diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/api.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/api.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..57ae67ad9b4f1da2c6cf201c3bf0fc5af6a6729a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/api.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/api.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/api.py new file mode 100644 index 0000000000000000000000000000000000000000..90ef985491da5350bad0735c6807836c29edc410 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/api.py @@ -0,0 +1,95 @@ +"""This module makes it possible to use mypy as part of a Python application. + +Since mypy still changes, the API was kept utterly simple and non-intrusive. +It just mimics command line activation without starting a new interpreter. +So the normal docs about the mypy command line apply. +Changes in the command line version of mypy will be immediately usable. + +Just import this module and then call the 'run' function with a parameter of +type List[str], containing what normally would have been the command line +arguments to mypy. + +Function 'run' returns a Tuple[str, str, int], namely +(, , ), +in which is what mypy normally writes to sys.stdout, + is what mypy normally writes to sys.stderr and exit_status is +the exit status mypy normally returns to the operating system. + +Any pretty formatting is left to the caller. + +The 'run_dmypy' function is similar, but instead mimics invocation of +dmypy. Note that run_dmypy is not thread-safe and modifies sys.stdout +and sys.stderr during its invocation. + +Note that these APIs don't support incremental generation of error +messages. + +Trivial example of code using this module: + +import sys +from mypy import api + +result = api.run(sys.argv[1:]) + +if result[0]: + print('\nType checking report:\n') + print(result[0]) # stdout + +if result[1]: + print('\nError report:\n') + print(result[1]) # stderr + +print('\nExit status:', result[2]) + +""" + +from __future__ import annotations + +import sys +from collections.abc import Callable +from io import StringIO +from typing import TextIO + + +def _run(main_wrapper: Callable[[TextIO, TextIO], None]) -> tuple[str, str, int]: + stdout = StringIO() + stderr = StringIO() + + try: + main_wrapper(stdout, stderr) + exit_status = 0 + except SystemExit as system_exit: + assert isinstance(system_exit.code, int) + exit_status = system_exit.code + + return stdout.getvalue(), stderr.getvalue(), exit_status + + +def run(args: list[str]) -> tuple[str, str, int]: + # Lazy import to avoid needing to import all of mypy to call run_dmypy + from mypy.main import main + + return _run( + lambda stdout, stderr: main(args=args, stdout=stdout, stderr=stderr, clean_exit=True) + ) + + +def run_dmypy(args: list[str]) -> tuple[str, str, int]: + from mypy.dmypy.client import main + + # A bunch of effort has been put into threading stdout and stderr + # through the main API to avoid the threadsafety problems of + # modifying sys.stdout/sys.stderr, but that hasn't been done for + # the dmypy client, so we just do the non-threadsafe thing. + def f(stdout: TextIO, stderr: TextIO) -> None: + old_stdout = sys.stdout + old_stderr = sys.stderr + try: + sys.stdout = stdout + sys.stderr = stderr + main(args) + finally: + sys.stdout = old_stdout + sys.stderr = old_stderr + + return _run(f) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/applytype.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/applytype.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..94f1e14be241008e4dfaba7c857d1b62e0432aba Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/applytype.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/applytype.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/applytype.py new file mode 100644 index 0000000000000000000000000000000000000000..c8003795ba0b1fd0197406cb7d72591e59cb3236 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/applytype.py @@ -0,0 +1,303 @@ +from __future__ import annotations + +from collections.abc import Callable, Iterable, Sequence + +import mypy.subtypes +from mypy.erasetype import erase_typevars +from mypy.expandtype import expand_type +from mypy.nodes import Context, TypeInfo +from mypy.type_visitor import TypeTranslator +from mypy.typeops import get_all_type_vars +from mypy.types import ( + AnyType, + CallableType, + Instance, + Parameters, + ParamSpecFlavor, + ParamSpecType, + PartialType, + ProperType, + Type, + TypeAliasType, + TypeVarId, + TypeVarLikeType, + TypeVarTupleType, + TypeVarType, + UninhabitedType, + UnpackType, + get_proper_type, + remove_dups, +) + + +def get_target_type( + tvar: TypeVarLikeType, + type: Type, + callable: CallableType, + report_incompatible_typevar_value: Callable[[CallableType, Type, str, Context], None], + context: Context, + skip_unsatisfied: bool, +) -> Type | None: + p_type = get_proper_type(type) + if isinstance(p_type, UninhabitedType) and tvar.has_default(): + return tvar.default + if isinstance(tvar, ParamSpecType): + return type + if isinstance(tvar, TypeVarTupleType): + return type + assert isinstance(tvar, TypeVarType) + values = tvar.values + if values: + if isinstance(p_type, AnyType): + return type + if isinstance(p_type, TypeVarType) and p_type.values: + # Allow substituting T1 for T if every allowed value of T1 + # is also a legal value of T. + if all(any(mypy.subtypes.is_same_type(v, v1) for v in values) for v1 in p_type.values): + return type + matching = [] + for value in values: + if mypy.subtypes.is_subtype(type, value): + matching.append(value) + if matching: + best = matching[0] + # If there are more than one matching value, we select the narrowest + for match in matching[1:]: + if mypy.subtypes.is_subtype(match, best): + best = match + return best + if skip_unsatisfied: + return None + report_incompatible_typevar_value(callable, type, tvar.name, context) + else: + upper_bound = tvar.upper_bound + if tvar.name == "Self": + # Internally constructed Self-types contain class type variables in upper bound, + # so we need to erase them to avoid false positives. This is safe because we do + # not support type variables in upper bounds of user defined types. + upper_bound = erase_typevars(upper_bound) + if not mypy.subtypes.is_subtype(type, upper_bound): + if skip_unsatisfied: + return None + report_incompatible_typevar_value(callable, type, tvar.name, context) + return type + + +def apply_generic_arguments( + callable: CallableType, + orig_types: Sequence[Type | None], + report_incompatible_typevar_value: Callable[[CallableType, Type, str, Context], None], + context: Context, + skip_unsatisfied: bool = False, +) -> CallableType: + """Apply generic type arguments to a callable type. + + For example, applying [int] to 'def [T] (T) -> T' results in + 'def (int) -> int'. + + Note that each type can be None; in this case, it will not be applied. + + If `skip_unsatisfied` is True, then just skip the types that don't satisfy type variable + bound or constraints, instead of giving an error. + """ + tvars = callable.variables + assert len(orig_types) <= len(tvars) + # Check that inferred type variable values are compatible with allowed + # values and bounds. Also, promote subtype values to allowed values. + # Create a map from type variable id to target type. + id_to_type: dict[TypeVarId, Type] = {} + + for tvar, type in zip(tvars, orig_types): + assert not isinstance(type, PartialType), "Internal error: must never apply partial type" + if type is None: + continue + + target_type = get_target_type( + tvar, type, callable, report_incompatible_typevar_value, context, skip_unsatisfied + ) + if target_type is not None: + id_to_type[tvar.id] = target_type + + # TODO: validate arg_kinds/arg_names for ParamSpec and TypeVarTuple replacements, + # not just type variable bounds above. + param_spec = callable.param_spec() + if param_spec is not None: + nt = id_to_type.get(param_spec.id) + if nt is not None: + # ParamSpec expansion is special-cased, so we need to always expand callable + # as a whole, not expanding arguments individually. + callable = expand_type(callable, id_to_type) + assert isinstance(callable, CallableType) + return callable.copy_modified( + variables=[tv for tv in tvars if tv.id not in id_to_type] + ) + + # Apply arguments to argument types. + var_arg = callable.var_arg() + if var_arg is not None and isinstance(var_arg.typ, UnpackType): + # Same as for ParamSpec, callable with variadic types needs to be expanded as a whole. + callable = expand_type(callable, id_to_type) + assert isinstance(callable, CallableType) + return callable.copy_modified(variables=[tv for tv in tvars if tv.id not in id_to_type]) + else: + callable = callable.copy_modified( + arg_types=[expand_type(at, id_to_type) for at in callable.arg_types] + ) + + # Apply arguments to TypeGuard and TypeIs if any. + if callable.type_guard is not None: + type_guard = expand_type(callable.type_guard, id_to_type) + else: + type_guard = None + if callable.type_is is not None: + type_is = expand_type(callable.type_is, id_to_type) + else: + type_is = None + + # The callable may retain some type vars if only some were applied. + # TODO: move apply_poly() logic here when new inference + # becomes universally used (i.e. in all passes + in unification). + # With this new logic we can actually *add* some new free variables. + remaining_tvars: list[TypeVarLikeType] = [] + for tv in tvars: + if tv.id in id_to_type: + continue + if not tv.has_default(): + remaining_tvars.append(tv) + continue + # TypeVarLike isn't in id_to_type mapping. + # Only expand the TypeVar default here. + typ = expand_type(tv, id_to_type) + assert isinstance(typ, TypeVarLikeType) + remaining_tvars.append(typ) + + return callable.copy_modified( + ret_type=expand_type(callable.ret_type, id_to_type), + variables=remaining_tvars, + type_guard=type_guard, + type_is=type_is, + ) + + +def apply_poly(tp: CallableType, poly_tvars: Sequence[TypeVarLikeType]) -> CallableType | None: + """Make free type variables generic in the type if possible. + + This will translate the type `tp` while trying to create valid bindings for + type variables `poly_tvars` while traversing the type. This follows the same rules + as we do during semantic analysis phase, examples: + * Callable[Callable[[T], T], T] -> def [T] (def (T) -> T) -> T + * Callable[[], Callable[[T], T]] -> def () -> def [T] (T -> T) + * List[T] -> None (not possible) + """ + try: + return tp.copy_modified( + arg_types=[t.accept(PolyTranslator(poly_tvars)) for t in tp.arg_types], + ret_type=tp.ret_type.accept(PolyTranslator(poly_tvars)), + variables=[], + ) + except PolyTranslationError: + return None + + +class PolyTranslationError(Exception): + pass + + +class PolyTranslator(TypeTranslator): + """Make free type variables generic in the type if possible. + + See docstring for apply_poly() for details. + """ + + def __init__( + self, + poly_tvars: Iterable[TypeVarLikeType], + bound_tvars: frozenset[TypeVarLikeType] = frozenset(), + seen_aliases: frozenset[TypeInfo] = frozenset(), + ) -> None: + super().__init__() + self.poly_tvars = set(poly_tvars) + # This is a simplified version of TypeVarScope used during semantic analysis. + self.bound_tvars = bound_tvars + self.seen_aliases = seen_aliases + + def collect_vars(self, t: CallableType | Parameters) -> list[TypeVarLikeType]: + found_vars = [] + for arg in t.arg_types: + for tv in get_all_type_vars(arg): + if isinstance(tv, ParamSpecType): + normalized: TypeVarLikeType = tv.copy_modified( + flavor=ParamSpecFlavor.BARE, prefix=Parameters([], [], []) + ) + else: + normalized = tv + if normalized in self.poly_tvars and normalized not in self.bound_tvars: + found_vars.append(normalized) + return remove_dups(found_vars) + + def visit_callable_type(self, t: CallableType) -> Type: + found_vars = self.collect_vars(t) + self.bound_tvars |= set(found_vars) + result = super().visit_callable_type(t) + self.bound_tvars -= set(found_vars) + + assert isinstance(result, ProperType) and isinstance(result, CallableType) + result.variables = result.variables + tuple(found_vars) + return result + + def visit_type_var(self, t: TypeVarType) -> Type: + if t in self.poly_tvars and t not in self.bound_tvars: + raise PolyTranslationError() + return super().visit_type_var(t) + + def visit_param_spec(self, t: ParamSpecType) -> Type: + if t in self.poly_tvars and t not in self.bound_tvars: + raise PolyTranslationError() + return super().visit_param_spec(t) + + def visit_type_var_tuple(self, t: TypeVarTupleType) -> Type: + if t in self.poly_tvars and t not in self.bound_tvars: + raise PolyTranslationError() + return super().visit_type_var_tuple(t) + + def visit_type_alias_type(self, t: TypeAliasType) -> Type: + if not t.args: + return t.copy_modified() + if not t.is_recursive: + return get_proper_type(t).accept(self) + # We can't handle polymorphic application for recursive generic aliases + # without risking an infinite recursion, just give up for now. + raise PolyTranslationError() + + def visit_instance(self, t: Instance) -> Type: + if t.type.has_param_spec_type: + # We need this special-casing to preserve the possibility to store a + # generic function in an instance type. Things like + # forall T . Foo[[x: T], T] + # are not really expressible in current type system, but this looks like + # a useful feature, so let's keep it. + param_spec_index = next( + i for (i, tv) in enumerate(t.type.defn.type_vars) if isinstance(tv, ParamSpecType) + ) + p = get_proper_type(t.args[param_spec_index]) + if isinstance(p, Parameters): + found_vars = self.collect_vars(p) + self.bound_tvars |= set(found_vars) + new_args = [a.accept(self) for a in t.args] + self.bound_tvars -= set(found_vars) + + repl = new_args[param_spec_index] + assert isinstance(repl, ProperType) and isinstance(repl, Parameters) + repl.variables = list(repl.variables) + list(found_vars) + return t.copy_modified(args=new_args) + # There is the same problem with callback protocols as with aliases + # (callback protocols are essentially more flexible aliases to callables). + if t.args and t.type.is_protocol and t.type.protocol_members == ["__call__"]: + if t.type in self.seen_aliases: + raise PolyTranslationError() + call = mypy.subtypes.find_member("__call__", t, t, is_operator=True) + assert call is not None + return call.accept( + PolyTranslator(self.poly_tvars, self.bound_tvars, self.seen_aliases | {t.type}) + ) + return super().visit_instance(t) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/argmap.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/argmap.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..53950323e73cd109fff466dc447246a45a184638 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/argmap.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/argmap.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/argmap.py new file mode 100644 index 0000000000000000000000000000000000000000..c30f6bd43f13fce35148c320fba0ca6f040ba4d1 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/argmap.py @@ -0,0 +1,269 @@ +"""Utilities for mapping between actual and formal arguments (and their types).""" + +from __future__ import annotations + +from collections.abc import Callable, Sequence +from typing import TYPE_CHECKING + +from mypy import nodes +from mypy.maptype import map_instance_to_supertype +from mypy.types import ( + AnyType, + Instance, + ParamSpecType, + TupleType, + Type, + TypedDictType, + TypeOfAny, + TypeVarTupleType, + UnpackType, + get_proper_type, +) + +if TYPE_CHECKING: + from mypy.infer import ArgumentInferContext + + +def map_actuals_to_formals( + actual_kinds: list[nodes.ArgKind], + actual_names: Sequence[str | None] | None, + formal_kinds: list[nodes.ArgKind], + formal_names: Sequence[str | None], + actual_arg_type: Callable[[int], Type], +) -> list[list[int]]: + """Calculate mapping between actual (caller) args and formals. + + The result contains a list of caller argument indexes mapping to each + callee argument index, indexed by callee index. + + The actual_arg_type argument should evaluate to the type of the actual + argument with the given index. + """ + nformals = len(formal_kinds) + formal_to_actual: list[list[int]] = [[] for i in range(nformals)] + ambiguous_actual_kwargs: list[int] = [] + fi = 0 + for ai, actual_kind in enumerate(actual_kinds): + if actual_kind == nodes.ARG_POS: + if fi < nformals: + if not formal_kinds[fi].is_star(): + formal_to_actual[fi].append(ai) + fi += 1 + elif formal_kinds[fi] == nodes.ARG_STAR: + formal_to_actual[fi].append(ai) + elif actual_kind == nodes.ARG_STAR: + # We need to know the actual type to map varargs. + actualt = get_proper_type(actual_arg_type(ai)) + if isinstance(actualt, TupleType): + # A tuple actual maps to a fixed number of formals. + for _ in range(len(actualt.items)): + if fi < nformals: + if formal_kinds[fi] != nodes.ARG_STAR2: + formal_to_actual[fi].append(ai) + else: + break + if formal_kinds[fi] != nodes.ARG_STAR: + fi += 1 + else: + # Assume that it is an iterable (if it isn't, there will be + # an error later). + while fi < nformals: + if formal_kinds[fi].is_named(star=True): + break + else: + formal_to_actual[fi].append(ai) + if formal_kinds[fi] == nodes.ARG_STAR: + break + fi += 1 + elif actual_kind.is_named(): + assert actual_names is not None, "Internal error: named kinds without names given" + name = actual_names[ai] + if name in formal_names and formal_kinds[formal_names.index(name)] != nodes.ARG_STAR: + formal_to_actual[formal_names.index(name)].append(ai) + elif nodes.ARG_STAR2 in formal_kinds: + formal_to_actual[formal_kinds.index(nodes.ARG_STAR2)].append(ai) + else: + assert actual_kind == nodes.ARG_STAR2 + actualt = get_proper_type(actual_arg_type(ai)) + if isinstance(actualt, TypedDictType): + for name in actualt.items: + if name in formal_names: + formal_to_actual[formal_names.index(name)].append(ai) + elif nodes.ARG_STAR2 in formal_kinds: + formal_to_actual[formal_kinds.index(nodes.ARG_STAR2)].append(ai) + else: + # We don't exactly know which **kwargs are provided by the + # caller, so we'll defer until all the other unambiguous + # actuals have been processed + ambiguous_actual_kwargs.append(ai) + + if ambiguous_actual_kwargs: + # Assume the ambiguous kwargs will fill the remaining arguments. + # + # TODO: If there are also tuple varargs, we might be missing some potential + # matches if the tuple was short enough to not match everything. + unmatched_formals = [ + fi + for fi in range(nformals) + if ( + formal_names[fi] + and ( + not formal_to_actual[fi] + or actual_kinds[formal_to_actual[fi][0]] == nodes.ARG_STAR + ) + and formal_kinds[fi] != nodes.ARG_STAR + ) + or formal_kinds[fi] == nodes.ARG_STAR2 + ] + for ai in ambiguous_actual_kwargs: + for fi in unmatched_formals: + formal_to_actual[fi].append(ai) + + return formal_to_actual + + +def map_formals_to_actuals( + actual_kinds: list[nodes.ArgKind], + actual_names: Sequence[str | None] | None, + formal_kinds: list[nodes.ArgKind], + formal_names: list[str | None], + actual_arg_type: Callable[[int], Type], +) -> list[list[int]]: + """Calculate the reverse mapping of map_actuals_to_formals.""" + formal_to_actual = map_actuals_to_formals( + actual_kinds, actual_names, formal_kinds, formal_names, actual_arg_type + ) + # Now reverse the mapping. + actual_to_formal: list[list[int]] = [[] for _ in actual_kinds] + for formal, actuals in enumerate(formal_to_actual): + for actual in actuals: + actual_to_formal[actual].append(formal) + return actual_to_formal + + +class ArgTypeExpander: + """Utility class for mapping actual argument types to formal arguments. + + One of the main responsibilities is to expand caller tuple *args and TypedDict + **kwargs, and to keep track of which tuple/TypedDict items have already been + consumed. + + Example: + + def f(x: int, *args: str) -> None: ... + f(*(1, 'x', 1.1)) + + We'd call expand_actual_type three times: + + 1. The first call would provide 'int' as the actual type of 'x' (from '1'). + 2. The second call would provide 'str' as one of the actual types for '*args'. + 2. The third call would provide 'float' as one of the actual types for '*args'. + + A single instance can process all the arguments for a single call. Each call + needs a separate instance since instances have per-call state. + """ + + def __init__(self, context: ArgumentInferContext) -> None: + # Next tuple *args index to use. + self.tuple_index = 0 + # Keyword arguments in TypedDict **kwargs used. + self.kwargs_used: set[str] | None = None + # Type context for `*` and `**` arg kinds. + self.context = context + + def expand_actual_type( + self, + actual_type: Type, + actual_kind: nodes.ArgKind, + formal_name: str | None, + formal_kind: nodes.ArgKind, + allow_unpack: bool = False, + ) -> Type: + """Return the actual (caller) type(s) of a formal argument with the given kinds. + + If the actual argument is a tuple *args, return the next individual tuple item that + maps to the formal arg. + + If the actual argument is a TypedDict **kwargs, return the next matching typed dict + value type based on formal argument name and kind. + + This is supposed to be called for each formal, in order. Call multiple times per + formal if multiple actuals map to a formal. + """ + original_actual = actual_type + actual_type = get_proper_type(actual_type) + if actual_kind == nodes.ARG_STAR: + if isinstance(actual_type, TypeVarTupleType): + # This code path is hit when *Ts is passed to a callable and various + # special-handling didn't catch this. The best thing we can do is to use + # the upper bound. + actual_type = get_proper_type(actual_type.upper_bound) + if isinstance(actual_type, Instance) and actual_type.args: + from mypy.subtypes import is_subtype + + if is_subtype(actual_type, self.context.iterable_type): + return map_instance_to_supertype( + actual_type, self.context.iterable_type.type + ).args[0] + else: + # We cannot properly unpack anything other + # than `Iterable` type with `*`. + # Just return `Any`, other parts of code would raise + # a different error for improper use. + return AnyType(TypeOfAny.from_error) + elif isinstance(actual_type, TupleType): + # Get the next tuple item of a tuple *arg. + if self.tuple_index >= len(actual_type.items): + # Exhausted a tuple -- continue to the next *args. + self.tuple_index = 1 + else: + self.tuple_index += 1 + item = actual_type.items[self.tuple_index - 1] + if isinstance(item, UnpackType) and not allow_unpack: + # An unpack item that doesn't have special handling, use upper bound as above. + unpacked = get_proper_type(item.type) + if isinstance(unpacked, TypeVarTupleType): + fallback = get_proper_type(unpacked.upper_bound) + else: + fallback = unpacked + assert ( + isinstance(fallback, Instance) + and fallback.type.fullname == "builtins.tuple" + ) + item = fallback.args[0] + return item + elif isinstance(actual_type, ParamSpecType): + # ParamSpec is valid in *args but it can't be unpacked. + return actual_type + else: + return AnyType(TypeOfAny.from_error) + elif actual_kind == nodes.ARG_STAR2: + from mypy.subtypes import is_subtype + + if isinstance(actual_type, TypedDictType): + if self.kwargs_used is None: + self.kwargs_used = set() + if formal_kind != nodes.ARG_STAR2 and formal_name in actual_type.items: + # Lookup type based on keyword argument name. + assert formal_name is not None + else: + # Pick an arbitrary item if no specified keyword is expected. + formal_name = (set(actual_type.items.keys()) - self.kwargs_used).pop() + self.kwargs_used.add(formal_name) + return actual_type.items[formal_name] + elif isinstance(actual_type, Instance) and is_subtype( + actual_type, self.context.mapping_type + ): + # Only `Mapping` type can be unpacked with `**`. + # Other types will produce an error somewhere else. + return map_instance_to_supertype(actual_type, self.context.mapping_type.type).args[ + 1 + ] + elif isinstance(actual_type, ParamSpecType): + # ParamSpec is valid in **kwargs but it can't be unpacked. + return actual_type + else: + return AnyType(TypeOfAny.from_error) + else: + # No translation for other kinds -- 1:1 mapping. + return original_actual diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/binder.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/binder.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..07036a9fa81ce672f96cb2e844c3f5e7fe77f770 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/binder.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/binder.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/binder.py new file mode 100644 index 0000000000000000000000000000000000000000..adcc812badc914c6fb91adfff28a4fd6e4143b3e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/binder.py @@ -0,0 +1,709 @@ +from __future__ import annotations + +from collections import defaultdict +from collections.abc import Iterator +from contextlib import contextmanager +from typing import Literal, NamedTuple, TypeAlias as _TypeAlias + +from mypy.erasetype import remove_instance_last_known_values +from mypy.literals import Key, extract_var_from_literal_hash, literal, literal_hash, subkeys +from mypy.nodes import ( + LITERAL_NO, + Expression, + IndexExpr, + MemberExpr, + NameExpr, + RefExpr, + TypeInfo, + Var, +) +from mypy.options import Options +from mypy.subtypes import is_same_type, is_subtype +from mypy.typeops import make_simplified_union +from mypy.types import ( + AnyType, + Instance, + NoneType, + PartialType, + ProperType, + TupleType, + Type, + TypeOfAny, + TypeType, + TypeVarType, + UnionType, + UnpackType, + find_unpack_in_list, + flatten_nested_unions, + get_proper_type, +) +from mypy.typevars import fill_typevars_with_any + +BindableExpression: _TypeAlias = IndexExpr | MemberExpr | NameExpr + + +class CurrentType(NamedTuple): + type: Type + from_assignment: bool + + +class Frame: + """A Frame represents a specific point in the execution of a program. + + It carries information about the current types of expressions at + that point, arising either from assignments to those expressions + or the result of isinstance checks and other type narrowing + operations. It also records whether it is possible to reach that + point at all. + + We add a new frame wherenever there is a new scope or control flow + branching. + + This information is not copied into a new Frame when it is pushed + onto the stack, so a given Frame only has information about types + that were assigned in that frame. + + Expressions are stored in dicts using 'literal hashes' as keys (type + "Key"). These are hashable values derived from expression AST nodes + (only those that can be narrowed). literal_hash(expr) is used to + calculate the hashes. Note that this isn't directly related to literal + types -- the concept predates literal types. + """ + + def __init__(self, id: int, conditional_frame: bool = False) -> None: + self.id = id + self.types: dict[Key, CurrentType] = {} + self.unreachable = False + self.conditional_frame = conditional_frame + self.suppress_unreachable_warnings = False + + def __repr__(self) -> str: + return f"Frame({self.id}, {self.types}, {self.unreachable}, {self.conditional_frame})" + + +Assigns = defaultdict[Expression, list[tuple[Type, Type | None]]] + + +class FrameContext: + """Context manager pushing a Frame to ConditionalTypeBinder. + + See frame_context() below for documentation on parameters. We use this class + instead of @contextmanager as a mypyc-specific performance optimization. + """ + + def __init__( + self, + binder: ConditionalTypeBinder, + can_skip: bool, + fall_through: int, + break_frame: int, + continue_frame: int, + conditional_frame: bool, + try_frame: bool, + discard: bool, + ) -> None: + self.binder = binder + self.can_skip = can_skip + self.fall_through = fall_through + self.break_frame = break_frame + self.continue_frame = continue_frame + self.conditional_frame = conditional_frame + self.try_frame = try_frame + self.discard = discard + + def __enter__(self) -> Frame: + assert len(self.binder.frames) > 1 + + if self.break_frame: + self.binder.break_frames.append(len(self.binder.frames) - self.break_frame) + if self.continue_frame: + self.binder.continue_frames.append(len(self.binder.frames) - self.continue_frame) + if self.try_frame: + self.binder.try_frames.add(len(self.binder.frames) - 1) + + new_frame = self.binder.push_frame(self.conditional_frame) + if self.try_frame: + # An exception may occur immediately + self.binder.allow_jump(-1) + return new_frame + + def __exit__(self, exc_type: object, exc_val: object, exc_tb: object) -> Literal[False]: + self.binder.pop_frame(self.can_skip, self.fall_through, discard=self.discard) + + if self.break_frame: + self.binder.break_frames.pop() + if self.continue_frame: + self.binder.continue_frames.pop() + if self.try_frame: + self.binder.try_frames.remove(len(self.binder.frames) - 1) + return False + + +class ConditionalTypeBinder: + """Keep track of conditional types of variables. + + NB: Variables are tracked by literal hashes of expressions, so it is + possible to confuse the binder when there is aliasing. Example: + + class A: + a: int | str + + x = A() + lst = [x] + reveal_type(x.a) # int | str + x.a = 1 + reveal_type(x.a) # int + reveal_type(lst[0].a) # int | str + lst[0].a = 'a' + reveal_type(x.a) # int + reveal_type(lst[0].a) # str + """ + + # Stored assignments for situations with tuple/list lvalue and rvalue of union type. + # This maps an expression to a list of bound types for every item in the union type. + type_assignments: Assigns | None = None + + def __init__(self, options: Options) -> None: + # Each frame gets an increasing, distinct id. + self.next_id = 1 + + # The stack of frames currently used. These map + # literal_hash(expr) -- literals like 'foo.bar' -- + # to types. The last element of this list is the + # top-most, current frame. Each earlier element + # records the state as of when that frame was last + # on top of the stack. + self.frames = [Frame(self._get_id())] + + # For frames higher in the stack, we record the set of + # Frames that can escape there, either by falling off + # the end of the frame or by a loop control construct + # or raised exception. The last element of self.frames + # has no corresponding element in this list. + self.options_on_return: list[list[Frame]] = [] + + # Maps literal_hash(expr) to get_declaration(expr) + # for every expr stored in the binder + self.declarations: dict[Key, Type | None] = {} + # Set of other keys to invalidate if a key is changed, e.g. x -> {x.a, x[0]} + # Whenever a new key (e.g. x.a.b) is added, we update this + self.dependencies: dict[Key, set[Key]] = {} + + # Whether the last pop changed the newly top frame on exit + self.last_pop_changed = False + + # These are used to track control flow in try statements and loops. + self.try_frames: set[int] = set() + self.break_frames: list[int] = [] + self.continue_frames: list[int] = [] + + # If True, initial assignment to a simple variable (e.g. "x", but not "x.y") + # is added to the binder. This allows more precise narrowing and more + # flexible inference of variable types (--allow-redefinition-new). + self.bind_all = options.allow_redefinition_new + + # This tracks any externally visible changes in binder to invalidate + # expression caches when needed. + self.version = 0 + + def _get_id(self) -> int: + self.next_id += 1 + return self.next_id + + def _add_dependencies(self, key: Key, value: Key | None = None) -> None: + if value is None: + value = key + else: + self.dependencies.setdefault(key, set()).add(value) + for elt in subkeys(key): + self._add_dependencies(elt, value) + + def push_frame(self, conditional_frame: bool = False) -> Frame: + """Push a new frame into the binder.""" + f = Frame(self._get_id(), conditional_frame) + self.frames.append(f) + self.options_on_return.append([]) + return f + + def _put(self, key: Key, type: Type, from_assignment: bool, index: int = -1) -> None: + self.version += 1 + self.frames[index].types[key] = CurrentType(type, from_assignment) + + def _get(self, key: Key, index: int = -1) -> CurrentType | None: + if index < 0: + index += len(self.frames) + for i in range(index, -1, -1): + if key in self.frames[i].types: + return self.frames[i].types[key] + return None + + @classmethod + def can_put_directly(cls, expr: Expression) -> bool: + """Will `.put()` on this expression be successful? + + This is inlined in `.put()` because the logic is rather hot and must be kept + in sync. + """ + return isinstance(expr, (IndexExpr, MemberExpr, NameExpr)) and literal(expr) > LITERAL_NO + + def put(self, expr: Expression, typ: Type, *, from_assignment: bool = True) -> None: + """Directly set the narrowed type of expression (if it supports it). + + This is used for isinstance() etc. Assignments should go through assign_type(). + """ + if not isinstance(expr, (IndexExpr, MemberExpr, NameExpr)): + return + if not literal(expr): + return + key = literal_hash(expr) + assert key is not None, "Internal error: binder tried to put non-literal" + if key not in self.declarations: + self.declarations[key] = get_declaration(expr) + self._add_dependencies(key) + self._put(key, typ, from_assignment) + + def unreachable(self) -> None: + self.version += 1 + self.frames[-1].unreachable = True + + def suppress_unreachable_warnings(self) -> None: + self.frames[-1].suppress_unreachable_warnings = True + + def get(self, expr: Expression) -> Type | None: + key = literal_hash(expr) + assert key is not None, "Internal error: binder tried to get non-literal" + found = self._get(key) + if found is None: + return None + return found.type + + def is_unreachable(self) -> bool: + # TODO: Copy the value of unreachable into new frames to avoid + # this traversal on every statement? + return any(f.unreachable for f in self.frames) + + def is_unreachable_warning_suppressed(self) -> bool: + return any(f.suppress_unreachable_warnings for f in self.frames) + + def cleanse(self, expr: Expression) -> None: + """Remove all references to a Node from the binder.""" + key = literal_hash(expr) + assert key is not None, "Internal error: binder tried cleanse non-literal" + self._cleanse_key(key) + + def _cleanse_key(self, key: Key) -> None: + """Remove all references to a key from the binder.""" + for frame in self.frames: + if key in frame.types: + del frame.types[key] + + def update_from_options(self, frames: list[Frame]) -> bool: + """Update the frame to reflect that each key will be updated + as in one of the frames. Return whether any item changes. + + If a key is declared as AnyType, only update it if all the + options are the same. + """ + all_reachable = all(not f.unreachable for f in frames) + if not all_reachable: + frames = [f for f in frames if not f.unreachable] + changed = False + keys = [key for f in frames for key in f.types] + if len(keys) > 1: + keys = list(set(keys)) + for key in keys: + current_value = self._get(key) + resulting_values = [f.types.get(key, current_value) for f in frames] + # Keys can be narrowed using two different semantics. The new semantics + # is enabled for inferred variables when bind_all is true, and it allows + # variable types to be widened using subsequent assignments. This is + # not allowed for instance attributes and annotated variables. + var = extract_var_from_literal_hash(key) + old_semantics = ( + not self.bind_all or var is None or not var.is_inferred and not var.is_argument + ) + if old_semantics and any(x is None for x in resulting_values): + # We didn't know anything about key before + # (current_value must be None), and we still don't + # know anything about key in at least one possible frame. + continue + + resulting_values = [x for x in resulting_values if x is not None] + + if all_reachable and all(not x.from_assignment for x in resulting_values): + # Do not synthesize a new type if we encountered a conditional block + # (if, while or match-case) without assignments. + # See check-isinstance.test::testNoneCheckDoesNotMakeTypeVarOptional + # This is a safe assumption: the fact that we checked something with `is` + # or `isinstance` does not change the type of the value. + continue + + # Remove exact duplicates to save pointless work later, this is + # a micro-optimization for --allow-redefinition-new. + seen_types = set() + resulting_types = [] + for rv in resulting_values: + assert rv is not None + if rv.type in seen_types: + continue + resulting_types.append(rv.type) + seen_types.add(rv.type) + + type = resulting_types[0] + declaration_type = get_proper_type(self.declarations.get(key)) + if isinstance(declaration_type, AnyType): + # At this point resulting values can't contain None, see continue above + if not all(is_same_type(type, t) for t in resulting_types[1:]): + type = AnyType(TypeOfAny.from_another_any, source_any=declaration_type) + else: + possible_types = [] + for t in resulting_types: + assert t is not None + possible_types.append(t) + if len(possible_types) == 1: + # This is to avoid calling get_proper_type() unless needed, as this may + # interfere with our (hacky) TypeGuard support. + type = possible_types[0] + else: + type = make_simplified_union(possible_types) + # Legacy guard for corner case when the original type is TypeVarType. + if isinstance(declaration_type, TypeVarType) and not is_subtype( + type, declaration_type + ): + type = declaration_type + # Try simplifying resulting type for unions involving variadic tuples. + # Technically, everything is still valid without this step, but if we do + # not do this, this may create long unions after exiting an if check like: + # x: tuple[int, ...] + # if len(x) < 10: + # ... + # We want the type of x to be tuple[int, ...] after this block (if it is + # still equivalent to such type). + if isinstance(type, UnionType): + type = collapse_variadic_union(type) + if ( + old_semantics + and isinstance(type, ProperType) + and isinstance(type, UnionType) + ): + # Simplify away any extra Any's that were added to the declared + # type when popping a frame. + simplified = UnionType.make_union( + [t for t in type.items if not isinstance(get_proper_type(t), AnyType)] + ) + if simplified == self.declarations[key]: + type = simplified + if ( + current_value is None + or not is_same_type(type, current_value.type) + # Manually carry over any narrowing from hasattr() from inner frames. This is + # a bit ad-hoc, but our handling of hasattr() is on best effort basis anyway. + or isinstance(p_type := get_proper_type(type), Instance) + and p_type.extra_attrs + ): + self._put(key, type, from_assignment=True) + if current_value is not None or extract_var_from_literal_hash(key) is None: + # We definitely learned something new + changed = True + elif not changed: + # If there is no current value compare with the declaration. This prevents + # reporting false changes in cases like this: + # x: int + # if foo(): + # x = 1 + # else: + # x = 2 + # We check partial types and widening in accept_loop() separately, so + # this should be safe. + changed = declaration_type is not None and not is_same_type( + type, declaration_type + ) + + self.frames[-1].unreachable = not frames + + return changed + + def pop_frame(self, can_skip: bool, fall_through: int, *, discard: bool = False) -> Frame: + """Pop a frame and return it. + + See frame_context() for documentation of fall_through and discard. + """ + + if fall_through > 0: + self.allow_jump(-fall_through) + + result = self.frames.pop() + options = self.options_on_return.pop() + + if discard: + self.last_pop_changed = False + return result + + if can_skip: + options.insert(0, self.frames[-1]) + + self.last_pop_changed = self.update_from_options(options) + + return result + + @contextmanager + def accumulate_type_assignments(self) -> Iterator[Assigns]: + """Push a new map to collect assigned types in multiassign from union. + + If this map is not None, actual binding is deferred until all items in + the union are processed (a union of collected items is later bound + manually by the caller). + """ + old_assignments = None + if self.type_assignments is not None: + old_assignments = self.type_assignments + self.type_assignments = defaultdict(list) + yield self.type_assignments + self.type_assignments = old_assignments + + def assign_type(self, expr: Expression, type: Type, declared_type: Type | None) -> None: + """Narrow type of expression through an assignment. + + Do nothing if the expression doesn't support narrowing. + + When not narrowing though an assignment (isinstance() etc.), use put() + directly. This omits some special-casing logic for assignments. + """ + # We should erase last known value in binder, because if we are using it, + # it means that the target is not final, and therefore can't hold a literal. + type = remove_instance_last_known_values(type) + + if self.type_assignments is not None: + # We are in a multiassign from union, defer the actual binding, + # just collect the types. + self.type_assignments[expr].append((type, declared_type)) + return + if not isinstance(expr, (IndexExpr, MemberExpr, NameExpr)): + return + if not literal(expr): + return + self.invalidate_dependencies(expr) + + if declared_type is None: + # Not sure why this happens. It seems to mainly happen in + # member initialization. + return + if not is_subtype(type, declared_type): + # Pretty sure this is only happens when there's a type error. + + # Ideally this function wouldn't be called if the + # expression has a type error, though -- do other kinds of + # errors cause this function to get called at invalid + # times? + return + + p_declared = get_proper_type(declared_type) + p_type = get_proper_type(type) + if isinstance(p_type, AnyType): + # Any type requires some special casing, for both historical reasons, + # and to optimise user experience without sacrificing correctness too much. + if isinstance(expr, RefExpr) and isinstance(expr.node, Var) and expr.node.is_inferred: + # First case: a local/global variable without explicit annotation, + # in this case we just assign Any (essentially following the SSA logic). + self.put(expr, type) + elif isinstance(p_declared, UnionType): + all_items = flatten_nested_unions(p_declared.items) + if any(isinstance(get_proper_type(item), NoneType) for item in all_items): + # Second case: explicit optional type, in this case we optimize for + # a common pattern when an untyped value used as a fallback replacing None. + new_items = [ + type if isinstance(get_proper_type(item), NoneType) else item + for item in all_items + ] + self.put(expr, UnionType(new_items)) + elif any(isinstance(get_proper_type(item), AnyType) for item in all_items): + # Third case: a union already containing Any (most likely from + # an un-imported name), in this case we allow assigning Any as well. + self.put(expr, type) + else: + # In all other cases we don't narrow to Any to minimize false negatives. + self.put(expr, declared_type) + else: + self.put(expr, declared_type) + elif isinstance(p_declared, AnyType): + # Mirroring the first case above, we don't narrow to a precise type if the variable + # has an explicit `Any` type annotation. + if isinstance(expr, RefExpr) and isinstance(expr.node, Var) and expr.node.is_inferred: + self.put(expr, type) + else: + self.put(expr, declared_type) + else: + self.put(expr, type) + + for i in self.try_frames: + # XXX This should probably not copy the entire frame, but + # just copy this variable into a single stored frame. + self.allow_jump(i) + + def invalidate_dependencies(self, expr: BindableExpression) -> None: + """Invalidate knowledge of types that include expr, but not expr itself. + + For example, when expr is foo.bar, invalidate foo.bar.baz. + + It is overly conservative: it invalidates globally, including + in code paths unreachable from here. + """ + key = literal_hash(expr) + assert key is not None + for dep in self.dependencies.get(key, set()): + self._cleanse_key(dep) + + def allow_jump(self, index: int) -> None: + # self.frames and self.options_on_return have different lengths + # so make sure the index is positive + if index < 0: + index += len(self.options_on_return) + frame = Frame(self._get_id()) + for f in self.frames[index + 1 :]: + frame.types.update(f.types) + if f.unreachable: + frame.unreachable = True + self.options_on_return[index].append(frame) + + def handle_break(self) -> None: + self.allow_jump(self.break_frames[-1]) + self.unreachable() + + def handle_continue(self) -> None: + self.allow_jump(self.continue_frames[-1]) + self.unreachable() + + def frame_context( + self, + *, + can_skip: bool, + fall_through: int = 1, + break_frame: int = 0, + continue_frame: int = 0, + conditional_frame: bool = False, + try_frame: bool = False, + discard: bool = False, + ) -> FrameContext: + """Return a context manager that pushes/pops frames on enter/exit. + + If can_skip is True, control flow is allowed to bypass the + newly-created frame. + + If fall_through > 0, then it will allow control flow that + falls off the end of the frame to escape to its ancestor + `fall_through` levels higher. Otherwise, control flow ends + at the end of the frame. + + If break_frame > 0, then 'break' statements within this frame + will jump out to the frame break_frame levels higher than the + frame created by this call to frame_context. Similarly, for + continue_frame and 'continue' statements. + + If try_frame is true, then execution is allowed to jump at any + point within the newly created frame (or its descendants) to + its parent (i.e., to the frame that was on top before this + call to frame_context). + + If discard is True, then this is a temporary throw-away frame + (used e.g. for isolation) and its effect will be discarded on pop. + + After the context manager exits, self.last_pop_changed indicates + whether any types changed in the newly-topmost frame as a result + of popping this frame. + """ + return FrameContext( + self, + can_skip=can_skip, + fall_through=fall_through, + break_frame=break_frame, + continue_frame=continue_frame, + conditional_frame=conditional_frame, + try_frame=try_frame, + discard=discard, + ) + + @contextmanager + def top_frame_context(self) -> Iterator[Frame]: + """A variant of frame_context for use at the top level of + a namespace (module, function, or class). + """ + assert len(self.frames) == 1 + yield self.push_frame() + self.pop_frame(True, 0) + assert len(self.frames) == 1 + + +def get_declaration(expr: BindableExpression) -> Type | None: + """Get the declared or inferred type of a RefExpr expression. + + Return None if there is no type or the expression is not a RefExpr. + This can return None if the type hasn't been inferred yet. + """ + if isinstance(expr, RefExpr): + if isinstance(expr.node, Var): + type = expr.node.type + if not isinstance(get_proper_type(type), PartialType): + return type + elif isinstance(expr.node, TypeInfo): + return TypeType(fill_typevars_with_any(expr.node)) + return None + + +def collapse_variadic_union(typ: UnionType) -> Type: + """Simplify a union involving variadic tuple if possible. + + This will collapse a type like e.g. + tuple[X, Z] | tuple[X, Y, Z] | tuple[X, Y, Y, *tuple[Y, ...], Z] + back to + tuple[X, *tuple[Y, ...], Z] + which is equivalent, but much simpler form of the same type. + """ + tuple_items = [] + other_items = [] + for t in typ.items: + p_t = get_proper_type(t) + if isinstance(p_t, TupleType): + tuple_items.append(p_t) + else: + other_items.append(t) + if len(tuple_items) <= 1: + # This type cannot be simplified further. + return typ + tuple_items = sorted(tuple_items, key=lambda t: len(t.items)) + first = tuple_items[0] + last = tuple_items[-1] + unpack_index = find_unpack_in_list(last.items) + if unpack_index is None: + return typ + unpack = last.items[unpack_index] + assert isinstance(unpack, UnpackType) + unpacked = get_proper_type(unpack.type) + if not isinstance(unpacked, Instance): + return typ + assert unpacked.type.fullname == "builtins.tuple" + suffix = last.items[unpack_index + 1 :] + + # Check that first item matches the expected pattern and infer prefix. + if len(first.items) < len(suffix): + return typ + if suffix and first.items[-len(suffix) :] != suffix: + return typ + if suffix: + prefix = first.items[: -len(suffix)] + else: + prefix = first.items + + # Check that all middle types match the expected pattern as well. + arg = unpacked.args[0] + for i, it in enumerate(tuple_items[1:-1]): + if it.items != prefix + [arg] * (i + 1) + suffix: + return typ + + # Check the last item (the one with unpack), and choose an appropriate simplified type. + if last.items != prefix + [arg] * (len(typ.items) - 1) + [unpack] + suffix: + return typ + if len(first.items) == 0: + simplified: Type = unpacked.copy_modified() + else: + simplified = TupleType(prefix + [unpack] + suffix, fallback=last.partial_fallback) + return UnionType.make_union([simplified] + other_items) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/bogus_type.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/bogus_type.py new file mode 100644 index 0000000000000000000000000000000000000000..1a61abac9732d1eab673061c10d8118c34281b28 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/bogus_type.py @@ -0,0 +1,27 @@ +"""A Bogus[T] type alias for marking when we subvert the type system + +We need this for compiling with mypyc, which inserts runtime +typechecks that cause problems when we subvert the type system. So +when compiling with mypyc, we turn those places into Any, while +keeping the types around for normal typechecks. + +Since this causes the runtime types to be Any, this is best used +in places where efficient access to properties is not important. +For those cases some other technique should be used. +""" + +from __future__ import annotations + +from typing import Any, TypeVar + +from mypy_extensions import FlexibleAlias + +T = TypeVar("T") + +# This won't ever be true at runtime, but we consider it true during +# mypyc compilations. +MYPYC = False +if MYPYC: + Bogus = FlexibleAlias[T, Any] +else: + Bogus = FlexibleAlias[T, T] diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/build.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/build.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..669fd9bf60066f1106da1fa9d384b9bac228c0bc Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/build.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/build.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/build.py new file mode 100644 index 0000000000000000000000000000000000000000..1f83cee536e827c69bcf0378d65ded049548cb10 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/build.py @@ -0,0 +1,4796 @@ +"""Facilities to analyze entire programs, including imported modules. + +Parse and analyze the source files of a program in the correct order +(based on file dependencies), and collect the results. + +This module only directs a build, which is performed in multiple passes per +file. The individual passes are implemented in separate modules. + +The function build() is the main interface to this module. +""" + +# TODO: More consistent terminology, e.g. path/fnam, module/id, state/file + +from __future__ import annotations + +import collections +import contextlib +import gc +import json +import os +import pickle +import platform +import re +import stat +import subprocess +import sys +import time +import types +from collections.abc import Callable, Iterator, Mapping, Sequence, Set as AbstractSet +from heapq import heappop, heappush +from textwrap import dedent +from typing import ( + TYPE_CHECKING, + Any, + ClassVar, + Final, + NoReturn, + TextIO, + TypeAlias as _TypeAlias, + TypedDict, + cast, + final, +) + +from librt.base64 import b64encode +from librt.internal import ( + cache_version, + read_bool, + read_int as read_int_bare, + read_str as read_str_bare, + read_tag, + write_bool, + write_bytes as write_bytes_bare, + write_int as write_int_bare, + write_str as write_str_bare, + write_tag, +) + +import mypy.semanal_main +from mypy.cache import ( + CACHE_VERSION, + DICT_STR_GEN, + LIST_GEN, + LITERAL_NONE, + CacheMeta, + ErrorTuple, + JsonValue, + ReadBuffer, + Tag, + WriteBuffer, + read_bytes, + read_errors, + read_int, + read_int_list, + read_int_opt, + read_str, + read_str_list, + read_str_opt, + write_bytes, + write_errors, + write_int, + write_int_list, + write_int_opt, + write_json_value, + write_str, + write_str_list, + write_str_opt, +) +from mypy.checker import TypeChecker +from mypy.defaults import ( + WORKER_CONNECTION_TIMEOUT, + WORKER_DONE_TIMEOUT, + WORKER_START_INTERVAL, + WORKER_START_TIMEOUT, +) +from mypy.error_formatter import OUTPUT_CHOICES, ErrorFormatter +from mypy.errorcodes import ErrorCode +from mypy.errors import CompileError, ErrorInfo, Errors, report_internal_error +from mypy.graph_utils import prepare_sccs, strongly_connected_components, topsort +from mypy.indirection import TypeIndirectionVisitor +from mypy.ipc import ( + BadStatus, + IPCClient, + IPCException, + IPCMessage, + read_status, + ready_to_read, + receive, + send, +) +from mypy.messages import MessageBuilder +from mypy.nodes import ( + FileRawData, + Import, + ImportAll, + ImportBase, + ImportFrom, + MypyFile, + SymbolTable, +) +from mypy.options import OPTIONS_AFFECTING_CACHE_NO_PLATFORM +from mypy.partially_defined import PossiblyUndefinedVariableVisitor +from mypy.semanal import SemanticAnalyzer +from mypy.semanal_pass1 import SemanticAnalyzerPreAnalysis +from mypy.util import ( + DecodeError, + decode_python_encoding, + get_mypy_comments, + hash_digest, + hash_digest_bytes, + is_stub_package_file, + is_sub_path_normabs, + is_typeshed_file, + module_prefix, + os_path_join, + read_py_file, + time_ref, + time_spent_us, +) + +if TYPE_CHECKING: + from mypy.report import Reports # Avoid unconditional slow import + +from mypy import errorcodes as codes +from mypy.config_parser import get_config_module_names, parse_mypy_comments +from mypy.fixup import fixup_module +from mypy.freetree import free_tree +from mypy.fscache import FileSystemCache +from mypy.metastore import FilesystemMetadataStore, MetadataStore, SqliteMetadataStore +from mypy.modulefinder import ( + BuildSource as BuildSource, + BuildSourceSet as BuildSourceSet, + FindModuleCache, + ModuleNotFoundReason, + ModuleSearchResult, + SearchPaths, + compute_search_paths, +) +from mypy.nodes import Expression +from mypy.options import Options +from mypy.parse import load_from_raw, parse +from mypy.plugin import ChainedPlugin, Plugin, ReportConfigContext +from mypy.plugins.default import DefaultPlugin +from mypy.renaming import LimitedVariableRenameVisitor, VariableRenameVisitor +from mypy.stats import dump_type_stats +from mypy.stubinfo import is_module_from_legacy_bundled_package, stub_distribution_name +from mypy.types import Type, instance_cache +from mypy.typestate import reset_global_state, type_state +from mypy.util import json_dumps, json_loads +from mypy.version import __version__ + +# Switch to True to produce debug output related to fine-grained incremental +# mode only that is useful during development. This produces only a subset of +# output compared to --verbose output. We use a global flag to enable this so +# that it's easy to enable this when running tests. +DEBUG_FINE_GRAINED: Final = False + +# These modules are special and should always come from typeshed. +CORE_BUILTIN_MODULES: Final = { + "builtins", + "typing", + "types", + "typing_extensions", + "mypy_extensions", + "_typeshed", + "_collections_abc", + "collections", + "collections.abc", + "sys", + "abc", +} + +# We are careful now, we can increase this in future if safe/useful. +MAX_GC_FREEZE_CYCLES: Final = 1 + +# We store status of initial GC freeze as a global variable to avoid memory +# leaks in tests, where we keep creating new BuildManagers in the same process. +initial_gc_freeze_done = False + +Graph: _TypeAlias = dict[str, "State"] + +MODULE_RESOLUTION_URL: Final = ( + "https://mypy.readthedocs.io/en/stable/running_mypy.html#mapping-file-paths-to-modules" +) + + +class SCC: + """A simple class that represents a strongly connected component (import cycle).""" + + id_counter: ClassVar[int] = 0 + + def __init__( + self, ids: set[str], scc_id: int | None = None, deps: list[int] | None = None + ) -> None: + if scc_id is None: + self.id = SCC.id_counter + SCC.id_counter += 1 + else: + self.id = scc_id + # Ids of modules in this cycle. + self.mod_ids = ids + # Direct dependencies, should be populated by the caller. + self.deps: set[int] = set(deps) if deps is not None else set() + # Direct dependencies that have not been processed yet. + # Should be populated by the caller. This set may change during graph + # processing, while the above stays constant. + self.not_ready_deps: set[int] = set() + # SCCs that (directly) depend on this SCC. Note this is a list to + # make processing order more predictable. Dependents will be notified + # that they may be ready in the order in this list. + self.direct_dependents: list[int] = [] + # Rough estimate of how much time processing this SCC will take, this + # is used for more efficient scheduling across multiple build workers. + self.size_hint: int = 0 + + +# TODO: Get rid of BuildResult. We might as well return a BuildManager. +class BuildResult: + """The result of a successful build. + + Attributes: + manager: The build manager. + files: Dictionary from module name to related AST node. + types: Dictionary from parse tree node to its inferred type. + used_cache: Whether the build took advantage of a pre-existing cache + errors: List of error messages. + """ + + def __init__(self, manager: BuildManager, graph: Graph) -> None: + self.manager = manager + self.graph = graph + self.files = manager.modules + self.types = manager.all_types # Non-empty if export_types True in options + self.used_cache = manager.cache_enabled + self.errors: list[str] = [] # Filled in by build if desired + + +class WorkerClient: + """A simple class that represents a mypy build worker.""" + + conn: IPCClient + + def __init__(self, status_file: str, options_data: str, env: Mapping[str, str]) -> None: + self.status_file = status_file + if os.path.isfile(status_file): + os.unlink(status_file) + + command = [ + sys.executable, + "-m", + "mypy.build_worker", + f"--status-file={status_file}", + f'--options-data="{options_data}"', + ] + # Return early without waiting, caller must call connect() before using the client. + self.proc = subprocess.Popen(command, env=env) + + def connect(self) -> None: + end_time = time.time() + WORKER_START_TIMEOUT + last_exception: Exception | None = None + while time.time() < end_time: + try: + data = read_status(self.status_file) + except BadStatus as exc: + last_exception = exc + time.sleep(WORKER_START_INTERVAL) + continue + try: + pid, connection_name = data["pid"], data["connection_name"] + assert isinstance(pid, int), f"Bad PID: {pid}" + assert isinstance(connection_name, str), f"Bad connection name: {connection_name}" + if sys.platform != "win32": + # Windows uses "wrapper processes" to run Python, so we cannot + # verify PIDs reliably. + assert pid == self.proc.pid, f"PID mismatch: {pid} vs {self.proc.pid}" + self.conn = IPCClient(connection_name, WORKER_CONNECTION_TIMEOUT) + return + except Exception as exc: + last_exception = exc + break + print("Failed to establish connection with worker:", last_exception) + sys.exit(2) + + def close(self) -> None: + self.conn.close() + # Technically we don't need to wait, but otherwise we will get ResourceWarnings. + try: + self.proc.wait(timeout=1) + except subprocess.TimeoutExpired: + pass + if os.path.isfile(self.status_file): + os.unlink(self.status_file) + + +def build_error(msg: str) -> NoReturn: + raise CompileError([f"mypy: error: {msg}"]) + + +def build( + sources: list[BuildSource], + options: Options, + alt_lib_path: str | None = None, + flush_errors: Callable[[str | None, list[str], bool], None] | None = None, + fscache: FileSystemCache | None = None, + stdout: TextIO | None = None, + stderr: TextIO | None = None, + extra_plugins: Sequence[Plugin] | None = None, + worker_env: Mapping[str, str] | None = None, +) -> BuildResult: + """Analyze a program. + + A single call to build performs parsing, semantic analysis and optionally + type checking for the program *and* all imported modules, recursively. + + Return BuildResult if successful or only non-blocking errors were found; + otherwise raise CompileError. + + If a flush_errors callback is provided, all error messages will be + passed to it and the errors and messages fields of BuildResult and + CompileError (respectively) will be empty. Otherwise those fields will + report any error messages. + + Args: + sources: list of sources to build + options: build options + alt_lib_path: an additional directory for looking up library modules + (takes precedence over other directories) + flush_errors: optional function to flush errors after a file is processed + fscache: optionally a file-system cacher + worker_env: An environment to start parallel build workers (used for tests) + """ + # If we were not given a flush_errors, we use one that will populate those + # fields for callers that want the traditional API. + messages = [] + + # This is mostly for the benefit of tests that use builtins fixtures. + instance_cache.reset() + + def default_flush_errors( + filename: str | None, new_messages: list[str], is_serious: bool + ) -> None: + messages.extend(new_messages) + + flush_errors = flush_errors or default_flush_errors + stdout = stdout or sys.stdout + stderr = stderr or sys.stderr + extra_plugins = extra_plugins or [] + + workers = [] + if options.num_workers > 0: + # TODO: switch to something more efficient than pickle (also in the daemon). + pickled_options = pickle.dumps(options.snapshot()) + options_data = b64encode(pickled_options).decode() + workers = [ + WorkerClient(f".mypy_worker.{idx}.json", options_data, worker_env or os.environ) + for idx in range(options.num_workers) + ] + sources_message = SourcesDataMessage(sources=sources) + buf = WriteBuffer() + sources_message.write(buf) + sources_data = buf.getvalue() + for worker in workers: + # Start loading graph in each worker as soon as it is up. + worker.connect() + worker.conn.write_bytes(sources_data) + + try: + result = build_inner( + sources, + options, + alt_lib_path, + flush_errors, + fscache, + stdout, + stderr, + extra_plugins, + workers, + ) + result.errors = messages + return result + except CompileError as e: + # CompileErrors raised from an errors object carry all the + # messages that have not been reported out by error streaming. + # Patch it up to contain either none or all none of the messages, + # depending on whether we are flushing errors. + serious = not e.use_stdout + flush_errors(None, e.messages, serious) + e.messages = messages + raise + finally: + for worker in workers: + try: + send(worker.conn, SccRequestMessage(scc_id=None, import_errors={}, mod_data={})) + except (OSError, IPCException): + pass + for worker in workers: + worker.close() + + +def build_inner( + sources: list[BuildSource], + options: Options, + alt_lib_path: str | None, + flush_errors: Callable[[str | None, list[str], bool], None], + fscache: FileSystemCache | None, + stdout: TextIO, + stderr: TextIO, + extra_plugins: Sequence[Plugin], + workers: list[WorkerClient], +) -> BuildResult: + if platform.python_implementation() == "CPython": + # Run gc less frequently, as otherwise we can spend a large fraction of + # cpu in gc. This seems the most reasonable place to tune garbage collection. + gc.set_threshold(200 * 1000, 30, 30) + + data_dir = default_data_dir() + fscache = fscache or FileSystemCache() + + search_paths = compute_search_paths(sources, options, data_dir, alt_lib_path) + + reports = None + if options.report_dirs: + # Import lazily to avoid slowing down startup. + from mypy.report import Reports + + reports = Reports(data_dir, options.report_dirs) + + source_set = BuildSourceSet(sources) + cached_read = fscache.read + errors = Errors(options, read_source=lambda path: read_py_file(path, cached_read)) + # Record import errors so that they can be replayed by the workers. + if workers: + errors.global_watcher = True + plugin, snapshot = load_plugins(options, errors, stdout, extra_plugins) + + # Validate error codes after plugins are loaded. + options.process_error_codes(error_callback=build_error) + + # Construct a build manager object to hold state during the build. + # + # Ignore current directory prefix in error messages. + manager = BuildManager( + data_dir, + search_paths, + ignore_prefix=os.getcwd(), + source_set=source_set, + reports=reports, + options=options, + version_id=__version__, + plugin=plugin, + plugins_snapshot=snapshot, + errors=errors, + error_formatter=None if options.output is None else OUTPUT_CHOICES.get(options.output), + flush_errors=flush_errors, + fscache=fscache, + stdout=stdout, + stderr=stderr, + ) + manager.workers = workers + if manager.verbosity() >= 2: + manager.trace(repr(options)) + + reset_global_state() + try: + graph = dispatch(sources, manager, stdout) + if not options.fine_grained_incremental: + type_state.reset_all_subtype_caches() + if options.timing_stats is not None: + dump_timing_stats(options.timing_stats, graph) + if options.line_checking_stats is not None: + dump_line_checking_stats(options.line_checking_stats, graph) + warn_unused_configs(options, flush_errors) + return BuildResult(manager, graph) + finally: + t0 = time.time() + manager.metastore.commit() + manager.add_stats(cache_commit_time=time.time() - t0) + manager.log( + "Build finished in %.3f seconds with %d modules, and %d errors" + % ( + time.time() - manager.start_time, + len(manager.modules), + manager.errors.num_messages(), + ) + ) + manager.dump_stats() + if reports is not None: + # Finish the HTML or XML reports even if CompileError was raised. + reports.finish() + if os.path.isdir(options.cache_dir): + add_catch_all_gitignore(options.cache_dir) + exclude_from_backups(options.cache_dir) + if os.path.isdir(options.cache_dir): + record_missing_stub_packages(options.cache_dir, manager.missing_stub_packages) + + +def warn_unused_configs( + options: Options, flush_errors: Callable[[str | None, list[str], bool], None] +) -> None: + if options.warn_unused_configs and options.unused_configs and not options.non_interactive: + unused = get_config_module_names( + options.config_file, + [glob for glob in options.per_module_options.keys() if glob in options.unused_configs], + ) + flush_errors( + None, ["{}: note: unused section(s): {}".format(options.config_file, unused)], False + ) + + +def default_data_dir() -> str: + """Returns directory containing typeshed directory.""" + return os.path.dirname(__file__) + + +def normpath(path: str, options: Options) -> str: + """Convert path to absolute; but to relative in bazel mode. + + (Bazel's distributed cache doesn't like filesystem metadata to + end up in output files.) + """ + # TODO: Could we always use relpath? (A worry in non-bazel + # mode would be that a moved file may change its full module + # name without changing its size, mtime or hash.) + if options.bazel: + return os.path.relpath(path) + else: + return os.path.abspath(path) + + +# NOTE: dependencies + suppressed == all reachable imports; +# suppressed contains those reachable imports that were prevented by +# silent mode or simply not found. + + +# Metadata for the fine-grained dependencies file associated with a module. +class FgDepMeta(TypedDict): + path: str + mtime: int + + +# Priorities used for imports. (Here, top-level includes inside a class.) +# These are used to determine a more predictable order in which the +# nodes in an import cycle are processed. +PRI_HIGH: Final = 5 # top-level "from X import blah" +PRI_MED: Final = 10 # top-level "import X" +PRI_LOW: Final = 20 # either form inside a function +PRI_MYPY: Final = 25 # inside "if MYPY" or "if TYPE_CHECKING" +PRI_INDIRECT: Final = 30 # an indirect dependency +PRI_ALL: Final = 99 # include all priorities + + +def import_priority(imp: ImportBase, toplevel_priority: int) -> int: + """Compute import priority from an import node.""" + if not imp.is_top_level: + # Inside a function + return PRI_LOW + if imp.is_mypy_only: + # Inside "if MYPY" or "if typing.TYPE_CHECKING" + return max(PRI_MYPY, toplevel_priority) + # A regular import; priority determined by argument. + return toplevel_priority + + +def load_plugins_from_config( + options: Options, errors: Errors, stdout: TextIO +) -> tuple[list[Plugin], dict[str, str]]: + """Load all configured plugins. + + Return a list of all the loaded plugins from the config file. + The second return value is a snapshot of versions/hashes of loaded user + plugins (for cache validation). + """ + import importlib + + snapshot: dict[str, str] = {} + + if not options.config_file: + return [], snapshot + + line = find_config_file_line_number(options.config_file, "mypy", "plugins") + if line == -1: + line = 1 # We need to pick some line number that doesn't look too confusing + + def plugin_error(message: str) -> NoReturn: + errors.report(line, 0, message) + errors.raise_error(use_stdout=False) + + custom_plugins: list[Plugin] = [] + errors.set_file(options.config_file, None, options) + for plugin_path in options.plugins: + func_name = "plugin" + plugin_dir: str | None = None + if ":" in os.path.basename(plugin_path): + plugin_path, func_name = plugin_path.rsplit(":", 1) + if plugin_path.endswith(".py"): + # Plugin paths can be relative to the config file location. + plugin_path = os_path_join(os.path.dirname(options.config_file), plugin_path) + if not os.path.isfile(plugin_path): + plugin_error(f'Can\'t find plugin "{plugin_path}"') + # Use an absolute path to avoid populating the cache entry + # for 'tmp' during tests, since it will be different in + # different tests. + plugin_dir = os.path.abspath(os.path.dirname(plugin_path)) + fnam = os.path.basename(plugin_path) + module_name = fnam[:-3] + sys.path.insert(0, plugin_dir) + elif re.search(r"[\\/]", plugin_path): + fnam = os.path.basename(plugin_path) + plugin_error(f'Plugin "{fnam}" does not have a .py extension') + else: + module_name = plugin_path + + try: + module = importlib.import_module(module_name) + except Exception as exc: + plugin_error(f'Error importing plugin "{plugin_path}": {exc}') + finally: + if plugin_dir is not None: + assert sys.path[0] == plugin_dir + del sys.path[0] + + if not hasattr(module, func_name): + plugin_error( + 'Plugin "{}" does not define entry point function "{}"'.format( + plugin_path, func_name + ) + ) + + try: + plugin_type = getattr(module, func_name)(__version__) + except Exception: + print(f"Error calling the plugin(version) entry point of {plugin_path}\n", file=stdout) + raise # Propagate to display traceback + + if not isinstance(plugin_type, type): + plugin_error( + 'Type object expected as the return value of "plugin"; got {!r} (in {})'.format( + plugin_type, plugin_path + ) + ) + if not issubclass(plugin_type, Plugin): + plugin_error( + 'Return value of "plugin" must be a subclass of "mypy.plugin.Plugin" ' + "(in {})".format(plugin_path) + ) + try: + custom_plugins.append(plugin_type(options)) + snapshot[module_name] = take_module_snapshot(module) + except Exception: + print(f"Error constructing plugin instance of {plugin_type.__name__}\n", file=stdout) + raise # Propagate to display traceback + + return custom_plugins, snapshot + + +def load_plugins( + options: Options, errors: Errors, stdout: TextIO, extra_plugins: Sequence[Plugin] +) -> tuple[Plugin, dict[str, str]]: + """Load all configured plugins. + + Return a plugin that encapsulates all plugins chained together. Always + at least include the default plugin (it's last in the chain). + The second return value is a snapshot of versions/hashes of loaded user + plugins (for cache validation). + """ + custom_plugins, snapshot = load_plugins_from_config(options, errors, stdout) + + custom_plugins += extra_plugins + + default_plugin: Plugin = DefaultPlugin(options) + if not custom_plugins: + return default_plugin, snapshot + + # Custom plugins take precedence over the default plugin. + return ChainedPlugin(options, custom_plugins + [default_plugin]), snapshot + + +def take_module_snapshot(module: types.ModuleType) -> str: + """Take plugin module snapshot by recording its version and hash. + + We record _both_ hash and the version to detect more possible changes + (e.g. if there is a change in modules imported by a plugin). + """ + if hasattr(module, "__file__"): + assert module.__file__ is not None + with open(module.__file__, "rb") as f: + digest = hash_digest(f.read()) + else: + digest = "unknown" + ver = getattr(module, "__version__", "none") + return f"{ver}:{digest}" + + +def find_config_file_line_number(path: str, section: str, setting_name: str) -> int: + """Return the approximate location of setting_name within mypy config file. + + Return -1 if can't determine the line unambiguously. + """ + in_desired_section = False + try: + results = [] + with open(path, encoding="UTF-8") as f: + for i, line in enumerate(f): + line = line.strip() + if line.startswith("[") and line.endswith("]"): + current_section = line[1:-1].strip() + in_desired_section = current_section == section + elif in_desired_section and re.match(rf"{setting_name}\s*=", line): + results.append(i + 1) + if len(results) == 1: + return results[0] + except OSError: + pass + return -1 + + +class BuildManager: + """This class holds shared state for building a mypy program. + + It is used to coordinate parsing, import processing, semantic + analysis and type checking. The actual build steps are carried + out by dispatch(). + + Attributes: + data_dir: Mypy data directory (contains stubs) + search_paths: SearchPaths instance indicating where to look for modules + modules: Mapping of module ID to MypyFile (shared by the passes) + semantic_analyzer: + Semantic analyzer, pass 2 + all_types: Map {Expression: Type} from all modules (enabled by export_types) + options: Build options + missing_modules: Modules that could not be imported (or intentionally skipped) + stale_modules: Set of modules that needed to be rechecked (only used by tests) + fg_deps_meta: Metadata for fine-grained dependencies caches associated with modules + fg_deps: A fine-grained dependency map + version_id: The current mypy version (based on commit id when possible) + plugin: Active mypy plugin(s) + plugins_snapshot: + Snapshot of currently active user plugins (versions and hashes) + old_plugins_snapshot: + Plugins snapshot from previous incremental run (or None in + non-incremental mode and if cache was not found) + errors: Used for reporting all errors + flush_errors: A function for processing errors after each SCC + cache_enabled: Whether cache is being read. This is set based on options, + but is disabled if fine-grained cache loading fails + and after an initial fine-grained load. This doesn't + determine whether we write cache files or not. + quickstart_state: + A cache of filename -> mtime/size/hash info used to avoid + needing to hash source files when using a cache with mismatching mtimes + stats: Dict with various instrumentation numbers, it is used + not only for debugging, but also required for correctness, + in particular to check consistency of the fine-grained dependency cache. + fscache: A file system cacher + ast_cache: AST cache to speed up mypy daemon + """ + + def __init__( + self, + data_dir: str, + search_paths: SearchPaths, + ignore_prefix: str, + source_set: BuildSourceSet, + reports: Reports | None, + options: Options, + version_id: str, + plugin: Plugin, + plugins_snapshot: dict[str, str], + errors: Errors, + flush_errors: Callable[[str | None, list[str], bool], None], + fscache: FileSystemCache, + stdout: TextIO, + stderr: TextIO, + error_formatter: ErrorFormatter | None = None, + parallel_worker: bool = False, + ) -> None: + self.stats: dict[str, Any] = {} # Values are ints or floats + self.stdout = stdout + self.stderr = stderr + self.start_time = time.time() + self.data_dir = data_dir + self.errors = errors + self.errors.set_ignore_prefix(ignore_prefix) + self.error_formatter = error_formatter + self.search_paths = search_paths + self.source_set = source_set + self.reports = reports + self.options = options + self.version_id = version_id + self.modules: dict[str, MypyFile] = {} + self.import_map: dict[str, set[str]] = {} + self.missing_modules: dict[str, int] = {} + self.fg_deps_meta: dict[str, FgDepMeta] = {} + # fg_deps holds the dependencies of every module that has been + # processed. We store this in BuildManager so that we can compute + # dependencies as we go, which allows us to free ASTs and type information, + # saving a ton of memory on net. + self.fg_deps: dict[str, set[str]] = {} + # Always convert the plugin to a ChainedPlugin so that it can be manipulated if needed + if not isinstance(plugin, ChainedPlugin): + plugin = ChainedPlugin(options, [plugin]) + self.plugin = plugin + # These allow quickly skipping logging and stats collection calls. Note + # that some stats impact mypy behavior, so be careful when skipping stats + # collection calls. + self.stats_enabled = self.options.dump_build_stats + self.logging_enabled = self.options.verbosity >= 1 + self.tracing_enabled = self.options.verbosity >= 2 + # Set of namespaces (module or class) that are being populated during semantic + # analysis and may have missing definitions. + self.incomplete_namespaces: set[str] = set() + self.semantic_analyzer = SemanticAnalyzer( + self.modules, + self.missing_modules, + self.incomplete_namespaces, + self.errors, + self.plugin, + self.import_map, + ) + self.all_types: dict[Expression, Type] = {} # Enabled by export_types + self.indirection_detector = TypeIndirectionVisitor() + self.stale_modules: set[str] = set() + self.rechecked_modules: set[str] = set() + self.flush_errors = flush_errors + has_reporters = reports is not None and reports.reporters + self.cache_enabled = ( + options.incremental + and (not options.fine_grained_incremental or options.use_fine_grained_cache) + and not has_reporters + ) + self.fscache = fscache + self.cwd = os.getcwd() + self.find_module_cache = FindModuleCache( + self.search_paths, self.fscache, self.options, source_set=self.source_set + ) + for module in CORE_BUILTIN_MODULES: + if options.use_builtins_fixtures: + continue + path = self.find_module_cache.find_module(module, fast_path=True) + if not isinstance(path, str): + raise CompileError( + [f"Failed to find builtin module {module}, perhaps typeshed is broken?"] + ) + if is_typeshed_file(options.abs_custom_typeshed_dir, path) or is_stub_package_file( + path + ): + continue + + raise CompileError( + [ + f'mypy: "{os.path.relpath(path)}" shadows library module "{module}"', + f'note: A user-defined top-level module with name "{module}" is not supported', + ] + ) + + self.metastore = create_metastore(options, parallel_worker=parallel_worker) + + # a mapping from source files to their corresponding shadow files + # for efficient lookup + self.shadow_map: dict[str, str] = {} + if self.options.shadow_file is not None: + self.shadow_map = dict(self.options.shadow_file) + # a mapping from each file being typechecked to its possible shadow file + self.shadow_equivalence_map: dict[str, str | None] = {} + self.plugin = plugin + self.plugins_snapshot = plugins_snapshot + self.old_plugins_snapshot = read_plugins_snapshot(self) + if self.verbosity() >= 2: + self.trace(f"Plugins snapshot (fresh) {json.dumps(self.plugins_snapshot)}") + self.quickstart_state = read_quickstart_file(options, self.stdout) + # Fine grained targets (module top levels and top level functions) processed by + # the semantic analyzer, used only for testing. Currently used only by the new + # semantic analyzer. Tuple of module and target name. + self.processed_targets: list[tuple[str, str]] = [] + # Missing stub packages encountered. + self.missing_stub_packages: set[str] = set() + # Cache for mypy ASTs that have completed semantic analysis + # pass 1. When multiple files are added to the build in a + # single daemon increment, only one of the files gets added + # per step and the others are discarded. This gets repeated + # until all the files have been added. This means that a + # new file can be processed O(n**2) times. This cache + # avoids most of this redundant work. + self.ast_cache: dict[str, tuple[MypyFile, list[ErrorInfo]]] = {} + # Number of times we used GC optimization hack for fresh SCCs. + self.gc_freeze_cycles = 0 + # Mapping from SCC id to corresponding SCC instance. This is populated + # in process_graph(). + self.scc_by_id: dict[int, SCC] = {} + # Mapping from module id to the SCC it belongs to. This is populated + # in process_graph(). + self.scc_by_mod_id: dict[str, SCC] = {} + # Global topological order for SCCs. This exists to make order of processing + # SCCs more predictable. + self.top_order: list[int] = [] + # Stale SCCs that are queued for processing. Each tuple contains SCC size hint, + # SCC adding order (tie-breaker), and the SCC itself. + self.scc_queue: list[tuple[int, int, SCC]] = [] + # SCCs that have been fully processed. + self.done_sccs: set[int] = set() + # Parallel build workers, list is empty for in-process type-checking. + self.workers: list[WorkerClient] = [] + # We track which workers are currently free in the coordinator process. + # This is a tiny bit faster and conceptually simpler than check which ones + # are writeable each time we want to submit an SCC for processing. + self.free_workers: set[int] = set() + # A global adding order for SCC queue, see comment above. + self.queue_order: int = 0 + # Is this an instance used by a parallel worker? + self.parallel_worker = parallel_worker + # Snapshot of import-related options per module. We record these even for + # suppressed imports, since they can affect errors in the callers. Bytes + # value is opaque but can be compared to detect changes in options. + self.import_options: dict[str, bytes] = {} + # Cache for transitive dependency check (expensive). + self.transitive_deps_cache: dict[tuple[int, int], bool] = {} + # Packages for which we know presence or absence of __getattr__(). + self.known_partial_packages: dict[str, bool] = {} + + def dump_stats(self) -> None: + if self.stats_enabled: + print("Stats:") + for key, value in sorted(self.stats_summary().items()): + print(f"{key + ':':24}{value}") + + def use_fine_grained_cache(self) -> bool: + return self.cache_enabled and self.options.use_fine_grained_cache + + def maybe_swap_for_shadow_path(self, path: str) -> str: + if not self.shadow_map: + return path + + path = normpath(path, self.options) + + previously_checked = path in self.shadow_equivalence_map + if not previously_checked: + for source, shadow in self.shadow_map.items(): + if self.fscache.samefile(path, source): + self.shadow_equivalence_map[path] = shadow + break + else: + self.shadow_equivalence_map[path] = None + + shadow_file = self.shadow_equivalence_map.get(path) + return shadow_file if shadow_file else path + + def get_stat(self, path: str) -> os.stat_result | None: + return self.fscache.stat_or_none(self.maybe_swap_for_shadow_path(path)) + + def getmtime(self, path: str) -> int: + """Return a file's mtime; but 0 in bazel mode. + + (Bazel's distributed cache doesn't like filesystem metadata to + end up in output files.) + """ + if self.options.bazel: + return 0 + else: + return int(self.metastore.getmtime(path)) + + def correct_rel_imp(self, file: MypyFile, imp: ImportFrom | ImportAll) -> str: + """Function to correct for relative imports.""" + file_id = file.fullname + rel = imp.relative + if rel == 0: + return imp.id + if os.path.basename(file.path).startswith("__init__."): + rel -= 1 + if rel != 0: + file_id = ".".join(file_id.split(".")[:-rel]) + new_id = file_id + "." + imp.id if imp.id else file_id + + if not new_id: + self.errors.set_file(file.path, file.name, self.options) + self.error( + imp.line, "No parent module -- cannot perform relative import", blocker=True + ) + + return new_id + + def all_imported_modules_in_file(self, file: MypyFile) -> list[tuple[int, str, int]]: + """Find all reachable import statements in a file. + + Return list of tuples (priority, module id, import line number) + for all modules imported in file; lower numbers == higher priority. + + Can generate blocking errors on bogus relative imports. + """ + res: list[tuple[int, str, int]] = [] + for imp in file.imports: + if not imp.is_unreachable: + if isinstance(imp, Import): + pri = import_priority(imp, PRI_MED) + ancestor_pri = import_priority(imp, PRI_LOW) + for id, _ in imp.ids: + res.append((pri, id, imp.line)) + ancestor_parts = id.split(".")[:-1] + ancestors = [] + for part in ancestor_parts: + ancestors.append(part) + res.append((ancestor_pri, ".".join(ancestors), imp.line)) + elif isinstance(imp, ImportFrom): + cur_id = self.correct_rel_imp(file, imp) + all_are_submodules = True + # Also add any imported names that are submodules. + pri = import_priority(imp, PRI_MED) + for name, __ in imp.names: + sub_id = cur_id + "." + name + if self.is_module(sub_id): + res.append((pri, sub_id, imp.line)) + else: + all_are_submodules = False + # Add cur_id as a dependency, even if all the + # imports are submodules. Processing import from will try + # to look through cur_id, so we should depend on it. + # As a workaround for some bugs in cycle handling (#4498), + # if all the imports are submodules, do the import at a lower + # priority. + pri = import_priority(imp, PRI_HIGH if not all_are_submodules else PRI_LOW) + res.append((pri, cur_id, imp.line)) + elif isinstance(imp, ImportAll): + pri = import_priority(imp, PRI_HIGH) + res.append((pri, self.correct_rel_imp(file, imp), imp.line)) + + # Sort such that module (e.g. foo.bar.baz) comes before its ancestors (e.g. foo + # and foo.bar) so that, if FindModuleCache finds the target module in a + # package marked with py.typed underneath a namespace package installed in + # site-packages, (gasp), that cache's knowledge of the ancestors + # (aka FindModuleCache.ns_ancestors) can be primed when it is asked to find + # the parent. + res.sort(key=lambda x: -x[1].count(".")) + return res + + def is_module(self, id: str) -> bool: + """Is there a file in the file system corresponding to module id?""" + return find_module_simple(id, self) is not None + + def parse_file( + self, + id: str, + path: str, + source: str, + ignore_errors: bool, + options: Options, + raw_data: FileRawData | None = None, + ) -> MypyFile: + """Parse the source of a file with the given name. + + Raise CompileError if there is a parse error. + """ + imports_only = False + if self.workers and self.fscache.exists(path): + # Currently, we can use the native parser only for actual files. + imports_only = True + t0 = time.time() + if ignore_errors: + self.errors.ignored_files.add(path) + if raw_data: + # If possible, deserialize from known binary data instead of parsing from scratch. + tree = load_from_raw(path, id, raw_data, self.errors, options) + else: + tree = parse(source, path, id, self.errors, options=options, imports_only=imports_only) + tree._fullname = id + self.add_stats( + files_parsed=1, + modules_parsed=int(not tree.is_stub), + stubs_parsed=int(tree.is_stub), + parse_time=time.time() - t0, + ) + + if self.errors.is_blockers(): + self.log("Bailing due to parse errors") + self.errors.raise_error() + return tree + + def load_fine_grained_deps(self, id: str) -> dict[str, set[str]]: + t0 = time.time() + if id in self.fg_deps_meta: + # TODO: Assert deps file wasn't changed. + deps = json_loads(self.metastore.read(self.fg_deps_meta[id]["path"])) + else: + deps = {} + val = {k: set(v) for k, v in deps.items()} + self.add_stats(load_fg_deps_time=time.time() - t0) + return val + + def report_file( + self, file: MypyFile, type_map: dict[Expression, Type], options: Options + ) -> None: + if self.reports is not None and self.source_set.is_source(file): + self.reports.file(file, self.modules, type_map, options) + + def verbosity(self) -> int: + return self.options.verbosity + + def log(self, *message: str) -> None: + if self.verbosity() >= 1: + if message: + print("LOG: ", *message, file=self.stderr) + else: + print(file=self.stderr) + self.stderr.flush() + + def log_fine_grained(self, *message: str) -> None: + if self.verbosity() >= 1: + self.log("fine-grained:", *message) + elif mypy.build.DEBUG_FINE_GRAINED: + # Output log in a simplified format that is quick to browse. + if message: + print(*message, file=self.stderr) + else: + print(file=self.stderr) + self.stderr.flush() + + def trace(self, *message: str) -> None: + if self.verbosity() >= 2: + print("TRACE:", *message, file=self.stderr) + self.stderr.flush() + + def add_stats(self, **kwds: Any) -> None: + for key, value in kwds.items(): + if key in self.stats: + self.stats[key] += value + else: + self.stats[key] = value + + def stats_summary(self) -> Mapping[str, object]: + return self.stats + + def submit(self, graph: Graph, sccs: list[SCC]) -> None: + """Submit a stale SCC for processing in current process or parallel workers.""" + if self.workers: + self.submit_to_workers(graph, sccs) + else: + self.scc_queue.extend([(0, 0, scc) for scc in sccs]) + + def submit_to_workers(self, graph: Graph, sccs: list[SCC] | None = None) -> None: + if sccs is not None: + for scc in sccs: + heappush(self.scc_queue, (-scc.size_hint, self.queue_order, scc)) + self.queue_order += 1 + while self.scc_queue and self.free_workers: + idx = self.free_workers.pop() + _, _, scc = heappop(self.scc_queue) + import_errors = { + mod_id: self.errors.recorded[path] + for mod_id in scc.mod_ids + if (path := graph[mod_id].xpath) in self.errors.recorded + } + send( + self.workers[idx].conn, + SccRequestMessage( + scc_id=scc.id, + import_errors=import_errors, + mod_data={ + mod_id: ( + # Although workers don't really need to know about details + # of dependencies, they will write cache, so we need to pass + # suppressed_deps_opts() as part of module data. + graph[mod_id].suppressed_deps_opts(), + tree.raw_data if (tree := graph[mod_id].tree) else None, + ) + for mod_id in scc.mod_ids + }, + ), + ) + + def wait_for_done( + self, graph: Graph + ) -> tuple[list[SCC], bool, dict[str, tuple[str, list[str]]]]: + """Wait for a stale SCC processing to finish. + + Return a tuple three items: + * processed SCCs + * whether we have more in the queue + * new interface hash and list of errors for each module + The last item is only used for parallel processing. + """ + if self.workers: + return self.wait_for_done_workers(graph) + if not self.scc_queue: + return [], False, {} + _, _, next_scc = self.scc_queue.pop(0) + process_stale_scc(graph, next_scc, self) + return [next_scc], bool(self.scc_queue), {} + + def wait_for_done_workers( + self, graph: Graph + ) -> tuple[list[SCC], bool, dict[str, tuple[str, list[str]]]]: + if not self.scc_queue and len(self.free_workers) == len(self.workers): + return [], False, {} + + done_sccs = [] + results = {} + for idx in ready_to_read([w.conn for w in self.workers], WORKER_DONE_TIMEOUT): + data = SccResponseMessage.read(receive(self.workers[idx].conn)) + self.free_workers.add(idx) + scc_id = data.scc_id + if data.blocker is not None: + raise data.blocker + assert data.result is not None + results.update(data.result) + done_sccs.append(self.scc_by_id[scc_id]) + self.submit_to_workers(graph) # advance after some workers are free. + return ( + done_sccs, + bool(self.scc_queue) or len(self.free_workers) < len(self.workers), + results, + ) + + def is_transitive_scc_dep(self, from_scc_id: int, to_scc_id: int) -> bool: + """Check if one SCC is a (transitive) dependency of another.""" + edge = (from_scc_id, to_scc_id) + if (cached := self.transitive_deps_cache.get(edge)) is not None: + return cached + todo = self.scc_by_id[from_scc_id].deps + seen = set() + while todo: + more = set() + # Breadth-first search seems to be better here, because all + # "lower-level" SCCs are processed and some may be cached. + for dep in todo: + seen.add(dep) + if dep == to_scc_id: + self.transitive_deps_cache[edge] = True + return True + if cached := self.transitive_deps_cache.get((dep, to_scc_id)): + self.transitive_deps_cache[edge] = True + return True + elif cached is None: + more |= self.scc_by_id[dep].deps + todo = more + self.transitive_deps_cache[edge] = False + for dep in seen: + # We negative-cache all intermediate lookups, thus + # trading time for space. + self.transitive_deps_cache[(dep, to_scc_id)] = False + return False + + def error( + self, + line: int | None, + msg: str, + code: ErrorCode | None = None, + *, + blocker: bool = False, + only_once: bool = False, + ) -> None: + if line is None: + line = column = -1 + else: + column = 0 + self.errors.report(line, column, msg, code, blocker=blocker, only_once=only_once) + + def note( + self, line: int | None, msg: str, code: ErrorCode | None = None, *, only_once: bool = False + ) -> None: + if line is None: + line = column = -1 + else: + column = 0 + self.errors.report(line, column, msg, code, severity="note", only_once=only_once) + + def note_multiline( + self, line: int | None, msg: str, code: ErrorCode | None = None, *, only_once: bool = False + ) -> None: + for msg_line in dedent(msg.lstrip("\n")).splitlines(): + self.note(line, msg_line, code, only_once=only_once) + + +def deps_to_json(x: dict[str, set[str]]) -> bytes: + return json_dumps({k: list(v) for k, v in x.items()}) + + +# File for storing metadata about all the fine-grained dependency caches +DEPS_META_FILE: Final = "@deps.meta.json" +# File for storing fine-grained dependencies that didn't a parent in the build +DEPS_ROOT_FILE: Final = "@root.deps.json" + +# The name of the fake module used to store fine-grained dependencies that +# have no other place to go. +FAKE_ROOT_MODULE: Final = "@root" + + +def write_deps_cache( + rdeps: dict[str, dict[str, set[str]]], manager: BuildManager, graph: Graph +) -> None: + """Write cache files for fine-grained dependencies. + + Serialize fine-grained dependencies map for fine-grained mode. + + Dependencies on some module 'm' is stored in the dependency cache + file m.deps.json. This entails some spooky action at a distance: + if module 'n' depends on 'm', that produces entries in m.deps.json. + When there is a dependency on a module that does not exist in the + build, it is stored with its first existing parent module. If no + such module exists, it is stored with the fake module FAKE_ROOT_MODULE. + + This means that the validity of the fine-grained dependency caches + are a global property, so we store validity checking information for + fine-grained dependencies in a global cache file: + * We take a snapshot of current sources to later check consistency + between the fine-grained dependency cache and module cache metadata + * We store the mtime of all the dependency files to verify they + haven't changed + """ + metastore = manager.metastore + + error = False + + fg_deps_meta = manager.fg_deps_meta.copy() + + for id in rdeps: + if id != FAKE_ROOT_MODULE: + _, _, deps_json = get_cache_names(id, graph[id].xpath, manager.options) + else: + deps_json = DEPS_ROOT_FILE + assert deps_json + manager.log("Writing deps cache", deps_json) + if not manager.metastore.write(deps_json, deps_to_json(rdeps[id])): + manager.log(f"Error writing fine-grained deps JSON file {deps_json}") + error = True + else: + fg_deps_meta[id] = {"path": deps_json, "mtime": manager.getmtime(deps_json)} + + meta_snapshot: dict[str, str] = {} + for id, st in graph.items(): + # If we didn't parse a file (so it doesn't have a + # source_hash), then it must be a module with a fresh cache, + # so use the hash from that. + if st.source_hash: + hash = st.source_hash + else: + if st.meta: + hash = st.meta.hash + else: + hash = "" + meta_snapshot[id] = hash + + meta = {"snapshot": meta_snapshot, "deps_meta": fg_deps_meta} + + if not metastore.write(DEPS_META_FILE, json_dumps(meta)): + manager.log(f"Error writing fine-grained deps meta JSON file {DEPS_META_FILE}") + error = True + + if error: + manager.errors.set_file(_cache_dir_prefix(manager.options), None, manager.options) + manager.error(None, "Error writing fine-grained dependencies cache", blocker=True) + + +def invert_deps(deps: dict[str, set[str]], graph: Graph) -> dict[str, dict[str, set[str]]]: + """Splits fine-grained dependencies based on the module of the trigger. + + Returns a dictionary from module ids to all dependencies on that + module. Dependencies not associated with a module in the build will be + associated with the nearest parent module that is in the build, or the + fake module FAKE_ROOT_MODULE if none are. + """ + # Lazy import to speed up startup + from mypy.server.target import trigger_to_target + + # Prepopulate the map for all the modules that have been processed, + # so that we always generate files for processed modules (even if + # there aren't any dependencies to them.) + rdeps: dict[str, dict[str, set[str]]] = {id: {} for id, st in graph.items() if st.tree} + for trigger, targets in deps.items(): + module = module_prefix(graph, trigger_to_target(trigger)) + if not module or not graph[module].tree: + module = FAKE_ROOT_MODULE + + mod_rdeps = rdeps.setdefault(module, {}) + mod_rdeps.setdefault(trigger, set()).update(targets) + + return rdeps + + +def generate_deps_for_cache(manager: BuildManager, graph: Graph) -> dict[str, dict[str, set[str]]]: + """Generate fine-grained dependencies into a form suitable for serializing. + + This does a couple things: + 1. Splits fine-grained deps based on the module of the trigger + 2. For each module we generated fine-grained deps for, load any previous + deps and merge them in. + + Returns a dictionary from module ids to all dependencies on that + module. Dependencies not associated with a module in the build will be + associated with the nearest parent module that is in the build, or the + fake module FAKE_ROOT_MODULE if none are. + """ + from mypy.server.deps import merge_dependencies # Lazy import to speed up startup + + # Split the dependencies out into based on the module that is depended on. + rdeps = invert_deps(manager.fg_deps, graph) + + # We can't just clobber existing dependency information, so we + # load the deps for every module we've generated new dependencies + # to and merge the new deps into them. + for module, mdeps in rdeps.items(): + old_deps = manager.load_fine_grained_deps(module) + merge_dependencies(old_deps, mdeps) + + return rdeps + + +PLUGIN_SNAPSHOT_FILE: Final = "@plugins_snapshot.json" + + +def write_plugins_snapshot(manager: BuildManager) -> None: + """Write snapshot of versions and hashes of currently active plugins.""" + snapshot = json_dumps(manager.plugins_snapshot) + if ( + not manager.metastore.write(PLUGIN_SNAPSHOT_FILE, snapshot) + and manager.options.cache_dir != os.devnull + ): + manager.errors.set_file(_cache_dir_prefix(manager.options), None, manager.options) + manager.error(None, "Error writing plugins snapshot", blocker=True) + + +def read_plugins_snapshot(manager: BuildManager) -> dict[str, str] | None: + """Read cached snapshot of versions and hashes of plugins from previous run.""" + snapshot = _load_json_file( + PLUGIN_SNAPSHOT_FILE, + manager, + log_success="Plugins snapshot (cached) ", + log_error="Could not load plugins snapshot: ", + ) + if snapshot is None: + return None + if not isinstance(snapshot, dict): + manager.log(f"Could not load plugins snapshot: cache is not a dict: {type(snapshot)}") # type: ignore[unreachable] + return None + return snapshot + + +def read_quickstart_file( + options: Options, stdout: TextIO +) -> dict[str, tuple[float, int, str]] | None: + quickstart: dict[str, tuple[float, int, str]] | None = None + if options.quickstart_file: + # This is very "best effort". If the file is missing or malformed, + # just ignore it. + raw_quickstart: dict[str, Any] = {} + try: + with open(options.quickstart_file, "rb") as f: + raw_quickstart = json_loads(f.read()) + + quickstart = {} + for file, (x, y, z) in raw_quickstart.items(): + quickstart[file] = (x, y, z) + except Exception as e: + print(f"Warning: Failed to load quickstart file: {str(e)}\n", file=stdout) + return quickstart + + +def read_deps_cache(manager: BuildManager, graph: Graph) -> dict[str, FgDepMeta] | None: + """Read and validate the fine-grained dependencies cache. + + See the write_deps_cache documentation for more information on + the details of the cache. + + Returns None if the cache was invalid in some way. + """ + deps_meta = _load_json_file( + DEPS_META_FILE, + manager, + log_success="Deps meta ", + log_error="Could not load fine-grained dependency metadata: ", + ) + if deps_meta is None: + return None + meta_snapshot = deps_meta["snapshot"] + # Take a snapshot of the source hashes from all the metas we found. + # (Including the ones we rejected because they were out of date.) + # We use this to verify that they match up with the proto_deps. + current_meta_snapshot = { + id: st.meta_source_hash for id, st in graph.items() if st.meta_source_hash is not None + } + + common = set(meta_snapshot.keys()) & set(current_meta_snapshot.keys()) + if any(meta_snapshot[id] != current_meta_snapshot[id] for id in common): + # TODO: invalidate also if options changed (like --strict-optional)? + manager.log("Fine-grained dependencies cache inconsistent, ignoring") + return None + + module_deps_metas = deps_meta["deps_meta"] + assert isinstance(module_deps_metas, dict) + if not manager.options.skip_cache_mtime_checks: + for meta in module_deps_metas.values(): + try: + matched = manager.getmtime(meta["path"]) == meta["mtime"] + except FileNotFoundError: + matched = False + if not matched: + manager.log(f"Invalid or missing fine-grained deps cache: {meta['path']}") + return None + + return module_deps_metas + + +def _load_ff_file( + file: str, manager: BuildManager, log_error_fmt: str, id: str | None +) -> bytes | None: + if manager.stats_enabled: + t0 = time.time() + try: + data = manager.metastore.read(file) + except OSError: + if manager.logging_enabled: + if id: + message = log_error_fmt.format(id) + file + else: + message = log_error_fmt + file + manager.log(message) + return None + if manager.stats_enabled: + manager.add_stats(metastore_read_time=time.time() - t0) + return data + + +def _load_json_file( + file: str, manager: BuildManager, log_success: str, log_error: str +) -> dict[str, Any] | None: + """A simple helper to read a JSON file with logging.""" + t0 = time.time() + try: + data = manager.metastore.read(file) + except OSError: + manager.log(log_error + file) + return None + manager.add_stats(metastore_read_time=time.time() - t0) + # Only bother to compute the log message if we are logging it, since it could be big + if manager.verbosity() >= 2: + manager.trace(log_success + data.rstrip().decode()) + try: + t1 = time.time() + result = json_loads(data) + manager.add_stats(data_file_load_time=time.time() - t1) + except json.JSONDecodeError: + manager.errors.set_file(file, None, manager.options) + manager.error( + None, + "Error reading JSON file;" + " you likely have a bad cache.\n" + "Try removing the {cache_dir} directory" + " and run mypy again.".format(cache_dir=manager.options.cache_dir), + blocker=True, + ) + return None + else: + assert isinstance(result, dict) + return result + + +def _cache_dir_prefix(options: Options) -> str: + """Get current cache directory (or file if id is given).""" + if options.bazel: + # This is needed so the cache map works. + return os.curdir + cache_dir = options.cache_dir + pyversion = options.python_version + base = os_path_join(cache_dir, "%d.%d" % pyversion) + return base + + +def add_catch_all_gitignore(target_dir: str) -> None: + """Add catch-all .gitignore to an existing directory. + + No-op if the .gitignore already exists. + """ + gitignore = os_path_join(target_dir, ".gitignore") + try: + with open(gitignore, "x") as f: + print("# Automatically created by mypy", file=f) + print("*", file=f) + except FileExistsError: + pass + + +def exclude_from_backups(target_dir: str) -> None: + """Exclude the directory from various archives and backups supporting CACHEDIR.TAG. + + If the CACHEDIR.TAG file exists the function is a no-op. + """ + cachedir_tag = os_path_join(target_dir, "CACHEDIR.TAG") + try: + with open(cachedir_tag, "x") as f: + f.write("""Signature: 8a477f597d28d172789f06886806bc55 +# This file is a cache directory tag automatically created by mypy. +# For information about cache directory tags see https://bford.info/cachedir/ +""") + except FileExistsError: + pass + + +def create_metastore(options: Options, parallel_worker: bool) -> MetadataStore: + """Create the appropriate metadata store.""" + if options.sqlite_cache: + mds: MetadataStore = SqliteMetadataStore( + _cache_dir_prefix(options), set_journal_mode=not parallel_worker + ) + else: + mds = FilesystemMetadataStore(_cache_dir_prefix(options)) + return mds + + +def get_errors_name(meta_name: str) -> str: + # Convert e.g. foo.bar.meta.ff to foo.bar.err.ff + parts = meta_name.rsplit(".", maxsplit=2) + parts[1] = "err" + return ".".join(parts) + + +def get_cache_names(id: str, path: str, options: Options) -> tuple[str, str, str | None]: + """Return the file names for the cache files. + + Args: + id: module ID + path: module path + options: build options + + Returns: + A tuple with the file names to be used for the meta file, the + data file, and the fine-grained deps JSON, respectively. + """ + if options.cache_map: + pair = options.cache_map.get(normpath(path, options)) + else: + pair = None + if pair is not None: + # The cache map paths were specified relative to the base directory, + # but the filesystem metastore APIs operates relative to the cache + # prefix directory. + # Solve this by rewriting the paths as relative to the root dir. + # This only makes sense when using the filesystem backed cache. + root = _cache_dir_prefix(options) + return os.path.relpath(pair[0], root), os.path.relpath(pair[1], root), None + prefix = os.path.join(*id.split(".")) + is_package = os.path.basename(path).startswith("__init__.py") + if is_package: + prefix = os_path_join(prefix, "__init__") + + deps_json = None + if options.cache_fine_grained: + deps_json = prefix + ".deps.json" + if options.fixed_format_cache: + data_suffix = ".data.ff" + meta_suffix = ".meta.ff" + else: + data_suffix = ".data.json" + meta_suffix = ".meta.json" + return prefix + meta_suffix, prefix + data_suffix, deps_json + + +def options_snapshot(id: str, manager: BuildManager) -> dict[str, object]: + """Make compact snapshot of options for a module. + + Separately store only the options we may compare individually, and take a hash + of everything else. If --debug-cache is specified, fall back to full snapshot. + """ + platform_opt, values = manager.options.clone_for_module(id).select_options_affecting_cache() + if manager.options.debug_cache: + # Build full options snapshot for debugging purposes. + result: dict[str, object] = {"platform": platform_opt} + for key, val in zip(OPTIONS_AFFECTING_CACHE_NO_PLATFORM, values): + result[key] = val + return result + # Process most options quickly, since this is performance critical. + buf = WriteBuffer() + write_json_value(buf, cast(JsonValue, values)) + return {"platform": platform_opt, "other_options": hash_digest(buf.getvalue())} + + +def find_cache_meta( + id: str, path: str, manager: BuildManager, skip_validation: bool = False +) -> tuple[CacheMeta | None, list[ErrorTuple]]: + """Find cache data for a module. + + Args: + id: module ID + path: module path + manager: the build manager (for pyversion, log/trace, and build options) + skip_validation: if True skip any validation steps (used for parallel checking) + + Returns: + A CacheMeta instance if the cache data was found and appears + valid; otherwise None. + """ + # TODO: May need to take more build options into account + meta_file, data_file, _ = get_cache_names(id, path, manager.options) + if manager.tracing_enabled: + manager.trace(f"Looking for {id} at {meta_file}") + if manager.stats_enabled: + t0 = time.time() + if manager.options.fixed_format_cache: + meta = _load_ff_file( + meta_file, manager, log_error_fmt="Could not load cache for {}: ", id=id + ) + else: + meta = _load_json_file( + meta_file, + manager, + log_success=f"Meta {id} ", + log_error=f"Could not load cache for {id}: ", + ) + if meta is None: + return None, [] + if manager.stats_enabled: + t1 = time.time() + if isinstance(meta, bytes): + # If either low-level buffer format or high-level cache layout changed, we + # cannot use the cache files, even with --skip-version-check. + # TODO: switch to something like librt.internal.read_byte() if this is slow. + if meta[0] != cache_version() or meta[1] != CACHE_VERSION: + manager.log(f"Metadata abandoned for {id}: incompatible cache format") + return None, [] + data_io = ReadBuffer(meta[2:]) + m = CacheMeta.read(data_io, data_file) + else: + m = CacheMeta.deserialize(meta, data_file) + if m is None: + manager.log(f"Metadata abandoned for {id}: cannot deserialize data") + return None, [] + if manager.stats_enabled: + t2 = time.time() + manager.add_stats( + load_meta_time=t2 - t0, load_meta_load_time=t1 - t0, load_meta_from_dict_time=t2 - t1 + ) + if skip_validation: + return m, [] + + # Ignore cache if generated by an older mypy version. + if m.version_id != manager.version_id and not manager.options.skip_version_check: + manager.log(f"Metadata abandoned for {id}: different mypy version") + return None, [] + + total_deps = len(m.dependencies) + len(m.suppressed) + if len(m.dep_prios) != total_deps or len(m.dep_lines) != total_deps: + manager.log(f"Metadata abandoned for {id}: broken dependencies") + return None, [] + + # Ignore cache if (relevant) options aren't the same. + # Note that it's fine to mutilate cached_options since it's only used here. + cached_options = m.options + current_options = options_snapshot(id, manager) + if manager.options.skip_version_check: + # When we're lax about version we're also lax about platform. + cached_options["platform"] = current_options["platform"] + if "debug_cache" in cached_options: + # Older versions included debug_cache, but it's silly to compare it. + del cached_options["debug_cache"] + if cached_options != current_options: + manager.log(f"Metadata abandoned for {id}: options differ") + if manager.options.verbosity >= 2: + for key in sorted(set(cached_options) | set(current_options)): + if cached_options.get(key) != current_options.get(key): + manager.trace( + " {}: {} != {}".format( + key, cached_options.get(key), current_options.get(key) + ) + ) + return None, [] + if manager.old_plugins_snapshot and manager.plugins_snapshot: + # Check if plugins are still the same. + if manager.plugins_snapshot != manager.old_plugins_snapshot: + manager.log(f"Metadata abandoned for {id}: plugins differ") + return None, [] + plugin_data = manager.plugin.report_config_data(ReportConfigContext(id, path, is_check=True)) + if not manager.options.fixed_format_cache: + # So that plugins can return data with tuples in it without + # things silently always invalidating modules, we round-trip + # the config data. This isn't beautiful. + plugin_data = json_loads(json_dumps(plugin_data)) + if m.plugin_data != plugin_data: + manager.log(f"Metadata abandoned for {id}: plugin configuration differs") + return None, [] + + # Load cached errors for this file, even if empty. This is needed to avoid + # invalid cache state after a crash/blocker/Ctrl+C etc. + errors_file = get_errors_name(meta_file) + if manager.options.fixed_format_cache: + errors = _load_ff_file( + errors_file, manager, log_error_fmt="Could not load errors for {}: ", id=id + ) + else: + errors = _load_json_file( + errors_file, + manager, + log_success=f"Errors {id} ", + log_error=f"Could not load errors for {id}: ", + ) + if errors is None: + return None, [] + if isinstance(errors, bytes): + data_io = ReadBuffer(errors) + e = read_errors(data_io) + else: + e = [tuple(err) for err in errors["error_lines"]] + manager.add_stats(fresh_metas=1) + return m, e + + +def validate_meta( + meta: CacheMeta | None, id: str, path: str | None, ignore_all: bool, manager: BuildManager +) -> CacheMeta | None: + """Checks whether the cached AST of this module can be used. + + Returns: + None, if the cached AST is unusable. + Original meta, if mtime/size matched. + Meta with mtime updated to match source file, if hash/size matched but mtime/path didn't. + """ + # This requires two steps. The first one is obvious: we check that the module source file + # contents is the same as it was when the cache data file was created. The second one is not + # too obvious: we check that the cache data file mtime has not changed; it is needed because + # we use cache data file mtime to propagate information about changes in the dependencies. + + if meta is None: + manager.log(f"Metadata not found for {id}") + return None + + if meta.ignore_all and not ignore_all: + manager.log(f"Metadata abandoned for {id}: errors were previously ignored") + return None + + if manager.stats_enabled: + t0 = time.time() + bazel = manager.options.bazel + assert path is not None, "Internal error: meta was provided without a path" + if not manager.options.skip_cache_mtime_checks: + # Check data_file; assume if its mtime matches it's good. + try: + data_mtime = manager.getmtime(meta.data_file) + except OSError: + manager.log(f"Metadata abandoned for {id}: failed to stat data_file") + return None + if data_mtime != meta.data_mtime: + manager.log(f"Metadata abandoned for {id}: data cache is modified") + return None + + if bazel: + # Normalize path under bazel to make sure it isn't absolute + path = normpath(path, manager.options) + + st = manager.get_stat(path) + if st is None: + return None + if not stat.S_ISDIR(st.st_mode) and not stat.S_ISREG(st.st_mode): + manager.log(f"Metadata abandoned for {id}: file or directory {path} does not exist") + return None + + if manager.stats_enabled: + manager.add_stats(validate_stat_time=time.time() - t0) + + # When we are using a fine-grained cache, we want our initial + # build() to load all of the cache information and then do a + # fine-grained incremental update to catch anything that has + # changed since the cache was generated. We *don't* want to do a + # coarse-grained incremental rebuild, so we accept the cache + # metadata even if it doesn't match the source file. + # + # We still *do* the mtime/hash checks, however, to enable + # fine-grained mode to take advantage of the mtime-updating + # optimization when mtimes differ but hashes match. There is + # essentially no extra time cost to computing the hash here, since + # it will be cached and will be needed for finding changed files + # later anyways. + fine_grained_cache = manager.use_fine_grained_cache() + + size = st.st_size + # Bazel ensures the cache is valid. + if size != meta.size and not bazel and not fine_grained_cache: + manager.log(f"Metadata abandoned for {id}: file {path} has different size") + return None + + # Bazel ensures the cache is valid. + mtime = 0 if bazel else int(st.st_mtime) + if not bazel and (mtime != meta.mtime or path != meta.path): + if manager.quickstart_state and path in manager.quickstart_state: + # If the mtime and the size of the file recorded in the quickstart dump matches + # what we see on disk, we know (assume) that the hash matches the quickstart + # data as well. If that hash matches the hash in the metadata, then we know + # the file is up to date even though the mtime is wrong, without needing to hash it. + qmtime, qsize, qhash = manager.quickstart_state[path] + if int(qmtime) == mtime and qsize == size and qhash == meta.hash: + manager.log(f"Metadata fresh (by quickstart) for {id}: file {path}") + meta.mtime = mtime + meta.path = path + return meta + + t0 = time.time() + try: + # dir means it is a namespace package + if stat.S_ISDIR(st.st_mode): + source_hash = "" + else: + source_hash = manager.fscache.hash_digest(path) + except (OSError, UnicodeDecodeError, DecodeError): + return None + manager.add_stats(validate_hash_time=time.time() - t0) + if source_hash != meta.hash: + if fine_grained_cache: + manager.log(f"Using stale metadata for {id}: file {path}") + return meta + else: + manager.log(f"Metadata abandoned for {id}: file {path} has different hash") + return None + else: + if manager.stats_enabled: + t0 = time.time() + # Optimization: update mtime and path (otherwise, this mismatch will reappear). + meta.mtime = mtime + meta.path = path + meta.size = size + meta.options = options_snapshot(id, manager) + meta_file, _, _ = get_cache_names(id, path, manager.options) + if manager.logging_enabled: + manager.log( + "Updating mtime for {}: file {}, meta {}, mtime {}".format( + id, path, meta_file, meta.mtime + ) + ) + write_cache_meta(meta, manager, meta_file) + if manager.stats_enabled: + t1 = time.time() + manager.add_stats( + validate_update_time=time.time() - t1, validate_munging_time=t1 - t0 + ) + return meta + + # It's a match on (id, path, size, hash, mtime). + if manager.logging_enabled: + manager.log(f"Metadata fresh for {id}: file {path}") + return meta + + +def compute_hash(text: str) -> str: + # We use a crypto hash instead of the builtin hash(...) function + # because the output of hash(...) can differ between runs due to + # hash randomization (enabled by default in Python 3.3). See the + # note in + # https://docs.python.org/3/reference/datamodel.html#object.__hash__. + return hash_digest(text.encode("utf-8")) + + +def write_cache( + id: str, + path: str, + tree: MypyFile, + dependencies: list[str], + suppressed: list[str], + suppressed_deps_opts: bytes, + imports_ignored: dict[int, list[str]], + dep_prios: list[int], + dep_lines: list[int], + old_interface_hash: bytes, + trans_dep_hash: bytes, + source_hash: str, + ignore_all: bool, + manager: BuildManager, +) -> tuple[bytes, tuple[CacheMeta, str] | None]: + """Write cache files for a module. + + Note that this mypy's behavior is still correct when any given + write_cache() call is replaced with a no-op, so error handling + code that bails without writing anything is okay. + + Args: + id: module ID + path: module path + tree: the fully checked module data + dependencies: module IDs on which this module depends + suppressed: module IDs which were suppressed as dependencies + dep_prios: priorities (parallel array to dependencies) + dep_lines: import line locations (parallel array to dependencies) + old_interface_hash: the hash from the previous version of the data cache file + source_hash: the hash of the source code + ignore_all: the ignore_all flag for this module + manager: the build manager (for pyversion, log/trace) + + Returns: + A tuple containing the interface hash and inner tuple with CacheMeta + that should be written and path to cache file (inner tuple may be None, + if the cache data could not be written). + """ + metastore = manager.metastore + # For Bazel we use relative paths and zero mtimes. + bazel = manager.options.bazel + + # Obtain file paths. + meta_file, data_file, _ = get_cache_names(id, path, manager.options) + manager.log(f"Writing {id} {path} {meta_file} {data_file}") + + # Update tree.path so that in bazel mode it's made relative (since + # sometimes paths leak out). + if bazel: + tree.path = path + + plugin_data = manager.plugin.report_config_data(ReportConfigContext(id, path, is_check=False)) + + # Serialize data and analyze interface + if manager.options.fixed_format_cache: + data_io = WriteBuffer() + tree.write(data_io) + data_bytes = data_io.getvalue() + else: + data = tree.serialize() + data_bytes = json_dumps(data, manager.options.debug_cache) + interface_hash = hash_digest_bytes(data_bytes + json_dumps(plugin_data)) + + # Obtain and set up metadata + st = manager.get_stat(path) + if st is None: + manager.log(f"Cannot get stat for {path}") + # Remove apparently-invalid cache files. + # (This is purely an optimization.) + for filename in [data_file, meta_file]: + try: + os.remove(filename) + except OSError: + pass + # Still return the interface hash we computed. + return interface_hash, None + + # Write data cache file, if applicable + # Note that for Bazel we don't record the data file's mtime. + if old_interface_hash == interface_hash: + manager.trace(f"Interface for {id} is unchanged") + else: + manager.trace(f"Interface for {id} has changed") + if not metastore.write(data_file, data_bytes): + # Most likely the error is the replace() call + # (see https://github.com/python/mypy/issues/3215). + manager.log(f"Error writing cache data file {data_file}") + # Let's continue without writing the meta file. Analysis: + # If the replace failed, we've changed nothing except left + # behind an extraneous temporary file; if the replace + # worked but the getmtime() call failed, the meta file + # will be considered invalid on the next run because the + # data_mtime field won't match the data file's mtime. + # Both have the effect of slowing down the next run a + # little bit due to an out-of-date cache file. + return interface_hash, None + + try: + data_mtime = manager.getmtime(data_file) + except OSError: + manager.log(f"Error in os.stat({data_file!r}), skipping cache write") + return interface_hash, None + + mtime = 0 if bazel else int(st.st_mtime) + size = st.st_size + # Note that the options we store in the cache are the options as + # specified by the command line/config file and *don't* reflect + # updates made by inline config directives in the file. This is + # important, or otherwise the options would never match when + # verifying the cache. + assert source_hash is not None + meta = CacheMeta( + id=id, + path=path, + mtime=mtime, + size=size, + hash=source_hash, + dependencies=dependencies, + data_mtime=data_mtime, + data_file=data_file, + suppressed=suppressed, + imports_ignored=imports_ignored, + options=options_snapshot(id, manager), + suppressed_deps_opts=suppressed_deps_opts, + dep_prios=dep_prios, + dep_lines=dep_lines, + interface_hash=interface_hash, + trans_dep_hash=trans_dep_hash, + version_id=manager.version_id, + ignore_all=ignore_all, + plugin_data=plugin_data, + # This one will be filled by the caller. + dep_hashes=[], + ) + return interface_hash, (meta, meta_file) + + +def write_cache_meta(meta: CacheMeta, manager: BuildManager, meta_file: str) -> None: + # Write meta cache file + metastore = manager.metastore + if manager.options.fixed_format_cache: + data_io = WriteBuffer() + meta.write(data_io) + # Prefix with both low- and high-level cache format versions for future validation. + # TODO: switch to something like librt.internal.write_byte() if this is slow. + meta_bytes = bytes([cache_version(), CACHE_VERSION]) + data_io.getvalue() + else: + meta_dict = meta.serialize() + meta_bytes = json_dumps(meta_dict, manager.options.debug_cache) + if not metastore.write(meta_file, meta_bytes): + # Most likely the error is the replace() call + # (see https://github.com/python/mypy/issues/3215). + # The next run will simply find the cache entry out of date. + manager.log(f"Error writing cache meta file {meta_file}") + + +def write_errors_file( + meta_file: str, error_lines: list[ErrorTuple], manager: BuildManager +) -> None: + # Write errors cache file + errors_file = get_errors_name(meta_file) + metastore = manager.metastore + if manager.options.fixed_format_cache: + data_io = WriteBuffer() + write_errors(data_io, error_lines) + meta_bytes = data_io.getvalue() + else: + # Some generic JSON helpers require top-level to be a dict. + meta_bytes = json_dumps({"error_lines": error_lines}, manager.options.debug_cache) + if not metastore.write(errors_file, meta_bytes): + manager.log(f"Error writing errors file {errors_file}") + + +"""Dependency manager. + +Design +====== + +Ideally +------- + +A. Collapse cycles (each SCC -- strongly connected component -- + becomes one "supernode"). + +B. Topologically sort nodes based on dependencies. + +C. Process from leaves towards roots. + +Wrinkles +-------- + +a. Need to parse source modules to determine dependencies. + +b. Processing order for modules within an SCC. + +c. Must order mtimes of files to decide whether to re-process; depends + on clock never resetting. + +d. from P import M; checks filesystem whether module P.M exists in + filesystem. + +e. Race conditions, where somebody modifies a file while we're + processing. Solved by using a FileSystemCache. + + +Steps +----- + +1. For each explicitly given module find the source file location. + +2. For each such module load and check the cache metadata, and decide + whether it's valid. + +3. Now recursively (or iteratively) find dependencies and add those to + the graph: + + - for cached nodes use the list of dependencies from the cache + metadata (this will be valid even if we later end up re-parsing + the same source); + + - for uncached nodes parse the file and process all imports found, + taking care of (a) above. + +Step 3 should also address (d) above. + +Once step 3 terminates we have the entire dependency graph, and for +each module we've either loaded the cache metadata or parsed the +source code. (However, we may still need to parse those modules for +which we have cache metadata but that depend, directly or indirectly, +on at least one module for which the cache metadata is stale.) + +Now we can execute steps A-C from the first section. Finding SCCs for +step A shouldn't be hard; there's a recipe here: +https://code.activestate.com/recipes/578507/. There's also a plethora +of topsort recipes, e.g. https://code.activestate.com/recipes/577413/. + +For single nodes, processing is simple. If the node was cached, we +deserialize the cache data and fix up cross-references. Otherwise, we +do semantic analysis followed by type checking. Once we (re-)processed +an SCC we check whether its interface (symbol table) is still fresh +(matches previous cached value). If it is not, we consider dependent SCCs +stale so that they need to be re-parsed as well. + +Note on indirect dependencies: normally dependencies are determined from +imports, but since our interfaces are "opaque" (i.e. symbol tables can +contain cross-references as well as types identified by name), these are not +enough. We *must* also add "indirect" dependencies from symbols and types to +their definitions. For this purpose, we record all accessed symbols during +semantic analysis, and after we finished processing a module, we traverse its +type map, and for each type we find (transitively) on which named types it +depends. + +Import cycles +------------- + +Finally we have to decide how to handle (b), import cycles. Here +we'll need a modified version of the original state machine +(build.py), but we only need to do this per SCC, and we won't have to +deal with changes to the list of nodes while we're processing it. + +If all nodes in the SCC have valid cache metadata and all dependencies +outside the SCC are still valid, we can proceed as follows: + + 1. Load cache data for all nodes in the SCC. + + 2. Fix up cross-references for all nodes in the SCC. + +Otherwise, the simplest (but potentially slow) way to proceed is to +invalidate all cache data in the SCC and re-parse all nodes in the SCC +from source. We can do this as follows: + + 1. Parse source for all nodes in the SCC. + + 2. Semantic analysis for all nodes in the SCC. + + 3. Type check all nodes in the SCC. + +(If there are more passes the process is the same -- each pass should +be done for all nodes before starting the next pass for any nodes in +the SCC.) + +We could process the nodes in the SCC in any order. For sentimental +reasons, I've decided to process them in the reverse order in which we +encountered them when originally constructing the graph. That's how +the old build.py deals with cycles, and at least this reproduces the +previous implementation more accurately. + +Can we do better than re-parsing all nodes in the SCC when any of its +dependencies are out of date? It's doubtful. The optimization +mentioned at the end of the previous section would require re-parsing +and type-checking a node and then comparing its symbol table to the +cached data; but because the node is part of a cycle we can't +technically type-check it until the semantic analysis of all other +nodes in the cycle has completed. (This is an important issue because +Dropbox has a very large cycle in production code. But I'd like to +deal with it later.) + +Additional wrinkles +------------------- + +During implementation more wrinkles were found. + +- When a submodule of a package (e.g. x.y) is encountered, the parent + package (e.g. x) must also be loaded, but it is not strictly a + dependency. See State.add_ancestors() below. +""" + + +class SuppressionReason: + NOT_FOUND: Final = 1 + SKIPPED: Final = 2 + + +class ModuleNotFound(Exception): + """Control flow exception to signal that a module was not found.""" + + def __init__(self, reason: int = SuppressionReason.NOT_FOUND) -> None: + self.reason = reason + + +@final +class State: + """The state for a module. + + The source is only used for the -c command line option; in that + case path is None. Otherwise, source is None and path isn't. + """ + + manager: BuildManager + order_counter: ClassVar[int] = 0 + order: int # Order in which modules were encountered + id: str # Fully qualified module name + path: str | None = None # Path to module source + abspath: str | None = None # Absolute path to module source + xpath: str # Path or '' + source: str | None = None # Module source code + source_hash: str | None = None # Hash calculated based on the source code + meta_source_hash: str | None = None # Hash of the source given in the meta, if any + meta: CacheMeta | None = None + tree: MypyFile | None = None + # We keep both a list and set of dependencies. A set because it makes it efficient to + # prevent duplicates and the list because I am afraid of changing the order of + # iteration over dependencies. + # They should be managed with add_dependency and suppress_dependency. + dependencies: list[str] # Modules directly imported by the module + dependencies_set: set[str] # The same but as a set for deduplication purposes + suppressed: list[str] # Suppressed/missing dependencies + suppressed_set: set[str] # Suppressed/missing dependencies + priorities: dict[str, int] + + # Map each dependency to the line number where it is first imported + dep_line_map: dict[str, int] + + # Map from dependency id to its last observed interface hash + dep_hashes: dict[str, bytes] + + # List of errors reported for this file last time. + error_lines: list[ErrorTuple] + + # Parent package, its parent, etc. + ancestors: list[str] | None = None + + # List of (path, line number) tuples giving context for import + import_context: list[tuple[str, int]] + + # If caller_state is set, the line number in the caller where the import occurred + caller_line = 0 + + # Contains a hash of the public interface in incremental mode + interface_hash: bytes = b"" + + # Hash of import structure that this module depends on. It is not 1:1 with + # transitive dependencies set, but if two hashes are equal, transitive + # dependencies are guaranteed to be identical. Some expensive checks can be + # skipped if this value is unchanged for a module. + trans_dep_hash: bytes = b"" + + # Options, specialized for this file + options: Options + + # Whether to ignore all errors + ignore_all = False + + # Errors reported before semantic analysis, to allow fine-grained + # mode to keep reporting them. + early_errors: list[ErrorInfo] + + # Type checker used for checking this file. Use type_checker() for + # access and to construct this on demand. + _type_checker: TypeChecker | None = None + + fine_grained_deps_loaded = False + + # Cumulative time spent on this file, in microseconds (for profiling stats) + time_spent_us: int = 0 + + # Per-line type-checking time (cumulative time spent type-checking expressions + # on a given source code line). + per_line_checking_time_ns: dict[int, int] + + # Rough estimate of how much time it would take to process this file. Currently, + # we use file size as a proxy for complexity. + size_hint: int + + # Mapping from line number to type ignore codes on this line (for imports only). + imports_ignored: dict[int, list[str]] + + @staticmethod + def new_state( + id: str | None, + path: str | None, + source: str | None, + manager: BuildManager, + caller_state: State | None = None, + caller_line: int = 0, + ancestor_for: State | None = None, + root_source: bool = False, + # If `temporary` is True, this State is being created to just + # quickly parse/load the tree, without an intention to further + # process it. With this flag, any changes to external state as well + # as error reporting should be avoided. + temporary: bool = False, + ) -> State: + if not temporary: + assert id or path or source is not None, "Neither id, path nor source given" + State.order_counter += 1 + if caller_state: + import_context = caller_state.import_context.copy() + import_context.append((caller_state.xpath, caller_line)) + else: + import_context = [] + id = id or "__main__" + options = manager.options.clone_for_module(id) + manager.import_options[id] = options.dep_import_options() + + ignore_all = False + if not path and source is None: + assert id is not None + try: + path, follow_imports = find_module_and_diagnose( + manager, + id, + options, + caller_state, + caller_line, + ancestor_for, + root_source, + skip_diagnose=temporary, + ) + except ModuleNotFound as exc: + if not temporary: + manager.missing_modules[id] = exc.reason + raise + if follow_imports == "silent": + ignore_all = True + elif path and is_silent_import_module(manager, path) and not root_source: + ignore_all = True + + meta = None + interface_hash = b"" + meta_source_hash = None + if path and source is None and manager.cache_enabled: + meta, error_lines = find_cache_meta(id, path, manager) + # TODO: Get mtime if not cached. + if meta is not None: + interface_hash = meta.interface_hash + meta_source_hash = meta.hash + if path and source is None and manager.fscache.isdir(path): + source = "" + + if manager.stats_enabled: + t0 = time.time() + meta = validate_meta(meta, id, path, ignore_all, manager) + if manager.stats_enabled: + manager.add_stats(validate_meta_time=time.time() - t0) + + if meta: + # Make copies, since we may modify these and want to + # compare them to the originals later. + dependencies = list(meta.dependencies) + suppressed = list(meta.suppressed) + all_deps = dependencies + suppressed + assert len(all_deps) == len(meta.dep_prios) + priorities = {id: pri for id, pri in zip(all_deps, meta.dep_prios)} + assert len(all_deps) == len(meta.dep_lines) + dep_line_map = {id: line for id, line in zip(all_deps, meta.dep_lines)} + assert len(meta.dep_hashes) == len(meta.dependencies) + dep_hashes = {k: v for (k, v) in zip(meta.dependencies, meta.dep_hashes)} + # Only copy `error_lines` if the module is not silently imported. + error_lines = [] if ignore_all else error_lines + imports_ignored = meta.imports_ignored + else: + dependencies = [] + suppressed = [] + priorities = {} + dep_line_map = {} + dep_hashes = {} + error_lines = [] + imports_ignored = {} + + state = State( + manager=manager, + order=State.order_counter, + id=id, + path=path, + source=source, + options=options, + ignore_all=ignore_all, + caller_line=caller_line, + import_context=import_context, + meta=meta, + interface_hash=interface_hash, + meta_source_hash=meta_source_hash, + dependencies=dependencies, + suppressed=suppressed, + priorities=priorities, + dep_line_map=dep_line_map, + dep_hashes=dep_hashes, + error_lines=error_lines, + imports_ignored=imports_ignored, + ) + + if meta: + if temporary: + state.load_tree(temporary=True) + if not manager.use_fine_grained_cache(): + # Special case: if there were a previously missing package imported here, + # and it is not present, then we need to re-calculate dependencies. + # This is to support patterns like this: + # from missing_package import missing_module # type: ignore + # At first mypy doesn't know that `missing_module` is a module + # (it may be a variable, a class, or a function), so it is not added to + # suppressed dependencies. Therefore, when the package with module is added, + # we need to re-calculate dependencies. + # NOTE: see comment below for why we skip this in fine-grained mode. + if exist_added_packages(suppressed, manager): + state.parse_file() # This is safe because the cache is anyway stale. + state.compute_dependencies() + # This is an inverse to the situation above. If we had an import like this: + # from pkg import mod + # and then mod was deleted, we need to force recompute dependencies, to + # decide whether we should still depend on a missing pkg.mod. Otherwise, + # the above import is indistinguishable from something like this: + # import pkg + # import pkg.mod + if exist_removed_submodules(dependencies, manager): + state.parse_file() # Same as above, the current state is stale anyway. + state.compute_dependencies() + state.size_hint = meta.size + else: + # When doing a fine-grained cache load, pretend we only + # know about modules that have cache information and defer + # handling new modules until the fine-grained update. + if manager.use_fine_grained_cache(): + manager.log(f"Deferring module to fine-grained update {path} ({id})") + raise ModuleNotFound + + # Parse the file (and then some) to get the dependencies. + state.parse_file(temporary=temporary) + state.compute_dependencies() + if manager.workers and state.tree: + # We don't need imports in coordinator process anymore, we parse only to + # compute dependencies. + state.tree.imports = [] + del manager.ast_cache[id] + + return state + + def __init__( + self, + manager: BuildManager, + order: int, + id: str, + path: str | None, + source: str | None, + options: Options, + ignore_all: bool, + caller_line: int, + import_context: list[tuple[str, int]], + meta: CacheMeta | None, + interface_hash: bytes, + meta_source_hash: str | None, + dependencies: list[str], + suppressed: list[str], + priorities: dict[str, int], + dep_line_map: dict[str, int], + dep_hashes: dict[str, bytes], + error_lines: list[ErrorTuple], + imports_ignored: dict[int, list[str]], + size_hint: int = 0, + ) -> None: + self.manager = manager + self.order = order + self.id = id + self.path = path + if path: + # Avoid calling os.abspath, since it makes a getcwd() syscall, which is slow + if os.path.isabs(path): + self.abspath = path + else: + self.abspath = os.path.normpath(os_path_join(manager.cwd, path)) + self.xpath = path or "" + self.source = source + self.options = options + self.ignore_all = ignore_all + self.caller_line = caller_line + self.import_context = import_context + self.meta = meta + self.interface_hash = interface_hash + self.meta_source_hash = meta_source_hash + self.dependencies = dependencies + self.suppressed = suppressed + self.dependencies_set = set(dependencies) + self.suppressed_set = set(suppressed) + self.priorities = priorities + self.dep_line_map = dep_line_map + self.dep_hashes = dep_hashes + self.error_lines = error_lines + self.per_line_checking_time_ns = collections.defaultdict(int) + self.early_errors = [] + self._type_checker = None + self.add_ancestors() + self.imports_ignored = imports_ignored + self.size_hint = size_hint + # Pre-computed opaque value of suppressed_deps_opts() used + # to minimize amount of data sent to parallel workers. + self.known_suppressed_deps_opts: bytes | None = None + + def write(self, buf: WriteBuffer) -> None: + """Serialize State for sending to build worker. + + Note that unlike write() methods for most other classes, this one is + not idempotent. We erase some bulky values that should either be not needed + for processing by the worker, or can be re-created from other data relatively + quickly. These are: + * self.meta: workers will call self.reload_meta() anyway. + * self.options: can be restored with Options.clone_for_module(). + * self.error_lines: fresh errors are handled by the coordinator. + """ + write_int(buf, self.order) + write_str(buf, self.id) + write_str_opt(buf, self.path) + write_str_opt(buf, self.source) # mostly for mypy -c '' + write_bool(buf, self.ignore_all) + write_int(buf, self.caller_line) + write_tag(buf, LIST_GEN) + write_int_bare(buf, len(self.import_context)) + for path, line in self.import_context: + write_str(buf, path) + write_int(buf, line) + write_bytes(buf, self.interface_hash) + write_str_opt(buf, self.meta_source_hash) + write_str_list(buf, self.dependencies) + write_str_list(buf, self.suppressed) + # TODO: we can possibly serialize these dictionaries in a more compact way. + # Most keys in the dictionaries should be the same, so we can write them once. + write_tag(buf, DICT_STR_GEN) + write_int_bare(buf, len(self.priorities)) + for mod_id, prio in self.priorities.items(): + write_str_bare(buf, mod_id) + write_int(buf, prio) + write_tag(buf, DICT_STR_GEN) + write_int_bare(buf, len(self.dep_line_map)) + for mod_id, line in self.dep_line_map.items(): + write_str_bare(buf, mod_id) + write_int(buf, line) + write_tag(buf, DICT_STR_GEN) + write_int_bare(buf, len(self.dep_hashes)) + for mod_id, dep_hash in self.dep_hashes.items(): + write_str_bare(buf, mod_id) + write_bytes(buf, dep_hash) + write_int(buf, self.size_hint) + + @classmethod + def read(cls, buf: ReadBuffer, manager: BuildManager) -> State: + order = read_int(buf) + id = read_str(buf) + path = read_str_opt(buf) + source = read_str_opt(buf) + ignore_all = read_bool(buf) + caller_line = read_int(buf) + assert read_tag(buf) == LIST_GEN + import_context = [(read_str(buf), read_int(buf)) for _ in range(read_int_bare(buf))] + interface_hash = read_bytes(buf) + meta_source_hash = read_str_opt(buf) + dependencies = read_str_list(buf) + suppressed = read_str_list(buf) + assert read_tag(buf) == DICT_STR_GEN + priorities = {read_str_bare(buf): read_int(buf) for _ in range(read_int_bare(buf))} + assert read_tag(buf) == DICT_STR_GEN + dep_line_map = {read_str_bare(buf): read_int(buf) for _ in range(read_int_bare(buf))} + assert read_tag(buf) == DICT_STR_GEN + dep_hashes = {read_str_bare(buf): read_bytes(buf) for _ in range(read_int_bare(buf))} + return cls( + manager=manager, + order=order, + id=id, + path=path, + source=source, + # The caller must call clone_for_module(). + options=manager.options, + ignore_all=ignore_all, + caller_line=caller_line, + import_context=import_context, + meta=None, + interface_hash=interface_hash, + meta_source_hash=meta_source_hash, + dependencies=dependencies, + suppressed=suppressed, + priorities=priorities, + dep_line_map=dep_line_map, + dep_hashes=dep_hashes, + error_lines=[], + imports_ignored={}, + size_hint=read_int(buf), + ) + + def reload_meta(self) -> None: + """Force reload of cache meta. + + This is used by parallel checking workers to update shared information + that may have changed after initial graph loading. Currently, this is only + the interface hash. + """ + assert self.path is not None + self.meta, _ = find_cache_meta(self.id, self.path, self.manager, skip_validation=True) + assert self.meta is not None + self.interface_hash = self.meta.interface_hash + + def add_ancestors(self) -> None: + if self.path is not None: + _, name = os.path.split(self.path) + base, _ = os.path.splitext(name) + if "." in base: + # This is just a weird filename, don't add anything + self.ancestors = [] + return + # All parent packages are new ancestors. + ancestors = [] + parent = self.id + while "." in parent: + parent, _ = parent.rsplit(".", 1) + ancestors.append(parent) + self.ancestors = ancestors + + def is_fresh(self) -> bool: + """Return whether the cache data for this file is fresh.""" + # NOTE: self.dependencies may differ from + # self.meta.dependencies when a dependency is dropped due to + # suppression by silent mode. However, when a suppressed + # dependency is added back we find out later in the process. + # Additionally, we need to verify that import following options are + # same for suppressed dependencies, even if the first check is OK. + return ( + self.meta is not None + and self.dependencies == self.meta.dependencies + and ( + self.options.fine_grained_incremental + or self.meta.suppressed_deps_opts == self.suppressed_deps_opts() + ) + ) + + def mark_as_rechecked(self) -> None: + """Marks this module as having been fully re-analyzed by the type-checker.""" + self.manager.rechecked_modules.add(self.id) + + def mark_interface_stale(self) -> None: + """Marks this module as having a stale public interface, and discards the cache data.""" + self.manager.stale_modules.add(self.id) + + def check_blockers(self) -> None: + """Raise CompileError if a blocking error is detected.""" + if self.manager.errors.is_blockers(): + self.manager.log("Bailing due to blocking errors") + self.manager.errors.raise_error() + + @contextlib.contextmanager + def wrap_context(self, check_blockers: bool = True) -> Iterator[None]: + """Temporarily change the error import context to match this state. + + Also report an internal error if an unexpected exception was raised + and raise an exception on a blocking error, unless + check_blockers is False. Skipping blocking error reporting is used + in the semantic analyzer so that we can report all blocking errors + for a file (across multiple targets) to maintain backward + compatibility. + """ + save_import_context = self.manager.errors.import_context() + self.manager.errors.set_import_context(self.import_context) + try: + yield + except CompileError: + raise + except Exception as err: + report_internal_error( + err, + self.path, + 0, + self.manager.errors, + self.options, + self.manager.stdout, + self.manager.stderr, + ) + self.manager.errors.set_import_context(save_import_context) + # TODO: Move this away once we've removed the old semantic analyzer? + if check_blockers: + self.check_blockers() + + def load_fine_grained_deps(self) -> dict[str, set[str]]: + return self.manager.load_fine_grained_deps(self.id) + + def load_tree(self, temporary: bool = False) -> None: + if self.manager.parallel_worker: + assert self.path is not None + _, data_file, _ = get_cache_names(self.id, self.path, self.manager.options) + else: + assert ( + self.meta is not None + ), "Internal error: this method must be called only for cached modules" + data_file = self.meta.data_file + + data: bytes | dict[str, Any] | None + if self.options.fixed_format_cache: + data = _load_ff_file(data_file, self.manager, "Could not load tree: ", None) + else: + data = _load_json_file(data_file, self.manager, "Load tree ", "Could not load tree: ") + if data is None: + return + + t0 = time.time() + # TODO: Assert data file wasn't changed. + if isinstance(data, bytes): + data_io = ReadBuffer(data) + self.tree = MypyFile.read(data_io) + else: + self.tree = MypyFile.deserialize(data) + t1 = time.time() + self.manager.add_stats(deserialize_time=t1 - t0) + if not temporary: + self.manager.modules[self.id] = self.tree + self.manager.add_stats(fresh_trees=1) + + def fix_cross_refs(self) -> None: + assert self.tree is not None, "Internal error: method must be called on parsed file only" + # We need to set allow_missing when doing a fine-grained cache + # load because we need to gracefully handle missing modules. + fixup_module(self.tree, self.manager.modules, self.options.use_fine_grained_cache) + + # Methods for processing modules from source code. + + def parse_file(self, *, temporary: bool = False, raw_data: FileRawData | None = None) -> None: + """Parse file and run first pass of semantic analysis. + + Everything done here is local to the file. Don't depend on imported + modules in any way. Also record module dependencies based on imports. + """ + if self.tree is not None: + # The file was already parsed (in __init__()). + return + + manager = self.manager + + # Can we reuse a previously parsed AST? This avoids redundant work in daemon. + cached = self.id in manager.ast_cache + modules = manager.modules + if not cached: + manager.log(f"Parsing {self.xpath} ({self.id})") + else: + manager.log(f"Using cached AST for {self.xpath} ({self.id})") + + t0 = time_ref() + + with self.wrap_context(): + source = self.source + if self.path and source is None: + try: + path = manager.maybe_swap_for_shadow_path(self.path) + source = decode_python_encoding(manager.fscache.read(path)) + self.source_hash = manager.fscache.hash_digest(path) + except OSError as ioerr: + # ioerr.strerror differs for os.stat failures between Windows and + # other systems, but os.strerror(ioerr.errno) does not, so we use that. + # (We want the error messages to be platform-independent so that the + # tests have predictable output.) + assert ioerr.errno is not None + raise CompileError( + [ + "mypy: error: cannot read file '{}': {}".format( + self.path.replace(os.getcwd() + os.sep, ""), + os.strerror(ioerr.errno), + ) + ], + module_with_blocker=self.id, + ) from ioerr + except (UnicodeDecodeError, DecodeError) as decodeerr: + if self.path.endswith(".pyd"): + err = f"{self.path}: error: stubgen does not support .pyd files" + else: + err = f"{self.path}: error: cannot decode file: {str(decodeerr)}" + raise CompileError([err], module_with_blocker=self.id) from decodeerr + elif self.path and self.manager.fscache.isdir(self.path): + source = "" + self.source_hash = "" + else: + assert source is not None + self.source_hash = compute_hash(source) + + self.parse_inline_configuration(source) + self.check_for_invalid_options() + + self.size_hint = len(source) + if not cached: + ignore_errors = self.ignore_all or self.options.ignore_errors + self.tree = manager.parse_file( + self.id, + self.xpath, + source, + ignore_errors=ignore_errors, + options=self.options, + raw_data=raw_data, + ) + else: + # Reuse a cached AST + self.tree = manager.ast_cache[self.id][0] + + self.time_spent_us += time_spent_us(t0) + + if not cached: + # Make a copy of any errors produced during parse time so that + # fine-grained mode can repeat them when the module is + # reprocessed. + self.early_errors = list(manager.errors.error_info_map.get(self.xpath, [])) + self.semantic_analysis_pass1() + else: + self.early_errors = manager.ast_cache[self.id][1] + + if not temporary: + modules[self.id] = self.tree + self.check_blockers() + + manager.ast_cache[self.id] = (self.tree, self.early_errors) + self.setup_errors() + + def setup_errors(self) -> None: + assert self.tree is not None + self.manager.errors.set_file_ignored_lines( + self.xpath, self.tree.ignored_lines, self.ignore_all or self.options.ignore_errors + ) + self.manager.errors.set_skipped_lines(self.xpath, self.tree.skipped_lines) + + def parse_inline_configuration(self, source: str) -> None: + """Check for inline mypy: options directive and parse them.""" + flags = get_mypy_comments(source) + if flags: + changes, config_errors = parse_mypy_comments(flags, self.options) + self.options = self.options.apply_changes(changes) + self.manager.errors.set_file(self.xpath, self.id, self.options) + for lineno, error in config_errors: + self.manager.error(lineno, error) + + def check_for_invalid_options(self) -> None: + if self.options.mypyc and not self.options.strict_bytes: + self.manager.errors.set_file(self.xpath, self.id, options=self.options) + self.manager.error( + None, "Option --strict-bytes cannot be disabled when using mypyc", blocker=True + ) + + def semantic_analysis_pass1(self) -> None: + """Perform pass 1 of semantic analysis, which happens immediately after parsing. + + This pass can't assume that any other modules have been processed yet. + """ + options = self.options + assert self.tree is not None + + t0 = time_ref() + + # Do the first pass of semantic analysis: analyze the reachability + # of blocks and import statements. We must do this before + # processing imports, since this may mark some import statements as + # unreachable. + # + # TODO: This should not be considered as a semantic analysis + # pass -- it's an independent pass. + if not options.native_parser: + analyzer = SemanticAnalyzerPreAnalysis() + with self.wrap_context(): + analyzer.visit_file(self.tree, self.xpath, self.id, options) + # TODO: Do this while constructing the AST? + self.tree.names = SymbolTable() + if not self.tree.is_stub: + if not self.options.allow_redefinition_new: + # Perform some low-key variable renaming when assignments can't + # widen inferred types + self.tree.accept(LimitedVariableRenameVisitor()) + if options.allow_redefinition_old: + # Perform more renaming across the AST to allow variable redefinitions + self.tree.accept(VariableRenameVisitor()) + self.time_spent_us += time_spent_us(t0) + + def add_dependency(self, dep: str) -> None: + if dep not in self.dependencies_set: + self.dependencies.append(dep) + self.dependencies_set.add(dep) + if dep in self.suppressed_set: + self.suppressed.remove(dep) + self.suppressed_set.remove(dep) + + def suppress_dependency(self, dep: str) -> None: + if dep in self.dependencies_set: + self.dependencies.remove(dep) + self.dependencies_set.remove(dep) + if dep not in self.suppressed_set: + self.suppressed.append(dep) + self.suppressed_set.add(dep) + + def compute_dependencies(self) -> None: + """Compute a module's dependencies after parsing it. + + This is used when we parse a file that we didn't have + up-to-date cache information for. When we have an up-to-date + cache, we just use the cached info. + """ + manager = self.manager + assert self.tree is not None + + # Compute (direct) dependencies. + # Add all direct imports (this is why we needed the first pass). + # Also keep track of each dependency's source line. + # Missing dependencies will be moved from dependencies to + # suppressed when they fail to be loaded in load_graph. + + self.dependencies = [] + self.dependencies_set = set() + self.suppressed = [] + self.suppressed_set = set() + self.priorities = {} # id -> priority + self.dep_line_map = {} # id -> line + self.dep_hashes = {} + dep_entries = manager.all_imported_modules_in_file( + self.tree + ) + self.manager.plugin.get_additional_deps(self.tree) + for pri, id, line in dep_entries: + self.priorities[id] = min(pri, self.priorities.get(id, PRI_ALL)) + if id == self.id: + continue + self.add_dependency(id) + if id not in self.dep_line_map: + self.dep_line_map[id] = line + import_lines = self.dep_line_map.values() + self.imports_ignored = { + line: codes for line, codes in self.tree.ignored_lines.items() if line in import_lines + } + # Every module implicitly depends on builtins. + if self.id != "builtins": + self.add_dependency("builtins") + if self.tree.uses_template_strings: + self.add_dependency("string.templatelib") + + self.check_blockers() # Can fail due to bogus relative imports + + def type_check_first_pass(self) -> None: + if self.options.semantic_analysis_only: + return + t0 = time_ref() + with self.wrap_context(): + self.type_checker().check_first_pass() + self.time_spent_us += time_spent_us(t0) + + def type_checker(self) -> TypeChecker: + if not self._type_checker: + assert self.tree is not None, "Internal error: must be called on parsed file only" + manager = self.manager + self._type_checker = TypeChecker( + manager.errors, + manager.modules, + self.options, + self.tree, + self.xpath, + manager.plugin, + self.per_line_checking_time_ns, + ) + return self._type_checker + + def type_map(self) -> dict[Expression, Type]: + # We can extract the master type map directly since at this + # point no temporary type maps can be active. + assert len(self.type_checker()._type_maps) == 1 + return self.type_checker()._type_maps[0] + + def type_check_second_pass(self) -> bool: + if self.options.semantic_analysis_only: + return False + t0 = time_ref() + with self.wrap_context(): + result = self.type_checker().check_second_pass() + self.time_spent_us += time_spent_us(t0) + return result + + def detect_possibly_undefined_vars(self) -> None: + assert self.tree is not None, "Internal error: method must be called on parsed file only" + if self.tree.is_stub: + # We skip stub files because they aren't actually executed. + return + manager = self.manager + manager.errors.set_file(self.xpath, self.tree.fullname, options=self.options) + if manager.errors.is_error_code_enabled( + codes.POSSIBLY_UNDEFINED + ) or manager.errors.is_error_code_enabled(codes.USED_BEFORE_DEF): + self.tree.accept( + PossiblyUndefinedVariableVisitor( + MessageBuilder(manager.errors, manager.modules), + self.type_map(), + self.options, + self.tree.names, + ) + ) + + def finish_passes(self) -> None: + assert self.tree is not None, "Internal error: method must be called on parsed file only" + manager = self.manager + if self.options.semantic_analysis_only: + return + t0 = time_ref() + with self.wrap_context(): + # Some tests (and tools) want to look at the set of all types. + options = manager.options + if options.export_types: + manager.all_types.update(self.type_map()) + + # We should always patch indirect dependencies, even in full (non-incremental) builds, + # because the cache still may be written, and it must be correct. + self.patch_indirect_dependencies( + # Two possible sources of indirect dependencies: + # * Symbols not directly imported in this module but accessed via an attribute + # or via a re-export (vast majority of these recorded in semantic analysis). + # * For each expression type we need to record definitions of type components + # since "meaning" of the type may be updated when definitions are updated. + self.tree.module_refs | self.type_checker().module_refs, + set(self.type_map().values()), + ) + + if self.options.dump_inference_stats: + dump_type_stats( + self.tree, + self.xpath, + modules=self.manager.modules, + inferred=True, + typemap=self.type_map(), + ) + manager.report_file(self.tree, self.type_map(), self.options) + + self.update_fine_grained_deps(self.manager.fg_deps) + + if manager.options.export_ref_info: + write_undocumented_ref_info( + self, manager.metastore, manager.options, self.type_map() + ) + + self.free_state() + if not manager.options.fine_grained_incremental and not manager.options.preserve_asts: + free_tree(self.tree) + self.tree.defs.clear() + self.time_spent_us += time_spent_us(t0) + + def free_state(self) -> None: + if self._type_checker: + self._type_checker.reset() + self._type_checker = None + + def patch_indirect_dependencies(self, module_refs: set[str], types: set[Type]) -> None: + assert self.ancestors is not None + existing_deps = set(self.dependencies + self.suppressed + self.ancestors) + existing_deps.add(self.id) + + encountered = self.manager.indirection_detector.find_modules(types) | module_refs + for dep in sorted(encountered - existing_deps): + if dep not in self.manager.modules: + continue + self.add_dependency(dep) + self.priorities[dep] = PRI_INDIRECT + + def compute_fine_grained_deps(self) -> dict[str, set[str]]: + assert self.tree is not None + if self.id in ("builtins", "typing", "types", "sys", "_typeshed"): + # We don't track changes to core parts of typeshed -- the + # assumption is that they are only changed as part of mypy + # updates, which will invalidate everything anyway. These + # will always be processed in the initial non-fine-grained + # build. Other modules may be brought in as a result of an + # fine-grained increment, and we may need these + # dependencies then to handle cyclic imports. + return {} + from mypy.server.deps import get_dependencies # Lazy import to speed up startup + + return get_dependencies( + target=self.tree, + type_map=self.type_map(), + python_version=self.options.python_version, + options=self.manager.options, + ) + + def update_fine_grained_deps(self, deps: dict[str, set[str]]) -> None: + options = self.manager.options + if options.cache_fine_grained or options.fine_grained_incremental: + from mypy.server.deps import merge_dependencies # Lazy import to speed up startup + + merge_dependencies(self.compute_fine_grained_deps(), deps) + type_state.update_protocol_deps(deps) + + def suppressed_deps_opts(self) -> bytes: + if not self.suppressed: + return b"" + if self.known_suppressed_deps_opts: + return self.known_suppressed_deps_opts + buf = WriteBuffer() + import_options = self.manager.import_options + for dep in sorted(self.suppressed): + # Using .get() is a bit defensive, but just in case we have a bug elsewhere + # (e.g. in the daemon), it is better to get a stale cache than a crash. + reason = self.manager.missing_modules.get(dep, SuppressionReason.NOT_FOUND) + if self.priorities.get(dep) != PRI_INDIRECT: + write_str_bare(buf, dep) + write_bytes_bare(buf, import_options[dep]) + write_int_bare(buf, reason) + return buf.getvalue() + + def write_cache(self) -> tuple[CacheMeta, str] | None: + assert self.tree is not None, "Internal error: method must be called on parsed file only" + # We don't support writing cache files in fine-grained incremental mode. + if ( + not self.path + or self.options.cache_dir == os.devnull + or self.options.fine_grained_incremental + ): + if self.options.debug_serialize: + try: + if self.manager.options.fixed_format_cache: + data = WriteBuffer() + self.tree.write(data) + else: + self.tree.serialize() + except Exception: + print(f"Error serializing {self.id}", file=self.manager.stdout) + raise # Propagate to display traceback + return None + dep_prios = self.dependency_priorities() + dep_lines = self.dependency_lines() + assert self.source_hash is not None + assert len(set(self.dependencies)) == len( + self.dependencies + ), f"Duplicates in dependencies list for {self.id} ({self.dependencies})" + new_interface_hash, meta_tuple = write_cache( + self.id, + self.path, + self.tree, + list(self.dependencies), + list(self.suppressed), + self.suppressed_deps_opts(), + self.imports_ignored, + dep_prios, + dep_lines, + self.interface_hash, + self.trans_dep_hash, + self.source_hash, + self.ignore_all, + self.manager, + ) + if new_interface_hash == self.interface_hash: + self.manager.log(f"Cached module {self.id} has same interface") + else: + self.manager.log(f"Cached module {self.id} has changed interface") + self.mark_interface_stale() + self.interface_hash = new_interface_hash + return meta_tuple + + def verify_dependencies(self, suppressed_only: bool = False) -> None: + """Report errors for import targets in modules that don't exist. + + If suppressed_only is set, only check suppressed dependencies. + """ + manager = self.manager + assert self.ancestors is not None + # Strip out indirect dependencies. See comment in build.load_graph(). + if suppressed_only: + all_deps = [dep for dep in self.suppressed if self.priorities.get(dep) != PRI_INDIRECT] + else: + dependencies = [ + dep + for dep in self.dependencies + self.suppressed + if self.priorities.get(dep) != PRI_INDIRECT + ] + all_deps = dependencies + self.ancestors + for dep in all_deps: + if dep in manager.modules: + continue + options = manager.options.clone_for_module(dep) + if options.ignore_missing_imports: + continue + line = self.dep_line_map.get(dep, 1) + try: + if dep in self.ancestors: + state: State | None = None + ancestor: State | None = self + else: + state, ancestor = self, None + # Called just for its side effects of producing diagnostics. + find_module_and_diagnose( + manager, + dep, + options, + caller_state=state, + caller_line=line, + ancestor_for=ancestor, + ) + except (ModuleNotFound, CompileError): + # Swallow up any ModuleNotFounds or CompilerErrors while generating + # a diagnostic. CompileErrors may get generated in + # fine-grained mode when an __init__.py is deleted, if a module + # that was in that package has targets reprocessed before + # it is renamed. + pass + + def dependency_priorities(self) -> list[int]: + return [self.priorities.get(dep, PRI_HIGH) for dep in self.dependencies + self.suppressed] + + def dependency_lines(self) -> list[int]: + return [self.dep_line_map.get(dep, 1) for dep in self.dependencies + self.suppressed] + + def generate_unused_ignore_notes(self) -> None: + if ( + self.options.warn_unused_ignores + or codes.UNUSED_IGNORE in self.options.enabled_error_codes + ) and codes.UNUSED_IGNORE not in self.options.disabled_error_codes: + # We only need this for the daemon, regular incremental does this unconditionally. + if self.meta and self.options.fine_grained_incremental: + self.verify_dependencies(suppressed_only=True) + is_typeshed = self.tree is not None and self.tree.is_typeshed_file(self.options) + self.manager.errors.generate_unused_ignore_errors(self.xpath, is_typeshed) + + def generate_ignore_without_code_notes(self) -> None: + if self.manager.errors.is_error_code_enabled(codes.IGNORE_WITHOUT_CODE): + is_typeshed = self.tree is not None and self.tree.is_typeshed_file(self.options) + self.manager.errors.generate_ignore_without_code_errors( + self.xpath, self.options.warn_unused_ignores, is_typeshed + ) + + +# Module import and diagnostic glue + + +def find_module_and_diagnose( + manager: BuildManager, + id: str, + options: Options, + caller_state: State | None = None, + caller_line: int = 0, + ancestor_for: State | None = None, + root_source: bool = False, + skip_diagnose: bool = False, +) -> tuple[str, str]: + """Find a module by name, respecting follow_imports and producing diagnostics. + + If the module is not found, then the ModuleNotFound exception is raised. + + Args: + id: module to find + options: the options for the module being loaded + caller_state: the state of the importing module, if applicable + caller_line: the line number of the import + ancestor_for: the child module this is an ancestor of, if applicable + root_source: whether this source was specified on the command line + skip_diagnose: skip any error diagnosis and reporting (but ModuleNotFound is + still raised if the module is missing) + + The specified value of follow_imports for a module can be overridden + if the module is specified on the command line or if it is a stub, + so we compute and return the "effective" follow_imports of the module. + + Returns a tuple containing (file path, target's effective follow_imports setting) + """ + result = find_module_with_reason(id, manager) + if isinstance(result, str): + # For non-stubs, look at options.follow_imports: + # - normal (default) -> fully analyze + # - silent -> analyze but silence errors + # - skip -> don't analyze, make the type Any + follow_imports = options.follow_imports + if ( + root_source # Honor top-level modules + or ( + result.endswith(".pyi") # Stubs are always normal + and not options.follow_imports_for_stubs # except when they aren't + ) + or id in CORE_BUILTIN_MODULES # core is always normal + ): + follow_imports = "normal" + if skip_diagnose: + pass + elif follow_imports == "silent": + # Still import it, but silence non-blocker errors. + manager.log(f"Silencing {result} ({id})") + elif follow_imports == "skip" or follow_imports == "error": + # In 'error' mode, produce special error messages. + if id not in manager.missing_modules: + manager.log(f"Skipping {result} ({id})") + if follow_imports == "error": + if ancestor_for: + skipping_ancestor(manager, id, result, ancestor_for) + else: + skipping_module(manager, caller_line, caller_state, id, result) + reason = SuppressionReason.SKIPPED + if options.ignore_missing_imports: + # Performance optimization: when we are ignoring imports, there is no + # difference for the caller between skipped import and actually missing one. + reason = SuppressionReason.NOT_FOUND + raise ModuleNotFound(reason=reason) + if is_silent_import_module(manager, result) and not root_source: + follow_imports = "silent" + return result, follow_imports + else: + # Could not find a module. Typically, the reason is a + # misspelled module name, missing stub, module not in + # search path or the module has not been installed. + + ignore_missing_imports = options.ignore_missing_imports + + # Don't honor a global (not per-module) ignore_missing_imports + # setting for modules that used to have bundled stubs, as + # otherwise updating mypy can silently result in new false + # negatives. (Unless there are stubs, but they are incomplete.) + global_ignore_missing_imports = manager.options.ignore_missing_imports + if ( + is_module_from_legacy_bundled_package(id) + and global_ignore_missing_imports + and not options.ignore_missing_imports_per_module + and result is ModuleNotFoundReason.APPROVED_STUBS_NOT_INSTALLED + ): + ignore_missing_imports = False + + if skip_diagnose: + raise ModuleNotFound + if caller_state: + if not (ignore_missing_imports or in_partial_package(id, manager)): + module_not_found(manager, caller_line, caller_state, id, result) + raise ModuleNotFound + elif root_source: + # If we can't find a root source it's always fatal. + # TODO: This might hide non-fatal errors from + # root sources processed earlier. + raise CompileError([f"mypy: can't find module '{id}'"]) + else: + raise ModuleNotFound + + +def exist_added_packages(suppressed: list[str], manager: BuildManager) -> bool: + """Find if there are any newly added packages that were previously suppressed. + + Exclude everything not in build for follow-imports=skip. + """ + for dep in suppressed: + if dep in manager.source_set.source_modules: + # We don't need to add any special logic for this. If a module + # is added to build, importers will be invalidated by normal mechanism. + continue + path = find_module_simple(dep, manager) + if not path: + continue + options = manager.options.clone_for_module(dep) + # Technically this is not 100% correct, since we can have: + # from pkg import mod + # with + # [mypy-pkg] + # follow-import = silent + # [mypy-pkg.mod] + # follow-imports = normal + # But such cases are extremely rare, and this allows us to avoid + # massive performance impact in much more common situations. + if options.follow_imports in ("skip", "error") and ( + not path.endswith(".pyi") or options.follow_imports_for_stubs + ): + continue + if os.path.basename(path) in ("__init__.py", "__init__.pyi"): + return True + return False + + +def exist_removed_submodules(dependencies: list[str], manager: BuildManager) -> bool: + """Find if there are any submodules of packages that are now missing. + + This is conceptually an inverse of exist_added_packages(). + """ + dependencies_set = set(dependencies) + for dep in dependencies: + if "." not in dep: + continue + if dep in manager.source_set.source_modules: + # We still know it is definitely a module. + continue + direct_ancestor, _ = dep.rsplit(".", maxsplit=1) + if direct_ancestor not in dependencies_set: + continue + if find_module_simple(dep, manager) is None: + return True + return False + + +def find_module_simple(id: str, manager: BuildManager) -> str | None: + """Find a filesystem path for module `id` or `None` if not found.""" + if manager.stats_enabled: + t0 = time.time() + x = manager.find_module_cache.find_module(id, fast_path=True) + if manager.stats_enabled: + manager.add_stats(find_module_time=time.time() - t0, find_module_calls=1) + if isinstance(x, ModuleNotFoundReason): + return None + return x + + +def find_module_with_reason(id: str, manager: BuildManager) -> ModuleSearchResult: + """Find a filesystem path for module `id` or the reason it can't be found.""" + if manager.stats_enabled: + t0 = time.time() + x = manager.find_module_cache.find_module(id, fast_path=False) + if manager.stats_enabled: + manager.add_stats(find_module_time=time.time() - t0, find_module_calls=1) + return x + + +def in_partial_package(id: str, manager: BuildManager) -> bool: + """Check if a missing module can potentially be a part of a package. + + This checks if there is any existing parent __init__.pyi stub that + defines a module-level __getattr__ (a.k.a. partial stub package). + """ + while "." in id: + ancestor, _ = id.rsplit(".", 1) + if ancestor in manager.known_partial_packages: + return manager.known_partial_packages[ancestor] + if ancestor in manager.modules: + ancestor_mod: MypyFile | None = manager.modules[ancestor] + else: + # Ancestor is not in build, try quickly if we can find it. + try: + ancestor_st = State.new_state( + id=ancestor, path=None, source=None, manager=manager, temporary=True + ) + except (ModuleNotFound, CompileError): + ancestor_mod = None + else: + ancestor_mod = ancestor_st.tree + # We will not need this anymore. + ancestor_st.tree = None + if ancestor_mod is not None: + # Bail out soon, complete subpackage found + manager.known_partial_packages[ancestor] = ancestor_mod.is_partial_stub_package + return ancestor_mod.is_partial_stub_package + id = ancestor + return False + + +def module_not_found( + manager: BuildManager, + line: int, + caller_state: State, + target: str, + reason: ModuleNotFoundReason, +) -> None: + errors = manager.errors + save_import_context = errors.import_context() + errors.set_import_context(caller_state.import_context) + errors.set_file(caller_state.xpath, caller_state.id, caller_state.options) + errors.set_file_ignored_lines( + caller_state.xpath, + caller_state.tree.ignored_lines if caller_state.tree else caller_state.imports_ignored, + caller_state.ignore_all or caller_state.options.ignore_errors, + ) + if target == "builtins": + manager.error( + line, "Cannot find 'builtins' module. Typeshed appears broken!", blocker=True + ) + errors.raise_error() + else: + daemon = manager.options.fine_grained_incremental + msg, notes = reason.error_message_templates(daemon) + if reason == ModuleNotFoundReason.NOT_FOUND: + code = codes.IMPORT_NOT_FOUND + elif ( + reason == ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS + or reason == ModuleNotFoundReason.APPROVED_STUBS_NOT_INSTALLED + ): + code = codes.IMPORT_UNTYPED + else: + code = codes.IMPORT + manager.error(line, msg.format(module=target), code=code) + + dist = stub_distribution_name(target) + for note in notes: + if "{stub_dist}" in note: + assert dist is not None + note = note.format(stub_dist=dist) + manager.note(line, note, only_once=True, code=code) + if reason is ModuleNotFoundReason.APPROVED_STUBS_NOT_INSTALLED: + assert dist is not None + manager.missing_stub_packages.add(dist) + errors.set_import_context(save_import_context) + + +def skipping_module( + manager: BuildManager, line: int, caller_state: State | None, id: str, path: str +) -> None: + """Produce an error for an import ignored due to --follow_imports=error""" + assert caller_state, (id, path) + save_import_context = manager.errors.import_context() + manager.errors.set_import_context(caller_state.import_context) + manager.errors.set_file(caller_state.xpath, caller_state.id, manager.options) + manager.error(line, f'Import of "{id}" ignored') + manager.note( + line, "(Using --follow-imports=error, module not passed on command line)", only_once=True + ) + manager.errors.set_import_context(save_import_context) + + +def skipping_ancestor(manager: BuildManager, id: str, path: str, ancestor_for: State) -> None: + """Produce an error for an ancestor ignored due to --follow_imports=error""" + # TODO: Read the path (the __init__.py file) and return + # immediately if it's empty or only contains comments. + # But beware, some package may be the ancestor of many modules, + # so we'd need to cache the decision. + manager.errors.set_import_context([]) + manager.errors.set_file(ancestor_for.xpath, ancestor_for.id, manager.options) + manager.error(None, f'Ancestor package "{id}" ignored', only_once=True) + manager.note( + None, "(Using --follow-imports=error, submodule passed on command line)", only_once=True + ) + + +def log_configuration(manager: BuildManager, sources: list[BuildSource]) -> None: + """Output useful configuration information to LOG and TRACE""" + + if not manager.logging_enabled: + return + + config_file = manager.options.config_file + if config_file: + config_file = os.path.abspath(config_file) + + manager.log() + configuration_vars = [ + ("Mypy Version", __version__), + ("Config File", (config_file or "Default")), + ("Configured Executable", manager.options.python_executable or "None"), + ("Current Executable", sys.executable), + ("Cache Dir", manager.options.cache_dir), + ("Compiled", str(not __file__.endswith(".py"))), + ("Exclude", manager.options.exclude), + ] + + for conf_name, conf_value in configuration_vars: + manager.log(f"{conf_name + ':':24}{conf_value}") + + for source in sources: + manager.log(f"{'Found source:':24}{source}") + + # Complete list of searched paths can get very long, put them under TRACE + for path_type, paths in manager.search_paths.asdict().items(): + if not paths: + manager.trace(f"No {path_type}") + continue + + manager.trace(f"{path_type}:") + + for pth in paths: + manager.trace(f" {pth}") + + +# The driver + + +def dispatch(sources: list[BuildSource], manager: BuildManager, stdout: TextIO) -> Graph: + log_configuration(manager, sources) + + t0 = time.time() + + # We disable GC while loading the graph as a performance optimization for + # cold-cache runs. The parsed ASTs are trees, and therefore should not have any + # reference cycles. This is an important optimization, since we create a lot of + # new objects while parsing files. + global initial_gc_freeze_done + if ( + not manager.options.test_env + and platform.python_implementation() == "CPython" + and not initial_gc_freeze_done + ): + gc.disable() + graph = load_graph(sources, manager) + + # This is a kind of unfortunate hack to work around some of fine-grained's + # fragility: if we have loaded less than 50% of the specified files from + # cache in fine-grained cache mode, load the graph again honestly. + # In this case, we just turn the cache off entirely, so we don't need + # to worry about some files being loaded and some from cache and so + # that fine-grained mode never *writes* to the cache. + if manager.use_fine_grained_cache() and len(graph) < 0.50 * len(sources): + manager.log("Redoing load_graph without cache because too much was missing") + manager.cache_enabled = False + graph = load_graph(sources, manager) + + if ( + not manager.options.test_env + and platform.python_implementation() == "CPython" + and not initial_gc_freeze_done + ): + gc.freeze() + gc.unfreeze() + gc.enable() + initial_gc_freeze_done = True + + for id in graph: + manager.import_map[id] = graph[id].dependencies_set + + t1 = time.time() + manager.add_stats( + graph_size=len(graph), + stubs_found=sum(g.path is not None and g.path.endswith(".pyi") for g in graph.values()), + graph_load_time=(t1 - t0), + fm_cache_size=len(manager.find_module_cache.results), + ) + if not graph: + print("Nothing to do?!", file=stdout) + return graph + manager.log(f"Loaded graph with {len(graph)} nodes ({t1 - t0:.3f} sec)") + if manager.options.dump_graph: + dump_graph(graph, stdout) + return graph + + # Fine grained dependencies that didn't have an associated module in the build + # are serialized separately, so we read them after we load the graph. + # We need to read them both for running in daemon mode and if we are generating + # a fine-grained cache (so that we can properly update them incrementally). + # The `read_deps_cache` will also validate + # the deps cache against the loaded individual cache files. + if manager.options.cache_fine_grained or manager.use_fine_grained_cache(): + t2 = time.time() + fg_deps_meta = read_deps_cache(manager, graph) + manager.add_stats(load_fg_deps_time=time.time() - t2) + if fg_deps_meta is not None: + manager.fg_deps_meta = fg_deps_meta + elif manager.stats.get("fresh_metas", 0) > 0: + # Clear the stats so we don't infinite loop because of positive fresh_metas + manager.stats.clear() + # There were some cache files read, but no fine-grained dependencies loaded. + manager.log("Error reading fine-grained dependencies cache -- aborting cache load") + manager.cache_enabled = False + manager.log("Falling back to full run -- reloading graph...") + return dispatch(sources, manager, stdout) + + # If we are loading a fine-grained incremental mode cache, we + # don't want to do a real incremental reprocess of the + # graph---we'll handle it all later. + if not manager.use_fine_grained_cache(): + process_graph(graph, manager) + # Update plugins snapshot. + write_plugins_snapshot(manager) + manager.old_plugins_snapshot = manager.plugins_snapshot + if manager.options.cache_fine_grained or manager.options.fine_grained_incremental: + # If we are running a daemon or are going to write cache for further fine grained use, + # then we need to collect fine grained protocol dependencies. + # Since these are a global property of the program, they are calculated after we + # processed the whole graph. + type_state.add_all_protocol_deps(manager.fg_deps) + if not manager.options.fine_grained_incremental: + rdeps = generate_deps_for_cache(manager, graph) + write_deps_cache(rdeps, manager, graph) + + if manager.options.dump_deps: + # This speeds up startup a little when not using the daemon mode. + from mypy.server.deps import dump_all_dependencies + + dump_all_dependencies( + manager.modules, manager.all_types, manager.options.python_version, manager.options + ) + + return graph + + +class NodeInfo: + """Some info about a node in the graph of SCCs.""" + + def __init__(self, index: int, scc: list[str]) -> None: + self.node_id = "n%d" % index + self.scc = scc + self.sizes: dict[str, int] = {} # mod -> size in bytes + self.deps: dict[str, int] = {} # node_id -> pri + + def dumps(self) -> str: + """Convert to JSON string.""" + total_size = sum(self.sizes.values()) + return "[{}, {}, {},\n {},\n {}]".format( + json.dumps(self.node_id), + json.dumps(total_size), + json.dumps(self.scc), + json.dumps(self.sizes), + json.dumps(self.deps), + ) + + +def dump_timing_stats(path: str, graph: Graph) -> None: + """Dump timing stats for each file in the given graph.""" + with open(path, "w") as f: + for id in sorted(graph): + f.write(f"{id} {graph[id].time_spent_us}\n") + + +def dump_line_checking_stats(path: str, graph: Graph) -> None: + """Dump per-line expression type checking stats.""" + with open(path, "w") as f: + for id in sorted(graph): + if not graph[id].per_line_checking_time_ns: + continue + f.write(f"{id}:\n") + for line in sorted(graph[id].per_line_checking_time_ns): + line_time = graph[id].per_line_checking_time_ns[line] + f.write(f"{line:>5} {line_time/1000:8.1f}\n") + + +def dump_graph(graph: Graph, stdout: TextIO | None = None) -> None: + """Dump the graph as a JSON string to stdout. + + This copies some of the work by process_graph() + (sorted_components() and order_ascc()). + """ + stdout = stdout or sys.stdout + nodes = [] + sccs = sorted_components(graph) + for i, ascc in enumerate(sccs): + scc = order_ascc(graph, ascc.mod_ids) + node = NodeInfo(i, scc) + nodes.append(node) + inv_nodes = {} # module -> node_id + for node in nodes: + for mod in node.scc: + inv_nodes[mod] = node.node_id + for node in nodes: + for mod in node.scc: + state = graph[mod] + size = 0 + if state.path: + try: + size = os.path.getsize(state.path) + except OSError: + pass + node.sizes[mod] = size + for dep in state.dependencies: + if dep in state.priorities: + pri = state.priorities[dep] + if dep in inv_nodes: + dep_id = inv_nodes[dep] + if dep_id != node.node_id and ( + dep_id not in node.deps or pri < node.deps[dep_id] + ): + node.deps[dep_id] = pri + print("[" + ",\n ".join(node.dumps() for node in nodes) + "\n]", file=stdout) + + +def load_graph( + sources: list[BuildSource], + manager: BuildManager, + old_graph: Graph | None = None, + new_modules: list[State] | None = None, +) -> Graph: + """Given some source files, load the full dependency graph. + + If an old_graph is passed in, it is used as the starting point and + modified during graph loading. + + If a new_modules is passed in, any modules that are loaded are + added to the list. This is an argument and not a return value + so that the caller can access it even if load_graph fails. + + As this may need to parse files, this can raise CompileError in case + there are syntax errors. + """ + + graph: Graph = old_graph if old_graph is not None else {} + + # The deque is used to implement breadth-first traversal. + # TODO: Consider whether to go depth-first instead. This may + # affect the order in which we process files within import cycles. + new = new_modules if new_modules is not None else [] + entry_points: set[str] = set() + # Seed the graph with the initial root sources. + for bs in sources: + try: + st = State.new_state( + id=bs.module, + path=bs.path, + source=bs.text, + manager=manager, + root_source=not bs.followed, + ) + except ModuleNotFound: + continue + if st.id in graph: + manager.errors.set_file(st.xpath, st.id, manager.options) + manager.error( + None, + f'Duplicate module named "{st.id}" (also at "{graph[st.id].xpath}")', + blocker=True, + ) + resolution_note = f""" + See {MODULE_RESOLUTION_URL} for more info + Common resolutions include: + a) using `--exclude` to avoid checking one of them, + b) adding `__init__.py` somewhere, + c) using `--explicit-package-bases` or adjusting `MYPYPATH` + """ + manager.note_multiline(None, resolution_note) + manager.errors.raise_error() + graph[st.id] = st + new.append(st) + entry_points.add(bs.module) + + # Note: Running this each time could be slow in the daemon. If it's a problem, we + # can do more work to maintain this incrementally. + seen_files = {st.abspath: st for st in graph.values() if st.path} + + # Collect dependencies. We go breadth-first. + # More nodes might get added to new as we go, but that's fine. + for st in new: + assert st.ancestors is not None + # Strip out indirect dependencies. These will be dealt with + # when they show up as direct dependencies, and there's a + # scenario where they hurt: + # - Suppose A imports B and B imports C. + # - Suppose on the next round: + # - C is deleted; + # - B is updated to remove the dependency on C; + # - A is unchanged. + # - In this case A's cached *direct* dependencies are still valid + # (since direct dependencies reflect the imports found in the source) + # but A's cached *indirect* dependency on C is wrong. + dependencies = [dep for dep in st.dependencies if st.priorities.get(dep) != PRI_INDIRECT] + if not manager.use_fine_grained_cache(): + added = [dep for dep in st.suppressed if find_module_simple(dep, manager)] + else: + # During initial loading we don't care about newly added modules, + # they will be taken care of during fine-grained update. See also + # comment about this in `State.new_state()`. + added = [] + for dep in st.ancestors + dependencies + st.suppressed: + ignored = dep in st.suppressed_set and dep not in entry_points + if ignored and dep not in added: + manager.missing_modules[dep] = SuppressionReason.NOT_FOUND + # TODO: for now we skip this in the daemon as a performance optimization. + # This however creates a correctness issue, see #7777 and State.is_fresh(). + if not manager.use_fine_grained_cache() or manager.options.warn_unused_configs: + manager.import_options[dep] = manager.options.clone_for_module( + dep + ).dep_import_options() + elif dep not in graph: + try: + if dep in st.ancestors: + # TODO: Why not 'if dep not in st.dependencies' ? + # Ancestors don't have import context. + newst = State.new_state( + id=dep, path=None, source=None, manager=manager, ancestor_for=st + ) + else: + newst = State.new_state( + id=dep, + path=None, + source=None, + manager=manager, + caller_state=st, + caller_line=st.dep_line_map.get(dep, 1), + ) + except ModuleNotFound: + if dep in st.dependencies_set: + st.suppress_dependency(dep) + else: + if newst.path: + newst_path = newst.abspath + + if newst_path in seen_files: + manager.error( + None, + "Source file found twice under different module names: " + f'"{seen_files[newst_path].id}" and "{newst.id}"', + blocker=True, + ) + resolution_note = f""" + See {MODULE_RESOLUTION_URL} for more info + Common resolutions include: + a) adding `__init__.py` somewhere, + b) using `--explicit-package-bases` or adjusting `MYPYPATH` + """ + manager.note_multiline(None, resolution_note) + manager.errors.raise_error() + + seen_files[newst_path] = newst + + assert newst.id not in graph, newst.id + graph[newst.id] = newst + new.append(newst) + # There are two things we need to do after the initial load loop. One is up-suppress + # modules that are back in graph. We need to do this after the loop to cover edge cases + # like where a namespace package ancestor is shared by a typed and an untyped package. + for st in graph.values(): + for dep in st.suppressed.copy(): + if dep in graph: + st.add_dependency(dep) + manager.missing_modules.pop(dep, None) + # Second, in the initial loop we skip indirect dependencies, so to make indirect dependencies + # behave more consistently with regular ones, we suppress them manually here (when needed). + for st in graph.values(): + indirect = [dep for dep in st.dependencies if st.priorities.get(dep) == PRI_INDIRECT] + for dep in indirect: + if dep not in graph: + st.suppress_dependency(dep) + manager.plugin.set_modules(manager.modules) + manager.errors.global_watcher = False + return graph + + +def order_ascc_ex(graph: Graph, ascc: SCC) -> list[str]: + """Apply extra heuristics on top of order_ascc(). + + This should be used only for actual SCCs, not for "inner" SCCs + we create recursively during ordering of the SCC. Currently, this + has only some special handling for builtin SCC. + """ + scc = order_ascc(graph, ascc.mod_ids) + # Make the order of the SCC that includes 'builtins' and 'typing', + # among other things, predictable. Various things may break if + # the order changes. + if "builtins" in ascc.mod_ids: + scc = sorted(scc, reverse=True) + # If builtins is in the list, move it last. (This is a bit of + # a hack, but it's necessary because the builtins module is + # part of a small cycle involving at least {builtins, abc, + # typing}. Of these, builtins must be processed last or else + # some builtin objects will be incompletely processed.) + scc.remove("builtins") + scc.append("builtins") + return scc + + +def verify_transitive_deps(ascc: SCC, graph: Graph, manager: BuildManager) -> str | None: + """Verify all indirect dependencies of this SCC are still reachable via direct ones. + + Return first unreachable dependency id, or None. + """ + for id in ascc.mod_ids: + st = graph[id] + assert st.meta is not None, "Must be called on fresh SCCs only" + if st.trans_dep_hash == st.meta.trans_dep_hash: + # Import graph unchanged, skip this module. + continue + for dep in st.dependencies: + if st.priorities.get(dep) == PRI_INDIRECT: + dep_scc_id = manager.scc_by_mod_id[dep].id + if dep_scc_id == ascc.id: + continue + if not manager.is_transitive_scc_dep(ascc.id, dep_scc_id): + return dep + return None + + +def find_stale_sccs( + sccs: list[SCC], graph: Graph, manager: BuildManager +) -> tuple[list[SCC], list[SCC]]: + """Split a list of ready SCCs into stale and fresh. + + Fresh SCCs are those where: + * We have valid cache files for all modules in the SCC. + * There are no changes in dependencies (files removed from/added to the build). + * The interface hashes of dependencies matches those recorded in the cache. + * All indirect dependencies are still reachable via direct ones. + The first and second conditions are verified by is_fresh(). + """ + stale_sccs = [] + fresh_sccs = [] + for ascc in sccs: + stale_scc = {id for id in ascc.mod_ids if not graph[id].is_fresh()} + fresh = not stale_scc + + # Verify that interfaces of dependencies still present in graph are up-to-date (fresh). + stale_deps = set() + for id in ascc.mod_ids: + for dep in graph[id].dep_hashes: + if dep in graph and graph[dep].interface_hash != graph[id].dep_hashes[dep]: + stale_deps.add(dep) + fresh = fresh and not stale_deps + + # Verify the invariant that indirect dependencies are a subset of transitive direct + # dependencies. Note: the case where indirect dependency is removed from the graph + # completely is already handled above. + stale_indirect = None + if fresh: + stale_indirect = verify_transitive_deps(ascc, graph, manager) + if stale_indirect is not None: + fresh = False + + if manager.logging_enabled: + if fresh: + fresh_msg = "fresh" + elif stale_scc: + fresh_msg = "inherently stale" + if stale_scc != ascc.mod_ids: + fresh_msg += f" ({' '.join(sorted(stale_scc))})" + if stale_deps: + fresh_msg += f" with stale deps ({' '.join(sorted(stale_deps))})" + elif stale_deps: + fresh_msg = f"stale due to deps ({' '.join(sorted(stale_deps))})" + else: + assert stale_indirect is not None + fresh_msg = f"stale due to stale indirect dep(s): first {stale_indirect}" + scc_str = " ".join(ascc.mod_ids) + + if fresh: + if manager.tracing_enabled: + manager.trace(f"Found {fresh_msg} SCC ({scc_str})") + # If there is at most one file with errors we can skip the ordering to save time. + mods_with_errors = [id for id in ascc.mod_ids if graph[id].error_lines] + if len(mods_with_errors) <= 1: + scc = mods_with_errors + else: + # Use exactly the same order as for stale SCCs for stability. + scc = order_ascc_ex(graph, ascc) + for id in scc: + if graph[id].error_lines: + path = manager.errors.simplify_path(graph[id].xpath) + formatted = manager.errors.format_messages( + path, graph[id].error_lines, formatter=manager.error_formatter + ) + manager.flush_errors(path, formatted, False) + fresh_sccs.append(ascc) + else: + if manager.logging_enabled: + size = len(ascc.mod_ids) + if size == 1: + manager.log(f"Scheduling SCC singleton ({scc_str}) as {fresh_msg}") + else: + manager.log( + "Scheduling SCC of size %d (%s) as %s" % (size, scc_str, fresh_msg) + ) + stale_sccs.append(ascc) + return stale_sccs, fresh_sccs + + +def process_graph(graph: Graph, manager: BuildManager) -> None: + """Process everything in dependency order.""" + # Broadcast graph to workers before computing SCCs to save a bit of time. + # TODO: check if we can optimize by sending only part of the graph needed for given SCC. + # For example only send modules in the SCC and their dependencies. + graph_message = GraphMessage(graph=graph, missing_modules=manager.missing_modules) + buf = WriteBuffer() + graph_message.write(buf) + graph_data = buf.getvalue() + for worker in manager.workers: + AckMessage.read(receive(worker.conn)) + worker.conn.write_bytes(graph_data) + + sccs = sorted_components(graph) + manager.log( + "Found %d SCCs; largest has %d nodes" % (len(sccs), max(len(scc.mod_ids) for scc in sccs)) + ) + scc_by_id = {scc.id: scc for scc in sccs} + manager.scc_by_id = scc_by_id + manager.top_order = [scc.id for scc in sccs] + for scc in sccs: + for mod_id in scc.mod_ids: + manager.scc_by_mod_id[mod_id] = scc + + # Broadcast SCC structure to the parallel workers, since they don't compute it. + sccs_message = SccsDataMessage(sccs=sccs) + buf = WriteBuffer() + sccs_message.write(buf) + sccs_data = buf.getvalue() + for worker in manager.workers: + AckMessage.read(receive(worker.conn)) + worker.conn.write_bytes(sccs_data) + for worker in manager.workers: + AckMessage.read(receive(worker.conn)) + + manager.free_workers = set(range(manager.options.num_workers)) + + # Prime the ready list with leaf SCCs (that have no dependencies). + ready = [] + not_ready = set() + for scc in sccs: + if not scc.deps: + ready.append(scc) + else: + not_ready.add(scc) + + still_working = False + while ready or not_ready or still_working: + stale, fresh = find_stale_sccs(ready, graph, manager) + if stale: + for scc in stale: + for id in scc.mod_ids: + graph[id].mark_as_rechecked() + manager.submit(graph, stale) + still_working = True + # We eagerly walk over fresh SCCs to reach as many stale SCCs as soon + # as possible. Only when there are no fresh SCCs, we wait on scheduled stale ones. + # This strategy, similar to a naive strategy in minesweeper game, will allow us + # to leverage parallelism as much as possible. + if fresh: + done = fresh + else: + done, still_working, results = manager.wait_for_done(graph) + # Expose the results of type-checking by workers. For in-process + # type-checking this is already done and results should be empty here. + if not manager.workers: + assert not results + for id, (interface_hash, errors) in results.items(): + new_hash = bytes.fromhex(interface_hash) + if new_hash != graph[id].interface_hash: + graph[id].mark_interface_stale() + graph[id].interface_hash = new_hash + manager.flush_errors(manager.errors.simplify_path(graph[id].xpath), errors, False) + ready = [] + for done_scc in done: + for dependent in done_scc.direct_dependents: + scc_by_id[dependent].not_ready_deps.discard(done_scc.id) + if not scc_by_id[dependent].not_ready_deps: + not_ready.remove(scc_by_id[dependent]) + ready.append(scc_by_id[dependent]) + manager.trace(f"Transitive deps cache size: {sys.getsizeof(manager.transitive_deps_cache)}") + + +def order_ascc(graph: Graph, ascc: AbstractSet[str], pri_max: int = PRI_INDIRECT) -> list[str]: + """Come up with the ideal processing order within an SCC. + + Using the priorities assigned by all_imported_modules_in_file(), + try to reduce the cycle to a DAG, by omitting arcs representing + dependencies of lower priority. + + In the simplest case, if we have A <--> B where A has a top-level + "import B" (medium priority) but B only has the reverse "import A" + inside a function (low priority), we turn the cycle into a DAG by + dropping the B --> A arc, which leaves only A --> B. + + If all arcs have the same priority, we fall back to sorting by + reverse global order (the order in which modules were first + encountered). + + The algorithm is recursive, as follows: when as arcs of different + priorities are present, drop all arcs of the lowest priority, + identify SCCs in the resulting graph, and apply the algorithm to + each SCC thus found. The recursion is bounded because at each + recursion the spread in priorities is (at least) one less. + + In practice there are only a few priority levels (less than a + dozen) and in the worst case we just carry out the same algorithm + for finding SCCs N times. Thus, the complexity is no worse than + the complexity of the original SCC-finding algorithm -- see + strongly_connected_components() below for a reference. + """ + if len(ascc) == 1: + return list(ascc) + pri_spread = set() + for id in ascc: + state = graph[id] + for dep in state.dependencies: + if dep in ascc: + pri = state.priorities.get(dep, PRI_HIGH) + if pri < pri_max: + pri_spread.add(pri) + if len(pri_spread) == 1: + # Filtered dependencies are uniform -- order by global order. + return sorted(ascc, key=lambda id: -graph[id].order) + pri_max = max(pri_spread) + sccs = sorted_components_inner(graph, ascc, pri_max) + # The recursion is bounded by the len(pri_spread) check above. + return [s for ss in sccs for s in order_ascc(graph, ss, pri_max)] + + +def process_fresh_modules(graph: Graph, modules: list[str], manager: BuildManager) -> None: + """Process the modules in one group of modules from their cached data. + + This can be used to process an SCC of modules. This involves loading the tree (i.e. + module symbol tables) from cache file and then fixing cross-references in the symbols. + """ + t0 = time.time() + for id in modules: + graph[id].load_tree() + t1 = time.time() + for id in modules: + graph[id].fix_cross_refs() + t2 = time.time() + manager.add_stats(process_fresh_time=t2 - t0, load_tree_time=t1 - t0) + + +def process_stale_scc( + graph: Graph, ascc: SCC, manager: BuildManager, from_cache: set[str] | None = None +) -> dict[str, tuple[str, list[str]]]: + """Process the modules in one SCC from source code.""" + # First verify if all transitive dependencies are loaded in the current process. + t0 = time.time() + missing_sccs = set() + sccs_to_find = ascc.deps.copy() + while sccs_to_find: + dep_scc = sccs_to_find.pop() + if dep_scc in manager.done_sccs or dep_scc in missing_sccs: + continue + missing_sccs.add(dep_scc) + sccs_to_find.update(manager.scc_by_id[dep_scc].deps) + + if missing_sccs: + # Load missing SCCs from cache. + # TODO: speed-up ordering if this causes problems for large builds. + fresh_sccs_to_load = [ + manager.scc_by_id[sid] for sid in manager.top_order if sid in missing_sccs + ] + + if manager.parallel_worker: + # Update cache metas as well, cache data is loaded below + # in process_fresh_modules(). + for prev_scc in fresh_sccs_to_load: + for mod_id in prev_scc.mod_ids: + graph[mod_id].reload_meta() + + manager.log(f"Processing {len(fresh_sccs_to_load)} fresh SCCs") + if ( + not manager.options.test_env + and platform.python_implementation() == "CPython" + # Parallel workers perform loading in many smaller "pieces", so we + # should repeat the GC hack multiple times to actually benefit from it. + and (manager.gc_freeze_cycles < MAX_GC_FREEZE_CYCLES or manager.parallel_worker) + ): + # When deserializing cache we create huge amount of new objects, so even + # with our generous GC thresholds, GC is still doing a lot of pointless + # work searching for garbage. So, we temporarily disable it when + # processing fresh SCCs, and then move all the new objects to the oldest + # generation with the freeze()/unfreeze() trick below. This is arguably + # a hack, but it gives huge performance wins for large third-party + # libraries, like torch. + gc.collect(generation=1) + gc.collect(generation=0) + gc.disable() + for prev_scc in fresh_sccs_to_load: + manager.done_sccs.add(prev_scc.id) + process_fresh_modules(graph, sorted(prev_scc.mod_ids), manager) + if ( + not manager.options.test_env + and platform.python_implementation() == "CPython" + and (manager.gc_freeze_cycles < MAX_GC_FREEZE_CYCLES or manager.parallel_worker) + ): + manager.gc_freeze_cycles += 1 + gc.freeze() + gc.unfreeze() + gc.enable() + + t1 = time.time() + # Process the SCC in stable order. + scc = order_ascc_ex(graph, ascc) + + t2 = time.time() + stale = scc + for id in stale: + # Re-generate import errors in case this module was loaded from the cache. + # Deserialized states all have meta=None, so the caller should specify + # explicitly which of them are from cache. + if graph[id].meta or from_cache and id in from_cache: + graph[id].verify_dependencies(suppressed_only=True) + # We may already have parsed the module, or not. + # If the former, parse_file() is a no-op. + graph[id].parse_file() + if "typing" in scc: + # For historical reasons we need to manually add typing aliases + # for built-in generic collections, see docstring of + # SemanticAnalyzerPass2.add_builtin_aliases for details. + typing_mod = graph["typing"].tree + assert typing_mod, "The typing module was not parsed" + mypy.semanal_main.semantic_analysis_for_scc(graph, scc, manager.errors) + + t3 = time.time() + # Track what modules aren't yet done, so we can finish them as soon + # as possible, saving memory. + unfinished_modules = set(stale) + for id in stale: + graph[id].type_check_first_pass() + if not graph[id].type_checker().deferred_nodes: + unfinished_modules.discard(id) + graph[id].detect_possibly_undefined_vars() + graph[id].finish_passes() + + while unfinished_modules: + for id in stale: + if id not in unfinished_modules: + continue + if not graph[id].type_check_second_pass(): + unfinished_modules.discard(id) + graph[id].detect_possibly_undefined_vars() + graph[id].finish_passes() + for id in stale: + graph[id].generate_unused_ignore_notes() + graph[id].generate_ignore_without_code_notes() + + t4 = time.time() + # Flush errors, and write cache in two phases: first data files, then meta files. + meta_tuples = {} + errors_by_id = {} + formatted_by_id = {} + for id in stale: + if graph[id].xpath not in manager.errors.ignored_files: + errors = manager.errors.file_messages(graph[id].xpath) + formatted = manager.errors.format_messages( + graph[id].xpath, errors, formatter=manager.error_formatter + ) + manager.flush_errors(manager.errors.simplify_path(graph[id].xpath), formatted, False) + errors_by_id[id] = errors + formatted_by_id[id] = formatted + meta_tuples[id] = graph[id].write_cache() + for id in stale: + meta_tuple = meta_tuples[id] + if meta_tuple is None: + continue + meta, meta_file = meta_tuple + meta.dep_hashes = [graph[dep].interface_hash for dep in graph[id].dependencies] + write_cache_meta(meta, manager, meta_file) + write_errors_file(meta_file, errors_by_id.get(id, []), manager) + manager.done_sccs.add(ascc.id) + manager.add_stats( + load_missing_time=t1 - t0, + order_scc_time=t2 - t1, + semanal_time=t3 - t2, + type_check_time=t4 - t3, + flush_and_cache_time=time.time() - t4, + ) + scc_result = {} + for id in scc: + scc_result[id] = graph[id].interface_hash.hex(), formatted_by_id.get(id, []) + return scc_result + + +def prepare_sccs_full( + raw_sccs: Iterator[set[str]], edges: dict[str, list[str]] +) -> dict[SCC, set[SCC]]: + """Turn raw SCC sets into SCC objects and build dependency graph for SCCs.""" + sccs = [SCC(raw_scc) for raw_scc in raw_sccs] + scc_map = {} + for scc in sccs: + for id in scc.mod_ids: + scc_map[id] = scc + scc_deps_map: dict[SCC, set[SCC]] = {} + for scc in sccs: + for id in scc.mod_ids: + scc_deps_map.setdefault(scc, set()).update(scc_map[dep] for dep in edges[id]) + for scc in sccs: + # Remove trivial dependency on itself. + scc_deps_map[scc].discard(scc) + for dep_scc in scc_deps_map[scc]: + scc.deps.add(dep_scc.id) + scc.not_ready_deps.add(dep_scc.id) + return scc_deps_map + + +def sorted_components(graph: Graph) -> list[SCC]: + """Return the graph's SCCs, topologically sorted by dependencies. + + The sort order is from leaves (nodes without dependencies) to + roots (nodes on which no other nodes depend). + """ + # Compute SCCs. + vertices = set(graph) + edges = {id: deps_filtered(graph, vertices, id, PRI_INDIRECT) for id in vertices} + scc_dep_map = prepare_sccs_full(strongly_connected_components(vertices, edges), edges) + # Topsort. + res = [] + for ready in topsort(scc_dep_map): + # Sort the sets in ready by reversed smallest State.order. Examples: + # + # - If ready is [{x}, {y}], x.order == 1, y.order == 2, we get + # [{y}, {x}]. + # + # - If ready is [{a, b}, {c, d}], a.order == 1, b.order == 3, + # c.order == 2, d.order == 4, the sort keys become [1, 2] + # and the result is [{c, d}, {a, b}]. + sorted_ready = sorted(ready, key=lambda scc: -min(graph[id].order for id in scc.mod_ids)) + for scc in sorted_ready: + scc.size_hint = sum(graph[mid].size_hint for mid in scc.mod_ids) + for dep in scc_dep_map[scc]: + dep.direct_dependents.append(scc.id) + # We compute dependencies hash here since we know no direct + # dependencies will be added or suppressed after this point. + trans_dep_hash = transitive_dep_hash(scc, graph) + for id in scc.mod_ids: + graph[id].trans_dep_hash = trans_dep_hash + res.extend(sorted_ready) + return res + + +def sorted_components_inner( + graph: Graph, vertices: AbstractSet[str], pri_max: int +) -> list[AbstractSet[str]]: + """Simplified version of sorted_components() to work with sub-graphs. + + This doesn't create SCC objects, and operates with raw sets. This function + also allows filtering dependencies to take into account when building SCCs. + This is used for heuristic ordering of modules within actual SCCs. + """ + edges = {id: deps_filtered(graph, vertices, id, pri_max) for id in vertices} + sccs = list(strongly_connected_components(vertices, edges)) + res = [] + for ready in topsort(prepare_sccs(sccs, edges)): + res.extend(sorted(ready, key=lambda scc: -min(graph[id].order for id in scc))) + return res + + +def deps_filtered(graph: Graph, vertices: AbstractSet[str], id: str, pri_max: int) -> list[str]: + """Filter dependencies for id with pri < pri_max.""" + if id not in vertices: + return [] + state = graph[id] + return [ + dep + for dep in state.dependencies + if dep in vertices and state.priorities.get(dep, PRI_HIGH) < pri_max + ] + + +def transitive_dep_hash(scc: SCC, graph: Graph) -> bytes: + """Compute stable snapshot of transitive import structure for given SCC.""" + all_direct_deps = sorted( + { + dep + for id in scc.mod_ids + for dep in graph[id].dependencies + if graph[id].priorities.get(dep) != PRI_INDIRECT + } + ) + buf = WriteBuffer() + for dep_id in all_direct_deps: + write_str_bare(buf, dep_id) + if dep_id not in scc.mod_ids: + write_bytes_bare(buf, graph[dep_id].trans_dep_hash) + return hash_digest_bytes(buf.getvalue()) + + +def missing_stubs_file(cache_dir: str) -> str: + return os_path_join(cache_dir, "missing_stubs") + + +def record_missing_stub_packages(cache_dir: str, missing_stub_packages: set[str]) -> None: + """Write a file containing missing stub packages. + + This allows a subsequent "mypy --install-types" run (without other arguments) + to install missing stub packages. + """ + fnam = missing_stubs_file(cache_dir) + if missing_stub_packages: + with open(fnam, "w") as f: + for pkg in sorted(missing_stub_packages): + f.write(f"{pkg}\n") + else: + if os.path.isfile(fnam): + os.remove(fnam) + + +def is_silent_import_module(manager: BuildManager, path: str) -> bool: + if manager.options.no_silence_site_packages: + return False + # Silence errors in site-package dirs and typeshed + if any(is_sub_path_normabs(path, dir) for dir in manager.search_paths.package_path): + return True + return any(is_sub_path_normabs(path, dir) for dir in manager.search_paths.typeshed_path) + + +def write_undocumented_ref_info( + state: State, metastore: MetadataStore, options: Options, type_map: dict[Expression, Type] +) -> None: + # This exports some dependency information in a rather ad-hoc fashion, which + # can be helpful for some tools. This is all highly experimental and could be + # removed at any time. + + from mypy.refinfo import get_undocumented_ref_info_json + + if not state.tree: + # We need a full AST for this. + return + + _, data_file, _ = get_cache_names(state.id, state.xpath, options) + ref_info_file = ".".join(data_file.split(".")[:-2]) + ".refs.json" + assert not ref_info_file.startswith(".") + + deps_json = get_undocumented_ref_info_json(state.tree, type_map) + metastore.write(ref_info_file, json_dumps(deps_json)) + + +# The IPC message classes and tags for communication with build workers are +# in this file to avoid import cycles. +# Note that we use a more compact fixed serialization format than in cache.py. +# This is because the messages don't need to read by a generic tool, nor there +# is any need for backwards compatibility. We still reuse some elements from +# cache.py for convenience, and also some conventions (like using bare ints +# to specify object size). +# Note that we can use tags overlapping with cache.py, since they should never +# appear on the same context. +ACK_MESSAGE: Final[Tag] = 101 +SCC_REQUEST_MESSAGE: Final[Tag] = 102 +SCC_RESPONSE_MESSAGE: Final[Tag] = 103 +SOURCES_DATA_MESSAGE: Final[Tag] = 104 +SCCS_DATA_MESSAGE: Final[Tag] = 105 +GRAPH_MESSAGE: Final[Tag] = 106 + + +class AckMessage(IPCMessage): + """An empty message used primarily for synchronization.""" + + @classmethod + def read(cls, buf: ReadBuffer) -> AckMessage: + assert read_tag(buf) == ACK_MESSAGE + return AckMessage() + + def write(self, buf: WriteBuffer) -> None: + write_tag(buf, ACK_MESSAGE) + + +class SccRequestMessage(IPCMessage): + """ + A message representing a request to type check an SCC. + + If scc_id is None, then it means that the coordinator requested a shutdown. + """ + + def __init__( + self, + *, + scc_id: int | None, + import_errors: dict[str, list[ErrorInfo]], + mod_data: dict[str, tuple[bytes, FileRawData | None]], + ) -> None: + self.scc_id = scc_id + self.import_errors = import_errors + self.mod_data = mod_data + + @classmethod + def read(cls, buf: ReadBuffer) -> SccRequestMessage: + assert read_tag(buf) == SCC_REQUEST_MESSAGE + return SccRequestMessage( + scc_id=read_int_opt(buf), + import_errors={ + read_str(buf): [ErrorInfo.read(buf) for _ in range(read_int_bare(buf))] + for _ in range(read_int_bare(buf)) + }, + mod_data={ + read_str_bare(buf): ( + read_bytes(buf), + FileRawData.read(buf) if read_bool(buf) else None, + ) + for _ in range(read_int_bare(buf)) + }, + ) + + def write(self, buf: WriteBuffer) -> None: + write_tag(buf, SCC_REQUEST_MESSAGE) + write_int_opt(buf, self.scc_id) + write_int_bare(buf, len(self.import_errors)) + for path, errors in self.import_errors.items(): + write_str(buf, path) + write_int_bare(buf, len(errors)) + for error in errors: + error.write(buf) + write_int_bare(buf, len(self.mod_data)) + for mod, (suppressed_deps_opts, raw_data) in self.mod_data.items(): + write_str_bare(buf, mod) + write_bytes(buf, suppressed_deps_opts) + if raw_data is None: + write_bool(buf, False) + else: + write_bool(buf, True) + raw_data.write(buf) + + +class SccResponseMessage(IPCMessage): + """ + A message representing a result of type checking an SCC. + + Only one of `result` or `blocker` can be non-None. The latter means there was + a blocking error while type checking the SCC. + """ + + def __init__( + self, + *, + scc_id: int, + result: dict[str, tuple[str, list[str]]] | None = None, + blocker: CompileError | None = None, + ) -> None: + if result is not None: + assert blocker is None + if blocker is not None: + assert result is None + self.scc_id = scc_id + self.result = result + self.blocker = blocker + + @classmethod + def read(cls, buf: ReadBuffer) -> SccResponseMessage: + assert read_tag(buf) == SCC_RESPONSE_MESSAGE + scc_id = read_int(buf) + tag = read_tag(buf) + if tag == LITERAL_NONE: + return SccResponseMessage( + scc_id=scc_id, + blocker=CompileError(read_str_list(buf), read_bool(buf), read_str_opt(buf)), + ) + else: + assert tag == DICT_STR_GEN + return SccResponseMessage( + scc_id=scc_id, + result={ + read_str_bare(buf): (read_str(buf), read_str_list(buf)) + for _ in range(read_int_bare(buf)) + }, + ) + + def write(self, buf: WriteBuffer) -> None: + write_tag(buf, SCC_RESPONSE_MESSAGE) + write_int(buf, self.scc_id) + if self.result is None: + assert self.blocker is not None + write_tag(buf, LITERAL_NONE) + write_str_list(buf, self.blocker.messages) + write_bool(buf, self.blocker.use_stdout) + write_str_opt(buf, self.blocker.module_with_blocker) + else: + write_tag(buf, DICT_STR_GEN) + write_int_bare(buf, len(self.result)) + for mod_id in sorted(self.result): + write_str_bare(buf, mod_id) + hex_hash, errs = self.result[mod_id] + write_str(buf, hex_hash) + write_str_list(buf, errs) + + +class SourcesDataMessage(IPCMessage): + """A message wrapping a list of build sources.""" + + def __init__(self, *, sources: list[BuildSource]) -> None: + self.sources = sources + + @classmethod + def read(cls, buf: ReadBuffer) -> SourcesDataMessage: + assert read_tag(buf) == SOURCES_DATA_MESSAGE + sources = [ + BuildSource( + read_str_opt(buf), + read_str_opt(buf), + read_str_opt(buf), + read_str_opt(buf), + read_bool(buf), + ) + for _ in range(read_int_bare(buf)) + ] + return SourcesDataMessage(sources=sources) + + def write(self, buf: WriteBuffer) -> None: + write_tag(buf, SOURCES_DATA_MESSAGE) + write_int_bare(buf, len(self.sources)) + for bs in self.sources: + write_str_opt(buf, bs.path) + write_str_opt(buf, bs.module) + write_str_opt(buf, bs.text) + write_str_opt(buf, bs.base_dir) + write_bool(buf, bs.followed) + + +class SccsDataMessage(IPCMessage): + """A message wrapping the SCC structure computed by the coordinator.""" + + def __init__(self, *, sccs: list[SCC]) -> None: + self.sccs = sccs + + @classmethod + def read(cls, buf: ReadBuffer) -> SccsDataMessage: + assert read_tag(buf) == SCCS_DATA_MESSAGE + sccs = [ + SCC(set(read_str_list(buf)), read_int(buf), read_int_list(buf)) + for _ in range(read_int_bare(buf)) + ] + return SccsDataMessage(sccs=sccs) + + def write(self, buf: WriteBuffer) -> None: + write_tag(buf, SCCS_DATA_MESSAGE) + write_int_bare(buf, len(self.sccs)) + for scc in self.sccs: + write_str_list(buf, sorted(scc.mod_ids)) + write_int(buf, scc.id) + write_int_list(buf, sorted(scc.deps)) + + +class GraphMessage(IPCMessage): + """A message wrapping the build graph computed by the coordinator.""" + + def __init__(self, *, graph: Graph, missing_modules: dict[str, int]) -> None: + self.graph = graph + self.missing_modules = missing_modules + # Send this data separately as it will be lost during state serialization. + self.from_cache = {mod_id for mod_id in graph if graph[mod_id].meta} + + @classmethod + def read(cls, buf: ReadBuffer, manager: BuildManager | None = None) -> GraphMessage: + assert manager is not None + assert read_tag(buf) == GRAPH_MESSAGE + graph = {read_str_bare(buf): State.read(buf, manager) for _ in range(read_int_bare(buf))} + missing_modules = {read_str_bare(buf): read_int(buf) for _ in range(read_int_bare(buf))} + message = GraphMessage(graph=graph, missing_modules=missing_modules) + message.from_cache = {read_str_bare(buf) for _ in range(read_int_bare(buf))} + return message + + def write(self, buf: WriteBuffer) -> None: + write_tag(buf, GRAPH_MESSAGE) + write_int_bare(buf, len(self.graph)) + for mod_id, state in self.graph.items(): + write_str_bare(buf, mod_id) + state.write(buf) + write_int_bare(buf, len(self.missing_modules)) + for module, reason in self.missing_modules.items(): + write_str_bare(buf, module) + write_int(buf, reason) + write_int_bare(buf, len(self.from_cache)) + for module in self.from_cache: + write_str_bare(buf, module) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/cache.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/cache.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..05e04290f9534379c9d25999df41e30cbb4a1966 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/cache.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/cache.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/cache.py new file mode 100644 index 0000000000000000000000000000000000000000..0adc7affb8cb416b6f35523907c36b6190f76c72 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/cache.py @@ -0,0 +1,532 @@ +""" +This module contains high-level logic for fixed format serialization. + +Lower-level parts are implemented in C in mypyc/lib-rt/internal/librt_internal.c +Short summary of low-level functionality: +* integers are automatically serialized as 1, 2, or 4 bytes, or arbitrary length. +* str/bytes are serialized as size (1, 2, or 4 bytes) followed by bytes buffer. +* floats are serialized as C doubles. + +At high-level we add type tags as needed so that our format is self-descriptive. +More precisely: +* False, True, and None are stored as just a tag: 0, 1, 2 correspondingly. +* builtin primitives like int/str/bytes/float are stored as their type tag followed + by bare (low-level) representation of the value. Reserved tag range for primitives is + 3 ... 19. +* generic (heterogeneous) list are stored as tag, followed by bare size, followed by + sequence of tagged values. +* homogeneous lists of primitives are stored as tag, followed by bare size, followed + by sequence of bare values. +* reserved tag range for sequence-like builtins is 20 ... 29 +* currently we have only one mapping-like format: string-keyed dictionary with heterogeneous + values. It is stored as tag, followed by bare size, followed by sequence of pairs: bare + string key followed by tagged value. +* reserved tag range for mapping-like builtins is 30 ... 39 +* there is an additional reserved tag range 40 ... 49 for any other builtin collections. +* custom classes (like types, symbols etc.) are stored as tag, followed by a sequence of + tagged field values, followed by a special end tag 255. Names of class fields are + *not* stored, the caller should know the field names and order for the given class tag. +* reserved tag range for symbols (TypeInfo, Var, etc) is 50 ... 79. +* class Instance is the only exception from the above format (since it is the most common one). + It has two extra formats: few most common instances like "builtins.object" are stored as + instance tag followed by a secondary tag, other plain non-generic instances are stored as + instance tag followed by secondary tag followed by fullname as bare string. All generic + readers must handle these. +* reserved tag range for Instance type formats is 80 ... 99, for other types it is 100 ... 149. +* tag 254 is reserved for if we would ever need to extend the tag range to indicated second tag + page. Tags 150 ... 253 are free for everything else (e.g. AST nodes etc). + +General convention is that custom classes implement write() and read() methods for FF +serialization. The write method should write both class tag and end tag. The read method +conventionally *does not* read the start tag (to simplify logic for unions). Known exceptions +are MypyFile.read() and SymbolTableNode.read(), since those two never appear in a union. + +If any of these details change, or if the structure of CacheMeta changes please +bump CACHE_VERSION below. +""" + +from __future__ import annotations + +from collections.abc import Sequence +from typing import Any, Final, TypeAlias as _TypeAlias + +from librt.internal import ( + ReadBuffer as ReadBuffer, + WriteBuffer as WriteBuffer, + read_bool as read_bool, + read_bytes as read_bytes_bare, + read_float as read_float_bare, + read_int as read_int_bare, + read_str as read_str_bare, + read_tag as read_tag, + write_bool as write_bool, + write_bytes as write_bytes_bare, + write_float as write_float_bare, + write_int as write_int_bare, + write_str as write_str_bare, + write_tag as write_tag, +) +from mypy_extensions import u8 + +# High-level cache layout format +CACHE_VERSION: Final = 7 + +# Type used internally to represent errors: +# (path, line, column, end_line, end_column, severity, message, code) +ErrorTuple: _TypeAlias = tuple[str | None, int, int, int, int, str, str, str | None] + + +class CacheMeta: + """Class representing cache metadata for a module.""" + + def __init__( + self, + *, + id: str, + path: str, + mtime: int, + size: int, + hash: str, + dependencies: list[str], + data_mtime: int, + data_file: str, + suppressed: list[str], + imports_ignored: dict[int, list[str]], + options: dict[str, object], + suppressed_deps_opts: bytes, + dep_prios: list[int], + dep_lines: list[int], + dep_hashes: list[bytes], + interface_hash: bytes, + trans_dep_hash: bytes, + version_id: str, + ignore_all: bool, + plugin_data: Any, + ) -> None: + self.id = id + self.path = path + self.mtime = mtime # source file mtime + self.size = size # source file size + self.hash = hash # source file hash (as a hex string for historical reasons) + self.dependencies = dependencies # names of imported modules + self.data_mtime = data_mtime # mtime of data_file + self.data_file = data_file # path of .data.json or .data.ff + self.suppressed = suppressed # dependencies that weren't imported + self.imports_ignored = imports_ignored # type ignore codes by line + self.options = options # build options snapshot + self.suppressed_deps_opts = suppressed_deps_opts # hash of import-related options + # dep_prios and dep_lines are both aligned with dependencies + suppressed + self.dep_prios = dep_prios + self.dep_lines = dep_lines + # dep_hashes list is aligned with dependencies only + self.dep_hashes = dep_hashes # list of interface_hash for dependencies + self.interface_hash = interface_hash # hash representing the public interface + self.trans_dep_hash = trans_dep_hash # hash of import structure (transitive) + self.version_id = version_id # mypy version for cache invalidation + self.ignore_all = ignore_all # if errors were ignored + self.plugin_data = plugin_data # config data from plugins + + def serialize(self) -> dict[str, Any]: + return { + "id": self.id, + "path": self.path, + "mtime": self.mtime, + "size": self.size, + "hash": self.hash, + "data_mtime": self.data_mtime, + "dependencies": self.dependencies, + "suppressed": self.suppressed, + "imports_ignored": {str(line): codes for line, codes in self.imports_ignored.items()}, + "options": self.options, + "suppressed_deps_opts": self.suppressed_deps_opts.hex(), + "dep_prios": self.dep_prios, + "dep_lines": self.dep_lines, + "dep_hashes": [dep.hex() for dep in self.dep_hashes], + "interface_hash": self.interface_hash.hex(), + "trans_dep_hash": self.trans_dep_hash.hex(), + "version_id": self.version_id, + "ignore_all": self.ignore_all, + "plugin_data": self.plugin_data, + } + + @classmethod + def deserialize(cls, meta: dict[str, Any], data_file: str) -> CacheMeta | None: + try: + return CacheMeta( + id=meta["id"], + path=meta["path"], + mtime=meta["mtime"], + size=meta["size"], + hash=meta["hash"], + dependencies=meta["dependencies"], + data_mtime=meta["data_mtime"], + data_file=data_file, + suppressed=meta["suppressed"], + imports_ignored={ + int(line): codes for line, codes in meta["imports_ignored"].items() + }, + options=meta["options"], + suppressed_deps_opts=bytes.fromhex(meta["suppressed_deps_opts"]), + dep_prios=meta["dep_prios"], + dep_lines=meta["dep_lines"], + dep_hashes=[bytes.fromhex(dep) for dep in meta["dep_hashes"]], + interface_hash=bytes.fromhex(meta["interface_hash"]), + trans_dep_hash=bytes.fromhex(meta["trans_dep_hash"]), + version_id=meta["version_id"], + ignore_all=meta["ignore_all"], + plugin_data=meta["plugin_data"], + ) + except (KeyError, ValueError): + return None + + def write(self, data: WriteBuffer) -> None: + write_str(data, self.id) + write_str(data, self.path) + write_int(data, self.mtime) + write_int(data, self.size) + write_str(data, self.hash) + write_str_list(data, self.dependencies) + write_int(data, self.data_mtime) + write_str_list(data, self.suppressed) + write_int_bare(data, len(self.imports_ignored)) + for line, codes in self.imports_ignored.items(): + write_int(data, line) + write_str_list(data, codes) + write_json(data, self.options) + write_bytes(data, self.suppressed_deps_opts) + write_int_list(data, self.dep_prios) + write_int_list(data, self.dep_lines) + write_bytes_list(data, self.dep_hashes) + write_bytes(data, self.interface_hash) + write_bytes(data, self.trans_dep_hash) + write_str(data, self.version_id) + write_bool(data, self.ignore_all) + # Plugin data may be not a dictionary, so we use + # a more generic write_json_value() here. + write_json_value(data, self.plugin_data) + + @classmethod + def read(cls, data: ReadBuffer, data_file: str) -> CacheMeta | None: + try: + return CacheMeta( + id=read_str(data), + path=read_str(data), + mtime=read_int(data), + size=read_int(data), + hash=read_str(data), + dependencies=read_str_list(data), + data_mtime=read_int(data), + data_file=data_file, + suppressed=read_str_list(data), + imports_ignored={ + read_int(data): read_str_list(data) for _ in range(read_int_bare(data)) + }, + options=read_json(data), + suppressed_deps_opts=read_bytes(data), + dep_prios=read_int_list(data), + dep_lines=read_int_list(data), + dep_hashes=read_bytes_list(data), + interface_hash=read_bytes(data), + trans_dep_hash=read_bytes(data), + version_id=read_str(data), + ignore_all=read_bool(data), + plugin_data=read_json_value(data), + ) + except (ValueError, AssertionError): + return None + + +# Always use this type alias to refer to type tags. +Tag = u8 + +# Primitives. +LITERAL_FALSE: Final[Tag] = 0 +LITERAL_TRUE: Final[Tag] = 1 +LITERAL_NONE: Final[Tag] = 2 +LITERAL_INT: Final[Tag] = 3 +LITERAL_STR: Final[Tag] = 4 +LITERAL_BYTES: Final[Tag] = 5 +LITERAL_FLOAT: Final[Tag] = 6 +LITERAL_COMPLEX: Final[Tag] = 7 + +# Collections. +LIST_GEN: Final[Tag] = 20 +LIST_INT: Final[Tag] = 21 +LIST_STR: Final[Tag] = 22 +LIST_BYTES: Final[Tag] = 23 +TUPLE_GEN: Final[Tag] = 24 +DICT_STR_GEN: Final[Tag] = 30 +DICT_INT_GEN: Final[Tag] = 31 + +# Misc classes. +EXTRA_ATTRS: Final[Tag] = 150 +DT_SPEC: Final[Tag] = 151 +# Four integers representing source file (line, column) range. +LOCATION: Final[Tag] = 152 + +END_TAG: Final[Tag] = 255 + + +def read_literal(data: ReadBuffer, tag: Tag) -> int | str | bool | float: + if tag == LITERAL_INT: + return read_int_bare(data) + elif tag == LITERAL_STR: + return read_str_bare(data) + elif tag == LITERAL_FALSE: + return False + elif tag == LITERAL_TRUE: + return True + elif tag == LITERAL_FLOAT: + return read_float_bare(data) + assert False, f"Unknown literal tag {tag}" + + +# There is an intentional asymmetry between read and write for literals because +# None and/or complex values are only allowed in some contexts but not in others. +def write_literal(data: WriteBuffer, value: int | str | bool | float | complex | None) -> None: + if isinstance(value, bool): + write_bool(data, value) + elif isinstance(value, int): + write_tag(data, LITERAL_INT) + write_int_bare(data, value) + elif isinstance(value, str): + write_tag(data, LITERAL_STR) + write_str_bare(data, value) + elif isinstance(value, float): + write_tag(data, LITERAL_FLOAT) + write_float_bare(data, value) + elif isinstance(value, complex): + write_tag(data, LITERAL_COMPLEX) + write_float_bare(data, value.real) + write_float_bare(data, value.imag) + else: + write_tag(data, LITERAL_NONE) + + +def read_int(data: ReadBuffer) -> int: + assert read_tag(data) == LITERAL_INT + return read_int_bare(data) + + +def write_int(data: WriteBuffer, value: int) -> None: + write_tag(data, LITERAL_INT) + write_int_bare(data, value) + + +def read_str(data: ReadBuffer) -> str: + assert read_tag(data) == LITERAL_STR + return read_str_bare(data) + + +def write_str(data: WriteBuffer, value: str) -> None: + write_tag(data, LITERAL_STR) + write_str_bare(data, value) + + +def read_bytes(data: ReadBuffer) -> bytes: + assert read_tag(data) == LITERAL_BYTES + return read_bytes_bare(data) + + +def write_bytes(data: WriteBuffer, value: bytes) -> None: + write_tag(data, LITERAL_BYTES) + write_bytes_bare(data, value) + + +def read_int_opt(data: ReadBuffer) -> int | None: + tag = read_tag(data) + if tag == LITERAL_NONE: + return None + assert tag == LITERAL_INT + return read_int_bare(data) + + +def write_int_opt(data: WriteBuffer, value: int | None) -> None: + if value is not None: + write_tag(data, LITERAL_INT) + write_int_bare(data, value) + else: + write_tag(data, LITERAL_NONE) + + +def read_str_opt(data: ReadBuffer) -> str | None: + tag = read_tag(data) + if tag == LITERAL_NONE: + return None + assert tag == LITERAL_STR + return read_str_bare(data) + + +def write_str_opt(data: WriteBuffer, value: str | None) -> None: + if value is not None: + write_tag(data, LITERAL_STR) + write_str_bare(data, value) + else: + write_tag(data, LITERAL_NONE) + + +def read_int_list(data: ReadBuffer) -> list[int]: + assert read_tag(data) == LIST_INT + size = read_int_bare(data) + return [read_int_bare(data) for _ in range(size)] + + +def write_int_list(data: WriteBuffer, value: list[int]) -> None: + write_tag(data, LIST_INT) + write_int_bare(data, len(value)) + for item in value: + write_int_bare(data, item) + + +def read_str_list(data: ReadBuffer) -> list[str]: + assert read_tag(data) == LIST_STR + size = read_int_bare(data) + return [read_str_bare(data) for _ in range(size)] + + +def write_str_list(data: WriteBuffer, value: Sequence[str]) -> None: + write_tag(data, LIST_STR) + write_int_bare(data, len(value)) + for item in value: + write_str_bare(data, item) + + +def read_bytes_list(data: ReadBuffer) -> list[bytes]: + assert read_tag(data) == LIST_BYTES + size = read_int_bare(data) + return [read_bytes_bare(data) for _ in range(size)] + + +def write_bytes_list(data: WriteBuffer, value: Sequence[bytes]) -> None: + write_tag(data, LIST_BYTES) + write_int_bare(data, len(value)) + for item in value: + write_bytes_bare(data, item) + + +def read_str_opt_list(data: ReadBuffer) -> list[str | None]: + assert read_tag(data) == LIST_GEN + size = read_int_bare(data) + return [read_str_opt(data) for _ in range(size)] + + +def write_str_opt_list(data: WriteBuffer, value: list[str | None]) -> None: + write_tag(data, LIST_GEN) + write_int_bare(data, len(value)) + for item in value: + write_str_opt(data, item) + + +Value: _TypeAlias = None | int | str | bool + +# Our JSON format is somewhat non-standard as we distinguish lists and tuples. +# This is convenient for some internal things, like mypyc plugin and error serialization. +JsonValue: _TypeAlias = ( + Value | list["JsonValue"] | dict[str, "JsonValue"] | tuple["JsonValue", ...] +) + + +def read_json_value(data: ReadBuffer) -> JsonValue: + tag = read_tag(data) + if tag == LITERAL_NONE: + return None + if tag == LITERAL_FALSE: + return False + if tag == LITERAL_TRUE: + return True + if tag == LITERAL_INT: + return read_int_bare(data) + if tag == LITERAL_STR: + return read_str_bare(data) + if tag == LIST_GEN: + size = read_int_bare(data) + return [read_json_value(data) for _ in range(size)] + if tag == TUPLE_GEN: + size = read_int_bare(data) + return tuple(read_json_value(data) for _ in range(size)) + if tag == DICT_STR_GEN: + size = read_int_bare(data) + return {read_str_bare(data): read_json_value(data) for _ in range(size)} + assert False, f"Invalid JSON tag: {tag}" + + +def write_json_value(data: WriteBuffer, value: JsonValue) -> None: + if value is None: + write_tag(data, LITERAL_NONE) + elif isinstance(value, bool): + write_bool(data, value) + elif isinstance(value, int): + write_tag(data, LITERAL_INT) + write_int_bare(data, value) + elif isinstance(value, str): + write_tag(data, LITERAL_STR) + write_str_bare(data, value) + elif isinstance(value, list): + write_tag(data, LIST_GEN) + write_int_bare(data, len(value)) + for val in value: + write_json_value(data, val) + elif isinstance(value, tuple): + write_tag(data, TUPLE_GEN) + write_int_bare(data, len(value)) + for val in value: + write_json_value(data, val) + elif isinstance(value, dict): + write_tag(data, DICT_STR_GEN) + write_int_bare(data, len(value)) + for key in sorted(value): + write_str_bare(data, key) + write_json_value(data, value[key]) + else: + assert False, f"Invalid JSON value: {value}" + + +# These are functions for JSON *dictionaries* specifically. Unfortunately, we +# must use imprecise types here, because the callers use imprecise types. +def read_json(data: ReadBuffer) -> dict[str, Any]: + assert read_tag(data) == DICT_STR_GEN + size = read_int_bare(data) + return {read_str_bare(data): read_json_value(data) for _ in range(size)} + + +def write_json(data: WriteBuffer, value: dict[str, Any]) -> None: + write_tag(data, DICT_STR_GEN) + write_int_bare(data, len(value)) + for key in sorted(value): + write_str_bare(data, key) + write_json_value(data, value[key]) + + +def write_errors(data: WriteBuffer, errs: list[ErrorTuple]) -> None: + write_tag(data, LIST_GEN) + write_int_bare(data, len(errs)) + for path, line, column, end_line, end_column, severity, message, code in errs: + write_tag(data, TUPLE_GEN) + write_str_opt(data, path) + write_int(data, line) + write_int(data, column) + write_int(data, end_line) + write_int(data, end_column) + write_str(data, severity) + write_str(data, message) + write_str_opt(data, code) + + +def read_errors(data: ReadBuffer) -> list[ErrorTuple]: + assert read_tag(data) == LIST_GEN + result = [] + for _ in range(read_int_bare(data)): + assert read_tag(data) == TUPLE_GEN + result.append( + ( + read_str_opt(data), + read_int(data), + read_int(data), + read_int(data), + read_int(data), + read_str(data), + read_str(data), + read_str_opt(data), + ) + ) + return result diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checker.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checker.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..ce717d8d875120aa367e0e30e4d7a8b1b2daf060 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checker.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checker.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checker.py new file mode 100644 index 0000000000000000000000000000000000000000..717733dd412468a25bcbe2aad7253466128fd992 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checker.py @@ -0,0 +1,9590 @@ +"""Mypy type checker.""" + +from __future__ import annotations + +import itertools +from collections import defaultdict +from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence, Set as AbstractSet +from contextlib import ExitStack, contextmanager +from typing import ( + Final, + Generic, + Literal, + NamedTuple, + TypeAlias as _TypeAlias, + TypeGuard, + TypeVar, + cast, + overload, +) + +import mypy.checkexpr +from mypy import errorcodes as codes, join, message_registry, nodes, operators +from mypy.binder import ConditionalTypeBinder, Frame, get_declaration +from mypy.checker_shared import CheckerScope, TypeCheckerSharedApi, TypeRange +from mypy.checker_state import checker_state +from mypy.checkmember import ( + MemberContext, + analyze_class_attribute_access, + analyze_instance_member_access, + analyze_member_access, + is_instance_var, +) +from mypy.checkpattern import PatternChecker +from mypy.constraints import SUPERTYPE_OF +from mypy.erasetype import ( + erase_type, + erase_typevars, + remove_instance_last_known_values, + shallow_erase_type_for_equality, +) +from mypy.errorcodes import TYPE_VAR, UNUSED_AWAITABLE, UNUSED_COROUTINE, ErrorCode +from mypy.errors import ( + ErrorInfo, + Errors, + ErrorWatcher, + IterationDependentErrors, + IterationErrorWatcher, + report_internal_error, +) +from mypy.expandtype import expand_type +from mypy.literals import Key, extract_var_from_literal_hash, literal, literal_hash +from mypy.maptype import map_instance_to_supertype +from mypy.meet import is_overlapping_erased_types, is_overlapping_types, meet_types +from mypy.message_registry import ErrorMessage +from mypy.messages import ( + SUGGESTED_TEST_FIXTURES, + MessageBuilder, + append_invariance_notes, + append_union_note, + format_type, + format_type_bare, + format_type_distinctly, + make_inferred_type_note, + pretty_seq, +) +from mypy.mro import MroError, calculate_mro +from mypy.nodes import ( + ARG_NAMED, + ARG_POS, + ARG_STAR, + CONTRAVARIANT, + COVARIANT, + FUNC_NO_INFO, + GDEF, + IMPLICITLY_ABSTRACT, + INVARIANT, + IS_ABSTRACT, + LDEF, + LITERAL_TYPE, + MDEF, + NOT_ABSTRACT, + SYMBOL_FUNCBASE_TYPES, + AssertStmt, + AssignmentExpr, + AssignmentStmt, + AwaitExpr, + Block, + BreakStmt, + BytesExpr, + CallExpr, + ClassDef, + ComparisonExpr, + Context, + ContinueStmt, + Decorator, + DelStmt, + DictExpr, + EllipsisExpr, + Expression, + ExpressionStmt, + FloatExpr, + ForStmt, + FuncBase, + FuncDef, + FuncItem, + GlobalDecl, + IfStmt, + Import, + ImportAll, + ImportBase, + ImportFrom, + IndexExpr, + IntExpr, + LambdaExpr, + ListExpr, + Lvalue, + MatchStmt, + MemberExpr, + MypyFile, + NameExpr, + Node, + NonlocalDecl, + OperatorAssignmentStmt, + OpExpr, + OverloadedFuncDef, + OverloadPart, + PassStmt, + PromoteExpr, + RaiseStmt, + RefExpr, + ReturnStmt, + SetExpr, + SplittingVisitor, + StarExpr, + Statement, + StrExpr, + SymbolNode, + SymbolTable, + SymbolTableNode, + TempNode, + TryStmt, + TupleExpr, + TypeAlias, + TypeAliasStmt, + TypeInfo, + UnaryExpr, + Var, + WhileStmt, + WithStmt, + YieldExpr, + get_func_def, + is_final_node, +) +from mypy.operators import flip_ops, int_op_to_method, neg_ops +from mypy.options import PRECISE_TUPLE_TYPES, Options +from mypy.patterns import AsPattern, StarredPattern +from mypy.plugin import Plugin +from mypy.plugins import dataclasses as dataclasses_plugin +from mypy.scope import Scope +from mypy.semanal import is_trivial_body, refers_to_fullname, set_callable_name +from mypy.semanal_enum import ENUM_BASES, ENUM_SPECIAL_PROPS +from mypy.semanal_shared import SemanticAnalyzerCoreInterface +from mypy.sharedparse import BINARY_MAGIC_METHODS +from mypy.state import state +from mypy.subtypes import ( + find_member, + infer_class_variances, + is_callable_compatible, + is_equivalent, + is_more_precise, + is_proper_subtype, + is_same_type, + is_subtype, + restrict_subtype_away, + unify_generic_callable, +) +from mypy.traverser import TraverserVisitor, all_return_statements, has_return_statement +from mypy.treetransform import TransformVisitor +from mypy.typeanal import check_for_explicit_any, has_any_from_unimported_type, make_optional_type +from mypy.typeops import ( + bind_self, + can_have_shared_disjoint_base, + coerce_to_literal, + custom_special_method, + erase_def_to_union_or_bound, + erase_to_bound, + erase_to_union_or_bound, + false_only, + fixup_partial_type, + function_type, + is_literal_type_like, + is_singleton_equality_type, + is_singleton_identity_type, + make_simplified_union, + true_only, + try_expanding_sum_type_to_union, + try_getting_int_literals_from_type, + try_getting_str_literals, + try_getting_str_literals_from_type, + tuple_fallback, + type_object_type, +) +from mypy.types import ( + ANY_STRATEGY, + MYPYC_NATIVE_INT_NAMES, + NOT_IMPLEMENTED_TYPE_NAMES, + OVERLOAD_NAMES, + AnyType, + BoolTypeQuery, + CallableType, + DeletedType, + ErasedType, + FunctionLike, + Instance, + LiteralType, + NoneType, + Overloaded, + PartialType, + ProperType, + TupleType, + Type, + TypeAliasType, + TypedDictType, + TypeGuardedType, + TypeOfAny, + TypeTranslator, + TypeType, + TypeVarId, + TypeVarLikeType, + TypeVarTupleType, + TypeVarType, + UnboundType, + UninhabitedType, + UnionType, + UnpackType, + find_unpack_in_list, + flatten_nested_unions, + get_proper_type, + get_proper_types, + instance_cache, + is_literal_type, + is_named_instance, +) +from mypy.types_utils import is_overlapping_none, remove_optional, store_argument_type, strip_type +from mypy.typetraverser import TypeTraverserVisitor +from mypy.typevars import fill_typevars, fill_typevars_with_any, has_no_typevars +from mypy.util import is_dunder, is_sunder +from mypy.visitor import NodeVisitor + +T = TypeVar("T") + +DEFAULT_LAST_PASS: Final = 2 # Pass numbers start at 0 + +# Maximum length of fixed tuple types inferred when narrowing from variadic tuples. +MAX_PRECISE_TUPLE_SIZE: Final = 8 + +DeferredNodeType: _TypeAlias = FuncDef | OverloadedFuncDef | Decorator +FineGrainedDeferredNodeType: _TypeAlias = FuncDef | MypyFile | OverloadedFuncDef + + +# A node which is postponed to be processed during the next pass. +# In normal mode one can defer functions and methods (also decorated and/or overloaded) +# but not lambda expressions. Nested functions can't be deferred -- only top-level functions +# and methods of classes not defined within a function can be deferred. +class DeferredNode(NamedTuple): + node: DeferredNodeType + # And its TypeInfo (for semantic analysis self type handling) + active_typeinfo: TypeInfo | None + + +# Same as above, but for fine-grained mode targets. Only top-level functions/methods +# and module top levels are allowed as such. +class FineGrainedDeferredNode(NamedTuple): + node: FineGrainedDeferredNodeType + active_typeinfo: TypeInfo | None + + +# Data structure returned by find_isinstance_check representing +# information learned from the truth or falsehood of a condition. The +# dict maps nodes representing expressions like 'a[0].x' to their +# refined types under the assumption that the condition has a +# particular truth value. A value of None means that the condition can +# never have that truth value. + +# NB: The keys of this dict are nodes in the original source program, +# which are compared by reference equality--effectively, being *the +# same* expression of the program, not just two identical expressions +# (such as two references to the same variable). TODO: it would +# probably be better to have the dict keyed by the nodes' literal_hash +# field instead. +TypeMap: _TypeAlias = dict[Expression, Type] + + +# Keeps track of partial types in a single scope. In fine-grained incremental +# mode partial types initially defined at the top level cannot be completed in +# a function, and we use the 'is_function' attribute to enforce this. +class PartialTypeScope(NamedTuple): + map: dict[Var, Context] + is_function: bool + is_local: bool + + +class LocalTypeMap: + """Store inferred types into a temporary type map (returned). + + This can be used to perform type checking "experiments" without + affecting exported types (which are used by mypyc). + """ + + def __init__(self, chk: TypeChecker) -> None: + self.chk = chk + + def __enter__(self) -> dict[Expression, Type]: + temp_type_map: dict[Expression, Type] = {} + self.chk._type_maps.append(temp_type_map) + return temp_type_map + + def __exit__(self, exc_type: object, exc_val: object, exc_tb: object) -> Literal[False]: + self.chk._type_maps.pop() + return False + + +class TypeChecker(NodeVisitor[None], TypeCheckerSharedApi, SplittingVisitor): + """Mypy type checker. + + Type check mypy source files that have been semantically analyzed. + + You must create a separate instance for each source file. + """ + + # Are we type checking a stub? + is_stub = False + # Error message reporter + errors: Errors + # Utility for generating messages + msg: MessageBuilder + # Types of type checked nodes. The first item is the "master" type + # map that will store the final, exported types. Additional items + # are temporary type maps used during type inference, and these + # will be eventually popped and either discarded or merged into + # the master type map. + # + # Avoid accessing this directly, but prefer the lookup_type(), + # has_type() etc. helpers instead. + _type_maps: list[dict[Expression, Type]] + + # Helper for managing conditional types + binder: ConditionalTypeBinder + # Helper for type checking expressions + _expr_checker: mypy.checkexpr.ExpressionChecker + + pattern_checker: PatternChecker + + tscope: Scope + scope: CheckerScope + # Innermost enclosing type + type: TypeInfo | None + # Stack of function return types + return_types: list[Type] + # Flags; true for dynamically typed functions + dynamic_funcs: list[bool] + # Stack of collections of variables with partial types + partial_types: list[PartialTypeScope] + # Vars for which partial type errors are already reported + # (to avoid logically duplicate errors with different error context). + partial_reported: set[Var] + # Short names of Var nodes whose previous inferred type has been widened via assignment. + # NOTE: The names might not be unique, they are only for debugging purposes. + widened_vars: list[str] + globals: SymbolTable + modules: dict[str, MypyFile] + # Nodes that couldn't be checked because some types weren't available. We'll run + # another pass and try these again. + deferred_nodes: list[DeferredNode] + # Type checking pass number (0 = first pass) + pass_num = 0 + # Last pass number to take + last_pass = DEFAULT_LAST_PASS + # Have we deferred the current function? If yes, don't infer additional + # types during this pass within the function. + current_node_deferred = False + # Is this file a typeshed stub? + is_typeshed_stub = False + options: Options + # Used for collecting inferred attribute types so that they can be checked + # for consistency. + inferred_attribute_types: dict[Var, Type] | None = None + # Don't infer partial None types if we are processing assignment from Union + no_partial_types: bool = False + # Extra module references not detected during semantic analysis (these are rare cases + # e.g. access to class-level import via instance). + module_refs: set[str] + # A map from variable nodes to a snapshot of the frame ids of the + # frames that were active when the variable was declared. This can + # be used to determine nearest common ancestor frame of a variable's + # declaration and the current frame, which lets us determine if it + # was declared in a different branch of the same `if` statement + # (if that frame is a conditional_frame). + var_decl_frames: dict[Var, set[int]] + + # Plugin that provides special type checking rules for specific library + # functions such as open(), etc. + plugin: Plugin + + # A helper state to produce unique temporary names on demand. + _unique_id: int + # Fake concrete type used when checking variance + _variance_dummy_type: Instance | None + + def __init__( + self, + errors: Errors, + modules: dict[str, MypyFile], + options: Options, + tree: MypyFile, + path: str, + plugin: Plugin, + per_line_checking_time_ns: dict[int, int], + ) -> None: + """Construct a type checker. + + Use errors to report type check errors. + """ + self.errors = errors + self.modules = modules + self.options = options + self.tree = tree + self.path = path + self.msg = MessageBuilder(errors, modules) + self.plugin = plugin + self.tscope = Scope() + self.scope = CheckerScope(tree) + self.binder = ConditionalTypeBinder(options) + self.globals = tree.names + self.type = None + self.return_types = [] + self.dynamic_funcs = [] + self.partial_types = [] + self.partial_reported = set() + self.var_decl_frames = {} + self.deferred_nodes = [] + self.widened_vars = [] + self._type_maps = [{}] + self.module_refs = set() + self.pass_num = 0 + self.current_node_deferred = False + self.is_stub = tree.is_stub + self.is_typeshed_stub = tree.is_typeshed_file(options) + self.inferred_attribute_types = None + self.allow_constructor_cache = True + self.local_type_map = LocalTypeMap(self) + + self.can_skip_diagnostics: Final = ( + self.options.ignore_errors + or self.path in self.msg.errors.ignored_files + or (self.options.test_env and self.is_typeshed_stub) + ) + self.recurse_into_functions = True + # This internal flag is used to track whether we a currently type-checking + # a final declaration (assignment), so that some errors should be suppressed. + # Should not be set manually, use get_final_context/enter_final_context instead. + # NOTE: we use the context manager to avoid "threading" an additional `is_final_def` + # argument through various `checker` and `checkmember` functions. + self._is_final_def = False + + # Track when we enter an overload implementation. Some checks should not be applied + # to the implementation signature when specific overloads are available. + # Use `enter_overload_impl` to modify. + self.overload_impl_stack: list[OverloadPart] = [] + + # This flag is set when we run type-check or attribute access check for the purpose + # of giving a note on possibly missing "await". It is used to avoid infinite recursion. + self.checking_missing_await = False + + # While this is True, allow passing an abstract class where Type[T] is expected. + # although this is technically unsafe, this is desirable in some context, for + # example when type-checking class decorators. + self.allow_abstract_call = False + + # Child checker objects for specific AST node types + self._expr_checker = mypy.checkexpr.ExpressionChecker( + self, self.msg, self.plugin, per_line_checking_time_ns + ) + + self.pattern_checker = PatternChecker(self, self.msg, self.plugin, options) + self._unique_id = 0 + self._variance_dummy_type = None + + @property + def expr_checker(self) -> mypy.checkexpr.ExpressionChecker: + return self._expr_checker + + @property + def type_context(self) -> list[Type | None]: + return self._expr_checker.type_context + + def reset(self) -> None: + """Cleanup stale state that might be left over from a typechecking run. + + This allows us to reuse TypeChecker objects in fine-grained + incremental mode. + """ + # TODO: verify this is still actually worth it over creating new checkers + self.partial_reported.clear() + self.module_refs.clear() + self.binder = ConditionalTypeBinder(self.options) + self._type_maps[1:] = [] + self._type_maps[0].clear() + self.expr_checker.reset() + self.deferred_nodes = [] + self.partial_types = [] + self.inferred_attribute_types = None + self.scope = CheckerScope(self.tree) + + def check_first_pass(self) -> None: + """Type check the entire file, but defer functions with unresolved references. + + Unresolved references are forward references to variables + whose types haven't been inferred yet. They may occur later + in the same file or in a different file that's being processed + later (usually due to an import cycle). + + Deferred functions will be processed by check_second_pass(). + """ + self.recurse_into_functions = True + with state.strict_optional_set(self.options.strict_optional), checker_state.set(self): + self.errors.set_file( + self.path, self.tree.fullname, scope=self.tscope, options=self.options + ) + with self.tscope.module_scope(self.tree.fullname): + with self.enter_partial_types(), self.binder.top_frame_context(): + for d in self.tree.defs: + if self.binder.is_unreachable(): + if not self.should_report_unreachable_issues(): + break + if not self.is_noop_for_reachability(d): + self.msg.unreachable_statement(d) + break + else: + self.accept(d) + + assert not self.current_node_deferred + + all_ = self.globals.get("__all__") + if all_ is not None and all_.type is not None: + all_node = all_.node + assert all_node is not None + seq_str = self.named_generic_type( + "typing.Sequence", [self.named_type("builtins.str")] + ) + if not is_subtype(all_.type, seq_str): + str_seq_s, all_s = format_type_distinctly( + seq_str, all_.type, options=self.options + ) + self.fail( + message_registry.ALL_MUST_BE_SEQ_STR.format(str_seq_s, all_s), all_node + ) + + def check_second_pass( + self, + todo: Sequence[DeferredNode | FineGrainedDeferredNode] | None = None, + *, + allow_constructor_cache: bool = True, + ) -> bool: + """Run second or following pass of type checking. + + This goes through deferred nodes, returning True if there were any. + """ + self.allow_constructor_cache = allow_constructor_cache + self.recurse_into_functions = True + with state.strict_optional_set(self.options.strict_optional), checker_state.set(self): + if not todo and not self.deferred_nodes: + return False + self.errors.set_file( + self.path, self.tree.fullname, scope=self.tscope, options=self.options + ) + with self.tscope.module_scope(self.tree.fullname): + self.pass_num += 1 + if not todo: + todo = self.deferred_nodes + else: + assert not self.deferred_nodes + self.deferred_nodes = [] + done: set[DeferredNodeType | FineGrainedDeferredNodeType] = set() + for node, active_typeinfo in todo: + if node in done: + continue + # This is useful for debugging: + # print("XXX in pass %d, class %s, function %s" % + # (self.pass_num, type_name, node.fullname or node.name)) + done.add(node) + with ExitStack() as stack: + if active_typeinfo: + stack.enter_context(self.tscope.class_scope(active_typeinfo)) + stack.enter_context(self.scope.push_class(active_typeinfo)) + self.check_partial(node) + return True + + def check_partial(self, node: DeferredNodeType | FineGrainedDeferredNodeType) -> None: + self.widened_vars = [] + if isinstance(node, MypyFile): + self.check_top_level(node) + else: + self.recurse_into_functions = True + with self.binder.top_frame_context(): + self.accept(node) + + def check_top_level(self, node: MypyFile) -> None: + """Check only the top-level of a module, skipping function definitions.""" + self.recurse_into_functions = False + with self.enter_partial_types(): + with self.binder.top_frame_context(): + for d in node.defs: + d.accept(self) + + assert not self.current_node_deferred + # TODO: Handle __all__ + + def defer_node(self, node: DeferredNodeType, enclosing_class: TypeInfo | None) -> None: + """Defer a node for processing during next type-checking pass. + + Args: + node: function/method being deferred + enclosing_class: for methods, the class where the method is defined + NOTE: this can't handle nested functions/methods. + """ + # We don't freeze the entire scope since only top-level functions and methods + # can be deferred. Only module/class level scope information is needed. + # Module-level scope information is preserved in the TypeChecker instance. + self.deferred_nodes.append(DeferredNode(node, enclosing_class)) + + def handle_cannot_determine_type(self, name: str, context: Context) -> None: + node = self.scope.top_level_function() + if self.pass_num < self.last_pass and isinstance(node, FuncDef): + # Don't report an error yet. Just defer. Note that we don't defer + # lambdas because they are coupled to the surrounding function + # through the binder and the inferred type of the lambda, so it + # would get messy. + enclosing_class = self.scope.enclosing_class(node) + self.defer_node(node, enclosing_class) + # Set a marker so that we won't infer additional types in this + # function. Any inferred types could be bogus, because there's at + # least one type that we don't know. + self.current_node_deferred = True + else: + self.msg.cannot_determine_type(name, context) + + def accept(self, stmt: Statement) -> None: + """Type check a node in the given type context.""" + try: + stmt.accept(self) + except Exception as err: + report_internal_error(err, self.errors.file, stmt.line, self.errors, self.options) + + def accept_loop( + self, + body: Statement, + else_body: Statement | None = None, + *, + exit_condition: Expression | None = None, + on_enter_body: Callable[[], None] | None = None, + ) -> None: + """Repeatedly type check a loop body until the frame doesn't change.""" + + # The outer frame accumulates the results of all iterations: + with self.binder.frame_context(can_skip=False, conditional_frame=True): + # Check for potential decreases in the number of partial types so as not to stop the + # iteration too early: + partials_old = sum(len(pts.map) for pts in self.partial_types) + # Check if assignment widened the inferred type of a variable; in this case we + # need to iterate again (we only do one extra iteration, since this could go + # on without bound otherwise) + widened_old = len(self.widened_vars) + + iter_errors = IterationDependentErrors() + iter = 1 + while True: + with self.binder.frame_context(can_skip=True, break_frame=2, continue_frame=1): + if on_enter_body is not None: + on_enter_body() + + with IterationErrorWatcher(self.msg.errors, iter_errors): + self.accept(body) + + partials_new = sum(len(pts.map) for pts in self.partial_types) + widened_new = len(self.widened_vars) + # Perform multiple iterations if something changed that might affect + # inferred types. Also limit the number of iterations. The limits are + # somewhat arbitrary, but they were chosen to 1) avoid slowdown from + # multiple iterations in common cases and 2) support common, valid use + # cases. Limits are needed since otherwise we could infer infinitely + # complex types. + if ( + (partials_new == partials_old) + and (not self.binder.last_pop_changed or iter > 3) + and (widened_new == widened_old or iter > 1) + ): + break + partials_old = partials_new + widened_old = widened_new + iter += 1 + if iter == 20: + raise RuntimeError("Too many iterations when checking a loop") + + self.msg.iteration_dependent_errors(iter_errors) + + # If exit_condition is set, assume it must be False on exit from the loop: + if exit_condition: + _, else_map = self.find_isinstance_check(exit_condition) + self.push_type_map(else_map) + + # Check the else body: + if else_body: + self.accept(else_body) + + # + # Definitions + # + + def visit_overloaded_func_def(self, defn: OverloadedFuncDef) -> None: + # If a function/method can infer variable types, it should be processed as part + # of the module top level (i.e. module interface). + if not self.recurse_into_functions and not defn.def_or_infer_vars: + return + with self.tscope.function_scope(defn), self.set_recurse_into_functions(): + self._visit_overloaded_func_def(defn) + + def _visit_overloaded_func_def(self, defn: OverloadedFuncDef) -> None: + num_abstract = 0 + if not defn.items: + # In this case we have already complained about none of these being + # valid overloads. + return + if len(defn.items) == 1: + self.fail(message_registry.MULTIPLE_OVERLOADS_REQUIRED, defn) + + if defn.is_property: + # HACK: Infer the type of the property. + assert isinstance(defn.items[0], Decorator) + self.visit_decorator(defn.items[0]) + if defn.items[0].var.is_settable_property: + # Perform a reduced visit just to infer the actual setter type. + self.visit_decorator_inner(defn.setter, skip_first_item=True) + setter_type = defn.setter.var.type + # Check if the setter can accept two positional arguments. + any_type = AnyType(TypeOfAny.special_form) + fallback_setter_type = CallableType( + arg_types=[any_type, any_type], + arg_kinds=[ARG_POS, ARG_POS], + arg_names=[None, None], + ret_type=any_type, + fallback=self.named_type("builtins.function"), + ) + if setter_type and not is_subtype(setter_type, fallback_setter_type): + self.fail("Invalid property setter signature", defn.setter.func) + setter_type = self.extract_callable_type(setter_type, defn) + if not isinstance(setter_type, CallableType) or len(setter_type.arg_types) != 2: + # TODO: keep precise type for callables with tricky but valid signatures. + setter_type = fallback_setter_type + defn.items[0].var.setter_type = setter_type + if isinstance(defn.type, Overloaded): + # Update legacy property type for decorated properties. + getter_type = self.extract_callable_type(defn.items[0].var.type, defn) + if getter_type is not None: + getter_type.definition = defn.items[0] + defn.type.items[0] = getter_type + for i, fdef in enumerate(defn.items): + assert isinstance(fdef, Decorator) + if defn.is_property: + assert isinstance(defn.items[0], Decorator) + settable = defn.items[0].var.is_settable_property + # Do not visit the second time the items we checked above. + if (settable and i > 1) or (not settable and i > 0): + self.check_func_item(fdef.func, name=fdef.func.name, allow_empty=True) + else: + # Perform full check for real overloads to infer type of all decorated + # overload variants. + self.visit_decorator_inner(fdef, allow_empty=True) + if fdef.func.abstract_status in (IS_ABSTRACT, IMPLICITLY_ABSTRACT): + num_abstract += 1 + if num_abstract not in (0, len(defn.items)): + self.fail(message_registry.INCONSISTENT_ABSTRACT_OVERLOAD, defn) + if defn.impl: + with self.enter_overload_impl(defn.impl): + defn.impl.accept(self) + if not defn.is_property: + self.check_overlapping_overloads(defn) + if defn.type is None: + item_types = [] + for item in defn.items: + assert isinstance(item, Decorator) + item_type = self.extract_callable_type(item.var.type, item) + if item_type is not None: + item_type.definition = item + item_types.append(item_type) + if item_types: + defn.type = Overloaded(item_types) + elif defn.type is None: + # We store the getter type as an overall overload type, as some + # code paths are getting property type this way. + assert isinstance(defn.items[0], Decorator) + var_type = self.extract_callable_type(defn.items[0].var.type, defn) + if not isinstance(var_type, CallableType): + # Construct a fallback type, invalid types should be already reported. + any_type = AnyType(TypeOfAny.special_form) + var_type = CallableType( + arg_types=[any_type], + arg_kinds=[ARG_POS], + arg_names=[None], + ret_type=any_type, + fallback=self.named_type("builtins.function"), + ) + defn.type = Overloaded([var_type]) + # Check override validity after we analyzed current definition. + if not self.can_skip_diagnostics and defn.info: + found_method_base_classes = self.check_method_override(defn) + if ( + defn.is_explicit_override + and not found_method_base_classes + and found_method_base_classes is not None + # If the class has Any fallback, we can't be certain that a method + # is really missing - it might come from unfollowed import. + and not defn.info.fallback_to_any + ): + self.msg.no_overridable_method(defn.name, defn) + self.check_explicit_override_decorator(defn, found_method_base_classes, defn.impl) + self.check_inplace_operator_method(defn) + + @contextmanager + def enter_overload_impl(self, impl: OverloadPart) -> Iterator[None]: + self.overload_impl_stack.append(impl) + try: + yield + finally: + assert self.overload_impl_stack.pop() == impl + + def extract_callable_type(self, inner_type: Type | None, ctx: Context) -> CallableType | None: + """Get type as seen by an overload item caller.""" + inner_type = get_proper_type(inner_type) + outer_type: FunctionLike | None = None + if inner_type is None or isinstance(inner_type, AnyType): + return None + if isinstance(inner_type, TypeVarLikeType): + inner_type = get_proper_type(inner_type.upper_bound) + if isinstance(inner_type, TypeType): + inner_type = get_proper_type( + self.expr_checker.analyze_type_type_callee(inner_type.item, ctx) + ) + + if isinstance(inner_type, FunctionLike): + outer_type = inner_type + elif isinstance(inner_type, Instance): + inner_call = get_proper_type( + analyze_member_access( + name="__call__", + typ=inner_type, + context=ctx, + is_lvalue=False, + is_super=False, + is_operator=True, + original_type=inner_type, + chk=self, + ) + ) + if isinstance(inner_call, FunctionLike): + outer_type = inner_call + elif isinstance(inner_type, UnionType): + union_type = make_simplified_union(inner_type.items) + if isinstance(union_type, UnionType): + items = [] + for item in union_type.items: + callable_item = self.extract_callable_type(item, ctx) + if callable_item is None: + break + items.append(callable_item) + else: + joined_type = get_proper_type(join.join_type_list(items)) + if isinstance(joined_type, FunctionLike): + outer_type = joined_type + else: + return self.extract_callable_type(union_type, ctx) + + if outer_type is None: + self.msg.not_callable(inner_type, ctx) + return None + if isinstance(outer_type, Overloaded): + return None + + assert isinstance(outer_type, CallableType) + return outer_type + + def check_overlapping_overloads(self, defn: OverloadedFuncDef) -> None: + # At this point we should have set the impl already, and all remaining + # items are decorators + + if self.can_skip_diagnostics: + return + + # Compute some info about the implementation (if it exists) for use below + impl_type: CallableType | None = None + if defn.impl: + if isinstance(defn.impl, FuncDef): + inner_type: Type | None = defn.impl.type + elif isinstance(defn.impl, Decorator): + inner_type = defn.impl.var.type + else: + assert False, "Impl isn't the right type" + + # This can happen if we've got an overload with a different + # decorator or if the implementation is untyped -- we gave up on the types. + impl_type = self.extract_callable_type(inner_type, defn.impl) + + is_descriptor_get = defn.info and defn.name == "__get__" + for i, item in enumerate(defn.items): + assert isinstance(item, Decorator) + sig1 = self.extract_callable_type(item.var.type, item) + if sig1 is None: + continue + + for j, item2 in enumerate(defn.items[i + 1 :]): + assert isinstance(item2, Decorator) + sig2 = self.extract_callable_type(item2.var.type, item2) + if sig2 is None: + continue + + if not are_argument_counts_overlapping(sig1, sig2): + continue + + if overload_can_never_match(sig1, sig2): + self.msg.overloaded_signature_will_never_match(i + 1, i + j + 2, item2.func) + elif not is_descriptor_get: + # Note: we force mypy to check overload signatures in strict-optional mode + # so we don't incorrectly report errors when a user tries typing an overload + # that happens to have a 'if the argument is None' fallback. + # + # For example, the following is fine in strict-optional mode but would throw + # the unsafe overlap error when strict-optional is disabled: + # + # @overload + # def foo(x: None) -> int: ... + # @overload + # def foo(x: str) -> str: ... + # + # See Python 2's map function for a concrete example of this kind of overload. + current_class = self.scope.active_class() + type_vars = current_class.defn.type_vars if current_class else [] + with state.strict_optional_set(True): + if is_unsafe_overlapping_overload_signatures(sig1, sig2, type_vars): + flip_note = ( + j == 0 + and not is_unsafe_overlapping_overload_signatures( + sig2, sig1, type_vars + ) + and not overload_can_never_match(sig2, sig1) + ) + self.msg.overloaded_signatures_overlap( + i + 1, i + j + 2, flip_note, item.func + ) + + if impl_type is not None: + assert defn.impl is not None + + # This is what we want from implementation, it should accept all arguments + # of an overload, but the return types should go the opposite way. + if is_callable_compatible( + impl_type, + sig1, + is_compat=is_subtype, + is_proper_subtype=False, + is_compat_return=lambda l, r: is_subtype(r, l), + ): + continue + # If the above check didn't work, we repeat some key steps in + # is_callable_compatible() to give a better error message. + + # We perform a unification step that's very similar to what + # 'is_callable_compatible' does -- the only difference is that + # we check and see if the impl_type's return value is a + # *supertype* of the overload alternative, not a *subtype*. + # + # This is to match the direction the implementation's return + # needs to be compatible in. + if impl_type.variables: + impl: CallableType | None = unify_generic_callable( + # Normalize both before unifying + impl_type.with_unpacked_kwargs(), + sig1.with_unpacked_kwargs(), + ignore_return=False, + return_constraint_direction=SUPERTYPE_OF, + ) + if impl is None: + self.msg.overloaded_signatures_typevar_specific(i + 1, defn.impl) + continue + else: + impl = impl_type + + # Prevent extra noise from inconsistent use of @classmethod by copying + # the first arg from the method being checked against. + if sig1.arg_types and defn.info: + impl = impl.copy_modified(arg_types=[sig1.arg_types[0]] + impl.arg_types[1:]) + + # Is the overload alternative's arguments subtypes of the implementation's? + if not is_callable_compatible( + impl, sig1, is_compat=is_subtype, is_proper_subtype=False, ignore_return=True + ): + self.msg.overloaded_signatures_param_specific(i + 1, defn.impl) + + # Is the overload alternative's return type a subtype of the implementation's? + if not ( + is_subtype(sig1.ret_type, impl.ret_type) + or is_subtype(impl.ret_type, sig1.ret_type) + ): + self.msg.overloaded_signatures_ret_specific(i + 1, defn.impl) + + # Here's the scoop about generators and coroutines. + # + # There are two kinds of generators: classic generators (functions + # with `yield` or `yield from` in the body) and coroutines + # (functions declared with `async def`). The latter are specified + # in PEP 492 and only available in Python >= 3.5. + # + # Classic generators can be parameterized with three types: + # - ty is the Yield type (the type of y in `yield y`) + # - tc is the type reCeived by yield (the type of c in `c = yield`). + # - tr is the Return type (the type of r in `return r`) + # + # A classic generator must define a return type that's either + # `Generator[ty, tc, tr]`, Iterator[ty], or Iterable[ty] (or + # object or Any). If tc/tr are not given, both are None. + # + # A coroutine must define a return type corresponding to tr; the + # other two are unconstrained. The "external" return type (seen + # by the caller) is Awaitable[tr]. + # + # In addition, there's the synthetic type AwaitableGenerator: it + # inherits from both Awaitable and Generator and can be used both + # in `yield from` and in `await`. This type is set automatically + # for functions decorated with `@types.coroutine` or + # `@asyncio.coroutine`. Its single parameter corresponds to tr. + # + # PEP 525 adds a new type, the asynchronous generator, which was + # first released in Python 3.6. Async generators are `async def` + # functions that can also `yield` values. They can be parameterized + # with two types, ty and tc, because they cannot return a value. + # + # There are several useful methods, each taking a type t and a + # flag c indicating whether it's for a generator or coroutine: + # + # - is_generator_return_type(t, c) returns whether t is a Generator, + # Iterator, Iterable (if not c), or Awaitable (if c), or + # AwaitableGenerator (regardless of c). + # - is_async_generator_return_type(t) returns whether t is an + # AsyncGenerator. + # - get_generator_yield_type(t, c) returns ty. + # - get_generator_receive_type(t, c) returns tc. + # - get_generator_return_type(t, c) returns tr. + + def is_generator_return_type(self, typ: Type, is_coroutine: bool) -> bool: + """Is `typ` a valid type for a generator/coroutine? + + True if `typ` is a *supertype* of Generator or Awaitable. + Also true it it's *exactly* AwaitableGenerator (modulo type parameters). + """ + typ = get_proper_type(typ) + if is_coroutine: + # This means we're in Python 3.5 or later. + at = self.named_generic_type("typing.Awaitable", [AnyType(TypeOfAny.special_form)]) + if is_subtype(at, typ): + return True + else: + any_type = AnyType(TypeOfAny.special_form) + gt = self.named_generic_type("typing.Generator", [any_type, any_type, any_type]) + if is_subtype(gt, typ): + return True + return isinstance(typ, Instance) and typ.type.fullname == "typing.AwaitableGenerator" + + def is_async_generator_return_type(self, typ: Type) -> bool: + """Is `typ` a valid type for an async generator? + + True if `typ` is a supertype of AsyncGenerator. + """ + try: + any_type = AnyType(TypeOfAny.special_form) + agt = self.named_generic_type("typing.AsyncGenerator", [any_type, any_type]) + except KeyError: + # we're running on a version of typing that doesn't have AsyncGenerator yet + return False + return is_subtype(agt, typ) + + def get_generator_yield_type(self, return_type: Type, is_coroutine: bool) -> Type: + """Given the declared return type of a generator (t), return the type it yields (ty).""" + return_type = get_proper_type(return_type) + + if isinstance(return_type, AnyType): + return AnyType(TypeOfAny.from_another_any, source_any=return_type) + elif isinstance(return_type, UnionType): + return make_simplified_union( + [self.get_generator_yield_type(item, is_coroutine) for item in return_type.items] + ) + elif not self.is_generator_return_type( + return_type, is_coroutine + ) and not self.is_async_generator_return_type(return_type): + # If the function doesn't have a proper Generator (or + # Awaitable) return type, anything is permissible. + return AnyType(TypeOfAny.from_error) + elif not isinstance(return_type, Instance): + # Same as above, but written as a separate branch so the typechecker can understand. + return AnyType(TypeOfAny.from_error) + elif return_type.type.fullname == "typing.Awaitable": + # Awaitable: ty is Any. + return AnyType(TypeOfAny.special_form) + elif return_type.args: + # AwaitableGenerator, Generator, AsyncGenerator, Iterator, or Iterable; ty is args[0]. + ret_type = return_type.args[0] + # TODO not best fix, better have dedicated yield token + return ret_type + else: + # If the function's declared supertype of Generator has no type + # parameters (i.e. is `object`), then the yielded values can't + # be accessed so any type is acceptable. IOW, ty is Any. + # (However, see https://github.com/python/mypy/issues/1933) + return AnyType(TypeOfAny.special_form) + + def get_generator_receive_type(self, return_type: Type, is_coroutine: bool) -> Type: + """Given a declared generator return type (t), return the type its yield receives (tc).""" + return_type = get_proper_type(return_type) + + if isinstance(return_type, AnyType): + return AnyType(TypeOfAny.from_another_any, source_any=return_type) + elif isinstance(return_type, UnionType): + return make_simplified_union( + [self.get_generator_receive_type(item, is_coroutine) for item in return_type.items] + ) + elif not self.is_generator_return_type( + return_type, is_coroutine + ) and not self.is_async_generator_return_type(return_type): + # If the function doesn't have a proper Generator (or + # Awaitable) return type, anything is permissible. + return AnyType(TypeOfAny.from_error) + elif not isinstance(return_type, Instance): + # Same as above, but written as a separate branch so the typechecker can understand. + return AnyType(TypeOfAny.from_error) + elif return_type.type.fullname == "typing.Awaitable": + # Awaitable, AwaitableGenerator: tc is Any. + return AnyType(TypeOfAny.special_form) + elif ( + return_type.type.fullname in ("typing.Generator", "typing.AwaitableGenerator") + and len(return_type.args) >= 3 + ): + # Generator: tc is args[1]. + return return_type.args[1] + elif return_type.type.fullname == "typing.AsyncGenerator" and len(return_type.args) >= 2: + return return_type.args[1] + else: + # `return_type` is a supertype of Generator, so callers won't be able to send it + # values. IOW, tc is None. + return NoneType() + + def get_coroutine_return_type(self, return_type: Type) -> Type: + return_type = get_proper_type(return_type) + if isinstance(return_type, AnyType): + return AnyType(TypeOfAny.from_another_any, source_any=return_type) + assert isinstance(return_type, Instance), "Should only be called on coroutine functions." + # Note: return type is the 3rd type parameter of Coroutine. + return return_type.args[2] + + def get_generator_return_type(self, return_type: Type, is_coroutine: bool) -> Type: + """Given the declared return type of a generator (t), return the type it returns (tr).""" + return_type = get_proper_type(return_type) + + if isinstance(return_type, AnyType): + return AnyType(TypeOfAny.from_another_any, source_any=return_type) + elif isinstance(return_type, UnionType): + return make_simplified_union( + [self.get_generator_return_type(item, is_coroutine) for item in return_type.items] + ) + elif not self.is_generator_return_type(return_type, is_coroutine): + # If the function doesn't have a proper Generator (or + # Awaitable) return type, anything is permissible. + return AnyType(TypeOfAny.from_error) + elif not isinstance(return_type, Instance): + # Same as above, but written as a separate branch so the typechecker can understand. + return AnyType(TypeOfAny.from_error) + elif return_type.type.fullname == "typing.Awaitable" and len(return_type.args) == 1: + # Awaitable: tr is args[0]. + return return_type.args[0] + elif ( + return_type.type.fullname in ("typing.Generator", "typing.AwaitableGenerator") + and len(return_type.args) >= 3 + ): + # AwaitableGenerator, Generator: tr is args[2]. + return return_type.args[2] + else: + # We have a supertype of Generator (Iterator, Iterable, object) + # Treat `Iterator[X]` as a shorthand for `Generator[X, Any, None]`. + return NoneType() + + def visit_func_def(self, defn: FuncDef) -> None: + if not self.recurse_into_functions and not defn.def_or_infer_vars: + return + with self.tscope.function_scope(defn), self.set_recurse_into_functions(): + self.check_func_item(defn, name=defn.name) + if not self.can_skip_diagnostics: + if defn.info: + if not defn.is_overload and not defn.is_decorated: + # If the definition is the implementation for an + # overload, the legality of the override has already + # been typechecked, and decorated methods will be + # checked when the decorator is. + found_method_base_classes = self.check_method_override(defn) + self.check_explicit_override_decorator(defn, found_method_base_classes) + self.check_inplace_operator_method(defn) + if defn.original_def: + # Override previous definition. + new_type = self.function_type(defn) + self.check_func_def_override(defn, new_type) + + def check_func_item( + self, + defn: FuncItem, + type_override: CallableType | None = None, + name: str | None = None, + allow_empty: bool = False, + ) -> None: + """Type check a function. + + If type_override is provided, use it as the function type. + """ + self.dynamic_funcs.append(defn.is_dynamic() and not type_override) + + enclosing_node_deferred = self.current_node_deferred + with self.enter_partial_types(is_function=True): + typ = self.function_type(defn) + if type_override: + typ = type_override.copy_modified(line=typ.line, column=typ.column) + if isinstance(typ, CallableType): + with self.enter_attribute_inference_context(): + self.check_func_def(defn, typ, name, allow_empty) + else: + raise RuntimeError("Not supported") + + self.dynamic_funcs.pop() + self.current_node_deferred = enclosing_node_deferred + + if name == "__exit__": + self.check__exit__return_type(defn) + # TODO: the following logic should move to the dataclasses plugin + # https://github.com/python/mypy/issues/15515 + if name == "__post_init__": + if dataclasses_plugin.is_processed_dataclass(defn.info): + dataclasses_plugin.check_post_init(self, defn, defn.info) + + def check_func_def_override(self, defn: FuncDef, new_type: FunctionLike) -> None: + assert defn.original_def is not None + if isinstance(defn.original_def, FuncDef): + # Function definition overrides function definition. + old_type = self.function_type(defn.original_def) + if not is_same_type(new_type, old_type): + self.msg.incompatible_conditional_function_def(defn, old_type, new_type) + else: + # Function definition overrides a variable initialized via assignment or a + # decorated function. + orig_type = defn.original_def.type + if orig_type is None: + # If other branch is unreachable, we don't type check it and so we might + # not have a type for the original definition + return + if isinstance(orig_type, PartialType): + if orig_type.type is None: + # Ah this is a partial type. Give it the type of the function. + orig_def = defn.original_def + if isinstance(orig_def, Decorator): + var = orig_def.var + else: + var = orig_def + partial_types = self.find_partial_types(var) + if partial_types is not None: + var.type = new_type + del partial_types[var] + else: + # Trying to redefine something like partial empty list as function. + self.fail(message_registry.INCOMPATIBLE_REDEFINITION, defn) + else: + name_expr = NameExpr(defn.name) + name_expr.node = defn.original_def + self.binder.assign_type(name_expr, new_type, orig_type) + self.check_subtype( + new_type, + orig_type, + defn, + message_registry.INCOMPATIBLE_REDEFINITION, + "redefinition with type", + "original type", + ) + + @contextmanager + def enter_attribute_inference_context(self) -> Iterator[None]: + old_types = self.inferred_attribute_types + self.inferred_attribute_types = {} + yield None + self.inferred_attribute_types = old_types + + def check_func_def( + self, defn: FuncItem, typ: CallableType, name: str | None, allow_empty: bool = False + ) -> None: + """Type check a function definition.""" + # Expand type variables with value restrictions to ordinary types. + self.check_typevar_defaults(typ.variables) + expanded = self.expand_typevars(defn, typ) + original_typ = typ + for item, typ in expanded: + old_binder = self.binder + self.binder = ConditionalTypeBinder(self.options) + with self.binder.top_frame_context(): + defn.expanded.append(item) + + # We may be checking a function definition or an anonymous + # function. In the first case, set up another reference with the + # precise type. + if not self.can_skip_diagnostics: + self.check_funcdef_item(item, typ, name, defn=defn, original_typ=original_typ) + + # Fix the type if decorated with `@types.coroutine` or `@asyncio.coroutine`. + if defn.is_awaitable_coroutine: + # Update the return type to AwaitableGenerator. + # (This doesn't exist in typing.py, only in typing.pyi.) + t = typ.ret_type + c = defn.is_coroutine + ty = self.get_generator_yield_type(t, c) + tc = self.get_generator_receive_type(t, c) + if c: + tr = self.get_coroutine_return_type(t) + else: + tr = self.get_generator_return_type(t, c) + ret_type = self.named_generic_type( + "typing.AwaitableGenerator", [ty, tc, tr, t] + ) + typ = typ.copy_modified(ret_type=ret_type) + defn.type = typ + + # Push return type. + self.return_types.append(typ.ret_type) + + with self.scope.push_function(defn): + # We temporary push the definition to get the self type as + # visible from *inside* of this function/method. + ref_type: Type | None = self.scope.active_self_type() + + if typ.type_is: + arg_index = 0 + # For methods and classmethods, we want the second parameter + if ref_type is not None and defn.has_self_or_cls_argument: + arg_index = 1 + if arg_index < len(typ.arg_types) and not is_subtype( + typ.type_is, typ.arg_types[arg_index] + ): + self.fail( + message_registry.NARROWED_TYPE_NOT_SUBTYPE.format( + format_type(typ.type_is, self.options), + format_type(typ.arg_types[arg_index], self.options), + ), + item, + ) + + # Store argument types. + found_self = False + if isinstance(defn, FuncDef) and not defn.is_decorated: + found_self = self.require_correct_self_argument(typ, defn) + for i in range(len(typ.arg_types)): + arg_type = typ.arg_types[i] + if isinstance(arg_type, TypeVarType): + # Refuse covariant parameter type variables + # TODO: check recursively for inner type variables + if ( + arg_type.variance == COVARIANT + and defn.name not in ("__init__", "__new__", "__post_init__") + and not is_private(defn.name) # private methods are not inherited + and (i != 0 or not found_self) + ): + ctx: Context = arg_type + if ctx.line < 0: + ctx = typ + self.fail(message_registry.FUNCTION_PARAMETER_CANNOT_BE_COVARIANT, ctx) + # Need to store arguments again for the expanded item. + store_argument_type(item, i, typ, self.named_generic_type) + + # Type check initialization expressions. + body_is_trivial = is_trivial_body(defn.body) + if not self.can_skip_diagnostics: + self.check_default_params(item, body_is_trivial) + + # Type check body in a new scope. + with self.binder.top_frame_context(): + # Copy some type narrowings from an outer function when it seems safe enough + # (i.e. we can't find an assignment that might change the type of the + # variable afterwards). + new_frame: Frame | None = None + for frame in old_binder.frames: + for key, narrowed_type in frame.types.items(): + key_var = extract_var_from_literal_hash(key) + if key_var is not None and not self.is_var_redefined_in_outer_context( + key_var, defn.line + ): + # It seems safe to propagate the type narrowing to a nested scope. + if new_frame is None: + new_frame = self.binder.push_frame() + new_frame.types[key] = narrowed_type + self.binder.declarations[key] = old_binder.declarations[key] + + if self.options.allow_redefinition_new and not self.is_stub: + # Add formal argument types to the binder. + for arg in defn.arguments: + # TODO: Add these directly using a fast path (possibly "put") + v = arg.variable + if v.type is not None: + n = NameExpr(v.name) + n.node = v + self.binder.assign_type(n, v.type, v.type) + + with self.scope.push_function(defn): + # We suppress reachability warnings for empty generator functions + # (return; yield) which have a "yield" that's unreachable by definition + # since it's only there to promote the function into a generator function. + # + # We also suppress reachability warnings when we use TypeVars with value + # restrictions: we only want to report a warning if a certain statement is + # marked as being suppressed in *all* of the expansions, but we currently + # have no good way of doing this. + # + # TODO: Find a way of working around this limitation + if _is_empty_generator_function(item) or len(expanded) >= 2: + self.binder.suppress_unreachable_warnings() + # When checking a third-party library, we can skip function body, + # if during semantic analysis we found that there are no attributes + # defined via self here. + if ( + not self.can_skip_diagnostics + or self.options.preserve_asts + or not isinstance(defn, FuncDef) + or defn.def_or_infer_vars + ): + self.accept(item.body) + unreachable = self.binder.is_unreachable() + if new_frame is not None: + self.binder.pop_frame(True, 0) + + if not unreachable: + if defn.is_generator or is_named_instance( + self.return_types[-1], "typing.AwaitableGenerator" + ): + return_type = self.get_generator_return_type( + self.return_types[-1], defn.is_coroutine + ) + elif defn.is_coroutine: + return_type = self.get_coroutine_return_type(self.return_types[-1]) + else: + return_type = self.return_types[-1] + return_type = get_proper_type(return_type) + + allow_empty = allow_empty or self.options.allow_empty_bodies + + show_error = ( + not body_is_trivial + or + # Allow empty bodies for abstract methods, overloads, in tests and stubs. + ( + not allow_empty + and not ( + isinstance(defn, FuncDef) and defn.abstract_status != NOT_ABSTRACT + ) + and not self.is_stub + ) + ) + + if ( + self.can_skip_diagnostics + # Ignore plugin generated methods, these usually don't need any bodies. + or ( + defn.info is not FUNC_NO_INFO + and ( + defn.name not in defn.info.names + or defn.info.names[defn.name].plugin_generated + ) + ) + # Ignore also definitions that appear in `if TYPE_CHECKING: ...` blocks. + # These can't be called at runtime anyway (similar to plugin-generated). + or (isinstance(defn, FuncDef) and defn.is_mypy_only) + # We want to minimize the fallout from checking empty bodies + # that was absent in many mypy versions. + or (body_is_trivial and is_subtype(NoneType(), return_type)) + ): + show_error = False + + if show_error and not self.current_node_deferred: + may_be_abstract = ( + body_is_trivial + and defn.info is not FUNC_NO_INFO + and defn.info.metaclass_type is not None + and defn.info.metaclass_type.type.has_base("abc.ABCMeta") + ) + if self.options.warn_no_return: + if not isinstance(return_type, (NoneType, AnyType)): + # Control flow fell off the end of a function that was + # declared to return a non-None type. + if isinstance(return_type, UninhabitedType): + # This is a NoReturn function + msg = message_registry.INVALID_IMPLICIT_RETURN + else: + msg = message_registry.MISSING_RETURN_STATEMENT + if body_is_trivial: + msg = msg._replace(code=codes.EMPTY_BODY) + self.fail(msg, defn) + if may_be_abstract: + self.note(message_registry.EMPTY_BODY_ABSTRACT, defn) + else: + msg = message_registry.INCOMPATIBLE_RETURN_VALUE_TYPE + if body_is_trivial: + msg = msg._replace(code=codes.EMPTY_BODY) + # similar to code in check_return_stmt + if ( + not self.check_subtype( + subtype_label="implicitly returns", + subtype=NoneType(), + supertype_label="expected", + supertype=return_type, + context=defn, + msg=msg, + ) + and may_be_abstract + ): + self.note(message_registry.EMPTY_BODY_ABSTRACT, defn) + + self.return_types.pop() + + self.binder = old_binder + + def check_funcdef_item( + self, + item: FuncItem, + typ: CallableType, + name: str | None, + *, + defn: FuncItem, + original_typ: CallableType, + ) -> None: + if isinstance(item, FuncDef): + fdef = item + # Check if __init__ has an invalid return type. + if ( + fdef.info + and fdef.name in ("__init__", "__init_subclass__") + and not isinstance(get_proper_type(typ.ret_type), (NoneType, UninhabitedType)) + and not self.dynamic_funcs[-1] + ): + self.fail(message_registry.MUST_HAVE_NONE_RETURN_TYPE.format(fdef.name), item) + + # Check validity of __new__ signature + if fdef.info and fdef.name == "__new__": + self.check___new___signature(fdef, typ) + + self.check_for_missing_annotations(fdef) + if self.options.disallow_any_unimported: + if fdef.type and isinstance(fdef.type, CallableType): + ret_type = fdef.type.ret_type + if has_any_from_unimported_type(ret_type): + self.msg.unimported_type_becomes_any("Return type", ret_type, fdef) + for idx, arg_type in enumerate(fdef.type.arg_types): + if has_any_from_unimported_type(arg_type): + prefix = f'Argument {idx + 1} to "{fdef.name}"' + self.msg.unimported_type_becomes_any(prefix, arg_type, fdef) + check_for_explicit_any( + fdef.type, self.options, self.is_typeshed_stub, self.msg, context=fdef + ) + + if name: # Special method names + if ( + defn.info + and self.is_reverse_op_method(name) + and defn not in self.overload_impl_stack + ): + self.check_reverse_op_method(item, typ, name, defn) + elif name in ("__getattr__", "__getattribute__"): + self.check_getattr_method(typ, defn, name) + elif name == "__setattr__": + self.check_setattr_method(typ, defn) + + # Refuse contravariant return type variable + if isinstance(typ.ret_type, TypeVarType): + if typ.ret_type.variance == CONTRAVARIANT: + self.fail(message_registry.RETURN_TYPE_CANNOT_BE_CONTRAVARIANT, typ.ret_type) + self.check_unbound_return_typevar(typ) + elif isinstance(original_typ.ret_type, TypeVarType) and original_typ.ret_type.values: + # Since type vars with values are expanded, the return type is changed + # to a raw value. This is a hack to get it back. + self.check_unbound_return_typevar(original_typ) + + # Check that Generator functions have the appropriate return type. + if defn.is_generator: + if defn.is_async_generator: + if not self.is_async_generator_return_type(typ.ret_type): + self.fail(message_registry.INVALID_RETURN_TYPE_FOR_ASYNC_GENERATOR, typ) + else: + if not self.is_generator_return_type(typ.ret_type, defn.is_coroutine): + self.fail(message_registry.INVALID_RETURN_TYPE_FOR_GENERATOR, typ) + + def require_correct_self_argument(self, func: Type, defn: FuncDef) -> bool: + func = get_proper_type(func) + if not isinstance(func, CallableType): + return False + + # Do not report errors for untyped methods in classes nested in untyped funcs. + if not ( + self.options.check_untyped_defs + or len(self.dynamic_funcs) < 2 + or not self.dynamic_funcs[-2] + or not defn.is_dynamic() + ): + return bool(func.arg_types) + + with self.scope.push_function(defn): + # We temporary push the definition to get the self type as + # visible from *inside* of this function/method. + ref_type: Type | None = self.scope.active_self_type() + if ref_type is None: + return False + + if not defn.has_self_or_cls_argument or ( + func.arg_kinds and func.arg_kinds[0] in [nodes.ARG_STAR, nodes.ARG_STAR2] + ): + return False + + if not func.arg_types: + self.fail( + 'Method must have at least one argument. Did you forget the "self" argument?', defn + ) + return False + + if self.can_skip_diagnostics: + return True + + arg_type = func.arg_types[0] + if defn.is_class or defn.name == "__new__": + ref_type = mypy.types.TypeType.make_normalized(ref_type) + if is_same_type(arg_type, ref_type): + return True + + # This level of erasure matches the one in checkmember.check_self_arg(), + # better keep these two checks consistent. + erased = get_proper_type(erase_typevars(erase_to_bound(arg_type))) + if not is_subtype(ref_type, erased, ignore_type_params=True): + if ( + isinstance(erased, Instance) + and erased.type.is_protocol + or isinstance(erased, TypeType) + and isinstance(erased.item, Instance) + and erased.item.type.is_protocol + ): + # We allow the explicit self-type to be not a supertype of + # the current class if it is a protocol. For such cases + # the consistency check will be performed at call sites. + msg = None + elif func.arg_names[0] in {"self", "cls"}: + msg = message_registry.ERASED_SELF_TYPE_NOT_SUPERTYPE.format( + erased.str_with_options(self.options), ref_type.str_with_options(self.options) + ) + else: + msg = message_registry.MISSING_OR_INVALID_SELF_TYPE + if msg: + self.fail(msg, defn) + return True + + def is_var_redefined_in_outer_context(self, v: Var, after_line: int) -> bool: + """Can the variable be assigned to at module top level or outer function? + + Note that this doesn't do a full CFG analysis but uses a line number based + heuristic that isn't correct in some (rare) cases. + """ + if v.is_final: + # Final vars are definitely never reassigned. + return False + + outers = self.tscope.outer_functions() + if not outers: + # Top-level function -- outer context is top level, and we can't reason about + # globals + return True + for outer in outers: + if isinstance(outer, FuncDef): + if find_last_var_assignment_line(outer.body, v) >= after_line: + return True + return False + + def check_unbound_return_typevar(self, typ: CallableType) -> None: + """Fails when the return typevar is not defined in arguments.""" + if isinstance(typ.ret_type, TypeVarType) and typ.ret_type in typ.variables: + arg_type_visitor = CollectArgTypeVarTypes() + for argtype in typ.arg_types: + argtype.accept(arg_type_visitor) + + if typ.ret_type not in arg_type_visitor.arg_types: + self.fail(message_registry.UNBOUND_TYPEVAR, typ.ret_type, code=TYPE_VAR) + upper_bound = get_proper_type(typ.ret_type.upper_bound) + if not ( + isinstance(upper_bound, Instance) + and upper_bound.type.fullname == "builtins.object" + ): + self.note( + "Consider using the upper bound " + f"{format_type(typ.ret_type.upper_bound, self.options)} instead", + context=typ.ret_type, + ) + + def check_default_params(self, item: FuncItem, body_is_trivial: bool) -> None: + for param in item.arguments: + if param.initializer is None: + continue + if body_is_trivial and isinstance(param.initializer, EllipsisExpr): + continue + name = param.variable.name + msg = "Incompatible default for " + if name.startswith("__tuple_param_"): + msg += f"tuple parameter {name[12:]}" + else: + msg += f'parameter "{name}"' + if ( + not self.options.implicit_optional + and isinstance(param.initializer, NameExpr) + and param.initializer.fullname == "builtins.None" + ): + notes = [ + "PEP 484 prohibits implicit Optional. " + "Accordingly, mypy has changed its default to no_implicit_optional=True", + "Use https://github.com/hauntsaninja/no_implicit_optional to automatically " + "upgrade your codebase", + ] + else: + notes = None + self.check_simple_assignment( + param.variable.type, + param.initializer, + context=param.initializer, + msg=ErrorMessage(msg, code=codes.ASSIGNMENT), + lvalue_name="parameter", + rvalue_name="default", + notes=notes, + ) + + def is_forward_op_method(self, method_name: str) -> bool: + return method_name in operators.reverse_op_methods + + def is_reverse_op_method(self, method_name: str) -> bool: + return method_name in operators.reverse_op_method_set + + def check_for_missing_annotations(self, fdef: FuncItem) -> None: + show_untyped = not self.is_typeshed_stub or self.options.warn_incomplete_stub + if not show_untyped: + return + + # Check for functions with unspecified/not fully specified types. + def is_unannotated_any(t: Type) -> bool: + if not isinstance(t, ProperType): + return False + return isinstance(t, AnyType) and t.type_of_any == TypeOfAny.unannotated + + has_explicit_annotation = isinstance(fdef.type, CallableType) and any( + not is_unannotated_any(t) for t in fdef.type.arg_types + [fdef.type.ret_type] + ) + + check_incomplete_defs = self.options.disallow_incomplete_defs and has_explicit_annotation + if self.options.disallow_untyped_defs or check_incomplete_defs: + if fdef.type is None and self.options.disallow_untyped_defs: + if not fdef.arguments or ( + len(fdef.arguments) == 1 + and (fdef.arg_names[0] == "self" or fdef.arg_names[0] == "cls") + ): + self.fail(message_registry.RETURN_TYPE_EXPECTED, fdef) + if not has_return_statement(fdef) and not fdef.is_generator: + self.note( + 'Use "-> None" if function does not return a value', + fdef, + code=codes.NO_UNTYPED_DEF, + ) + else: + self.fail(message_registry.FUNCTION_TYPE_EXPECTED, fdef) + elif isinstance(fdef.type, CallableType): + ret_type = get_proper_type(fdef.type.ret_type) + if is_unannotated_any(ret_type): + self.fail(message_registry.RETURN_TYPE_EXPECTED, fdef) + elif fdef.is_generator: + if is_unannotated_any( + self.get_generator_return_type(ret_type, fdef.is_coroutine) + ): + self.fail(message_registry.RETURN_TYPE_EXPECTED, fdef) + elif fdef.is_coroutine and isinstance(ret_type, Instance): + if is_unannotated_any(self.get_coroutine_return_type(ret_type)): + self.fail(message_registry.RETURN_TYPE_EXPECTED, fdef) + if any(is_unannotated_any(t) for t in fdef.type.arg_types): + self.fail(message_registry.PARAM_TYPE_EXPECTED, fdef) + + def check___new___signature(self, fdef: FuncDef, typ: CallableType) -> None: + self_type = fill_typevars_with_any(fdef.info) + bound_type = bind_self(typ, self_type, is_classmethod=True) + # Check that __new__ (after binding cls) returns an instance + # type (or any). + if fdef.info.is_metaclass(): + # This is a metaclass, so it must return a new unrelated type. + self.check_subtype( + bound_type.ret_type, + self.type_type(), + fdef, + message_registry.INVALID_NEW_TYPE, + "returns", + "but must return a subtype of", + ) + elif not isinstance( + get_proper_type(bound_type.ret_type), + (AnyType, Instance, TupleType, UninhabitedType, LiteralType), + ): + self.fail( + message_registry.NON_INSTANCE_NEW_TYPE.format( + format_type(bound_type.ret_type, self.options) + ), + fdef, + ) + else: + # And that it returns a subtype of the class + self.check_subtype( + bound_type.ret_type, + self_type, + fdef, + message_registry.INVALID_NEW_TYPE, + "returns", + "but must return a subtype of", + ) + + def check_reverse_op_method( + self, defn: FuncItem, reverse_type: CallableType, reverse_name: str, context: Context + ) -> None: + """Check a reverse operator method such as __radd__.""" + # Decides whether it's worth calling check_overlapping_op_methods(). + + # This used to check for some very obscure scenario. It now + # just decides whether it's worth calling + # check_overlapping_op_methods(). + + assert defn.info + + # First check for a valid signature + method_type = CallableType( + [AnyType(TypeOfAny.special_form), AnyType(TypeOfAny.special_form)], + [nodes.ARG_POS, nodes.ARG_POS], + [None, None], + AnyType(TypeOfAny.special_form), + self.named_type("builtins.function"), + ) + if not is_subtype(reverse_type, method_type): + self.msg.invalid_signature(reverse_type, context) + return + + if reverse_name in ("__eq__", "__ne__"): + # These are defined for all objects => can't cause trouble. + return + + # With 'Any' or 'object' return type we are happy, since any possible + # return value is valid. + ret_type = get_proper_type(reverse_type.ret_type) + if isinstance(ret_type, AnyType): + return + if isinstance(ret_type, Instance): + if ret_type.type.fullname == "builtins.object": + return + if reverse_type.arg_kinds[0] == ARG_STAR: + reverse_type = reverse_type.copy_modified( + arg_types=[reverse_type.arg_types[0]] * 2, + arg_kinds=[ARG_POS] * 2, + arg_names=[reverse_type.arg_names[0], "_"], + ) + assert len(reverse_type.arg_types) >= 2 + + forward_name = operators.normal_from_reverse_op[reverse_name] + forward_inst = get_proper_type(reverse_type.arg_types[1]) + if isinstance(forward_inst, TypeVarType): + forward_inst = get_proper_type(forward_inst.upper_bound) + elif isinstance(forward_inst, TupleType): + forward_inst = tuple_fallback(forward_inst) + elif isinstance(forward_inst, (FunctionLike, TypedDictType, LiteralType)): + forward_inst = forward_inst.fallback + if isinstance(forward_inst, TypeType): + item = forward_inst.item + if isinstance(item, Instance): + opt_meta = item.type.metaclass_type + if opt_meta is not None: + forward_inst = opt_meta + + def has_readable_member(typ: UnionType | Instance, name: str) -> bool: + # TODO: Deal with attributes of TupleType etc. + if isinstance(typ, Instance): + return typ.type.has_readable_member(name) + return all( + (isinstance(x, UnionType) and has_readable_member(x, name)) + or (isinstance(x, Instance) and x.type.has_readable_member(name)) + for x in get_proper_types(typ.relevant_items()) + ) + + if not ( + isinstance(forward_inst, (Instance, UnionType)) + and has_readable_member(forward_inst, forward_name) + ): + return + forward_base = reverse_type.arg_types[1] + forward_type = self.expr_checker.analyze_external_member_access( + forward_name, forward_base, context=defn + ) + self.check_overlapping_op_methods( + reverse_type, + reverse_name, + defn.info, + forward_type, + forward_name, + forward_base, + context=defn, + ) + + def check_overlapping_op_methods( + self, + reverse_type: CallableType, + reverse_name: str, + reverse_class: TypeInfo, + forward_type: Type, + forward_name: str, + forward_base: Type, + context: Context, + ) -> None: + """Check for overlapping method and reverse method signatures. + + This function assumes that: + + - The reverse method has valid argument count and kinds. + - If the reverse operator method accepts some argument of type + X, the forward operator method also belong to class X. + + For example, if we have the reverse operator `A.__radd__(B)`, then the + corresponding forward operator must have the type `B.__add__(...)`. + """ + + # Note: Suppose we have two operator methods "A.__rOP__(B) -> R1" and + # "B.__OP__(C) -> R2". We check if these two methods are unsafely overlapping + # by using the following algorithm: + # + # 1. Rewrite "B.__OP__(C) -> R1" to "temp1(B, C) -> R1" + # + # 2. Rewrite "A.__rOP__(B) -> R2" to "temp2(B, A) -> R2" + # + # 3. Treat temp1 and temp2 as if they were both variants in the same + # overloaded function. (This mirrors how the Python runtime calls + # operator methods: we first try __OP__, then __rOP__.) + # + # If the first signature is unsafely overlapping with the second, + # report an error. + # + # 4. However, if temp1 shadows temp2 (e.g. the __rOP__ method can never + # be called), do NOT report an error. + # + # This behavior deviates from how we handle overloads -- many of the + # modules in typeshed seem to define __OP__ methods that shadow the + # corresponding __rOP__ method. + # + # Note: we do not attempt to handle unsafe overlaps related to multiple + # inheritance. (This is consistent with how we handle overloads: we also + # do not try checking unsafe overlaps due to multiple inheritance there.) + + for forward_item in flatten_nested_unions([forward_type]): + forward_item = get_proper_type(forward_item) + if isinstance(forward_item, CallableType): + if self.is_unsafe_overlapping_op(forward_item, forward_base, reverse_type): + self.msg.operator_method_signatures_overlap( + reverse_class, reverse_name, forward_base, forward_name, context + ) + elif isinstance(forward_item, Overloaded): + for item in forward_item.items: + if self.is_unsafe_overlapping_op(item, forward_base, reverse_type): + self.msg.operator_method_signatures_overlap( + reverse_class, reverse_name, forward_base, forward_name, context + ) + elif not isinstance(forward_item, AnyType): + self.msg.forward_operator_not_callable(forward_name, context) + + def is_unsafe_overlapping_op( + self, forward_item: CallableType, forward_base: Type, reverse_type: CallableType + ) -> bool: + # TODO: check argument kinds? + if len(forward_item.arg_types) < 1: + # Not a valid operator method -- can't succeed anyway. + return False + + # Erase the type if necessary to make sure we don't have a single + # TypeVar in forward_tweaked. (Having a function signature containing + # just a single TypeVar can lead to unpredictable behavior.) + forward_base_erased = forward_base + if isinstance(forward_base, TypeVarType): + forward_base_erased = erase_to_bound(forward_base) + + # Construct normalized function signatures corresponding to the + # operator methods. The first argument is the left operand and the + # second operand is the right argument -- we switch the order of + # the arguments of the reverse method. + + # TODO: this manipulation is dangerous if callables are generic. + # Shuffling arguments between callables can create meaningless types. + forward_tweaked = forward_item.copy_modified( + arg_types=[forward_base_erased, forward_item.arg_types[0]], + arg_kinds=[nodes.ARG_POS] * 2, + arg_names=[None] * 2, + ) + reverse_tweaked = reverse_type.copy_modified( + arg_types=[reverse_type.arg_types[1], reverse_type.arg_types[0]], + arg_kinds=[nodes.ARG_POS] * 2, + arg_names=[None] * 2, + ) + + reverse_base_erased = reverse_type.arg_types[0] + if isinstance(reverse_base_erased, TypeVarType): + reverse_base_erased = erase_to_bound(reverse_base_erased) + + if is_same_type(reverse_base_erased, forward_base_erased): + return False + elif is_subtype(reverse_base_erased, forward_base_erased): + first = reverse_tweaked + second = forward_tweaked + else: + first = forward_tweaked + second = reverse_tweaked + + current_class = self.scope.active_class() + type_vars = current_class.defn.type_vars if current_class else [] + return is_unsafe_overlapping_overload_signatures( + first, second, type_vars, partial_only=False + ) + + def check_inplace_operator_method(self, defn: FuncBase) -> None: + """Check an inplace operator method such as __iadd__. + + They cannot arbitrarily overlap with __add__. + """ + method = defn.name + if method not in operators.inplace_operator_methods: + return + typ = bind_self(self.function_type(defn)) + cls = defn.info + other_method = "__" + method[3:] + if cls.has_readable_member(other_method): + instance = fill_typevars(cls) + typ2 = get_proper_type( + self.expr_checker.analyze_external_member_access(other_method, instance, defn) + ) + fail = False + if isinstance(typ2, FunctionLike): + if not is_more_general_arg_prefix(typ, typ2): + fail = True + else: + # TODO overloads + fail = True + if fail: + self.msg.signatures_incompatible(method, other_method, defn) + + def check_getattr_method(self, typ: Type, context: Context, name: str) -> None: + if len(self.scope.stack) == 1: + # module scope + if name == "__getattribute__": + self.fail(message_registry.MODULE_LEVEL_GETATTRIBUTE, context) + return + # __getattr__ is fine at the module level as of Python 3.7 (PEP 562). We could + # show an error for Python < 3.7, but that would be annoying in code that supports + # both 3.7 and older versions. + method_type = CallableType( + [self.named_type("builtins.str")], + [nodes.ARG_POS], + [None], + AnyType(TypeOfAny.special_form), + self.named_type("builtins.function"), + ) + elif self.scope.active_class(): + method_type = CallableType( + [AnyType(TypeOfAny.special_form), self.named_type("builtins.str")], + [nodes.ARG_POS, nodes.ARG_POS], + [None, None], + AnyType(TypeOfAny.special_form), + self.named_type("builtins.function"), + ) + else: + return + if not is_subtype(typ, method_type): + self.msg.invalid_signature_for_special_method(typ, context, name) + + def check_setattr_method(self, typ: Type, context: Context) -> None: + if not self.scope.active_class(): + return + method_type = CallableType( + [ + AnyType(TypeOfAny.special_form), + self.named_type("builtins.str"), + AnyType(TypeOfAny.special_form), + ], + [nodes.ARG_POS, nodes.ARG_POS, nodes.ARG_POS], + [None, None, None], + NoneType(), + self.named_type("builtins.function"), + ) + if not is_subtype(typ, method_type): + self.msg.invalid_signature_for_special_method(typ, context, "__setattr__") + + def check_slots_definition(self, typ: Type, context: Context) -> None: + """Check the type of __slots__.""" + str_type = self.named_type("builtins.str") + expected_type = UnionType( + [str_type, self.named_generic_type("typing.Iterable", [str_type])] + ) + self.check_subtype( + typ, + expected_type, + context, + message_registry.INVALID_TYPE_FOR_SLOTS, + "actual type", + "expected type", + code=codes.ASSIGNMENT, + ) + + def check_match_args(self, var: Var, typ: Type, context: Context) -> None: + """Check that __match_args__ contains literal strings""" + if not self.scope.active_class(): + return + typ = get_proper_type(typ) + if not isinstance(typ, TupleType) or not all( + is_string_literal(item) for item in typ.items + ): + self.msg.note( + "__match_args__ must be a tuple containing string literals for checking " + "of match statements to work", + context, + code=codes.LITERAL_REQ, + ) + + def expand_typevars( + self, defn: FuncItem, typ: CallableType + ) -> list[tuple[FuncItem, CallableType]]: + # TODO use generator + subst: list[list[tuple[TypeVarId, Type]]] = [] + tvars = list(typ.variables) or [] + if defn.info: + # Class type variables + tvars += defn.info.defn.type_vars or [] + for tvar in tvars: + if isinstance(tvar, TypeVarType) and tvar.values: + subst.append([(tvar.id, value) for value in tvar.values]) + # Make a copy of the function to check for each combination of + # value restricted type variables. (Except when running mypyc, + # where we need one canonical version of the function.) + if subst and not (self.options.mypyc or self.options.inspections): + result: list[tuple[FuncItem, CallableType]] = [] + for substitutions in itertools.product(*subst): + mapping = dict(substitutions) + result.append((expand_func(defn, mapping), expand_type(typ, mapping))) + return result + else: + return [(defn, typ)] + + def check_explicit_override_decorator( + self, + defn: FuncDef | OverloadedFuncDef, + found_method_base_classes: list[TypeInfo] | None, + context: Context | None = None, + ) -> None: + plugin_generated = False + if defn.info and (node := defn.info.get(defn.name)) and node.plugin_generated: + # Do not report issues for plugin generated nodes, + # they can't realistically use `@override` for their methods. + plugin_generated = True + + if ( + not plugin_generated + and found_method_base_classes + and not defn.is_explicit_override + and defn.name not in ("__init__", "__new__") + and not is_private(defn.name) + ): + self.msg.explicit_override_decorator_missing( + defn.name, found_method_base_classes[0].fullname, context or defn + ) + + def check_method_override( + self, defn: FuncDef | OverloadedFuncDef | Decorator + ) -> list[TypeInfo] | None: + """Check if function definition is compatible with base classes. + + This may defer the method if a signature is not available in at least one base class. + Return ``None`` if that happens. + + Return a list of base classes which contain an attribute with the method name. + """ + if self.can_skip_diagnostics: + return None + # Check against definitions in base classes. + check_override_compatibility = ( + defn.name not in ("__init__", "__new__", "__init_subclass__", "__post_init__") + and (self.options.check_untyped_defs or not defn.is_dynamic()) + and ( + # don't check override for synthesized __replace__ methods from dataclasses + defn.name != "__replace__" + or defn.info.metadata.get("dataclass_tag") is None + ) + ) + found_method_base_classes: list[TypeInfo] = [] + for base in defn.info.mro[1:]: + result = self.check_method_or_accessor_override_for_base( + defn, base, check_override_compatibility + ) + if result is None: + # Node was deferred, we will have another attempt later. + return None + if result: + found_method_base_classes.append(base) + return found_method_base_classes + + def check_method_or_accessor_override_for_base( + self, + defn: FuncDef | OverloadedFuncDef | Decorator, + base: TypeInfo, + check_override_compatibility: bool, + ) -> bool | None: + """Check if method definition is compatible with a base class. + + Return ``None`` if the node was deferred because one of the corresponding + superclass nodes is not ready. + + Return ``True`` if an attribute with the method name was found in the base class. + """ + found_base_method = False + if base: + name = defn.name + base_attr = base.names.get(name) + if base_attr: + # First, check if we override a final (always an error, even with Any types). + if is_final_node(base_attr.node) and not is_private(name): + self.msg.cant_override_final(name, base.name, defn) + # Second, final can't override anything writeable independently of types. + if defn.is_final: + self.check_if_final_var_override_writable(name, base_attr.node, defn) + found_base_method = True + if check_override_compatibility: + # Check compatibility of the override signature + # (__init__, __new__, __init_subclass__ are special). + if self.check_method_override_for_base_with_name(defn, name, base): + return None + if name in operators.inplace_operator_methods: + # Figure out the name of the corresponding operator method. + method = "__" + name[3:] + # An inplace operator method such as __iadd__ might not be + # always introduced safely if a base class defined __add__. + # TODO can't come up with an example where this is + # necessary; now it's "just in case" + if self.check_method_override_for_base_with_name(defn, method, base): + return None + return found_base_method + + def check_setter_type_override(self, defn: OverloadedFuncDef, base: TypeInfo) -> None: + """Check override of a setter type of a mutable attribute. + + Currently, this should be only called when either base node or the current node + is a custom settable property (i.e. where setter type is different from getter type). + Note that this check is contravariant. + """ + typ, _ = self.node_type_from_base(defn.name, defn.info, defn, setter_type=True) + original_type, _ = self.node_type_from_base(defn.name, base, defn, setter_type=True) + # The caller should handle deferrals. + assert typ is not None and original_type is not None + + if not is_subtype(original_type, typ): + self.msg.incompatible_setter_override(defn.setter, typ, original_type, base) + + def check_method_override_for_base_with_name( + self, defn: FuncDef | OverloadedFuncDef | Decorator, name: str, base: TypeInfo + ) -> bool: + """Check if overriding an attribute `name` of `base` with `defn` is valid. + + Return True if the supertype node was not analysed yet, and `defn` was deferred. + """ + base_attr = base.names.get(name) + if not base_attr: + return False + # The name of the method is defined in the base class. + + # Point errors at the 'def' line (important for backward compatibility + # of type ignores). + if not isinstance(defn, Decorator): + context = defn + else: + context = defn.func + + # Construct the type of the overriding method. + if isinstance(defn, (FuncDef, OverloadedFuncDef)): + override_class_or_static = defn.is_class or defn.is_static + else: + override_class_or_static = defn.func.is_class or defn.func.is_static + typ, _ = self.node_type_from_base(defn.name, defn.info, defn) + if typ is None: + # This may only happen if we're checking `x-redefinition` member + # and `x` itself is for some reason gone. Normally the node should + # be reachable from the containing class by its name. + # The redefinition is never removed, use this as a sanity check to verify + # the reasoning above. + assert f"{defn.name}-redefinition" in defn.info.names + return False + + original_node = base_attr.node + # `original_type` can be partial if (e.g.) it is originally an + # instance variable from an `__init__` block that becomes deferred. + supertype_ready = True + original_type, _ = self.node_type_from_base(name, base, defn) + if original_type is None: + supertype_ready = False + if self.pass_num < self.last_pass: + # If there are passes left, defer this node until next pass, + # otherwise try reconstructing the method type from available information. + # For consistency, defer an enclosing top-level function (if any). + top_level = self.scope.top_level_function() + if isinstance(top_level, FuncDef): + self.defer_node(top_level, self.scope.enclosing_class(top_level)) + else: + # Specify enclosing class explicitly, as we check type override before + # entering e.g. decorators or overloads. + self.defer_node(defn, defn.info) + return True + elif isinstance(original_node, (FuncDef, OverloadedFuncDef)): + original_type = self.function_type(original_node) + elif isinstance(original_node, Decorator): + original_type = self.function_type(original_node.func) + elif isinstance(original_node, Var): + # Super type can define method as an attribute. + # See https://github.com/python/mypy/issues/10134 + + # We also check that sometimes `original_node.type` is None. + # This is the case when we use something like `__hash__ = None`. + if original_node.type is not None: + original_type = get_proper_type(original_node.type) + else: + original_type = NoneType() + else: + # Will always fail to typecheck below, since we know the node is a method + original_type = NoneType() + + always_allow_covariant = False + if is_settable_property(defn) and ( + is_settable_property(original_node) or isinstance(original_node, Var) + ): + if is_custom_settable_property(defn) or (is_custom_settable_property(original_node)): + # Unlike with getter, where we try to construct some fallback type in case of + # deferral during last_pass, we can't make meaningful setter checks if the + # supertype is not known precisely. + if supertype_ready: + always_allow_covariant = True + self.check_setter_type_override(defn, base) + + if isinstance(original_node, (FuncDef, OverloadedFuncDef)): + original_class_or_static = original_node.is_class or original_node.is_static + elif isinstance(original_node, Decorator): + fdef = original_node.func + original_class_or_static = fdef.is_class or fdef.is_static + else: + original_class_or_static = False # a variable can't be class or static + + typ = get_proper_type(typ) + original_type = get_proper_type(original_type) + + if ( + is_property(defn) + and isinstance(original_node, Var) + and not original_node.is_final + and (not original_node.is_property or original_node.is_settable_property) + and isinstance(defn, Decorator) + ): + # We only give an error where no other similar errors will be given. + if not isinstance(original_type, AnyType): + self.msg.fail( + "Cannot override writeable attribute with read-only property", + # Give an error on function line to match old behaviour. + defn.func, + code=codes.OVERRIDE, + ) + + if isinstance(original_type, AnyType) or isinstance(typ, AnyType): + pass + elif isinstance(original_type, FunctionLike) and isinstance(typ, FunctionLike): + # Check that the types are compatible. + ok = self.check_override( + typ, + original_type, + defn.name, + name, + base.name if base.module_name == self.tree.fullname else base.fullname, + original_class_or_static, + override_class_or_static, + context, + ) + # Check if this override is covariant. + if ( + ok + and original_node + and codes.MUTABLE_OVERRIDE in self.options.enabled_error_codes + and self.is_writable_attribute(original_node) + and not always_allow_covariant + and not is_subtype(original_type, typ, ignore_pos_arg_names=True) + ): + base_str, override_str = format_type_distinctly( + original_type, typ, options=self.options + ) + msg = message_registry.COVARIANT_OVERRIDE_OF_MUTABLE_ATTRIBUTE.with_additional_msg( + f' (base class "{base.name}" defined the type as {base_str},' + f" override has type {override_str})" + ) + self.fail(msg, context) + elif isinstance(original_type, UnionType) and any( + is_subtype(typ, orig_typ, ignore_pos_arg_names=True) + for orig_typ in original_type.items + ): + # This method is a subtype of at least one union variant. + if ( + original_node + and codes.MUTABLE_OVERRIDE in self.options.enabled_error_codes + and self.is_writable_attribute(original_node) + and not always_allow_covariant + ): + # Covariant override of mutable attribute. + base_str, override_str = format_type_distinctly( + original_type, typ, options=self.options + ) + msg = message_registry.COVARIANT_OVERRIDE_OF_MUTABLE_ATTRIBUTE.with_additional_msg( + f' (base class "{base.name}" defined the type as {base_str},' + f" override has type {override_str})" + ) + self.fail(msg, context) + elif is_equivalent(original_type, typ): + # Assume invariance for a non-callable attribute here. Note + # that this doesn't affect read-only properties which can have + # covariant overrides. + pass + elif ( + original_node + and (not self.is_writable_attribute(original_node) or always_allow_covariant) + and is_subtype(typ, original_type) + ): + # If the attribute is read-only, allow covariance + pass + else: + self.msg.signature_incompatible_with_supertype( + defn.name, name, base.name, context, original=original_type, override=typ + ) + return False + + def get_op_other_domain(self, tp: FunctionLike) -> Type | None: + if isinstance(tp, CallableType): + if tp.arg_kinds and tp.arg_kinds[0] == ARG_POS: + # For generic methods, domain comparison is tricky, as a first + # approximation erase all remaining type variables. + return erase_typevars(tp.arg_types[0], {v.id for v in tp.variables}) + return None + elif isinstance(tp, Overloaded): + raw_items = [self.get_op_other_domain(it) for it in tp.items] + items = [it for it in raw_items if it] + if items: + return make_simplified_union(items) + return None + else: + assert False, "Need to check all FunctionLike subtypes here" + + def check_override( + self, + override: FunctionLike, + original: FunctionLike, + name: str, + name_in_super: str, + supertype: str, + original_class_or_static: bool, + override_class_or_static: bool, + node: Context, + ) -> bool: + """Check a method override with given signatures. + + Arguments: + override: The signature of the overriding method. + original: The signature of the original supertype method. + name: The name of the overriding method. + Used primarily for generating error messages. + name_in_super: The name of the overridden in the superclass. + Used for generating error messages only. + supertype: The name of the supertype. + original_class_or_static: Indicates whether the original method (from the superclass) + is either a class method or a static method. + override_class_or_static: Indicates whether the overriding method (from the subclass) + is either a class method or a static method. + node: Context node. + """ + # Use boolean variable to clarify code. + fail = False + op_method_wider_note = False + if not is_subtype(override, original, ignore_pos_arg_names=True): + fail = True + elif isinstance(override, Overloaded) and self.is_forward_op_method(name): + # Operator method overrides cannot extend the domain, as + # this could be unsafe with reverse operator methods. + original_domain = self.get_op_other_domain(original) + override_domain = self.get_op_other_domain(override) + if ( + original_domain + and override_domain + and not is_subtype(override_domain, original_domain) + ): + fail = True + op_method_wider_note = True + if isinstance(override, FunctionLike): + if original_class_or_static and not override_class_or_static: + fail = True + elif isinstance(original, CallableType) and isinstance(override, CallableType): + if original.type_guard is not None and override.type_guard is None: + fail = True + if original.type_is is not None and override.type_is is None: + fail = True + + if is_private(name): + fail = False + + if fail: + emitted_msg = False + + offset_arguments = isinstance(override, CallableType) and override.unpack_kwargs + # Normalize signatures, so we get better diagnostics. + if isinstance(override, (CallableType, Overloaded)): + override = override.with_unpacked_kwargs() + if isinstance(original, (CallableType, Overloaded)): + original = original.with_unpacked_kwargs() + + if ( + isinstance(override, CallableType) + and isinstance(original, CallableType) + and len(override.arg_types) == len(original.arg_types) + and override.min_args == original.min_args + ): + # Give more detailed messages for the common case of both + # signatures having the same number of arguments and no + # overloads. + + # override might have its own generic function type + # variables. If an argument or return type of override + # does not have the correct subtyping relationship + # with the original type even after these variables + # are erased, then it is definitely an incompatibility. + + override_ids = override.type_var_ids() + type_name = None + definition = get_func_def(override) + if isinstance(definition, FuncDef): + type_name = definition.info.name + + def erase_override(t: Type) -> Type: + return erase_typevars(t, ids_to_erase=override_ids) + + for i, (sub_kind, super_kind) in enumerate( + zip(override.arg_kinds, original.arg_kinds) + ): + if sub_kind.is_positional() and super_kind.is_positional(): + override_arg_type = override.arg_types[i] + original_arg_type = original.arg_types[i] + elif sub_kind.is_named() and super_kind.is_named() and not offset_arguments: + arg_name = override.arg_names[i] + if arg_name in original.arg_names: + override_arg_type = override.arg_types[i] + original_i = original.arg_names.index(arg_name) + original_arg_type = original.arg_types[original_i] + else: + continue + else: + continue + if not is_subtype(original_arg_type, erase_override(override_arg_type)): + context: Context = node + if ( + isinstance(node, FuncDef) + and not node.is_property + and ( + not node.is_decorated # fast path + # allow trivial decorators like @classmethod and @override + or not (sym := node.info.get(node.name)) + or not isinstance(sym.node, Decorator) + or not sym.node.decorators + ) + ): + # If there's any decorator, we can no longer map arguments 1:1 reliably. + arg_node = node.arguments[i + override.bound()] + if arg_node.line != -1: + context = arg_node + self.msg.argument_incompatible_with_supertype( + i + 1, + name, + type_name, + name_in_super, + original_arg_type, + supertype, + context, + origin_context=node, + ) + emitted_msg = True + + if not is_subtype(erase_override(override.ret_type), original.ret_type): + self.msg.return_type_incompatible_with_supertype( + name, name_in_super, supertype, original.ret_type, override.ret_type, node + ) + emitted_msg = True + elif isinstance(override, Overloaded) and isinstance(original, Overloaded): + # Give a more detailed message in the case where the user is trying to + # override an overload, and the subclass's overload is plausible, except + # that the order of the variants are wrong. + # + # For example, if the parent defines the overload f(int) -> int and f(str) -> str + # (in that order), and if the child swaps the two and does f(str) -> str and + # f(int) -> int + order = [] + for child_variant in override.items: + for i, parent_variant in enumerate(original.items): + if is_subtype(child_variant, parent_variant): + order.append(i) + break + + if len(order) == len(original.items) and order != sorted(order): + self.msg.overload_signature_incompatible_with_supertype( + name, name_in_super, supertype, node + ) + emitted_msg = True + + if not emitted_msg: + # Fall back to generic incompatibility message. + self.msg.signature_incompatible_with_supertype( + name, name_in_super, supertype, node, original=original, override=override + ) + if op_method_wider_note: + self.note( + "Overloaded operator methods can't have wider argument types in overrides", + node, + code=codes.OVERRIDE, + ) + return not fail + + def check__exit__return_type(self, defn: FuncItem) -> None: + """Generate error if the return type of __exit__ is problematic. + + If __exit__ always returns False but the return type is declared + as bool, mypy thinks that a with statement may "swallow" + exceptions even though this is not the case, resulting in + invalid reachability inference. + """ + if not defn.type or not isinstance(defn.type, CallableType): + return + + ret_type = get_proper_type(defn.type.ret_type) + if not has_bool_item(ret_type): + return + + returns = all_return_statements(defn) + if not returns: + return + + if all( + isinstance(ret.expr, NameExpr) and ret.expr.fullname == "builtins.False" + for ret in returns + ): + self.msg.incorrect__exit__return(defn) + + def visit_class_def(self, defn: ClassDef) -> None: + """Type check a class definition.""" + typ = defn.info + for base in typ.mro[1:]: + if base.is_final: + self.fail(message_registry.CANNOT_INHERIT_FROM_FINAL.format(base.name), defn) + if not can_have_shared_disjoint_base(typ.bases): + self.fail(message_registry.INCOMPATIBLE_DISJOINT_BASES.format(typ.name), defn) + with ( + self.tscope.class_scope(defn.info), + self.enter_partial_types(is_class=True), + self.enter_class(defn.info), + ): + old_binder = self.binder + self.binder = ConditionalTypeBinder(self.options) + with self.binder.top_frame_context(): + with self.scope.push_class(defn.info): + self.accept(defn.defs) + self.binder = old_binder + if not self.can_skip_diagnostics: + if not (defn.info.typeddict_type or defn.info.tuple_type or defn.info.is_enum): + # If it is not a normal class (not a special form) check class keywords. + self.check_init_subclass(defn) + if not defn.has_incompatible_baseclass: + # Otherwise we've already found errors; more errors are not useful + self.check_multiple_inheritance(typ) + self.check_metaclass_compatibility(typ) + self.check_final_deletable(typ) + + if defn.decorators: + sig: Type = type_object_type(defn.info, self.named_type) + # Decorators are applied in reverse order. + for decorator in reversed(defn.decorators): + if isinstance(decorator, CallExpr) and isinstance( + decorator.analyzed, PromoteExpr + ): + # _promote is a special type checking related construct. + continue + + dec = self.expr_checker.accept(decorator) + temp = self.temp_node(sig, context=decorator) + fullname = None + if isinstance(decorator, RefExpr): + fullname = decorator.fullname or None + + # TODO: Figure out how to have clearer error messages. + # (e.g. "class decorator must be a function that accepts a type." + old_allow_abstract_call = self.allow_abstract_call + self.allow_abstract_call = True + sig, _ = self.expr_checker.check_call( + dec, [temp], [nodes.ARG_POS], defn, callable_name=fullname + ) + self.allow_abstract_call = old_allow_abstract_call + # TODO: Apply the sig to the actual TypeInfo so we can handle decorators + # that completely swap out the type. (e.g. Callable[[Type[A]], Type[B]]) + if typ.defn.type_vars and typ.defn.type_args is None: + for base_inst in typ.bases: + for base_tvar, base_decl_tvar in zip( + base_inst.args, base_inst.type.defn.type_vars + ): + if ( + isinstance(base_tvar, TypeVarType) + and base_tvar.variance != INVARIANT + and isinstance(base_decl_tvar, TypeVarType) + and base_decl_tvar.variance != base_tvar.variance + ): + self.fail( + f'Variance of TypeVar "{base_tvar.name}" incompatible ' + "with variance in parent type", + context=defn, + code=codes.TYPE_VAR, + ) + if typ.defn.type_vars: + self.check_typevar_defaults(typ.defn.type_vars) + + if typ.is_protocol and typ.defn.type_vars: + self.check_protocol_variance(defn) + if not defn.has_incompatible_baseclass and defn.info.is_enum: + self.check_enum(defn) + infer_class_variances(defn.info) + + @contextmanager + def enter_class(self, type: TypeInfo) -> Iterator[None]: + original_type = self.type + self.type = type + try: + yield + finally: + self.type = original_type + + def check_final_deletable(self, typ: TypeInfo) -> None: + # These checks are only for mypyc. Only perform some checks that are easier + # to implement here than in mypyc. + for attr in typ.deletable_attributes: + node = typ.names.get(attr) + if node and isinstance(node.node, Var) and node.node.is_final: + self.fail(message_registry.CANNOT_MAKE_DELETABLE_FINAL, node.node) + + def check_init_subclass(self, defn: ClassDef) -> None: + """Check that keywords in a class definition are valid arguments for __init_subclass__(). + + In this example: + 1 class Base: + 2 def __init_subclass__(cls, thing: int): + 3 pass + 4 class Child(Base, thing=5): + 5 def __init_subclass__(cls): + 6 pass + 7 Child() + + Base.__init_subclass__(thing=5) is called at line 4. This is what we simulate here. + Child.__init_subclass__ is never called. + """ + if defn.info.metaclass_type and defn.info.metaclass_type.type.fullname not in ( + "builtins.type", + "abc.ABCMeta", + ): + # We can't safely check situations when both __init_subclass__ and a custom + # metaclass are present. + return + # At runtime, only Base.__init_subclass__ will be called, so + # we skip the current class itself. + for base in defn.info.mro[1:]: + if "__init_subclass__" not in base.names: + continue + name_expr = NameExpr(defn.name) + name_expr.node = base + callee = MemberExpr(name_expr, "__init_subclass__") + args = list(defn.keywords.values()) + arg_names: list[str | None] = list(defn.keywords.keys()) + # 'metaclass' keyword is consumed by the rest of the type machinery, + # and is never passed to __init_subclass__ implementations + if "metaclass" in arg_names: + idx = arg_names.index("metaclass") + arg_names.pop(idx) + args.pop(idx) + arg_kinds = [ARG_NAMED] * len(args) + call_expr = CallExpr(callee, args, arg_kinds, arg_names) + call_expr.line = defn.line + call_expr.column = defn.column + call_expr.end_line = defn.end_line + self.expr_checker.accept(call_expr, allow_none_return=True, always_allow_any=True) + # We are only interested in the first Base having __init_subclass__, + # all other bases have already been checked. + break + + def check_typevar_defaults(self, tvars: Sequence[TypeVarLikeType]) -> None: + for tv in tvars: + if not (isinstance(tv, TypeVarType) and tv.has_default()): + continue + if not is_subtype(tv.default, tv.upper_bound): + self.fail("TypeVar default must be a subtype of the bound type", tv) + if tv.values and not any(is_same_type(tv.default, value) for value in tv.values): + self.fail("TypeVar default must be one of the constraint types", tv) + + def check_enum(self, defn: ClassDef) -> None: + assert defn.info.is_enum + if defn.info.fullname not in ENUM_BASES and "__members__" in defn.info.names: + sym = defn.info.names["__members__"] + if isinstance(sym.node, Var) and sym.node.has_explicit_value: + # `__members__` will always be overwritten by `Enum` and is considered + # read-only so we disallow assigning a value to it + self.fail(message_registry.ENUM_MEMBERS_ATTR_WILL_BE_OVERRIDDEN, sym.node) + for base in defn.info.mro[1:-1]: # we don't need self and `object` + if base.is_enum and base.fullname not in ENUM_BASES: + self.check_final_enum(defn, base) + + if self.is_stub and self.tree.fullname not in {"enum", "_typeshed"}: + if not defn.info.enum_members: + self.fail( + f'Detected enum "{defn.info.fullname}" in a type stub with zero members. ' + "There is a chance this is due to a recent change in the semantics of " + "enum membership. If so, use `member = value` to mark an enum member, " + "instead of `member: type`", + defn, + ) + self.note( + "See https://typing.readthedocs.io/en/latest/spec/enums.html#defining-members", + defn, + ) + + self.check_enum_bases(defn) + self.check_enum_new(defn) + + def check_final_enum(self, defn: ClassDef, base: TypeInfo) -> None: + if base.enum_members: + self.fail(f'Cannot extend enum with existing members: "{base.name}"', defn) + + def is_final_enum_value(self, sym: SymbolTableNode) -> bool: + if isinstance(sym.node, (FuncBase, Decorator)): + return False # A method is fine + if not isinstance(sym.node, Var): + return True # Can be a class or anything else + + # Now, only `Var` is left, we need to check: + # 1. Private name like in `__prop = 1` + # 2. Dunder name like `__hash__ = some_hasher` + # 3. Sunder name like `_order_ = 'a, b, c'` + # 4. If it is a method / descriptor like in `method = classmethod(func)` + if ( + is_private(sym.node.name) + or is_dunder(sym.node.name) + or is_sunder(sym.node.name) + # TODO: make sure that `x = @class/staticmethod(func)` + # and `x = property(prop)` both work correctly. + # Now they are incorrectly counted as enum members. + or isinstance(get_proper_type(sym.node.type), FunctionLike) + ): + return False + + return self.is_stub or sym.node.has_explicit_value + + def check_enum_bases(self, defn: ClassDef) -> None: + """ + Non-enum mixins cannot appear after enum bases; this is disallowed at runtime: + + class Foo: ... + class Bar(enum.Enum, Foo): ... + + But any number of enum mixins can appear in a class definition + (even if multiple enum bases define __new__). So this is fine: + + class Foo(enum.Enum): + def __new__(cls, val): ... + class Bar(enum.Enum): + def __new__(cls, val): ... + class Baz(int, Foo, Bar, enum.Flag): ... + """ + enum_base: Instance | None = None + for base in defn.info.bases: + if enum_base is None and base.type.is_enum: + enum_base = base + continue + elif enum_base is not None and not base.type.is_enum: + self.fail( + f'No non-enum mixin classes are allowed after "{enum_base.str_with_options(self.options)}"', + defn, + ) + break + + def check_enum_new(self, defn: ClassDef) -> None: + def has_new_method(info: TypeInfo) -> bool: + new_method = info.get("__new__") + return bool( + new_method + and new_method.node + and new_method.node.fullname != "builtins.object.__new__" + ) + + has_new = False + for base in defn.info.bases: + candidate = False + + if base.type.is_enum: + # If we have an `Enum`, then we need to check all its bases. + candidate = any(not b.is_enum and has_new_method(b) for b in base.type.mro[1:-1]) + else: + candidate = has_new_method(base.type) + + if candidate and has_new: + self.fail( + "Only a single data type mixin is allowed for Enum subtypes, " + 'found extra "{}"'.format(base.str_with_options(self.options)), + defn, + ) + elif candidate: + has_new = True + + def check_protocol_variance(self, defn: ClassDef) -> None: + """Check that protocol definition is compatible with declared + variances of type variables. + + Note that we also prohibit declaring protocol classes as invariant + if they are actually covariant/contravariant, since this may break + transitivity of subtyping, see PEP 544. + """ + if self.can_skip_diagnostics: + return + if defn.type_args is not None: + # Using new-style syntax (PEP 695), so variance will be inferred + return + info = defn.info + object_type = Instance(info.mro[-1], []) + tvars = info.defn.type_vars + if self._variance_dummy_type is None: + _, dummy_info = self.make_fake_typeinfo("", "Dummy", "Dummy", []) + self._variance_dummy_type = Instance(dummy_info, []) + dummy = self._variance_dummy_type + for i, tvar in enumerate(tvars): + if not isinstance(tvar, TypeVarType): + # Variance of TypeVarTuple and ParamSpec is underspecified by PEPs. + continue + up_args: list[Type] = [ + object_type if i == j else dummy.copy_modified() for j, _ in enumerate(tvars) + ] + down_args: list[Type] = [ + UninhabitedType() if i == j else dummy.copy_modified() for j, _ in enumerate(tvars) + ] + up, down = Instance(info, up_args), Instance(info, down_args) + # TODO: add advanced variance checks for recursive protocols + if is_subtype(down, up, ignore_declared_variance=True): + expected = COVARIANT + elif is_subtype(up, down, ignore_declared_variance=True): + expected = CONTRAVARIANT + else: + expected = INVARIANT + if expected != tvar.variance: + self.msg.bad_proto_variance(tvar.variance, tvar.name, expected, defn) + + def check_multiple_inheritance(self, typ: TypeInfo) -> None: + """Check for multiple inheritance related errors.""" + if len(typ.bases) <= 1: + # No multiple inheritance. + return + # Verify that inherited attributes are compatible. + mro = typ.mro[1:] + all_names = {name for base in mro for name in base.names} + for name in sorted(all_names - typ.names.keys()): + # Sort for reproducible message order. + # Attributes defined in both the type and base are skipped. + # Normal checks for attribute compatibility should catch any problems elsewhere. + if is_private(name): + continue + # Compare the first base defining a name with the rest. + # Remaining bases may not be pairwise compatible as the first base provides + # the used definition. + i, base = next((i, base) for i, base in enumerate(mro) if name in base.names) + for base2 in mro[i + 1 :]: + if name in base2.names and base2 not in base.mro: + self.check_compatibility(name, base, base2, typ) + + def check_compatibility( + self, name: str, base1: TypeInfo, base2: TypeInfo, ctx: TypeInfo + ) -> None: + """Check if attribute name in base1 is compatible with base2 in multiple inheritance. + + Assume base1 comes before base2 in the MRO, and that base1 and base2 don't have + a direct subclass relationship (i.e., the compatibility requirement only derives from + multiple inheritance). + + This check verifies that a definition taken from base1 (and mapped to the current + class ctx), is type compatible with the definition taken from base2 (also mapped), so + that unsafe subclassing like this can be detected: + class A(Generic[T]): + def foo(self, x: T) -> None: ... + + class B: + def foo(self, x: str) -> None: ... + + class C(B, A[int]): ... # this is unsafe because... + + x: A[int] = C() + x.foo # ...runtime type is (str) -> None, while static type is (int) -> None + """ + if name in ("__init__", "__new__", "__init_subclass__"): + # __init__ and friends can be incompatible -- it's a special case. + return + first = base1.names[name] + second = base2.names[name] + # Specify current_class explicitly as this function is called after leaving the class. + first_type, _ = self.node_type_from_base(name, base1, ctx, current_class=ctx) + second_type, _ = self.node_type_from_base(name, base2, ctx, current_class=ctx) + + # TODO: use more principled logic to decide is_subtype() vs is_equivalent(). + # We should rely on mutability of superclass node, not on types being Callable. + # (in particular handle settable properties with setter type different from getter). + + p_first_type = get_proper_type(first_type) + p_second_type = get_proper_type(second_type) + if isinstance(p_first_type, FunctionLike) and isinstance(p_second_type, FunctionLike): + if p_first_type.is_type_obj() and p_second_type.is_type_obj(): + # For class objects only check the subtype relationship of the classes, + # since we allow incompatible overrides of '__init__'/'__new__' + ok = is_subtype( + left=fill_typevars_with_any(p_first_type.type_object()), + right=fill_typevars_with_any(p_second_type.type_object()), + ) + else: + assert first_type and second_type + ok = is_subtype(first_type, second_type, ignore_pos_arg_names=True) + elif first_type and second_type: + if second.node is not None and not self.is_writable_attribute(second.node): + ok = is_subtype(first_type, second_type) + else: + ok = is_equivalent(first_type, second_type) + if ok: + if ( + first.node + and second.node + and self.is_writable_attribute(second.node) + and is_property(first.node) + and isinstance(first.node, Decorator) + and not isinstance(p_second_type, AnyType) + ): + self.msg.fail( + f'Cannot override writeable attribute "{name}" in base "{base2.name}"' + f' with read-only property in base "{base1.name}"', + ctx, + code=codes.OVERRIDE, + ) + else: + if first_type is None: + self.msg.cannot_determine_type_in_base(name, base1.name, ctx) + if second_type is None: + self.msg.cannot_determine_type_in_base(name, base2.name, ctx) + ok = True + # Final attributes can never be overridden, but can override + # non-final read-only attributes. + if is_final_node(second.node) and not is_private(name): + self.msg.cant_override_final(name, base2.name, ctx) + if is_final_node(first.node): + self.check_if_final_var_override_writable(name, second.node, ctx) + # Some attributes like __slots__ and __deletable__ are special, and the type can + # vary across class hierarchy. + if isinstance(second.node, Var) and second.node.allow_incompatible_override: + ok = True + if not ok: + self.msg.base_class_definitions_incompatible(name, base1, base2, ctx) + + def check_metaclass_compatibility(self, typ: TypeInfo) -> None: + """Ensures that metaclasses of all parent types are compatible.""" + if ( + typ.is_metaclass() + or typ.is_protocol + or typ.is_named_tuple + or typ.is_enum + or typ.typeddict_type is not None + ): + return # Reasonable exceptions from this check + + if typ.metaclass_type is None and any( + base.type.metaclass_type is not None for base in typ.bases + ): + self.fail( + "Metaclass conflict: the metaclass of a derived class must be " + "a (non-strict) subclass of the metaclasses of all its bases", + typ, + code=codes.METACLASS, + ) + explanation = typ.explain_metaclass_conflict() + if explanation: + self.note(explanation, typ, code=codes.METACLASS) + + def visit_import_from(self, node: ImportFrom) -> None: + for name, _ in node.names: + if (sym := self.globals.get(name)) is not None: + self.warn_deprecated(sym.node, node) + self.check_import(node) + + def visit_import_all(self, node: ImportAll) -> None: + self.check_import(node) + + def visit_import(self, node: Import) -> None: + self.check_import(node) + + def check_import(self, node: ImportBase) -> None: + for assign in node.assignments: + lvalue = assign.lvalues[0] + lvalue_type, _, __ = self.check_lvalue(lvalue) + if lvalue_type is None: + # TODO: This is broken. + lvalue_type = AnyType(TypeOfAny.special_form) + assert isinstance(assign.rvalue, NameExpr) + message = message_registry.INCOMPATIBLE_IMPORT_OF.format(assign.rvalue.name) + self.check_simple_assignment( + lvalue_type, + assign.rvalue, + node, + msg=message, + lvalue_name="local name", + rvalue_name="imported name", + ) + + # + # Statements + # + + def visit_block(self, b: Block) -> None: + if b.is_unreachable: + # This block was marked as being unreachable during semantic analysis. + # It turns out any blocks marked in this way are *intentionally* marked + # as unreachable -- so we don't display an error. + self.binder.unreachable() + return + for s in b.body: + if self.binder.is_unreachable(): + if not self.should_report_unreachable_issues(): + break + if not self.is_noop_for_reachability(s): + self.msg.unreachable_statement(s) + break + else: + self.accept(s) + # Clear expression cache after each statement to avoid unlimited growth. + self.expr_checker.expr_cache.clear() + + def should_report_unreachable_issues(self) -> bool: + return ( + self.in_checked_function() + and self.options.warn_unreachable + and not self.current_node_deferred + and not self.binder.is_unreachable_warning_suppressed() + ) + + def is_noop_for_reachability(self, s: Statement) -> bool: + """Returns 'true' if the given statement either throws an error of some kind + or is a no-op. + + We use this function while handling the '--warn-unreachable' flag. When + that flag is present, we normally report an error on any unreachable statement. + But if that statement is just something like a 'pass' or a just-in-case 'assert False', + reporting an error would be annoying. + """ + if isinstance(s, AssertStmt) and is_false_literal(s.expr): + return True + elif isinstance(s, ReturnStmt) and is_literal_not_implemented(s.expr): + return True + elif isinstance(s, RaiseStmt): + return True + elif isinstance(s, ExpressionStmt): + if isinstance(s.expr, CallExpr): + with self.expr_checker.msg.filter_errors(filter_revealed_type=True): + typ = get_proper_type( + self.expr_checker.accept( + s.expr, allow_none_return=True, always_allow_any=True + ) + ) + + if isinstance(typ, UninhabitedType): + return True + return False + + def visit_assignment_stmt(self, s: AssignmentStmt) -> None: + """Type check an assignment statement. + + Handle all kinds of assignment statements (simple, indexed, multiple). + """ + + # Avoid type checking type aliases in stubs to avoid false + # positives about modern type syntax available in stubs such + # as X | Y. + if not (s.is_alias_def and self.is_stub): + with self.enter_final_context(s.is_final_def): + self.check_assignment(s.lvalues[-1], s.rvalue, s.type is None, s.new_syntax) + + if s.is_alias_def: + self.check_type_alias_rvalue(s) + + if ( + s.type is not None + and self.options.disallow_any_unimported + and has_any_from_unimported_type(s.type) + ): + if isinstance(s.lvalues[-1], TupleExpr): + # This is a multiple assignment. Instead of figuring out which type is problematic, + # give a generic error message. + self.msg.unimported_type_becomes_any( + "A type on this line", AnyType(TypeOfAny.special_form), s + ) + else: + self.msg.unimported_type_becomes_any("Type of variable", s.type, s) + check_for_explicit_any(s.type, self.options, self.is_typeshed_stub, self.msg, context=s) + + if len(s.lvalues) > 1: + # Chained assignment (e.g. x = y = ...). + # Make sure that rvalue type will not be reinferred. + if not self.has_type(s.rvalue): + self.expr_checker.accept(s.rvalue) + rvalue = self.temp_node(self.lookup_type(s.rvalue), s) + for lv in s.lvalues[:-1]: + with self.enter_final_context(s.is_final_def): + self.check_assignment(lv, rvalue, s.type is None) + + self.check_final(s) + if ( + s.is_final_def + and s.type + and not has_no_typevars(s.type) + and self.scope.active_class() is not None + ): + self.fail(message_registry.DEPENDENT_FINAL_IN_CLASS_BODY, s) + + if s.unanalyzed_type and not self.in_checked_function(): + self.msg.annotation_in_unchecked_function(context=s) + + def check_type_alias_rvalue(self, s: AssignmentStmt) -> None: + with self.msg.filter_errors(): + alias_type = self.expr_checker.accept(s.rvalue) + self.store_type(s.lvalues[-1], alias_type) + + def check_assignment( + self, + lvalue: Lvalue, + rvalue: Expression, + infer_lvalue_type: bool = True, + new_syntax: bool = False, + ) -> None: + """Type check a single assignment: lvalue = rvalue.""" + if isinstance(lvalue, (TupleExpr, ListExpr)): + self.check_assignment_to_multiple_lvalues( + lvalue.items, rvalue, rvalue, infer_lvalue_type + ) + else: + self.try_infer_partial_generic_type_from_assignment(lvalue, rvalue, "=") + lvalue_type, index_lvalue, inferred = self.check_lvalue(lvalue, rvalue) + # If we're assigning to __getattr__ or similar methods, check that the signature is + # valid. + if isinstance(lvalue, NameExpr) and lvalue.node: + name = lvalue.node.name + if name in ("__setattr__", "__getattribute__", "__getattr__"): + # If an explicit type is given, use that. + if lvalue_type: + signature = lvalue_type + else: + signature = self.expr_checker.accept(rvalue) + if signature: + if name == "__setattr__": + self.check_setattr_method(signature, lvalue) + else: + self.check_getattr_method(signature, lvalue, name) + + if name == "__slots__" and self.scope.active_class() is not None: + typ = lvalue_type or self.expr_checker.accept(rvalue) + self.check_slots_definition(typ, lvalue) + if name == "__match_args__" and inferred is not None: + typ = self.expr_checker.accept(rvalue) + self.check_match_args(inferred, typ, lvalue) + if name == "__post_init__": + active_class = self.scope.active_class() + if active_class and dataclasses_plugin.is_processed_dataclass(active_class): + self.fail(message_registry.DATACLASS_POST_INIT_MUST_BE_A_FUNCTION, rvalue) + + if isinstance(lvalue, MemberExpr) and lvalue.name == "__match_args__": + self.fail(message_registry.CANNOT_MODIFY_MATCH_ARGS, lvalue) + + if lvalue_type: + if isinstance(lvalue_type, PartialType) and lvalue_type.type is None: + # Try to infer a proper type for a variable with a partial None type. + rvalue_type = self.expr_checker.accept(rvalue) + if isinstance(get_proper_type(rvalue_type), NoneType): + # This doesn't actually provide any additional information -- multiple + # None initializers preserve the partial None type. + return + + var = lvalue_type.var + if is_valid_inferred_type( + rvalue_type, self.options, is_lvalue_final=var.is_final + ): + partial_types = self.find_partial_types(var) + if partial_types is not None: + if not self.current_node_deferred: + # Partial type can't be final, so strip any literal values. + rvalue_type = remove_instance_last_known_values(rvalue_type) + inferred_type = make_simplified_union([rvalue_type, NoneType()]) + self.set_inferred_type(var, lvalue, inferred_type) + else: + var.type = None + del partial_types[var] + lvalue_type = var.type + else: + # Try to infer a partial type. + if not self.infer_partial_type(var, lvalue, rvalue_type): + # If that also failed, give up and let the caller know that we + # cannot read their mind. The definition site will be reported later. + # Calling .put() directly because the newly inferred type is + # not a subtype of None - we are not looking for narrowing + fallback = self.inference_error_fallback_type(rvalue_type) + self.binder.put(lvalue, fallback) + # Same as self.set_inference_error_fallback_type but inlined + # to avoid computing fallback twice. + # We are replacing partial now, so the variable type + # should remain optional. + self.set_inferred_type(var, lvalue, make_optional_type(fallback)) + elif ( + is_literal_none(rvalue) + and isinstance(lvalue, NameExpr) + and isinstance(lvalue.node, Var) + and lvalue.node.is_initialized_in_class + and not new_syntax + ): + # Allow None's to be assigned to class variables with non-Optional types. + rvalue_type = lvalue_type + elif ( + isinstance(lvalue, MemberExpr) and lvalue.kind is None + ): # Ignore member access to modules + instance_type = self.expr_checker.accept(lvalue.expr) + rvalue_type, lvalue_type, infer_lvalue_type = self.check_member_assignment( + lvalue, instance_type, lvalue_type, rvalue, context=rvalue + ) + else: + # Hacky special case for assigning a literal None + # to a variable defined in a previous if + # branch. When we detect this, we'll go back and + # make the type optional. This is somewhat + # unpleasant, and a generalization of this would + # be an improvement! + if ( + not self.options.allow_redefinition_new + and is_literal_none(rvalue) + and isinstance(lvalue, NameExpr) + and lvalue.kind == LDEF + and isinstance(lvalue.node, Var) + and lvalue.node.type + and lvalue.node in self.var_decl_frames + and not isinstance(get_proper_type(lvalue_type), AnyType) + ): + decl_frame_map = self.var_decl_frames[lvalue.node] + # Check if the nearest common ancestor frame for the definition site + # and the current site is the enclosing frame of an if/elif/else block. + has_if_ancestor = False + for frame in reversed(self.binder.frames): + if frame.id in decl_frame_map: + has_if_ancestor = frame.conditional_frame + break + if has_if_ancestor: + lvalue_type = make_optional_type(lvalue_type) + self.set_inferred_type(lvalue.node, lvalue, lvalue_type) + + rvalue_type, lvalue_type = self.check_simple_assignment( + lvalue_type, rvalue, context=rvalue, inferred=inferred, lvalue=lvalue + ) + # The above call may update inferred variable type. Prevent further + # inference. + inferred = None + + # Special case: only non-abstract non-protocol classes can be assigned to + # variables with explicit type `Type[A]`, where A is protocol or abstract. + p_rvalue_type = get_proper_type(rvalue_type) + p_lvalue_type = get_proper_type(lvalue_type) + if ( + isinstance(p_rvalue_type, FunctionLike) + and p_rvalue_type.is_type_obj() + and ( + p_rvalue_type.type_object().is_abstract + or p_rvalue_type.type_object().is_protocol + ) + and isinstance(p_lvalue_type, TypeType) + and isinstance(p_lvalue_type.item, Instance) + and ( + p_lvalue_type.item.type.is_abstract or p_lvalue_type.item.type.is_protocol + ) + ): + self.msg.concrete_only_assign(p_lvalue_type, rvalue) + return + if rvalue_type and infer_lvalue_type and not isinstance(lvalue_type, PartialType): + # Don't use type binder for definitions of special forms, like named tuples. + if not (isinstance(lvalue, NameExpr) and lvalue.is_special_form): + self.binder.assign_type(lvalue, rvalue_type, lvalue_type) + if ( + isinstance(lvalue, NameExpr) + and isinstance(lvalue.node, Var) + and lvalue.node.is_inferred + and lvalue.node.is_index_var + and lvalue_type is not None + ): + lvalue.node.type = remove_instance_last_known_values(lvalue_type) + elif ( + self.options.allow_redefinition_new + and lvalue_type is not None + and not isinstance(lvalue_type, PartialType) + # Note that `inferred is not None` is not a reliable check here, because + # simple assignments like x = "a" are inferred during semantic analysis. + and isinstance(lvalue, NameExpr) + and isinstance(lvalue.node, Var) + and lvalue.node.is_inferred + ): + # TODO: Can we use put() here? + self.binder.assign_type(lvalue, lvalue_type, lvalue_type) + + elif index_lvalue: + self.check_indexed_assignment(index_lvalue, rvalue, lvalue) + + if inferred: + type_context = self.get_variable_type_context(inferred, rvalue) + rvalue_type = self.expr_checker.accept(rvalue, type_context=type_context) + if not ( + inferred.is_final + or inferred.is_index_var + or (isinstance(lvalue, NameExpr) and lvalue.name == "__match_args__") + ): + rvalue_type = remove_instance_last_known_values(rvalue_type) + self.infer_variable_type(inferred, lvalue, rvalue_type, rvalue) + self.check_assignment_to_slots(lvalue) + if ( + isinstance(lvalue, RefExpr) + and not (isinstance(lvalue, NameExpr) and lvalue.name == "__match_args__") + and not self.can_skip_diagnostics + ): + # We check override here at the end after storing the inferred type, since + # override check will try to access the current attribute via symbol tables + # (like a regular attribute access). + self.check_compatibility_all_supers(lvalue, rvalue) + + # (type, operator) tuples for augmented assignments supported with partial types + partial_type_augmented_ops: Final = {("builtins.list", "+"), ("builtins.set", "|")} + + def get_variable_type_context(self, inferred: Var, rvalue: Expression) -> Type | None: + type_contexts = [] + if inferred.info: + for base in inferred.info.mro[1:]: + if inferred.name not in base.names: + continue + # For inference within class body, get supertype attribute as it would look on + # a class object for lambdas overriding methods, etc. + base_node = base.names[inferred.name].node + base_type, _ = self.node_type_from_base( + inferred.name, + base, + inferred, + is_class=is_method(base_node) + or isinstance(base_node, Var) + and not is_instance_var(base_node), + ) + if ( + base_type + and not (isinstance(base_node, Var) and base_node.invalid_partial_type) + and not isinstance(base_type, PartialType) + ): + type_contexts.append(base_type) + # Use most derived supertype as type context if available. + if not type_contexts: + if inferred.name == "__slots__" and self.scope.active_class() is not None: + str_type = self.named_type("builtins.str") + return self.named_generic_type("typing.Iterable", [str_type]) + if inferred.name == "__all__" and self.scope.is_top_level(): + str_type = self.named_type("builtins.str") + return self.named_generic_type("typing.Sequence", [str_type]) + return None + candidate = type_contexts[0] + for other in type_contexts: + if is_proper_subtype(other, candidate): + candidate = other + elif not is_subtype(candidate, other): + # Multiple incompatible candidates, cannot use any of them as context. + return None + return candidate + + def try_infer_partial_generic_type_from_assignment( + self, lvalue: Lvalue, rvalue: Expression, op: str + ) -> None: + """Try to infer a precise type for partial generic type from assignment. + + 'op' is '=' for normal assignment and a binary operator ('+', ...) for + augmented assignment. + + Example where this happens: + + x = [] + if foo(): + x = [1] # Infer List[int] as type of 'x' + """ + var = None + if ( + isinstance(lvalue, NameExpr) + and isinstance(lvalue.node, Var) + and isinstance(lvalue.node.type, PartialType) + ): + var = lvalue.node + elif isinstance(lvalue, MemberExpr): + var = self.expr_checker.get_partial_self_var(lvalue) + if var is not None: + typ = var.type + assert isinstance(typ, PartialType) + if typ.type is None: + return + # Return if this is an unsupported augmented assignment. + if op != "=" and (typ.type.fullname, op) not in self.partial_type_augmented_ops: + return + # TODO: some logic here duplicates the None partial type counterpart + # inlined in check_assignment(), see #8043. + partial_types = self.find_partial_types(var) + if partial_types is None: + return + rvalue_type = self.expr_checker.accept(rvalue) + rvalue_type = get_proper_type(rvalue_type) + if isinstance(rvalue_type, Instance): + if rvalue_type.type == typ.type and is_valid_inferred_type( + rvalue_type, self.options + ): + var.type = rvalue_type + del partial_types[var] + elif isinstance(rvalue_type, AnyType): + var.type = fill_typevars_with_any(typ.type) + del partial_types[var] + + def check_compatibility_all_supers(self, lvalue: RefExpr, rvalue: Expression) -> None: + lvalue_node = lvalue.node + # Check if we are a class variable with at least one base class + if ( + isinstance(lvalue_node, Var) + # If we have explicit annotation, there is no point in checking the override + # for each assignment, so we check only for the first one. + # TODO: for some reason annotated attributes on self are stored as inferred vars. + and ( + lvalue_node.line == lvalue.line + or lvalue_node.is_inferred + and not lvalue_node.explicit_self_type + ) + and lvalue.kind in (MDEF, None) # None for Vars defined via self + and len(lvalue_node.info.bases) > 0 + ): + for base in lvalue_node.info.mro[1:]: + tnode = base.names.get(lvalue_node.name) + if tnode is not None: + if not self.check_compatibility_classvar_super(lvalue_node, base, tnode.node): + # Show only one error per variable + break + + if not self.check_compatibility_final_super(lvalue_node, base, tnode.node): + # Show only one error per variable + break + + direct_bases = lvalue_node.info.direct_base_classes() + last_immediate_base = direct_bases[-1] if direct_bases else None + + # The historical behavior for inferred vars was to compare rvalue type against + # the type declared in a superclass. To preserve this behavior, we temporarily + # store the rvalue type on the variable. + actual_lvalue_type = None + if lvalue_node.is_inferred and not lvalue_node.explicit_self_type: + # Don't use partial types as context, similar to regular code path. + ctx = lvalue_node.type if not isinstance(lvalue_node.type, PartialType) else None + rvalue_type = self.expr_checker.accept(rvalue, ctx) + actual_lvalue_type = lvalue_node.type + lvalue_node.type = rvalue_type + lvalue_type, _ = self.node_type_from_base(lvalue_node.name, lvalue_node.info, lvalue) + if lvalue_node.is_inferred and not lvalue_node.explicit_self_type: + lvalue_node.type = actual_lvalue_type + + if not lvalue_type: + return + + for base in lvalue_node.info.mro[1:]: + # The type of "__slots__" and some other attributes usually doesn't need to + # be compatible with a base class. We'll still check the type of "__slots__" + # against "object" as an exception. + if lvalue_node.allow_incompatible_override and not ( + lvalue_node.name == "__slots__" and base.fullname == "builtins.object" + ): + continue + + if is_private(lvalue_node.name): + continue + + base_type, base_node = self.node_type_from_base(lvalue_node.name, base, lvalue) + # TODO: if the r.h.s. is a descriptor, we should check setter override as well. + custom_setter = is_custom_settable_property(base_node) + if isinstance(base_type, PartialType): + base_type = None + + if base_type: + assert base_node is not None + if not self.check_compatibility_super( + lvalue_type, + rvalue, + base, + base_type, + base_node, + always_allow_covariant=custom_setter, + ): + # Only show one error per variable; even if other + # base classes are also incompatible + return + if lvalue_type and custom_setter: + base_type, _ = self.node_type_from_base( + lvalue_node.name, base, lvalue, setter_type=True + ) + # Setter type for a custom property must be ready if + # the getter type is ready. + assert base_type is not None + if not is_subtype(base_type, lvalue_type): + self.msg.incompatible_setter_override( + lvalue, lvalue_type, base_type, base + ) + return + if base is last_immediate_base: + # At this point, the attribute was found to be compatible with all + # immediate parents. + break + + def check_compatibility_super( + self, + compare_type: Type, + rvalue: Expression, + base: TypeInfo, + base_type: Type, + base_node: Node, + always_allow_covariant: bool, + ) -> bool: + # TODO: check __set__() type override for custom descriptors. + # TODO: for descriptors check also class object access override. + ok = self.check_subtype( + compare_type, + base_type, + rvalue, + message_registry.INCOMPATIBLE_TYPES_IN_ASSIGNMENT, + "expression has type", + f'base class "{base.name}" defined the type as', + ) + if ( + ok + and codes.MUTABLE_OVERRIDE in self.options.enabled_error_codes + and self.is_writable_attribute(base_node) + and not always_allow_covariant + ): + ok = self.check_subtype( + base_type, + compare_type, + rvalue, + message_registry.COVARIANT_OVERRIDE_OF_MUTABLE_ATTRIBUTE, + f'base class "{base.name}" defined the type as', + "expression has type", + ) + return ok + + def node_type_from_base( + self, + name: str, + base: TypeInfo, + context: Context, + *, + setter_type: bool = False, + is_class: bool = False, + current_class: TypeInfo | None = None, + ) -> tuple[Type | None, SymbolNode | None]: + """Find a type for a name in base class. + + Return the type found and the corresponding node defining the name or None + for both if the name is not defined in base or the node type is not known (yet). + The type returned is already properly mapped/bound to the subclass. + If setter_type is True, return setter types for settable properties (otherwise the + getter type is returned). + """ + base_node = base.names.get(name) + + # TODO: defer current node if the superclass node is not ready. + if ( + not base_node + or isinstance(base_node.node, (Var, Decorator)) + and not base_node.type + or isinstance(base_node.type, PartialType) + and base_node.type.type is not None + ): + return None, None + + if current_class is None: + self_type = self.scope.current_self_type() + else: + self_type = fill_typevars(current_class) + assert self_type is not None, "Internal error: base lookup outside class" + if isinstance(self_type, TupleType): + instance = tuple_fallback(self_type) + else: + instance = self_type + + mx = MemberContext( + is_lvalue=setter_type, + is_super=False, + is_operator=mypy.checkexpr.is_operator_method(name), + original_type=self_type, + context=context, + chk=self, + suppress_errors=True, + ) + # TODO: we should not filter "cannot determine type" errors here. + with self.msg.filter_errors(filter_deprecated=True): + if is_class: + fallback = instance.type.metaclass_type or mx.named_type("builtins.type") + base_type = analyze_class_attribute_access( + instance, name, mx, mcs_fallback=fallback, override_info=base + ) + else: + base_type = analyze_instance_member_access(name, instance, mx, base) + return base_type, base_node.node + + def check_compatibility_classvar_super( + self, node: Var, base: TypeInfo, base_node: Node | None + ) -> bool: + if not isinstance(base_node, Var): + return True + if node.is_classvar and not base_node.is_classvar: + self.fail(message_registry.CANNOT_OVERRIDE_INSTANCE_VAR.format(base.name), node) + return False + elif not node.is_classvar and base_node.is_classvar: + self.fail(message_registry.CANNOT_OVERRIDE_CLASS_VAR.format(base.name), node) + return False + return True + + def check_compatibility_final_super( + self, node: Var, base: TypeInfo, base_node: Node | None + ) -> bool: + """Check if an assignment overrides a final attribute in a base class. + + This only checks situations where either a node in base class is not a variable + but a final method, or where override is explicitly declared as final. + In these cases we give a more detailed error message. In addition, we check that + a final variable doesn't override writeable attribute, which is not safe. + + Other situations are checked in `check_final()`. + """ + if not isinstance(base_node, (Var, FuncBase, Decorator)): + return True + if is_private(node.name): + return True + if base_node.is_final and (node.is_final or not isinstance(base_node, Var)): + # Give this error only for explicit override attempt with `Final`, or + # if we are overriding a final method with variable. + # Other override attempts will be flagged as assignment to constant + # in `check_final()`. + self.msg.cant_override_final(node.name, base.name, node) + return False + if node.is_final: + if base.fullname in ENUM_BASES or node.name in ENUM_SPECIAL_PROPS: + return True + self.check_if_final_var_override_writable(node.name, base_node, node) + return True + + def check_if_final_var_override_writable( + self, name: str, base_node: Node | None, ctx: Context + ) -> None: + """Check that a final variable doesn't override writeable attribute. + + This is done to prevent situations like this: + class C: + attr = 1 + class D(C): + attr: Final = 2 + + x: C = D() + x.attr = 3 # Oops! + """ + writable = True + if base_node: + writable = self.is_writable_attribute(base_node) + if writable: + self.msg.final_cant_override_writable(name, ctx) + + def get_final_context(self) -> bool: + """Check whether we a currently checking a final declaration.""" + return self._is_final_def + + @contextmanager + def enter_final_context(self, is_final_def: bool) -> Iterator[None]: + """Store whether the current checked assignment is a final declaration.""" + old_ctx = self._is_final_def + self._is_final_def = is_final_def + try: + yield + finally: + self._is_final_def = old_ctx + + def check_final(self, s: AssignmentStmt | OperatorAssignmentStmt | AssignmentExpr) -> None: + """Check if this assignment does not assign to a final attribute. + + This function performs the check only for name assignments at module + and class scope. The assignments to `obj.attr` and `Cls.attr` are checked + in checkmember.py. + """ + if isinstance(s, AssignmentStmt): + lvs = self.flatten_lvalues(s.lvalues) + elif isinstance(s, AssignmentExpr): + lvs = [s.target] + else: + lvs = [s.lvalue] + is_final_decl = s.is_final_def if isinstance(s, AssignmentStmt) else False + if is_final_decl and (active_class := self.scope.active_class()): + lv = lvs[0] + assert isinstance(lv, RefExpr) + if lv.node is not None: + assert isinstance(lv.node, Var) + if ( + lv.node.final_unset_in_class + and not lv.node.final_set_in_init + and not self.is_stub # It is OK to skip initializer in stub files. + and + # Avoid extra error messages, if there is no type in Final[...], + # then we already reported the error about missing r.h.s. + isinstance(s, AssignmentStmt) + and s.type is not None + # Avoid extra error message for NamedTuples, + # they were reported during semanal + and not active_class.is_named_tuple + ): + self.msg.final_without_value(s) + for lv in lvs: + if isinstance(lv, RefExpr) and isinstance(lv.node, Var): + name = lv.node.name + cls = self.scope.active_class() + if cls is not None: + # These additional checks exist to give more error messages + # even if the final attribute was overridden with a new symbol + # (which is itself an error)... + for base in cls.mro[1:]: + sym = base.names.get(name) + # We only give this error if base node is variable, + # overriding final method will be caught in + # `check_compatibility_final_super()`. + if sym and isinstance(sym.node, Var): + if sym.node.is_final and not is_final_decl: + self.msg.cant_assign_to_final(name, sym.node.info is None, s) + # ...but only once + break + if lv.node.is_final and not is_final_decl: + self.msg.cant_assign_to_final(name, lv.node.info is None, s) + + def check_assignment_to_slots(self, lvalue: Lvalue) -> None: + if not isinstance(lvalue, MemberExpr): + return + + inst = get_proper_type(self.expr_checker.accept(lvalue.expr)) + if isinstance(inst, TypeVarType) and inst.id.is_self(): + # Unwrap self type + inst = get_proper_type(inst.upper_bound) + if not isinstance(inst, Instance): + return + if inst.type.slots is None: + return # Slots do not exist, we can allow any assignment + if lvalue.name in inst.type.slots: + return # We are assigning to an existing slot + for base_info in inst.type.mro[:-1]: + if base_info.names.get("__setattr__") is not None: + # When type has `__setattr__` defined, + # we can assign any dynamic value. + # We exclude object, because it always has `__setattr__`. + return + + definition = inst.type.get(lvalue.name) + if definition is None: + # We don't want to duplicate + # `"SomeType" has no attribute "some_attr"` + # error twice. + return + if self.is_assignable_slot(lvalue, definition.type): + return + + self.fail( + message_registry.NAME_NOT_IN_SLOTS.format(lvalue.name, inst.type.fullname), lvalue + ) + + def is_assignable_slot(self, lvalue: Lvalue, typ: Type | None) -> bool: + if getattr(lvalue, "node", None): + return False # This is a definition + + typ = get_proper_type(typ) + if typ is None or isinstance(typ, AnyType): + return True # Any can be literally anything, like `@property` + if isinstance(typ, Instance): + # When working with instances, we need to know if they contain + # `__set__` special method. Like `@property` does. + # This makes assigning to properties possible, + # even without extra slot spec. + return typ.type.get("__set__") is not None + if isinstance(typ, FunctionLike): + return True # Can be a property, or some other magic + if isinstance(typ, UnionType): + return all(self.is_assignable_slot(lvalue, u) for u in typ.items) + return False + + def flatten_rvalues(self, rvalues: list[Expression]) -> list[Expression]: + """Flatten expression list by expanding those * items that have tuple type. + + For each regular type item in the tuple type use a TempNode(), for an Unpack + item use a corresponding StarExpr(TempNode()). + """ + new_rvalues = [] + for rv in rvalues: + if not isinstance(rv, StarExpr): + new_rvalues.append(rv) + continue + typ = get_proper_type(self.expr_checker.accept(rv.expr)) + if not isinstance(typ, TupleType): + new_rvalues.append(rv) + continue + for t in typ.items: + if not isinstance(t, UnpackType): + new_rvalues.append(TempNode(t)) + else: + unpacked = get_proper_type(t.type) + if isinstance(unpacked, TypeVarTupleType): + fallback = unpacked.upper_bound + else: + assert ( + isinstance(unpacked, Instance) + and unpacked.type.fullname == "builtins.tuple" + ) + fallback = unpacked + new_rvalues.append(StarExpr(TempNode(fallback))) + return new_rvalues + + def check_assignment_to_multiple_lvalues( + self, + lvalues: list[Lvalue], + rvalue: Expression, + context: Context, + infer_lvalue_type: bool = True, + ) -> None: + if isinstance(rvalue, (TupleExpr, ListExpr)): + # Recursively go into Tuple or List expression rhs instead of + # using the type of rhs, because this allows more fine-grained + # control in cases like: a, b = [int, str] where rhs would get + # type List[object] + rvalues: list[Expression] = [] + iterable_type: Type | None = None + last_idx: int | None = None + for idx_rval, rval in enumerate(self.flatten_rvalues(rvalue.items)): + if isinstance(rval, StarExpr): + typs = get_proper_type(self.expr_checker.accept(rval.expr)) + if self.type_is_iterable(typs) and isinstance(typs, Instance): + if iterable_type is not None and iterable_type != self.iterable_item_type( + typs, rvalue + ): + self.fail(message_registry.CONTIGUOUS_ITERABLE_EXPECTED, context) + else: + if last_idx is None or last_idx + 1 == idx_rval: + rvalues.append(rval) + last_idx = idx_rval + iterable_type = self.iterable_item_type(typs, rvalue) + else: + self.fail(message_registry.CONTIGUOUS_ITERABLE_EXPECTED, context) + else: + self.fail(message_registry.ITERABLE_TYPE_EXPECTED.format(typs), context) + else: + rvalues.append(rval) + iterable_start: int | None = None + iterable_end: int | None = None + for i, rval in enumerate(rvalues): + if isinstance(rval, StarExpr): + typs = get_proper_type(self.expr_checker.accept(rval.expr)) + if self.type_is_iterable(typs) and isinstance(typs, Instance): + if iterable_start is None: + iterable_start = i + iterable_end = i + if ( + iterable_start is not None + and iterable_end is not None + and iterable_type is not None + ): + iterable_num = iterable_end - iterable_start + 1 + rvalue_needed = len(lvalues) - (len(rvalues) - iterable_num) + if rvalue_needed > 0: + rvalues = ( + rvalues[0:iterable_start] + + [TempNode(iterable_type, context=rval) for _ in range(rvalue_needed)] + + rvalues[iterable_end + 1 :] + ) + + if self.check_rvalue_count_in_assignment(lvalues, len(rvalues), context): + star_index = next( + (i for i, lv in enumerate(lvalues) if isinstance(lv, StarExpr)), len(lvalues) + ) + + left_lvs = lvalues[:star_index] + star_lv = ( + cast(StarExpr, lvalues[star_index]) if star_index != len(lvalues) else None + ) + right_lvs = lvalues[star_index + 1 :] + + left_rvs, star_rvs, right_rvs = self.split_around_star( + rvalues, star_index, len(lvalues) + ) + + lr_pairs = list(zip(left_lvs, left_rvs)) + if star_lv: + rv_list = ListExpr(star_rvs) + rv_list.set_line(rvalue) + lr_pairs.append((star_lv.expr, rv_list)) + lr_pairs.extend(zip(right_lvs, right_rvs)) + + for lv, rv in lr_pairs: + self.check_assignment(lv, rv, infer_lvalue_type) + else: + self.check_multi_assignment(lvalues, rvalue, context, infer_lvalue_type) + + def check_rvalue_count_in_assignment( + self, + lvalues: list[Lvalue], + rvalue_count: int, + context: Context, + rvalue_unpack: int | None = None, + ) -> bool: + if rvalue_unpack is not None: + if not any(isinstance(e, StarExpr) for e in lvalues): + self.fail("Variadic tuple unpacking requires a star target", context) + return False + if len(lvalues) > rvalue_count: + self.fail(message_registry.TOO_MANY_TARGETS_FOR_VARIADIC_UNPACK, context) + return False + left_star_index = next(i for i, lv in enumerate(lvalues) if isinstance(lv, StarExpr)) + left_prefix = left_star_index + left_suffix = len(lvalues) - left_star_index - 1 + right_prefix = rvalue_unpack + right_suffix = rvalue_count - rvalue_unpack - 1 + if left_suffix > right_suffix or left_prefix > right_prefix: + # Case of asymmetric unpack like: + # rv: tuple[int, *Ts, int, int] + # x, y, *xs, z = rv + # it is technically valid, but is tricky to reason about. + # TODO: support this (at least if the r.h.s. unpack is a homogeneous tuple). + self.fail(message_registry.TOO_MANY_TARGETS_FOR_VARIADIC_UNPACK, context) + return True + if any(isinstance(lvalue, StarExpr) for lvalue in lvalues): + if len(lvalues) - 1 > rvalue_count: + self.msg.wrong_number_values_to_unpack(rvalue_count, len(lvalues) - 1, context) + return False + elif rvalue_count != len(lvalues): + self.msg.wrong_number_values_to_unpack(rvalue_count, len(lvalues), context) + return False + return True + + def check_multi_assignment( + self, + lvalues: list[Lvalue], + rvalue: Expression, + context: Context, + infer_lvalue_type: bool = True, + rv_type: Type | None = None, + undefined_rvalue: bool = False, + ) -> None: + """Check the assignment of one rvalue to a number of lvalues.""" + + # Infer the type of an ordinary rvalue expression. + # TODO: maybe elsewhere; redundant. + rvalue_type = get_proper_type(rv_type or self.expr_checker.accept(rvalue)) + + if isinstance(rvalue_type, TypeVarLikeType): + rvalue_type = get_proper_type(rvalue_type.upper_bound) + + if isinstance(rvalue_type, UnionType): + # If this is an Optional type in non-strict Optional code, unwrap it. + relevant_items = rvalue_type.relevant_items() + if len(relevant_items) == 1: + rvalue_type = get_proper_type(relevant_items[0]) + + if ( + isinstance(rvalue_type, TupleType) + and find_unpack_in_list(rvalue_type.items) is not None + ): + # Normalize for consistent handling with "old-style" homogeneous tuples. + rvalue_type = expand_type(rvalue_type, {}) + + if isinstance(rvalue_type, AnyType): + for lv in lvalues: + if isinstance(lv, StarExpr): + lv = lv.expr + temp_node = self.temp_node( + AnyType(TypeOfAny.from_another_any, source_any=rvalue_type), context + ) + self.check_assignment(lv, temp_node, infer_lvalue_type) + elif isinstance(rvalue_type, TupleType): + self.check_multi_assignment_from_tuple( + lvalues, rvalue, rvalue_type, context, undefined_rvalue, infer_lvalue_type + ) + elif isinstance(rvalue_type, UnionType): + self.check_multi_assignment_from_union( + lvalues, rvalue, rvalue_type, context, infer_lvalue_type + ) + else: + rvalue_literal = rvalue_type + if isinstance(rvalue_type, Instance) and rvalue_type.type.fullname == "builtins.str": + if rvalue_type.last_known_value is None: + self.msg.unpacking_strings_disallowed(context) + else: + rvalue_literal = rvalue_type.last_known_value + if ( + isinstance(rvalue_literal, LiteralType) + and isinstance(rvalue_literal.value, str) + and len(lvalues) != len(rvalue_literal.value) + ): + self.msg.unpacking_strings_disallowed(context) + + self.check_multi_assignment_from_iterable( + lvalues, rvalue_type, context, infer_lvalue_type + ) + + def check_multi_assignment_from_union( + self, + lvalues: list[Expression], + rvalue: Expression, + rvalue_type: UnionType, + context: Context, + infer_lvalue_type: bool, + ) -> None: + """Check assignment to multiple lvalue targets when rvalue type is a Union[...]. + For example: + + t: Union[Tuple[int, int], Tuple[str, str]] + x, y = t + reveal_type(x) # Union[int, str] + + The idea in this case is to process the assignment for every item of the union. + Important note: the types are collected in two places, 'union_types' contains + inferred types for first assignments, 'assignments' contains the narrowed types + for binder. + """ + self.no_partial_types = True + transposed: tuple[list[Type], ...] = tuple([] for _ in self.flatten_lvalues(lvalues)) + # Notify binder that we want to defer bindings and instead collect types. + with self.binder.accumulate_type_assignments() as assignments: + for item in rvalue_type.items: + # Type check the assignment separately for each union item and collect + # the inferred lvalue types for each union item. + self.check_multi_assignment( + lvalues, + rvalue, + context, + infer_lvalue_type=infer_lvalue_type, + rv_type=item, + undefined_rvalue=True, + ) + for t, lv in zip(transposed, self.flatten_lvalues(lvalues)): + # We can access _type_maps directly since temporary type maps are + # only created within expressions. + t.append(self._type_maps[-1].pop(lv, AnyType(TypeOfAny.special_form))) + union_types = tuple(make_simplified_union(col) for col in transposed) + for expr, items in assignments.items(): + # Bind a union of types collected in 'assignments' to every expression. + if isinstance(expr, StarExpr): + expr = expr.expr + + # TODO: See comment in binder.py, ConditionalTypeBinder.assign_type + # It's unclear why the 'declared_type' param is sometimes 'None' + clean_items: list[tuple[Type, Type]] = [] + for type, declared_type in items: + assert declared_type is not None + clean_items.append((type, declared_type)) + + types, declared_types = zip(*clean_items) + self.binder.assign_type( + expr, + make_simplified_union(list(types)), + make_simplified_union(list(declared_types)), + ) + for union, lv in zip(union_types, self.flatten_lvalues(lvalues)): + # Properly store the inferred types. + _1, _2, inferred = self.check_lvalue(lv) + if inferred: + self.set_inferred_type(inferred, lv, union) + else: + self.store_type(lv, union) + self.no_partial_types = False + + def flatten_lvalues(self, lvalues: list[Expression]) -> list[Expression]: + res: list[Expression] = [] + for lv in lvalues: + if isinstance(lv, (TupleExpr, ListExpr)): + res.extend(self.flatten_lvalues(lv.items)) + if isinstance(lv, StarExpr): + # Unwrap StarExpr, since it is unwrapped by other helpers. + lv = lv.expr + res.append(lv) + return res + + def check_multi_assignment_from_tuple( + self, + lvalues: list[Lvalue], + rvalue: Expression, + rvalue_type: TupleType, + context: Context, + undefined_rvalue: bool, + infer_lvalue_type: bool = True, + ) -> None: + rvalue_unpack = find_unpack_in_list(rvalue_type.items) + if self.check_rvalue_count_in_assignment( + lvalues, len(rvalue_type.items), context, rvalue_unpack=rvalue_unpack + ): + star_index = next( + (i for i, lv in enumerate(lvalues) if isinstance(lv, StarExpr)), len(lvalues) + ) + + left_lvs = lvalues[:star_index] + star_lv = cast(StarExpr, lvalues[star_index]) if star_index != len(lvalues) else None + right_lvs = lvalues[star_index + 1 :] + + if not undefined_rvalue: + # Infer rvalue again, now in the correct type context. + lvalue_type = self.lvalue_type_for_inference(lvalues, rvalue_type) + reinferred_rvalue_type = get_proper_type( + self.expr_checker.accept(rvalue, lvalue_type) + ) + + if isinstance(reinferred_rvalue_type, TypeVarLikeType): + reinferred_rvalue_type = get_proper_type(reinferred_rvalue_type.upper_bound) + if isinstance(reinferred_rvalue_type, UnionType): + # If this is an Optional type in non-strict Optional code, unwrap it. + relevant_items = reinferred_rvalue_type.relevant_items() + if len(relevant_items) == 1: + reinferred_rvalue_type = get_proper_type(relevant_items[0]) + if isinstance(reinferred_rvalue_type, UnionType): + self.check_multi_assignment_from_union( + lvalues, rvalue, reinferred_rvalue_type, context, infer_lvalue_type + ) + return + if isinstance(reinferred_rvalue_type, AnyType): + # We can get Any if the current node is + # deferred. Doing more inference in deferred nodes + # is hard, so give up for now. We can also get + # here if reinferring types above changes the + # inferred return type for an overloaded function + # to be ambiguous. + return + assert isinstance(reinferred_rvalue_type, TupleType) + rvalue_type = reinferred_rvalue_type + + left_rv_types, star_rv_types, right_rv_types = self.split_around_star( + rvalue_type.items, star_index, len(lvalues) + ) + + for lv, rv_type in zip(left_lvs, left_rv_types): + self.check_assignment(lv, self.temp_node(rv_type, context), infer_lvalue_type) + if star_lv: + list_expr = ListExpr( + [ + ( + self.temp_node(rv_type, context) + if not isinstance(rv_type, UnpackType) + else StarExpr(self.temp_node(rv_type.type, context)) + ) + for rv_type in star_rv_types + ] + ) + list_expr.set_line(context) + self.check_assignment(star_lv.expr, list_expr, infer_lvalue_type) + for lv, rv_type in zip(right_lvs, right_rv_types): + self.check_assignment(lv, self.temp_node(rv_type, context), infer_lvalue_type) + else: + # Store meaningful Any types for lvalues, errors are already given + # by check_rvalue_count_in_assignment() + if infer_lvalue_type: + for lv in lvalues: + if ( + isinstance(lv, NameExpr) + and isinstance(lv.node, Var) + and lv.node.type is None + ): + lv.node.type = AnyType(TypeOfAny.from_error) + elif isinstance(lv, StarExpr): + if ( + isinstance(lv.expr, NameExpr) + and isinstance(lv.expr.node, Var) + and lv.expr.node.type is None + ): + lv.expr.node.type = self.named_generic_type( + "builtins.list", [AnyType(TypeOfAny.from_error)] + ) + + def lvalue_type_for_inference(self, lvalues: list[Lvalue], rvalue_type: TupleType) -> Type: + star_index = next( + (i for i, lv in enumerate(lvalues) if isinstance(lv, StarExpr)), len(lvalues) + ) + left_lvs = lvalues[:star_index] + star_lv = cast(StarExpr, lvalues[star_index]) if star_index != len(lvalues) else None + right_lvs = lvalues[star_index + 1 :] + left_rv_types, star_rv_types, right_rv_types = self.split_around_star( + rvalue_type.items, star_index, len(lvalues) + ) + + type_parameters: list[Type] = [] + + def append_types_for_inference(lvs: list[Expression], rv_types: list[Type]) -> None: + for lv, rv_type in zip(lvs, rv_types): + sub_lvalue_type, index_expr, inferred = self.check_lvalue(lv) + if sub_lvalue_type and not isinstance(sub_lvalue_type, PartialType): + type_parameters.append(sub_lvalue_type) + else: # index lvalue + # TODO Figure out more precise type context, probably + # based on the type signature of the _set method. + type_parameters.append(rv_type) + + append_types_for_inference(left_lvs, left_rv_types) + + if star_lv: + sub_lvalue_type, index_expr, inferred = self.check_lvalue(star_lv.expr) + if sub_lvalue_type and not isinstance(sub_lvalue_type, PartialType): + type_parameters.extend([sub_lvalue_type] * len(star_rv_types)) + else: # index lvalue + # TODO Figure out more precise type context, probably + # based on the type signature of the _set method. + type_parameters.extend(star_rv_types) + + append_types_for_inference(right_lvs, right_rv_types) + + return TupleType(type_parameters, self.named_type("builtins.tuple")) + + def split_around_star( + self, items: list[T], star_index: int, length: int + ) -> tuple[list[T], list[T], list[T]]: + """Splits a list of items in three to match another list of length 'length' + that contains a starred expression at 'star_index' in the following way: + + star_index = 2, length = 5 (i.e., [a,b,*,c,d]), items = [1,2,3,4,5,6,7] + returns in: ([1,2], [3,4,5], [6,7]) + """ + nr_right_of_star = length - star_index - 1 + right_index = -nr_right_of_star if nr_right_of_star != 0 else len(items) + left = items[:star_index] + star = items[star_index:right_index] + right = items[right_index:] + return left, star, right + + def type_is_iterable(self, type: Type) -> bool: + type = get_proper_type(type) + if isinstance(type, FunctionLike) and type.is_type_obj(): + type = type.fallback + return is_subtype( + type, self.named_generic_type("typing.Iterable", [AnyType(TypeOfAny.special_form)]) + ) + + def check_multi_assignment_from_iterable( + self, + lvalues: list[Lvalue], + rvalue_type: Type, + context: Context, + infer_lvalue_type: bool = True, + ) -> None: + rvalue_type = get_proper_type(rvalue_type) + if self.type_is_iterable(rvalue_type): + item_type = self.iterable_item_type(rvalue_type, context) + for lv in lvalues: + if isinstance(lv, StarExpr): + items_type = self.named_generic_type("builtins.list", [item_type]) + self.check_assignment( + lv.expr, self.temp_node(items_type, context), infer_lvalue_type + ) + else: + self.check_assignment( + lv, self.temp_node(item_type, context), infer_lvalue_type + ) + else: + self.msg.type_not_iterable(rvalue_type, context) + + def check_lvalue( + self, lvalue: Lvalue, rvalue: Expression | None = None + ) -> tuple[Type | None, IndexExpr | None, Var | None]: + lvalue_type = None + index_lvalue = None + inferred = None + + # When revisiting the initial assignment (for example in a loop), + # treat is as regular if redefinitions are allowed. + skip_definition = ( + self.options.allow_redefinition_new + and isinstance(lvalue, NameExpr) + and isinstance(lvalue.node, Var) + and lvalue.node.is_inferred + and lvalue.node.type is not None + and not isinstance(lvalue.node.type, PartialType) + # Indexes in for loops require special handling, we need to reset them to + # a literal value on each loop, but binder doesn't work well with literals. + and not lvalue.node.is_index_var + ) + + if ( + self.is_definition(lvalue) + and (not isinstance(lvalue, NameExpr) or isinstance(lvalue.node, Var)) + and not skip_definition + ): + if isinstance(lvalue, NameExpr): + assert isinstance(lvalue.node, Var) + inferred = lvalue.node + else: + assert isinstance(lvalue, MemberExpr) + self.expr_checker.accept(lvalue.expr) + inferred = lvalue.def_var + elif isinstance(lvalue, IndexExpr): + index_lvalue = lvalue + elif isinstance(lvalue, MemberExpr): + lvalue_type = self.expr_checker.analyze_ordinary_member_access(lvalue, True, rvalue) + self.store_type(lvalue, lvalue_type) + elif isinstance(lvalue, NameExpr): + lvalue_type = self.expr_checker.analyze_ref_expr(lvalue, lvalue=True) + if ( + self.options.allow_redefinition_new + and isinstance(lvalue.node, Var) + # We allow redefinition for function arguments inside function body. + # Although we normally do this for variables without annotation, users + # don't have a choice to leave a function argument without annotation. + and (lvalue.node.is_inferred or lvalue.node.is_argument) + ): + inferred = lvalue.node + self.store_type(lvalue, lvalue_type) + elif isinstance(lvalue, (TupleExpr, ListExpr)): + types = [ + self.check_lvalue(sub_expr)[0] or + # This type will be used as a context for further inference of rvalue, + # we put Uninhabited if there is no information available from lvalue. + UninhabitedType() + for sub_expr in lvalue.items + ] + lvalue_type = TupleType(types, self.named_type("builtins.tuple")) + elif isinstance(lvalue, StarExpr): + lvalue_type, _, _ = self.check_lvalue(lvalue.expr) + else: + lvalue_type = self.expr_checker.accept(lvalue) + + return lvalue_type, index_lvalue, inferred + + def is_definition(self, s: Lvalue) -> bool: + if isinstance(s, NameExpr): + if s.is_inferred_def: + return True + # If the node type is not defined, this must the first assignment + # that we process => this is a definition, even though the semantic + # analyzer did not recognize this as such. This can arise in code + # that uses isinstance checks, if type checking of the primary + # definition is skipped due to an always False type check. + node = s.node + if isinstance(node, Var): + return node.type is None + elif isinstance(s, MemberExpr): + return s.is_inferred_def + return False + + def infer_variable_type( + self, name: Var, lvalue: Lvalue, init_type: Type, context: Context + ) -> None: + """Infer the type of initialized variables from initializer type.""" + if isinstance(init_type, DeletedType): + self.msg.deleted_as_rvalue(init_type, context) + elif ( + not is_valid_inferred_type( + init_type, + self.options, + is_lvalue_final=name.is_final, + is_lvalue_member=isinstance(lvalue, MemberExpr), + ) + and not ( + # Trust None assignments to dunder methods + # This is a bit ad-hoc, but it improves protocol + # (non-)assignability, for instance `__hash__ = None` + self.scope.active_class() + and is_dunder(name.name) + and isinstance(get_proper_type(init_type), NoneType) + ) + and not self.no_partial_types + ): + # We cannot use the type of the initialization expression for full type + # inference (it's not specific enough), but we might be able to give + # partial type which will be made more specific later. A partial type + # gets generated in assignment like 'x = []' where item type is not known. + if name.name != "_" and not self.infer_partial_type(name, lvalue, init_type): + self.msg.need_annotation_for_var(name, context, self.options) + self.set_inference_error_fallback_type(name, lvalue, init_type) + elif ( + isinstance(lvalue, MemberExpr) + and self.inferred_attribute_types is not None + and lvalue.def_var + and lvalue.def_var in self.inferred_attribute_types + and not is_same_type(self.inferred_attribute_types[lvalue.def_var], init_type) + ): + # Multiple, inconsistent types inferred for an attribute. + self.msg.need_annotation_for_var(name, context, self.options) + name.type = AnyType(TypeOfAny.from_error) + else: + # Infer type of the target. + + # Make the type more general (strip away function names etc.). + init_type = strip_type(init_type) + + self.set_inferred_type(name, lvalue, init_type) + if self.options.allow_redefinition_new: + self.binder.assign_type(lvalue, init_type, init_type) + + def infer_partial_type(self, name: Var, lvalue: Lvalue, init_type: Type) -> bool: + init_type = get_proper_type(init_type) + if isinstance(init_type, NoneType) and ( + isinstance(lvalue, MemberExpr) or not self.options.allow_redefinition_new + ): + # When using --allow-redefinition-new, None types aren't special + # when inferring simple variable types. + partial_type = PartialType(None, name) + elif isinstance(init_type, Instance): + fullname = init_type.type.fullname + is_ref = isinstance(lvalue, RefExpr) + if ( + is_ref + and ( + fullname == "builtins.list" + or fullname == "builtins.set" + or fullname == "builtins.dict" + or fullname == "collections.OrderedDict" + ) + and all( + isinstance(t, (NoneType, UninhabitedType)) + for t in get_proper_types(init_type.args) + ) + ): + partial_type = PartialType(init_type.type, name) + elif is_ref and fullname == "collections.defaultdict": + arg0 = get_proper_type(init_type.args[0]) + arg1 = get_proper_type(init_type.args[1]) + if isinstance( + arg0, (NoneType, UninhabitedType) + ) and self.is_valid_defaultdict_partial_value_type(arg1): + arg1 = erase_type(arg1) + assert isinstance(arg1, Instance) + partial_type = PartialType(init_type.type, name, arg1) + else: + return False + else: + return False + else: + return False + self.set_inferred_type(name, lvalue, partial_type) + self.partial_types[-1].map[name] = lvalue + return True + + def is_valid_defaultdict_partial_value_type(self, t: ProperType) -> bool: + """Check if t can be used as the basis for a partial defaultdict value type. + + Examples: + + * t is 'int' --> True + * t is 'list[Never]' --> True + * t is 'dict[...]' --> False (only generic types with a single type + argument supported) + """ + if not isinstance(t, Instance): + return False + if len(t.args) == 0: + return True + if len(t.args) == 1: + arg = get_proper_type(t.args[0]) + if self.options.old_type_inference: + # Allow leaked TypeVars for legacy inference logic. + allowed = isinstance(arg, (UninhabitedType, NoneType, TypeVarType)) + else: + allowed = isinstance(arg, (UninhabitedType, NoneType)) + if allowed: + return True + return False + + def set_inferred_type(self, var: Var, lvalue: Lvalue, type: Type) -> None: + """Store inferred variable type. + + Store the type to both the variable node and the expression node that + refers to the variable (lvalue). If var is None, do nothing. + """ + if var and not self.current_node_deferred: + var.type = type + var.is_inferred = True + var.is_ready = True + if var not in self.var_decl_frames: + # Used for the hack to improve optional type inference in conditionals + self.var_decl_frames[var] = {frame.id for frame in self.binder.frames} + if isinstance(lvalue, MemberExpr) and self.inferred_attribute_types is not None: + # Store inferred attribute type so that we can check consistency afterwards. + if lvalue.def_var is not None: + self.inferred_attribute_types[lvalue.def_var] = type + self.store_type(lvalue, type) + p_type = get_proper_type(type) + definition = None + if isinstance(p_type, CallableType): + definition = p_type.definition + elif isinstance(p_type, Overloaded): + # Randomly select first item, if items are different, there will + # be an error during semantic analysis. + definition = p_type.items[0].definition + if definition: + if is_node_static(definition): + var.is_staticmethod = True + elif is_classmethod_node(definition): + var.is_classmethod = True + elif is_property(definition): + var.is_property = True + if isinstance(p_type, Overloaded): + # TODO: in theory we can have a property with a deleter only. + var.is_settable_property = True + assert isinstance(definition, Decorator), definition + var.setter_type = definition.var.setter_type + + def set_inference_error_fallback_type(self, var: Var, lvalue: Lvalue, type: Type) -> None: + """Store best known type for variable if type inference failed. + + If a program ignores error on type inference error, the variable should get some + inferred type so that it can be used later on in the program. Example: + + x = [] # type: ignore + x.append(1) # Should be ok! + + We implement this here by giving x a valid type (replacing inferred Never with Any). + """ + fallback = self.inference_error_fallback_type(type) + self.set_inferred_type(var, lvalue, fallback) + + def inference_error_fallback_type(self, type: Type) -> Type: + fallback = type.accept(SetNothingToAny()) + # Type variables may leak from inference, see https://github.com/python/mypy/issues/5738, + # we therefore need to erase them. + return erase_typevars(fallback) + + def simple_rvalue(self, rvalue: Expression) -> bool: + """Returns True for expressions for which inferred type should not depend on context. + + Note that this function can still return False for some expressions where inferred type + does not depend on context. It only exists for performance optimizations. + """ + if isinstance(rvalue, (IntExpr, StrExpr, BytesExpr, FloatExpr, RefExpr)): + return True + if isinstance(rvalue, CallExpr): + if isinstance(rvalue.callee, RefExpr) and isinstance( + rvalue.callee.node, SYMBOL_FUNCBASE_TYPES + ): + typ = rvalue.callee.node.type + if isinstance(typ, CallableType): + return not typ.variables + elif isinstance(typ, Overloaded): + return not any(item.variables for item in typ.items) + return False + + def infer_rvalue_with_fallback_context( + self, + lvalue_type: Type | None, + rvalue: Expression, + preferred_context: Type | None, + fallback_context: Type | None, + inferred: Var | None, + always_allow_any: bool, + ) -> Type: + """Infer rvalue type in two type context and select the best one. + + See comments below for supported fallback scenarios. + """ + assert fallback_context is not preferred_context + # TODO: make assignment checking correct in presence of walrus in r.h.s. + # We may accept r.h.s. twice. In presence of walrus this can lead to weird + # false negatives and "back action". A proper solution would be to use + # binder.accumulate_type_assignments() and assign the types inferred for type + # context that is ultimately used. This is however tricky with redefinitions. + # For now we simply disable second accept in cases known to cause problems, + # see e.g. testAssignToOptionalTupleWalrus. + binder_version = self.binder.version + + fallback_context_used = False + with ( + self.msg.filter_errors(save_filtered_errors=True) as local_errors, + self.local_type_map as type_map, + ): + rvalue_type = self.expr_checker.accept( + rvalue, type_context=preferred_context, always_allow_any=always_allow_any + ) + + # There are two cases where we want to try re-inferring r.h.s. in a fallback + # type context. First case is when redefinitions are allowed, and we got + # invalid type when using the preferred (empty) type context. + redefinition_fallback = ( + inferred is not None + and not inferred.is_argument + and not is_valid_inferred_type(rvalue_type, self.options) + ) + # For function arguments the preference order is opposite, and we use errors + # during type-checking as the fallback trigger. + argument_redefinition_fallback = ( + inferred is not None and inferred.is_argument and local_errors.has_new_errors() + ) + # Try re-inferring r.h.s. in empty context for union with explicit annotation, + # and use it results in a narrower type. This helps with various practical + # examples, see e.g. testOptionalTypeNarrowedByGenericCall. + union_fallback = ( + preferred_context is not None + and isinstance(get_proper_type(lvalue_type), UnionType) + and binder_version == self.binder.version + ) + + # Skip literal types, as they have special logic (for better errors). + try_fallback = redefinition_fallback or union_fallback or argument_redefinition_fallback + if try_fallback and not is_literal_type_like(rvalue_type): + with ( + self.msg.filter_errors(save_filtered_errors=True) as alt_local_errors, + self.local_type_map as alt_type_map, + ): + alt_rvalue_type = self.expr_checker.accept( + rvalue, fallback_context, always_allow_any=always_allow_any + ) + if ( + not alt_local_errors.has_new_errors() + and is_valid_inferred_type(alt_rvalue_type, self.options) + and ( + # For redefinition fallbacks we are fine getting not a subtype. + redefinition_fallback + or argument_redefinition_fallback + # Skip Any type, since it is special cased in binder. + or not isinstance(get_proper_type(alt_rvalue_type), AnyType) + and is_proper_subtype(alt_rvalue_type, rvalue_type) + ) + ): + fallback_context_used = True + rvalue_type = alt_rvalue_type + self.store_types(alt_type_map) + + if not fallback_context_used: + self.msg.add_errors(local_errors.filtered_errors()) + self.store_types(type_map) + return rvalue_type + + def check_simple_assignment( + self, + lvalue_type: Type | None, + rvalue: Expression, + context: Context, + msg: ErrorMessage = message_registry.INCOMPATIBLE_TYPES_IN_ASSIGNMENT, + lvalue_name: str = "variable", + rvalue_name: str = "expression", + *, + notes: list[str] | None = None, + lvalue: Expression | None = None, + inferred: Var | None = None, + ) -> tuple[Type, Type | None]: + if self.is_stub and isinstance(rvalue, EllipsisExpr): + # '...' is always a valid initializer in a stub. + return AnyType(TypeOfAny.special_form), lvalue_type + else: + always_allow_any = lvalue_type is not None and not isinstance( + get_proper_type(lvalue_type), AnyType + ) + + # If redefinitions are allowed (i.e. we have --allow-redefinition-new + # and a variable without annotation) or if a variable has union type we + # try inferring r.h.s. twice with a fallback type context. The only exception + # is TypedDicts, they are often useless without context. + try_fallback = ( + inferred is not None or isinstance(get_proper_type(lvalue_type), UnionType) + ) and not self.simple_rvalue(rvalue) + + if not try_fallback or lvalue_type is None or is_typeddict_type_context(lvalue_type): + rvalue_type = self.expr_checker.accept( + rvalue, type_context=lvalue_type, always_allow_any=always_allow_any + ) + else: + # Prefer full type context for function arguments as this reduces + # false positives, see issue #19918 for discussion. + if inferred is not None and not inferred.is_argument: + preferred = None + fallback = lvalue_type + else: + preferred = lvalue_type + fallback = None + + rvalue_type = self.infer_rvalue_with_fallback_context( + lvalue_type, rvalue, preferred, fallback, inferred, always_allow_any + ) + + if ( + inferred is not None + and not is_valid_inferred_type(rvalue_type, self.options) + and ( + not inferred.type + or isinstance(inferred.type, PartialType) + # This additional check is to give an error instead of inferring + # a useless type like None | list[Never] in case of "double-partial" + # types that are not supported yet, see issue #20257. + or not is_subtype(rvalue_type, inferred.type) + ) + ): + self.msg.need_annotation_for_var(inferred, inferred, self.options) + rvalue_type = rvalue_type.accept(SetNothingToAny()) + + if ( + isinstance(lvalue, NameExpr) + and inferred is not None + and inferred.type is not None + and not inferred.is_final + ): + new_inferred = remove_instance_last_known_values(rvalue_type) + # Should we widen the inferred type or the lvalue? Variables defined + # at module level or class bodies can't be widened in functions, or + # in another module. + if ( + not self.refers_to_different_scope(lvalue) + and not isinstance(inferred.type, PartialType) + and not is_proper_subtype(new_inferred, inferred.type) + ): + lvalue_type = make_simplified_union([inferred.type, new_inferred]) + # Widen the type to the union of original and new type. + if not inferred.is_index_var: + # Skip index variables as they are reset on each loop. + self.widened_vars.append(inferred.name) + self.set_inferred_type(inferred, lvalue, lvalue_type) + self.binder.put(lvalue, rvalue_type) + # TODO: A bit hacky, maybe add a binder method that does put and + # updates declaration? + lit = literal_hash(lvalue) + if lit is not None: + self.binder.declarations[lit] = lvalue_type + + if isinstance(rvalue_type, DeletedType): + self.msg.deleted_as_rvalue(rvalue_type, context) + if isinstance(lvalue_type, DeletedType): + self.msg.deleted_as_lvalue(lvalue_type, context) + elif lvalue_type: + self.check_subtype( + # Preserve original aliases for error messages when possible. + rvalue_type, + lvalue_type, + context, + msg, + f"{rvalue_name} has type", + f"{lvalue_name} has type", + notes=notes, + ) + return rvalue_type, lvalue_type + + def refers_to_different_scope(self, name: NameExpr) -> bool: + if name.kind == LDEF: + # TODO: Consider reference to outer function as a different scope? + return False + elif self.scope.top_level_function() is not None: + # A non-local reference from within a function must refer to a different scope + return True + elif name.kind == GDEF and name.fullname.rpartition(".")[0] != self.tree.fullname: + # Reference to global definition from another module + return True + return False + + def check_member_assignment( + self, + lvalue: MemberExpr, + instance_type: Type, + set_lvalue_type: Type, + rvalue: Expression, + context: Context, + ) -> tuple[Type, Type, bool]: + """Type member assignment. + + This defers to check_simple_assignment, unless the member expression + is a descriptor, in which case this checks descriptor semantics as well. + + Return the inferred rvalue_type, inferred lvalue_type, and whether to use the binder + for this assignment. + """ + instance_type = get_proper_type(instance_type) + # Descriptors don't participate in class-attribute access + if (isinstance(instance_type, FunctionLike) and instance_type.is_type_obj()) or isinstance( + instance_type, TypeType + ): + rvalue_type, _ = self.check_simple_assignment(set_lvalue_type, rvalue, context) + return rvalue_type, set_lvalue_type, True + + with self.msg.filter_errors(filter_deprecated=True): + get_lvalue_type = self.expr_checker.analyze_ordinary_member_access( + lvalue, is_lvalue=False + ) + + # Special case: if the rvalue_type is a subtype of '__get__' type, and + # '__get__' type is narrower than '__set__', then we invoke the binder to narrow type + # by this assignment. Technically, this is not safe, but in practice this is + # what a user expects. + rvalue_type, _ = self.check_simple_assignment(set_lvalue_type, rvalue, context) + rvalue_type = rvalue_type if is_subtype(rvalue_type, get_lvalue_type) else get_lvalue_type + return rvalue_type, set_lvalue_type, is_subtype(get_lvalue_type, set_lvalue_type) + + def check_indexed_assignment( + self, lvalue: IndexExpr, rvalue: Expression, context: Context + ) -> None: + """Type check indexed assignment base[index] = rvalue. + + The lvalue argument is the base[index] expression. + """ + self.try_infer_partial_type_from_indexed_assignment(lvalue, rvalue) + basetype = get_proper_type(self.expr_checker.accept(lvalue.base)) + method_type = self.expr_checker.analyze_external_member_access( + "__setitem__", basetype, lvalue + ) + + lvalue.method_type = method_type + res_type, _ = self.expr_checker.check_method_call( + "__setitem__", + basetype, + method_type, + [lvalue.index, rvalue], + [nodes.ARG_POS, nodes.ARG_POS], + context, + ) + res_type = get_proper_type(res_type) + if isinstance(res_type, UninhabitedType) and not res_type.ambiguous: + self.binder.unreachable() + + def replace_partial_type( + self, var: Var, new_type: Type, partial_types: dict[Var, Context] + ) -> None: + """Replace the partial type of var with a non-partial type.""" + var.type = new_type + # Updating a partial type should invalidate expression caches. + self.binder.version += 1 + del partial_types[var] + if self.options.allow_redefinition_new: + # When using --allow-redefinition-new, binder tracks all types of + # simple variables. + n = NameExpr(var.name) + n.node = var + self.binder.assign_type(n, new_type, new_type) + + def try_infer_partial_type_from_indexed_assignment( + self, lvalue: IndexExpr, rvalue: Expression + ) -> None: + # TODO: Should we share some of this with try_infer_partial_type? + var = None + if isinstance(lvalue.base, RefExpr) and isinstance(lvalue.base.node, Var): + var = lvalue.base.node + elif isinstance(lvalue.base, MemberExpr): + var = self.expr_checker.get_partial_self_var(lvalue.base) + if isinstance(var, Var): + if isinstance(var.type, PartialType): + type_type = var.type.type + if type_type is None: + return # The partial type is None. + partial_types = self.find_partial_types(var) + if partial_types is None: + return + typename = type_type.fullname + if ( + typename == "builtins.dict" + or typename == "collections.OrderedDict" + or typename == "collections.defaultdict" + ): + # TODO: Don't infer things twice. + key_type = self.expr_checker.accept(lvalue.index) + value_type = self.expr_checker.accept(rvalue) + if ( + is_valid_inferred_type(key_type, self.options) + and is_valid_inferred_type(value_type, self.options) + and not self.current_node_deferred + and not ( + typename == "collections.defaultdict" + and var.type.value_type is not None + and not is_equivalent(value_type, var.type.value_type) + ) + ): + new_type = self.named_generic_type(typename, [key_type, value_type]) + self.replace_partial_type(var, new_type, partial_types) + + def type_requires_usage(self, typ: Type) -> tuple[str, ErrorCode] | None: + """Some types require usage in all cases. The classic example is + an unused coroutine. + + In the case that it does require usage, returns a note to attach + to the error message. + """ + proper_type = get_proper_type(typ) + if isinstance(proper_type, Instance): + # We use different error codes for generic awaitable vs coroutine. + # Coroutines are on by default, whereas generic awaitables are not. + if proper_type.type.fullname == "typing.Coroutine": + return ("Are you missing an await?", UNUSED_COROUTINE) + if proper_type.type.get("__await__") is not None: + return ("Are you missing an await?", UNUSED_AWAITABLE) + return None + + def visit_expression_stmt(self, s: ExpressionStmt) -> None: + expr_type = self.expr_checker.accept(s.expr, allow_none_return=True, always_allow_any=True) + error_note_and_code = self.type_requires_usage(expr_type) + if error_note_and_code: + error_note, code = error_note_and_code + self.fail( + message_registry.TYPE_MUST_BE_USED.format(format_type(expr_type, self.options)), + s, + code=code, + ) + self.note(error_note, s, code=code) + + def visit_return_stmt(self, s: ReturnStmt) -> None: + """Type check a return statement.""" + self.check_return_stmt(s) + self.binder.unreachable() + + def infer_context_dependent( + self, expr: Expression, type_ctx: Type, allow_none_func_call: bool + ) -> ProperType: + """Infer type of expression with fallback to empty type context.""" + with self.msg.filter_errors(filter_deprecated=True, save_filtered_errors=True) as msg: + with ( + self.local_type_map as type_map, + # Prevent any narrowing (e.g. from walrus) to have effect during second accept. + self.binder.frame_context(can_skip=False, discard=True), + ): + typ = get_proper_type( + self.expr_checker.accept( + expr, type_ctx, allow_none_return=allow_none_func_call + ) + ) + if not msg.has_new_errors(): + self.store_types(type_map) + return typ + + # If there are errors with the original type context, try re-inferring in empty context. + original_messages = msg.filtered_errors() + original_type_map = type_map + with self.msg.filter_errors(filter_deprecated=True, save_filtered_errors=True) as msg: + with self.local_type_map as type_map: + alt_typ = get_proper_type( + self.expr_checker.accept(expr, None, allow_none_return=allow_none_func_call) + ) + if not msg.has_new_errors() and is_subtype(alt_typ, type_ctx): + self.store_types(type_map) + return alt_typ + + # If empty fallback didn't work, use results from the original type context. + self.msg.add_errors(original_messages) + self.store_types(original_type_map) + return typ + + def check_return_stmt(self, s: ReturnStmt) -> None: + defn = self.scope.current_function() + if defn is not None: + if defn.is_generator: + return_type = self.get_generator_return_type( + self.return_types[-1], defn.is_coroutine + ) + elif defn.is_coroutine: + return_type = self.get_coroutine_return_type(self.return_types[-1]) + else: + return_type = self.return_types[-1] + return_type = get_proper_type(return_type) + + is_lambda = isinstance(defn, LambdaExpr) + if isinstance(return_type, UninhabitedType): + # Avoid extra error messages for failed inference in lambdas + if not is_lambda and not return_type.ambiguous: + self.fail(message_registry.NO_RETURN_EXPECTED, s) + return + + if s.expr: + declared_none_return = isinstance(return_type, NoneType) + declared_any_return = isinstance(return_type, AnyType) + + # This controls whether or not we allow a function call that + # returns None as the expression of this return statement. + # E.g. `return f()` for some `f` that returns None. We allow + # this only if we're in a lambda or in a function that returns + # `None` or `Any`. + allow_none_func_call = is_lambda or declared_none_return or declared_any_return + + # Return with a value. + if ( + isinstance(s.expr, (CallExpr, ListExpr, TupleExpr, DictExpr, SetExpr, OpExpr)) + or isinstance(s.expr, AwaitExpr) + and isinstance(s.expr.expr, CallExpr) + ): + # For expressions that (strongly) depend on type context (i.e. those that + # are handled like a function call), we allow fallback to empty type context + # in case of errors, this improves user experience in some cases, + # see e.g. testReturnFallbackInference. + typ = self.infer_context_dependent(s.expr, return_type, allow_none_func_call) + else: + typ = get_proper_type( + self.expr_checker.accept( + s.expr, return_type, allow_none_return=allow_none_func_call + ) + ) + # Treat NotImplemented as having type Any, consistent with its + # definition in typeshed prior to python/typeshed#4222. + if isinstance(typ, Instance) and typ.type.fullname in NOT_IMPLEMENTED_TYPE_NAMES: + typ = AnyType(TypeOfAny.special_form) + + if defn.is_async_generator: + self.fail(message_registry.RETURN_IN_ASYNC_GENERATOR, s) + return + # Returning a value of type Any is always fine. + if isinstance(typ, AnyType): + # (Unless you asked to be warned in that case, and the + # function is not declared to return Any) + if ( + self.options.warn_return_any + and not self.current_node_deferred + and not is_proper_subtype(AnyType(TypeOfAny.special_form), return_type) + and not ( + defn.name in BINARY_MAGIC_METHODS + and is_literal_not_implemented(s.expr) + ) + and not ( + isinstance(return_type, Instance) + and return_type.type.fullname == "builtins.object" + ) + and not is_lambda + ): + self.msg.incorrectly_returning_any(return_type, s) + return + + # Disallow return expressions in functions declared to return + # None, subject to two exceptions below. + if declared_none_return: + # Lambdas are allowed to have None returns. + # Functions returning a value of type None are allowed to have a None return. + if is_lambda or isinstance(typ, NoneType): + return + self.fail(message_registry.NO_RETURN_VALUE_EXPECTED, s) + else: + self.check_subtype( + subtype_label="got", + subtype=typ, + supertype_label="expected", + supertype=return_type, + context=s.expr, + outer_context=s, + msg=message_registry.INCOMPATIBLE_RETURN_VALUE_TYPE, + ) + else: + # Empty returns are valid in Generators with Any typed returns, but not in + # coroutines. + if ( + defn.is_generator + and not defn.is_coroutine + and isinstance(return_type, AnyType) + ): + return + + if isinstance(return_type, (NoneType, AnyType)): + return + + if self.in_checked_function(): + self.fail(message_registry.RETURN_VALUE_EXPECTED, s) + + def visit_if_stmt(self, s: IfStmt) -> None: + """Type check an if statement.""" + # This frame records the knowledge from previous if/elif clauses not being taken. + # Fall-through to the original frame is handled explicitly in each block. + with self.binder.frame_context(can_skip=False, conditional_frame=True, fall_through=0): + for e, b in zip(s.expr, s.body): + t = get_proper_type(self.expr_checker.accept(e)) + + if isinstance(t, DeletedType): + self.msg.deleted_as_rvalue(t, s) + + if_map, else_map = self.find_isinstance_check(e) + + s.unreachable_else = is_unreachable_map(else_map) + + # XXX Issue a warning if condition is always False? + with self.binder.frame_context(can_skip=True, fall_through=2): + self.push_type_map(if_map, from_assignment=False) + self.accept(b) + + # XXX Issue a warning if condition is always True? + self.push_type_map(else_map, from_assignment=False) + + with self.binder.frame_context(can_skip=False, fall_through=2): + if s.else_body: + self.accept(s.else_body) + + def visit_while_stmt(self, s: WhileStmt) -> None: + """Type check a while statement.""" + if_stmt = IfStmt([s.expr], [s.body], None) + if_stmt.set_line(s) + self.accept_loop(if_stmt, s.else_body, exit_condition=s.expr) + + def visit_operator_assignment_stmt(self, s: OperatorAssignmentStmt) -> None: + """Type check an operator assignment statement, e.g. x += 1.""" + self.try_infer_partial_generic_type_from_assignment(s.lvalue, s.rvalue, s.op) + if isinstance(s.lvalue, MemberExpr): + # Special case, some additional errors may be given for + # assignments to read-only or final attributes. + lvalue_type = self.expr_checker.visit_member_expr(s.lvalue, True) + else: + lvalue_type = self.expr_checker.accept(s.lvalue) + inplace, method = infer_operator_assignment_method(lvalue_type, s.op) + if inplace: + # There is __ifoo__, treat as x = x.__ifoo__(y) + rvalue_type, _ = self.expr_checker.check_op(method, lvalue_type, s.rvalue, s) + if not is_subtype(rvalue_type, lvalue_type): + self.msg.incompatible_operator_assignment(s.op, s) + else: + # There is no __ifoo__, treat as x = x y + expr = OpExpr(s.op, s.lvalue, s.rvalue) + expr.set_line(s) + self.check_assignment( + lvalue=s.lvalue, rvalue=expr, infer_lvalue_type=True, new_syntax=False + ) + self.check_final(s) + + def visit_assert_stmt(self, s: AssertStmt) -> None: + self.expr_checker.accept(s.expr) + + if isinstance(s.expr, TupleExpr) and len(s.expr.items) > 0: + self.fail(message_registry.MALFORMED_ASSERT, s) + + # If this is asserting some isinstance check, bind that type in the following code + true_map, else_map = self.find_isinstance_check(s.expr) + if s.msg is not None: + self.expr_checker.analyze_cond_branch( + else_map, s.msg, None, suppress_unreachable_errors=False + ) + self.push_type_map(true_map) + + def visit_raise_stmt(self, s: RaiseStmt) -> None: + """Type check a raise statement.""" + if s.expr: + self.type_check_raise(s.expr, s) + if s.from_expr: + self.type_check_raise(s.from_expr, s, optional=True) + self.binder.unreachable() + + def type_check_raise(self, e: Expression, s: RaiseStmt, optional: bool = False) -> None: + typ = get_proper_type(self.expr_checker.accept(e)) + if isinstance(typ, DeletedType): + self.msg.deleted_as_rvalue(typ, e) + return + + exc_type = self.named_type("builtins.BaseException") + expected_type_items = [exc_type, TypeType(exc_type)] + if optional: + # This is used for `x` part in a case like `raise e from x`, + # where we allow `raise e from None`. + expected_type_items.append(NoneType()) + + self.check_subtype( + typ, UnionType.make_union(expected_type_items), s, message_registry.INVALID_EXCEPTION + ) + + if isinstance(typ, FunctionLike): + # https://github.com/python/mypy/issues/11089 + self.expr_checker.check_call(typ, [], [], e) + + if (isinstance(typ, Instance) and typ.type.fullname in NOT_IMPLEMENTED_TYPE_NAMES) or ( + isinstance(e, CallExpr) + and isinstance(e.callee, RefExpr) + and e.callee.fullname == "builtins.NotImplemented" + ): + self.fail( + message_registry.INVALID_EXCEPTION.with_additional_msg( + '; did you mean "NotImplementedError"?' + ), + s, + ) + + def visit_try_stmt(self, s: TryStmt) -> None: + """Type check a try statement.""" + + iter_errors = None + + # Our enclosing frame will get the result if the try/except falls through. + # This one gets all possible states after the try block exited abnormally + # (by exception, return, break, etc.) + with self.binder.frame_context(can_skip=False, fall_through=0): + # Not only might the body of the try statement exit + # abnormally, but so might an exception handler or else + # clause. The finally clause runs in *all* cases, so we + # need an outer try frame to catch all intermediate states + # in case an exception is raised during an except or else + # clause. As an optimization, only create the outer try + # frame when there actually is a finally clause. + self.visit_try_without_finally(s, try_frame=bool(s.finally_body)) + if s.finally_body: + # First we check finally_body is type safe on all abnormal exit paths + iter_errors = IterationDependentErrors() + with IterationErrorWatcher(self.msg.errors, iter_errors): + self.accept(s.finally_body) + + if s.finally_body: + # Then we try again for the more restricted set of options + # that can fall through. (Why do we need to check the + # finally clause twice? Depending on whether the finally + # clause was reached by the try clause falling off the end + # or exiting abnormally, after completing the finally clause + # either flow will continue to after the entire try statement + # or the exception/return/etc. will be processed and control + # flow will escape. We need to check that the finally clause + # type checks in both contexts, but only the resulting types + # from the latter context affect the type state in the code + # that follows the try statement.) + assert iter_errors is not None + if not self.binder.is_unreachable(): + with IterationErrorWatcher(self.msg.errors, iter_errors): + self.accept(s.finally_body) + self.msg.iteration_dependent_errors(iter_errors) + + def visit_try_without_finally(self, s: TryStmt, try_frame: bool) -> None: + """Type check a try statement, ignoring the finally block. + + On entry, the top frame should receive all flow that exits the + try block abnormally (i.e., such that the else block does not + execute), and its parent should receive all flow that exits + the try block normally. + """ + # This frame will run the else block if the try fell through. + # In that case, control flow continues to the parent of what + # was the top frame on entry. + with self.binder.frame_context(can_skip=False, fall_through=2, try_frame=try_frame): + # This frame receives exit via exception, and runs exception handlers + with self.binder.frame_context(can_skip=False, conditional_frame=True, fall_through=2): + # Finally, the body of the try statement + with self.binder.frame_context(can_skip=False, fall_through=2, try_frame=True): + self.accept(s.body) + for i in range(len(s.handlers)): + with self.binder.frame_context(can_skip=True, fall_through=4): + typ = s.types[i] + if typ: + t = self.check_except_handler_test(typ, s.is_star) + var = s.vars[i] + if var: + # To support local variables, we make this a definition line, + # causing assignment to set the variable's type. + var.is_inferred_def = True + self.check_assignment(var, self.temp_node(t, var)) + self.accept(s.handlers[i]) + var = s.vars[i] + if var: + # Exception variables are deleted. + # Unfortunately, this doesn't let us detect usage before the + # try/except block. + source = var.name + if isinstance(var.node, Var): + new_type = DeletedType(source=source) + var.node.type = new_type + if self.options.allow_redefinition_new: + # TODO: Should we use put() here? + self.binder.assign_type(var, new_type, new_type) + if not self.options.allow_redefinition_new: + self.binder.cleanse(var) + if s.else_body: + self.accept(s.else_body) + + def check_except_handler_test(self, n: Expression, is_star: bool) -> Type: + """Type check an exception handler test clause.""" + typ = self.expr_checker.accept(n) + + all_types: list[Type] = [] + test_types = self.get_types_from_except_handler(typ, n) + + for ttype in get_proper_types(test_types): + if isinstance(ttype, AnyType): + all_types.append(ttype) + continue + if isinstance(ttype, UninhabitedType): + continue + + if isinstance(ttype, FunctionLike): + item = ttype.items[0] + if not item.is_type_obj(): + self.fail(message_registry.INVALID_EXCEPTION_TYPE, n) + return self.default_exception_type(is_star) + exc_type = erase_typevars(item.ret_type) + elif isinstance(ttype, TypeType): + exc_type = ttype.item + else: + self.fail(message_registry.INVALID_EXCEPTION_TYPE, n) + return self.default_exception_type(is_star) + + if not is_subtype(exc_type, self.named_type("builtins.BaseException")): + self.fail(message_registry.INVALID_EXCEPTION_TYPE, n) + return self.default_exception_type(is_star) + + all_types.append(exc_type) + + if is_star: + new_all_types: list[Type] = [] + for typ in all_types: + if is_proper_subtype(typ, self.named_type("builtins.BaseExceptionGroup")): + self.fail(message_registry.INVALID_EXCEPTION_GROUP, n) + new_all_types.append(AnyType(TypeOfAny.from_error)) + else: + new_all_types.append(typ) + return self.wrap_exception_group(new_all_types) + return make_simplified_union(all_types) + + def default_exception_type(self, is_star: bool) -> Type: + """Exception type to return in case of a previous type error.""" + any_type = AnyType(TypeOfAny.from_error) + if is_star: + return self.named_generic_type("builtins.ExceptionGroup", [any_type]) + return any_type + + def wrap_exception_group(self, types: Sequence[Type]) -> Type: + """Transform except* variable type into an appropriate exception group.""" + arg = make_simplified_union(types) + if is_subtype(arg, self.named_type("builtins.Exception")): + base = "builtins.ExceptionGroup" + else: + base = "builtins.BaseExceptionGroup" + return self.named_generic_type(base, [arg]) + + def get_types_from_except_handler(self, typ: Type, n: Expression) -> list[Type]: + """Helper for check_except_handler_test to retrieve handler types.""" + typ = get_proper_type(typ) + if isinstance(typ, TupleType): + merged_type = make_simplified_union(typ.items) + if isinstance(merged_type, UnionType): + return merged_type.relevant_items() + return [merged_type] + elif is_named_instance(typ, "builtins.tuple"): + # variadic tuple + merged_type = make_simplified_union((typ.args[0],)) + if isinstance(merged_type, UnionType): + return merged_type.relevant_items() + return [merged_type] + elif isinstance(typ, UnionType): + return [ + union_typ + for item in typ.relevant_items() + for union_typ in self.get_types_from_except_handler(item, n) + ] + else: + return [typ] + + def visit_for_stmt(self, s: ForStmt) -> None: + """Type check a for statement.""" + if s.is_async: + iterator_type, item_type = self.analyze_async_iterable_item_type(s.expr) + else: + iterator_type, item_type = self.analyze_iterable_item_type(s.expr) + s.inferred_item_type = item_type + s.inferred_iterator_type = iterator_type + + self.accept_loop( + s.body, + s.else_body, + on_enter_body=lambda: self.analyze_index_variables( + s.index, item_type, s.index_type is None, s + ), + ) + + def analyze_async_iterable_item_type(self, expr: Expression) -> tuple[Type, Type]: + """Analyse async iterable expression and return iterator and iterator item types.""" + echk = self.expr_checker + iterable = echk.accept(expr) + iterator = echk.check_method_call_by_name("__aiter__", iterable, [], [], expr)[0] + awaitable = echk.check_method_call_by_name("__anext__", iterator, [], [], expr)[0] + item_type = echk.check_awaitable_expr( + awaitable, expr, message_registry.INCOMPATIBLE_TYPES_IN_ASYNC_FOR + ) + return iterator, item_type + + def analyze_iterable_item_type(self, expr: Expression) -> tuple[Type, Type]: + """Analyse iterable expression and return iterator and iterator item types.""" + iterator, iterable = self.analyze_iterable_item_type_without_expression( + self.expr_checker.accept(expr), context=expr + ) + int_type = self.analyze_range_native_int_type(expr) + if int_type: + return iterator, int_type + return iterator, iterable + + def analyze_iterable_item_type_without_expression( + self, type: Type, context: Context + ) -> tuple[Type, Type]: + """Analyse iterable type and return iterator and iterator item types.""" + echk = self.expr_checker + iterable: Type + iterable = get_proper_type(type) + iterator = echk.check_method_call_by_name("__iter__", iterable, [], [], context)[0] + + if ( + isinstance(iterable, TupleType) + and iterable.partial_fallback.type.fullname == "builtins.tuple" + ): + return iterator, tuple_fallback(iterable).args[0] + else: + # Non-tuple iterable. + iterable = echk.check_method_call_by_name("__next__", iterator, [], [], context)[0] + return iterator, iterable + + def analyze_range_native_int_type(self, expr: Expression) -> Type | None: + """Try to infer native int item type from arguments to range(...). + + For example, return i64 if the expression is "range(0, i64(n))". + + Return None if unsuccessful. + """ + if ( + isinstance(expr, CallExpr) + and isinstance(expr.callee, RefExpr) + and expr.callee.fullname == "builtins.range" + and 1 <= len(expr.args) <= 3 + and all(kind == ARG_POS for kind in expr.arg_kinds) + ): + native_int: Type | None = None + ok = True + for arg in expr.args: + argt = get_proper_type(self.lookup_type(arg)) + if isinstance(argt, Instance) and argt.type.fullname in MYPYC_NATIVE_INT_NAMES: + if native_int is None: + native_int = argt + elif argt != native_int: + ok = False + if ok and native_int: + return native_int + return None + + def analyze_container_item_type(self, typ: Type) -> Type | None: + """Check if a type is a nominal container of a union of such. + + Return the corresponding container item type. + """ + typ = get_proper_type(typ) + if isinstance(typ, UnionType): + types: list[Type] = [] + for item in typ.items: + c_type = self.analyze_container_item_type(item) + if c_type: + types.append(c_type) + return UnionType.make_union(types) + if isinstance(typ, Instance) and typ.type.has_base("typing.Container"): + supertype = self.named_type("typing.Container").type + super_instance = map_instance_to_supertype(typ, supertype) + assert len(super_instance.args) == 1 + return super_instance.args[0] + if isinstance(typ, TupleType): + return self.analyze_container_item_type(tuple_fallback(typ)) + return None + + def analyze_index_variables( + self, index: Expression, item_type: Type, infer_lvalue_type: bool, context: Context + ) -> None: + """Type check or infer for loop or list comprehension index vars.""" + self.check_assignment(index, self.temp_node(item_type, context), infer_lvalue_type) + + def visit_del_stmt(self, s: DelStmt) -> None: + if isinstance(s.expr, IndexExpr): + e = s.expr + m = MemberExpr(e.base, "__delitem__") + m.line = s.line + m.column = s.column + c = CallExpr(m, [e.index], [nodes.ARG_POS], [None]) + c.line = s.line + c.column = s.column + self.expr_checker.accept(c, allow_none_return=True) + else: + s.expr.accept(self.expr_checker) + for elt in flatten(s.expr): + if isinstance(elt, NameExpr): + self.binder.assign_type( + elt, DeletedType(source=elt.name), get_declaration(elt) + ) + + def visit_decorator(self, e: Decorator) -> None: + for d in e.decorators: + if isinstance(d, RefExpr): + if d.fullname == "typing.no_type_check": + e.var.type = AnyType(TypeOfAny.special_form) + e.var.is_ready = True + return + self.visit_decorator_inner(e) + + def visit_decorator_inner( + self, e: Decorator, allow_empty: bool = False, skip_first_item: bool = False + ) -> None: + if self.recurse_into_functions or e.func.def_or_infer_vars: + with self.tscope.function_scope(e.func), self.set_recurse_into_functions(): + self.check_func_item(e.func, name=e.func.name, allow_empty=allow_empty) + + # Process decorators from the inside out to determine decorated signature, which + # may be different from the declared signature. + sig: Type = self.function_type(e.func) + non_trivial_decorator = False + # For settable properties skip the first decorator (that is @foo.setter). + for d in reversed(e.decorators[1:] if skip_first_item else e.decorators): + if refers_to_fullname(d, "abc.abstractmethod"): + # This is a hack to avoid spurious errors because of incomplete type + # of @abstractmethod in the test fixtures. + continue + if refers_to_fullname(d, OVERLOAD_NAMES): + if not allow_empty: + self.fail(message_registry.MULTIPLE_OVERLOADS_REQUIRED, e) + continue + non_trivial_decorator = True + dec = self.expr_checker.accept(d) + temp = self.temp_node(sig, context=d) + fullname = None + if isinstance(d, RefExpr): + fullname = d.fullname or None + # if this is an expression like @b.a where b is an object, get the type of b, + # so we can pass it the method hook in the plugins + object_type: Type | None = None + if fullname is None and isinstance(d, MemberExpr) and self.has_type(d.expr): + object_type = self.lookup_type(d.expr) + fullname = self.expr_checker.method_fullname(object_type, d.name) + self.check_for_untyped_decorator(e.func, dec, d) + sig, t2 = self.expr_checker.check_call( + dec, [temp], [nodes.ARG_POS], e, callable_name=fullname, object_type=object_type + ) + if non_trivial_decorator: + self.check_untyped_after_decorator(sig, e.func) + self.require_correct_self_argument(sig, e.func) + sig = set_callable_name(sig, e.func) + if isinstance(sig, CallableType): + sig.definition = e + e.var.type = sig + e.var.is_ready = True + if e.func.is_property: + if isinstance(sig, CallableType): + if len([k for k in sig.arg_kinds if k.is_required()]) > 1: + self.msg.fail("Too many arguments for property", e) + self.check_incompatible_property_override(e) + # For overloaded functions/properties we already checked override for overload as a whole. + if allow_empty or skip_first_item: + return + if e.func.info and not e.is_overload: + found_method_base_classes = self.check_method_override(e) + if ( + e.func.is_explicit_override + and not found_method_base_classes + and found_method_base_classes is not None + # If the class has Any fallback, we can't be certain that a method + # is really missing - it might come from unfollowed import. + and not e.func.info.fallback_to_any + ): + self.msg.no_overridable_method(e.func.name, e.func) + self.check_explicit_override_decorator(e.func, found_method_base_classes) + + if e.func.info and e.func.name in ("__init__", "__new__"): + if e.type and not isinstance(get_proper_type(e.type), (FunctionLike, AnyType)): + self.fail(message_registry.BAD_CONSTRUCTOR_TYPE, e) + + if e.func.original_def and isinstance(sig, FunctionLike): + # Function definition overrides function definition. + self.check_func_def_override(e.func, sig) + + def check_for_untyped_decorator( + self, func: FuncDef, dec_type: Type, dec_expr: Expression + ) -> None: + if ( + self.options.disallow_untyped_decorators + and is_typed_callable(func.type) + and is_untyped_decorator(dec_type) + and not self.current_node_deferred + ): + self.msg.typed_function_untyped_decorator(func.name, dec_expr) + + def check_incompatible_property_override(self, e: Decorator) -> None: + if not e.var.is_settable_property and e.func.info: + name = e.func.name + for base in e.func.info.mro[1:]: + base_attr = base.names.get(name) + if not base_attr: + continue + if ( + isinstance(base_attr.node, OverloadedFuncDef) + and base_attr.node.is_property + and cast(Decorator, base_attr.node.items[0]).var.is_settable_property + ): + self.fail(message_registry.READ_ONLY_PROPERTY_OVERRIDES_READ_WRITE, e) + + def visit_with_stmt(self, s: WithStmt) -> None: + exceptions_maybe_suppressed = False + for expr, target in zip(s.expr, s.target): + if s.is_async: + exit_ret_type = self.check_async_with_item(expr, target, s.unanalyzed_type is None) + else: + exit_ret_type = self.check_with_item(expr, target, s.unanalyzed_type is None) + + # Based on the return type, determine if this context manager 'swallows' + # exceptions or not. We determine this using a heuristic based on the + # return type of the __exit__ method -- see the discussion in + # https://github.com/python/mypy/issues/7214 and the section about context managers + # in https://github.com/python/typeshed/blob/main/CONTRIBUTING.md#conventions + # for more details. + + exit_ret_type = get_proper_type(exit_ret_type) + if is_literal_type(exit_ret_type, "builtins.bool", False): + continue + + if is_literal_type(exit_ret_type, "builtins.bool", True) or ( + isinstance(exit_ret_type, Instance) + and exit_ret_type.type.fullname == "builtins.bool" + and state.strict_optional + ): + # Note: if strict-optional is disabled, this bool instance + # could actually be an Optional[bool]. + exceptions_maybe_suppressed = True + + if exceptions_maybe_suppressed: + # Treat this 'with' block in the same way we'd treat a 'try: BODY; except: pass' + # block. This means control flow can continue after the 'with' even if the 'with' + # block immediately returns. + with self.binder.frame_context(can_skip=True, try_frame=True): + self.accept(s.body) + else: + self.accept(s.body) + + def check_untyped_after_decorator(self, typ: Type, func: FuncDef) -> None: + if not self.options.disallow_any_decorated or self.is_stub or self.current_node_deferred: + return + + if mypy.checkexpr.has_any_type(typ): + self.msg.untyped_decorated_function(typ, func) + + def check_async_with_item( + self, expr: Expression, target: Expression | None, infer_lvalue_type: bool + ) -> Type: + echk = self.expr_checker + ctx = echk.accept(expr) + obj = echk.check_method_call_by_name("__aenter__", ctx, [], [], expr)[0] + obj = echk.check_awaitable_expr( + obj, expr, message_registry.INCOMPATIBLE_TYPES_IN_ASYNC_WITH_AENTER + ) + if target: + self.check_assignment(target, self.temp_node(obj, expr), infer_lvalue_type) + arg = self.temp_node(AnyType(TypeOfAny.special_form), expr) + res, _ = echk.check_method_call_by_name( + "__aexit__", ctx, [arg] * 3, [nodes.ARG_POS] * 3, expr + ) + return echk.check_awaitable_expr( + res, expr, message_registry.INCOMPATIBLE_TYPES_IN_ASYNC_WITH_AEXIT + ) + + def check_with_item( + self, expr: Expression, target: Expression | None, infer_lvalue_type: bool + ) -> Type: + echk = self.expr_checker + ctx = echk.accept(expr) + obj = echk.check_method_call_by_name("__enter__", ctx, [], [], expr)[0] + if target: + self.check_assignment(target, self.temp_node(obj, expr), infer_lvalue_type) + arg = self.temp_node(AnyType(TypeOfAny.special_form), expr) + res, _ = echk.check_method_call_by_name( + "__exit__", ctx, [arg] * 3, [nodes.ARG_POS] * 3, expr + ) + return res + + def visit_break_stmt(self, s: BreakStmt) -> None: + self.binder.handle_break() + + def visit_continue_stmt(self, s: ContinueStmt) -> None: + self.binder.handle_continue() + return + + def visit_match_stmt(self, s: MatchStmt) -> None: + # In sync with similar actions elsewhere, narrow the target if + # we are matching an AssignmentExpr + unwrapped_subject = collapse_walrus(s.subject) + named_subject = self._make_named_statement_for_match(s, unwrapped_subject) + with self.binder.frame_context(can_skip=False, fall_through=0): + subject_type = get_proper_type(self.expr_checker.accept(s.subject)) + + if isinstance(subject_type, DeletedType): + self.msg.deleted_as_rvalue(subject_type, s) + + # We infer types of patterns twice. The first pass is used + # to infer the types of capture variables. The type of a + # capture variable may depend on multiple patterns (it + # will be a union of all capture types). This pass ignores + # guard expressions. + pattern_types = [self.pattern_checker.accept(p, subject_type) for p in s.patterns] + type_maps: list[TypeMap] = [t.captures for t in pattern_types] + inferred_types = self.infer_variable_types_from_type_maps(type_maps) + + # The second pass narrows down the types and type checks bodies. + unmatched_types: TypeMap = {s.subject: UninhabitedType()} + for p, g, b in zip(s.patterns, s.guards, s.bodies): + current_subject_type = self.expr_checker.narrow_type_from_binder( + named_subject, subject_type + ) + pattern_type = self.pattern_checker.accept(p, current_subject_type) + with self.binder.frame_context(can_skip=True, fall_through=2): + pattern_map, else_map = conditional_types_to_typemaps( + named_subject, pattern_type.type, pattern_type.rest_type + ) + # Maybe the subject type can be inferred from constraints on + # its attribute/item? + if named_subject in pattern_map: + pattern_map[unwrapped_subject] = pattern_map[named_subject] + if named_subject in else_map: + else_map[unwrapped_subject] = else_map[named_subject] + pattern_map = self.propagate_up_typemap_info(pattern_map) + else_map = self.propagate_up_typemap_info(else_map) + self.remove_capture_conflicts(pattern_type.captures, inferred_types) + self.push_type_map(pattern_map, from_assignment=False) + if pattern_map: + for expr, typ in pattern_map.items(): + self.push_type_map( + self._get_recursive_sub_patterns_map(expr, typ), + from_assignment=False, + ) + self.push_type_map(pattern_type.captures, from_assignment=False) + if g is not None: + with self.binder.frame_context(can_skip=False, fall_through=3): + gt = get_proper_type(self.expr_checker.accept(g)) + + if isinstance(gt, DeletedType): + self.msg.deleted_as_rvalue(gt, s) + + guard_map, guard_else_map = self.find_isinstance_check(g) + else_map = or_conditional_maps(else_map, guard_else_map) + + # If the guard narrowed the subject, copy the narrowed types over + if isinstance(p, AsPattern): + case_target = p.pattern or p.name + if isinstance(case_target, NameExpr): + for type_map in (guard_map, else_map): + for expr in list(type_map): + if not ( + isinstance(expr, NameExpr) + and expr.fullname == case_target.fullname + ): + continue + type_map[named_subject] = type_map[expr] + + self.push_type_map(guard_map, from_assignment=False) + self.accept(b) + else: + self.accept(b) + self.push_type_map(else_map, from_assignment=False) + unmatched_types = else_map + + if not is_unreachable_map(unmatched_types) and not self.current_node_deferred: + for typ in unmatched_types.values(): + self.msg.match_statement_inexhaustive_match(typ, s) + + # This is needed due to a quirk in frame_context. Without it types will stay narrowed + # after the match. + with self.binder.frame_context(can_skip=False, fall_through=2): + pass + + def _make_named_statement_for_match(self, s: MatchStmt, subject: Expression) -> Expression: + """Construct a fake NameExpr for inference if a match clause is complex.""" + if self.binder.can_put_directly(subject): + # Already named - we should infer type of it as given + return subject + elif s.subject_dummy is not None: + return s.subject_dummy + else: + # Create a dummy subject expression to handle cases where a match statement's subject + # is not a literal value. This lets us correctly narrow types and check exhaustivity + # This is hack! + name = self.new_unique_dummy_name("match") + v = Var(name) + named_subject = NameExpr(name) + named_subject.node = v + s.subject_dummy = named_subject + return named_subject + + def _get_recursive_sub_patterns_map( + self, expr: Expression, typ: Type + ) -> dict[Expression, Type]: + sub_patterns_map: dict[Expression, Type] = {} + typ_ = get_proper_type(typ) + if isinstance(expr, TupleExpr) and isinstance(typ_, TupleType): + # When matching a tuple expression with a sequence pattern, narrow individual tuple items + assert len(expr.items) == len(typ_.items) + for item_expr, item_typ in zip(expr.items, typ_.items): + sub_patterns_map[item_expr] = item_typ + sub_patterns_map.update(self._get_recursive_sub_patterns_map(item_expr, item_typ)) + + return sub_patterns_map + + def infer_variable_types_from_type_maps( + self, type_maps: list[TypeMap] + ) -> dict[SymbolNode, Type]: + # Type maps may contain variables inherited from previous code which are not + # necessary `Var`s (e.g. a function defined earlier with the same name). + all_captures: dict[SymbolNode, list[tuple[NameExpr, Type]]] = defaultdict(list) + for tm in type_maps: + if not is_unreachable_map(tm): + for expr, typ in tm.items(): + if isinstance(expr, NameExpr): + node = expr.node + assert node is not None + all_captures[node].append((expr, typ)) + + inferred_types: dict[SymbolNode, Type] = {} + for var, captures in all_captures.items(): + already_exists = False + types: list[Type] = [] + for expr, typ in captures: + types.append(typ) + + previous_type, _, _ = self.check_lvalue(expr) + if previous_type is not None: + already_exists = True + if isinstance(expr.node, Var) and expr.node.is_final: + self.msg.cant_assign_to_final(expr.name, False, expr) + if self.check_subtype( + typ, + previous_type, + expr, + msg=message_registry.INCOMPATIBLE_TYPES_IN_CAPTURE, + subtype_label="pattern captures type", + supertype_label="variable has type", + ): + inferred_types[var] = previous_type + + if not already_exists: + new_type = UnionType.make_union(types) + # Infer the union type at the first occurrence + first_occurrence, _ = captures[0] + # If it didn't exist before ``match``, it's a Var. + assert isinstance(var, Var) + inferred_types[var] = new_type + self.infer_variable_type(var, first_occurrence, new_type, first_occurrence) + return inferred_types + + def remove_capture_conflicts( + self, type_map: TypeMap, inferred_types: dict[SymbolNode, Type] + ) -> None: + if not is_unreachable_map(type_map): + for expr, typ in list(type_map.items()): + if isinstance(expr, NameExpr): + node = expr.node + if node not in inferred_types or not is_subtype(typ, inferred_types[node]): + del type_map[expr] + + def visit_type_alias_stmt(self, o: TypeAliasStmt) -> None: + if o.alias_node: + self.check_typevar_defaults(o.alias_node.alias_tvars) + + with self.msg.filter_errors(): + self.expr_checker.accept(o.value) + + def make_fake_typeinfo( + self, + curr_module_fullname: str, + class_gen_name: str, + class_short_name: str, + bases: list[Instance], + ) -> tuple[ClassDef, TypeInfo]: + # Build the fake ClassDef and TypeInfo together. + # The ClassDef is full of lies and doesn't actually contain a body. + # Use format_bare to generate a nice name for error messages. + # We skip fully filling out a handful of TypeInfo fields because they + # should be irrelevant for a generated type like this: + # is_protocol, protocol_members, is_abstract + cdef = ClassDef(class_short_name, Block([])) + cdef.fullname = curr_module_fullname + "." + class_gen_name + info = TypeInfo(SymbolTable(), cdef, curr_module_fullname) + cdef.info = info + info.bases = bases + calculate_mro(info) + info.metaclass_type = info.calculate_metaclass_type() + return cdef, info + + def intersect_instances( + self, instances: tuple[Instance, Instance], errors: list[tuple[str, str]] + ) -> Instance | None: + """Try creating an ad-hoc intersection of the given instances. + + Note that this function does *not* try and create a full-fledged + intersection type. Instead, it returns an instance of a new ad-hoc + subclass of the given instances. + + This is mainly useful when you need a way of representing some + theoretical subclass of the instances the user may be trying to use + the generated intersection can serve as a placeholder. + + This function will create a fresh subclass the first time you call it. + So this means calling `self.intersect_intersection([inst_1, inst_2], ctx)` + twice will return the same subclass of inst_1 and inst_2. + + Returns None if creating the subclass is impossible (e.g. due to + MRO errors or incompatible signatures). If we do successfully create + a subclass, its TypeInfo will automatically be added to the global scope. + """ + curr_module = self.scope.stack[0] + assert isinstance(curr_module, MypyFile) + + # First, retry narrowing while allowing promotions (they are disabled by default + # for isinstance() checks, etc). This way we will still type-check branches like + # x: complex = 1 + # if isinstance(x, int): + # ... + left, right = instances + if is_proper_subtype(left, right, ignore_promotions=False): + return left + if is_proper_subtype(right, left, ignore_promotions=False): + return right + + def _get_base_classes(instances_: tuple[Instance, Instance]) -> list[Instance]: + base_classes_ = [] + for inst in instances_: + if inst.type.is_intersection: + expanded = inst.type.bases + else: + expanded = [inst] + + for expanded_inst in expanded: + base_classes_.append(expanded_inst) + return base_classes_ + + def _make_fake_typeinfo_and_full_name( + base_classes_: list[Instance], curr_module_: MypyFile, options: Options + ) -> tuple[TypeInfo, str]: + names = [format_type_bare(x, options=options, verbosity=2) for x in base_classes_] + name = f"" + if (symbol := curr_module_.names.get(name)) is not None: + assert isinstance(symbol.node, TypeInfo) + return symbol.node, name + cdef, info_ = self.make_fake_typeinfo(curr_module_.fullname, name, name, base_classes_) + return info_, name + + base_classes = _get_base_classes(instances) + # We use the pretty_names_list for error messages but for the real name that goes + # into the symbol table because it is not specific enough. + pretty_names_list = pretty_seq( + format_type_distinctly(*base_classes, options=self.options, bare=True), "and" + ) + + if not can_have_shared_disjoint_base(base_classes): + errors.append((pretty_names_list, "have distinct disjoint bases")) + return None + + new_errors = [] + for base in base_classes: + if base.type.is_final: + new_errors.append((pretty_names_list, f'"{base.type.name}" is final')) + if new_errors: + errors.extend(new_errors) + return None + + try: + info, full_name = _make_fake_typeinfo_and_full_name( + base_classes, curr_module, self.options + ) + with self.msg.filter_errors() as local_errors: + self.check_multiple_inheritance(info) + if local_errors.has_new_errors(): + # "class A(B, C)" unsafe, now check "class A(C, B)": + base_classes = _get_base_classes(instances[::-1]) + info, full_name = _make_fake_typeinfo_and_full_name( + base_classes, curr_module, self.options + ) + with self.msg.filter_errors() as local_errors: + self.check_multiple_inheritance(info) + info.is_intersection = True + except MroError: + errors.append((pretty_names_list, "would have inconsistent method resolution order")) + return None + if local_errors.has_new_errors(): + errors.append((pretty_names_list, "would have incompatible method signatures")) + return None + + curr_module.names[full_name] = SymbolTableNode(GDEF, info, False, module_hidden=True) + return Instance(info, [], extra_attrs=instances[0].extra_attrs or instances[1].extra_attrs) + + def intersect_instance_callable(self, typ: Instance, callable_type: CallableType) -> Instance: + """Creates a fake type that represents the intersection of an Instance and a CallableType. + + It operates by creating a bare-minimum dummy TypeInfo that + subclasses type and adds a __call__ method matching callable_type. + """ + + # In order for this to work in incremental mode, the type we generate needs to + # have a valid fullname and a corresponding entry in a symbol table. We generate + # a unique name inside the symbol table of the current module. + cur_module = self.scope.stack[0] + assert isinstance(cur_module, MypyFile) + gen_name = gen_unique_name(f"", cur_module.names) + + # Synthesize a fake TypeInfo + short_name = format_type_bare(typ, self.options) + cdef, info = self.make_fake_typeinfo(cur_module.fullname, gen_name, short_name, [typ]) + + # Build up a fake FuncDef so we can populate the symbol table. + func_def = FuncDef("__call__", [], Block([]), callable_type) + func_def._fullname = cdef.fullname + ".__call__" + func_def.info = info + info.names["__call__"] = SymbolTableNode(MDEF, func_def) + + cur_module.names[gen_name] = SymbolTableNode(GDEF, info) + + return Instance(info, [], extra_attrs=typ.extra_attrs) + + def make_fake_callable(self, typ: Instance) -> Instance: + """Produce a new type that makes type Callable with a generic callable type.""" + + fallback = self.named_type("builtins.function") + callable_type = CallableType( + [AnyType(TypeOfAny.explicit), AnyType(TypeOfAny.explicit)], + [nodes.ARG_STAR, nodes.ARG_STAR2], + [None, None], + ret_type=AnyType(TypeOfAny.explicit), + fallback=fallback, + is_ellipsis_args=True, + ) + + return self.intersect_instance_callable(typ, callable_type) + + def partition_by_callable( + self, typ: Type, unsound_partition: bool + ) -> tuple[list[Type], list[Type]]: + """Partitions a type into callable subtypes and uncallable subtypes. + + Thus, given: + `callables, uncallables = partition_by_callable(type)` + + If we assert `callable(type)` then `type` has type Union[*callables], and + If we assert `not callable(type)` then `type` has type Union[*uncallables] + + If unsound_partition is set, assume that anything that is not + clearly callable is in fact not callable. Otherwise we generate a + new subtype that *is* callable. + + Guaranteed to not return [], []. + """ + typ = get_proper_type(typ) + + if isinstance(typ, (FunctionLike, TypeType)): + return [typ], [] + + if isinstance(typ, AnyType): + return [typ], [typ] + + if isinstance(typ, NoneType): + return [], [typ] + + if isinstance(typ, UnionType): + callables = [] + uncallables: list[Type] = [] + for subtype in typ.items: + # Use unsound_partition when handling unions in order to + # allow the expected type discrimination. + subcallables, subuncallables = self.partition_by_callable( + subtype, unsound_partition=True + ) + callables.extend(subcallables) + uncallables.extend(subuncallables) + return callables, uncallables + + if isinstance(typ, TypeVarType): + # We could do better probably? + # Refine the type variable's bound as our type in the case that + # callable() is true. This unfortunately loses the information that + # the type is a type variable in that branch. + # This matches what is done for isinstance, but it may be possible to + # do better. + # If it is possible for the false branch to execute, return the original + # type to avoid losing type information. + callables, uncallables = self.partition_by_callable( + erase_to_union_or_bound(typ), unsound_partition + ) + uncallables = [typ] if uncallables else [] + return callables, uncallables + + # A TupleType is callable if its fallback is, but needs special handling + # when we dummy up a new type. + ityp = typ + if isinstance(typ, TupleType): + ityp = tuple_fallback(typ) + + if isinstance(ityp, Instance): + method = ityp.type.get_method("__call__") + if method and method.type: + callables, uncallables = self.partition_by_callable( + method.type, unsound_partition=False + ) + if callables and not uncallables: + # Only consider the type callable if its __call__ method is + # definitely callable. + return [typ], [] + + if not unsound_partition: + fake = self.make_fake_callable(ityp) + if isinstance(typ, TupleType): + fake.type.tuple_type = TupleType(typ.items, fake) + return [fake.type.tuple_type], [typ] + return [fake], [typ] + + if unsound_partition: + return [], [typ] + else: + # We don't know how properly make the type callable. + return [typ], [typ] + + def conditional_callable_type_map( + self, expr: Expression, current_type: Type | None + ) -> tuple[TypeMap, TypeMap]: + """Takes in an expression and the current type of the expression. + + Returns a 2-tuple: The first element is a map from the expression to + the restricted type if it were callable. The second element is a + map from the expression to the type it would hold if it weren't + callable. + """ + if not current_type: + return {}, {} + + if isinstance(get_proper_type(current_type), AnyType): + return {}, {} + + callables, uncallables = self.partition_by_callable(current_type, unsound_partition=False) + + if callables and uncallables: + callable_map = {expr: UnionType.make_union(callables)} + uncallable_map = {expr: UnionType.make_union(uncallables)} + return callable_map, uncallable_map + + elif callables: + return {}, {expr: UninhabitedType()} + + return {expr: UninhabitedType()}, {} + + def conditional_types_for_iterable( + self, item_type: Type, iterable_type: Type + ) -> tuple[Type, Type]: + """ + Narrows the type of `iterable_type` based on the type of `item_type`. + For now, we only support narrowing unions of TypedDicts based on left operand being literal string(s). + """ + if_types: list[Type] = [] + else_types: list[Type] = [] + + iterable_type = get_proper_type(iterable_type) + if isinstance(iterable_type, UnionType): + possible_iterable_types = get_proper_types(iterable_type.relevant_items()) + else: + possible_iterable_types = [iterable_type] + + item_str_literals = try_getting_str_literals_from_type(item_type) + + for possible_iterable_type in possible_iterable_types: + if item_str_literals and isinstance(possible_iterable_type, TypedDictType): + for key in item_str_literals: + if key in possible_iterable_type.required_keys: + if_types.append(possible_iterable_type) + elif ( + key in possible_iterable_type.items or not possible_iterable_type.is_final + ): + if_types.append(possible_iterable_type) + else_types.append(possible_iterable_type) + else: + else_types.append(possible_iterable_type) + else: + if_types.append(possible_iterable_type) + else_types.append(possible_iterable_type) + + return UnionType.make_union(if_types), UnionType.make_union(else_types) + + def _is_truthy_type(self, t: ProperType) -> bool: + return ( + ( + isinstance(t, Instance) + and bool(t.type) + and not t.type.has_readable_member("__bool__") + and not t.type.has_readable_member("__len__") + and t.type.fullname != "builtins.object" + ) + or isinstance(t, FunctionLike) + or ( + isinstance(t, UnionType) + and all(self._is_truthy_type(t) for t in get_proper_types(t.items)) + ) + ) + + def check_for_truthy_type(self, t: Type, expr: Expression) -> None: + """ + Check if a type can have a truthy value. + + Used in checks like:: + + if x: # <--- + + not x # <--- + """ + if not state.strict_optional: + return # if everything can be None, all bets are off + + t = get_proper_type(t) + if not self._is_truthy_type(t): + return + + def format_expr_type() -> str: + typ = format_type(t, self.options) + if isinstance(expr, MemberExpr): + return f'Member "{expr.name}" has type {typ}' + elif isinstance(expr, RefExpr) and expr.fullname: + return f'"{expr.fullname}" has type {typ}' + elif isinstance(expr, CallExpr): + if isinstance(expr.callee, MemberExpr): + return f'"{expr.callee.name}" returns {typ}' + elif isinstance(expr.callee, RefExpr) and expr.callee.fullname: + return f'"{expr.callee.fullname}" returns {typ}' + return f"Call returns {typ}" + else: + return f"Expression has type {typ}" + + def get_expr_name() -> str: + if isinstance(expr, (NameExpr, MemberExpr)): + return f'"{expr.name}"' + else: + # return type if expr has no name + return format_type(t, self.options) + + if isinstance(t, FunctionLike): + self.fail(message_registry.FUNCTION_ALWAYS_TRUE.format(get_expr_name()), expr) + elif isinstance(t, UnionType): + self.fail(message_registry.TYPE_ALWAYS_TRUE_UNIONTYPE.format(format_expr_type()), expr) + elif isinstance(t, Instance) and t.type.fullname == "typing.Iterable": + _, info = self.make_fake_typeinfo("typing", "Collection", "Collection", []) + self.fail( + message_registry.ITERABLE_ALWAYS_TRUE.format( + format_expr_type(), format_type(Instance(info, t.args), self.options) + ), + expr, + ) + else: + self.fail(message_registry.TYPE_ALWAYS_TRUE.format(format_expr_type()), expr) + + def find_isinstance_check( + self, node: Expression, *, in_boolean_context: bool = True + ) -> tuple[TypeMap, TypeMap]: + """Find any isinstance checks (within a chain of ands). Includes + implicit and explicit checks for None and calls to callable. + Also includes TypeGuard and TypeIs functions. + + Return value is a map of variables to their types if the condition + is true and a map of variables to their types if the condition is false. + + If either of the values in the tuple is None, then that particular + branch can never occur. + + If `in_boolean_context=True` is passed, it means that we handle + a walrus expression. We treat rhs values + in expressions like `(a := A())` specially: + for example, some errors are suppressed. + + May return {}, {}. + Can return None, None in situations involving NoReturn. + """ + if_map, else_map = self.find_isinstance_check_helper( + node, in_boolean_context=in_boolean_context + ) + new_if_map = self.propagate_up_typemap_info(if_map) + new_else_map = self.propagate_up_typemap_info(else_map) + return new_if_map, new_else_map + + def find_isinstance_check_helper( + self, node: Expression, *, in_boolean_context: bool = True + ) -> tuple[TypeMap, TypeMap]: + if is_true_literal(node): + return {}, {node: UninhabitedType()} + if is_false_literal(node): + return {node: UninhabitedType()}, {} + + if isinstance(node, CallExpr) and len(node.args) != 0: + expr = collapse_walrus(node.args[0]) + if refers_to_fullname(node.callee, "builtins.isinstance"): + if len(node.args) != 2: # the error will be reported elsewhere + return {}, {} + if literal(expr) == LITERAL_TYPE: + return conditional_types_to_typemaps( + expr, + *self.conditional_types_with_intersection( + self.lookup_type(expr), self.get_isinstance_type(node.args[1]), expr + ), + ) + elif refers_to_fullname(node.callee, "builtins.issubclass"): + if len(node.args) != 2: # the error will be reported elsewhere + return {}, {} + if literal(expr) == LITERAL_TYPE: + return self.infer_issubclass_maps(node, expr) + elif refers_to_fullname(node.callee, "builtins.callable"): + if len(node.args) != 1: # the error will be reported elsewhere + return {}, {} + if literal(expr) == LITERAL_TYPE: + vartype = self.lookup_type(expr) + return self.conditional_callable_type_map(expr, vartype) + elif refers_to_fullname(node.callee, "builtins.hasattr"): + if len(node.args) != 2: # the error will be reported elsewhere + return {}, {} + attr = try_getting_str_literals(node.args[1], self.lookup_type(node.args[1])) + if literal(expr) == LITERAL_TYPE and attr and len(attr) == 1: + return self.hasattr_type_maps(expr, self.lookup_type(expr), attr[0]) + else: + type_is, type_guard = None, None + called_type = self.lookup_type_or_none(node.callee) + if called_type is not None: + called_type = get_proper_type(called_type) + # TODO: there are some more cases in check_call() to handle. + # If the callee is an instance, try to extract TypeGuard/TypeIs from its __call__ method. + if isinstance(called_type, Instance): + call = find_member("__call__", called_type, called_type, is_operator=True) + if call is not None: + called_type = get_proper_type(call) + if isinstance(called_type, CallableType): + type_is, type_guard = called_type.type_is, called_type.type_guard + + # If the callee is a RefExpr, extract TypeGuard/TypeIs directly. + if isinstance(node.callee, RefExpr): + type_is, type_guard = node.callee.type_is, node.callee.type_guard + if type_guard is not None or type_is is not None: + # TODO: Follow *args, **kwargs + if node.arg_kinds[0] != nodes.ARG_POS: + # *assuming* the overloaded function is correct, there's a couple cases: + # 1) The first argument has different names, but is pos-only. We don't + # care about this case, the argument must be passed positionally. + # 2) The first argument allows keyword reference, therefore must be the + # same between overloads. + if isinstance(called_type, (CallableType, Overloaded)): + name = called_type.items[0].arg_names[0] + if name in node.arg_names: + idx = node.arg_names.index(name) + # we want the idx-th variable to be narrowed + expr = collapse_walrus(node.args[idx]) + else: + kind = "guard" if type_guard is not None else "narrower" + self.fail( + message_registry.TYPE_GUARD_POS_ARG_REQUIRED.format(kind), node + ) + return {}, {} + if literal(expr) == LITERAL_TYPE: + # Note: we wrap the target type, so that we can special case later. + # Namely, for isinstance() we use a normal meet, while TypeGuard is + # considered "always right" (i.e. even if the types are not overlapping). + # Also note that a care must be taken to unwrap this back at read places + # where we use this to narrow down declared type. + if type_guard is not None: + return {expr: TypeGuardedType(type_guard)}, {} + else: + assert type_is is not None + return conditional_types_to_typemaps( + expr, + *self.conditional_types_with_intersection( + self.lookup_type(expr), + [TypeRange(type_is, is_upper_bound=False)], + expr, + consider_runtime_isinstance=False, + ), + ) + elif isinstance(node, ComparisonExpr): + return self.comparison_type_narrowing_helper(node) + elif isinstance(node, AssignmentExpr): + if_map: TypeMap + else_map: TypeMap + if_map = {} + else_map = {} + + if_assignment_map, else_assignment_map = self.find_isinstance_check(node.target) + if_map.update(if_assignment_map) + else_map.update(else_assignment_map) + + if_condition_map, else_condition_map = self.find_isinstance_check( + node.value, in_boolean_context=False + ) + + if_map.update(if_condition_map) + else_map.update(else_condition_map) + + return if_map, else_map + elif isinstance(node, OpExpr) and node.op == "and": + left_if_vars, left_else_vars = self.find_isinstance_check(node.left) + right_if_vars, right_else_vars = self.find_isinstance_check(node.right) + + # (e1 and e2) is true if both e1 and e2 are true, + # and false if at least one of e1 and e2 is false. + return ( + and_conditional_maps(left_if_vars, right_if_vars), + # Note that if left else type is Any, we can't add any additional + # types to it, since the right maps were computed assuming + # the left is True, which may be not the case in the else branch. + or_conditional_maps(left_else_vars, right_else_vars, coalesce_any=True), + ) + elif isinstance(node, OpExpr) and node.op == "or": + left_if_vars, left_else_vars = self.find_isinstance_check(node.left) + right_if_vars, right_else_vars = self.find_isinstance_check(node.right) + + # (e1 or e2) is true if at least one of e1 or e2 is true, + # and false if both e1 and e2 are false. + return ( + or_conditional_maps(left_if_vars, right_if_vars), + and_conditional_maps(left_else_vars, right_else_vars), + ) + elif isinstance(node, UnaryExpr) and node.op == "not": + left, right = self.find_isinstance_check(node.expr) + return right, left + elif ( + literal(node) == LITERAL_TYPE + and self.has_type(node) + and self.can_be_narrowed_with_len(self.lookup_type(node)) + # Only translate `if x` to `if len(x) > 0` when possible. + and not custom_special_method(self.lookup_type(node), "__bool__") + and self.options.strict_optional + ): + # Combine a `len(x) > 0` check with the default logic below. + yes_type, no_type = self.narrow_with_len(self.lookup_type(node), ">", 0) + if_map = {node: true_only(yes_type)} + else_map = {node: false_only(no_type)} + return if_map, else_map + + # Restrict the type of the variable to True-ish/False-ish in the if and else branches + # respectively + original_vartype = self.lookup_type(node) + if in_boolean_context: + # We don't check `:=` values in expressions like `(a := A())`, + # because they produce two error messages. + self.check_for_truthy_type(original_vartype, node) + vartype = try_expanding_sum_type_to_union(original_vartype, "builtins.bool") + + if_map = {node: true_only(vartype)} + else_map = {node: false_only(vartype)} + return if_map, else_map + + def comparison_type_narrowing_helper(self, node: ComparisonExpr) -> tuple[TypeMap, TypeMap]: + """Infer type narrowing from a comparison expression.""" + # Step 1: Obtain the types of each operand and whether or not we can + # narrow their types. (For example, we shouldn't try narrowing the + # types of literal string or enum expressions). + + operands = [collapse_walrus(x) for x in node.operands] + operand_types = [] + narrowable_operand_index_to_hash = {} + for i, expr in enumerate(operands): + if not self.has_type(expr): + return {}, {} + expr_type = self.lookup_type(expr) + operand_types.append(expr_type) + + if ( + literal(expr) == LITERAL_TYPE + and not is_literal_none(expr) + and not is_literal_not_implemented(expr) + and not is_false_literal(expr) + and not is_true_literal(expr) + and not self.is_literal_enum(expr) + # CallableType type objects are usually already maximally specific + and not ( + isinstance(p_expr := get_proper_type(expr_type), FunctionLike) + and p_expr.is_type_obj() + ) + # This is a little ad hoc, in the absence of intersection types + and not (isinstance(p_expr, TypeType) and isinstance(p_expr.item, TypeVarType)) + ): + h = literal_hash(expr) + if h is not None: + narrowable_operand_index_to_hash[i] = h + + # Step 2: Group operands chained by either the 'is' or '==' operands + # together. For all other operands, we keep them in groups of size 2. + # So the expression: + # + # x0 == x1 == x2 < x3 < x4 is x5 is x6 is not x7 is not x8 + # + # ...is converted into the simplified operator list: + # + # [("==", [0, 1, 2]), ("<", [2, 3]), ("<", [3, 4]), + # ("is", [4, 5, 6]), ("is not", [6, 7]), ("is not", [7, 8])] + # + # We group identity/equality expressions so we can propagate information + # we discover about one operand across the entire chain. We don't bother + # handling 'is not' and '!=' chains in a special way: those are very rare + # in practice. + + simplified_operator_list = group_comparison_operands( + node.pairwise(), narrowable_operand_index_to_hash, {"==", "is"} + ) + + # Step 3: Analyze each group and infer more precise type maps for each + # assignable operand, if possible. We combine these type maps together + # in the final step. + + partial_type_maps = [] + for operator, expr_indices in simplified_operator_list: + if_map: TypeMap + else_map: TypeMap + + if operator in {"is", "is not", "==", "!="}: + if_map, else_map = self.narrow_type_by_identity_equality( + operator, + operands, + operand_types, + expr_indices, + narrowable_indices=narrowable_operand_index_to_hash.keys(), + ) + elif operator in {"in", "not in"}: + assert len(expr_indices) == 2 + left_index, right_index = expr_indices + item_type = operand_types[left_index] + iterable_type = operand_types[right_index] + + if_map = {} + else_map = {} + + if left_index in narrowable_operand_index_to_hash: + collection_item_type = get_proper_type(builtin_item_type(iterable_type)) + if collection_item_type is not None: + if_map, else_map = self.narrow_type_by_identity_equality( + "==", + operands=[operands[left_index], operands[right_index]], + operand_types=[item_type, collection_item_type], + expr_indices=[0, 1], + narrowable_indices={0}, + ) + + # TODO: This remove_optional code should no longer be needed. The only + # thing it does is paper over a pre-existing deficiency in equality + # narrowing w.r.t to enums. + # We only try and narrow away 'None' for now + if ( + not is_unreachable_map(if_map) + and is_overlapping_none(item_type) + and not is_overlapping_none(collection_item_type) + and not ( + isinstance(collection_item_type, Instance) + and collection_item_type.type.fullname == "builtins.object" + ) + and is_overlapping_erased_types(item_type, collection_item_type) + ): + if_map[operands[left_index]] = remove_optional(item_type) + + if right_index in narrowable_operand_index_to_hash: + if_type, else_type = self.conditional_types_for_iterable( + item_type, iterable_type + ) + expr = operands[right_index] + if_map[expr] = if_type + else_map[expr] = else_type + + else: + if_map = {} + else_map = {} + + if operator in {"is not", "!=", "not in"}: + if_map, else_map = else_map, if_map + + partial_type_maps.append((if_map, else_map)) + + # If we have found non-trivial restrictions from the regular comparisons, + # then return soon. Otherwise try to infer restrictions involving `len(x)`. + # TODO: support regular and len() narrowing in the same chain. + if any(len(m[0]) or len(m[1]) for m in partial_type_maps): + return reduce_conditional_maps(partial_type_maps, use_meet=True) + else: + # Use meet for `and` maps to get correct results for chained checks + # like `if 1 < len(x) < 4: ...` + return reduce_conditional_maps(self.find_tuple_len_narrowing(node), use_meet=True) + + def narrow_type_by_identity_equality( + self, + operator: str, + operands: list[Expression], + operand_types: list[Type], + expr_indices: list[int], + narrowable_indices: AbstractSet[int], + ) -> tuple[TypeMap, TypeMap]: + """ + Calculate type maps for '==', '!=', 'is' or 'is not' expression, ignoring `type(x)` checks. + + The 'operands' and 'operand_types' lists should be the full list of operands used + in the overall comparison expression. The 'chain_indices' list is the list of indices + actually used within this identity comparison chain. + + So if we have the expression: + + a <= b is c is d <= e + + ...then 'operands' and 'operand_types' would be lists of length 5 and 'chain_indices' + would be the list [1, 2, 3]. + + The 'narrowable_indices' parameter is the set of all indices we are allowed + to refine the types of: that is, all operands that will potentially be a part of + the output TypeMaps. + + """ + # is_target_for_value_narrowing: + # If the operator returns True when compared to this target, do we narrow in else branch? + # E.g. if operator is "==", then: + # - is_target_for_value_narrowing(str) == False + # - is_target_for_value_narrowing(Literal["asdf"]) == True + is_target_for_value_narrowing: Callable[[ProperType], bool] + + # should_coerce_literals: + # Ideally, we should always attempt to have this set to True. Unfortunately, for now, + # performing this coercion can sometimes result in overly aggressive narrowing when taking + # in the context of other type checker behaviour. + should_coerce_literals: bool + + # custom_eq_indices: + # Operands at these indices define a custom `__eq__`. These can do arbitrary things, so we + # have to be more careful about what narrowing we can conclude from a successful comparison + custom_eq_indices: set[int] + + # enum_comparison_is_ambiguous: + # `if x is Fruits.APPLE` we know `x` is `Fruits.APPLE`, but `if x == Fruits.APPLE: ...` + # it could e.g. be an int or str if Fruits is an IntEnum or StrEnum. + # See ambiguous_enum_equality_keys for more details + enum_comparison_is_ambiguous: bool + + if operator in {"is", "is not"}: + is_target_for_value_narrowing = is_singleton_identity_type + should_coerce_literals = True + custom_eq_indices = set() + enum_comparison_is_ambiguous = False + + elif operator in {"==", "!="}: + is_target_for_value_narrowing = is_singleton_equality_type + + should_coerce_literals = False + for i in expr_indices: + typ = get_proper_type(operand_types[i]) + if is_literal_type_like(typ) or (isinstance(typ, Instance) and typ.type.is_enum): + should_coerce_literals = True + break + + custom_eq_indices = {i for i in expr_indices if has_custom_eq_checks(operand_types[i])} + enum_comparison_is_ambiguous = True + else: + raise AssertionError + + all_if_maps: list[TypeMap] = [] + all_else_maps: list[TypeMap] = [] + + # For each narrowable index, we see what we can narrow based on each relevant target + for i in expr_indices: + if i not in narrowable_indices: + continue + if i in custom_eq_indices: + # Handled later + continue + + expr_type = operand_types[i] + expr_enum_keys = ambiguous_enum_equality_keys(expr_type) + expr_type = try_expanding_sum_type_to_union(coerce_to_literal(expr_type), None) + for j in expr_indices: + if i == j: + continue + if j in custom_eq_indices: + # We can't use types with custom __eq__ as targets for narrowing + # E.g. if (x: int | None) == (y: CustomEq | None), we cannot narrow x to None + continue + target_type = operand_types[j] + if should_coerce_literals: + target_type = coerce_to_literal(target_type) + + if ( + # See comments in ambiguous_enum_equality_keys + enum_comparison_is_ambiguous + and len(expr_enum_keys | ambiguous_enum_equality_keys(target_type)) > 1 + ): + continue + + target = TypeRange(target_type, is_upper_bound=False) + + if_map, else_map = conditional_types_to_typemaps( + operands[i], *conditional_types(expr_type, [target], from_equality=True) + ) + if is_target_for_value_narrowing(get_proper_type(target_type)): + all_if_maps.append(if_map) + all_else_maps.append(else_map) + else: + # For value targets, it is safe to narrow in the negative case. + # e.g. if (x: Literal[5] | None) != (y: Literal[5]), we can narrow x to None + # However, for non-value targets, we cannot do this narrowing, + # and so we ignore else_map + # e.g. if (x: str | None) != (y: str), we cannot narrow x to None + + # It is correct to always narrow here. It improves behaviour on tests and + # detects many inaccurate type annotations on primer. + # However, because mypy does not currently check unreachable code, it feels + # risky to narrow to unreachable without --warn-unreachable or not + # at module level + # See also this specific primer comment, where I force primer to run with + # --warn-unreachable to see what code we would stop checking: + # https://github.com/python/mypy/pull/20660#issuecomment-3865794148 + if ( + self.options.warn_unreachable and len(self.scope.stack) != 1 + ) or not is_unreachable_map(if_map): + all_if_maps.append(if_map) + + # Handle narrowing for operands with custom __eq__ methods specially + # In most cases, we won't be able to do any narrowing + for i in custom_eq_indices: + if i not in narrowable_indices: + continue + union_expr_type = get_proper_type(operand_types[i]) + if not isinstance(union_expr_type, UnionType): + # Here we won't be able to do any positive narrowing, because we can't conclude + # anything from a custom __eq__ returning True. + # But we might be able to do some negative narrowing, since we can assume + # a custom __eq__ is reflexive. This should only apply to custom __eq__ enums, + # see testNarrowingEqualityCustomEqualityEnum + expr_type = operand_types[i] + for j in expr_indices: + if j in custom_eq_indices: + continue + target_type = operand_types[j] + if should_coerce_literals: + target_type = coerce_to_literal(target_type) + target = TypeRange(target_type, is_upper_bound=False) + if is_target_for_value_narrowing(get_proper_type(target_type)): + if_map, else_map = conditional_types_to_typemaps( + operands[i], + *conditional_types(expr_type, [target], from_equality=True), + ) + all_else_maps.append(else_map) + continue + + # If our operand with custom __eq__ is a union, where only some members of the union + # implement custom __eq__, then we can narrow down the other members as usual. + # This is basically the same logic as the main narrowing loop above. + or_if_maps: list[TypeMap] = [] + or_else_maps: list[TypeMap] = [] + for expr_type in union_expr_type.items: + if has_custom_eq_checks(expr_type): + # Always include the union items with custom __eq__ in the type + # we narrow to in the if_map + or_if_maps.append({operands[i]: expr_type}) + + expr_type = coerce_to_literal(try_expanding_sum_type_to_union(expr_type, None)) + for j in expr_indices: + if j in custom_eq_indices: + if i == j: + continue + # If we compare to a target with custom __eq__, we cannot narrow at all + if is_overlapping_none(expr_type) and not is_overlapping_none( + operand_types[j] + ): + # Narrow away from None. This is unsound, we're hoping that no one + # has a custom __eq__ that returns True for None. + or_if_maps.append({operands[i]: remove_optional(expr_type)}) + else: + or_if_maps.append({operands[i]: expr_type}) + continue + target_type = operand_types[j] + if should_coerce_literals: + target_type = coerce_to_literal(target_type) + target = TypeRange(target_type, is_upper_bound=False) + + if_map, else_map = conditional_types_to_typemaps( + operands[i], + *conditional_types( + expr_type, [target], default=expr_type, from_equality=True + ), + ) + or_if_maps.append(if_map) + if is_target_for_value_narrowing(get_proper_type(target_type)): + or_else_maps.append(else_map) + + all_if_maps.append(reduce_or_conditional_type_maps(or_if_maps)) + all_else_maps.append(reduce_or_conditional_type_maps(or_else_maps)) + + # Handle narrowing for comparisons that produce additional narrowing, like + # `type(x) == T` or `x.__class__ is T` + for i in expr_indices: + type_expr = operands[i] + if ( + isinstance(type_expr, CallExpr) + and refers_to_fullname(type_expr.callee, "builtins.type") + and len(type_expr.args) == 1 + ): + expr_in_type_expr = type_expr.args[0] + elif isinstance(type_expr, MemberExpr) and type_expr.name == "__class__": + expr_in_type_expr = type_expr.expr + else: + continue + + p_expr_type = get_proper_type(operand_types[i]) + if isinstance(p_expr_type, TypeType) and isinstance(p_expr_type.item, TypeVarType): + # This mirrors logic in comparison_type_narrowing_helper + # In theory, this is like `i not in narrowable_indices`, except that + # narrowable_indices filters all type(x) narrowing as it's a call + continue + + for j in expr_indices: + if i == j: + continue + expr = operands[j] + + current_type_range = self.get_type_range_of_type(operand_types[j]) + if current_type_range is None: + continue + if isinstance(get_proper_type(current_type_range.item), AnyType): + # Avoid widening to Any for checks like `type(x) is type(y: Any)`. + # We patch this here because it is desirable to widen to any for cases like + # isinstance(x, (y: Any)) + continue + + arg_type = self.lookup_type(expr_in_type_expr) + if_type, else_type = self.conditional_types_with_intersection( + arg_type, [current_type_range], expr_in_type_expr + ) + if if_type is not None and ( + not current_type_range.is_upper_bound + and not is_equivalent(if_type, current_type_range.item) + ): + # type(x) and x.__class__ checks must exact match + if_type = UninhabitedType() + + if_map, else_map = conditional_types_to_typemaps( + expr_in_type_expr, if_type, else_type + ) + + is_final = ( + expr.node.is_final + if isinstance(expr, RefExpr) and isinstance(expr.node, TypeInfo) + else False + ) + all_if_maps.append(if_map) + if is_final: + # We can only narrow `type(x) == T` in the negative case if T is final + all_else_maps.append(else_map) + + # We will not have duplicate entries in our type maps if we only have two operands, + # so we can skip running meets on the intersections + if_map = reduce_and_conditional_type_maps(all_if_maps, use_meet=len(operands) > 2) + else_map = reduce_or_conditional_type_maps(all_else_maps) + return if_map, else_map + + def propagate_up_typemap_info(self, new_types: TypeMap) -> TypeMap: + """Attempts refining parent expressions of any MemberExpr or IndexExprs in new_types. + + This function iterates through new_types and attempts to use the information to try + refining any parent types that happen to be unions. + + For example, suppose there are two types "A = Tuple[int, int]" and "B = Tuple[str, str]". + Next, suppose that 'new_types' specifies the expression 'foo[0]' has a refined type + of 'int' and that 'foo' was previously deduced to be of type Union[A, B]. + + Then, this function will observe that since A[0] is an int and B[0] is not, the type of + 'foo' can be further refined from Union[A, B] into just B. + + We perform this kind of "parent narrowing" for member lookup expressions and indexing + expressions into tuples, namedtuples, and typeddicts. We repeat this narrowing + recursively if the parent is also a "lookup expression". So for example, if we have + the expression "foo['bar'].baz[0]", we'd potentially end up refining types for the + expressions "foo", "foo['bar']", and "foo['bar'].baz". + + We return the newly refined map. This map is guaranteed to be a superset of 'new_types'. + """ + all_mappings = [new_types] + for expr, expr_type in new_types.items(): + all_mappings.append(self.refine_parent_types(expr, expr_type)) + return reduce_and_conditional_type_maps(all_mappings, use_meet=True) + + def refine_parent_types(self, expr: Expression, expr_type: Type) -> TypeMap: + """Checks if the given expr is a 'lookup operation' into a union and iteratively refines + the parent types based on the 'expr_type'. + + For example, if 'expr' is an expression like 'a.b.c.d', we'll potentially return refined + types for expressions 'a', 'a.b', and 'a.b.c'. + + For more details about what a 'lookup operation' is and how we use the expr_type to refine + the parent types of lookup_expr, see the docstring in 'propagate_up_typemap_info'. + """ + output: dict[Expression, Type] = {} + + # Note: parent_expr and parent_type are progressively refined as we crawl up the + # parent lookup chain. + while True: + # First, check if this expression is one that's attempting to + # "lookup" some key in the parent type. If so, save the parent type + # and create function that will try replaying the same lookup + # operation against arbitrary types. + if isinstance(expr, MemberExpr): + parent_expr = self._propagate_walrus_assignments(expr.expr, output) + parent_type = self.lookup_type_or_none(parent_expr) + member_name = expr.name + + def replay_lookup(new_parent_type: ProperType) -> Type | None: + with self.msg.filter_errors() as w: + member_type = analyze_member_access( + name=member_name, + typ=new_parent_type, + context=parent_expr, + is_lvalue=False, + is_super=False, + is_operator=False, + original_type=new_parent_type, + chk=self, + in_literal_context=False, + ) + if w.has_new_errors(): + return None + else: + return member_type + + elif isinstance(expr, IndexExpr): + parent_expr = self._propagate_walrus_assignments(expr.base, output) + parent_type = self.lookup_type_or_none(parent_expr) + + self._propagate_walrus_assignments(expr.index, output) + index_type = self.lookup_type_or_none(expr.index) + if index_type is None: + return output + + str_literals = try_getting_str_literals_from_type(index_type) + if str_literals is not None: + # Refactoring these two indexing replay functions is surprisingly + # tricky -- see https://github.com/python/mypy/pull/7917, which + # was blocked by https://github.com/mypyc/mypyc/issues/586 + def replay_lookup(new_parent_type: ProperType) -> Type | None: + if not isinstance(new_parent_type, TypedDictType): + return None + try: + assert str_literals is not None + member_types = [new_parent_type.items[key] for key in str_literals] + except KeyError: + return None + return make_simplified_union(member_types) + + else: + int_literals = try_getting_int_literals_from_type(index_type) + if int_literals is not None: + + def replay_lookup(new_parent_type: ProperType) -> Type | None: + if not isinstance(new_parent_type, TupleType): + return None + try: + assert int_literals is not None + member_types = [new_parent_type.items[key] for key in int_literals] + except IndexError: + return None + return make_simplified_union(member_types) + + else: + return output + else: + return output + + # If we somehow didn't previously derive the parent type, abort completely + # with what we have so far: something went wrong at an earlier stage. + if parent_type is None: + return output + + # We currently only try refining the parent type if it's a Union. + # If not, there's no point in trying to refine any further parents + # since we have no further information we can use to refine the lookup + # chain, so we end early as an optimization. + parent_type = get_proper_type(parent_type) + if not isinstance(parent_type, UnionType): + return output + + # Take each element in the parent union and replay the original lookup procedure + # to figure out which parents are compatible. + new_parent_types = [] + for item in flatten_nested_unions(parent_type.items): + member_type = replay_lookup(get_proper_type(item)) + if member_type is None: + # We were unable to obtain the member type. So, we give up on refining this + # parent type entirely and abort. + return output + + if is_overlapping_types(member_type, expr_type): + new_parent_types.append(item) + + # If none of the parent types overlap (if we derived an empty union), something + # went wrong. We should never hit this case, but deriving the uninhabited type or + # reporting an error both seem unhelpful. So we abort. + if not new_parent_types: + return output + + expr = parent_expr + expr_type = output[parent_expr] = make_simplified_union(new_parent_types) + + def _propagate_walrus_assignments( + self, expr: Expression, type_map: dict[Expression, Type] + ) -> Expression: + """Add assignments from walrus expressions to inferred types. + + Only considers nested assignment exprs, does not recurse into other types. + This may be added later if necessary by implementing a dedicated visitor. + """ + if isinstance(expr, AssignmentExpr): + if isinstance(expr.value, AssignmentExpr): + self._propagate_walrus_assignments(expr.value, type_map) + assigned_type = self.lookup_type_or_none(expr.value) + parent_expr = collapse_walrus(expr) + if assigned_type is not None: + type_map[parent_expr] = assigned_type + return parent_expr + return expr + + def is_len_of_tuple(self, expr: Expression) -> bool: + """Is this expression a `len(x)` call where x is a tuple or union of tuples?""" + if not isinstance(expr, CallExpr): + return False + if not refers_to_fullname(expr.callee, "builtins.len"): + return False + if len(expr.args) != 1: + return False + expr = expr.args[0] + if literal(expr) != LITERAL_TYPE: + return False + if not self.has_type(expr): + return False + return self.can_be_narrowed_with_len(self.lookup_type(expr)) + + def can_be_narrowed_with_len(self, typ: Type) -> bool: + """Is this a type that can benefit from length check type restrictions? + + Currently supported types are TupleTypes, Instances of builtins.tuple, and + unions involving such types. + """ + if custom_special_method(typ, "__len__"): + # If user overrides builtin behavior, we can't do anything. + return False + p_typ = get_proper_type(typ) + # Note: we are conservative about tuple subclasses, because some code may rely on + # the fact that tuple_type of fallback TypeInfo matches the original TupleType. + if isinstance(p_typ, TupleType): + if any(isinstance(t, UnpackType) for t in p_typ.items): + return p_typ.partial_fallback.type.fullname == "builtins.tuple" + return True + if isinstance(p_typ, Instance): + return p_typ.type.has_base("builtins.tuple") + if isinstance(p_typ, UnionType): + return any(self.can_be_narrowed_with_len(t) for t in p_typ.items) + return False + + def literal_int_expr(self, expr: Expression) -> int | None: + """Is this expression an int literal, or a reference to an int constant? + + If yes, return the corresponding int value, otherwise return None. + """ + if not self.has_type(expr): + return None + expr_type = self.lookup_type(expr) + expr_type = coerce_to_literal(expr_type) + proper_type = get_proper_type(expr_type) + if not isinstance(proper_type, LiteralType): + return None + if not isinstance(proper_type.value, int): + return None + return proper_type.value + + def find_tuple_len_narrowing(self, node: ComparisonExpr) -> list[tuple[TypeMap, TypeMap]]: + """Top-level logic to find type restrictions from a length check on tuples. + + We try to detect `if` checks like the following: + x: tuple[int, int] | tuple[int, int, int] + y: tuple[int, int] | tuple[int, int, int] + if len(x) == len(y) == 2: + a, b = x # OK + c, d = y # OK + + z: tuple[int, ...] + if 1 < len(z) < 4: + x = z # OK + and report corresponding type restrictions to the binder. + """ + # First step: group consecutive `is` and `==` comparisons together. + # This is essentially a simplified version of group_comparison_operands(), + # tuned to the len()-like checks. Note that we don't propagate indirect + # restrictions like e.g. `len(x) > foo() > 1` yet, since it is tricky. + # TODO: propagate indirect len() comparison restrictions. + chained = [] + last_group = set() + for op, left, right in node.pairwise(): + if isinstance(left, AssignmentExpr): + left = left.value + if isinstance(right, AssignmentExpr): + right = right.value + if op in ("is", "=="): + last_group.add(left) + last_group.add(right) + else: + if last_group: + chained.append(("==", list(last_group))) + last_group = set() + if op in {"is not", "!=", "<", "<=", ">", ">="}: + chained.append((op, [left, right])) + if last_group: + chained.append(("==", list(last_group))) + + yes_map: TypeMap + no_map: TypeMap + + # Second step: infer type restrictions from each group found above. + type_maps = [] + for op, items in chained: + # TODO: support unions of literal types as len() comparison targets. + if not any(self.literal_int_expr(it) is not None for it in items): + continue + if not any(self.is_len_of_tuple(it) for it in items): + continue + + # At this step we know there is at least one len(x) and one literal in the group. + if op in ("is", "=="): + literal_values = set() + tuples = [] + for it in items: + lit = self.literal_int_expr(it) + if lit is not None: + literal_values.add(lit) + continue + if self.is_len_of_tuple(it): + assert isinstance(it, CallExpr) + tuples.append(it.args[0]) + if len(literal_values) > 1: + # More than one different literal value found, like 1 == len(x) == 2, + # so the corresponding branch is unreachable. + yes_map = {tpl: UninhabitedType() for tpl in tuples} + return [(yes_map, {})] + size = literal_values.pop() + if size > MAX_PRECISE_TUPLE_SIZE: + # Avoid creating huge tuples from checks like if len(x) == 300. + continue + for tpl in tuples: + yes_type, no_type = self.narrow_with_len(self.lookup_type(tpl), op, size) + yes_map = {tpl: yes_type} + no_map = {tpl: no_type} + type_maps.append((yes_map, no_map)) + else: + left, right = items + if self.is_len_of_tuple(right): + # Normalize `1 < len(x)` and similar as `len(x) > 1`. + left, right = right, left + op = flip_ops.get(op, op) + r_size = self.literal_int_expr(right) + assert r_size is not None + if r_size > MAX_PRECISE_TUPLE_SIZE: + # Avoid creating huge unions from checks like if len(x) > 300. + continue + assert isinstance(left, CallExpr) + yes_type, no_type = self.narrow_with_len( + self.lookup_type(left.args[0]), op, r_size + ) + yes_map = {left.args[0]: yes_type} + no_map = {left.args[0]: no_type} + type_maps.append((yes_map, no_map)) + return type_maps + + def narrow_with_len(self, typ: Type, op: str, size: int) -> tuple[Type, Type]: + """Dispatch tuple type narrowing logic depending on the kind of type we got.""" + typ = get_proper_type(typ) + if isinstance(typ, TupleType): + return self.refine_tuple_type_with_len(typ, op, size) + elif isinstance(typ, Instance): + return self.refine_instance_type_with_len(typ, op, size) + elif isinstance(typ, UnionType): + yes_types = [] + no_types = [] + other_types = [] + for t in typ.items: + if not self.can_be_narrowed_with_len(t): + other_types.append(t) + continue + yt, nt = self.narrow_with_len(t, op, size) + yes_types.append(yt) + no_types.append(nt) + yes_types += other_types + no_types += other_types + yes_type = make_simplified_union(yes_types) + no_type = make_simplified_union(no_types) + return yes_type, no_type + else: + assert False, "Unsupported type for len narrowing" + + def refine_tuple_type_with_len(self, typ: TupleType, op: str, size: int) -> tuple[Type, Type]: + """Narrow a TupleType using length restrictions.""" + unpack_index = find_unpack_in_list(typ.items) + if unpack_index is None: + # For fixed length tuple situation is trivial, it is either reachable or not, + # depending on the current length, expected length, and the comparison op. + method = int_op_to_method[op] + if method(typ.length(), size): + return typ, UninhabitedType() + return UninhabitedType(), typ + unpack = typ.items[unpack_index] + assert isinstance(unpack, UnpackType) + unpacked = get_proper_type(unpack.type) + if isinstance(unpacked, TypeVarTupleType): + # For tuples involving TypeVarTuple unpack we can't do much except + # inferring reachability, and recording the restrictions on TypeVarTuple + # for further "manual" use elsewhere. + min_len = typ.length() - 1 + unpacked.min_len + if op in ("==", "is"): + if min_len <= size: + return typ, typ + return UninhabitedType(), typ + elif op in ("<", "<="): + if op == "<=": + size += 1 + if min_len < size: + prefix = typ.items[:unpack_index] + suffix = typ.items[unpack_index + 1 :] + # TODO: also record max_len to avoid false negatives? + unpack = UnpackType(unpacked.copy_modified(min_len=size - typ.length() + 1)) + return typ, typ.copy_modified(items=prefix + [unpack] + suffix) + return UninhabitedType(), typ + else: + yes_type, no_type = self.refine_tuple_type_with_len(typ, neg_ops[op], size) + return no_type, yes_type + # Homogeneous variadic item is the case where we are most flexible. Essentially, + # we adjust the variadic item by "eating away" from it to satisfy the restriction. + assert isinstance(unpacked, Instance) and unpacked.type.fullname == "builtins.tuple" + min_len = typ.length() - 1 + arg = unpacked.args[0] + prefix = typ.items[:unpack_index] + suffix = typ.items[unpack_index + 1 :] + if op in ("==", "is"): + if min_len <= size: + # TODO: return fixed union + prefixed variadic tuple for no_type? + return typ.copy_modified(items=prefix + [arg] * (size - min_len) + suffix), typ + return UninhabitedType(), typ + elif op in ("<", "<="): + if op == "<=": + size += 1 + if min_len < size: + # Note: there is some ambiguity w.r.t. to where to put the additional + # items: before or after the unpack. However, such types are equivalent, + # so we always put them before for consistency. + no_type = typ.copy_modified( + items=prefix + [arg] * (size - min_len) + [unpack] + suffix + ) + yes_items = [] + for n in range(size - min_len): + yes_items.append(typ.copy_modified(items=prefix + [arg] * n + suffix)) + return UnionType.make_union(yes_items, typ.line, typ.column), no_type + return UninhabitedType(), typ + else: + yes_type, no_type = self.refine_tuple_type_with_len(typ, neg_ops[op], size) + return no_type, yes_type + + def refine_instance_type_with_len( + self, typ: Instance, op: str, size: int + ) -> tuple[Type, Type]: + """Narrow a homogeneous tuple using length restrictions.""" + base = map_instance_to_supertype(typ, self.lookup_typeinfo("builtins.tuple")) + arg = base.args[0] + # Again, we are conservative about subclasses until we gain more confidence. + allow_precise = ( + PRECISE_TUPLE_TYPES in self.options.enable_incomplete_feature + ) and typ.type.fullname == "builtins.tuple" + if op in ("==", "is"): + # TODO: return fixed union + prefixed variadic tuple for no_type? + return TupleType(items=[arg] * size, fallback=typ), typ + elif op in ("<", "<="): + if op == "<=": + size += 1 + if allow_precise: + unpack = UnpackType(self.named_generic_type("builtins.tuple", [arg])) + no_type: Type = TupleType(items=[arg] * size + [unpack], fallback=typ) + else: + no_type = typ + if allow_precise: + items = [] + for n in range(size): + items.append(TupleType([arg] * n, fallback=typ)) + yes_type: Type = UnionType.make_union(items, typ.line, typ.column) + else: + yes_type = typ + return yes_type, no_type + else: + yes_type, no_type = self.refine_instance_type_with_len(typ, neg_ops[op], size) + return no_type, yes_type + + # + # Helpers + # + @overload + def check_subtype( + self, + subtype: Type, + supertype: Type, + context: Context, + msg: str, + subtype_label: str | None = None, + supertype_label: str | None = None, + *, + notes: list[str] | None = None, + code: ErrorCode | None = None, + outer_context: Context | None = None, + ) -> bool: ... + + @overload + def check_subtype( + self, + subtype: Type, + supertype: Type, + context: Context, + msg: ErrorMessage, + subtype_label: str | None = None, + supertype_label: str | None = None, + *, + notes: list[str] | None = None, + outer_context: Context | None = None, + ) -> bool: ... + + def check_subtype( + self, + subtype: Type, + supertype: Type, + context: Context, + msg: str | ErrorMessage, + subtype_label: str | None = None, + supertype_label: str | None = None, + *, + notes: list[str] | None = None, + code: ErrorCode | None = None, + outer_context: Context | None = None, + ) -> bool: + """Generate an error if the subtype is not compatible with supertype.""" + if is_subtype(subtype, supertype, options=self.options): + return True + + if isinstance(msg, str): + msg = ErrorMessage(msg, code=code) + + if self.msg.prefer_simple_messages(): + self.fail(msg, context) # Fast path -- skip all fancy logic + return False + + orig_subtype = subtype + subtype = get_proper_type(subtype) + orig_supertype = supertype + supertype = get_proper_type(supertype) + if self.msg.try_report_long_tuple_assignment_error( + subtype, supertype, context, msg, subtype_label, supertype_label + ): + return False + extra_info: list[str] = [] + note_msg = "" + notes = notes or [] + if subtype_label is not None or supertype_label is not None: + subtype_str, supertype_str = format_type_distinctly( + orig_subtype, orig_supertype, options=self.options + ) + if subtype_label is not None: + extra_info.append(subtype_label + " " + subtype_str) + if supertype_label is not None: + extra_info.append(supertype_label + " " + supertype_str) + note_msg = make_inferred_type_note( + outer_context or context, subtype, supertype, supertype_str + ) + if isinstance(subtype, Instance) and isinstance(supertype, Instance): + notes = append_invariance_notes(notes, subtype, supertype) + if isinstance(subtype, UnionType) and isinstance(supertype, UnionType): + notes = append_union_note(notes, subtype, supertype, self.options) + if extra_info: + msg = msg.with_additional_msg(" (" + ", ".join(extra_info) + ")") + + error = self.fail(msg, context) + for note in notes: + self.msg.note(note, context, code=msg.code) + if note_msg: + self.note(note_msg, context, code=msg.code) + self.msg.maybe_note_concatenate_pos_args(subtype, supertype, context, code=msg.code) + if ( + isinstance(supertype, Instance) + and supertype.type.is_protocol + and isinstance(subtype, (CallableType, Instance, TupleType, TypedDictType, TypeType)) + ): + self.msg.report_protocol_problems(subtype, supertype, context, parent_error=error) + if isinstance(supertype, CallableType) and isinstance(subtype, Instance): + call = find_member("__call__", subtype, subtype, is_operator=True) + if call: + self.msg.note_call(subtype, call, context, code=msg.code) + if isinstance(subtype, (CallableType, Overloaded)) and isinstance(supertype, Instance): + if supertype.type.is_protocol and "__call__" in supertype.type.protocol_members: + call = find_member("__call__", supertype, subtype, is_operator=True) + assert call is not None + if not is_subtype(subtype, call, options=self.options): + self.msg.note_call(supertype, call, context, code=msg.code) + self.check_possible_missing_await(subtype, supertype, context, code=msg.code) + return False + + def get_precise_awaitable_type(self, typ: Type, local_errors: ErrorWatcher) -> Type | None: + """If type implements Awaitable[X] with non-Any X, return X. + + In all other cases return None. This method must be called in context + of local_errors. + """ + if isinstance(get_proper_type(typ), PartialType): + # Partial types are special, ignore them here. + return None + try: + aw_type = self.expr_checker.check_awaitable_expr( + typ, Context(), "", ignore_binder=True + ) + except KeyError: + # This is a hack to speed up tests by not including Awaitable in all typing stubs. + return None + if local_errors.has_new_errors(): + return None + if isinstance(get_proper_type(aw_type), (AnyType, UnboundType)): + return None + return aw_type + + @contextmanager + def checking_await_set(self) -> Iterator[None]: + self.checking_missing_await = True + try: + yield + finally: + self.checking_missing_await = False + + def check_possible_missing_await( + self, subtype: Type, supertype: Type, context: Context, code: ErrorCode | None + ) -> None: + """Check if the given type becomes a subtype when awaited.""" + if self.checking_missing_await: + # Avoid infinite recursion. + return + with self.checking_await_set(), self.msg.filter_errors() as local_errors: + aw_type = self.get_precise_awaitable_type(subtype, local_errors) + if aw_type is None: + return + if not self.check_subtype( + aw_type, supertype, context, msg=message_registry.INCOMPATIBLE_TYPES + ): + return + self.msg.possible_missing_await(context, code) + + def named_type(self, name: str) -> Instance: + """Return an instance type with given name and implicit Any type args. + + For example, named_type('builtins.object') produces the 'object' type. + """ + if name == "builtins.str": + if instance_cache.str_type is None: + instance_cache.str_type = self._named_type(name) + return instance_cache.str_type + if name == "builtins.function": + if instance_cache.function_type is None: + instance_cache.function_type = self._named_type(name) + return instance_cache.function_type + if name == "builtins.int": + if instance_cache.int_type is None: + instance_cache.int_type = self._named_type(name) + return instance_cache.int_type + if name == "builtins.bool": + if instance_cache.bool_type is None: + instance_cache.bool_type = self._named_type(name) + return instance_cache.bool_type + if name == "builtins.object": + if instance_cache.object_type is None: + instance_cache.object_type = self._named_type(name) + return instance_cache.object_type + return self._named_type(name) + + def _named_type(self, name: str) -> Instance: + # Assume that the name refers to a type. + sym = self.lookup_qualified(name) + node = sym.node + if isinstance(node, TypeAlias): + assert isinstance(node.target, Instance) # type: ignore[misc] + node = node.target.type + assert isinstance(node, TypeInfo), node + any_type = AnyType(TypeOfAny.from_omitted_generics) + return Instance(node, [any_type] * len(node.defn.type_vars)) + + def named_generic_type(self, name: str, args: list[Type]) -> Instance: + """Return an instance with the given name and type arguments. + + Assume that the number of arguments is correct. Assume that + the name refers to a compatible generic type. + """ + info = self.lookup_typeinfo(name) + args = [remove_instance_last_known_values(arg) for arg in args] + # TODO: assert len(args) == len(info.defn.type_vars) + return Instance(info, args) + + def lookup_typeinfo(self, fullname: str) -> TypeInfo: + # Assume that the name refers to a class. + sym = self.lookup_qualified(fullname) + node = sym.node + assert isinstance(node, TypeInfo), node + return node + + def type_type(self) -> Instance: + """Return instance type 'type'.""" + return self.named_type("builtins.type") + + def str_type(self) -> Instance: + """Return instance type 'str'.""" + return self.named_type("builtins.str") + + def store_type(self, node: Expression, typ: Type) -> None: + """Store the type of a node in the type map.""" + self._type_maps[-1][node] = typ + + def has_type(self, node: Expression) -> bool: + return any(node in m for m in reversed(self._type_maps)) + + def lookup_type_or_none(self, node: Expression) -> Type | None: + for m in reversed(self._type_maps): + if node in m: + return m[node] + return None + + def lookup_type(self, node: Expression) -> Type: + for m in reversed(self._type_maps): + t = m.get(node) + if t is not None: + return t + raise KeyError(node) + + def store_types(self, d: dict[Expression, Type]) -> None: + self._type_maps[-1].update(d) + + def in_checked_function(self) -> bool: + """Should we type-check the current function? + + - Yes if --check-untyped-defs is set. + - Yes outside functions. + - Yes in annotated functions. + - No otherwise. + """ + return ( + self.options.check_untyped_defs or not self.dynamic_funcs or not self.dynamic_funcs[-1] + ) + + def lookup(self, name: str) -> SymbolTableNode: + """Look up a definition from the symbol table with the given name.""" + if name in self.globals: + return self.globals[name] + else: + b = self.globals.get("__builtins__", None) + if b: + assert isinstance(b.node, MypyFile) + table = b.node.names + if name in table: + return table[name] + raise KeyError(f"Failed lookup: {name}") + + def lookup_qualified(self, name: str) -> SymbolTableNode: + if "." not in name: + return self.lookup(name) + else: + parts = name.split(".") + n = self.modules[parts[0]] + for i in range(1, len(parts) - 1): + sym = n.names.get(parts[i]) + assert sym is not None, "Internal error: attempted lookup of unknown name" + assert isinstance(sym.node, MypyFile) + n = sym.node + last = parts[-1] + if last in n.names: + return n.names[last] + elif len(parts) == 2 and parts[0] in ("builtins", "typing"): + fullname = ".".join(parts) + if fullname in SUGGESTED_TEST_FIXTURES: + suggestion = ", e.g. add '[{} fixtures/{}]' to your test".format( + parts[0], SUGGESTED_TEST_FIXTURES[fullname] + ) + else: + suggestion = "" + raise KeyError( + "Could not find builtin symbol '{}' (If you are running a " + "test case, use a fixture that " + "defines this symbol{})".format(last, suggestion) + ) + else: + msg = "Failed qualified lookup: '{}' (fullname = '{}')." + raise KeyError(msg.format(last, name)) + + @contextmanager + def enter_partial_types( + self, *, is_function: bool = False, is_class: bool = False + ) -> Iterator[None]: + """Enter a new scope for collecting partial types. + + Also report errors for (some) variables which still have partial + types, i.e. we couldn't infer a complete type. + """ + is_local = (self.partial_types and self.partial_types[-1].is_local) or is_function + self.partial_types.append(PartialTypeScope({}, is_function, is_local)) + yield + + # Don't complain about not being able to infer partials if it is + # at the toplevel (with allow_untyped_globals) or if it is in an + # untyped function being checked with check_untyped_defs. + permissive = (self.options.allow_untyped_globals and not is_local) or ( + self.options.check_untyped_defs and self.dynamic_funcs and self.dynamic_funcs[-1] + ) + + partial_types, _, _ = self.partial_types.pop() + if not self.current_node_deferred: + for var, context in partial_types.items(): + if isinstance(var.type, PartialType) and var.type.type is None and not permissive: + var.type = NoneType() + else: + if var not in self.partial_reported and not permissive: + self.msg.need_annotation_for_var(var, context, self.options) + self.partial_reported.add(var) + if var.type: + fixed = fixup_partial_type(var.type) + var.invalid_partial_type = fixed != var.type + var.type = fixed + + def handle_partial_var_type( + self, typ: PartialType, is_lvalue: bool, node: Var, context: Context + ) -> Type: + """Handle a reference to a partial type through a var. + + (Used by checkexpr and checkmember.) + """ + in_scope, is_local, partial_types = self.find_partial_types_in_all_scopes(node) + if typ.type is None and in_scope: + # 'None' partial type. It has a well-defined type. In an lvalue context + # we want to preserve the knowledge of it being a partial type. + if not is_lvalue: + return NoneType() + else: + return typ + else: + if partial_types is not None and not self.current_node_deferred: + if in_scope: + context = partial_types[node] + if is_local or not self.options.allow_untyped_globals: + self.msg.need_annotation_for_var(node, context, self.options) + self.partial_reported.add(node) + else: + # Defer the node -- we might get a better type in the outer scope + self.handle_cannot_determine_type(node.name, context) + return fixup_partial_type(typ) + + def is_defined_in_base_class(self, var: Var) -> bool: + if not var.info: + return False + return var.info.fallback_to_any or any( + base.get(var.name) is not None for base in var.info.mro[1:] + ) + + def find_partial_types(self, var: Var) -> dict[Var, Context] | None: + """Look for an active partial type scope containing variable. + + A scope is active if assignments in the current context can refine a partial + type originally defined in the scope. This is affected by the local_partial_types + configuration option. + """ + in_scope, _, partial_types = self.find_partial_types_in_all_scopes(var) + if in_scope: + return partial_types + return None + + def find_partial_types_in_all_scopes( + self, var: Var + ) -> tuple[bool, bool, dict[Var, Context] | None]: + """Look for partial type scope containing variable. + + Return tuple (is the scope active, is the scope a local scope, scope). + """ + for scope in reversed(self.partial_types): + if var in scope.map: + # All scopes within the outermost function are active. Scopes out of + # the outermost function are inactive to allow local reasoning (important + # for fine-grained incremental mode). + disallow_other_scopes = self.options.local_partial_types + + # There are two exceptions: + if isinstance(var.type, PartialType) and var.type.type is not None and var.info: + # We always prohibit non-None partial types at class scope + # for historical reasons. + disallow_other_scopes = True + if isinstance(var.type, PartialType) and var.type.type is None: + # We always allow None partial types, since this is a common use case. + # It is special-cased in fine-grained incremental mode. + disallow_other_scopes = False + + scope_active = ( + not disallow_other_scopes or scope.is_local == self.partial_types[-1].is_local + ) + return scope_active, scope.is_local, scope.map + return False, False, None + + def temp_node(self, t: Type, context: Context | None = None) -> TempNode: + """Create a temporary node with the given, fixed type.""" + return TempNode(t, context=context) + + def fail( + self, msg: str | ErrorMessage, context: Context, *, code: ErrorCode | None = None + ) -> ErrorInfo: + """Produce an error message.""" + if isinstance(msg, ErrorMessage): + return self.msg.fail(msg.value, context, code=msg.code) + return self.msg.fail(msg, context, code=code) + + def note( + self, + msg: str | ErrorMessage, + context: Context, + offset: int = 0, + *, + code: ErrorCode | None = None, + ) -> None: + """Produce a note.""" + if isinstance(msg, ErrorMessage): + self.msg.note(msg.value, context, code=msg.code) + return + self.msg.note(msg, context, offset=offset, code=code) + + def iterable_item_type(self, it: ProperType, context: Context) -> Type: + if isinstance(it, Instance): + iterable = map_instance_to_supertype(it, self.lookup_typeinfo("typing.Iterable")) + item_type = iterable.args[0] + if not isinstance(get_proper_type(item_type), AnyType): + # This relies on 'map_instance_to_supertype' returning 'Iterable[Any]' + # in case there is no explicit base class. + return item_type + # Try also structural typing. + return self.analyze_iterable_item_type_without_expression(it, context)[1] + + def function_type(self, func: FuncBase) -> FunctionLike: + return function_type(func, self.named_type("builtins.function")) + + def push_type_map(self, type_map: TypeMap, *, from_assignment: bool = True) -> None: + if is_unreachable_map(type_map): + self.binder.unreachable() + else: + for expr, type in type_map.items(): + self.binder.put(expr, type, from_assignment=from_assignment) + + def infer_issubclass_maps(self, node: CallExpr, expr: Expression) -> tuple[TypeMap, TypeMap]: + """Infer type restrictions for an expression in issubclass call.""" + vartype = self.lookup_type(expr) + type = self.get_isinstance_type(node.args[1]) + if isinstance(vartype, TypeVarType): + vartype = vartype.upper_bound + vartype = get_proper_type(vartype) + if isinstance(vartype, UnionType): + union_list = [] + for t in get_proper_types(vartype.items): + if isinstance(t, TypeType): + union_list.append(t.item) + else: + # This is an error that should be reported earlier + # if we reach here, we refuse to do any type inference. + return {}, {} + vartype = UnionType(union_list) + elif isinstance(vartype, TypeType): + vartype = vartype.item + elif isinstance(vartype, Instance) and vartype.type.is_metaclass(): + vartype = self.named_type("builtins.object") + else: + # Any other object whose type we don't know precisely + # for example, Any or a custom metaclass. + return {}, {} # unknown type + yes_type, no_type = self.conditional_types_with_intersection(vartype, type, expr) + yes_map, no_map = conditional_types_to_typemaps(expr, yes_type, no_type) + yes_map, no_map = map(convert_to_typetype, (yes_map, no_map)) + return yes_map, no_map + + @overload + def conditional_types_with_intersection( + self, + expr_type: Type, + type_ranges: list[TypeRange] | None, + ctx: Context, + default: None = None, + *, + consider_runtime_isinstance: bool = True, + ) -> tuple[Type | None, Type | None]: ... + + @overload + def conditional_types_with_intersection( + self, + expr_type: Type, + type_ranges: list[TypeRange] | None, + ctx: Context, + default: Type, + *, + consider_runtime_isinstance: bool = True, + ) -> tuple[Type, Type]: ... + + def conditional_types_with_intersection( + self, + expr_type: Type, + type_ranges: list[TypeRange] | None, + ctx: Context, + default: Type | None = None, + *, + consider_runtime_isinstance: bool = True, + ) -> tuple[Type | None, Type | None]: + initial_types = conditional_types( + expr_type, + type_ranges, + default, + consider_runtime_isinstance=consider_runtime_isinstance, + ) + # For some reason, doing "yes_map, no_map = conditional_types_to_typemaps(...)" + # doesn't work: mypyc will decide that 'yes_map' is of type None if we try. + yes_type: Type | None = initial_types[0] + no_type: Type | None = initial_types[1] + + if not isinstance(get_proper_type(yes_type), UninhabitedType) or type_ranges is None: + return yes_type, no_type + + # If conditional_types was unable to successfully narrow the expr_type + # using the type_ranges and concluded if-branch is unreachable, we try + # computing it again using a different algorithm that tries to generate + # an ad-hoc intersection between the expr_type and the type_ranges. + proper_type = get_proper_type(expr_type) + if isinstance(proper_type, UnionType): + possible_expr_types = get_proper_types(proper_type.relevant_items()) + else: + possible_expr_types = [proper_type] + + possible_target_types = [] + for tr in type_ranges: + item = get_proper_type(tr.item) + if isinstance(item, (Instance, NoneType)): + possible_target_types.append(item) + if not possible_target_types: + return yes_type, no_type + + out = [] + errors: list[tuple[str, str]] = [] + for v in possible_expr_types: + if not isinstance(v, Instance): + return yes_type, no_type + for t in possible_target_types: + if isinstance(t, NoneType): + errors.append((f'"{v.type.name}" and "NoneType"', '"NoneType" is final')) + continue + intersection = self.intersect_instances((v, t), errors) + if intersection is None: + continue + out.append(intersection) + if not out: + # Only report errors if no element in the union worked. + if self.should_report_unreachable_issues(): + for types, reason in errors: + self.msg.impossible_intersection(types, reason, ctx) + return UninhabitedType(), expr_type + new_yes_type = make_simplified_union(out) + return new_yes_type, expr_type + + def is_writable_attribute(self, node: Node) -> bool: + """Check if an attribute is writable""" + if isinstance(node, Var): + if node.is_property and not node.is_settable_property: + return False + return True + elif isinstance(node, OverloadedFuncDef) and node.is_property: + first_item = node.items[0] + assert isinstance(first_item, Decorator) + return first_item.var.is_settable_property + return False + + def get_isinstance_type( + self, expr: Expression, flatten_tuples: bool = True + ) -> list[TypeRange] | None: + """Get the type(s) resulting from an isinstance check. + + Returns an empty list for isinstance(x, ()). + """ + if isinstance(expr, OpExpr) and expr.op == "|": + left: list[TypeRange] | None + right: list[TypeRange] | None + if is_literal_none(expr.left): + left = [TypeRange(NoneType(), is_upper_bound=False)] + else: + left = self.get_isinstance_type(expr.left, flatten_tuples=False) + if is_literal_none(expr.right): + right = [TypeRange(NoneType(), is_upper_bound=False)] + else: + right = self.get_isinstance_type(expr.right, flatten_tuples=False) + if left is None or right is None: + return None + return left + right + + if flatten_tuples: + type_ranges = [] + for typ in flatten_types_if_tuple(self.lookup_type(expr)): + type_range = self.get_type_range_of_type(typ) + if type_range is None: + return None + type_ranges.append(type_range) + return type_ranges + + else: + type_range = self.get_type_range_of_type(self.lookup_type(expr)) + if type_range is None: + return None + return [type_range] + + def get_type_range_of_type(self, typ: Type) -> TypeRange | None: + typ = get_proper_type(typ) + if isinstance(typ, TypeVarType): + typ = get_proper_type(typ.upper_bound) + + if isinstance(typ, UnionType): + type_ranges = [self.get_type_range_of_type(item) for item in typ.items] + item = make_simplified_union([t.item for t in type_ranges if t is not None]) + return TypeRange(item, is_upper_bound=True) + if isinstance(typ, FunctionLike) and typ.is_type_obj(): + # If a type is generic, `isinstance` can only narrow its variables to Any. + any_parameterized = fill_typevars_with_any(typ.type_object()) + # Tuples may have unattended type variables among their items + if isinstance(any_parameterized, TupleType): + erased_type = erase_typevars(any_parameterized) + else: + erased_type = any_parameterized + return TypeRange(erased_type, is_upper_bound=False) + if isinstance(typ, TypeType): + # Type[A] means "any type that is a subtype of A" rather than "precisely type A" + # we indicate this by setting is_upper_bound flag + is_upper_bound = True + if isinstance(typ.item, NoneType): + # except for Type[None], because "'NoneType' is not an acceptable base type" + is_upper_bound = False + if isinstance(typ.item, Instance) and typ.item.type.is_final: + is_upper_bound = False + return TypeRange(typ.item, is_upper_bound=is_upper_bound) + if isinstance(typ, AnyType): + return TypeRange(typ, is_upper_bound=False) + if isinstance(typ, Instance) and typ.type.fullname == "builtins.type": + object_type = Instance(typ.type.mro[-1], []) + return TypeRange(object_type, is_upper_bound=True) + if isinstance(typ, Instance) and typ.type.fullname == "types.UnionType" and typ.args: + return TypeRange(UnionType(typ.args), is_upper_bound=False) + if isinstance(typ, Instance) and typ.type.fullname == "typing._SpecialForm": + # This is probably an alias to a Union object. We don't have the args here so we can't + # conclude anything + return None + if not is_subtype(self.named_type("builtins.type"), typ): + # We saw something, but it couldn't possibly be valid + return TypeRange(UninhabitedType(), is_upper_bound=False) + + # This is e.g. a variable of type object, so we can't conclude anything + return None + + def is_literal_enum(self, n: Expression) -> bool: + """Returns true if this expression (with the given type context) is an Enum literal. + + For example, if we had an enum: + + class Foo(Enum): + A = 1 + B = 2 + + ...and if the expression 'Foo' referred to that enum within the current type context, + then the expression 'Foo.A' would be a literal enum. However, if we did 'a = Foo.A', + then the variable 'a' would *not* be a literal enum. + + We occasionally special-case expressions like 'Foo.A' and treat them as a single primitive + unit for the same reasons we sometimes treat 'True', 'False', or 'None' as a single + primitive unit. + """ + if not isinstance(n, MemberExpr) or not isinstance(n.expr, NameExpr): + return False + + parent_type = self.lookup_type_or_none(n.expr) + member_type = self.lookup_type_or_none(n) + if member_type is None or parent_type is None: + return False + + parent_type = get_proper_type(parent_type) + member_type = get_proper_type(coerce_to_literal(member_type)) + if not isinstance(parent_type, FunctionLike) or not isinstance(member_type, LiteralType): + return False + + if not parent_type.is_type_obj(): + return False + + return ( + member_type.is_enum_literal() + and member_type.fallback.type == parent_type.type_object() + ) + + def add_any_attribute_to_type(self, typ: Type, name: str) -> Type: + """Inject an extra attribute with Any type using fallbacks.""" + orig_typ = typ + typ = get_proper_type(typ) + any_type = AnyType(TypeOfAny.unannotated) + if isinstance(typ, Instance): + result = typ.copy_with_extra_attr(name, any_type) + # For instances, we erase the possible module name, so that restrictions + # become anonymous types.ModuleType instances, allowing hasattr() to + # have effect on modules. + assert result.extra_attrs is not None + result.extra_attrs.mod_name = None + return result + if isinstance(typ, TupleType): + fallback = typ.partial_fallback.copy_with_extra_attr(name, any_type) + return typ.copy_modified(fallback=fallback) + if isinstance(typ, CallableType): + fallback = typ.fallback.copy_with_extra_attr(name, any_type) + return typ.copy_modified(fallback=fallback) + if isinstance(typ, TypeType) and isinstance(typ.item, Instance): + return TypeType.make_normalized( + self.add_any_attribute_to_type(typ.item, name), is_type_form=typ.is_type_form + ) + if isinstance(typ, TypeVarType): + return typ.copy_modified( + upper_bound=self.add_any_attribute_to_type(typ.upper_bound, name), + values=[self.add_any_attribute_to_type(v, name) for v in typ.values], + ) + if isinstance(typ, UnionType): + with_attr, without_attr = self.partition_union_by_attr(typ, name) + return make_simplified_union( + with_attr + [self.add_any_attribute_to_type(typ, name) for typ in without_attr] + ) + return orig_typ + + def hasattr_type_maps( + self, expr: Expression, source_type: Type, name: str + ) -> tuple[TypeMap, TypeMap]: + """Simple support for hasattr() checks. + + Essentially the logic is following: + * In the if branch, keep types that already has a valid attribute as is, + for other inject an attribute with `Any` type. + * In the else branch, remove types that already have a valid attribute, + while keeping the rest. + """ + if self.has_valid_attribute(source_type, name): + return {expr: source_type}, {} + + source_type = get_proper_type(source_type) + if isinstance(source_type, UnionType): + _, without_attr = self.partition_union_by_attr(source_type, name) + yes_map = {expr: self.add_any_attribute_to_type(source_type, name)} + return yes_map, {expr: make_simplified_union(without_attr)} + + type_with_attr = self.add_any_attribute_to_type(source_type, name) + if type_with_attr != source_type: + return {expr: type_with_attr}, {} + return {}, {} + + def partition_union_by_attr( + self, source_type: UnionType, name: str + ) -> tuple[list[Type], list[Type]]: + with_attr = [] + without_attr = [] + for item in source_type.items: + if self.has_valid_attribute(item, name): + with_attr.append(item) + else: + without_attr.append(item) + return with_attr, without_attr + + def has_valid_attribute(self, typ: Type, name: str) -> bool: + p_typ = get_proper_type(typ) + if isinstance(p_typ, AnyType): + return False + if isinstance(p_typ, Instance) and p_typ.extra_attrs and p_typ.extra_attrs.mod_name: + # Presence of module_symbol_table means this check will skip ModuleType.__getattr__ + module_symbol_table = p_typ.type.names + else: + module_symbol_table = None + with self.msg.filter_errors() as watcher: + analyze_member_access( + name, + typ, + TempNode(AnyType(TypeOfAny.special_form)), + is_lvalue=False, + is_super=False, + is_operator=False, + original_type=typ, + chk=self, + # This is not a real attribute lookup so don't mess with deferring nodes. + no_deferral=True, + module_symbol_table=module_symbol_table, + ) + return not watcher.has_new_errors() + + def get_expression_type(self, node: Expression, type_context: Type | None = None) -> Type: + return self.expr_checker.accept(node, type_context=type_context) + + def is_defined_in_stub(self, typ: Instance, /) -> bool: + return self.modules[typ.type.module_name].is_stub + + def check_deprecated(self, node: Node | None, context: Context) -> None: + """Warn if deprecated and not directly imported with a `from` statement.""" + if isinstance(node, Decorator): + node = node.func + if isinstance(node, (FuncDef, OverloadedFuncDef, TypeInfo)) and ( + node.deprecated is not None + ): + for imp in self.tree.imports: + if isinstance(imp, ImportFrom) and any(node.name == n[0] for n in imp.names): + break + else: + self.warn_deprecated(node, context) + + def warn_deprecated(self, node: Node | None, context: Context) -> None: + """Warn if deprecated.""" + if isinstance(node, Decorator): + node = node.func + if ( + isinstance(node, (FuncDef, OverloadedFuncDef, TypeInfo)) + and (deprecated := node.deprecated) is not None + and not self.is_typeshed_stub + and not any( + node.fullname == p or node.fullname.startswith(f"{p}.") + for p in self.options.deprecated_calls_exclude + ) + ): + warn = self.msg.note if self.options.report_deprecated_as_note else self.msg.fail + warn(deprecated, context, code=codes.DEPRECATED) + + def new_unique_dummy_name(self, namespace: str) -> str: + """Generate a name that is guaranteed to be unique for this TypeChecker instance.""" + name = f"dummy-{namespace}-{self._unique_id}" + self._unique_id += 1 + return name + + # leafs + + def visit_pass_stmt(self, o: PassStmt, /) -> None: + return None + + def visit_nonlocal_decl(self, o: NonlocalDecl, /) -> None: + return None + + def visit_global_decl(self, o: GlobalDecl, /) -> None: + return None + + +class TypeCheckerAsSemanticAnalyzer(SemanticAnalyzerCoreInterface): + """ + Adapts TypeChecker to the SemanticAnalyzerCoreInterface, + allowing most type expressions to be parsed during the TypeChecker pass. + + See ExpressionChecker.try_parse_as_type_expression() to understand how this + class is used. + """ + + _chk: TypeChecker + _names: dict[str, SymbolTableNode] + did_fail: bool + + def __init__(self, chk: TypeChecker, names: dict[str, SymbolTableNode]) -> None: + self._chk = chk + self._names = names + self.did_fail = False + + def lookup_qualified( + self, name: str, ctx: Context, suppress_errors: bool = False + ) -> SymbolTableNode | None: + sym = self._names.get(name) + # All names being looked up should have been previously gathered, + # even if the related SymbolTableNode does not refer to a valid SymbolNode + assert sym is not None, name + return sym + + def lookup_fully_qualified(self, fullname: str, /) -> SymbolTableNode: + ret = self.lookup_fully_qualified_or_none(fullname) + assert ret is not None, fullname + return ret + + def lookup_fully_qualified_or_none(self, fullname: str, /) -> SymbolTableNode | None: + try: + return self._chk.lookup_qualified(fullname) + except KeyError: + return None + + def fail( + self, + msg: str, + ctx: Context, + serious: bool = False, + *, + blocker: bool = False, + code: ErrorCode | None = None, + ) -> None: + self.did_fail = True + + def note(self, msg: str, ctx: Context, *, code: ErrorCode | None = None) -> None: + pass + + def incomplete_feature_enabled(self, feature: str, ctx: Context) -> bool: + if feature not in self._chk.options.enable_incomplete_feature: + self.fail("__ignored__", ctx) + return False + return True + + def record_incomplete_ref(self) -> None: + pass + + def defer(self, debug_context: Context | None = None, force_progress: bool = False) -> None: + pass + + def is_incomplete_namespace(self, fullname: str) -> bool: + return False + + @property + def final_iteration(self) -> bool: + return True + + def is_future_flag_set(self, flag: str) -> bool: + return self._chk.tree.is_future_flag_set(flag) + + @property + def is_stub_file(self) -> bool: + return self._chk.tree.is_stub + + def is_func_scope(self) -> bool: + # Return arbitrary value. + # + # This method is currently only used to decide whether to pair + # a fail() message with a note() message or not. Both of those + # message types are ignored. + return False + + @property + def type(self) -> TypeInfo | None: + return self._chk.type + + +class CollectArgTypeVarTypes(TypeTraverserVisitor): + """Collects the non-nested argument types in a set.""" + + def __init__(self) -> None: + self.arg_types: set[TypeVarType] = set() + + def visit_type_var(self, t: TypeVarType) -> None: + self.arg_types.add(t) + + +@overload +def conditional_types( + current_type: Type, + proposed_type_ranges: list[TypeRange] | None, + default: None = None, + *, + consider_runtime_isinstance: bool = True, + from_equality: bool = False, +) -> tuple[Type | None, Type | None]: ... + + +@overload +def conditional_types( + current_type: Type, + proposed_type_ranges: list[TypeRange] | None, + default: Type, + *, + consider_runtime_isinstance: bool = True, + from_equality: bool = False, +) -> tuple[Type, Type]: ... + + +def conditional_types( + current_type: Type, + proposed_type_ranges: list[TypeRange] | None, + default: Type | None = None, + *, + consider_runtime_isinstance: bool = True, + from_equality: bool = False, +) -> tuple[Type | None, Type | None]: + """Takes in the current type and a proposed type of an expression. + + Returns a 2-tuple: + The first element is the proposed type, if the expression can be the proposed type. + (or default, if default is set and the expression is a subtype of the proposed type). + The second element is the type it would hold if it was not the proposed type, if any. + (or default, if default is set and the expression is not a subtype of the proposed type). + + UninhabitedType means unreachable. + None means no new information can be inferred. + """ + if proposed_type_ranges is None: + # An isinstance check, but we don't understand the type + return current_type, default + + if not proposed_type_ranges: + # This is the case for `if isinstance(x, ())` which always returns False. + return UninhabitedType(), default + + if len(proposed_type_ranges) == 1: + # expand e.g. bool -> Literal[True] | Literal[False] + target = proposed_type_ranges[0].item + target = get_proper_type(target) + if isinstance(target, LiteralType) and ( + target.is_enum_literal() or isinstance(target.value, bool) + ): + enum_name = target.fallback.type.fullname + current_type = try_expanding_sum_type_to_union(current_type, enum_name) + + proposed_type: Type + remaining_type: Type + + p_current_type = get_proper_type(current_type) + # factorize over union types: isinstance(A|B, C) -> yes = A_yes | B_yes + if isinstance(p_current_type, UnionType): + yes_items: list[Type] = [] + no_items: list[Type] = [] + for union_item in p_current_type.items: + yes_type, no_type = conditional_types( + union_item, + proposed_type_ranges, + default=union_item, + consider_runtime_isinstance=consider_runtime_isinstance, + from_equality=from_equality, + ) + yes_items.append(yes_type) + no_items.append(no_type) + + proposed_type = make_simplified_union(yes_items) + remaining_type = make_simplified_union(no_items) + return proposed_type, remaining_type + + proposed_type = make_simplified_union([type_range.item for type_range in proposed_type_ranges]) + items = proposed_type.items if isinstance(proposed_type, UnionType) else [proposed_type] + for i in range(len(items)): + item = get_proper_type(items[i]) + # Avoid ever narrowing to a NewType. The principle is values of NewType should only be + # produce by explicit wrapping + while isinstance(item, Instance) and item.type.is_newtype: + item = item.type.bases[0] + items[i] = item + proposed_type = get_proper_type(UnionType.make_union(items)) + + if isinstance(p_current_type, AnyType): + return proposed_type, current_type + if isinstance(proposed_type, AnyType): + # We don't really know much about the proposed type, so we shouldn't + # attempt to narrow anything. Instead, we broaden the expr to Any to + # avoid false positives + return proposed_type, default + if not any(type_range.is_upper_bound for type_range in proposed_type_ranges): + # concrete subtype + if is_proper_subtype(current_type, proposed_type, ignore_promotions=True): + return default, UninhabitedType() + + # structural subtypes + if ( + isinstance(proposed_type, CallableType) + or (isinstance(proposed_type, Instance) and proposed_type.type.is_protocol) + ) and is_subtype(current_type, proposed_type, ignore_promotions=True): + # Note: It's possible that current_type=`Any | Proto` while proposed_type=`Proto` + # so we cannot return `Never` for the else branch + remainder = restrict_subtype_away( + current_type, + default if default is not None else proposed_type, + consider_runtime_isinstance=consider_runtime_isinstance, + ) + return default, remainder + + if from_equality: + # We erase generic args because values with different generic types can compare equal + # For instance, cast(list[str], []) and cast(list[int], []) + proposed_type = shallow_erase_type_for_equality(proposed_type) + if not is_overlapping_types(current_type, proposed_type, ignore_promotions=False): + # Equality narrowing is one of the places at runtime where subtyping with promotion + # does happen to match runtime semantics + # Expression is never of any type in proposed_type_ranges + return UninhabitedType(), default + if not is_overlapping_types(current_type, proposed_type, ignore_promotions=True): + return default, default + else: + if not is_overlapping_types(current_type, proposed_type, ignore_promotions=True): + # Expression is never of any type in proposed_type_ranges + return UninhabitedType(), default + + # we can only restrict when the type is precise, not bounded + proposed_precise_type = UnionType.make_union( + [type_range.item for type_range in proposed_type_ranges if not type_range.is_upper_bound] + ) + remaining_type = restrict_subtype_away( + current_type, + proposed_precise_type, + consider_runtime_isinstance=consider_runtime_isinstance, + ) + + # Avoid widening the type + if is_proper_subtype(p_current_type, proposed_type, ignore_promotions=True): + proposed_type = default if default is not None else current_type + + return proposed_type, remaining_type + + +def conditional_types_to_typemaps( + expr: Expression, yes_type: Type | None, no_type: Type | None +) -> tuple[TypeMap, TypeMap]: + expr = collapse_walrus(expr) + + yes_map = {} if yes_type is None else {expr: yes_type} + no_map = {} if no_type is None else {expr: no_type} + return yes_map, no_map + + +def gen_unique_name(base: str, table: SymbolTable) -> str: + """Generate a name that does not appear in table by appending numbers to base.""" + if base not in table: + return base + i = 1 + while base + str(i) in table: + i += 1 + return base + str(i) + + +def is_true_literal(n: Expression) -> bool: + """Returns true if this expression is the 'True' literal/keyword.""" + return refers_to_fullname(n, "builtins.True") or isinstance(n, IntExpr) and n.value != 0 + + +def is_false_literal(n: Expression) -> bool: + """Returns true if this expression is the 'False' literal/keyword.""" + return refers_to_fullname(n, "builtins.False") or isinstance(n, IntExpr) and n.value == 0 + + +def is_literal_none(n: Expression) -> bool: + """Returns true if this expression is the 'None' literal/keyword.""" + return isinstance(n, NameExpr) and n.fullname == "builtins.None" + + +def is_literal_not_implemented(n: Expression | None) -> bool: + return isinstance(n, NameExpr) and n.fullname == "builtins.NotImplemented" + + +def _is_empty_generator_function(func: FuncItem) -> bool: + """ + Checks whether a function's body is 'return; yield' (the yield being added only + to promote the function into a generator function). + """ + body = func.body.body + return ( + len(body) == 2 + and isinstance(ret_stmt := body[0], ReturnStmt) + and (ret_stmt.expr is None or is_literal_none(ret_stmt.expr)) + and isinstance(expr_stmt := body[1], ExpressionStmt) + and isinstance(yield_expr := expr_stmt.expr, YieldExpr) + and (yield_expr.expr is None or is_literal_none(yield_expr.expr)) + ) + + +def builtin_item_type(tp: Type) -> Type | None: + """Get the item type of a builtin container. + + If 'tp' is not one of the built containers (these includes NamedTuple and TypedDict) + or if the container is not parameterized (like List or List[Any]) + return None. This function is used to narrow optional types in situations like this: + + x: Optional[int] + if x in (1, 2, 3): + x + 42 # OK + + Note: this is only OK for built-in containers, where we know the behavior + of __contains__. + """ + tp = get_proper_type(tp) + + if isinstance(tp, Instance): + if tp.type.fullname in [ + "builtins.list", + "builtins.tuple", + "builtins.dict", + "builtins.set", + "builtins.frozenset", + "_collections_abc.dict_keys", + "typing.KeysView", + ]: + if not tp.args: + # TODO: fix tuple in lib-stub/builtins.pyi (it should be generic). + return None + if not isinstance(get_proper_type(tp.args[0]), AnyType): + return tp.args[0] + elif isinstance(tp, TupleType): + normalized_items = [] + for it in tp.items: + # This use case is probably rare, but not handling unpacks here can cause crashes. + if isinstance(it, UnpackType): + unpacked = get_proper_type(it.type) + if isinstance(unpacked, TypeVarTupleType): + unpacked = get_proper_type(unpacked.upper_bound) + assert ( + isinstance(unpacked, Instance) and unpacked.type.fullname == "builtins.tuple" + ) + normalized_items.append(unpacked.args[0]) + else: + normalized_items.append(it) + if all(not isinstance(it, AnyType) for it in get_proper_types(normalized_items)): + return make_simplified_union(normalized_items) # this type is not externally visible + elif isinstance(tp, TypedDictType): + # TypedDict always has non-optional string keys. Find the key type from the Mapping + # base class. + for base in tp.fallback.type.mro: + if base.fullname == "typing.Mapping": + return map_instance_to_supertype(tp.fallback, base).args[0] + assert False, "No Mapping base class found for TypedDict fallback" + return None + + +def is_unreachable_map(map: TypeMap) -> bool: + return any(isinstance(get_proper_type(v), UninhabitedType) for v in map.values()) + + +def and_conditional_maps(m1: TypeMap, m2: TypeMap, *, use_meet: bool = False) -> TypeMap: + """Calculate what information we can learn from the truth of (e1 and e2) + in terms of the information that we can learn from the truth of e1 and + the truth of e2. + """ + # Both conditions can be true; combine the information. Anything + # we learn from either conditions' truth is valid. If the same + # expression's type is refined by both conditions, we somewhat + # arbitrarily give precedence to m2 unless m1 value is Any. + # In the future, we could use an intersection type or meet_types(). + result = m2.copy() + m2_keys = {literal_hash(n2) for n2 in m2} + for n1 in m1: + if literal_hash(n1) not in m2_keys or isinstance( + get_proper_type(m1[n1]), (AnyType, UninhabitedType) + ): + result[n1] = m1[n1] + if use_meet: + # For now, meet common keys only if specifically requested. + # This is currently used for tuple types narrowing, where having + # a precise result is important. + for n1 in m1: + for n2 in m2: + if literal_hash(n1) == literal_hash(n2): + result[n1] = meet_types(m1[n1], m2[n2]) + return result + + +def or_conditional_maps(m1: TypeMap, m2: TypeMap, *, coalesce_any: bool = False) -> TypeMap: + """Calculate what information we can learn from the truth of (e1 or e2) + in terms of the information that we can learn from the truth of e1 and + the truth of e2. If coalesce_any is True, consider Any a supertype when + joining restrictions. + """ + + if is_unreachable_map(m1): + return m2 + if is_unreachable_map(m2): + return m1 + # Both conditions can be true. Combine information about + # expressions whose type is refined by both conditions. (We do not + # learn anything about expressions whose type is refined by only + # one condition.) + result: dict[Expression, Type] = {} + for n1 in m1: + for n2 in m2: + if literal_hash(n1) == literal_hash(n2): + if coalesce_any and isinstance(get_proper_type(m1[n1]), AnyType): + result[n1] = m1[n1] + else: + result[n1] = make_simplified_union([m1[n1], m2[n2]]) + return result + + +def reduce_conditional_maps( + type_maps: list[tuple[TypeMap, TypeMap]], use_meet: bool = False +) -> tuple[TypeMap, TypeMap]: + """Reduces a list containing pairs of if/else TypeMaps into a single pair. + + We "and" together all of the if TypeMaps and "or" together the else TypeMaps. So + for example, if we had the input: + + [ + ({x: TypeIfX, shared: TypeIfShared1}, {x: TypeElseX, shared: TypeElseShared1}), + ({y: TypeIfY, shared: TypeIfShared2}, {y: TypeElseY, shared: TypeElseShared2}), + ] + + ...we'd return the output: + + ( + {x: TypeIfX, y: TypeIfY, shared: PseudoIntersection[TypeIfShared1, TypeIfShared2]}, + {shared: Union[TypeElseShared1, TypeElseShared2]}, + ) + + ...where "PseudoIntersection[X, Y] == Y" because mypy actually doesn't understand intersections + yet, so we settle for just arbitrarily picking the right expr's type. + + We only retain the shared expression in the 'else' case because we don't actually know + whether x was refined or y was refined -- only just that one of the two was refined. + """ + if len(type_maps) == 0: + return {}, {} + elif len(type_maps) == 1: + return type_maps[0] + else: + final_if_map, final_else_map = type_maps[0] + for if_map, else_map in type_maps[1:]: + final_if_map = and_conditional_maps(final_if_map, if_map, use_meet=use_meet) + final_else_map = or_conditional_maps(final_else_map, else_map) + + return final_if_map, final_else_map + + +def reduce_or_conditional_type_maps(ms: list[TypeMap]) -> TypeMap: + """Reduces a list of TypeMaps into a single TypeMap by "or"-ing them together.""" + if len(ms) == 0: + return {} + if len(ms) == 1: + return ms[0] + result = ms[0] + for m in ms[1:]: + result = or_conditional_maps(result, m) + return result + + +def reduce_and_conditional_type_maps(ms: list[TypeMap], *, use_meet: bool) -> TypeMap: + """Reduces a list of TypeMaps into a single TypeMap by "and"-ing them together.""" + if len(ms) == 0: + return {} + if len(ms) == 1: + return ms[0] + result = ms[0] + for m in ms[1:]: + if not m: + continue # this is a micro-optimisation + result = and_conditional_maps(result, m, use_meet=use_meet) + return result + + +BUILTINS_CUSTOM_EQ_CHECKS: Final = { + "builtins.bytearray", + "builtins.memoryview", + "builtins.frozenset", + "_collections_abc.dict_keys", + "_collections_abc.dict_items", +} + + +def has_custom_eq_checks(t: Type) -> bool: + return ( + custom_special_method(t, "__eq__", check_all=False) + or custom_special_method(t, "__ne__", check_all=False) + # custom_special_method has special casing for builtins.* and typing.* that make the + # above always return False. So here we return True if the a value of a builtin type + # will ever compare equal to value of another type, e.g. a bytes value can compare equal + # to a bytearray value. + or ( + isinstance(pt := get_proper_type(t), Instance) + and pt.type.fullname in BUILTINS_CUSTOM_EQ_CHECKS + ) + ) + + +def convert_to_typetype(type_map: TypeMap) -> TypeMap: + converted_type_map: dict[Expression, Type] = {} + for expr, typ in type_map.items(): + t = typ + if isinstance(t, TypeVarType): + t = t.upper_bound + t = get_proper_type(t) + + # TODO: should we only allow unions of instances as per PEP 484? + if isinstance(t, UninhabitedType): + converted_type_map[expr] = typ + elif isinstance(t, (UnionType, Instance, NoneType)): + converted_type_map[expr] = TypeType.make_normalized(typ) + else: + # unknown type; error was likely reported earlier + return {} + return converted_type_map + + +def flatten(t: Expression) -> list[Expression]: + """Flatten a nested sequence of tuples/lists into one list of nodes.""" + if isinstance(t, (TupleExpr, ListExpr)): + return [b for a in t.items for b in flatten(a)] + elif isinstance(t, StarExpr): + return flatten(t.expr) + else: + return [t] + + +def flatten_types_if_tuple(t: Type) -> list[Type]: + """Flatten a nested sequence of tuples into one list of nodes.""" + t = get_proper_type(t) + if isinstance(t, UnionType): + return [UnionType.make_union([b for a in t.items for b in flatten_types_if_tuple(a)])] + if isinstance(t, TupleType): + return [b for a in t.items for b in flatten_types_if_tuple(a)] + elif is_named_instance(t, "builtins.tuple"): + return [t.args[0]] + return [t] + + +def expand_func(defn: FuncItem, map: dict[TypeVarId, Type]) -> FuncItem: + visitor = TypeTransformVisitor(map) + ret = visitor.node(defn) + assert isinstance(ret, FuncItem) + return ret + + +class TypeTransformVisitor(TransformVisitor): + def __init__(self, map: dict[TypeVarId, Type]) -> None: + super().__init__() + self.map = map + + def type(self, type: Type) -> Type: + return expand_type(type, self.map) + + +def are_argument_counts_overlapping(t: CallableType, s: CallableType) -> bool: + """Can a single call match both t and s, based just on positional argument counts?""" + min_args = max(t.min_args, s.min_args) + max_args = min(t.max_possible_positional_args(), s.max_possible_positional_args()) + return min_args <= max_args + + +def expand_callable_variants(c: CallableType) -> list[CallableType]: + """Expand a generic callable using all combinations of type variables' values/bounds.""" + for tv in c.variables: + # We need to expand self-type before other variables, because this is the only + # type variable that can have other type variables in the upper bound. + if tv.id.is_self(): + c = expand_type(c, {tv.id: tv.upper_bound}).copy_modified( + variables=[v for v in c.variables if not v.id.is_self()] + ) + break + + if not c.is_generic(): + # Fast path. + return [c] + + tvar_values = [] + for tvar in c.variables: + if isinstance(tvar, TypeVarType) and tvar.values: + tvar_values.append(tvar.values) + else: + tvar_values.append([tvar.upper_bound]) + + variants = [] + for combination in itertools.product(*tvar_values): + tvar_map = {tv.id: subst for (tv, subst) in zip(c.variables, combination)} + variants.append(expand_type(c, tvar_map).copy_modified(variables=[])) + return variants + + +def is_unsafe_overlapping_overload_signatures( + signature: CallableType, + other: CallableType, + class_type_vars: list[TypeVarLikeType], + partial_only: bool = True, +) -> bool: + """Check if two overloaded signatures are unsafely overlapping or partially overlapping. + + We consider two functions 's' and 't' to be unsafely overlapping if three + conditions hold: + + 1. s's parameters are partially overlapping with t's. i.e. there are calls that are + valid for both signatures. + 2. for these common calls, some of t's parameters types are wider that s's. + 3. s's return type is NOT a subset of t's. + + Note that we use subset rather than subtype relationship in these checks because: + * Overload selection happens at runtime, not statically. + * This results in more lenient behavior. + This can cause false negatives (e.g. if overloaded function returns an externally + visible attribute with invariant type), but such situations are rare. In general, + overloads in Python are generally unsafe, so we intentionally try to avoid giving + non-actionable errors (see more details in comments below). + + Assumes that 'signature' appears earlier in the list of overload + alternatives then 'other' and that their argument counts are overlapping. + """ + # Try detaching callables from the containing class so that all TypeVars + # are treated as being free, i.e. the signature is as seen from inside the class, + # where "self" is not yet bound to anything. + signature = detach_callable(signature, class_type_vars) + other = detach_callable(other, class_type_vars) + + # Note: We repeat this check twice in both directions compensate for slight + # asymmetries in 'is_callable_compatible'. + + other_expanded = expand_callable_variants(other) + for sig_variant in expand_callable_variants(signature): + for other_variant in other_expanded: + # Using only expanded callables may cause false negatives, we can add + # more variants (e.g. using inference between callables) in the future. + if is_subset_no_promote(sig_variant.ret_type, other_variant.ret_type): + continue + if not ( + is_callable_compatible( + sig_variant, + other_variant, + is_compat=is_overlapping_types_for_overload, + check_args_covariantly=False, + is_proper_subtype=False, + is_compat_return=lambda l, r: not is_subset_no_promote(l, r), + allow_partial_overlap=True, + ) + or is_callable_compatible( + other_variant, + sig_variant, + is_compat=is_overlapping_types_for_overload, + check_args_covariantly=True, + is_proper_subtype=False, + is_compat_return=lambda l, r: not is_subset_no_promote(r, l), + allow_partial_overlap=True, + ) + ): + continue + # Using the same `allow_partial_overlap` flag as before, can cause false + # negatives in case where star argument is used in a catch-all fallback overload. + # But again, practicality beats purity here. + if not partial_only or not is_callable_compatible( + other_variant, + sig_variant, + is_compat=is_subset_no_promote, + check_args_covariantly=True, + is_proper_subtype=False, + ignore_return=True, + allow_partial_overlap=True, + ): + return True + return False + + +def detach_callable(typ: CallableType, class_type_vars: list[TypeVarLikeType]) -> CallableType: + """Ensures that the callable's type variables are 'detached' and independent of the context. + + A callable normally keeps track of the type variables it uses within its 'variables' field. + However, if the callable is from a method and that method is using a class type variable, + the callable will not keep track of that type variable since it belongs to the class. + """ + if not class_type_vars: + # Fast path, nothing to update. + return typ + return typ.copy_modified(variables=list(typ.variables) + class_type_vars) + + +def overload_can_never_match(signature: CallableType, other: CallableType) -> bool: + """Check if the 'other' method can never be matched due to 'signature'. + + This can happen if signature's parameters are all strictly broader then + other's parameters. + + Assumes that both signatures have overlapping argument counts. + """ + # The extra erasure is needed to prevent spurious errors + # in situations where an `Any` overload is used as a fallback + # for an overload with type variables. The spurious error appears + # because the type variables turn into `Any` during unification in + # the below subtype check and (surprisingly?) `is_proper_subtype(Any, Any)` + # returns `True`. + # TODO: find a cleaner solution instead of this ad-hoc erasure. + exp_signature = expand_type( + signature, {tvar.id: erase_def_to_union_or_bound(tvar) for tvar in signature.variables} + ) + return is_callable_compatible( + exp_signature, other, is_compat=is_more_precise, is_proper_subtype=True, ignore_return=True + ) + + +def is_more_general_arg_prefix(t: FunctionLike, s: FunctionLike) -> bool: + """Does t have wider arguments than s?""" + # TODO should an overload with additional items be allowed to be more + # general than one with fewer items (or just one item)? + if isinstance(t, CallableType): + if isinstance(s, CallableType): + return is_callable_compatible( + t, s, is_compat=is_proper_subtype, is_proper_subtype=True, ignore_return=True + ) + elif isinstance(t, FunctionLike): + if isinstance(s, FunctionLike): + if len(t.items) == len(s.items): + return all( + is_same_arg_prefix(items, itemt) for items, itemt in zip(t.items, s.items) + ) + return False + + +def is_same_arg_prefix(t: CallableType, s: CallableType) -> bool: + return is_callable_compatible( + t, + s, + is_compat=is_same_type, + is_proper_subtype=True, + ignore_return=True, + check_args_covariantly=True, + ignore_pos_arg_names=True, + ) + + +def infer_operator_assignment_method(typ: Type, operator: str) -> tuple[bool, str]: + """Determine if operator assignment on given value type is in-place, and the method name. + + For example, if operator is '+', return (True, '__iadd__') or (False, '__add__') + depending on which method is supported by the type. + """ + typ = get_proper_type(typ) + method = operators.op_methods[operator] + existing_method = None + if isinstance(typ, Instance): + existing_method = _find_inplace_method(typ, method, operator) + elif isinstance(typ, TypedDictType): + existing_method = _find_inplace_method(typ.fallback, method, operator) + + if existing_method is not None: + return True, existing_method + return False, method + + +def _find_inplace_method(inst: Instance, method: str, operator: str) -> str | None: + if operator in operators.ops_with_inplace_method: + inplace_method = "__i" + method[2:] + if inst.type.has_readable_member(inplace_method): + return inplace_method + return None + + +def is_valid_inferred_type( + typ: Type, options: Options, is_lvalue_final: bool = False, is_lvalue_member: bool = False +) -> bool: + """Is an inferred type valid and needs no further refinement? + + Examples of invalid types include the None type (when we are not assigning + None to a final lvalue) or List[]. + + When not doing strict Optional checking, all types containing None are + invalid. When doing strict Optional checking, only None and types that are + incompletely defined (i.e. contain UninhabitedType) are invalid. + """ + proper_type = get_proper_type(typ) + if isinstance(proper_type, NoneType): + # If the lvalue is final, we may immediately infer NoneType when the + # initializer is None. + # + # If not, we want to defer making this decision. The final inferred + # type could either be NoneType or an Optional type, depending on + # the context. This resolution happens in leave_partial_types when + # we pop a partial types scope. + return is_lvalue_final or (not is_lvalue_member and options.allow_redefinition_new) + elif isinstance(proper_type, UninhabitedType): + return False + return not typ.accept(InvalidInferredTypes()) + + +class InvalidInferredTypes(BoolTypeQuery): + """Find type components that are not valid for an inferred type. + + These include type, and any uninhabited types resulting from failed + (ambiguous) type inference. + """ + + def __init__(self) -> None: + super().__init__(ANY_STRATEGY) + + def visit_uninhabited_type(self, t: UninhabitedType) -> bool: + return t.ambiguous + + def visit_erased_type(self, t: ErasedType) -> bool: + # This can happen inside a lambda. + return True + + def visit_type_var(self, t: TypeVarType) -> bool: + # This is needed to prevent leaking into partial types during + # multi-step type inference. + return t.id.is_meta_var() + + def visit_tuple_type(self, t: TupleType, /) -> bool: + # Exclude fallback to avoid bogus "need type annotation" errors + return self.query_types(t.items) + + +class SetNothingToAny(TypeTranslator): + """Replace all ambiguous Uninhabited types with Any (to avoid spurious extra errors).""" + + def visit_uninhabited_type(self, t: UninhabitedType) -> Type: + if t.ambiguous: + return AnyType(TypeOfAny.from_error) + return t + + def visit_type_alias_type(self, t: TypeAliasType) -> Type: + # Target of the alias cannot be an ambiguous UninhabitedType, so we just + # replace the arguments. + return t.copy_modified(args=[a.accept(self) for a in t.args]) + + +def is_classmethod_node(node: SymbolNode | None) -> bool | None: + """Find out if a node describes a classmethod.""" + if isinstance(node, Decorator): + node = node.func + if isinstance(node, FuncDef): + return node.is_class + if isinstance(node, Var): + return node.is_classmethod + return None + + +def is_node_static(node: SymbolNode | None) -> bool | None: + """Find out if a node describes a static function method.""" + if isinstance(node, Decorator): + node = node.func + if isinstance(node, FuncDef): + return node.is_static + if isinstance(node, Var): + return node.is_staticmethod + return None + + +TKey = TypeVar("TKey") +TValue = TypeVar("TValue") + + +class DisjointDict(Generic[TKey, TValue]): + """An variation of the union-find algorithm/data structure where instead of keeping + track of just disjoint sets, we keep track of disjoint dicts -- keep track of multiple + Set[Key] -> Set[Value] mappings, where each mapping's keys are guaranteed to be disjoint. + + This data structure is currently used exclusively by 'group_comparison_operands' below + to merge chains of '==' and 'is' comparisons when two or more chains use the same expression + in best-case O(n), where n is the number of operands. + + Specifically, the `add_mapping()` function and `items()` functions will take on average + O(k + v) and O(n) respectively, where k and v are the number of keys and values we're adding + for a given chain. Note that k <= n and v <= n. + + We hit these average/best-case scenarios for most user code: e.g. when the user has just + a single chain like 'a == b == c == d == ...' or multiple disjoint chains like + 'a==b < c==d < e==f < ...'. (Note that a naive iterative merging would be O(n^2) for + the latter case). + + In comparison, this data structure will make 'group_comparison_operands' have a worst-case + runtime of O(n*log(n)): 'add_mapping()' and 'items()' are worst-case O(k*log(n) + v) and + O(k*log(n)) respectively. This happens only in the rare case where the user keeps repeatedly + making disjoint mappings before merging them in a way that persistently dodges the path + compression optimization in '_lookup_root_id', which would end up constructing a single + tree of height log_2(n). This makes root lookups no longer amoritized constant time when we + finally call 'items()'. + """ + + def __init__(self) -> None: + # Each key maps to a unique ID + self._key_to_id: dict[TKey, int] = {} + + # Each id points to the parent id, forming a forest of upwards-pointing trees. If the + # current id already is the root, it points to itself. We gradually flatten these trees + # as we perform root lookups: eventually all nodes point directly to its root. + self._id_to_parent_id: dict[int, int] = {} + + # Each root id in turn maps to the set of values. + self._root_id_to_values: dict[int, set[TValue]] = {} + + def add_mapping(self, keys: set[TKey], values: set[TValue]) -> None: + """Adds a 'Set[TKey] -> Set[TValue]' mapping. If there already exists a mapping + containing one or more of the given keys, we merge the input mapping with the old one. + + Note that the given set of keys must be non-empty -- otherwise, nothing happens. + """ + if not keys: + return + + subtree_roots = [self._lookup_or_make_root_id(key) for key in keys] + new_root = subtree_roots[0] + + root_values = self._root_id_to_values[new_root] + root_values.update(values) + for subtree_root in subtree_roots[1:]: + if subtree_root == new_root or subtree_root not in self._root_id_to_values: + continue + self._id_to_parent_id[subtree_root] = new_root + root_values.update(self._root_id_to_values.pop(subtree_root)) + + def items(self) -> list[tuple[set[TKey], set[TValue]]]: + """Returns all disjoint mappings in key-value pairs.""" + root_id_to_keys: dict[int, set[TKey]] = {} + for key in self._key_to_id: + root_id = self._lookup_root_id(key) + if root_id not in root_id_to_keys: + root_id_to_keys[root_id] = set() + root_id_to_keys[root_id].add(key) + + output = [] + for root_id, keys in root_id_to_keys.items(): + output.append((keys, self._root_id_to_values[root_id])) + + return output + + def _lookup_or_make_root_id(self, key: TKey) -> int: + if key in self._key_to_id: + return self._lookup_root_id(key) + else: + new_id = len(self._key_to_id) + self._key_to_id[key] = new_id + self._id_to_parent_id[new_id] = new_id + self._root_id_to_values[new_id] = set() + return new_id + + def _lookup_root_id(self, key: TKey) -> int: + i = self._key_to_id[key] + while i != self._id_to_parent_id[i]: + # Optimization: make keys directly point to their grandparents to speed up + # future traversals. This prevents degenerate trees of height n from forming. + new_parent = self._id_to_parent_id[self._id_to_parent_id[i]] + self._id_to_parent_id[i] = new_parent + i = new_parent + return i + + +def group_comparison_operands( + pairwise_comparisons: Iterable[tuple[str, Expression, Expression]], + operand_to_literal_hash: Mapping[int, Key], + operators_to_group: set[str], +) -> list[tuple[str, list[int]]]: + """Group a series of comparison operands together chained by any operand + in the 'operators_to_group' set. All other pairwise operands are kept in + groups of size 2. + + For example, suppose we have the input comparison expression: + + x0 == x1 == x2 < x3 < x4 is x5 is x6 is not x7 is not x8 + + If we get these expressions in a pairwise way (e.g. by calling ComparisonExpr's + 'pairwise()' method), we get the following as input: + + [('==', x0, x1), ('==', x1, x2), ('<', x2, x3), ('<', x3, x4), + ('is', x4, x5), ('is', x5, x6), ('is not', x6, x7), ('is not', x7, x8)] + + If `operators_to_group` is the set {'==', 'is'}, this function will produce + the following "simplified operator list": + + [("==", [0, 1, 2]), ("<", [2, 3]), ("<", [3, 4]), + ("is", [4, 5, 6]), ("is not", [6, 7]), ("is not", [7, 8])] + + Note that (a) we yield *indices* to the operands rather then the operand + expressions themselves and that (b) operands used in a consecutive chain + of '==' or 'is' are grouped together. + + If two of these chains happen to contain operands with the same underlying + literal hash (e.g. are assignable and correspond to the same expression), + we combine those chains together. For example, if we had: + + same == x < y == same + + ...and if 'operand_to_literal_hash' contained the same values for the indices + 0 and 3, we'd produce the following output: + + [("==", [0, 1, 2, 3]), ("<", [1, 2])] + + But if the 'operand_to_literal_hash' did *not* contain an entry, we'd instead + default to returning: + + [("==", [0, 1]), ("<", [1, 2]), ("==", [2, 3])] + + This function is currently only used to assist with type-narrowing refinements + and is extracted out to a helper function so we can unit test it. + """ + groups: dict[str, DisjointDict[Key, int]] = {op: DisjointDict() for op in operators_to_group} + + simplified_operator_list: list[tuple[str, list[int]]] = [] + last_operator: str | None = None + current_indices: set[int] = set() + current_hashes: set[Key] = set() + for i, (operator, left_expr, right_expr) in enumerate(pairwise_comparisons): + if last_operator is None: + last_operator = operator + + if current_indices and (operator != last_operator or operator not in operators_to_group): + # If some of the operands in the chain are assignable, defer adding it: we might + # end up needing to merge it with other chains that appear later. + if not current_hashes: + simplified_operator_list.append((last_operator, sorted(current_indices))) + else: + groups[last_operator].add_mapping(current_hashes, current_indices) + last_operator = operator + current_indices = set() + current_hashes = set() + + # Note: 'i' corresponds to the left operand index, so 'i + 1' is the + # right operand. + current_indices.add(i) + current_indices.add(i + 1) + + # We only ever want to combine operands/combine chains for these operators + if operator in operators_to_group: + left_hash = operand_to_literal_hash.get(i) + if left_hash is not None: + current_hashes.add(left_hash) + right_hash = operand_to_literal_hash.get(i + 1) + if right_hash is not None: + current_hashes.add(right_hash) + + if last_operator is not None: + if not current_hashes: + simplified_operator_list.append((last_operator, sorted(current_indices))) + else: + groups[last_operator].add_mapping(current_hashes, current_indices) + + # Now that we know which chains happen to contain the same underlying expressions + # and can be merged together, add in this info back to the output. + for operator, disjoint_dict in groups.items(): + for keys, indices in disjoint_dict.items(): + simplified_operator_list.append((operator, sorted(indices))) + + # For stability, reorder list by the first operand index to appear + simplified_operator_list.sort(key=lambda item: item[1][0]) + return simplified_operator_list + + +def is_typed_callable(c: Type | None) -> bool: + c = get_proper_type(c) + if not c or not isinstance(c, CallableType): + return False + return not all( + isinstance(t, AnyType) and t.type_of_any == TypeOfAny.unannotated + for t in get_proper_types(c.arg_types + [c.ret_type]) + ) + + +def is_untyped_decorator(typ: Type | None) -> bool: + typ = get_proper_type(typ) + if not typ: + return True + elif isinstance(typ, CallableType): + return not is_typed_callable(typ) + elif isinstance(typ, Instance): + method = typ.type.get_method("__call__") + if method: + if isinstance(method, Decorator): + return is_untyped_decorator(method.func.type) or is_untyped_decorator( + method.var.type + ) + + if isinstance(method.type, Overloaded): + return any(is_untyped_decorator(item) for item in method.type.items) + else: + return not is_typed_callable(method.type) + else: + return False + elif isinstance(typ, Overloaded): + return any(is_untyped_decorator(item) for item in typ.items) + return True + + +def is_static(func: FuncBase | Decorator) -> bool: + if isinstance(func, Decorator): + return is_static(func.func) + elif isinstance(func, FuncBase): + return func.is_static + assert False, f"Unexpected func type: {type(func)}" + + +def is_property(defn: SymbolNode) -> bool: + if isinstance(defn, FuncDef): + return defn.is_property + if isinstance(defn, Decorator): + return defn.func.is_property + if isinstance(defn, OverloadedFuncDef): + if defn.items and isinstance(defn.items[0], Decorator): + return defn.items[0].func.is_property + return False + + +def is_settable_property(defn: SymbolNode | None) -> TypeGuard[OverloadedFuncDef]: + if isinstance(defn, OverloadedFuncDef): + if defn.items and isinstance(defn.items[0], Decorator): + return defn.items[0].func.is_property + return False + + +def is_custom_settable_property(defn: SymbolNode | None) -> bool: + """Check if a node is a settable property with a non-trivial setter type. + + By non-trivial here we mean that it is known (i.e. definition was already type + checked), it is not Any, and it is different from the property getter type. + """ + if defn is None: + return False + if not is_settable_property(defn): + return False + first_item = defn.items[0] + assert isinstance(first_item, Decorator) + if not first_item.var.is_settable_property: + return False + var = first_item.var + if var.type is None or var.setter_type is None or isinstance(var.type, PartialType): + # The caller should defer in case of partial types or not ready variables. + return False + setter_type = var.setter_type.arg_types[1] + if isinstance(get_proper_type(setter_type), AnyType): + return False + return not is_same_type(get_property_type(get_proper_type(var.type)), setter_type) + + +def get_property_type(t: ProperType) -> ProperType: + if isinstance(t, CallableType): + return get_proper_type(t.ret_type) + if isinstance(t, Overloaded): + return get_proper_type(t.items[0].ret_type) + return t + + +def is_subset_no_promote(left: Type, right: Type) -> bool: + return is_subtype(left, right, ignore_promotions=True, always_covariant=True) + + +def is_overlapping_types_for_overload(left: Type, right: Type) -> bool: + # Note that among other effects 'overlap_for_overloads' flag will effectively + # ignore possible overlap between type variables and None. This is technically + # unsafe, but unsafety is tiny and this prevents some common use cases like: + # @overload + # def foo(x: None) -> None: .. + # @overload + # def foo(x: T) -> Foo[T]: ... + return is_overlapping_types(left, right, ignore_promotions=True, overlap_for_overloads=True) + + +def is_private(node_name: str) -> bool: + """Check if node is private to class definition.""" + return node_name.startswith("__") and not node_name.endswith("__") + + +def is_string_literal(typ: Type) -> bool: + strs = try_getting_str_literals_from_type(typ) + return strs is not None and len(strs) == 1 + + +def has_bool_item(typ: ProperType) -> bool: + """Return True if type is 'bool' or a union with a 'bool' item.""" + if is_named_instance(typ, "builtins.bool"): + return True + if isinstance(typ, UnionType): + return any(is_named_instance(item, "builtins.bool") for item in typ.items) + return False + + +def collapse_walrus(e: Expression) -> Expression: + """If an expression is an AssignmentExpr, pull out the assignment target. + + We don't make any attempt to pull out all the targets in code like `x := (y := z)`. + We could support narrowing those if that sort of code turns out to be common. + """ + if isinstance(e, AssignmentExpr): + return e.target + return e + + +def find_last_var_assignment_line(n: Node, v: Var) -> int: + """Find the highest line number of a potential assignment to variable within node. + + This supports local and global variables. + + Return -1 if no assignment was found. + """ + visitor = VarAssignVisitor(v) + n.accept(visitor) + return visitor.last_line + + +class VarAssignVisitor(TraverserVisitor): + def __init__(self, v: Var) -> None: + self.last_line = -1 + self.lvalue = False + self.var_node = v + + def visit_assignment_stmt(self, s: AssignmentStmt) -> None: + self.lvalue = True + for lv in s.lvalues: + lv.accept(self) + self.lvalue = False + + def visit_name_expr(self, e: NameExpr) -> None: + if self.lvalue and e.node is self.var_node: + self.last_line = max(self.last_line, e.line) + + def visit_member_expr(self, e: MemberExpr) -> None: + old_lvalue = self.lvalue + self.lvalue = False + super().visit_member_expr(e) + self.lvalue = old_lvalue + + def visit_index_expr(self, e: IndexExpr) -> None: + old_lvalue = self.lvalue + self.lvalue = False + super().visit_index_expr(e) + self.lvalue = old_lvalue + + def visit_with_stmt(self, s: WithStmt) -> None: + self.lvalue = True + for lv in s.target: + if lv is not None: + lv.accept(self) + self.lvalue = False + s.body.accept(self) + + def visit_for_stmt(self, s: ForStmt) -> None: + self.lvalue = True + s.index.accept(self) + self.lvalue = False + s.body.accept(self) + if s.else_body: + s.else_body.accept(self) + + def visit_assignment_expr(self, e: AssignmentExpr) -> None: + self.lvalue = True + e.target.accept(self) + self.lvalue = False + e.value.accept(self) + + def visit_as_pattern(self, p: AsPattern) -> None: + if p.pattern is not None: + p.pattern.accept(self) + if p.name is not None: + self.lvalue = True + p.name.accept(self) + self.lvalue = False + + def visit_starred_pattern(self, p: StarredPattern) -> None: + if p.capture is not None: + self.lvalue = True + p.capture.accept(self) + self.lvalue = False + + +def ambiguous_enum_equality_keys(t: Type) -> set[str]: + """ + Used when narrowing types based on equality. + + Certain kinds of enums can compare equal to values of other types, so doing type math + the way `conditional_types` does will be misleading if you expect it to correspond to + conditions based on equality comparisons. + + For example, StrEnum classes can compare equal to str values. So if we see + `val: StrEnum; if val == "foo": ...` we currently avoid narrowing. + Note that we do wish to continue narrowing for `if val == StrEnum.MEMBER: ...` + """ + # We need these things for this to be ambiguous: + # (1) an IntEnum or StrEnum type or enum subclass of int or str + # (2) either a different IntEnum/StrEnum type or a non-enum type ("") + result = set() + t = get_proper_type(t) + if isinstance(t, UnionType): + for item in t.items: + result.update(ambiguous_enum_equality_keys(item)) + elif isinstance(t, Instance): + if t.last_known_value: + result.update(ambiguous_enum_equality_keys(t.last_known_value)) + elif t.type.is_enum and any( + base.fullname in ("enum.IntEnum", "enum.StrEnum", "builtins.str", "builtins.int") + for base in t.type.mro + ): + result.add(t.type.fullname) + elif not t.type.is_enum: + # These might compare equal to IntEnum/StrEnum types (e.g. Decimal), so + # let's be conservative + result.add("") + elif isinstance(t, LiteralType): + result.update(ambiguous_enum_equality_keys(t.fallback)) + elif isinstance(t, NoneType): + pass + else: + result.add("") + return result + + +def is_typeddict_type_context(lvalue_type: Type) -> bool: + lvalue_type = get_proper_type(lvalue_type) + if isinstance(lvalue_type, TypedDictType): + return True + if isinstance(lvalue_type, UnionType): + for item in lvalue_type.items: + if is_typeddict_type_context(item): + return True + return False + + +def is_method(node: SymbolNode | None) -> bool: + if isinstance(node, OverloadedFuncDef): + return not node.is_property + if isinstance(node, Decorator): + return not node.var.is_property + return isinstance(node, FuncDef) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checker_shared.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checker_shared.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..9e0fca4262f409836a0c5d8fbe0b8fe38f306dac Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checker_shared.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checker_shared.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checker_shared.py new file mode 100644 index 0000000000000000000000000000000000000000..55d9e15764178f8599b9f366b8879d37069afbc2 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checker_shared.py @@ -0,0 +1,365 @@ +"""Shared definitions used by different parts of type checker.""" + +from __future__ import annotations + +from abc import abstractmethod +from collections.abc import Iterator, Sequence, Set as AbstractSet +from contextlib import contextmanager +from typing import NamedTuple, overload + +from mypy_extensions import trait + +from mypy.errorcodes import ErrorCode +from mypy.errors import ErrorWatcher +from mypy.message_registry import ErrorMessage +from mypy.nodes import ( + ArgKind, + Context, + Expression, + FuncItem, + LambdaExpr, + MypyFile, + Node, + RefExpr, + SymbolNode, + TypeInfo, + Var, +) +from mypy.plugin import CheckerPluginInterface, Plugin +from mypy.types import ( + CallableType, + Instance, + LiteralValue, + Overloaded, + PartialType, + TupleType, + Type, + TypedDictType, + TypeType, +) +from mypy.typevars import fill_typevars + + +# An object that represents either a precise type or a type with an upper bound; +# it is important for correct type inference with isinstance. +class TypeRange(NamedTuple): + item: Type + is_upper_bound: bool # False => precise type + + +@trait +class ExpressionCheckerSharedApi: + @abstractmethod + def accept( + self, + node: Expression, + type_context: Type | None = None, + allow_none_return: bool = False, + always_allow_any: bool = False, + is_callee: bool = False, + ) -> Type: + raise NotImplementedError + + @abstractmethod + def analyze_ref_expr(self, e: RefExpr, lvalue: bool = False) -> Type: + raise NotImplementedError + + @abstractmethod + def check_call( + self, + callee: Type, + args: list[Expression], + arg_kinds: list[ArgKind], + context: Context, + arg_names: Sequence[str | None] | None = None, + callable_node: Expression | None = None, + callable_name: str | None = None, + object_type: Type | None = None, + original_type: Type | None = None, + ) -> tuple[Type, Type]: + raise NotImplementedError + + @abstractmethod + def transform_callee_type( + self, + callable_name: str | None, + callee: Type, + args: list[Expression], + arg_kinds: list[ArgKind], + context: Context, + arg_names: Sequence[str | None] | None = None, + object_type: Type | None = None, + ) -> Type: + raise NotImplementedError + + @abstractmethod + def method_fullname(self, object_type: Type, method_name: str) -> str | None: + raise NotImplementedError + + @abstractmethod + def check_method_call_by_name( + self, + method: str, + base_type: Type, + args: list[Expression], + arg_kinds: list[ArgKind], + context: Context, + original_type: Type | None = None, + ) -> tuple[Type, Type]: + raise NotImplementedError + + @abstractmethod + def visit_typeddict_index_expr( + self, td_type: TypedDictType, index: Expression, setitem: bool = False + ) -> tuple[Type, set[str]]: + raise NotImplementedError + + @abstractmethod + def infer_literal_expr_type(self, value: LiteralValue, fallback_name: str) -> Type: + raise NotImplementedError + + @abstractmethod + def analyze_static_reference( + self, + node: SymbolNode, + ctx: Context, + is_lvalue: bool, + *, + include_modules: bool = True, + suppress_errors: bool = False, + ) -> Type: + raise NotImplementedError + + +@trait +class TypeCheckerSharedApi(CheckerPluginInterface): + plugin: Plugin + module_refs: set[str] + scope: CheckerScope + checking_missing_await: bool + allow_constructor_cache: bool + + @property + @abstractmethod + def expr_checker(self) -> ExpressionCheckerSharedApi: + raise NotImplementedError + + @abstractmethod + def named_type(self, name: str) -> Instance: + raise NotImplementedError + + @abstractmethod + def lookup_typeinfo(self, fullname: str) -> TypeInfo: + raise NotImplementedError + + @abstractmethod + def lookup_type(self, node: Expression) -> Type: + raise NotImplementedError + + @abstractmethod + def handle_cannot_determine_type(self, name: str, context: Context) -> None: + raise NotImplementedError + + @abstractmethod + def handle_partial_var_type( + self, typ: PartialType, is_lvalue: bool, node: Var, context: Context + ) -> Type: + raise NotImplementedError + + @overload + @abstractmethod + def check_subtype( + self, + subtype: Type, + supertype: Type, + context: Context, + msg: str, + subtype_label: str | None = None, + supertype_label: str | None = None, + *, + notes: list[str] | None = None, + code: ErrorCode | None = None, + outer_context: Context | None = None, + ) -> bool: ... + + @overload + @abstractmethod + def check_subtype( + self, + subtype: Type, + supertype: Type, + context: Context, + msg: ErrorMessage, + subtype_label: str | None = None, + supertype_label: str | None = None, + *, + notes: list[str] | None = None, + outer_context: Context | None = None, + ) -> bool: ... + + # Unfortunately, mypyc doesn't support abstract overloads yet. + @abstractmethod + def check_subtype( + self, + subtype: Type, + supertype: Type, + context: Context, + msg: str | ErrorMessage, + subtype_label: str | None = None, + supertype_label: str | None = None, + *, + notes: list[str] | None = None, + code: ErrorCode | None = None, + outer_context: Context | None = None, + ) -> bool: + raise NotImplementedError + + @abstractmethod + def get_final_context(self) -> bool: + raise NotImplementedError + + @overload + @abstractmethod + def conditional_types_with_intersection( + self, + expr_type: Type, + type_ranges: list[TypeRange] | None, + ctx: Context, + default: None = None, + ) -> tuple[Type | None, Type | None]: ... + + @overload + @abstractmethod + def conditional_types_with_intersection( + self, expr_type: Type, type_ranges: list[TypeRange] | None, ctx: Context, default: Type + ) -> tuple[Type, Type]: ... + + # Unfortunately, mypyc doesn't support abstract overloads yet. + @abstractmethod + def conditional_types_with_intersection( + self, + expr_type: Type, + type_ranges: list[TypeRange] | None, + ctx: Context, + default: Type | None = None, + ) -> tuple[Type | None, Type | None]: + raise NotImplementedError + + @abstractmethod + def narrow_type_by_identity_equality( + self, + operator: str, + operands: list[Expression], + operand_types: list[Type], + expr_indices: list[int], + narrowable_indices: AbstractSet[int], + ) -> tuple[dict[Expression, Type] | None, dict[Expression, Type] | None]: + raise NotImplementedError + + @abstractmethod + def check_deprecated(self, node: Node | None, context: Context) -> None: + raise NotImplementedError + + @abstractmethod + def warn_deprecated(self, node: Node | None, context: Context) -> None: + raise NotImplementedError + + @abstractmethod + def type_is_iterable(self, type: Type) -> bool: + raise NotImplementedError + + @abstractmethod + def iterable_item_type( + self, it: Instance | CallableType | TypeType | Overloaded, context: Context + ) -> Type: + raise NotImplementedError + + @abstractmethod + @contextmanager + def checking_await_set(self) -> Iterator[None]: + raise NotImplementedError + + @abstractmethod + def get_precise_awaitable_type(self, typ: Type, local_errors: ErrorWatcher) -> Type | None: + raise NotImplementedError + + @abstractmethod + def add_any_attribute_to_type(self, typ: Type, name: str) -> Type: + raise NotImplementedError + + @abstractmethod + def is_defined_in_stub(self, typ: Instance, /) -> bool: + raise NotImplementedError + + +class CheckerScope: + # We keep two stacks combined, to maintain the relative order + stack: list[TypeInfo | FuncItem | MypyFile] + + def __init__(self, module: MypyFile) -> None: + self.stack = [module] + + def current_function(self) -> FuncItem | None: + for e in reversed(self.stack): + if isinstance(e, FuncItem): + return e + return None + + def top_level_function(self) -> FuncItem | None: + """Return top-level non-lambda function.""" + for e in self.stack: + if isinstance(e, FuncItem) and not isinstance(e, LambdaExpr): + return e + return None + + def active_class(self) -> TypeInfo | None: + if isinstance(self.stack[-1], TypeInfo): + return self.stack[-1] + return None + + def enclosing_class(self, func: FuncItem | None = None) -> TypeInfo | None: + """Is there a class *directly* enclosing this function?""" + func = func or self.current_function() + assert func, "This method must be called from inside a function" + index = self.stack.index(func) + assert index, "CheckerScope stack must always start with a module" + enclosing = self.stack[index - 1] + if isinstance(enclosing, TypeInfo): + return enclosing + return None + + def active_self_type(self) -> Instance | TupleType | None: + """An instance or tuple type representing the current class. + + This returns None unless we are in class body or in a method. + In particular, inside a function nested in method this returns None. + """ + info = self.active_class() + if not info and self.current_function(): + info = self.enclosing_class() + if info: + return fill_typevars(info) + return None + + def current_self_type(self) -> Instance | TupleType | None: + """Same as active_self_type() but handle functions nested in methods.""" + for item in reversed(self.stack): + if isinstance(item, TypeInfo): + return fill_typevars(item) + return None + + def is_top_level(self) -> bool: + """Is current scope top-level (no classes or functions)?""" + return len(self.stack) == 1 + + @contextmanager + def push_function(self, item: FuncItem) -> Iterator[None]: + self.stack.append(item) + yield + self.stack.pop() + + @contextmanager + def push_class(self, info: TypeInfo) -> Iterator[None]: + self.stack.append(info) + yield + self.stack.pop() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checker_state.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checker_state.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..3b6bf51e88273bd2c257f4ca4bbaa6763687d508 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checker_state.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checker_state.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checker_state.py new file mode 100644 index 0000000000000000000000000000000000000000..9b988ad18ba4f7cc46e1946f8a6f2343da322084 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checker_state.py @@ -0,0 +1,30 @@ +from __future__ import annotations + +from collections.abc import Iterator +from contextlib import contextmanager +from typing import Final + +from mypy.checker_shared import TypeCheckerSharedApi + +# This is global mutable state. Don't add anything here unless there's a very +# good reason. + + +class TypeCheckerState: + # Wrap this in a class since it's faster that using a module-level attribute. + + def __init__(self, type_checker: TypeCheckerSharedApi | None) -> None: + # Value varies by file being processed + self.type_checker = type_checker + + @contextmanager + def set(self, value: TypeCheckerSharedApi) -> Iterator[None]: + saved = self.type_checker + self.type_checker = value + try: + yield + finally: + self.type_checker = saved + + +checker_state: Final = TypeCheckerState(type_checker=None) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checkexpr.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checkexpr.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..0f5d8b4962ffc49f7ba96da8df36364108e7da88 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checkexpr.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checkexpr.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checkexpr.py new file mode 100644 index 0000000000000000000000000000000000000000..84d8fa67fd177453f3dbb85c344e7a80fb981cd8 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checkexpr.py @@ -0,0 +1,6904 @@ +"""Expression type checker. This file is conceptually part of TypeChecker.""" + +from __future__ import annotations + +import enum +import itertools +import time +from collections import defaultdict +from collections.abc import Callable, Iterable, Iterator, Sequence +from contextlib import contextmanager, nullcontext +from typing import ClassVar, Final, TypeAlias as _TypeAlias, cast, overload +from typing_extensions import assert_never + +import mypy.checker +import mypy.errorcodes as codes +from mypy import applytype, erasetype, join, message_registry, nodes, operators, types +from mypy.argmap import ArgTypeExpander, map_actuals_to_formals, map_formals_to_actuals +from mypy.checker_shared import ExpressionCheckerSharedApi +from mypy.checkmember import analyze_member_access, has_operator +from mypy.checkstrformat import StringFormatterChecker +from mypy.constant_fold import constant_fold_expr +from mypy.erasetype import erase_type, remove_instance_last_known_values, replace_meta_vars +from mypy.errors import ErrorInfo, ErrorWatcher, report_internal_error +from mypy.expandtype import ( + expand_type, + expand_type_by_instance, + freshen_all_functions_type_vars, + freshen_function_type_vars, +) +from mypy.exprtotype import TypeTranslationError, expr_to_unanalyzed_type +from mypy.infer import ArgumentInferContext, infer_function_type_arguments, infer_type_arguments +from mypy.literals import literal +from mypy.lookup import lookup_fully_qualified +from mypy.maptype import map_instance_to_supertype +from mypy.meet import is_overlapping_types, narrow_declared_type +from mypy.message_registry import ErrorMessage +from mypy.messages import MessageBuilder, format_type +from mypy.nodes import ( + ARG_NAMED, + ARG_POS, + ARG_STAR, + ARG_STAR2, + IMPLICITLY_ABSTRACT, + LAMBDA_NAME, + LITERAL_TYPE, + REVEAL_LOCALS, + REVEAL_TYPE, + UNBOUND_IMPORTED, + ArgKind, + AssertTypeExpr, + AssignmentExpr, + AwaitExpr, + BytesExpr, + CallExpr, + CastExpr, + ComparisonExpr, + ComplexExpr, + ConditionalExpr, + Context, + Decorator, + DictExpr, + DictionaryComprehension, + EllipsisExpr, + EnumCallExpr, + Expression, + FloatExpr, + FuncDef, + GeneratorExpr, + IndexExpr, + IntExpr, + LambdaExpr, + ListComprehension, + ListExpr, + MaybeTypeExpression, + MemberExpr, + MypyFile, + NamedTupleExpr, + NameExpr, + NewTypeExpr, + NotParsed, + OpExpr, + OverloadedFuncDef, + ParamSpecExpr, + PlaceholderNode, + PromoteExpr, + RefExpr, + RevealExpr, + SetComprehension, + SetExpr, + SliceExpr, + StarExpr, + StrExpr, + SuperExpr, + SymbolNode, + SymbolTableNode, + TemplateStrExpr, + TempNode, + TupleExpr, + TypeAlias, + TypeAliasExpr, + TypeApplication, + TypedDictExpr, + TypeFormExpr, + TypeInfo, + TypeVarExpr, + TypeVarLikeExpr, + TypeVarTupleExpr, + UnaryExpr, + Var, + YieldExpr, + YieldFromExpr, + get_member_expr_fullname, +) +from mypy.options import PRECISE_TUPLE_TYPES +from mypy.plugin import ( + FunctionContext, + FunctionSigContext, + MethodContext, + MethodSigContext, + Plugin, +) +from mypy.semanal_enum import ENUM_BASES +from mypy.state import state +from mypy.subtypes import ( + covers_at_runtime, + find_member, + is_equivalent, + is_same_type, + is_subtype, + non_method_protocol_members, +) +from mypy.traverser import ( + all_name_and_member_expressions, + has_await_expression, + has_str_expression, +) +from mypy.tvar_scope import TypeVarLikeScope +from mypy.typeanal import ( + TypeAnalyser, + check_for_explicit_any, + fix_instance, + has_any_from_unimported_type, + instantiate_type_alias, + make_optional_type, + set_any_tvars, + validate_instance, +) +from mypy.typeops import ( + callable_type, + custom_special_method, + erase_to_union_or_bound, + false_only, + fixup_partial_type, + freeze_all_type_vars, + function_type, + get_all_type_vars, + get_type_vars, + is_literal_type_like, + make_simplified_union, + true_only, + try_expanding_sum_type_to_union, + try_getting_str_literals, + tuple_fallback, + type_object_type, +) +from mypy.types import ( + LITERAL_TYPE_NAMES, + TUPLE_LIKE_INSTANCE_NAMES, + AnyType, + CallableType, + DeletedType, + ErasedType, + ExtraAttrs, + FunctionLike, + Instance, + LiteralType, + LiteralValue, + NoneType, + Overloaded, + Parameters, + ParamSpecFlavor, + ParamSpecType, + PartialType, + ProperType, + TupleType, + Type, + TypeAliasType, + TypedDictType, + TypeOfAny, + TypeType, + TypeVarId, + TypeVarLikeType, + TypeVarTupleType, + TypeVarType, + UnboundType, + UninhabitedType, + UnionType, + UnpackType, + find_unpack_in_list, + flatten_nested_tuples, + flatten_nested_unions, + get_proper_type, + get_proper_types, + has_recursive_types, + has_type_vars, + is_named_instance, + split_with_prefix_and_suffix, +) +from mypy.types_utils import ( + is_generic_instance, + is_overlapping_none, + is_self_type_like, + remove_optional, +) +from mypy.typestate import type_state +from mypy.typevars import fill_typevars +from mypy.visitor import ExpressionVisitor + +# Type of callback user for checking individual function arguments. See +# check_args() below for details. +ArgChecker: _TypeAlias = Callable[ + [Type, Type, ArgKind, Type, int, int, CallableType, Type | None, Context, Context], None +] + +# Maximum nesting level for math union in overloads, setting this to large values +# may cause performance issues. The reason is that although union math algorithm we use +# nicely captures most corner cases, its worst case complexity is exponential, +# see https://github.com/python/mypy/pull/5255#discussion_r196896335 for discussion. +MAX_UNIONS: Final = 5 + + +# Types considered safe for comparisons with --strict-equality due to known behaviour of __eq__. +# NOTE: All these types are subtypes of AbstractSet. +OVERLAPPING_TYPES_ALLOWLIST: Final = [ + "builtins.set", + "builtins.frozenset", + "typing.KeysView", + "typing.ItemsView", + "_collections_abc.dict_keys", + "_collections_abc.dict_items", +] +OVERLAPPING_BYTES_ALLOWLIST: Final = { + "builtins.bytes", + "builtins.bytearray", + "builtins.memoryview", +} + + +class TooManyUnions(Exception): + """Indicates that we need to stop splitting unions in an attempt + to match an overload in order to save performance. + """ + + +def allow_fast_container_literal(t: Type) -> bool: + if isinstance(t, TypeAliasType) and t.is_recursive: + return False + t = get_proper_type(t) + return isinstance(t, Instance) or ( + isinstance(t, TupleType) and all(allow_fast_container_literal(it) for it in t.items) + ) + + +class Finished(Exception): + """Raised if we can terminate overload argument check early (no match).""" + + +@enum.unique +class UseReverse(enum.Enum): + """Used in `visit_op_expr` to enable or disable reverse method checks.""" + + DEFAULT = 0 + ALWAYS = 1 + NEVER = 2 + + +USE_REVERSE_DEFAULT: Final = UseReverse.DEFAULT +USE_REVERSE_ALWAYS: Final = UseReverse.ALWAYS +USE_REVERSE_NEVER: Final = UseReverse.NEVER + + +class ExpressionChecker(ExpressionVisitor[Type], ExpressionCheckerSharedApi): + """Expression type checker. + + This class works closely together with checker.TypeChecker. + """ + + # Some services are provided by a TypeChecker instance. + chk: mypy.checker.TypeChecker + # This is shared with TypeChecker, but stored also here for convenience. + msg: MessageBuilder + # Type context for type inference + type_context: list[Type | None] + + strfrm_checker: StringFormatterChecker + plugin: Plugin + + _arg_infer_context_cache: ArgumentInferContext | None + + def __init__( + self, + chk: mypy.checker.TypeChecker, + msg: MessageBuilder, + plugin: Plugin, + per_line_checking_time_ns: dict[int, int], + ) -> None: + """Construct an expression type checker.""" + self.chk = chk + self.msg = msg + self.plugin = plugin + self.per_line_checking_time_ns = per_line_checking_time_ns + self.collect_line_checking_stats = chk.options.line_checking_stats is not None + # Are we already visiting some expression? This is used to avoid double counting + # time for nested expressions. + self.in_expression = False + self.type_context = [None] + + # Temporary overrides for expression types. This is currently + # used by the union math in overloads. + # TODO: refactor this to use a pattern similar to one in + # multiassign_from_union, or maybe even combine the two? + self.type_overrides: dict[Expression, Type] = {} + self.strfrm_checker = StringFormatterChecker(self.chk, self.msg) + + # Callee in a call expression is in some sense both runtime context and + # type context, because we support things like C[int](...). Store information + # on whether current expression is a callee, to give better error messages + # related to type context. + self.is_callee = False + type_state.infer_polymorphic = not self.chk.options.old_type_inference + + self._arg_infer_context_cache = None + self.expr_cache: dict[ + tuple[Expression, Type | None], + tuple[int, Type, list[ErrorInfo], dict[Expression, Type]], + ] = {} + self.in_lambda_expr = False + + self._literal_true: Instance | None = None + self._literal_false: Instance | None = None + + def reset(self) -> None: + self.expr_cache.clear() + + def visit_name_expr(self, e: NameExpr) -> Type: + """Type check a name expression. + + It can be of any kind: local, member or global. + """ + result = self.analyze_ref_expr(e) + narrowed = self.narrow_type_from_binder(e, result) + self.chk.check_deprecated(e.node, e) + return narrowed + + def analyze_ref_expr(self, e: RefExpr, lvalue: bool = False) -> Type: + result: Type | None = None + node = e.node + + if isinstance(e, NameExpr) and e.is_special_form: + # A special form definition, nothing to check here. + return AnyType(TypeOfAny.special_form) + + if isinstance(node, Var): + # Variable reference. + result = self.analyze_var_ref(node, e) + if isinstance(result, PartialType): + result = self.chk.handle_partial_var_type(result, lvalue, node, e) + elif isinstance(node, Decorator): + result = self.analyze_var_ref(node.var, e) + elif isinstance(node, OverloadedFuncDef): + if node.type is None: + if self.chk.in_checked_function() and node.items: + self.chk.handle_cannot_determine_type(node.name, e) + result = AnyType(TypeOfAny.from_error) + else: + result = node.type + elif isinstance(node, (FuncDef, TypeInfo, TypeAlias, MypyFile, TypeVarLikeExpr)): + result = self.analyze_static_reference(node, e, e.is_alias_rvalue or lvalue) + else: + if isinstance(node, PlaceholderNode): + assert False, f"PlaceholderNode {node.fullname!r} leaked to checker" + # Unknown reference; use any type implicitly to avoid + # generating extra type errors. + result = AnyType(TypeOfAny.from_error) + if isinstance(node, TypeInfo): + if isinstance(result, CallableType) and isinstance( # type: ignore[misc] + result.ret_type, Instance + ): + # We need to set correct line and column + # TODO: always do this in type_object_type by passing the original context + result.ret_type.line = e.line + result.ret_type.column = e.column + if is_type_type_context(self.type_context[-1]): + # This is the type in a type[] expression, so substitute type + # variables with Any. + result = erasetype.erase_typevars(result) + assert result is not None + return result + + def analyze_static_reference( + self, + node: SymbolNode, + ctx: Context, + is_lvalue: bool, + *, + include_modules: bool = True, + suppress_errors: bool = False, + ) -> Type: + """ + This is the version of analyze_ref_expr() that doesn't do any deferrals. + + This function can be used by member access to "static" attributes. For example, + when accessing module attributes in protocol checks, or accessing attributes of + special kinds (like TypeAlias, TypeInfo, etc.) on an instance or class object. + # TODO: merge with analyze_ref_expr() when we are confident about performance. + """ + if isinstance(node, (Var, Decorator, OverloadedFuncDef)): + return node.type or AnyType(TypeOfAny.special_form) + elif isinstance(node, FuncDef): + return function_type(node, self.named_type("builtins.function")) + elif isinstance(node, TypeInfo): + # Reference to a type object. + if node.typeddict_type: + # We special-case TypedDict, because they don't define any constructor. + return self.typeddict_callable(node) + elif node.fullname == "types.NoneType": + # We special case NoneType, because its stub definition is not related to None. + return TypeType(NoneType()) + else: + return type_object_type(node, self.named_type) + elif isinstance(node, TypeAlias): + # Something that refers to a type alias appears in runtime context. + # Note that we suppress bogus errors for alias redefinitions, + # they are already reported in semanal.py. + with self.msg.filter_errors() if suppress_errors else nullcontext(): + return self.alias_type_in_runtime_context( + node, ctx=ctx, alias_definition=is_lvalue + ) + elif isinstance(node, TypeVarExpr): + return self.named_type("typing.TypeVar") + elif isinstance(node, (ParamSpecExpr, TypeVarTupleExpr)): + return self.object_type() + elif isinstance(node, MypyFile): + # Reference to a module object. + return self.module_type(node) if include_modules else AnyType(TypeOfAny.special_form) + return AnyType(TypeOfAny.from_error) + + def analyze_var_ref(self, var: Var, context: Context) -> Type: + if var.type: + var_type = get_proper_type(var.type) + if isinstance(var_type, Instance): + if var.fullname == "typing.Any": + # The typeshed type is 'object'; give a more useful type in runtime context + return self.named_type("typing._SpecialForm") + if self.is_literal_context() and var_type.last_known_value is not None: + return var_type.last_known_value + if var.name in {"True", "False"}: + return self.infer_literal_expr_type(var.name == "True", "builtins.bool") + return var.type + else: + if not var.is_ready and self.chk.in_checked_function(): + self.chk.handle_cannot_determine_type(var.name, context) + # Implicit 'Any' type. + return AnyType(TypeOfAny.special_form) + + def module_type(self, node: MypyFile) -> Instance: + try: + result = self.named_type("types.ModuleType") + except KeyError: + # In test cases might 'types' may not be available. + # Fall back to a dummy 'object' type instead to + # avoid a crash. + # Make a copy so that we don't set extra_attrs (below) on a shared instance. + result = self.named_type("builtins.object").copy_modified() + module_attrs: dict[str, Type] = {} + immutable = set() + for name, n in node.names.items(): + if not n.module_public: + continue + if isinstance(n.node, Var) and n.node.is_final: + immutable.add(name) + if n.node is None: + module_attrs[name] = AnyType(TypeOfAny.from_error) + else: + # TODO: what to do about nested module references? + # They are non-trivial because there may be import cycles. + module_attrs[name] = self.analyze_static_reference( + n.node, n.node, False, include_modules=False, suppress_errors=True + ) + result.extra_attrs = ExtraAttrs(module_attrs, immutable, node.fullname) + return result + + def visit_call_expr(self, e: CallExpr, allow_none_return: bool = False) -> Type: + """Type check a call expression.""" + if e.analyzed: + if isinstance(e.analyzed, NamedTupleExpr) and not e.analyzed.is_typed: + # Type check the arguments, but ignore the results. This relies + # on the typeshed stubs to type check the arguments. + self.visit_call_expr_inner(e) + # It's really a special form that only looks like a call. + return self.accept(e.analyzed, self.type_context[-1]) + return self.visit_call_expr_inner(e, allow_none_return=allow_none_return) + + def refers_to_typeddict(self, base: Expression) -> bool: + if not isinstance(base, RefExpr): + return False + if isinstance(base.node, TypeInfo) and base.node.typeddict_type is not None: + # Direct reference. + return True + return isinstance(base.node, TypeAlias) and isinstance( + get_proper_type(base.node.target), TypedDictType + ) + + def visit_call_expr_inner(self, e: CallExpr, allow_none_return: bool = False) -> Type: + if ( + self.refers_to_typeddict(e.callee) + or isinstance(e.callee, IndexExpr) + and self.refers_to_typeddict(e.callee.base) + ): + typeddict_callable = get_proper_type(self.accept(e.callee, is_callee=True)) + if isinstance(typeddict_callable, CallableType): + typeddict_type = get_proper_type(typeddict_callable.ret_type) + assert isinstance(typeddict_type, TypedDictType) + return self.check_typeddict_call( + typeddict_type, e.arg_kinds, e.arg_names, e.args, e, typeddict_callable + ) + if ( + isinstance(e.callee, NameExpr) + and e.callee.name in ("isinstance", "issubclass") + and len(e.args) == 2 + ): + for typ in mypy.checker.flatten(e.args[1]): + node = None + if isinstance(typ, NameExpr): + try: + node = self.chk.lookup_qualified(typ.name) + except KeyError: + # Undefined names should already be reported in semantic analysis. + pass + if is_expr_literal_type(typ): + self.msg.cannot_use_function_with_type(e.callee.name, "Literal", e) + continue + if node and isinstance(node.node, TypeAlias): + target = get_proper_type(node.node.target) + if isinstance(target, AnyType): + self.msg.cannot_use_function_with_type(e.callee.name, "Any", e) + continue + if isinstance(target, NoneType): + continue + if ( + isinstance(typ, IndexExpr) + and isinstance(typ.analyzed, (TypeApplication, TypeAliasExpr)) + ) or ( + isinstance(typ, NameExpr) + and node + and isinstance(node.node, TypeAlias) + and not node.node.no_args + and not ( + isinstance(union_target := get_proper_type(node.node.target), UnionType) + and ( + union_target.uses_pep604_syntax + or self.chk.options.python_version >= (3, 10) + ) + ) + ): + self.msg.type_arguments_not_allowed(e) + if isinstance(typ, RefExpr) and isinstance(typ.node, TypeInfo): + if typ.node.typeddict_type: + self.msg.cannot_use_function_with_type(e.callee.name, "TypedDict", e) + elif typ.node.is_newtype: + self.msg.cannot_use_function_with_type(e.callee.name, "NewType", e) + self.try_infer_partial_type(e) + type_context = None + if isinstance(e.callee, LambdaExpr): + formal_to_actual = map_actuals_to_formals( + e.arg_kinds, + e.arg_names, + e.callee.arg_kinds, + e.callee.arg_names, + lambda i: self.accept(e.args[i]), + ) + + arg_types = [ + join.join_type_list([self.accept(e.args[j]) for j in formal_to_actual[i]]) + for i in range(len(e.callee.arg_kinds)) + ] + type_context = CallableType( + arg_types, + e.callee.arg_kinds, + e.callee.arg_names, + ret_type=self.object_type(), + fallback=self.named_type("builtins.function"), + ) + callee_type = get_proper_type( + self.accept(e.callee, type_context, always_allow_any=True, is_callee=True) + ) + + # Figure out the full name of the callee for plugin lookup. + object_type = None + member = None + fullname = None + if isinstance(e.callee, RefExpr): + # There are two special cases where plugins might act: + # * A "static" reference/alias to a class or function; + # get_function_hook() will be invoked for these. + fullname = e.callee.fullname or None + if isinstance(e.callee.node, TypeAlias): + target = get_proper_type(e.callee.node.target) + if isinstance(target, Instance): + fullname = target.type.fullname + # * Call to a method on object that has a full name (see + # method_fullname() for details on supported objects); + # get_method_hook() and get_method_signature_hook() will + # be invoked for these. + if ( + not fullname + and isinstance(e.callee, MemberExpr) + and self.chk.has_type(e.callee.expr) + ): + member = e.callee.name + object_type = self.chk.lookup_type(e.callee.expr) + + if ( + self.chk.options.disallow_untyped_calls + and self.chk.in_checked_function() + and isinstance(callee_type, CallableType) + and callee_type.implicit + and callee_type.name != LAMBDA_NAME + ): + if fullname is None and member is not None: + assert object_type is not None + fullname = self.method_fullname(object_type, member) + if not fullname or not any( + fullname == p or fullname.startswith(f"{p}.") + for p in self.chk.options.untyped_calls_exclude + ): + self.msg.untyped_function_call(callee_type, e) + + ret_type = self.check_call_expr_with_callee_type( + callee_type, e, fullname, object_type, member + ) + if isinstance(e.callee, RefExpr) and len(e.args) == 2: + if e.callee.fullname in ("builtins.isinstance", "builtins.issubclass"): + self.check_runtime_protocol_test(e) + if e.callee.fullname == "builtins.issubclass": + self.check_protocol_issubclass(e) + if isinstance(e.callee, MemberExpr) and e.callee.name == "format": + self.check_str_format_call(e) + ret_type = get_proper_type(ret_type) + if isinstance(ret_type, UnionType): + ret_type = make_simplified_union(ret_type.items) + if isinstance(ret_type, UninhabitedType) and not ret_type.ambiguous: + self.chk.binder.unreachable() + # Warn on calls to functions that always return None. The check + # of ret_type is both a common-case optimization and prevents reporting + # the error in dynamic functions (where it will be Any). + if ( + not allow_none_return + and isinstance(ret_type, NoneType) + and self.always_returns_none(e.callee) + ): + self.chk.msg.does_not_return_value(callee_type, e) + return ret_type + + def check_str_format_call(self, e: CallExpr) -> None: + """More precise type checking for str.format() calls on literals and folded constants.""" + assert isinstance(e.callee, MemberExpr) + format_value = None + folded_callee_expr = constant_fold_expr(e.callee.expr, "") + if isinstance(folded_callee_expr, str): + format_value = folded_callee_expr + elif self.chk.has_type(e.callee.expr): + typ = get_proper_type(self.chk.lookup_type(e.callee.expr)) + if ( + isinstance(typ, Instance) + and typ.type.is_enum + and isinstance(typ.last_known_value, LiteralType) + and isinstance(typ.last_known_value.value, str) + ): + value_type = typ.type.names[typ.last_known_value.value].type + if isinstance(value_type, Type): + typ = get_proper_type(value_type) + base_typ = try_getting_literal(typ) + if isinstance(base_typ, LiteralType) and isinstance(base_typ.value, str): + format_value = base_typ.value + if format_value is not None: + self.strfrm_checker.check_str_format_call(e, format_value) + + def method_fullname(self, object_type: Type, method_name: str) -> str | None: + """Convert a method name to a fully qualified name, based on the type of the object that + it is invoked on. Return `None` if the name of `object_type` cannot be determined. + """ + object_type = get_proper_type(object_type) + + if isinstance(object_type, CallableType) and object_type.is_type_obj(): + # For class method calls, object_type is a callable representing the class object. + # We "unwrap" it to a regular type, as the class/instance method difference doesn't + # affect the fully qualified name. + object_type = get_proper_type(object_type.ret_type) + elif isinstance(object_type, TypeType): + object_type = object_type.item + + type_name = None + if isinstance(object_type, Instance): + type_name = object_type.type.fullname + elif isinstance(object_type, (TypedDictType, LiteralType)): + info = object_type.fallback.type.get_containing_type_info(method_name) + type_name = info.fullname if info is not None else None + elif isinstance(object_type, TupleType): + type_name = tuple_fallback(object_type).type.fullname + + if type_name: + return f"{type_name}.{method_name}" + else: + return None + + def always_returns_none(self, node: Expression) -> bool: + """Check if `node` refers to something explicitly annotated as only returning None.""" + if isinstance(node, RefExpr): + if self.defn_returns_none(node.node): + return True + if isinstance(node, MemberExpr) and node.node is None: # instance or class attribute + typ = get_proper_type(self.chk.lookup_type(node.expr)) + if isinstance(typ, Instance): + info = typ.type + elif isinstance(typ, CallableType) and typ.is_type_obj(): + ret_type = get_proper_type(typ.ret_type) + if isinstance(ret_type, Instance): + info = ret_type.type + else: + return False + else: + return False + sym = info.get(node.name) + if sym and self.defn_returns_none(sym.node): + return True + return False + + def defn_returns_none(self, defn: SymbolNode | None) -> bool: + """Check if `defn` can _only_ return None.""" + if isinstance(defn, FuncDef): + return isinstance(defn.type, CallableType) and isinstance( + get_proper_type(defn.type.ret_type), NoneType + ) + if isinstance(defn, OverloadedFuncDef): + return all(self.defn_returns_none(item) for item in defn.items) + if isinstance(defn, Var): + typ = get_proper_type(defn.type) + if ( + not defn.is_inferred + and isinstance(typ, CallableType) + and isinstance(get_proper_type(typ.ret_type), NoneType) + ): + return True + if isinstance(typ, Instance): + sym = typ.type.get("__call__") + if sym and self.defn_returns_none(sym.node): + return True + return False + + def check_runtime_protocol_test(self, e: CallExpr) -> None: + for expr in mypy.checker.flatten(e.args[1]): + tp = get_proper_type(self.chk.lookup_type(expr)) + if ( + isinstance(tp, FunctionLike) + and tp.is_type_obj() + and tp.type_object().is_protocol + and not tp.type_object().runtime_protocol + ): + self.chk.fail(message_registry.RUNTIME_PROTOCOL_EXPECTED, e) + + def check_protocol_issubclass(self, e: CallExpr) -> None: + for expr in mypy.checker.flatten(e.args[1]): + tp = get_proper_type(self.chk.lookup_type(expr)) + if isinstance(tp, FunctionLike) and tp.is_type_obj() and tp.type_object().is_protocol: + attr_members = non_method_protocol_members(tp.type_object()) + if attr_members: + self.chk.msg.report_non_method_protocol(tp.type_object(), attr_members, e) + + def check_typeddict_call( + self, + callee: TypedDictType, + arg_kinds: list[ArgKind], + arg_names: Sequence[str | None], + args: list[Expression], + context: Context, + orig_callee: Type | None, + ) -> Type: + if args and all(ak in (ARG_NAMED, ARG_STAR2) for ak in arg_kinds): + # ex: Point(x=42, y=1337, **extras) + # This is a bit ugly, but this is a price for supporting all possible syntax + # variants for TypedDict constructors. + kwargs = zip([StrExpr(n) if n is not None else None for n in arg_names], args) + result = self.validate_typeddict_kwargs(kwargs=kwargs, callee=callee) + if result is not None: + validated_kwargs, always_present_keys = result + return self.check_typeddict_call_with_kwargs( + callee, validated_kwargs, context, orig_callee, always_present_keys + ) + return AnyType(TypeOfAny.from_error) + + if len(args) == 1 and arg_kinds[0] == ARG_POS: + unique_arg = args[0] + if isinstance(unique_arg, DictExpr): + # ex: Point({'x': 42, 'y': 1337, **extras}) + return self.check_typeddict_call_with_dict( + callee, unique_arg.items, context, orig_callee + ) + if isinstance(unique_arg, CallExpr) and isinstance(unique_arg.analyzed, DictExpr): + # ex: Point(dict(x=42, y=1337, **extras)) + return self.check_typeddict_call_with_dict( + callee, unique_arg.analyzed.items, context, orig_callee + ) + + if not args: + # ex: EmptyDict() + return self.check_typeddict_call_with_kwargs(callee, {}, context, orig_callee, set()) + + self.chk.fail(message_registry.INVALID_TYPEDDICT_ARGS, context) + return AnyType(TypeOfAny.from_error) + + def validate_typeddict_kwargs( + self, kwargs: Iterable[tuple[Expression | None, Expression]], callee: TypedDictType + ) -> tuple[dict[str, list[Expression]], set[str]] | None: + # All (actual or mapped from ** unpacks) expressions that can match given key. + result = defaultdict(list) + # Keys that are guaranteed to be present no matter what (e.g. for all items of a union) + always_present_keys = set() + # Indicates latest encountered ** unpack among items. + last_star_found = None + + for item_name_expr, item_arg in kwargs: + if item_name_expr: + key_type = self.accept(item_name_expr) + values = try_getting_str_literals(item_name_expr, key_type) + literal_value = None + if values and len(values) == 1: + literal_value = values[0] + if literal_value is None: + key_context = item_name_expr or item_arg + self.chk.fail( + message_registry.TYPEDDICT_KEY_MUST_BE_STRING_LITERAL, + key_context, + code=codes.LITERAL_REQ, + ) + return None + else: + # A directly present key unconditionally shadows all previously found + # values from ** items. + # TODO: for duplicate keys, type-check all values. + result[literal_value] = [item_arg] + always_present_keys.add(literal_value) + else: + last_star_found = item_arg + if not self.validate_star_typeddict_item( + item_arg, callee, result, always_present_keys + ): + return None + if self.chk.options.extra_checks and last_star_found is not None: + absent_keys = [] + for key in callee.items: + if key not in callee.required_keys and key not in result: + absent_keys.append(key) + if absent_keys: + # Having an optional key not explicitly declared by a ** unpacked + # TypedDict is unsafe, it may be an (incompatible) subtype at runtime. + # TODO: catch the cases where a declared key is overridden by a subsequent + # ** item without it (and not again overridden with complete ** item). + self.msg.non_required_keys_absent_with_star(absent_keys, last_star_found) + return result, always_present_keys + + def validate_star_typeddict_item( + self, + item_arg: Expression, + callee: TypedDictType, + result: dict[str, list[Expression]], + always_present_keys: set[str], + ) -> bool: + """Update keys/expressions from a ** expression in TypedDict constructor. + + Note `result` and `always_present_keys` are updated in place. Return true if the + expression `item_arg` may valid in `callee` TypedDict context. + """ + inferred = get_proper_type(self.accept(item_arg, type_context=callee)) + possible_tds = [] + if isinstance(inferred, TypedDictType): + possible_tds = [inferred] + elif isinstance(inferred, UnionType): + for item in get_proper_types(inferred.relevant_items()): + if isinstance(item, TypedDictType): + possible_tds.append(item) + elif not self.valid_unpack_fallback_item(item): + self.msg.unsupported_target_for_star_typeddict(item, item_arg) + return False + elif not self.valid_unpack_fallback_item(inferred): + self.msg.unsupported_target_for_star_typeddict(inferred, item_arg) + return False + all_keys: set[str] = set() + for td in possible_tds: + all_keys |= td.items.keys() + for key in all_keys: + arg = TempNode( + UnionType.make_union([td.items[key] for td in possible_tds if key in td.items]) + ) + arg.set_line(item_arg) + if all(key in td.required_keys for td in possible_tds): + always_present_keys.add(key) + # Always present keys override previously found values. This is done + # to support use cases like `Config({**defaults, **overrides})`, where + # some `overrides` types are narrower that types in `defaults`, and + # former are too wide for `Config`. + if result[key]: + first = result[key][0] + if not isinstance(first, TempNode): + # We must always preserve any non-synthetic values, so that + # we will accept them even if they are shadowed. + result[key] = [first, arg] + else: + result[key] = [arg] + else: + result[key] = [arg] + else: + # If this key is not required at least in some item of a union + # it may not shadow previous item, so we need to type check both. + result[key].append(arg) + return True + + def valid_unpack_fallback_item(self, typ: ProperType) -> bool: + if isinstance(typ, AnyType): + return True + if not isinstance(typ, Instance) or not typ.type.has_base("typing.Mapping"): + return False + mapped = map_instance_to_supertype(typ, self.chk.lookup_typeinfo("typing.Mapping")) + return all(isinstance(a, AnyType) for a in get_proper_types(mapped.args)) + + def match_typeddict_call_with_dict( + self, + callee: TypedDictType, + kwargs: list[tuple[Expression | None, Expression]], + context: Context, + ) -> bool: + result = self.validate_typeddict_kwargs(kwargs=kwargs, callee=callee) + if result is not None: + validated_kwargs, _ = result + return callee.required_keys <= set(validated_kwargs.keys()) <= set(callee.items.keys()) + else: + return False + + def check_typeddict_call_with_dict( + self, + callee: TypedDictType, + kwargs: list[tuple[Expression | None, Expression]], + context: Context, + orig_callee: Type | None, + ) -> Type: + result = self.validate_typeddict_kwargs(kwargs=kwargs, callee=callee) + if result is not None: + validated_kwargs, always_present_keys = result + return self.check_typeddict_call_with_kwargs( + callee, + kwargs=validated_kwargs, + context=context, + orig_callee=orig_callee, + always_present_keys=always_present_keys, + ) + else: + return AnyType(TypeOfAny.from_error) + + def typeddict_callable(self, info: TypeInfo) -> CallableType: + """Construct a reasonable type for a TypedDict type in runtime context. + + If it appears as a callee, it will be special-cased anyway, e.g. it is + also allowed to accept a single positional argument if it is a dict literal. + + Note it is not safe to move this to type_object_type() since it will crash + on plugin-generated TypedDicts, that may not have the special_alias. + """ + assert info.special_alias is not None + target = info.special_alias.target + assert isinstance(target, ProperType) and isinstance(target, TypedDictType) + return self.typeddict_callable_from_context(target, info.defn.type_vars) + + def typeddict_callable_from_context( + self, callee: TypedDictType, variables: Sequence[TypeVarLikeType] | None = None + ) -> CallableType: + return CallableType( + list(callee.items.values()), + [ + ArgKind.ARG_NAMED if name in callee.required_keys else ArgKind.ARG_NAMED_OPT + for name in callee.items + ], + list(callee.items.keys()), + callee, + self.named_type("builtins.type"), + variables=variables, + is_bound=True, + ) + + def check_typeddict_call_with_kwargs( + self, + callee: TypedDictType, + kwargs: dict[str, list[Expression]], + context: Context, + orig_callee: Type | None, + always_present_keys: set[str], + ) -> Type: + actual_keys = kwargs.keys() + if callee.to_be_mutated: + assigned_readonly_keys = actual_keys & callee.readonly_keys + if assigned_readonly_keys: + self.msg.readonly_keys_mutated(assigned_readonly_keys, context=context) + if not ( + callee.required_keys <= always_present_keys and actual_keys <= callee.items.keys() + ): + if not (actual_keys <= callee.items.keys()): + self.msg.unexpected_typeddict_keys( + callee, + expected_keys=[ + key + for key in callee.items.keys() + if key in callee.required_keys or key in actual_keys + ], + actual_keys=list(actual_keys), + context=context, + ) + if not (callee.required_keys <= always_present_keys): + self.msg.unexpected_typeddict_keys( + callee, + expected_keys=[ + key for key in callee.items.keys() if key in callee.required_keys + ], + actual_keys=[ + key for key in always_present_keys if key in callee.required_keys + ], + context=context, + ) + if callee.required_keys > actual_keys: + # found_set is a sub-set of the required_keys + # This means we're missing some keys and as such, we can't + # properly type the object + return AnyType(TypeOfAny.from_error) + + orig_callee = get_proper_type(orig_callee) + if isinstance(orig_callee, CallableType): + infer_callee = orig_callee + else: + # Try reconstructing from type context. + if callee.fallback.type.special_alias is not None: + infer_callee = self.typeddict_callable(callee.fallback.type) + else: + # Likely a TypedDict type generated by a plugin. + infer_callee = self.typeddict_callable_from_context(callee) + + # We don't show any errors, just infer types in a generic TypedDict type, + # a custom error message will be given below, if there are errors. + with self.msg.filter_errors(), self.chk.local_type_map: + orig_ret_type, _ = self.check_callable_call( + infer_callee, + # We use first expression for each key to infer type variables of a generic + # TypedDict. This is a bit arbitrary, but in most cases will work better than + # trying to infer a union or a join. + [args[0] for args in kwargs.values()], + [ArgKind.ARG_NAMED] * len(kwargs), + context, + list(kwargs.keys()), + None, + None, + None, + ) + + ret_type = get_proper_type(orig_ret_type) + if not isinstance(ret_type, TypedDictType): + # If something went really wrong, type-check call with original type, + # this may give a better error message. + ret_type = callee + + for item_name, item_expected_type in ret_type.items.items(): + if item_name in kwargs: + item_values = kwargs[item_name] + for item_value in item_values: + self.chk.check_simple_assignment( + lvalue_type=item_expected_type, + rvalue=item_value, + context=item_value, + msg=ErrorMessage( + message_registry.INCOMPATIBLE_TYPES.value, code=codes.TYPEDDICT_ITEM + ), + lvalue_name=f'TypedDict item "{item_name}"', + rvalue_name="expression", + ) + + return orig_ret_type + + def get_partial_self_var(self, expr: MemberExpr) -> Var | None: + """Get variable node for a partial self attribute. + + If the expression is not a self attribute, or attribute is not variable, + or variable is not partial, return None. + """ + if not ( + isinstance(expr.expr, NameExpr) + and isinstance(expr.expr.node, Var) + and expr.expr.node.is_self + ): + # Not a self.attr expression. + return None + info = self.chk.scope.enclosing_class() + if not info or expr.name not in info.names: + # Don't mess with partial types in superclasses. + return None + sym = info.names[expr.name] + if isinstance(sym.node, Var) and isinstance(sym.node.type, PartialType): + return sym.node + return None + + # Types and methods that can be used to infer partial types. + item_args: ClassVar[dict[str, list[str]]] = { + "builtins.list": ["append"], + "builtins.set": ["add", "discard"], + } + container_args: ClassVar[dict[str, dict[str, list[str]]]] = { + "builtins.list": {"extend": ["builtins.list"]}, + "builtins.dict": {"update": ["builtins.dict"]}, + "collections.OrderedDict": {"update": ["builtins.dict"]}, + "builtins.set": {"update": ["builtins.set", "builtins.list"]}, + } + + def try_infer_partial_type(self, e: CallExpr) -> None: + """Try to make partial type precise from a call.""" + if not isinstance(e.callee, MemberExpr): + return + callee = e.callee + if isinstance(callee.expr, RefExpr): + # Call a method with a RefExpr callee, such as 'x.method(...)'. + ret = self.get_partial_var(callee.expr) + if ret is None: + return + var, partial_types = ret + typ = self.try_infer_partial_value_type_from_call(e, callee.name, var) + # Var may be deleted from partial_types in try_infer_partial_value_type_from_call + if typ is not None and var in partial_types: + self.chk.replace_partial_type(var, typ, partial_types) + elif isinstance(callee.expr, IndexExpr) and isinstance(callee.expr.base, RefExpr): + # Call 'x[y].method(...)'; may infer type of 'x' if it's a partial defaultdict. + if callee.expr.analyzed is not None: + return # A special form + base = callee.expr.base + index = callee.expr.index + ret = self.get_partial_var(base) + if ret is None: + return + var, partial_types = ret + partial_type = get_partial_instance_type(var.type) + if partial_type is None or partial_type.value_type is None: + return + value_type = self.try_infer_partial_value_type_from_call(e, callee.name, var) + if value_type is not None: + # Infer key type. + key_type = self.accept(index) + if mypy.checker.is_valid_inferred_type(key_type, self.chk.options): + # Store inferred partial type. + assert partial_type.type is not None + typename = partial_type.type.fullname + new_type = self.chk.named_generic_type(typename, [key_type, value_type]) + self.chk.replace_partial_type(var, new_type, partial_types) + + def get_partial_var(self, ref: RefExpr) -> tuple[Var, dict[Var, Context]] | None: + var = ref.node + if var is None and isinstance(ref, MemberExpr): + var = self.get_partial_self_var(ref) + if not isinstance(var, Var): + return None + partial_types = self.chk.find_partial_types(var) + if partial_types is None: + return None + return var, partial_types + + def try_infer_partial_value_type_from_call( + self, e: CallExpr, methodname: str, var: Var + ) -> Instance | None: + """Try to make partial type precise from a call such as 'x.append(y)'.""" + if self.chk.current_node_deferred: + return None + partial_type = get_partial_instance_type(var.type) + if partial_type is None: + return None + if partial_type.value_type: + typename = partial_type.value_type.type.fullname + else: + assert partial_type.type is not None + typename = partial_type.type.fullname + # Sometimes we can infer a full type for a partial List, Dict or Set type. + # TODO: Don't infer argument expression twice. + if ( + typename in self.item_args + and methodname in self.item_args[typename] + and e.arg_kinds == [ARG_POS] + ): + item_type = self.accept(e.args[0]) + if mypy.checker.is_valid_inferred_type(item_type, self.chk.options): + return self.chk.named_generic_type(typename, [item_type]) + elif ( + typename in self.container_args + and methodname in self.container_args[typename] + and e.arg_kinds == [ARG_POS] + ): + arg_type = get_proper_type(self.accept(e.args[0])) + if isinstance(arg_type, Instance): + arg_typename = arg_type.type.fullname + if arg_typename in self.container_args[typename][methodname]: + if all( + mypy.checker.is_valid_inferred_type(item_type, self.chk.options) + for item_type in arg_type.args + ): + return self.chk.named_generic_type(typename, list(arg_type.args)) + elif isinstance(arg_type, AnyType): + return self.chk.named_type(typename) + + return None + + def apply_function_plugin( + self, + callee: CallableType, + arg_kinds: list[ArgKind], + arg_types: list[Type], + arg_names: Sequence[str | None] | None, + formal_to_actual: list[list[int]], + args: list[Expression], + fullname: str, + object_type: Type | None, + context: Context, + ) -> Type: + """Use special case logic to infer the return type of a specific named function/method. + + Caller must ensure that a plugin hook exists. There are two different cases: + + - If object_type is None, the caller must ensure that a function hook exists + for fullname. + - If object_type is not None, the caller must ensure that a method hook exists + for fullname. + + Return the inferred return type. + """ + num_formals = len(callee.arg_types) + formal_arg_types: list[list[Type]] = [[] for _ in range(num_formals)] + formal_arg_exprs: list[list[Expression]] = [[] for _ in range(num_formals)] + formal_arg_names: list[list[str | None]] = [[] for _ in range(num_formals)] + formal_arg_kinds: list[list[ArgKind]] = [[] for _ in range(num_formals)] + for formal, actuals in enumerate(formal_to_actual): + for actual in actuals: + formal_arg_types[formal].append(arg_types[actual]) + formal_arg_exprs[formal].append(args[actual]) + if arg_names: + formal_arg_names[formal].append(arg_names[actual]) + else: + formal_arg_names[formal].append(None) + formal_arg_kinds[formal].append(arg_kinds[actual]) + + if object_type is None: + # Apply function plugin + callback = self.plugin.get_function_hook(fullname) + assert callback is not None # Assume that caller ensures this + return callback( + FunctionContext( + arg_types=formal_arg_types, + arg_kinds=formal_arg_kinds, + callee_arg_names=callee.arg_names, + arg_names=formal_arg_names, + default_return_type=callee.ret_type, + args=formal_arg_exprs, + context=context, + api=self.chk, + ) + ) + else: + # Apply method plugin + method_callback = self.plugin.get_method_hook(fullname) + assert method_callback is not None # Assume that caller ensures this + object_type = get_proper_type(object_type) + return method_callback( + MethodContext( + type=object_type, + arg_types=formal_arg_types, + arg_kinds=formal_arg_kinds, + callee_arg_names=callee.arg_names, + arg_names=formal_arg_names, + default_return_type=callee.ret_type, + args=formal_arg_exprs, + context=context, + api=self.chk, + ) + ) + + def apply_signature_hook( + self, + callee: FunctionLike, + args: list[Expression], + arg_kinds: list[ArgKind], + arg_names: Sequence[str | None] | None, + hook: Callable[[list[list[Expression]], CallableType], FunctionLike], + ) -> FunctionLike: + """Helper to apply a signature hook for either a function or method""" + if isinstance(callee, CallableType): + num_formals = len(callee.arg_kinds) + formal_to_actual = map_actuals_to_formals( + arg_kinds, + arg_names, + callee.arg_kinds, + callee.arg_names, + lambda i: self.accept(args[i]), + ) + formal_arg_exprs: list[list[Expression]] = [[] for _ in range(num_formals)] + for formal, actuals in enumerate(formal_to_actual): + for actual in actuals: + formal_arg_exprs[formal].append(args[actual]) + return hook(formal_arg_exprs, callee) + else: + assert isinstance(callee, Overloaded) + items = [] + for item in callee.items: + adjusted = self.apply_signature_hook(item, args, arg_kinds, arg_names, hook) + assert isinstance(adjusted, CallableType) + items.append(adjusted) + return Overloaded(items) + + def apply_function_signature_hook( + self, + callee: FunctionLike, + args: list[Expression], + arg_kinds: list[ArgKind], + context: Context, + arg_names: Sequence[str | None] | None, + signature_hook: Callable[[FunctionSigContext], FunctionLike], + ) -> FunctionLike: + """Apply a plugin hook that may infer a more precise signature for a function.""" + return self.apply_signature_hook( + callee, + args, + arg_kinds, + arg_names, + (lambda args, sig: signature_hook(FunctionSigContext(args, sig, context, self.chk))), + ) + + def apply_method_signature_hook( + self, + callee: FunctionLike, + args: list[Expression], + arg_kinds: list[ArgKind], + context: Context, + arg_names: Sequence[str | None] | None, + object_type: Type, + signature_hook: Callable[[MethodSigContext], FunctionLike], + ) -> FunctionLike: + """Apply a plugin hook that may infer a more precise signature for a method.""" + pobject_type = get_proper_type(object_type) + return self.apply_signature_hook( + callee, + args, + arg_kinds, + arg_names, + ( + lambda args, sig: signature_hook( + MethodSigContext(pobject_type, args, sig, context, self.chk) + ) + ), + ) + + def transform_callee_type( + self, + callable_name: str | None, + callee: Type, + args: list[Expression], + arg_kinds: list[ArgKind], + context: Context, + arg_names: Sequence[str | None] | None = None, + object_type: Type | None = None, + ) -> Type: + """Attempt to determine a more accurate signature for a method call. + + This is done by looking up and applying a method signature hook (if one exists for the + given method name). + + If no matching method signature hook is found, callee is returned unmodified. The same + happens if the arguments refer to a non-method callable (this is allowed so that the code + calling transform_callee_type needs to perform fewer boilerplate checks). + + Note: this method is *not* called automatically as part of check_call, because in some + cases check_call is called multiple times while checking a single call (for example when + dealing with overloads). Instead, this method needs to be called explicitly + (if appropriate) before the signature is passed to check_call. + """ + callee = get_proper_type(callee) + if callable_name is not None and isinstance(callee, FunctionLike): + if object_type is not None: + method_sig_hook = self.plugin.get_method_signature_hook(callable_name) + if method_sig_hook: + return self.apply_method_signature_hook( + callee, args, arg_kinds, context, arg_names, object_type, method_sig_hook + ) + else: + function_sig_hook = self.plugin.get_function_signature_hook(callable_name) + if function_sig_hook: + return self.apply_function_signature_hook( + callee, args, arg_kinds, context, arg_names, function_sig_hook + ) + + return callee + + def is_generic_decorator_overload_call( + self, callee_type: CallableType, args: list[Expression] + ) -> Overloaded | None: + """Check if this looks like an application of a generic function to overload argument.""" + assert callee_type.variables + if len(callee_type.arg_types) != 1 or len(args) != 1: + # TODO: can we handle more general cases? + return None + if not isinstance(get_proper_type(callee_type.arg_types[0]), CallableType): + return None + if not isinstance(get_proper_type(callee_type.ret_type), CallableType): + return None + with self.chk.local_type_map: + with self.msg.filter_errors(): + arg_type = get_proper_type(self.accept(args[0], type_context=None)) + if isinstance(arg_type, Overloaded): + return arg_type + return None + + def handle_decorator_overload_call( + self, callee_type: CallableType, overloaded: Overloaded, ctx: Context + ) -> tuple[Type, Type] | None: + """Type-check application of a generic callable to an overload. + + We check call on each individual overload item, and then combine results into a new + overload. This function should be only used if callee_type takes and returns a Callable. + """ + result = [] + inferred_args = [] + for item in overloaded.items: + arg = TempNode(typ=item) + with self.msg.filter_errors() as err: + item_result, inferred_arg = self.check_call(callee_type, [arg], [ARG_POS], ctx) + if err.has_new_errors(): + # This overload doesn't match. + continue + p_item_result = get_proper_type(item_result) + if not isinstance(p_item_result, CallableType): + continue + p_inferred_arg = get_proper_type(inferred_arg) + if not isinstance(p_inferred_arg, CallableType): + continue + inferred_args.append(p_inferred_arg) + result.append(p_item_result) + if not result or not inferred_args: + # None of the overload matched (or overload was initially malformed). + return None + return Overloaded(result), Overloaded(inferred_args) + + def check_call_expr_with_callee_type( + self, + callee_type: Type, + e: CallExpr, + callable_name: str | None, + object_type: Type | None, + member: str | None = None, + ) -> Type: + """Type check call expression. + + The callee_type should be used as the type of callee expression. In particular, + in case of a union type this can be a particular item of the union, so that we can + apply plugin hooks to each item. + + The 'member', 'callable_name' and 'object_type' are only used to call plugin hooks. + If 'callable_name' is None but 'member' is not None (member call), try constructing + 'callable_name' using 'object_type' (the base type on which the method is called), + for example 'typing.Mapping.get'. + """ + if callable_name is None and member is not None: + assert object_type is not None + callable_name = self.method_fullname(object_type, member) + object_type = get_proper_type(object_type) + if callable_name: + # Try to refine the call signature using plugin hooks before checking the call. + callee_type = self.transform_callee_type( + callable_name, callee_type, e.args, e.arg_kinds, e, e.arg_names, object_type + ) + # Unions are special-cased to allow plugins to act on each item in the union. + elif member is not None and isinstance(object_type, UnionType): + return self.check_union_call_expr(e, object_type, member) + ret_type, callee_type = self.check_call( + callee_type, + e.args, + e.arg_kinds, + e, + e.arg_names, + callable_node=e.callee, + callable_name=callable_name, + object_type=object_type, + ) + proper_callee = get_proper_type(callee_type) + if isinstance(e.callee, RefExpr) and isinstance(proper_callee, CallableType): + # Cache it for find_isinstance_check() + if proper_callee.type_guard is not None: + e.callee.type_guard = proper_callee.type_guard + if proper_callee.type_is is not None: + e.callee.type_is = proper_callee.type_is + return ret_type + + def check_union_call_expr(self, e: CallExpr, object_type: UnionType, member: str) -> Type: + """Type check calling a member expression where the base type is a union.""" + res: list[Type] = [] + for typ in flatten_nested_unions(object_type.relevant_items()): + # Member access errors are already reported when visiting the member expression. + with self.msg.filter_errors(): + item = analyze_member_access( + member, + typ, + e, + is_lvalue=False, + is_super=False, + is_operator=False, + original_type=object_type, + chk=self.chk, + in_literal_context=self.is_literal_context(), + self_type=typ, + ) + narrowed = self.narrow_type_from_binder(e.callee, item, skip_non_overlapping=True) + if narrowed is None: + continue + callable_name = self.method_fullname(typ, member) + item_object_type = typ if callable_name else None + res.append( + self.check_call_expr_with_callee_type(narrowed, e, callable_name, item_object_type) + ) + return make_simplified_union(res) + + def check_call( + self, + callee: Type, + args: list[Expression], + arg_kinds: list[ArgKind], + context: Context, + arg_names: Sequence[str | None] | None = None, + callable_node: Expression | None = None, + callable_name: str | None = None, + object_type: Type | None = None, + original_type: Type | None = None, + ) -> tuple[Type, Type]: + """Type check a call. + + Also infer type arguments if the callee is a generic function. + + Return (result type, inferred callee type). + + Arguments: + callee: type of the called value + args: actual argument expressions + arg_kinds: contains nodes.ARG_* constant for each argument in args + describing whether the argument is positional, *arg, etc. + context: current expression context, used for inference. + arg_names: names of arguments (optional) + callable_node: associate the inferred callable type to this node, + if specified + callable_name: Fully-qualified name of the function/method to call, + or None if unavailable (examples: 'builtins.open', 'typing.Mapping.get') + object_type: If callable_name refers to a method, the type of the object + on which the method is being called + """ + callee = get_proper_type(callee) + + if isinstance(callee, CallableType): + if callee.variables: + overloaded = self.is_generic_decorator_overload_call(callee, args) + if overloaded is not None: + # Special casing for inline application of generic callables to overloads. + # Supporting general case would be tricky, but this should cover 95% of cases. + overloaded_result = self.handle_decorator_overload_call( + callee, overloaded, context + ) + if overloaded_result is not None: + return overloaded_result + + return self.check_callable_call( + callee, + args, + arg_kinds, + context, + arg_names, + callable_node, + callable_name, + object_type, + ) + elif isinstance(callee, Overloaded): + return self.check_overload_call( + callee, args, arg_kinds, arg_names, callable_name, object_type, context + ) + elif isinstance(callee, AnyType) or not self.chk.in_checked_function(): + return self.check_any_type_call(args, arg_kinds, callee, context) + elif isinstance(callee, UnionType): + return self.check_union_call(callee, args, arg_kinds, arg_names, context) + elif isinstance(callee, Instance): + call_function = analyze_member_access( + "__call__", + callee, + context, + is_lvalue=False, + is_super=False, + is_operator=True, + original_type=original_type or callee, + chk=self.chk, + in_literal_context=self.is_literal_context(), + ) + callable_name = callee.type.fullname + ".__call__" + # Apply method signature hook, if one exists + call_function = self.transform_callee_type( + callable_name, call_function, args, arg_kinds, context, arg_names, callee + ) + result = self.check_call( + call_function, + args, + arg_kinds, + context, + arg_names, + callable_node, + callable_name, + callee, + ) + if callable_node: + # check_call() stored "call_function" as the type, which is incorrect. + # Override the type. + self.chk.store_type(callable_node, callee) + return result + elif isinstance(callee, TypeVarType): + return self.check_call( + callee.upper_bound, args, arg_kinds, context, arg_names, callable_node + ) + elif isinstance(callee, TypeType): + item = self.analyze_type_type_callee(callee.item, context) + return self.check_call(item, args, arg_kinds, context, arg_names, callable_node) + elif isinstance(callee, TupleType): + return self.check_call( + tuple_fallback(callee), + args, + arg_kinds, + context, + arg_names, + callable_node, + callable_name, + object_type, + original_type=callee, + ) + elif isinstance(callee, UninhabitedType): + ret = UninhabitedType() + ret.ambiguous = callee.ambiguous + return callee, ret + else: + return self.msg.not_callable(callee, context), AnyType(TypeOfAny.from_error) + + def check_callable_call( + self, + callee: CallableType, + args: list[Expression], + arg_kinds: list[ArgKind], + context: Context, + arg_names: Sequence[str | None] | None, + callable_node: Expression | None, + callable_name: str | None, + object_type: Type | None, + ) -> tuple[Type, Type]: + """Type check a call that targets a callable value. + + See the docstring of check_call for more information. + """ + # Always unpack **kwargs before checking a call. + callee = callee.with_unpacked_kwargs().with_normalized_var_args() + if callable_name is None and callee.name: + callable_name = callee.name + ret_type = get_proper_type(callee.ret_type) + if callee.is_type_obj() and isinstance(ret_type, Instance): + callable_name = ret_type.type.fullname + if isinstance(callable_node, RefExpr) and callable_node.fullname in ENUM_BASES: + # An Enum() call that failed SemanticAnalyzerPass2.check_enum_call(). + return callee.ret_type, callee + + if ( + callee.is_type_obj() + and callee.type_object().is_protocol + # Exception for Type[...] + and not callee.from_type_type + ): + self.chk.fail( + message_registry.CANNOT_INSTANTIATE_PROTOCOL.format(callee.type_object().name), + context, + ) + elif ( + callee.is_type_obj() + and callee.type_object().is_abstract + # Exception for Type[...] + and not callee.from_type_type + and not callee.type_object().fallback_to_any + ): + type = callee.type_object() + # Determine whether the implicitly abstract attributes are functions with + # None-compatible return types. + abstract_attributes: dict[str, bool] = {} + for attr_name, abstract_status in type.abstract_attributes: + if abstract_status == IMPLICITLY_ABSTRACT: + abstract_attributes[attr_name] = self.can_return_none(type, attr_name) + else: + abstract_attributes[attr_name] = False + self.msg.cannot_instantiate_abstract_class( + callee.type_object().name, abstract_attributes, context + ) + + var_arg = callee.var_arg() + if var_arg and isinstance(var_arg.typ, UnpackType): + # It is hard to support multiple variadic unpacks (except for old-style *args: int), + # fail gracefully to avoid crashes later. + seen_unpack = False + for arg, arg_kind in zip(args, arg_kinds): + if arg_kind != ARG_STAR: + continue + arg_type = get_proper_type(self.accept(arg)) + if not isinstance(arg_type, TupleType) or any( + isinstance(t, UnpackType) for t in arg_type.items + ): + if seen_unpack: + self.msg.fail( + "Passing multiple variadic unpacks in a call is not supported", + context, + code=codes.CALL_ARG, + ) + return AnyType(TypeOfAny.from_error), callee + seen_unpack = True + + # This is tricky: return type may contain its own type variables, like in + # def [S] (S) -> def [T] (T) -> tuple[S, T], so we need to update their ids + # to avoid possible id clashes if this call itself appears in a generic + # function body. + ret_type = get_proper_type(callee.ret_type) + if isinstance(ret_type, CallableType) and ret_type.variables: + fresh_ret_type = freshen_all_functions_type_vars(callee.ret_type) + freeze_all_type_vars(fresh_ret_type) + callee = callee.copy_modified(ret_type=fresh_ret_type) + + if callee.is_generic(): + callee = freshen_function_type_vars(callee) + callee = self.infer_function_type_arguments_using_context(callee, context) + + formal_to_actual = map_actuals_to_formals( + arg_kinds, + arg_names, + callee.arg_kinds, + callee.arg_names, + lambda i: self.accept(args[i]), + ) + + if callee.is_generic(): + need_refresh = any( + isinstance(v, (ParamSpecType, TypeVarTupleType)) for v in callee.variables + ) + callee = self.infer_function_type_arguments( + callee, args, arg_kinds, arg_names, formal_to_actual, need_refresh, context + ) + if need_refresh: + # Argument kinds etc. may have changed due to + # ParamSpec or TypeVarTuple variables being replaced with an arbitrary + # number of arguments; recalculate actual-to-formal map + formal_to_actual = map_actuals_to_formals( + arg_kinds, + arg_names, + callee.arg_kinds, + callee.arg_names, + lambda i: self.accept(args[i]), + ) + + param_spec = callee.param_spec() + if ( + param_spec is not None + and arg_kinds == [ARG_STAR, ARG_STAR2] + and len(formal_to_actual) == 2 + ): + arg1 = self.accept(args[0]) + arg2 = self.accept(args[1]) + if ( + isinstance(arg1, ParamSpecType) + and isinstance(arg2, ParamSpecType) + and arg1.flavor == ParamSpecFlavor.ARGS + and arg2.flavor == ParamSpecFlavor.KWARGS + and arg1.id == arg2.id == param_spec.id + ): + return callee.ret_type, callee + + arg_types = self.infer_arg_types_in_context(callee, args, arg_kinds, formal_to_actual) + + self.check_argument_count( + callee, + arg_types, + arg_kinds, + arg_names, + formal_to_actual, + context, + object_type, + callable_name, + ) + + self.check_argument_types( + arg_types, arg_kinds, args, callee, formal_to_actual, context, object_type=object_type + ) + + if ( + callee.is_type_obj() + and (len(arg_types) == 1) + and is_equivalent(callee.ret_type, self.named_type("builtins.type")) + ): + callee = callee.copy_modified(ret_type=TypeType.make_normalized(arg_types[0])) + + if callable_node: + # Store the inferred callable type. + self.chk.store_type(callable_node, callee) + + if callable_name and ( + (object_type is None and self.plugin.get_function_hook(callable_name)) + or (object_type is not None and self.plugin.get_method_hook(callable_name)) + ): + new_ret_type = self.apply_function_plugin( + callee, + arg_kinds, + arg_types, + arg_names, + formal_to_actual, + args, + callable_name, + object_type, + context, + ) + callee = callee.copy_modified(ret_type=new_ret_type) + return callee.ret_type, callee + + def can_return_none(self, type: TypeInfo, attr_name: str) -> bool: + """Is the given attribute a method with a None-compatible return type? + + Overloads are only checked if there is an implementation. + """ + if not state.strict_optional: + # If strict-optional is not set, is_subtype(NoneType(), T) is always True. + # So, we cannot do anything useful here in that case. + return False + for base in type.mro: + symnode = base.names.get(attr_name) + if symnode is None: + continue + node = symnode.node + if isinstance(node, OverloadedFuncDef): + node = node.impl + if isinstance(node, Decorator): + node = node.func + if isinstance(node, FuncDef): + if node.type is not None: + assert isinstance(node.type, CallableType) + return is_subtype(NoneType(), node.type.ret_type) + return False + + def analyze_type_type_callee(self, item: ProperType, context: Context) -> Type: + """Analyze the callee X in X(...) where X is Type[item]. + + Return a Y that we can pass to check_call(Y, ...). + """ + if isinstance(item, AnyType): + return AnyType(TypeOfAny.from_another_any, source_any=item) + if isinstance(item, Instance): + res = type_object_type(item.type, self.named_type) + if isinstance(res, CallableType): + res = res.copy_modified(from_type_type=True) + expanded = expand_type_by_instance(res, item) + if isinstance(expanded, CallableType): + # Callee of the form Type[...] should never be generic, only + # proper class objects can be. + expanded = expanded.copy_modified(variables=[]) + return expanded + if isinstance(item, UnionType): + return UnionType( + [ + self.analyze_type_type_callee(get_proper_type(tp), context) + for tp in item.relevant_items() + ], + item.line, + ) + if isinstance(item, TypeVarType): + # Pretend we're calling the typevar's upper bound, + # i.e. its constructor (a poor approximation for reality, + # but better than AnyType...), but replace the return type + # with typevar. + callee = self.analyze_type_type_callee(get_proper_type(item.upper_bound), context) + callee = get_proper_type(callee) + if isinstance(callee, CallableType): + callee = callee.copy_modified(ret_type=item) + elif isinstance(callee, Overloaded): + callee = Overloaded([c.copy_modified(ret_type=item) for c in callee.items]) + return callee + # We support Type of namedtuples but not of tuples in general + if isinstance(item, TupleType) and tuple_fallback(item).type.fullname != "builtins.tuple": + return self.analyze_type_type_callee(tuple_fallback(item), context) + if isinstance(item, TypedDictType): + return self.typeddict_callable_from_context(item) + + self.msg.unsupported_type_type(item, context) + return AnyType(TypeOfAny.from_error) + + def infer_arg_types_in_empty_context(self, args: list[Expression]) -> list[Type]: + """Infer argument expression types in an empty context. + + In short, we basically recurse on each argument without considering + in what context the argument was called. + """ + res: list[Type] = [] + + for arg in args: + arg_type = self.accept(arg) + if has_erased_component(arg_type): + res.append(NoneType()) + else: + res.append(arg_type) + return res + + def infer_more_unions_for_recursive_type(self, type_context: Type) -> bool: + """Adjust type inference of unions if type context has a recursive type. + + Return the old state. The caller must assign it to type_state.infer_unions + afterwards. + + This is a hack to better support inference for recursive types. + + Note: This is performance-sensitive and must not be a context manager + until mypyc supports them better. + """ + old = type_state.infer_unions + if has_recursive_types(type_context): + type_state.infer_unions = True + return old + + def infer_arg_types_in_context( + self, + callee: CallableType, + args: list[Expression], + arg_kinds: list[ArgKind], + formal_to_actual: list[list[int]], + ) -> list[Type]: + """Infer argument expression types using a callable type as context. + + For example, if callee argument 2 has type List[int], infer the + argument expression with List[int] type context. + + Returns the inferred types of *actual arguments*. + """ + # Precompute arg_context so that we type check argument expressions in evaluation order + arg_context: list[Type | None] = [None] * len(args) + for fi, actuals in enumerate(formal_to_actual): + for ai in actuals: + if arg_kinds[ai].is_star(): + continue + arg_context[ai] = callee.arg_types[fi] + + res = [] + for arg, ctx in zip(args, arg_context): + if ctx is not None: + # When the outer context for a function call is known to be recursive, + # we solve type constraints inferred from arguments using unions instead + # of joins. This is a bit arbitrary, but in practice it works for most + # cases. A cleaner alternative would be to switch to single bin type + # inference, but this is a lot of work. + old = self.infer_more_unions_for_recursive_type(ctx) + res.append(self.accept(arg, ctx)) + # We need to manually restore union inference state, ugh. + type_state.infer_unions = old + else: + res.append(self.accept(arg)) + return res + + def infer_function_type_arguments_using_context( + self, callable: CallableType, error_context: Context + ) -> CallableType: + """Unify callable return type to type context to infer type vars. + + For example, if the return type is set[t] where 't' is a type variable + of callable, and if the context is set[int], return callable modified + by substituting 't' with 'int'. + """ + ctx = self.type_context[-1] + if not ctx: + return callable + # The return type may have references to type metavariables that + # we are inferring right now. We must consider them as indeterminate + # and they are not potential results; thus we replace them with the + # special ErasedType type. On the other hand, class type variables are + # valid results. + erased_ctx = replace_meta_vars(ctx, ErasedType()) + ret_type = callable.ret_type + if is_overlapping_none(ret_type) and is_overlapping_none(ctx): + # If both the context and the return type are optional, unwrap the optional, + # since in 99% cases this is what a user expects. In other words, we replace + # Optional[T] <: Optional[int] + # with + # T <: int + # while the former would infer T <: Optional[int]. + ret_type = remove_optional(ret_type) + erased_ctx = remove_optional(erased_ctx) + # + # TODO: Instead of this hack and the one below, we need to use outer and + # inner contexts at the same time. This is however not easy because of two + # reasons: + # * We need to support constraints like [1 <: 2, 2 <: X], i.e. with variables + # on both sides. (This is not too hard.) + # * We need to update all the inference "infrastructure", so that all + # variables in an expression are inferred at the same time. + # (And this is hard, also we need to be careful with lambdas that require + # two passes.) + proper_ret = get_proper_type(ret_type) + if ( + isinstance(proper_ret, TypeVarType) + or isinstance(proper_ret, UnionType) + and all(isinstance(get_proper_type(u), TypeVarType) for u in proper_ret.items) + ): + # Another special case: the return type is a type variable. If it's unrestricted, + # we could infer a too general type for the type variable if we use context, + # and this could result in confusing and spurious type errors elsewhere. + # + # So we give up and just use function arguments for type inference, with just two + # exceptions: + # + # 1. If the context is a generic instance type, actually use it as context, as + # this *seems* to usually be the reasonable thing to do. + # + # See also github issues #462 and #360. + # + # 2. If the context is some literal type, we want to "propagate" that information + # down so that we infer a more precise type for literal expressions. For example, + # the expression `3` normally has an inferred type of `builtins.int`: but if it's + # in a literal context like below, we want it to infer `Literal[3]` instead. + # + # def expects_literal(x: Literal[3]) -> None: pass + # def identity(x: T) -> T: return x + # + # expects_literal(identity(3)) # Should type-check + # TODO: we may want to add similar exception if all arguments are lambdas, since + # in this case external context is almost everything we have. + if not is_generic_instance(ctx) and not is_literal_type_like(ctx): + return callable.copy_modified() + args = infer_type_arguments( + callable.variables, ret_type, erased_ctx, skip_unsatisfied=True + ) + # Only substitute non-Uninhabited and non-erased types. + new_args: list[Type | None] = [] + for arg in args: + if has_uninhabited_component(arg) or has_erased_component(arg): + new_args.append(None) + else: + new_args.append(arg) + # Don't show errors after we have only used the outer context for inference. + # We will use argument context to infer more variables. + return self.apply_generic_arguments( + callable, new_args, error_context, skip_unsatisfied=True + ) + + def infer_function_type_arguments( + self, + callee_type: CallableType, + args: list[Expression], + arg_kinds: list[ArgKind], + arg_names: Sequence[str | None] | None, + formal_to_actual: list[list[int]], + need_refresh: bool, + context: Context, + ) -> CallableType: + """Infer the type arguments for a generic callee type. + + Infer based on the types of arguments. + + Return a derived callable type that has the arguments applied. + """ + if self.chk.in_checked_function(): + # Disable type errors during type inference. There may be errors + # due to partial available context information at this time, but + # these errors can be safely ignored as the arguments will be + # inferred again later. + with self.msg.filter_errors(): + arg_types = self.infer_arg_types_in_context( + callee_type, args, arg_kinds, formal_to_actual + ) + + arg_pass_nums = self.get_arg_infer_passes( + callee_type, args, arg_types, formal_to_actual, len(args) + ) + + pass1_args: list[Type | None] = [] + for i, arg in enumerate(arg_types): + if arg_pass_nums[i] > 1: + pass1_args.append(None) + else: + pass1_args.append(arg) + + inferred_args, _ = infer_function_type_arguments( + callee_type, + pass1_args, + arg_kinds, + arg_names, + formal_to_actual, + context=self.argument_infer_context(), + strict=self.chk.in_checked_function(), + ) + + if 2 in arg_pass_nums: + # Second pass of type inference. + callee_type, inferred_args = self.infer_function_type_arguments_pass2( + callee_type, + args, + arg_kinds, + arg_names, + formal_to_actual, + inferred_args, + need_refresh, + context, + ) + + if ( + callee_type.special_sig == "dict" + and len(inferred_args) == 2 + and (ARG_NAMED in arg_kinds or ARG_STAR2 in arg_kinds) + ): + # HACK: Infer str key type for dict(...) with keyword args. The type system + # can't represent this so we special case it, as this is a pretty common + # thing. This doesn't quite work with all possible subclasses of dict + # if they shuffle type variables around, as we assume that there is a 1-1 + # correspondence with dict type variables. This is a marginal issue and + # a little tricky to fix so it's left unfixed for now. + first_arg = get_proper_type(inferred_args[0]) + if isinstance(first_arg, (NoneType, UninhabitedType)): + inferred_args[0] = self.named_type("builtins.str") + elif not first_arg or not is_subtype(self.named_type("builtins.str"), first_arg): + self.chk.fail(message_registry.KEYWORD_ARGUMENT_REQUIRES_STR_KEY_TYPE, context) + + if not self.chk.options.old_type_inference and any( + a is None + or isinstance(get_proper_type(a), UninhabitedType) + or set(get_type_vars(a)) & set(callee_type.variables) + for a in inferred_args + ): + if need_refresh: + # Technically we need to refresh formal_to_actual after *each* inference pass, + # since each pass can expand ParamSpec or TypeVarTuple. Although such situations + # are very rare, not doing this can cause crashes. + formal_to_actual = map_actuals_to_formals( + arg_kinds, + arg_names, + callee_type.arg_kinds, + callee_type.arg_names, + lambda a: self.accept(args[a]), + ) + # If the regular two-phase inference didn't work, try inferring type + # variables while allowing for polymorphic solutions, i.e. for solutions + # potentially involving free variables. + # TODO: support the similar inference for return type context. + poly_inferred_args, free_vars = infer_function_type_arguments( + callee_type, + arg_types, + arg_kinds, + arg_names, + formal_to_actual, + context=self.argument_infer_context(), + strict=self.chk.in_checked_function(), + allow_polymorphic=True, + ) + poly_callee_type = self.apply_generic_arguments( + callee_type, poly_inferred_args, context + ) + # Try applying inferred polymorphic type if possible, e.g. Callable[[T], T] can + # be interpreted as def [T] (T) -> T, but dict[T, T] cannot be expressed. + applied = applytype.apply_poly(poly_callee_type, free_vars) + if applied is not None and all( + a is not None and not isinstance(get_proper_type(a), UninhabitedType) + for a in poly_inferred_args + ): + freeze_all_type_vars(applied) + return applied + # If it didn't work, erase free variables as uninhabited, to avoid confusing errors. + unknown = UninhabitedType() + unknown.ambiguous = True + inferred_args = [ + ( + expand_type( + a, {v.id: unknown for v in list(callee_type.variables) + free_vars} + ) + if a is not None + else None + ) + for a in poly_inferred_args + ] + else: + # In dynamically typed functions use implicit 'Any' types for + # type variables. + inferred_args = [AnyType(TypeOfAny.unannotated)] * len(callee_type.variables) + return self.apply_inferred_arguments(callee_type, inferred_args, context) + + def infer_function_type_arguments_pass2( + self, + callee_type: CallableType, + args: list[Expression], + arg_kinds: list[ArgKind], + arg_names: Sequence[str | None] | None, + formal_to_actual: list[list[int]], + old_inferred_args: Sequence[Type | None], + need_refresh: bool, + context: Context, + ) -> tuple[CallableType, list[Type | None]]: + """Perform second pass of generic function type argument inference. + + The second pass is needed for arguments with types such as Callable[[T], S], + where both T and S are type variables, when the actual argument is a + lambda with inferred types. The idea is to infer the type variable T + in the first pass (based on the types of other arguments). This lets + us infer the argument and return type of the lambda expression and + thus also the type variable S in this second pass. + + Return (the callee with type vars applied, inferred actual arg types). + """ + # None or erased types in inferred types mean that there was not enough + # information to infer the argument. Replace them with None values so + # that they are not applied yet below. + inferred_args = list(old_inferred_args) + for i, arg in enumerate(get_proper_types(inferred_args)): + if isinstance(arg, (NoneType, UninhabitedType)) or has_erased_component(arg): + inferred_args[i] = None + callee_type = self.apply_generic_arguments(callee_type, inferred_args, context) + + if not callee_type.is_generic(): + # Fast path, second pass can't give new information. + return callee_type, [] + + if need_refresh: + formal_to_actual = map_actuals_to_formals( + arg_kinds, + arg_names, + callee_type.arg_kinds, + callee_type.arg_names, + lambda a: self.accept(args[a]), + ) + + # Same as during first pass, disable type errors (we still have partial context). + with self.msg.filter_errors(): + arg_types = self.infer_arg_types_in_context( + callee_type, args, arg_kinds, formal_to_actual + ) + + inferred_args, _ = infer_function_type_arguments( + callee_type, + arg_types, + arg_kinds, + arg_names, + formal_to_actual, + context=self.argument_infer_context(), + ) + + return callee_type, inferred_args + + def argument_infer_context(self) -> ArgumentInferContext: + if self._arg_infer_context_cache is None: + self._arg_infer_context_cache = ArgumentInferContext( + self.chk.named_type("typing.Mapping"), self.chk.named_type("typing.Iterable") + ) + return self._arg_infer_context_cache + + def get_arg_infer_passes( + self, + callee: CallableType, + args: list[Expression], + arg_types: list[Type], + formal_to_actual: list[list[int]], + num_actuals: int, + ) -> list[int]: + """Return pass numbers for args for two-pass argument type inference. + + For each actual, the pass number is either 1 (first pass) or 2 (second + pass). + + Two-pass argument type inference primarily lets us infer types of + lambdas more effectively. + """ + res = [1] * num_actuals + for i, arg in enumerate(callee.arg_types): + skip_param_spec = False + p_formal = get_proper_type(callee.arg_types[i]) + if isinstance(p_formal, CallableType) and p_formal.param_spec(): + for j in formal_to_actual[i]: + p_actual = get_proper_type(arg_types[j]) + # This is an exception from the usual logic where we put generic Callable + # arguments in the second pass. If we have a non-generic actual, it is + # likely to infer good constraints, for example if we have: + # def run(Callable[P, None], *args: P.args, **kwargs: P.kwargs) -> None: ... + # def test(x: int, y: int) -> int: ... + # run(test, 1, 2) + # we will use `test` for inference, since it will allow to infer also + # argument *names* for P <: [x: int, y: int]. + if isinstance(p_actual, Instance): + call_method = find_member("__call__", p_actual, p_actual, is_operator=True) + if call_method is not None: + p_actual = get_proper_type(call_method) + if ( + isinstance(p_actual, CallableType) + and not p_actual.variables + and not isinstance(args[j], LambdaExpr) + ): + skip_param_spec = True + break + if not skip_param_spec and arg.accept(ArgInferSecondPassQuery()): + for j in formal_to_actual[i]: + res[j] = 2 + return res + + def apply_inferred_arguments( + self, callee_type: CallableType, inferred_args: Sequence[Type | None], context: Context + ) -> CallableType: + """Apply inferred values of type arguments to a generic function. + + Inferred_args contains the values of function type arguments. + """ + # Report error if some of the variables could not be solved. In that + # case assume that all variables have type Any to avoid extra + # bogus error messages. + for inferred_type, tv in zip(inferred_args, callee_type.variables): + if not inferred_type or has_erased_component(inferred_type): + # Could not infer a non-trivial type for a type variable. + self.msg.could_not_infer_type_arguments(callee_type, tv, context) + inferred_args = [AnyType(TypeOfAny.from_error)] * len(inferred_args) + # Apply the inferred types to the function type. In this case the + # return type must be CallableType, since we give the right number of type + # arguments. + return self.apply_generic_arguments(callee_type, inferred_args, context) + + def check_argument_count( + self, + callee: CallableType, + actual_types: list[Type], + actual_kinds: list[ArgKind], + actual_names: Sequence[str | None] | None, + formal_to_actual: list[list[int]], + context: Context | None, + object_type: Type | None = None, + callable_name: str | None = None, + ) -> bool: + """Check that there is a value for all required arguments to a function. + + Also check that there are no duplicate values for arguments. Report found errors + using 'messages' if it's not None. If 'messages' is given, 'context' must also be given. + + Return False if there were any errors. Otherwise return True + """ + if context is None: + # Avoid "is None" checks + context = TempNode(AnyType(TypeOfAny.special_form)) + + # TODO(jukka): We could return as soon as we find an error if messages is None. + + # Collect dict of all actual arguments matched to formal arguments, with occurrence count + all_actuals: dict[int, int] = {} + for actuals in formal_to_actual: + for a in actuals: + all_actuals[a] = all_actuals.get(a, 0) + 1 + + ok, is_unexpected_arg_error = self.check_for_extra_actual_arguments( + callee, actual_types, actual_kinds, actual_names, all_actuals, context + ) + + # Check for too many or few values for formals. + for i, kind in enumerate(callee.arg_kinds): + mapped_args = formal_to_actual[i] + if kind.is_required() and not mapped_args and not is_unexpected_arg_error: + # No actual for a mandatory formal + if kind.is_positional(): + self.msg.too_few_arguments(callee, context, actual_names) + if object_type and callable_name and "." in callable_name: + self.missing_classvar_callable_note(object_type, callable_name, context) + else: + argname = callee.arg_names[i] or "?" + self.msg.missing_named_argument(callee, context, argname) + ok = False + elif not kind.is_star() and is_duplicate_mapping( + mapped_args, actual_types, actual_kinds + ): + if self.chk.in_checked_function() or isinstance( + get_proper_type(actual_types[mapped_args[0]]), TupleType + ): + self.msg.duplicate_argument_value(callee, i, context) + ok = False + elif ( + kind.is_named() + and mapped_args + and actual_kinds[mapped_args[0]] not in [nodes.ARG_NAMED, nodes.ARG_STAR2] + ): + # Positional argument when expecting a keyword argument. + self.msg.too_many_positional_arguments(callee, context) + ok = False + elif callee.param_spec() is not None: + if not mapped_args and callee.special_sig != "partial": + self.msg.too_few_arguments(callee, context, actual_names) + ok = False + elif len(mapped_args) > 1: + paramspec_entries = sum( + isinstance(get_proper_type(actual_types[k]), ParamSpecType) + for k in mapped_args + ) + if actual_kinds[mapped_args[0]] == nodes.ARG_STAR and paramspec_entries > 1: + self.msg.fail("ParamSpec.args should only be passed once", context) + ok = False + if actual_kinds[mapped_args[0]] == nodes.ARG_STAR2 and paramspec_entries > 1: + self.msg.fail("ParamSpec.kwargs should only be passed once", context) + ok = False + return ok + + def check_for_extra_actual_arguments( + self, + callee: CallableType, + actual_types: list[Type], + actual_kinds: list[ArgKind], + actual_names: Sequence[str | None] | None, + all_actuals: dict[int, int], + context: Context, + ) -> tuple[bool, bool]: + """Check for extra actual arguments. + + Return tuple (was everything ok, + was there an extra keyword argument error [used to avoid duplicate errors]). + """ + + is_unexpected_arg_error = False # Keep track of errors to avoid duplicate errors + ok = True # False if we've found any error + + for i, kind in enumerate(actual_kinds): + if ( + i not in all_actuals + and + # We accept the other iterables than tuple (including Any) + # as star arguments because they could be empty, resulting no arguments. + (kind != nodes.ARG_STAR or is_non_empty_tuple(actual_types[i])) + and + # Accept all types for double-starred arguments, because they could be empty + # dictionaries and we can't tell it from their types + kind != nodes.ARG_STAR2 + ): + # Extra actual: not matched by a formal argument. + ok = False + if kind != nodes.ARG_NAMED: + self.msg.too_many_arguments(callee, context) + else: + assert actual_names, "Internal error: named kinds without names given" + act_name = actual_names[i] + assert act_name is not None + act_type = actual_types[i] + self.msg.unexpected_keyword_argument(callee, act_name, act_type, context) + is_unexpected_arg_error = True + elif ( + kind == nodes.ARG_STAR and nodes.ARG_STAR not in callee.arg_kinds + ) or kind == nodes.ARG_STAR2: + actual_type = get_proper_type(actual_types[i]) + if isinstance(actual_type, (TupleType, TypedDictType)): + if all_actuals.get(i, 0) < len(actual_type.items): + # Too many tuple/dict items as some did not match. + if kind != nodes.ARG_STAR2 or not isinstance(actual_type, TypedDictType): + self.msg.too_many_arguments(callee, context) + else: + self.msg.too_many_arguments_from_typed_dict( + callee, actual_type, context + ) + is_unexpected_arg_error = True + ok = False + # *args/**kwargs can be applied even if the function takes a fixed + # number of positional arguments. This may succeed at runtime. + + return ok, is_unexpected_arg_error + + def missing_classvar_callable_note( + self, object_type: Type, callable_name: str, context: Context + ) -> None: + if isinstance(object_type, ProperType) and isinstance(object_type, Instance): + _, var_name = callable_name.rsplit(".", maxsplit=1) + node = object_type.type.get(var_name) + if node is not None and isinstance(node.node, Var): + if not node.node.is_inferred and not node.node.is_classvar: + self.msg.note( + f'"{var_name}" is considered instance variable,' + " to make it class variable use ClassVar[...]", + context, + ) + + def check_var_args_kwargs( + self, arg_types: list[Type], arg_kinds: list[ArgKind], context: Context + ) -> None: + for arg_type, arg_kind in zip(arg_types, arg_kinds): + arg_type = get_proper_type(arg_type) + if arg_kind == nodes.ARG_STAR and not self.is_valid_var_arg(arg_type): + self.msg.invalid_var_arg(arg_type, context) + if arg_kind == nodes.ARG_STAR2 and not self.is_valid_keyword_var_arg(arg_type): + is_mapping = is_subtype( + arg_type, self.chk.named_type("_typeshed.SupportsKeysAndGetItem") + ) + self.msg.invalid_keyword_var_arg(arg_type, is_mapping, context) + + def check_argument_types( + self, + arg_types: list[Type], + arg_kinds: list[ArgKind], + args: list[Expression], + callee: CallableType, + formal_to_actual: list[list[int]], + context: Context, + check_arg: ArgChecker | None = None, + object_type: Type | None = None, + ) -> None: + """Check argument types against a callable type. + + Report errors if the argument types are not compatible. + + The check_call docstring describes some of the arguments. + """ + self.check_var_args_kwargs(arg_types, arg_kinds, context) + + check_arg = check_arg or self.check_arg + # Keep track of consumed tuple *arg items. + mapper = ArgTypeExpander(self.argument_infer_context()) + + for i, actuals in enumerate(formal_to_actual): + orig_callee_arg_type = get_proper_type(callee.arg_types[i]) + + # Checking the case that we have more than one item but the first argument + # is an unpack, so this would be something like: + # [Tuple[Unpack[Ts]], int] + # + # In this case we have to check everything together, we do this by re-unifying + # the suffices to the tuple, e.g. a single actual like + # Tuple[Unpack[Ts], int] + expanded_tuple = False + actual_kinds = [arg_kinds[a] for a in actuals] + if len(actuals) > 1: + p_actual_type = get_proper_type(arg_types[actuals[0]]) + if ( + isinstance(p_actual_type, TupleType) + and len(p_actual_type.items) == 1 + and isinstance(p_actual_type.items[0], UnpackType) + and actual_kinds == [nodes.ARG_STAR] + [nodes.ARG_POS] * (len(actuals) - 1) + ): + actual_types = [p_actual_type.items[0]] + [arg_types[a] for a in actuals[1:]] + if isinstance(orig_callee_arg_type, UnpackType): + p_callee_type = get_proper_type(orig_callee_arg_type.type) + if isinstance(p_callee_type, TupleType): + assert p_callee_type.items + callee_arg_types = p_callee_type.items + callee_arg_kinds = [nodes.ARG_STAR] + [nodes.ARG_POS] * ( + len(p_callee_type.items) - 1 + ) + expanded_tuple = True + + if not expanded_tuple: + actual_types = [arg_types[a] for a in actuals] + if isinstance(orig_callee_arg_type, UnpackType): + unpacked_type = get_proper_type(orig_callee_arg_type.type) + if isinstance(unpacked_type, TupleType): + inner_unpack_index = find_unpack_in_list(unpacked_type.items) + if inner_unpack_index is None: + callee_arg_types = unpacked_type.items + callee_arg_kinds = [ARG_POS] * len(actuals) + else: + inner_unpack = unpacked_type.items[inner_unpack_index] + assert isinstance(inner_unpack, UnpackType) + inner_unpacked_type = get_proper_type(inner_unpack.type) + if isinstance(inner_unpacked_type, TypeVarTupleType): + # This branch mimics the expanded_tuple case above but for + # the case where caller passed a single * unpacked tuple argument. + callee_arg_types = unpacked_type.items + callee_arg_kinds = [ + ARG_POS if i != inner_unpack_index else ARG_STAR + for i in range(len(unpacked_type.items)) + ] + else: + # We assume heterogeneous tuples are desugared earlier. + assert isinstance(inner_unpacked_type, Instance) + assert inner_unpacked_type.type.fullname == "builtins.tuple" + callee_arg_types = ( + unpacked_type.items[:inner_unpack_index] + + [inner_unpacked_type.args[0]] + * (len(actuals) - len(unpacked_type.items) + 1) + + unpacked_type.items[inner_unpack_index + 1 :] + ) + callee_arg_kinds = [ARG_POS] * len(actuals) + elif isinstance(unpacked_type, TypeVarTupleType): + callee_arg_types = [orig_callee_arg_type] + callee_arg_kinds = [ARG_STAR] + else: + assert isinstance(unpacked_type, Instance) + assert unpacked_type.type.fullname == "builtins.tuple" + callee_arg_types = [unpacked_type.args[0]] * len(actuals) + callee_arg_kinds = [ARG_POS] * len(actuals) + else: + callee_arg_types = [orig_callee_arg_type] * len(actuals) + callee_arg_kinds = [callee.arg_kinds[i]] * len(actuals) + + assert len(actual_types) == len(actuals) == len(actual_kinds) + + if len(callee_arg_types) != len(actual_types): + if len(actual_types) > len(callee_arg_types): + self.chk.msg.too_many_arguments(callee, context) + else: + self.chk.msg.too_few_arguments(callee, context, None) + continue + + assert len(callee_arg_types) == len(actual_types) + assert len(callee_arg_types) == len(callee_arg_kinds) + for actual, actual_type, actual_kind, callee_arg_type, callee_arg_kind in zip( + actuals, actual_types, actual_kinds, callee_arg_types, callee_arg_kinds + ): + # Check that a *arg is valid as varargs. + expanded_actual = mapper.expand_actual_type( + actual_type, + actual_kind, + callee.arg_names[i], + callee_arg_kind, + allow_unpack=isinstance(callee_arg_type, UnpackType), + ) + check_arg( + expanded_actual, + actual_type, + actual_kind, + callee_arg_type, + actual + 1, + i + 1, + callee, + object_type, + args[actual], + context, + ) + + def check_arg( + self, + caller_type: Type, + original_caller_type: Type, + caller_kind: ArgKind, + callee_type: Type, + n: int, + m: int, + callee: CallableType, + object_type: Type | None, + context: Context, + outer_context: Context, + ) -> None: + """Check the type of a single argument in a call.""" + caller_type = get_proper_type(caller_type) + original_caller_type = get_proper_type(original_caller_type) + callee_type = get_proper_type(callee_type) + + if isinstance(caller_type, DeletedType): + self.msg.deleted_as_rvalue(caller_type, context) + # Only non-abstract non-protocol class can be given where Type[...] is expected... + elif self.has_abstract_type_part(caller_type, callee_type): + self.msg.concrete_only_call(callee_type, context) + elif not is_subtype(caller_type, callee_type, options=self.chk.options): + error = self.msg.incompatible_argument( + n, + m, + callee, + original_caller_type, + caller_kind, + object_type=object_type, + context=context, + outer_context=outer_context, + ) + if not caller_kind.is_star(): + # For *args and **kwargs this note would be incorrect - we're comparing + # iterable/mapping type with union of relevant arg types. + self.msg.incompatible_argument_note( + original_caller_type, callee_type, context, parent_error=error + ) + if not self.msg.prefer_simple_messages(): + self.chk.check_possible_missing_await( + caller_type, callee_type, context, error.code + ) + + def check_overload_call( + self, + callee: Overloaded, + args: list[Expression], + arg_kinds: list[ArgKind], + arg_names: Sequence[str | None] | None, + callable_name: str | None, + object_type: Type | None, + context: Context, + ) -> tuple[Type, Type]: + """Checks a call to an overloaded function.""" + # Normalize unpacked kwargs before checking the call. + callee = callee.with_unpacked_kwargs() + arg_types = self.infer_arg_types_in_empty_context(args) + # Step 1: Filter call targets to remove ones where the argument counts don't match + plausible_targets = self.plausible_overload_call_targets( + arg_types, arg_kinds, arg_names, callee + ) + + # Step 2: If the arguments contain a union, we try performing union math first, + # instead of picking the first matching overload. + # This is because picking the first overload often ends up being too greedy: + # for example, when we have a fallback alternative that accepts an unrestricted + # typevar. See https://github.com/python/mypy/issues/4063 for related discussion. + erased_targets: list[CallableType] | None = None + inferred_types: list[Type] | None = None + unioned_result: tuple[Type, Type] | None = None + + # Determine whether we need to encourage union math. This should be generally safe, + # as union math infers better results in the vast majority of cases, but it is very + # computationally intensive. + none_type_var_overlap = self.possible_none_type_var_overlap(arg_types, plausible_targets) + union_interrupted = False # did we try all union combinations? + if any(self.real_union(arg) for arg in arg_types): + try: + with self.msg.filter_errors(): + unioned_return = self.union_overload_result( + plausible_targets, + args, + arg_types, + arg_kinds, + arg_names, + callable_name, + object_type, + none_type_var_overlap, + context, + ) + except TooManyUnions: + union_interrupted = True + else: + # Record if we succeeded. Next we need to see if maybe normal procedure + # gives a narrower type. + if unioned_return: + returns = [u[0] for u in unioned_return] + inferred_types = [u[1] for u in unioned_return] + # Note that we use `combine_function_signatures` instead of just returning + # a union of inferred callables because for example a call + # Union[int -> int, str -> str](Union[int, str]) is invalid and + # we don't want to introduce internal inconsistencies. + unioned_result = ( + make_simplified_union(returns, context.line, context.column), + self.combine_function_signatures(get_proper_types(inferred_types)), + ) + + # Step 3: We try checking each branch one-by-one. + inferred_result = self.infer_overload_return_type( + plausible_targets, + args, + arg_types, + arg_kinds, + arg_names, + callable_name, + object_type, + context, + ) + # If any of checks succeed, perform deprecation tests and stop early. + if inferred_result is not None and unioned_result is not None: + # Both unioned and direct checks succeeded, choose the more precise type. + if ( + is_subtype(inferred_result[0], unioned_result[0]) + and not isinstance(get_proper_type(inferred_result[0]), AnyType) + and not none_type_var_overlap + ): + unioned_result = None + else: + inferred_result = None + if unioned_result is not None: + if inferred_types is not None: + for inferred_type in inferred_types: + if isinstance(c := get_proper_type(inferred_type), CallableType): + self.chk.warn_deprecated(c.definition, context) + return unioned_result + if inferred_result is not None: + if isinstance(c := get_proper_type(inferred_result[1]), CallableType): + self.chk.warn_deprecated(c.definition, context) + return inferred_result + + # Step 4: Failure. At this point, we know there is no match. We fall back to trying + # to find a somewhat plausible overload target using the erased types + # so we can produce a nice error message. + # + # For example, suppose the user passes a value of type 'List[str]' into an + # overload with signatures f(x: int) -> int and f(x: List[int]) -> List[int]. + # + # Neither alternative matches, but we can guess the user probably wants the + # second one. + erased_targets = self.overload_erased_call_targets( + plausible_targets, arg_types, arg_kinds, arg_names, args, context + ) + + # Step 5: We try and infer a second-best alternative if possible. If not, fall back + # to using 'Any'. + if len(erased_targets) > 0: + # Pick the first plausible erased target as the fallback + # TODO: Adjust the error message here to make it clear there was no match. + # In order to do this, we need to find a clean way of associating + # a note with whatever error message 'self.check_call' will generate. + # In particular, the note's line and column numbers need to be the same + # as the error's. + target: Type = erased_targets[0] + else: + # There was no plausible match: give up + target = AnyType(TypeOfAny.from_error) + if not is_operator_method(callable_name): + code = None + else: + code = codes.OPERATOR + self.msg.no_variant_matches_arguments(callee, arg_types, context, code=code) + + result = self.check_call( + target, + args, + arg_kinds, + context, + arg_names, + callable_name=callable_name, + object_type=object_type, + ) + # Do not show the extra error if the union math was forced. + if union_interrupted and not none_type_var_overlap: + self.chk.fail(message_registry.TOO_MANY_UNION_COMBINATIONS, context) + return result + + def plausible_overload_call_targets( + self, + arg_types: list[Type], + arg_kinds: list[ArgKind], + arg_names: Sequence[str | None] | None, + overload: Overloaded, + ) -> list[CallableType]: + """Returns all overload call targets that having matching argument counts. + + If the given args contains a star-arg (*arg or **kwarg argument, except for + ParamSpec), this method will ensure all star-arg overloads appear at the start + of the list, instead of their usual location. + + The only exception is if the starred argument is something like a Tuple or a + NamedTuple, which has a definitive "shape". If so, we don't move the corresponding + alternative to the front since we can infer a more precise match using the original + order.""" + + def has_shape(typ: Type) -> bool: + typ = get_proper_type(typ) + return isinstance(typ, (TupleType, TypedDictType)) or ( + isinstance(typ, Instance) and typ.type.is_named_tuple + ) + + matches: list[CallableType] = [] + star_matches: list[CallableType] = [] + + args_have_var_arg = False + args_have_kw_arg = False + for kind, typ in zip(arg_kinds, arg_types): + if kind == ARG_STAR and not has_shape(typ): + args_have_var_arg = True + if kind == ARG_STAR2 and not has_shape(typ): + args_have_kw_arg = True + + for typ in overload.items: + formal_to_actual = map_actuals_to_formals( + arg_kinds, arg_names, typ.arg_kinds, typ.arg_names, lambda i: arg_types[i] + ) + with self.msg.filter_errors(): + if typ.param_spec() is not None: + # ParamSpec can be expanded in a lot of different ways. We may try + # to expand it here instead, but picking an impossible overload + # is safe: it will be filtered out later. + # Unlike other var-args signatures, ParamSpec produces essentially + # a fixed signature, so there's no need to push them to the top. + matches.append(typ) + elif self.check_argument_count( + typ, arg_types, arg_kinds, arg_names, formal_to_actual, None + ): + if args_have_var_arg and typ.is_var_arg: + star_matches.append(typ) + elif args_have_kw_arg and typ.is_kw_arg: + star_matches.append(typ) + else: + matches.append(typ) + + return star_matches + matches + + def infer_overload_return_type( + self, + plausible_targets: list[CallableType], + args: list[Expression], + arg_types: list[Type], + arg_kinds: list[ArgKind], + arg_names: Sequence[str | None] | None, + callable_name: str | None, + object_type: Type | None, + context: Context, + ) -> tuple[Type, Type] | None: + """Attempts to find the first matching callable from the given list. + + If a match is found, returns a tuple containing the result type and the inferred + callee type. (This tuple is meant to be eventually returned by check_call.) + If multiple targets match due to ambiguous Any parameters, returns (AnyType, AnyType). + If no targets match, returns None. + + Assumes all of the given targets have argument counts compatible with the caller. + """ + + matches: list[CallableType] = [] + return_types: list[Type] = [] + inferred_types: list[Type] = [] + args_contain_any = any(map(has_any_type, arg_types)) + type_maps: list[dict[Expression, Type]] = [] + + for typ in plausible_targets: + assert self.msg is self.chk.msg + with self.msg.filter_errors(filter_revealed_type=True) as w: + with self.chk.local_type_map as m: + ret_type, infer_type = self.check_call( + callee=typ, + args=args, + arg_kinds=arg_kinds, + arg_names=arg_names, + context=context, + callable_name=callable_name, + object_type=object_type, + ) + is_match = not w.has_new_errors() + if is_match: + # Return early if possible; otherwise record info, so we can + # check for ambiguity due to 'Any' below. + if not args_contain_any: + self.chk.store_types(m) + return ret_type, infer_type + p_infer_type = get_proper_type(infer_type) + if isinstance(p_infer_type, CallableType): + # Prefer inferred types if possible, this will avoid false triggers for + # Any-ambiguity caused by arguments with Any passed to generic overloads. + matches.append(p_infer_type) + else: + matches.append(typ) + return_types.append(ret_type) + inferred_types.append(infer_type) + type_maps.append(m) + + if not matches: + return None + elif any_causes_overload_ambiguity(matches, return_types, arg_types, arg_kinds, arg_names): + # An argument of type or containing the type 'Any' caused ambiguity. + # We try returning a precise type if we can. If not, we give up and just return 'Any'. + if all_same_types(return_types): + self.chk.store_types(type_maps[0]) + return return_types[0], inferred_types[0] + elif all_same_types([erase_type(typ) for typ in return_types]): + self.chk.store_types(type_maps[0]) + return erase_type(return_types[0]), erase_type(inferred_types[0]) + else: + return self.check_call( + callee=AnyType(TypeOfAny.special_form), + args=args, + arg_kinds=arg_kinds, + arg_names=arg_names, + context=context, + callable_name=callable_name, + object_type=object_type, + ) + else: + # Success! No ambiguity; return the first match. + self.chk.store_types(type_maps[0]) + return return_types[0], inferred_types[0] + + def overload_erased_call_targets( + self, + plausible_targets: list[CallableType], + arg_types: list[Type], + arg_kinds: list[ArgKind], + arg_names: Sequence[str | None] | None, + args: list[Expression], + context: Context, + ) -> list[CallableType]: + """Returns a list of all targets that match the caller after erasing types. + + Assumes all of the given targets have argument counts compatible with the caller. + """ + matches: list[CallableType] = [] + for typ in plausible_targets: + if self.erased_signature_similarity( + arg_types, arg_kinds, arg_names, args, typ, context + ): + matches.append(typ) + return matches + + def possible_none_type_var_overlap( + self, arg_types: list[Type], plausible_targets: list[CallableType] + ) -> bool: + """Heuristic to determine whether we need to try forcing union math. + + This is needed to avoid greedy type variable match in situations like this: + @overload + def foo(x: None) -> None: ... + @overload + def foo(x: T) -> list[T]: ... + + x: int | None + foo(x) + we want this call to infer list[int] | None, not list[int | None]. + """ + if not plausible_targets or not arg_types: + return False + has_optional_arg = False + for arg_type in get_proper_types(arg_types): + if not isinstance(arg_type, UnionType): + continue + for item in get_proper_types(arg_type.items): + if isinstance(item, NoneType): + has_optional_arg = True + break + if not has_optional_arg: + return False + + min_prefix = min(len(c.arg_types) for c in plausible_targets) + for i in range(min_prefix): + if any( + isinstance(get_proper_type(c.arg_types[i]), NoneType) for c in plausible_targets + ) and any( + isinstance(get_proper_type(c.arg_types[i]), TypeVarType) for c in plausible_targets + ): + return True + return False + + def union_overload_result( + self, + plausible_targets: list[CallableType], + args: list[Expression], + arg_types: list[Type], + arg_kinds: list[ArgKind], + arg_names: Sequence[str | None] | None, + callable_name: str | None, + object_type: Type | None, + none_type_var_overlap: bool, + context: Context, + level: int = 0, + ) -> list[tuple[Type, Type]] | None: + """Accepts a list of overload signatures and attempts to match calls by destructuring + the first union. + + Return a list of (, ) if call succeeds for every + item of the desctructured union. Returns None if there is no match. + """ + # Step 1: If we are already too deep, then stop immediately. Otherwise mypy might + # hang for long time because of a weird overload call. The caller will get + # the exception and generate an appropriate note message, if needed. + if level >= MAX_UNIONS: + raise TooManyUnions + + # Step 2: Find position of the first union in arguments. Return the normal inferred + # type if no more unions left. + for idx, typ in enumerate(arg_types): + if self.real_union(typ): + break + else: + # No unions in args, just fall back to normal inference + with self.type_overrides_set(args, arg_types): + res = self.infer_overload_return_type( + plausible_targets, + args, + arg_types, + arg_kinds, + arg_names, + callable_name, + object_type, + context, + ) + if res is not None: + return [res] + return None + + # Step 3: Try a direct match before splitting to avoid unnecessary union splits + # and save performance. + if not none_type_var_overlap: + with self.type_overrides_set(args, arg_types): + direct = self.infer_overload_return_type( + plausible_targets, + args, + arg_types, + arg_kinds, + arg_names, + callable_name, + object_type, + context, + ) + if direct is not None and not isinstance( + get_proper_type(direct[0]), (UnionType, AnyType) + ): + # We only return non-unions soon, to avoid greedy match. + return [direct] + + # Step 4: Split the first remaining union type in arguments into items and + # try to match each item individually (recursive). + first_union = get_proper_type(arg_types[idx]) + assert isinstance(first_union, UnionType) + res_items = [] + for item in first_union.relevant_items(): + new_arg_types = arg_types.copy() + new_arg_types[idx] = item + sub_result = self.union_overload_result( + plausible_targets, + args, + new_arg_types, + arg_kinds, + arg_names, + callable_name, + object_type, + none_type_var_overlap, + context, + level + 1, + ) + if sub_result is not None: + res_items.extend(sub_result) + else: + # Some item doesn't match, return soon. + return None + + # Step 5: If splitting succeeded, then filter out duplicate items before returning. + seen: set[tuple[Type, Type]] = set() + result = [] + for pair in res_items: + if pair not in seen: + seen.add(pair) + result.append(pair) + return result + + def real_union(self, typ: Type) -> bool: + typ = get_proper_type(typ) + return isinstance(typ, UnionType) and len(typ.relevant_items()) > 1 + + @contextmanager + def type_overrides_set( + self, exprs: Sequence[Expression], overrides: Sequence[Type] + ) -> Iterator[None]: + """Set _temporary_ type overrides for given expressions.""" + assert len(exprs) == len(overrides) + for expr, typ in zip(exprs, overrides): + self.type_overrides[expr] = typ + try: + yield + finally: + for expr in exprs: + del self.type_overrides[expr] + + def combine_function_signatures(self, types: list[ProperType]) -> AnyType | CallableType: + """Accepts a list of function signatures and attempts to combine them together into a + new CallableType consisting of the union of all of the given arguments and return types. + + If there is at least one non-callable type, return Any (this can happen if there is + an ambiguity because of Any in arguments). + """ + assert types, "Trying to merge no callables" + if not all(isinstance(c, CallableType) for c in types): + return AnyType(TypeOfAny.special_form) + callables = cast("list[CallableType]", types) + if len(callables) == 1: + return callables[0] + + # Note: we are assuming here that if a user uses some TypeVar 'T' in + # two different functions, they meant for that TypeVar to mean the + # same thing. + # + # This function will make sure that all instances of that TypeVar 'T' + # refer to the same underlying TypeVarType objects to simplify the union-ing + # logic below. + # + # (If the user did *not* mean for 'T' to be consistently bound to the + # same type in their overloads, well, their code is probably too + # confusing and ought to be re-written anyways.) + callables, variables = merge_typevars_in_callables_by_name(callables) + + new_args: list[list[Type]] = [[] for _ in range(len(callables[0].arg_types))] + new_kinds = list(callables[0].arg_kinds) + new_returns: list[Type] = [] + + too_complex = False + for target in callables: + # We fall back to Callable[..., Union[]] if the functions do not have + # the exact same signature. The only exception is if one arg is optional and + # the other is positional: in that case, we continue unioning (and expect a + # positional arg). + # TODO: Enhance the merging logic to handle a wider variety of signatures. + if len(new_kinds) != len(target.arg_kinds): + too_complex = True + break + for i, (new_kind, target_kind) in enumerate(zip(new_kinds, target.arg_kinds)): + if new_kind == target_kind: + continue + elif new_kind.is_positional() and target_kind.is_positional(): + new_kinds[i] = ARG_POS + else: + too_complex = True + break + + if too_complex: + break # outer loop + + for i, arg in enumerate(target.arg_types): + new_args[i].append(arg) + new_returns.append(target.ret_type) + + union_return = make_simplified_union(new_returns) + if too_complex: + any = AnyType(TypeOfAny.special_form) + return callables[0].copy_modified( + arg_types=[any, any], + arg_kinds=[ARG_STAR, ARG_STAR2], + arg_names=[None, None], + ret_type=union_return, + variables=variables, + implicit=True, + ) + + final_args = [] + for args_list in new_args: + new_type = make_simplified_union(args_list) + final_args.append(new_type) + + return callables[0].copy_modified( + arg_types=final_args, + arg_kinds=new_kinds, + ret_type=union_return, + variables=variables, + implicit=True, + ) + + def erased_signature_similarity( + self, + arg_types: list[Type], + arg_kinds: list[ArgKind], + arg_names: Sequence[str | None] | None, + args: list[Expression], + callee: CallableType, + context: Context, + ) -> bool: + """Determine whether arguments could match the signature at runtime, after + erasing types.""" + formal_to_actual = map_actuals_to_formals( + arg_kinds, arg_names, callee.arg_kinds, callee.arg_names, lambda i: arg_types[i] + ) + + with self.msg.filter_errors(): + if not self.check_argument_count( + callee, arg_types, arg_kinds, arg_names, formal_to_actual, None + ): + # Too few or many arguments -> no match. + return False + + def check_arg( + caller_type: Type, + original_ccaller_type: Type, + caller_kind: ArgKind, + callee_type: Type, + n: int, + m: int, + callee: CallableType, + object_type: Type | None, + context: Context, + outer_context: Context, + ) -> None: + if not arg_approximate_similarity(caller_type, callee_type): + # No match -- exit early since none of the remaining work can change + # the result. + raise Finished + + try: + self.check_argument_types( + arg_types, + arg_kinds, + args, + callee, + formal_to_actual, + context=context, + check_arg=check_arg, + ) + return True + except Finished: + return False + + def apply_generic_arguments( + self, + callable: CallableType, + types: Sequence[Type | None], + context: Context, + skip_unsatisfied: bool = False, + ) -> CallableType: + """Simple wrapper around mypy.applytype.apply_generic_arguments.""" + return applytype.apply_generic_arguments( + callable, + types, + self.msg.incompatible_typevar_value, + context, + skip_unsatisfied=skip_unsatisfied, + ) + + def check_any_type_call( + self, args: list[Expression], arg_kinds: list[ArgKind], callee: Type, context: Context + ) -> tuple[Type, Type]: + arg_types = self.infer_arg_types_in_empty_context(args) + self.check_var_args_kwargs(arg_types, arg_kinds, context) + + callee = get_proper_type(callee) + if isinstance(callee, AnyType): + return ( + AnyType(TypeOfAny.from_another_any, source_any=callee), + AnyType(TypeOfAny.from_another_any, source_any=callee), + ) + else: + return AnyType(TypeOfAny.special_form), AnyType(TypeOfAny.special_form) + + def check_union_call( + self, + callee: UnionType, + args: list[Expression], + arg_kinds: list[ArgKind], + arg_names: Sequence[str | None] | None, + context: Context, + ) -> tuple[Type, Type]: + with self.msg.disable_type_names(): + results = [ + self.check_call(subtype, args, arg_kinds, context, arg_names) + for subtype in callee.relevant_items() + ] + + return (make_simplified_union([res[0] for res in results]), callee) + + def visit_member_expr(self, e: MemberExpr, is_lvalue: bool = False) -> Type: + """Visit member expression (of form e.id).""" + result = self.analyze_ordinary_member_access(e, is_lvalue) + narrowed = self.narrow_type_from_binder(e, result) + self.chk.warn_deprecated(e.node, e) + return narrowed + + def analyze_ordinary_member_access( + self, e: MemberExpr, is_lvalue: bool, rvalue: Expression | None = None + ) -> Type: + """Analyse member expression or member lvalue. + + An rvalue can be provided optionally to infer better setter type when is_lvalue is True. + """ + if e.kind is not None: + # This is a reference to a module attribute. + return self.analyze_ref_expr(e) + else: + # This is a reference to a non-module attribute. + original_type = self.accept(e.expr, is_callee=self.is_callee) + base = e.expr + module_symbol_table = None + + if isinstance(base, RefExpr) and isinstance(base.node, MypyFile): + module_symbol_table = base.node.names + if isinstance(base, RefExpr) and isinstance(base.node, Var): + # This is needed to special case self-types, so we don't need to track + # these flags separately in checkmember.py. + is_self = base.node.is_self or base.node.is_cls + else: + is_self = False + + member_type = analyze_member_access( + e.name, + original_type, + e, + is_lvalue=is_lvalue, + is_super=False, + is_operator=False, + original_type=original_type, + chk=self.chk, + in_literal_context=self.is_literal_context(), + module_symbol_table=module_symbol_table, + is_self=is_self, + rvalue=rvalue, + ) + + return member_type + + def analyze_external_member_access( + self, member: str, base_type: Type, context: Context + ) -> Type: + """Analyse member access that is external, i.e. it cannot + refer to private definitions. Return the result type. + """ + # TODO remove; no private definitions in mypy + return analyze_member_access( + member, + base_type, + context, + is_lvalue=False, + is_super=False, + is_operator=False, + original_type=base_type, + chk=self.chk, + in_literal_context=self.is_literal_context(), + ) + + def is_literal_context(self) -> bool: + return is_literal_type_like(self.type_context[-1]) + + def infer_literal_expr_type(self, value: LiteralValue, fallback_name: str) -> Type: + """Analyzes the given literal expression and determines if we should be + inferring an Instance type, a Literal[...] type, or an Instance that + remembers the original literal. We... + + 1. ...Infer a normal Instance in most circumstances. + + 2. ...Infer a Literal[...] if we're in a literal context. For example, if we + were analyzing the "3" in "foo(3)" where "foo" has a signature of + "def foo(Literal[3]) -> None", we'd want to infer that the "3" has a + type of Literal[3] instead of Instance. + + 3. ...Infer an Instance that remembers the original Literal if we're declaring + a Final variable with an inferred type -- for example, "bar" in "bar: Final = 3" + would be assigned an Instance that remembers it originated from a '3'. See + the comments in Instance's constructor for more details. + """ + typ = self.named_type(fallback_name) + if self.is_literal_context(): + return LiteralType(value=value, fallback=typ) + else: + if value is True: + if self._literal_true is None: + self._literal_true = typ.copy_modified( + last_known_value=LiteralType(value=value, fallback=typ) + ) + return self._literal_true + if value is False: + if self._literal_false is None: + self._literal_false = typ.copy_modified( + last_known_value=LiteralType(value=value, fallback=typ) + ) + return self._literal_false + return typ.copy_modified(last_known_value=LiteralType(value=value, fallback=typ)) + + def concat_tuples(self, left: TupleType, right: TupleType) -> TupleType: + """Concatenate two fixed length tuples.""" + assert not (find_unpack_in_list(left.items) and find_unpack_in_list(right.items)) + return TupleType( + items=left.items + right.items, fallback=self.named_type("builtins.tuple") + ) + + def visit_int_expr(self, e: IntExpr) -> Type: + """Type check an integer literal (trivial).""" + return self.infer_literal_expr_type(e.value, "builtins.int") + + def visit_str_expr(self, e: StrExpr) -> Type: + """Type check a string literal (trivial).""" + return self.infer_literal_expr_type(e.value, "builtins.str") + + def visit_bytes_expr(self, e: BytesExpr) -> Type: + """Type check a bytes literal (trivial).""" + return self.infer_literal_expr_type(e.value, "builtins.bytes") + + def visit_float_expr(self, e: FloatExpr) -> Type: + """Type check a float literal (trivial).""" + return self.named_type("builtins.float") + + def visit_complex_expr(self, e: ComplexExpr) -> Type: + """Type check a complex literal.""" + return self.named_type("builtins.complex") + + def visit_ellipsis(self, e: EllipsisExpr) -> Type: + """Type check '...'.""" + return self.named_type("builtins.ellipsis") + + def visit_op_expr(self, e: OpExpr) -> Type: + """Type check a binary operator expression.""" + if e.analyzed: + # It's actually a type expression X | Y. + return self.accept(e.analyzed) + if e.op == "and" or e.op == "or": + return self.check_boolean_op(e) + if e.op == "*" and isinstance(e.left, ListExpr): + # Expressions of form [...] * e get special type inference. + return self.check_list_multiply(e) + if e.op == "%": + if isinstance(e.left, BytesExpr): + return self.strfrm_checker.check_str_interpolation(e.left, e.right) + if isinstance(e.left, StrExpr): + return self.strfrm_checker.check_str_interpolation(e.left, e.right) + left_type = self.accept(e.left) + + proper_left_type = get_proper_type(left_type) + if isinstance(proper_left_type, TupleType) and e.op == "+": + left_add_method = proper_left_type.partial_fallback.type.get("__add__") + if left_add_method and left_add_method.fullname == "builtins.tuple.__add__": + proper_right_type = get_proper_type(self.accept(e.right)) + if isinstance(proper_right_type, TupleType): + right_radd_method = proper_right_type.partial_fallback.type.get("__radd__") + if right_radd_method is None: + # One cannot have two variadic items in the same tuple. + if ( + find_unpack_in_list(proper_left_type.items) is None + or find_unpack_in_list(proper_right_type.items) is None + ): + return self.concat_tuples(proper_left_type, proper_right_type) + elif ( + PRECISE_TUPLE_TYPES in self.chk.options.enable_incomplete_feature + and isinstance(proper_right_type, Instance) + and self.chk.type_is_iterable(proper_right_type) + ): + # Handle tuple[X, Y] + tuple[Z, ...] = tuple[X, Y, *tuple[Z, ...]]. + right_radd_method = proper_right_type.type.get("__radd__") + if ( + right_radd_method is None + and proper_left_type.partial_fallback.type.fullname == "builtins.tuple" + and find_unpack_in_list(proper_left_type.items) is None + ): + item_type = self.chk.iterable_item_type(proper_right_type, e) + mapped = self.chk.named_generic_type("builtins.tuple", [item_type]) + return proper_left_type.copy_modified( + items=proper_left_type.items + [UnpackType(mapped)] + ) + + use_reverse: UseReverse = USE_REVERSE_DEFAULT + if e.op == "|": + if is_named_instance(proper_left_type, "builtins.dict"): + # This is a special case for `dict | TypedDict`. + # 1. Find `dict | TypedDict` case + # 2. Switch `dict.__or__` to `TypedDict.__ror__` (the same from both runtime and typing perspective) + proper_right_type = get_proper_type(self.accept(e.right)) + if isinstance(proper_right_type, TypedDictType): + use_reverse = USE_REVERSE_ALWAYS + if isinstance(proper_left_type, TypedDictType): + # This is the reverse case: `TypedDict | dict`, + # simply do not allow the reverse checking: + # do not call `__dict__.__ror__`. + proper_right_type = get_proper_type(self.accept(e.right)) + if is_named_instance(proper_right_type, "builtins.dict"): + use_reverse = USE_REVERSE_NEVER + + if PRECISE_TUPLE_TYPES in self.chk.options.enable_incomplete_feature: + # Handle tuple[X, ...] + tuple[Y, Z] = tuple[*tuple[X, ...], Y, Z]. + if ( + e.op == "+" + and isinstance(proper_left_type, Instance) + and proper_left_type.type.fullname == "builtins.tuple" + ): + proper_right_type = get_proper_type(self.accept(e.right)) + if ( + isinstance(proper_right_type, TupleType) + and proper_right_type.partial_fallback.type.fullname == "builtins.tuple" + and find_unpack_in_list(proper_right_type.items) is None + ): + return proper_right_type.copy_modified( + items=[UnpackType(proper_left_type)] + proper_right_type.items + ) + + if e.op in operators.op_methods: + method = operators.op_methods[e.op] + if use_reverse is UseReverse.DEFAULT or use_reverse is UseReverse.NEVER: + result, method_type = self.check_op( + method, + base_type=left_type, + arg=e.right, + context=e, + allow_reverse=use_reverse is UseReverse.DEFAULT, + ) + elif use_reverse is UseReverse.ALWAYS: + result, method_type = self.check_op( + # The reverse operator here gives better error messages: + operators.reverse_op_methods[method], + base_type=self.accept(e.right), + arg=e.left, + context=e, + allow_reverse=False, + ) + else: + assert_never(use_reverse) + e.method_type = method_type + return result + else: + raise RuntimeError(f"Unknown operator {e.op}") + + def visit_comparison_expr(self, e: ComparisonExpr) -> Type: + """Type check a comparison expression. + + Comparison expressions are type checked consecutive-pair-wise + That is, 'a < b > c == d' is check as 'a < b and b > c and c == d' + """ + result: Type | None = None + sub_result: Type + + # Check each consecutive operand pair and their operator + for left, right, operator in zip(e.operands, e.operands[1:], e.operators): + left_type = self.accept(left) + + if operator == "in" or operator == "not in": + # This case covers both iterables and containers, which have different meanings. + # For a container, the in operator calls the __contains__ method. + # For an iterable, the in operator iterates over the iterable, and compares each item one-by-one. + # We allow `in` for a union of containers and iterables as long as at least one of them matches the + # type of the left operand, as the operation will simply return False if the union's container/iterator + # type doesn't match the left operand. + + # If the right operand has partial type, look it up without triggering + # a "Need type annotation ..." message, as it would be noise. + right_type = self.find_partial_type_ref_fast_path(right) + if right_type is None: + right_type = self.accept(right) # Validate the right operand + + right_type = get_proper_type(right_type) + item_types: Sequence[Type] = [right_type] + if isinstance(right_type, UnionType): + item_types = list(right_type.relevant_items()) + + sub_result = self.bool_type() + + container_types: list[Type] = [] + iterable_types: list[Type] = [] + failed_out = False + encountered_partial_type = False + + for item_type in item_types: + # Keep track of whether we get type check errors (these won't be reported, they + # are just to verify whether something is valid typing wise). + with self.msg.filter_errors(save_filtered_errors=True) as container_errors: + _, method_type = self.check_method_call_by_name( + method="__contains__", + base_type=item_type, + args=[left], + arg_kinds=[ARG_POS], + context=e, + original_type=right_type, + ) + # Container item type for strict type overlap checks. Note: we need to only + # check for nominal type, because a usual "Unsupported operands for in" + # will be reported for types incompatible with __contains__(). + # See testCustomContainsCheckStrictEquality for an example. + cont_type = self.chk.analyze_container_item_type(item_type) + + if isinstance(item_type, PartialType): + # We don't really know if this is an error or not, so just shut up. + encountered_partial_type = True + pass + elif ( + container_errors.has_new_errors() + and + # is_valid_var_arg is True for any Iterable + self.is_valid_var_arg(item_type) + ): + # it's not a container, but it is an iterable + with self.msg.filter_errors(save_filtered_errors=True) as iterable_errors: + _, itertype = self.chk.analyze_iterable_item_type_without_expression( + item_type, e + ) + if iterable_errors.has_new_errors(): + self.msg.add_errors(iterable_errors.filtered_errors()) + failed_out = True + else: + method_type = CallableType( + [left_type], + [nodes.ARG_POS], + [None], + self.bool_type(), + self.named_type("builtins.function"), + ) + e.method_types.append(method_type) + iterable_types.append(itertype) + elif not container_errors.has_new_errors() and cont_type: + container_types.append(cont_type) + e.method_types.append(method_type) + else: + self.msg.add_errors(container_errors.filtered_errors()) + failed_out = True + + if not encountered_partial_type and not failed_out: + iterable_type = UnionType.make_union(iterable_types) + if not is_subtype(left_type, iterable_type): + if not container_types: + self.msg.unsupported_operand_types("in", left_type, right_type, e) + else: + container_type = UnionType.make_union(container_types) + if not self.chk.can_skip_diagnostics and self.dangerous_comparison( + left_type, + container_type, + original_container=right_type, + prefer_literal=False, + ): + self.msg.dangerous_comparison( + left_type, container_type, "container", e + ) + + elif operator in operators.op_methods: + method = operators.op_methods[operator] + + with ErrorWatcher(self.msg.errors) as w: + sub_result, method_type = self.check_op( + method, left_type, right, e, allow_reverse=True + ) + e.method_types.append(method_type) + + # Only show dangerous overlap if there are no other errors. See + # testCustomEqCheckStrictEquality for an example. + if not w.has_new_errors() and operator in ("==", "!="): + right_type = self.accept(right) + if not self.chk.can_skip_diagnostics and self.dangerous_comparison( + left_type, right_type + ): + # Show the most specific literal types possible + left_type = try_getting_literal(left_type) + right_type = try_getting_literal(right_type) + self.msg.dangerous_comparison(left_type, right_type, "equality", e) + + elif operator == "is" or operator == "is not": + right_type = self.accept(right) # validate the right operand + sub_result = self.bool_type() + if ( + not self.chk.can_skip_diagnostics + and self.dangerous_comparison(left_type, right_type, identity_check=True) + # Allow dangerous identity comparisons with objects explicitly typed as Any + and not ( + isinstance(left, NameExpr) + and isinstance(left.node, Var) + and not left.node.is_inferred + and isinstance(get_proper_type(left.node.type), AnyType) + ) + and not ( + isinstance(right, NameExpr) + and isinstance(right.node, Var) + and not right.node.is_inferred + and isinstance(get_proper_type(right.node.type), AnyType) + ) + ): + # Show the most specific literal types possible + left_type = try_getting_literal(left_type) + right_type = try_getting_literal(right_type) + self.msg.dangerous_comparison(left_type, right_type, "identity", e) + e.method_types.append(None) + else: + raise RuntimeError(f"Unknown comparison operator {operator}") + + # Determine type of boolean-and of result and sub_result + if result is None: + result = sub_result + else: + result = join.join_types(result, sub_result) + + assert result is not None + return result + + def find_partial_type_ref_fast_path(self, expr: Expression) -> Type | None: + """If expression has a partial generic type, return it without additional checks. + + In particular, this does not generate an error about a missing annotation. + + Otherwise, return None. + """ + if not isinstance(expr, RefExpr): + return None + if isinstance(expr.node, Var): + result = self.analyze_var_ref(expr.node, expr) + if isinstance(result, PartialType) and result.type is not None: + self.chk.store_type(expr, fixup_partial_type(result)) + return result + return None + + def dangerous_comparison( + self, + left: Type, + right: Type, + *, + original_container: Type | None = None, + seen_types: set[tuple[Type, Type]] | None = None, + prefer_literal: bool = True, + identity_check: bool = False, + ) -> bool: + """Check for dangerous non-overlapping comparisons like 42 == 'no'. + + The original_container is the original container type for 'in' checks + (and None for equality checks). + + Rules: + * X and None are overlapping even in strict-optional mode. This is to allow + 'assert x is not None' for x defined as 'x = None # type: str' in class body + (otherwise mypy itself would have couple dozen errors because of this). + * Optional[X] and Optional[Y] are non-overlapping if X and Y are + non-overlapping, although technically None is overlap, it is most + likely an error. + * Any overlaps with everything, i.e. always safe. + * Special case: b'abc' in b'cde' is safe. + """ + if not self.chk.options.strict_equality: + return False + + if seen_types is None: + seen_types = set() + if (left, right) in seen_types: + return False + seen_types.add((left, right)) + + left, right = get_proper_types((left, right)) + + # We suppress the error for equality and container checks if there is a custom __eq__() + # method on either side. User defined (or even standard library) classes can define this + # to return True for comparisons between non-overlapping types. + if ( + custom_special_method(left, "__eq__") or custom_special_method(right, "__eq__") + ) and not identity_check: + return False + + if prefer_literal: + # Also flag non-overlapping literals in situations like: + # x: Literal['a', 'b'] + # if x == 'c': + # ... + left = try_getting_literal(left) + right = try_getting_literal(right) + + if self.chk.binder.is_unreachable_warning_suppressed(): + # We are inside a function that contains type variables with value restrictions in + # its signature. In this case we just suppress all strict-equality checks to avoid + # false positives for code like: + # + # T = TypeVar('T', str, int) + # def f(x: T) -> T: + # if x == 0: + # ... + # return x + # + # TODO: find a way of disabling the check only for types resulted from the expansion. + return False + if self.chk.options.strict_equality_for_none: + if isinstance(left, NoneType) and isinstance(right, NoneType): + return False + elif isinstance(left, NoneType) or isinstance(right, NoneType): + return False + if isinstance(left, UnionType) and isinstance(right, UnionType): + left = remove_optional(left) + right = remove_optional(right) + left, right = get_proper_types((left, right)) + if ( + original_container + and has_bytes_component(original_container) + and has_bytes_component(left) + ): + # We need to special case bytes and bytearray, because 97 in b'abc', b'a' in b'abc', + # b'a' in bytearray(b'abc') etc. all return True (and we want to show the error only + # if the check can _never_ be True). + return False + if isinstance(left, Instance) and isinstance(right, Instance): + # Special case some builtin implementations of AbstractSet. + left_name = left.type.fullname + right_name = right.type.fullname + if ( + left_name in OVERLAPPING_TYPES_ALLOWLIST + and right_name in OVERLAPPING_TYPES_ALLOWLIST + ): + abstract_set = self.chk.lookup_typeinfo("typing.AbstractSet") + left = map_instance_to_supertype(left, abstract_set) + right = map_instance_to_supertype(right, abstract_set) + return self.dangerous_comparison( + left.args[0], right.args[0], seen_types=seen_types + ) + elif left.type.has_base("typing.Mapping") and right.type.has_base("typing.Mapping"): + # Similar to above: Mapping ignores the classes, it just compares items. + abstract_map = self.chk.lookup_typeinfo("typing.Mapping") + left = map_instance_to_supertype(left, abstract_map) + right = map_instance_to_supertype(right, abstract_map) + return self.dangerous_comparison( + left.args[0], right.args[0], seen_types=seen_types + ) or self.dangerous_comparison(left.args[1], right.args[1], seen_types=seen_types) + elif left_name in ("builtins.list", "builtins.tuple") and right_name == left_name: + return self.dangerous_comparison( + left.args[0], right.args[0], seen_types=seen_types + ) + elif left_name in OVERLAPPING_BYTES_ALLOWLIST and right_name in ( + OVERLAPPING_BYTES_ALLOWLIST + ): + return False + if isinstance(left, LiteralType) and isinstance(right, LiteralType): + if isinstance(left.value, bool) and isinstance(right.value, bool): + # Comparing different booleans is not dangerous. + return False + if isinstance(left, LiteralType) and isinstance(right, Instance): + # bytes/bytearray comparisons are supported + if left.fallback.type.fullname == "builtins.bytes" and right.type.has_base( + "builtins.bytearray" + ): + return False + if isinstance(right, LiteralType) and isinstance(left, Instance): + # bytes/bytearray comparisons are supported + if right.fallback.type.fullname == "builtins.bytes" and left.type.has_base( + "builtins.bytearray" + ): + return False + return not is_overlapping_types(left, right, ignore_promotions=False) + + def check_method_call_by_name( + self, + method: str, + base_type: Type, + args: list[Expression], + arg_kinds: list[ArgKind], + context: Context, + original_type: Type | None = None, + self_type: Type | None = None, + ) -> tuple[Type, Type]: + """Type check a call to a named method on an object. + + Return tuple (result type, inferred method type). The 'original_type' + is used for error messages. The self_type is to bind self in methods + (see analyze_member_access for more details). + """ + original_type = original_type or base_type + self_type = self_type or base_type + # Unions are special-cased to allow plugins to act on each element of the union. + base_type = get_proper_type(base_type) + if isinstance(base_type, UnionType): + return self.check_union_method_call_by_name( + method, base_type, args, arg_kinds, context, original_type + ) + + method_type = analyze_member_access( + method, + base_type, + context, + is_lvalue=False, + is_super=False, + is_operator=True, + original_type=original_type, + self_type=self_type, + chk=self.chk, + in_literal_context=self.is_literal_context(), + ) + return self.check_method_call(method, base_type, method_type, args, arg_kinds, context) + + def check_union_method_call_by_name( + self, + method: str, + base_type: UnionType, + args: list[Expression], + arg_kinds: list[ArgKind], + context: Context, + original_type: Type | None = None, + ) -> tuple[Type, Type]: + """Type check a call to a named method on an object with union type. + + This essentially checks the call using check_method_call_by_name() for each + union item and unions the result. We do this to allow plugins to act on + individual union items. + """ + res: list[Type] = [] + meth_res: list[Type] = [] + for typ in base_type.relevant_items(): + # Format error messages consistently with + # mypy.checkmember.analyze_union_member_access(). + with self.msg.disable_type_names(): + item, meth_item = self.check_method_call_by_name( + method, typ, args, arg_kinds, context, original_type + ) + res.append(item) + meth_res.append(meth_item) + return make_simplified_union(res), make_simplified_union(meth_res) + + def check_method_call( + self, + method_name: str, + base_type: Type, + method_type: Type, + args: list[Expression], + arg_kinds: list[ArgKind], + context: Context, + ) -> tuple[Type, Type]: + """Type check a call to a method with the given name and type on an object. + + Return tuple (result type, inferred method type). + """ + callable_name = self.method_fullname(base_type, method_name) + object_type = base_type if callable_name is not None else None + + # Try to refine the method signature using plugin hooks before checking the call. + method_type = self.transform_callee_type( + callable_name, method_type, args, arg_kinds, context, object_type=object_type + ) + + return self.check_call( + method_type, + args, + arg_kinds, + context, + callable_name=callable_name, + object_type=base_type, + ) + + def check_op_reversible( + self, + op_name: str, + left_type: Type, + left_expr: Expression, + right_type: Type, + right_expr: Expression, + context: Context, + ) -> tuple[Type, Type]: + def lookup_operator(op_name: str, base_type: Type) -> Type | None: + """Looks up the given operator and returns the corresponding type, + if it exists.""" + + # This check is an important performance optimization. + if not has_operator(base_type, op_name, self.named_type): + return None + + with self.msg.filter_errors() as w: + member = analyze_member_access( + name=op_name, + typ=base_type, + is_lvalue=False, + is_super=False, + is_operator=True, + original_type=base_type, + context=context, + chk=self.chk, + in_literal_context=self.is_literal_context(), + ) + return None if w.has_new_errors() else member + + def lookup_definer(typ: Instance, attr_name: str) -> str | None: + """Returns the name of the class that contains the actual definition of attr_name. + + So if class A defines foo and class B subclasses A, running + 'get_class_defined_in(B, "foo")` would return the full name of A. + + However, if B were to override and redefine foo, that method call would + return the full name of B instead. + + If the attr name is not present in the given class or its MRO, returns None. + """ + for cls in typ.type.mro: + if cls.names.get(attr_name): + return cls.fullname + return None + + left_type = get_proper_type(left_type) + right_type = get_proper_type(right_type) + + # If either the LHS or the RHS are Any, we can't really concluding anything + # about the operation since the Any type may or may not define an + # __op__ or __rop__ method. So, we punt and return Any instead. + + if isinstance(left_type, AnyType): + any_type = AnyType(TypeOfAny.from_another_any, source_any=left_type) + return any_type, any_type + if isinstance(right_type, AnyType): + any_type = AnyType(TypeOfAny.from_another_any, source_any=right_type) + return any_type, any_type + + # STEP 1: + # We start by getting the __op__ and __rop__ methods, if they exist. + + rev_op_name = operators.reverse_op_methods[op_name] + + left_op = lookup_operator(op_name, left_type) + right_op = lookup_operator(rev_op_name, right_type) + + # STEP 2a: + # We figure out in which order Python will call the operator methods. As it + # turns out, it's not as simple as just trying to call __op__ first and + # __rop__ second. + # + # We store the determined order inside the 'variants_raw' variable, + # which records tuples containing the method, base type, and the argument. + + if op_name in operators.op_methods_that_shortcut and is_same_type(left_type, right_type): + # When we do "A() + A()", for example, Python will only call the __add__ method, + # never the __radd__ method. + # + # This is the case even if the __add__ method is completely missing and the __radd__ + # method is defined. + + variants_raw = [(op_name, left_op, left_type, right_expr)] + elif ( + ( + # Checking (A implies B) using the logically equivalent (not A or B), where + # A: left and right are both `Instance` objects + # B: right's __rop__ method is different from left's __op__ method + not (isinstance(left_type, Instance) and isinstance(right_type, Instance)) + or ( + lookup_definer(left_type, op_name) != lookup_definer(right_type, rev_op_name) + and ( + left_type.type.alt_promote is None + or left_type.type.alt_promote.type is not right_type.type + ) + ) + ) + # Note: use `covers_at_runtime` instead of `is_subtype` (#19006) + and covers_at_runtime(right_type, left_type) + ): + # When we do "A() + B()" where B is a subclass of A, we'll actually try calling + # B's __radd__ method first, but ONLY if B explicitly defines or overrides the + # __radd__ method. + # + # This mechanism lets subclasses "refine" the expected outcome of the operation, even + # if they're located on the RHS. + # + # As a special case, the alt_promote check makes sure that we don't use the + # __radd__ method of int if the LHS is a native int type. + + variants_raw = [ + (rev_op_name, right_op, right_type, left_expr), + (op_name, left_op, left_type, right_expr), + ] + else: + # In all other cases, we do the usual thing and call __add__ first and + # __radd__ second when doing "A() + B()". + + variants_raw = [ + (op_name, left_op, left_type, right_expr), + (rev_op_name, right_op, right_type, left_expr), + ] + + # STEP 3: + # We now filter out all non-existent operators. The 'variants' list contains + # all operator methods that are actually present, in the order that Python + # attempts to invoke them. + + variants = [(na, op, obj, arg) for (na, op, obj, arg) in variants_raw if op is not None] + + # STEP 4: + # We now try invoking each one. If an operation succeeds, end early and return + # the corresponding result. Otherwise, return the result and errors associated + # with the first entry. + + errors = [] + results = [] + for name, method, obj, arg in variants: + with self.msg.filter_errors(save_filtered_errors=True) as local_errors: + result = self.check_method_call(name, obj, method, [arg], [ARG_POS], context) + if local_errors.has_new_errors(): + errors.append(local_errors.filtered_errors()) + results.append(result) + else: + return result + + # We finish invoking above operators and no early return happens. Therefore, + # we check if either the LHS or the RHS is Instance and fallbacks to Any, + # if so, we also return Any + if (isinstance(left_type, Instance) and left_type.type.fallback_to_any) or ( + isinstance(right_type, Instance) and right_type.type.fallback_to_any + ): + any_type = AnyType(TypeOfAny.special_form) + return any_type, any_type + + # STEP 4b: + # Sometimes, the variants list is empty. In that case, we fall-back to attempting to + # call the __op__ method (even though it's missing). + + if not variants: + with self.msg.filter_errors(save_filtered_errors=True) as local_errors: + result = self.check_method_call_by_name( + op_name, left_type, [right_expr], [ARG_POS], context + ) + + if local_errors.has_new_errors(): + errors.append(local_errors.filtered_errors()) + results.append(result) + else: + # Although we should not need this case anymore, we keep it just in case, as + # otherwise we will get a crash if we introduce inconsistency in checkmember.py + return result + + self.msg.add_errors(errors[0]) + if len(results) == 1: + return results[0] + else: + error_any = AnyType(TypeOfAny.from_error) + result = error_any, error_any + return result + + def check_op( + self, + method: str, + base_type: Type, + arg: Expression, + context: Context, + allow_reverse: bool = False, + ) -> tuple[Type, Type]: + """Type check a binary operation which maps to a method call. + + Return tuple (result type, inferred operator method type). + """ + + if allow_reverse: + left_variants = [base_type] + base_type = get_proper_type(base_type) + if isinstance(base_type, UnionType): + left_variants = list(flatten_nested_unions(base_type.relevant_items())) + right_type = self.accept(arg) + + # Step 1: We first try leaving the right arguments alone and destructure + # just the left ones. (Mypy can sometimes perform some more precise inference + # if we leave the right operands a union -- see testOperatorWithEmptyListAndSum.) + all_results = [] + all_inferred = [] + + with self.msg.filter_errors() as local_errors: + for left_possible_type in left_variants: + result, inferred = self.check_op_reversible( + op_name=method, + left_type=left_possible_type, + left_expr=TempNode(left_possible_type, context=context), + right_type=right_type, + right_expr=arg, + context=context, + ) + all_results.append(result) + all_inferred.append(inferred) + + if not local_errors.has_new_errors(): + results_final = make_simplified_union(all_results) + inferred_final = make_simplified_union(all_inferred) + return results_final, inferred_final + + # Step 2: If that fails, we try again but also destructure the right argument. + # This is also necessary to make certain edge cases work -- see + # testOperatorDoubleUnionInterwovenUnionAdd, for example. + + # Note: We want to pass in the original 'arg' for 'left_expr' and 'right_expr' + # whenever possible so that plugins and similar things can introspect on the original + # node if possible. + # + # We don't do the same for the base expression because it could lead to weird + # type inference errors -- e.g. see 'testOperatorDoubleUnionSum'. + # TODO: Can we use `type_overrides_set()` here? + right_variants = [(right_type, arg)] + right_type = get_proper_type(right_type) + if isinstance(right_type, UnionType): + right_variants = [ + (item, TempNode(item, context=context)) + for item in flatten_nested_unions(right_type.relevant_items()) + ] + + all_results = [] + all_inferred = [] + + with self.msg.filter_errors(save_filtered_errors=True) as local_errors: + for left_possible_type in left_variants: + for right_possible_type, right_expr in right_variants: + result, inferred = self.check_op_reversible( + op_name=method, + left_type=left_possible_type, + left_expr=TempNode(left_possible_type, context=context), + right_type=right_possible_type, + right_expr=right_expr, + context=context, + ) + all_results.append(result) + all_inferred.append(inferred) + + if local_errors.has_new_errors(): + self.msg.add_errors(local_errors.filtered_errors()) + # Point any notes to the same location as an existing message. + err = local_errors.filtered_errors()[-1] + recent_context = TempNode(NoneType()) + recent_context.line = err.line + recent_context.column = err.column + if len(left_variants) >= 2 and len(right_variants) >= 2: + self.msg.warn_both_operands_are_from_unions(recent_context) + elif len(left_variants) >= 2: + self.msg.warn_operand_was_from_union("Left", base_type, context=recent_context) + elif len(right_variants) >= 2: + self.msg.warn_operand_was_from_union( + "Right", right_type, context=recent_context + ) + + # See the comment in 'check_overload_call' for more details on why + # we call 'combine_function_signature' instead of just unioning the inferred + # callable types. + results_final = make_simplified_union(all_results) + inferred_final = self.combine_function_signatures(get_proper_types(all_inferred)) + return results_final, inferred_final + else: + return self.check_method_call_by_name( + method=method, + base_type=base_type, + args=[arg], + arg_kinds=[ARG_POS], + context=context, + ) + + def check_boolean_op(self, e: OpExpr) -> Type: + """Type check a boolean operation ('and' or 'or').""" + + # A boolean operation can evaluate to either of the operands. + + # We use the current type context to guide the type inference of + # the left operand. We also use the left operand type to guide the type + # inference of the right operand so that expressions such as + # '[1] or []' are inferred correctly. + ctx = self.type_context[-1] + left_type = self.accept(e.left, ctx) + expanded_left_type = try_expanding_sum_type_to_union(left_type, "builtins.bool") + + assert e.op in ("and", "or") # Checked by visit_op_expr + + left_map: mypy.checker.TypeMap + right_map: mypy.checker.TypeMap + if e.right_always: + left_map, right_map = {e.left: UninhabitedType()}, {} + elif e.right_unreachable: + left_map, right_map = {}, {e.right: UninhabitedType()} + elif e.op == "and": + right_map, left_map = self.chk.find_isinstance_check(e.left) + elif e.op == "or": + left_map, right_map = self.chk.find_isinstance_check(e.left) + + # If left_map is unreachable then we know mypy considers the left expression + # to be redundant. + left_unreachable = mypy.checker.is_unreachable_map(left_map) + if ( + codes.REDUNDANT_EXPR in self.chk.options.enabled_error_codes + and left_unreachable + # don't report an error if it's intentional + and not e.right_always + ): + self.msg.redundant_left_operand(e.op, e.left) + + right_unreachable = mypy.checker.is_unreachable_map(right_map) + if ( + self.chk.should_report_unreachable_issues() + and right_unreachable + # don't report an error if it's intentional + and not e.right_unreachable + ): + self.msg.unreachable_right_operand(e.op, e.right) + + right_type = self.analyze_cond_branch( + right_map, e.right, self._combined_context(expanded_left_type) + ) + + if left_unreachable and right_unreachable: + return UninhabitedType() + + if right_unreachable: + # The boolean expression is statically known to be the left value + return left_type + if left_unreachable: + # The boolean expression is statically known to be the right value + return right_type + + if e.op == "and": + restricted_left_type = false_only(expanded_left_type) + result_is_left = not expanded_left_type.can_be_true + elif e.op == "or": + restricted_left_type = true_only(expanded_left_type) + result_is_left = not expanded_left_type.can_be_false + + if isinstance(restricted_left_type, UninhabitedType): + # The left operand can never be the result + return right_type + elif result_is_left: + # The left operand is always the result + return left_type + else: + return make_simplified_union([restricted_left_type, right_type]) + + def check_list_multiply(self, e: OpExpr) -> Type: + """Type check an expression of form '[...] * e'. + + Type inference is special-cased for this common construct. + """ + right_type = self.accept(e.right) + if is_subtype(right_type, self.named_type("builtins.int")): + # Special case: [...] * . Use the type context of the + # OpExpr, since the multiplication does not affect the type. + left_type = self.accept(e.left, type_context=self.type_context[-1]) + else: + left_type = self.accept(e.left) + result, method_type = self.check_op("__mul__", left_type, e.right, e) + e.method_type = method_type + return result + + def visit_assignment_expr(self, e: AssignmentExpr) -> Type: + value = self.accept(e.value) + self.chk.check_assignment(e.target, e.value) + self.chk.check_final(e) + if not has_uninhabited_component(value): + # TODO: can we get rid of this extra store_type()? + # Usually, check_assignment() already stores the lvalue type correctly. + self.chk.store_type(e.target, value) + self.find_partial_type_ref_fast_path(e.target) + return value + + def visit_unary_expr(self, e: UnaryExpr) -> Type: + """Type check an unary operation ('not', '-', '+' or '~').""" + operand_type = self.accept(e.expr) + op = e.op + if op == "not": + result: Type = self.bool_type() + self.chk.check_for_truthy_type(operand_type, e.expr) + else: + method = operators.unary_op_methods[op] + result, method_type = self.check_method_call_by_name(method, operand_type, [], [], e) + e.method_type = method_type + return result + + def visit_index_expr(self, e: IndexExpr) -> Type: + """Type check an index expression (base[index]). + + It may also represent type application. + """ + result = self.visit_index_expr_helper(e) + result = self.narrow_type_from_binder(e, result) + p_result = get_proper_type(result) + if ( + self.is_literal_context() + and isinstance(p_result, Instance) + and p_result.last_known_value is not None + ): + result = p_result.last_known_value + return result + + def visit_index_expr_helper(self, e: IndexExpr) -> Type: + if e.analyzed: + # It's actually a type application. + return self.accept(e.analyzed) + left_type = self.accept(e.base) + return self.visit_index_with_type(left_type, e) + + def visit_index_with_type( + self, + left_type: Type, + e: IndexExpr, + original_type: ProperType | None = None, + self_type: Type | None = None, + ) -> Type: + """Analyze type of an index expression for a given type of base expression. + + The 'original_type' is used for error messages (currently used for union types). The + 'self_type' is to bind self in methods (see analyze_member_access for more details). + """ + index = e.index + self_type = self_type or left_type + left_type = get_proper_type(left_type) + + # Visit the index, just to make sure we have a type for it available + self.accept(index) + + if isinstance(left_type, TupleType) and any( + isinstance(it, UnpackType) for it in left_type.items + ): + # Normalize variadic tuples for consistency. + left_type = expand_type(left_type, {}) + + if isinstance(left_type, UnionType): + original_type = original_type or left_type + # Don't combine literal types, since we may need them for type narrowing. + return make_simplified_union( + [ + self.visit_index_with_type(typ, e, original_type) + for typ in left_type.relevant_items() + ], + contract_literals=False, + ) + elif isinstance(left_type, TupleType) and self.chk.in_checked_function(): + # Special case for tuples. They return a more specific type when + # indexed by an integer literal. + if isinstance(index, SliceExpr): + return self.visit_tuple_slice_helper(left_type, index) + + ns = self.try_getting_int_literals(index) + if ns is not None: + out = [] + for n in ns: + item = self.visit_tuple_index_helper(left_type, n) + if item is not None: + out.append(item) + else: + self.chk.fail(message_registry.TUPLE_INDEX_OUT_OF_RANGE, e) + if any(isinstance(t, UnpackType) for t in left_type.items): + min_len = self.min_tuple_length(left_type) + self.chk.note(f"Variadic tuple can have length {min_len}", e) + return AnyType(TypeOfAny.from_error) + return make_simplified_union(out) + else: + return self.nonliteral_tuple_index_helper(left_type, index) + elif isinstance(left_type, TypedDictType): + return self.visit_typeddict_index_expr(left_type, e.index)[0] + elif isinstance(left_type, FunctionLike) and left_type.is_type_obj(): + if left_type.type_object().is_enum: + return self.visit_enum_index_expr(left_type.type_object(), e.index, e) + elif ( + left_type.type_object().type_vars + or left_type.type_object().fullname == "builtins.type" + ): + return self.named_type("types.GenericAlias") + + if isinstance(left_type, TypeVarType): + return self.visit_index_with_type( + left_type.values_or_bound(), e, original_type, left_type + ) + elif isinstance(left_type, Instance) and left_type.type.fullname == "typing._SpecialForm": + # Allow special forms to be indexed and used to create union types + return self.named_type("typing._SpecialForm") + else: + result, method_type = self.check_method_call_by_name( + "__getitem__", + left_type, + [e.index], + [ARG_POS], + e, + original_type=original_type, + self_type=self_type, + ) + e.method_type = method_type + return result + + def min_tuple_length(self, left: TupleType) -> int: + unpack_index = find_unpack_in_list(left.items) + if unpack_index is None: + return left.length() + unpack = left.items[unpack_index] + assert isinstance(unpack, UnpackType) + if isinstance(unpack.type, TypeVarTupleType): + return left.length() - 1 + unpack.type.min_len + return left.length() - 1 + + def visit_tuple_index_helper(self, left: TupleType, n: int) -> Type | None: + unpack_index = find_unpack_in_list(left.items) + if unpack_index is None: + if n < 0: + n += len(left.items) + if 0 <= n < len(left.items): + return left.items[n] + return None + unpack = left.items[unpack_index] + assert isinstance(unpack, UnpackType) + unpacked = get_proper_type(unpack.type) + if isinstance(unpacked, TypeVarTupleType): + # Usually we say that TypeVarTuple can't be split, be in case of + # indexing it seems benign to just return the upper bound item, similar + # to what we do when indexing a regular TypeVar. + bound = get_proper_type(unpacked.upper_bound) + assert isinstance(bound, Instance) + assert bound.type.fullname == "builtins.tuple" + middle = bound.args[0] + else: + assert isinstance(unpacked, Instance) + assert unpacked.type.fullname == "builtins.tuple" + middle = unpacked.args[0] + + extra_items = self.min_tuple_length(left) - left.length() + 1 + if n >= 0: + if n >= self.min_tuple_length(left): + # For tuple[int, *tuple[str, ...], int] we allow either index 0 or 1, + # since variadic item may have zero items. + return None + if n < unpack_index: + return left.items[n] + return UnionType.make_union( + [middle] + + left.items[unpack_index + 1 : max(n - extra_items + 2, unpack_index + 1)], + left.line, + left.column, + ) + n += self.min_tuple_length(left) + if n < 0: + # Similar to above, we only allow -1, and -2 for tuple[int, *tuple[str, ...], int] + return None + if n >= unpack_index + extra_items: + return left.items[n - extra_items + 1] + return UnionType.make_union( + left.items[min(n, unpack_index) : unpack_index] + [middle], left.line, left.column + ) + + def visit_tuple_slice_helper(self, left_type: TupleType, slic: SliceExpr) -> Type: + begin: Sequence[int | None] = [None] + end: Sequence[int | None] = [None] + stride: Sequence[int | None] = [None] + + if slic.begin_index: + begin_raw = self.try_getting_int_literals(slic.begin_index) + if begin_raw is None: + return self.nonliteral_tuple_index_helper(left_type, slic) + begin = begin_raw + + if slic.end_index: + end_raw = self.try_getting_int_literals(slic.end_index) + if end_raw is None: + return self.nonliteral_tuple_index_helper(left_type, slic) + end = end_raw + + if slic.stride: + stride_raw = self.try_getting_int_literals(slic.stride) + if stride_raw is None: + return self.nonliteral_tuple_index_helper(left_type, slic) + stride = stride_raw + + items: list[Type] = [] + for b, e, s in itertools.product(begin, end, stride): + item = left_type.slice(b, e, s, fallback=self.named_type("builtins.tuple")) + if item is None: + self.chk.fail(message_registry.AMBIGUOUS_SLICE_OF_VARIADIC_TUPLE, slic) + return AnyType(TypeOfAny.from_error) + items.append(item) + return make_simplified_union(items) + + def try_getting_int_literals(self, index: Expression) -> list[int] | None: + """If the given expression or type corresponds to an int literal + or a union of int literals, returns a list of the underlying ints. + Otherwise, returns None. + + Specifically, this function is guaranteed to return a list with + one or more ints if one the following is true: + + 1. 'expr' is a IntExpr or a UnaryExpr backed by an IntExpr + 2. 'typ' is a LiteralType containing an int + 3. 'typ' is a UnionType containing only LiteralType of ints + """ + if isinstance(index, IntExpr): + return [index.value] + elif isinstance(index, UnaryExpr): + if index.op == "-": + operand = index.expr + if isinstance(operand, IntExpr): + return [-1 * operand.value] + if index.op == "+": + operand = index.expr + if isinstance(operand, IntExpr): + return [operand.value] + typ = get_proper_type(self.accept(index)) + if isinstance(typ, Instance) and typ.last_known_value is not None: + typ = typ.last_known_value + if isinstance(typ, LiteralType) and isinstance(typ.value, int): + return [typ.value] + if isinstance(typ, UnionType): + out = [] + for item in get_proper_types(typ.items): + if isinstance(item, LiteralType) and isinstance(item.value, int): + out.append(item.value) + else: + return None + return out + return None + + def nonliteral_tuple_index_helper(self, left_type: TupleType, index: Expression) -> Type: + self.check_method_call_by_name("__getitem__", left_type, [index], [ARG_POS], context=index) + # We could return the return type from above, but unions are often better than the join + union = self.union_tuple_fallback_item(left_type) + if isinstance(index, SliceExpr): + return self.chk.named_generic_type("builtins.tuple", [union]) + return union + + def union_tuple_fallback_item(self, left_type: TupleType) -> Type: + # TODO: this duplicates logic in typeops.tuple_fallback(). + items = [] + for item in left_type.items: + if isinstance(item, UnpackType): + unpacked_type = get_proper_type(item.type) + if isinstance(unpacked_type, TypeVarTupleType): + unpacked_type = get_proper_type(unpacked_type.upper_bound) + if ( + isinstance(unpacked_type, Instance) + and unpacked_type.type.fullname == "builtins.tuple" + ): + items.append(unpacked_type.args[0]) + else: + raise NotImplementedError + else: + items.append(item) + return make_simplified_union(items) + + def visit_typeddict_index_expr( + self, td_type: TypedDictType, index: Expression, setitem: bool = False + ) -> tuple[Type, set[str]]: + if isinstance(index, StrExpr): + key_names = [index.value] + else: + typ = get_proper_type(self.accept(index)) + if isinstance(typ, UnionType): + key_types: list[Type] = list(typ.items) + else: + key_types = [typ] + + key_names = [] + for key_type in get_proper_types(key_types): + if isinstance(key_type, Instance) and key_type.last_known_value is not None: + key_type = key_type.last_known_value + + if ( + isinstance(key_type, LiteralType) + and isinstance(key_type.value, str) + and key_type.fallback.type.fullname != "builtins.bytes" + ): + key_names.append(key_type.value) + else: + self.msg.typeddict_key_must_be_string_literal(td_type, index) + return AnyType(TypeOfAny.from_error), set() + + value_types = [] + for key_name in key_names: + value_type = td_type.items.get(key_name) + if value_type is None: + self.msg.typeddict_key_not_found(td_type, key_name, index, setitem) + return AnyType(TypeOfAny.from_error), set() + else: + value_types.append(value_type) + return make_simplified_union(value_types), set(key_names) + + def visit_enum_index_expr( + self, enum_type: TypeInfo, index: Expression, context: Context + ) -> Type: + string_type: Type = self.named_type("builtins.str") + self.chk.check_subtype( + self.accept(index), + string_type, + context, + "Enum index should be a string", + "actual index type", + ) + return Instance(enum_type, []) + + def visit_cast_expr(self, expr: CastExpr) -> Type: + """Type check a cast expression.""" + source_type = self.accept( + expr.expr, + type_context=AnyType(TypeOfAny.special_form), + allow_none_return=True, + always_allow_any=True, + ) + target_type = expr.type + options = self.chk.options + if ( + options.warn_redundant_casts + and not is_same_type(target_type, AnyType(TypeOfAny.special_form)) + and is_same_type(source_type, target_type) + ): + self.msg.redundant_cast(target_type, expr) + if options.disallow_any_unimported and has_any_from_unimported_type(target_type): + self.msg.unimported_type_becomes_any("Target type of cast", target_type, expr) + check_for_explicit_any( + target_type, self.chk.options, self.chk.is_typeshed_stub, self.msg, context=expr + ) + return target_type + + def visit_type_form_expr(self, expr: TypeFormExpr) -> Type: + typ = expr.type + return TypeType.make_normalized(typ, line=typ.line, column=typ.column, is_type_form=True) + + def visit_assert_type_expr(self, expr: AssertTypeExpr) -> Type: + source_type = self.accept( + expr.expr, + type_context=self.type_context[-1], + allow_none_return=True, + always_allow_any=True, + ) + if self.chk.current_node_deferred: + return source_type + + target_type = expr.type + proper_source_type = get_proper_type(source_type) + if ( + isinstance(proper_source_type, mypy.types.Instance) + and proper_source_type.last_known_value is not None + ): + source_type = proper_source_type.last_known_value + if not is_same_type(source_type, target_type): + if not self.chk.in_checked_function(): + self.msg.note( + '"assert_type" expects everything to be "Any" in unchecked functions', + expr.expr, + ) + self.msg.assert_type_fail(source_type, target_type, expr) + return source_type + + def visit_reveal_expr(self, expr: RevealExpr) -> Type: + """Type check a reveal_type expression.""" + if expr.kind == REVEAL_TYPE: + assert expr.expr is not None + revealed_type = self.accept( + expr.expr, type_context=self.type_context[-1], allow_none_return=True + ) + if not self.chk.current_node_deferred: + self.msg.reveal_type(revealed_type, expr.expr) + if not self.chk.in_checked_function(): + self.msg.note( + "'reveal_type' always outputs 'Any' in unchecked functions", expr.expr + ) + self.check_reveal_imported(expr) + return revealed_type + else: + # REVEAL_LOCALS + if not self.chk.current_node_deferred: + # the RevealExpr contains a local_nodes attribute, + # calculated at semantic analysis time. Use it to pull out the + # corresponding subset of variables in self.chk.type_map + names_to_types = ( + {var_node.name: var_node.type for var_node in expr.local_nodes} + if expr.local_nodes is not None + else {} + ) + + self.msg.reveal_locals(names_to_types, expr) + self.check_reveal_imported(expr) + return NoneType() + + def check_reveal_imported(self, expr: RevealExpr) -> None: + if codes.UNIMPORTED_REVEAL not in self.chk.options.enabled_error_codes: + return + + name = "" + if expr.kind == REVEAL_LOCALS: + name = "reveal_locals" + elif expr.kind == REVEAL_TYPE and not expr.is_imported: + name = "reveal_type" + else: + return + + self.chk.fail(f'Name "{name}" is not defined', expr, code=codes.UNIMPORTED_REVEAL) + if name == "reveal_type": + module = ( + "typing" if self.chk.options.python_version >= (3, 11) else "typing_extensions" + ) + hint = ( + 'Did you forget to import it from "{module}"?' + ' (Suggestion: "from {module} import {name}")' + ).format(module=module, name=name) + self.chk.note(hint, expr, code=codes.UNIMPORTED_REVEAL) + + def visit_type_application(self, tapp: TypeApplication) -> Type: + """Type check a type application (expr[type, ...]). + + There are two different options here, depending on whether expr refers + to a type alias or directly to a generic class. In the first case we need + to use a dedicated function typeanal.instantiate_type_alias(). This + is due to slight differences in how type arguments are applied and checked. + """ + if isinstance(tapp.expr, RefExpr) and isinstance(tapp.expr.node, TypeAlias): + if tapp.expr.node.python_3_12_type_alias: + return self.type_alias_type_type() + # Subscription of a (generic) alias in runtime context, expand the alias. + item = instantiate_type_alias( + tapp.expr.node, + tapp.types, + self.chk.fail, + tapp.expr.node.no_args, + tapp, + self.chk.options, + ) + item = get_proper_type(item) + if isinstance(item, Instance): + tp = type_object_type(item.type, self.named_type) + return self.apply_type_arguments_to_callable(tp, item.args, tapp) + elif isinstance(item, TupleType) and item.partial_fallback.type.is_named_tuple: + tp = type_object_type(item.partial_fallback.type, self.named_type) + return self.apply_type_arguments_to_callable(tp, item.partial_fallback.args, tapp) + elif isinstance(item, TypedDictType): + return self.typeddict_callable_from_context(item) + else: + self.chk.fail(message_registry.ONLY_CLASS_APPLICATION, tapp) + return AnyType(TypeOfAny.from_error) + # Type application of a normal generic class in runtime context. + # This is typically used as `x = G[int]()`. + tp = get_proper_type(self.accept(tapp.expr)) + if isinstance(tp, (CallableType, Overloaded)): + if not tp.is_type_obj(): + self.chk.fail(message_registry.ONLY_CLASS_APPLICATION, tapp) + return self.apply_type_arguments_to_callable(tp, tapp.types, tapp) + if isinstance(tp, AnyType): + return AnyType(TypeOfAny.from_another_any, source_any=tp) + return AnyType(TypeOfAny.special_form) + + def visit_type_alias_expr(self, alias: TypeAliasExpr) -> Type: + """Right hand side of a type alias definition. + + It has the same type as if the alias itself was used in a runtime context. + For example, here: + + A = reveal_type(List[T]) + reveal_type(A) + + both `reveal_type` instances will reveal the same type `def (...) -> builtins.list[Any]`. + Note that type variables are implicitly substituted with `Any`. + """ + return self.alias_type_in_runtime_context(alias.node, ctx=alias, alias_definition=True) + + def alias_type_in_runtime_context( + self, alias: TypeAlias, *, ctx: Context, alias_definition: bool = False + ) -> Type: + """Get type of a type alias (could be generic) in a runtime expression. + + Note that this function can be called only if the alias appears _not_ + as a target of type application, which is treated separately in the + visit_type_application method. Some examples where this method is called are + casts and instantiation: + + class LongName(Generic[T]): ... + A = LongName[int] + + x = A() + y = cast(A, ...) + """ + if alias.python_3_12_type_alias: + return self.type_alias_type_type() + # If this is a generic alias, we set all variables to `Any`. + # For example: + # A = List[Tuple[T, T]] + # x = A() <- same as List[Tuple[Any, Any]], see PEP 484. + disallow_any = self.chk.options.disallow_any_generics and self.is_callee + item = get_proper_type( + set_any_tvars( + alias, + [], + ctx.line, + ctx.column, + self.chk.options, + disallow_any=disallow_any, + fail=self.msg.fail, + ) + ) + if isinstance(item, Instance): + # Normally we get a callable type (or overloaded) with .is_type_obj() true + # representing the class's constructor + tp = type_object_type(item.type, self.named_type) + if alias.no_args: + return tp + return self.apply_type_arguments_to_callable(tp, item.args, ctx) + elif ( + isinstance(item, TupleType) + and + # Tuple[str, int]() fails at runtime, only named tuples and subclasses work. + tuple_fallback(item).type.fullname != "builtins.tuple" + ): + return type_object_type(tuple_fallback(item).type, self.named_type) + elif isinstance(item, TypedDictType): + return self.typeddict_callable_from_context(item) + elif isinstance(item, NoneType): + return TypeType(item, line=item.line, column=item.column) + elif isinstance(item, AnyType): + return AnyType(TypeOfAny.from_another_any, source_any=item) + elif ( + isinstance(item, UnionType) + and item.uses_pep604_syntax + and self.chk.options.python_version >= (3, 10) + ): + return self.chk.named_generic_type("types.UnionType", item.items) + else: + if alias_definition: + return AnyType(TypeOfAny.special_form) + # The _SpecialForm type can be used in some runtime contexts (e.g. it may have __or__). + return self.named_type("typing._SpecialForm") + + def split_for_callable( + self, t: CallableType, args: Sequence[Type], ctx: Context + ) -> list[Type]: + """Handle directly applying type arguments to a variadic Callable. + + This is needed in situations where e.g. variadic class object appears in + runtime context. For example: + class C(Generic[T, Unpack[Ts]]): ... + x = C[int, str]() + + We simply group the arguments that need to go into Ts variable into a TupleType, + similar to how it is done in other places using split_with_prefix_and_suffix(). + """ + if t.is_type_obj(): + # Type arguments must map to class type variables, ignoring constructor vars. + vars = t.type_object().defn.type_vars + else: + vars = list(t.variables) + args = flatten_nested_tuples(args) + + # TODO: this logic is duplicated with semanal_typeargs. + for tv, arg in zip(t.variables, args): + if isinstance(tv, ParamSpecType): + if not isinstance( + get_proper_type(arg), (Parameters, ParamSpecType, AnyType, UnboundType) + ): + self.chk.fail( + "Can only replace ParamSpec with a parameter types list or" + f" another ParamSpec, got {format_type(arg, self.chk.options)}", + ctx, + ) + return [AnyType(TypeOfAny.from_error)] * len(vars) + + # TODO: in future we may want to support type application to variadic functions. + if ( + not vars + or not any(isinstance(v, TypeVarTupleType) for v in vars) + or not t.is_type_obj() + ): + return list(args) + info = t.type_object() + # We reuse the logic from semanal phase to reduce code duplication. + fake = Instance(info, args, line=ctx.line, column=ctx.column) + # This code can be only called either from checking a type application, or from + # checking a type alias (after the caller handles no_args aliases), so we know it + # was initially an IndexExpr, and we allow empty tuple type arguments. + if not validate_instance(fake, self.chk.fail, indexed=True): + fix_instance( + fake, self.chk.fail, self.chk.note, disallow_any=False, options=self.chk.options + ) + args = list(fake.args) + + prefix = next(i for (i, v) in enumerate(vars) if isinstance(v, TypeVarTupleType)) + suffix = len(vars) - prefix - 1 + tvt = vars[prefix] + assert isinstance(tvt, TypeVarTupleType) + start, middle, end = split_with_prefix_and_suffix(tuple(args), prefix, suffix) + return list(start) + [TupleType(list(middle), tvt.tuple_fallback)] + list(end) + + def apply_type_arguments_to_callable( + self, tp: Type, args: Sequence[Type], ctx: Context + ) -> Type: + """Apply type arguments to a generic callable type coming from a type object. + + This will first perform type arguments count checks, report the + error as needed, and return the correct kind of Any. As a special + case this returns Any for non-callable types, because if type object type + is not callable, then an error should be already reported. + """ + tp = get_proper_type(tp) + + if isinstance(tp, CallableType): + if tp.is_type_obj(): + # If we have a class object in runtime context, then the available type + # variables are those of the class, we don't include additional variables + # of the constructor. So that with + # class C(Generic[T]): + # def __init__(self, f: Callable[[S], T], x: S) -> None + # C[int] is valid + # C[int, str] is invalid (although C as a callable has 2 type variables) + # Note: various logic below and in applytype.py relies on the fact that + # class type variables appear *before* constructor variables. + type_vars = tp.type_object().defn.type_vars + else: + type_vars = list(tp.variables) + min_arg_count = sum(not v.has_default() for v in type_vars) + has_type_var_tuple = any(isinstance(v, TypeVarTupleType) for v in type_vars) + if ( + len(args) < min_arg_count or len(args) > len(type_vars) + ) and not has_type_var_tuple: + if tp.is_type_obj() and tp.type_object().fullname == "builtins.tuple": + # e.g. expression tuple[X, Y] + # - want the type of the expression i.e. a function with that as its return type + # - tp is type of tuple (note it won't have params as we are only called + # with generic callable type) + # - tuple[X, Y]() takes a single arg that is a tuple containing an X and a Y + return CallableType( + [TupleType(list(args), self.chk.named_type("tuple"))], + [ARG_POS], + [None], + TupleType(list(args), self.chk.named_type("tuple")), + tp.fallback, + name="tuple", + definition=tp.definition, + is_bound=tp.is_bound, + ) + self.msg.incompatible_type_application( + min_arg_count, len(type_vars), len(args), ctx + ) + return AnyType(TypeOfAny.from_error) + return self.apply_generic_arguments(tp, self.split_for_callable(tp, args, ctx), ctx) + if isinstance(tp, Overloaded): + for it in tp.items: + if tp.is_type_obj(): + # Same as above. + type_vars = tp.type_object().defn.type_vars + else: + type_vars = list(it.variables) + min_arg_count = sum(not v.has_default() for v in type_vars) + has_type_var_tuple = any(isinstance(v, TypeVarTupleType) for v in type_vars) + if ( + len(args) < min_arg_count or len(args) > len(type_vars) + ) and not has_type_var_tuple: + self.msg.incompatible_type_application( + min_arg_count, len(type_vars), len(args), ctx + ) + return AnyType(TypeOfAny.from_error) + return Overloaded( + [ + self.apply_generic_arguments(it, self.split_for_callable(it, args, ctx), ctx) + for it in tp.items + ] + ) + return AnyType(TypeOfAny.special_form) + + def visit_list_expr(self, e: ListExpr) -> Type: + """Type check a list expression [...].""" + return self.check_lst_expr(e, "builtins.list", "") + + def visit_set_expr(self, e: SetExpr) -> Type: + return self.check_lst_expr(e, "builtins.set", "") + + def fast_container_type( + self, e: ListExpr | SetExpr | TupleExpr, container_fullname: str + ) -> Type | None: + """ + Fast path to determine the type of a list or set literal, + based on the list of entries. This mostly impacts large + module-level constant definitions. + + Limitations: + + - no active type context + - at least one item + - no star expressions + - not after deferral + - either exactly one distinct type inside, + or the joined type of all entries is an Instance or Tuple type, + """ + ctx = self.type_context[-1] + if ctx or not e.items: + return None + if self.chk.current_node_deferred: + # Guarantees that all items will be Any, we'll reject it anyway. + return None + values: list[Type] = [] + # Preserve join order while avoiding O(n) lookups at every iteration + values_set: set[Type] = set() + for item in e.items: + if isinstance(item, StarExpr): + # fallback to slow path + return None + + typ = self.accept(item) + if typ not in values_set: + values.append(typ) + values_set.add(typ) + + vt = self._first_or_join_fast_item(values) + if vt is None: + return None + return self.chk.named_generic_type(container_fullname, [vt]) + + def _first_or_join_fast_item(self, items: list[Type]) -> Type | None: + if len(items) == 1 and not self.chk.current_node_deferred: + return items[0] + typ = join.join_type_list(items) + if not allow_fast_container_literal(typ): + # TODO: This is overly strict, many other types can be joined safely here. + # However, our join implementation isn't bug-free, and some joins may produce + # undesired `Any`s or even more surprising results. + return None + return typ + + def check_lst_expr(self, e: ListExpr | SetExpr | TupleExpr, fullname: str, tag: str) -> Type: + # fast path + t = self.fast_container_type(e, fullname) + if t: + return t + + # Translate into type checking a generic function call. + # Used for list and set expressions, as well as for tuples + # containing star expressions that don't refer to a + # Tuple. (Note: "lst" stands for list-set-tuple. :-) + tv = TypeVarType( + "T", + "T", + id=TypeVarId(-1, namespace=""), + values=[], + upper_bound=self.object_type(), + default=AnyType(TypeOfAny.from_omitted_generics), + ) + constructor = CallableType( + [tv], + [nodes.ARG_STAR], + [None], + self.chk.named_generic_type(fullname, [tv]), + self.named_type("builtins.function"), + name=tag, + variables=[tv], + ) + out = self.check_call( + constructor, + [(i.expr if isinstance(i, StarExpr) else i) for i in e.items], + [(nodes.ARG_STAR if isinstance(i, StarExpr) else nodes.ARG_POS) for i in e.items], + e, + )[0] + return remove_instance_last_known_values(out) + + def tuple_context_matches(self, expr: TupleExpr, ctx: TupleType) -> bool: + ctx_unpack_index = find_unpack_in_list(ctx.items) + if ctx_unpack_index is None: + # For fixed tuples accept everything that can possibly match, even if this + # requires all star items to be empty. + return len([e for e in expr.items if not isinstance(e, StarExpr)]) <= len(ctx.items) + # For variadic context, the only easy case is when structure matches exactly. + # TODO: try using tuple type context in more cases. + if len([e for e in expr.items if isinstance(e, StarExpr)]) != 1: + return False + expr_star_index = next(i for i, lv in enumerate(expr.items) if isinstance(lv, StarExpr)) + return len(expr.items) == len(ctx.items) and ctx_unpack_index == expr_star_index + + def visit_tuple_expr(self, e: TupleExpr) -> Type: + """Type check a tuple expression.""" + # Try to determine type context for type inference. + type_context = get_proper_type(self.type_context[-1]) + type_context_items = None + if isinstance(type_context, UnionType): + tuples_in_context = [ + t + for t in get_proper_types(type_context.items) + if (isinstance(t, TupleType) and self.tuple_context_matches(e, t)) + or is_named_instance(t, TUPLE_LIKE_INSTANCE_NAMES) + ] + if len(tuples_in_context) == 1: + type_context = tuples_in_context[0] + else: + # There are either no relevant tuples in the Union, or there is + # more than one. Either way, we can't decide on a context. + pass + + if isinstance(type_context, TupleType) and self.tuple_context_matches(e, type_context): + type_context_items = type_context.items + elif type_context and is_named_instance(type_context, TUPLE_LIKE_INSTANCE_NAMES): + assert isinstance(type_context, Instance) + if type_context.args: + type_context_items = [type_context.args[0]] * len(e.items) + # NOTE: it's possible for the context to have a different + # number of items than e. In that case we use those context + # items that match a position in e, and we'll worry about type + # mismatches later. + + unpack_in_context = False + if type_context_items is not None: + unpack_in_context = find_unpack_in_list(type_context_items) is not None + seen_unpack_in_items = False + allow_precise_tuples = ( + unpack_in_context or PRECISE_TUPLE_TYPES in self.chk.options.enable_incomplete_feature + ) + + # Infer item types. Give up if there's a star expression + # that's not a Tuple. + items: list[Type] = [] + j = 0 # Index into type_context_items; irrelevant if type_context_items is none + for i in range(len(e.items)): + item = e.items[i] + if isinstance(item, StarExpr): + # Special handling for star expressions. + # TODO: If there's a context, and item.expr is a + # TupleExpr, flatten it, so we can benefit from the + # context? Counterargument: Why would anyone write + # (1, *(2, 3)) instead of (1, 2, 3) except in a test? + if unpack_in_context: + # Note: this logic depends on full structure match in tuple_context_matches(). + assert type_context_items + ctx_item = type_context_items[j] + assert isinstance(ctx_item, UnpackType) + ctx = ctx_item.type + else: + ctx = None + tt = self.accept(item.expr, ctx) + tt = get_proper_type(tt) + if isinstance(tt, TupleType): + if find_unpack_in_list(tt.items) is not None: + if seen_unpack_in_items: + # Multiple unpack items are not allowed in tuples, + # fall back to instance type. + return self.check_lst_expr(e, "builtins.tuple", "") + else: + seen_unpack_in_items = True + items.extend(tt.items) + # Note: this logic depends on full structure match in tuple_context_matches(). + if unpack_in_context: + j += 1 + else: + # If there is an unpack in expressions, but not in context, this will + # result in an error later, just do something predictable here. + j += len(tt.items) + else: + if allow_precise_tuples and not seen_unpack_in_items: + # Handle (x, *y, z), where y is e.g. tuple[Y, ...]. + if isinstance(tt, Instance) and self.chk.type_is_iterable(tt): + item_type = self.chk.iterable_item_type(tt, e) + mapped = self.chk.named_generic_type("builtins.tuple", [item_type]) + items.append(UnpackType(mapped)) + seen_unpack_in_items = True + continue + # A star expression that's not a Tuple. + # Treat the whole thing as a variable-length tuple. + return self.check_lst_expr(e, "builtins.tuple", "") + else: + if not type_context_items or j >= len(type_context_items): + tt = self.accept(item) + else: + tt = self.accept(item, type_context_items[j]) + j += 1 + items.append(tt) + # This is a partial fallback item type. A precise type will be calculated on demand. + fallback_item = AnyType(TypeOfAny.special_form) + result: ProperType = TupleType( + items, self.chk.named_generic_type("builtins.tuple", [fallback_item]) + ) + if seen_unpack_in_items: + # Return already normalized tuple type just in case. + result = expand_type(result, {}) + return result + + def fast_dict_type(self, e: DictExpr) -> Type | None: + """ + Fast path to determine the type of a dict literal, + based on the list of entries. This mostly impacts large + module-level constant definitions. + + Limitations: + + - no active type context + - at least one item + - only supported star expressions are other dict instances + - either exactly one distinct type (keys and values separately) inside, + or the joined type of all entries is an Instance or Tuple type + """ + ctx = self.type_context[-1] + if ctx or not e.items: + return None + + if self.chk.current_node_deferred: + # Guarantees that all items will be Any, we'll reject it anyway. + return None + + keys: list[Type] = [] + values: list[Type] = [] + # Preserve join order while avoiding O(n) lookups at every iteration + keys_set: set[Type] = set() + values_set: set[Type] = set() + stargs: tuple[Type, Type] | None = None + for key, value in e.items: + if key is None: + st = get_proper_type(self.accept(value)) + if ( + isinstance(st, Instance) + and st.type.fullname == "builtins.dict" + and len(st.args) == 2 + ): + stargs = (st.args[0], st.args[1]) + else: + return None + else: + key_t = self.accept(key) + if key_t not in keys_set: + keys.append(key_t) + keys_set.add(key_t) + value_t = self.accept(value) + if value_t not in values_set: + values.append(value_t) + values_set.add(value_t) + + kt = self._first_or_join_fast_item(keys) + if kt is None: + return None + + vt = self._first_or_join_fast_item(values) + if vt is None: + return None + + if stargs and (stargs[0] != kt or stargs[1] != vt): + return None + return self.chk.named_generic_type("builtins.dict", [kt, vt]) + + def check_typeddict_literal_in_context( + self, e: DictExpr, typeddict_context: TypedDictType + ) -> Type: + orig_ret_type = self.check_typeddict_call_with_dict( + callee=typeddict_context, kwargs=e.items, context=e, orig_callee=None + ) + ret_type = get_proper_type(orig_ret_type) + if isinstance(ret_type, TypedDictType): + return ret_type.copy_modified() + return typeddict_context.copy_modified() + + def visit_dict_expr(self, e: DictExpr) -> Type: + """Type check a dict expression. + + Translate it into a call to dict(), with provisions for **expr. + """ + # if the dict literal doesn't match TypedDict, check_typeddict_call_with_dict reports + # an error, but returns the TypedDict type that matches the literal it found + # that would cause a second error when that TypedDict type is returned upstream + # to avoid the second error, we always return TypedDict type that was requested + typeddict_contexts, exhaustive = self.find_typeddict_context(self.type_context[-1], e) + if typeddict_contexts: + if len(typeddict_contexts) == 1 and exhaustive: + return self.check_typeddict_literal_in_context(e, typeddict_contexts[0]) + # Multiple items union, check if at least one of them matches cleanly. + for typeddict_context in typeddict_contexts: + with self.msg.filter_errors() as err, self.chk.local_type_map as tmap: + ret_type = self.check_typeddict_literal_in_context(e, typeddict_context) + if err.has_new_errors(): + continue + self.chk.store_types(tmap) + return ret_type + # No item matched without an error, so we can't unambiguously choose the item. + if exhaustive: + self.msg.typeddict_context_ambiguous(typeddict_contexts, e) + + # fast path attempt + dt = self.fast_dict_type(e) + if dt: + return dt + + # Define type variables (used in constructors below). + kt = TypeVarType( + "KT", + "KT", + id=TypeVarId(-1, namespace=""), + values=[], + upper_bound=self.object_type(), + default=AnyType(TypeOfAny.from_omitted_generics), + ) + vt = TypeVarType( + "VT", + "VT", + id=TypeVarId(-2, namespace=""), + values=[], + upper_bound=self.object_type(), + default=AnyType(TypeOfAny.from_omitted_generics), + ) + + # Collect function arguments, watching out for **expr. + args: list[Expression] = [] + expected_types: list[Type] = [] + for key, value in e.items: + if key is None: + args.append(value) + expected_types.append( + self.chk.named_generic_type("_typeshed.SupportsKeysAndGetItem", [kt, vt]) + ) + else: + tup = TupleExpr([key, value]) + if key.line >= 0: + tup.line = key.line + tup.column = key.column + else: + tup.line = value.line + tup.column = value.column + tup.end_line = value.end_line + tup.end_column = value.end_column + args.append(tup) + expected_types.append(TupleType([kt, vt], self.named_type("builtins.tuple"))) + + # The callable type represents a function like this (except we adjust for **expr): + # def (*v: Tuple[kt, vt]) -> Dict[kt, vt]: ... + constructor = CallableType( + expected_types, + [nodes.ARG_POS] * len(expected_types), + [None] * len(expected_types), + self.chk.named_generic_type("builtins.dict", [kt, vt]), + self.named_type("builtins.function"), + name="", + variables=[kt, vt], + ) + return self.check_call(constructor, args, [nodes.ARG_POS] * len(args), e)[0] + + def find_typeddict_context( + self, context: Type | None, dict_expr: DictExpr + ) -> tuple[list[TypedDictType], bool]: + """Extract `TypedDict` members of the enclosing context. + + Returns: + a 2-tuple, (found_candidates, is_exhaustive) + """ + context = get_proper_type(context) + if isinstance(context, TypedDictType): + return [context], True + elif isinstance(context, UnionType): + items = [] + exhaustive = True + for item in context.items: + item_contexts, item_exhaustive = self.find_typeddict_context(item, dict_expr) + for item_context in item_contexts: + if self.match_typeddict_call_with_dict( + item_context, dict_expr.items, dict_expr + ): + items.append(item_context) + exhaustive = exhaustive and item_exhaustive + return items, exhaustive + # No TypedDict type in context. + return [], False + + def visit_template_str_expr(self, e: TemplateStrExpr) -> Type: + """Type check a template string expression (t-string). + + Type-checks all interpolated expressions but the result is always + string.templatelib.Template. + """ + for item in e.items: + if isinstance(item, tuple): + value_expr, _source, _conversion, format_spec = item + self.accept(value_expr) + if format_spec is not None: + self.accept(format_spec) + sym = lookup_fully_qualified("string.templatelib.Template", self.chk.modules) + if sym is not None and isinstance(sym.node, TypeInfo): + return Instance(sym.node, []) + return AnyType(TypeOfAny.from_error) + + def visit_lambda_expr(self, e: LambdaExpr) -> Type: + """Type check lambda expression.""" + old_in_lambda = self.in_lambda_expr + self.in_lambda_expr = True + self.chk.check_default_params(e, body_is_trivial=False) + inferred_type, type_override = self.infer_lambda_type_using_context(e) + if not inferred_type: + self.chk.return_types.append(AnyType(TypeOfAny.special_form)) + # Type check everything in the body except for the final return + # statement (it can contain tuple unpacking before return). + with ( + self.chk.binder.frame_context(can_skip=True, fall_through=0), + self.chk.scope.push_function(e), + ): + # Lambdas can have more than one element in body, + # when we add "fictional" AssignmentStatement nodes, like in: + # `lambda (a, b): a` + for stmt in e.body.body[:-1]: + stmt.accept(self.chk) + # Only type check the return expression, not the return statement. + # There's no useful type context. + ret_type = self.accept(e.expr(), allow_none_return=True) + fallback = self.named_type("builtins.function") + self.chk.return_types.pop() + self.in_lambda_expr = old_in_lambda + return callable_type(e, fallback, ret_type) + else: + # Type context available. + self.chk.return_types.append(inferred_type.ret_type) + with self.chk.tscope.function_scope(e): + self.chk.check_func_item(e, type_override=type_override) + if not self.chk.has_type(e.expr()): + # TODO: return expression must be accepted before exiting function scope. + with self.chk.binder.frame_context(can_skip=True, fall_through=0): + self.accept(e.expr(), allow_none_return=True) + ret_type = self.chk.lookup_type(e.expr()) + self.chk.return_types.pop() + self.in_lambda_expr = old_in_lambda + return replace_callable_return_type(inferred_type, ret_type) + + def infer_lambda_type_using_context( + self, e: LambdaExpr + ) -> tuple[CallableType | None, CallableType | None]: + """Try to infer lambda expression type using context. + + Return None if could not infer type. + The second item in the return type is the type_override parameter for check_func_item. + """ + # TODO also accept 'Any' context + ctx = get_proper_type(self.type_context[-1]) + + if isinstance(ctx, UnionType): + callables = [ + t for t in get_proper_types(ctx.relevant_items()) if isinstance(t, CallableType) + ] + if len(callables) == 1: + ctx = callables[0] + + if not ctx or not isinstance(ctx, CallableType): + return None, None + + # The context may have function type variables in it. We replace them + # since these are the type variables we are ultimately trying to infer; + # they must be considered as indeterminate. We use ErasedType since it + # does not affect type inference results (it is for purposes like this + # only). + if not self.chk.options.old_type_inference: + # With new type inference we can preserve argument types even if they + # are generic, since new inference algorithm can handle constraints + # like S <: T (we still erase return type since it's ultimately unknown). + extra_vars = [] + for arg in ctx.arg_types: + meta_vars = [tv for tv in get_all_type_vars(arg) if tv.id.is_meta_var()] + extra_vars.extend([tv for tv in meta_vars if tv not in extra_vars]) + callable_ctx = ctx.copy_modified( + ret_type=replace_meta_vars(ctx.ret_type, ErasedType()), + variables=list(ctx.variables) + extra_vars, + ) + else: + erased_ctx = replace_meta_vars(ctx, ErasedType()) + assert isinstance(erased_ctx, ProperType) and isinstance(erased_ctx, CallableType) + callable_ctx = erased_ctx + + # The callable_ctx may have a fallback of builtins.type if the context + # is a constructor -- but this fallback doesn't make sense for lambdas. + callable_ctx = callable_ctx.copy_modified(fallback=self.named_type("builtins.function")) + + if callable_ctx.type_guard is not None or callable_ctx.type_is is not None: + # Lambda's return type cannot be treated as a `TypeGuard`, + # because it is implicit. And `TypeGuard`s must be explicit. + # See https://github.com/python/mypy/issues/9927 + return None, None + + arg_kinds = [arg.kind for arg in e.arguments] + + if callable_ctx.is_ellipsis_args or ctx.param_spec() is not None: + # Fill in Any arguments to match the arguments of the lambda. + callable_ctx = callable_ctx.copy_modified( + is_ellipsis_args=False, + arg_types=[AnyType(TypeOfAny.special_form)] * len(arg_kinds), + arg_kinds=arg_kinds, + arg_names=e.arg_names.copy(), + ) + + if ARG_STAR in arg_kinds or ARG_STAR2 in arg_kinds: + # TODO treat this case appropriately + return callable_ctx, None + + if callable_ctx.arg_kinds != arg_kinds: + # Incompatible context; cannot use it to infer types. + self.chk.fail(message_registry.CANNOT_INFER_LAMBDA_TYPE, e) + return None, None + + # Type of lambda must have correct argument names, to prevent false + # negatives when lambdas appear in `ParamSpec` context. + return callable_ctx.copy_modified(arg_names=e.arg_names), callable_ctx + + def visit_super_expr(self, e: SuperExpr) -> Type: + """Type check a super expression (non-lvalue).""" + + # We have an expression like super(T, var).member + + # First compute the types of T and var + types = self._super_arg_types(e) + if isinstance(types, tuple): + type_type, instance_type = types + else: + return types + + # Now get the MRO + type_info = type_info_from_type(type_type) + if type_info is None: + self.chk.fail(message_registry.UNSUPPORTED_ARG_1_FOR_SUPER, e) + return AnyType(TypeOfAny.from_error) + + instance_info = type_info_from_type(instance_type) + if instance_info is None: + self.chk.fail(message_registry.UNSUPPORTED_ARG_2_FOR_SUPER, e) + return AnyType(TypeOfAny.from_error) + + mro = instance_info.mro + + # The base is the first MRO entry *after* type_info that has a member + # with the right name + index = None + if type_info in mro: + index = mro.index(type_info) + else: + method = self.chk.scope.current_function() + # Mypy explicitly allows supertype upper bounds (and no upper bound at all) + # for annotating self-types. However, if such an annotation is used for + # checking super() we will still get an error. So to be consistent, we also + # allow such imprecise annotations for use with super(), where we fall back + # to the current class MRO instead. This works only from inside a method. + if method is not None and is_self_type_like( + instance_type, is_classmethod=method.is_class + ): + if e.info and type_info in e.info.mro: + mro = e.info.mro + index = mro.index(type_info) + if index is None: + if ( + instance_info.is_protocol + and instance_info != type_info + and not type_info.is_protocol + ): + # A special case for mixins, in this case super() should point + # directly to the host protocol, this is not safe, since the real MRO + # is not known yet for mixin, but this feature is more like an escape hatch. + index = -1 + else: + self.chk.fail(message_registry.SUPER_ARG_2_NOT_INSTANCE_OF_ARG_1, e) + return AnyType(TypeOfAny.from_error) + + if len(mro) == index + 1: + self.chk.fail(message_registry.TARGET_CLASS_HAS_NO_BASE_CLASS, e) + return AnyType(TypeOfAny.from_error) + + for base in mro[index + 1 :]: + if e.name in base.names or base == mro[-1]: + if e.info and e.info.fallback_to_any and base == mro[-1]: + # There's an undefined base class, and we're at the end of the + # chain. That's not an error. + return AnyType(TypeOfAny.special_form) + + return analyze_member_access( + name=e.name, + typ=instance_type, + is_lvalue=False, + is_super=True, + is_operator=False, + original_type=instance_type, + override_info=base, + context=e, + chk=self.chk, + in_literal_context=self.is_literal_context(), + ) + + assert False, "unreachable" + + def _super_arg_types(self, e: SuperExpr) -> Type | tuple[Type, Type]: + """ + Computes the types of the type and instance expressions in super(T, instance), or the + implicit ones for zero-argument super() expressions. Returns a single type for the whole + super expression when possible (for errors, anys), otherwise the pair of computed types. + """ + + if not self.chk.in_checked_function(): + return AnyType(TypeOfAny.unannotated) + elif len(e.call.args) == 0: + if not e.info: + # This has already been reported by the semantic analyzer. + return AnyType(TypeOfAny.from_error) + elif self.chk.scope.active_class(): + self.chk.fail(message_registry.SUPER_OUTSIDE_OF_METHOD_NOT_SUPPORTED, e) + return AnyType(TypeOfAny.from_error) + + # Zero-argument super() is like super(, ) + current_type = fill_typevars(e.info) + type_type: ProperType = TypeType(current_type) + + # Use the type of the self argument, in case it was annotated + method = self.chk.scope.current_function() + assert method is not None + if method.arguments: + instance_type: Type = method.arguments[0].variable.type or current_type + else: + self.chk.fail(message_registry.SUPER_ENCLOSING_POSITIONAL_ARGS_REQUIRED, e) + return AnyType(TypeOfAny.from_error) + elif ARG_STAR in e.call.arg_kinds: + self.chk.fail(message_registry.SUPER_VARARGS_NOT_SUPPORTED, e) + return AnyType(TypeOfAny.from_error) + elif set(e.call.arg_kinds) != {ARG_POS}: + self.chk.fail(message_registry.SUPER_POSITIONAL_ARGS_REQUIRED, e) + return AnyType(TypeOfAny.from_error) + elif len(e.call.args) == 1: + self.chk.fail(message_registry.SUPER_WITH_SINGLE_ARG_NOT_SUPPORTED, e) + return AnyType(TypeOfAny.from_error) + elif len(e.call.args) == 2: + type_type = get_proper_type(self.accept(e.call.args[0])) + instance_type = self.accept(e.call.args[1]) + else: + self.chk.fail(message_registry.TOO_MANY_ARGS_FOR_SUPER, e) + return AnyType(TypeOfAny.from_error) + + # Imprecisely assume that the type is the current class + if isinstance(type_type, AnyType): + if e.info: + type_type = TypeType(fill_typevars(e.info)) + else: + return AnyType(TypeOfAny.from_another_any, source_any=type_type) + elif isinstance(type_type, TypeType): + type_item = type_type.item + if isinstance(type_item, AnyType): + if e.info: + type_type = TypeType(fill_typevars(e.info)) + else: + return AnyType(TypeOfAny.from_another_any, source_any=type_item) + + if not isinstance(type_type, TypeType) and not ( + isinstance(type_type, FunctionLike) and type_type.is_type_obj() + ): + self.msg.first_argument_for_super_must_be_type(type_type, e) + return AnyType(TypeOfAny.from_error) + + # Imprecisely assume that the instance is of the current class + instance_type = get_proper_type(instance_type) + if isinstance(instance_type, AnyType): + if e.info: + instance_type = fill_typevars(e.info) + else: + return AnyType(TypeOfAny.from_another_any, source_any=instance_type) + elif isinstance(instance_type, TypeType): + instance_item = instance_type.item + if isinstance(instance_item, AnyType): + if e.info: + instance_type = TypeType(fill_typevars(e.info)) + else: + return AnyType(TypeOfAny.from_another_any, source_any=instance_item) + + return type_type, instance_type + + def visit_slice_expr(self, e: SliceExpr) -> Type: + try: + supports_index = self.chk.named_type("typing_extensions.SupportsIndex") + except KeyError: + supports_index = self.chk.named_type("builtins.int") # thanks, fixture life + expected = make_optional_type(supports_index) + type_args = [] + for index in [e.begin_index, e.end_index, e.stride]: + if index: + t = self.accept(index) + self.chk.check_subtype(t, expected, index, message_registry.INVALID_SLICE_INDEX) + type_args.append(t) + else: + type_args.append(NoneType()) + return self.chk.named_generic_type("builtins.slice", type_args) + + def visit_list_comprehension(self, e: ListComprehension) -> Type: + return self.check_generator_or_comprehension( + e.generator, "builtins.list", "" + ) + + def visit_set_comprehension(self, e: SetComprehension) -> Type: + return self.check_generator_or_comprehension( + e.generator, "builtins.set", "" + ) + + def visit_generator_expr(self, e: GeneratorExpr) -> Type: + # If any of the comprehensions use async for, the expression will return an async generator + # object, or await is used anywhere but in the leftmost sequence. + if ( + any(e.is_async) + or has_await_expression(e.left_expr) + or any(has_await_expression(sequence) for sequence in e.sequences[1:]) + or any(has_await_expression(cond) for condlist in e.condlists for cond in condlist) + ): + typ = "typing.AsyncGenerator" + # received type is always None in async generator expressions + additional_args: list[Type] = [NoneType()] + else: + typ = "typing.Generator" + # received type and returned type are None + additional_args = [NoneType(), NoneType()] + return self.check_generator_or_comprehension( + e, typ, "", additional_args=additional_args + ) + + def check_generator_or_comprehension( + self, + gen: GeneratorExpr, + type_name: str, + id_for_messages: str, + additional_args: list[Type] | None = None, + ) -> Type: + """Type check a generator expression or a list comprehension.""" + additional_args = additional_args or [] + with self.chk.binder.frame_context(can_skip=True, fall_through=0): + self.check_for_comp(gen) + + # Infer the type of the list comprehension by using a synthetic generic + # callable type. + tv = TypeVarType( + "T", + "T", + id=TypeVarId(-1, namespace=""), + values=[], + upper_bound=self.object_type(), + default=AnyType(TypeOfAny.from_omitted_generics), + ) + tv_list: list[Type] = [tv] + constructor = CallableType( + tv_list, + [nodes.ARG_POS], + [None], + self.chk.named_generic_type(type_name, tv_list + additional_args), + self.chk.named_type("builtins.function"), + name=id_for_messages, + variables=[tv], + ) + return self.check_call(constructor, [gen.left_expr], [nodes.ARG_POS], gen)[0] + + def visit_dictionary_comprehension(self, e: DictionaryComprehension) -> Type: + """Type check a dictionary comprehension.""" + with self.chk.binder.frame_context(can_skip=True, fall_through=0): + self.check_for_comp(e) + + # Infer the type of the list comprehension by using a synthetic generic + # callable type. + ktdef = TypeVarType( + "KT", + "KT", + id=TypeVarId(-1, namespace=""), + values=[], + upper_bound=self.object_type(), + default=AnyType(TypeOfAny.from_omitted_generics), + ) + vtdef = TypeVarType( + "VT", + "VT", + id=TypeVarId(-2, namespace=""), + values=[], + upper_bound=self.object_type(), + default=AnyType(TypeOfAny.from_omitted_generics), + ) + constructor = CallableType( + [ktdef, vtdef], + [nodes.ARG_POS, nodes.ARG_POS], + [None, None], + self.chk.named_generic_type("builtins.dict", [ktdef, vtdef]), + self.chk.named_type("builtins.function"), + name="", + variables=[ktdef, vtdef], + ) + return self.check_call( + constructor, [e.key, e.value], [nodes.ARG_POS, nodes.ARG_POS], e + )[0] + + def check_for_comp(self, e: GeneratorExpr | DictionaryComprehension) -> None: + """Check the for_comp part of comprehensions. That is the part from 'for': + ... for x in y if z + + Note: This adds the type information derived from the condlists to the current binder. + """ + for index, sequence, conditions, is_async in zip( + e.indices, e.sequences, e.condlists, e.is_async + ): + if is_async: + _, sequence_type = self.chk.analyze_async_iterable_item_type(sequence) + else: + _, sequence_type = self.chk.analyze_iterable_item_type(sequence) + if ( + isinstance(get_proper_type(sequence_type), UninhabitedType) + and isinstance(index, NameExpr) + and index.name == "_" + ): + # To preserve backward compatibility, avoid inferring Never for "_" + sequence_type = AnyType(TypeOfAny.special_form) + + self.chk.analyze_index_variables(index, sequence_type, True, e) + for condition in conditions: + self.accept(condition) + + # values are only part of the comprehension when all conditions are true + true_map, false_map = self.chk.find_isinstance_check(condition) + self.chk.push_type_map(true_map) + + if codes.REDUNDANT_EXPR in self.chk.options.enabled_error_codes: + if mypy.checker.is_unreachable_map(true_map): + self.msg.redundant_condition_in_comprehension(False, condition) + elif mypy.checker.is_unreachable_map(false_map): + self.msg.redundant_condition_in_comprehension(True, condition) + + def visit_conditional_expr(self, e: ConditionalExpr, allow_none_return: bool = False) -> Type: + self.accept(e.cond) + ctx: Type | None = self.type_context[-1] + + # Gain type information from isinstance if it is there + # but only for the current expression + if_map, else_map = self.chk.find_isinstance_check(e.cond) + if codes.REDUNDANT_EXPR in self.chk.options.enabled_error_codes: + if mypy.checker.is_unreachable_map(if_map): + self.msg.redundant_condition_in_if(False, e.cond) + elif mypy.checker.is_unreachable_map(else_map): + self.msg.redundant_condition_in_if(True, e.cond) + + if ctx is None: + # When no context is provided, compute each branch individually, and + # use the union of the results as artificial context. Important for: + # - testUnificationDict + # - testConditionalExpressionWithEmpty + ctx_if_type = self.analyze_cond_branch( + if_map, e.if_expr, context=ctx, allow_none_return=allow_none_return + ) + ctx_else_type = self.analyze_cond_branch( + else_map, e.else_expr, context=ctx, allow_none_return=allow_none_return + ) + if has_ambiguous_uninhabited_component(ctx_if_type): + ctx = ctx_else_type + elif has_ambiguous_uninhabited_component(ctx_else_type): + ctx = ctx_if_type + else: + ctx = make_simplified_union([ctx_if_type, ctx_else_type]) + + if_type = self.analyze_cond_branch( + if_map, e.if_expr, context=ctx, allow_none_return=allow_none_return + ) + else_type = self.analyze_cond_branch( + else_map, e.else_expr, context=ctx, allow_none_return=allow_none_return + ) + + res: Type = make_simplified_union([if_type, else_type]) + if has_uninhabited_component(res) and not isinstance( + get_proper_type(self.type_context[-1]), UnionType + ): + # In rare cases with empty collections join may give a better result. + alternative = join.join_types(if_type, else_type) + p_alt = get_proper_type(alternative) + if not isinstance(p_alt, Instance) or p_alt.type.fullname != "builtins.object": + res = alternative + return res + + def analyze_cond_branch( + self, + map: dict[Expression, Type], + node: Expression, + context: Type | None, + allow_none_return: bool = False, + suppress_unreachable_errors: bool = True, + ) -> Type: + with self.chk.binder.frame_context(can_skip=True, fall_through=0): + if mypy.checker.is_unreachable_map(map): + # We still need to type check node, in case we want to + # process it for isinstance checks later. Since the branch was + # determined to be unreachable, any errors should be suppressed. + with self.msg.filter_errors(filter_errors=suppress_unreachable_errors): + self.accept(node, type_context=context, allow_none_return=allow_none_return) + return UninhabitedType() + self.chk.push_type_map(map) + return self.accept(node, type_context=context, allow_none_return=allow_none_return) + + def _combined_context(self, ty: Type | None) -> Type | None: + ctx_items = [] + if ty is not None: + if has_any_type(ty): + # HACK: Any should be contagious, `dict[str, Any] or ` should still + # infer Any in x. + return ty + ctx_items.append(ty) + if self.type_context and self.type_context[-1] is not None: + ctx_items.append(self.type_context[-1]) + if ctx_items: + return make_simplified_union(ctx_items) + return None + + # + # Helpers + # + + def accept( + self, + node: Expression, + type_context: Type | None = None, + allow_none_return: bool = False, + always_allow_any: bool = False, + is_callee: bool = False, + ) -> Type: + """Type check a node in the given type context. If allow_none_return + is True and this expression is a call, allow it to return None. This + applies only to this expression and not any subexpressions. + """ + if node in self.type_overrides: + # This branch is very fast, there is no point timing it. + return self.type_overrides[node] + # We don't use context manager here to get most precise data (and avoid overhead). + record_time = False + if self.collect_line_checking_stats and not self.in_expression: + t0 = time.perf_counter_ns() + self.in_expression = True + record_time = True + self.type_context.append(type_context) + old_is_callee = self.is_callee + self.is_callee = is_callee + try: + p_type_context = get_proper_type(type_context) + if allow_none_return and isinstance(node, CallExpr): + typ = self.visit_call_expr(node, allow_none_return=True) + elif allow_none_return and isinstance(node, YieldFromExpr): + typ = self.visit_yield_from_expr(node, allow_none_return=True) + elif allow_none_return and isinstance(node, ConditionalExpr): + typ = self.visit_conditional_expr(node, allow_none_return=True) + elif allow_none_return and isinstance(node, AwaitExpr): + typ = self.visit_await_expr(node, allow_none_return=True) + + elif ( + isinstance(p_type_context, TypeType) + and p_type_context.is_type_form + and (node_as_type := self.try_parse_as_type_expression(node)) is not None + ): + typ = TypeType.make_normalized( + node_as_type, + line=node_as_type.line, + column=node_as_type.column, + is_type_form=True, + ) # r-value type, when interpreted as a type expression + elif ( + isinstance(p_type_context, UnionType) + and any( + isinstance(p_item := get_proper_type(item), TypeType) and p_item.is_type_form + for item in p_type_context.items + ) + and (node_as_type := self.try_parse_as_type_expression(node)) is not None + ): + typ1 = TypeType.make_normalized( + node_as_type, + line=node_as_type.line, + column=node_as_type.column, + is_type_form=True, + ) + if is_subtype(typ1, p_type_context): + typ = typ1 # r-value type, when interpreted as a type expression + else: + typ2 = node.accept(self) + typ = typ2 # r-value type, when interpreted as a value expression + # Deeply nested generic calls can deteriorate performance dramatically. + # Although in most cases caching makes little difference, in worst case + # it avoids exponential complexity. + # We cannot use cache inside lambdas, because they skip immediate type + # context, and use enclosing one, see infer_lambda_type_using_context(). + # TODO: consider using cache for more expression kinds. + elif ( + isinstance(node, (CallExpr, ListExpr, TupleExpr, DictExpr, OpExpr)) + and not (self.in_lambda_expr or self.chk.current_node_deferred) + and not self.chk.options.disable_expression_cache + ): + if (node, type_context) in self.expr_cache: + binder_version, typ, messages, type_map = self.expr_cache[(node, type_context)] + if binder_version == self.chk.binder.version: + self.chk.store_types(type_map) + self.msg.add_errors(messages) + else: + typ = self.accept_maybe_cache(node, type_context=type_context) + else: + typ = self.accept_maybe_cache(node, type_context=type_context) + else: + typ = node.accept(self) # r-value type, when interpreted as a value expression + except Exception as err: + report_internal_error( + err, self.chk.errors.file, node.line, self.chk.errors, self.chk.options + ) + self.is_callee = old_is_callee + self.type_context.pop() + assert typ is not None + self.chk.store_type(node, typ) + + if ( + self.chk.options.disallow_any_expr + and not always_allow_any + and not self.chk.is_stub + and self.chk.in_checked_function() + and has_any_type(typ) + and not self.chk.current_node_deferred + ): + self.msg.disallowed_any_type(typ, node) + + if not self.chk.in_checked_function() or self.chk.current_node_deferred: + result: Type = AnyType(TypeOfAny.unannotated) + else: + result = typ + if record_time: + self.per_line_checking_time_ns[node.line] += time.perf_counter_ns() - t0 + self.in_expression = False + return result + + def accept_maybe_cache(self, node: Expression, type_context: Type | None = None) -> Type: + binder_version = self.chk.binder.version + with self.msg.filter_errors(filter_errors=True, save_filtered_errors=True) as msg: + with self.chk.local_type_map as type_map: + typ = node.accept(self) + messages = msg.filtered_errors() + if binder_version == self.chk.binder.version and not self.chk.current_node_deferred: + self.expr_cache[(node, type_context)] = (binder_version, typ, messages, type_map) + self.chk.store_types(type_map) + self.msg.add_errors(messages) + return typ + + def named_type(self, name: str) -> Instance: + """Return an instance type with type given by the name and no type + arguments. Alias for TypeChecker.named_type. + """ + return self.chk.named_type(name) + + def type_alias_type_type(self) -> Instance: + """Returns a `typing.TypeAliasType` or `typing_extensions.TypeAliasType`.""" + if self.chk.options.python_version >= (3, 12): + return self.named_type("typing.TypeAliasType") + return self.named_type("typing_extensions.TypeAliasType") + + def is_valid_var_arg(self, typ: Type) -> bool: + """Is a type valid as a *args argument?""" + typ = get_proper_type(typ) + return isinstance(typ, (TupleType, AnyType, ParamSpecType, UnpackType)) or is_subtype( + typ, self.chk.named_generic_type("typing.Iterable", [AnyType(TypeOfAny.special_form)]) + ) + + def is_valid_keyword_var_arg(self, typ: Type) -> bool: + """Is a type valid as a **kwargs argument?""" + typ = get_proper_type(typ) + return ( + ( + # This is a little ad hoc, ideally we would have a map_instance_to_supertype + # that worked for protocols + isinstance(typ, Instance) + and typ.type.fullname == "builtins.dict" + and is_subtype(typ.args[0], self.named_type("builtins.str")) + ) + or isinstance(typ, ParamSpecType) + or is_subtype( + typ, + self.chk.named_generic_type( + "_typeshed.SupportsKeysAndGetItem", + [self.named_type("builtins.str"), AnyType(TypeOfAny.special_form)], + ), + ) + or is_subtype( + typ, + self.chk.named_generic_type( + "_typeshed.SupportsKeysAndGetItem", [UninhabitedType(), UninhabitedType()] + ), + ) + ) + + def not_ready_callback(self, name: str, context: Context) -> None: + """Called when we can't infer the type of a variable because it's not ready yet. + + Either defer type checking of the enclosing function to the next + pass or report an error. + """ + self.chk.handle_cannot_determine_type(name, context) + + def visit_yield_expr(self, e: YieldExpr) -> Type: + return_type = self.chk.return_types[-1] + expected_item_type = self.chk.get_generator_yield_type(return_type, False) + if e.expr is None: + if ( + not isinstance(get_proper_type(expected_item_type), (NoneType, AnyType)) + and self.chk.in_checked_function() + ): + self.chk.fail(message_registry.YIELD_VALUE_EXPECTED, e) + else: + actual_item_type = self.accept(e.expr, expected_item_type) + self.chk.check_subtype( + actual_item_type, + expected_item_type, + e, + message_registry.INCOMPATIBLE_TYPES_IN_YIELD, + "actual type", + "expected type", + ) + return self.chk.get_generator_receive_type(return_type, False) + + def visit_await_expr(self, e: AwaitExpr, allow_none_return: bool = False) -> Type: + expected_type = self.type_context[-1] + if expected_type is not None: + expected_type = self.chk.named_generic_type("typing.Awaitable", [expected_type]) + actual_type = get_proper_type(self.accept(e.expr, expected_type)) + if isinstance(actual_type, AnyType): + return AnyType(TypeOfAny.from_another_any, source_any=actual_type) + ret = self.check_awaitable_expr( + actual_type, e, message_registry.INCOMPATIBLE_TYPES_IN_AWAIT + ) + if not allow_none_return and isinstance(get_proper_type(ret), NoneType): + self.chk.msg.does_not_return_value(None, e) + return ret + + def check_awaitable_expr( + self, t: Type, ctx: Context, msg: str | ErrorMessage, ignore_binder: bool = False + ) -> Type: + """Check the argument to `await` and extract the type of value. + + Also used by `async for` and `async with`. + """ + if not self.chk.check_subtype( + t, self.named_type("typing.Awaitable"), ctx, msg, "actual type", "expected type" + ): + return AnyType(TypeOfAny.special_form) + else: + generator = self.check_method_call_by_name("__await__", t, [], [], ctx)[0] + ret_type = self.chk.get_generator_return_type(generator, False) + ret_type = get_proper_type(ret_type) + if ( + not ignore_binder + and isinstance(ret_type, UninhabitedType) + and not ret_type.ambiguous + ): + self.chk.binder.unreachable() + return ret_type + + def visit_yield_from_expr(self, e: YieldFromExpr, allow_none_return: bool = False) -> Type: + # NOTE: Whether `yield from` accepts an `async def` decorated + # with `@types.coroutine` (or `@asyncio.coroutine`) depends on + # whether the generator containing the `yield from` is itself + # thus decorated. But it accepts a generator regardless of + # how it's decorated. + return_type = self.chk.return_types[-1] + # TODO: What should the context for the sub-expression be? + # If the containing function has type Generator[X, Y, ...], + # the context should be Generator[X, Y, T], where T is the + # context of the 'yield from' itself (but it isn't known). + subexpr_type = get_proper_type(self.accept(e.expr)) + + # Check that the expr is an instance of Iterable and get the type of the iterator produced + # by __iter__. + if isinstance(subexpr_type, AnyType): + iter_type: Type = AnyType(TypeOfAny.from_another_any, source_any=subexpr_type) + elif self.chk.type_is_iterable(subexpr_type): + if is_async_def(subexpr_type) and not has_coroutine_decorator(return_type): + self.chk.msg.yield_from_invalid_operand_type(subexpr_type, e) + + any_type = AnyType(TypeOfAny.special_form) + generic_generator_type = self.chk.named_generic_type( + "typing.Generator", [any_type, any_type, any_type] + ) + generic_generator_type.set_line(e) + iter_type, _ = self.check_method_call_by_name( + "__iter__", subexpr_type, [], [], context=generic_generator_type + ) + else: + if not (is_async_def(subexpr_type) and has_coroutine_decorator(return_type)): + self.chk.msg.yield_from_invalid_operand_type(subexpr_type, e) + iter_type = AnyType(TypeOfAny.from_error) + else: + iter_type = self.check_awaitable_expr( + subexpr_type, e, message_registry.INCOMPATIBLE_TYPES_IN_YIELD_FROM + ) + + # Check that the iterator's item type matches the type yielded by the Generator function + # containing this `yield from` expression. + expected_item_type = self.chk.get_generator_yield_type(return_type, False) + actual_item_type = self.chk.get_generator_yield_type(iter_type, False) + + self.chk.check_subtype( + actual_item_type, + expected_item_type, + e, + message_registry.INCOMPATIBLE_TYPES_IN_YIELD_FROM, + "actual type", + "expected type", + ) + + # Determine the type of the entire yield from expression. + iter_type = get_proper_type(iter_type) + expr_type = self.chk.get_generator_return_type(iter_type, is_coroutine=False) + + if not allow_none_return and isinstance(get_proper_type(expr_type), NoneType): + self.chk.msg.does_not_return_value(None, e) + return expr_type + + def visit_temp_node(self, e: TempNode) -> Type: + return e.type + + def visit_type_var_expr(self, e: TypeVarExpr) -> Type: + p_default = get_proper_type(e.default) + if not ( + isinstance(p_default, AnyType) + and p_default.type_of_any == TypeOfAny.from_omitted_generics + ): + if not is_subtype(p_default, e.upper_bound): + self.chk.fail("TypeVar default must be a subtype of the bound type", e) + if e.values and not any(is_same_type(p_default, value) for value in e.values): + self.chk.fail("TypeVar default must be one of the constraint types", e) + return AnyType(TypeOfAny.special_form) + + def visit_paramspec_expr(self, e: ParamSpecExpr) -> Type: + return AnyType(TypeOfAny.special_form) + + def visit_type_var_tuple_expr(self, e: TypeVarTupleExpr) -> Type: + return AnyType(TypeOfAny.special_form) + + def visit_newtype_expr(self, e: NewTypeExpr) -> Type: + return AnyType(TypeOfAny.special_form) + + def visit_namedtuple_expr(self, e: NamedTupleExpr) -> Type: + tuple_type = e.info.tuple_type + if tuple_type: + if self.chk.options.disallow_any_unimported and has_any_from_unimported_type( + tuple_type + ): + self.msg.unimported_type_becomes_any("NamedTuple type", tuple_type, e) + check_for_explicit_any( + tuple_type, self.chk.options, self.chk.is_typeshed_stub, self.msg, context=e + ) + return AnyType(TypeOfAny.special_form) + + def visit_enum_call_expr(self, e: EnumCallExpr) -> Type: + for name, value in zip(e.items, e.values): + if value is not None: + typ = self.accept(value) + if not isinstance(get_proper_type(typ), AnyType): + var = e.info.names[name].node + if isinstance(var, Var): + # Inline TypeChecker.set_inferred_type(), + # without the lvalue. (This doesn't really do + # much, since the value attribute is defined + # to have type Any in the typeshed stub.) + var.type = typ + var.is_inferred = True + return AnyType(TypeOfAny.special_form) + + def visit_typeddict_expr(self, e: TypedDictExpr) -> Type: + return AnyType(TypeOfAny.special_form) + + def visit__promote_expr(self, e: PromoteExpr) -> Type: + return e.type + + def visit_star_expr(self, e: StarExpr) -> Type: + # TODO: should this ever be called (see e.g. mypyc visitor)? + return self.accept(e.expr) + + def object_type(self) -> Instance: + """Return instance type 'object'.""" + return self.named_type("builtins.object") + + def bool_type(self) -> Instance: + """Return instance type 'bool'.""" + return self.named_type("builtins.bool") + + @overload + def narrow_type_from_binder(self, expr: Expression, known_type: Type) -> Type: ... + + @overload + def narrow_type_from_binder( + self, expr: Expression, known_type: Type, skip_non_overlapping: bool + ) -> Type | None: ... + + def narrow_type_from_binder( + self, expr: Expression, known_type: Type, skip_non_overlapping: bool = False + ) -> Type | None: + """Narrow down a known type of expression using information in conditional type binder. + + If 'skip_non_overlapping' is True, return None if the type and restriction are + non-overlapping. + """ + if literal(expr) >= LITERAL_TYPE: + restriction = self.chk.binder.get(expr) + # If the current node is deferred, some variables may get Any types that they + # otherwise wouldn't have. We don't want to narrow down these since it may + # produce invalid inferred Optional[Any] types, at least. + if restriction and not ( + isinstance(get_proper_type(known_type), AnyType) and self.chk.current_node_deferred + ): + # Note: this call should match the one in narrow_declared_type(). + if skip_non_overlapping and not is_overlapping_types(known_type, restriction): + return None + narrowed = narrow_declared_type(known_type, restriction) + if isinstance(get_proper_type(narrowed), UninhabitedType): + # If we hit this case, it means that we can't reliably mark the code as + # unreachable, but the resulting type can't be expressed in type system. + # Falling back to restriction is more intuitive in most cases. + return restriction + return narrowed + return known_type + + def has_abstract_type_part(self, caller_type: ProperType, callee_type: ProperType) -> bool: + # TODO: support other possible types here + if isinstance(caller_type, TupleType) and isinstance(callee_type, TupleType): + return any( + self.has_abstract_type(get_proper_type(caller), get_proper_type(callee)) + for caller, callee in zip(caller_type.items, callee_type.items) + ) + return self.has_abstract_type(caller_type, callee_type) + + def has_abstract_type(self, caller_type: ProperType, callee_type: ProperType) -> bool: + return ( + isinstance(caller_type, FunctionLike) + and isinstance(callee_type, TypeType) + and caller_type.is_type_obj() + and (caller_type.type_object().is_abstract or caller_type.type_object().is_protocol) + and isinstance(callee_type.item, Instance) + and (callee_type.item.type.is_abstract or callee_type.item.type.is_protocol) + and not self.chk.allow_abstract_call + ) + + def try_parse_as_type_expression(self, maybe_type_expr: Expression) -> Type | None: + """Try to parse a value Expression as a type expression. + If success then return the type that it spells. + If fails then return None. + + A value expression that is parsable as a type expression may be used + where a TypeForm is expected to represent the spelled type. + + Unlike SemanticAnalyzer.try_parse_as_type_expression() + (used in the earlier SemanticAnalyzer pass), this function can only + recognize type expressions which contain no string annotations.""" + if not isinstance(maybe_type_expr, MaybeTypeExpression): + return None + + # Check whether has already been parsed as a type expression + # by SemanticAnalyzer.try_parse_as_type_expression(), + # perhaps containing a string annotation + if ( + isinstance(maybe_type_expr, (StrExpr, IndexExpr, OpExpr)) + and maybe_type_expr.as_type != NotParsed.VALUE + ): + return maybe_type_expr.as_type + + # If is potentially a type expression containing a string annotation, + # don't try to parse it because there isn't enough information + # available to the TypeChecker pass to resolve string annotations + if has_str_expression(maybe_type_expr): + self.chk.fail( + "TypeForm containing a string annotation cannot be recognized here. " + "Surround with TypeForm(...) to recognize.", + maybe_type_expr, + code=codes.MAYBE_UNRECOGNIZED_STR_TYPEFORM, + ) + return None + + # Collect symbols targeted by NameExprs and MemberExprs, + # to be looked up by TypeAnalyser when binding the + # UnboundTypes corresponding to those expressions. + name_exprs, member_exprs = all_name_and_member_expressions(maybe_type_expr) + sym_for_name = {e.name: SymbolTableNode(UNBOUND_IMPORTED, e.node) for e in name_exprs} | { + e_name: SymbolTableNode(UNBOUND_IMPORTED, e.node) + for e in member_exprs + if (e_name := get_member_expr_fullname(e)) is not None + } + + chk_sem = mypy.checker.TypeCheckerAsSemanticAnalyzer(self.chk, sym_for_name) + tpan = TypeAnalyser( + chk_sem, + # NOTE: Will never need to lookup type vars in this scope because + # SemanticAnalyzer.try_parse_as_type_expression() will have + # already recognized any type var referenced in a NameExpr. + # String annotations (which may also reference type vars) + # can't be resolved in the TypeChecker pass anyway. + TypeVarLikeScope(), # empty scope + self.plugin, + self.chk.options, + self.chk.tree, + self.chk.is_typeshed_stub, + ) + + try: + typ1 = expr_to_unanalyzed_type( + maybe_type_expr, self.chk.options, self.chk.is_typeshed_stub + ) + typ2 = typ1.accept(tpan) + if chk_sem.did_fail: + return None + return typ2 + except TypeTranslationError: + return None + + +def has_any_type(t: Type, ignore_in_type_obj: bool = False) -> bool: + """Whether t contains an Any type""" + return t.accept(HasAnyType(ignore_in_type_obj)) + + +class HasAnyType(types.BoolTypeQuery): + def __init__(self, ignore_in_type_obj: bool) -> None: + super().__init__(types.ANY_STRATEGY) + self.ignore_in_type_obj = ignore_in_type_obj + + def visit_any(self, t: AnyType) -> bool: + return t.type_of_any != TypeOfAny.special_form # special forms are not real Any types + + def visit_callable_type(self, t: CallableType) -> bool: + if self.ignore_in_type_obj and t.is_type_obj(): + return False + return super().visit_callable_type(t) + + def visit_type_var(self, t: TypeVarType) -> bool: + default = [t.default] if t.has_default() else [] + return self.query_types([t.upper_bound, *default] + t.values) + + def visit_param_spec(self, t: ParamSpecType) -> bool: + default = [t.default] if t.has_default() else [] + return self.query_types([t.upper_bound, *default, t.prefix]) + + def visit_type_var_tuple(self, t: TypeVarTupleType) -> bool: + default = [t.default] if t.has_default() else [] + return self.query_types([t.upper_bound, *default]) + + +def has_coroutine_decorator(t: Type) -> bool: + """Whether t came from a function decorated with `@coroutine`.""" + t = get_proper_type(t) + return isinstance(t, Instance) and t.type.fullname == "typing.AwaitableGenerator" + + +def is_async_def(t: Type) -> bool: + """Whether t came from a function defined using `async def`.""" + # In check_func_def(), when we see a function decorated with + # `@typing.coroutine` or `@async.coroutine`, we change the + # return type to typing.AwaitableGenerator[...], so that its + # type is compatible with either Generator or Awaitable. + # But for the check here we need to know whether the original + # function (before decoration) was an `async def`. The + # AwaitableGenerator type conveniently preserves the original + # type as its 4th parameter (3rd when using 0-origin indexing + # :-), so that we can recover that information here. + # (We really need to see whether the original, undecorated + # function was an `async def`, which is orthogonal to its + # decorations.) + t = get_proper_type(t) + if ( + isinstance(t, Instance) + and t.type.fullname == "typing.AwaitableGenerator" + and len(t.args) >= 4 + ): + t = get_proper_type(t.args[3]) + return isinstance(t, Instance) and t.type.fullname == "typing.Coroutine" + + +def is_non_empty_tuple(t: Type) -> bool: + t = get_proper_type(t) + return isinstance(t, TupleType) and bool(t.items) + + +def is_duplicate_mapping( + mapping: list[int], actual_types: list[Type], actual_kinds: list[ArgKind] +) -> bool: + return ( + len(mapping) > 1 + # Multiple actuals can map to the same formal if they both come from + # varargs (*args and **kwargs); in this case at runtime it is possible + # that here are no duplicates. We need to allow this, as the convention + # f(..., *args, **kwargs) is common enough. + and not ( + len(mapping) == 2 + and actual_kinds[mapping[0]] == nodes.ARG_STAR + and actual_kinds[mapping[1]] == nodes.ARG_STAR2 + ) + # Multiple actuals can map to the same formal if there are multiple + # **kwargs which cannot be mapped with certainty (non-TypedDict + # **kwargs). + and not all( + actual_kinds[m] == nodes.ARG_STAR2 + and not isinstance(get_proper_type(actual_types[m]), TypedDictType) + for m in mapping + ) + ) + + +def replace_callable_return_type(c: CallableType, new_ret_type: Type) -> CallableType: + """Return a copy of a callable type with a different return type.""" + return c.copy_modified(ret_type=new_ret_type) + + +class ArgInferSecondPassQuery(types.BoolTypeQuery): + """Query whether an argument type should be inferred in the second pass. + + The result is True if the type has a type variable in a callable return + type anywhere. For example, the result for Callable[[], T] is True if t is + a type variable. + """ + + def __init__(self) -> None: + super().__init__(types.ANY_STRATEGY) + + def visit_callable_type(self, t: CallableType) -> bool: + # TODO: we need to check only for type variables of original callable. + return self.query_types(t.arg_types) or has_type_vars(t) + + +def has_erased_component(t: Type | None) -> bool: + return t is not None and t.accept(HasErasedComponentsQuery()) + + +class HasErasedComponentsQuery(types.BoolTypeQuery): + """Visitor for querying whether a type has an erased component.""" + + def __init__(self) -> None: + super().__init__(types.ANY_STRATEGY) + + def visit_erased_type(self, t: ErasedType) -> bool: + return True + + +def has_uninhabited_component(t: Type | None) -> bool: + return t is not None and t.accept(HasUninhabitedComponentsQuery()) + + +class HasUninhabitedComponentsQuery(types.BoolTypeQuery): + """Visitor for querying whether a type has an UninhabitedType component.""" + + def __init__(self) -> None: + super().__init__(types.ANY_STRATEGY) + + def visit_uninhabited_type(self, t: UninhabitedType) -> bool: + return True + + +def has_ambiguous_uninhabited_component(t: Type) -> bool: + return t.accept(HasAmbiguousUninhabitedComponentsQuery()) + + +class HasAmbiguousUninhabitedComponentsQuery(types.BoolTypeQuery): + """Visitor for querying whether a type has an ambiguous UninhabitedType component.""" + + def __init__(self) -> None: + super().__init__(types.ANY_STRATEGY) + + def visit_uninhabited_type(self, t: UninhabitedType) -> bool: + return t.ambiguous + + +def arg_approximate_similarity(actual: Type, formal: Type) -> bool: + """Return if caller argument (actual) is roughly compatible with signature arg (formal). + + This function is deliberately loose and will report two types are similar + as long as their "shapes" are plausibly the same. + + This is useful when we're doing error reporting: for example, if we're trying + to select an overload alternative and there's no exact match, we can use + this function to help us identify which alternative the user might have + *meant* to match. + """ + actual = get_proper_type(actual) + formal = get_proper_type(formal) + + # Erase typevars: we'll consider them all to have the same "shape". + if isinstance(actual, TypeVarType): + actual = erase_to_union_or_bound(actual) + if isinstance(formal, TypeVarType): + formal = erase_to_union_or_bound(formal) + + # Callable or Type[...]-ish types + def is_typetype_like(typ: ProperType) -> bool: + return ( + isinstance(typ, TypeType) + or (isinstance(typ, FunctionLike) and typ.is_type_obj()) + or (isinstance(typ, Instance) and typ.type.fullname == "builtins.type") + ) + + if isinstance(formal, CallableType): + if isinstance(actual, (CallableType, Overloaded, TypeType)): + return True + if is_typetype_like(actual) and is_typetype_like(formal): + return True + + # Unions + if isinstance(actual, UnionType): + return any(arg_approximate_similarity(item, formal) for item in actual.relevant_items()) + if isinstance(formal, UnionType): + return any(arg_approximate_similarity(actual, item) for item in formal.relevant_items()) + + # TypedDicts + if isinstance(actual, TypedDictType): + if isinstance(formal, TypedDictType): + return True + return arg_approximate_similarity(actual.fallback, formal) + + # Instances + # For instances, we mostly defer to the existing is_subtype check. + if isinstance(formal, Instance): + if isinstance(actual, CallableType): + actual = actual.fallback + if isinstance(actual, Overloaded): + actual = actual.items[0].fallback + if isinstance(actual, TupleType): + actual = tuple_fallback(actual) + if isinstance(actual, Instance) and formal.type in actual.type.mro: + # Try performing a quick check as an optimization + return True + + # Fall back to a standard subtype check for the remaining kinds of type. + return is_subtype(erasetype.erase_type(actual), erasetype.erase_type(formal)) + + +def any_causes_overload_ambiguity( + items: list[CallableType], + return_types: list[Type], + arg_types: list[Type], + arg_kinds: list[ArgKind], + arg_names: Sequence[str | None] | None, +) -> bool: + """May an argument containing 'Any' cause ambiguous result type on call to overloaded function? + + Note that this sometimes returns True even if there is no ambiguity, since a correct + implementation would be complex (and the call would be imprecisely typed due to Any + types anyway). + + Args: + items: Overload items matching the actual arguments + arg_types: Actual argument types + arg_kinds: Actual argument kinds + arg_names: Actual argument names + """ + if all_same_types(return_types): + return False + + actual_to_formal = [ + map_formals_to_actuals( + arg_kinds, arg_names, item.arg_kinds, item.arg_names, lambda i: arg_types[i] + ) + for item in items + ] + + for arg_idx, arg_type in enumerate(arg_types): + # We ignore Anys in type object callables as ambiguity + # creators, since that can lead to falsely claiming ambiguity + # for overloads between Type and Callable. + if has_any_type(arg_type, ignore_in_type_obj=True): + matching_formals_unfiltered = [ + (item_idx, lookup[arg_idx]) + for item_idx, lookup in enumerate(actual_to_formal) + if lookup[arg_idx] + ] + + matching_returns = [] + matching_formals = [] + for item_idx, formals in matching_formals_unfiltered: + matched_callable = items[item_idx] + matching_returns.append(matched_callable.ret_type) + + # Note: if an actual maps to multiple formals of differing types within + # a single callable, then we know at least one of those formals must be + # a different type then the formal(s) in some other callable. + # So it's safe to just append everything to the same list. + for formal in formals: + matching_formals.append(matched_callable.arg_types[formal]) + if not all_same_types(matching_formals) and not all_same_types(matching_returns): + # Any maps to multiple different types, and the return types of these items differ. + return True + return False + + +def all_same_types(types: list[Type]) -> bool: + if not types: + return True + return all(is_same_type(t, types[0]) for t in types[1:]) + + +def merge_typevars_in_callables_by_name( + callables: Sequence[CallableType], +) -> tuple[list[CallableType], list[TypeVarType]]: + """Takes all the typevars present in the callables and 'combines' the ones with the same name. + + For example, suppose we have two callables with signatures "f(x: T, y: S) -> T" and + "f(x: List[Tuple[T, S]]) -> Tuple[T, S]". Both callables use typevars named "T" and + "S", but we treat them as distinct, unrelated typevars. (E.g. they could both have + distinct ids.) + + If we pass in both callables into this function, it returns a list containing two + new callables that are identical in signature, but use the same underlying TypeVarType + for T and S. + + This is useful if we want to take the output lists and "merge" them into one callable + in some way -- for example, when unioning together overloads. + + Returns both the new list of callables and a list of all distinct TypeVarType objects used. + """ + output: list[CallableType] = [] + unique_typevars: dict[str, TypeVarType] = {} + variables: list[TypeVarType] = [] + + for target in callables: + if target.is_generic(): + target = freshen_function_type_vars(target) + + rename = {} # Dict[TypeVarId, TypeVar] + for tv in target.variables: + name = tv.fullname + if name not in unique_typevars: + # TODO: support ParamSpecType and TypeVarTuple. + if isinstance(tv, (ParamSpecType, TypeVarTupleType)): + continue + assert isinstance(tv, TypeVarType) + unique_typevars[name] = tv + variables.append(tv) + rename[tv.id] = unique_typevars[name] + + target = expand_type(target, rename) + output.append(target) + + return output, variables + + +def try_getting_literal(typ: Type) -> ProperType: + """If possible, get a more precise literal type for a given type.""" + typ = get_proper_type(typ) + if isinstance(typ, Instance) and typ.last_known_value is not None: + return typ.last_known_value + return typ + + +def is_expr_literal_type(node: Expression) -> bool: + """Returns 'true' if the given node is a Literal""" + if isinstance(node, IndexExpr): + base = node.base + return isinstance(base, RefExpr) and base.fullname in LITERAL_TYPE_NAMES + if isinstance(node, NameExpr): + underlying = node.node + return isinstance(underlying, TypeAlias) and isinstance( + get_proper_type(underlying.target), LiteralType + ) + return False + + +def has_bytes_component(typ: Type) -> bool: + """Is this one of builtin byte types, or a union that contains it?""" + typ = get_proper_type(typ) + byte_types = {"builtins.bytes", "builtins.bytearray"} + if isinstance(typ, UnionType): + return any(has_bytes_component(t) for t in typ.items) + if isinstance(typ, Instance) and typ.type.fullname in byte_types: + return True + return False + + +def type_info_from_type(typ: Type) -> TypeInfo | None: + """Gets the TypeInfo for a type, indirecting through things like type variables and tuples.""" + typ = get_proper_type(typ) + if isinstance(typ, FunctionLike) and typ.is_type_obj(): + return typ.type_object() + if isinstance(typ, TypeType): + typ = typ.item + if isinstance(typ, TypeVarType): + typ = get_proper_type(typ.upper_bound) + if isinstance(typ, TupleType): + typ = tuple_fallback(typ) + if isinstance(typ, Instance): + return typ.type + + # A complicated type. Too tricky, give up. + # TODO: Do something more clever here. + return None + + +def is_operator_method(fullname: str | None) -> bool: + if not fullname: + return False + short_name = fullname.split(".")[-1] + return ( + short_name in operators.op_methods.values() + or short_name in operators.reverse_op_methods.values() + or short_name in operators.unary_op_methods.values() + ) + + +def get_partial_instance_type(t: Type | None) -> PartialType | None: + if t is None or not isinstance(t, PartialType) or t.type is None: + return None + return t + + +def is_type_type_context(context: Type | None) -> bool: + context = get_proper_type(context) + if isinstance(context, TypeType): + return True + if isinstance(context, UnionType): + return any(is_type_type_context(item) for item in context.items) + return False diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checkmember.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checkmember.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..d2e412238b1ac5d63ebe67f3a60f8dba620f7e2a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checkmember.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checkmember.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checkmember.py new file mode 100644 index 0000000000000000000000000000000000000000..3359190092aff37284e254d2de7f71b7fbb02ec4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checkmember.py @@ -0,0 +1,1588 @@ +"""Type checking of attribute access""" + +from __future__ import annotations + +from collections.abc import Callable, Sequence +from typing import TypeVar, cast + +from mypy import message_registry, state +from mypy.checker_shared import TypeCheckerSharedApi +from mypy.erasetype import erase_typevars +from mypy.expandtype import ( + expand_self_type, + expand_type_by_instance, + freshen_all_functions_type_vars, +) +from mypy.maptype import map_instance_to_supertype +from mypy.meet import is_overlapping_types +from mypy.messages import MessageBuilder +from mypy.nodes import ( + ARG_POS, + ARG_STAR, + ARG_STAR2, + EXCLUDED_ENUM_ATTRIBUTES, + SYMBOL_FUNCBASE_TYPES, + Context, + Decorator, + Expression, + FuncBase, + FuncDef, + IndexExpr, + MypyFile, + NameExpr, + OverloadedFuncDef, + SymbolTable, + TempNode, + TypeAlias, + TypeInfo, + TypeVarLikeExpr, + Var, + is_final_node, +) +from mypy.plugin import AttributeContext +from mypy.subtypes import is_subtype +from mypy.typeops import ( + bind_self, + erase_to_bound, + freeze_all_type_vars, + function_type, + get_all_type_vars, + make_simplified_union, + supported_self_type, + tuple_fallback, +) +from mypy.types import ( + AnyType, + CallableType, + DeletedType, + FunctionLike, + Instance, + LiteralType, + NoneType, + Overloaded, + ParamSpecType, + PartialType, + ProperType, + TupleType, + Type, + TypedDictType, + TypeOfAny, + TypeType, + TypeVarLikeType, + TypeVarTupleType, + TypeVarType, + UninhabitedType, + UnionType, + get_proper_type, +) + + +class MemberContext: + """Information and objects needed to type check attribute access. + + Look at the docstring of analyze_member_access for more information. + """ + + def __init__( + self, + *, + is_lvalue: bool, + is_super: bool, + is_operator: bool, + original_type: Type, + context: Context, + chk: TypeCheckerSharedApi, + self_type: Type | None = None, + module_symbol_table: SymbolTable | None = None, + no_deferral: bool = False, + is_self: bool = False, + rvalue: Expression | None = None, + suppress_errors: bool = False, + preserve_type_var_ids: bool = False, + ) -> None: + self.is_lvalue = is_lvalue + self.is_super = is_super + self.is_operator = is_operator + self.original_type = original_type + self.self_type = self_type or original_type + self.context = context # Error context + self.chk = chk + self.msg = chk.msg + self.module_symbol_table = module_symbol_table + self.no_deferral = no_deferral + self.is_self = is_self + if rvalue is not None: + assert is_lvalue + self.rvalue = rvalue + self.suppress_errors = suppress_errors + # This attribute is only used to preserve old protocol member access logic. + # It is needed to avoid infinite recursion in cases involving self-referential + # generic methods, see find_member() for details. Do not use for other purposes! + self.preserve_type_var_ids = preserve_type_var_ids + + def named_type(self, name: str) -> Instance: + return self.chk.named_type(name) + + def not_ready_callback(self, name: str, context: Context) -> None: + self.chk.handle_cannot_determine_type(name, context) + + def fail(self, msg: str) -> None: + if not self.suppress_errors: + self.msg.fail(msg, self.context) + + def copy_modified( + self, + *, + self_type: Type | None = None, + is_lvalue: bool | None = None, + original_type: Type | None = None, + ) -> MemberContext: + mx = MemberContext( + is_lvalue=self.is_lvalue, + is_super=self.is_super, + is_operator=self.is_operator, + original_type=self.original_type, + context=self.context, + chk=self.chk, + self_type=self.self_type, + module_symbol_table=self.module_symbol_table, + no_deferral=self.no_deferral, + rvalue=self.rvalue, + suppress_errors=self.suppress_errors, + preserve_type_var_ids=self.preserve_type_var_ids, + ) + if self_type is not None: + mx.self_type = self_type + if is_lvalue is not None: + mx.is_lvalue = is_lvalue + if original_type is not None: + mx.original_type = original_type + return mx + + +def analyze_member_access( + name: str, + typ: Type, + context: Context, + *, + is_lvalue: bool, + is_super: bool, + is_operator: bool, + original_type: Type, + chk: TypeCheckerSharedApi, + override_info: TypeInfo | None = None, + in_literal_context: bool = False, + self_type: Type | None = None, + module_symbol_table: SymbolTable | None = None, + no_deferral: bool = False, + is_self: bool = False, + rvalue: Expression | None = None, + suppress_errors: bool = False, +) -> Type: + """Return the type of attribute 'name' of 'typ'. + + The actual implementation is in '_analyze_member_access' and this docstring + also applies to it. + + This is a general operation that supports various different variations: + + 1. lvalue or non-lvalue access (setter or getter access) + 2. supertype access when using super() (is_super == True and + 'override_info' should refer to the supertype) + + 'original_type' is the most precise inferred or declared type of the base object + that we have available. When looking for an attribute of 'typ', we may perform + recursive calls targeting the fallback type, and 'typ' may become some supertype + of 'original_type'. 'original_type' is always preserved as the 'typ' type used in + the initial, non-recursive call. The 'self_type' is a component of 'original_type' + to which generic self should be bound (a narrower type that has a fallback to instance). + Currently, this is used only for union types. + + 'module_symbol_table' is passed to this function if 'typ' is actually a module, + and we want to keep track of the available attributes of the module (since they + are not available via the type object directly) + + 'rvalue' can be provided optionally to infer better setter type when is_lvalue is True, + most notably this helps for descriptors with overloaded __set__() method. + + 'suppress_errors' will skip any logic that is only needed to generate error messages. + Note that this more of a performance optimization, one should not rely on this to not + show any messages, as some may be show e.g. by callbacks called here, + use msg.filter_errors(), if needed. + """ + mx = MemberContext( + is_lvalue=is_lvalue, + is_super=is_super, + is_operator=is_operator, + original_type=original_type, + context=context, + chk=chk, + self_type=self_type, + module_symbol_table=module_symbol_table, + no_deferral=no_deferral, + is_self=is_self, + rvalue=rvalue, + suppress_errors=suppress_errors, + ) + result = _analyze_member_access(name, typ, mx, override_info) + possible_literal = get_proper_type(result) + if ( + in_literal_context + and isinstance(possible_literal, Instance) + and possible_literal.last_known_value is not None + ): + return possible_literal.last_known_value + else: + return result + + +def _analyze_member_access( + name: str, typ: Type, mx: MemberContext, override_info: TypeInfo | None = None +) -> Type: + typ = get_proper_type(typ) + if isinstance(typ, Instance): + return analyze_instance_member_access(name, typ, mx, override_info) + elif isinstance(typ, AnyType): + # The base object has dynamic type. + return AnyType(TypeOfAny.from_another_any, source_any=typ) + elif isinstance(typ, UnionType): + return analyze_union_member_access(name, typ, mx) + elif isinstance(typ, FunctionLike) and typ.is_type_obj(): + return analyze_type_callable_member_access(name, typ, mx) + elif isinstance(typ, TypeType): + return analyze_type_type_member_access(name, typ, mx, override_info) + elif isinstance(typ, TupleType): + # Actually look up from the fallback instance type. + return _analyze_member_access(name, tuple_fallback(typ), mx, override_info) + elif isinstance(typ, (LiteralType, FunctionLike)): + # Actually look up from the fallback instance type. + return _analyze_member_access(name, typ.fallback, mx, override_info) + elif isinstance(typ, TypedDictType): + return analyze_typeddict_access(name, typ, mx, override_info) + elif isinstance(typ, NoneType): + return analyze_none_member_access(name, typ, mx) + elif isinstance(typ, TypeVarLikeType): + if isinstance(typ, TypeVarType) and typ.values: + return _analyze_member_access( + name, make_simplified_union(typ.values), mx, override_info + ) + return _analyze_member_access(name, typ.upper_bound, mx, override_info) + elif isinstance(typ, DeletedType): + if not mx.suppress_errors: + mx.msg.deleted_as_rvalue(typ, mx.context) + return AnyType(TypeOfAny.from_error) + elif isinstance(typ, UninhabitedType): + attr_type = UninhabitedType() + attr_type.ambiguous = typ.ambiguous + return attr_type + return report_missing_attribute(mx.original_type, typ, name, mx) + + +def may_be_awaitable_attribute( + name: str, typ: Type, mx: MemberContext, override_info: TypeInfo | None = None +) -> bool: + """Check if the given type has the attribute when awaited.""" + if mx.chk.checking_missing_await: + # Avoid infinite recursion. + return False + with mx.chk.checking_await_set(), mx.msg.filter_errors() as local_errors: + aw_type = mx.chk.get_precise_awaitable_type(typ, local_errors) + if aw_type is None: + return False + _ = _analyze_member_access( + name, aw_type, mx.copy_modified(self_type=aw_type), override_info + ) + return not local_errors.has_new_errors() + + +def report_missing_attribute( + original_type: Type, + typ: Type, + name: str, + mx: MemberContext, + override_info: TypeInfo | None = None, +) -> Type: + if mx.suppress_errors: + return AnyType(TypeOfAny.from_error) + error_code = mx.msg.has_no_attr(original_type, typ, name, mx.context, mx.module_symbol_table) + if not mx.msg.prefer_simple_messages(): + if may_be_awaitable_attribute(name, typ, mx, override_info): + mx.msg.possible_missing_await(mx.context, error_code) + return AnyType(TypeOfAny.from_error) + + +# The several functions that follow implement analyze_member_access for various +# types and aren't documented individually. + + +def analyze_instance_member_access( + name: str, typ: Instance, mx: MemberContext, override_info: TypeInfo | None +) -> Type: + info = typ.type + if override_info: + info = override_info + + method = info.get_method(name) + + if name == "__init__" and not mx.is_super and not info.is_final: + if not method or not method.is_final: + # Accessing __init__ in statically typed code would compromise + # type safety unless used via super() or the method/class is final. + mx.fail(message_registry.CANNOT_ACCESS_INIT) + return AnyType(TypeOfAny.from_error) + + # The base object has an instance type. + + if ( + state.find_occurrences + and info.name == state.find_occurrences[0] + and name == state.find_occurrences[1] + and not mx.suppress_errors + ): + mx.msg.note("Occurrence of '{}.{}'".format(*state.find_occurrences), mx.context) + + # Look up the member. First look up the method dictionary. + if method and not isinstance(method, Decorator): + if mx.is_super and not mx.suppress_errors: + validate_super_call(method, mx) + + if method.is_property: + assert isinstance(method, OverloadedFuncDef) + getter = method.items[0] + assert isinstance(getter, Decorator) + if mx.is_lvalue and getter.var.is_settable_property: + mx.chk.warn_deprecated(method.setter, mx.context) + return analyze_var(name, getter.var, typ, mx) + + if mx.is_lvalue and not mx.suppress_errors: + mx.msg.cant_assign_to_method(mx.context) + if not isinstance(method, OverloadedFuncDef): + signature = function_type(method, mx.named_type("builtins.function")) + else: + if method.type is None: + # Overloads may be not ready if they are decorated. Handle this in same + # manner as we would handle a regular decorated function: defer if possible. + if not mx.no_deferral and method.items: + mx.not_ready_callback(method.name, mx.context) + return AnyType(TypeOfAny.special_form) + assert isinstance(method.type, Overloaded) + signature = method.type + if not mx.preserve_type_var_ids: + signature = freshen_all_functions_type_vars(signature) + if not method.is_static: + if isinstance(method, (FuncDef, OverloadedFuncDef)) and method.is_trivial_self: + signature = bind_self_fast(signature, mx.self_type) + else: + signature = check_self_arg( + signature, mx.self_type, method.is_class, mx.context, name, mx.msg + ) + signature = bind_self(signature, mx.self_type, is_classmethod=method.is_class) + typ = map_instance_to_supertype(typ, method.info) + member_type = expand_type_by_instance(signature, typ) + freeze_all_type_vars(member_type) + return member_type + else: + # Not a method. + return analyze_member_var_access(name, typ, info, mx) + + +def validate_super_call(node: FuncBase, mx: MemberContext) -> None: + unsafe_super = False + if isinstance(node, FuncDef) and node.is_trivial_body: + unsafe_super = True + elif isinstance(node, OverloadedFuncDef): + if node.impl: + impl = node.impl if isinstance(node.impl, FuncDef) else node.impl.func + unsafe_super = impl.is_trivial_body + elif not node.is_property and node.items: + assert isinstance(node.items[0], Decorator) + unsafe_super = node.items[0].func.is_trivial_body + if unsafe_super: + mx.msg.unsafe_super(node.name, node.info.name, mx.context) + + +def analyze_type_callable_member_access(name: str, typ: FunctionLike, mx: MemberContext) -> Type: + # Class attribute. + # TODO super? + ret_type = typ.items[0].ret_type + assert isinstance(ret_type, ProperType) + if isinstance(ret_type, TupleType): + ret_type = tuple_fallback(ret_type) + if isinstance(ret_type, TypedDictType): + ret_type = ret_type.fallback + if isinstance(ret_type, LiteralType): + ret_type = ret_type.fallback + if isinstance(ret_type, Instance): + if not mx.is_operator: + # When Python sees an operator (eg `3 == 4`), it automatically translates that + # into something like `int.__eq__(3, 4)` instead of `(3).__eq__(4)` as an + # optimization. + # + # While it normally it doesn't matter which of the two versions are used, it + # does cause inconsistencies when working with classes. For example, translating + # `int == int` to `int.__eq__(int)` would not work since `int.__eq__` is meant to + # compare two int _instances_. What we really want is `type(int).__eq__`, which + # is meant to compare two types or classes. + # + # This check makes sure that when we encounter an operator, we skip looking up + # the corresponding method in the current instance to avoid this edge case. + # See https://github.com/python/mypy/pull/1787 for more info. + # TODO: do not rely on same type variables being present in all constructor overloads. + result = analyze_class_attribute_access( + ret_type, name, mx, original_vars=typ.items[0].variables, mcs_fallback=typ.fallback + ) + if result: + return result + # Look up from the 'type' type. + return _analyze_member_access(name, typ.fallback, mx) + else: + assert False, f"Unexpected type {ret_type!r}" + + +def analyze_type_type_member_access( + name: str, typ: TypeType, mx: MemberContext, override_info: TypeInfo | None +) -> Type: + # Similar to analyze_type_callable_attribute_access. + item = None + fallback = mx.named_type("builtins.type") + if isinstance(typ.item, Instance): + item = typ.item + elif isinstance(typ.item, AnyType): + with mx.msg.filter_errors(): + return _analyze_member_access(name, fallback, mx, override_info) + elif isinstance(typ.item, TypeVarType): + upper_bound = get_proper_type(typ.item.upper_bound) + if isinstance(upper_bound, Instance): + item = upper_bound + elif isinstance(upper_bound, UnionType): + return _analyze_member_access( + name, + TypeType.make_normalized(upper_bound, line=typ.line, column=typ.column), + mx, + override_info, + ) + elif isinstance(upper_bound, TupleType): + item = tuple_fallback(upper_bound) + elif isinstance(upper_bound, AnyType): + with mx.msg.filter_errors(): + return _analyze_member_access(name, fallback, mx, override_info) + elif isinstance(typ.item, TupleType): + item = tuple_fallback(typ.item) + elif isinstance(typ.item, FunctionLike) and typ.item.is_type_obj(): + item = typ.item.fallback + elif isinstance(typ.item, TypeType): + # Access member on metaclass object via Type[Type[C]] + if isinstance(typ.item.item, Instance): + item = typ.item.item.type.metaclass_type + ignore_messages = False + + if item is not None: + fallback = item.type.metaclass_type or fallback + + if item and not mx.is_operator: + # See comment above for why operators are skipped + result = analyze_class_attribute_access( + item, name, mx, mcs_fallback=fallback, override_info=override_info + ) + if result: + if not (isinstance(get_proper_type(result), AnyType) and item.type.fallback_to_any): + return result + else: + # We don't want errors on metaclass lookup for classes with Any fallback + ignore_messages = True + + with mx.msg.filter_errors(filter_errors=ignore_messages): + return _analyze_member_access(name, fallback, mx, override_info) + + +def analyze_union_member_access(name: str, typ: UnionType, mx: MemberContext) -> Type: + with mx.msg.disable_type_names(): + results = [] + for subtype in typ.relevant_items(): + # Self types should be bound to every individual item of a union. + item_mx = mx.copy_modified(self_type=subtype) + results.append(_analyze_member_access(name, subtype, item_mx)) + return make_simplified_union(results) + + +def analyze_none_member_access(name: str, typ: NoneType, mx: MemberContext) -> Type: + if name == "__bool__": + literal_false = LiteralType(False, fallback=mx.named_type("builtins.bool")) + return CallableType( + arg_types=[], + arg_kinds=[], + arg_names=[], + ret_type=literal_false, + fallback=mx.named_type("builtins.function"), + ) + else: + return _analyze_member_access(name, mx.named_type("builtins.object"), mx) + + +def analyze_member_var_access( + name: str, itype: Instance, info: TypeInfo, mx: MemberContext +) -> Type: + """Analyse attribute access that does not target a method. + + This is logically part of analyze_member_access and the arguments are similar. + + original_type is the type of E in the expression E.var + """ + # It was not a method. Try looking up a variable. + node = info.get(name) + v = node.node if node else None + + mx.chk.warn_deprecated(v, mx.context) + + vv = v + is_trivial_self = False + if isinstance(vv, Decorator): + # The associated Var node of a decorator contains the type. + v = vv.var + is_trivial_self = vv.func.is_trivial_self and not vv.decorators + if mx.is_super and not mx.suppress_errors: + validate_super_call(vv.func, mx) + if isinstance(v, FuncDef): + assert False, "Did not expect a function" + if isinstance(v, MypyFile): + # Special case: accessing module on instances is allowed, but will not + # be recorded by semantic analyzer. + mx.chk.module_refs.add(v.fullname) + + if isinstance(vv, (TypeInfo, TypeAlias, MypyFile, TypeVarLikeExpr)): + # If the associated variable is a TypeInfo synthesize a Var node for + # the purposes of type checking. This enables us to type check things + # like accessing class attributes on an inner class. Similar we allow + # using qualified type aliases in runtime context. For example: + # class C: + # A = List[int] + # x = C.A() <- this is OK + typ = mx.chk.expr_checker.analyze_static_reference(vv, mx.context, mx.is_lvalue) + v = Var(name, type=typ) + v.info = info + + if isinstance(v, Var): + implicit = info[name].implicit + + # An assignment to final attribute is always an error, + # independently of types. + if mx.is_lvalue and not mx.chk.get_final_context(): + check_final_member(name, info, mx.msg, mx.context) + + return analyze_var(name, v, itype, mx, implicit=implicit, is_trivial_self=is_trivial_self) + elif ( + not v + and name not in ["__getattr__", "__setattr__", "__getattribute__"] + and not mx.is_operator + and mx.module_symbol_table is None + ): + # Above we skip ModuleType.__getattr__ etc. if we have a + # module symbol table, since the symbol table allows precise + # checking. + if not mx.is_lvalue: + for method_name in ("__getattribute__", "__getattr__"): + method = info.get_method(method_name) + + # __getattribute__ is defined on builtins.object and returns Any, so without + # the guard this search will always find object.__getattribute__ and conclude + # that the attribute exists + if method and method.info.fullname != "builtins.object": + bound_method = analyze_decorator_or_funcbase_access( + defn=method, itype=itype, name=method_name, mx=mx + ) + typ = map_instance_to_supertype(itype, method.info) + getattr_type = get_proper_type(expand_type_by_instance(bound_method, typ)) + if isinstance(getattr_type, CallableType): + result = getattr_type.ret_type + else: + result = getattr_type + + # Call the attribute hook before returning. + fullname = f"{method.info.fullname}.{name}" + hook = mx.chk.plugin.get_attribute_hook(fullname) + if hook: + result = hook( + AttributeContext( + get_proper_type(mx.original_type), + result, + mx.is_lvalue, + mx.context, + mx.chk, + ) + ) + return result + else: + setattr_meth = info.get_method("__setattr__") + if setattr_meth and setattr_meth.info.fullname != "builtins.object": + bound_type = analyze_decorator_or_funcbase_access( + defn=setattr_meth, + itype=itype, + name="__setattr__", + mx=mx.copy_modified(is_lvalue=False), + ) + typ = map_instance_to_supertype(itype, setattr_meth.info) + setattr_type = get_proper_type(expand_type_by_instance(bound_type, typ)) + if isinstance(setattr_type, CallableType) and len(setattr_type.arg_types) > 0: + return setattr_type.arg_types[-1] + + if itype.type.fallback_to_any: + return AnyType(TypeOfAny.special_form) + + # Could not find the member. + if itype.extra_attrs and name in itype.extra_attrs.attrs: + # For modules use direct symbol table lookup. + if not itype.extra_attrs.mod_name: + return itype.extra_attrs.attrs[name] + + if mx.is_super and not mx.suppress_errors: + mx.msg.undefined_in_superclass(name, mx.context) + return AnyType(TypeOfAny.from_error) + else: + ret = report_missing_attribute(mx.original_type, itype, name, mx) + # Avoid paying double jeopardy if we can't find the member due to --no-implicit-reexport + if ( + mx.module_symbol_table is not None + and name in mx.module_symbol_table + and not mx.module_symbol_table[name].module_public + ): + v = mx.module_symbol_table[name].node + e = NameExpr(name) + e.set_line(mx.context) + e.node = v + return mx.chk.expr_checker.analyze_ref_expr(e, lvalue=mx.is_lvalue) + return ret + + +def check_final_member(name: str, info: TypeInfo, msg: MessageBuilder, ctx: Context) -> None: + """Give an error if the name being assigned was declared as final.""" + for base in info.mro: + sym = base.names.get(name) + if sym and is_final_node(sym.node): + msg.cant_assign_to_final(name, attr_assign=True, ctx=ctx) + + +def analyze_descriptor_access(descriptor_type: Type, mx: MemberContext) -> Type: + """Type check descriptor access. + + Arguments: + descriptor_type: The type of the descriptor attribute being accessed + (the type of ``f`` in ``a.f`` when ``f`` is a descriptor). + mx: The current member access context. + Return: + The return type of the appropriate ``__get__/__set__`` overload for the descriptor. + """ + instance_type = get_proper_type(mx.self_type) + orig_descriptor_type = descriptor_type + descriptor_type = get_proper_type(descriptor_type) + + if isinstance(descriptor_type, UnionType): + # Map the access over union types + return make_simplified_union( + [analyze_descriptor_access(typ, mx) for typ in descriptor_type.items] + ) + elif not isinstance(descriptor_type, Instance): + return orig_descriptor_type + + if not mx.is_lvalue and not descriptor_type.type.has_readable_member("__get__"): + return orig_descriptor_type + + # We do this check first to accommodate for descriptors with only __set__ method. + # If there is no __set__, we type-check that the assigned value matches + # the return type of __get__. This doesn't match the python semantics, + # (which allow you to override the descriptor with any value), but preserves + # the type of accessing the attribute (even after the override). + if mx.is_lvalue and descriptor_type.type.has_readable_member("__set__"): + return analyze_descriptor_assign(descriptor_type, mx) + + if mx.is_lvalue and not descriptor_type.type.has_readable_member("__get__"): + # This turned out to be not a descriptor after all. + return orig_descriptor_type + + dunder_get = descriptor_type.type.get_method("__get__") + if dunder_get is None: + mx.fail( + message_registry.DESCRIPTOR_GET_NOT_CALLABLE.format( + descriptor_type.str_with_options(mx.msg.options) + ) + ) + return AnyType(TypeOfAny.from_error) + + bound_method = analyze_decorator_or_funcbase_access( + defn=dunder_get, + itype=descriptor_type, + name="__get__", + mx=mx.copy_modified(self_type=descriptor_type), + ) + + typ = map_instance_to_supertype(descriptor_type, dunder_get.info) + dunder_get_type = expand_type_by_instance(bound_method, typ) + + if isinstance(instance_type, FunctionLike) and instance_type.is_type_obj(): + owner_type = instance_type.items[0].ret_type + instance_type = NoneType() + elif isinstance(instance_type, TypeType): + owner_type = instance_type.item + instance_type = NoneType() + else: + owner_type = instance_type + + callable_name = mx.chk.expr_checker.method_fullname(descriptor_type, "__get__") + dunder_get_type = mx.chk.expr_checker.transform_callee_type( + callable_name, + dunder_get_type, + [ + TempNode(instance_type, context=mx.context), + TempNode(TypeType.make_normalized(owner_type), context=mx.context), + ], + [ARG_POS, ARG_POS], + mx.context, + object_type=descriptor_type, + ) + + _, inferred_dunder_get_type = mx.chk.expr_checker.check_call( + dunder_get_type, + [ + TempNode(instance_type, context=mx.context), + TempNode(TypeType.make_normalized(owner_type), context=mx.context), + ], + [ARG_POS, ARG_POS], + mx.context, + object_type=descriptor_type, + callable_name=callable_name, + ) + + # Search for possible deprecations: + mx.chk.warn_deprecated(dunder_get, mx.context) + + inferred_dunder_get_type = get_proper_type(inferred_dunder_get_type) + if isinstance(inferred_dunder_get_type, AnyType): + # check_call failed, and will have reported an error + return inferred_dunder_get_type + + if not isinstance(inferred_dunder_get_type, CallableType): + mx.fail( + message_registry.DESCRIPTOR_GET_NOT_CALLABLE.format( + descriptor_type.str_with_options(mx.msg.options) + ) + ) + return AnyType(TypeOfAny.from_error) + + return inferred_dunder_get_type.ret_type + + +def analyze_descriptor_assign(descriptor_type: Instance, mx: MemberContext) -> Type: + instance_type = get_proper_type(mx.self_type) + dunder_set = descriptor_type.type.get_method("__set__") + if dunder_set is None: + mx.fail( + message_registry.DESCRIPTOR_SET_NOT_CALLABLE.format( + descriptor_type.str_with_options(mx.msg.options) + ).value + ) + return AnyType(TypeOfAny.from_error) + + bound_method = analyze_decorator_or_funcbase_access( + defn=dunder_set, + itype=descriptor_type, + name="__set__", + mx=mx.copy_modified(is_lvalue=False, self_type=descriptor_type), + ) + typ = map_instance_to_supertype(descriptor_type, dunder_set.info) + dunder_set_type = expand_type_by_instance(bound_method, typ) + + callable_name = mx.chk.expr_checker.method_fullname(descriptor_type, "__set__") + rvalue = mx.rvalue or TempNode(AnyType(TypeOfAny.special_form), context=mx.context) + dunder_set_type = mx.chk.expr_checker.transform_callee_type( + callable_name, + dunder_set_type, + [TempNode(instance_type, context=mx.context), rvalue], + [ARG_POS, ARG_POS], + mx.context, + object_type=descriptor_type, + ) + + # For non-overloaded setters, the result should be type-checked like a regular assignment. + # Hence, we first only try to infer the type by using the rvalue as type context. + type_context = rvalue + with mx.msg.filter_errors(): + _, inferred_dunder_set_type = mx.chk.expr_checker.check_call( + dunder_set_type, + [TempNode(instance_type, context=mx.context), type_context], + [ARG_POS, ARG_POS], + mx.context, + object_type=descriptor_type, + callable_name=callable_name, + ) + + # And now we in fact type check the call, to show errors related to wrong arguments + # count, etc., replacing the type context for non-overloaded setters only. + inferred_dunder_set_type = get_proper_type(inferred_dunder_set_type) + if isinstance(inferred_dunder_set_type, CallableType): + type_context = TempNode(AnyType(TypeOfAny.special_form), context=mx.context) + mx.chk.expr_checker.check_call( + dunder_set_type, + [TempNode(instance_type, context=mx.context), type_context], + [ARG_POS, ARG_POS], + mx.context, + object_type=descriptor_type, + callable_name=callable_name, + ) + + # Search for possible deprecations: + mx.chk.warn_deprecated(dunder_set, mx.context) + + # In the following cases, a message already will have been recorded in check_call. + if (not isinstance(inferred_dunder_set_type, CallableType)) or ( + len(inferred_dunder_set_type.arg_types) < 2 + ): + return AnyType(TypeOfAny.from_error) + return inferred_dunder_set_type.arg_types[1] + + +def is_instance_var(var: Var) -> bool: + """Return if var is an instance variable according to PEP 526.""" + return ( + # check the type_info node is the var (not a decorated function, etc.) + var.name in var.info.names + and var.info.names[var.name].node is var + and not var.is_classvar + # variables without annotations are treated as classvar + and not var.is_inferred + ) + + +def analyze_var( + name: str, + var: Var, + itype: Instance, + mx: MemberContext, + *, + implicit: bool = False, + is_trivial_self: bool = False, +) -> Type: + """Analyze access to an attribute via a Var node. + + This is conceptually part of analyze_member_access and the arguments are similar. + itype is the instance type in which attribute should be looked up + original_type is the type of E in the expression E.var + if implicit is True, the original Var was created as an assignment to self + if is_trivial_self is True, we can use fast path for bind_self(). + """ + # Found a member variable. + original_itype = itype + itype = map_instance_to_supertype(itype, var.info) + if var.is_settable_property and mx.is_lvalue: + typ: Type | None = var.setter_type + if typ is None and var.is_ready: + # Existing synthetic properties may not set setter type. Fall back to getter. + typ = var.type + else: + typ = var.type + if typ: + if isinstance(typ, PartialType): + return mx.chk.handle_partial_var_type(typ, mx.is_lvalue, var, mx.context) + if mx.is_lvalue and not mx.suppress_errors: + if var.is_property and not var.is_settable_property: + mx.msg.read_only_property(name, itype.type, mx.context) + if var.is_classvar: + mx.msg.cant_assign_to_classvar(name, mx.context) + # This is the most common case for variables, so start with this. + result = expand_without_binding(typ, var, itype, original_itype, mx) + + # A non-None value indicates that we should actually bind self for this variable. + call_type: ProperType | None = None + if var.is_initialized_in_class and (not is_instance_var(var) or mx.is_operator): + typ = get_proper_type(typ) + if isinstance(typ, FunctionLike) and not typ.is_type_obj(): + call_type = typ + elif var.is_property: + deco_mx = mx.copy_modified(original_type=typ, self_type=typ, is_lvalue=False) + call_type = get_proper_type(_analyze_member_access("__call__", typ, deco_mx)) + else: + call_type = typ + + # Bound variables with callable types are treated like methods + # (these are usually method aliases like __rmul__ = __mul__). + if isinstance(call_type, FunctionLike) and not call_type.is_type_obj(): + if mx.is_lvalue and not var.is_property and not mx.suppress_errors: + mx.msg.cant_assign_to_method(mx.context) + + # Bind the self type for each callable component (when needed). + if call_type and not var.is_staticmethod: + bound_items = [] + for ct in call_type.items if isinstance(call_type, UnionType) else [call_type]: + p_ct = get_proper_type(ct) + if isinstance(p_ct, FunctionLike) and (not p_ct.bound() or var.is_property): + item = expand_and_bind_callable(p_ct, var, itype, name, mx, is_trivial_self) + else: + item = expand_without_binding(ct, var, itype, original_itype, mx) + bound_items.append(item) + result = UnionType.make_union(bound_items) + else: + if not var.is_ready and not mx.no_deferral: + mx.not_ready_callback(var.name, mx.context) + # Implicit 'Any' type. + result = AnyType(TypeOfAny.special_form) + fullname = f"{var.info.fullname}.{name}" + hook = mx.chk.plugin.get_attribute_hook(fullname) + + if var.info.is_enum and not mx.is_lvalue: + if name in var.info.enum_members and name not in {"name", "value"}: + enum_literal = LiteralType(name, fallback=itype) + result = itype.copy_modified(last_known_value=enum_literal) + elif ( + isinstance(p_result := get_proper_type(result), Instance) + and p_result.type.fullname == "enum.nonmember" + and p_result.args + ): + # Unwrap nonmember similar to class-level access + result = p_result.args[0] + if result and not (implicit or var.info.is_protocol and is_instance_var(var)): + result = analyze_descriptor_access(result, mx) + if hook: + result = hook( + AttributeContext( + get_proper_type(mx.original_type), result, mx.is_lvalue, mx.context, mx.chk + ) + ) + return result + + +def expand_without_binding( + typ: Type, var: Var, itype: Instance, original_itype: Instance, mx: MemberContext +) -> Type: + if not mx.preserve_type_var_ids: + typ = freshen_all_functions_type_vars(typ) + typ = expand_self_type_if_needed(typ, mx, var, original_itype) + expanded = expand_type_by_instance(typ, itype) + freeze_all_type_vars(expanded) + return expanded + + +def expand_and_bind_callable( + functype: FunctionLike, + var: Var, + itype: Instance, + name: str, + mx: MemberContext, + is_trivial_self: bool, +) -> Type: + if not mx.preserve_type_var_ids: + functype = freshen_all_functions_type_vars(functype) + typ = get_proper_type(expand_self_type(var, functype, mx.self_type)) + assert isinstance(typ, FunctionLike) + if is_trivial_self: + typ = bind_self_fast(typ, mx.self_type) + else: + typ = check_self_arg(typ, mx.self_type, var.is_classmethod, mx.context, name, mx.msg) + typ = bind_self(typ, mx.self_type, var.is_classmethod) + expanded = expand_type_by_instance(typ, itype) + freeze_all_type_vars(expanded) + if not var.is_property: + return expanded + if isinstance(expanded, Overloaded): + # Legacy way to store settable properties is with overloads. Also in case it is + # an actual overloaded property, selecting first item that passed check_self_arg() + # is a good approximation, long-term we should use check_call() inference below. + if not expanded.items: + # A broken overload, error should be already reported. + return AnyType(TypeOfAny.from_error) + expanded = expanded.items[0] + assert isinstance(expanded, CallableType), expanded + if var.is_settable_property and mx.is_lvalue and var.setter_type is not None: + if expanded.variables: + type_ctx = mx.rvalue or TempNode(AnyType(TypeOfAny.special_form), context=mx.context) + _, inferred_expanded = mx.chk.expr_checker.check_call( + expanded, [type_ctx], [ARG_POS], mx.context + ) + expanded = get_proper_type(inferred_expanded) + assert isinstance(expanded, CallableType) + if not expanded.arg_types: + # This can happen when accessing invalid property from its own body, + # error will be reported elsewhere. + return AnyType(TypeOfAny.from_error) + return expanded.arg_types[0] + else: + return expanded.ret_type + + +def expand_self_type_if_needed( + t: Type, mx: MemberContext, var: Var, itype: Instance, is_class: bool = False +) -> Type: + """Expand special Self type in a backwards compatible manner. + + This should ensure that mixing old-style and new-style self-types work + seamlessly. Also, re-bind new style self-types in subclasses if needed. + """ + original = get_proper_type(mx.self_type) + if not (mx.is_self or mx.is_super): + repl = mx.self_type + if is_class: + if isinstance(original, TypeType): + repl = original.item + elif isinstance(original, CallableType): + # Problematic access errors should have been already reported. + repl = erase_typevars(original.ret_type) + else: + repl = itype + return expand_self_type(var, t, repl) + elif supported_self_type( + # Support compatibility with plain old style T -> T and Type[T] -> T only. + get_proper_type(mx.self_type), + allow_instances=False, + allow_callable=False, + ): + repl = mx.self_type + if is_class and isinstance(original, TypeType): + repl = original.item + return expand_self_type(var, t, repl) + elif ( + mx.is_self + and itype.type != var.info + # If an attribute with Self-type was defined in a supertype, we need to + # rebind the Self type variable to Self type variable of current class... + and itype.type.self_type is not None + # ...unless `self` has an explicit non-trivial annotation. + and itype == mx.chk.scope.active_self_type() + ): + return expand_self_type(var, t, itype.type.self_type) + else: + return t + + +def check_self_arg( + functype: FunctionLike, + dispatched_arg_type: Type, + is_classmethod: bool, + context: Context, + name: str, + msg: MessageBuilder, +) -> FunctionLike: + """Check that an instance has a valid type for a method with annotated 'self'. + + For example if the method is defined as: + class A: + def f(self: S) -> T: ... + then for 'x.f' we check that type(x) <: S. If the method is overloaded, we select + only overloads items that satisfy this requirement. If there are no matching + overloads, an error is generated. + """ + items = functype.items + if not items: + return functype + new_items = [] + if is_classmethod: + dispatched_arg_type = TypeType.make_normalized(dispatched_arg_type) + p_dispatched_arg_type = get_proper_type(dispatched_arg_type) + + for item in items: + if not item.arg_types or item.arg_kinds[0] not in (ARG_POS, ARG_STAR): + # No positional first (self) argument (*args is okay). + msg.no_formal_self(name, item, context) + # This is pretty bad, so just return the original signature if + # there is at least one such error. + return functype + selfarg = get_proper_type(item.arg_types[0]) + if isinstance(selfarg, Instance) and isinstance(p_dispatched_arg_type, Instance): + if selfarg.type is p_dispatched_arg_type.type and selfarg.args: + if not is_overlapping_types(p_dispatched_arg_type, selfarg): + # This special casing is needed since `actual <: erased(template)` + # logic below doesn't always work, and a more correct approach may + # be tricky. + continue + new_items.append(item) + + if new_items: + items = new_items + new_items = [] + + for item in items: + selfarg = get_proper_type(item.arg_types[0]) + # This matches similar special-casing in bind_self(), see more details there. + self_callable = name == "__call__" and isinstance(selfarg, CallableType) + if self_callable or is_subtype( + dispatched_arg_type, + # This level of erasure matches the one in checker.check_func_def(), + # better keep these two checks consistent. + erase_typevars(erase_to_bound(selfarg)), + # This is to work around the fact that erased ParamSpec and TypeVarTuple + # callables are not always compatible with non-erased ones both ways. + always_covariant=any( + not isinstance(tv, TypeVarType) for tv in get_all_type_vars(selfarg) + ), + ignore_pos_arg_names=True, + ): + new_items.append(item) + elif isinstance(selfarg, ParamSpecType): + # TODO: This is not always right. What's the most reasonable thing to do here? + new_items.append(item) + elif isinstance(selfarg, TypeVarTupleType): + raise NotImplementedError + if not new_items: + # Choose first item for the message (it may be not very helpful for overloads). + msg.incompatible_self_argument( + name, dispatched_arg_type, items[0], is_classmethod, context + ) + return functype + if len(new_items) == 1: + return new_items[0] + return Overloaded(new_items) + + +def analyze_class_attribute_access( + itype: Instance, + name: str, + mx: MemberContext, + *, + mcs_fallback: Instance, + override_info: TypeInfo | None = None, + original_vars: Sequence[TypeVarLikeType] | None = None, +) -> Type | None: + """Analyze access to an attribute on a class object. + + itype is the return type of the class object callable, original_type is the type + of E in the expression E.var, original_vars are type variables of the class callable + (for generic classes). + """ + info = itype.type + if override_info: + info = override_info + + fullname = f"{info.fullname}.{name}" + hook = mx.chk.plugin.get_class_attribute_hook(fullname) + + node = info.get(name) + if not node: + if itype.extra_attrs and name in itype.extra_attrs.attrs: + # For modules use direct symbol table lookup. + if not itype.extra_attrs.mod_name: + return itype.extra_attrs.attrs[name] + if info.fallback_to_any or info.meta_fallback_to_any: + return apply_class_attr_hook(mx, hook, AnyType(TypeOfAny.special_form)) + return None + + if ( + isinstance(node.node, Var) + and not node.node.is_classvar + and not hook + and mcs_fallback.type.get(name) + ): + # If the same attribute is declared on the metaclass and the class but with different types, + # and the attribute on the class is not a ClassVar, + # the type of the attribute on the metaclass should take priority + # over the type of the attribute on the class, + # when the attribute is being accessed from the class object itself. + # + # Return `None` here to signify that the name should be looked up + # on the class object itself rather than the instance. + return None + + mx.chk.warn_deprecated(node.node, mx.context) + + is_decorated = isinstance(node.node, Decorator) + is_method = is_decorated or isinstance(node.node, FuncBase) + if mx.is_lvalue and not mx.suppress_errors: + if is_method: + mx.msg.cant_assign_to_method(mx.context) + if isinstance(node.node, TypeInfo): + mx.fail(message_registry.CANNOT_ASSIGN_TO_TYPE) + + # Refuse class attribute access if slot defined + if info.slots and name in info.slots: + mx.fail(message_registry.CLASS_VAR_CONFLICTS_SLOTS.format(name)) + + if node.implicit and isinstance(node.node, Var): + if node.node.is_final: + # If a final attribute was declared on `self` in `__init__`, then it + # can't be accessed on the class object. + mx.fail(message_registry.CANNOT_ACCESS_FINAL_INSTANCE_ATTR.format(node.node.name)) + elif not mx.is_lvalue and not defined_in_superclass(info, name): + mx.fail(message_registry.CANNOT_ACCESS_INSTANCE_ONLY_ATTR.format(node.node.name)) + + # An assignment to final attribute on class object is also always an error, + # independently of types. + if mx.is_lvalue and not mx.chk.get_final_context(): + check_final_member(name, info, mx.msg, mx.context) + + if info.is_enum and not (mx.is_lvalue or is_decorated or is_method): + enum_class_attribute_type = analyze_enum_class_attribute_access(itype, name, mx) + if enum_class_attribute_type: + return apply_class_attr_hook(mx, hook, enum_class_attribute_type) + + t = node.type + if t: + if isinstance(t, PartialType): + symnode = node.node + assert isinstance(symnode, Var) + return apply_class_attr_hook( + mx, hook, mx.chk.handle_partial_var_type(t, mx.is_lvalue, symnode, mx.context) + ) + + # Find the class where method/variable was defined. + if isinstance(node.node, Decorator): + super_info: TypeInfo | None = node.node.var.info + elif isinstance(node.node, (Var, SYMBOL_FUNCBASE_TYPES)): + super_info = node.node.info + else: + super_info = None + + # Map the type to how it would look as a defining class. For example: + # class C(Generic[T]): ... + # class D(C[Tuple[T, S]]): ... + # D[int, str].method() + # Here itype is D[int, str], isuper is C[Tuple[int, str]]. + if not super_info: + isuper = None + else: + isuper = map_instance_to_supertype(itype, super_info) + + if isinstance(node.node, Var): + assert isuper is not None + object_type = get_proper_type(mx.self_type) + # Check if original variable type has type variables. For example: + # class C(Generic[T]): + # x: T + # C.x # Error, ambiguous access + # C[int].x # Also an error, since C[int] is same as C at runtime + # Exception is Self type wrapped in ClassVar, that is safe. + prohibit_self = not node.node.is_classvar + def_vars = set(node.node.info.defn.type_vars) + if prohibit_self and node.node.info.self_type: + def_vars.add(node.node.info.self_type) + # Exception: access on Type[...], including first argument of class methods is OK. + prohibit_generic = not isinstance(object_type, TypeType) or node.implicit + if prohibit_generic and def_vars & set(get_all_type_vars(t)): + if node.node.is_classvar: + message = message_registry.GENERIC_CLASS_VAR_ACCESS + else: + message = message_registry.GENERIC_INSTANCE_VAR_CLASS_ACCESS + mx.fail(message) + t = expand_self_type_if_needed(t, mx, node.node, itype, is_class=True) + t = expand_type_by_instance(t, isuper) + # Erase non-mapped variables, but keep mapped ones, even if there is an error. + # In the above example this means that we infer following types: + # C.x -> Any + # C[int].x -> int + if prohibit_generic: + erase_vars = set(itype.type.defn.type_vars) + if prohibit_self and itype.type.self_type: + erase_vars.add(itype.type.self_type) + t = erase_typevars(t, {tv.id for tv in erase_vars}) + + is_classmethod = ( + (is_decorated and cast(Decorator, node.node).func.is_class) + or (isinstance(node.node, SYMBOL_FUNCBASE_TYPES) and node.node.is_class) + or isinstance(node.node, Var) + and node.node.is_classmethod + ) + t = get_proper_type(t) + is_trivial_self = False + if isinstance(node.node, Decorator): + # Use fast path if there are trivial decorators like @classmethod or @property + is_trivial_self = node.node.func.is_trivial_self and not node.node.decorators + elif isinstance(node.node, (FuncDef, OverloadedFuncDef)): + is_trivial_self = node.node.is_trivial_self + if ( + isinstance(t, FunctionLike) + and is_classmethod + and not is_trivial_self + and not t.bound() + ): + t = check_self_arg(t, mx.self_type, False, mx.context, name, mx.msg) + t = add_class_tvars( + t, + isuper, + is_classmethod, + mx, + original_vars=original_vars, + is_trivial_self=is_trivial_self, + ) + if is_decorated: + t = expand_self_type_if_needed( + t, mx, cast(Decorator, node.node).var, itype, is_class=is_classmethod + ) + + result = t + # __set__ is not called on class objects. + if not mx.is_lvalue: + result = analyze_descriptor_access(result, mx) + + return apply_class_attr_hook(mx, hook, result) + elif isinstance(node.node, Var): + mx.not_ready_callback(name, mx.context) + return AnyType(TypeOfAny.special_form) + + if isinstance(node.node, (TypeInfo, TypeAlias, MypyFile, TypeVarLikeExpr)): + # TODO: should we apply class plugin here (similar to instance access)? + return mx.chk.expr_checker.analyze_static_reference(node.node, mx.context, mx.is_lvalue) + + if is_decorated: + assert isinstance(node.node, Decorator) + if node.node.type: + return apply_class_attr_hook(mx, hook, node.node.type) + else: + mx.not_ready_callback(name, mx.context) + return AnyType(TypeOfAny.from_error) + else: + assert isinstance(node.node, SYMBOL_FUNCBASE_TYPES) + typ = function_type(node.node, mx.named_type("builtins.function")) + # Note: if we are accessing class method on class object, the cls argument is bound. + # Annotated and/or explicit class methods go through other code paths above, for + # unannotated implicit class methods we do this here. + if node.node.is_class: + typ = bind_self_fast(typ) + return apply_class_attr_hook(mx, hook, typ) + + +def apply_class_attr_hook( + mx: MemberContext, hook: Callable[[AttributeContext], Type] | None, result: Type +) -> Type | None: + if hook: + result = hook( + AttributeContext( + get_proper_type(mx.original_type), result, mx.is_lvalue, mx.context, mx.chk + ) + ) + return result + + +def analyze_enum_class_attribute_access( + itype: Instance, name: str, mx: MemberContext +) -> Type | None: + # Skip these since Enum will remove it + if name in EXCLUDED_ENUM_ATTRIBUTES: + return report_missing_attribute(mx.original_type, itype, name, mx) + + node = itype.type.get(name) + if node and node.type: + proper = get_proper_type(node.type) + # Support `A = nonmember(1)` function call and decorator. + if ( + isinstance(proper, Instance) + and proper.type.fullname == "enum.nonmember" + and proper.args + ): + return proper.args[0] + + if name not in itype.type.enum_members: + return None + + enum_literal = LiteralType(name, fallback=itype) + return itype.copy_modified(last_known_value=enum_literal) + + +def analyze_typeddict_access( + name: str, typ: TypedDictType, mx: MemberContext, override_info: TypeInfo | None +) -> Type: + if name == "__setitem__": + if isinstance(mx.context, IndexExpr): + # Since we can get this during `a['key'] = ...` + # it is safe to assume that the context is `IndexExpr`. + item_type, key_names = mx.chk.expr_checker.visit_typeddict_index_expr( + typ, mx.context.index, setitem=True + ) + assigned_readonly_keys = typ.readonly_keys & key_names + if assigned_readonly_keys and not mx.suppress_errors: + mx.msg.readonly_keys_mutated(assigned_readonly_keys, context=mx.context) + else: + # It can also be `a.__setitem__(...)` direct call. + # In this case `item_type` can be `Any`, + # because we don't have args available yet. + # TODO: check in `default` plugin that `__setitem__` is correct. + item_type = AnyType(TypeOfAny.implementation_artifact) + return CallableType( + arg_types=[mx.chk.named_type("builtins.str"), item_type], + arg_kinds=[ARG_POS, ARG_POS], + arg_names=[None, None], + ret_type=NoneType(), + fallback=mx.chk.named_type("builtins.function"), + name=name, + ) + elif name == "__delitem__": + return CallableType( + arg_types=[mx.chk.named_type("builtins.str")], + arg_kinds=[ARG_POS], + arg_names=[None], + ret_type=NoneType(), + fallback=mx.chk.named_type("builtins.function"), + name=name, + ) + return _analyze_member_access(name, typ.fallback, mx, override_info) + + +def add_class_tvars( + t: ProperType, + isuper: Instance | None, + is_classmethod: bool, + mx: MemberContext, + original_vars: Sequence[TypeVarLikeType] | None = None, + is_trivial_self: bool = False, +) -> Type: + """Instantiate type variables during analyze_class_attribute_access, + e.g T and Q in the following: + + class A(Generic[T]): + @classmethod + def foo(cls: Type[Q]) -> Tuple[T, Q]: ... + + class B(A[str]): pass + B.foo() + + Args: + t: Declared type of the method (or property) + isuper: Current instance mapped to the superclass where method was defined, this + is usually done by map_instance_to_supertype() + is_classmethod: True if this method is decorated with @classmethod + original_vars: Type variables of the class callable on which the method was accessed + is_trivial_self: if True, we can use fast path for bind_self(). + Returns: + Expanded method type with added type variables (when needed). + """ + # TODO: verify consistency between Q and T + + # We add class type variables if the class method is accessed on class object + # without applied type arguments, this matches the behavior of __init__(). + # For example (continuing the example in docstring): + # A # The type of callable is def [T] () -> A[T], _not_ def () -> A[Any] + # A[int] # The type of callable is def () -> A[int] + # and + # A.foo # The type is generic def [T] () -> Tuple[T, A[T]] + # A[int].foo # The type is non-generic def () -> Tuple[int, A[int]] + # + # This behaviour is useful for defining alternative constructors for generic classes. + # To achieve such behaviour, we add the class type variables that are still free + # (i.e. appear in the return type of the class object on which the method was accessed). + if isinstance(t, CallableType): + tvars = original_vars if original_vars is not None else [] + if not mx.preserve_type_var_ids: + t = freshen_all_functions_type_vars(t) + if is_classmethod and not t.is_bound: + if is_trivial_self: + t = bind_self_fast(t, mx.self_type) + else: + t = bind_self(t, mx.self_type, is_classmethod=True) + if isuper is not None: + t = expand_type_by_instance(t, isuper) + freeze_all_type_vars(t) + return t.copy_modified(variables=list(tvars) + list(t.variables)) + elif isinstance(t, Overloaded): + return Overloaded( + [ + cast( + CallableType, + add_class_tvars(item, isuper, is_classmethod, mx, original_vars=original_vars), + ) + for item in t.items + ] + ) + if isuper is not None: + t = expand_type_by_instance(t, isuper) + return t + + +def analyze_decorator_or_funcbase_access( + defn: Decorator | FuncBase, itype: Instance, name: str, mx: MemberContext +) -> Type: + """Analyzes the type behind method access. + + The function itself can possibly be decorated. + See: https://github.com/python/mypy/issues/10409 + """ + if isinstance(defn, Decorator): + return analyze_var(name, defn.var, itype, mx) + typ = function_type(defn, mx.chk.named_type("builtins.function")) + if isinstance(defn, (FuncDef, OverloadedFuncDef)) and defn.is_trivial_self: + return bind_self_fast(typ, mx.self_type) + typ = check_self_arg(typ, mx.self_type, defn.is_class, mx.context, name, mx.msg) + return bind_self(typ, original_type=mx.self_type, is_classmethod=defn.is_class) + + +F = TypeVar("F", bound=FunctionLike) + + +def bind_self_fast(method: F, original_type: Type | None = None) -> F: + """Return a copy of `method`, with the type of its first parameter (usually + self or cls) bound to original_type. + + This is a faster version of mypy.typeops.bind_self() that can be used for methods + with trivial self/cls annotations. + """ + if isinstance(method, Overloaded): + items = [bind_self_fast(c, original_type) for c in method.items] + return cast(F, Overloaded(items)) + assert isinstance(method, CallableType) + if not method.arg_types: + # Invalid method, return something. + return method + if method.arg_kinds[0] in (ARG_STAR, ARG_STAR2): + # See typeops.py for details. + return method + return method.copy_modified( + arg_types=method.arg_types[1:], + arg_kinds=method.arg_kinds[1:], + arg_names=method.arg_names[1:], + is_bound=True, + ) + + +def has_operator(typ: Type, op_method: str, named_type: Callable[[str], Instance]) -> bool: + """Does type have operator with the given name? + + Note: this follows the rules for operator access, in particular: + * __getattr__ is not considered + * for class objects we only look in metaclass + * instance level attributes (i.e. extra_attrs) are not considered + """ + # This is much faster than analyze_member_access, and so using + # it first as a filter is important for performance. This is mostly relevant + # in situations where we can't expect that method is likely present, + # e.g. for __OP__ vs __rOP__. + typ = get_proper_type(typ) + + if isinstance(typ, TypeVarLikeType): + typ = typ.values_or_bound() + if isinstance(typ, AnyType): + return True + if isinstance(typ, UnionType): + return all(has_operator(x, op_method, named_type) for x in typ.relevant_items()) + if isinstance(typ, FunctionLike) and typ.is_type_obj(): + return typ.fallback.type.has_readable_member(op_method) + if isinstance(typ, TypeType): + # Type[Union[X, ...]] is always normalized to Union[Type[X], ...], + # so we don't need to care about unions here, but we need to care about + # Type[T], where upper bound of T is a union. + item = typ.item + if isinstance(item, TypeVarType): + item = item.values_or_bound() + if isinstance(item, UnionType): + return all(meta_has_operator(x, op_method, named_type) for x in item.relevant_items()) + return meta_has_operator(item, op_method, named_type) + return instance_fallback(typ, named_type).type.has_readable_member(op_method) + + +def instance_fallback(typ: ProperType, named_type: Callable[[str], Instance]) -> Instance: + if isinstance(typ, Instance): + return typ + if isinstance(typ, TupleType): + return tuple_fallback(typ) + if isinstance(typ, (LiteralType, TypedDictType)): + return typ.fallback + return named_type("builtins.object") + + +def meta_has_operator(item: Type, op_method: str, named_type: Callable[[str], Instance]) -> bool: + item = get_proper_type(item) + if isinstance(item, AnyType): + return True + item = instance_fallback(item, named_type) + meta = item.type.metaclass_type or named_type("builtins.type") + return meta.type.has_readable_member(op_method) + + +def defined_in_superclass(info: TypeInfo, name: str) -> bool: + """Check if a variable has an explicit value at class level in any of superclasses.""" + for base in info.mro[1:]: + if (node := base.names.get(name)) is not None: + if not node.implicit and isinstance(node.node, Var) and node.node.has_explicit_value: + return True + return False diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checkpattern.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checkpattern.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..868a80d3402b16dbae168800025b659adaca6dc4 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checkpattern.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checkpattern.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checkpattern.py new file mode 100644 index 0000000000000000000000000000000000000000..53fa75fa5ec389ace64b01e419ea38e1a5ad4b23 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checkpattern.py @@ -0,0 +1,885 @@ +"""Pattern checker. This file is conceptually part of TypeChecker.""" + +from __future__ import annotations + +from collections import defaultdict +from typing import Final, NamedTuple + +from mypy import message_registry +from mypy.checker_shared import TypeCheckerSharedApi, TypeRange +from mypy.checkmember import analyze_member_access +from mypy.expandtype import expand_type_by_instance +from mypy.join import join_types +from mypy.literals import literal_hash +from mypy.maptype import map_instance_to_supertype +from mypy.meet import narrow_declared_type +from mypy.messages import MessageBuilder +from mypy.nodes import ARG_POS, Expression, NameExpr, TempNode, TypeAlias, Var +from mypy.options import Options +from mypy.patterns import ( + AsPattern, + ClassPattern, + MappingPattern, + OrPattern, + Pattern, + SequencePattern, + SingletonPattern, + StarredPattern, + ValuePattern, +) +from mypy.plugin import Plugin +from mypy.subtypes import is_subtype +from mypy.typeops import ( + coerce_to_literal, + make_simplified_union, + try_getting_str_literals_from_type, + tuple_fallback, +) +from mypy.types import ( + AnyType, + FunctionLike, + Instance, + NoneType, + ProperType, + TupleType, + Type, + TypedDictType, + TypeOfAny, + TypeType, + TypeVarTupleType, + TypeVarType, + UninhabitedType, + UnionType, + UnpackType, + callable_with_ellipsis, + find_unpack_in_list, + get_proper_type, + split_with_prefix_and_suffix, +) +from mypy.typevars import fill_typevars, fill_typevars_with_any +from mypy.visitor import PatternVisitor + +self_match_type_names: Final = [ + "builtins.bool", + "builtins.bytearray", + "builtins.bytes", + "builtins.dict", + "builtins.float", + "builtins.frozenset", + "builtins.int", + "builtins.list", + "builtins.set", + "builtins.str", + "builtins.tuple", +] + +non_sequence_match_type_names: Final = ["builtins.str", "builtins.bytes", "builtins.bytearray"] + + +# For every Pattern a PatternType can be calculated. This requires recursively calculating +# the PatternTypes of the sub-patterns first. +# Using the data in the PatternType the match subject and captured names can be narrowed/inferred. +class PatternType(NamedTuple): + type: Type # The type the match subject can be narrowed to + rest_type: Type # The remaining type if the pattern didn't match + captures: dict[Expression, Type] # The variables captured by the pattern + + +class PatternChecker(PatternVisitor[PatternType]): + """Pattern checker. + + This class checks if a pattern can match a type, what the type can be narrowed to, and what + type capture patterns should be inferred as. + """ + + # Some services are provided by a TypeChecker instance. + chk: TypeCheckerSharedApi + # This is shared with TypeChecker, but stored also here for convenience. + msg: MessageBuilder + # Currently unused + plugin: Plugin + # The expression being matched against the pattern + subject: Expression + + subject_type: Type + # Type of the subject to check the (sub)pattern against + type_context: list[Type] + # Types that match against self instead of their __match_args__ if used as a class pattern + # Filled in from self_match_type_names + self_match_types: list[Type] + # Types that are sequences, but don't match sequence patterns. Filled in from + # non_sequence_match_type_names + non_sequence_match_types: list[Type] + + options: Options + + def __init__( + self, chk: TypeCheckerSharedApi, msg: MessageBuilder, plugin: Plugin, options: Options + ) -> None: + self.chk = chk + self.msg = msg + self.plugin = plugin + + self.type_context = [] + self.self_match_types = self.generate_types_from_names(self_match_type_names) + self.non_sequence_match_types = self.generate_types_from_names( + non_sequence_match_type_names + ) + self.options = options + + def accept(self, o: Pattern, type_context: Type) -> PatternType: + self.type_context.append(type_context) + result = o.accept(self) + self.type_context.pop() + + return result + + def visit_as_pattern(self, o: AsPattern) -> PatternType: + current_type = self.type_context[-1] + if o.pattern is not None: + pattern_type = self.accept(o.pattern, current_type) + typ, rest_type, type_map = pattern_type + else: + typ, rest_type, type_map = current_type, UninhabitedType(), {} + + if not is_uninhabited(typ) and o.name is not None: + typ, _ = self.chk.conditional_types_with_intersection( + current_type, [get_type_range(typ)], o, default=current_type + ) + if not is_uninhabited(typ): + type_map[o.name] = typ + + return PatternType(typ, rest_type, type_map) + + def visit_or_pattern(self, o: OrPattern) -> PatternType: + current_type = self.type_context[-1] + + # + # Check all the subpatterns + # + pattern_types = [] + for pattern in o.patterns: + pattern_type = self.accept(pattern, current_type) + pattern_types.append(pattern_type) + if not is_uninhabited(pattern_type.type): + current_type = pattern_type.rest_type + + # + # Collect the final type + # + types = [] + for pattern_type in pattern_types: + if not is_uninhabited(pattern_type.type): + types.append(pattern_type.type) + + # + # Check the capture types + # + capture_types: dict[Var, list[tuple[Expression, Type]]] = defaultdict(list) + # Collect captures from the first subpattern + for expr, typ in pattern_types[0].captures.items(): + node = get_var(expr) + capture_types[node].append((expr, typ)) + + # Check if other subpatterns capture the same names + for i, pattern_type in enumerate(pattern_types[1:]): + vars = {get_var(expr) for expr, _ in pattern_type.captures.items()} + if capture_types.keys() != vars: + self.msg.fail(message_registry.OR_PATTERN_ALTERNATIVE_NAMES, o.patterns[i]) + for expr, typ in pattern_type.captures.items(): + node = get_var(expr) + capture_types[node].append((expr, typ)) + + captures: dict[Expression, Type] = {} + for capture_list in capture_types.values(): + typ = UninhabitedType() + for _, other in capture_list: + typ = make_simplified_union([typ, other]) + + captures[capture_list[0][0]] = typ + + union_type = make_simplified_union(types) + return PatternType(union_type, current_type, captures) + + def visit_value_pattern(self, o: ValuePattern) -> PatternType: + current_type = self.type_context[-1] + typ = self.chk.expr_checker.accept(o.expr) + typ = coerce_to_literal(typ) + node = TempNode(current_type) + # Value patterns are essentially a syntactic sugar on top of `if x == Value`. + # They should be treated equivalently. + ok_map, rest_map = self.chk.narrow_type_by_identity_equality( + "==", [node, TempNode(typ)], [current_type, typ], [0, 1], {0} + ) + ok_type = ok_map.get(node, current_type) if ok_map is not None else UninhabitedType() + rest_type = rest_map.get(node, current_type) if rest_map is not None else UninhabitedType() + return PatternType(ok_type, rest_type, {}) + + def visit_singleton_pattern(self, o: SingletonPattern) -> PatternType: + current_type = self.type_context[-1] + value: bool | None = o.value + if isinstance(value, bool): + typ = self.chk.expr_checker.infer_literal_expr_type(value, "builtins.bool") + elif value is None: + typ = NoneType() + else: + assert False + + narrowed_type, rest_type = self.chk.conditional_types_with_intersection( + current_type, [get_type_range(typ)], o, default=current_type + ) + return PatternType(narrowed_type, rest_type, {}) + + def visit_sequence_pattern(self, o: SequencePattern) -> PatternType: + # + # Step 1. Check for existence of a starred pattern + # + current_type = get_proper_type(self.type_context[-1]) + if not self.can_match_sequence(current_type): + return self.early_non_match() + + star_positions = [i for i, p in enumerate(o.patterns) if isinstance(p, StarredPattern)] + star_position: int | None = None + if len(star_positions) == 1: + star_position = star_positions[0] + elif len(star_positions) >= 2: + assert False, "Parser should prevent multiple starred patterns" + required_patterns = len(o.patterns) + if star_position is not None: + required_patterns -= 1 + + # + # Step 2. If we have a union, recurse and return the combined result + # + if isinstance(current_type, UnionType): + match_types: list[Type] = [] + rest_types: list[Type] = [] + captures_list: dict[Expression, list[Type]] = {} + + if star_position is not None: + star_pattern = o.patterns[star_position] + assert isinstance(star_pattern, StarredPattern) + star_expr = star_pattern.capture + else: + star_expr = None + + for t in current_type.items: + match_type, rest_type, captures = self.accept(o, t) + match_types.append(match_type) + rest_types.append(rest_type) + if not is_uninhabited(match_type): + for expr, typ in captures.items(): + p_typ = get_proper_type(typ) + if expr not in captures_list: + captures_list[expr] = [] + # Avoid adding in a list[Never] for empty list captures + if ( + expr == star_expr + and isinstance(p_typ, Instance) + and p_typ.type.fullname == "builtins.list" + and is_uninhabited(p_typ.args[0]) + ): + continue + captures_list[expr].append(typ) + + return PatternType( + make_simplified_union(match_types), + make_simplified_union(rest_types), + {expr: make_simplified_union(types) for expr, types in captures_list.items()}, + ) + + # + # Step 3. Get inner types of original type + # + unpack_index = None + if isinstance(current_type, TupleType): + inner_types: list[Type] = current_type.items + unpack_index = find_unpack_in_list(inner_types) + if unpack_index is None: + size_diff = len(inner_types) - required_patterns + if size_diff < 0: + return self.early_non_match() + elif size_diff > 0 and star_position is None: + return self.early_non_match() + else: + normalized_inner_types = [] + for it in inner_types: + # Unfortunately, it is not possible to "split" the TypeVarTuple + # into individual items, so we just use its upper bound for the whole + # analysis instead. + if isinstance(it, UnpackType) and isinstance(it.type, TypeVarTupleType): + it = UnpackType(it.type.upper_bound) + normalized_inner_types.append(it) + inner_types = normalized_inner_types + current_type = current_type.copy_modified(items=normalized_inner_types) + if len(inner_types) - 1 > required_patterns and star_position is None: + return self.early_non_match() + elif isinstance(current_type, AnyType): + inner_type = AnyType(TypeOfAny.from_another_any, current_type) + inner_types = [inner_type] * len(o.patterns) + elif isinstance(current_type, Instance) and self.chk.type_is_iterable(current_type): + inner_type = self.chk.iterable_item_type(current_type, o) + inner_types = [inner_type] * len(o.patterns) + else: + inner_type = self.chk.named_type("builtins.object") + inner_types = [inner_type] * len(o.patterns) + + # + # Step 4. Match inner patterns + # + contracted_new_inner_types: list[Type] = [] + contracted_rest_inner_types: list[Type] = [] + captures = {} # dict[Expression, Type] + + contracted_inner_types = self.contract_starred_pattern_types( + inner_types, star_position, required_patterns + ) + for p, t in zip(o.patterns, contracted_inner_types): + pattern_type = self.accept(p, t) + typ, rest, type_map = pattern_type + contracted_new_inner_types.append(typ) + contracted_rest_inner_types.append(rest) + self.update_type_map(captures, type_map) + + new_inner_types = self.expand_starred_pattern_types( + contracted_new_inner_types, star_position, len(inner_types), unpack_index is not None + ) + rest_inner_types = self.expand_starred_pattern_types( + contracted_rest_inner_types, star_position, len(inner_types), unpack_index is not None + ) + + # + # Step 5. Calculate new type + # + new_type: Type + rest_type = current_type + if isinstance(current_type, TupleType) and unpack_index is None: + if any(is_uninhabited(typ) for typ in new_inner_types): + new_type = UninhabitedType() + else: + new_type = TupleType(new_inner_types, current_type.partial_fallback) + + num_always_match = sum(is_uninhabited(typ) for typ in rest_inner_types) + if num_always_match == len(rest_inner_types): + # All subpatterns always match, so we can apply negative narrowing + rest_type = UninhabitedType() + elif num_always_match == len(rest_inner_types) - 1: + # Exactly one subpattern may conditionally match, the rest always match. + # We can apply negative narrowing to this one position. + rest_type = TupleType( + [ + curr if is_uninhabited(rest) else rest + for curr, rest in zip(inner_types, rest_inner_types) + ], + current_type.partial_fallback, + ) + elif isinstance(current_type, TupleType): + # For variadic tuples it is too tricky to match individual items like for fixed + # tuples, so we instead try to narrow the entire type. + # TODO: use more precise narrowing when possible (e.g. for identical shapes). + new_tuple_type = TupleType(new_inner_types, current_type.partial_fallback) + new_type, _ = self.chk.conditional_types_with_intersection( + new_tuple_type, [get_type_range(current_type)], o, default=new_tuple_type + ) + if ( + star_position is not None + and required_patterns <= len(inner_types) - 1 + and all(is_uninhabited(rest) for rest in rest_inner_types) + ): + rest_type = UninhabitedType() + else: + new_inner_type = UninhabitedType() + for typ in new_inner_types: + new_inner_type = join_types(new_inner_type, typ) + new_type = self.construct_sequence_child(current_type, new_inner_type) + new_type, possible_rest_type = self.chk.conditional_types_with_intersection( + current_type, [get_type_range(new_type)], o, default=current_type + ) + if star_position is not None and len(o.patterns) == 1: + # Match cannot be refuted, so narrow the remaining type + rest_type = possible_rest_type + + return PatternType(new_type, rest_type, captures) + + def contract_starred_pattern_types( + self, types: list[Type], star_pos: int | None, num_patterns: int + ) -> list[Type]: + """ + Contracts a list of types in a sequence pattern depending on the position of a starred + capture pattern. + + For example if the sequence pattern [a, *b, c] is matched against types [bool, int, str, + bytes] the contracted types are [bool, Union[int, str], bytes]. + + If star_pos in None the types are returned unchanged. + """ + unpack_index = find_unpack_in_list(types) + if unpack_index is not None: + # Variadic tuples require "re-shaping" to match the requested pattern. + unpack = types[unpack_index] + assert isinstance(unpack, UnpackType) + unpacked = get_proper_type(unpack.type) + # This should be guaranteed by the normalization in the caller. + assert isinstance(unpacked, Instance) and unpacked.type.fullname == "builtins.tuple" + if star_pos is None: + missing = num_patterns - len(types) + 1 + new_types = types[:unpack_index] + new_types += [unpacked.args[0]] * missing + new_types += types[unpack_index + 1 :] + return new_types + prefix, middle, suffix = split_with_prefix_and_suffix( + tuple([UnpackType(unpacked) if isinstance(t, UnpackType) else t for t in types]), + star_pos, + num_patterns - star_pos, + ) + new_middle = [] + for m in middle: + # The existing code expects the star item type, rather than the type of + # the whole tuple "slice". + if isinstance(m, UnpackType): + new_middle.append(unpacked.args[0]) + else: + new_middle.append(m) + return list(prefix) + [make_simplified_union(new_middle)] + list(suffix) + else: + if star_pos is None: + return types + new_types = types[:star_pos] + star_length = len(types) - num_patterns + new_types.append(make_simplified_union(types[star_pos : star_pos + star_length])) + new_types += types[star_pos + star_length :] + return new_types + + def expand_starred_pattern_types( + self, types: list[Type], star_pos: int | None, num_types: int, original_unpack: bool + ) -> list[Type]: + """Undoes the contraction done by contract_starred_pattern_types. + + For example if the sequence pattern is [a, *b, c] and types [bool, int, str] are extended + to length 4 the result is [bool, int, int, str]. + """ + if star_pos is None: + return types + if original_unpack: + # In the case where original tuple type has an unpack item, it is not practical + # to coerce pattern type back to the original shape (and may not even be possible), + # so we only restore the type of the star item. + res = [] + for i, t in enumerate(types): + if i != star_pos or is_uninhabited(t): + res.append(t) + else: + res.append(UnpackType(self.chk.named_generic_type("builtins.tuple", [t]))) + return res + new_types = types[:star_pos] + star_length = num_types - len(types) + 1 + new_types += [types[star_pos]] * star_length + new_types += types[star_pos + 1 :] + + return new_types + + def visit_starred_pattern(self, o: StarredPattern) -> PatternType: + captures: dict[Expression, Type] = {} + if o.capture is not None: + list_type = self.chk.named_generic_type("builtins.list", [self.type_context[-1]]) + captures[o.capture] = list_type + return PatternType(self.type_context[-1], UninhabitedType(), captures) + + def visit_mapping_pattern(self, o: MappingPattern) -> PatternType: + current_type = get_proper_type(self.type_context[-1]) + can_match = True + captures: dict[Expression, Type] = {} + for key, value in zip(o.keys, o.values): + inner_type = self.get_mapping_item_type(o, current_type, key) + if inner_type is None: + can_match = False + inner_type = self.chk.named_type("builtins.object") + pattern_type = self.accept(value, inner_type) + if is_uninhabited(pattern_type.type): + can_match = False + else: + self.update_type_map(captures, pattern_type.captures) + + if o.rest is not None: + mapping = self.chk.named_type("typing.Mapping") + if is_subtype(current_type, mapping) and isinstance(current_type, Instance): + mapping_inst = map_instance_to_supertype(current_type, mapping.type) + dict_typeinfo = self.chk.lookup_typeinfo("builtins.dict") + rest_type = Instance(dict_typeinfo, mapping_inst.args) + else: + object_type = self.chk.named_type("builtins.object") + rest_type = self.chk.named_generic_type( + "builtins.dict", [object_type, object_type] + ) + + captures[o.rest] = rest_type + + else_type = current_type + if can_match: + # We can't narrow the type here, as Mapping key is invariant. + new_type = self.type_context[-1] + if not o.keys: + # Match cannot be refuted, so narrow the remaining type + mapping = self.chk.named_type("typing.Mapping") + if_type, else_type = self.chk.conditional_types_with_intersection( + current_type, + [TypeRange(mapping, is_upper_bound=False)], + o, + default=current_type, + ) + if not isinstance(current_type, AnyType): + new_type = if_type + else: + new_type = UninhabitedType() + return PatternType(new_type, else_type, captures) + + def get_mapping_item_type( + self, pattern: MappingPattern, mapping_type: Type, key: Expression + ) -> Type | None: + mapping_type = get_proper_type(mapping_type) + if isinstance(mapping_type, TypedDictType): + with self.msg.filter_errors() as local_errors: + result: Type | None = self.chk.expr_checker.visit_typeddict_index_expr( + mapping_type, key + )[0] + has_local_errors = local_errors.has_new_errors() + # If we can't determine the type statically fall back to treating it as a normal + # mapping + if has_local_errors: + with self.msg.filter_errors() as local_errors: + result = self.get_simple_mapping_item_type(pattern, mapping_type, key) + + if local_errors.has_new_errors(): + result = None + else: + with self.msg.filter_errors(): + result = self.get_simple_mapping_item_type(pattern, mapping_type, key) + return result + + def get_simple_mapping_item_type( + self, pattern: MappingPattern, mapping_type: Type, key: Expression + ) -> Type: + result, _ = self.chk.expr_checker.check_method_call_by_name( + "__getitem__", mapping_type, [key], [ARG_POS], pattern + ) + return result + + def visit_class_pattern(self, o: ClassPattern) -> PatternType: + current_type = get_proper_type(self.type_context[-1]) + + # + # Check class type + # + type_info = o.class_ref.node + if isinstance(type_info, TypeAlias) and not type_info.no_args: + self.msg.fail(message_registry.CLASS_PATTERN_GENERIC_TYPE_ALIAS, o) + return self.early_non_match() + + typ = self.chk.expr_checker.accept(o.class_ref) + type_ranges = self.get_class_pattern_type_ranges(typ, o) + if type_ranges is None: + return self.early_non_match() + typ = UnionType.make_union([t.item for t in type_ranges]) + + new_type, rest_type = self.chk.conditional_types_with_intersection( + current_type, type_ranges, o, default=current_type + ) + if is_uninhabited(new_type): + return self.early_non_match() + # TODO: Do I need this? + narrowed_type = narrow_declared_type(current_type, new_type) + + # + # Convert positional to keyword patterns + # + keyword_pairs: list[tuple[str | None, Pattern]] = [] + match_arg_set: set[str] = set() + + captures: dict[Expression, Type] = {} + + if len(o.positionals) != 0: + if self.should_self_match(typ): + if len(o.positionals) > 1: + self.msg.fail(message_registry.CLASS_PATTERN_TOO_MANY_POSITIONAL_ARGS, o) + pattern_type = self.accept(o.positionals[0], narrowed_type) + if not is_uninhabited(pattern_type.type): + return PatternType( + pattern_type.type, + join_types(rest_type, pattern_type.rest_type), + pattern_type.captures, + ) + captures = pattern_type.captures + else: + with self.msg.filter_errors() as local_errors: + match_args_type = analyze_member_access( + "__match_args__", + typ, + o, + is_lvalue=False, + is_super=False, + is_operator=False, + original_type=typ, + chk=self.chk, + ) + has_local_errors = local_errors.has_new_errors() + if has_local_errors: + self.msg.fail( + message_registry.MISSING_MATCH_ARGS.format( + typ.str_with_options(self.options) + ), + o, + ) + return self.early_non_match() + + proper_match_args_type = get_proper_type(match_args_type) + if isinstance(proper_match_args_type, TupleType): + match_arg_names = get_match_arg_names(proper_match_args_type) + + if len(o.positionals) > len(match_arg_names): + self.msg.fail(message_registry.CLASS_PATTERN_TOO_MANY_POSITIONAL_ARGS, o) + return self.early_non_match() + else: + match_arg_names = [None] * len(o.positionals) + + for arg_name, pos in zip(match_arg_names, o.positionals): + keyword_pairs.append((arg_name, pos)) + if arg_name is not None: + match_arg_set.add(arg_name) + + # + # Check for duplicate patterns + # + keyword_arg_set = set() + has_duplicates = False + for key, value in zip(o.keyword_keys, o.keyword_values): + keyword_pairs.append((key, value)) + if key in match_arg_set: + self.msg.fail( + message_registry.CLASS_PATTERN_KEYWORD_MATCHES_POSITIONAL.format(key), value + ) + has_duplicates = True + elif key in keyword_arg_set: + self.msg.fail( + message_registry.CLASS_PATTERN_DUPLICATE_KEYWORD_PATTERN.format(key), value + ) + has_duplicates = True + keyword_arg_set.add(key) + + if has_duplicates: + return self.early_non_match() + + # + # Check keyword patterns + # + can_match = True + for keyword, pattern in keyword_pairs: + key_type: Type | None = None + with self.msg.filter_errors() as local_errors: + if keyword is not None: + key_type = analyze_member_access( + keyword, + narrowed_type, + pattern, + is_lvalue=False, + is_super=False, + is_operator=False, + original_type=new_type, + chk=self.chk, + ) + else: + key_type = AnyType(TypeOfAny.from_error) + has_local_errors = local_errors.has_new_errors() + if has_local_errors or key_type is None: + key_type = AnyType(TypeOfAny.from_error) + if not (type_info and type_info.fullname == "builtins.object"): + self.msg.fail( + message_registry.CLASS_PATTERN_UNKNOWN_KEYWORD.format( + typ.str_with_options(self.options), keyword + ), + pattern, + ) + elif keyword is not None: + new_type = self.chk.add_any_attribute_to_type(new_type, keyword) + + inner_type, inner_rest_type, inner_captures = self.accept(pattern, key_type) + if is_uninhabited(inner_type): + can_match = False + else: + self.update_type_map(captures, inner_captures) + if not is_uninhabited(inner_rest_type): + rest_type = current_type + + if not can_match: + new_type = UninhabitedType() + return PatternType(new_type, rest_type, captures) + + def get_class_pattern_type_ranges(self, typ: Type, o: ClassPattern) -> list[TypeRange] | None: + p_typ = get_proper_type(typ) + + if isinstance(p_typ, UnionType): + type_ranges = [] + for item in p_typ.items: + type_range = self.get_class_pattern_type_ranges(item, o) + if type_range is not None: + type_ranges.extend(type_range) + if not type_ranges: + return None + return type_ranges + + if isinstance(p_typ, FunctionLike) and p_typ.is_type_obj(): + typ = fill_typevars_with_any(p_typ.type_object()) + return [TypeRange(typ, is_upper_bound=False)] + if ( + isinstance(o.class_ref.node, Var) + and o.class_ref.node.type is not None + and o.class_ref.node.fullname == "typing.Callable" + ): + # Create a `Callable[..., Any]` + fallback = self.chk.named_type("builtins.function") + any_type = AnyType(TypeOfAny.unannotated) + typ = callable_with_ellipsis(any_type, ret_type=any_type, fallback=fallback) + return [TypeRange(typ, is_upper_bound=False)] + if isinstance(p_typ, TypeType): + typ = p_typ.item + return [TypeRange(p_typ.item, is_upper_bound=True)] + if isinstance(p_typ, AnyType): + return [TypeRange(p_typ, is_upper_bound=False)] + + self.msg.fail( + message_registry.CLASS_PATTERN_TYPE_REQUIRED.format( + typ.str_with_options(self.options) + ), + o, + ) + return None + + def should_self_match(self, typ: Type) -> bool: + typ = get_proper_type(typ) + if isinstance(typ, TupleType): + typ = typ.partial_fallback + if isinstance(typ, AnyType): + return False + if isinstance(typ, Instance) and typ.type.get("__match_args__") is not None: + # Named tuples and other subtypes of builtins that define __match_args__ + # should not self match. + return False + for other in self.self_match_types: + if is_subtype(typ, other): + return True + return False + + def can_match_sequence(self, typ: ProperType) -> bool: + if isinstance(typ, AnyType): + return True + if isinstance(typ, UnionType): + return any(self.can_match_sequence(get_proper_type(item)) for item in typ.items) + for other in self.non_sequence_match_types: + # We have to ignore promotions, as memoryview should match, but bytes, + # which it can be promoted to, shouldn't + if is_subtype(typ, other, ignore_promotions=True): + return False + sequence = self.chk.named_type("typing.Sequence") + # If the static type is more general than sequence the actual type could still match + return is_subtype(typ, sequence) or is_subtype(sequence, typ) + + def generate_types_from_names(self, type_names: list[str]) -> list[Type]: + types: list[Type] = [] + for name in type_names: + try: + types.append(self.chk.named_type(name)) + except KeyError as e: + # Some built in types are not defined in all test cases + if not name.startswith("builtins."): + raise e + return types + + def update_type_map( + self, original_type_map: dict[Expression, Type], extra_type_map: dict[Expression, Type] + ) -> None: + # Calculating this would not be needed if TypeMap directly used literal hashes instead of + # expressions, as suggested in the TODO above it's definition + already_captured = {literal_hash(expr) for expr in original_type_map} + for expr, typ in extra_type_map.items(): + if literal_hash(expr) in already_captured: + node = get_var(expr) + self.msg.fail( + message_registry.MULTIPLE_ASSIGNMENTS_IN_PATTERN.format(node.name), expr + ) + else: + original_type_map[expr] = typ + + def construct_sequence_child(self, outer_type: Type, inner_type: Type) -> Type: + """ + If outer_type is a child class of typing.Sequence returns a new instance of + outer_type, that is a Sequence of inner_type. If outer_type is not a child class of + typing.Sequence just returns a Sequence of inner_type + + For example: + construct_sequence_child(List[int], str) = List[str] + + TODO: this doesn't make sense. For example if one has class S(Sequence[int], Generic[T]) + or class T(Sequence[Tuple[T, T]]), there is no way any of those can map to Sequence[str]. + """ + proper_type = get_proper_type(outer_type) + if isinstance(proper_type, TypeVarType): + new_bound = self.construct_sequence_child(proper_type.upper_bound, inner_type) + return proper_type.copy_modified(upper_bound=new_bound) + if isinstance(proper_type, AnyType): + return outer_type + if isinstance(proper_type, UnionType): + types = [ + self.construct_sequence_child(item, inner_type) + for item in proper_type.items + if self.can_match_sequence(get_proper_type(item)) + ] + return make_simplified_union(types) + sequence = self.chk.named_generic_type("typing.Sequence", [inner_type]) + if is_subtype(outer_type, self.chk.named_type("typing.Sequence")): + if isinstance(proper_type, TupleType): + proper_type = tuple_fallback(proper_type) + assert isinstance(proper_type, Instance) + empty_type = fill_typevars(proper_type.type) + partial_type = expand_type_by_instance(empty_type, sequence) + return expand_type_by_instance(partial_type, proper_type) + else: + return sequence + + def early_non_match(self) -> PatternType: + return PatternType(UninhabitedType(), self.type_context[-1], {}) + + +def get_match_arg_names(typ: TupleType) -> list[str | None]: + args: list[str | None] = [] + for item in typ.items: + values = try_getting_str_literals_from_type(item) + if values is None or len(values) != 1: + args.append(None) + else: + args.append(values[0]) + return args + + +def get_var(expr: Expression) -> Var: + """ + Warning: this in only true for expressions captured by a match statement. + Don't call it from anywhere else + """ + assert isinstance(expr, NameExpr), expr + node = expr.node + assert isinstance(node, Var), node + return node + + +def get_type_range(typ: Type) -> TypeRange: + typ = get_proper_type(typ) + if ( + isinstance(typ, Instance) + and typ.last_known_value + and isinstance(typ.last_known_value.value, bool) + ): + typ = typ.last_known_value + return TypeRange(typ, is_upper_bound=False) + + +def is_uninhabited(typ: Type) -> bool: + return isinstance(get_proper_type(typ), UninhabitedType) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checkstrformat.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checkstrformat.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..fcc0134cabf1d4eead007a970494777ddb588030 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checkstrformat.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checkstrformat.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checkstrformat.py new file mode 100644 index 0000000000000000000000000000000000000000..55605274aa1f13fc8890353fd237bd3d3f324b2b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/checkstrformat.py @@ -0,0 +1,1099 @@ +""" +Format expression type checker. + +This file is conceptually part of ExpressionChecker and TypeChecker. Main functionality +is located in StringFormatterChecker.check_str_format_call() for '{}'.format(), and in +StringFormatterChecker.check_str_interpolation() for printf-style % interpolation. + +Note that although at runtime format strings are parsed using custom parsers, +here we use a regexp-based approach. This way we 99% match runtime behaviour while keeping +implementation simple. +""" + +from __future__ import annotations + +import re +from collections.abc import Callable +from re import Match, Pattern +from typing import Final, TypeAlias as _TypeAlias, cast + +import mypy.errorcodes as codes +from mypy import message_registry +from mypy.checker_shared import TypeCheckerSharedApi +from mypy.errors import Errors +from mypy.maptype import map_instance_to_supertype +from mypy.messages import MessageBuilder +from mypy.nodes import ( + ARG_NAMED, + ARG_POS, + ARG_STAR, + ARG_STAR2, + BytesExpr, + CallExpr, + Context, + DictExpr, + Expression, + ExpressionStmt, + IndexExpr, + IntExpr, + MemberExpr, + MypyFile, + NameExpr, + Node, + StarExpr, + StrExpr, + TempNode, + TupleExpr, +) +from mypy.parse import parse +from mypy.subtypes import is_subtype +from mypy.typeops import custom_special_method +from mypy.types import ( + AnyType, + Instance, + LiteralType, + TupleType, + Type, + TypeOfAny, + TypeVarTupleType, + TypeVarType, + UnionType, + UnpackType, + find_unpack_in_list, + get_proper_type, + get_proper_types, +) + +FormatStringExpr: _TypeAlias = StrExpr | BytesExpr +Checkers: _TypeAlias = tuple[Callable[[Expression], None], Callable[[Type], bool]] +MatchMap: _TypeAlias = dict[tuple[int, int], Match[str]] # span -> match + + +def compile_format_re() -> Pattern[str]: + """Construct regexp to match format conversion specifiers in % interpolation. + + See https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting + The regexp is intentionally a bit wider to report better errors. + """ + key_re = r"(\((?P[^)]*)\))?" # (optional) parenthesised sequence of characters. + flags_re = r"(?P[#0\-+ ]*)" # (optional) sequence of flags. + width_re = r"(?P[1-9][0-9]*|\*)?" # (optional) minimum field width (* or numbers). + precision_re = r"(?:\.(?P\*|[0-9]+)?)?" # (optional) . followed by * of numbers. + length_mod_re = r"[hlL]?" # (optional) length modifier (unused). + type_re = r"(?P.)?" # conversion type. + format_re = "%" + key_re + flags_re + width_re + precision_re + length_mod_re + type_re + return re.compile(format_re) + + +def compile_new_format_re(custom_spec: bool) -> Pattern[str]: + """Construct regexps to match format conversion specifiers in str.format() calls. + + See After https://docs.python.org/3/library/string.html#formatspec for + specifications. The regexps are intentionally wider, to report better errors, + instead of just not matching. + """ + + # Field (optional) is an integer/identifier possibly followed by several .attr and [index]. + field = r"(?P(?P[^.[!:]*)([^:!]+)?)" + + # Conversion (optional) is ! followed by one of letters for forced repr(), str(), or ascii(). + conversion = r"(?P![^:])?" + + # Format specification (optional) follows its own mini-language: + if not custom_spec: + # Fill and align is valid for all builtin types. + fill_align = r"(?P.?[<>=^])?" + # Number formatting options are only valid for int, float, complex, and Decimal, + # except if only width is given (it is valid for all types). + # This contains sign, flags (sign, # and/or 0), width, grouping (_ or ,) and precision. + num_spec = r"(?P[+\- ]?#?0?)(?P\d+)?[_,]?(?P\.\d+)?" + # The last element is type. + conv_type = r"(?P.)?" # only some are supported, but we want to give a better error + format_spec = r"(?P:" + fill_align + num_spec + conv_type + r")?" + else: + # Custom types can define their own form_spec using __format__(). + format_spec = r"(?P:.*)?" + + return re.compile(field + conversion + format_spec) + + +FORMAT_RE: Final = compile_format_re() +FORMAT_RE_NEW: Final = compile_new_format_re(False) +FORMAT_RE_NEW_CUSTOM: Final = compile_new_format_re(True) +DUMMY_FIELD_NAME: Final = "__dummy_name__" + +# Types that require either int or float. +NUMERIC_TYPES_OLD: Final = {"d", "i", "o", "u", "x", "X", "e", "E", "f", "F", "g", "G"} +NUMERIC_TYPES_NEW: Final = {"b", "d", "o", "e", "E", "f", "F", "g", "G", "n", "x", "X", "%"} + +# These types accept _only_ int. +REQUIRE_INT_OLD: Final = {"o", "x", "X"} +REQUIRE_INT_NEW: Final = {"b", "d", "o", "x", "X"} + +# These types fall back to SupportsFloat with % (other fall back to SupportsInt) +FLOAT_TYPES: Final = {"e", "E", "f", "F", "g", "G"} + + +class ConversionSpecifier: + def __init__( + self, match: Match[str], start_pos: int = -1, non_standard_format_spec: bool = False + ) -> None: + self.whole_seq = match.group() + self.start_pos = start_pos + + m_dict = match.groupdict() + self.key = m_dict.get("key") + + # Replace unmatched optional groups with empty matches (for convenience). + self.conv_type = m_dict.get("type") or "" + self.flags = m_dict.get("flags") or "" + self.width = m_dict.get("width") or "" + self.precision = m_dict.get("precision") or "" + + # Used only for str.format() calls (it may be custom for types with __format__()). + self.format_spec = m_dict.get("format_spec") + self.non_standard_format_spec = non_standard_format_spec + # Used only for str.format() calls. + self.conversion = m_dict.get("conversion") + # Full formatted expression (i.e. key plus following attributes and/or indexes). + # Used only for str.format() calls. + self.field = m_dict.get("field") + + def has_key(self) -> bool: + return self.key is not None + + def has_star(self) -> bool: + return self.width == "*" or self.precision == "*" + + +def parse_conversion_specifiers(format_str: str) -> list[ConversionSpecifier]: + """Parse c-printf-style format string into list of conversion specifiers.""" + specifiers: list[ConversionSpecifier] = [] + for m in re.finditer(FORMAT_RE, format_str): + specifiers.append(ConversionSpecifier(m, start_pos=m.start())) + return specifiers + + +def parse_format_value( + format_value: str, ctx: Context, msg: MessageBuilder, nested: bool = False +) -> list[ConversionSpecifier] | None: + """Parse format string into list of conversion specifiers. + + The specifiers may be nested (two levels maximum), in this case they are ordered as + '{0:{1}}, {2:{3}{4}}'. Return None in case of an error. + """ + top_targets = find_non_escaped_targets(format_value, ctx, msg) + if top_targets is None: + return None + + result: list[ConversionSpecifier] = [] + for target, start_pos in top_targets: + match = FORMAT_RE_NEW.fullmatch(target) + if match: + conv_spec = ConversionSpecifier(match, start_pos=start_pos) + else: + custom_match = FORMAT_RE_NEW_CUSTOM.fullmatch(target) + if custom_match: + conv_spec = ConversionSpecifier( + custom_match, start_pos=start_pos, non_standard_format_spec=True + ) + else: + msg.fail( + "Invalid conversion specifier in format string", + ctx, + code=codes.STRING_FORMATTING, + ) + return None + + if conv_spec.key and ("{" in conv_spec.key or "}" in conv_spec.key): + msg.fail("Conversion value must not contain { or }", ctx, code=codes.STRING_FORMATTING) + return None + result.append(conv_spec) + + # Parse nested conversions that are allowed in format specifier. + if ( + conv_spec.format_spec + and conv_spec.non_standard_format_spec + and ("{" in conv_spec.format_spec or "}" in conv_spec.format_spec) + ): + if nested: + msg.fail( + "Formatting nesting must be at most two levels deep", + ctx, + code=codes.STRING_FORMATTING, + ) + return None + sub_conv_specs = parse_format_value(conv_spec.format_spec, ctx, msg, nested=True) + if sub_conv_specs is None: + return None + result.extend(sub_conv_specs) + return result + + +def find_non_escaped_targets( + format_value: str, ctx: Context, msg: MessageBuilder +) -> list[tuple[str, int]] | None: + """Return list of raw (un-parsed) format specifiers in format string. + + Format specifiers don't include enclosing braces. We don't use regexp for + this because they don't work well with nested/repeated patterns + (both greedy and non-greedy), and these are heavily used internally for + representation of f-strings. + + Return None in case of an error. + """ + result = [] + next_spec = "" + pos = 0 + nesting = 0 + while pos < len(format_value): + c = format_value[pos] + if not nesting: + # Skip any paired '{{' and '}}', enter nesting on '{', report error on '}'. + if c == "{": + if pos < len(format_value) - 1 and format_value[pos + 1] == "{": + pos += 1 + else: + nesting = 1 + if c == "}": + if pos < len(format_value) - 1 and format_value[pos + 1] == "}": + pos += 1 + else: + msg.fail( + "Invalid conversion specifier in format string: unexpected }", + ctx, + code=codes.STRING_FORMATTING, + ) + return None + else: + # Adjust nesting level, then either continue adding chars or move on. + if c == "{": + nesting += 1 + if c == "}": + nesting -= 1 + if nesting: + next_spec += c + else: + result.append((next_spec, pos - len(next_spec))) + next_spec = "" + pos += 1 + if nesting: + msg.fail( + "Invalid conversion specifier in format string: unmatched {", + ctx, + code=codes.STRING_FORMATTING, + ) + return None + return result + + +class StringFormatterChecker: + """String interpolation/formatter type checker. + + This class works closely together with checker.ExpressionChecker. + """ + + # Some services are provided by a TypeChecker instance. + chk: TypeCheckerSharedApi + # This is shared with TypeChecker, but stored also here for convenience. + msg: MessageBuilder + + def __init__(self, chk: TypeCheckerSharedApi, msg: MessageBuilder) -> None: + """Construct an expression type checker.""" + self.chk = chk + self.msg = msg + + def check_str_format_call(self, call: CallExpr, format_value: str) -> None: + """Perform more precise checks for str.format() calls when possible. + + Currently the checks are performed for: + * Actual string literals + * Literal types with string values + * Final names with string values + + The checks that we currently perform: + * Check generic validity (e.g. unmatched { or }, and {} in invalid positions) + * Check consistency of specifiers' auto-numbering + * Verify that replacements can be found for all conversion specifiers, + and all arguments were used + * Non-standard format specs are only allowed for types with custom __format__ + * Type check replacements with accessors applied (if any). + * Verify that specifier type is known and matches replacement type + * Perform special checks for some specifier types: + - 'c' requires a single character string + - 's' must not accept bytes + - non-empty flags are only allowed for numeric types + """ + conv_specs = parse_format_value(format_value, call, self.msg) + if conv_specs is None: + return + if not self.auto_generate_keys(conv_specs, call): + return + self.check_specs_in_format_call(call, conv_specs, format_value) + + def check_specs_in_format_call( + self, call: CallExpr, specs: list[ConversionSpecifier], format_value: str + ) -> None: + """Perform pairwise checks for conversion specifiers vs their replacements. + + The core logic for format checking is implemented in this method. + """ + assert all(s.key for s in specs), "Keys must be auto-generated first!" + replacements = self.find_replacements_in_call(call, [cast(str, s.key) for s in specs]) + assert len(replacements) == len(specs) + for spec, repl in zip(specs, replacements): + repl = self.apply_field_accessors(spec, repl, ctx=call) + actual_type = repl.type if isinstance(repl, TempNode) else self.chk.lookup_type(repl) + assert actual_type is not None + + # Special case custom formatting. + if ( + spec.format_spec + and spec.non_standard_format_spec + and + # Exclude "dynamic" specifiers (i.e. containing nested formatting). + not ("{" in spec.format_spec or "}" in spec.format_spec) + ): + if ( + not custom_special_method(actual_type, "__format__", check_all=True) + or spec.conversion + ): + # TODO: add support for some custom specs like datetime? + self.msg.fail( + f'Unrecognized format specification "{spec.format_spec[1:]}"', + call, + code=codes.STRING_FORMATTING, + ) + continue + # Adjust expected and actual types. + if not spec.conv_type: + expected_type: Type | None = AnyType(TypeOfAny.special_form) + else: + assert isinstance(call.callee, MemberExpr) + if isinstance(call.callee.expr, StrExpr): + format_str = call.callee.expr + else: + format_str = StrExpr(format_value) + expected_type = self.conversion_type( + spec.conv_type, call, format_str, format_call=True + ) + if spec.conversion is not None: + # If the explicit conversion is given, then explicit conversion is called _first_. + if spec.conversion[1] not in "rsa": + self.msg.fail( + ( + f'Invalid conversion type "{spec.conversion[1]}", ' + f'must be one of "r", "s" or "a"' + ), + call, + code=codes.STRING_FORMATTING, + ) + actual_type = self.named_type("builtins.str") + + # Perform the checks for given types. + if expected_type is None: + continue + + a_type = get_proper_type(actual_type) + actual_items = ( + get_proper_types(a_type.items) if isinstance(a_type, UnionType) else [a_type] + ) + for a_type in actual_items: + if custom_special_method(a_type, "__format__"): + continue + self.check_placeholder_type(a_type, expected_type, call) + self.perform_special_format_checks(spec, call, repl, a_type, expected_type) + + def perform_special_format_checks( + self, + spec: ConversionSpecifier, + call: CallExpr, + repl: Expression, + actual_type: Type, + expected_type: Type, + ) -> None: + # TODO: try refactoring to combine this logic with % formatting. + if spec.conv_type == "c": + if isinstance(repl, (StrExpr, BytesExpr)) and len(repl.value) != 1: + self.msg.requires_int_or_char(call, format_call=True) + c_typ = get_proper_type(self.chk.lookup_type(repl)) + if isinstance(c_typ, Instance) and c_typ.last_known_value: + c_typ = c_typ.last_known_value + if isinstance(c_typ, LiteralType) and isinstance(c_typ.value, str): + if len(c_typ.value) != 1: + self.msg.requires_int_or_char(call, format_call=True) + if (not spec.conv_type or spec.conv_type == "s") and not spec.conversion: + if has_type_component(actual_type, "builtins.bytes") and not custom_special_method( + actual_type, "__str__" + ): + self.msg.fail( + 'If x = b\'abc\' then f"{x}" or "{}".format(x) produces "b\'abc\'", ' + 'not "abc". If this is desired behavior, use f"{x!r}" or "{!r}".format(x). ' + "Otherwise, decode the bytes", + call, + code=codes.STR_BYTES_PY3, + ) + if spec.flags: + numeric_types = UnionType( + [self.named_type("builtins.int"), self.named_type("builtins.float")] + ) + if ( + spec.conv_type + and spec.conv_type not in NUMERIC_TYPES_NEW + or not spec.conv_type + and not is_subtype(actual_type, numeric_types) + and not custom_special_method(actual_type, "__format__") + ): + self.msg.fail( + "Numeric flags are only allowed for numeric types", + call, + code=codes.STRING_FORMATTING, + ) + + def find_replacements_in_call(self, call: CallExpr, keys: list[str]) -> list[Expression]: + """Find replacement expression for every specifier in str.format() call. + + In case of an error use TempNode(AnyType). + """ + result: list[Expression] = [] + used: set[Expression] = set() + for key in keys: + if key.isdecimal(): + expr = self.get_expr_by_position(int(key), call) + if not expr: + self.msg.fail( + f"Cannot find replacement for positional format specifier {key}", + call, + code=codes.STRING_FORMATTING, + ) + expr = TempNode(AnyType(TypeOfAny.from_error)) + else: + expr = self.get_expr_by_name(key, call) + if not expr: + self.msg.fail( + f'Cannot find replacement for named format specifier "{key}"', + call, + code=codes.STRING_FORMATTING, + ) + expr = TempNode(AnyType(TypeOfAny.from_error)) + result.append(expr) + if not isinstance(expr, TempNode): + used.add(expr) + # Strictly speaking not using all replacements is not a type error, but most likely + # a typo in user code, so we show an error like we do for % formatting. + total_explicit = len([kind for kind in call.arg_kinds if kind in (ARG_POS, ARG_NAMED)]) + if len(used) < total_explicit: + self.msg.too_many_string_formatting_arguments(call) + return result + + def get_expr_by_position(self, pos: int, call: CallExpr) -> Expression | None: + """Get positional replacement expression from '{0}, {1}'.format(x, y, ...) call. + + If the type is from *args, return TempNode(). Return None in case of + an error. + """ + pos_args = [arg for arg, kind in zip(call.args, call.arg_kinds) if kind == ARG_POS] + if pos < len(pos_args): + return pos_args[pos] + star_args = [arg for arg, kind in zip(call.args, call.arg_kinds) if kind == ARG_STAR] + if not star_args: + return None + + # Fall back to *args when present in call. + star_arg = star_args[0] + varargs_type = get_proper_type(self.chk.lookup_type(star_arg)) + if not isinstance(varargs_type, Instance) or not varargs_type.type.has_base( + "typing.Sequence" + ): + # Error should be already reported. + return TempNode(AnyType(TypeOfAny.special_form)) + iter_info = self.chk.named_generic_type( + "typing.Sequence", [AnyType(TypeOfAny.special_form)] + ).type + return TempNode(map_instance_to_supertype(varargs_type, iter_info).args[0]) + + def get_expr_by_name(self, key: str, call: CallExpr) -> Expression | None: + """Get named replacement expression from '{name}'.format(name=...) call. + + If the type is from **kwargs, return TempNode(). Return None in case of + an error. + """ + named_args = [ + arg + for arg, kind, name in zip(call.args, call.arg_kinds, call.arg_names) + if kind == ARG_NAMED and name == key + ] + if named_args: + return named_args[0] + star_args_2 = [arg for arg, kind in zip(call.args, call.arg_kinds) if kind == ARG_STAR2] + if not star_args_2: + return None + star_arg_2 = star_args_2[0] + kwargs_type = get_proper_type(self.chk.lookup_type(star_arg_2)) + if not isinstance(kwargs_type, Instance) or not kwargs_type.type.has_base( + "typing.Mapping" + ): + # Error should be already reported. + return TempNode(AnyType(TypeOfAny.special_form)) + any_type = AnyType(TypeOfAny.special_form) + mapping_info = self.chk.named_generic_type("typing.Mapping", [any_type, any_type]).type + return TempNode(map_instance_to_supertype(kwargs_type, mapping_info).args[1]) + + def auto_generate_keys(self, all_specs: list[ConversionSpecifier], ctx: Context) -> bool: + """Translate '{} {name} {}' to '{0} {name} {1}'. + + Return True if generation was successful, otherwise report an error and return false. + """ + some_defined = any(s.key and s.key.isdecimal() for s in all_specs) + all_defined = all(bool(s.key) for s in all_specs) + if some_defined and not all_defined: + self.msg.fail( + "Cannot combine automatic field numbering and manual field specification", + ctx, + code=codes.STRING_FORMATTING, + ) + return False + if all_defined: + return True + next_index = 0 + for spec in all_specs: + if not spec.key: + str_index = str(next_index) + spec.key = str_index + # Update also the full field (i.e. turn {.x} into {0.x}). + if not spec.field: + spec.field = str_index + else: + spec.field = str_index + spec.field + next_index += 1 + return True + + def apply_field_accessors( + self, spec: ConversionSpecifier, repl: Expression, ctx: Context + ) -> Expression: + """Transform and validate expr in '{.attr[item]}'.format(expr) into expr.attr['item']. + + If validation fails, return TempNode(AnyType). + """ + assert spec.key, "Keys must be auto-generated first!" + if spec.field == spec.key: + return repl + assert spec.field + + temp_errors = Errors(self.chk.options) + dummy = DUMMY_FIELD_NAME + spec.field[len(spec.key) :] + temp_ast: Node = parse( + dummy, fnam="", module=None, options=self.chk.options, errors=temp_errors + ) + if temp_errors.is_errors(): + self.msg.fail( + f'Syntax error in format specifier "{spec.field}"', + ctx, + code=codes.STRING_FORMATTING, + ) + return TempNode(AnyType(TypeOfAny.from_error)) + + # These asserts are guaranteed by the original regexp. + assert isinstance(temp_ast, MypyFile) + temp_ast = temp_ast.defs[0] + assert isinstance(temp_ast, ExpressionStmt) + temp_ast = temp_ast.expr + if not self.validate_and_transform_accessors(temp_ast, repl, spec, ctx=ctx): + return TempNode(AnyType(TypeOfAny.from_error)) + + # Check if there are any other errors (like missing members). + # TODO: fix column to point to actual start of the format specifier _within_ string. + temp_ast.line = ctx.line + temp_ast.column = ctx.column + self.chk.expr_checker.accept(temp_ast) + return temp_ast + + def validate_and_transform_accessors( + self, + temp_ast: Expression, + original_repl: Expression, + spec: ConversionSpecifier, + ctx: Context, + ) -> bool: + """Validate and transform (in-place) format field accessors. + + On error, report it and return False. The transformations include replacing the dummy + variable with actual replacement expression and translating any name expressions in an + index into strings, so that this will work: + + class User(TypedDict): + name: str + id: int + u: User + '{[id]:d} -> {[name]}'.format(u) + """ + if not isinstance(temp_ast, (MemberExpr, IndexExpr)): + self.msg.fail( + "Only index and member expressions are allowed in" + ' format field accessors; got "{}"'.format(spec.field), + ctx, + code=codes.STRING_FORMATTING, + ) + return False + if isinstance(temp_ast, MemberExpr): + node = temp_ast.expr + else: + node = temp_ast.base + if not isinstance(temp_ast.index, (NameExpr, IntExpr)): + assert spec.key, "Call this method only after auto-generating keys!" + assert spec.field + self.msg.fail( + 'Invalid index expression in format field accessor "{}"'.format( + spec.field[len(spec.key) :] + ), + ctx, + code=codes.STRING_FORMATTING, + ) + return False + if isinstance(temp_ast.index, NameExpr): + temp_ast.index = StrExpr(temp_ast.index.name) + if isinstance(node, NameExpr) and node.name == DUMMY_FIELD_NAME: + # Replace it with the actual replacement expression. + assert isinstance(temp_ast, (IndexExpr, MemberExpr)) # XXX: this is redundant + if isinstance(temp_ast, IndexExpr): + temp_ast.base = original_repl + else: + temp_ast.expr = original_repl + return True + node.line = ctx.line + node.column = ctx.column + return self.validate_and_transform_accessors( + node, original_repl=original_repl, spec=spec, ctx=ctx + ) + + # TODO: In Python 3, the bytes formatting has a more restricted set of options + # compared to string formatting. + def check_str_interpolation(self, expr: FormatStringExpr, replacements: Expression) -> Type: + """Check the types of the 'replacements' in a string interpolation + expression: str % replacements. + """ + self.chk.expr_checker.accept(expr) + specifiers = parse_conversion_specifiers(expr.value) + has_mapping_keys = self.analyze_conversion_specifiers(specifiers, expr) + if has_mapping_keys is None: + pass # Error was reported + elif has_mapping_keys: + self.check_mapping_str_interpolation(specifiers, replacements, expr) + else: + self.check_simple_str_interpolation(specifiers, replacements, expr) + + if isinstance(expr, BytesExpr): + return self.named_type("builtins.bytes") + elif isinstance(expr, StrExpr): + return self.named_type("builtins.str") + else: + assert False + + def analyze_conversion_specifiers( + self, specifiers: list[ConversionSpecifier], context: Context + ) -> bool | None: + has_star = any(specifier.has_star() for specifier in specifiers) + has_key = any(specifier.has_key() for specifier in specifiers) + all_have_keys = all( + specifier.has_key() or specifier.conv_type == "%" for specifier in specifiers + ) + + if has_key and has_star: + self.msg.string_interpolation_with_star_and_key(context) + return None + if has_key and not all_have_keys: + self.msg.string_interpolation_mixing_key_and_non_keys(context) + return None + return has_key + + def check_simple_str_interpolation( + self, + specifiers: list[ConversionSpecifier], + replacements: Expression, + expr: FormatStringExpr, + ) -> None: + """Check % string interpolation with positional specifiers '%s, %d' % ('yes, 42').""" + checkers = self.build_replacement_checkers(specifiers, replacements, expr) + if checkers is None: + return + + rhs_type = get_proper_type(self.accept(replacements)) + rep_types: list[Type] = [] + if isinstance(rhs_type, TupleType): + rep_types = rhs_type.items + unpack_index = find_unpack_in_list(rep_types) + if unpack_index is not None: + # TODO: we should probably warn about potentially short tuple. + # However, without special-casing for tuple(f(i) for in other_tuple) + # this causes false positive on mypy self-check in report.py. + extras = max(0, len(checkers) - len(rep_types) + 1) + unpacked = rep_types[unpack_index] + assert isinstance(unpacked, UnpackType) + unpacked = get_proper_type(unpacked.type) + if isinstance(unpacked, TypeVarTupleType): + unpacked = get_proper_type(unpacked.upper_bound) + assert ( + isinstance(unpacked, Instance) and unpacked.type.fullname == "builtins.tuple" + ) + unpack_items = [unpacked.args[0]] * extras + rep_types = rep_types[:unpack_index] + unpack_items + rep_types[unpack_index + 1 :] + elif isinstance(rhs_type, AnyType): + return + elif isinstance(rhs_type, Instance) and rhs_type.type.fullname == "builtins.tuple": + # Assume that an arbitrary-length tuple has the right number of items. + rep_types = [rhs_type.args[0]] * len(checkers) + elif isinstance(rhs_type, UnionType): + for typ in rhs_type.relevant_items(): + temp_node = TempNode(typ) + temp_node.line = replacements.line + self.check_simple_str_interpolation(specifiers, temp_node, expr) + return + else: + rep_types = [rhs_type] + + if len(checkers) > len(rep_types): + # Only check the fix-length Tuple type. Other Iterable types would skip. + if is_subtype(rhs_type, self.chk.named_type("typing.Iterable")) and not isinstance( + rhs_type, TupleType + ): + return + else: + self.msg.too_few_string_formatting_arguments(replacements) + elif len(checkers) < len(rep_types): + self.msg.too_many_string_formatting_arguments(replacements) + else: + if len(checkers) == 1: + check_node, check_type = checkers[0] + if isinstance(rhs_type, TupleType) and len(rhs_type.items) == 1: + check_type(rhs_type.items[0]) + else: + check_node(replacements) + elif isinstance(replacements, TupleExpr) and not any( + isinstance(item, StarExpr) for item in replacements.items + ): + for checks, rep_node in zip(checkers, replacements.items): + check_node, check_type = checks + check_node(rep_node) + else: + for checks, rep_type in zip(checkers, rep_types): + check_node, check_type = checks + check_type(rep_type) + + def check_mapping_str_interpolation( + self, + specifiers: list[ConversionSpecifier], + replacements: Expression, + expr: FormatStringExpr, + ) -> None: + """Check % string interpolation with names specifiers '%(name)s' % {'name': 'John'}.""" + if isinstance(replacements, DictExpr) and all( + isinstance(k, (StrExpr, BytesExpr)) for k, v in replacements.items + ): + mapping: dict[str, Type] = {} + for k, v in replacements.items: + if isinstance(expr, BytesExpr): + # Special case: for bytes formatting keys must be bytes. + if not isinstance(k, BytesExpr): + self.msg.fail( + "Dictionary keys in bytes formatting must be bytes, not strings", + expr, + code=codes.STRING_FORMATTING, + ) + key_str = cast(FormatStringExpr, k).value + mapping[key_str] = self.accept(v) + + for specifier in specifiers: + if specifier.conv_type == "%": + # %% is allowed in mappings, no checking is required + continue + assert specifier.key is not None + if specifier.key not in mapping: + self.msg.key_not_in_mapping(specifier.key, replacements) + return + rep_type = mapping[specifier.key] + assert specifier.conv_type is not None + expected_type = self.conversion_type(specifier.conv_type, replacements, expr) + if expected_type is None: + return + self.chk.check_subtype( + rep_type, + expected_type, + replacements, + message_registry.INCOMPATIBLE_TYPES_IN_STR_INTERPOLATION, + "expression has type", + f"placeholder with key '{specifier.key}' has type", + code=codes.STRING_FORMATTING, + ) + if specifier.conv_type == "s": + self.check_s_special_cases(expr, rep_type, expr) + else: + rep_type = self.accept(replacements) + dict_type = self.build_dict_type(expr) + self.chk.check_subtype( + rep_type, + dict_type, + replacements, + message_registry.FORMAT_REQUIRES_MAPPING, + "expression has type", + "expected type for mapping is", + code=codes.STRING_FORMATTING, + ) + + def build_dict_type(self, expr: FormatStringExpr) -> Type: + """Build expected mapping type for right operand in % formatting.""" + any_type = AnyType(TypeOfAny.special_form) + if isinstance(expr, BytesExpr): + bytes_type = self.chk.named_generic_type("builtins.bytes", []) + return self.chk.named_generic_type( + "_typeshed.SupportsKeysAndGetItem", [bytes_type, any_type] + ) + elif isinstance(expr, StrExpr): + str_type = self.chk.named_generic_type("builtins.str", []) + return self.chk.named_generic_type( + "_typeshed.SupportsKeysAndGetItem", [str_type, any_type] + ) + else: + assert False, "Unreachable" + + def build_replacement_checkers( + self, specifiers: list[ConversionSpecifier], context: Context, expr: FormatStringExpr + ) -> list[Checkers] | None: + checkers: list[Checkers] = [] + for specifier in specifiers: + checker = self.replacement_checkers(specifier, context, expr) + if checker is None: + return None + checkers.extend(checker) + return checkers + + def replacement_checkers( + self, specifier: ConversionSpecifier, context: Context, expr: FormatStringExpr + ) -> list[Checkers] | None: + """Returns a list of tuples of two functions that check whether a replacement is + of the right type for the specifier. The first function takes a node and checks + its type in the right type context. The second function just checks a type. + """ + checkers: list[Checkers] = [] + + if specifier.width == "*": + checkers.append(self.checkers_for_star(context)) + if specifier.precision == "*": + checkers.append(self.checkers_for_star(context)) + + if specifier.conv_type == "c": + c = self.checkers_for_c_type(specifier.conv_type, context, expr) + if c is None: + return None + checkers.append(c) + elif specifier.conv_type is not None and specifier.conv_type != "%": + c = self.checkers_for_regular_type(specifier.conv_type, context, expr) + if c is None: + return None + checkers.append(c) + return checkers + + def checkers_for_star(self, context: Context) -> Checkers: + """Returns a tuple of check functions that check whether, respectively, + a node or a type is compatible with a star in a conversion specifier. + """ + expected = self.named_type("builtins.int") + + def check_type(type: Type) -> bool: + expected = self.named_type("builtins.int") + return self.chk.check_subtype( + type, expected, context, "* wants int", code=codes.STRING_FORMATTING + ) + + def check_expr(expr: Expression) -> None: + type = self.accept(expr, expected) + check_type(type) + + return check_expr, check_type + + def check_placeholder_type(self, typ: Type, expected_type: Type, context: Context) -> bool: + return self.chk.check_subtype( + typ, + expected_type, + context, + message_registry.INCOMPATIBLE_TYPES_IN_STR_INTERPOLATION, + "expression has type", + "placeholder has type", + code=codes.STRING_FORMATTING, + ) + + def checkers_for_regular_type( + self, conv_type: str, context: Context, expr: FormatStringExpr + ) -> Checkers | None: + """Returns a tuple of check functions that check whether, respectively, + a node or a type is compatible with 'type'. Return None in case of an error. + """ + expected_type = self.conversion_type(conv_type, context, expr) + if expected_type is None: + return None + + def check_type(typ: Type) -> bool: + assert expected_type is not None + ret = self.check_placeholder_type(typ, expected_type, context) + if ret and conv_type == "s": + ret = self.check_s_special_cases(expr, typ, context) + return ret + + def check_expr(expr: Expression) -> None: + type = self.accept(expr, expected_type) + check_type(type) + + return check_expr, check_type + + def check_s_special_cases(self, expr: FormatStringExpr, typ: Type, context: Context) -> bool: + """Additional special cases for %s in bytes vs string context.""" + if isinstance(expr, StrExpr): + # Couple special cases for string formatting. + if has_type_component(typ, "builtins.bytes"): + self.msg.fail( + 'If x = b\'abc\' then "%s" % x produces "b\'abc\'", not "abc". ' + 'If this is desired behavior use "%r" % x. Otherwise, decode the bytes', + context, + code=codes.STR_BYTES_PY3, + ) + return False + if isinstance(expr, BytesExpr): + # A special case for bytes formatting: b'%s' actually requires bytes on Python 3. + if has_type_component(typ, "builtins.str"): + self.msg.fail( + "On Python 3 b'%s' requires bytes, not string", + context, + code=codes.STRING_FORMATTING, + ) + return False + return True + + def checkers_for_c_type( + self, type: str, context: Context, format_expr: FormatStringExpr + ) -> Checkers | None: + """Returns a tuple of check functions that check whether, respectively, + a node or a type is compatible with 'type' that is a character type. + """ + expected_type = self.conversion_type(type, context, format_expr) + if expected_type is None: + return None + + def check_type(type: Type) -> bool: + assert expected_type is not None + if isinstance(format_expr, BytesExpr): + err_msg = '"%c" requires an integer in range(256) or a single byte' + else: + err_msg = '"%c" requires int or char' + return self.chk.check_subtype( + type, + expected_type, + context, + err_msg, + "expression has type", + code=codes.STRING_FORMATTING, + ) + + def check_expr(expr: Expression) -> None: + """int, or str with length 1""" + type = self.accept(expr, expected_type) + # We need further check with expr to make sure that + # it has exact one char or one single byte. + if check_type(type): + # Python 3 doesn't support b'%c' % str + if ( + isinstance(format_expr, BytesExpr) + and isinstance(expr, BytesExpr) + and len(expr.value) != 1 + ): + self.msg.requires_int_or_single_byte(context) + elif isinstance(expr, (StrExpr, BytesExpr)) and len(expr.value) != 1: + self.msg.requires_int_or_char(context) + + return check_expr, check_type + + def conversion_type( + self, p: str, context: Context, expr: FormatStringExpr, format_call: bool = False + ) -> Type | None: + """Return the type that is accepted for a string interpolation conversion specifier type. + + Note that both Python's float (e.g. %f) and integer (e.g. %d) + specifier types accept both float and integers. + + The 'format_call' argument indicates whether this type came from % interpolation or from + a str.format() call, the meaning of few formatting types are different. + """ + NUMERIC_TYPES = NUMERIC_TYPES_NEW if format_call else NUMERIC_TYPES_OLD + INT_TYPES = REQUIRE_INT_NEW if format_call else REQUIRE_INT_OLD + if p == "b" and not format_call: + if not isinstance(expr, BytesExpr): + self.msg.fail( + 'Format character "b" is only supported on bytes patterns', + context, + code=codes.STRING_FORMATTING, + ) + return None + return self.named_type("builtins.bytes") + elif p == "a": + # TODO: return type object? + return AnyType(TypeOfAny.special_form) + elif p in ["s", "r"]: + return AnyType(TypeOfAny.special_form) + elif p in NUMERIC_TYPES: + if p in INT_TYPES: + numeric_types = [self.named_type("builtins.int")] + else: + numeric_types = [ + self.named_type("builtins.int"), + self.named_type("builtins.float"), + ] + if not format_call: + if p in FLOAT_TYPES: + numeric_types.append(self.named_type("typing.SupportsFloat")) + else: + numeric_types.append(self.named_type("typing.SupportsInt")) + return UnionType.make_union(numeric_types) + elif p in ["c"]: + if isinstance(expr, BytesExpr): + return UnionType( + [self.named_type("builtins.int"), self.named_type("builtins.bytes")] + ) + else: + return UnionType( + [self.named_type("builtins.int"), self.named_type("builtins.str")] + ) + else: + self.msg.unsupported_placeholder(p, context) + return None + + # + # Helpers + # + + def named_type(self, name: str) -> Instance: + """Return an instance type with type given by the name and no type + arguments. Alias for TypeChecker.named_type. + """ + return self.chk.named_type(name) + + def accept(self, expr: Expression, context: Type | None = None) -> Type: + """Type check a node. Alias for TypeChecker.accept.""" + return self.chk.expr_checker.accept(expr, context) + + +def has_type_component(typ: Type, fullname: str) -> bool: + """Is this a specific instance type, or a union that contains it? + + We use this ad-hoc function instead of a proper visitor or subtype check + because some str vs bytes errors are strictly speaking not runtime errors, + but rather highly counter-intuitive behavior. This is similar to what is used for + --strict-equality. + """ + typ = get_proper_type(typ) + if isinstance(typ, Instance): + return typ.type.has_base(fullname) + elif isinstance(typ, TypeVarType): + return has_type_component(typ.upper_bound, fullname) or any( + has_type_component(v, fullname) for v in typ.values + ) + elif isinstance(typ, UnionType): + return any(has_type_component(t, fullname) for t in typ.relevant_items()) + return False diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/config_parser.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/config_parser.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..fe960aa9e4d999fe75384b1405d575767e2e3b57 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/config_parser.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/config_parser.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/config_parser.py new file mode 100644 index 0000000000000000000000000000000000000000..747981916960d65f698cb46351f6a83e4b075063 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/config_parser.py @@ -0,0 +1,734 @@ +from __future__ import annotations + +import argparse +import configparser +import glob as fileglob +import os +import re +import sys +from io import StringIO + +if sys.version_info >= (3, 11): + import tomllib +else: + import tomli as tomllib + +from collections.abc import Callable, Mapping, MutableMapping, Sequence +from typing import Any, Final, TextIO, TypeAlias +from typing_extensions import Never + +from mypy import defaults +from mypy.options import PER_MODULE_OPTIONS, Options + +_CONFIG_VALUE_TYPES: TypeAlias = ( + str | bool | int | float | dict[str, str] | list[str] | tuple[int, int] +) +_INI_PARSER_CALLABLE: TypeAlias = Callable[[Any], _CONFIG_VALUE_TYPES] + + +class VersionTypeError(argparse.ArgumentTypeError): + """Provide a fallback value if the Python version is unsupported.""" + + def __init__(self, *args: Any, fallback: tuple[int, int]) -> None: + self.fallback = fallback + super().__init__(*args) + + +def parse_version(v: str | float) -> tuple[int, int]: + m = re.match(r"\A(\d)\.(\d+)\Z", str(v)) + if not m: + raise argparse.ArgumentTypeError(f"Invalid python version '{v}' (expected format: 'x.y')") + major, minor = int(m.group(1)), int(m.group(2)) + if major == 2 and minor == 7: + pass # Error raised elsewhere + elif major == 3: + if minor < defaults.PYTHON3_VERSION_MIN[1]: + msg = "Python 3.{} is not supported (must be {}.{} or higher)".format( + minor, *defaults.PYTHON3_VERSION_MIN + ) + + if isinstance(v, float): + msg += ". You may need to put quotes around your Python version" + + raise VersionTypeError(msg, fallback=defaults.PYTHON3_VERSION_MIN) + else: + raise argparse.ArgumentTypeError( + f"Python major version '{major}' out of range (must be 3)" + ) + return major, minor + + +def try_split(v: str | Sequence[str] | object, split_regex: str = ",") -> list[str]: + """Split and trim a str or sequence (eg: list) of str into a list of str. + If an element of the input is not str, a type error will be raised.""" + + def complain(x: object, additional_info: str = "") -> Never: + raise argparse.ArgumentTypeError( + f"Expected a list or a stringified version thereof, but got: '{x}', of type {type(x).__name__}.{additional_info}" + ) + + if isinstance(v, str): + items = [p.strip() for p in re.split(split_regex, v)] + if items and items[-1] == "": + items.pop(-1) + return items + elif isinstance(v, Sequence): + return [ + ( + p.strip() + if isinstance(p, str) + else complain(p, additional_info=" (As an element of the list.)") + ) + for p in v + ] + else: + complain(v) + + +def validate_package_allow_list(allow_list: list[str]) -> list[str]: + for p in allow_list: + msg = f"Invalid allow list entry: {p}" + if "*" in p: + raise argparse.ArgumentTypeError( + f"{msg} (entries are already prefixes so must not contain *)" + ) + if "\\" in p or "/" in p: + raise argparse.ArgumentTypeError( + f"{msg} (entries must be packages like foo.bar not directories or files)" + ) + return allow_list + + +def expand_path(path: str) -> str: + """Expand the user home directory and any environment variables contained within + the provided path. + """ + + return os.path.expandvars(os.path.expanduser(path)) + + +def str_or_array_as_list(v: str | Sequence[str]) -> list[str]: + if isinstance(v, str): + return [v.strip()] if v.strip() else [] + return [p.strip() for p in v if p.strip()] + + +def split_and_match_files_list(paths: Sequence[str]) -> list[str]: + """Take a list of files/directories (with support for globbing through the glob library). + + Where a path/glob matches no file, we still include the raw path in the resulting list. + + Returns a list of file paths + """ + expanded_paths = [] + + for path in paths: + path = expand_path(path.strip()) + globbed_files = fileglob.glob(path, recursive=True) + if globbed_files: + expanded_paths.extend(globbed_files) + else: + expanded_paths.append(path) + + return expanded_paths + + +def split_and_match_files(paths: str) -> list[str]: + """Take a string representing a list of files/directories (with support for globbing + through the glob library). + + Where a path/glob matches no file, we still include the raw path in the resulting list. + + Returns a list of file paths + """ + + return split_and_match_files_list(split_commas(paths)) + + +def check_follow_imports(choice: str) -> str: + choices = ["normal", "silent", "skip", "error"] + if choice not in choices: + raise argparse.ArgumentTypeError( + "invalid choice '{}' (choose from {})".format( + choice, ", ".join(f"'{x}'" for x in choices) + ) + ) + return choice + + +def check_junit_format(choice: str) -> str: + choices = ["global", "per_file"] + if choice not in choices: + raise argparse.ArgumentTypeError( + "invalid choice '{}' (choose from {})".format( + choice, ", ".join(f"'{x}'" for x in choices) + ) + ) + return choice + + +def split_commas(value: str) -> list[str]: + # Uses a bit smarter technique to allow last trailing comma + # and to remove last `""` item from the split. + items = value.split(",") + if items and items[-1] == "": + items.pop(-1) + return items + + +# For most options, the type of the default value set in options.py is +# sufficient, and we don't have to do anything here. This table +# exists to specify types for values initialized to None or container +# types. +ini_config_types: Final[dict[str, _INI_PARSER_CALLABLE]] = { + "python_version": parse_version, + "custom_typing_module": str, + "custom_typeshed_dir": expand_path, + "mypy_path": lambda s: [expand_path(p.strip()) for p in re.split("[,:]", s)], + "files": split_and_match_files, + "quickstart_file": expand_path, + "junit_xml": expand_path, + "junit_format": check_junit_format, + "follow_imports": check_follow_imports, + "no_site_packages": bool, + "plugins": lambda s: [p.strip() for p in split_commas(s)], + "always_true": lambda s: [p.strip() for p in split_commas(s)], + "always_false": lambda s: [p.strip() for p in split_commas(s)], + "untyped_calls_exclude": lambda s: validate_package_allow_list( + [p.strip() for p in split_commas(s)] + ), + "enable_incomplete_feature": lambda s: [p.strip() for p in split_commas(s)], + "disable_error_code": lambda s: [p.strip() for p in split_commas(s)], + "enable_error_code": lambda s: [p.strip() for p in split_commas(s)], + "package_root": lambda s: [p.strip() for p in split_commas(s)], + "cache_dir": expand_path, + "python_executable": expand_path, + "strict": bool, + "exclude": lambda s: [s.strip()], + "packages": try_split, + "modules": try_split, +} + +# Reuse the ini_config_types and overwrite the diff +toml_config_types: Final[dict[str, _INI_PARSER_CALLABLE]] = ini_config_types.copy() +toml_config_types.update( + { + "python_version": parse_version, + "mypy_path": lambda s: [expand_path(p) for p in try_split(s, "[,:]")], + "files": lambda s: split_and_match_files_list(try_split(s)), + "junit_format": lambda s: check_junit_format(str(s)), + "follow_imports": lambda s: check_follow_imports(str(s)), + "plugins": try_split, + "always_true": try_split, + "always_false": try_split, + "untyped_calls_exclude": lambda s: validate_package_allow_list(try_split(s)), + "enable_incomplete_feature": try_split, + "disable_error_code": lambda s: try_split(s), + "enable_error_code": lambda s: try_split(s), + "package_root": try_split, + "exclude": str_or_array_as_list, + "packages": try_split, + "modules": try_split, + } +) + + +def _parse_individual_file( + config_file: str, stderr: TextIO | None = None +) -> tuple[MutableMapping[str, Any], dict[str, _INI_PARSER_CALLABLE], str] | None: + + if not os.path.exists(config_file): + return None + + parser: MutableMapping[str, Any] + try: + if is_toml(config_file): + with open(config_file, "rb") as f: + toml_data = tomllib.load(f) + # Filter down to just mypy relevant toml keys + toml_data = toml_data.get("tool", {}) + if "mypy" not in toml_data: + return None + toml_data = {"mypy": toml_data["mypy"]} + parser = destructure_overrides(toml_data) + config_types = toml_config_types + else: + parser = configparser.RawConfigParser() + parser.read(config_file) + config_types = ini_config_types + + except (tomllib.TOMLDecodeError, configparser.Error, ConfigTOMLValueError) as err: + print(f"{config_file}: {err}", file=stderr) + return None + + if os.path.basename(config_file) in defaults.SHARED_CONFIG_NAMES and "mypy" not in parser: + return None + + return parser, config_types, config_file + + +def _find_config_file( + stderr: TextIO | None = None, +) -> tuple[MutableMapping[str, Any], dict[str, _INI_PARSER_CALLABLE], str] | None: + + current_dir = os.path.abspath(os.getcwd()) + + while True: + for name in defaults.CONFIG_NAMES + defaults.SHARED_CONFIG_NAMES: + config_file = os.path.relpath(os.path.join(current_dir, name)) + ret = _parse_individual_file(config_file, stderr) + if ret is None: + continue + return ret + + if any( + os.path.exists(os.path.join(current_dir, cvs_root)) for cvs_root in (".git", ".hg") + ): + break + parent_dir = os.path.dirname(current_dir) + if parent_dir == current_dir: + break + current_dir = parent_dir + + for config_file in defaults.USER_CONFIG_FILES: + ret = _parse_individual_file(config_file, stderr) + if ret is None: + continue + return ret + + return None + + +def parse_config_file( + options: Options, + set_strict_flags: Callable[[], None], + filename: str | None, + stdout: TextIO | None = None, + stderr: TextIO | None = None, +) -> None: + """Parse a config file into an Options object. + + Errors are written to stderr but are not fatal. + + If filename is None, fall back to default config files. + """ + stdout = stdout or sys.stdout + stderr = stderr or sys.stderr + + ret = ( + _parse_individual_file(filename, stderr) + if filename is not None + else _find_config_file(stderr) + ) + if ret is None: + return + parser, config_types, file_read = ret + + options.config_file = file_read + os.environ["MYPY_CONFIG_FILE_DIR"] = os.path.dirname(os.path.abspath(file_read)) + + if "mypy" not in parser: + if filename or os.path.basename(file_read) not in defaults.SHARED_CONFIG_NAMES: + print(f"{file_read}: No [mypy] section in config file", file=stderr) + else: + section = parser["mypy"] + prefix = f"{file_read}: [mypy]: " + updates, report_dirs = parse_section( + prefix, options, set_strict_flags, section, config_types, stderr + ) + for k, v in updates.items(): + setattr(options, k, v) + options.report_dirs.update(report_dirs) + + for name, section in parser.items(): + if name.startswith("mypy-"): + prefix = get_prefix(file_read, name) + updates, report_dirs = parse_section( + prefix, options, set_strict_flags, section, config_types, stderr + ) + if report_dirs: + print( + prefix, + "Per-module sections should not specify reports ({})".format( + ", ".join(s + "_report" for s in sorted(report_dirs)) + ), + file=stderr, + ) + if set(updates) - PER_MODULE_OPTIONS: + print( + prefix, + "Per-module sections should only specify per-module flags ({})".format( + ", ".join(sorted(set(updates) - PER_MODULE_OPTIONS)) + ), + file=stderr, + ) + updates = {k: v for k, v in updates.items() if k in PER_MODULE_OPTIONS} + + globs = name[5:] + for glob in globs.split(","): + # For backwards compatibility, replace (back)slashes with dots. + glob = glob.replace(os.sep, ".") + if os.altsep: + glob = glob.replace(os.altsep, ".") + + if any(c in glob for c in "?[]!") or any( + "*" in x and x != "*" for x in glob.split(".") + ): + print( + prefix, + "Patterns must be fully-qualified module names, optionally " + "with '*' in some components (e.g spam.*.eggs.*)", + file=stderr, + ) + else: + options.per_module_options[glob] = updates + + +def get_prefix(file_read: str, name: str) -> str: + if is_toml(file_read): + module_name_str = 'module = "%s"' % "-".join(name.split("-")[1:]) + else: + module_name_str = name + + return f"{file_read}: [{module_name_str}]:" + + +def is_toml(filename: str) -> bool: + return filename.lower().endswith(".toml") + + +def destructure_overrides(toml_data: dict[str, Any]) -> dict[str, Any]: + """Take the new [[tool.mypy.overrides]] section array in the pyproject.toml file, + and convert it back to a flatter structure that the existing config_parser can handle. + + E.g. the following pyproject.toml file: + + [[tool.mypy.overrides]] + module = [ + "a.b", + "b.*" + ] + disallow_untyped_defs = true + + [[tool.mypy.overrides]] + module = 'c' + disallow_untyped_defs = false + + Would map to the following config dict that it would have gotten from parsing an equivalent + ini file: + + { + "mypy-a.b": { + disallow_untyped_defs = true, + }, + "mypy-b.*": { + disallow_untyped_defs = true, + }, + "mypy-c": { + disallow_untyped_defs: false, + }, + } + """ + if "overrides" not in toml_data["mypy"]: + return toml_data + + if not isinstance(toml_data["mypy"]["overrides"], list): + raise ConfigTOMLValueError( + "tool.mypy.overrides sections must be an array. Please make " + "sure you are using double brackets like so: [[tool.mypy.overrides]]" + ) + + result = toml_data.copy() + for override in result["mypy"]["overrides"]: + if "module" not in override: + raise ConfigTOMLValueError( + "toml config file contains a [[tool.mypy.overrides]] " + "section, but no module to override was specified." + ) + + if isinstance(override["module"], str): + modules = [override["module"]] + elif isinstance(override["module"], list): + modules = override["module"] + else: + raise ConfigTOMLValueError( + "toml config file contains a [[tool.mypy.overrides]] " + "section with a module value that is not a string or a list of " + "strings" + ) + + for module in modules: + module_overrides = override.copy() + del module_overrides["module"] + old_config_name = f"mypy-{module}" + if old_config_name not in result: + result[old_config_name] = module_overrides + else: + for new_key, new_value in module_overrides.items(): + if ( + new_key in result[old_config_name] + and result[old_config_name][new_key] != new_value + ): + raise ConfigTOMLValueError( + "toml config file contains " + "[[tool.mypy.overrides]] sections with conflicting " + f"values. Module '{module}' has two different values for '{new_key}'" + ) + result[old_config_name][new_key] = new_value + + del result["mypy"]["overrides"] + return result + + +def parse_section( + prefix: str, + template: Options, + set_strict_flags: Callable[[], None], + section: Mapping[str, Any], + config_types: dict[str, Any], + stderr: TextIO = sys.stderr, +) -> tuple[dict[str, object], dict[str, str]]: + """Parse one section of a config file. + + Returns a dict of option values encountered, and a dict of report directories. + """ + results: dict[str, object] = {} + report_dirs: dict[str, str] = {} + + # Because these fields exist on Options, without proactive checking, we would accept them + # and crash later + invalid_options = { + "enabled_error_codes": "enable_error_code", + "disabled_error_codes": "disable_error_code", + } + + for key in section: + invert = False + # Here we use `key` for original config section key, and `options_key` for + # the corresponding Options attribute. + options_key = key + # Match aliasing for command line flag. + if key.endswith("allow_redefinition"): + options_key += "_old" + if key in config_types: + ct = config_types[key] + elif key in invalid_options: + print( + f"{prefix}Unrecognized option: {key} = {section[key]}" + f" (did you mean {invalid_options[key]}?)", + file=stderr, + ) + continue + else: + dv = getattr(template, options_key, None) + if dv is None: + if key.endswith("_report"): + report_type = key[:-7].replace("_", "-") + if report_type in defaults.REPORTER_NAMES: + report_dirs[report_type] = str(section[key]) + else: + print(f"{prefix}Unrecognized report type: {key}", file=stderr) + continue + if key.startswith("x_"): + pass # Don't complain about `x_blah` flags + elif key.startswith("no_") and hasattr(template, options_key[3:]): + options_key = options_key[3:] + invert = True + elif key.startswith("allow") and hasattr(template, "dis" + options_key): + options_key = "dis" + options_key + invert = True + elif key.startswith("disallow") and hasattr(template, options_key[3:]): + options_key = options_key[3:] + invert = True + elif key.startswith("show_") and hasattr(template, "hide_" + options_key[5:]): + options_key = "hide_" + options_key[5:] + invert = True + elif key == "strict": + pass # Special handling below + else: + print(f"{prefix}Unrecognized option: {key} = {section[key]}", file=stderr) + if invert: + dv = getattr(template, options_key, None) + else: + continue + ct = type(dv) if dv is not None else None + v: Any = None + try: + if ct is bool: + if isinstance(section, dict): + v = convert_to_boolean(section.get(key)) + else: + v = section.getboolean(key) # type: ignore[attr-defined] # Until better stub + if invert: + v = not v + elif callable(ct): + if invert: + print(f"{prefix}Can not invert non-boolean key {options_key}", file=stderr) + continue + try: + v = ct(section.get(key)) + except VersionTypeError as err_version: + print(f"{prefix}{key}: {err_version}", file=stderr) + v = err_version.fallback + except argparse.ArgumentTypeError as err: + print(f"{prefix}{key}: {err}", file=stderr) + continue + else: + print(f"{prefix}Don't know what type {key} should have", file=stderr) + continue + except ValueError as err: + print(f"{prefix}{key}: {err}", file=stderr) + continue + if key == "strict": + if v: + set_strict_flags() + continue + results[options_key] = v + + # These two flags act as per-module overrides, so store the empty defaults. + if "disable_error_code" not in results: + results["disable_error_code"] = [] + if "enable_error_code" not in results: + results["enable_error_code"] = [] + + return results, report_dirs + + +def convert_to_boolean(value: Any | None) -> bool: + """Return a boolean value translating from other types if necessary.""" + if isinstance(value, bool): + return value + if not isinstance(value, str): + value = str(value) + if value.lower() not in configparser.RawConfigParser.BOOLEAN_STATES: + raise ValueError(f"Not a boolean: {value}") + return configparser.RawConfigParser.BOOLEAN_STATES[value.lower()] + + +def split_directive(s: str) -> tuple[list[str], list[str]]: + """Split s on commas, except during quoted sections. + + Returns the parts and a list of error messages.""" + parts = [] + cur: list[str] = [] + errors = [] + i = 0 + while i < len(s): + if s[i] == ",": + parts.append("".join(cur).strip()) + cur = [] + elif s[i] == '"': + i += 1 + while i < len(s) and s[i] != '"': + cur.append(s[i]) + i += 1 + if i == len(s): + errors.append("Unterminated quote in configuration comment") + cur.clear() + else: + cur.append(s[i]) + i += 1 + if cur: + parts.append("".join(cur).strip()) + + return parts, errors + + +def mypy_comments_to_config_map(line: str, template: Options) -> tuple[dict[str, str], list[str]]: + """Rewrite the mypy comment syntax into ini file syntax.""" + options = {} + entries, errors = split_directive(line) + for entry in entries: + if "=" not in entry: + name = entry + value = None + else: + name, value = (x.strip() for x in entry.split("=", 1)) + + name = name.replace("-", "_") + if value is None: + value = "True" + options[name] = value + + return options, errors + + +def parse_mypy_comments( + args: list[tuple[int, str]], template: Options +) -> tuple[dict[str, object], list[tuple[int, str]]]: + """Parse a collection of inline mypy: configuration comments. + + Returns a dictionary of options to be applied and a list of error messages + generated. + """ + errors: list[tuple[int, str]] = [] + sections: dict[str, object] = {"enable_error_code": [], "disable_error_code": []} + + for lineno, line in args: + # In order to easily match the behavior for bools, we abuse configparser. + # Oddly, the only way to get the SectionProxy object with the getboolean + # method is to create a config parser. + parser = configparser.RawConfigParser() + options, parse_errors = mypy_comments_to_config_map(line, template) + if "python_version" in options: + errors.append((lineno, "python_version not supported in inline configuration")) + del options["python_version"] + + parser["dummy"] = options + errors.extend((lineno, x) for x in parse_errors) + + stderr = StringIO() + strict_found = False + + def set_strict_flags() -> None: + nonlocal strict_found + strict_found = True + + new_sections, reports = parse_section( + "", template, set_strict_flags, parser["dummy"], ini_config_types, stderr=stderr + ) + errors.extend((lineno, x) for x in stderr.getvalue().strip().split("\n") if x) + if reports: + errors.append((lineno, "Reports not supported in inline configuration")) + if strict_found: + errors.append( + ( + lineno, + 'Setting "strict" not supported in inline configuration: specify it in ' + "a configuration file instead, or set individual inline flags " + '(see "mypy -h" for the list of flags enabled in strict mode)', + ) + ) + # Because this is currently special-cased + # (the new_sections for an inline config *always* includes 'disable_error_code' and + # 'enable_error_code' fields, usually empty, which overwrite the old ones), + # we have to manipulate them specially. + # This could use a refactor, but so could the whole subsystem. + if ( + "enable_error_code" in new_sections + and isinstance(neec := new_sections["enable_error_code"], list) + and isinstance(eec := sections.get("enable_error_code", []), list) + ): + new_sections["enable_error_code"] = sorted(set(neec + eec)) + if ( + "disable_error_code" in new_sections + and isinstance(ndec := new_sections["disable_error_code"], list) + and isinstance(dec := sections.get("disable_error_code", []), list) + ): + new_sections["disable_error_code"] = sorted(set(ndec + dec)) + sections.update(new_sections) + return sections, errors + + +def get_config_module_names(filename: str | None, modules: list[str]) -> str: + if not filename or not modules: + return "" + + if not is_toml(filename): + return ", ".join(f"[mypy-{module}]" for module in modules) + + return "module = ['%s']" % ("', '".join(sorted(modules))) + + +class ConfigTOMLValueError(ValueError): + pass diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/constant_fold.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/constant_fold.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..05259515d45dbde48f8e81512630f601457c79ed Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/constant_fold.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/constant_fold.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/constant_fold.py new file mode 100644 index 0000000000000000000000000000000000000000..e1b915df229855b01dc737c564fff0596aa1e03e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/constant_fold.py @@ -0,0 +1,187 @@ +"""Constant folding of expressions. + +For example, 3 + 5 can be constant folded into 8. +""" + +from __future__ import annotations + +from typing import Final + +from mypy.nodes import ( + ComplexExpr, + Expression, + FloatExpr, + IntExpr, + NameExpr, + OpExpr, + StrExpr, + UnaryExpr, + Var, +) + +# All possible result types of constant folding +ConstantValue = int | bool | float | complex | str +CONST_TYPES: Final = (int, bool, float, complex, str) + + +def constant_fold_expr(expr: Expression, cur_mod_id: str) -> ConstantValue | None: + """Return the constant value of an expression for supported operations. + + Among other things, support int arithmetic and string + concatenation. For example, the expression 3 + 5 has the constant + value 8. + + Also bind simple references to final constants defined in the + current module (cur_mod_id). Binding to references is best effort + -- we don't bind references to other modules. Mypyc trusts these + to be correct in compiled modules, so that it can replace a + constant expression (or a reference to one) with the statically + computed value. We don't want to infer constant values based on + stubs, in particular, as these might not match the implementation + (due to version skew, for example). + + Return None if unsuccessful. + """ + if isinstance(expr, IntExpr): + return expr.value + if isinstance(expr, StrExpr): + return expr.value + if isinstance(expr, FloatExpr): + return expr.value + if isinstance(expr, ComplexExpr): + return expr.value + elif isinstance(expr, NameExpr): + if expr.name == "True": + return True + elif expr.name == "False": + return False + node = expr.node + if ( + isinstance(node, Var) + and node.is_final + and node.fullname.rsplit(".", 1)[0] == cur_mod_id + ): + value = node.final_value + if isinstance(value, (CONST_TYPES)): + return value + elif isinstance(expr, OpExpr): + left = constant_fold_expr(expr.left, cur_mod_id) + right = constant_fold_expr(expr.right, cur_mod_id) + if left is not None and right is not None: + return constant_fold_binary_op(expr.op, left, right) + elif isinstance(expr, UnaryExpr): + value = constant_fold_expr(expr.expr, cur_mod_id) + if value is not None: + return constant_fold_unary_op(expr.op, value) + return None + + +def constant_fold_binary_op( + op: str, left: ConstantValue, right: ConstantValue +) -> ConstantValue | None: + if isinstance(left, int) and isinstance(right, int): + return constant_fold_binary_int_op(op, left, right) + + # Float and mixed int/float arithmetic. + if isinstance(left, float) and isinstance(right, float): + return constant_fold_binary_float_op(op, left, right) + elif isinstance(left, float) and isinstance(right, int): + return constant_fold_binary_float_op(op, left, right) + elif isinstance(left, int) and isinstance(right, float): + return constant_fold_binary_float_op(op, left, right) + + # String concatenation and multiplication. + if op == "+" and isinstance(left, str) and isinstance(right, str): + return left + right + elif op == "*" and isinstance(left, str) and isinstance(right, int): + return left * right + elif op == "*" and isinstance(left, int) and isinstance(right, str): + return left * right + + # Complex construction. + if op == "+" and isinstance(left, (int, float)) and isinstance(right, complex): + return left + right + elif op == "+" and isinstance(left, complex) and isinstance(right, (int, float)): + return left + right + elif op == "-" and isinstance(left, (int, float)) and isinstance(right, complex): + return left - right + elif op == "-" and isinstance(left, complex) and isinstance(right, (int, float)): + return left - right + + return None + + +def constant_fold_binary_int_op(op: str, left: int, right: int) -> int | float | None: + if op == "+": + return left + right + if op == "-": + return left - right + elif op == "*": + return left * right + elif op == "/": + if right != 0: + return left / right + elif op == "//": + if right != 0: + return left // right + elif op == "%": + if right != 0: + return left % right + elif op == "&": + return left & right + elif op == "|": + return left | right + elif op == "^": + return left ^ right + elif op == "<<": + if right >= 0: + return left << right + elif op == ">>": + if right >= 0: + return left >> right + elif op == "**": + if right >= 0: + ret = left**right + assert isinstance(ret, int) + return ret + return None + + +def constant_fold_binary_float_op(op: str, left: int | float, right: int | float) -> float | None: + assert not (isinstance(left, int) and isinstance(right, int)), (op, left, right) + if op == "+": + return left + right + elif op == "-": + return left - right + elif op == "*": + return left * right + elif op == "/": + if right != 0: + return left / right + elif op == "//": + if right != 0: + return left // right + elif op == "%": + if right != 0: + return left % right + elif op == "**": + if (left < 0 and isinstance(right, int)) or left > 0: + try: + ret = left**right + except OverflowError: + return None + else: + assert isinstance(ret, float), ret + return ret + + return None + + +def constant_fold_unary_op(op: str, value: ConstantValue) -> int | float | None: + if op == "-" and isinstance(value, (int, float)): + return -value + elif op == "~" and isinstance(value, int): + return ~value + elif op == "+" and isinstance(value, (int, float)): + return value + return None diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/constraints.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/constraints.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..e2999a111d755086bc8d54a01135f85e6fcd2b7d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/constraints.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/constraints.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/constraints.py new file mode 100644 index 0000000000000000000000000000000000000000..df79fdae5456cf679e70a8131d6b9c79560957e4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/constraints.py @@ -0,0 +1,1687 @@ +"""Type inference constraints.""" + +from __future__ import annotations + +from collections.abc import Iterable, Sequence +from typing import TYPE_CHECKING, Final, TypeGuard, cast + +import mypy.subtypes +import mypy.typeops +from mypy.argmap import ArgTypeExpander +from mypy.erasetype import erase_typevars +from mypy.maptype import map_instance_to_supertype +from mypy.nodes import ( + ARG_OPT, + ARG_POS, + ARG_STAR, + ARG_STAR2, + CONTRAVARIANT, + COVARIANT, + ArgKind, + TypeInfo, +) +from mypy.types import ( + TUPLE_LIKE_INSTANCE_NAMES, + AnyType, + CallableType, + DeletedType, + ErasedType, + Instance, + LiteralType, + NoneType, + NormalizedCallableType, + Overloaded, + Parameters, + ParamSpecType, + PartialType, + ProperType, + TupleType, + Type, + TypeAliasType, + TypedDictType, + TypeOfAny, + TypeType, + TypeVarId, + TypeVarLikeType, + TypeVarTupleType, + TypeVarType, + TypeVisitor, + UnboundType, + UninhabitedType, + UnionType, + UnpackType, + find_unpack_in_list, + flatten_nested_tuples, + get_proper_type, + has_recursive_types, + has_type_vars, + is_named_instance, + split_with_prefix_and_suffix, +) +from mypy.types_utils import is_union_with_any +from mypy.typestate import type_state + +if TYPE_CHECKING: + from mypy.infer import ArgumentInferContext + +SUBTYPE_OF: Final = 0 +SUPERTYPE_OF: Final = 1 + + +class Constraint: + """A representation of a type constraint. + + It can be either T <: type or T :> type (T is a type variable). + """ + + type_var: TypeVarId + op = 0 # SUBTYPE_OF or SUPERTYPE_OF + target: Type + + def __init__(self, type_var: TypeVarLikeType, op: int, target: Type) -> None: + self.type_var = type_var.id + self.op = op + # TODO: should we add "assert not isinstance(target, UnpackType)"? + # UnpackType is a synthetic type, and is never valid as a constraint target. + self.target = target + self.origin_type_var = type_var + # These are additional type variables that should be solved for together with type_var. + # TODO: A cleaner solution may be to modify the return type of infer_constraints() + # to include these instead, but this is a rather big refactoring. + self.extra_tvars: list[TypeVarLikeType] = [] + + def __repr__(self) -> str: + op_str = "<:" + if self.op == SUPERTYPE_OF: + op_str = ":>" + return f"{self.type_var} {op_str} {self.target}" + + def __hash__(self) -> int: + return hash((self.type_var, self.op, self.target)) + + def __eq__(self, other: object) -> bool: + if not isinstance(other, Constraint): + return False + return (self.type_var, self.op, self.target) == (other.type_var, other.op, other.target) + + +def infer_constraints_for_callable( + callee: CallableType, + arg_types: Sequence[Type | None], + arg_kinds: list[ArgKind], + arg_names: Sequence[str | None] | None, + formal_to_actual: list[list[int]], + context: ArgumentInferContext, +) -> list[Constraint]: + """Infer type variable constraints for a callable and actual arguments. + + Return a list of constraints. + """ + constraints: list[Constraint] = [] + mapper = ArgTypeExpander(context) + + param_spec = callee.param_spec() + param_spec_arg_types = [] + param_spec_arg_names = [] + param_spec_arg_kinds: list[ArgKind] = [] + + incomplete_star_mapping = False + for i, actuals in enumerate(formal_to_actual): # TODO: isn't this `enumerate(arg_types)`? + for actual in actuals: + if actual is None and callee.arg_kinds[i] in (ARG_STAR, ARG_STAR2): # type: ignore[unreachable] + # We can't use arguments to infer ParamSpec constraint, if only some + # are present in the current inference pass. + incomplete_star_mapping = True # type: ignore[unreachable] + break + + for i, actuals in enumerate(formal_to_actual): + if isinstance(callee.arg_types[i], UnpackType): + unpack_type = callee.arg_types[i] + assert isinstance(unpack_type, UnpackType) + + # In this case we are binding all the actuals to *args, + # and we want a constraint that the typevar tuple being unpacked + # is equal to a type list of all the actuals. + actual_types = [] + + unpacked_type = get_proper_type(unpack_type.type) + if isinstance(unpacked_type, TypeVarTupleType): + tuple_instance = unpacked_type.tuple_fallback + elif isinstance(unpacked_type, TupleType): + tuple_instance = unpacked_type.partial_fallback + else: + assert False, "mypy bug: unhandled constraint inference case" + + for actual in actuals: + actual_arg_type = arg_types[actual] + if actual_arg_type is None: + continue + + expanded_actual = mapper.expand_actual_type( + actual_arg_type, + arg_kinds[actual], + callee.arg_names[i], + callee.arg_kinds[i], + allow_unpack=True, + ) + + if arg_kinds[actual] != ARG_STAR or isinstance( + get_proper_type(actual_arg_type), TupleType + ): + actual_types.append(expanded_actual) + else: + # If we are expanding an iterable inside * actual, append a homogeneous item instead + actual_types.append( + UnpackType(tuple_instance.copy_modified(args=[expanded_actual])) + ) + + if isinstance(unpacked_type, TypeVarTupleType): + constraints.append( + Constraint( + unpacked_type, + SUPERTYPE_OF, + TupleType(actual_types, unpacked_type.tuple_fallback), + ) + ) + elif isinstance(unpacked_type, TupleType): + # Prefixes get converted to positional args, so technically the only case we + # should have here is like Tuple[Unpack[Ts], Y1, Y2, Y3]. If this turns out + # not to hold we can always handle the prefixes too. + inner_unpack = unpacked_type.items[0] + assert isinstance(inner_unpack, UnpackType) + inner_unpacked_type = get_proper_type(inner_unpack.type) + suffix_len = len(unpacked_type.items) - 1 + if isinstance(inner_unpacked_type, TypeVarTupleType): + # Variadic item can be either *Ts... + constraints.append( + Constraint( + inner_unpacked_type, + SUPERTYPE_OF, + TupleType( + actual_types[:-suffix_len], inner_unpacked_type.tuple_fallback + ), + ) + ) + else: + # ...or it can be a homogeneous tuple. + assert ( + isinstance(inner_unpacked_type, Instance) + and inner_unpacked_type.type.fullname == "builtins.tuple" + ) + for at in actual_types[:-suffix_len]: + constraints.extend( + infer_constraints(inner_unpacked_type.args[0], at, SUPERTYPE_OF) + ) + # Now handle the suffix (if any). + if suffix_len: + for tt, at in zip(unpacked_type.items[1:], actual_types[-suffix_len:]): + constraints.extend(infer_constraints(tt, at, SUPERTYPE_OF)) + else: + assert False, "mypy bug: unhandled constraint inference case" + else: + for actual in actuals: + actual_arg_type = arg_types[actual] + if actual_arg_type is None: + continue + + if param_spec and callee.arg_kinds[i] in (ARG_STAR, ARG_STAR2): + # If actual arguments are mapped to ParamSpec type, we can't infer individual + # constraints, instead store them and infer single constraint at the end. + # It is impossible to map actual kind to formal kind, so use some heuristic. + # This inference is used as a fallback, so relying on heuristic should be OK. + if not incomplete_star_mapping: + param_spec_arg_types.append( + mapper.expand_actual_type( + actual_arg_type, arg_kinds[actual], None, arg_kinds[actual] + ) + ) + actual_kind = arg_kinds[actual] + param_spec_arg_kinds.append( + ARG_POS if actual_kind not in (ARG_STAR, ARG_STAR2) else actual_kind + ) + param_spec_arg_names.append(arg_names[actual] if arg_names else None) + else: + actual_type = mapper.expand_actual_type( + actual_arg_type, + arg_kinds[actual], + callee.arg_names[i], + callee.arg_kinds[i], + ) + c = infer_constraints(callee.arg_types[i], actual_type, SUPERTYPE_OF) + constraints.extend(c) + if ( + param_spec + and not any(c.type_var == param_spec.id for c in constraints) + and not incomplete_star_mapping + ): + # Use ParamSpec constraint from arguments only if there are no other constraints, + # since as explained above it is quite ad-hoc. + constraints.append( + Constraint( + param_spec, + SUPERTYPE_OF, + Parameters( + arg_types=param_spec_arg_types, + arg_kinds=param_spec_arg_kinds, + arg_names=param_spec_arg_names, + imprecise_arg_kinds=True, + ), + ) + ) + if any(isinstance(v, ParamSpecType) for v in callee.variables): + # As a perf optimization filter imprecise constraints only when we can have them. + constraints = filter_imprecise_kinds(constraints) + return constraints + + +def infer_constraints( + template: Type, actual: Type, direction: int, skip_neg_op: bool = False +) -> list[Constraint]: + """Infer type constraints. + + Match a template type, which may contain type variable references, + recursively against a type which does not contain (the same) type + variable references. The result is a list of type constrains of + form 'T is a supertype/subtype of x', where T is a type variable + present in the template and x is a type without reference to type + variables present in the template. + + Assume T and S are type variables. Now the following results can be + calculated (read as '(template, actual) --> result'): + + (T, X) --> T :> X + (X[T], X[Y]) --> T <: Y and T :> Y + ((T, T), (X, Y)) --> T :> X and T :> Y + ((T, S), (X, Y)) --> T :> X and S :> Y + (X[T], Any) --> T <: Any and T :> Any + + The constraints are represented as Constraint objects. If skip_neg_op == True, + then skip adding reverse (polymorphic) constraints (since this is already a call + to infer such constraints). + """ + if any( + get_proper_type(template) == get_proper_type(t) + and get_proper_type(actual) == get_proper_type(a) + for (t, a) in reversed(type_state.inferring) + ): + return [] + if has_recursive_types(template) or isinstance(get_proper_type(template), Instance): + # This case requires special care because it may cause infinite recursion. + # Note that we include Instances because the may be recursive as str(Sequence[str]). + if not has_type_vars(template): + # Return early on an empty branch. + return [] + type_state.inferring.append((template, actual)) + res = _infer_constraints(template, actual, direction, skip_neg_op) + type_state.inferring.pop() + return res + return _infer_constraints(template, actual, direction, skip_neg_op) + + +def _infer_constraints( + template: Type, actual: Type, direction: int, skip_neg_op: bool +) -> list[Constraint]: + orig_template = template + template = get_proper_type(template) + actual = get_proper_type(actual) + + # Type inference shouldn't be affected by whether union types have been simplified. + # We however keep any ErasedType items, so that the caller will see it when using + # checkexpr.has_erased_component(). + if isinstance(template, UnionType): + template = mypy.typeops.make_simplified_union(template.items, keep_erased=True) + if isinstance(actual, UnionType): + actual = mypy.typeops.make_simplified_union(actual.items, keep_erased=True) + + # Ignore Any types from the type suggestion engine to avoid them + # causing us to infer Any in situations where a better job could + # be done otherwise. (This can produce false positives but that + # doesn't really matter because it is all heuristic anyway.) + if isinstance(actual, AnyType) and actual.type_of_any == TypeOfAny.suggestion_engine: + return [] + + # type[A | B] is always represented as type[A] | type[B] internally. + # This makes our constraint solver choke on type[T] <: type[A] | type[B], + # solving T as generic meet(A, B) which is often `object`. Force unwrap such unions + # if both sides are type[...] or unions thereof. See `testTypeVarType` test + type_type_unwrapped = False + if _is_type_type(template) and _is_type_type(actual): + type_type_unwrapped = True + template = _unwrap_type_type(template) + actual = _unwrap_type_type(actual) + + # If the template is simply a type variable, emit a Constraint directly. + # We need to handle this case before handling Unions for two reasons: + # 1. "T <: Union[U1, U2]" is not equivalent to "T <: U1 or T <: U2", + # because T can itself be a union (notably, Union[U1, U2] itself). + # 2. "T :> Union[U1, U2]" is logically equivalent to "T :> U1 and + # T :> U2", but they are not equivalent to the constraint solver, + # which never introduces new Union types (it uses join() instead). + if isinstance(template, TypeVarType): + return [Constraint(template, direction, actual)] + + if ( + isinstance(actual, TypeVarType) + and not actual.id.is_meta_var() + and direction == SUPERTYPE_OF + ): + # Unless template is also a type variable (or a union that contains one), using the upper + # bound for inference will usually give better result for actual that is a type variable. + if not isinstance(template, UnionType) or not any( + isinstance(t, TypeVarType) for t in template.items + ): + actual = get_proper_type(actual.upper_bound) + + # Now handle the case of either template or actual being a Union. + # For a Union to be a subtype of another type, every item of the Union + # must be a subtype of that type, so concatenate the constraints. + if direction == SUBTYPE_OF and isinstance(template, UnionType): + res = [] + for t_item in template.items: + res.extend(infer_constraints(t_item, actual, direction)) + return res + if direction == SUPERTYPE_OF and isinstance(actual, UnionType): + res = [] + for a_item in actual.items: + # `orig_template` has to be preserved intact in case it's recursive. + # If we unwrapped ``type[...]`` previously, wrap the item back again, + # as ``type[...]`` can't be removed from `orig_template`. + if type_type_unwrapped: + a_item = TypeType.make_normalized(a_item) + res.extend(infer_constraints(orig_template, a_item, direction)) + return res + + # Now the potential subtype is known not to be a Union or a type + # variable that we are solving for. In that case, for a Union to + # be a supertype of the potential subtype, some item of the Union + # must be a supertype of it. + if direction == SUBTYPE_OF and isinstance(actual, UnionType): + # We infer constraints eagerly -- try to find constraints for a type + # variable if possible. This seems to help with some real-world + # use cases. + return any_constraints( + [ + infer_constraints_if_possible(template, a_item, direction) + for a_item in actual.items + ], + eager=True, + ) + if direction == SUPERTYPE_OF and isinstance(template, UnionType): + # When the template is a union, we are okay with leaving some + # type variables indeterminate. This helps with some special + # cases, though this isn't very principled. + result = any_constraints( + [ + infer_constraints_if_possible(t_item, actual, direction) + for t_item in template.items + ], + eager=isinstance(actual, AnyType), + ) + if result: + return result + elif has_recursive_types(template) and not has_recursive_types(actual): + return handle_recursive_union(template, actual, direction) + return [] + + # Remaining cases are handled by ConstraintBuilderVisitor. + return template.accept(ConstraintBuilderVisitor(actual, direction, skip_neg_op)) + + +def _is_type_type(tp: ProperType) -> TypeGuard[TypeType | UnionType]: + """Is ``tp`` a ``type[...]`` or a union thereof? + + ``Type[A | B]`` is internally represented as ``type[A] | type[B]``, and this + troubles the solver sometimes. + """ + return ( + isinstance(tp, TypeType) + or isinstance(tp, UnionType) + and all(isinstance(get_proper_type(o), TypeType) for o in tp.items) + ) + + +def _unwrap_type_type(tp: TypeType | UnionType) -> ProperType: + """Extract the inner type from ``type[...]`` expression or a union thereof.""" + if isinstance(tp, TypeType): + return tp.item + return UnionType.make_union([cast(TypeType, get_proper_type(o)).item for o in tp.items]) + + +def infer_constraints_if_possible( + template: Type, actual: Type, direction: int +) -> list[Constraint] | None: + """Like infer_constraints, but return None if the input relation is + known to be unsatisfiable, for example if template=List[T] and actual=int. + (In this case infer_constraints would return [], just like it would for + an automatically satisfied relation like template=List[T] and actual=object.) + """ + if direction == SUBTYPE_OF and not mypy.subtypes.is_subtype(erase_typevars(template), actual): + return None + if direction == SUPERTYPE_OF and not mypy.subtypes.is_subtype( + actual, erase_typevars(template) + ): + return None + if ( + direction == SUPERTYPE_OF + and isinstance(template, TypeVarType) + and not mypy.subtypes.is_subtype(actual, erase_typevars(template.upper_bound)) + ): + # This is not caught by the above branch because of the erase_typevars() call, + # that would return 'Any' for a type variable. + return None + return infer_constraints(template, actual, direction) + + +def select_trivial(options: Sequence[list[Constraint] | None]) -> list[list[Constraint]]: + """Select only those lists where each item is a constraint against Any.""" + res = [] + for option in options: + if option is None: + continue + if all(isinstance(get_proper_type(c.target), AnyType) for c in option): + res.append(option) + return res + + +def merge_with_any(constraint: Constraint) -> Constraint: + """Transform a constraint target into a union with given Any type.""" + target = constraint.target + if is_union_with_any(target): + # Do not produce redundant unions. + return constraint + # TODO: if we will support multiple sources Any, use this here instead. + any_type = AnyType(TypeOfAny.implementation_artifact) + return Constraint( + constraint.origin_type_var, + constraint.op, + UnionType.make_union([target, any_type], target.line, target.column), + ) + + +def handle_recursive_union(template: UnionType, actual: Type, direction: int) -> list[Constraint]: + # This is a hack to special-case things like Union[T, Inst[T]] in recursive types. Although + # it is quite arbitrary, it is a relatively common pattern, so we should handle it well. + # This function may be called when inferring against such union resulted in different + # constraints for each item. Normally we give up in such case, but here we instead split + # the union in two parts, and try inferring sequentially. + non_type_var_items = [t for t in template.items if not isinstance(t, TypeVarType)] + type_var_items = [t for t in template.items if isinstance(t, TypeVarType)] + return infer_constraints( + UnionType.make_union(non_type_var_items), actual, direction + ) or infer_constraints(UnionType.make_union(type_var_items), actual, direction) + + +def any_constraints(options: list[list[Constraint] | None], *, eager: bool) -> list[Constraint]: + """Deduce what we can from a collection of constraint lists. + + It's a given that at least one of the lists must be satisfied. A + None element in the list of options represents an unsatisfiable + constraint and is ignored. Ignore empty constraint lists if eager + is true -- they are always trivially satisfiable. + """ + if eager: + valid_options = [option for option in options if option] + else: + valid_options = [option for option in options if option is not None] + + if not valid_options: + return [] + + if len(valid_options) == 1: + return valid_options[0] + + if all(is_same_constraints(valid_options[0], c) for c in valid_options[1:]): + # Multiple sets of constraints that are all the same. Just pick any one of them. + return valid_options[0] + + if all(is_similar_constraints(valid_options[0], c) for c in valid_options[1:]): + # All options have same structure. In this case we can merge-in trivial + # options (i.e. those that only have Any) and try again. + # TODO: More generally, if a given (variable, direction) pair appears in + # every option, combine the bounds with meet/join always, not just for Any. + trivial_options = select_trivial(valid_options) + if trivial_options and len(trivial_options) < len(valid_options): + merged_options = [] + for option in valid_options: + if option in trivial_options: + continue + merged_options.append([merge_with_any(c) for c in option]) + return any_constraints(list(merged_options), eager=eager) + + # If normal logic didn't work, try excluding trivially unsatisfiable constraint (due to + # upper bounds) from each option, and comparing them again. + filtered_options = [filter_satisfiable(o) for o in options] + if filtered_options != options: + return any_constraints(filtered_options, eager=eager) + + # Try harder: if that didn't work, try to strip typevars that aren't meta vars. + # Note this is what we would always do, but unfortunately some callers may not + # set the meta var status correctly (for historical reasons), so we use this as + # a fallback only. + filtered_options = [exclude_non_meta_vars(o) for o in options] + if filtered_options != options: + return any_constraints(filtered_options, eager=eager) + + # Otherwise, there are either no valid options or multiple, inconsistent valid + # options. Give up and deduce nothing. + return [] + + +def filter_satisfiable(option: list[Constraint] | None) -> list[Constraint] | None: + """Keep only constraints that can possibly be satisfied. + + Currently, we filter out constraints where target is not a subtype of the upper bound. + Since those can be never satisfied. We may add more cases in future if it improves type + inference. + """ + if not option: + return option + + satisfiable = [] + for c in option: + if isinstance(c.origin_type_var, TypeVarType) and c.origin_type_var.values: + if any( + mypy.subtypes.is_subtype(c.target, value) for value in c.origin_type_var.values + ): + satisfiable.append(c) + elif mypy.subtypes.is_subtype(c.target, c.origin_type_var.upper_bound): + satisfiable.append(c) + if not satisfiable: + return None + return satisfiable + + +def exclude_non_meta_vars(option: list[Constraint] | None) -> list[Constraint] | None: + # If we had an empty list, keep it intact + if not option: + return option + # However, if none of the options actually references meta vars, better remove + # this constraint entirely. + return [c for c in option if c.type_var.is_meta_var()] or None + + +def is_same_constraints(x: list[Constraint], y: list[Constraint]) -> bool: + for c1 in x: + if not any(is_same_constraint(c1, c2) for c2 in y): + return False + for c1 in y: + if not any(is_same_constraint(c1, c2) for c2 in x): + return False + return True + + +def is_same_constraint(c1: Constraint, c2: Constraint) -> bool: + # Ignore direction when comparing constraints against Any. + skip_op_check = isinstance(get_proper_type(c1.target), AnyType) and isinstance( + get_proper_type(c2.target), AnyType + ) + return ( + c1.type_var == c2.type_var + and (c1.op == c2.op or skip_op_check) + and mypy.subtypes.is_same_type(c1.target, c2.target) + ) + + +def is_similar_constraints(x: list[Constraint], y: list[Constraint]) -> bool: + """Check that two lists of constraints have similar structure. + + This means that each list has same type variable plus direction pairs (i.e we + ignore the target). Except for constraints where target is Any type, there + we ignore direction as well. + """ + return _is_similar_constraints(x, y) and _is_similar_constraints(y, x) + + +def _is_similar_constraints(x: list[Constraint], y: list[Constraint]) -> bool: + """Check that every constraint in the first list has a similar one in the second. + + See docstring above for definition of similarity. + """ + for c1 in x: + has_similar = False + for c2 in y: + # Ignore direction when either constraint is against Any. + skip_op_check = isinstance(get_proper_type(c1.target), AnyType) or isinstance( + get_proper_type(c2.target), AnyType + ) + if c1.type_var == c2.type_var and (c1.op == c2.op or skip_op_check): + has_similar = True + break + if not has_similar: + return False + return True + + +class ConstraintBuilderVisitor(TypeVisitor[list[Constraint]]): + """Visitor class for inferring type constraints.""" + + # The type that is compared against a template + # TODO: The value may be None. Is that actually correct? + actual: ProperType + + def __init__(self, actual: ProperType, direction: int, skip_neg_op: bool) -> None: + # Direction must be SUBTYPE_OF or SUPERTYPE_OF. + self.actual = actual + self.direction = direction + # Whether to skip polymorphic inference (involves inference in opposite direction) + # this is used to prevent infinite recursion when both template and actual are + # generic callables. + self.skip_neg_op = skip_neg_op + + # Trivial leaf types + + def visit_unbound_type(self, template: UnboundType) -> list[Constraint]: + return [] + + def visit_any(self, template: AnyType) -> list[Constraint]: + return [] + + def visit_none_type(self, template: NoneType) -> list[Constraint]: + return [] + + def visit_uninhabited_type(self, template: UninhabitedType) -> list[Constraint]: + return [] + + def visit_erased_type(self, template: ErasedType) -> list[Constraint]: + return [] + + def visit_deleted_type(self, template: DeletedType) -> list[Constraint]: + return [] + + def visit_literal_type(self, template: LiteralType) -> list[Constraint]: + return [] + + # Errors + + def visit_partial_type(self, template: PartialType) -> list[Constraint]: + # We can't do anything useful with a partial type here. + assert False, "Internal error" + + # Non-trivial leaf type + + def visit_type_var(self, template: TypeVarType) -> list[Constraint]: + assert False, ( + "Unexpected TypeVarType in ConstraintBuilderVisitor" + " (should have been handled in infer_constraints)" + ) + + def visit_param_spec(self, template: ParamSpecType) -> list[Constraint]: + # Can't infer ParamSpecs from component values (only via Callable[P, T]). + return [] + + def visit_type_var_tuple(self, template: TypeVarTupleType) -> list[Constraint]: + raise NotImplementedError + + def visit_unpack_type(self, template: UnpackType) -> list[Constraint]: + raise RuntimeError("Mypy bug: unpack should be handled at a higher level.") + + def visit_parameters(self, template: Parameters) -> list[Constraint]: + # Constraining Any against C[P] turns into infer_against_any([P], Any) + if isinstance(self.actual, AnyType): + return self.infer_against_any(template.arg_types, self.actual) + if type_state.infer_polymorphic and isinstance(self.actual, Parameters): + # For polymorphic inference we need to be able to infer secondary constraints + # in situations like [x: T] <: P <: [x: int]. + return infer_callable_arguments_constraints(template, self.actual, self.direction) + if type_state.infer_polymorphic and isinstance(self.actual, ParamSpecType): + # Similar for [x: T] <: Q <: Concatenate[int, P]. + return infer_callable_arguments_constraints( + template, self.actual.prefix, self.direction + ) + # There also may be unpatched types after a user error, simply ignore them. + return [] + + # Non-leaf types + + def visit_instance(self, template: Instance) -> list[Constraint]: + original_actual = actual = self.actual + res: list[Constraint] = [] + if isinstance(actual, (CallableType, Overloaded)) and template.type.is_protocol: + if "__call__" in template.type.protocol_members: + # Special case: a generic callback protocol + if not any(template == t for t in template.type.inferring): + template.type.inferring.append(template) + call = mypy.subtypes.find_member( + "__call__", template, actual, is_operator=True + ) + assert call is not None + if ( + self.direction == SUPERTYPE_OF + and mypy.subtypes.is_subtype(actual, erase_typevars(call)) + or self.direction == SUBTYPE_OF + and mypy.subtypes.is_subtype(erase_typevars(call), actual) + ): + res.extend(infer_constraints(call, actual, self.direction)) + template.type.inferring.pop() + if isinstance(actual, CallableType) and actual.fallback is not None: + if ( + actual.is_type_obj() + and template.type.is_protocol + and self.direction == SUPERTYPE_OF + ): + ret_type = get_proper_type(actual.ret_type) + if isinstance(ret_type, TupleType): + ret_type = mypy.typeops.tuple_fallback(ret_type) + if isinstance(ret_type, Instance): + res.extend( + self.infer_constraints_from_protocol_members( + ret_type, template, ret_type, template, class_obj=True + ) + ) + actual = actual.fallback + if isinstance(actual, TypeType) and template.type.is_protocol: + if self.direction == SUPERTYPE_OF: + a_item = actual.item + if isinstance(a_item, Instance): + res.extend( + self.infer_constraints_from_protocol_members( + a_item, template, a_item, template, class_obj=True + ) + ) + # Infer constraints for Type[T] via metaclass of T when it makes sense. + if isinstance(a_item, TypeVarType): + a_item = get_proper_type(a_item.upper_bound) + if isinstance(a_item, Instance) and a_item.type.metaclass_type: + res.extend( + self.infer_constraints_from_protocol_members( + a_item.type.metaclass_type, template, actual, template + ) + ) + + if isinstance(actual, Overloaded) and actual.fallback is not None: + actual = actual.fallback + if isinstance(actual, TypedDictType): + actual = actual.create_anonymous_fallback() + if isinstance(actual, LiteralType): + actual = actual.fallback + if isinstance(actual, Instance): + instance = actual + erased = erase_typevars(template) + assert isinstance(erased, Instance) # type: ignore[misc] + # We always try nominal inference if possible, + # it is much faster than the structural one. + if self.direction == SUBTYPE_OF and template.type.has_base(instance.type.fullname): + mapped = map_instance_to_supertype(template, instance.type) + tvars = mapped.type.defn.type_vars + + if instance.type.has_type_var_tuple_type: + # Variadic types need special handling to map each type argument to + # the correct corresponding type variable. + assert instance.type.type_var_tuple_prefix is not None + assert instance.type.type_var_tuple_suffix is not None + prefix_len = instance.type.type_var_tuple_prefix + suffix_len = instance.type.type_var_tuple_suffix + tvt = instance.type.defn.type_vars[prefix_len] + assert isinstance(tvt, TypeVarTupleType) + fallback = tvt.tuple_fallback + i_prefix, i_middle, i_suffix = split_with_prefix_and_suffix( + instance.args, prefix_len, suffix_len + ) + m_prefix, m_middle, m_suffix = split_with_prefix_and_suffix( + mapped.args, prefix_len, suffix_len + ) + instance_args = i_prefix + (TupleType(list(i_middle), fallback),) + i_suffix + mapped_args = m_prefix + (TupleType(list(m_middle), fallback),) + m_suffix + else: + mapped_args = mapped.args + instance_args = instance.args + + # N.B: We use zip instead of indexing because the lengths might have + # mismatches during daemon reprocessing. + for tvar, mapped_arg, instance_arg in zip(tvars, mapped_args, instance_args): + if isinstance(tvar, TypeVarType): + # The constraints for generic type parameters depend on variance. + # Include constraints from both directions if invariant. + if tvar.variance != CONTRAVARIANT: + res.extend(infer_constraints(mapped_arg, instance_arg, self.direction)) + if tvar.variance != COVARIANT: + res.extend( + infer_constraints(mapped_arg, instance_arg, neg_op(self.direction)) + ) + elif isinstance(tvar, ParamSpecType) and isinstance(mapped_arg, ParamSpecType): + prefix = mapped_arg.prefix + if isinstance(instance_arg, Parameters): + # No such thing as variance for ParamSpecs, consider them invariant + # TODO: constraints between prefixes using + # infer_callable_arguments_constraints() + suffix: Type = instance_arg.copy_modified( + instance_arg.arg_types[len(prefix.arg_types) :], + instance_arg.arg_kinds[len(prefix.arg_kinds) :], + instance_arg.arg_names[len(prefix.arg_names) :], + ) + res.append(Constraint(mapped_arg, SUBTYPE_OF, suffix)) + res.append(Constraint(mapped_arg, SUPERTYPE_OF, suffix)) + elif isinstance(instance_arg, ParamSpecType): + suffix = instance_arg.copy_modified( + prefix=Parameters( + instance_arg.prefix.arg_types[len(prefix.arg_types) :], + instance_arg.prefix.arg_kinds[len(prefix.arg_kinds) :], + instance_arg.prefix.arg_names[len(prefix.arg_names) :], + ) + ) + res.append(Constraint(mapped_arg, SUBTYPE_OF, suffix)) + res.append(Constraint(mapped_arg, SUPERTYPE_OF, suffix)) + elif isinstance(tvar, TypeVarTupleType): + # Handle variadic type variables covariantly for consistency. + res.extend(infer_constraints(mapped_arg, instance_arg, self.direction)) + + return res + elif self.direction == SUPERTYPE_OF and instance.type.has_base(template.type.fullname): + mapped = map_instance_to_supertype(instance, template.type) + tvars = template.type.defn.type_vars + if template.type.has_type_var_tuple_type: + # Variadic types need special handling to map each type argument to + # the correct corresponding type variable. + assert template.type.type_var_tuple_prefix is not None + assert template.type.type_var_tuple_suffix is not None + prefix_len = template.type.type_var_tuple_prefix + suffix_len = template.type.type_var_tuple_suffix + tvt = template.type.defn.type_vars[prefix_len] + assert isinstance(tvt, TypeVarTupleType) + fallback = tvt.tuple_fallback + t_prefix, t_middle, t_suffix = split_with_prefix_and_suffix( + template.args, prefix_len, suffix_len + ) + m_prefix, m_middle, m_suffix = split_with_prefix_and_suffix( + mapped.args, prefix_len, suffix_len + ) + template_args = t_prefix + (TupleType(list(t_middle), fallback),) + t_suffix + mapped_args = m_prefix + (TupleType(list(m_middle), fallback),) + m_suffix + else: + mapped_args = mapped.args + template_args = template.args + # N.B: We use zip instead of indexing because the lengths might have + # mismatches during daemon reprocessing. + for tvar, mapped_arg, template_arg in zip(tvars, mapped_args, template_args): + if isinstance(tvar, TypeVarType): + # The constraints for generic type parameters depend on variance. + # Include constraints from both directions if invariant. + if tvar.variance != CONTRAVARIANT: + res.extend(infer_constraints(template_arg, mapped_arg, self.direction)) + if tvar.variance != COVARIANT: + res.extend( + infer_constraints(template_arg, mapped_arg, neg_op(self.direction)) + ) + elif isinstance(tvar, ParamSpecType) and isinstance( + template_arg, ParamSpecType + ): + prefix = template_arg.prefix + if isinstance(mapped_arg, Parameters): + # No such thing as variance for ParamSpecs, consider them invariant + # TODO: constraints between prefixes using + # infer_callable_arguments_constraints() + suffix = mapped_arg.copy_modified( + mapped_arg.arg_types[len(prefix.arg_types) :], + mapped_arg.arg_kinds[len(prefix.arg_kinds) :], + mapped_arg.arg_names[len(prefix.arg_names) :], + ) + res.append(Constraint(template_arg, SUBTYPE_OF, suffix)) + res.append(Constraint(template_arg, SUPERTYPE_OF, suffix)) + elif isinstance(mapped_arg, ParamSpecType): + suffix = mapped_arg.copy_modified( + prefix=Parameters( + mapped_arg.prefix.arg_types[len(prefix.arg_types) :], + mapped_arg.prefix.arg_kinds[len(prefix.arg_kinds) :], + mapped_arg.prefix.arg_names[len(prefix.arg_names) :], + ) + ) + res.append(Constraint(template_arg, SUBTYPE_OF, suffix)) + res.append(Constraint(template_arg, SUPERTYPE_OF, suffix)) + elif isinstance(tvar, TypeVarTupleType): + # Consider variadic type variables to be invariant. + res.extend(infer_constraints(template_arg, mapped_arg, SUBTYPE_OF)) + res.extend(infer_constraints(template_arg, mapped_arg, SUPERTYPE_OF)) + return res + if ( + template.type.is_protocol + and self.direction == SUPERTYPE_OF + and + # We avoid infinite recursion for structural subtypes by checking + # whether this type already appeared in the inference chain. + # This is a conservative way to break the inference cycles. + # It never produces any "false" constraints but gives up soon + # on purely structural inference cycles, see #3829. + # Note that we use is_protocol_implementation instead of is_subtype + # because some type may be considered a subtype of a protocol + # due to _promote, but still not implement the protocol. + not any(template == t for t in reversed(template.type.inferring)) + and mypy.subtypes.is_protocol_implementation(instance, erased, skip=["__call__"]) + ): + template.type.inferring.append(template) + res.extend( + self.infer_constraints_from_protocol_members( + instance, template, original_actual, template + ) + ) + template.type.inferring.pop() + return res + elif ( + instance.type.is_protocol + and self.direction == SUBTYPE_OF + and + # We avoid infinite recursion for structural subtypes also here. + not any(instance == i for i in reversed(instance.type.inferring)) + and mypy.subtypes.is_protocol_implementation(erased, instance, skip=["__call__"]) + ): + instance.type.inferring.append(instance) + res.extend( + self.infer_constraints_from_protocol_members( + instance, template, template, instance + ) + ) + instance.type.inferring.pop() + return res + if res: + return res + + if isinstance(actual, AnyType): + return self.infer_against_any(template.args, actual) + if ( + isinstance(actual, TupleType) + and is_named_instance(template, TUPLE_LIKE_INSTANCE_NAMES) + and self.direction == SUPERTYPE_OF + ): + for item in actual.items: + if isinstance(item, UnpackType): + unpacked = get_proper_type(item.type) + if isinstance(unpacked, TypeVarTupleType): + # Cannot infer anything for T from [T, ...] <: *Ts + continue + assert ( + isinstance(unpacked, Instance) + and unpacked.type.fullname == "builtins.tuple" + ) + item = unpacked.args[0] + cb = infer_constraints(template.args[0], item, SUPERTYPE_OF) + res.extend(cb) + return res + elif isinstance(actual, TupleType) and self.direction == SUPERTYPE_OF: + return infer_constraints(template, mypy.typeops.tuple_fallback(actual), self.direction) + elif isinstance(actual, TypeVarType): + if not actual.values and not actual.id.is_meta_var(): + return infer_constraints(template, actual.upper_bound, self.direction) + return [] + elif isinstance(actual, ParamSpecType): + return infer_constraints(template, actual.upper_bound, self.direction) + elif isinstance(actual, TypeVarTupleType): + raise NotImplementedError + else: + return [] + + def infer_constraints_from_protocol_members( + self, + instance: Instance, + template: Instance, + subtype: Type, + protocol: Instance, + class_obj: bool = False, + ) -> list[Constraint]: + """Infer constraints for situations where either 'template' or 'instance' is a protocol. + + The 'protocol' is the one of two that is an instance of protocol type, 'subtype' + is the type used to bind self during inference. Currently, we just infer constrains for + every protocol member type (both ways for settable members). + """ + res = [] + for member in protocol.type.protocol_members: + inst = mypy.subtypes.find_member(member, instance, subtype, class_obj=class_obj) + temp = mypy.subtypes.find_member(member, template, subtype) + if inst is None or temp is None: + if member == "__call__": + continue + return [] # See #11020 + # The above is safe since at this point we know that 'instance' is a subtype + # of (erased) 'template', therefore it defines all protocol members + if class_obj: + # For class objects we must only infer constraints if possible, otherwise it + # can lead to confusion between class and instance, for example StrEnum is + # Iterable[str] for an instance, but Iterable[StrEnum] for a class object. + if not mypy.subtypes.is_subtype( + inst, erase_typevars(temp), ignore_pos_arg_names=True + ): + continue + # This exception matches the one in typeops.py, see PR #14121 for context. + if member == "__call__" and instance.type.is_metaclass(precise=True): + continue + res.extend(infer_constraints(temp, inst, self.direction)) + if mypy.subtypes.IS_SETTABLE in mypy.subtypes.get_member_flags(member, protocol): + # Settable members are invariant, add opposite constraints + res.extend(infer_constraints(temp, inst, neg_op(self.direction))) + return res + + def visit_callable_type(self, template: CallableType) -> list[Constraint]: + # Normalize callables before matching against each other. + # Note that non-normalized callables can be created in annotations + # using e.g. callback protocols. + # TODO: check that callables match? Ideally we should not infer constraints + # callables that can never be subtypes of one another in given direction. + template = template.with_unpacked_kwargs().with_normalized_var_args() + extra_tvars = False + if isinstance(self.actual, CallableType): + res: list[Constraint] = [] + cactual = self.actual.with_unpacked_kwargs().with_normalized_var_args() + param_spec = template.param_spec() + + template_ret_type, cactual_ret_type = template.ret_type, cactual.ret_type + if template.type_guard is not None and cactual.type_guard is not None: + template_ret_type = template.type_guard + cactual_ret_type = cactual.type_guard + + if template.type_is is not None and cactual.type_is is not None: + template_ret_type = template.type_is + cactual_ret_type = cactual.type_is + + res.extend(infer_constraints(template_ret_type, cactual_ret_type, self.direction)) + + if param_spec is None: + # TODO: Erase template variables if it is generic? + if ( + type_state.infer_polymorphic + and cactual.variables + and not self.skip_neg_op + # Technically, the correct inferred type for application of e.g. + # Callable[..., T] -> Callable[..., T] (with literal ellipsis), to a generic + # like U -> U, should be Callable[..., Any], but if U is a self-type, we can + # allow it to leak, to be later bound to self. A bunch of existing code + # depends on this old behaviour. + and not ( + any(tv.id.is_self() for tv in cactual.variables) + and template.is_ellipsis_args + ) + ): + # If the actual callable is generic, infer constraints in the opposite + # direction, and indicate to the solver there are extra type variables + # to solve for (see more details in mypy/solve.py). + res.extend( + infer_constraints( + cactual, template, neg_op(self.direction), skip_neg_op=True + ) + ) + extra_tvars = True + + # We can't infer constraints from arguments if the template is Callable[..., T] + # (with literal '...'). + if not template.is_ellipsis_args: + unpack_present = find_unpack_in_list(template.arg_types) + # When both ParamSpec and TypeVarTuple are present, things become messy + # quickly. For now, we only allow ParamSpec to "capture" TypeVarTuple, + # but not vice versa. + # TODO: infer more from prefixes when possible. + if unpack_present is not None and not cactual.param_spec(): + # We need to re-normalize args to the form they appear in tuples, + # for callables we always pack the suffix inside another tuple. + unpack = template.arg_types[unpack_present] + assert isinstance(unpack, UnpackType) + tuple_type = get_tuple_fallback_from_unpack(unpack) + template_types = repack_callable_args(template, tuple_type) + actual_types = repack_callable_args(cactual, tuple_type) + # Now we can use the same general helper as for tuple types. + unpack_constraints = build_constraints_for_simple_unpack( + template_types, actual_types, neg_op(self.direction) + ) + res.extend(unpack_constraints) + else: + # TODO: do we need some special-casing when unpack is present in actual + # callable but not in template callable? + res.extend( + infer_callable_arguments_constraints(template, cactual, self.direction) + ) + else: + prefix = param_spec.prefix + prefix_len = len(prefix.arg_types) + cactual_ps = cactual.param_spec() + + if type_state.infer_polymorphic and cactual.variables and not self.skip_neg_op: + # Similar logic to the branch above. + res.extend( + infer_constraints( + cactual, template, neg_op(self.direction), skip_neg_op=True + ) + ) + extra_tvars = True + + # Compare prefixes as well + cactual_prefix = cactual.copy_modified( + arg_types=cactual.arg_types[:prefix_len], + arg_kinds=cactual.arg_kinds[:prefix_len], + arg_names=cactual.arg_names[:prefix_len], + ) + res.extend( + infer_callable_arguments_constraints(prefix, cactual_prefix, self.direction) + ) + + param_spec_target: Type | None = None + if not cactual_ps: + max_prefix_len = len([k for k in cactual.arg_kinds if k in (ARG_POS, ARG_OPT)]) + prefix_len = min(prefix_len, max_prefix_len) + param_spec_target = Parameters( + arg_types=cactual.arg_types[prefix_len:], + arg_kinds=cactual.arg_kinds[prefix_len:], + arg_names=cactual.arg_names[prefix_len:], + variables=cactual.variables if not type_state.infer_polymorphic else [], + imprecise_arg_kinds=cactual.imprecise_arg_kinds, + ) + else: + if len(param_spec.prefix.arg_types) <= len(cactual_ps.prefix.arg_types): + param_spec_target = cactual_ps.copy_modified( + prefix=Parameters( + arg_types=cactual_ps.prefix.arg_types[prefix_len:], + arg_kinds=cactual_ps.prefix.arg_kinds[prefix_len:], + arg_names=cactual_ps.prefix.arg_names[prefix_len:], + imprecise_arg_kinds=cactual_ps.prefix.imprecise_arg_kinds, + ) + ) + if param_spec_target is not None: + res.append(Constraint(param_spec, self.direction, param_spec_target)) + if extra_tvars: + for c in res: + c.extra_tvars += cactual.variables + return res + elif isinstance(self.actual, AnyType): + param_spec = template.param_spec() + any_type = AnyType(TypeOfAny.from_another_any, source_any=self.actual) + if param_spec is None: + # FIX what if generic + res = self.infer_against_any(template.arg_types, self.actual) + else: + res = [ + Constraint( + param_spec, + SUBTYPE_OF, + Parameters([any_type, any_type], [ARG_STAR, ARG_STAR2], [None, None]), + ) + ] + res.extend(infer_constraints(template.ret_type, any_type, self.direction)) + return res + elif isinstance(self.actual, Overloaded): + return self.infer_against_overloaded(self.actual, template) + elif isinstance(self.actual, TypeType): + return infer_constraints(template.ret_type, self.actual.item, self.direction) + elif isinstance(self.actual, Instance): + # Instances with __call__ method defined are considered structural + # subtypes of Callable with a compatible signature. + call = mypy.subtypes.find_member( + "__call__", self.actual, self.actual, is_operator=True + ) + if call: + return infer_constraints(template, call, self.direction) + else: + return [] + else: + return [] + + def infer_against_overloaded( + self, overloaded: Overloaded, template: CallableType + ) -> list[Constraint]: + # Create constraints by matching an overloaded type against a template. + # This is tricky to do in general. We cheat by only matching against + # the first overload item that is callable compatible. This + # seems to work somewhat well, but we should really use a more + # reliable technique. + item = find_matching_overload_item(overloaded, template) + return infer_constraints(template, item, self.direction) + + def visit_tuple_type(self, template: TupleType) -> list[Constraint]: + actual = self.actual + unpack_index = find_unpack_in_list(template.items) + is_varlength_tuple = ( + isinstance(actual, Instance) and actual.type.fullname == "builtins.tuple" + ) + + if isinstance(actual, TupleType) or is_varlength_tuple: + res: list[Constraint] = [] + if unpack_index is not None: + if is_varlength_tuple: + # Variadic tuple can be only a supertype of a tuple type, but even if + # direction is opposite, inferring something may give better error messages. + unpack_type = template.items[unpack_index] + assert isinstance(unpack_type, UnpackType) + unpacked_type = get_proper_type(unpack_type.type) + if isinstance(unpacked_type, TypeVarTupleType): + res = [ + Constraint(type_var=unpacked_type, op=self.direction, target=actual) + ] + else: + assert ( + isinstance(unpacked_type, Instance) + and unpacked_type.type.fullname == "builtins.tuple" + ) + res = infer_constraints(unpacked_type, actual, self.direction) + assert isinstance(actual, Instance) # ensured by is_varlength_tuple == True + for i, ti in enumerate(template.items): + if i == unpack_index: + # This one we just handled above. + continue + # For Tuple[T, *Ts, S] <: tuple[X, ...] infer also T <: X and S <: X. + res.extend(infer_constraints(ti, actual.args[0], self.direction)) + return res + else: + assert isinstance(actual, TupleType) + unpack_constraints = build_constraints_for_simple_unpack( + template.items, actual.items, self.direction + ) + actual_items: tuple[Type, ...] = () + template_items: tuple[Type, ...] = () + res.extend(unpack_constraints) + elif isinstance(actual, TupleType): + a_unpack_index = find_unpack_in_list(actual.items) + if a_unpack_index is not None: + # The case where template tuple doesn't have an unpack, but actual tuple + # has an unpack. We can infer something if actual unpack is a variadic tuple. + # Tuple[T, S, U] <: tuple[X, *tuple[Y, ...], Z] => T <: X, S <: Y, U <: Z. + a_unpack = actual.items[a_unpack_index] + assert isinstance(a_unpack, UnpackType) + a_unpacked = get_proper_type(a_unpack.type) + if len(actual.items) + 1 <= len(template.items): + a_prefix_len = a_unpack_index + a_suffix_len = len(actual.items) - a_unpack_index - 1 + t_prefix, t_middle, t_suffix = split_with_prefix_and_suffix( + tuple(template.items), a_prefix_len, a_suffix_len + ) + actual_items = tuple(actual.items[:a_prefix_len]) + if a_suffix_len: + actual_items += tuple(actual.items[-a_suffix_len:]) + template_items = t_prefix + t_suffix + if isinstance(a_unpacked, Instance): + assert a_unpacked.type.fullname == "builtins.tuple" + for tm in t_middle: + res.extend( + infer_constraints(tm, a_unpacked.args[0], self.direction) + ) + else: + actual_items = () + template_items = () + else: + actual_items = tuple(actual.items) + template_items = tuple(template.items) + else: + return res + + # Cases above will return if actual wasn't a TupleType. + assert isinstance(actual, TupleType) + if len(actual_items) == len(template_items): + if ( + actual.partial_fallback.type.is_named_tuple + and template.partial_fallback.type.is_named_tuple + ): + # For named tuples using just the fallbacks usually gives better results. + return res + infer_constraints( + template.partial_fallback, actual.partial_fallback, self.direction + ) + for i in range(len(template_items)): + res.extend( + infer_constraints(template_items[i], actual_items[i], self.direction) + ) + res.extend( + infer_constraints( + template.partial_fallback, actual.partial_fallback, self.direction + ) + ) + return res + elif isinstance(actual, AnyType): + return self.infer_against_any(template.items, actual) + else: + return [] + + def visit_typeddict_type(self, template: TypedDictType) -> list[Constraint]: + actual = self.actual + if isinstance(actual, TypedDictType): + res: list[Constraint] = [] + # NOTE: Non-matching keys are ignored. Compatibility is checked + # elsewhere so this shouldn't be unsafe. + for item_name, template_item_type, actual_item_type in template.zip(actual): + res.extend(infer_constraints(template_item_type, actual_item_type, self.direction)) + return res + elif isinstance(actual, AnyType): + return self.infer_against_any(template.items.values(), actual) + else: + return [] + + def visit_union_type(self, template: UnionType) -> list[Constraint]: + assert False, ( + "Unexpected UnionType in ConstraintBuilderVisitor" + " (should have been handled in infer_constraints)" + ) + + def visit_type_alias_type(self, template: TypeAliasType) -> list[Constraint]: + assert False, f"This should be never called, got {template}" + + def infer_against_any(self, types: Iterable[Type], any_type: AnyType) -> list[Constraint]: + res: list[Constraint] = [] + # Some items may be things like `*Tuple[*Ts, T]` for example from callable types with + # suffix after *arg, so flatten them. + for t in flatten_nested_tuples(types): + if isinstance(t, UnpackType): + if isinstance(t.type, TypeVarTupleType): + res.append(Constraint(t.type, self.direction, any_type)) + else: + unpacked = get_proper_type(t.type) + assert isinstance(unpacked, Instance) + res.extend(infer_constraints(unpacked, any_type, self.direction)) + else: + # Note that we ignore variance and simply always use the + # original direction. This is because for Any targets direction is + # irrelevant in most cases, see e.g. is_same_constraint(). + res.extend(infer_constraints(t, any_type, self.direction)) + return res + + def visit_overloaded(self, template: Overloaded) -> list[Constraint]: + if isinstance(self.actual, CallableType): + items = find_matching_overload_items(template, self.actual) + else: + items = template.items + res: list[Constraint] = [] + for t in items: + res.extend(infer_constraints(t, self.actual, self.direction)) + return res + + def visit_type_type(self, template: TypeType) -> list[Constraint]: + if isinstance(self.actual, CallableType): + return infer_constraints(template.item, self.actual.ret_type, self.direction) + elif isinstance(self.actual, Overloaded): + return infer_constraints(template.item, self.actual.items[0].ret_type, self.direction) + elif isinstance(self.actual, TypeType): + return infer_constraints(template.item, self.actual.item, self.direction) + elif isinstance(self.actual, AnyType): + return infer_constraints(template.item, self.actual, self.direction) + else: + return [] + + +def neg_op(op: int) -> int: + """Map SubtypeOf to SupertypeOf and vice versa.""" + + if op == SUBTYPE_OF: + return SUPERTYPE_OF + elif op == SUPERTYPE_OF: + return SUBTYPE_OF + else: + raise ValueError(f"Invalid operator {op}") + + +def find_matching_overload_item(overloaded: Overloaded, template: CallableType) -> CallableType: + """Disambiguate overload item against a template.""" + items = overloaded.items + for item in items: + # Return type may be indeterminate in the template, so ignore it when performing a + # subtype check. + if mypy.subtypes.is_callable_compatible( + item, + template, + is_compat=mypy.subtypes.is_subtype, + is_proper_subtype=False, + ignore_return=True, + ): + return item + # Fall back to the first item if we can't find a match. This is totally arbitrary -- + # maybe we should just bail out at this point. + return items[0] + + +def find_matching_overload_items( + overloaded: Overloaded, template: CallableType +) -> list[CallableType]: + """Like find_matching_overload_item, but return all matches, not just the first.""" + items = overloaded.items + res = [] + for item in items: + # Return type may be indeterminate in the template, so ignore it when performing a + # subtype check. + if mypy.subtypes.is_callable_compatible( + item, + template, + is_compat=mypy.subtypes.is_subtype, + is_proper_subtype=False, + ignore_return=True, + ): + res.append(item) + if not res: + # Falling back to all items if we can't find a match is pretty arbitrary, but + # it maintains backward compatibility. + res = items.copy() + return res + + +def get_tuple_fallback_from_unpack(unpack: UnpackType) -> TypeInfo: + """Get builtins.tuple type from available types to construct homogeneous tuples.""" + tp = get_proper_type(unpack.type) + if isinstance(tp, Instance) and tp.type.fullname == "builtins.tuple": + return tp.type + if isinstance(tp, TypeVarTupleType): + return tp.tuple_fallback.type + if isinstance(tp, TupleType): + for base in tp.partial_fallback.type.mro: + if base.fullname == "builtins.tuple": + return base + assert False, "Invalid unpack type" + + +def repack_callable_args(callable: CallableType, tuple_type: TypeInfo) -> list[Type]: + """Present callable with star unpack in a normalized form. + + Since positional arguments cannot follow star argument, they are packed in a suffix, + while prefix is represented as individual positional args. We want to put all in a single + list with unpack in the middle, and prefix/suffix on the sides (as they would appear + in e.g. a TupleType). + """ + if ARG_STAR not in callable.arg_kinds: + return callable.arg_types + star_index = callable.arg_kinds.index(ARG_STAR) + arg_types = callable.arg_types[:star_index] + star_type = callable.arg_types[star_index] + suffix_types = [] + if not isinstance(star_type, UnpackType): + # Re-normalize *args: X -> *args: *tuple[X, ...] + star_type = UnpackType(Instance(tuple_type, [star_type])) + else: + tp = get_proper_type(star_type.type) + if isinstance(tp, TupleType): + assert isinstance(tp.items[0], UnpackType) + star_type = tp.items[0] + suffix_types = tp.items[1:] + return arg_types + [star_type] + suffix_types + + +def build_constraints_for_simple_unpack( + template_args: list[Type], actual_args: list[Type], direction: int +) -> list[Constraint]: + """Infer constraints between two lists of types with variadic items. + + This function is only supposed to be called when a variadic item is present in templates. + If there is no variadic item the actuals, we simply use split_with_prefix_and_suffix() + and infer prefix <: prefix, suffix <: suffix, variadic <: middle. If there is a variadic + item in the actuals we need to be more careful, only common prefix/suffix can generate + constraints, also we can only infer constraints for variadic template item, if template + prefix/suffix are shorter that actual ones, otherwise there may be partial overlap + between variadic items, for example if template prefix is longer: + + templates: T1, T2, Ts, Ts, Ts, ... + actuals: A1, As, As, As, ... + + Note: this function can only be called for builtin variadic constructors: Tuple and Callable. + For instances, you should first find correct type argument mapping. + """ + template_unpack = find_unpack_in_list(template_args) + assert template_unpack is not None + template_prefix = template_unpack + template_suffix = len(template_args) - template_prefix - 1 + + t_unpack = None + res = [] + + actual_unpack = find_unpack_in_list(actual_args) + if actual_unpack is None: + t_unpack = template_args[template_unpack] + if template_prefix + template_suffix > len(actual_args): + # These can't be subtypes of each-other, return fast. + assert isinstance(t_unpack, UnpackType) + if isinstance(t_unpack.type, TypeVarTupleType): + # Set TypeVarTuple to empty to improve error messages. + return [ + Constraint( + t_unpack.type, direction, TupleType([], t_unpack.type.tuple_fallback) + ) + ] + else: + return [] + common_prefix = template_prefix + common_suffix = template_suffix + else: + actual_prefix = actual_unpack + actual_suffix = len(actual_args) - actual_prefix - 1 + common_prefix = min(template_prefix, actual_prefix) + common_suffix = min(template_suffix, actual_suffix) + if actual_prefix >= template_prefix and actual_suffix >= template_suffix: + # This is the only case where we can guarantee there will be no partial overlap + # (note however partial overlap is OK for variadic tuples, it is handled below). + t_unpack = template_args[template_unpack] + + # Handle constraints from prefixes/suffixes first. + start, middle, end = split_with_prefix_and_suffix( + tuple(actual_args), common_prefix, common_suffix + ) + for t, a in zip(template_args[:common_prefix], start): + res.extend(infer_constraints(t, a, direction)) + if common_suffix: + for t, a in zip(template_args[-common_suffix:], end): + res.extend(infer_constraints(t, a, direction)) + + if t_unpack is not None: + # Add constraint(s) for variadic item when possible. + assert isinstance(t_unpack, UnpackType) + tp = get_proper_type(t_unpack.type) + if isinstance(tp, Instance) and tp.type.fullname == "builtins.tuple": + # Homogeneous case *tuple[T, ...] <: [X, Y, Z, ...]. + for a in middle: + # TODO: should we use union instead of join here? + if not isinstance(a, UnpackType): + res.extend(infer_constraints(tp.args[0], a, direction)) + else: + a_tp = get_proper_type(a.type) + # This is the case *tuple[T, ...] <: *tuple[A, ...]. + if isinstance(a_tp, Instance) and a_tp.type.fullname == "builtins.tuple": + res.extend(infer_constraints(tp.args[0], a_tp.args[0], direction)) + elif isinstance(tp, TypeVarTupleType): + res.append(Constraint(tp, direction, TupleType(list(middle), tp.tuple_fallback))) + elif actual_unpack is not None: + # A special case for a variadic tuple unpack, we simply infer T <: X from + # Tuple[..., *tuple[T, ...], ...] <: Tuple[..., *tuple[X, ...], ...]. + actual_unpack_type = actual_args[actual_unpack] + assert isinstance(actual_unpack_type, UnpackType) + a_unpacked = get_proper_type(actual_unpack_type.type) + if isinstance(a_unpacked, Instance) and a_unpacked.type.fullname == "builtins.tuple": + t_unpack = template_args[template_unpack] + assert isinstance(t_unpack, UnpackType) + tp = get_proper_type(t_unpack.type) + if isinstance(tp, Instance) and tp.type.fullname == "builtins.tuple": + res.extend(infer_constraints(tp.args[0], a_unpacked.args[0], direction)) + return res + + +def infer_directed_arg_constraints(left: Type, right: Type, direction: int) -> list[Constraint]: + """Infer constraints between two arguments using direction between original callables.""" + if isinstance(left, (ParamSpecType, UnpackType)) or isinstance( + right, (ParamSpecType, UnpackType) + ): + # This avoids bogus constraints like T <: P.args + # TODO: can we infer something useful for *T vs P? + return [] + if direction == SUBTYPE_OF: + # We invert direction to account for argument contravariance. + return infer_constraints(left, right, neg_op(direction)) + else: + return infer_constraints(right, left, neg_op(direction)) + + +def infer_callable_arguments_constraints( + template: NormalizedCallableType | Parameters, + actual: NormalizedCallableType | Parameters, + direction: int, +) -> list[Constraint]: + """Infer constraints between argument types of two callables. + + This function essentially extracts four steps from are_parameters_compatible() in + subtypes.py that involve subtype checks between argument types. We keep the argument + matching logic, but ignore various strictness flags present there, and checks that + do not involve subtyping. Then in place of every subtype check we put an infer_constraints() + call for the same types. + """ + res = [] + if direction == SUBTYPE_OF: + left, right = template, actual + else: + left, right = actual, template + left_star = left.var_arg() + left_star2 = left.kw_arg() + right_star = right.var_arg() + right_star2 = right.kw_arg() + + # Numbering of steps below matches the one in are_parameters_compatible() for convenience. + # Phase 1a: compare star vs star arguments. + if left_star is not None and right_star is not None: + res.extend(infer_directed_arg_constraints(left_star.typ, right_star.typ, direction)) + if left_star2 is not None and right_star2 is not None: + res.extend(infer_directed_arg_constraints(left_star2.typ, right_star2.typ, direction)) + + # Phase 1b: compare left args with corresponding non-star right arguments. + for right_arg in right.formal_arguments(): + left_arg = mypy.typeops.callable_corresponding_argument(left, right_arg) + if left_arg is None: + continue + res.extend(infer_directed_arg_constraints(left_arg.typ, right_arg.typ, direction)) + + # Phase 1c: compare left args with right *args. + if right_star is not None: + right_by_position = right.try_synthesizing_arg_from_vararg(None) + assert right_by_position is not None + i = right_star.pos + assert i is not None + while i < len(left.arg_kinds) and left.arg_kinds[i].is_positional(): + left_by_position = left.argument_by_position(i) + assert left_by_position is not None + res.extend( + infer_directed_arg_constraints( + left_by_position.typ, right_by_position.typ, direction + ) + ) + i += 1 + + # Phase 1d: compare left args with right **kwargs. + if right_star2 is not None: + right_names = {name for name in right.arg_names if name is not None} + left_only_names = set() + for name, kind in zip(left.arg_names, left.arg_kinds): + if name is None or kind.is_star() or name in right_names: + continue + left_only_names.add(name) + + right_by_name = right.try_synthesizing_arg_from_kwarg(None) + assert right_by_name is not None + for name in left_only_names: + left_by_name = left.argument_by_name(name) + assert left_by_name is not None + res.extend( + infer_directed_arg_constraints(left_by_name.typ, right_by_name.typ, direction) + ) + return res + + +def filter_imprecise_kinds(cs: list[Constraint]) -> list[Constraint]: + """For each ParamSpec remove all imprecise constraints, if at least one precise available.""" + have_precise = set() + for c in cs: + if not isinstance(c.origin_type_var, ParamSpecType): + continue + if ( + isinstance(c.target, ParamSpecType) + or isinstance(c.target, Parameters) + and not c.target.imprecise_arg_kinds + ): + have_precise.add(c.type_var) + new_cs = [] + for c in cs: + if not isinstance(c.origin_type_var, ParamSpecType) or c.type_var not in have_precise: + new_cs.append(c) + if not isinstance(c.target, Parameters) or not c.target.imprecise_arg_kinds: + new_cs.append(c) + return new_cs diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/copytype.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/copytype.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..4de05a0d1b89516f77101eabb18c85a60bfe0035 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/copytype.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/copytype.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/copytype.py new file mode 100644 index 0000000000000000000000000000000000000000..9a390a01bdbab4e385c4fc6687695d7d6cced3a6 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/copytype.py @@ -0,0 +1,134 @@ +from __future__ import annotations + +from typing import Any, cast + +from mypy.types import ( + AnyType, + CallableType, + DeletedType, + ErasedType, + Instance, + LiteralType, + NoneType, + Overloaded, + Parameters, + ParamSpecType, + PartialType, + ProperType, + TupleType, + TypeAliasType, + TypedDictType, + TypeType, + TypeVarTupleType, + TypeVarType, + UnboundType, + UninhabitedType, + UnionType, + UnpackType, +) + +# type_visitor needs to be imported after types +from mypy.type_visitor import TypeVisitor # ruff: isort: skip + + +def copy_type(t: ProperType) -> ProperType: + """Create a shallow copy of a type. + + This can be used to mutate the copy with truthiness information. + + Classes compiled with mypyc don't support copy.copy(), so we need + a custom implementation. + """ + return t.accept(TypeShallowCopier()) + + +class TypeShallowCopier(TypeVisitor[ProperType]): + def visit_unbound_type(self, t: UnboundType) -> ProperType: + return t + + def visit_any(self, t: AnyType) -> ProperType: + return self.copy_common(t, AnyType(t.type_of_any, t.source_any, t.missing_import_name)) + + def visit_none_type(self, t: NoneType) -> ProperType: + return self.copy_common(t, NoneType()) + + def visit_uninhabited_type(self, t: UninhabitedType) -> ProperType: + dup = UninhabitedType() + dup.ambiguous = t.ambiguous + return self.copy_common(t, dup) + + def visit_erased_type(self, t: ErasedType) -> ProperType: + return self.copy_common(t, ErasedType()) + + def visit_deleted_type(self, t: DeletedType) -> ProperType: + return self.copy_common(t, DeletedType(t.source)) + + def visit_instance(self, t: Instance) -> ProperType: + dup = Instance(t.type, t.args, last_known_value=t.last_known_value) + return self.copy_common(t, dup) + + def visit_type_var(self, t: TypeVarType) -> ProperType: + return self.copy_common(t, t.copy_modified()) + + def visit_param_spec(self, t: ParamSpecType) -> ProperType: + dup = ParamSpecType( + t.name, t.fullname, t.id, t.flavor, t.upper_bound, t.default, prefix=t.prefix + ) + return self.copy_common(t, dup) + + def visit_parameters(self, t: Parameters) -> ProperType: + dup = Parameters( + t.arg_types, + t.arg_kinds, + t.arg_names, + variables=t.variables, + is_ellipsis_args=t.is_ellipsis_args, + ) + return self.copy_common(t, dup) + + def visit_type_var_tuple(self, t: TypeVarTupleType) -> ProperType: + dup = TypeVarTupleType( + t.name, t.fullname, t.id, t.upper_bound, t.tuple_fallback, t.default + ) + return self.copy_common(t, dup) + + def visit_unpack_type(self, t: UnpackType) -> ProperType: + dup = UnpackType(t.type) + return self.copy_common(t, dup) + + def visit_partial_type(self, t: PartialType) -> ProperType: + return self.copy_common(t, PartialType(t.type, t.var, t.value_type)) + + def visit_callable_type(self, t: CallableType) -> ProperType: + return self.copy_common(t, t.copy_modified()) + + def visit_tuple_type(self, t: TupleType) -> ProperType: + return self.copy_common(t, TupleType(t.items, t.partial_fallback, implicit=t.implicit)) + + def visit_typeddict_type(self, t: TypedDictType) -> ProperType: + return self.copy_common( + t, TypedDictType(t.items, t.required_keys, t.readonly_keys, t.fallback) + ) + + def visit_literal_type(self, t: LiteralType) -> ProperType: + return self.copy_common(t, LiteralType(value=t.value, fallback=t.fallback)) + + def visit_union_type(self, t: UnionType) -> ProperType: + return self.copy_common(t, UnionType(t.items)) + + def visit_overloaded(self, t: Overloaded) -> ProperType: + return self.copy_common(t, Overloaded(items=t.items)) + + def visit_type_type(self, t: TypeType) -> ProperType: + # Use cast since the type annotations in TypeType are imprecise. + return self.copy_common(t, TypeType(cast(Any, t.item), is_type_form=t.is_type_form)) + + def visit_type_alias_type(self, t: TypeAliasType) -> ProperType: + assert False, "only ProperTypes supported" + + def copy_common(self, t: ProperType, t2: ProperType) -> ProperType: + t2.line = t.line + t2.column = t.column + t2.can_be_false = t.can_be_false + t2.can_be_true = t.can_be_true + return t2 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/defaults.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/defaults.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..2e081eb6760025c5caf945f7109e9d34df72f784 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/defaults.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/defaults.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/defaults.py new file mode 100644 index 0000000000000000000000000000000000000000..a39a577d03ac6b680dc2a10cdb595742edab086e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/defaults.py @@ -0,0 +1,51 @@ +from __future__ import annotations + +import os +from typing import Final + +# Earliest fully supported Python 3.x version. Used as the default Python +# version in tests. Mypy wheels should be built starting with this version, +# and CI tests should be run on this version (and later versions). +PYTHON3_VERSION: Final = (3, 10) + +# Earliest Python 3.x version supported via --python-version 3.x. To run +# mypy, at least version PYTHON3_VERSION is needed. +PYTHON3_VERSION_MIN: Final = (3, 9) # Keep in sync with typeshed's python support + +CACHE_DIR: Final = ".mypy_cache" + +CONFIG_NAMES: Final = ["mypy.ini", ".mypy.ini"] +SHARED_CONFIG_NAMES: Final = ["pyproject.toml", "setup.cfg"] + +USER_CONFIG_FILES: list[str] = ["~/.config/mypy/config", "~/.mypy.ini"] +if os.environ.get("XDG_CONFIG_HOME"): + USER_CONFIG_FILES.insert(0, os.path.join(os.environ["XDG_CONFIG_HOME"], "mypy/config")) +USER_CONFIG_FILES = [os.path.expanduser(f) for f in USER_CONFIG_FILES] + +# This must include all reporters defined in mypy.report. This is defined here +# to make reporter names available without importing mypy.report -- this speeds +# up startup. +REPORTER_NAMES: Final = [ + "linecount", + "any-exprs", + "linecoverage", + "memory-xml", + "cobertura-xml", + "xml", + "xslt-html", + "xslt-txt", + "html", + "txt", + "lineprecision", +] + +# Threshold after which we sometimes filter out most errors to avoid very +# verbose output. The default is to show all errors. +MANY_ERRORS_THRESHOLD: Final = -1 + +RECURSION_LIMIT: Final = 2**14 + +WORKER_START_INTERVAL: Final = 0.01 +WORKER_START_TIMEOUT: Final = 3 +WORKER_CONNECTION_TIMEOUT: Final = 10 +WORKER_DONE_TIMEOUT: Final = 600 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/dmypy_os.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/dmypy_os.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..d60c81ff21d64593d031e7a4526c9be422cb36b2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/dmypy_os.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/dmypy_os.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/dmypy_os.py new file mode 100644 index 0000000000000000000000000000000000000000..184015ffe7203d1ecd313586dccef953bb73621a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/dmypy_os.py @@ -0,0 +1,43 @@ +from __future__ import annotations + +import sys +from collections.abc import Callable +from typing import Any + +if sys.platform == "win32": + import ctypes + import subprocess + from ctypes.wintypes import DWORD, HANDLE + + PROCESS_QUERY_LIMITED_INFORMATION = ctypes.c_ulong(0x1000) + + kernel32 = ctypes.windll.kernel32 + OpenProcess: Callable[[DWORD, int, int], HANDLE] = kernel32.OpenProcess + GetExitCodeProcess: Callable[[HANDLE, Any], int] = kernel32.GetExitCodeProcess +else: + import os + import signal + + +def alive(pid: int) -> bool: + """Is the process alive?""" + if sys.platform == "win32": + # why can't anything be easy... + status = DWORD() + handle = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, 0, pid) + GetExitCodeProcess(handle, ctypes.byref(status)) + return status.value == 259 # STILL_ACTIVE + else: + try: + os.kill(pid, 0) + except OSError: + return False + return True + + +def kill(pid: int) -> None: + """Kill the process.""" + if sys.platform == "win32": + subprocess.check_output(f"taskkill /pid {pid} /f /t") + else: + os.kill(pid, signal.SIGKILL) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/dmypy_server.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/dmypy_server.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..bb5c9becc3875407282039d0115cabcd909cd0bf Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/dmypy_server.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/dmypy_server.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/dmypy_server.py new file mode 100644 index 0000000000000000000000000000000000000000..5b0e03282a4a6a606af6f6b0ccf9596495f5f037 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/dmypy_server.py @@ -0,0 +1,1126 @@ +"""Server for mypy daemon mode. + +This implements a daemon process which keeps useful state in memory +to enable fine-grained incremental reprocessing of changes. +""" + +from __future__ import annotations + +import argparse +import io +import json +import os +import pickle +import subprocess +import sys +import time +import traceback +from collections.abc import Callable, Sequence, Set as AbstractSet +from contextlib import redirect_stderr, redirect_stdout +from typing import Any, Final, TypeAlias as _TypeAlias + +from librt.base64 import b64encode + +import mypy.build +import mypy.errors +import mypy.main +from mypy.dmypy_util import WriteToConn, receive, send +from mypy.find_sources import InvalidSourceList, create_source_list +from mypy.fscache import FileSystemCache +from mypy.fswatcher import FileData, FileSystemWatcher +from mypy.inspections import InspectionEngine +from mypy.ipc import IPCServer +from mypy.modulefinder import BuildSource, FindModuleCache, SearchPaths, compute_search_paths +from mypy.options import Options +from mypy.server.update import FineGrainedBuildManager, refresh_suppressed_submodules +from mypy.suggestions import SuggestionEngine, SuggestionFailure +from mypy.typestate import reset_global_state +from mypy.util import FancyFormatter, count_stats +from mypy.version import __version__ + +MEM_PROFILE: Final = False # If True, dump memory profile after initialization + +if sys.platform == "win32": + from subprocess import STARTUPINFO + + def daemonize( + options: Options, status_file: str, timeout: int | None = None, log_file: str | None = None + ) -> int: + """Create the daemon process via "dmypy daemon" and pass options via command line + + When creating the daemon grandchild, we create it in a new console, which is + started hidden. We cannot use DETACHED_PROCESS since it will cause console windows + to pop up when starting. See + https://github.com/python/cpython/pull/4150#issuecomment-340215696 + for more on why we can't have nice things. + + It also pickles the options to be unpickled by mypy. + """ + command = [sys.executable, "-m", "mypy.dmypy", "--status-file", status_file, "daemon"] + pickled_options = pickle.dumps(options.snapshot()) + command.append(f'--options-data="{b64encode(pickled_options).decode()}"') + if timeout: + command.append(f"--timeout={timeout}") + if log_file: + command.append(f"--log-file={log_file}") + info = STARTUPINFO() + info.dwFlags = 0x1 # STARTF_USESHOWWINDOW aka use wShowWindow's value + info.wShowWindow = 0 # SW_HIDE aka make the window invisible + try: + subprocess.Popen(command, creationflags=0x10, startupinfo=info) # CREATE_NEW_CONSOLE + return 0 + except subprocess.CalledProcessError as e: + return e.returncode + +else: + + def _daemonize_cb(func: Callable[[], None], log_file: str | None = None) -> int: + """Arrange to call func() in a grandchild of the current process. + + Return 0 for success, exit status for failure, negative if + subprocess killed by signal. + """ + # See https://stackoverflow.com/questions/473620/how-do-you-create-a-daemon-in-python + sys.stdout.flush() + sys.stderr.flush() + pid = os.fork() + if pid: + # Parent process: wait for child in case things go bad there. + npid, sts = os.waitpid(pid, 0) + sig = sts & 0xFF + if sig: + print("Child killed by signal", sig) + return -sig + sts = sts >> 8 + if sts: + print("Child exit status", sts) + return sts + # Child process: do a bunch of UNIX stuff and then fork a grandchild. + try: + os.setsid() # Detach controlling terminal + os.umask(0o27) + devnull = os.open("/dev/null", os.O_RDWR) + os.dup2(devnull, 0) + os.dup2(devnull, 1) + os.dup2(devnull, 2) + os.close(devnull) + pid = os.fork() + if pid: + # Child is done, exit to parent. + os._exit(0) + # Grandchild: run the server. + if log_file: + sys.stdout = sys.stderr = open(log_file, "a", buffering=1) + fd = sys.stdout.fileno() + os.dup2(fd, 2) + os.dup2(fd, 1) + func() + finally: + # Make sure we never get back into the caller. + os._exit(1) + + def daemonize( + options: Options, status_file: str, timeout: int | None = None, log_file: str | None = None + ) -> int: + """Run the mypy daemon in a grandchild of the current process + + Return 0 for success, exit status for failure, negative if + subprocess killed by signal. + """ + return _daemonize_cb(Server(options, status_file, timeout).serve, log_file) + + +# Server code. + +CONNECTION_NAME: Final = "dmypy" + + +def process_start_options(flags: list[str], allow_sources: bool) -> Options: + _, options = mypy.main.process_options( + ["-i"] + flags, require_targets=False, server_options=True + ) + if options.report_dirs: + print("dmypy: Ignoring report generation settings. Start/restart cannot generate reports.") + if options.junit_xml: + print( + "dmypy: Ignoring report generation settings. " + "Start/restart does not support --junit-xml. Pass it to check/recheck instead" + ) + options.junit_xml = None + if not options.incremental: + sys.exit("dmypy: start/restart should not disable incremental mode") + if options.follow_imports not in ("skip", "error", "normal"): + sys.exit("dmypy: follow-imports=silent not supported") + return options + + +def ignore_suppressed_imports(module: str) -> bool: + """Can we skip looking for newly unsuppressed imports to module?""" + # Various submodules of 'encodings' can be suppressed, since it + # uses module-level '__getattr__'. Skip them since there are many + # of them, and following imports to them is kind of pointless. + return module.startswith("encodings.") + + +ModulePathPair: _TypeAlias = tuple[str, str] +ModulePathPairs: _TypeAlias = list[ModulePathPair] +ChangesAndRemovals: _TypeAlias = tuple[ModulePathPairs, ModulePathPairs] + + +class Server: + # NOTE: the instance is constructed in the parent process but + # serve() is called in the grandchild (by daemonize()). + + def __init__(self, options: Options, status_file: str, timeout: int | None = None) -> None: + """Initialize the server with the desired mypy flags.""" + self.options = options + # Snapshot the options info before we muck with it, to detect changes + self.options_snapshot = options.snapshot() + self.timeout = timeout + self.fine_grained_manager: FineGrainedBuildManager | None = None + + if os.path.isfile(status_file): + os.unlink(status_file) + + self.fscache = FileSystemCache() + + options.raise_exceptions = True + options.incremental = True + options.fine_grained_incremental = True + options.show_traceback = True + if options.use_fine_grained_cache: + # Using fine_grained_cache implies generating and caring + # about the fine grained cache + options.cache_fine_grained = True + else: + options.cache_dir = os.devnull + # Fine-grained incremental doesn't support general partial types + # (details in https://github.com/python/mypy/issues/4492) + options.local_partial_types = True + self.status_file = status_file + + # Since the object is created in the parent process we can check + # the output terminal options here. + self.formatter = FancyFormatter(sys.stdout, sys.stderr, options.hide_error_codes) + + def _response_metadata(self) -> dict[str, str]: + py_version = f"{self.options.python_version[0]}_{self.options.python_version[1]}" + return {"platform": self.options.platform, "python_version": py_version} + + def serve(self) -> None: + """Serve requests, synchronously (no thread or fork).""" + + command = None + server = IPCServer(CONNECTION_NAME, self.timeout) + orig_stdout = sys.stdout + orig_stderr = sys.stderr + + try: + with open(self.status_file, "w") as f: + json.dump({"pid": os.getpid(), "connection_name": server.connection_name}, f) + f.write("\n") # I like my JSON with a trailing newline + while True: + with server: + data = receive(server) + sys.stdout = WriteToConn(server, "stdout", sys.stdout.isatty()) + sys.stderr = WriteToConn(server, "stderr", sys.stderr.isatty()) + resp: dict[str, Any] = {} + if "command" not in data: + resp = {"error": "No command found in request"} + else: + command = data["command"] + if not isinstance(command, str): + resp = {"error": "Command is not a string"} + else: + command = data.pop("command") + try: + resp = self.run_command(command, data) + except Exception: + # If we are crashing, report the crash to the client + tb = traceback.format_exception(*sys.exc_info()) + resp = {"error": "Daemon crashed!\n" + "".join(tb)} + resp.update(self._response_metadata()) + resp["final"] = True + send(server, resp) + raise + resp["final"] = True + try: + resp.update(self._response_metadata()) + send(server, resp) + except OSError: + pass # Maybe the client hung up + if command == "stop": + reset_global_state() + sys.exit(0) + finally: + # Revert stdout/stderr so we can see any errors. + sys.stdout = orig_stdout + sys.stderr = orig_stderr + + # If the final command is something other than a clean + # stop, remove the status file. (We can't just + # simplify the logic and always remove the file, since + # that could cause us to remove a future server's + # status file.) + if command != "stop": + os.unlink(self.status_file) + try: + server.cleanup() # try to remove the socket dir on Linux + except OSError: + pass + exc_info = sys.exc_info() + if exc_info[0] and exc_info[0] is not SystemExit: + traceback.print_exception(*exc_info) + + def run_command(self, command: str, data: dict[str, object]) -> dict[str, object]: + """Run a specific command from the registry.""" + key = "cmd_" + command + method = getattr(self.__class__, key, None) + if method is None: + return {"error": f"Unrecognized command '{command}'"} + else: + if command not in {"check", "recheck", "run"}: + # Only the above commands use some error formatting. + del data["is_tty"] + del data["terminal_width"] + ret = method(self, **data) + assert isinstance(ret, dict) + return ret + + # Command functions (run in the server via RPC). + + def cmd_status(self, fswatcher_dump_file: str | None = None) -> dict[str, object]: + """Return daemon status.""" + res: dict[str, object] = {} + res.update(get_meminfo()) + if fswatcher_dump_file: + data = self.fswatcher.dump_file_data() if hasattr(self, "fswatcher") else {} + # Using .dumps and then writing was noticeably faster than using dump + s = json.dumps(data) + with open(fswatcher_dump_file, "w") as f: + f.write(s) + return res + + def cmd_stop(self) -> dict[str, object]: + """Stop daemon.""" + # We need to remove the status file *before* we complete the + # RPC. Otherwise a race condition exists where a subsequent + # command can see a status file from a dying server and think + # it is a live one. + os.unlink(self.status_file) + return {} + + def cmd_run( + self, + version: str, + args: Sequence[str], + export_types: bool, + is_tty: bool, + terminal_width: int, + ) -> dict[str, object]: + """Check a list of files, triggering a restart if needed.""" + stderr = io.StringIO() + stdout = io.StringIO() + try: + # Process options can exit on improper arguments, so we need to catch that and + # capture stderr so the client can report it + with redirect_stderr(stderr): + with redirect_stdout(stdout): + sources, options = mypy.main.process_options( + ["-i"] + list(args), + require_targets=True, + server_options=True, + fscache=self.fscache, + program="mypy-daemon", + header=argparse.SUPPRESS, + ) + # Signal that we need to restart if the options have changed + if not options.compare_stable(self.options_snapshot): + return {"restart": "configuration changed"} + if __version__ != version: + return {"restart": "mypy version changed"} + if self.fine_grained_manager: + manager = self.fine_grained_manager.manager + start_plugins_snapshot = manager.plugins_snapshot + _, current_plugins_snapshot = mypy.build.load_plugins( + options, manager.errors, sys.stdout, extra_plugins=() + ) + if current_plugins_snapshot != start_plugins_snapshot: + return {"restart": "plugins changed"} + except InvalidSourceList as err: + return {"out": "", "err": str(err), "status": 2} + except SystemExit as e: + return {"out": stdout.getvalue(), "err": stderr.getvalue(), "status": e.code} + return self.check(sources, export_types, is_tty, terminal_width) + + def cmd_check( + self, files: Sequence[str], export_types: bool, is_tty: bool, terminal_width: int + ) -> dict[str, object]: + """Check a list of files.""" + try: + sources = create_source_list(files, self.options, self.fscache) + except InvalidSourceList as err: + return {"out": "", "err": str(err), "status": 2} + return self.check(sources, export_types, is_tty, terminal_width) + + def cmd_recheck( + self, + is_tty: bool, + terminal_width: int, + export_types: bool, + remove: list[str] | None = None, + update: list[str] | None = None, + ) -> dict[str, object]: + """Check the same list of files we checked most recently. + + If remove/update is given, they modify the previous list; + if all are None, stat() is called for each file in the previous list. + """ + t0 = time.time() + if not self.fine_grained_manager: + return {"error": "Command 'recheck' is only valid after a 'check' command"} + sources = self.previous_sources + if remove: + removals = set(remove) + sources = [s for s in sources if s.path and s.path not in removals] + if update: + # Sort list of file updates by extension, so *.pyi files are first. + update.sort(key=lambda f: os.path.splitext(f)[1], reverse=True) + + known = {s.path for s in sources if s.path} + added = [p for p in update if p not in known] + try: + added_sources = create_source_list(added, self.options, self.fscache) + except InvalidSourceList as err: + return {"out": "", "err": str(err), "status": 2} + sources = sources + added_sources # Make a copy! + t1 = time.time() + manager = self.fine_grained_manager.manager + manager.log(f"fine-grained increment: cmd_recheck: {t1 - t0:.3f}s") + old_export_types = self.options.export_types + self.options.export_types = self.options.export_types or export_types + if not self.following_imports(): + messages = self.fine_grained_increment( + sources, remove, update, explicit_export_types=export_types + ) + else: + assert remove is None and update is None + messages = self.fine_grained_increment_follow_imports( + sources, explicit_export_types=export_types + ) + res = self.increment_output(messages, sources, is_tty, terminal_width) + self.flush_caches() + self.update_stats(res) + self.options.export_types = old_export_types + return res + + def check( + self, sources: list[BuildSource], export_types: bool, is_tty: bool, terminal_width: int + ) -> dict[str, Any]: + """Check using fine-grained incremental mode. + + If is_tty is True format the output nicely with colors and summary line + (unless disabled in self.options). Also pass the terminal_width to formatter. + """ + old_export_types = self.options.export_types + self.options.export_types = self.options.export_types or export_types + if not self.fine_grained_manager: + res = self.initialize_fine_grained(sources, is_tty, terminal_width) + else: + if not self.following_imports(): + messages = self.fine_grained_increment(sources, explicit_export_types=export_types) + else: + messages = self.fine_grained_increment_follow_imports( + sources, explicit_export_types=export_types + ) + res = self.increment_output(messages, sources, is_tty, terminal_width) + self.flush_caches() + self.update_stats(res) + self.options.export_types = old_export_types + return res + + def flush_caches(self) -> None: + self.fscache.flush() + if self.fine_grained_manager: + self.fine_grained_manager.flush_cache() + + def update_stats(self, res: dict[str, Any]) -> None: + if self.fine_grained_manager: + manager = self.fine_grained_manager.manager + manager.dump_stats() + res["stats"] = manager.stats + manager.stats = {} + + def following_imports(self) -> bool: + """Are we following imports?""" + # TODO: What about silent? + return self.options.follow_imports == "normal" + + def initialize_fine_grained( + self, sources: list[BuildSource], is_tty: bool, terminal_width: int + ) -> dict[str, Any]: + self.fswatcher = FileSystemWatcher(self.fscache) + t0 = time.time() + self.update_sources(sources) + t1 = time.time() + try: + result = mypy.build.build(sources=sources, options=self.options, fscache=self.fscache) + except mypy.errors.CompileError as e: + output = "".join(s + "\n" for s in e.messages) + if e.use_stdout: + out, err = output, "" + else: + out, err = "", output + return {"out": out, "err": err, "status": 2} + messages = result.errors + self.fine_grained_manager = FineGrainedBuildManager(result) + + original_sources_len = len(sources) + if self.following_imports(): + sources = find_all_sources_in_build(self.fine_grained_manager.graph, sources) + self.update_sources(sources) + + self.previous_sources = sources + + # If we are using the fine-grained cache, build hasn't actually done + # the typechecking on the updated files yet. + # Run a fine-grained update starting from the cached data + if result.used_cache: + t2 = time.time() + # Pull times and hashes out of the saved_cache and stick them into + # the fswatcher, so we pick up the changes. + for state in self.fine_grained_manager.graph.values(): + meta = state.meta + if meta is None: + continue + assert state.path is not None + self.fswatcher.set_file_data( + state.path, + FileData(st_mtime=float(meta.mtime), st_size=meta.size, hash=meta.hash), + ) + + changed, removed = self.find_changed(sources) + changed += self.find_added_suppressed( + self.fine_grained_manager.graph, + set(), + self.fine_grained_manager.manager.search_paths, + ) + + # Find anything that has had its dependency list change + for state in self.fine_grained_manager.graph.values(): + if not state.is_fresh(): + assert state.path is not None + changed.append((state.id, state.path)) + + t3 = time.time() + # Run an update + messages = self.fine_grained_manager.update(changed, removed) + + if self.following_imports(): + # We need to do another update to any new files found by following imports. + messages = self.fine_grained_increment_follow_imports(sources) + + t4 = time.time() + self.fine_grained_manager.manager.add_stats( + update_sources_time=t1 - t0, + build_time=t2 - t1, + find_changes_time=t3 - t2, + fg_update_time=t4 - t3, + files_changed=len(removed) + len(changed), + ) + + else: + # Stores the initial state of sources as a side effect. + self.fswatcher.find_changed() + + if MEM_PROFILE: + from mypy.memprofile import print_memory_profile + + print_memory_profile(run_gc=False) + + __, n_notes, __ = count_stats(messages) + status = 1 if messages and n_notes < len(messages) else 0 + # We use explicit sources length to match the logic in non-incremental mode. + messages = self.pretty_messages(messages, original_sources_len, is_tty, terminal_width) + return {"out": "".join(s + "\n" for s in messages), "err": "", "status": status} + + def fine_grained_increment( + self, + sources: list[BuildSource], + remove: list[str] | None = None, + update: list[str] | None = None, + explicit_export_types: bool = False, + ) -> list[str]: + """Perform a fine-grained type checking increment. + + If remove and update are None, determine changed paths by using + fswatcher. Otherwise, assume that only these files have changes. + + Args: + sources: sources passed on the command line + remove: paths of files that have been removed + update: paths of files that have been changed or created + explicit_export_types: --export-type was passed in a check command + (as opposite to being set in dmypy start) + """ + assert self.fine_grained_manager is not None + manager = self.fine_grained_manager.manager + + t0 = time.time() + if remove is None and update is None: + # Use the fswatcher to determine which files were changed + # (updated or added) or removed. + self.update_sources(sources) + changed, removed = self.find_changed(sources) + else: + # Use the remove/update lists to update fswatcher. + # This avoids calling stat() for unchanged files. + changed, removed = self.update_changed(sources, remove or [], update or []) + if explicit_export_types: + # If --export-types is given, we need to force full re-checking of all + # explicitly passed files, since we need to visit each expression. + add_all_sources_to_changed(sources, changed) + changed += self.find_added_suppressed( + self.fine_grained_manager.graph, set(), manager.search_paths + ) + manager.search_paths = compute_search_paths(sources, manager.options, manager.data_dir) + t1 = time.time() + manager.log(f"fine-grained increment: find_changed: {t1 - t0:.3f}s") + messages = self.fine_grained_manager.update(changed, removed) + t2 = time.time() + manager.log(f"fine-grained increment: update: {t2 - t1:.3f}s") + manager.add_stats( + find_changes_time=t1 - t0, + fg_update_time=t2 - t1, + files_changed=len(removed) + len(changed), + ) + + self.previous_sources = sources + return messages + + def fine_grained_increment_follow_imports( + self, sources: list[BuildSource], explicit_export_types: bool = False + ) -> list[str]: + """Like fine_grained_increment, but follow imports.""" + t0 = time.time() + + # TODO: Support file events + + assert self.fine_grained_manager is not None + fine_grained_manager = self.fine_grained_manager + graph = fine_grained_manager.graph + manager = fine_grained_manager.manager + + orig_modules = list(graph.keys()) + + self.update_sources(sources) + changed_paths = self.fswatcher.find_changed() + manager.search_paths = compute_search_paths(sources, manager.options, manager.data_dir) + + t1 = time.time() + manager.log(f"fine-grained increment: find_changed: {t1 - t0:.3f}s") + + # Track all modules encountered so far. New entries for all dependencies + # are added below by other module finding methods below. All dependencies + # in graph but not in `seen` are considered deleted at the end of this method. + seen = {source.module for source in sources} + + # Find changed modules reachable from roots (or in roots) already in graph. + changed, new_files = self.find_reachable_changed_modules( + sources, graph, seen, changed_paths + ) + # Same as in fine_grained_increment(). + self.add_explicitly_new(sources, changed) + if explicit_export_types: + # Same as in fine_grained_increment(). + add_all_sources_to_changed(sources, changed) + sources.extend(new_files) + + # Process changes directly reachable from roots. + messages = fine_grained_manager.update(changed, [], followed=True) + + # Follow deps from changed modules (still within graph). + worklist = changed.copy() + while worklist: + module = worklist.pop() + if module[0] not in graph: + continue + sources2 = self.direct_imports(module, graph) + # Filter anything already seen before. This prevents + # infinite looping if there are any self edges. (Self + # edges are maybe a bug, but...) + sources2 = [source for source in sources2 if source.module not in seen] + changed, new_files = self.find_reachable_changed_modules( + sources2, graph, seen, changed_paths + ) + self.update_sources(new_files) + messages = fine_grained_manager.update(changed, [], followed=True) + worklist.extend(changed) + + t2 = time.time() + + def refresh_file(module: str, path: str) -> list[str]: + return fine_grained_manager.update([(module, path)], [], followed=True) + + for module_id, state in list(graph.items()): + new_messages = refresh_suppressed_submodules( + module_id, state.path, fine_grained_manager.deps, graph, self.fscache, refresh_file + ) + if new_messages is not None: + messages = new_messages + + t3 = time.time() + + # There may be new files that became available, currently treated as + # suppressed imports. Process them. + while True: + new_unsuppressed = self.find_added_suppressed(graph, seen, manager.search_paths) + if not new_unsuppressed: + break + new_files = [BuildSource(mod[1], mod[0], followed=True) for mod in new_unsuppressed] + sources.extend(new_files) + self.update_sources(new_files) + messages = fine_grained_manager.update(new_unsuppressed, [], followed=True) + + for module_id, path in new_unsuppressed: + new_messages = refresh_suppressed_submodules( + module_id, path, fine_grained_manager.deps, graph, self.fscache, refresh_file + ) + if new_messages is not None: + messages = new_messages + + t4 = time.time() + + # Find all original modules in graph that were not reached -- they are deleted. + to_delete = [] + for module_id in orig_modules: + if module_id not in graph: + continue + if module_id not in seen: + module_path = graph[module_id].path + assert module_path is not None + to_delete.append((module_id, module_path)) + if to_delete: + messages = fine_grained_manager.update([], to_delete) + + fix_module_deps(graph) + + self.previous_sources = find_all_sources_in_build(graph) + self.update_sources(self.previous_sources) + + # Store current file state as side effect + self.fswatcher.find_changed() + + t5 = time.time() + + manager.log(f"fine-grained increment: update: {t5 - t1:.3f}s") + manager.add_stats( + find_changes_time=t1 - t0, + fg_update_time=t2 - t1, + refresh_suppressed_time=t3 - t2, + find_added_suppressed_time=t4 - t3, + cleanup_time=t5 - t4, + ) + + return messages + + def find_reachable_changed_modules( + self, + roots: list[BuildSource], + graph: mypy.build.Graph, + seen: set[str], + changed_paths: AbstractSet[str], + ) -> tuple[list[tuple[str, str]], list[BuildSource]]: + """Follow imports within graph from given sources until hitting changed modules. + + If we find a changed module, we can't continue following imports as the imports + may have changed. + + Args: + roots: modules where to start search from + graph: module graph to use for the search + seen: modules we've seen before that won't be visited (mutated here!!). + Needed to accumulate all modules encountered during update and remove + everything that no longer exists. + changed_paths: which paths have changed (stop search here and return any found) + + Return (encountered reachable changed modules, + unchanged files not in sources_set traversed). + """ + changed = [] + new_files = [] + worklist = roots.copy() + seen.update(source.module for source in worklist) + while worklist: + nxt = worklist.pop() + if nxt.module not in seen: + seen.add(nxt.module) + new_files.append(nxt) + if nxt.path in changed_paths: + assert nxt.path is not None # TODO + changed.append((nxt.module, nxt.path)) + elif nxt.module in graph: + state = graph[nxt.module] + ancestors = state.ancestors or [] + for dep in state.dependencies + ancestors: + if dep not in seen: + seen.add(dep) + worklist.append(BuildSource(graph[dep].path, graph[dep].id, followed=True)) + return changed, new_files + + def direct_imports( + self, module: tuple[str, str], graph: mypy.build.Graph + ) -> list[BuildSource]: + """Return the direct imports of module not included in seen.""" + state = graph[module[0]] + return [BuildSource(graph[dep].path, dep, followed=True) for dep in state.dependencies] + + def find_added_suppressed( + self, graph: mypy.build.Graph, seen: set[str], search_paths: SearchPaths + ) -> list[tuple[str, str]]: + """Find suppressed modules that have been added (and not included in seen). + + Args: + seen: reachable modules we've seen before (mutated here!!). + Needed to accumulate all modules encountered during update and remove + everything that no longer exists. + + Return suppressed, added modules. + """ + all_suppressed = set() + for state in graph.values(): + all_suppressed |= state.suppressed_set + + # Filter out things that shouldn't actually be considered suppressed. + # + # TODO: Figure out why these are treated as suppressed + all_suppressed = { + module + for module in all_suppressed + if module not in graph and not ignore_suppressed_imports(module) + } + + # Optimization: skip top-level packages that are obviously not + # there, to avoid calling the relatively slow find_module() + # below too many times. + packages = {module.split(".", 1)[0] for module in all_suppressed} + packages = filter_out_missing_top_level_packages(packages, search_paths, self.fscache) + + # TODO: Namespace packages + + finder = FindModuleCache(search_paths, self.fscache, self.options) + + found = [] + + for module in all_suppressed: + top_level_pkg = module.split(".", 1)[0] + if top_level_pkg not in packages: + # Fast path: non-existent top-level package + continue + result = finder.find_module(module, fast_path=True) + if isinstance(result, str) and module not in seen: + # When not following imports, we only follow imports to .pyi files. + if not self.following_imports() and not result.endswith(".pyi"): + continue + found.append((module, result)) + seen.add(module) + + return found + + def increment_output( + self, messages: list[str], sources: list[BuildSource], is_tty: bool, terminal_width: int + ) -> dict[str, Any]: + status = 1 if messages else 0 + messages = self.pretty_messages(messages, len(sources), is_tty, terminal_width) + return {"out": "".join(s + "\n" for s in messages), "err": "", "status": status} + + def pretty_messages( + self, + messages: list[str], + n_sources: int, + is_tty: bool = False, + terminal_width: int | None = None, + ) -> list[str]: + use_color = self.options.color_output and is_tty + fit_width = self.options.pretty and is_tty + if fit_width: + messages = self.formatter.fit_in_terminal( + messages, fixed_terminal_width=terminal_width + ) + if self.options.error_summary: + summary: str | None = None + n_errors, n_notes, n_files = count_stats(messages) + if n_errors: + summary = self.formatter.format_error( + n_errors, n_files, n_sources, use_color=use_color + ) + elif not messages or n_notes == len(messages): + summary = self.formatter.format_success(n_sources, use_color) + if summary: + # Create new list to avoid appending multiple summaries on successive runs. + messages = messages + [summary] + if use_color: + messages = [self.formatter.colorize(m) for m in messages] + return messages + + def update_sources(self, sources: list[BuildSource]) -> None: + paths = [source.path for source in sources if source.path is not None] + if self.following_imports(): + # Filter out directories (used for namespace packages). + paths = [path for path in paths if self.fscache.isfile(path)] + self.fswatcher.add_watched_paths(paths) + + def update_changed( + self, sources: list[BuildSource], remove: list[str], update: list[str] + ) -> ChangesAndRemovals: + changed_paths = self.fswatcher.update_changed(remove, update) + return self._find_changed(sources, changed_paths) + + def find_changed(self, sources: list[BuildSource]) -> ChangesAndRemovals: + changed_paths = self.fswatcher.find_changed() + return self._find_changed(sources, changed_paths) + + def _find_changed( + self, sources: list[BuildSource], changed_paths: AbstractSet[str] + ) -> ChangesAndRemovals: + # Find anything that has been added or modified + changed = [ + (source.module, source.path) + for source in sources + if source.path and source.path in changed_paths + ] + + # Now find anything that has been removed from the build + modules = {source.module for source in sources} + omitted = [source for source in self.previous_sources if source.module not in modules] + removed = [] + for source in omitted: + path = source.path + assert path + removed.append((source.module, path)) + + self.add_explicitly_new(sources, changed) + + # Find anything that has had its module path change because of added or removed __init__s + last = {s.path: s.module for s in self.previous_sources} + for s in sources: + assert s.path + if s.path in last and last[s.path] != s.module: + # Mark it as removed from its old name and changed at its new name + removed.append((last[s.path], s.path)) + changed.append((s.module, s.path)) + + return changed, removed + + def add_explicitly_new( + self, sources: list[BuildSource], changed: list[tuple[str, str]] + ) -> None: + # Always add modules that were (re-)added, since they may be detected as not changed by + # fswatcher (if they were actually not changed), but they may still need to be checked + # in case they had errors before they were deleted from sources on previous runs. + previous_modules = {source.module for source in self.previous_sources} + changed_set = set(changed) + changed.extend( + [ + (source.module, source.path) + for source in sources + if source.path + and source.module not in previous_modules + and (source.module, source.path) not in changed_set + ] + ) + + def cmd_inspect( + self, + show: str, + location: str, + verbosity: int = 0, + limit: int = 0, + include_span: bool = False, + include_kind: bool = False, + include_object_attrs: bool = False, + union_attrs: bool = False, + force_reload: bool = False, + ) -> dict[str, object]: + """Locate and inspect expression(s).""" + if not self.fine_grained_manager: + return { + "error": 'Command "inspect" is only valid after a "check" command' + " (that produces no parse errors)" + } + engine = InspectionEngine( + self.fine_grained_manager, + verbosity=verbosity, + limit=limit, + include_span=include_span, + include_kind=include_kind, + include_object_attrs=include_object_attrs, + union_attrs=union_attrs, + force_reload=force_reload, + ) + old_inspections = self.options.inspections + self.options.inspections = True + try: + if show == "type": + result = engine.get_type(location) + elif show == "attrs": + result = engine.get_attrs(location) + elif show == "definition": + result = engine.get_definition(location) + else: + assert False, "Unknown inspection kind" + finally: + self.options.inspections = old_inspections + if "out" in result: + assert isinstance(result["out"], str) + result["out"] += "\n" + return result + + def cmd_suggest(self, function: str, callsites: bool, **kwargs: Any) -> dict[str, object]: + """Suggest a signature for a function.""" + if not self.fine_grained_manager: + return { + "error": "Command 'suggest' is only valid after a 'check' command" + " (that produces no parse errors)" + } + engine = SuggestionEngine(self.fine_grained_manager, **kwargs) + try: + if callsites: + out = engine.suggest_callsites(function) + else: + out = engine.suggest(function) + except SuggestionFailure as err: + return {"error": str(err)} + else: + if not out: + out = "No suggestions\n" + elif not out.endswith("\n"): + out += "\n" + return {"out": out, "err": "", "status": 0} + finally: + self.flush_caches() + + def cmd_hang(self) -> dict[str, object]: + """Hang for 100 seconds, as a debug hack.""" + time.sleep(100) + return {} + + +# Misc utilities. + + +MiB: Final = 2**20 + + +def get_meminfo() -> dict[str, Any]: + res: dict[str, Any] = {} + try: + import psutil + except ImportError: + res["memory_psutil_missing"] = ( + "psutil not found, run pip install mypy[dmypy] " + "to install the needed components for dmypy" + ) + else: + process = psutil.Process() + meminfo = process.memory_info() + res["memory_rss_mib"] = meminfo.rss / MiB + res["memory_vms_mib"] = meminfo.vms / MiB + if sys.platform == "win32": + res["memory_maxrss_mib"] = meminfo.peak_wset / MiB + else: + # See https://stackoverflow.com/questions/938733/total-memory-used-by-python-process + import resource # Since it doesn't exist on Windows. + + rusage = resource.getrusage(resource.RUSAGE_SELF) + if sys.platform == "darwin": + factor = 1 + else: + factor = 1024 # Linux + res["memory_maxrss_mib"] = rusage.ru_maxrss * factor / MiB + return res + + +def find_all_sources_in_build( + graph: mypy.build.Graph, extra: Sequence[BuildSource] = () +) -> list[BuildSource]: + result = list(extra) + seen = {source.module for source in result} + for module, state in graph.items(): + if module not in seen: + result.append(BuildSource(state.path, module)) + return result + + +def add_all_sources_to_changed(sources: list[BuildSource], changed: list[tuple[str, str]]) -> None: + """Add all (explicit) sources to the list changed files in place. + + Use this when re-processing of unchanged files is needed (e.g. for + the purpose of exporting types for inspections). + """ + changed_set = set(changed) + changed.extend( + [ + (bs.module, bs.path) + for bs in sources + if bs.path and (bs.module, bs.path) not in changed_set + ] + ) + + +def fix_module_deps(graph: mypy.build.Graph) -> None: + """After an incremental update, update module dependencies to reflect the new state. + + This can make some suppressed dependencies non-suppressed, and vice versa (if modules + have been added to or removed from the build). + """ + for state in graph.values(): + new_suppressed = [] + new_dependencies = [] + for dep in state.dependencies + state.suppressed: + if dep in graph: + new_dependencies.append(dep) + else: + new_suppressed.append(dep) + state.dependencies = new_dependencies + state.dependencies_set = set(new_dependencies) + state.suppressed = new_suppressed + state.suppressed_set = set(new_suppressed) + + +def filter_out_missing_top_level_packages( + packages: set[str], search_paths: SearchPaths, fscache: FileSystemCache +) -> set[str]: + """Quickly filter out obviously missing top-level packages. + + Return packages with entries that can't be found removed. + + This is approximate: some packages that aren't actually valid may be + included. However, all potentially valid packages must be returned. + """ + # Start with a empty set and add all potential top-level packages. + found = set() + paths = ( + search_paths.python_path + + search_paths.mypy_path + + search_paths.package_path + + search_paths.typeshed_path + ) + for p in paths: + try: + entries = fscache.listdir(p) + except Exception: + entries = [] + for entry in entries: + # The code is hand-optimized for mypyc since this may be somewhat + # performance-critical. + if entry.endswith(".py"): + entry = entry[:-3] + elif entry.endswith(".pyi"): + entry = entry[:-4] + elif entry.endswith("-stubs"): + # Possible PEP 561 stub package + entry = entry[:-6] + if entry in packages: + found.add(entry) + return found diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/dmypy_util.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/dmypy_util.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..19495ea35488e9d6c31fe4017d288abc5eca064b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/dmypy_util.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/dmypy_util.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/dmypy_util.py new file mode 100644 index 0000000000000000000000000000000000000000..eeb918b7877e596a318af637ecf5c0597c1d388d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/dmypy_util.py @@ -0,0 +1,117 @@ +"""Shared code between dmypy.py and dmypy_server.py. + +This should be pretty lightweight and not depend on other mypy code (other than ipc). +""" + +from __future__ import annotations + +import io +import json +from collections.abc import Iterable, Iterator +from types import TracebackType +from typing import Any, Final, TextIO + +from mypy.ipc import IPCBase + +DEFAULT_STATUS_FILE: Final = ".dmypy.json" + + +def receive(connection: IPCBase) -> Any: + """Receive single JSON data frame from a connection. + + Raise OSError if the data received is not valid JSON or if it is + not a dict. + """ + bdata = connection.read() + if not bdata: + raise OSError("No data received") + try: + data = json.loads(bdata) + except Exception as e: + raise OSError("Data received is not valid JSON") from e + if not isinstance(data, dict): + raise OSError(f"Data received is not a dict ({type(data)})") + return data + + +def send(connection: IPCBase, data: Any) -> None: + """Send data to a connection encoded and framed. + + The data must be JSON-serializable. We assume that a single send call is a + single frame to be sent on the connect. + """ + connection.write(json.dumps(data)) + + +class WriteToConn(TextIO): + """Helper class to write to a connection instead of standard output.""" + + def __init__(self, server: IPCBase, output_key: str, isatty: bool) -> None: + self.server = server + self.output_key = output_key + self._isatty = isatty + + def __enter__(self) -> TextIO: + return self + + def __exit__( + self, + t: type[BaseException] | None, + value: BaseException | None, + traceback: TracebackType | None, + ) -> None: + pass + + def __iter__(self) -> Iterator[str]: + raise io.UnsupportedOperation + + def __next__(self) -> str: + raise io.UnsupportedOperation + + def close(self) -> None: + pass + + def fileno(self) -> int: + raise OSError + + def flush(self) -> None: + pass + + def isatty(self) -> bool: + return self._isatty + + def read(self, n: int = 0) -> str: + raise io.UnsupportedOperation + + def readable(self) -> bool: + return False + + def readline(self, limit: int = 0) -> str: + raise io.UnsupportedOperation + + def readlines(self, hint: int = 0) -> list[str]: + raise io.UnsupportedOperation + + def seek(self, offset: int, whence: int = 0) -> int: + raise io.UnsupportedOperation + + def seekable(self) -> bool: + return False + + def tell(self) -> int: + raise io.UnsupportedOperation + + def truncate(self, size: int | None = 0) -> int: + raise io.UnsupportedOperation + + def write(self, output: str) -> int: + resp: dict[str, Any] = {self.output_key: output} + send(self.server, resp) + return len(output) + + def writable(self) -> bool: + return True + + def writelines(self, lines: Iterable[str]) -> None: + for s in lines: + self.write(s) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/erasetype.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/erasetype.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..6ea5d6e8253269bdffbb977eb491e873213a9c0b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/erasetype.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/erasetype.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/erasetype.py new file mode 100644 index 0000000000000000000000000000000000000000..cb8d66f292dd3157b781ad8aa3cc5ebdf3e3e6d2 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/erasetype.py @@ -0,0 +1,301 @@ +from __future__ import annotations + +from collections.abc import Callable, Container +from typing import cast + +from mypy.nodes import ARG_STAR, ARG_STAR2 +from mypy.types import ( + AnyType, + CallableType, + DeletedType, + ErasedType, + Instance, + LiteralType, + NoneType, + Overloaded, + Parameters, + ParamSpecType, + PartialType, + ProperType, + TupleType, + Type, + TypeAliasType, + TypedDictType, + TypeOfAny, + TypeTranslator, + TypeType, + TypeVarId, + TypeVarTupleType, + TypeVarType, + TypeVisitor, + UnboundType, + UninhabitedType, + UnionType, + UnpackType, + get_proper_type, + get_proper_types, +) +from mypy.typevartuples import erased_vars + + +def erase_type(typ: Type) -> ProperType: + """Erase any type variables from a type. + + Also replace tuple types with the corresponding concrete types. + + Examples: + A -> A + B[X] -> B[Any] + Tuple[A, B] -> tuple + Callable[[A1, A2, ...], R] -> Callable[..., Any] + Type[X] -> Type[Any] + """ + typ = get_proper_type(typ) + return typ.accept(EraseTypeVisitor()) + + +class EraseTypeVisitor(TypeVisitor[ProperType]): + def visit_unbound_type(self, t: UnboundType) -> ProperType: + # TODO: replace with an assert after UnboundType can't leak from semantic analysis. + return AnyType(TypeOfAny.from_error) + + def visit_any(self, t: AnyType) -> ProperType: + return t + + def visit_none_type(self, t: NoneType) -> ProperType: + return t + + def visit_uninhabited_type(self, t: UninhabitedType) -> ProperType: + return t + + def visit_erased_type(self, t: ErasedType) -> ProperType: + return t + + def visit_partial_type(self, t: PartialType) -> ProperType: + # Should not get here. + raise RuntimeError("Cannot erase partial types") + + def visit_deleted_type(self, t: DeletedType) -> ProperType: + return t + + def visit_instance(self, t: Instance) -> ProperType: + args = erased_vars(t.type.defn.type_vars, TypeOfAny.special_form) + return Instance(t.type, args, t.line) + + def visit_type_var(self, t: TypeVarType) -> ProperType: + return AnyType(TypeOfAny.special_form) + + def visit_param_spec(self, t: ParamSpecType) -> ProperType: + return AnyType(TypeOfAny.special_form) + + def visit_parameters(self, t: Parameters) -> ProperType: + raise RuntimeError("Parameters should have been bound to a class") + + def visit_type_var_tuple(self, t: TypeVarTupleType) -> ProperType: + # Likely, we can never get here because of aggressive erasure of types that + # can contain this, but better still return a valid replacement. + return t.tuple_fallback.copy_modified(args=[AnyType(TypeOfAny.special_form)]) + + def visit_unpack_type(self, t: UnpackType) -> ProperType: + return AnyType(TypeOfAny.special_form) + + def visit_callable_type(self, t: CallableType) -> ProperType: + # We must preserve the fallback type for overload resolution to work. + any_type = AnyType(TypeOfAny.special_form) + return CallableType( + arg_types=[any_type, any_type], + arg_kinds=[ARG_STAR, ARG_STAR2], + arg_names=[None, None], + ret_type=any_type, + fallback=t.fallback, + is_ellipsis_args=True, + implicit=True, + ) + + def visit_overloaded(self, t: Overloaded) -> ProperType: + return t.fallback.accept(self) + + def visit_tuple_type(self, t: TupleType) -> ProperType: + return t.partial_fallback.accept(self) + + def visit_typeddict_type(self, t: TypedDictType) -> ProperType: + return t.fallback.accept(self) + + def visit_literal_type(self, t: LiteralType) -> ProperType: + # The fallback for literal types should always be either + # something like int or str, or an enum class -- types that + # don't contain any TypeVars. So there's no need to visit it. + return t + + def visit_union_type(self, t: UnionType) -> ProperType: + erased_items = [erase_type(item) for item in t.items] + from mypy.typeops import make_simplified_union + + return make_simplified_union(erased_items) + + def visit_type_type(self, t: TypeType) -> ProperType: + return TypeType.make_normalized( + t.item.accept(self), line=t.line, is_type_form=t.is_type_form + ) + + def visit_type_alias_type(self, t: TypeAliasType) -> ProperType: + raise RuntimeError("Type aliases should be expanded before accepting this visitor") + + +def erase_typevars(t: Type, ids_to_erase: Container[TypeVarId] | None = None) -> Type: + """Replace all type variables in a type with any, + or just the ones in the provided collection. + """ + + if ids_to_erase is None: + return t.accept(TypeVarEraser(None, AnyType(TypeOfAny.special_form))) + + def erase_id(id: TypeVarId) -> bool: + return id in ids_to_erase + + return t.accept(TypeVarEraser(erase_id, AnyType(TypeOfAny.special_form))) + + +def erase_meta_id(id: TypeVarId) -> bool: + return id.is_meta_var() + + +def replace_meta_vars(t: Type, target_type: Type) -> Type: + """Replace unification variables in a type with the target type.""" + return t.accept(TypeVarEraser(erase_meta_id, target_type)) + + +class TypeVarEraser(TypeTranslator): + """Implementation of type erasure""" + + def __init__(self, erase_id: Callable[[TypeVarId], bool] | None, replacement: Type) -> None: + super().__init__() + self.erase_id = erase_id + self.replacement = replacement + + def visit_type_var(self, t: TypeVarType) -> Type: + if self.erase_id is None or self.erase_id(t.id): + return self.replacement + return t + + # TODO: below two methods duplicate some logic with expand_type(). + # In fact, we may want to refactor this whole visitor to use expand_type(). + def visit_instance(self, t: Instance) -> Type: + result = super().visit_instance(t) + assert isinstance(result, ProperType) and isinstance(result, Instance) + if t.type.fullname == "builtins.tuple": + # Normalize Tuple[*Tuple[X, ...], ...] -> Tuple[X, ...] + arg = result.args[0] + if isinstance(arg, UnpackType): + unpacked = get_proper_type(arg.type) + if isinstance(unpacked, Instance): + assert unpacked.type.fullname == "builtins.tuple" + return unpacked + return result + + def visit_tuple_type(self, t: TupleType) -> Type: + result = super().visit_tuple_type(t) + assert isinstance(result, ProperType) and isinstance(result, TupleType) + if len(result.items) == 1: + # Normalize Tuple[*Tuple[X, ...]] -> Tuple[X, ...] + item = result.items[0] + if isinstance(item, UnpackType): + unpacked = get_proper_type(item.type) + if isinstance(unpacked, Instance): + assert unpacked.type.fullname == "builtins.tuple" + if result.partial_fallback.type.fullname != "builtins.tuple": + # If it is a subtype (like named tuple) we need to preserve it, + # this essentially mimics the logic in tuple_fallback(). + return result.partial_fallback.accept(self) + return unpacked + return result + + def visit_callable_type(self, t: CallableType) -> Type: + result = super().visit_callable_type(t) + assert isinstance(result, ProperType) and isinstance(result, CallableType) + # Usually this is done in semanal_typeargs.py, but erasure can create + # a non-normal callable from normal one. + result.normalize_trivial_unpack() + return result + + def visit_type_var_tuple(self, t: TypeVarTupleType) -> Type: + if self.erase_id is None or self.erase_id(t.id): + return t.tuple_fallback.copy_modified(args=[self.replacement]) + return t + + def visit_param_spec(self, t: ParamSpecType) -> Type: + # TODO: we should probably preserve prefix here. + if self.erase_id is None or self.erase_id(t.id): + return self.replacement + return t + + def visit_type_alias_type(self, t: TypeAliasType) -> Type: + # Type alias target can't contain bound type variables (not bound by the type + # alias itself), so it is safe to just erase the arguments. + return t.copy_modified(args=[a.accept(self) for a in t.args]) + + +def remove_instance_last_known_values(t: Type) -> Type: + return t.accept(LastKnownValueEraser()) + + +class LastKnownValueEraser(TypeTranslator): + """Removes the Literal[...] type that may be associated with any + Instance types.""" + + def visit_instance(self, t: Instance) -> Type: + if not t.last_known_value and not t.args: + return t + return t.copy_modified(args=[a.accept(self) for a in t.args], last_known_value=None) + + def visit_type_alias_type(self, t: TypeAliasType) -> Type: + # Type aliases can't contain literal values, because they are + # always constructed as explicit types. + return t + + def visit_union_type(self, t: UnionType) -> Type: + new = cast(UnionType, super().visit_union_type(t)) + # Erasure can result in many duplicate items; merge them. + # Call make_simplified_union only on lists of instance types + # that all have the same fullname, to avoid simplifying too + # much. + instances = [item for item in new.items if isinstance(get_proper_type(item), Instance)] + # Avoid merge in simple cases such as optional types. + if len(instances) > 1: + instances_by_name: dict[str, list[Instance]] = {} + p_new_items = get_proper_types(new.items) + for p_item in p_new_items: + if isinstance(p_item, Instance) and not p_item.args: + instances_by_name.setdefault(p_item.type.fullname, []).append(p_item) + merged: list[Type] = [] + for item in new.items: + orig_item = item + item = get_proper_type(item) + if isinstance(item, Instance) and not item.args: + types = instances_by_name.get(item.type.fullname) + if types is not None: + if len(types) == 1: + merged.append(item) + else: + from mypy.typeops import make_simplified_union + + merged.append(make_simplified_union(types)) + del instances_by_name[item.type.fullname] + else: + merged.append(orig_item) + return UnionType.make_union(merged) + return new + + +def shallow_erase_type_for_equality(typ: Type) -> ProperType: + """Erase type variables from Instance's""" + p_typ = get_proper_type(typ) + if isinstance(p_typ, Instance): + if not p_typ.args: + return p_typ + args = erased_vars(p_typ.type.defn.type_vars, TypeOfAny.special_form) + return Instance(p_typ.type, args, p_typ.line) + if isinstance(p_typ, UnionType): + items = [shallow_erase_type_for_equality(item) for item in p_typ.items] + return UnionType.make_union(items) + return p_typ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/error_formatter.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/error_formatter.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..060abe6d562bd70612c46cc225dd53bb86ba3e7d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/error_formatter.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/error_formatter.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/error_formatter.py new file mode 100644 index 0000000000000000000000000000000000000000..ebb962e4641fed59468eaa09e147111c63e03837 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/error_formatter.py @@ -0,0 +1,39 @@ +"""Defines the different custom formats in which mypy can output.""" + +import json +from abc import ABC, abstractmethod +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from mypy.errors import MypyError + + +class ErrorFormatter(ABC): + """Base class to define how errors are formatted before being printed.""" + + @abstractmethod + def report_error(self, error: "MypyError") -> str: + raise NotImplementedError + + +class JSONFormatter(ErrorFormatter): + """Formatter for basic JSON output format.""" + + def report_error(self, error: "MypyError") -> str: + """Prints out the errors as simple, static JSON lines.""" + return json.dumps( + { + "file": error.file_path, + "line": error.line, + "column": error.column, + "end_line": error.end_line, + "end_column": error.end_column, + "message": error.message, + "hint": None if len(error.hints) == 0 else "\n".join(error.hints), + "code": error.errorcode, + "severity": error.severity, + } + ) + + +OUTPUT_CHOICES = {"json": JSONFormatter()} diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/errorcodes.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/errorcodes.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..86a6d19a17f22ea4b3a87d37374daa5cbbc8ec84 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/errorcodes.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/errorcodes.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/errorcodes.py new file mode 100644 index 0000000000000000000000000000000000000000..5c28e8332a76cdc75f2c84964ce7d2e95171696c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/errorcodes.py @@ -0,0 +1,333 @@ +"""Classification of possible errors mypy can detect. + +These can be used for filtering specific errors. +""" + +from __future__ import annotations + +from collections import defaultdict +from typing import Final + +from mypy_extensions import mypyc_attr + +error_codes: dict[str, ErrorCode] = {} +sub_code_map: dict[str, set[str]] = defaultdict(set) + + +@mypyc_attr(allow_interpreted_subclasses=True) +class ErrorCode: + def __init__( + self, + code: str, + description: str, + category: str, + default_enabled: bool = True, + sub_code_of: ErrorCode | None = None, + ) -> None: + self.code = code + self.description = description + self.category = category + self.default_enabled = default_enabled + self.sub_code_of = sub_code_of + if sub_code_of is not None: + assert sub_code_of.sub_code_of is None, "Nested subcategories are not supported" + sub_code_map[sub_code_of.code].add(code) + error_codes[code] = self + + def __str__(self) -> str: + return f"" + + def __repr__(self) -> str: + """This doesn't fulfill the goals of repr but it's better than the default view.""" + return f"" + + def __eq__(self, other: object) -> bool: + if not isinstance(other, ErrorCode): + return False + return self.code == other.code + + def __hash__(self) -> int: + return hash((self.code,)) + + +ATTR_DEFINED: Final = ErrorCode("attr-defined", "Check that attribute exists", "General") +NAME_DEFINED: Final = ErrorCode("name-defined", "Check that name is defined", "General") +CALL_ARG: Final = ErrorCode( + "call-arg", "Check number, names and kinds of arguments in calls", "General" +) +ARG_TYPE: Final = ErrorCode("arg-type", "Check argument types in calls", "General") +CALL_OVERLOAD: Final = ErrorCode( + "call-overload", "Check that an overload variant matches arguments", "General" +) +VALID_TYPE: Final = ErrorCode("valid-type", "Check that type (annotation) is valid", "General") +NONETYPE_TYPE: Final = ErrorCode( + "nonetype-type", "Check that type (annotation) is not NoneType", "General" +) +VAR_ANNOTATED: Final = ErrorCode( + "var-annotated", "Require variable annotation if type can't be inferred", "General" +) +OVERRIDE: Final = ErrorCode( + "override", "Check that method override is compatible with base class", "General" +) +RETURN: Final = ErrorCode("return", "Check that function always returns a value", "General") +RETURN_VALUE: Final = ErrorCode( + "return-value", "Check that return value is compatible with signature", "General" +) +ASSIGNMENT: Final = ErrorCode( + "assignment", "Check that assigned value is compatible with target", "General" +) +METHOD_ASSIGN: Final = ErrorCode( + "method-assign", + "Check that assignment target is not a method", + "General", + sub_code_of=ASSIGNMENT, +) +TYPE_ARG: Final = ErrorCode("type-arg", "Check that generic type arguments are present", "General") +TYPE_VAR: Final = ErrorCode("type-var", "Check that type variable values are valid", "General") +UNION_ATTR: Final = ErrorCode( + "union-attr", "Check that attribute exists in each item of a union", "General" +) +INDEX: Final = ErrorCode("index", "Check indexing operations", "General") +OPERATOR: Final = ErrorCode("operator", "Check that operator is valid for operands", "General") +LIST_ITEM: Final = ErrorCode( + "list-item", "Check list items in a list expression [item, ...]", "General" +) +DICT_ITEM: Final = ErrorCode( + "dict-item", "Check dict items in a dict expression {key: value, ...}", "General" +) +TYPEDDICT_ITEM: Final = ErrorCode( + "typeddict-item", "Check items when constructing TypedDict", "General" +) +TYPEDDICT_UNKNOWN_KEY: Final = ErrorCode( + "typeddict-unknown-key", + "Check unknown keys when constructing TypedDict", + "General", + sub_code_of=TYPEDDICT_ITEM, +) +HAS_TYPE: Final = ErrorCode( + "has-type", "Check that type of reference can be determined", "General" +) +IMPORT: Final = ErrorCode( + "import", "Require that imported module can be found or has stubs", "General" +) +IMPORT_NOT_FOUND: Final = ErrorCode( + "import-not-found", "Require that imported module can be found", "General", sub_code_of=IMPORT +) +IMPORT_UNTYPED: Final = ErrorCode( + "import-untyped", "Require that imported module has stubs", "General", sub_code_of=IMPORT +) +NO_REDEF: Final = ErrorCode("no-redef", "Check that each name is defined once", "General") +FUNC_RETURNS_VALUE: Final = ErrorCode( + "func-returns-value", "Check that called function returns a value in value context", "General" +) +ABSTRACT: Final = ErrorCode( + "abstract", "Prevent instantiation of classes with abstract attributes", "General" +) +TYPE_ABSTRACT: Final = ErrorCode( + "type-abstract", "Require only concrete classes where Type[...] is expected", "General" +) +VALID_NEWTYPE: Final = ErrorCode( + "valid-newtype", "Check that argument 2 to NewType is valid", "General" +) +STRING_FORMATTING: Final = ErrorCode( + "str-format", "Check that string formatting/interpolation is type-safe", "General" +) +STR_BYTES_PY3: Final = ErrorCode( + "str-bytes-safe", "Warn about implicit coercions related to bytes and string types", "General" +) +EXIT_RETURN: Final = ErrorCode( + "exit-return", "Warn about too general return type for '__exit__'", "General" +) +LITERAL_REQ: Final = ErrorCode("literal-required", "Check that value is a literal", "General") +UNUSED_COROUTINE: Final = ErrorCode( + "unused-coroutine", "Ensure that all coroutines are used", "General" +) +EMPTY_BODY: Final = ErrorCode( + "empty-body", + "A dedicated error code to opt out return errors for empty/trivial bodies", + "General", +) +SAFE_SUPER: Final = ErrorCode( + "safe-super", "Warn about calls to abstract methods with empty/trivial bodies", "General" +) +TOP_LEVEL_AWAIT: Final = ErrorCode( + "top-level-await", "Warn about top level await expressions", "General" +) +AWAIT_NOT_ASYNC: Final = ErrorCode( + "await-not-async", 'Warn about "await" outside coroutine ("async def")', "General" +) +# These error codes aren't enabled by default. +NO_UNTYPED_DEF: Final = ErrorCode( + "no-untyped-def", "Check that every function has an annotation", "General" +) +NO_UNTYPED_CALL: Final = ErrorCode( + "no-untyped-call", + "Disallow calling functions without type annotations from annotated functions", + "General", +) +REDUNDANT_CAST: Final = ErrorCode( + "redundant-cast", "Check that cast changes type of expression", "General" +) +ASSERT_TYPE: Final = ErrorCode("assert-type", "Check that assert_type() call succeeds", "General") +COMPARISON_OVERLAP: Final = ErrorCode( + "comparison-overlap", "Check that types in comparisons and 'in' expressions overlap", "General" +) +NO_ANY_UNIMPORTED: Final = ErrorCode( + "no-any-unimported", 'Reject "Any" types from unfollowed imports', "General" +) +NO_ANY_RETURN: Final = ErrorCode( + "no-any-return", + 'Reject returning value with "Any" type if return type is not "Any"', + "General", +) +UNREACHABLE: Final = ErrorCode( + "unreachable", "Warn about unreachable statements or expressions", "General" +) +ANNOTATION_UNCHECKED: Final = ErrorCode( + "annotation-unchecked", "Notify about type annotations in unchecked functions", "General" +) +TYPEDDICT_READONLY_MUTATED: Final = ErrorCode( + "typeddict-readonly-mutated", "TypedDict's ReadOnly key is mutated", "General" +) +POSSIBLY_UNDEFINED: Final = ErrorCode( + "possibly-undefined", + "Warn about variables that are defined only in some execution paths", + "General", + default_enabled=False, +) +REDUNDANT_EXPR: Final = ErrorCode( + "redundant-expr", "Warn about redundant expressions", "General", default_enabled=False +) +TRUTHY_BOOL: Final = ErrorCode( + "truthy-bool", + "Warn about expressions that could always evaluate to true in boolean contexts", + "General", + default_enabled=False, +) +TRUTHY_FUNCTION: Final = ErrorCode( + "truthy-function", + "Warn about function that always evaluate to true in boolean contexts", + "General", +) +TRUTHY_ITERABLE: Final = ErrorCode( + "truthy-iterable", + "Warn about Iterable expressions that could always evaluate to true in boolean contexts", + "General", + default_enabled=False, +) +STR_UNPACK: Final[ErrorCode] = ErrorCode( + "str-unpack", "Warn about expressions that unpack str", "General" +) +NAME_MATCH: Final = ErrorCode( + "name-match", "Check that type definition has consistent naming", "General" +) +NO_OVERLOAD_IMPL: Final = ErrorCode( + "no-overload-impl", + "Check that overloaded functions outside stub files have an implementation", + "General", +) +IGNORE_WITHOUT_CODE: Final = ErrorCode( + "ignore-without-code", + "Warn about '# type: ignore' comments which do not have error codes", + "General", + default_enabled=False, +) +UNUSED_AWAITABLE: Final = ErrorCode( + "unused-awaitable", + "Ensure that all awaitable values are used", + "General", + default_enabled=False, +) +REDUNDANT_SELF_TYPE: Final = ErrorCode( + "redundant-self", + "Warn about redundant Self type annotations on method first argument", + "General", + default_enabled=False, +) +USED_BEFORE_DEF: Final = ErrorCode( + "used-before-def", "Warn about variables that are used before they are defined", "General" +) +UNUSED_IGNORE: Final = ErrorCode( + "unused-ignore", "Ensure that all type ignores are used", "General", default_enabled=False +) +EXPLICIT_OVERRIDE_REQUIRED: Final = ErrorCode( + "explicit-override", + "Require @override decorator if method is overriding a base class method", + "General", + default_enabled=False, +) +UNIMPORTED_REVEAL: Final = ErrorCode( + "unimported-reveal", + "Require explicit import from typing or typing_extensions for reveal_type", + "General", + default_enabled=False, +) +MUTABLE_OVERRIDE: Final = ErrorCode( + "mutable-override", + "Reject covariant overrides for mutable attributes", + "General", + default_enabled=False, +) +EXHAUSTIVE_MATCH: Final = ErrorCode( + "exhaustive-match", + "Reject match statements that are not exhaustive", + "General", + default_enabled=False, +) +METACLASS: Final = ErrorCode("metaclass", "Ensure that metaclass is valid", "General") +MAYBE_UNRECOGNIZED_STR_TYPEFORM: Final = ErrorCode( + "maybe-unrecognized-str-typeform", + "Error when a string is used where a TypeForm is expected but a string annotation cannot be recognized", + "General", +) + +# Syntax errors are often blocking. +SYNTAX: Final = ErrorCode("syntax", "Report syntax errors", "General") + +# This is a catch-all for remaining uncategorized errors. +MISC: Final = ErrorCode("misc", "Miscellaneous other checks", "General") + +OVERLOAD_CANNOT_MATCH: Final = ErrorCode( + "overload-cannot-match", + "Warn if an @overload signature can never be matched", + "General", + sub_code_of=MISC, +) + +OVERLOAD_OVERLAP: Final = ErrorCode( + "overload-overlap", + "Warn if multiple @overload variants overlap in unsafe ways", + "General", + sub_code_of=MISC, +) + +PROPERTY_DECORATOR: Final = ErrorCode( + "prop-decorator", + "Decorators on top of @property are not supported", + "General", + sub_code_of=MISC, +) + +UNTYPED_DECORATOR: Final = ErrorCode( + "untyped-decorator", "Error if an untyped decorator makes a typed function untyped", "General" +) + +NARROWED_TYPE_NOT_SUBTYPE: Final = ErrorCode( + "narrowed-type-not-subtype", + "Warn if a TypeIs function's narrowed type is not a subtype of the original type", + "General", +) + +EXPLICIT_ANY: Final = ErrorCode( + "explicit-any", "Warn about explicit Any type annotations", "General" +) + +DEPRECATED: Final = ErrorCode( + "deprecated", + "Warn when importing or using deprecated (overloaded) functions, methods or classes", + "General", + default_enabled=False, +) + +# This copy will not include any error codes defined later in the plugins. +mypy_error_codes = error_codes.copy() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/errors.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/errors.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..47378e27589294f0e217e9fc5d3f4372d67adc95 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/errors.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/errors.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/errors.py new file mode 100644 index 0000000000000000000000000000000000000000..5ffada781b9ab156165eb14268654cb58163d1ea --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/errors.py @@ -0,0 +1,1471 @@ +from __future__ import annotations + +import os.path +import sys +import traceback +from collections import defaultdict +from collections.abc import Callable, Iterable, Iterator +from itertools import chain +from typing import Final, Literal, NoReturn, TextIO, TypeVar +from typing_extensions import Self + +from librt.internal import ( + ReadBuffer, + WriteBuffer, + read_bool, + read_int as read_int_bare, + write_bool, + write_int as write_int_bare, +) + +from mypy import errorcodes as codes +from mypy.cache import ( + ErrorTuple, + read_int, + read_int_list, + read_str, + read_str_opt, + write_int, + write_int_list, + write_str, + write_str_opt, +) +from mypy.error_formatter import ErrorFormatter +from mypy.errorcodes import IMPORT, IMPORT_NOT_FOUND, IMPORT_UNTYPED, ErrorCode, mypy_error_codes +from mypy.nodes import Context +from mypy.options import Options +from mypy.scope import Scope +from mypy.types import Type +from mypy.util import DEFAULT_SOURCE_OFFSET +from mypy.version import __version__ as mypy_version + +T = TypeVar("T") + +# Show error codes for some note-level messages (these usually appear alone +# and not as a comment for a previous error-level message). +SHOW_NOTE_CODES: Final = {codes.ANNOTATION_UNCHECKED.code, codes.DEPRECATED.code} + +# Do not add notes with links to error code docs to errors with these codes. +# We can tweak this set as we get more experience about what is helpful and what is not. +HIDE_LINK_CODES: Final = { + # This is a generic error code, so it has no useful docs + codes.MISC, + # These are trivial and have some custom notes (e.g. for list being invariant) + codes.ASSIGNMENT, + codes.ARG_TYPE, + codes.RETURN_VALUE, + # Undefined name/attribute errors are self-explanatory + codes.ATTR_DEFINED, + codes.NAME_DEFINED, + # Overrides have a custom link to docs + codes.OVERRIDE, +} + +BASE_RTD_URL: Final = "https://mypy.rtfd.io/en/stable/_refs.html#code" + +# Keep track of the original error code when the error code of a message is changed. +# This is used to give notes about out-of-date "type: ignore" comments. +original_error_codes: Final = {codes.LITERAL_REQ: codes.MISC, codes.TYPE_ABSTRACT: codes.MISC} + + +class ErrorInfo: + """Representation of a single error message.""" + + # Description of a sequence of imports that refer to the source file + # related to this error. Each item is a (path, line number) tuple. + import_ctx: list[tuple[str, int]] + # Type and function/method where this error occurred. Unqualified, may be None. + local_ctx: tuple[str | None, str | None] + + # The line number related to this error within file. + line = 0 # -1 if unknown + # The column number related to this error with file. + column = 0 # -1 if unknown + # The end line number related to this error within file. + end_line = 0 # -1 if unknown + # The end column number related to this error with file. + end_column = 0 # -1 if unknown + # Either 'error' or 'note' + severity = "" + # The error message. + message = "" + # The error code. + code: ErrorCode | None = None + + # If True, we should halt build after the file that generated this error. + blocker = False + # Only report this particular messages once per program. + only_once = False + + # These two are used by the daemon: + # The fully-qualified id of the source module for this error. + module: str | None + # Fine-grained incremental target where this was reported + target: str | None + + # Lines where `type: ignores` will have effect on this error, for most errors + # this is just [line]. But sometimes may be custom, e.g. for override errors + # in methods with multi-line definition. + origin_span: Iterable[int] + # For errors on the same line you can use this to customize their sorting + # (lower value means show first). + priority: int + # If True, don't show this message in output, but still record the error. + hidden = False + + # For notes, specifies (optionally) the error this note is attached to. This is used to + # simplify error code matching and de-duplication logic for complex multi-line notes. + parent_error: ErrorInfo | None = None + + def __init__( + self, + *, + import_ctx: list[tuple[str, int]], + local_ctx: tuple[str | None, str | None], + line: int, + column: int, + end_line: int, + end_column: int, + severity: str, + message: str, + code: ErrorCode | None, + blocker: bool, + only_once: bool, + module: str | None, + target: str | None, + origin_span: Iterable[int] | None = None, + priority: int = 0, + parent_error: ErrorInfo | None = None, + ) -> None: + self.import_ctx = import_ctx + self.module = module + self.local_ctx = local_ctx + self.line = line + self.column = column + self.end_line = end_line + self.end_column = end_column + self.severity = severity + self.message = message + self.code = code + self.blocker = blocker + self.only_once = only_once + self.origin_span = origin_span or [line] + self.target = target + self.priority = priority + if parent_error is not None: + assert severity == "note", "Only notes can specify parent errors" + self.parent_error = parent_error + + def write(self, buf: WriteBuffer) -> None: + assert self.parent_error is None, "Parent errors not supported yet" + write_int_bare(buf, len(self.import_ctx)) + for file, line in self.import_ctx: + write_str(buf, file) + write_int(buf, line) + type, function = self.local_ctx + write_str_opt(buf, type) + write_str_opt(buf, function) + write_int(buf, self.line) + write_int(buf, self.column) + write_int(buf, self.end_line) + write_int(buf, self.end_column) + write_str(buf, self.severity) + write_str(buf, self.message) + write_str_opt(buf, self.code.code if self.code else None) + write_bool(buf, self.blocker) + write_bool(buf, self.only_once) + write_str_opt(buf, self.module) + write_str_opt(buf, self.target) + write_int_list(buf, list(self.origin_span)) + write_int(buf, self.priority) + + @classmethod + def read(cls, buf: ReadBuffer) -> ErrorInfo: + return ErrorInfo( + import_ctx=[(read_str(buf), read_int(buf)) for _ in range(read_int_bare(buf))], + local_ctx=(read_str_opt(buf), read_str_opt(buf)), + line=read_int(buf), + column=read_int(buf), + end_line=read_int(buf), + end_column=read_int(buf), + severity=read_str(buf), + message=read_str(buf), + code=mypy_error_codes[code] if (code := read_str_opt(buf)) else None, + blocker=read_bool(buf), + only_once=read_bool(buf), + module=read_str_opt(buf), + target=read_str_opt(buf), + origin_span=read_int_list(buf), + priority=read_int(buf), + ) + + +class ErrorWatcher: + """Context manager that can be used to keep track of new errors recorded + around a given operation. + + Errors maintain a stack of such watchers. The handler is called starting + at the top of the stack, and is propagated down the stack unless filtered + out by one of the ErrorWatcher instances. + """ + + # public attribute for the special treatment of `reveal_type` by + # `MessageBuilder.reveal_type`: + filter_revealed_type: bool + + def __init__( + self, + errors: Errors, + *, + filter_errors: bool | Callable[[str, ErrorInfo], bool] = False, + save_filtered_errors: bool = False, + filter_deprecated: bool = False, + filter_revealed_type: bool = False, + ) -> None: + self.errors = errors + self._has_new_errors = False + self._filter = filter_errors + self._filter_deprecated = filter_deprecated + self.filter_revealed_type = filter_revealed_type + self._filtered: list[ErrorInfo] | None = [] if save_filtered_errors else None + + def __enter__(self) -> Self: + self.errors._watchers.append(self) + return self + + def __exit__(self, exc_type: object, exc_val: object, exc_tb: object) -> Literal[False]: + last = self.errors._watchers.pop() + assert last == self + return False + + def on_error(self, file: str, info: ErrorInfo) -> bool: + """Handler called when a new error is recorded. + + The default implementation just sets the has_new_errors flag + + Return True to filter out the error, preventing it from being seen by other + ErrorWatcher further down the stack and from being recorded by Errors + """ + if info.code == codes.DEPRECATED: + # Deprecated is not a type error, so it is handled on opt-in basis here. + if not self._filter_deprecated: + return False + + self._has_new_errors = True + if isinstance(self._filter, bool): + should_filter = self._filter + elif callable(self._filter): + should_filter = self._filter(file, info) + else: + raise AssertionError(f"invalid error filter: {type(self._filter)}") + if should_filter and self._filtered is not None: + self._filtered.append(info) + + return should_filter + + def has_new_errors(self) -> bool: + return self._has_new_errors + + def filtered_errors(self) -> list[ErrorInfo]: + assert self._filtered is not None + return self._filtered + + +class NonOverlapErrorInfo: + line: int + column: int + end_line: int | None + end_column: int | None + kind: str + + def __init__( + self, *, line: int, column: int, end_line: int | None, end_column: int | None, kind: str + ) -> None: + self.line = line + self.column = column + self.end_line = end_line + self.end_column = end_column + self.kind = kind + + def __eq__(self, other: object) -> bool: + if isinstance(other, NonOverlapErrorInfo): + return ( + self.line == other.line + and self.column == other.column + and self.end_line == other.end_line + and self.end_column == other.end_column + and self.kind == other.kind + ) + return False + + def __hash__(self) -> int: + return hash((self.line, self.column, self.end_line, self.end_column, self.kind)) + + +class IterationDependentErrors: + """An `IterationDependentErrors` instance serves to collect the `unreachable`, + `redundant-expr`, and `redundant-casts` errors, as well as the revealed types and + non-overlapping types, handled by the individual `IterationErrorWatcher` instances + sequentially applied to the same code section.""" + + # One set of `unreachable`, `redundant-expr`, and `redundant-casts` errors per + # iteration step. Meaning of the tuple items: ErrorCode, message, line, column, + # end_line, end_column. + uselessness_errors: list[set[tuple[ErrorCode, str, int, int, int, int]]] + + # One set of unreachable line numbers per iteration step. Not only the lines where + # the error report occurs but really all unreachable lines. + unreachable_lines: list[set[int]] + + # One list of revealed types for each `reveal_type` statement. Each created list + # can grow during the iteration. Meaning of the tuple items: line, column, + # end_line, end_column: + revealed_types: dict[tuple[int, int, int | None, int | None], list[Type]] + + # One dictionary of non-overlapping types per iteration step: + nonoverlapping_types: list[dict[NonOverlapErrorInfo, tuple[Type, Type]]] + + def __init__(self) -> None: + self.uselessness_errors = [] + self.unreachable_lines = [] + self.nonoverlapping_types = [] + self.revealed_types = defaultdict(list) + + def yield_uselessness_error_infos(self) -> Iterator[tuple[str, Context, ErrorCode]]: + """Report only those `unreachable`, `redundant-expr`, and `redundant-casts` + errors that could not be ruled out in any iteration step.""" + + persistent_uselessness_errors = set() + for candidate in set(chain(*self.uselessness_errors)): + if all( + (candidate in errors) or (candidate[2] in lines) + for errors, lines in zip(self.uselessness_errors, self.unreachable_lines) + ): + persistent_uselessness_errors.add(candidate) + for error_info in persistent_uselessness_errors: + context = Context(line=error_info[2], column=error_info[3]) + context.end_line = error_info[4] + context.end_column = error_info[5] + yield error_info[1], context, error_info[0] + + def yield_nonoverlapping_types( + self, + ) -> Iterator[tuple[tuple[list[Type], list[Type]], str, Context]]: + """Report expressions where non-overlapping types were detected for all iterations + were the expression was reachable.""" + + selected = set() + for candidate in set(chain.from_iterable(self.nonoverlapping_types)): + if all( + (candidate in nonoverlap) or (candidate.line in lines) + for nonoverlap, lines in zip(self.nonoverlapping_types, self.unreachable_lines) + ): + selected.add(candidate) + + persistent_nonoverlaps: dict[NonOverlapErrorInfo, tuple[list[Type], list[Type]]] = ( + defaultdict(lambda: ([], [])) + ) + for nonoverlaps in self.nonoverlapping_types: + for candidate, (left, right) in nonoverlaps.items(): + if candidate in selected: + types = persistent_nonoverlaps[candidate] + types[0].append(left) + types[1].append(right) + + for error_info, types in persistent_nonoverlaps.items(): + context = Context(line=error_info.line, column=error_info.column) + context.end_line = error_info.end_line + context.end_column = error_info.end_column + yield (types[0], types[1]), error_info.kind, context + + def yield_revealed_type_infos(self) -> Iterator[tuple[list[Type], Context]]: + """Yield all types revealed in at least one iteration step.""" + + for note_info, types in self.revealed_types.items(): + context = Context(line=note_info[0], column=note_info[1]) + context.end_line = note_info[2] + context.end_column = note_info[3] + yield types, context + + +class IterationErrorWatcher(ErrorWatcher): + """Error watcher that filters and separately collects `unreachable` errors, + `redundant-expr` and `redundant-casts` errors, and revealed types and + non-overlapping types when analysing code sections iteratively to help avoid + making too-hasty reports.""" + + iteration_dependent_errors: IterationDependentErrors + + def __init__( + self, + errors: Errors, + iteration_dependent_errors: IterationDependentErrors, + *, + filter_errors: bool | Callable[[str, ErrorInfo], bool] = False, + save_filtered_errors: bool = False, + filter_deprecated: bool = False, + ) -> None: + super().__init__( + errors, + filter_errors=filter_errors, + save_filtered_errors=save_filtered_errors, + filter_deprecated=filter_deprecated, + ) + self.iteration_dependent_errors = iteration_dependent_errors + iteration_dependent_errors.uselessness_errors.append(set()) + iteration_dependent_errors.nonoverlapping_types.append({}) + iteration_dependent_errors.unreachable_lines.append(set()) + + def on_error(self, file: str, info: ErrorInfo) -> bool: + """Filter out the "iteration-dependent" errors and notes and store their + information to handle them after iteration is completed.""" + + iter_errors = self.iteration_dependent_errors + + if info.code in (codes.UNREACHABLE, codes.REDUNDANT_EXPR, codes.REDUNDANT_CAST): + iter_errors.uselessness_errors[-1].add( + (info.code, info.message, info.line, info.column, info.end_line, info.end_column) + ) + if info.code == codes.UNREACHABLE: + iter_errors.unreachable_lines[-1].update(range(info.line, info.end_line + 1)) + return True + + return super().on_error(file, info) + + +class Errors: + """Container for compile errors. + + This class generates and keeps tracks of compile errors and the + current error context (nested imports). + """ + + # Map from files to generated error messages. Is an OrderedDict so + # that it can be used to order messages based on the order the + # files were processed. + error_info_map: dict[str, list[ErrorInfo]] + + # optimization for legacy codebases with many files with errors + has_blockers: set[str] + + # Files that we have reported the errors for + flushed_files: set[str] + + # Current error context: nested import context/stack, as a list of (path, line) pairs. + import_ctx: list[tuple[str, int]] + + # Path name prefix that is removed from all paths, if set. + ignore_prefix: str | None = None + + # Path to current file. + file: str = "" + + # Ignore some errors on these lines of each file + # (path -> line -> error-codes) + ignored_lines: dict[str, dict[int, list[str]]] + + # Lines that were skipped during semantic analysis e.g. due to ALWAYS_FALSE, MYPY_FALSE, + # or platform/version checks. Those lines would not be type-checked. + skipped_lines: dict[str, set[int]] + + # Lines on which an error was actually ignored. + used_ignored_lines: dict[str, dict[int, list[str]]] + + # Files where all errors should be ignored. + ignored_files: set[str] + + # Collection of reported only_once messages. + only_once_messages: set[str] + + # State for keeping track of the current fine-grained incremental mode target. + # (See mypy.server.update for more about targets.) + # Current module id. + target_module: str | None = None + scope: Scope | None = None + + # Have we seen an import-related error so far? If yes, we filter out other messages + # in some cases to avoid reporting huge numbers of errors. + seen_import_error = False + + # Set this flag to record all raw report() calls. Recorded error (per file) can + # be replayed using by calling set_file() and add_error_info(). + global_watcher = False + recorded: dict[str, list[ErrorInfo]] + + _watchers: list[ErrorWatcher] + + def __init__( + self, + options: Options, + *, + read_source: Callable[[str], list[str] | None] | None = None, + hide_error_codes: bool | None = None, + ) -> None: + self.options = options + self.hide_error_codes = ( + hide_error_codes if hide_error_codes is not None else options.hide_error_codes + ) + # We use fscache to read source code when showing snippets. + self.read_source = read_source + self.initialize() + + def initialize(self) -> None: + self.error_info_map = {} + self.flushed_files = set() + self.import_ctx = [] + self.function_or_member = [None] + self.ignored_lines = {} + self.skipped_lines = {} + self.used_ignored_lines = defaultdict(lambda: defaultdict(list)) + self.ignored_files = set() + self.only_once_messages = set() + self.has_blockers = set() + self.scope = None + self.target_module = None + self.seen_import_error = False + self._watchers = [] + self.global_watcher = False + self.recorded = defaultdict(list) + + def reset(self) -> None: + self.initialize() + + def set_ignore_prefix(self, prefix: str) -> None: + """Set path prefix that will be removed from all paths.""" + prefix = os.path.normpath(prefix) + # Add separator to the end, if not given. + if os.path.basename(prefix) != "": + prefix += os.sep + self.ignore_prefix = prefix + + def simplify_path(self, file: str) -> str: + if self.options.show_absolute_path: + return os.path.abspath(file) + else: + file = os.path.normpath(file) + return remove_path_prefix(file, self.ignore_prefix) + + def set_file( + self, file: str, module: str | None, options: Options, scope: Scope | None = None + ) -> None: + """Set the path and module id of the current file.""" + # The path will be simplified later, in render_messages. That way + # * 'file' is always a key that uniquely identifies a source file + # that mypy read (simplified paths might not be unique); and + # * we only have to simplify in one place, while still supporting + # reporting errors for files other than the one currently being + # processed. + self.file = file + self.target_module = module + self.scope = scope + self.options = options + + def set_file_ignored_lines( + self, file: str, ignored_lines: dict[int, list[str]], ignore_all: bool = False + ) -> None: + self.ignored_lines[file] = ignored_lines + if ignore_all: + self.ignored_files.add(file) + + def set_skipped_lines(self, file: str, skipped_lines: set[int]) -> None: + self.skipped_lines[file] = skipped_lines + + def current_target(self) -> str | None: + """Retrieves the current target from the associated scope. + + If there is no associated scope, use the target module.""" + if self.scope is not None: + return self.scope.current_target() + return self.target_module + + def current_module(self) -> str | None: + return self.target_module + + def import_context(self) -> list[tuple[str, int]]: + """Return a copy of the import context.""" + return self.import_ctx.copy() + + def set_import_context(self, ctx: list[tuple[str, int]]) -> None: + """Replace the entire import context with a new value.""" + self.import_ctx = ctx.copy() + + def report( + self, + line: int, + column: int | None, + message: str, + code: ErrorCode | None = None, + *, + blocker: bool = False, + severity: str = "error", + only_once: bool = False, + origin_span: Iterable[int] | None = None, + offset: int = 0, + end_line: int | None = None, + end_column: int | None = None, + parent_error: ErrorInfo | None = None, + ) -> ErrorInfo: + """Report message at the given line using the current error context. + + Args: + line: line number of error + column: column number of error + message: message to report + code: error code (defaults to 'misc'; not shown for notes) + blocker: if True, don't continue analysis after this error + severity: 'error' or 'note' + only_once: if True, only report this exact message once per build + origin_span: lines where `type: ignore`s have effect for this error + (default is [line]) + offset: number of spaces to prefix this message + end_line: if known, end line of error location + end_column: if known, end column of error location + parent_error: an error this note is attached to (for notes only). + """ + if self.scope: + type = self.scope.current_type_name() + if self.scope.ignored > 0: + type = None # Omit type context if nested function + function = self.scope.current_function_name() + else: + type = None + function = None + + # It looks like there is a bug in how we parse f-strings, + # we cannot simply assert this yet. + if end_line is None or end_line < line: + end_line = line + + if column is None: + column = -1 + if end_column is None: + if column == -1: + end_column = -1 + else: + end_column = column + 1 + if line == end_line and end_column <= column: + # Be defensive, similar to the logic for lines above. + end_column = column + 1 + + if offset: + message = " " * offset + message + + code = code or (parent_error.code if parent_error else None) + if parent_error is not None: + assert code == parent_error.code, "Must have same error code as parent" + assert severity == "note", "Only notes can have parent errors" + code = code or (codes.MISC if not blocker else None) + + info = ErrorInfo( + import_ctx=self.import_context(), + local_ctx=(type, function), + line=line, + column=column, + end_line=end_line, + end_column=end_column, + severity=severity, + message=message, + code=code, + blocker=blocker, + only_once=only_once, + origin_span=origin_span, + module=self.current_module(), + target=self.current_target(), + parent_error=parent_error, + ) + if self.global_watcher: + self.recorded[self.file].append(info) + self.add_error_info(info) + return info + + def _add_error_info(self, file: str, info: ErrorInfo) -> None: + assert file not in self.flushed_files + # process the stack of ErrorWatchers before modifying any internal state + # in case we need to filter out the error entirely + if self._filter_error(file, info): + return + if file not in self.error_info_map: + self.error_info_map[file] = [] + self.error_info_map[file].append(info) + if info.blocker: + self.has_blockers.add(file) + if info.code in (IMPORT, IMPORT_UNTYPED, IMPORT_NOT_FOUND): + self.seen_import_error = True + + def note_for_info( + self, + file: str, + info: ErrorInfo, + message: str, + code: ErrorCode | None, + *, + only_once: bool = False, + priority: int = 0, + ) -> None: + """Generate an additional note for an existing ErrorInfo. + + This skip the logic in add_error_info() and goes to _add_error_info(). + """ + info = ErrorInfo( + import_ctx=info.import_ctx, + local_ctx=info.local_ctx, + line=info.line, + column=info.column, + end_line=info.end_line, + end_column=info.end_column, + severity="note", + message=message, + code=code, + blocker=False, + only_once=only_once, + module=info.module, + target=info.target, + origin_span=info.origin_span, + priority=priority, + ) + self._add_error_info(file, info) + + def report_simple_error( + self, file: str, line: int, message: str, code: ErrorCode | None + ) -> None: + """Generate a simple error in a module. + + This skip the logic in add_error_info() and goes to _add_error_info(). + """ + info = ErrorInfo( + import_ctx=self.import_context(), + local_ctx=(None, None), + line=line, + column=-1, + end_line=line, + end_column=-1, + severity="error", + message=message, + code=code, + blocker=False, + only_once=False, + module=self.current_module(), + # TODO: can we support more precise targets? + target=self.target_module, + ) + self._add_error_info(file, info) + + def get_watchers(self) -> Iterator[ErrorWatcher]: + """Yield the `ErrorWatcher` stack from top to bottom.""" + i = len(self._watchers) + while i > 0: + i -= 1 + yield self._watchers[i] + + def _filter_error(self, file: str, info: ErrorInfo) -> bool: + """ + process ErrorWatcher stack from top to bottom, + stopping early if error needs to be filtered out + """ + return any(w.on_error(file, info) for w in self.get_watchers()) + + def add_error_info(self, info: ErrorInfo, *, file: str | None = None) -> None: + lines = info.origin_span + file = file or self.file + # process the stack of ErrorWatchers before modifying any internal state + # in case we need to filter out the error entirely + # NB: we need to do this both here and in _add_error_info, otherwise we + # might incorrectly update the sets of ignored or only_once messages + if self._filter_error(file, info): + return + if not info.blocker: # Blockers cannot be ignored + if file in self.ignored_lines: + # Check each line in this context for "type: ignore" comments. + # line == end_line for most nodes, so we only loop once. + for scope_line in lines: + if self.is_ignored_error(scope_line, info, self.ignored_lines[file]): + err_code = info.code or codes.MISC + if not self.is_error_code_enabled(err_code): + # Error code is disabled - don't mark the current + # "type: ignore" comment as used. + return + # Annotation requests us to ignore all errors on this line. + self.used_ignored_lines[file][scope_line].append(err_code.code) + return + if file in self.ignored_files: + return + if info.only_once: + if info.message in self.only_once_messages: + return + self.only_once_messages.add(info.message) + if ( + self.seen_import_error + and info.code not in (IMPORT, IMPORT_UNTYPED, IMPORT_NOT_FOUND) + and self.has_many_errors() + ): + # Missing stubs can easily cause thousands of errors about + # Any types, especially when upgrading to mypy 0.900, + # which no longer bundles third-party library stubs. Avoid + # showing too many errors to make it easier to see + # import-related errors. + info.hidden = True + self.report_hidden_errors(file, info) + self._add_error_info(file, info) + ignored_codes = self.ignored_lines.get(file, {}).get(info.line, []) + if ignored_codes and info.code: + # Something is ignored on the line, but not this error, so maybe the error + # code is incorrect. + msg = f'Error code "{info.code.code}" not covered by "type: ignore" comment' + if info.code in original_error_codes: + # If there seems to be a "type: ignore" with a stale error + # code, report a more specific note. + old_code = original_error_codes[info.code].code + if old_code in ignored_codes: + msg = ( + f'Error code changed to {info.code.code}; "type: ignore" comment ' + + "may be out of date" + ) + self.note_for_info(file, info, msg, None, only_once=False) + if ( + self.options.show_error_code_links + and not self.options.hide_error_codes + and info.code is not None + and info.code not in HIDE_LINK_CODES + and info.code.code in mypy_error_codes + ): + message = f"See {BASE_RTD_URL}-{info.code.code} for more info" + if message in self.only_once_messages: + return + self.only_once_messages.add(message) + self.note_for_info(file, info, message, info.code, only_once=True, priority=20) + + def has_many_errors(self) -> bool: + if self.options.many_errors_threshold < 0: + return False + if len(self.error_info_map) >= self.options.many_errors_threshold: + return True + if ( + sum(len(errors) for errors in self.error_info_map.values()) + >= self.options.many_errors_threshold + ): + return True + return False + + def report_hidden_errors(self, file: str, info: ErrorInfo) -> None: + message = ( + "(Skipping most remaining errors due to unresolved imports or missing stubs; " + + "fix these first)" + ) + if message in self.only_once_messages: + return + self.only_once_messages.add(message) + self.note_for_info(file, info, message, None, only_once=True) + + def is_ignored_error(self, line: int, info: ErrorInfo, ignores: dict[int, list[str]]) -> bool: + if info.blocker: + # Blocking errors can never be ignored + return False + if info.code and not self.is_error_code_enabled(info.code): + return True + if line not in ignores: + return False + if not ignores[line]: + # Empty list means that we ignore all errors + return True + if info.code and self.is_error_code_enabled(info.code): + return ( + info.code.code in ignores[line] + or info.code.sub_code_of is not None + and info.code.sub_code_of.code in ignores[line] + ) + return False + + def is_error_code_enabled(self, error_code: ErrorCode) -> bool: + if self.options: + current_mod_disabled = self.options.disabled_error_codes + current_mod_enabled = self.options.enabled_error_codes + else: + current_mod_disabled = set() + current_mod_enabled = set() + + if error_code in current_mod_disabled: + return False + elif error_code in current_mod_enabled: + return True + elif error_code.sub_code_of is not None and error_code.sub_code_of in current_mod_disabled: + return False + else: + return error_code.default_enabled + + def clear_errors_in_targets(self, path: str, targets: set[str]) -> None: + """Remove errors in specific fine-grained targets within a file.""" + if path in self.error_info_map: + new_errors = [] + has_blocker = False + for info in self.error_info_map[path]: + if info.target not in targets: + new_errors.append(info) + has_blocker |= info.blocker + elif info.only_once: + self.only_once_messages.remove(info.message) + self.error_info_map[path] = new_errors + if not has_blocker and path in self.has_blockers: + self.has_blockers.remove(path) + + def generate_unused_ignore_errors(self, file: str, is_typeshed: bool = False) -> None: + if is_typeshed or file in self.ignored_files: + return + ignored_lines = self.ignored_lines[file] + used_ignored_lines = self.used_ignored_lines[file] + for line, ignored_codes in ignored_lines.items(): + if line in self.skipped_lines[file]: + continue + if codes.UNUSED_IGNORE.code in ignored_codes: + continue + used_ignored_codes = set(used_ignored_lines[line]) + unused_ignored_codes = [c for c in ignored_codes if c not in used_ignored_codes] + # `ignore` is used + if not ignored_codes and used_ignored_codes: + continue + # All codes appearing in `ignore[...]` are used + if ignored_codes and not unused_ignored_codes: + continue + # Display detail only when `ignore[...]` specifies more than one error code + unused_codes_message = "" + if len(ignored_codes) > 1 and unused_ignored_codes: + unused_codes_message = f"[{', '.join(unused_ignored_codes)}]" + message = f'Unused "type: ignore{unused_codes_message}" comment' + for unused in unused_ignored_codes: + narrower = set(used_ignored_codes) & codes.sub_code_map[unused] + if narrower: + message += f", use narrower [{', '.join(narrower)}] instead of [{unused}] code" + # Don't use report() since add_error_info will ignore the error! + self.report_simple_error(file, line, message, code=codes.UNUSED_IGNORE) + + def generate_ignore_without_code_errors( + self, file: str, is_warning_unused_ignores: bool, is_typeshed: bool = False + ) -> None: + if is_typeshed or file in self.ignored_files: + return + + used_ignored_lines = self.used_ignored_lines[file] + for line, ignored_codes in self.ignored_lines[file].items(): + if line in self.skipped_lines[file]: + continue + if ignored_codes: + continue + + # If the `type: ignore` is itself unused and that would be warned about, + # let that error stand alone + if is_warning_unused_ignores and not used_ignored_lines[line]: + continue + + codes_hint = "" + ignored_codes = sorted(set(used_ignored_lines[line])) + if ignored_codes: + codes_hint = f' (consider "type: ignore[{", ".join(ignored_codes)}]" instead)' + + message = f'"type: ignore" comment without error code{codes_hint}' + # Don't use report() since add_error_info will ignore the error! + self.report_simple_error(file, line, message, code=codes.IGNORE_WITHOUT_CODE) + + def num_messages(self) -> int: + """Return the number of generated messages.""" + return sum(len(x) for x in self.error_info_map.values()) + + def is_errors(self) -> bool: + """Are there any generated messages?""" + return bool(self.error_info_map) + + def is_blockers(self) -> bool: + """Are the any errors that are blockers?""" + return bool(self.has_blockers) + + def blocker_module(self) -> str | None: + """Return the module with a blocking error, or None if not possible.""" + for path in self.has_blockers: + for err in self.error_info_map[path]: + if err.blocker: + return err.module + return None + + def is_errors_for_file(self, file: str) -> bool: + """Are there any errors for the given file?""" + return file in self.error_info_map and file not in self.ignored_files + + def prefer_simple_messages(self) -> bool: + """Should we generate simple/fast error messages? + + Return True if errors are not shown to user, i.e. errors are ignored + or they are collected for internal use only. + + If True, we should prefer to generate a simple message quickly. + All normal errors should still be reported. + """ + if self.file in self.ignored_files: + # Errors ignored, so no point generating fancy messages + return True + if self.options.ignore_errors: + return True + if self._watchers: + _watcher = self._watchers[-1] + if _watcher._filter is True and _watcher._filtered is None: + # Errors are filtered + return True + return False + + def raise_error(self, use_stdout: bool = True) -> NoReturn: + """Raise a CompileError with the generated messages. + + Render the messages suitable for displaying. + """ + # self.new_messages() will format all messages that haven't already + # been returned from a file_messages() call. + raise CompileError( + self.new_messages(), use_stdout=use_stdout, module_with_blocker=self.blocker_module() + ) + + def format_messages_default( + self, error_tuples: list[ErrorTuple], source_lines: list[str] | None + ) -> list[str]: + """Return a string list that represents the error messages. + + Use a form suitable for displaying to the user. If self.pretty + is True also append a relevant trimmed source code line (only for + severity 'error'). + """ + a: list[str] = [] + for file, line, column, end_line, end_column, severity, message, code in error_tuples: + s = "" + if file is not None: + if self.options.show_column_numbers and line >= 0 and column >= 0: + srcloc = f"{file}:{line}:{1 + column}" + if self.options.show_error_end and end_line >= 0 and end_column >= 0: + srcloc += f":{end_line}:{end_column}" + elif line >= 0: + srcloc = f"{file}:{line}" + else: + srcloc = file + s = f"{srcloc}: {severity}: {message}" + else: + s = message + if ( + not self.hide_error_codes + and code + and (severity != "note" or code in SHOW_NOTE_CODES) + ): + # If note has an error code, it is related to a previous error. Avoid + # displaying duplicate error codes. + s = f"{s} [{code}]" + a.append(s) + if self.options.pretty: + # Add source code fragment and a location marker. + if severity == "error" and source_lines and line > 0: + source_line = source_lines[line - 1] + source_line_expanded = source_line.expandtabs() + min_column = len(source_line) - len(source_line.lstrip()) + if column < min_column: + # Something went wrong, take first non-empty column. + column = min_column + + # Shifts column after tab expansion + column = len(source_line[:column].expandtabs()) + end_column = len(source_line[:end_column].expandtabs()) + + # Note, currently coloring uses the offset to detect source snippets, + # so these offsets should not be arbitrary. + a.append(" " * DEFAULT_SOURCE_OFFSET + source_line_expanded) + marker = "^" + if end_line == line and end_column > column: + marker = f'^{"~" * (end_column - column - 1)}' + elif end_line != line: + # just highlight the first line instead + marker = f'^{"~" * (len(source_line_expanded) - column - 1)}' + a.append(" " * (DEFAULT_SOURCE_OFFSET + column) + marker) + return a + + def file_messages(self, path: str) -> list[ErrorTuple]: + """Return an error tuple list of new error messages from a given file.""" + if path not in self.error_info_map: + return [] + + error_info = self.error_info_map[path] + error_info = [info for info in error_info if not info.hidden] + error_info = self.remove_duplicates(self.sort_messages(error_info)) + return self.render_messages(path, error_info) + + def format_messages( + self, path: str, error_tuples: list[ErrorTuple], formatter: ErrorFormatter | None = None + ) -> list[str]: + """Return a string list of new error messages from a given file. + + Use a form suitable for displaying to the user. + """ + self.flushed_files.add(path) + if formatter is not None: + errors = create_errors(error_tuples) + return [formatter.report_error(err) for err in errors] + + source_lines = None + if self.options.pretty and self.read_source: + # Find shadow file mapping and read source lines if a shadow file exists for the given path. + # If shadow file mapping is not found, read source lines + mapped_path = self.find_shadow_file_mapping(path) + if mapped_path: + source_lines = self.read_source(mapped_path) + else: + source_lines = self.read_source(path) + return self.format_messages_default(error_tuples, source_lines) + + def find_shadow_file_mapping(self, path: str) -> str | None: + """Return the shadow file path for a given source file path or None.""" + if self.options.shadow_file is None: + return None + + for i in self.options.shadow_file: + if i[0] == path: + return i[1] + return None + + def new_messages(self) -> list[str]: + """Return a string list of new error messages. + + Use a form suitable for displaying to the user. + Errors from different files are ordered based on the order in which + they first generated an error. + """ + msgs = [] + for path in self.error_info_map.keys(): + if path not in self.flushed_files: + error_tuples = self.file_messages(path) + msgs.extend(self.format_messages(path, error_tuples)) + return msgs + + def targets(self) -> set[str]: + """Return a set of all targets that contain errors.""" + # TODO: Make sure that either target is always defined or that not being defined + # is okay for fine-grained incremental checking. + return { + info.target for errs in self.error_info_map.values() for info in errs if info.target + } + + def render_messages(self, file: str, errors: list[ErrorInfo]) -> list[ErrorTuple]: + """Translate the messages into a sequence of tuples. + + Each tuple is of form (path, line, col, severity, message, code). + The rendered sequence includes information about error contexts. + The path item may be None. If the line item is negative, the + line number is not defined for the tuple. + """ + file = self.simplify_path(file) + result: list[ErrorTuple] = [] + prev_import_context: list[tuple[str, int]] = [] + prev_function: str | None = None + prev_type: str | None = None + + for e in errors: + # Report module import context, if different from previous message. + if not self.options.show_error_context: + pass + elif e.import_ctx != prev_import_context: + last = len(e.import_ctx) - 1 + i = last + while i >= 0: + path, line = e.import_ctx[i] + fmt = "{}:{}: note: In module imported here" + if i < last: + fmt = "{}:{}: note: ... from here" + if i > 0: + fmt += "," + else: + fmt += ":" + # Remove prefix to ignore from path (if present) to + # simplify path. + path = remove_path_prefix(path, self.ignore_prefix) + result.append((None, -1, -1, -1, -1, "note", fmt.format(path, line), None)) + i -= 1 + + # Report context within a source file. + type, function = e.local_ctx + if not self.options.show_error_context: + pass + elif function != prev_function or type != prev_type: + if function is None: + if type is None: + result.append((file, -1, -1, -1, -1, "note", "At top level:", None)) + else: + result.append((file, -1, -1, -1, -1, "note", f'In class "{type}":', None)) + else: + + if type is None: + msg = f'In function "{function}":' + else: + msg = 'In member "{}" of class "{}":'.format(function, type) + result.append((file, -1, -1, -1, -1, "note", msg, None)) + + elif type != prev_type: + if type is None: + result.append((file, -1, -1, -1, -1, "note", "At top level:", None)) + else: + result.append((file, -1, -1, -1, -1, "note", f'In class "{type}":', None)) + + code = e.code.code if e.code is not None else None + result.append( + (file, e.line, e.column, e.end_line, e.end_column, e.severity, e.message, code) + ) + + prev_import_context = e.import_ctx + prev_function = function + prev_type = type + + return result + + def sort_messages(self, errors: list[ErrorInfo]) -> list[ErrorInfo]: + """Sort an array of error messages locally by line number. + + I.e., sort a run of consecutive messages with the same + context by line number, but otherwise retain the general + ordering of the messages. + """ + result: list[ErrorInfo] = [] + i = 0 + while i < len(errors): + i0 = i + # Find neighbouring errors with the same context and file. + while i + 1 < len(errors) and errors[i + 1].import_ctx == errors[i].import_ctx: + i += 1 + i += 1 + + # Sort the errors specific to a file according to line number and column. + a = sorted(errors[i0:i], key=lambda x: (x.line, x.column)) + a = self.sort_within_context(a) + result.extend(a) + return result + + def sort_within_context(self, errors: list[ErrorInfo]) -> list[ErrorInfo]: + """For the same location decide which messages to show first/last. + + Currently, we only compare within the same error code, to decide the + order of various additional notes. + """ + result = [] + i = 0 + while i < len(errors): + i0 = i + # Find neighbouring errors with the same position and error code. + while ( + i + 1 < len(errors) + and errors[i + 1].line == errors[i].line + and errors[i + 1].column == errors[i].column + and errors[i + 1].end_line == errors[i].end_line + and errors[i + 1].end_column == errors[i].end_column + and errors[i + 1].code == errors[i].code + ): + i += 1 + i += 1 + + # Sort the messages specific to a given error by priority. + a = sorted(errors[i0:i], key=lambda x: x.priority) + result.extend(a) + return result + + def remove_duplicates(self, errors: list[ErrorInfo]) -> list[ErrorInfo]: + filtered_errors = [] + seen_by_line: defaultdict[int, set[tuple[str, str]]] = defaultdict(set) + removed = set() + for err in errors: + if err.parent_error is not None: + # Notes with specified parent are removed together with error below. + filtered_errors.append(err) + elif (err.severity, err.message) not in seen_by_line[err.line]: + filtered_errors.append(err) + seen_by_line[err.line].add((err.severity, err.message)) + else: + removed.add(err) + return [ + err + for err in filtered_errors + if err.parent_error is None or err.parent_error not in removed + ] + + +class CompileError(Exception): + """Exception raised when there is a compile error. + + It can be a parse, semantic analysis, type check or other + compilation-related error. + + CompileErrors raised from an errors object carry all of the + messages that have not been reported out by error streaming. + This is patched up by build.build to contain either all error + messages (if errors were streamed) or none (if they were not). + + """ + + messages: list[str] + use_stdout = False + # Can be set in case there was a module with a blocking error + module_with_blocker: str | None = None + + def __init__( + self, messages: list[str], use_stdout: bool = False, module_with_blocker: str | None = None + ) -> None: + super().__init__("\n".join(messages)) + self.messages = messages + self.use_stdout = use_stdout + self.module_with_blocker = module_with_blocker + + +def remove_path_prefix(path: str, prefix: str | None) -> str: + """If path starts with prefix, return copy of path with the prefix removed. + Otherwise, return path. If path is None, return None. + """ + if prefix is not None and path.startswith(prefix): + return path[len(prefix) :] + else: + return path + + +def report_internal_error( + err: Exception, + file: str | None, + line: int, + errors: Errors | None, + options: Options, + stdout: TextIO | None = None, + stderr: TextIO | None = None, +) -> NoReturn: + """Report internal error and exit. + + This optionally starts pdb or shows a traceback. + """ + stdout = stdout or sys.stdout + stderr = stderr or sys.stderr + # Dump out errors so far, they often provide a clue. + # But catch unexpected errors rendering them. + if errors: + try: + for msg in errors.new_messages(): + print(msg) + except Exception as e: + print("Failed to dump errors:", repr(e), file=stderr) + + # Compute file:line prefix for official-looking error messages. + if file: + if line: + prefix = f"{file}:{line}: " + else: + prefix = f"{file}: " + else: + prefix = "" + + # Print "INTERNAL ERROR" message. + print( + f"{prefix}error: INTERNAL ERROR --", + "Please try using mypy master on GitHub:\n" + "https://mypy.readthedocs.io/en/stable/common_issues.html" + "#using-a-development-mypy-build", + file=stderr, + ) + if options.show_traceback: + print("Please report a bug at https://github.com/python/mypy/issues", file=stderr) + else: + print( + "If this issue continues with mypy master, " + "please report a bug at https://github.com/python/mypy/issues", + file=stderr, + ) + print(f"version: {mypy_version}", file=stderr) + + # If requested, drop into pdb. This overrides show_tb. + if options.pdb: + print("Dropping into pdb", file=stderr) + import pdb + + pdb.post_mortem(sys.exc_info()[2]) + + # If requested, print traceback, else print note explaining how to get one. + if options.raise_exceptions: + raise err + if not options.show_traceback: + if not options.pdb: + print( + "{}note: please use --show-traceback to print a traceback " + "when reporting a bug".format(prefix), + file=stderr, + ) + else: + tb = traceback.extract_stack()[:-2] + tb2 = traceback.extract_tb(sys.exc_info()[2]) + print("Traceback (most recent call last):") + for s in traceback.format_list(tb + tb2): + print(s.rstrip("\n")) + print(f"{type(err).__name__}: {err}", file=stdout) + print(f"{prefix}note: use --pdb to drop into pdb", file=stderr) + + # Exit. The caller has nothing more to say. + # We use exit code 2 to signal that this is no ordinary error. + raise SystemExit(2) + + +class MypyError: + def __init__( + self, + file_path: str, + line: int, + column: int, + end_line: int, + end_column: int, + message: str, + errorcode: str | None, + severity: Literal["error", "note"], + ) -> None: + self.file_path = file_path + self.line = line + self.column = column + self.end_line = end_line + self.end_column = end_column + self.message = message + self.errorcode = errorcode + self.severity = severity + self.hints: list[str] = [] + + +# (file_path, line, column) +_ErrorLocation = tuple[str, int, int] + + +def create_errors(error_tuples: list[ErrorTuple]) -> list[MypyError]: + errors: list[MypyError] = [] + latest_error_at_location: dict[_ErrorLocation, MypyError] = {} + + for error_tuple in error_tuples: + file_path, line, column, end_line, end_column, severity, message, errorcode = error_tuple + if file_path is None: + continue + + assert severity in ("error", "note") + if severity == "note": + error_location = (file_path, line, column) + error = latest_error_at_location.get(error_location) + if error is None: + # This is purely a note, with no error correlated to it + error = MypyError( + file_path, + line, + column, + end_line, + end_column, + message, + errorcode, + severity="note", + ) + errors.append(error) + continue + + error.hints.append(message) + + else: + error = MypyError( + file_path, line, column, end_line, end_column, message, errorcode, severity="error" + ) + errors.append(error) + error_location = (file_path, line, column) + latest_error_at_location[error_location] = error + + return errors diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/evalexpr.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/evalexpr.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..988d5eb74dec1bf21cb6f426df922f3929a565fe Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/evalexpr.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/evalexpr.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/evalexpr.py new file mode 100644 index 0000000000000000000000000000000000000000..f46e5c23c3e43f79899791e173d4ad9bf999daa9 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/evalexpr.py @@ -0,0 +1,211 @@ +""" + +Evaluate an expression. + +Used by stubtest; in a separate file because things break if we don't +put it in a mypyc-compiled file. + +""" + +import ast +from typing import Final + +import mypy.nodes +from mypy.visitor import ExpressionVisitor + +UNKNOWN = object() + + +class _NodeEvaluator(ExpressionVisitor[object]): + def visit_int_expr(self, o: mypy.nodes.IntExpr) -> int: + return o.value + + def visit_str_expr(self, o: mypy.nodes.StrExpr) -> str: + return o.value + + def visit_bytes_expr(self, o: mypy.nodes.BytesExpr) -> object: + # The value of a BytesExpr is a string created from the repr() + # of the bytes object. Get the original bytes back. + try: + return ast.literal_eval(f"b'{o.value}'") + except SyntaxError: + return ast.literal_eval(f'b"{o.value}"') + + def visit_float_expr(self, o: mypy.nodes.FloatExpr) -> float: + return o.value + + def visit_complex_expr(self, o: mypy.nodes.ComplexExpr) -> object: + return o.value + + def visit_ellipsis(self, o: mypy.nodes.EllipsisExpr) -> object: + return Ellipsis + + def visit_star_expr(self, o: mypy.nodes.StarExpr) -> object: + return UNKNOWN + + def visit_name_expr(self, o: mypy.nodes.NameExpr) -> object: + if o.name == "True": + return True + elif o.name == "False": + return False + elif o.name == "None": + return None + # TODO: Handle more names by figuring out a way to hook into the + # symbol table. + return UNKNOWN + + def visit_member_expr(self, o: mypy.nodes.MemberExpr) -> object: + return UNKNOWN + + def visit_yield_from_expr(self, o: mypy.nodes.YieldFromExpr) -> object: + return UNKNOWN + + def visit_yield_expr(self, o: mypy.nodes.YieldExpr) -> object: + return UNKNOWN + + def visit_call_expr(self, o: mypy.nodes.CallExpr) -> object: + return UNKNOWN + + def visit_op_expr(self, o: mypy.nodes.OpExpr) -> object: + return UNKNOWN + + def visit_comparison_expr(self, o: mypy.nodes.ComparisonExpr) -> object: + return UNKNOWN + + def visit_cast_expr(self, o: mypy.nodes.CastExpr) -> object: + return o.expr.accept(self) + + def visit_type_form_expr(self, o: mypy.nodes.TypeFormExpr) -> object: + return UNKNOWN + + def visit_assert_type_expr(self, o: mypy.nodes.AssertTypeExpr) -> object: + return o.expr.accept(self) + + def visit_reveal_expr(self, o: mypy.nodes.RevealExpr) -> object: + return UNKNOWN + + def visit_super_expr(self, o: mypy.nodes.SuperExpr) -> object: + return UNKNOWN + + def visit_unary_expr(self, o: mypy.nodes.UnaryExpr) -> object: + operand = o.expr.accept(self) + if operand is UNKNOWN: + return UNKNOWN + if o.op == "-": + if isinstance(operand, (int, float, complex)): + return -operand + elif o.op == "+": + if isinstance(operand, (int, float, complex)): + return +operand + elif o.op == "~": + if isinstance(operand, int): + return ~operand + elif o.op == "not": + if isinstance(operand, (bool, int, float, str, bytes)): + return not operand + return UNKNOWN + + def visit_assignment_expr(self, o: mypy.nodes.AssignmentExpr) -> object: + return o.value.accept(self) + + def visit_list_expr(self, o: mypy.nodes.ListExpr) -> object: + items = [item.accept(self) for item in o.items] + if all(item is not UNKNOWN for item in items): + return items + return UNKNOWN + + def visit_dict_expr(self, o: mypy.nodes.DictExpr) -> object: + items = [ + (UNKNOWN if key is None else key.accept(self), value.accept(self)) + for key, value in o.items + ] + if all(key is not UNKNOWN and value is not None for key, value in items): + return dict(items) + return UNKNOWN + + def visit_tuple_expr(self, o: mypy.nodes.TupleExpr) -> object: + items = [item.accept(self) for item in o.items] + if all(item is not UNKNOWN for item in items): + return tuple(items) + return UNKNOWN + + def visit_set_expr(self, o: mypy.nodes.SetExpr) -> object: + items = [item.accept(self) for item in o.items] + if all(item is not UNKNOWN for item in items): + return set(items) + return UNKNOWN + + def visit_index_expr(self, o: mypy.nodes.IndexExpr) -> object: + return UNKNOWN + + def visit_type_application(self, o: mypy.nodes.TypeApplication) -> object: + return UNKNOWN + + def visit_lambda_expr(self, o: mypy.nodes.LambdaExpr) -> object: + return UNKNOWN + + def visit_list_comprehension(self, o: mypy.nodes.ListComprehension) -> object: + return UNKNOWN + + def visit_set_comprehension(self, o: mypy.nodes.SetComprehension) -> object: + return UNKNOWN + + def visit_dictionary_comprehension(self, o: mypy.nodes.DictionaryComprehension) -> object: + return UNKNOWN + + def visit_generator_expr(self, o: mypy.nodes.GeneratorExpr) -> object: + return UNKNOWN + + def visit_slice_expr(self, o: mypy.nodes.SliceExpr) -> object: + return UNKNOWN + + def visit_conditional_expr(self, o: mypy.nodes.ConditionalExpr) -> object: + return UNKNOWN + + def visit_type_var_expr(self, o: mypy.nodes.TypeVarExpr) -> object: + return UNKNOWN + + def visit_paramspec_expr(self, o: mypy.nodes.ParamSpecExpr) -> object: + return UNKNOWN + + def visit_type_var_tuple_expr(self, o: mypy.nodes.TypeVarTupleExpr) -> object: + return UNKNOWN + + def visit_type_alias_expr(self, o: mypy.nodes.TypeAliasExpr) -> object: + return UNKNOWN + + def visit_namedtuple_expr(self, o: mypy.nodes.NamedTupleExpr) -> object: + return UNKNOWN + + def visit_enum_call_expr(self, o: mypy.nodes.EnumCallExpr) -> object: + return UNKNOWN + + def visit_typeddict_expr(self, o: mypy.nodes.TypedDictExpr) -> object: + return UNKNOWN + + def visit_newtype_expr(self, o: mypy.nodes.NewTypeExpr) -> object: + return UNKNOWN + + def visit__promote_expr(self, o: mypy.nodes.PromoteExpr) -> object: + return UNKNOWN + + def visit_await_expr(self, o: mypy.nodes.AwaitExpr) -> object: + return UNKNOWN + + def visit_template_str_expr(self, o: mypy.nodes.TemplateStrExpr) -> object: + return UNKNOWN + + def visit_temp_node(self, o: mypy.nodes.TempNode) -> object: + return UNKNOWN + + +_evaluator: Final = _NodeEvaluator() + + +def evaluate_expression(expr: mypy.nodes.Expression) -> object: + """Evaluate an expression at runtime. + + Return the result of the expression, or UNKNOWN if the expression cannot be + evaluated. + """ + return expr.accept(_evaluator) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/expandtype.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/expandtype.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..c5007b926508fc54eeb2664fed6171e8b967abae Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/expandtype.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/expandtype.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/expandtype.py new file mode 100644 index 0000000000000000000000000000000000000000..5790b717172acafe218f45882aaa010ef62be236 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/expandtype.py @@ -0,0 +1,662 @@ +from __future__ import annotations + +from collections.abc import Iterable, Mapping +from typing import Final, TypeVar, cast, overload + +from mypy.nodes import ARG_STAR, ArgKind, FakeInfo, Var +from mypy.state import state +from mypy.types import ( + ANY_STRATEGY, + AnyType, + BoolTypeQuery, + CallableType, + DeletedType, + ErasedType, + FunctionLike, + Instance, + LiteralType, + NoneType, + Overloaded, + Parameters, + ParamSpecFlavor, + ParamSpecType, + PartialType, + ProperType, + TrivialSyntheticTypeTranslator, + TupleType, + Type, + TypeAliasType, + TypedDictType, + TypeOfAny, + TypeType, + TypeVarId, + TypeVarLikeType, + TypeVarTupleType, + TypeVarType, + UnboundType, + UninhabitedType, + UnionType, + UnpackType, + flatten_nested_unions, + get_proper_type, + split_with_prefix_and_suffix, +) +from mypy.typevartuples import split_with_instance + +# Solving the import cycle: +import mypy.type_visitor # ruff: isort: skip + +# WARNING: these functions should never (directly or indirectly) depend on +# is_subtype(), meet_types(), join_types() etc. +# TODO: add a static dependency test for this. + + +@overload +def expand_type(typ: CallableType, env: Mapping[TypeVarId, Type]) -> CallableType: ... + + +@overload +def expand_type(typ: ProperType, env: Mapping[TypeVarId, Type]) -> ProperType: ... + + +@overload +def expand_type(typ: Type, env: Mapping[TypeVarId, Type]) -> Type: ... + + +def expand_type(typ: Type, env: Mapping[TypeVarId, Type]) -> Type: + """Substitute any type variable references in a type given by a type + environment. + """ + return typ.accept(ExpandTypeVisitor(env)) + + +@overload +def expand_type_by_instance(typ: CallableType, instance: Instance) -> CallableType: ... + + +@overload +def expand_type_by_instance(typ: ProperType, instance: Instance) -> ProperType: ... + + +@overload +def expand_type_by_instance(typ: Type, instance: Instance) -> Type: ... + + +def expand_type_by_instance(typ: Type, instance: Instance) -> Type: + """Substitute type variables in type using values from an Instance. + Type variables are considered to be bound by the class declaration.""" + if not instance.args and not instance.type.has_type_var_tuple_type: + return typ + else: + variables: dict[TypeVarId, Type] = {} + if instance.type.has_type_var_tuple_type: + assert instance.type.type_var_tuple_prefix is not None + assert instance.type.type_var_tuple_suffix is not None + + args_prefix, args_middle, args_suffix = split_with_instance(instance) + tvars_prefix, tvars_middle, tvars_suffix = split_with_prefix_and_suffix( + tuple(instance.type.defn.type_vars), + instance.type.type_var_tuple_prefix, + instance.type.type_var_tuple_suffix, + ) + tvar = tvars_middle[0] + assert isinstance(tvar, TypeVarTupleType) + variables = {tvar.id: TupleType(list(args_middle), tvar.tuple_fallback)} + instance_args = args_prefix + args_suffix + tvars = tvars_prefix + tvars_suffix + else: + tvars = tuple(instance.type.defn.type_vars) + instance_args = instance.args + + for binder, arg in zip(tvars, instance_args): + assert isinstance(binder, TypeVarLikeType) + variables[binder.id] = arg + + return expand_type(typ, variables) + + +F = TypeVar("F", bound=FunctionLike) + + +def freshen_function_type_vars(callee: F) -> F: + """Substitute fresh type variables for generic function type variables.""" + if isinstance(callee, CallableType): + if not callee.is_generic(): + return callee + tvs = [] + tvmap: dict[TypeVarId, Type] = {} + for v in callee.variables: + tv = v.new_unification_variable(v) + tvs.append(tv) + tvmap[v.id] = tv + fresh = expand_type(callee, tvmap).copy_modified(variables=tvs) + return cast(F, fresh) + else: + assert isinstance(callee, Overloaded) + fresh_overload = Overloaded([freshen_function_type_vars(item) for item in callee.items]) + return cast(F, fresh_overload) + + +class HasGenericCallable(BoolTypeQuery): + def __init__(self) -> None: + super().__init__(ANY_STRATEGY) + + def visit_callable_type(self, t: CallableType) -> bool: + return t.is_generic() or super().visit_callable_type(t) + + +# Share a singleton since this is performance sensitive +has_generic_callable: Final = HasGenericCallable() + + +T = TypeVar("T", bound=Type) + + +def freshen_all_functions_type_vars(t: T) -> T: + result: Type + has_generic_callable.reset() + if not t.accept(has_generic_callable): + return t # Fast path to avoid expensive freshening + else: + result = t.accept(FreshenCallableVisitor()) + assert isinstance(result, type(t)) + return result + + +class FreshenCallableVisitor(mypy.type_visitor.TypeTranslator): + def visit_callable_type(self, t: CallableType) -> Type: + result = super().visit_callable_type(t) + assert isinstance(result, ProperType) and isinstance(result, CallableType) + return freshen_function_type_vars(result) + + def visit_type_alias_type(self, t: TypeAliasType) -> Type: + # Same as for ExpandTypeVisitor + return t.copy_modified(args=[arg.accept(self) for arg in t.args]) + + +class ExpandTypeVisitor(TrivialSyntheticTypeTranslator): + """Visitor that substitutes type variables with values.""" + + variables: Mapping[TypeVarId, Type] # TypeVar id -> TypeVar value + + def __init__(self, variables: Mapping[TypeVarId, Type]) -> None: + super().__init__() + self.variables = variables + self.recursive_tvar_guard: dict[TypeVarId, Type | None] | None = None + + def visit_unbound_type(self, t: UnboundType) -> Type: + return t + + def visit_any(self, t: AnyType) -> Type: + return t + + def visit_none_type(self, t: NoneType) -> Type: + return t + + def visit_uninhabited_type(self, t: UninhabitedType) -> Type: + return t + + def visit_deleted_type(self, t: DeletedType) -> Type: + return t + + def visit_erased_type(self, t: ErasedType) -> Type: + # This may happen during type inference if some function argument + # type is a generic callable, and its erased form will appear in inferred + # constraints, then solver may check subtyping between them, which will trigger + # unify_generic_callables(), this is why we can get here. Another example is + # when inferring type of lambda in generic context, the lambda body contains + # a generic method in generic class. + return t + + def visit_instance(self, t: Instance) -> Type: + if len(t.args) == 0: + return t + + args = self.expand_type_tuple_with_unpack(t.args) + + if isinstance(t.type, FakeInfo): + # The type checker expands function definitions and bodies + # if they depend on constrained type variables but the body + # might contain a tuple type comment (e.g., # type: (int, float)), + # in which case 't.type' is not yet available. + # + # See: https://github.com/python/mypy/issues/16649 + return t.copy_modified(args=args) + + if t.type.fullname == "builtins.tuple": + # Normalize Tuple[*Tuple[X, ...], ...] -> Tuple[X, ...] + arg = args[0] + if isinstance(arg, UnpackType): + unpacked = get_proper_type(arg.type) + if isinstance(unpacked, Instance): + # TODO: this and similar asserts below may be unsafe because get_proper_type() + # may be called during semantic analysis before all invalid types are removed. + assert unpacked.type.fullname == "builtins.tuple" + args = list(unpacked.args) + return t.copy_modified(args=args) + + def visit_type_var(self, t: TypeVarType) -> Type: + # Normally upper bounds can't contain other type variables, the only exception is + # special type variable Self`0 <: C[T, S], where C is the class where Self is used. + if t.id.is_self(): + t = t.copy_modified(upper_bound=t.upper_bound.accept(self)) + repl = self.variables.get(t.id, t) + if isinstance(repl, ProperType) and isinstance(repl, Instance): + # TODO: do we really need to do this? + # If I try to remove this special-casing ~40 tests fail on reveal_type(). + return repl.copy_modified(last_known_value=None) + if isinstance(repl, TypeVarType) and repl.has_default(): + if self.recursive_tvar_guard is None: + self.recursive_tvar_guard = {} + if (tvar_id := repl.id) in self.recursive_tvar_guard: + return self.recursive_tvar_guard[tvar_id] or repl + self.recursive_tvar_guard[tvar_id] = None + repl.default = repl.default.accept(self) + expanded = repl.accept(self) # Note: `expanded is repl` may be true. + repl = repl if isinstance(expanded, TypeVarType) else expanded + self.recursive_tvar_guard[tvar_id] = repl + return repl + + def visit_param_spec(self, t: ParamSpecType) -> Type: + # Set prefix to something empty, so we don't duplicate it below. + repl = self.variables.get(t.id, t.copy_modified(prefix=Parameters([], [], []))) + if isinstance(repl, ParamSpecType): + return repl.copy_modified( + flavor=t.flavor, + prefix=t.prefix.copy_modified( + arg_types=self.expand_types(t.prefix.arg_types) + repl.prefix.arg_types, + arg_kinds=t.prefix.arg_kinds + repl.prefix.arg_kinds, + arg_names=t.prefix.arg_names + repl.prefix.arg_names, + ), + ) + elif isinstance(repl, Parameters): + assert isinstance(t.upper_bound, ProperType) and isinstance(t.upper_bound, Instance) + if t.flavor == ParamSpecFlavor.BARE: + return Parameters( + self.expand_types(t.prefix.arg_types) + repl.arg_types, + t.prefix.arg_kinds + repl.arg_kinds, + t.prefix.arg_names + repl.arg_names, + variables=[*t.prefix.variables, *repl.variables], + imprecise_arg_kinds=repl.imprecise_arg_kinds, + ) + elif t.flavor == ParamSpecFlavor.ARGS: + assert all(k.is_positional() for k in t.prefix.arg_kinds) + return self._possible_callable_varargs( + repl, list(t.prefix.arg_types), t.upper_bound + ) + else: + assert t.flavor == ParamSpecFlavor.KWARGS + return self._possible_callable_kwargs(repl, t.upper_bound) + else: + # We could encode Any as trivial parameters etc., but it would be too verbose. + # TODO: assert this is a trivial type, like Any, Never, or object. + return repl + + @classmethod + def _possible_callable_varargs( + cls, repl: Parameters, required_prefix: list[Type], tuple_type: Instance + ) -> ProperType: + """Given a callable, extract all parameters that can be passed as `*args`. + + This builds a union of all (possibly variadic) tuples representing all possible + argument sequences that can be passed positionally. Each such tuple starts with + all required (pos-only without a default) arguments, followed by some prefix + of other arguments that can be passed positionally. + """ + required_posargs = required_prefix + if repl.variables: + # We will tear the callable apart, do not leak type variables + return tuple_type + optional_posargs: list[Type] = [] + for kind, name, type in zip(repl.arg_kinds, repl.arg_names, repl.arg_types): + if kind == ArgKind.ARG_POS and name is None: + if optional_posargs: + # May happen following Unpack expansion without kinds correction + required_posargs += optional_posargs + optional_posargs = [] + required_posargs.append(type) + elif kind.is_positional(): + optional_posargs.append(type) + elif kind == ArgKind.ARG_STAR: + if isinstance(type, UnpackType): + optional_posargs.append(type) + else: + optional_posargs.append(UnpackType(Instance(tuple_type.type, [type]))) + break + return UnionType.make_union( + [ + TupleType(required_posargs + optional_posargs[:i], fallback=tuple_type) + for i in range(len(optional_posargs) + 1) + ] + ) + + @classmethod + def _possible_callable_kwargs(cls, repl: Parameters, dict_type: Instance) -> ProperType: + """Given a callable, extract all parameters that can be passed as `**kwargs`. + + If the function only accepts **kwargs, this will be a `dict[str, KwargsValueType]`. + Otherwise, this will be a `TypedDict` containing all explicit args and ignoring + `**kwargs` (until PEP 728 `extra_items` is supported). TypedDict entries will + be required iff the corresponding argument is kw-only and has no default. + """ + if repl.variables: + # We will tear the callable apart, do not leak type variables + return dict_type + kwargs = {} + required_names = set() + extra_items: Type = UninhabitedType() + for kind, name, type in zip(repl.arg_kinds, repl.arg_names, repl.arg_types): + if kind == ArgKind.ARG_NAMED and name is not None: + kwargs[name] = type + required_names.add(name) + elif kind == ArgKind.ARG_STAR2: + # Unpack[TypedDict] is normalized early, it isn't stored as Unpack + extra_items = type + elif not kind.is_star() and name is not None: + kwargs[name] = type + if not kwargs: + return Instance(dict_type.type, [dict_type.args[0], extra_items]) + # TODO: when PEP 728 is implemented, pass extra_items below. + return TypedDictType(kwargs, required_names, set(), fallback=dict_type) + + def visit_type_var_tuple(self, t: TypeVarTupleType) -> Type: + # Sometimes solver may need to expand a type variable with (a copy of) itself + # (usually together with other TypeVars, but it is hard to filter out TypeVarTuples). + repl = self.variables.get(t.id, t) + if isinstance(repl, TypeVarTupleType): + return repl + elif isinstance(repl, ProperType) and isinstance(repl, (AnyType, UninhabitedType)): + # Some failed inference scenarios will try to set all type variables to Never. + # Instead of being picky and require all the callers to wrap them, + # do this here instead. + # Note: most cases when this happens are handled in expand unpack below, but + # in rare cases (e.g. ParamSpec containing Unpack star args) it may be skipped. + return t.tuple_fallback.copy_modified(args=[repl]) + raise NotImplementedError + + def visit_unpack_type(self, t: UnpackType) -> Type: + # It is impossible to reasonably implement visit_unpack_type, because + # unpacking inherently expands to something more like a list of types. + # + # Relevant sections that can call unpack should call expand_unpack() + # instead. + # However, if the item is a variadic tuple, we can simply carry it over. + # In particular, if we expand A[*tuple[T, ...]] with substitutions {T: str}, + # it is hard to assert this without getting proper type. Another important + # example is non-normalized types when called from semanal.py. + return UnpackType(t.type.accept(self)) + + def expand_unpack(self, t: UnpackType) -> list[Type]: + assert isinstance(t.type, TypeVarTupleType) + repl = get_proper_type(self.variables.get(t.type.id, t.type)) + if isinstance(repl, UnpackType): + repl = get_proper_type(repl.type) + if isinstance(repl, TupleType): + return repl.items + elif ( + isinstance(repl, Instance) + and repl.type.fullname == "builtins.tuple" + or isinstance(repl, TypeVarTupleType) + ): + return [UnpackType(typ=repl)] + elif isinstance(repl, (AnyType, UninhabitedType)): + # Replace *Ts = Any with *Ts = *tuple[Any, ...] and same for Never. + # These types may appear here as a result of user error or failed inference. + return [UnpackType(t.type.tuple_fallback.copy_modified(args=[repl]))] + else: + raise RuntimeError(f"Invalid type replacement to expand: {repl}") + + def visit_parameters(self, t: Parameters) -> Type: + return t.copy_modified(arg_types=self.expand_types(t.arg_types)) + + def interpolate_args_for_unpack(self, t: CallableType, var_arg: UnpackType) -> list[Type]: + star_index = t.arg_kinds.index(ARG_STAR) + prefix = self.expand_types(t.arg_types[:star_index]) + suffix = self.expand_types(t.arg_types[star_index + 1 :]) + + var_arg_type = get_proper_type(var_arg.type) + new_unpack: Type + if isinstance(var_arg_type, TupleType): + # We have something like Unpack[Tuple[Unpack[Ts], X1, X2]] + expanded_tuple = var_arg_type.accept(self) + assert isinstance(expanded_tuple, ProperType) and isinstance(expanded_tuple, TupleType) + expanded_items = expanded_tuple.items + fallback = var_arg_type.partial_fallback + new_unpack = UnpackType(TupleType(expanded_items, fallback)) + elif isinstance(var_arg_type, TypeVarTupleType): + # We have plain Unpack[Ts] + fallback = var_arg_type.tuple_fallback + expanded_items = self.expand_unpack(var_arg) + new_unpack = UnpackType(TupleType(expanded_items, fallback)) + # Since get_proper_type() may be called in semanal.py before callable + # normalization happens, we need to also handle non-normal cases here. + elif isinstance(var_arg_type, Instance): + # we have something like Unpack[Tuple[Any, ...]] + new_unpack = UnpackType(var_arg.type.accept(self)) + else: + # We have invalid type in Unpack. This can happen when expanding aliases + # to Callable[[*Invalid], Ret] + new_unpack = AnyType(TypeOfAny.from_error, line=var_arg.line, column=var_arg.column) + return prefix + [new_unpack] + suffix + + def visit_callable_type(self, t: CallableType) -> CallableType: + param_spec = t.param_spec() + if param_spec is not None: + repl = self.variables.get(param_spec.id) + # If a ParamSpec in a callable type is substituted with a + # callable type, we can't use normal substitution logic, + # since ParamSpec is actually split into two components + # *P.args and **P.kwargs in the original type. Instead, we + # must expand both of them with all the argument types, + # kinds and names in the replacement. The return type in + # the replacement is ignored. + if isinstance(repl, Parameters): + # We need to expand both the types in the prefix and the ParamSpec itself + expanded = t.copy_modified( + arg_types=self.expand_types(t.arg_types[:-2]) + repl.arg_types, + arg_kinds=t.arg_kinds[:-2] + repl.arg_kinds, + arg_names=t.arg_names[:-2] + repl.arg_names, + ret_type=t.ret_type.accept(self), + type_guard=(t.type_guard.accept(self) if t.type_guard is not None else None), + type_is=(t.type_is.accept(self) if t.type_is is not None else None), + imprecise_arg_kinds=(t.imprecise_arg_kinds or repl.imprecise_arg_kinds), + variables=[*repl.variables, *t.variables], + ) + var_arg = expanded.var_arg() + if var_arg is not None and isinstance(var_arg.typ, UnpackType): + # Sometimes we get new unpacks after expanding ParamSpec. + expanded.normalize_trivial_unpack() + return expanded + elif isinstance(repl, ParamSpecType): + # We're substituting one ParamSpec for another; this can mean that the prefix + # changes, e.g. substitute Concatenate[int, P] in place of Q. + prefix = repl.prefix + clean_repl = repl.copy_modified(prefix=Parameters([], [], [])) + return t.copy_modified( + arg_types=self.expand_types(t.arg_types[:-2]) + + prefix.arg_types + + [ + clean_repl.with_flavor(ParamSpecFlavor.ARGS), + clean_repl.with_flavor(ParamSpecFlavor.KWARGS), + ], + arg_kinds=t.arg_kinds[:-2] + prefix.arg_kinds + t.arg_kinds[-2:], + arg_names=t.arg_names[:-2] + prefix.arg_names + t.arg_names[-2:], + ret_type=t.ret_type.accept(self), + from_concatenate=t.from_concatenate or bool(repl.prefix.arg_types), + imprecise_arg_kinds=(t.imprecise_arg_kinds or prefix.imprecise_arg_kinds), + ) + + var_arg = t.var_arg() + needs_normalization = False + if var_arg is not None and isinstance(var_arg.typ, UnpackType): + needs_normalization = True + arg_types = self.interpolate_args_for_unpack(t, var_arg.typ) + else: + arg_types = self.expand_types(t.arg_types) + expanded = t.copy_modified( + arg_types=arg_types, + ret_type=t.ret_type.accept(self), + type_guard=(t.type_guard.accept(self) if t.type_guard is not None else None), + type_is=(t.type_is.accept(self) if t.type_is is not None else None), + ) + if needs_normalization: + return expanded.with_normalized_var_args() + return expanded + + def visit_overloaded(self, t: Overloaded) -> Type: + items: list[CallableType] = [] + for item in t.items: + new_item = item.accept(self) + assert isinstance(new_item, ProperType) + assert isinstance(new_item, CallableType) + items.append(new_item) + return Overloaded(items) + + def expand_type_list_with_unpack(self, typs: list[Type]) -> list[Type]: + """Expands a list of types that has an unpack.""" + items: list[Type] = [] + for item in typs: + if isinstance(item, UnpackType) and isinstance(item.type, TypeVarTupleType): + items.extend(self.expand_unpack(item)) + else: + items.append(item.accept(self)) + return items + + def expand_type_tuple_with_unpack(self, typs: tuple[Type, ...]) -> list[Type]: + """Expands a tuple of types that has an unpack.""" + # Micro-optimization: Specialized variant of expand_type_list_with_unpack + items: list[Type] = [] + for item in typs: + if isinstance(item, UnpackType) and isinstance(item.type, TypeVarTupleType): + items.extend(self.expand_unpack(item)) + else: + items.append(item.accept(self)) + return items + + def visit_tuple_type(self, t: TupleType) -> Type: + items = self.expand_type_list_with_unpack(t.items) + if len(items) == 1: + # Normalize Tuple[*Tuple[X, ...]] -> Tuple[X, ...] + item = items[0] + if isinstance(item, UnpackType): + unpacked = get_proper_type(item.type) + if isinstance(unpacked, Instance): + # expand_type() may be called during semantic analysis, before invalid unpacks are fixed. + if unpacked.type.fullname != "builtins.tuple": + return t.partial_fallback.accept(self) + if t.partial_fallback.type.fullname != "builtins.tuple": + # If it is a subtype (like named tuple) we need to preserve it, + # this essentially mimics the logic in tuple_fallback(). + return t.partial_fallback.accept(self) + return unpacked + fallback = t.partial_fallback.accept(self) + assert isinstance(fallback, ProperType) and isinstance(fallback, Instance) + return t.copy_modified(items=items, fallback=fallback) + + def visit_typeddict_type(self, t: TypedDictType) -> Type: + if cached := self.get_cached(t): + return cached + fallback = t.fallback.accept(self) + assert isinstance(fallback, ProperType) and isinstance(fallback, Instance) + result = t.copy_modified(item_types=self.expand_types(t.items.values()), fallback=fallback) + self.set_cached(t, result) + return result + + def visit_literal_type(self, t: LiteralType) -> Type: + # TODO: Verify this implementation is correct + return t + + def visit_union_type(self, t: UnionType) -> Type: + # Use cache to avoid O(n**2) or worse expansion of types during translation + # (only for large unions, since caching adds overhead) + use_cache = len(t.items) > 3 + if use_cache and (cached := self.get_cached(t)): + return cached + + expanded = self.expand_types(t.items) + # After substituting for type variables in t.items, some resulting types + # might be subtypes of others, however calling make_simplified_union() + # can cause recursion, so we just remove strict duplicates. + simplified = UnionType.make_union( + remove_trivial(flatten_nested_unions(expanded)), t.line, t.column + ) + # This call to get_proper_type() is unfortunate but is required to preserve + # the invariant that ProperType will stay ProperType after applying expand_type(), + # otherwise a single item union of a type alias will break it. Note this should not + # cause infinite recursion since pathological aliases like A = Union[A, B] are + # banned at the semantic analysis level. + result = get_proper_type(simplified) + + if use_cache: + self.set_cached(t, result) + return result + + def visit_partial_type(self, t: PartialType) -> Type: + return t + + def visit_type_type(self, t: TypeType) -> Type: + # TODO: Verify that the new item type is valid (instance or + # union of instances or Any). Sadly we can't report errors + # here yet. + item = t.item.accept(self) + return TypeType.make_normalized(item, is_type_form=t.is_type_form) + + def visit_type_alias_type(self, t: TypeAliasType) -> Type: + # Target of the type alias cannot contain type variables (not bound by the type + # alias itself), so we just expand the arguments. + if len(t.args) == 0: + return t + args = self.expand_type_list_with_unpack(t.args) + # TODO: normalize if target is Tuple, and args are [*tuple[X, ...]]? + return t.copy_modified(args=args) + + def expand_types(self, types: Iterable[Type]) -> list[Type]: + a: list[Type] = [] + for t in types: + a.append(t.accept(self)) + return a + + +@overload +def expand_self_type(var: Var, typ: ProperType, replacement: ProperType) -> ProperType: ... + + +@overload +def expand_self_type(var: Var, typ: Type, replacement: Type) -> Type: ... + + +def expand_self_type(var: Var, typ: Type, replacement: Type) -> Type: + """Expand appearances of Self type in a variable type.""" + if var.info.self_type is not None and not var.is_property: + return expand_type(typ, {var.info.self_type.id: replacement}) + return typ + + +def remove_trivial(types: Iterable[Type]) -> list[Type]: + """Make trivial simplifications on a list of types without calling is_subtype(). + + This makes following simplifications: + * Remove bottom types (taking into account strict optional setting) + * Remove everything else if there is an `object` + * Remove strict duplicate types + """ + removed_none = False + new_types = [] + all_types = set() + for t in types: + p_t = get_proper_type(t) + if isinstance(p_t, UninhabitedType): + continue + if isinstance(p_t, NoneType) and not state.strict_optional: + removed_none = True + continue + if isinstance(p_t, Instance) and p_t.type.fullname == "builtins.object": + return [p_t] + if p_t not in all_types: + new_types.append(t) + all_types.add(p_t) + if new_types: + return new_types + if removed_none: + return [NoneType()] + return [UninhabitedType()] diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/exportjson.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/exportjson.py new file mode 100644 index 0000000000000000000000000000000000000000..c08f0f9f2911824ffa0a7fca65b73a4a296b8abb --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/exportjson.py @@ -0,0 +1,612 @@ +"""Tool to convert binary mypy cache files (.ff) to JSON (.ff.json). + +Usage: + python -m mypy.exportjson .mypy_cache/.../my_module.data.ff + +The idea is to make caches introspectable once we've switched to a binary +cache format and removed support for the older JSON cache format. + +This is primarily to support existing use cases that need to inspect +cache files, and to support debugging mypy caching issues. This means that +this doesn't necessarily need to be kept 1:1 up to date with changes in the +binary cache format (to simplify maintenance -- we don't want this to slow +down mypy development). +""" + +import argparse +import json +import sys +from typing import Any, TypeAlias as _TypeAlias + +from librt.internal import ReadBuffer, cache_version + +from mypy.cache import CACHE_VERSION, CacheMeta +from mypy.nodes import ( + FUNCBASE_FLAGS, + FUNCDEF_FLAGS, + VAR_FLAGS, + ClassDef, + DataclassTransformSpec, + Decorator, + FuncDef, + MypyFile, + OverloadedFuncDef, + OverloadPart, + ParamSpecExpr, + SymbolNode, + SymbolTable, + SymbolTableNode, + TypeAlias, + TypeInfo, + TypeVarExpr, + TypeVarTupleExpr, + Var, + get_flags, + node_kinds, +) +from mypy.types import ( + NOT_READY, + AnyType, + CallableType, + ExtraAttrs, + Instance, + LiteralType, + NoneType, + Overloaded, + Parameters, + ParamSpecType, + TupleType, + Type, + TypeAliasType, + TypedDictType, + TypeType, + TypeVarTupleType, + TypeVarType, + UnboundType, + UninhabitedType, + UnionType, + UnpackType, + get_proper_type, +) + +Json: _TypeAlias = dict[str, Any] | str + + +class Config: + def __init__(self, *, implicit_names: bool = True) -> None: + self.implicit_names = implicit_names + + +def convert_binary_cache_to_json(data: bytes, *, implicit_names: bool = True) -> Json: + tree = MypyFile.read(ReadBuffer(data)) + return convert_mypy_file_to_json(tree, Config(implicit_names=implicit_names)) + + +def convert_mypy_file_to_json(self: MypyFile, cfg: Config) -> Json: + return { + ".class": "MypyFile", + "_fullname": self._fullname, + "names": convert_symbol_table(self.names, cfg), + "is_stub": self.is_stub, + "path": self.path, + "is_partial_stub_package": self.is_partial_stub_package, + "future_import_flags": sorted(self.future_import_flags), + } + + +def convert_symbol_table(self: SymbolTable, cfg: Config) -> Json: + data: dict[str, Any] = {".class": "SymbolTable"} + for key, value in self.items(): + # Skip __builtins__: it's a reference to the builtins + # module that gets added to every module by + # SemanticAnalyzerPass2.visit_file(), but it shouldn't be + # accessed by users of the module. + if key == "__builtins__" or value.no_serialize: + continue + if not cfg.implicit_names and key in { + "__spec__", + "__package__", + "__file__", + "__doc__", + "__annotations__", + "__name__", + }: + continue + data[key] = convert_symbol_table_node(value, cfg) + return data + + +def convert_symbol_table_node(self: SymbolTableNode, cfg: Config) -> Json: + data: dict[str, Any] = {".class": "SymbolTableNode", "kind": node_kinds[self.kind]} + if self.module_hidden: + data["module_hidden"] = True + if not self.module_public: + data["module_public"] = False + if self.implicit: + data["implicit"] = True + if self.plugin_generated: + data["plugin_generated"] = True + if self.cross_ref: + data["cross_ref"] = self.cross_ref + elif self.node is not None: + data["node"] = convert_symbol_node(self.node, cfg) + return data + + +def convert_symbol_node(self: SymbolNode, cfg: Config) -> Json: + if isinstance(self, FuncDef): + return convert_func_def(self) + elif isinstance(self, OverloadedFuncDef): + return convert_overloaded_func_def(self) + elif isinstance(self, Decorator): + return convert_decorator(self) + elif isinstance(self, Var): + return convert_var(self) + elif isinstance(self, TypeInfo): + return convert_type_info(self, cfg) + elif isinstance(self, TypeAlias): + return convert_type_alias(self) + elif isinstance(self, TypeVarExpr): + return convert_type_var_expr(self) + elif isinstance(self, ParamSpecExpr): + return convert_param_spec_expr(self) + elif isinstance(self, TypeVarTupleExpr): + return convert_type_var_tuple_expr(self) + return {"ERROR": f"{type(self)!r} unrecognized"} + + +def convert_func_def(self: FuncDef) -> Json: + return { + ".class": "FuncDef", + "name": self._name, + "fullname": self._fullname, + "arg_names": self.arg_names, + "arg_kinds": [int(x.value) for x in self.arg_kinds], + "type": None if self.type is None else convert_type(self.type), + "flags": get_flags(self, FUNCDEF_FLAGS), + "abstract_status": self.abstract_status, + # TODO: Do we need expanded, original_def? + "dataclass_transform_spec": ( + None + if self.dataclass_transform_spec is None + else convert_dataclass_transform_spec(self.dataclass_transform_spec) + ), + "deprecated": self.deprecated, + "original_first_arg": self.original_first_arg, + } + + +def convert_dataclass_transform_spec(self: DataclassTransformSpec) -> Json: + return { + "eq_default": self.eq_default, + "order_default": self.order_default, + "kw_only_default": self.kw_only_default, + "frozen_default": self.frozen_default, + "field_specifiers": list(self.field_specifiers), + } + + +def convert_overloaded_func_def(self: OverloadedFuncDef) -> Json: + return { + ".class": "OverloadedFuncDef", + "items": [convert_overload_part(i) for i in self.items], + "type": None if self.type is None else convert_type(self.type), + "fullname": self._fullname, + "impl": None if self.impl is None else convert_overload_part(self.impl), + "flags": get_flags(self, FUNCBASE_FLAGS), + "deprecated": self.deprecated, + "setter_index": self.setter_index, + } + + +def convert_overload_part(self: OverloadPart) -> Json: + if isinstance(self, FuncDef): + return convert_func_def(self) + else: + return convert_decorator(self) + + +def convert_decorator(self: Decorator) -> Json: + return { + ".class": "Decorator", + "func": convert_func_def(self.func), + "var": convert_var(self.var), + "is_overload": self.is_overload, + } + + +def convert_var(self: Var) -> Json: + data: dict[str, Any] = { + ".class": "Var", + "name": self._name, + "fullname": self._fullname, + "type": None if self.type is None else convert_type(self.type), + "setter_type": None if self.setter_type is None else convert_type(self.setter_type), + "flags": get_flags(self, VAR_FLAGS), + } + if self.final_value is not None: + data["final_value"] = self.final_value + return data + + +def convert_type_info(self: TypeInfo, cfg: Config) -> Json: + data = { + ".class": "TypeInfo", + "module_name": self.module_name, + "fullname": self.fullname, + "names": convert_symbol_table(self.names, cfg), + "defn": convert_class_def(self.defn), + "abstract_attributes": self.abstract_attributes, + "type_vars": self.type_vars, + "has_param_spec_type": self.has_param_spec_type, + "bases": [convert_type(b) for b in self.bases], + "mro": self._mro_refs, + "_promote": [convert_type(p) for p in self._promote], + "alt_promote": None if self.alt_promote is None else convert_type(self.alt_promote), + "declared_metaclass": ( + None if self.declared_metaclass is None else convert_type(self.declared_metaclass) + ), + "metaclass_type": ( + None if self.metaclass_type is None else convert_type(self.metaclass_type) + ), + "tuple_type": None if self.tuple_type is None else convert_type(self.tuple_type), + "typeddict_type": ( + None if self.typeddict_type is None else convert_typeddict_type(self.typeddict_type) + ), + "flags": get_flags(self, TypeInfo.FLAGS), + "metadata": self.metadata, + "slots": sorted(self.slots) if self.slots is not None else None, + "deletable_attributes": self.deletable_attributes, + "self_type": convert_type(self.self_type) if self.self_type is not None else None, + "dataclass_transform_spec": ( + convert_dataclass_transform_spec(self.dataclass_transform_spec) + if self.dataclass_transform_spec is not None + else None + ), + "deprecated": self.deprecated, + } + return data + + +def convert_class_def(self: ClassDef) -> Json: + return { + ".class": "ClassDef", + "name": self.name, + "fullname": self.fullname, + "type_vars": [convert_type(v) for v in self.type_vars], + } + + +def convert_type_alias(self: TypeAlias) -> Json: + data: Json = { + ".class": "TypeAlias", + "fullname": self._fullname, + "module": self.module, + "target": convert_type(self.target), + "alias_tvars": [convert_type(v) for v in self.alias_tvars], + "no_args": self.no_args, + "normalized": self.normalized, + "python_3_12_type_alias": self.python_3_12_type_alias, + } + return data + + +def convert_type_var_expr(self: TypeVarExpr) -> Json: + return { + ".class": "TypeVarExpr", + "name": self._name, + "fullname": self._fullname, + "values": [convert_type(t) for t in self.values], + "upper_bound": convert_type(self.upper_bound), + "default": convert_type(self.default), + "variance": self.variance, + } + + +def convert_param_spec_expr(self: ParamSpecExpr) -> Json: + return { + ".class": "ParamSpecExpr", + "name": self._name, + "fullname": self._fullname, + "upper_bound": convert_type(self.upper_bound), + "default": convert_type(self.default), + "variance": self.variance, + } + + +def convert_type_var_tuple_expr(self: TypeVarTupleExpr) -> Json: + return { + ".class": "TypeVarTupleExpr", + "name": self._name, + "fullname": self._fullname, + "upper_bound": convert_type(self.upper_bound), + "tuple_fallback": convert_type(self.tuple_fallback), + "default": convert_type(self.default), + "variance": self.variance, + } + + +def convert_type(typ: Type) -> Json: + if type(typ) is TypeAliasType: + return convert_type_alias_type(typ) + typ = get_proper_type(typ) + if isinstance(typ, Instance): + return convert_instance(typ) + elif isinstance(typ, AnyType): + return convert_any_type(typ) + elif isinstance(typ, NoneType): + return convert_none_type(typ) + elif isinstance(typ, UnionType): + return convert_union_type(typ) + elif isinstance(typ, TupleType): + return convert_tuple_type(typ) + elif isinstance(typ, CallableType): + return convert_callable_type(typ) + elif isinstance(typ, Overloaded): + return convert_overloaded(typ) + elif isinstance(typ, LiteralType): + return convert_literal_type(typ) + elif isinstance(typ, TypeVarType): + return convert_type_var_type(typ) + elif isinstance(typ, TypeType): + return convert_type_type(typ) + elif isinstance(typ, UninhabitedType): + return convert_uninhabited_type(typ) + elif isinstance(typ, UnpackType): + return convert_unpack_type(typ) + elif isinstance(typ, ParamSpecType): + return convert_param_spec_type(typ) + elif isinstance(typ, TypeVarTupleType): + return convert_type_var_tuple_type(typ) + elif isinstance(typ, Parameters): + return convert_parameters(typ) + elif isinstance(typ, TypedDictType): + return convert_typeddict_type(typ) + elif isinstance(typ, UnboundType): + return convert_unbound_type(typ) + return {"ERROR": f"{type(typ)!r} unrecognized"} + + +def convert_instance(self: Instance) -> Json: + ready = self.type is not NOT_READY + if not self.args and not self.last_known_value and not self.extra_attrs: + if ready: + return self.type.fullname + elif self.type_ref: + return self.type_ref + + data: dict[str, Any] = { + ".class": "Instance", + "type_ref": self.type.fullname if ready else self.type_ref, + "args": [convert_type(arg) for arg in self.args], + } + if self.last_known_value is not None: + data["last_known_value"] = convert_type(self.last_known_value) + data["extra_attrs"] = convert_extra_attrs(self.extra_attrs) if self.extra_attrs else None + return data + + +def convert_extra_attrs(self: ExtraAttrs) -> Json: + return { + ".class": "ExtraAttrs", + "attrs": {k: convert_type(v) for k, v in self.attrs.items()}, + "immutable": sorted(self.immutable), + "mod_name": self.mod_name, + } + + +def convert_type_alias_type(self: TypeAliasType) -> Json: + data: Json = { + ".class": "TypeAliasType", + "type_ref": self.type_ref, + "args": [convert_type(arg) for arg in self.args], + } + return data + + +def convert_any_type(self: AnyType) -> Json: + return { + ".class": "AnyType", + "type_of_any": self.type_of_any, + "source_any": convert_type(self.source_any) if self.source_any is not None else None, + "missing_import_name": self.missing_import_name, + } + + +def convert_none_type(self: NoneType) -> Json: + return {".class": "NoneType"} + + +def convert_union_type(self: UnionType) -> Json: + return { + ".class": "UnionType", + "items": [convert_type(t) for t in self.items], + "uses_pep604_syntax": self.uses_pep604_syntax, + } + + +def convert_tuple_type(self: TupleType) -> Json: + return { + ".class": "TupleType", + "items": [convert_type(t) for t in self.items], + "partial_fallback": convert_type(self.partial_fallback), + "implicit": self.implicit, + } + + +def convert_literal_type(self: LiteralType) -> Json: + return {".class": "LiteralType", "value": self.value, "fallback": convert_type(self.fallback)} + + +def convert_type_var_type(self: TypeVarType) -> Json: + assert not self.id.is_meta_var() + return { + ".class": "TypeVarType", + "name": self.name, + "fullname": self.fullname, + "id": self.id.raw_id, + "namespace": self.id.namespace, + "values": [convert_type(v) for v in self.values], + "upper_bound": convert_type(self.upper_bound), + "default": convert_type(self.default), + "variance": self.variance, + } + + +def convert_callable_type(self: CallableType) -> Json: + return { + ".class": "CallableType", + "arg_types": [convert_type(t) for t in self.arg_types], + "arg_kinds": [int(x.value) for x in self.arg_kinds], + "arg_names": self.arg_names, + "ret_type": convert_type(self.ret_type), + "fallback": convert_type(self.fallback), + "name": self.name, + # We don't serialize the definition (only used for error messages). + "variables": [convert_type(v) for v in self.variables], + "is_ellipsis_args": self.is_ellipsis_args, + "implicit": self.implicit, + "is_bound": self.is_bound, + "type_guard": convert_type(self.type_guard) if self.type_guard is not None else None, + "type_is": convert_type(self.type_is) if self.type_is is not None else None, + "from_concatenate": self.from_concatenate, + "imprecise_arg_kinds": self.imprecise_arg_kinds, + "unpack_kwargs": self.unpack_kwargs, + } + + +def convert_overloaded(self: Overloaded) -> Json: + return {".class": "Overloaded", "items": [convert_type(t) for t in self.items]} + + +def convert_type_type(self: TypeType) -> Json: + return {".class": "TypeType", "item": convert_type(self.item)} + + +def convert_uninhabited_type(self: UninhabitedType) -> Json: + return {".class": "UninhabitedType"} + + +def convert_unpack_type(self: UnpackType) -> Json: + return {".class": "UnpackType", "type": convert_type(self.type)} + + +def convert_param_spec_type(self: ParamSpecType) -> Json: + assert not self.id.is_meta_var() + return { + ".class": "ParamSpecType", + "name": self.name, + "fullname": self.fullname, + "id": self.id.raw_id, + "namespace": self.id.namespace, + "flavor": self.flavor, + "upper_bound": convert_type(self.upper_bound), + "default": convert_type(self.default), + "prefix": convert_type(self.prefix), + } + + +def convert_type_var_tuple_type(self: TypeVarTupleType) -> Json: + assert not self.id.is_meta_var() + return { + ".class": "TypeVarTupleType", + "name": self.name, + "fullname": self.fullname, + "id": self.id.raw_id, + "namespace": self.id.namespace, + "upper_bound": convert_type(self.upper_bound), + "tuple_fallback": convert_type(self.tuple_fallback), + "default": convert_type(self.default), + "min_len": self.min_len, + } + + +def convert_parameters(self: Parameters) -> Json: + return { + ".class": "Parameters", + "arg_types": [convert_type(t) for t in self.arg_types], + "arg_kinds": [int(x.value) for x in self.arg_kinds], + "arg_names": self.arg_names, + "variables": [convert_type(tv) for tv in self.variables], + "imprecise_arg_kinds": self.imprecise_arg_kinds, + } + + +def convert_typeddict_type(self: TypedDictType) -> Json: + return { + ".class": "TypedDictType", + "items": [[n, convert_type(t)] for (n, t) in self.items.items()], + "required_keys": sorted(self.required_keys), + "readonly_keys": sorted(self.readonly_keys), + "fallback": convert_type(self.fallback), + } + + +def convert_unbound_type(self: UnboundType) -> Json: + return { + ".class": "UnboundType", + "name": self.name, + "args": [convert_type(a) for a in self.args], + "expr": self.original_str_expr, + "expr_fallback": self.original_str_fallback, + } + + +def convert_binary_cache_meta_to_json(data: bytes, data_file: str) -> Json: + assert ( + data[0] == cache_version() and data[1] == CACHE_VERSION + ), "Cache file created by an incompatible mypy version" + meta = CacheMeta.read(ReadBuffer(data[2:]), data_file) + assert meta is not None, f"Error reading meta cache file associated with {data_file}" + return { + "id": meta.id, + "path": meta.path, + "mtime": meta.mtime, + "size": meta.size, + "hash": meta.hash, + "data_mtime": meta.data_mtime, + "dependencies": meta.dependencies, + "suppressed": meta.suppressed, + "options": meta.options, + "dep_prios": meta.dep_prios, + "dep_lines": meta.dep_lines, + "dep_hashes": [dep.hex() for dep in meta.dep_hashes], + "interface_hash": meta.interface_hash.hex(), + "version_id": meta.version_id, + "ignore_all": meta.ignore_all, + "plugin_data": meta.plugin_data, + } + + +def main() -> None: + parser = argparse.ArgumentParser( + description="Convert binary cache files to JSON. " + "Create files in the same directory with extra .json extension." + ) + parser.add_argument( + "path", nargs="+", help="mypy cache data file to convert (.data.ff extension)" + ) + args = parser.parse_args() + fnams: list[str] = args.path + for fnam in fnams: + if fnam.endswith(".data.ff"): + is_data = True + elif fnam.endswith(".meta.ff"): + is_data = False + else: + sys.exit(f"error: Expected .data.ff or .meta.ff extension, but got {fnam}") + with open(fnam, "rb") as f: + data = f.read() + if is_data: + json_data = convert_binary_cache_to_json(data) + else: + data_file = fnam.removesuffix(".meta.ff") + ".data.ff" + json_data = convert_binary_cache_meta_to_json(data, data_file) + new_fnam = fnam + ".json" + with open(new_fnam, "w") as f: + json.dump(json_data, f) + print(f"{fnam} -> {new_fnam}") + + +if __name__ == "__main__": + main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/exprtotype.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/exprtotype.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..30845a4135874ff47a2ca78f661715cc5c16757c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/exprtotype.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/exprtotype.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/exprtotype.py new file mode 100644 index 0000000000000000000000000000000000000000..ae36fc8adde09560e04d2e516a277d804906a77c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/exprtotype.py @@ -0,0 +1,289 @@ +"""Translate an Expression to a Type value.""" + +from __future__ import annotations + +from collections.abc import Callable + +from mypy.fastparse import parse_type_string +from mypy.nodes import ( + MISSING_FALLBACK, + BytesExpr, + CallExpr, + ComplexExpr, + Context, + DictExpr, + EllipsisExpr, + Expression, + FloatExpr, + IndexExpr, + IntExpr, + ListExpr, + MemberExpr, + NameExpr, + OpExpr, + RefExpr, + StarExpr, + StrExpr, + SymbolTableNode, + TupleExpr, + UnaryExpr, + get_member_expr_fullname, +) +from mypy.options import Options +from mypy.types import ( + ANNOTATED_TYPE_NAMES, + AnyType, + CallableArgument, + EllipsisType, + Instance, + ProperType, + RawExpressionType, + Type, + TypedDictType, + TypeList, + TypeOfAny, + UnboundType, + UnionType, + UnpackType, +) + + +class TypeTranslationError(Exception): + """Exception raised when an expression is not valid as a type.""" + + +def _extract_argument_name(expr: Expression) -> str | None: + if isinstance(expr, NameExpr) and expr.name == "None": + return None + elif isinstance(expr, StrExpr): + return expr.value + else: + raise TypeTranslationError() + + +def expr_to_unanalyzed_type( + expr: Expression, + options: Options, + allow_new_syntax: bool = False, + _parent: Expression | None = None, + allow_unpack: bool = False, + lookup_qualified: Callable[[str, Context], SymbolTableNode | None] | None = None, +) -> ProperType: + """Translate an expression to the corresponding type. + + The result is not semantically analyzed. It can be UnboundType or TypeList. + Raise TypeTranslationError if the expression cannot represent a type. + + If lookup_qualified is not provided, the expression is expected to be semantically + analyzed. + + If allow_new_syntax is True, allow all type syntax independent of the target + Python version (used in stubs). + + # TODO: a lot of code here is duplicated in fastparse.py, refactor this. + """ + # The `parent` parameter is used in recursive calls to provide context for + # understanding whether an CallableArgument is ok. + name: str | None = None + if isinstance(expr, NameExpr): + name = expr.name + if name == "True": + return RawExpressionType(True, "builtins.bool", line=expr.line, column=expr.column) + elif name == "False": + return RawExpressionType(False, "builtins.bool", line=expr.line, column=expr.column) + else: + return UnboundType(name, line=expr.line, column=expr.column) + elif isinstance(expr, MemberExpr): + fullname = get_member_expr_fullname(expr) + if fullname: + return UnboundType(fullname, line=expr.line, column=expr.column) + else: + raise TypeTranslationError() + elif isinstance(expr, IndexExpr): + base = expr_to_unanalyzed_type( + expr.base, options, allow_new_syntax, expr, lookup_qualified=lookup_qualified + ) + if isinstance(base, UnboundType): + if base.args: + raise TypeTranslationError() + if isinstance(expr.index, TupleExpr): + args = expr.index.items + else: + args = [expr.index] + + if isinstance(expr.base, RefExpr): + # Check if the type is Annotated[...]. For this we need the fullname, + # which must be looked up if the expression hasn't been semantically analyzed. + base_fullname = None + if lookup_qualified is not None: + sym = lookup_qualified(base.name, expr) + if sym and sym.node: + base_fullname = sym.node.fullname + else: + base_fullname = expr.base.fullname + + if base_fullname is not None and base_fullname in ANNOTATED_TYPE_NAMES: + # TODO: this is not the optimal solution as we are basically getting rid + # of the Annotation definition and only returning the type information, + # losing all the annotations. + return expr_to_unanalyzed_type( + args[0], options, allow_new_syntax, expr, lookup_qualified=lookup_qualified + ) + base.args = tuple( + expr_to_unanalyzed_type( + arg, + options, + allow_new_syntax, + expr, + allow_unpack=True, + lookup_qualified=lookup_qualified, + ) + for arg in args + ) + if not base.args: + base.empty_tuple_index = True + return base + else: + raise TypeTranslationError() + elif ( + isinstance(expr, OpExpr) + and expr.op == "|" + and ((options.python_version >= (3, 10)) or allow_new_syntax) + ): + return UnionType( + [ + expr_to_unanalyzed_type( + expr.left, options, allow_new_syntax, lookup_qualified=lookup_qualified + ), + expr_to_unanalyzed_type( + expr.right, options, allow_new_syntax, lookup_qualified=lookup_qualified + ), + ], + uses_pep604_syntax=True, + ) + elif isinstance(expr, CallExpr) and isinstance(_parent, ListExpr): + c = expr.callee + names = [] + # Go through the dotted member expr chain to get the full arg + # constructor name to look up + while True: + if isinstance(c, NameExpr): + names.append(c.name) + break + elif isinstance(c, MemberExpr): + names.append(c.name) + c = c.expr + else: + raise TypeTranslationError() + arg_const = ".".join(reversed(names)) + + # Go through the constructor args to get its name and type. + name = None + default_type = AnyType(TypeOfAny.unannotated) + typ: Type = default_type + for i, arg in enumerate(expr.args): + if expr.arg_names[i] is not None: + if expr.arg_names[i] == "name": + if name is not None: + # Two names + raise TypeTranslationError() + name = _extract_argument_name(arg) + continue + elif expr.arg_names[i] == "type": + if typ is not default_type: + # Two types + raise TypeTranslationError() + typ = expr_to_unanalyzed_type( + arg, options, allow_new_syntax, expr, lookup_qualified=lookup_qualified + ) + continue + else: + raise TypeTranslationError() + elif i == 0: + typ = expr_to_unanalyzed_type( + arg, options, allow_new_syntax, expr, lookup_qualified=lookup_qualified + ) + elif i == 1: + name = _extract_argument_name(arg) + else: + raise TypeTranslationError() + return CallableArgument(typ, name, arg_const, expr.line, expr.column) + elif isinstance(expr, ListExpr): + return TypeList( + [ + expr_to_unanalyzed_type( + t, + options, + allow_new_syntax, + expr, + allow_unpack=True, + lookup_qualified=lookup_qualified, + ) + for t in expr.items + ], + line=expr.line, + column=expr.column, + ) + elif isinstance(expr, StrExpr): + return parse_type_string(expr.value, "builtins.str", expr.line, expr.column) + elif isinstance(expr, BytesExpr): + return parse_type_string(expr.value, "builtins.bytes", expr.line, expr.column) + elif isinstance(expr, UnaryExpr): + typ = expr_to_unanalyzed_type( + expr.expr, options, allow_new_syntax, lookup_qualified=lookup_qualified + ) + if isinstance(typ, RawExpressionType): + if isinstance(typ.literal_value, int): + if expr.op == "-": + typ.literal_value *= -1 + return typ + elif expr.op == "+": + return typ + raise TypeTranslationError() + elif isinstance(expr, IntExpr): + return RawExpressionType(expr.value, "builtins.int", line=expr.line, column=expr.column) + elif isinstance(expr, FloatExpr): + # Floats are not valid parameters for RawExpressionType , so we just + # pass in 'None' for now. We'll report the appropriate error at a later stage. + return RawExpressionType(None, "builtins.float", line=expr.line, column=expr.column) + elif isinstance(expr, ComplexExpr): + # Same thing as above with complex numbers. + return RawExpressionType(None, "builtins.complex", line=expr.line, column=expr.column) + elif isinstance(expr, EllipsisExpr): + return EllipsisType(expr.line) + elif allow_unpack and isinstance(expr, StarExpr): + return UnpackType( + expr_to_unanalyzed_type( + expr.expr, options, allow_new_syntax, lookup_qualified=lookup_qualified + ), + from_star_syntax=True, + ) + elif isinstance(expr, DictExpr): + if not expr.items: + raise TypeTranslationError() + items: dict[str, Type] = {} + extra_items_from = [] + for item_name, value in expr.items: + if not isinstance(item_name, StrExpr): + if item_name is None: + extra_items_from.append( + expr_to_unanalyzed_type( + value, + options, + allow_new_syntax, + expr, + lookup_qualified=lookup_qualified, + ) + ) + continue + raise TypeTranslationError() + items[item_name.value] = expr_to_unanalyzed_type( + value, options, allow_new_syntax, expr, lookup_qualified=lookup_qualified + ) + result = TypedDictType( + items, set(), set(), Instance(MISSING_FALLBACK, ()), expr.line, expr.column + ) + result.extra_items_from = extra_items_from + return result + else: + raise TypeTranslationError() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/fastparse.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/fastparse.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..997fdad2ea32462447251aec31707e5ca216156d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/fastparse.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/fastparse.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/fastparse.py new file mode 100644 index 0000000000000000000000000000000000000000..e85b8fffaf9e970710589890cc59a2d17b042640 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/fastparse.py @@ -0,0 +1,2256 @@ +from __future__ import annotations + +import re +import sys +import warnings +from collections.abc import Callable, Sequence +from typing import Any, Final, Literal, TypeVar, cast, overload + +from mypy import defaults, errorcodes as codes, message_registry +from mypy.errors import Errors +from mypy.message_registry import ErrorMessage +from mypy.nodes import ( + ARG_NAMED, + ARG_NAMED_OPT, + ARG_OPT, + ARG_POS, + ARG_STAR, + ARG_STAR2, + MISSING_FALLBACK, + PARAM_SPEC_KIND, + TYPE_VAR_KIND, + TYPE_VAR_TUPLE_KIND, + ArgKind, + Argument, + AssertStmt, + AssignmentExpr, + AssignmentStmt, + AwaitExpr, + Block, + BreakStmt, + BytesExpr, + CallExpr, + ClassDef, + ComparisonExpr, + ComplexExpr, + ConditionalExpr, + ContinueStmt, + Decorator, + DelStmt, + DictExpr, + DictionaryComprehension, + EllipsisExpr, + Expression, + ExpressionStmt, + FloatExpr, + ForStmt, + FuncDef, + GeneratorExpr, + GlobalDecl, + IfStmt, + Import, + ImportAll, + ImportBase, + ImportFrom, + IndexExpr, + IntExpr, + LambdaExpr, + ListComprehension, + ListExpr, + MatchStmt, + MemberExpr, + MypyFile, + NameExpr, + Node, + NonlocalDecl, + OperatorAssignmentStmt, + OpExpr, + OverloadedFuncDef, + OverloadPart, + PassStmt, + RaiseStmt, + RefExpr, + ReturnStmt, + SetComprehension, + SetExpr, + SliceExpr, + StarExpr, + Statement, + StrExpr, + SuperExpr, + TemplateStrExpr, + TempNode, + TryStmt, + TupleExpr, + TypeAliasStmt, + TypeParam, + UnaryExpr, + Var, + WhileStmt, + WithStmt, + YieldExpr, + YieldFromExpr, + check_param_names, +) +from mypy.options import Options +from mypy.patterns import ( + AsPattern, + ClassPattern, + MappingPattern, + OrPattern, + SequencePattern, + SingletonPattern, + StarredPattern, + ValuePattern, +) +from mypy.reachability import infer_reachability_of_if_statement, mark_block_unreachable +from mypy.sharedparse import argument_elide_name, special_function_elide_names +from mypy.traverser import TraverserVisitor +from mypy.types import ( + AnyType, + CallableArgument, + CallableType, + EllipsisType, + Instance, + ProperType, + RawExpressionType, + TupleType, + Type, + TypedDictType, + TypeList, + TypeOfAny, + UnboundType, + UnionType, + UnpackType, +) +from mypy.util import bytes_to_human_readable_repr, unnamed_function + +# pull this into a final variable to make mypyc be quiet about the +# the default argument warning +PY_MINOR_VERSION: Final = sys.version_info[1] + +import ast as ast3 +from ast import AST, Attribute, Call, FunctionType, Name, Starred, UAdd, UnaryOp, USub + + +def ast3_parse( + source: str | bytes, filename: str, mode: str, feature_version: int = PY_MINOR_VERSION +) -> AST: + # Ignore warnings that look like: + # :1: SyntaxWarning: invalid escape sequence '\.' + # because `source` could be anything, including literals like r'(re\.match)' + with warnings.catch_warnings(): + warnings.simplefilter("ignore", SyntaxWarning) + return ast3.parse( + source, + filename, + mode, + type_comments=True, # This works the magic + feature_version=feature_version, + ) + + +AstNode = ast3.expr | ast3.stmt | ast3.pattern | ast3.ExceptHandler + +if sys.version_info >= (3, 11): + TryStar = ast3.TryStar +else: + TryStar = Any + +if sys.version_info >= (3, 12): + ast_TypeAlias = ast3.TypeAlias + ast_ParamSpec = ast3.ParamSpec + ast_TypeVar = ast3.TypeVar + ast_TypeVarTuple = ast3.TypeVarTuple +else: + ast_TypeAlias = Any + ast_ParamSpec = Any + ast_TypeVar = Any + ast_TypeVarTuple = Any + +if sys.version_info >= (3, 14): + ast_TemplateStr = ast3.TemplateStr + ast_Interpolation = ast3.Interpolation +else: + ast_TemplateStr = Any + ast_Interpolation = Any + +N = TypeVar("N", bound=Node) + +# There is no way to create reasonable fallbacks at this stage, +# they must be patched later. +_dummy_fallback: Final = Instance(MISSING_FALLBACK, [], -1) + +TYPE_IGNORE_PATTERN: Final = re.compile(r"[^#]*#\s*type:\s*ignore\s*(.*)") + + +def parse( + source: str | bytes, + fnam: str, + module: str | None, + errors: Errors, + options: Options | None = None, +) -> MypyFile: + """Parse a source file, without doing any semantic analysis. + + Return the parse tree. If errors is not provided, raise ParseError + on failure. Otherwise, use the errors object to report parse errors. + """ + ignore_errors = (options is not None and options.ignore_errors) or ( + fnam in errors.ignored_files + ) + # If errors are ignored, we can drop many function bodies to speed up type checking. + strip_function_bodies = ignore_errors and (options is None or not options.preserve_asts) + + if options is None: + options = Options() + errors.set_file(fnam, module, options=options) + is_stub_file = fnam.endswith(".pyi") + if is_stub_file: + feature_version = defaults.PYTHON3_VERSION[1] + if options.python_version[0] == 3 and options.python_version[1] > feature_version: + feature_version = options.python_version[1] + else: + assert options.python_version[0] >= 3 + feature_version = options.python_version[1] + try: + # Disable + # - deprecation warnings for 'invalid escape sequence' (Python 3.11 and below) + # - syntax warnings for 'invalid escape sequence' (3.12+) and 'return in finally' (3.14+) + with warnings.catch_warnings(): + warnings.filterwarnings("ignore", category=DeprecationWarning) + warnings.filterwarnings("ignore", category=SyntaxWarning) + ast = ast3_parse(source, fnam, "exec", feature_version=feature_version) + + tree = ASTConverter( + options=options, + is_stub=is_stub_file, + errors=errors, + strip_function_bodies=strip_function_bodies, + path=fnam, + ).visit(ast) + + except RecursionError as e: + # For very complex expressions it is possible to hit recursion limit + # before reaching a leaf node. + # Should reject at top level instead at bottom, since bottom would already + # be at the threshold of the recursion limit, and may fail again later. + # E.G. x1+x2+x3+...+xn -> BinOp(left=BinOp(left=BinOp(left=... + try: + # But to prove that is the cause of this particular recursion error, + # try to walk the tree using builtin visitor + ast3.NodeVisitor().visit(ast) + except RecursionError: + errors.report( + -1, -1, "Source expression too complex to parse", blocker=False, code=codes.MISC + ) + + tree = MypyFile([], [], False, {}) + + else: + # re-raise original recursion error if it *can* be unparsed, + # maybe this is some other issue that shouldn't be silenced/misdirected + raise e + + except SyntaxError as e: + message = e.msg + if feature_version > sys.version_info.minor and message.startswith("invalid syntax"): + python_version_str = f"{options.python_version[0]}.{options.python_version[1]}" + message += f"; you likely need to run mypy using Python {python_version_str} or newer" + errors.report( + e.lineno if e.lineno is not None else -1, + e.offset, + re.sub( + r"^(\s*\w)", lambda m: m.group(1).upper(), message + ), # Standardizing error message + blocker=True, + code=codes.SYNTAX, + ) + tree = MypyFile([], [], False, {}) + + assert isinstance(tree, MypyFile) + return tree + + +def parse_type_ignore_tag(tag: str | None) -> list[str] | None: + """Parse optional "[code, ...]" tag after "# type: ignore". + + Return: + * [] if no tag was found (ignore all errors) + * list of ignored error codes if a tag was found + * None if the tag was invalid. + """ + if not tag or tag.strip() == "" or tag.strip().startswith("#"): + # No tag -- ignore all errors. + return [] + m = re.match(r"\s*\[([^]#]*)\]\s*(#.*)?$", tag) + if m is None: + # Invalid "# type: ignore" comment. + return None + return [stripped_code for code in m.group(1).split(",") if (stripped_code := code.strip())] + + +def parse_type_comment( + type_comment: str, line: int, column: int, errors: Errors | None +) -> tuple[list[str] | None, ProperType | None]: + """Parse type portion of a type comment (+ optional type ignore). + + Return (ignore info, parsed type). + """ + try: + typ = ast3_parse(type_comment, "", "eval") + except SyntaxError: + if errors is not None: + stripped_type = type_comment.split("#", 2)[0].strip() + err_msg = message_registry.TYPE_COMMENT_SYNTAX_ERROR_VALUE.format(stripped_type) + errors.report(line, column, err_msg.value, blocker=True, code=err_msg.code) + return None, None + else: + raise + else: + extra_ignore = TYPE_IGNORE_PATTERN.match(type_comment) + if extra_ignore: + tag: str | None = extra_ignore.group(1) + ignored: list[str] | None = parse_type_ignore_tag(tag) + if ignored is None: + if errors is not None: + errors.report( + line, column, message_registry.INVALID_TYPE_IGNORE.value, code=codes.SYNTAX + ) + else: + raise SyntaxError + else: + ignored = None + assert isinstance(typ, ast3.Expression) + converted = TypeConverter( + errors, line=line, override_column=column, is_evaluated=False + ).visit(typ.body) + return ignored, converted + + +def parse_type_string( + expr_string: str, expr_fallback_name: str, line: int, column: int +) -> ProperType: + """Parses a type that was originally present inside of an explicit string. + + For example, suppose we have the type `Foo["blah"]`. We should parse the + string expression "blah" using this function. + """ + try: + _, node = parse_type_comment(f"({expr_string})", line=line, column=column, errors=None) + if isinstance(node, (UnboundType, UnionType)) and node.original_str_expr is None: + node.original_str_expr = expr_string + node.original_str_fallback = expr_fallback_name + return node + else: + return RawExpressionType(expr_string, expr_fallback_name, line, column) + except (SyntaxError, ValueError): + # Note: the parser will raise a `ValueError` instead of a SyntaxError if + # the string happens to contain things like \x00. + return RawExpressionType(expr_string, expr_fallback_name, line, column) + + +def is_no_type_check_decorator(expr: ast3.expr) -> bool: + if isinstance(expr, Name): + return expr.id == "no_type_check" + elif isinstance(expr, Attribute): + if isinstance(expr.value, Name): + return expr.value.id == "typing" and expr.attr == "no_type_check" + return False + + +def find_disallowed_expression_in_annotation_scope(expr: ast3.expr | None) -> ast3.expr | None: + if expr is None: + return None + for node in ast3.walk(expr): + if isinstance(node, (ast3.Yield, ast3.YieldFrom, ast3.NamedExpr, ast3.Await)): + return node + return None + + +class ASTConverter: + def __init__( + self, + options: Options, + is_stub: bool, + errors: Errors, + *, + strip_function_bodies: bool, + path: str, + ) -> None: + # 'C' for class, 'D' for function signature, 'F' for function, 'L' for lambda + self.class_and_function_stack: list[Literal["C", "D", "F", "L"]] = [] + self.imports: list[ImportBase] = [] + + self.options = options + self.is_stub = is_stub + self.errors = errors + self.strip_function_bodies = strip_function_bodies + self.path = path + + self.type_ignores: dict[int, list[str]] = {} + self.uses_template_strings = False + + # Cache of visit_X methods keyed by type of visited object + self.visitor_cache: dict[type, Callable[[AST | None], Any]] = {} + + def note(self, msg: str, line: int, column: int) -> None: + self.errors.report(line, column, msg, severity="note", code=codes.SYNTAX) + + def fail(self, msg: ErrorMessage, line: int, column: int, blocker: bool) -> None: + if blocker or not self.options.ignore_errors: + # Make sure self.errors reflects any type ignores that we have parsed + self.errors.set_file_ignored_lines( + self.path, self.type_ignores, self.options.ignore_errors + ) + self.errors.report(line, column, msg.value, blocker=blocker, code=msg.code) + + def fail_merge_overload(self, node: IfStmt) -> None: + self.fail( + message_registry.FAILED_TO_MERGE_OVERLOADS, + line=node.line, + column=node.column, + blocker=False, + ) + + def visit(self, node: AST | None) -> Any: + if node is None: + return None + typeobj = type(node) + visitor = self.visitor_cache.get(typeobj) + if visitor is None: + method = "visit_" + node.__class__.__name__ + visitor = getattr(self, method) + self.visitor_cache[typeobj] = visitor + + return visitor(node) + + def set_line(self, node: N, n: AstNode) -> N: + node.line = n.lineno + node.column = n.col_offset + node.end_line = n.end_lineno + node.end_column = n.end_col_offset + + return node + + def translate_opt_expr_list(self, l: Sequence[AST | None]) -> list[Expression | None]: + res: list[Expression | None] = [] + for e in l: + exp = self.visit(e) + res.append(exp) + return res + + def translate_expr_list(self, l: Sequence[AST]) -> list[Expression]: + return cast(list[Expression], self.translate_opt_expr_list(l)) + + def get_lineno(self, node: ast3.expr | ast3.stmt) -> int: + if ( + isinstance(node, (ast3.AsyncFunctionDef, ast3.ClassDef, ast3.FunctionDef)) + and node.decorator_list + ): + return node.decorator_list[0].lineno + return node.lineno + + def translate_stmt_list( + self, + stmts: Sequence[ast3.stmt], + *, + ismodule: bool = False, + can_strip: bool = False, + is_coroutine: bool = False, + ) -> list[Statement]: + # A "# type: ignore" comment before the first statement of a module + # ignores the whole module: + if ( + ismodule + and stmts + and self.type_ignores + and (first := min(self.type_ignores)) < self.get_lineno(stmts[0]) + ): + ignores = self.type_ignores.pop(first) + if ignores: + joined_ignores = ", ".join(ignores) + self.fail( + message_registry.TYPE_IGNORE_WITH_ERRCODE_ON_MODULE.format(joined_ignores), + line=first, + column=0, + blocker=False, + ) + block = Block(self.fix_function_overloads(self.translate_stmt_list(stmts))) + self.set_block_lines(block, stmts) + mark_block_unreachable(block) + return [block] + + stack = self.class_and_function_stack + # Fast case for stripping function bodies + if ( + can_strip + and self.strip_function_bodies + and len(stack) == 1 + and stack[0] == "F" + and not is_coroutine + ): + return [] + + res: list[Statement] = [] + for stmt in stmts: + node = self.visit(stmt) + res.append(node) + + # Slow case for stripping function bodies + if can_strip and self.strip_function_bodies: + if stack[-2:] == ["C", "F"]: + if is_possible_trivial_body(res): + can_strip = False + else: + # We only strip method bodies if they don't assign to an attribute, as + # this may define an attribute which has an externally visible effect. + visitor = FindAttributeAssign() + for s in res: + s.accept(visitor) + if visitor.found: + can_strip = False + break + + if can_strip and stack[-1] == "F" and is_coroutine: + # Yields inside an async function affect the return type and should not + # be stripped. + yield_visitor = FindYield() + for s in res: + s.accept(yield_visitor) + if yield_visitor.found: + can_strip = False + break + + if can_strip: + return [] + return res + + def translate_type_comment( + self, n: ast3.stmt | ast3.arg, type_comment: str | None + ) -> ProperType | None: + if type_comment is None: + return None + else: + lineno = n.lineno + extra_ignore, typ = parse_type_comment(type_comment, lineno, n.col_offset, self.errors) + if extra_ignore is not None: + self.type_ignores[lineno] = extra_ignore + return typ + + op_map: Final[dict[type[AST], str]] = { + ast3.Add: "+", + ast3.Sub: "-", + ast3.Mult: "*", + ast3.MatMult: "@", + ast3.Div: "/", + ast3.Mod: "%", + ast3.Pow: "**", + ast3.LShift: "<<", + ast3.RShift: ">>", + ast3.BitOr: "|", + ast3.BitXor: "^", + ast3.BitAnd: "&", + ast3.FloorDiv: "//", + } + + def from_operator(self, op: ast3.operator) -> str: + op_name = ASTConverter.op_map.get(type(op)) + if op_name is None: + raise RuntimeError("Unknown operator " + str(type(op))) + else: + return op_name + + comp_op_map: Final[dict[type[AST], str]] = { + ast3.Gt: ">", + ast3.Lt: "<", + ast3.Eq: "==", + ast3.GtE: ">=", + ast3.LtE: "<=", + ast3.NotEq: "!=", + ast3.Is: "is", + ast3.IsNot: "is not", + ast3.In: "in", + ast3.NotIn: "not in", # codespell:ignore notin + } + + def from_comp_operator(self, op: ast3.cmpop) -> str: + op_name = ASTConverter.comp_op_map.get(type(op)) + if op_name is None: + raise RuntimeError("Unknown comparison operator " + str(type(op))) + else: + return op_name + + def set_block_lines(self, b: Block, stmts: Sequence[ast3.stmt]) -> None: + first, last = stmts[0], stmts[-1] + b.line = first.lineno + b.column = first.col_offset + b.end_line = last.end_lineno + b.end_column = last.end_col_offset + if not b.body: + return + new_first = b.body[0] + if isinstance(new_first, (Decorator, OverloadedFuncDef)): + # Decorated function lines are different between Python versions. + # copy the normalization we do for them to block first lines. + b.line = new_first.line + b.column = new_first.column + + def as_block(self, stmts: list[ast3.stmt]) -> Block | None: + b = None + if stmts: + b = Block(self.fix_function_overloads(self.translate_stmt_list(stmts))) + self.set_block_lines(b, stmts) + return b + + def as_required_block( + self, stmts: list[ast3.stmt], *, can_strip: bool = False, is_coroutine: bool = False + ) -> Block: + assert stmts # must be non-empty + b = Block( + self.fix_function_overloads( + self.translate_stmt_list(stmts, can_strip=can_strip, is_coroutine=is_coroutine) + ) + ) + self.set_block_lines(b, stmts) + return b + + def fix_function_overloads(self, stmts: list[Statement]) -> list[Statement]: + ret: list[Statement] = [] + current_overload: list[OverloadPart] = [] + current_overload_name: str | None = None + last_unconditional_func_def: str | None = None + last_if_stmt: IfStmt | None = None + last_if_overload: Decorator | FuncDef | OverloadedFuncDef | None = None + last_if_stmt_overload_name: str | None = None + last_if_unknown_truth_value: IfStmt | None = None + skipped_if_stmts: list[IfStmt] = [] + for stmt in stmts: + if_overload_name: str | None = None + if_block_with_overload: Block | None = None + if_unknown_truth_value: IfStmt | None = None + if isinstance(stmt, IfStmt): + # Check IfStmt block to determine if function overloads can be merged + if_overload_name = self._check_ifstmt_for_overloads(stmt, current_overload_name) + if if_overload_name is not None: + if_block_with_overload, if_unknown_truth_value = ( + self._get_executable_if_block_with_overloads(stmt) + ) + + if ( + current_overload_name is not None + and isinstance(stmt, (Decorator, FuncDef)) + and stmt.name == current_overload_name + ): + if last_if_stmt is not None: + skipped_if_stmts.append(last_if_stmt) + if last_if_overload is not None: + # Last stmt was an IfStmt with same overload name + # Add overloads to current_overload + if isinstance(last_if_overload, OverloadedFuncDef): + current_overload.extend(last_if_overload.items) + else: + current_overload.append(last_if_overload) + last_if_stmt, last_if_overload = None, None + if last_if_unknown_truth_value: + self.fail_merge_overload(last_if_unknown_truth_value) + last_if_unknown_truth_value = None + current_overload.append(stmt) + if isinstance(stmt, FuncDef): + # This is, strictly speaking, wrong: there might be a decorated + # implementation. However, it only affects the error message we show: + # ideally it's "already defined", but "implementation must come last" + # is also reasonable. + # TODO: can we get rid of this completely and just always emit + # "implementation must come last" instead? + last_unconditional_func_def = stmt.name + elif ( + current_overload_name is not None + and isinstance(stmt, IfStmt) + and if_overload_name == current_overload_name + and last_unconditional_func_def != current_overload_name + ): + # IfStmt only contains stmts relevant to current_overload. + # Check if stmts are reachable and add them to current_overload, + # otherwise skip IfStmt to allow subsequent overload + # or function definitions. + skipped_if_stmts.append(stmt) + if if_block_with_overload is None: + if if_unknown_truth_value is not None: + self.fail_merge_overload(if_unknown_truth_value) + continue + if last_if_overload is not None: + # Last stmt was an IfStmt with same overload name + # Add overloads to current_overload + if isinstance(last_if_overload, OverloadedFuncDef): + current_overload.extend(last_if_overload.items) + else: + current_overload.append(last_if_overload) + last_if_stmt, last_if_overload = None, None + if isinstance(if_block_with_overload.body[-1], OverloadedFuncDef): + skipped_if_stmts.extend(cast(list[IfStmt], if_block_with_overload.body[:-1])) + current_overload.extend(if_block_with_overload.body[-1].items) + else: + current_overload.append( + cast(Decorator | FuncDef, if_block_with_overload.body[0]) + ) + else: + if last_if_stmt is not None: + ret.append(last_if_stmt) + last_if_stmt_overload_name = current_overload_name + last_if_stmt, last_if_overload = None, None + last_if_unknown_truth_value = None + + if current_overload and current_overload_name == last_if_stmt_overload_name: + # Remove last stmt (IfStmt) from ret if the overload names matched + # Only happens if no executable block had been found in IfStmt + popped = ret.pop() + assert isinstance(popped, IfStmt) + skipped_if_stmts.append(popped) + if current_overload and skipped_if_stmts: + # Add bare IfStmt (without overloads) to ret + # Required for mypy to be able to still check conditions + for if_stmt in skipped_if_stmts: + self._strip_contents_from_if_stmt(if_stmt) + ret.append(if_stmt) + skipped_if_stmts = [] + if len(current_overload) == 1: + ret.append(current_overload[0]) + elif len(current_overload) > 1: + ret.append(OverloadedFuncDef(current_overload)) + + # If we have multiple decorated functions named "_" next to each, we want to treat + # them as a series of regular FuncDefs instead of one OverloadedFuncDef because + # most of mypy/mypyc assumes that all the functions in an OverloadedFuncDef are + # related, but multiple underscore functions next to each other aren't necessarily + # related + last_unconditional_func_def = None + if isinstance(stmt, Decorator) and not unnamed_function(stmt.name): + current_overload = [stmt] + current_overload_name = stmt.name + elif isinstance(stmt, IfStmt) and if_overload_name is not None: + current_overload = [] + current_overload_name = if_overload_name + last_if_stmt = stmt + last_if_stmt_overload_name = None + if if_block_with_overload is not None: + skipped_if_stmts.extend( + cast(list[IfStmt], if_block_with_overload.body[:-1]) + ) + last_if_overload = cast( + Decorator | FuncDef | OverloadedFuncDef, + if_block_with_overload.body[-1], + ) + last_if_unknown_truth_value = if_unknown_truth_value + else: + current_overload = [] + current_overload_name = None + ret.append(stmt) + + if current_overload and skipped_if_stmts: + # Add bare IfStmt (without overloads) to ret + # Required for mypy to be able to still check conditions + for if_stmt in skipped_if_stmts: + self._strip_contents_from_if_stmt(if_stmt) + ret.append(if_stmt) + if len(current_overload) == 1: + ret.append(current_overload[0]) + elif len(current_overload) > 1: + ret.append(OverloadedFuncDef(current_overload)) + elif last_if_overload is not None: + ret.append(last_if_overload) + elif last_if_stmt is not None: + ret.append(last_if_stmt) + return ret + + def _check_ifstmt_for_overloads( + self, stmt: IfStmt, current_overload_name: str | None = None + ) -> str | None: + """Check if IfStmt contains only overloads with the same name. + Return overload_name if found, None otherwise. + """ + # Check that block only contains a single Decorator, FuncDef, or OverloadedFuncDef. + # Multiple overloads have already been merged as OverloadedFuncDef. + if not ( + len(stmt.body[0].body) == 1 + and ( + isinstance(stmt.body[0].body[0], (Decorator, OverloadedFuncDef)) + or current_overload_name is not None + and isinstance(stmt.body[0].body[0], FuncDef) + ) + or len(stmt.body[0].body) > 1 + and isinstance(stmt.body[0].body[-1], OverloadedFuncDef) + and all(self._is_stripped_if_stmt(if_stmt) for if_stmt in stmt.body[0].body[:-1]) + ): + return None + + overload_name = cast(Decorator | FuncDef | OverloadedFuncDef, stmt.body[0].body[-1]).name + if stmt.else_body is None: + return overload_name + + if len(stmt.else_body.body) == 1: + # For elif: else_body contains an IfStmt itself -> do a recursive check. + if ( + isinstance(stmt.else_body.body[0], (Decorator, FuncDef, OverloadedFuncDef)) + and stmt.else_body.body[0].name == overload_name + ): + return overload_name + if ( + isinstance(stmt.else_body.body[0], IfStmt) + and self._check_ifstmt_for_overloads(stmt.else_body.body[0], current_overload_name) + == overload_name + ): + return overload_name + + return None + + def _get_executable_if_block_with_overloads( + self, stmt: IfStmt + ) -> tuple[Block | None, IfStmt | None]: + """Return block from IfStmt that will get executed. + + Return + 0 -> A block if sure that alternative blocks are unreachable. + 1 -> An IfStmt if the reachability of it can't be inferred, + i.e. the truth value is unknown. + """ + infer_reachability_of_if_statement(stmt, self.options) + if stmt.else_body is None and stmt.body[0].is_unreachable is True: + # always False condition with no else + return None, None + if ( + stmt.else_body is None + or stmt.body[0].is_unreachable is False + and stmt.else_body.is_unreachable is False + ): + # The truth value is unknown, thus not conclusive + return None, stmt + if stmt.else_body.is_unreachable is True: + # else_body will be set unreachable if condition is always True + return stmt.body[0], None + if stmt.body[0].is_unreachable is True: + # body will be set unreachable if condition is always False + # else_body can contain an IfStmt itself (for elif) -> do a recursive check + if isinstance(stmt.else_body.body[0], IfStmt): + return self._get_executable_if_block_with_overloads(stmt.else_body.body[0]) + return stmt.else_body, None + return None, stmt + + def _strip_contents_from_if_stmt(self, stmt: IfStmt) -> None: + """Remove contents from IfStmt. + + Needed to still be able to check the conditions after the contents + have been merged with the surrounding function overloads. + """ + if len(stmt.body) == 1: + stmt.body[0].body = [] + if stmt.else_body and len(stmt.else_body.body) == 1: + if isinstance(stmt.else_body.body[0], IfStmt): + self._strip_contents_from_if_stmt(stmt.else_body.body[0]) + else: + stmt.else_body.body = [] + + def _is_stripped_if_stmt(self, stmt: Statement) -> bool: + """Check stmt to make sure it is a stripped IfStmt. + + See also: _strip_contents_from_if_stmt + """ + if not isinstance(stmt, IfStmt): + return False + + if not (len(stmt.body) == 1 and len(stmt.body[0].body) == 0): + # Body not empty + return False + + if not stmt.else_body or len(stmt.else_body.body) == 0: + # No or empty else_body + return True + + # For elif, IfStmt are stored recursively in else_body + return self._is_stripped_if_stmt(stmt.else_body.body[0]) + + def translate_module_id(self, id: str) -> str: + """Return the actual, internal module id for a source text id.""" + if id == self.options.custom_typing_module: + return "typing" + return id + + def visit_Module(self, mod: ast3.Module) -> MypyFile: + self.type_ignores = {} + self.uses_template_strings = False + for ti in mod.type_ignores: + parsed = parse_type_ignore_tag(ti.tag) + if parsed is not None: + self.type_ignores[ti.lineno] = parsed + else: + self.fail(message_registry.INVALID_TYPE_IGNORE, ti.lineno, -1, blocker=False) + + body = self.fix_function_overloads(self.translate_stmt_list(mod.body, ismodule=True)) + + ret = MypyFile(body, self.imports, False, ignored_lines=self.type_ignores) + ret.is_stub = self.is_stub + ret.path = self.path + ret.uses_template_strings = self.uses_template_strings + return ret + + # --- stmt --- + # FunctionDef(identifier name, arguments args, + # stmt* body, expr* decorator_list, expr? returns, string? type_comment) + # arguments = (arg* args, arg? vararg, arg* kwonlyargs, expr* kw_defaults, + # arg? kwarg, expr* defaults) + def visit_FunctionDef(self, n: ast3.FunctionDef) -> FuncDef | Decorator: + return self.do_func_def(n) + + # AsyncFunctionDef(identifier name, arguments args, + # stmt* body, expr* decorator_list, expr? returns, string? type_comment) + def visit_AsyncFunctionDef(self, n: ast3.AsyncFunctionDef) -> FuncDef | Decorator: + return self.do_func_def(n, is_coroutine=True) + + def do_func_def( + self, n: ast3.FunctionDef | ast3.AsyncFunctionDef, is_coroutine: bool = False + ) -> FuncDef | Decorator: + """Helper shared between visit_FunctionDef and visit_AsyncFunctionDef.""" + self.class_and_function_stack.append("D") + no_type_check = bool( + n.decorator_list and any(is_no_type_check_decorator(d) for d in n.decorator_list) + ) + + lineno = n.lineno + args = self.transform_args(n.args, lineno, no_type_check=no_type_check) + if self.options.pos_only_special_methods and special_function_elide_names(n.name): + for arg in args: + arg.pos_only = True + + arg_kinds = [arg.kind for arg in args] + arg_names = [None if arg.pos_only else arg.variable.name for arg in args] + # Type parameters, if using new syntax for generics (PEP 695) + explicit_type_params: list[TypeParam] | None = None + + arg_types: list[Type | None] = [] + if no_type_check: + arg_types = [None] * len(args) + return_type = None + elif n.type_comment is not None: + try: + func_type_ast = ast3_parse(n.type_comment, "", "func_type") + assert isinstance(func_type_ast, FunctionType) + # for ellipsis arg + if ( + len(func_type_ast.argtypes) == 1 + and isinstance(func_type_ast.argtypes[0], ast3.Constant) + and func_type_ast.argtypes[0].value is Ellipsis + ): + if n.returns: + # PEP 484 disallows both type annotations and type comments + self.fail( + message_registry.DUPLICATE_TYPE_SIGNATURES, + lineno, + n.col_offset, + blocker=False, + ) + arg_types = [ + ( + a.type_annotation + if a.type_annotation is not None + else AnyType(TypeOfAny.unannotated) + ) + for a in args + ] + else: + # PEP 484 disallows both type annotations and type comments + if n.returns or any(a.type_annotation is not None for a in args): + self.fail( + message_registry.DUPLICATE_TYPE_SIGNATURES, + lineno, + n.col_offset, + blocker=False, + ) + translated_args: list[Type] = TypeConverter( + self.errors, line=lineno, override_column=n.col_offset + ).translate_expr_list(func_type_ast.argtypes) + # Use a cast to work around `list` invariance + arg_types = cast(list[Type | None], translated_args) + return_type = TypeConverter(self.errors, line=lineno).visit(func_type_ast.returns) + + # add implicit self type + in_method_scope = self.class_and_function_stack[-2:] == ["C", "D"] + if in_method_scope and len(arg_types) < len(args): + arg_types.insert(0, AnyType(TypeOfAny.special_form)) + except SyntaxError: + stripped_type = n.type_comment.split("#", 2)[0].strip() + err_msg = message_registry.TYPE_COMMENT_SYNTAX_ERROR_VALUE.format(stripped_type) + self.fail(err_msg, lineno, n.col_offset, blocker=False) + if n.type_comment and n.type_comment[0] not in ["(", "#"]: + self.note( + "Suggestion: wrap argument types in parentheses", lineno, n.col_offset + ) + arg_types = [AnyType(TypeOfAny.from_error)] * len(args) + return_type = AnyType(TypeOfAny.from_error) + else: + if sys.version_info >= (3, 12) and n.type_params: + explicit_type_params = self.translate_type_params(n.type_params) + + arg_types = [a.type_annotation for a in args] + return_type = TypeConverter( + self.errors, line=n.returns.lineno if n.returns else lineno + ).visit(n.returns) + + for arg, arg_type in zip(args, arg_types): + self.set_type_optional(arg_type, arg.initializer) + + func_type = None + if any(arg_types) or return_type: + if len(arg_types) != 1 and any(isinstance(t, EllipsisType) for t in arg_types): + self.fail( + message_registry.ELLIPSIS_WITH_OTHER_TYPEPARAMS, + lineno, + n.col_offset, + blocker=False, + ) + elif len(arg_types) > len(arg_kinds): + self.fail( + message_registry.TYPE_SIGNATURE_TOO_MANY_PARAMS, + lineno, + n.col_offset, + blocker=False, + ) + elif len(arg_types) < len(arg_kinds): + self.fail( + message_registry.TYPE_SIGNATURE_TOO_FEW_PARAMS, + lineno, + n.col_offset, + blocker=False, + ) + else: + func_type = CallableType( + [a if a is not None else AnyType(TypeOfAny.unannotated) for a in arg_types], + arg_kinds, + arg_names, + return_type if return_type is not None else AnyType(TypeOfAny.unannotated), + _dummy_fallback, + ) + + # End position is always the same. + end_line = n.end_lineno + end_column = n.end_col_offset + + self.class_and_function_stack.pop() + self.class_and_function_stack.append("F") + body = self.as_required_block(n.body, can_strip=True, is_coroutine=is_coroutine) + func_def = FuncDef(n.name, args, body, func_type, explicit_type_params) + if isinstance(func_def.type, CallableType): + # semanal.py does some in-place modifications we want to avoid + func_def.unanalyzed_type = func_def.type.copy_modified() + if is_coroutine: + func_def.is_coroutine = True + if func_type is not None: + func_type.definition = func_def + func_type.set_line(lineno) + + if n.decorator_list: + var = Var(func_def.name) + var.is_ready = False + var.set_line(lineno) + + func_def.is_decorated = True + self.set_line(func_def, n) + + deco = Decorator(func_def, self.translate_expr_list(n.decorator_list), var) + first = n.decorator_list[0] + deco.set_line(first.lineno, first.col_offset, end_line, end_column) + retval: FuncDef | Decorator = deco + else: + self.set_line(func_def, n) + retval = func_def + if self.options.include_docstrings: + func_def.docstring = ast3.get_docstring(n, clean=False) + self.class_and_function_stack.pop() + return retval + + def set_type_optional(self, type: Type | None, initializer: Expression | None) -> None: + if not self.options.implicit_optional: + return + # Indicate that type should be wrapped in an Optional if arg is initialized to None. + optional = isinstance(initializer, NameExpr) and initializer.name == "None" + if isinstance(type, UnboundType): + type.optional = optional + + def transform_args( + self, args: ast3.arguments, line: int, no_type_check: bool = False + ) -> list[Argument]: + new_args = [] + names: list[ast3.arg] = [] + posonlyargs = args.posonlyargs + args_args = posonlyargs + args.args + args_defaults = args.defaults + num_no_defaults = len(args_args) - len(args_defaults) + # positional arguments without defaults + for i, a in enumerate(args_args[:num_no_defaults]): + pos_only = i < len(posonlyargs) + new_args.append(self.make_argument(a, None, ARG_POS, no_type_check, pos_only)) + names.append(a) + + # positional arguments with defaults + for i, (a, d) in enumerate(zip(args_args[num_no_defaults:], args_defaults)): + pos_only = num_no_defaults + i < len(posonlyargs) + new_args.append(self.make_argument(a, d, ARG_OPT, no_type_check, pos_only)) + names.append(a) + + # *arg + if args.vararg is not None: + new_args.append(self.make_argument(args.vararg, None, ARG_STAR, no_type_check)) + names.append(args.vararg) + + # keyword-only arguments with defaults + for a, kd in zip(args.kwonlyargs, args.kw_defaults): + new_args.append( + self.make_argument( + a, kd, ARG_NAMED if kd is None else ARG_NAMED_OPT, no_type_check + ) + ) + names.append(a) + + # **kwarg + if args.kwarg is not None: + new_args.append(self.make_argument(args.kwarg, None, ARG_STAR2, no_type_check)) + names.append(args.kwarg) + + check_param_names([arg.variable.name for arg in new_args], names, self.fail_arg) + + return new_args + + def make_argument( + self, + arg: ast3.arg, + default: ast3.expr | None, + kind: ArgKind, + no_type_check: bool, + pos_only: bool = False, + ) -> Argument: + if no_type_check: + arg_type = None + else: + annotation = arg.annotation + type_comment = arg.type_comment + if annotation is not None and type_comment is not None: + self.fail( + message_registry.DUPLICATE_TYPE_SIGNATURES, + arg.lineno, + arg.col_offset, + blocker=False, + ) + arg_type = None + if annotation is not None: + arg_type = TypeConverter(self.errors, line=arg.lineno).visit(annotation) + else: + arg_type = self.translate_type_comment(arg, type_comment) + if argument_elide_name(arg.arg): + pos_only = True + + var = Var(arg.arg, arg_type) + var.is_inferred = False + var.is_argument = True + argument = Argument(var, arg_type, self.visit(default), kind, pos_only) + argument.set_line(arg.lineno, arg.col_offset, arg.end_lineno, arg.end_col_offset) + return argument + + def fail_arg(self, msg: str, arg: ast3.arg) -> None: + self.fail(ErrorMessage(msg), arg.lineno, arg.col_offset, blocker=True) + + # ClassDef(identifier name, + # expr* bases, + # keyword* keywords, + # stmt* body, + # expr* decorator_list) + def visit_ClassDef(self, n: ast3.ClassDef) -> ClassDef: + self.class_and_function_stack.append("C") + keywords = [(kw.arg, self.visit(kw.value)) for kw in n.keywords if kw.arg] + + # Type parameters, if using new syntax for generics (PEP 695) + explicit_type_params: list[TypeParam] | None = None + + if sys.version_info >= (3, 12) and n.type_params: + explicit_type_params = self.translate_type_params(n.type_params) + + cdef = ClassDef( + n.name, + self.as_required_block(n.body), + None, + self.translate_expr_list(n.bases), + metaclass=dict(keywords).get("metaclass"), + keywords=keywords, + type_args=explicit_type_params, + ) + cdef.decorators = self.translate_expr_list(n.decorator_list) + self.set_line(cdef, n) + + if self.options.include_docstrings: + cdef.docstring = ast3.get_docstring(n, clean=False) + cdef.column = n.col_offset + cdef.end_line = n.end_lineno + cdef.end_column = n.end_col_offset + self.class_and_function_stack.pop() + return cdef + + def validate_type_param(self, type_param: ast_TypeVar) -> None: + incorrect_expr = find_disallowed_expression_in_annotation_scope(type_param.bound) + if incorrect_expr is None: + return + if isinstance(incorrect_expr, (ast3.Yield, ast3.YieldFrom)): + self.fail( + message_registry.TYPE_VAR_YIELD_EXPRESSION_IN_BOUND, + type_param.lineno, + type_param.col_offset, + blocker=True, + ) + if isinstance(incorrect_expr, ast3.NamedExpr): + self.fail( + message_registry.TYPE_VAR_NAMED_EXPRESSION_IN_BOUND, + type_param.lineno, + type_param.col_offset, + blocker=True, + ) + if isinstance(incorrect_expr, ast3.Await): + self.fail( + message_registry.TYPE_VAR_AWAIT_EXPRESSION_IN_BOUND, + type_param.lineno, + type_param.col_offset, + blocker=True, + ) + + def translate_type_params(self, type_params: list[Any]) -> list[TypeParam]: + explicit_type_params = [] + for p in type_params: + bound: Type | None = None + values: list[Type] = [] + default: Type | None = None + if sys.version_info >= (3, 13): + default = TypeConverter(self.errors, line=p.lineno).visit(p.default_value) + if isinstance(p, ast_ParamSpec): # type: ignore[misc] + explicit_type_params.append(TypeParam(p.name, PARAM_SPEC_KIND, None, [], default)) + elif isinstance(p, ast_TypeVarTuple): # type: ignore[misc] + explicit_type_params.append( + TypeParam(p.name, TYPE_VAR_TUPLE_KIND, None, [], default) + ) + else: + if isinstance(p.bound, ast3.Tuple): + if len(p.bound.elts) < 2: + self.fail( + message_registry.TYPE_VAR_TOO_FEW_CONSTRAINED_TYPES, + p.lineno, + p.col_offset, + blocker=False, + ) + else: + conv = TypeConverter(self.errors, line=p.lineno) + values = [conv.visit(t) for t in p.bound.elts] + elif p.bound is not None: + self.validate_type_param(p) + bound = TypeConverter(self.errors, line=p.lineno).visit(p.bound) + explicit_type_params.append( + TypeParam(p.name, TYPE_VAR_KIND, bound, values, default) + ) + return explicit_type_params + + # Return(expr? value) + def visit_Return(self, n: ast3.Return) -> ReturnStmt: + node = ReturnStmt(self.visit(n.value)) + return self.set_line(node, n) + + # Delete(expr* targets) + def visit_Delete(self, n: ast3.Delete) -> DelStmt: + if len(n.targets) > 1: + tup = TupleExpr(self.translate_expr_list(n.targets)) + tup.set_line(n.lineno) + node = DelStmt(tup) + else: + node = DelStmt(self.visit(n.targets[0])) + return self.set_line(node, n) + + # Assign(expr* targets, expr? value, string? type_comment, expr? annotation) + def visit_Assign(self, n: ast3.Assign) -> AssignmentStmt: + lvalues = self.translate_expr_list(n.targets) + rvalue = self.visit(n.value) + typ = self.translate_type_comment(n, n.type_comment) + s = AssignmentStmt(lvalues, rvalue, type=typ, new_syntax=False) + return self.set_line(s, n) + + # AnnAssign(expr target, expr annotation, expr? value, int simple) + def visit_AnnAssign(self, n: ast3.AnnAssign) -> AssignmentStmt: + line = n.lineno + if n.value is None: # always allow 'x: int' + rvalue: Expression = TempNode(AnyType(TypeOfAny.special_form), no_rhs=True) + self.set_line(rvalue, n) + else: + rvalue = self.visit(n.value) + typ = TypeConverter(self.errors, line=line).visit(n.annotation) + assert typ is not None + typ.column = n.annotation.col_offset + s = AssignmentStmt([self.visit(n.target)], rvalue, type=typ, new_syntax=True) + return self.set_line(s, n) + + # AugAssign(expr target, operator op, expr value) + def visit_AugAssign(self, n: ast3.AugAssign) -> OperatorAssignmentStmt: + s = OperatorAssignmentStmt( + self.from_operator(n.op), self.visit(n.target), self.visit(n.value) + ) + return self.set_line(s, n) + + # For(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment) + def visit_For(self, n: ast3.For) -> ForStmt: + target_type = self.translate_type_comment(n, n.type_comment) + node = ForStmt( + self.visit(n.target), + self.visit(n.iter), + self.as_required_block(n.body), + self.as_block(n.orelse), + target_type, + ) + return self.set_line(node, n) + + # AsyncFor(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment) + def visit_AsyncFor(self, n: ast3.AsyncFor) -> ForStmt: + target_type = self.translate_type_comment(n, n.type_comment) + node = ForStmt( + self.visit(n.target), + self.visit(n.iter), + self.as_required_block(n.body), + self.as_block(n.orelse), + target_type, + ) + node.is_async = True + return self.set_line(node, n) + + # While(expr test, stmt* body, stmt* orelse) + def visit_While(self, n: ast3.While) -> WhileStmt: + node = WhileStmt( + self.visit(n.test), self.as_required_block(n.body), self.as_block(n.orelse) + ) + return self.set_line(node, n) + + # If(expr test, stmt* body, stmt* orelse) + def visit_If(self, n: ast3.If) -> IfStmt: + node = IfStmt( + [self.visit(n.test)], [self.as_required_block(n.body)], self.as_block(n.orelse) + ) + return self.set_line(node, n) + + # With(withitem* items, stmt* body, string? type_comment) + def visit_With(self, n: ast3.With) -> WithStmt: + target_type = self.translate_type_comment(n, n.type_comment) + node = WithStmt( + [self.visit(i.context_expr) for i in n.items], + [self.visit(i.optional_vars) for i in n.items], + self.as_required_block(n.body), + target_type, + ) + return self.set_line(node, n) + + # AsyncWith(withitem* items, stmt* body, string? type_comment) + def visit_AsyncWith(self, n: ast3.AsyncWith) -> WithStmt: + target_type = self.translate_type_comment(n, n.type_comment) + s = WithStmt( + [self.visit(i.context_expr) for i in n.items], + [self.visit(i.optional_vars) for i in n.items], + self.as_required_block(n.body), + target_type, + ) + s.is_async = True + return self.set_line(s, n) + + # Raise(expr? exc, expr? cause) + def visit_Raise(self, n: ast3.Raise) -> RaiseStmt: + node = RaiseStmt(self.visit(n.exc), self.visit(n.cause)) + return self.set_line(node, n) + + # Try(stmt* body, excepthandler* handlers, stmt* orelse, stmt* finalbody) + def visit_Try(self, n: ast3.Try) -> TryStmt: + vs = [ + self.set_line(NameExpr(h.name), h) if h.name is not None else None for h in n.handlers + ] + types = [self.visit(h.type) for h in n.handlers] + handlers = [self.as_required_block(h.body) for h in n.handlers] + + node = TryStmt( + self.as_required_block(n.body), + vs, + types, + handlers, + self.as_block(n.orelse), + self.as_block(n.finalbody), + ) + return self.set_line(node, n) + + def visit_TryStar(self, n: TryStar) -> TryStmt: + vs = [ + self.set_line(NameExpr(h.name), h) if h.name is not None else None for h in n.handlers + ] + types = [self.visit(h.type) for h in n.handlers] + handlers = [self.as_required_block(h.body) for h in n.handlers] + + node = TryStmt( + self.as_required_block(n.body), + vs, + types, + handlers, + self.as_block(n.orelse), + self.as_block(n.finalbody), + ) + node.is_star = True + return self.set_line(node, n) + + # Assert(expr test, expr? msg) + def visit_Assert(self, n: ast3.Assert) -> AssertStmt: + node = AssertStmt(self.visit(n.test), self.visit(n.msg)) + return self.set_line(node, n) + + # Import(alias* names) + def visit_Import(self, n: ast3.Import) -> Import: + names: list[tuple[str, str | None]] = [] + for alias in n.names: + name = self.translate_module_id(alias.name) + asname = alias.asname + if asname is None and name != alias.name: + # if the module name has been translated (and it's not already + # an explicit import-as), make it an implicit import-as the + # original name + asname = alias.name + names.append((name, asname)) + i = Import(names) + self.imports.append(i) + return self.set_line(i, n) + + # ImportFrom(identifier? module, alias* names, int? level) + def visit_ImportFrom(self, n: ast3.ImportFrom) -> ImportBase: + assert n.level is not None + if len(n.names) == 1 and n.names[0].name == "*": + mod = n.module if n.module is not None else "" + i: ImportBase = ImportAll(mod, n.level) + else: + i = ImportFrom( + self.translate_module_id(n.module) if n.module is not None else "", + n.level, + [(a.name, a.asname) for a in n.names], + ) + self.imports.append(i) + return self.set_line(i, n) + + # Global(identifier* names) + def visit_Global(self, n: ast3.Global) -> GlobalDecl: + g = GlobalDecl(n.names) + return self.set_line(g, n) + + # Nonlocal(identifier* names) + def visit_Nonlocal(self, n: ast3.Nonlocal) -> NonlocalDecl: + d = NonlocalDecl(n.names) + return self.set_line(d, n) + + # Expr(expr value) + def visit_Expr(self, n: ast3.Expr) -> ExpressionStmt: + value = self.visit(n.value) + node = ExpressionStmt(value) + return self.set_line(node, n) + + # Pass + def visit_Pass(self, n: ast3.Pass) -> PassStmt: + s = PassStmt() + return self.set_line(s, n) + + # Break + def visit_Break(self, n: ast3.Break) -> BreakStmt: + s = BreakStmt() + return self.set_line(s, n) + + # Continue + def visit_Continue(self, n: ast3.Continue) -> ContinueStmt: + s = ContinueStmt() + return self.set_line(s, n) + + # --- expr --- + + def visit_NamedExpr(self, n: ast3.NamedExpr) -> AssignmentExpr: + s = AssignmentExpr(self.visit(n.target), self.visit(n.value)) + return self.set_line(s, n) + + # BoolOp(boolop op, expr* values) + def visit_BoolOp(self, n: ast3.BoolOp) -> OpExpr: + # mypy translates (1 and 2 and 3) as (1 and (2 and 3)) + assert len(n.values) >= 2 + op_node = n.op + if isinstance(op_node, ast3.And): + op = "and" + elif isinstance(op_node, ast3.Or): + op = "or" + else: + raise RuntimeError("unknown BoolOp " + str(type(n))) + + # potentially inefficient! + return self.group(op, self.translate_expr_list(n.values), n) + + def group(self, op: str, vals: list[Expression], n: ast3.expr) -> OpExpr: + if len(vals) == 2: + e = OpExpr(op, vals[0], vals[1]) + else: + e = OpExpr(op, vals[0], self.group(op, vals[1:], n)) + return self.set_line(e, n) + + # BinOp(expr left, operator op, expr right) + def visit_BinOp(self, n: ast3.BinOp) -> OpExpr: + op = self.from_operator(n.op) + + if op is None: + raise RuntimeError("cannot translate BinOp " + str(type(n.op))) + + e = OpExpr(op, self.visit(n.left), self.visit(n.right)) + return self.set_line(e, n) + + # UnaryOp(unaryop op, expr operand) + def visit_UnaryOp(self, n: ast3.UnaryOp) -> UnaryExpr: + op = None + if isinstance(n.op, ast3.Invert): + op = "~" + elif isinstance(n.op, ast3.Not): + op = "not" + elif isinstance(n.op, ast3.UAdd): + op = "+" + elif isinstance(n.op, ast3.USub): + op = "-" + + if op is None: + raise RuntimeError("cannot translate UnaryOp " + str(type(n.op))) + + e = UnaryExpr(op, self.visit(n.operand)) + return self.set_line(e, n) + + # Lambda(arguments args, expr body) + def visit_Lambda(self, n: ast3.Lambda) -> LambdaExpr: + body = ast3.Return(n.body) + body.lineno = n.body.lineno + body.col_offset = n.body.col_offset + + self.class_and_function_stack.append("L") + e = LambdaExpr(self.transform_args(n.args, n.lineno), self.as_required_block([body])) + self.class_and_function_stack.pop() + e.set_line(n.lineno, n.col_offset) # Overrides set_line -- can't use self.set_line + return e + + # IfExp(expr test, expr body, expr orelse) + def visit_IfExp(self, n: ast3.IfExp) -> ConditionalExpr: + e = ConditionalExpr(self.visit(n.test), self.visit(n.body), self.visit(n.orelse)) + return self.set_line(e, n) + + # Dict(expr* keys, expr* values) + def visit_Dict(self, n: ast3.Dict) -> DictExpr: + e = DictExpr( + list(zip(self.translate_opt_expr_list(n.keys), self.translate_expr_list(n.values))) + ) + return self.set_line(e, n) + + # Set(expr* elts) + def visit_Set(self, n: ast3.Set) -> SetExpr: + e = SetExpr(self.translate_expr_list(n.elts)) + return self.set_line(e, n) + + # ListComp(expr elt, comprehension* generators) + def visit_ListComp(self, n: ast3.ListComp) -> ListComprehension: + e = ListComprehension(self.visit_GeneratorExp(cast(ast3.GeneratorExp, n))) + return self.set_line(e, n) + + # SetComp(expr elt, comprehension* generators) + def visit_SetComp(self, n: ast3.SetComp) -> SetComprehension: + e = SetComprehension(self.visit_GeneratorExp(cast(ast3.GeneratorExp, n))) + return self.set_line(e, n) + + # DictComp(expr key, expr value, comprehension* generators) + def visit_DictComp(self, n: ast3.DictComp) -> DictionaryComprehension: + targets = [self.visit(c.target) for c in n.generators] + iters = [self.visit(c.iter) for c in n.generators] + ifs_list = [self.translate_expr_list(c.ifs) for c in n.generators] + is_async = [bool(c.is_async) for c in n.generators] + e = DictionaryComprehension( + self.visit(n.key), self.visit(n.value), targets, iters, ifs_list, is_async + ) + return self.set_line(e, n) + + # GeneratorExp(expr elt, comprehension* generators) + def visit_GeneratorExp(self, n: ast3.GeneratorExp) -> GeneratorExpr: + targets = [self.visit(c.target) for c in n.generators] + iters = [self.visit(c.iter) for c in n.generators] + ifs_list = [self.translate_expr_list(c.ifs) for c in n.generators] + is_async = [bool(c.is_async) for c in n.generators] + e = GeneratorExpr(self.visit(n.elt), targets, iters, ifs_list, is_async) + return self.set_line(e, n) + + # Await(expr value) + def visit_Await(self, n: ast3.Await) -> AwaitExpr: + v = self.visit(n.value) + e = AwaitExpr(v) + return self.set_line(e, n) + + # Yield(expr? value) + def visit_Yield(self, n: ast3.Yield) -> YieldExpr: + e = YieldExpr(self.visit(n.value)) + return self.set_line(e, n) + + # YieldFrom(expr value) + def visit_YieldFrom(self, n: ast3.YieldFrom) -> YieldFromExpr: + e = YieldFromExpr(self.visit(n.value)) + return self.set_line(e, n) + + # Compare(expr left, cmpop* ops, expr* comparators) + def visit_Compare(self, n: ast3.Compare) -> ComparisonExpr: + operators = [self.from_comp_operator(o) for o in n.ops] + operands = self.translate_expr_list([n.left] + n.comparators) + e = ComparisonExpr(operators, operands) + return self.set_line(e, n) + + # Call(expr func, expr* args, keyword* keywords) + # keyword = (identifier? arg, expr value) + def visit_Call(self, n: Call) -> CallExpr: + args = n.args + keywords = n.keywords + keyword_names = [k.arg for k in keywords] + arg_types = self.translate_expr_list( + [a.value if isinstance(a, Starred) else a for a in args] + [k.value for k in keywords] + ) + arg_kinds = [ARG_STAR if type(a) is Starred else ARG_POS for a in args] + [ + ARG_STAR2 if arg is None else ARG_NAMED for arg in keyword_names + ] + e = CallExpr( + self.visit(n.func), + arg_types, + arg_kinds, + cast("list[str | None]", [None] * len(args)) + keyword_names, + ) + return self.set_line(e, n) + + # Constant(object value) + def visit_Constant(self, n: ast3.Constant) -> Any: + val = n.value + e: Any = None + if val is None: + e = NameExpr("None") + elif isinstance(val, str): + e = StrExpr(val) + elif isinstance(val, bytes): + e = BytesExpr(bytes_to_human_readable_repr(val)) + elif isinstance(val, bool): # Must check before int! + e = NameExpr(str(val)) + elif isinstance(val, int): + e = IntExpr(val) + elif isinstance(val, float): + e = FloatExpr(val) + elif isinstance(val, complex): + e = ComplexExpr(val) + elif val is Ellipsis: + e = EllipsisExpr() + else: + raise RuntimeError("Constant not implemented for " + str(type(val))) + return self.set_line(e, n) + + # JoinedStr(expr* values) + def visit_JoinedStr(self, n: ast3.JoinedStr) -> Expression: + # Each of n.values is a str or FormattedValue; we just concatenate + # them all using ''.join. + empty_string = StrExpr("") + empty_string.set_line(n.lineno, n.col_offset) + strs_to_join = ListExpr(self.translate_expr_list(n.values)) + strs_to_join.set_line(empty_string) + # Don't make unnecessary join call if there is only one str to join + if len(strs_to_join.items) == 1: + return self.set_line(strs_to_join.items[0], n) + elif len(strs_to_join.items) > 1: + last = strs_to_join.items[-1] + if isinstance(last, StrExpr) and last.value == "": + # 3.12 can add an empty literal at the end. Delete it for consistency + # between Python versions. + del strs_to_join.items[-1:] + join_method = MemberExpr(empty_string, "join") + join_method.set_line(empty_string) + result_expression = CallExpr(join_method, [strs_to_join], [ARG_POS], [None]) + return self.set_line(result_expression, n) + + # FormattedValue(expr value) + def visit_FormattedValue(self, n: ast3.FormattedValue) -> Expression: + # A FormattedValue is a component of a JoinedStr, or it can exist + # on its own. We translate them to individual '{}'.format(value) + # calls. Format specifier and conversion information is passed along + # to allow mypyc to support f-strings with format specifiers and conversions. + val_exp = self.visit(n.value) + val_exp.set_line(n.lineno, n.col_offset) + conv_str = "" if n.conversion < 0 else "!" + chr(n.conversion) + format_string = StrExpr("{" + conv_str + ":{}}") + format_spec_exp = self.visit(n.format_spec) if n.format_spec is not None else StrExpr("") + format_string.set_line(n.lineno, n.col_offset) + format_method = MemberExpr(format_string, "format") + format_method.set_line(format_string) + result_expression = CallExpr( + format_method, [val_exp, format_spec_exp], [ARG_POS, ARG_POS], [None, None] + ) + return self.set_line(result_expression, n) + + # TemplateStr(expr* values) + def visit_TemplateStr(self, n: ast_TemplateStr) -> TemplateStrExpr: + self.uses_template_strings = True + items: list[Expression | tuple[Expression, str, str | None, Expression | None]] = [] + for value in n.values: + if isinstance(value, ast_Interpolation): # type: ignore[misc] + val_expr = self.visit(value.value) + val_expr.set_line(value.lineno, value.col_offset) + conversion = None if value.conversion < 0 else chr(value.conversion) + format_spec = ( + self.visit(value.format_spec) if value.format_spec is not None else None + ) + items.append((val_expr, value.str, conversion, format_spec)) + else: + items.append(self.visit(value)) + e = TemplateStrExpr(items) + return self.set_line(e, n) + + # Attribute(expr value, identifier attr, expr_context ctx) + def visit_Attribute(self, n: Attribute) -> MemberExpr | SuperExpr: + value = n.value + member_expr = MemberExpr(self.visit(value), n.attr) + obj = member_expr.expr + if ( + isinstance(obj, CallExpr) + and isinstance(obj.callee, NameExpr) + and obj.callee.name == "super" + ): + e: MemberExpr | SuperExpr = SuperExpr(member_expr.name, obj) + else: + e = member_expr + return self.set_line(e, n) + + # Subscript(expr value, slice slice, expr_context ctx) + def visit_Subscript(self, n: ast3.Subscript) -> IndexExpr: + e = IndexExpr(self.visit(n.value), self.visit(n.slice)) + return self.set_line(e, n) + + # Starred(expr value, expr_context ctx) + def visit_Starred(self, n: Starred) -> StarExpr: + e = StarExpr(self.visit(n.value)) + return self.set_line(e, n) + + # Name(identifier id, expr_context ctx) + def visit_Name(self, n: Name) -> NameExpr: + e = NameExpr(n.id) + return self.set_line(e, n) + + # List(expr* elts, expr_context ctx) + def visit_List(self, n: ast3.List) -> ListExpr | TupleExpr: + expr_list: list[Expression] = [self.visit(e) for e in n.elts] + if isinstance(n.ctx, ast3.Store): + # [x, y] = z and (x, y) = z means exactly the same thing + e: ListExpr | TupleExpr = TupleExpr(expr_list) + else: + e = ListExpr(expr_list) + return self.set_line(e, n) + + # Tuple(expr* elts, expr_context ctx) + def visit_Tuple(self, n: ast3.Tuple) -> TupleExpr: + e = TupleExpr(self.translate_expr_list(n.elts)) + return self.set_line(e, n) + + # Slice(expr? lower, expr? upper, expr? step) + def visit_Slice(self, n: ast3.Slice) -> SliceExpr: + e = SliceExpr(self.visit(n.lower), self.visit(n.upper), self.visit(n.step)) + return self.set_line(e, n) + + # Match(expr subject, match_case* cases) # python 3.10 and later + def visit_Match(self, n: ast3.Match) -> MatchStmt: + node = MatchStmt( + self.visit(n.subject), + [self.visit(c.pattern) for c in n.cases], + [self.visit(c.guard) for c in n.cases], + [self.as_required_block(c.body) for c in n.cases], + ) + return self.set_line(node, n) + + def visit_MatchValue(self, n: ast3.MatchValue) -> ValuePattern: + node = ValuePattern(self.visit(n.value)) + return self.set_line(node, n) + + def visit_MatchSingleton(self, n: ast3.MatchSingleton) -> SingletonPattern: + node = SingletonPattern(n.value) + return self.set_line(node, n) + + def visit_MatchSequence(self, n: ast3.MatchSequence) -> SequencePattern: + patterns = [self.visit(p) for p in n.patterns] + stars = [p for p in patterns if isinstance(p, StarredPattern)] + assert len(stars) < 2 + + node = SequencePattern(patterns) + return self.set_line(node, n) + + def visit_MatchStar(self, n: ast3.MatchStar) -> StarredPattern: + if n.name is None: + node = StarredPattern(None) + else: + name = self.set_line(NameExpr(n.name), n) + node = StarredPattern(name) + + return self.set_line(node, n) + + def visit_MatchMapping(self, n: ast3.MatchMapping) -> MappingPattern: + keys = [self.visit(k) for k in n.keys] + values = [self.visit(v) for v in n.patterns] + + if n.rest is None: + rest = None + else: + rest = self.set_line(NameExpr(n.rest), n) + + node = MappingPattern(keys, values, rest) + return self.set_line(node, n) + + def visit_MatchClass(self, n: ast3.MatchClass) -> ClassPattern: + class_ref = self.visit(n.cls) + assert isinstance(class_ref, RefExpr) + positionals = [self.visit(p) for p in n.patterns] + keyword_keys = n.kwd_attrs + keyword_values = [self.visit(p) for p in n.kwd_patterns] + + node = ClassPattern(class_ref, positionals, keyword_keys, keyword_values) + return self.set_line(node, n) + + # MatchAs(expr pattern, identifier name) + def visit_MatchAs(self, n: ast3.MatchAs) -> AsPattern: + if n.name is None: + name = None + else: + name = NameExpr(n.name) + name = self.set_line(name, n) + node = AsPattern(self.visit(n.pattern), name) + return self.set_line(node, n) + + # MatchOr(expr* pattern) + def visit_MatchOr(self, n: ast3.MatchOr) -> OrPattern: + node = OrPattern([self.visit(pattern) for pattern in n.patterns]) + return self.set_line(node, n) + + def validate_type_alias(self, n: ast_TypeAlias) -> None: + incorrect_expr = find_disallowed_expression_in_annotation_scope(n.value) + if incorrect_expr is None: + return + if isinstance(incorrect_expr, (ast3.Yield, ast3.YieldFrom)): + self.fail( + message_registry.TYPE_ALIAS_WITH_YIELD_EXPRESSION, + n.lineno, + n.col_offset, + blocker=True, + ) + if isinstance(incorrect_expr, ast3.NamedExpr): + self.fail( + message_registry.TYPE_ALIAS_WITH_NAMED_EXPRESSION, + n.lineno, + n.col_offset, + blocker=True, + ) + if isinstance(incorrect_expr, ast3.Await): + self.fail( + message_registry.TYPE_ALIAS_WITH_AWAIT_EXPRESSION, + n.lineno, + n.col_offset, + blocker=True, + ) + + # TypeAlias(identifier name, type_param* type_params, expr value) + def visit_TypeAlias(self, n: ast_TypeAlias) -> TypeAliasStmt | AssignmentStmt: + node: TypeAliasStmt | AssignmentStmt + type_params = self.translate_type_params(n.type_params) + self.validate_type_alias(n) + value = self.visit(n.value) + # Since the value is evaluated lazily, wrap the value inside a lambda. + # This helps mypyc. + ret = ReturnStmt(value) + self.set_line(ret, n.value) + value_func = LambdaExpr(body=Block([ret])) + self.set_line(value_func, n.value) + node = TypeAliasStmt(self.visit_Name(n.name), type_params, value_func) + return self.set_line(node, n) + + +class TypeConverter: + def __init__( + self, + errors: Errors | None, + line: int = -1, + override_column: int = -1, + is_evaluated: bool = True, + ) -> None: + self.errors = errors + self.line = line + self.override_column = override_column + self.node_stack: list[AST] = [] + self.is_evaluated = is_evaluated + + def convert_column(self, column: int) -> int: + """Apply column override if defined; otherwise return column. + + Column numbers are sometimes incorrect in the AST and the column + override can be used to work around that. + """ + if self.override_column < 0: + return column + else: + return self.override_column + + def invalid_type(self, node: AST, note: str | None = None) -> RawExpressionType: + """Constructs a type representing some expression that normally forms an invalid type. + For example, if we see a type hint that says "3 + 4", we would transform that + expression into a RawExpressionType. + + The semantic analysis layer will report an "Invalid type" error when it + encounters this type, along with the given note if one is provided. + + See RawExpressionType's docstring for more details on how it's used. + """ + return RawExpressionType( + None, "typing.Any", line=self.line, column=getattr(node, "col_offset", -1), note=note + ) + + @overload + def visit(self, node: ast3.expr) -> ProperType: ... + + @overload + def visit(self, node: AST | None) -> ProperType | None: ... + + def visit(self, node: AST | None) -> ProperType | None: + """Modified visit -- keep track of the stack of nodes""" + if node is None: + return None + self.node_stack.append(node) + try: + method = "visit_" + node.__class__.__name__ + visitor = getattr(self, method, None) + if visitor is not None: + typ = visitor(node) + assert isinstance(typ, ProperType) + return typ + else: + return self.invalid_type(node) + finally: + self.node_stack.pop() + + def parent(self) -> AST | None: + """Return the AST node above the one we are processing""" + if len(self.node_stack) < 2: + return None + return self.node_stack[-2] + + def fail(self, msg: ErrorMessage, line: int, column: int) -> None: + if self.errors: + self.errors.report(line, column, msg.value, blocker=True, code=msg.code) + + def note(self, msg: str, line: int, column: int) -> None: + if self.errors: + self.errors.report(line, column, msg, severity="note", code=codes.SYNTAX) + + def translate_expr_list(self, l: Sequence[ast3.expr]) -> list[Type]: + return [self.visit(e) for e in l] + + def visit_Call(self, e: Call) -> Type: + # Parse the arg constructor + f = e.func + constructor = stringify_name(f) + + if not isinstance(self.parent(), ast3.List): + note = None + if constructor: + note = "Suggestion: use {0}[...] instead of {0}(...)".format(constructor) + return self.invalid_type(e, note=note) + if not constructor: + self.fail(message_registry.ARG_CONSTRUCTOR_NAME_EXPECTED, e.lineno, e.col_offset) + + name: str | None = None + default_type = AnyType(TypeOfAny.special_form) + typ: Type = default_type + for i, arg in enumerate(e.args): + if i == 0: + converted = self.visit(arg) + assert converted is not None + typ = converted + elif i == 1: + name = self._extract_argument_name(arg) + else: + self.fail(message_registry.ARG_CONSTRUCTOR_TOO_MANY_ARGS, f.lineno, f.col_offset) + for k in e.keywords: + value = k.value + if k.arg == "name": + if name is not None: + self.fail( + message_registry.MULTIPLE_VALUES_FOR_NAME_KWARG.format(constructor), + f.lineno, + f.col_offset, + ) + name = self._extract_argument_name(value) + elif k.arg == "type": + if typ is not default_type: + self.fail( + message_registry.MULTIPLE_VALUES_FOR_TYPE_KWARG.format(constructor), + f.lineno, + f.col_offset, + ) + converted = self.visit(value) + assert converted is not None + typ = converted + else: + self.fail( + message_registry.ARG_CONSTRUCTOR_UNEXPECTED_ARG.format(k.arg), + value.lineno, + value.col_offset, + ) + return CallableArgument(typ, name, constructor, e.lineno, e.col_offset) + + def translate_argument_list(self, l: Sequence[ast3.expr]) -> TypeList: + return TypeList([self.visit(e) for e in l], line=self.line) + + def _extract_argument_name(self, n: ast3.expr) -> str | None: + if isinstance(n, ast3.Constant) and isinstance(n.value, str): + return n.value.strip() + elif isinstance(n, ast3.Constant) and n.value is None: + return None + self.fail( + message_registry.ARG_NAME_EXPECTED_STRING_LITERAL.format(type(n).__name__), + self.line, + 0, + ) + return None + + def visit_Name(self, n: Name) -> Type: + return UnboundType(n.id, line=self.line, column=self.convert_column(n.col_offset)) + + def visit_BinOp(self, n: ast3.BinOp) -> Type: + if not isinstance(n.op, ast3.BitOr): + return self.invalid_type(n) + + left = self.visit(n.left) + right = self.visit(n.right) + return UnionType( + [left, right], + line=self.line, + column=self.convert_column(n.col_offset), + is_evaluated=self.is_evaluated, + uses_pep604_syntax=True, + ) + + def visit_Constant(self, n: ast3.Constant) -> Type: + val = n.value + if val is None: + # None is a type. + return UnboundType("None", line=self.line) + if isinstance(val, str): + # Parse forward reference. + return parse_type_string(val, "builtins.str", self.line, n.col_offset) + if val is Ellipsis: + # '...' is valid in some types. + return EllipsisType(line=self.line) + if isinstance(val, bool): + # Special case for True/False. + return RawExpressionType(val, "builtins.bool", line=self.line) + if isinstance(val, (int, float, complex)): + return self.numeric_type(val, n) + if isinstance(val, bytes): + contents = bytes_to_human_readable_repr(val) + return RawExpressionType(contents, "builtins.bytes", self.line, column=n.col_offset) + # Everything else is invalid. + + # UnaryOp(op, operand) + def visit_UnaryOp(self, n: UnaryOp) -> Type: + # We support specifically Literal[-4], Literal[+4], and nothing else. + # For example, Literal[~6] or Literal[not False] is not supported. + typ = self.visit(n.operand) + if ( + isinstance(typ, RawExpressionType) + # Use type() because we do not want to allow bools. + and type(typ.literal_value) is int + ): + if isinstance(n.op, USub): + typ.literal_value *= -1 + return typ + if isinstance(n.op, UAdd): + return typ + return self.invalid_type(n) + + def numeric_type(self, value: object, n: AST) -> Type: + # The node's field has the type complex, but complex isn't *really* + # a parent of int and float, and this causes isinstance below + # to think that the complex branch is always picked. Avoid + # this by throwing away the type. + if isinstance(value, int): + numeric_value: int | None = value + type_name = "builtins.int" + else: + # Other kinds of numbers (floats, complex) are not valid parameters for + # RawExpressionType so we just pass in 'None' for now. We'll report the + # appropriate error at a later stage. + numeric_value = None + type_name = f"builtins.{type(value).__name__}" + return RawExpressionType( + numeric_value, type_name, line=self.line, column=getattr(n, "col_offset", -1) + ) + + def visit_Slice(self, n: ast3.Slice) -> Type: + return self.invalid_type(n, note="did you mean to use ',' instead of ':' ?") + + # Subscript(expr value, expr slice, expr_context ctx) + def visit_Subscript(self, n: ast3.Subscript) -> Type: + empty_tuple_index = False + if isinstance(n.slice, ast3.Tuple): + params = self.translate_expr_list(n.slice.elts) + if len(n.slice.elts) == 0: + empty_tuple_index = True + else: + params = [self.visit(n.slice)] + + value = self.visit(n.value) + if isinstance(value, UnboundType) and not value.args: + result = UnboundType( + value.name, + params, + line=self.line, + column=value.column, + empty_tuple_index=empty_tuple_index, + ) + result.end_column = n.end_col_offset + result.end_line = n.end_lineno + return result + else: + return self.invalid_type(n) + + def visit_Tuple(self, n: ast3.Tuple) -> Type: + return TupleType( + self.translate_expr_list(n.elts), + _dummy_fallback, + implicit=True, + line=self.line, + column=self.convert_column(n.col_offset), + ) + + def visit_Dict(self, n: ast3.Dict) -> Type: + if not n.keys: + return self.invalid_type(n) + items: dict[str, Type] = {} + extra_items_from = [] + for item_name, value in zip(n.keys, n.values): + if not isinstance(item_name, ast3.Constant) or not isinstance(item_name.value, str): + if item_name is None: + extra_items_from.append(self.visit(value)) + continue + return self.invalid_type(n) + items[item_name.value] = self.visit(value) + result = TypedDictType(items, set(), set(), _dummy_fallback, n.lineno, n.col_offset) + result.extra_items_from = extra_items_from + return result + + # Attribute(expr value, identifier attr, expr_context ctx) + def visit_Attribute(self, n: Attribute) -> Type: + before_dot = self.visit(n.value) + + if isinstance(before_dot, UnboundType) and not before_dot.args: + return UnboundType(f"{before_dot.name}.{n.attr}", line=self.line, column=n.col_offset) + else: + return self.invalid_type(n) + + # Used for Callable[[X *Ys, Z], R] etc. + def visit_Starred(self, n: ast3.Starred) -> Type: + return UnpackType(self.visit(n.value), from_star_syntax=True) + + # List(expr* elts, expr_context ctx) + def visit_List(self, n: ast3.List) -> Type: + assert isinstance(n.ctx, ast3.Load) + result = self.translate_argument_list(n.elts) + return result + + +def stringify_name(n: AST) -> str | None: + if isinstance(n, Name): + return n.id + elif isinstance(n, Attribute): + sv = stringify_name(n.value) + if sv is not None: + return f"{sv}.{n.attr}" + return None # Can't do it. + + +class FindAttributeAssign(TraverserVisitor): + """Check if an AST contains attribute assignments (e.g. self.x = 0).""" + + def __init__(self) -> None: + self.lvalue = False + self.found = False + + def visit_assignment_stmt(self, s: AssignmentStmt) -> None: + self.lvalue = True + for lv in s.lvalues: + lv.accept(self) + self.lvalue = False + + def visit_with_stmt(self, s: WithStmt) -> None: + self.lvalue = True + for lv in s.target: + if lv is not None: + lv.accept(self) + self.lvalue = False + s.body.accept(self) + + def visit_for_stmt(self, s: ForStmt) -> None: + self.lvalue = True + s.index.accept(self) + self.lvalue = False + s.body.accept(self) + if s.else_body: + s.else_body.accept(self) + + def visit_expression_stmt(self, s: ExpressionStmt) -> None: + # No need to look inside these + pass + + def visit_call_expr(self, e: CallExpr) -> None: + # No need to look inside these + pass + + def visit_index_expr(self, e: IndexExpr) -> None: + # No need to look inside these + pass + + def visit_member_expr(self, e: MemberExpr) -> None: + if self.lvalue and isinstance(e.expr, NameExpr): + self.found = True + + +class FindYield(TraverserVisitor): + """Check if an AST contains yields or yield froms.""" # codespell:ignore froms + + def __init__(self) -> None: + self.found = False + + def visit_yield_expr(self, e: YieldExpr) -> None: + self.found = True + + def visit_yield_from_expr(self, e: YieldFromExpr) -> None: + self.found = True + + +def is_possible_trivial_body(s: list[Statement]) -> bool: + """Could the statements form a "trivial" function body, such as 'pass'? + + This mimics mypy.semanal.is_trivial_body, but this runs before + semantic analysis so some checks must be conservative. + """ + l = len(s) + if l == 0: + return False + i = 0 + if isinstance(s[0], ExpressionStmt) and isinstance(s[0].expr, StrExpr): + # Skip docstring + i += 1 + if i == l: + return True + if l > i + 1: + return False + stmt = s[i] + return isinstance(stmt, (PassStmt, RaiseStmt)) or ( + isinstance(stmt, ExpressionStmt) and isinstance(stmt.expr, EllipsisExpr) + ) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/find_sources.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/find_sources.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..4fa6a08c8a815fbc53fa17a70dbf511f4936273a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/find_sources.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/find_sources.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/find_sources.py new file mode 100644 index 0000000000000000000000000000000000000000..e1edebe90985b091021580fc88d9a66ead9de40a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/find_sources.py @@ -0,0 +1,257 @@ +"""Routines for finding the sources that mypy will check""" + +from __future__ import annotations + +import functools +import os +from collections.abc import Sequence +from typing import Final + +from mypy.fscache import FileSystemCache +from mypy.modulefinder import ( + PYTHON_EXTENSIONS, + BuildSource, + matches_exclude, + matches_gitignore, + mypy_path, +) +from mypy.options import Options + +PY_EXTENSIONS: Final = tuple(PYTHON_EXTENSIONS) + + +class InvalidSourceList(Exception): + """Exception indicating a problem in the list of sources given to mypy.""" + + +def create_source_list( + paths: Sequence[str], + options: Options, + fscache: FileSystemCache | None = None, + allow_empty_dir: bool = False, +) -> list[BuildSource]: + """From a list of source files/directories, makes a list of BuildSources. + + Raises InvalidSourceList on errors. + """ + fscache = fscache or FileSystemCache() + finder = SourceFinder(fscache, options) + + sources = [] + for path in paths: + path = os.path.normpath(path) + if path.endswith(PY_EXTENSIONS): + # Can raise InvalidSourceList if a directory doesn't have a valid module name. + name, base_dir = finder.crawl_up(path) + sources.append(BuildSource(path, name, None, base_dir)) + elif fscache.isdir(path): + sub_sources = finder.find_sources_in_dir(path) + if not sub_sources and not allow_empty_dir: + raise InvalidSourceList(f"There are no .py[i] files in directory '{path}'") + sources.extend(sub_sources) + else: + mod = os.path.basename(path) if options.scripts_are_modules else None + sources.append(BuildSource(path, mod, None)) + return sources + + +def keyfunc(name: str) -> tuple[bool, int, str]: + """Determines sort order for directory listing. + + The desirable properties are: + 1) foo < foo.pyi < foo.py + 2) __init__.py[i] < foo + """ + base, suffix = os.path.splitext(name) + for i, ext in enumerate(PY_EXTENSIONS): + if suffix == ext: + return (base != "__init__", i, base) + return (base != "__init__", -1, name) + + +def normalise_package_base(root: str) -> str: + if not root: + root = os.curdir + root = os.path.abspath(root) + if root.endswith(os.sep): + root = root[:-1] + return root + + +def get_explicit_package_bases(options: Options) -> list[str] | None: + """Returns explicit package bases to use if the option is enabled, or None if disabled. + + We currently use MYPYPATH and the current directory as the package bases. In the future, + when --namespace-packages is the default could also use the values passed with the + --package-root flag, see #9632. + + Values returned are normalised so we can use simple string comparisons in + SourceFinder.is_explicit_package_base + """ + if not options.explicit_package_bases: + return None + roots = mypy_path() + options.mypy_path + [os.getcwd()] + return [normalise_package_base(root) for root in roots] + + +class SourceFinder: + def __init__(self, fscache: FileSystemCache, options: Options) -> None: + self.fscache = fscache + self.explicit_package_bases = get_explicit_package_bases(options) + self.namespace_packages = options.namespace_packages + self.exclude = options.exclude + self.exclude_gitignore = options.exclude_gitignore + self.verbosity = options.verbosity + + def is_explicit_package_base(self, path: str) -> bool: + assert self.explicit_package_bases + return normalise_package_base(path) in self.explicit_package_bases + + def find_sources_in_dir(self, path: str) -> list[BuildSource]: + sources = [] + + seen: set[str] = set() + names = sorted(self.fscache.listdir(path), key=keyfunc) + for name in names: + # Skip certain names altogether + if name in ("__pycache__", "site-packages", "node_modules") or name.startswith("."): + continue + subpath = os.path.join(path, name) + + if matches_exclude(subpath, self.exclude, self.fscache, self.verbosity >= 2): + continue + if self.exclude_gitignore and matches_gitignore( + subpath, self.fscache, self.verbosity >= 2 + ): + continue + + if self.fscache.isdir(subpath): + sub_sources = self.find_sources_in_dir(subpath) + if sub_sources: + seen.add(name) + sources.extend(sub_sources) + else: + stem, suffix = os.path.splitext(name) + if stem not in seen and suffix in PY_EXTENSIONS: + seen.add(stem) + module, base_dir = self.crawl_up(subpath) + sources.append(BuildSource(subpath, module, None, base_dir)) + + return sources + + def crawl_up(self, path: str) -> tuple[str, str]: + """Given a .py[i] filename, return module and base directory. + + For example, given "xxx/yyy/foo/bar.py", we might return something like: + ("foo.bar", "xxx/yyy") + + If namespace packages is off, we crawl upwards until we find a directory without + an __init__.py + + If namespace packages is on, we crawl upwards until the nearest explicit base directory. + Failing that, we return one past the highest directory containing an __init__.py + + We won't crawl past directories with invalid package names. + The base directory returned is an absolute path. + """ + path = os.path.abspath(path) + parent, filename = os.path.split(path) + + module_name = strip_py(filename) or filename + + parent_module, base_dir = self.crawl_up_dir(parent) + if module_name == "__init__": + return parent_module, base_dir + + # Note that module_name might not actually be a valid identifier, but that's okay + # Ignoring this possibility sidesteps some search path confusion + module = module_join(parent_module, module_name) + return module, base_dir + + def crawl_up_dir(self, dir: str) -> tuple[str, str]: + return self._crawl_up_helper(dir) or ("", dir) + + @functools.lru_cache # noqa: B019 + def _crawl_up_helper(self, dir: str) -> tuple[str, str] | None: + """Given a directory, maybe returns module and base directory. + + We return a non-None value if we were able to find something clearly intended as a base + directory (as adjudicated by being an explicit base directory or by containing a package + with __init__.py). + + This distinction is necessary for namespace packages, so that we know when to treat + ourselves as a subpackage. + """ + # stop crawling if we're an explicit base directory + if self.explicit_package_bases is not None and self.is_explicit_package_base(dir): + return "", dir + + parent, name = os.path.split(dir) + name = name.removesuffix("-stubs") # PEP-561 stub-only directory + + # recurse if there's an __init__.py + init_file = self.get_init_file(dir) + if init_file is not None: + if not name.isidentifier(): + # in most cases the directory name is invalid, we'll just stop crawling upwards + # but if there's an __init__.py in the directory, something is messed up + raise InvalidSourceList( + f"{name} contains {os.path.basename(init_file)} " + "but is not a valid Python package name" + ) + # we're definitely a package, so we always return a non-None value + mod_prefix, base_dir = self.crawl_up_dir(parent) + return module_join(mod_prefix, name), base_dir + + # stop crawling if we're out of path components or our name is an invalid identifier + if not name or not parent or not name.isidentifier(): + return None + + # stop crawling if namespace packages is off (since we don't have an __init__.py) + if not self.namespace_packages: + return None + + # at this point: namespace packages is on, we don't have an __init__.py and we're not an + # explicit base directory + result = self._crawl_up_helper(parent) + if result is None: + # we're not an explicit base directory and we don't have an __init__.py + # and none of our parents are either, so return + return None + # one of our parents was an explicit base directory or had an __init__.py, so we're + # definitely a subpackage! chain our name to the module. + mod_prefix, base_dir = result + return module_join(mod_prefix, name), base_dir + + def get_init_file(self, dir: str) -> str | None: + """Check whether a directory contains a file named __init__.py[i]. + + If so, return the file's name (with dir prefixed). If not, return None. + + This prefers .pyi over .py (because of the ordering of PY_EXTENSIONS). + """ + for ext in PY_EXTENSIONS: + f = os.path.join(dir, "__init__" + ext) + if self.fscache.isfile(f): + return f + if ext == ".py" and self.fscache.init_under_package_root(f): + return f + return None + + +def module_join(parent: str, child: str) -> str: + """Join module ids, accounting for a possibly empty parent.""" + if parent: + return parent + "." + child + return child + + +def strip_py(arg: str) -> str | None: + """Strip a trailing .py or .pyi suffix. + + Return None if no such suffix is found. + """ + for ext in PY_EXTENSIONS: + if arg.endswith(ext): + return arg[: -len(ext)] + return None diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/fixup.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/fixup.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..bf88c65b310d30c7f24e802fdf27ff6652dcfdd0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/fixup.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/fixup.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/fixup.py new file mode 100644 index 0000000000000000000000000000000000000000..d0205f64b7207e1e092ab1f1f476923f9aed4c41 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/fixup.py @@ -0,0 +1,444 @@ +"""Fix up various things after deserialization.""" + +from __future__ import annotations + +from typing import Any, Final + +from mypy.lookup import lookup_fully_qualified +from mypy.nodes import ( + Block, + ClassDef, + Decorator, + FuncDef, + MypyFile, + OverloadedFuncDef, + ParamSpecExpr, + SymbolTable, + TypeAlias, + TypeInfo, + TypeVarExpr, + TypeVarTupleExpr, + Var, +) +from mypy.types import ( + NOT_READY, + AnyType, + CallableType, + Instance, + LiteralType, + Overloaded, + Parameters, + ParamSpecType, + ProperType, + TupleType, + TypeAliasType, + TypedDictType, + TypeOfAny, + TypeType, + TypeVarTupleType, + TypeVarType, + TypeVisitor, + UnboundType, + UnionType, + UnpackType, +) +from mypy.visitor import NodeVisitor + + +# N.B: we do a allow_missing fixup when fixing up a fine-grained +# incremental cache load (since there may be cross-refs into deleted +# modules) +def fixup_module(tree: MypyFile, modules: dict[str, MypyFile], allow_missing: bool) -> None: + node_fixer = NodeFixer(modules, allow_missing) + node_fixer.visit_symbol_table(tree.names, tree.fullname) + + +# TODO: Fix up .info when deserializing, i.e. much earlier. +class NodeFixer(NodeVisitor[None]): + current_info: TypeInfo | None = None + + def __init__(self, modules: dict[str, MypyFile], allow_missing: bool) -> None: + self.modules = modules + self.allow_missing = allow_missing + self.type_fixer = TypeFixer(self.modules, allow_missing) + + # NOTE: This method isn't (yet) part of the NodeVisitor API. + def visit_type_info(self, info: TypeInfo) -> None: + save_info = self.current_info + try: + self.current_info = info + if info.defn: + info.defn.accept(self) + if info.names: + self.visit_symbol_table(info.names, info.fullname) + if info.bases: + for base in info.bases: + base.accept(self.type_fixer) + if info._promote: + for p in info._promote: + p.accept(self.type_fixer) + if info.tuple_type: + info.tuple_type.accept(self.type_fixer) + info.update_tuple_type(info.tuple_type) + if info.special_alias: + info.special_alias.alias_tvars = list(info.defn.type_vars) + for i, t in enumerate(info.defn.type_vars): + if isinstance(t, TypeVarTupleType): + info.special_alias.tvar_tuple_index = i + if info.typeddict_type: + info.typeddict_type.accept(self.type_fixer) + info.update_typeddict_type(info.typeddict_type) + if info.special_alias: + info.special_alias.alias_tvars = list(info.defn.type_vars) + for i, t in enumerate(info.defn.type_vars): + if isinstance(t, TypeVarTupleType): + info.special_alias.tvar_tuple_index = i + if info.declared_metaclass: + info.declared_metaclass.accept(self.type_fixer) + if info.metaclass_type: + info.metaclass_type.accept(self.type_fixer) + if info.self_type: + info.self_type.accept(self.type_fixer) + if info.alt_promote: + info.alt_promote.accept(self.type_fixer) + instance = Instance(info, []) + # Hack: We may also need to add a backwards promotion (from int to native int), + # since it might not be serialized. + if instance not in info.alt_promote.type._promote: + info.alt_promote.type._promote.append(instance) + if info._mro_refs: + info.mro = [ + lookup_fully_qualified_typeinfo( + self.modules, name, allow_missing=self.allow_missing + ) + for name in info._mro_refs + ] + info._mro_refs = None + finally: + self.current_info = save_info + + # NOTE: This method *definitely* isn't part of the NodeVisitor API. + def visit_symbol_table(self, symtab: SymbolTable, table_fullname: str) -> None: + # Copy the items because we may mutate symtab. + for key in list(symtab): + value = symtab[key] + cross_ref = value.cross_ref + if cross_ref is not None: # Fix up cross-reference. + value.cross_ref = None + if cross_ref in self.modules: + value.node = self.modules[cross_ref] + else: + stnode = lookup_fully_qualified( + cross_ref, self.modules, raise_on_missing=not self.allow_missing + ) + if stnode is not None: + if stnode is value: + # The node seems to refer to itself, which can mean that + # the target is a deleted submodule of the current module, + # and thus lookup falls back to the symbol table of the parent + # package. Here's how this may happen: + # + # pkg/__init__.py: + # from pkg import sub + # + # Now if pkg.sub is deleted, the pkg.sub symbol table entry + # appears to refer to itself. Replace the entry with a + # placeholder to avoid a crash. We can't delete the entry, + # as it would stop dependency propagation. + value.node = Var(key + "@deleted") + else: + assert stnode.node is not None, (table_fullname + "." + key, cross_ref) + value.node = stnode.node + elif not self.allow_missing: + assert False, f"Could not find cross-ref {cross_ref}" + else: + # We have a missing crossref in allow missing mode, need to put something + value.node = missing_info(self.modules) + else: + if isinstance(value.node, TypeInfo): + # TypeInfo has no accept(). TODO: Add it? + self.visit_type_info(value.node) + elif value.node is not None: + value.node.accept(self) + else: + assert False, f"Unexpected empty node {key!r}: {value}" + + def visit_func_def(self, func: FuncDef) -> None: + if self.current_info is not None: + func.info = self.current_info + if func.type is not None: + func.type.accept(self.type_fixer) + if isinstance(func.type, CallableType): + func.type.definition = func + + def visit_overloaded_func_def(self, o: OverloadedFuncDef) -> None: + if self.current_info is not None: + o.info = self.current_info + if o.type: + o.type.accept(self.type_fixer) + for item in o.items: + item.accept(self) + if o.impl: + o.impl.accept(self) + if isinstance(o.type, Overloaded): + # For error messages we link the original definition for each item. + for typ, item in zip(o.type.items, o.items): + typ.definition = item + + def visit_decorator(self, d: Decorator) -> None: + if self.current_info is not None: + d.var.info = self.current_info + if d.func: + d.func.accept(self) + if d.var: + d.var.accept(self) + for node in d.decorators: + node.accept(self) + typ = d.var.type + if isinstance(typ, ProperType) and isinstance(typ, CallableType): + typ.definition = d.func + + def visit_class_def(self, c: ClassDef) -> None: + for v in c.type_vars: + v.accept(self.type_fixer) + + def visit_type_var_expr(self, tv: TypeVarExpr) -> None: + for value in tv.values: + value.accept(self.type_fixer) + tv.upper_bound.accept(self.type_fixer) + tv.default.accept(self.type_fixer) + + def visit_paramspec_expr(self, p: ParamSpecExpr) -> None: + p.upper_bound.accept(self.type_fixer) + p.default.accept(self.type_fixer) + + def visit_type_var_tuple_expr(self, tv: TypeVarTupleExpr) -> None: + tv.upper_bound.accept(self.type_fixer) + tv.tuple_fallback.accept(self.type_fixer) + tv.default.accept(self.type_fixer) + + def visit_var(self, v: Var) -> None: + if self.current_info is not None: + v.info = self.current_info + if v.type is not None: + v.type.accept(self.type_fixer) + if v.setter_type is not None: + v.setter_type.accept(self.type_fixer) + + def visit_type_alias(self, a: TypeAlias) -> None: + a.target.accept(self.type_fixer) + for v in a.alias_tvars: + v.accept(self.type_fixer) + + +class TypeFixer(TypeVisitor[None]): + def __init__(self, modules: dict[str, MypyFile], allow_missing: bool) -> None: + self.modules = modules + self.allow_missing = allow_missing + + def visit_instance(self, inst: Instance) -> None: + # TODO: Combine Instances that are exactly the same? + type_ref = inst.type_ref + if type_ref is None: + return # We've already been here. + inst.type_ref = None + inst.type = lookup_fully_qualified_typeinfo( + self.modules, type_ref, allow_missing=self.allow_missing + ) + # TODO: Is this needed or redundant? + # Also fix up the bases, just in case. + for base in inst.type.bases: + if base.type is NOT_READY: + base.accept(self) + for a in inst.args: + a.accept(self) + if inst.last_known_value is not None: + inst.last_known_value.accept(self) + if inst.extra_attrs: + for v in inst.extra_attrs.attrs.values(): + v.accept(self) + + def visit_type_alias_type(self, t: TypeAliasType) -> None: + type_ref = t.type_ref + if type_ref is None: + return # We've already been here. + t.type_ref = None + t.alias = lookup_fully_qualified_alias( + self.modules, type_ref, allow_missing=self.allow_missing + ) + for a in t.args: + a.accept(self) + + def visit_any(self, o: Any) -> None: + pass # Nothing to descend into. + + def visit_callable_type(self, ct: CallableType) -> None: + if ct.fallback: + ct.fallback.accept(self) + for argt in ct.arg_types: + # argt may be None, e.g. for __self in NamedTuple constructors. + if argt is not None: + argt.accept(self) + if ct.ret_type is not None: + ct.ret_type.accept(self) + for v in ct.variables: + v.accept(self) + if ct.type_guard is not None: + ct.type_guard.accept(self) + if ct.type_is is not None: + ct.type_is.accept(self) + + def visit_overloaded(self, t: Overloaded) -> None: + for ct in t.items: + ct.accept(self) + + def visit_erased_type(self, o: Any) -> None: + # This type should exist only temporarily during type inference + raise RuntimeError("Shouldn't get here", o) + + def visit_deleted_type(self, o: Any) -> None: + pass # Nothing to descend into. + + def visit_none_type(self, o: Any) -> None: + pass # Nothing to descend into. + + def visit_uninhabited_type(self, o: Any) -> None: + pass # Nothing to descend into. + + def visit_partial_type(self, o: Any) -> None: + raise RuntimeError("Shouldn't get here", o) + + def visit_tuple_type(self, tt: TupleType) -> None: + if tt.items: + for it in tt.items: + it.accept(self) + if tt.partial_fallback is not None: + tt.partial_fallback.accept(self) + + def visit_typeddict_type(self, tdt: TypedDictType) -> None: + if tdt.items: + for it in tdt.items.values(): + it.accept(self) + if tdt.fallback is not None: + if tdt.fallback.type_ref is not None: + if ( + lookup_fully_qualified( + tdt.fallback.type_ref, + self.modules, + raise_on_missing=not self.allow_missing, + ) + is None + ): + # We reject fake TypeInfos for TypedDict fallbacks because + # the latter are used in type checking and must be valid. + tdt.fallback.type_ref = "typing._TypedDict" + tdt.fallback.accept(self) + + def visit_literal_type(self, lt: LiteralType) -> None: + lt.fallback.accept(self) + + def visit_type_var(self, tvt: TypeVarType) -> None: + if tvt.values: + for vt in tvt.values: + vt.accept(self) + tvt.upper_bound.accept(self) + tvt.default.accept(self) + + def visit_param_spec(self, p: ParamSpecType) -> None: + p.upper_bound.accept(self) + p.default.accept(self) + p.prefix.accept(self) + + def visit_type_var_tuple(self, t: TypeVarTupleType) -> None: + t.tuple_fallback.accept(self) + t.upper_bound.accept(self) + t.default.accept(self) + + def visit_unpack_type(self, u: UnpackType) -> None: + u.type.accept(self) + + def visit_parameters(self, p: Parameters) -> None: + for argt in p.arg_types: + if argt is not None: + argt.accept(self) + for var in p.variables: + var.accept(self) + + def visit_unbound_type(self, o: UnboundType) -> None: + for a in o.args: + a.accept(self) + + def visit_union_type(self, ut: UnionType) -> None: + if ut.items: + for it in ut.items: + it.accept(self) + + def visit_type_type(self, t: TypeType) -> None: + t.item.accept(self) + + +def lookup_fully_qualified_typeinfo( + modules: dict[str, MypyFile], name: str, *, allow_missing: bool +) -> TypeInfo: + stnode = lookup_fully_qualified(name, modules, raise_on_missing=not allow_missing) + node = stnode.node if stnode else None + if isinstance(node, TypeInfo): + return node + else: + # Looks like a missing TypeInfo during an initial daemon load, put something there + assert ( + allow_missing + ), "Should never get here in normal mode, got {}:{} instead of TypeInfo".format( + type(node).__name__, node.fullname if node else "" + ) + return missing_info(modules) + + +def lookup_fully_qualified_alias( + modules: dict[str, MypyFile], name: str, *, allow_missing: bool +) -> TypeAlias: + stnode = lookup_fully_qualified(name, modules, raise_on_missing=not allow_missing) + node = stnode.node if stnode else None + if isinstance(node, TypeAlias): + return node + elif isinstance(node, TypeInfo): + if node.special_alias: + # Already fixed up. + return node.special_alias + if node.tuple_type: + alias = TypeAlias.from_tuple_type(node) + elif node.typeddict_type: + alias = TypeAlias.from_typeddict_type(node) + else: + assert allow_missing + return missing_alias() + node.special_alias = alias + return alias + else: + # Looks like a missing TypeAlias during an initial daemon load, put something there + assert ( + allow_missing + ), "Should never get here in normal mode, got {}:{} instead of TypeAlias".format( + type(node).__name__, node.fullname if node else "" + ) + return missing_alias() + + +_SUGGESTION: Final = "" + + +def missing_info(modules: dict[str, MypyFile]) -> TypeInfo: + suggestion = _SUGGESTION.format("info") + dummy_def = ClassDef(suggestion, Block([])) + dummy_def.fullname = suggestion + + info = TypeInfo(SymbolTable(), dummy_def, "") + obj_type = lookup_fully_qualified_typeinfo(modules, "builtins.object", allow_missing=False) + info.bases = [Instance(obj_type, [])] + info.mro = [info, obj_type] + return info + + +def missing_alias() -> TypeAlias: + suggestion = _SUGGESTION.format("alias") + return TypeAlias(AnyType(TypeOfAny.special_form), suggestion, "", line=-1, column=-1) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/freetree.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/freetree.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..2615737c186f5a386d00809cf6a7bb7d6fffb2d8 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/freetree.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/dmypy-script.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/dmypy-script.py new file mode 100644 index 0000000000000000000000000000000000000000..d6559da8dd6cd4e553a044709d83e73bb437488a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/dmypy-script.py @@ -0,0 +1,10 @@ + +# -*- coding: utf-8 -*- +import re +import sys + +from mypy.dmypy.client import console_entry + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(console_entry()) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/dmypy.exe b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/dmypy.exe new file mode 100644 index 0000000000000000000000000000000000000000..0251e7a4bca1830f4777cb4f855f3e5fd3b2046a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/dmypy.exe differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/mypy-script.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/mypy-script.py new file mode 100644 index 0000000000000000000000000000000000000000..e08602493ed90b92df97a01b36e240e72bf71a7c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/mypy-script.py @@ -0,0 +1,10 @@ + +# -*- coding: utf-8 -*- +import re +import sys + +from mypy.__main__ import console_entry + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(console_entry()) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/mypy.exe b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/mypy.exe new file mode 100644 index 0000000000000000000000000000000000000000..0251e7a4bca1830f4777cb4f855f3e5fd3b2046a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/mypy.exe differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/mypyc-script.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/mypyc-script.py new file mode 100644 index 0000000000000000000000000000000000000000..797942de4a18fbe823266b2a41bafaa5d4115d68 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/mypyc-script.py @@ -0,0 +1,10 @@ + +# -*- coding: utf-8 -*- +import re +import sys + +from mypyc.__main__ import main + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/mypyc.exe b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/mypyc.exe new file mode 100644 index 0000000000000000000000000000000000000000..0251e7a4bca1830f4777cb4f855f3e5fd3b2046a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/mypyc.exe differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/stubgen-script.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/stubgen-script.py new file mode 100644 index 0000000000000000000000000000000000000000..fd73274936dcffd6c28f66774bf33d5b89d10861 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/stubgen-script.py @@ -0,0 +1,10 @@ + +# -*- coding: utf-8 -*- +import re +import sys + +from mypy.stubgen import main + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/stubgen.exe b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/stubgen.exe new file mode 100644 index 0000000000000000000000000000000000000000..0251e7a4bca1830f4777cb4f855f3e5fd3b2046a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/stubgen.exe differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/stubtest-script.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/stubtest-script.py new file mode 100644 index 0000000000000000000000000000000000000000..a3854b5aae9e43e72eb03b291d7f762b730165d3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/stubtest-script.py @@ -0,0 +1,10 @@ + +# -*- coding: utf-8 -*- +import re +import sys + +from mypy.stubtest import main + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/stubtest.exe b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/stubtest.exe new file mode 100644 index 0000000000000000000000000000000000000000..0251e7a4bca1830f4777cb4f855f3e5fd3b2046a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Scripts/stubtest.exe differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/info/about.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/info/about.json new file mode 100644 index 0000000000000000000000000000000000000000..18a4537684c3c8367ebe2a68e996f7ec8859bc0b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/info/about.json @@ -0,0 +1,315 @@ +{ + "channels": [ + "https://conda.anaconda.org/conda-forge" + ], + "conda_build_version": "26.3.0", + "conda_version": "26.3.2", + "description": "Add type annotations to your Python programs, and use mypy to type check\nthem. Mypy is essentially a Python linter on steroids, and it can catch\nmany programming errors by analyzing your program, without actually having\nto run it. Mypy has a powerful type system with features such as type\ninference, gradual typing, generics and union types.\n", + "dev_url": "https://github.com/python/mypy", + "doc_url": "http://mypy.readthedocs.io", + "env_vars": { + "CIO_TEST": "" + }, + "extra": { + "copy_test_source_files": true, + "feedstock-name": "mypy", + "final": true, + "flow_run_id": "azure_20260421.2.1", + "parent_recipe": { + "name": "mypy-split", + "path": "D:\\a\\1\\s\\recipe", + "version": "1.20.2" + }, + "recipe-maintainers": [ + "nehaljwani", + "ocefpaf", + "matthiasdiener", + "bollwyvl" + ], + "remote_url": "https://github.com/conda-forge/mypy-feedstock", + "sha": "98430d135eb137dd89d1633cd200929956452777" + }, + "home": "http://mypy-lang.org", + "identifiers": [], + "keywords": [], + "license": "MIT", + "license_family": "MIT", + "license_file": "LICENSE", + "root_pkgs": [ + "anaconda-auth 0.14.2 pyhd8ed1ab_0", + "anaconda-cli-base 0.8.2 pyhc364b38_0", + "anaconda-client 1.14.1 pyhcf101f3_0", + "annotated-doc 0.0.4 pyhcf101f3_0", + "annotated-types 0.7.0 pyhd8ed1ab_1", + "anyio 4.13.0 pyhcf101f3_0", + "archspec 0.2.5 pyhd8ed1ab_0", + "attrs 26.1.0 pyhcf101f3_0", + "backports 1.0 pyhd8ed1ab_5", + "backports.tarfile 1.2.0 pyhcf101f3_2", + "backports.zstd 1.3.0 py312h06d0912_0", + "beautifulsoup4 4.14.3 pyha770c72_0", + "boltons 25.0.0 pyhd8ed1ab_0", + "brotli-python 1.2.0 py312hc6d9e41_1", + "bzip2 1.0.8 h0ad9c76_9", + "ca-certificates 2026.2.25 h4c7d964_0", + "certifi 2026.2.25 pyhd8ed1ab_0", + "cffi 2.0.0 py312he06e257_1", + "chardet 5.2.0 pyhd8ed1ab_3", + "charset-normalizer 3.4.7 pyhd8ed1ab_0", + "click 8.3.2 pyh6dadd2b_0", + "colorama 0.4.6 pyhd8ed1ab_1", + "conda 26.3.2 py312h2e8e312_0", + "conda-build 26.3.0 pyhe63316d_1", + "conda-env 2.6.0 1", + "conda-forge-ci-setup 4.24.2 py312h3368cd0_101", + "conda-forge-metadata 0.13.0 pyhcf101f3_0", + "conda-index 0.11.0 pyhd8ed1ab_0", + "conda-libmamba-solver 26.3.0 pyhd8ed1ab_0", + "conda-oci-mirror 0.2.3 pyhd8ed1ab_1", + "conda-package-handling 2.4.0 pyh7900ff3_2", + "conda-package-streaming 0.12.0 pyhd8ed1ab_0", + "cpp-expected 1.3.1 h477610d_0", + "cryptography 46.0.7 py312h232196e_0", + "defusedxml 0.7.1 pyhd8ed1ab_0", + "deprecated 1.3.1 pyhd8ed1ab_1", + "distro 1.9.0 pyhd8ed1ab_1", + "evalidate 2.0.5 pyhe01879c_0", + "exceptiongroup 1.3.1 pyhd8ed1ab_0", + "filelock 3.29.0 pyhd8ed1ab_0", + "fmt 12.1.0 h7f4e812_0", + "frozendict 2.4.7 py312he06e257_0", + "h11 0.16.0 pyhcf101f3_1", + "h2 4.3.0 pyhcf101f3_0", + "hpack 4.1.0 pyhd8ed1ab_0", + "httpcore 1.0.9 pyh29332c3_0", + "httpx 0.28.1 pyhd8ed1ab_0", + "hyperframe 6.1.0 pyhd8ed1ab_0", + "idna 3.11 pyhd8ed1ab_0", + "importlib-metadata 8.8.0 pyhcf101f3_0", + "importlib_resources 7.1.0 pyhd8ed1ab_0", + "jaraco.classes 3.4.0 pyhcf101f3_3", + "jaraco.context 6.1.1 pyhcf101f3_0", + "jaraco.functools 4.4.0 pyhcf101f3_1", + "jinja2 3.1.6 pyhcf101f3_1", + "joblib 1.5.3 pyhd8ed1ab_0", + "jsonpatch 1.33 pyhd8ed1ab_1", + "jsonpointer 3.1.1 pyhcf101f3_0", + "jsonschema 4.26.0 pyhcf101f3_0", + "jsonschema-specifications 2025.9.1 pyhcf101f3_0", + "jupyter_core 5.9.1 pyh6dadd2b_0", + "keyring 25.7.0 pyh7428d3b_0", + "krb5 1.22.2 h0ea6238_0", + "lcms2 2.18 hf2c6c5f_0", + "lerc 4.1.0 hd936e49_0", + "libarchive 3.8.7 gpl_he24518a_100", + "libcurl 8.19.0 h8206538_0", + "libdeflate 1.25 h51727cc_0", + "libexpat 2.7.5 hac47afa_0", + "libffi 3.5.2 h3d046cb_0", + "libfreetype 2.14.3 h57928b3_0", + "libfreetype6 2.14.3 hdbac1cb_0", + "libgcc 15.2.0 h8ee18e1_18", + "libgomp 15.2.0 h8ee18e1_18", + "libiconv 1.18 hc1393d2_2", + "libjpeg-turbo 3.1.4.1 hfd05255_0", + "liblief 0.17.6 hac47afa_0", + "liblzma 5.8.3 hfd05255_0", + "libmamba 2.5.0 h06825f5_0", + "libmamba-spdlog 2.5.0 h9ae1bf1_0", + "libmambapy 2.5.0 py312h26e665a_0", + "libpng 1.6.58 h7351971_0", + "libsodium 1.0.21 h6a83c73_3", + "libsolv 0.7.36 h8883371_0", + "libsqlite 3.53.0 hf5d6505_0", + "libssh2 1.11.1 h9aa295b_0", + "libtiff 4.7.1 h8f73337_1", + "libwebp-base 1.6.0 h4d5522a_0", + "libwinpthread 12.0.0.r4.gg4f2fc60ca h57928b3_10", + "libxcb 1.17.0 h0e4246c_0", + "libxml2-16 2.15.3 h692994f_0", + "libxml2 2.15.3 hbc0d294_0", + "libzlib 1.3.2 hfd05255_2", + "lz4-c 1.10.0 h2466b09_1", + "lzo 2.10 h6a83c73_1002", + "m2-bash 5.2.037.2 hc364b38_6", + "m2-brotli 1.1.0.2 hc364b38_6", + "m2-ca-certificates 20241223.1 hc364b38_6", + "m2-conda-epoch 20250515 0_x86_64", + "m2-coreutils 8.32.5 hc364b38_6", + "m2-curl 8.9.1.1 hc364b38_6", + "m2-db 6.2.32.5 hc364b38_6", + "m2-file 5.46.2 hc364b38_6", + "m2-filesystem 2025.02.23.1 hc364b38_10", + "m2-findutils 4.9.0.3 hc364b38_6", + "m2-gcc-libs 13.3.0.1 hc364b38_6", + "m2-gdbm 1.25.1 hc364b38_6", + "m2-git 2.49.0.1 hc364b38_6", + "m2-gmp 6.3.0.1 hc364b38_6", + "m2-gzip 1.14.1 hc364b38_6", + "m2-heimdal 7.8.0.5 hc364b38_6", + "m2-heimdal-libs 7.8.0.5 hc364b38_6", + "m2-info 7.2.1 hc364b38_6", + "m2-less 668.1 hc364b38_6", + "m2-libbz2 1.0.8.4 hc364b38_6", + "m2-libcbor 0.12.0.1 hc364b38_6", + "m2-libcurl 8.9.1.1 hc364b38_6", + "m2-libdb 6.2.32.5 hc364b38_6", + "m2-libedit 20240808_3.1.1 hc364b38_6", + "m2-libexpat 2.7.1.1 hc364b38_6", + "m2-libffi 3.4.8.1 hc364b38_6", + "m2-libfido2 1.16.0.1 hc364b38_6", + "m2-libgdbm 1.25.1 hc364b38_6", + "m2-libiconv 1.18.1 hc364b38_6", + "m2-libidn2 2.3.8.1 hc364b38_6", + "m2-libintl 0.22.5.1 hc364b38_6", + "m2-liblzma 5.8.1.1 hc364b38_6", + "m2-libnghttp2 1.65.0.1 hc364b38_6", + "m2-libopenssl 3.5.0.1 hc364b38_6", + "m2-libp11-kit 0.25.5.2 hc364b38_6", + "m2-libpcre2_8 10.45.1 hc364b38_6", + "m2-libpsl 0.21.5.2 hc364b38_6", + "m2-libreadline 8.2.013.1 hc364b38_6", + "m2-libsqlite 3.49.1.2 hc364b38_6", + "m2-libssh2 1.11.1.1 hc364b38_6", + "m2-libtasn1 4.20.0.1 hc364b38_6", + "m2-libunistring 1.3.1 hc364b38_6", + "m2-libxcrypt 4.4.38.1 hc364b38_6", + "m2-libzstd 1.5.7.1 hc364b38_6", + "m2-msys2-runtime 3.6.1.4 hc364b38_6", + "m2-nano 8.4.1 hc364b38_6", + "m2-ncurses 6.5.20240831.2 hc364b38_6", + "m2-openssh 9.9p2.1 hc364b38_6", + "m2-openssl 3.5.0.1 hc364b38_6", + "m2-p11-kit 0.25.5.2 hc364b38_6", + "m2-patch 2.7.6.3 hc364b38_6", + "m2-perl 5.38.4.2 hc364b38_6", + "m2-perl-authen-sasl 2.1800.1 hc364b38_6", + "m2-perl-clone 0.47.1 hc364b38_6", + "m2-perl-convert-binhex 1.125.2 hc364b38_6", + "m2-perl-encode-locale 1.05.2 hc364b38_6", + "m2-perl-error 0.17030.1 hc364b38_6", + "m2-perl-file-listing 6.16.1 hc364b38_6", + "m2-perl-html-parser 3.83.1 hc364b38_6", + "m2-perl-html-tagset 3.24.1 hc364b38_6", + "m2-perl-http-cookiejar 0.014.1 hc364b38_6", + "m2-perl-http-cookies 6.11.1 hc364b38_6", + "m2-perl-http-daemon 6.16.1 hc364b38_6", + "m2-perl-http-date 6.06.1 hc364b38_6", + "m2-perl-http-message 7.00.1 hc364b38_6", + "m2-perl-http-negotiate 6.01.3 hc364b38_6", + "m2-perl-io-html 1.004.2 hc364b38_6", + "m2-perl-io-socket-ip 0.41.2 hc364b38_6", + "m2-perl-io-socket-ssl 2.089.1 hc364b38_6", + "m2-perl-io-stringy 2.113.2 hc364b38_6", + "m2-perl-libwww 6.78.1 hc364b38_6", + "m2-perl-lwp-mediatypes 6.04.2 hc364b38_6", + "m2-perl-mailtools 2.22.1 hc364b38_6", + "m2-perl-mime-tools 5.515.1 hc364b38_6", + "m2-perl-net-http 6.23.1 hc364b38_6", + "m2-perl-net-smtp-ssl 1.04.2 hc364b38_6", + "m2-perl-net-ssleay 1.94.2 hc364b38_6", + "m2-perl-termreadkey 2.38.6 hc364b38_6", + "m2-perl-timedate 2.33.2 hc364b38_6", + "m2-perl-try-tiny 0.32.1 hc364b38_6", + "m2-perl-uri 5.31.1 hc364b38_6", + "m2-perl-www-robotrules 6.02.3 hc364b38_6", + "m2-sed 4.9.1 hc364b38_6", + "m2-zlib 1.3.1.1 hc364b38_6", + "mamba 2.5.0 hf588a56_0", + "markdown-it-py 4.0.0 pyhd8ed1ab_0", + "markupsafe 3.0.3 py312h05f76fc_1", + "mbedtls 3.6.3.1 he0c23c2_0", + "mdurl 0.1.2 pyhd8ed1ab_1", + "menuinst 2.4.2 py312hbb81ca0_0", + "more-itertools 11.0.2 pyhcf101f3_0", + "msgpack-python 1.1.2 py312hf90b1b7_1", + "nbformat 5.10.4 pyhd8ed1ab_1", + "nlohmann_json-abi 3.12.0 h0f90c79_1", + "openjpeg 2.5.4 h0e57b4f_0", + "openssl 3.6.2 hf411b9b_0", + "oras-py 0.1.14 pyhd8ed1ab_0", + "packaging 26.1 pyhc364b38_0", + "pillow 12.2.0 py312h31f0997_0", + "pip 26.0.1 pyh8b19718_0", + "pkce 1.0.3 pyhd8ed1ab_1", + "pkginfo 1.12.1.2 pyhd8ed1ab_0", + "platformdirs 4.9.6 pyhcf101f3_0", + "pluggy 1.6.0 pyhf9edf01_1", + "psutil 7.2.2 py312he5662c2_0", + "pthread-stubs 0.4 h0e40799_1002", + "py-lief 0.17.6 py312hbb81ca0_0", + "pybind11-abi 11 hc364b38_1", + "pycosat 0.6.6 py312he06e257_3", + "pycparser 2.22 pyh29332c3_1", + "pydantic 2.13.3 pyhcf101f3_0", + "pydantic-core 2.46.3 py312hdabe01f_0", + "pydantic-settings 2.14.0 pyhd8ed1ab_0", + "pygithub 2.9.1 pyhd8ed1ab_0", + "pygments 2.20.0 pyhd8ed1ab_0", + "pyjwt 2.12.1 pyhcf101f3_0", + "pynacl 1.6.2 py312h570541e_1", + "pysocks 1.7.1 pyh09c184e_7", + "python 3.12.13 h0159041_0_cpython", + "python-dateutil 2.9.0.post0 pyhe01879c_2", + "python-dotenv 1.2.2 pyhcf101f3_0", + "python-fastjsonschema 2.21.2 pyhe01879c_0", + "python-libarchive-c 5.3 pyhe01879c_1", + "python_abi 3.12 8_cp312", + "pytz 2026.1.post1 pyhcf101f3_0", + "pywin32 311 py312h829343e_1", + "pywin32-ctypes 0.2.3 py312h2e8e312_3", + "pyyaml 6.0.3 py312h05f76fc_1", + "rattler-build 0.62.2 he94b42d_0", + "rattler-build-conda-compat 1.4.13 pyhd8ed1ab_0", + "readchar 4.2.2 pyhcf101f3_0", + "referencing 0.37.0 pyhcf101f3_0", + "reproc 14.2.7.post0 hfd05255_0", + "reproc-cpp 14.2.7.post0 hac47afa_0", + "requests 2.33.1 pyhcf101f3_0", + "requests-toolbelt 1.0.0 pyhd8ed1ab_1", + "rich 15.0.0 pyhcf101f3_0", + "ripgrep 15.1.0 h77a83cd_0", + "rpds-py 0.30.0 py312hdabe01f_0", + "ruamel.yaml 0.18.17 py312he5662c2_2", + "ruamel.yaml.clib 0.2.15 py312he5662c2_1", + "semver 3.0.4 pyhcf101f3_1", + "setuptools 82.0.1 pyh332efcf_0", + "shellingham 1.5.4 pyhd8ed1ab_2", + "shyaml 0.6.2 pyhd3deb0d_0", + "simdjson 4.2.4 h49e36cd_0", + "six 1.17.0 pyhe01879c_1", + "sniffio 1.3.1 pyhd8ed1ab_2", + "soupsieve 2.8.3 pyhd8ed1ab_0", + "spdlog 1.17.0 h9f585f1_1", + "tk 8.6.13 h6ed50ae_3", + "tomli 2.4.1 pyhcf101f3_0", + "tomlkit 0.14.0 pyha770c72_0", + "tqdm 4.67.3 pyha7b4d00_0", + "traitlets 5.14.3 pyhd8ed1ab_1", + "truststore 0.10.4 pyhcf101f3_0", + "typer 0.24.1 pyhcf101f3_0", + "typing-extensions 4.15.0 h396c80c_0", + "typing-inspection 0.4.2 pyhd8ed1ab_1", + "typing_extensions 4.15.0 pyhcf101f3_0", + "tzdata 2025c hc9c84f9_1", + "ucrt 10.0.26100.0 h57928b3_0", + "urllib3 2.6.3 pyhd8ed1ab_0", + "vc 14.3 h41ae7f8_34", + "vc14_runtime 14.44.35208 h818238b_34", + "vcomp14 14.44.35208 h818238b_34", + "wheel 0.46.3 pyhd8ed1ab_0", + "win_inet_pton 1.1.0 pyh7428d3b_8", + "wrapt 2.1.2 py312he06e257_0", + "xorg-libxau 1.0.12 hba3369d_1", + "xorg-libxdmcp 1.1.5 hba3369d_1", + "yaml 0.2.5 h6a83c73_3", + "yaml-cpp 0.8.0 he0c23c2_0", + "zipp 3.23.1 pyhcf101f3_0", + "zlib-ng 2.3.3 h0261ad2_1", + "zstandard 0.25.0 py312he5662c2_1", + "zstd 1.5.7 h534d264_6", + "_openmp_mutex 4.5 20_gnu" + ], + "summary": "Optional static typing for Python", + "tags": [] +} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/info/files b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/info/files new file mode 100644 index 0000000000000000000000000000000000000000..7e500f1721ec86e03ebaf24a962e21ae64503a3d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/info/files @@ -0,0 +1,1756 @@ +Lib/site-packages/0aca9ce3d91742c5b361__mypyc.cp314t-win_amd64.pyd +Lib/site-packages/mypy-1.20.2.dist-info/INSTALLER +Lib/site-packages/mypy-1.20.2.dist-info/METADATA +Lib/site-packages/mypy-1.20.2.dist-info/RECORD +Lib/site-packages/mypy-1.20.2.dist-info/REQUESTED +Lib/site-packages/mypy-1.20.2.dist-info/WHEEL +Lib/site-packages/mypy-1.20.2.dist-info/direct_url.json +Lib/site-packages/mypy-1.20.2.dist-info/entry_points.txt +Lib/site-packages/mypy-1.20.2.dist-info/licenses/LICENSE +Lib/site-packages/mypy-1.20.2.dist-info/licenses/mypy/typeshed/LICENSE +Lib/site-packages/mypy-1.20.2.dist-info/top_level.txt +Lib/site-packages/mypy/__init__.cp314t-win_amd64.pyd +Lib/site-packages/mypy/__init__.py +Lib/site-packages/mypy/__main__.py +Lib/site-packages/mypy/__pycache__/__init__.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/__main__.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/api.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/applytype.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/argmap.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/binder.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/bogus_type.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/build.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/cache.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/checker.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/checker_shared.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/checker_state.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/checkexpr.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/checkmember.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/checkpattern.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/checkstrformat.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/config_parser.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/constant_fold.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/constraints.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/copytype.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/defaults.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/dmypy_os.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/dmypy_server.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/dmypy_util.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/erasetype.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/error_formatter.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/errorcodes.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/errors.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/evalexpr.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/expandtype.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/exportjson.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/exprtotype.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/fastparse.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/find_sources.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/fixup.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/freetree.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/fscache.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/fswatcher.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/gclogger.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/git.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/graph_utils.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/indirection.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/infer.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/inspections.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/ipc.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/join.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/literals.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/lookup.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/main.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/maptype.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/meet.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/memprofile.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/message_registry.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/messages.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/metastore.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/mixedtraverser.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/modulefinder.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/moduleinspect.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/mro.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/nativeparse.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/nodes.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/operators.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/options.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/parse.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/partially_defined.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/patterns.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/plugin.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/pyinfo.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/reachability.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/refinfo.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/renaming.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/report.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/scope.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/semanal.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/semanal_classprop.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/semanal_enum.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/semanal_infer.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/semanal_main.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/semanal_namedtuple.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/semanal_newtype.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/semanal_pass1.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/semanal_shared.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/semanal_typeargs.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/semanal_typeddict.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/sharedparse.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/solve.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/split_namespace.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/state.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/stats.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/strconv.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/stubdoc.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/stubgen.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/stubgenc.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/stubinfo.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/stubtest.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/stubutil.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/subtypes.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/suggestions.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/traverser.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/treetransform.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/tvar_scope.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/type_visitor.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/typeanal.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/typeops.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/types.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/types_utils.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/typestate.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/typetraverser.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/typevars.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/typevartuples.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/util.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/version.cpython-314.pyc +Lib/site-packages/mypy/__pycache__/visitor.cpython-314.pyc +Lib/site-packages/mypy/api.cp314t-win_amd64.pyd +Lib/site-packages/mypy/api.py +Lib/site-packages/mypy/applytype.cp314t-win_amd64.pyd +Lib/site-packages/mypy/applytype.py +Lib/site-packages/mypy/argmap.cp314t-win_amd64.pyd +Lib/site-packages/mypy/argmap.py +Lib/site-packages/mypy/binder.cp314t-win_amd64.pyd +Lib/site-packages/mypy/binder.py +Lib/site-packages/mypy/bogus_type.py +Lib/site-packages/mypy/build.cp314t-win_amd64.pyd +Lib/site-packages/mypy/build.py +Lib/site-packages/mypy/build_worker/__init__.cp314t-win_amd64.pyd +Lib/site-packages/mypy/build_worker/__init__.py +Lib/site-packages/mypy/build_worker/__main__.py +Lib/site-packages/mypy/build_worker/__pycache__/__init__.cpython-314.pyc +Lib/site-packages/mypy/build_worker/__pycache__/__main__.cpython-314.pyc +Lib/site-packages/mypy/build_worker/__pycache__/worker.cpython-314.pyc +Lib/site-packages/mypy/build_worker/worker.cp314t-win_amd64.pyd +Lib/site-packages/mypy/build_worker/worker.py +Lib/site-packages/mypy/cache.cp314t-win_amd64.pyd +Lib/site-packages/mypy/cache.py +Lib/site-packages/mypy/checker.cp314t-win_amd64.pyd +Lib/site-packages/mypy/checker.py +Lib/site-packages/mypy/checker_shared.cp314t-win_amd64.pyd +Lib/site-packages/mypy/checker_shared.py +Lib/site-packages/mypy/checker_state.cp314t-win_amd64.pyd +Lib/site-packages/mypy/checker_state.py +Lib/site-packages/mypy/checkexpr.cp314t-win_amd64.pyd +Lib/site-packages/mypy/checkexpr.py +Lib/site-packages/mypy/checkmember.cp314t-win_amd64.pyd +Lib/site-packages/mypy/checkmember.py +Lib/site-packages/mypy/checkpattern.cp314t-win_amd64.pyd +Lib/site-packages/mypy/checkpattern.py +Lib/site-packages/mypy/checkstrformat.cp314t-win_amd64.pyd +Lib/site-packages/mypy/checkstrformat.py +Lib/site-packages/mypy/config_parser.cp314t-win_amd64.pyd +Lib/site-packages/mypy/config_parser.py +Lib/site-packages/mypy/constant_fold.cp314t-win_amd64.pyd +Lib/site-packages/mypy/constant_fold.py +Lib/site-packages/mypy/constraints.cp314t-win_amd64.pyd +Lib/site-packages/mypy/constraints.py +Lib/site-packages/mypy/copytype.cp314t-win_amd64.pyd +Lib/site-packages/mypy/copytype.py +Lib/site-packages/mypy/defaults.cp314t-win_amd64.pyd +Lib/site-packages/mypy/defaults.py +Lib/site-packages/mypy/dmypy/__init__.cp314t-win_amd64.pyd +Lib/site-packages/mypy/dmypy/__init__.py +Lib/site-packages/mypy/dmypy/__main__.py +Lib/site-packages/mypy/dmypy/__pycache__/__init__.cpython-314.pyc +Lib/site-packages/mypy/dmypy/__pycache__/__main__.cpython-314.pyc +Lib/site-packages/mypy/dmypy/__pycache__/client.cpython-314.pyc +Lib/site-packages/mypy/dmypy/client.cp314t-win_amd64.pyd +Lib/site-packages/mypy/dmypy/client.py +Lib/site-packages/mypy/dmypy_os.cp314t-win_amd64.pyd +Lib/site-packages/mypy/dmypy_os.py +Lib/site-packages/mypy/dmypy_server.cp314t-win_amd64.pyd +Lib/site-packages/mypy/dmypy_server.py +Lib/site-packages/mypy/dmypy_util.cp314t-win_amd64.pyd +Lib/site-packages/mypy/dmypy_util.py +Lib/site-packages/mypy/erasetype.cp314t-win_amd64.pyd +Lib/site-packages/mypy/erasetype.py +Lib/site-packages/mypy/error_formatter.cp314t-win_amd64.pyd +Lib/site-packages/mypy/error_formatter.py +Lib/site-packages/mypy/errorcodes.cp314t-win_amd64.pyd +Lib/site-packages/mypy/errorcodes.py +Lib/site-packages/mypy/errors.cp314t-win_amd64.pyd +Lib/site-packages/mypy/errors.py +Lib/site-packages/mypy/evalexpr.cp314t-win_amd64.pyd +Lib/site-packages/mypy/evalexpr.py +Lib/site-packages/mypy/expandtype.cp314t-win_amd64.pyd +Lib/site-packages/mypy/expandtype.py +Lib/site-packages/mypy/exportjson.py +Lib/site-packages/mypy/exprtotype.cp314t-win_amd64.pyd +Lib/site-packages/mypy/exprtotype.py +Lib/site-packages/mypy/fastparse.cp314t-win_amd64.pyd +Lib/site-packages/mypy/fastparse.py +Lib/site-packages/mypy/find_sources.cp314t-win_amd64.pyd +Lib/site-packages/mypy/find_sources.py +Lib/site-packages/mypy/fixup.cp314t-win_amd64.pyd +Lib/site-packages/mypy/fixup.py +Lib/site-packages/mypy/freetree.cp314t-win_amd64.pyd +Lib/site-packages/mypy/freetree.py +Lib/site-packages/mypy/fscache.cp314t-win_amd64.pyd +Lib/site-packages/mypy/fscache.py +Lib/site-packages/mypy/fswatcher.cp314t-win_amd64.pyd +Lib/site-packages/mypy/fswatcher.py +Lib/site-packages/mypy/gclogger.cp314t-win_amd64.pyd +Lib/site-packages/mypy/gclogger.py +Lib/site-packages/mypy/git.cp314t-win_amd64.pyd +Lib/site-packages/mypy/git.py +Lib/site-packages/mypy/graph_utils.cp314t-win_amd64.pyd +Lib/site-packages/mypy/graph_utils.py +Lib/site-packages/mypy/indirection.cp314t-win_amd64.pyd +Lib/site-packages/mypy/indirection.py +Lib/site-packages/mypy/infer.cp314t-win_amd64.pyd +Lib/site-packages/mypy/infer.py +Lib/site-packages/mypy/inspections.cp314t-win_amd64.pyd +Lib/site-packages/mypy/inspections.py +Lib/site-packages/mypy/ipc.cp314t-win_amd64.pyd +Lib/site-packages/mypy/ipc.py +Lib/site-packages/mypy/join.cp314t-win_amd64.pyd +Lib/site-packages/mypy/join.py +Lib/site-packages/mypy/literals.cp314t-win_amd64.pyd +Lib/site-packages/mypy/literals.py +Lib/site-packages/mypy/lookup.cp314t-win_amd64.pyd +Lib/site-packages/mypy/lookup.py +Lib/site-packages/mypy/main.cp314t-win_amd64.pyd +Lib/site-packages/mypy/main.py +Lib/site-packages/mypy/maptype.cp314t-win_amd64.pyd +Lib/site-packages/mypy/maptype.py +Lib/site-packages/mypy/meet.cp314t-win_amd64.pyd +Lib/site-packages/mypy/meet.py +Lib/site-packages/mypy/memprofile.cp314t-win_amd64.pyd +Lib/site-packages/mypy/memprofile.py +Lib/site-packages/mypy/message_registry.cp314t-win_amd64.pyd +Lib/site-packages/mypy/message_registry.py +Lib/site-packages/mypy/messages.cp314t-win_amd64.pyd +Lib/site-packages/mypy/messages.py +Lib/site-packages/mypy/metastore.cp314t-win_amd64.pyd +Lib/site-packages/mypy/metastore.py +Lib/site-packages/mypy/mixedtraverser.cp314t-win_amd64.pyd +Lib/site-packages/mypy/mixedtraverser.py +Lib/site-packages/mypy/modulefinder.cp314t-win_amd64.pyd +Lib/site-packages/mypy/modulefinder.py +Lib/site-packages/mypy/moduleinspect.cp314t-win_amd64.pyd +Lib/site-packages/mypy/moduleinspect.py +Lib/site-packages/mypy/mro.cp314t-win_amd64.pyd +Lib/site-packages/mypy/mro.py +Lib/site-packages/mypy/nativeparse.cp314t-win_amd64.pyd +Lib/site-packages/mypy/nativeparse.py +Lib/site-packages/mypy/nodes.cp314t-win_amd64.pyd +Lib/site-packages/mypy/nodes.py +Lib/site-packages/mypy/operators.cp314t-win_amd64.pyd +Lib/site-packages/mypy/operators.py +Lib/site-packages/mypy/options.cp314t-win_amd64.pyd +Lib/site-packages/mypy/options.py +Lib/site-packages/mypy/parse.cp314t-win_amd64.pyd +Lib/site-packages/mypy/parse.py +Lib/site-packages/mypy/partially_defined.cp314t-win_amd64.pyd +Lib/site-packages/mypy/partially_defined.py +Lib/site-packages/mypy/patterns.cp314t-win_amd64.pyd +Lib/site-packages/mypy/patterns.py +Lib/site-packages/mypy/plugin.cp314t-win_amd64.pyd +Lib/site-packages/mypy/plugin.py +Lib/site-packages/mypy/plugins/__init__.py +Lib/site-packages/mypy/plugins/__pycache__/__init__.cpython-314.pyc +Lib/site-packages/mypy/plugins/__pycache__/attrs.cpython-314.pyc +Lib/site-packages/mypy/plugins/__pycache__/common.cpython-314.pyc +Lib/site-packages/mypy/plugins/__pycache__/constants.cpython-314.pyc +Lib/site-packages/mypy/plugins/__pycache__/ctypes.cpython-314.pyc +Lib/site-packages/mypy/plugins/__pycache__/dataclasses.cpython-314.pyc +Lib/site-packages/mypy/plugins/__pycache__/default.cpython-314.pyc +Lib/site-packages/mypy/plugins/__pycache__/enums.cpython-314.pyc +Lib/site-packages/mypy/plugins/__pycache__/functools.cpython-314.pyc +Lib/site-packages/mypy/plugins/__pycache__/proper_plugin.cpython-314.pyc +Lib/site-packages/mypy/plugins/__pycache__/singledispatch.cpython-314.pyc +Lib/site-packages/mypy/plugins/attrs.cp314t-win_amd64.pyd +Lib/site-packages/mypy/plugins/attrs.py +Lib/site-packages/mypy/plugins/common.cp314t-win_amd64.pyd +Lib/site-packages/mypy/plugins/common.py +Lib/site-packages/mypy/plugins/constants.cp314t-win_amd64.pyd +Lib/site-packages/mypy/plugins/constants.py +Lib/site-packages/mypy/plugins/ctypes.cp314t-win_amd64.pyd +Lib/site-packages/mypy/plugins/ctypes.py +Lib/site-packages/mypy/plugins/dataclasses.cp314t-win_amd64.pyd +Lib/site-packages/mypy/plugins/dataclasses.py +Lib/site-packages/mypy/plugins/default.cp314t-win_amd64.pyd +Lib/site-packages/mypy/plugins/default.py +Lib/site-packages/mypy/plugins/enums.cp314t-win_amd64.pyd +Lib/site-packages/mypy/plugins/enums.py +Lib/site-packages/mypy/plugins/functools.cp314t-win_amd64.pyd +Lib/site-packages/mypy/plugins/functools.py +Lib/site-packages/mypy/plugins/proper_plugin.cp314t-win_amd64.pyd +Lib/site-packages/mypy/plugins/proper_plugin.py +Lib/site-packages/mypy/plugins/singledispatch.cp314t-win_amd64.pyd +Lib/site-packages/mypy/plugins/singledispatch.py +Lib/site-packages/mypy/py.typed +Lib/site-packages/mypy/pyinfo.py +Lib/site-packages/mypy/reachability.cp314t-win_amd64.pyd +Lib/site-packages/mypy/reachability.py +Lib/site-packages/mypy/refinfo.cp314t-win_amd64.pyd +Lib/site-packages/mypy/refinfo.py +Lib/site-packages/mypy/renaming.cp314t-win_amd64.pyd +Lib/site-packages/mypy/renaming.py +Lib/site-packages/mypy/report.cp314t-win_amd64.pyd +Lib/site-packages/mypy/report.py +Lib/site-packages/mypy/scope.cp314t-win_amd64.pyd +Lib/site-packages/mypy/scope.py +Lib/site-packages/mypy/semanal.cp314t-win_amd64.pyd +Lib/site-packages/mypy/semanal.py +Lib/site-packages/mypy/semanal_classprop.cp314t-win_amd64.pyd +Lib/site-packages/mypy/semanal_classprop.py +Lib/site-packages/mypy/semanal_enum.cp314t-win_amd64.pyd +Lib/site-packages/mypy/semanal_enum.py +Lib/site-packages/mypy/semanal_infer.cp314t-win_amd64.pyd +Lib/site-packages/mypy/semanal_infer.py +Lib/site-packages/mypy/semanal_main.cp314t-win_amd64.pyd +Lib/site-packages/mypy/semanal_main.py +Lib/site-packages/mypy/semanal_namedtuple.cp314t-win_amd64.pyd +Lib/site-packages/mypy/semanal_namedtuple.py +Lib/site-packages/mypy/semanal_newtype.cp314t-win_amd64.pyd +Lib/site-packages/mypy/semanal_newtype.py +Lib/site-packages/mypy/semanal_pass1.cp314t-win_amd64.pyd +Lib/site-packages/mypy/semanal_pass1.py +Lib/site-packages/mypy/semanal_shared.cp314t-win_amd64.pyd +Lib/site-packages/mypy/semanal_shared.py +Lib/site-packages/mypy/semanal_typeargs.cp314t-win_amd64.pyd +Lib/site-packages/mypy/semanal_typeargs.py +Lib/site-packages/mypy/semanal_typeddict.cp314t-win_amd64.pyd +Lib/site-packages/mypy/semanal_typeddict.py +Lib/site-packages/mypy/server/__init__.py +Lib/site-packages/mypy/server/__pycache__/__init__.cpython-314.pyc +Lib/site-packages/mypy/server/__pycache__/astdiff.cpython-314.pyc +Lib/site-packages/mypy/server/__pycache__/astmerge.cpython-314.pyc +Lib/site-packages/mypy/server/__pycache__/aststrip.cpython-314.pyc +Lib/site-packages/mypy/server/__pycache__/deps.cpython-314.pyc +Lib/site-packages/mypy/server/__pycache__/mergecheck.cpython-314.pyc +Lib/site-packages/mypy/server/__pycache__/objgraph.cpython-314.pyc +Lib/site-packages/mypy/server/__pycache__/subexpr.cpython-314.pyc +Lib/site-packages/mypy/server/__pycache__/target.cpython-314.pyc +Lib/site-packages/mypy/server/__pycache__/trigger.cpython-314.pyc +Lib/site-packages/mypy/server/__pycache__/update.cpython-314.pyc +Lib/site-packages/mypy/server/astdiff.cp314t-win_amd64.pyd +Lib/site-packages/mypy/server/astdiff.py +Lib/site-packages/mypy/server/astmerge.cp314t-win_amd64.pyd +Lib/site-packages/mypy/server/astmerge.py +Lib/site-packages/mypy/server/aststrip.cp314t-win_amd64.pyd +Lib/site-packages/mypy/server/aststrip.py +Lib/site-packages/mypy/server/deps.cp314t-win_amd64.pyd +Lib/site-packages/mypy/server/deps.py +Lib/site-packages/mypy/server/mergecheck.cp314t-win_amd64.pyd +Lib/site-packages/mypy/server/mergecheck.py +Lib/site-packages/mypy/server/objgraph.cp314t-win_amd64.pyd +Lib/site-packages/mypy/server/objgraph.py +Lib/site-packages/mypy/server/subexpr.cp314t-win_amd64.pyd +Lib/site-packages/mypy/server/subexpr.py +Lib/site-packages/mypy/server/target.cp314t-win_amd64.pyd +Lib/site-packages/mypy/server/target.py +Lib/site-packages/mypy/server/trigger.cp314t-win_amd64.pyd +Lib/site-packages/mypy/server/trigger.py +Lib/site-packages/mypy/server/update.cp314t-win_amd64.pyd +Lib/site-packages/mypy/server/update.py +Lib/site-packages/mypy/sharedparse.cp314t-win_amd64.pyd +Lib/site-packages/mypy/sharedparse.py +Lib/site-packages/mypy/solve.cp314t-win_amd64.pyd +Lib/site-packages/mypy/solve.py +Lib/site-packages/mypy/split_namespace.py +Lib/site-packages/mypy/state.cp314t-win_amd64.pyd +Lib/site-packages/mypy/state.py +Lib/site-packages/mypy/stats.cp314t-win_amd64.pyd +Lib/site-packages/mypy/stats.py +Lib/site-packages/mypy/strconv.cp314t-win_amd64.pyd +Lib/site-packages/mypy/strconv.py +Lib/site-packages/mypy/stubdoc.py +Lib/site-packages/mypy/stubgen.cp314t-win_amd64.pyd +Lib/site-packages/mypy/stubgen.py +Lib/site-packages/mypy/stubgenc.py +Lib/site-packages/mypy/stubinfo.cp314t-win_amd64.pyd +Lib/site-packages/mypy/stubinfo.py +Lib/site-packages/mypy/stubtest.py +Lib/site-packages/mypy/stubutil.cp314t-win_amd64.pyd +Lib/site-packages/mypy/stubutil.py +Lib/site-packages/mypy/subtypes.cp314t-win_amd64.pyd +Lib/site-packages/mypy/subtypes.py +Lib/site-packages/mypy/suggestions.cp314t-win_amd64.pyd +Lib/site-packages/mypy/suggestions.py +Lib/site-packages/mypy/test/__init__.py +Lib/site-packages/mypy/test/__pycache__/__init__.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/config.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/data.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/helpers.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/test_config_parser.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/test_diff_cache.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/test_find_sources.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/test_nativeparse.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/test_ref_info.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testapi.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testargs.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testcheck.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testcmdline.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testconstraints.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testdaemon.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testdeps.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testdiff.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testerrorstream.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testexportjson.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testfinegrained.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testfinegrainedcache.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testformatter.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testfscache.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testgraph.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testinfer.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testipc.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testmerge.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testmodulefinder.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testmypyc.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testoutput.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testparse.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testpep561.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testpythoneval.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testreports.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testsemanal.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testsolve.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/teststubgen.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/teststubinfo.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/teststubtest.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testsubtypes.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testtransform.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testtypegen.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testtypes.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/testutil.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/typefixture.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/update_data.cpython-314.pyc +Lib/site-packages/mypy/test/__pycache__/visitors.cpython-314.pyc +Lib/site-packages/mypy/test/config.py +Lib/site-packages/mypy/test/data.py +Lib/site-packages/mypy/test/helpers.py +Lib/site-packages/mypy/test/meta/__init__.py +Lib/site-packages/mypy/test/meta/__pycache__/__init__.cpython-314.pyc +Lib/site-packages/mypy/test/meta/__pycache__/_pytest.cpython-314.pyc +Lib/site-packages/mypy/test/meta/__pycache__/test_diff_helper.cpython-314.pyc +Lib/site-packages/mypy/test/meta/__pycache__/test_parse_data.cpython-314.pyc +Lib/site-packages/mypy/test/meta/__pycache__/test_update_data.cpython-314.pyc +Lib/site-packages/mypy/test/meta/_pytest.py +Lib/site-packages/mypy/test/meta/test_diff_helper.py +Lib/site-packages/mypy/test/meta/test_parse_data.py +Lib/site-packages/mypy/test/meta/test_update_data.py +Lib/site-packages/mypy/test/test_config_parser.py +Lib/site-packages/mypy/test/test_diff_cache.py +Lib/site-packages/mypy/test/test_find_sources.py +Lib/site-packages/mypy/test/test_nativeparse.py +Lib/site-packages/mypy/test/test_ref_info.py +Lib/site-packages/mypy/test/testapi.py +Lib/site-packages/mypy/test/testargs.py +Lib/site-packages/mypy/test/testcheck.py +Lib/site-packages/mypy/test/testcmdline.py +Lib/site-packages/mypy/test/testconstraints.py +Lib/site-packages/mypy/test/testdaemon.py +Lib/site-packages/mypy/test/testdeps.py +Lib/site-packages/mypy/test/testdiff.py +Lib/site-packages/mypy/test/testerrorstream.py +Lib/site-packages/mypy/test/testexportjson.py +Lib/site-packages/mypy/test/testfinegrained.py +Lib/site-packages/mypy/test/testfinegrainedcache.py +Lib/site-packages/mypy/test/testformatter.py +Lib/site-packages/mypy/test/testfscache.py +Lib/site-packages/mypy/test/testgraph.py +Lib/site-packages/mypy/test/testinfer.py +Lib/site-packages/mypy/test/testipc.py +Lib/site-packages/mypy/test/testmerge.py +Lib/site-packages/mypy/test/testmodulefinder.py +Lib/site-packages/mypy/test/testmypyc.py +Lib/site-packages/mypy/test/testoutput.py +Lib/site-packages/mypy/test/testparse.py +Lib/site-packages/mypy/test/testpep561.py +Lib/site-packages/mypy/test/testpythoneval.py +Lib/site-packages/mypy/test/testreports.py +Lib/site-packages/mypy/test/testsemanal.py +Lib/site-packages/mypy/test/testsolve.py +Lib/site-packages/mypy/test/teststubgen.py +Lib/site-packages/mypy/test/teststubinfo.py +Lib/site-packages/mypy/test/teststubtest.py +Lib/site-packages/mypy/test/testsubtypes.py +Lib/site-packages/mypy/test/testtransform.py +Lib/site-packages/mypy/test/testtypegen.py +Lib/site-packages/mypy/test/testtypes.py +Lib/site-packages/mypy/test/testutil.py +Lib/site-packages/mypy/test/typefixture.py +Lib/site-packages/mypy/test/update_data.py +Lib/site-packages/mypy/test/visitors.cp314t-win_amd64.pyd +Lib/site-packages/mypy/test/visitors.py +Lib/site-packages/mypy/traverser.cp314t-win_amd64.pyd +Lib/site-packages/mypy/traverser.py +Lib/site-packages/mypy/treetransform.cp314t-win_amd64.pyd +Lib/site-packages/mypy/treetransform.py +Lib/site-packages/mypy/tvar_scope.cp314t-win_amd64.pyd +Lib/site-packages/mypy/tvar_scope.py +Lib/site-packages/mypy/type_visitor.cp314t-win_amd64.pyd +Lib/site-packages/mypy/type_visitor.py +Lib/site-packages/mypy/typeanal.cp314t-win_amd64.pyd +Lib/site-packages/mypy/typeanal.py +Lib/site-packages/mypy/typeops.cp314t-win_amd64.pyd +Lib/site-packages/mypy/typeops.py +Lib/site-packages/mypy/types.cp314t-win_amd64.pyd +Lib/site-packages/mypy/types.py +Lib/site-packages/mypy/types_utils.cp314t-win_amd64.pyd +Lib/site-packages/mypy/types_utils.py +Lib/site-packages/mypy/typeshed/LICENSE +Lib/site-packages/mypy/typeshed/stdlib/VERSIONS +Lib/site-packages/mypy/typeshed/stdlib/__future__.pyi +Lib/site-packages/mypy/typeshed/stdlib/__main__.pyi +Lib/site-packages/mypy/typeshed/stdlib/_ast.pyi +Lib/site-packages/mypy/typeshed/stdlib/_asyncio.pyi +Lib/site-packages/mypy/typeshed/stdlib/_bisect.pyi +Lib/site-packages/mypy/typeshed/stdlib/_blake2.pyi +Lib/site-packages/mypy/typeshed/stdlib/_bootlocale.pyi +Lib/site-packages/mypy/typeshed/stdlib/_bz2.pyi +Lib/site-packages/mypy/typeshed/stdlib/_codecs.pyi +Lib/site-packages/mypy/typeshed/stdlib/_collections_abc.pyi +Lib/site-packages/mypy/typeshed/stdlib/_compat_pickle.pyi +Lib/site-packages/mypy/typeshed/stdlib/_compression.pyi +Lib/site-packages/mypy/typeshed/stdlib/_contextvars.pyi +Lib/site-packages/mypy/typeshed/stdlib/_csv.pyi +Lib/site-packages/mypy/typeshed/stdlib/_ctypes.pyi +Lib/site-packages/mypy/typeshed/stdlib/_curses.pyi +Lib/site-packages/mypy/typeshed/stdlib/_curses_panel.pyi +Lib/site-packages/mypy/typeshed/stdlib/_dbm.pyi +Lib/site-packages/mypy/typeshed/stdlib/_decimal.pyi +Lib/site-packages/mypy/typeshed/stdlib/_frozen_importlib.pyi +Lib/site-packages/mypy/typeshed/stdlib/_frozen_importlib_external.pyi +Lib/site-packages/mypy/typeshed/stdlib/_gdbm.pyi +Lib/site-packages/mypy/typeshed/stdlib/_hashlib.pyi +Lib/site-packages/mypy/typeshed/stdlib/_heapq.pyi +Lib/site-packages/mypy/typeshed/stdlib/_imp.pyi +Lib/site-packages/mypy/typeshed/stdlib/_interpchannels.pyi +Lib/site-packages/mypy/typeshed/stdlib/_interpqueues.pyi +Lib/site-packages/mypy/typeshed/stdlib/_interpreters.pyi +Lib/site-packages/mypy/typeshed/stdlib/_io.pyi +Lib/site-packages/mypy/typeshed/stdlib/_json.pyi +Lib/site-packages/mypy/typeshed/stdlib/_locale.pyi +Lib/site-packages/mypy/typeshed/stdlib/_lsprof.pyi +Lib/site-packages/mypy/typeshed/stdlib/_lzma.pyi +Lib/site-packages/mypy/typeshed/stdlib/_markupbase.pyi +Lib/site-packages/mypy/typeshed/stdlib/_msi.pyi +Lib/site-packages/mypy/typeshed/stdlib/_multibytecodec.pyi +Lib/site-packages/mypy/typeshed/stdlib/_operator.pyi +Lib/site-packages/mypy/typeshed/stdlib/_osx_support.pyi +Lib/site-packages/mypy/typeshed/stdlib/_pickle.pyi +Lib/site-packages/mypy/typeshed/stdlib/_posixsubprocess.pyi +Lib/site-packages/mypy/typeshed/stdlib/_py_abc.pyi +Lib/site-packages/mypy/typeshed/stdlib/_pydecimal.pyi +Lib/site-packages/mypy/typeshed/stdlib/_queue.pyi +Lib/site-packages/mypy/typeshed/stdlib/_random.pyi +Lib/site-packages/mypy/typeshed/stdlib/_sitebuiltins.pyi +Lib/site-packages/mypy/typeshed/stdlib/_socket.pyi +Lib/site-packages/mypy/typeshed/stdlib/_sqlite3.pyi +Lib/site-packages/mypy/typeshed/stdlib/_ssl.pyi +Lib/site-packages/mypy/typeshed/stdlib/_stat.pyi +Lib/site-packages/mypy/typeshed/stdlib/_struct.pyi +Lib/site-packages/mypy/typeshed/stdlib/_thread.pyi +Lib/site-packages/mypy/typeshed/stdlib/_threading_local.pyi +Lib/site-packages/mypy/typeshed/stdlib/_tkinter.pyi +Lib/site-packages/mypy/typeshed/stdlib/_tracemalloc.pyi +Lib/site-packages/mypy/typeshed/stdlib/_typeshed/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/_typeshed/_type_checker_internals.pyi +Lib/site-packages/mypy/typeshed/stdlib/_typeshed/dbapi.pyi +Lib/site-packages/mypy/typeshed/stdlib/_typeshed/importlib.pyi +Lib/site-packages/mypy/typeshed/stdlib/_typeshed/wsgi.pyi +Lib/site-packages/mypy/typeshed/stdlib/_typeshed/xml.pyi +Lib/site-packages/mypy/typeshed/stdlib/_warnings.pyi +Lib/site-packages/mypy/typeshed/stdlib/_weakref.pyi +Lib/site-packages/mypy/typeshed/stdlib/_weakrefset.pyi +Lib/site-packages/mypy/typeshed/stdlib/_winapi.pyi +Lib/site-packages/mypy/typeshed/stdlib/_zstd.pyi +Lib/site-packages/mypy/typeshed/stdlib/abc.pyi +Lib/site-packages/mypy/typeshed/stdlib/aifc.pyi +Lib/site-packages/mypy/typeshed/stdlib/annotationlib.pyi +Lib/site-packages/mypy/typeshed/stdlib/antigravity.pyi +Lib/site-packages/mypy/typeshed/stdlib/argparse.pyi +Lib/site-packages/mypy/typeshed/stdlib/array.pyi +Lib/site-packages/mypy/typeshed/stdlib/ast.pyi +Lib/site-packages/mypy/typeshed/stdlib/asynchat.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/base_events.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/base_futures.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/base_subprocess.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/base_tasks.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/constants.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/coroutines.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/events.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/exceptions.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/format_helpers.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/futures.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/graph.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/locks.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/log.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/mixins.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/proactor_events.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/protocols.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/queues.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/runners.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/selector_events.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/sslproto.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/staggered.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/streams.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/subprocess.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/taskgroups.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/tasks.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/threads.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/timeouts.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/tools.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/transports.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/trsock.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/unix_events.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/windows_events.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncio/windows_utils.pyi +Lib/site-packages/mypy/typeshed/stdlib/asyncore.pyi +Lib/site-packages/mypy/typeshed/stdlib/atexit.pyi +Lib/site-packages/mypy/typeshed/stdlib/audioop.pyi +Lib/site-packages/mypy/typeshed/stdlib/base64.pyi +Lib/site-packages/mypy/typeshed/stdlib/bdb.pyi +Lib/site-packages/mypy/typeshed/stdlib/binascii.pyi +Lib/site-packages/mypy/typeshed/stdlib/binhex.pyi +Lib/site-packages/mypy/typeshed/stdlib/bisect.pyi +Lib/site-packages/mypy/typeshed/stdlib/builtins.pyi +Lib/site-packages/mypy/typeshed/stdlib/bz2.pyi +Lib/site-packages/mypy/typeshed/stdlib/cProfile.pyi +Lib/site-packages/mypy/typeshed/stdlib/calendar.pyi +Lib/site-packages/mypy/typeshed/stdlib/cgi.pyi +Lib/site-packages/mypy/typeshed/stdlib/cgitb.pyi +Lib/site-packages/mypy/typeshed/stdlib/chunk.pyi +Lib/site-packages/mypy/typeshed/stdlib/cmath.pyi +Lib/site-packages/mypy/typeshed/stdlib/cmd.pyi +Lib/site-packages/mypy/typeshed/stdlib/code.pyi +Lib/site-packages/mypy/typeshed/stdlib/codecs.pyi +Lib/site-packages/mypy/typeshed/stdlib/codeop.pyi +Lib/site-packages/mypy/typeshed/stdlib/collections/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/collections/abc.pyi +Lib/site-packages/mypy/typeshed/stdlib/colorsys.pyi +Lib/site-packages/mypy/typeshed/stdlib/compileall.pyi +Lib/site-packages/mypy/typeshed/stdlib/compression/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/compression/_common/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/compression/_common/_streams.pyi +Lib/site-packages/mypy/typeshed/stdlib/compression/bz2.pyi +Lib/site-packages/mypy/typeshed/stdlib/compression/gzip.pyi +Lib/site-packages/mypy/typeshed/stdlib/compression/lzma.pyi +Lib/site-packages/mypy/typeshed/stdlib/compression/zlib.pyi +Lib/site-packages/mypy/typeshed/stdlib/compression/zstd/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/compression/zstd/_zstdfile.pyi +Lib/site-packages/mypy/typeshed/stdlib/concurrent/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/concurrent/futures/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/concurrent/futures/_base.pyi +Lib/site-packages/mypy/typeshed/stdlib/concurrent/futures/interpreter.pyi +Lib/site-packages/mypy/typeshed/stdlib/concurrent/futures/process.pyi +Lib/site-packages/mypy/typeshed/stdlib/concurrent/futures/thread.pyi +Lib/site-packages/mypy/typeshed/stdlib/concurrent/interpreters/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/concurrent/interpreters/_crossinterp.pyi +Lib/site-packages/mypy/typeshed/stdlib/concurrent/interpreters/_queues.pyi +Lib/site-packages/mypy/typeshed/stdlib/configparser.pyi +Lib/site-packages/mypy/typeshed/stdlib/contextlib.pyi +Lib/site-packages/mypy/typeshed/stdlib/contextvars.pyi +Lib/site-packages/mypy/typeshed/stdlib/copy.pyi +Lib/site-packages/mypy/typeshed/stdlib/copyreg.pyi +Lib/site-packages/mypy/typeshed/stdlib/crypt.pyi +Lib/site-packages/mypy/typeshed/stdlib/csv.pyi +Lib/site-packages/mypy/typeshed/stdlib/ctypes/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/ctypes/_endian.pyi +Lib/site-packages/mypy/typeshed/stdlib/ctypes/macholib/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/ctypes/macholib/dyld.pyi +Lib/site-packages/mypy/typeshed/stdlib/ctypes/macholib/dylib.pyi +Lib/site-packages/mypy/typeshed/stdlib/ctypes/macholib/framework.pyi +Lib/site-packages/mypy/typeshed/stdlib/ctypes/util.pyi +Lib/site-packages/mypy/typeshed/stdlib/ctypes/wintypes.pyi +Lib/site-packages/mypy/typeshed/stdlib/curses/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/curses/ascii.pyi +Lib/site-packages/mypy/typeshed/stdlib/curses/has_key.pyi +Lib/site-packages/mypy/typeshed/stdlib/curses/panel.pyi +Lib/site-packages/mypy/typeshed/stdlib/curses/textpad.pyi +Lib/site-packages/mypy/typeshed/stdlib/dataclasses.pyi +Lib/site-packages/mypy/typeshed/stdlib/datetime.pyi +Lib/site-packages/mypy/typeshed/stdlib/dbm/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/dbm/dumb.pyi +Lib/site-packages/mypy/typeshed/stdlib/dbm/gnu.pyi +Lib/site-packages/mypy/typeshed/stdlib/dbm/ndbm.pyi +Lib/site-packages/mypy/typeshed/stdlib/dbm/sqlite3.pyi +Lib/site-packages/mypy/typeshed/stdlib/decimal.pyi +Lib/site-packages/mypy/typeshed/stdlib/difflib.pyi +Lib/site-packages/mypy/typeshed/stdlib/dis.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/_msvccompiler.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/archive_util.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/bcppcompiler.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/ccompiler.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/cmd.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/command/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/command/bdist.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/command/bdist_dumb.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/command/bdist_msi.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/command/bdist_packager.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/command/bdist_rpm.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/command/bdist_wininst.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/command/build.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/command/build_clib.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/command/build_ext.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/command/build_py.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/command/build_scripts.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/command/check.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/command/clean.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/command/config.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/command/install.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/command/install_data.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/command/install_egg_info.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/command/install_headers.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/command/install_lib.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/command/install_scripts.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/command/register.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/command/sdist.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/command/upload.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/config.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/core.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/cygwinccompiler.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/debug.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/dep_util.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/dir_util.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/dist.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/errors.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/extension.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/fancy_getopt.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/file_util.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/filelist.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/log.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/msvccompiler.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/spawn.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/sysconfig.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/text_file.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/unixccompiler.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/util.pyi +Lib/site-packages/mypy/typeshed/stdlib/distutils/version.pyi +Lib/site-packages/mypy/typeshed/stdlib/doctest.pyi +Lib/site-packages/mypy/typeshed/stdlib/email/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/email/_header_value_parser.pyi +Lib/site-packages/mypy/typeshed/stdlib/email/_policybase.pyi +Lib/site-packages/mypy/typeshed/stdlib/email/base64mime.pyi +Lib/site-packages/mypy/typeshed/stdlib/email/charset.pyi +Lib/site-packages/mypy/typeshed/stdlib/email/contentmanager.pyi +Lib/site-packages/mypy/typeshed/stdlib/email/encoders.pyi +Lib/site-packages/mypy/typeshed/stdlib/email/errors.pyi +Lib/site-packages/mypy/typeshed/stdlib/email/feedparser.pyi +Lib/site-packages/mypy/typeshed/stdlib/email/generator.pyi +Lib/site-packages/mypy/typeshed/stdlib/email/header.pyi +Lib/site-packages/mypy/typeshed/stdlib/email/headerregistry.pyi +Lib/site-packages/mypy/typeshed/stdlib/email/iterators.pyi +Lib/site-packages/mypy/typeshed/stdlib/email/message.pyi +Lib/site-packages/mypy/typeshed/stdlib/email/mime/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/email/mime/application.pyi +Lib/site-packages/mypy/typeshed/stdlib/email/mime/audio.pyi +Lib/site-packages/mypy/typeshed/stdlib/email/mime/base.pyi +Lib/site-packages/mypy/typeshed/stdlib/email/mime/image.pyi +Lib/site-packages/mypy/typeshed/stdlib/email/mime/message.pyi +Lib/site-packages/mypy/typeshed/stdlib/email/mime/multipart.pyi +Lib/site-packages/mypy/typeshed/stdlib/email/mime/nonmultipart.pyi +Lib/site-packages/mypy/typeshed/stdlib/email/mime/text.pyi +Lib/site-packages/mypy/typeshed/stdlib/email/parser.pyi +Lib/site-packages/mypy/typeshed/stdlib/email/policy.pyi +Lib/site-packages/mypy/typeshed/stdlib/email/quoprimime.pyi +Lib/site-packages/mypy/typeshed/stdlib/email/utils.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/aliases.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/ascii.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/base64_codec.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/big5.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/big5hkscs.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/bz2_codec.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/charmap.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp037.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp1006.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp1026.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp1125.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp1140.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp1250.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp1251.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp1252.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp1253.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp1254.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp1255.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp1256.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp1257.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp1258.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp273.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp424.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp437.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp500.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp720.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp737.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp775.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp850.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp852.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp855.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp856.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp857.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp858.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp860.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp861.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp862.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp863.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp864.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp865.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp866.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp869.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp874.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp875.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp932.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp949.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/cp950.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/euc_jis_2004.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/euc_jisx0213.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/euc_jp.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/euc_kr.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/gb18030.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/gb2312.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/gbk.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/hex_codec.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/hp_roman8.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/hz.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/idna.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/iso2022_jp.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/iso2022_jp_1.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/iso2022_jp_2.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/iso2022_jp_2004.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/iso2022_jp_3.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/iso2022_jp_ext.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/iso2022_kr.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_1.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_10.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_11.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_13.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_14.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_15.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_16.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_2.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_3.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_4.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_5.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_6.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_7.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_8.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_9.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/johab.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/koi8_r.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/koi8_t.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/koi8_u.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/kz1048.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/latin_1.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/mac_arabic.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/mac_croatian.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/mac_cyrillic.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/mac_farsi.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/mac_greek.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/mac_iceland.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/mac_latin2.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/mac_roman.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/mac_romanian.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/mac_turkish.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/mbcs.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/oem.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/palmos.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/ptcp154.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/punycode.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/quopri_codec.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/raw_unicode_escape.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/rot_13.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/shift_jis.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/shift_jis_2004.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/shift_jisx0213.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/tis_620.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/undefined.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/unicode_escape.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/utf_16.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/utf_16_be.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/utf_16_le.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/utf_32.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/utf_32_be.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/utf_32_le.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/utf_7.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/utf_8.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/utf_8_sig.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/uu_codec.pyi +Lib/site-packages/mypy/typeshed/stdlib/encodings/zlib_codec.pyi +Lib/site-packages/mypy/typeshed/stdlib/ensurepip/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/enum.pyi +Lib/site-packages/mypy/typeshed/stdlib/errno.pyi +Lib/site-packages/mypy/typeshed/stdlib/faulthandler.pyi +Lib/site-packages/mypy/typeshed/stdlib/fcntl.pyi +Lib/site-packages/mypy/typeshed/stdlib/filecmp.pyi +Lib/site-packages/mypy/typeshed/stdlib/fileinput.pyi +Lib/site-packages/mypy/typeshed/stdlib/fnmatch.pyi +Lib/site-packages/mypy/typeshed/stdlib/formatter.pyi +Lib/site-packages/mypy/typeshed/stdlib/fractions.pyi +Lib/site-packages/mypy/typeshed/stdlib/ftplib.pyi +Lib/site-packages/mypy/typeshed/stdlib/functools.pyi +Lib/site-packages/mypy/typeshed/stdlib/gc.pyi +Lib/site-packages/mypy/typeshed/stdlib/genericpath.pyi +Lib/site-packages/mypy/typeshed/stdlib/getopt.pyi +Lib/site-packages/mypy/typeshed/stdlib/getpass.pyi +Lib/site-packages/mypy/typeshed/stdlib/gettext.pyi +Lib/site-packages/mypy/typeshed/stdlib/glob.pyi +Lib/site-packages/mypy/typeshed/stdlib/graphlib.pyi +Lib/site-packages/mypy/typeshed/stdlib/grp.pyi +Lib/site-packages/mypy/typeshed/stdlib/gzip.pyi +Lib/site-packages/mypy/typeshed/stdlib/hashlib.pyi +Lib/site-packages/mypy/typeshed/stdlib/heapq.pyi +Lib/site-packages/mypy/typeshed/stdlib/hmac.pyi +Lib/site-packages/mypy/typeshed/stdlib/html/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/html/entities.pyi +Lib/site-packages/mypy/typeshed/stdlib/html/parser.pyi +Lib/site-packages/mypy/typeshed/stdlib/http/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/http/client.pyi +Lib/site-packages/mypy/typeshed/stdlib/http/cookiejar.pyi +Lib/site-packages/mypy/typeshed/stdlib/http/cookies.pyi +Lib/site-packages/mypy/typeshed/stdlib/http/server.pyi +Lib/site-packages/mypy/typeshed/stdlib/imaplib.pyi +Lib/site-packages/mypy/typeshed/stdlib/imghdr.pyi +Lib/site-packages/mypy/typeshed/stdlib/imp.pyi +Lib/site-packages/mypy/typeshed/stdlib/importlib/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/importlib/_abc.pyi +Lib/site-packages/mypy/typeshed/stdlib/importlib/_bootstrap.pyi +Lib/site-packages/mypy/typeshed/stdlib/importlib/_bootstrap_external.pyi +Lib/site-packages/mypy/typeshed/stdlib/importlib/abc.pyi +Lib/site-packages/mypy/typeshed/stdlib/importlib/machinery.pyi +Lib/site-packages/mypy/typeshed/stdlib/importlib/metadata/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/importlib/metadata/_meta.pyi +Lib/site-packages/mypy/typeshed/stdlib/importlib/metadata/diagnose.pyi +Lib/site-packages/mypy/typeshed/stdlib/importlib/readers.pyi +Lib/site-packages/mypy/typeshed/stdlib/importlib/resources/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/importlib/resources/_common.pyi +Lib/site-packages/mypy/typeshed/stdlib/importlib/resources/_functional.pyi +Lib/site-packages/mypy/typeshed/stdlib/importlib/resources/abc.pyi +Lib/site-packages/mypy/typeshed/stdlib/importlib/resources/readers.pyi +Lib/site-packages/mypy/typeshed/stdlib/importlib/resources/simple.pyi +Lib/site-packages/mypy/typeshed/stdlib/importlib/simple.pyi +Lib/site-packages/mypy/typeshed/stdlib/importlib/util.pyi +Lib/site-packages/mypy/typeshed/stdlib/inspect.pyi +Lib/site-packages/mypy/typeshed/stdlib/io.pyi +Lib/site-packages/mypy/typeshed/stdlib/ipaddress.pyi +Lib/site-packages/mypy/typeshed/stdlib/itertools.pyi +Lib/site-packages/mypy/typeshed/stdlib/json/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/json/decoder.pyi +Lib/site-packages/mypy/typeshed/stdlib/json/encoder.pyi +Lib/site-packages/mypy/typeshed/stdlib/json/scanner.pyi +Lib/site-packages/mypy/typeshed/stdlib/json/tool.pyi +Lib/site-packages/mypy/typeshed/stdlib/keyword.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/btm_matcher.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixer_base.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_apply.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_asserts.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_basestring.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_buffer.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_dict.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_except.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_exec.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_execfile.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_exitfunc.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_filter.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_funcattrs.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_future.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_getcwdu.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_has_key.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_idioms.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_import.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_imports.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_imports2.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_input.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_intern.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_isinstance.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_itertools.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_itertools_imports.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_long.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_map.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_metaclass.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_methodattrs.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_ne.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_next.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_nonzero.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_numliterals.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_operator.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_paren.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_print.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_raise.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_raw_input.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_reduce.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_reload.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_renames.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_repr.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_set_literal.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_standarderror.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_sys_exc.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_throw.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_tuple_params.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_types.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_unicode.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_urllib.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_ws_comma.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_xrange.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_xreadlines.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_zip.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/main.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/pgen2/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/pgen2/driver.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/pgen2/grammar.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/pgen2/literals.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/pgen2/parse.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/pgen2/pgen.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/pgen2/token.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/pgen2/tokenize.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/pygram.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/pytree.pyi +Lib/site-packages/mypy/typeshed/stdlib/lib2to3/refactor.pyi +Lib/site-packages/mypy/typeshed/stdlib/linecache.pyi +Lib/site-packages/mypy/typeshed/stdlib/locale.pyi +Lib/site-packages/mypy/typeshed/stdlib/logging/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/logging/config.pyi +Lib/site-packages/mypy/typeshed/stdlib/logging/handlers.pyi +Lib/site-packages/mypy/typeshed/stdlib/lzma.pyi +Lib/site-packages/mypy/typeshed/stdlib/mailbox.pyi +Lib/site-packages/mypy/typeshed/stdlib/mailcap.pyi +Lib/site-packages/mypy/typeshed/stdlib/marshal.pyi +Lib/site-packages/mypy/typeshed/stdlib/math.pyi +Lib/site-packages/mypy/typeshed/stdlib/mimetypes.pyi +Lib/site-packages/mypy/typeshed/stdlib/mmap.pyi +Lib/site-packages/mypy/typeshed/stdlib/modulefinder.pyi +Lib/site-packages/mypy/typeshed/stdlib/msilib/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/msilib/schema.pyi +Lib/site-packages/mypy/typeshed/stdlib/msilib/sequence.pyi +Lib/site-packages/mypy/typeshed/stdlib/msilib/text.pyi +Lib/site-packages/mypy/typeshed/stdlib/msvcrt.pyi +Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/connection.pyi +Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/context.pyi +Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/dummy/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/dummy/connection.pyi +Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/forkserver.pyi +Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/heap.pyi +Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/managers.pyi +Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/pool.pyi +Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/popen_fork.pyi +Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/popen_forkserver.pyi +Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/popen_spawn_posix.pyi +Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/popen_spawn_win32.pyi +Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/process.pyi +Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/queues.pyi +Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/reduction.pyi +Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/resource_sharer.pyi +Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/resource_tracker.pyi +Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/shared_memory.pyi +Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/sharedctypes.pyi +Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/spawn.pyi +Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/synchronize.pyi +Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/util.pyi +Lib/site-packages/mypy/typeshed/stdlib/netrc.pyi +Lib/site-packages/mypy/typeshed/stdlib/nis.pyi +Lib/site-packages/mypy/typeshed/stdlib/nntplib.pyi +Lib/site-packages/mypy/typeshed/stdlib/nt.pyi +Lib/site-packages/mypy/typeshed/stdlib/ntpath.pyi +Lib/site-packages/mypy/typeshed/stdlib/nturl2path.pyi +Lib/site-packages/mypy/typeshed/stdlib/numbers.pyi +Lib/site-packages/mypy/typeshed/stdlib/opcode.pyi +Lib/site-packages/mypy/typeshed/stdlib/operator.pyi +Lib/site-packages/mypy/typeshed/stdlib/optparse.pyi +Lib/site-packages/mypy/typeshed/stdlib/os/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/os/path.pyi +Lib/site-packages/mypy/typeshed/stdlib/ossaudiodev.pyi +Lib/site-packages/mypy/typeshed/stdlib/parser.pyi +Lib/site-packages/mypy/typeshed/stdlib/pathlib/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/pathlib/types.pyi +Lib/site-packages/mypy/typeshed/stdlib/pdb.pyi +Lib/site-packages/mypy/typeshed/stdlib/pickle.pyi +Lib/site-packages/mypy/typeshed/stdlib/pickletools.pyi +Lib/site-packages/mypy/typeshed/stdlib/pipes.pyi +Lib/site-packages/mypy/typeshed/stdlib/pkgutil.pyi +Lib/site-packages/mypy/typeshed/stdlib/platform.pyi +Lib/site-packages/mypy/typeshed/stdlib/plistlib.pyi +Lib/site-packages/mypy/typeshed/stdlib/poplib.pyi +Lib/site-packages/mypy/typeshed/stdlib/posix.pyi +Lib/site-packages/mypy/typeshed/stdlib/posixpath.pyi +Lib/site-packages/mypy/typeshed/stdlib/pprint.pyi +Lib/site-packages/mypy/typeshed/stdlib/profile.pyi +Lib/site-packages/mypy/typeshed/stdlib/pstats.pyi +Lib/site-packages/mypy/typeshed/stdlib/pty.pyi +Lib/site-packages/mypy/typeshed/stdlib/pwd.pyi +Lib/site-packages/mypy/typeshed/stdlib/py_compile.pyi +Lib/site-packages/mypy/typeshed/stdlib/pyclbr.pyi +Lib/site-packages/mypy/typeshed/stdlib/pydoc.pyi +Lib/site-packages/mypy/typeshed/stdlib/pydoc_data/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/pydoc_data/module_docs.pyi +Lib/site-packages/mypy/typeshed/stdlib/pydoc_data/topics.pyi +Lib/site-packages/mypy/typeshed/stdlib/pyexpat/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/pyexpat/errors.pyi +Lib/site-packages/mypy/typeshed/stdlib/pyexpat/model.pyi +Lib/site-packages/mypy/typeshed/stdlib/queue.pyi +Lib/site-packages/mypy/typeshed/stdlib/quopri.pyi +Lib/site-packages/mypy/typeshed/stdlib/random.pyi +Lib/site-packages/mypy/typeshed/stdlib/re.pyi +Lib/site-packages/mypy/typeshed/stdlib/readline.pyi +Lib/site-packages/mypy/typeshed/stdlib/reprlib.pyi +Lib/site-packages/mypy/typeshed/stdlib/resource.pyi +Lib/site-packages/mypy/typeshed/stdlib/rlcompleter.pyi +Lib/site-packages/mypy/typeshed/stdlib/runpy.pyi +Lib/site-packages/mypy/typeshed/stdlib/sched.pyi +Lib/site-packages/mypy/typeshed/stdlib/secrets.pyi +Lib/site-packages/mypy/typeshed/stdlib/select.pyi +Lib/site-packages/mypy/typeshed/stdlib/selectors.pyi +Lib/site-packages/mypy/typeshed/stdlib/shelve.pyi +Lib/site-packages/mypy/typeshed/stdlib/shlex.pyi +Lib/site-packages/mypy/typeshed/stdlib/shutil.pyi +Lib/site-packages/mypy/typeshed/stdlib/signal.pyi +Lib/site-packages/mypy/typeshed/stdlib/site.pyi +Lib/site-packages/mypy/typeshed/stdlib/smtpd.pyi +Lib/site-packages/mypy/typeshed/stdlib/smtplib.pyi +Lib/site-packages/mypy/typeshed/stdlib/sndhdr.pyi +Lib/site-packages/mypy/typeshed/stdlib/socket.pyi +Lib/site-packages/mypy/typeshed/stdlib/socketserver.pyi +Lib/site-packages/mypy/typeshed/stdlib/spwd.pyi +Lib/site-packages/mypy/typeshed/stdlib/sqlite3/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/sqlite3/dbapi2.pyi +Lib/site-packages/mypy/typeshed/stdlib/sqlite3/dump.pyi +Lib/site-packages/mypy/typeshed/stdlib/sre_compile.pyi +Lib/site-packages/mypy/typeshed/stdlib/sre_constants.pyi +Lib/site-packages/mypy/typeshed/stdlib/sre_parse.pyi +Lib/site-packages/mypy/typeshed/stdlib/ssl.pyi +Lib/site-packages/mypy/typeshed/stdlib/stat.pyi +Lib/site-packages/mypy/typeshed/stdlib/statistics.pyi +Lib/site-packages/mypy/typeshed/stdlib/string/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/string/templatelib.pyi +Lib/site-packages/mypy/typeshed/stdlib/stringprep.pyi +Lib/site-packages/mypy/typeshed/stdlib/struct.pyi +Lib/site-packages/mypy/typeshed/stdlib/subprocess.pyi +Lib/site-packages/mypy/typeshed/stdlib/sunau.pyi +Lib/site-packages/mypy/typeshed/stdlib/symbol.pyi +Lib/site-packages/mypy/typeshed/stdlib/symtable.pyi +Lib/site-packages/mypy/typeshed/stdlib/sys/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/sys/_monitoring.pyi +Lib/site-packages/mypy/typeshed/stdlib/sysconfig.pyi +Lib/site-packages/mypy/typeshed/stdlib/syslog.pyi +Lib/site-packages/mypy/typeshed/stdlib/tabnanny.pyi +Lib/site-packages/mypy/typeshed/stdlib/tarfile.pyi +Lib/site-packages/mypy/typeshed/stdlib/telnetlib.pyi +Lib/site-packages/mypy/typeshed/stdlib/tempfile.pyi +Lib/site-packages/mypy/typeshed/stdlib/termios.pyi +Lib/site-packages/mypy/typeshed/stdlib/textwrap.pyi +Lib/site-packages/mypy/typeshed/stdlib/this.pyi +Lib/site-packages/mypy/typeshed/stdlib/threading.pyi +Lib/site-packages/mypy/typeshed/stdlib/time.pyi +Lib/site-packages/mypy/typeshed/stdlib/timeit.pyi +Lib/site-packages/mypy/typeshed/stdlib/tkinter/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/tkinter/colorchooser.pyi +Lib/site-packages/mypy/typeshed/stdlib/tkinter/commondialog.pyi +Lib/site-packages/mypy/typeshed/stdlib/tkinter/constants.pyi +Lib/site-packages/mypy/typeshed/stdlib/tkinter/dialog.pyi +Lib/site-packages/mypy/typeshed/stdlib/tkinter/dnd.pyi +Lib/site-packages/mypy/typeshed/stdlib/tkinter/filedialog.pyi +Lib/site-packages/mypy/typeshed/stdlib/tkinter/font.pyi +Lib/site-packages/mypy/typeshed/stdlib/tkinter/messagebox.pyi +Lib/site-packages/mypy/typeshed/stdlib/tkinter/scrolledtext.pyi +Lib/site-packages/mypy/typeshed/stdlib/tkinter/simpledialog.pyi +Lib/site-packages/mypy/typeshed/stdlib/tkinter/tix.pyi +Lib/site-packages/mypy/typeshed/stdlib/tkinter/ttk.pyi +Lib/site-packages/mypy/typeshed/stdlib/token.pyi +Lib/site-packages/mypy/typeshed/stdlib/tokenize.pyi +Lib/site-packages/mypy/typeshed/stdlib/tomllib.pyi +Lib/site-packages/mypy/typeshed/stdlib/trace.pyi +Lib/site-packages/mypy/typeshed/stdlib/traceback.pyi +Lib/site-packages/mypy/typeshed/stdlib/tracemalloc.pyi +Lib/site-packages/mypy/typeshed/stdlib/tty.pyi +Lib/site-packages/mypy/typeshed/stdlib/turtle.pyi +Lib/site-packages/mypy/typeshed/stdlib/types.pyi +Lib/site-packages/mypy/typeshed/stdlib/typing.pyi +Lib/site-packages/mypy/typeshed/stdlib/typing_extensions.pyi +Lib/site-packages/mypy/typeshed/stdlib/unicodedata.pyi +Lib/site-packages/mypy/typeshed/stdlib/unittest/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/unittest/_log.pyi +Lib/site-packages/mypy/typeshed/stdlib/unittest/async_case.pyi +Lib/site-packages/mypy/typeshed/stdlib/unittest/case.pyi +Lib/site-packages/mypy/typeshed/stdlib/unittest/loader.pyi +Lib/site-packages/mypy/typeshed/stdlib/unittest/main.pyi +Lib/site-packages/mypy/typeshed/stdlib/unittest/mock.pyi +Lib/site-packages/mypy/typeshed/stdlib/unittest/result.pyi +Lib/site-packages/mypy/typeshed/stdlib/unittest/runner.pyi +Lib/site-packages/mypy/typeshed/stdlib/unittest/signals.pyi +Lib/site-packages/mypy/typeshed/stdlib/unittest/suite.pyi +Lib/site-packages/mypy/typeshed/stdlib/unittest/util.pyi +Lib/site-packages/mypy/typeshed/stdlib/urllib/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/urllib/error.pyi +Lib/site-packages/mypy/typeshed/stdlib/urllib/parse.pyi +Lib/site-packages/mypy/typeshed/stdlib/urllib/request.pyi +Lib/site-packages/mypy/typeshed/stdlib/urllib/response.pyi +Lib/site-packages/mypy/typeshed/stdlib/urllib/robotparser.pyi +Lib/site-packages/mypy/typeshed/stdlib/uu.pyi +Lib/site-packages/mypy/typeshed/stdlib/uuid.pyi +Lib/site-packages/mypy/typeshed/stdlib/venv/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/warnings.pyi +Lib/site-packages/mypy/typeshed/stdlib/wave.pyi +Lib/site-packages/mypy/typeshed/stdlib/weakref.pyi +Lib/site-packages/mypy/typeshed/stdlib/webbrowser.pyi +Lib/site-packages/mypy/typeshed/stdlib/winreg.pyi +Lib/site-packages/mypy/typeshed/stdlib/winsound.pyi +Lib/site-packages/mypy/typeshed/stdlib/wsgiref/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/wsgiref/handlers.pyi +Lib/site-packages/mypy/typeshed/stdlib/wsgiref/headers.pyi +Lib/site-packages/mypy/typeshed/stdlib/wsgiref/simple_server.pyi +Lib/site-packages/mypy/typeshed/stdlib/wsgiref/types.pyi +Lib/site-packages/mypy/typeshed/stdlib/wsgiref/util.pyi +Lib/site-packages/mypy/typeshed/stdlib/wsgiref/validate.pyi +Lib/site-packages/mypy/typeshed/stdlib/xdrlib.pyi +Lib/site-packages/mypy/typeshed/stdlib/xml/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/xml/dom/NodeFilter.pyi +Lib/site-packages/mypy/typeshed/stdlib/xml/dom/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/xml/dom/domreg.pyi +Lib/site-packages/mypy/typeshed/stdlib/xml/dom/expatbuilder.pyi +Lib/site-packages/mypy/typeshed/stdlib/xml/dom/minicompat.pyi +Lib/site-packages/mypy/typeshed/stdlib/xml/dom/minidom.pyi +Lib/site-packages/mypy/typeshed/stdlib/xml/dom/pulldom.pyi +Lib/site-packages/mypy/typeshed/stdlib/xml/dom/xmlbuilder.pyi +Lib/site-packages/mypy/typeshed/stdlib/xml/etree/ElementInclude.pyi +Lib/site-packages/mypy/typeshed/stdlib/xml/etree/ElementPath.pyi +Lib/site-packages/mypy/typeshed/stdlib/xml/etree/ElementTree.pyi +Lib/site-packages/mypy/typeshed/stdlib/xml/etree/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/xml/etree/cElementTree.pyi +Lib/site-packages/mypy/typeshed/stdlib/xml/parsers/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/xml/parsers/expat/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/xml/parsers/expat/errors.pyi +Lib/site-packages/mypy/typeshed/stdlib/xml/parsers/expat/model.pyi +Lib/site-packages/mypy/typeshed/stdlib/xml/sax/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/xml/sax/_exceptions.pyi +Lib/site-packages/mypy/typeshed/stdlib/xml/sax/expatreader.pyi +Lib/site-packages/mypy/typeshed/stdlib/xml/sax/handler.pyi +Lib/site-packages/mypy/typeshed/stdlib/xml/sax/saxutils.pyi +Lib/site-packages/mypy/typeshed/stdlib/xml/sax/xmlreader.pyi +Lib/site-packages/mypy/typeshed/stdlib/xmlrpc/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/xmlrpc/client.pyi +Lib/site-packages/mypy/typeshed/stdlib/xmlrpc/server.pyi +Lib/site-packages/mypy/typeshed/stdlib/xxlimited.pyi +Lib/site-packages/mypy/typeshed/stdlib/zipapp.pyi +Lib/site-packages/mypy/typeshed/stdlib/zipfile/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/zipfile/_path/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/zipfile/_path/glob.pyi +Lib/site-packages/mypy/typeshed/stdlib/zipimport.pyi +Lib/site-packages/mypy/typeshed/stdlib/zlib.pyi +Lib/site-packages/mypy/typeshed/stdlib/zoneinfo/__init__.pyi +Lib/site-packages/mypy/typeshed/stdlib/zoneinfo/_common.pyi +Lib/site-packages/mypy/typeshed/stdlib/zoneinfo/_tzpath.pyi +Lib/site-packages/mypy/typeshed/stubs/librt/librt/__init__.pyi +Lib/site-packages/mypy/typeshed/stubs/librt/librt/base64.pyi +Lib/site-packages/mypy/typeshed/stubs/librt/librt/internal.pyi +Lib/site-packages/mypy/typeshed/stubs/librt/librt/strings.pyi +Lib/site-packages/mypy/typeshed/stubs/librt/librt/time.pyi +Lib/site-packages/mypy/typeshed/stubs/librt/librt/vecs.pyi +Lib/site-packages/mypy/typeshed/stubs/mypy-extensions/mypy_extensions.pyi +Lib/site-packages/mypy/typestate.cp314t-win_amd64.pyd +Lib/site-packages/mypy/typestate.py +Lib/site-packages/mypy/typetraverser.cp314t-win_amd64.pyd +Lib/site-packages/mypy/typetraverser.py +Lib/site-packages/mypy/typevars.cp314t-win_amd64.pyd +Lib/site-packages/mypy/typevars.py +Lib/site-packages/mypy/typevartuples.cp314t-win_amd64.pyd +Lib/site-packages/mypy/typevartuples.py +Lib/site-packages/mypy/util.cp314t-win_amd64.pyd +Lib/site-packages/mypy/util.py +Lib/site-packages/mypy/version.py +Lib/site-packages/mypy/visitor.cp314t-win_amd64.pyd +Lib/site-packages/mypy/visitor.py +Lib/site-packages/mypy/xml/mypy-html.css +Lib/site-packages/mypy/xml/mypy-html.xslt +Lib/site-packages/mypy/xml/mypy-txt.xslt +Lib/site-packages/mypy/xml/mypy.xsd +Lib/site-packages/mypyc/__init__.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/__init__.py +Lib/site-packages/mypyc/__main__.py +Lib/site-packages/mypyc/__pycache__/__init__.cpython-314.pyc +Lib/site-packages/mypyc/__pycache__/__main__.cpython-314.pyc +Lib/site-packages/mypyc/__pycache__/annotate.cpython-314.pyc +Lib/site-packages/mypyc/__pycache__/build.cpython-314.pyc +Lib/site-packages/mypyc/__pycache__/build_setup.cpython-314.pyc +Lib/site-packages/mypyc/__pycache__/common.cpython-314.pyc +Lib/site-packages/mypyc/__pycache__/crash.cpython-314.pyc +Lib/site-packages/mypyc/__pycache__/errors.cpython-314.pyc +Lib/site-packages/mypyc/__pycache__/namegen.cpython-314.pyc +Lib/site-packages/mypyc/__pycache__/options.cpython-314.pyc +Lib/site-packages/mypyc/__pycache__/rt_subtype.cpython-314.pyc +Lib/site-packages/mypyc/__pycache__/sametype.cpython-314.pyc +Lib/site-packages/mypyc/__pycache__/subtype.cpython-314.pyc +Lib/site-packages/mypyc/analysis/__init__.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/analysis/__init__.py +Lib/site-packages/mypyc/analysis/__pycache__/__init__.cpython-314.pyc +Lib/site-packages/mypyc/analysis/__pycache__/attrdefined.cpython-314.pyc +Lib/site-packages/mypyc/analysis/__pycache__/blockfreq.cpython-314.pyc +Lib/site-packages/mypyc/analysis/__pycache__/capsule_deps.cpython-314.pyc +Lib/site-packages/mypyc/analysis/__pycache__/dataflow.cpython-314.pyc +Lib/site-packages/mypyc/analysis/__pycache__/ircheck.cpython-314.pyc +Lib/site-packages/mypyc/analysis/__pycache__/selfleaks.cpython-314.pyc +Lib/site-packages/mypyc/analysis/attrdefined.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/analysis/attrdefined.py +Lib/site-packages/mypyc/analysis/blockfreq.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/analysis/blockfreq.py +Lib/site-packages/mypyc/analysis/capsule_deps.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/analysis/capsule_deps.py +Lib/site-packages/mypyc/analysis/dataflow.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/analysis/dataflow.py +Lib/site-packages/mypyc/analysis/ircheck.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/analysis/ircheck.py +Lib/site-packages/mypyc/analysis/selfleaks.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/analysis/selfleaks.py +Lib/site-packages/mypyc/annotate.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/annotate.py +Lib/site-packages/mypyc/build.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/build.py +Lib/site-packages/mypyc/build_setup.py +Lib/site-packages/mypyc/codegen/__init__.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/codegen/__init__.py +Lib/site-packages/mypyc/codegen/__pycache__/__init__.cpython-314.pyc +Lib/site-packages/mypyc/codegen/__pycache__/cstring.cpython-314.pyc +Lib/site-packages/mypyc/codegen/__pycache__/emit.cpython-314.pyc +Lib/site-packages/mypyc/codegen/__pycache__/emitclass.cpython-314.pyc +Lib/site-packages/mypyc/codegen/__pycache__/emitfunc.cpython-314.pyc +Lib/site-packages/mypyc/codegen/__pycache__/emitmodule.cpython-314.pyc +Lib/site-packages/mypyc/codegen/__pycache__/emitwrapper.cpython-314.pyc +Lib/site-packages/mypyc/codegen/__pycache__/literals.cpython-314.pyc +Lib/site-packages/mypyc/codegen/cstring.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/codegen/cstring.py +Lib/site-packages/mypyc/codegen/emit.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/codegen/emit.py +Lib/site-packages/mypyc/codegen/emitclass.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/codegen/emitclass.py +Lib/site-packages/mypyc/codegen/emitfunc.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/codegen/emitfunc.py +Lib/site-packages/mypyc/codegen/emitmodule.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/codegen/emitmodule.py +Lib/site-packages/mypyc/codegen/emitwrapper.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/codegen/emitwrapper.py +Lib/site-packages/mypyc/codegen/literals.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/codegen/literals.py +Lib/site-packages/mypyc/common.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/common.py +Lib/site-packages/mypyc/crash.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/crash.py +Lib/site-packages/mypyc/errors.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/errors.py +Lib/site-packages/mypyc/ir/__init__.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/ir/__init__.py +Lib/site-packages/mypyc/ir/__pycache__/__init__.cpython-314.pyc +Lib/site-packages/mypyc/ir/__pycache__/class_ir.cpython-314.pyc +Lib/site-packages/mypyc/ir/__pycache__/deps.cpython-314.pyc +Lib/site-packages/mypyc/ir/__pycache__/func_ir.cpython-314.pyc +Lib/site-packages/mypyc/ir/__pycache__/module_ir.cpython-314.pyc +Lib/site-packages/mypyc/ir/__pycache__/ops.cpython-314.pyc +Lib/site-packages/mypyc/ir/__pycache__/pprint.cpython-314.pyc +Lib/site-packages/mypyc/ir/__pycache__/rtypes.cpython-314.pyc +Lib/site-packages/mypyc/ir/class_ir.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/ir/class_ir.py +Lib/site-packages/mypyc/ir/deps.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/ir/deps.py +Lib/site-packages/mypyc/ir/func_ir.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/ir/func_ir.py +Lib/site-packages/mypyc/ir/module_ir.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/ir/module_ir.py +Lib/site-packages/mypyc/ir/ops.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/ir/ops.py +Lib/site-packages/mypyc/ir/pprint.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/ir/pprint.py +Lib/site-packages/mypyc/ir/rtypes.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/ir/rtypes.py +Lib/site-packages/mypyc/irbuild/__init__.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/__init__.py +Lib/site-packages/mypyc/irbuild/__pycache__/__init__.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/__pycache__/ast_helpers.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/__pycache__/builder.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/__pycache__/callable_class.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/__pycache__/classdef.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/__pycache__/constant_fold.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/__pycache__/context.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/__pycache__/env_class.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/__pycache__/expression.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/__pycache__/for_helpers.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/__pycache__/format_str_tokenizer.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/__pycache__/function.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/__pycache__/generator.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/__pycache__/ll_builder.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/__pycache__/main.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/__pycache__/mapper.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/__pycache__/match.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/__pycache__/missingtypevisitor.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/__pycache__/nonlocalcontrol.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/__pycache__/prebuildvisitor.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/__pycache__/prepare.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/__pycache__/specialize.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/__pycache__/statement.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/__pycache__/targets.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/__pycache__/util.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/__pycache__/vec.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/__pycache__/visitor.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/__pycache__/vtable.cpython-314.pyc +Lib/site-packages/mypyc/irbuild/ast_helpers.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/ast_helpers.py +Lib/site-packages/mypyc/irbuild/builder.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/builder.py +Lib/site-packages/mypyc/irbuild/callable_class.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/callable_class.py +Lib/site-packages/mypyc/irbuild/classdef.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/classdef.py +Lib/site-packages/mypyc/irbuild/constant_fold.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/constant_fold.py +Lib/site-packages/mypyc/irbuild/context.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/context.py +Lib/site-packages/mypyc/irbuild/env_class.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/env_class.py +Lib/site-packages/mypyc/irbuild/expression.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/expression.py +Lib/site-packages/mypyc/irbuild/for_helpers.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/for_helpers.py +Lib/site-packages/mypyc/irbuild/format_str_tokenizer.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/format_str_tokenizer.py +Lib/site-packages/mypyc/irbuild/function.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/function.py +Lib/site-packages/mypyc/irbuild/generator.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/generator.py +Lib/site-packages/mypyc/irbuild/ll_builder.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/ll_builder.py +Lib/site-packages/mypyc/irbuild/main.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/main.py +Lib/site-packages/mypyc/irbuild/mapper.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/mapper.py +Lib/site-packages/mypyc/irbuild/match.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/match.py +Lib/site-packages/mypyc/irbuild/missingtypevisitor.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/missingtypevisitor.py +Lib/site-packages/mypyc/irbuild/nonlocalcontrol.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/nonlocalcontrol.py +Lib/site-packages/mypyc/irbuild/prebuildvisitor.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/prebuildvisitor.py +Lib/site-packages/mypyc/irbuild/prepare.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/prepare.py +Lib/site-packages/mypyc/irbuild/specialize.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/specialize.py +Lib/site-packages/mypyc/irbuild/statement.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/statement.py +Lib/site-packages/mypyc/irbuild/targets.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/targets.py +Lib/site-packages/mypyc/irbuild/util.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/util.py +Lib/site-packages/mypyc/irbuild/vec.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/vec.py +Lib/site-packages/mypyc/irbuild/visitor.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/visitor.py +Lib/site-packages/mypyc/irbuild/vtable.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/irbuild/vtable.py +Lib/site-packages/mypyc/lib-rt/CPy.h +Lib/site-packages/mypyc/lib-rt/__pycache__/build_setup.cpython-314.pyc +Lib/site-packages/mypyc/lib-rt/base64/arch/avx/codec.c +Lib/site-packages/mypyc/lib-rt/base64/arch/avx/enc_loop_asm.c +Lib/site-packages/mypyc/lib-rt/base64/arch/avx2/codec.c +Lib/site-packages/mypyc/lib-rt/base64/arch/avx2/dec_loop.c +Lib/site-packages/mypyc/lib-rt/base64/arch/avx2/dec_reshuffle.c +Lib/site-packages/mypyc/lib-rt/base64/arch/avx2/enc_loop.c +Lib/site-packages/mypyc/lib-rt/base64/arch/avx2/enc_loop_asm.c +Lib/site-packages/mypyc/lib-rt/base64/arch/avx2/enc_reshuffle.c +Lib/site-packages/mypyc/lib-rt/base64/arch/avx2/enc_translate.c +Lib/site-packages/mypyc/lib-rt/base64/arch/avx512/codec.c +Lib/site-packages/mypyc/lib-rt/base64/arch/avx512/enc_loop.c +Lib/site-packages/mypyc/lib-rt/base64/arch/avx512/enc_reshuffle_translate.c +Lib/site-packages/mypyc/lib-rt/base64/arch/generic/32/dec_loop.c +Lib/site-packages/mypyc/lib-rt/base64/arch/generic/32/enc_loop.c +Lib/site-packages/mypyc/lib-rt/base64/arch/generic/64/enc_loop.c +Lib/site-packages/mypyc/lib-rt/base64/arch/generic/codec.c +Lib/site-packages/mypyc/lib-rt/base64/arch/generic/dec_head.c +Lib/site-packages/mypyc/lib-rt/base64/arch/generic/dec_tail.c +Lib/site-packages/mypyc/lib-rt/base64/arch/generic/enc_head.c +Lib/site-packages/mypyc/lib-rt/base64/arch/generic/enc_tail.c +Lib/site-packages/mypyc/lib-rt/base64/arch/neon32/codec.c +Lib/site-packages/mypyc/lib-rt/base64/arch/neon32/dec_loop.c +Lib/site-packages/mypyc/lib-rt/base64/arch/neon32/enc_loop.c +Lib/site-packages/mypyc/lib-rt/base64/arch/neon32/enc_reshuffle.c +Lib/site-packages/mypyc/lib-rt/base64/arch/neon32/enc_translate.c +Lib/site-packages/mypyc/lib-rt/base64/arch/neon64/codec.c +Lib/site-packages/mypyc/lib-rt/base64/arch/neon64/dec_loop.c +Lib/site-packages/mypyc/lib-rt/base64/arch/neon64/enc_loop.c +Lib/site-packages/mypyc/lib-rt/base64/arch/neon64/enc_loop_asm.c +Lib/site-packages/mypyc/lib-rt/base64/arch/neon64/enc_reshuffle.c +Lib/site-packages/mypyc/lib-rt/base64/arch/sse41/codec.c +Lib/site-packages/mypyc/lib-rt/base64/arch/sse42/codec.c +Lib/site-packages/mypyc/lib-rt/base64/arch/ssse3/codec.c +Lib/site-packages/mypyc/lib-rt/base64/arch/ssse3/dec_loop.c +Lib/site-packages/mypyc/lib-rt/base64/arch/ssse3/dec_reshuffle.c +Lib/site-packages/mypyc/lib-rt/base64/arch/ssse3/enc_loop.c +Lib/site-packages/mypyc/lib-rt/base64/arch/ssse3/enc_loop_asm.c +Lib/site-packages/mypyc/lib-rt/base64/arch/ssse3/enc_reshuffle.c +Lib/site-packages/mypyc/lib-rt/base64/arch/ssse3/enc_translate.c +Lib/site-packages/mypyc/lib-rt/base64/codec_choose.c +Lib/site-packages/mypyc/lib-rt/base64/codecs.h +Lib/site-packages/mypyc/lib-rt/base64/config.h +Lib/site-packages/mypyc/lib-rt/base64/env.h +Lib/site-packages/mypyc/lib-rt/base64/lib.c +Lib/site-packages/mypyc/lib-rt/base64/lib_openmp.c +Lib/site-packages/mypyc/lib-rt/base64/libbase64.h +Lib/site-packages/mypyc/lib-rt/base64/librt_base64.c +Lib/site-packages/mypyc/lib-rt/base64/librt_base64.h +Lib/site-packages/mypyc/lib-rt/base64/tables/table_dec_32bit.h +Lib/site-packages/mypyc/lib-rt/base64/tables/table_enc_12bit.h +Lib/site-packages/mypyc/lib-rt/base64/tables/tables.c +Lib/site-packages/mypyc/lib-rt/base64/tables/tables.h +Lib/site-packages/mypyc/lib-rt/build_setup.py +Lib/site-packages/mypyc/lib-rt/bytearray_extra_ops.c +Lib/site-packages/mypyc/lib-rt/bytearray_extra_ops.h +Lib/site-packages/mypyc/lib-rt/bytes_extra_ops.c +Lib/site-packages/mypyc/lib-rt/bytes_extra_ops.h +Lib/site-packages/mypyc/lib-rt/bytes_ops.c +Lib/site-packages/mypyc/lib-rt/byteswriter_extra_ops.c +Lib/site-packages/mypyc/lib-rt/byteswriter_extra_ops.h +Lib/site-packages/mypyc/lib-rt/dict_ops.c +Lib/site-packages/mypyc/lib-rt/exc_ops.c +Lib/site-packages/mypyc/lib-rt/float_ops.c +Lib/site-packages/mypyc/lib-rt/function_wrapper.c +Lib/site-packages/mypyc/lib-rt/generic_ops.c +Lib/site-packages/mypyc/lib-rt/getargs.c +Lib/site-packages/mypyc/lib-rt/getargsfast.c +Lib/site-packages/mypyc/lib-rt/init.c +Lib/site-packages/mypyc/lib-rt/int_ops.c +Lib/site-packages/mypyc/lib-rt/internal/librt_internal.c +Lib/site-packages/mypyc/lib-rt/internal/librt_internal.h +Lib/site-packages/mypyc/lib-rt/list_ops.c +Lib/site-packages/mypyc/lib-rt/misc_ops.c +Lib/site-packages/mypyc/lib-rt/module_shim.tmpl +Lib/site-packages/mypyc/lib-rt/module_shim_no_gil_multiphase.tmpl +Lib/site-packages/mypyc/lib-rt/mypyc_util.h +Lib/site-packages/mypyc/lib-rt/pythoncapi_compat.h +Lib/site-packages/mypyc/lib-rt/pythonsupport.c +Lib/site-packages/mypyc/lib-rt/pythonsupport.h +Lib/site-packages/mypyc/lib-rt/set_ops.c +Lib/site-packages/mypyc/lib-rt/static_data.c +Lib/site-packages/mypyc/lib-rt/static_data.h +Lib/site-packages/mypyc/lib-rt/str_extra_ops.c +Lib/site-packages/mypyc/lib-rt/str_extra_ops.h +Lib/site-packages/mypyc/lib-rt/str_ops.c +Lib/site-packages/mypyc/lib-rt/strings/librt_strings.c +Lib/site-packages/mypyc/lib-rt/strings/librt_strings.h +Lib/site-packages/mypyc/lib-rt/strings/librt_strings_common.h +Lib/site-packages/mypyc/lib-rt/stringwriter_extra_ops.c +Lib/site-packages/mypyc/lib-rt/stringwriter_extra_ops.h +Lib/site-packages/mypyc/lib-rt/time/librt_time.c +Lib/site-packages/mypyc/lib-rt/time/librt_time.h +Lib/site-packages/mypyc/lib-rt/tuple_ops.c +Lib/site-packages/mypyc/lib-rt/vecs/librt_vecs.c +Lib/site-packages/mypyc/lib-rt/vecs/librt_vecs.h +Lib/site-packages/mypyc/lib-rt/vecs/vec_bool.c +Lib/site-packages/mypyc/lib-rt/vecs/vec_float.c +Lib/site-packages/mypyc/lib-rt/vecs/vec_i16.c +Lib/site-packages/mypyc/lib-rt/vecs/vec_i32.c +Lib/site-packages/mypyc/lib-rt/vecs/vec_i64.c +Lib/site-packages/mypyc/lib-rt/vecs/vec_nested.c +Lib/site-packages/mypyc/lib-rt/vecs/vec_t.c +Lib/site-packages/mypyc/lib-rt/vecs/vec_template.c +Lib/site-packages/mypyc/lib-rt/vecs/vec_u8.c +Lib/site-packages/mypyc/lib-rt/vecs/vecs_internal.h +Lib/site-packages/mypyc/lib-rt/vecs_extra_ops.c +Lib/site-packages/mypyc/lib-rt/vecs_extra_ops.h +Lib/site-packages/mypyc/lower/__init__.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/lower/__init__.py +Lib/site-packages/mypyc/lower/__pycache__/__init__.cpython-314.pyc +Lib/site-packages/mypyc/lower/__pycache__/int_ops.cpython-314.pyc +Lib/site-packages/mypyc/lower/__pycache__/list_ops.cpython-314.pyc +Lib/site-packages/mypyc/lower/__pycache__/misc_ops.cpython-314.pyc +Lib/site-packages/mypyc/lower/__pycache__/registry.cpython-314.pyc +Lib/site-packages/mypyc/lower/int_ops.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/lower/int_ops.py +Lib/site-packages/mypyc/lower/list_ops.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/lower/list_ops.py +Lib/site-packages/mypyc/lower/misc_ops.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/lower/misc_ops.py +Lib/site-packages/mypyc/lower/registry.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/lower/registry.py +Lib/site-packages/mypyc/namegen.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/namegen.py +Lib/site-packages/mypyc/options.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/options.py +Lib/site-packages/mypyc/primitives/__init__.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/primitives/__init__.py +Lib/site-packages/mypyc/primitives/__pycache__/__init__.cpython-314.pyc +Lib/site-packages/mypyc/primitives/__pycache__/bytearray_ops.cpython-314.pyc +Lib/site-packages/mypyc/primitives/__pycache__/bytes_ops.cpython-314.pyc +Lib/site-packages/mypyc/primitives/__pycache__/dict_ops.cpython-314.pyc +Lib/site-packages/mypyc/primitives/__pycache__/exc_ops.cpython-314.pyc +Lib/site-packages/mypyc/primitives/__pycache__/float_ops.cpython-314.pyc +Lib/site-packages/mypyc/primitives/__pycache__/generic_ops.cpython-314.pyc +Lib/site-packages/mypyc/primitives/__pycache__/int_ops.cpython-314.pyc +Lib/site-packages/mypyc/primitives/__pycache__/librt_strings_ops.cpython-314.pyc +Lib/site-packages/mypyc/primitives/__pycache__/librt_time_ops.cpython-314.pyc +Lib/site-packages/mypyc/primitives/__pycache__/librt_vecs_ops.cpython-314.pyc +Lib/site-packages/mypyc/primitives/__pycache__/list_ops.cpython-314.pyc +Lib/site-packages/mypyc/primitives/__pycache__/misc_ops.cpython-314.pyc +Lib/site-packages/mypyc/primitives/__pycache__/registry.cpython-314.pyc +Lib/site-packages/mypyc/primitives/__pycache__/set_ops.cpython-314.pyc +Lib/site-packages/mypyc/primitives/__pycache__/str_ops.cpython-314.pyc +Lib/site-packages/mypyc/primitives/__pycache__/tuple_ops.cpython-314.pyc +Lib/site-packages/mypyc/primitives/__pycache__/weakref_ops.cpython-314.pyc +Lib/site-packages/mypyc/primitives/bytearray_ops.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/primitives/bytearray_ops.py +Lib/site-packages/mypyc/primitives/bytes_ops.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/primitives/bytes_ops.py +Lib/site-packages/mypyc/primitives/dict_ops.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/primitives/dict_ops.py +Lib/site-packages/mypyc/primitives/exc_ops.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/primitives/exc_ops.py +Lib/site-packages/mypyc/primitives/float_ops.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/primitives/float_ops.py +Lib/site-packages/mypyc/primitives/generic_ops.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/primitives/generic_ops.py +Lib/site-packages/mypyc/primitives/int_ops.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/primitives/int_ops.py +Lib/site-packages/mypyc/primitives/librt_strings_ops.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/primitives/librt_strings_ops.py +Lib/site-packages/mypyc/primitives/librt_time_ops.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/primitives/librt_time_ops.py +Lib/site-packages/mypyc/primitives/librt_vecs_ops.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/primitives/librt_vecs_ops.py +Lib/site-packages/mypyc/primitives/list_ops.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/primitives/list_ops.py +Lib/site-packages/mypyc/primitives/misc_ops.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/primitives/misc_ops.py +Lib/site-packages/mypyc/primitives/registry.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/primitives/registry.py +Lib/site-packages/mypyc/primitives/set_ops.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/primitives/set_ops.py +Lib/site-packages/mypyc/primitives/str_ops.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/primitives/str_ops.py +Lib/site-packages/mypyc/primitives/tuple_ops.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/primitives/tuple_ops.py +Lib/site-packages/mypyc/primitives/weakref_ops.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/primitives/weakref_ops.py +Lib/site-packages/mypyc/py.typed +Lib/site-packages/mypyc/rt_subtype.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/rt_subtype.py +Lib/site-packages/mypyc/sametype.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/sametype.py +Lib/site-packages/mypyc/subtype.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/subtype.py +Lib/site-packages/mypyc/test/__init__.py +Lib/site-packages/mypyc/test/__pycache__/__init__.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/config.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/librt_cache.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_alwaysdefined.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_analysis.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_annotate.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_capsule_deps.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_cheader.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_commandline.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_emit.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_emitclass.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_emitfunc.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_emitwrapper.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_exceptions.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_external.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_irbuild.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_ircheck.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_literals.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_lowering.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_misc.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_namegen.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_optimizations.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_pprint.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_rarray.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_refcount.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_run.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_serialization.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_statement.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_struct.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_tuplename.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/test_typeops.cpython-314.pyc +Lib/site-packages/mypyc/test/__pycache__/testutil.cpython-314.pyc +Lib/site-packages/mypyc/test/config.py +Lib/site-packages/mypyc/test/librt_cache.py +Lib/site-packages/mypyc/test/test_alwaysdefined.py +Lib/site-packages/mypyc/test/test_analysis.py +Lib/site-packages/mypyc/test/test_annotate.py +Lib/site-packages/mypyc/test/test_capsule_deps.py +Lib/site-packages/mypyc/test/test_cheader.py +Lib/site-packages/mypyc/test/test_commandline.py +Lib/site-packages/mypyc/test/test_emit.py +Lib/site-packages/mypyc/test/test_emitclass.py +Lib/site-packages/mypyc/test/test_emitfunc.py +Lib/site-packages/mypyc/test/test_emitwrapper.py +Lib/site-packages/mypyc/test/test_exceptions.py +Lib/site-packages/mypyc/test/test_external.py +Lib/site-packages/mypyc/test/test_irbuild.py +Lib/site-packages/mypyc/test/test_ircheck.py +Lib/site-packages/mypyc/test/test_literals.py +Lib/site-packages/mypyc/test/test_lowering.py +Lib/site-packages/mypyc/test/test_misc.py +Lib/site-packages/mypyc/test/test_namegen.py +Lib/site-packages/mypyc/test/test_optimizations.py +Lib/site-packages/mypyc/test/test_pprint.py +Lib/site-packages/mypyc/test/test_rarray.py +Lib/site-packages/mypyc/test/test_refcount.py +Lib/site-packages/mypyc/test/test_run.py +Lib/site-packages/mypyc/test/test_serialization.py +Lib/site-packages/mypyc/test/test_statement.py +Lib/site-packages/mypyc/test/test_struct.py +Lib/site-packages/mypyc/test/test_tuplename.py +Lib/site-packages/mypyc/test/test_typeops.py +Lib/site-packages/mypyc/test/testutil.py +Lib/site-packages/mypyc/transform/__init__.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/transform/__init__.py +Lib/site-packages/mypyc/transform/__pycache__/__init__.cpython-314.pyc +Lib/site-packages/mypyc/transform/__pycache__/copy_propagation.cpython-314.pyc +Lib/site-packages/mypyc/transform/__pycache__/exceptions.cpython-314.pyc +Lib/site-packages/mypyc/transform/__pycache__/flag_elimination.cpython-314.pyc +Lib/site-packages/mypyc/transform/__pycache__/ir_transform.cpython-314.pyc +Lib/site-packages/mypyc/transform/__pycache__/log_trace.cpython-314.pyc +Lib/site-packages/mypyc/transform/__pycache__/lower.cpython-314.pyc +Lib/site-packages/mypyc/transform/__pycache__/refcount.cpython-314.pyc +Lib/site-packages/mypyc/transform/__pycache__/spill.cpython-314.pyc +Lib/site-packages/mypyc/transform/__pycache__/uninit.cpython-314.pyc +Lib/site-packages/mypyc/transform/copy_propagation.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/transform/copy_propagation.py +Lib/site-packages/mypyc/transform/exceptions.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/transform/exceptions.py +Lib/site-packages/mypyc/transform/flag_elimination.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/transform/flag_elimination.py +Lib/site-packages/mypyc/transform/ir_transform.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/transform/ir_transform.py +Lib/site-packages/mypyc/transform/log_trace.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/transform/log_trace.py +Lib/site-packages/mypyc/transform/lower.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/transform/lower.py +Lib/site-packages/mypyc/transform/refcount.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/transform/refcount.py +Lib/site-packages/mypyc/transform/spill.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/transform/spill.py +Lib/site-packages/mypyc/transform/uninit.cp314t-win_amd64.pyd +Lib/site-packages/mypyc/transform/uninit.py +Scripts/dmypy-script.py +Scripts/dmypy.exe +Scripts/mypy-script.py +Scripts/mypy.exe +Scripts/mypyc-script.py +Scripts/mypyc.exe +Scripts/stubgen-script.py +Scripts/stubgen.exe +Scripts/stubtest-script.py +Scripts/stubtest.exe diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/info/git b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/info/git new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/info/hash_input.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/info/hash_input.json new file mode 100644 index 0000000000000000000000000000000000000000..21e22819fa59b0947d113f33ec6b880017a67cc0 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/info/hash_input.json @@ -0,0 +1,7 @@ +{ + "target_platform": "win-64", + "c_compiler": "vs2022", + "c_stdlib": "vs", + "python": "3.14.* *_cp314t", + "channel_targets": "conda-forge main" +} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/info/index.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/info/index.json new file mode 100644 index 0000000000000000000000000000000000000000..136388ba5d5ce674312ddad504466d065eca35d6 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/info/index.json @@ -0,0 +1,24 @@ +{ + "arch": "x86_64", + "build": "py314hac7e1cd_0", + "build_number": 0, + "depends": [ + "mypy_extensions >=1.0.0", + "pathspec >=1.0.0", + "psutil >=4.0", + "python >=3.14,<3.15.0a0", + "python-librt >=0.8.0", + "python_abi 3.14.* *_cp314t", + "typing_extensions >=4.6.0", + "ucrt >=10.0.20348.0", + "vc >=14.3,<15", + "vc14_runtime >=14.44.35208" + ], + "license": "MIT", + "license_family": "MIT", + "name": "mypy", + "platform": "win", + "subdir": "win-64", + "timestamp": 1776802451807, + "version": "1.20.2" +} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/info/paths.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/info/paths.json new file mode 100644 index 0000000000000000000000000000000000000000..60ddb22c4dcd529b3e4118d75e5b4a494e34c93c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/info/paths.json @@ -0,0 +1,10541 @@ +{ + "paths": [ + { + "_path": "Lib/site-packages/0aca9ce3d91742c5b361__mypyc.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "7033c4dfed59549b7d257aec749da8585127f5046d60400ba669d065bb605a9d", + "size_in_bytes": 22917120 + }, + { + "_path": "Lib/site-packages/mypy-1.20.2.dist-info/INSTALLER", + "path_type": "hardlink", + "sha256": "d0edee15f91b406f3f99726e44eb990be6e34fd0345b52b910c568e0eef6a2a8", + "size_in_bytes": 5 + }, + { + "_path": "Lib/site-packages/mypy-1.20.2.dist-info/METADATA", + "path_type": "hardlink", + "sha256": "26f9bc847f86baee2bc0589c64cff2e4bd4453e63093e50a53aef0cf1ba77c98", + "size_in_bytes": 2428 + }, + { + "_path": "Lib/site-packages/mypy-1.20.2.dist-info/RECORD", + "path_type": "hardlink", + "sha256": "ad1d4eb92e5f5b67d8b89eeed2430b9e3f6ff9c56da72035c6a71c48c250bc42", + "size_in_bytes": 149744 + }, + { + "_path": "Lib/site-packages/mypy-1.20.2.dist-info/REQUESTED", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypy-1.20.2.dist-info/WHEEL", + "path_type": "hardlink", + "sha256": "ffbe40fe67512c29719a3125623042dd0ebc78ba9809e89d9447fd882aec9f48", + "size_in_bytes": 102 + }, + { + "_path": "Lib/site-packages/mypy-1.20.2.dist-info/direct_url.json", + "path_type": "hardlink", + "sha256": "7b77b328e499149cce6acf5cde3505fe122827fc40267f242163bd18a7cf30c1", + "size_in_bytes": 71 + }, + { + "_path": "Lib/site-packages/mypy-1.20.2.dist-info/entry_points.txt", + "path_type": "hardlink", + "sha256": "0ca4671989678e7cfdffa8f16211ec91d7992f0342ebd47e64f571bf76fd7697", + "size_in_bytes": 179 + }, + { + "_path": "Lib/site-packages/mypy-1.20.2.dist-info/licenses/LICENSE", + "path_type": "hardlink", + "sha256": "fdf1cd17f50e1305ed8cfd37467312d27a984648dba622cef70573b5512e4e1b", + "size_in_bytes": 12842 + }, + { + "_path": "Lib/site-packages/mypy-1.20.2.dist-info/licenses/mypy/typeshed/LICENSE", + "path_type": "hardlink", + "sha256": "295f8538c94ae5c3043301cf7cff1c852dab6a786a8ddee471e061b40d5ecabe", + "size_in_bytes": 12657 + }, + { + "_path": "Lib/site-packages/mypy-1.20.2.dist-info/top_level.txt", + "path_type": "hardlink", + "sha256": "d8f5534a55ad787f14e14309d5758e28b34c2d815153332536fa7435a515207a", + "size_in_bytes": 39 + }, + { + "_path": "Lib/site-packages/mypy/__init__.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "dc3bc2ac14971b12aae506900467a5068c7174ca4764da28c0d05312a9d9c74b", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/__init__.py", + "path_type": "hardlink", + "sha256": "e32a78dea340659d15881a559f9e8173b300e07d943177b459354f7643833fa9", + "size_in_bytes": 37 + }, + { + "_path": "Lib/site-packages/mypy/__main__.py", + "path_type": "hardlink", + "sha256": "1773286083dea5824e20aafb9561823ec317ecfa56c6ecb061ba9766d2aa5d5f", + "size_in_bytes": 1524 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/__init__.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "4ffff1bc4c723331e3d1bb728def3d5b1ebbdb701ed1e10792412202541ac4c2", + "size_in_bytes": 133 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/__main__.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "71a832d6306f66c76326fa724b9d18f83f8fd9870ee318681726c3c0fbe1a565", + "size_in_bytes": 3090 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/api.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "e92506c3955a9f48543b6fe070b9cb5da29b5cdfc996a27d150b4e307821e428", + "size_in_bytes": 4225 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/applytype.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "d02a46a3526c3068acc5c6c85ec5c8a55412cbdd94c82e81a16d024f78996004", + "size_in_bytes": 16389 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/argmap.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "a536b68062577e98898a734f85f39ada84f46b4e8d7c00d3513b417950368ecc", + "size_in_bytes": 11351 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/binder.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "d56d5a7ca93592e5690670b8f70623311f55e57389701f2e6b7fcd0221af1f07", + "size_in_bytes": 37674 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/bogus_type.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "842b16d671f1f687a6d0c8cbe797e090bfc2e121140d5ed342e0669d23743608", + "size_in_bytes": 956 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/build.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "136f9be55b4028a9989320d8c5f2ce35bcceca5ca8a32a441f7231266ac3b54d", + "size_in_bytes": 233834 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/cache.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "c60a2bec1d9c4e8c79ea87316fa063f2e102b8a6b96dec75c6f4db5294bdd30e", + "size_in_bytes": 28911 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/checker.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "435ba8a980f3660758185ff873c8719656ac762456e3902af59a1bc67ba68b8c", + "size_in_bytes": 490295 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/checker_shared.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "c894dc7df32a0baccb71e5523d88f05b9485eeea370ccdfcf69d2c852a9be07b", + "size_in_bytes": 21951 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/checker_state.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "a087fddd9123730404bea42e8911e8c93a956f65042df039b1c23ed239d6ab31", + "size_in_bytes": 1640 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/checkexpr.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "8e3e941ab32c445e9e5971a3bf53c6ff5c7efdbbf232bfded3de459f91328c3d", + "size_in_bytes": 343761 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/checkmember.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "f955273e6b9ab12ac4e2047908309712a007214d8425d440f111069edc995708", + "size_in_bytes": 76589 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/checkpattern.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "c15e58c8cc62e0ea6205ab9b9cf4f401ccd7b3b075a3e493a2ce610d92a673af", + "size_in_bytes": 43657 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/checkstrformat.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "602c4c63b4a780f4f85a222fbf72e43cbb222209c15a6fdfd4ceb3e591ad717a", + "size_in_bytes": 59964 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/config_parser.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "a4d04f70ad0016643847e8164d8a702fb3086701a8e02bc0bb1ff8b475e4a856", + "size_in_bytes": 38443 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/constant_fold.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "1ba6f48c5756d8687d17a8e6e28ddb8a4e2a1fcaf085acaba167876657e1a9c6", + "size_in_bytes": 8703 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/constraints.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "5bcb8c727495d6cd9ccfcacca1c8a0f8f9d0a2cd0e995f5b59ce687c372be159", + "size_in_bytes": 85788 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/copytype.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "e50098e6a27aa7bd9618722ae3aae72190442765a582580d96d5a7ead5c384a7", + "size_in_bytes": 12085 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/defaults.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "e5e34a3357b96c00955c63362bd268266dceff768e4e16110be6c2c93dcba368", + "size_in_bytes": 1729 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/dmypy_os.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "04f08ce6057b658fba6957bca2a8ea14f76410731aaf4a5911fd677ec21410ff", + "size_in_bytes": 2328 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/dmypy_server.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "c7bcb887331d1ed3819661e9b31c4d1aacca1589b335e9beee09f67e4519810d", + "size_in_bytes": 58260 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/dmypy_util.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "24fb9ae9fc123815c0d47ba1c37da8a87d546c893eac85065b2a283d527fc842", + "size_in_bytes": 8951 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/erasetype.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "99dffc6e019dc9e2e2d0659d80d239cf893a2363f6bcd1811c7cd697f12ca262", + "size_in_bytes": 22397 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/error_formatter.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "41dbeb98bc416924d359ae63c812142018a92e3bf54c46ce26876287d31c103e", + "size_in_bytes": 2480 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/errorcodes.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "931a108da2552c1eebb5a3b15b851517ff670d7021d7896440f33fb5b6f49d1a", + "size_in_bytes": 14895 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/errors.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "ada2aac50e9e8e173c1477030191f734db6924b7f40fc3b73072beda8af88614", + "size_in_bytes": 73465 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/evalexpr.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "cf239028a7832913bdb23fe40feecfb4d4bb578b2509fb92217d8c1ffb0b2235", + "size_in_bytes": 23090 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/expandtype.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "77791212f9881941076f4c1cd2858150cffd2367162162116d8c16bb980437c0", + "size_in_bytes": 41249 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/exportjson.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "e7049275e39d77a57d7a626348919e041dc49b92fcaf21edc24cc275a11269fa", + "size_in_bytes": 36213 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/exprtotype.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "91f0efcaa180f94c2129d538808ef5350e6b2c49c79319b83ed945d5750c99f9", + "size_in_bytes": 10597 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/fastparse.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "fe0ec9f10d603dd95cd1edacbe56b64a40d3b4713baad7bd6c6125d934a55ba0", + "size_in_bytes": 135867 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/find_sources.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "8c363d6dbc39864f9e62ada6d20a16d87708e28b0b61b6fe0e15a0146b02fb0e", + "size_in_bytes": 13818 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/fixup.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "04916d292f4f614e1ef91dc984db4ac5521e2d017109179419869f310b89dd6f", + "size_in_bytes": 29601 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/freetree.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "dc1671b1b879ec4e9adf73bcbb65bed00c787984effbd1af587a2a45db32dd3f", + "size_in_bytes": 1708 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/fscache.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "ed446e448ae19232bd7fa79d497588aa8977b975fdc555dd2d62d6abdcc4ffa8", + "size_in_bytes": 15861 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/fswatcher.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "9c21080ce35c564e7e5896feda8ee5e96d147a167e4321ce149c05d66dd1dafe", + "size_in_bytes": 7002 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/gclogger.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "a80f411e511221a87a5202559ce71b23a3613367175d4c4f2d4a95e495f46c5b", + "size_in_bytes": 3600 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/git.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "29d56c329dd8af34a15601f658390958f52c761f2514085c8ebcfecd442c75ce", + "size_in_bytes": 2273 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/graph_utils.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "2b4f5e4a48c7aac8aac9515d3ce7bf9f3dac7c4fcf34b54c81b6157b1dc43ae2", + "size_in_bytes": 7356 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/indirection.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "58f7e2ac75ff8d8bf6d2b5d6662072e19a64355e24435cb0117c9ac7d7a88c36", + "size_in_bytes": 14661 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/infer.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "ab771a99d5bd778525088d1487fec9ec0f8befb0a656be62e66b86a6f7c0bb08", + "size_in_bytes": 3314 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/inspections.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "1f2c75815426e4ff0c7ed78cc3526cc1bbdc8d1c61c73f181301a70ded4d0708", + "size_in_bytes": 34921 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/ipc.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "c72f611117b0661d107c124a8c4ba6d5d1b5d14ecc6587b8052b8f74e524b926", + "size_in_bytes": 25234 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/join.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "b601ccc2b8613d9a57857ed1c5eb15d4b350878fe80501d42dfa053406efd457", + "size_in_bytes": 52206 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/literals.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "2e22e8a5a314192f387d51f14889cd5bc4c2ac9de8f6acd407b1565c30610bbc", + "size_in_bytes": 23357 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/lookup.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "5d7b7fe4638e86caa4d337a8675bf495a54a2ce5eeab27cd0679d126746bc207", + "size_in_bytes": 2436 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/main.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "98fa39bf1d74f744f7719c938669a2461d6f8130a046cc8a0fbd12c5fd0bf38f", + "size_in_bytes": 68712 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/maptype.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "42812e57b0fdf8be96feeecee92756c562a05f7a7ea4f68991798eeb44c9c930", + "size_in_bytes": 4815 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/meet.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "972f4e7b6ed37ad50fdbab116d145b2422a54e17a27d01149e4ce8e83bdf5b80", + "size_in_bytes": 68018 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/memprofile.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "88963b01b4c1b21e17fe02d92e33ebfd911de6b1c9ca229a41ee4e16009c2cac", + "size_in_bytes": 6789 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/message_registry.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "32e3afe72f1a287f22cd89dd12dca1ac293d42503ec1d9ca542c5ef16d54affd", + "size_in_bytes": 22629 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/messages.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "83aeba38ac4c75d0cb2ca50105c51a994dffa890f4145884221dc68a4b1f461e", + "size_in_bytes": 194338 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/metastore.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "6a7006254ca9be9f09e68cb0b39d5ac8a351e451c5ec68e12fcb86b94de227a1", + "size_in_bytes": 15678 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/mixedtraverser.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "e678af9c8108babfa3d7ee9402e4387d8a500437be2f27bdd807c02e56b58ad3", + "size_in_bytes": 11057 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/modulefinder.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "f20d6e9d58dfb0b5e75a994400c002d8c779d8e7ba5114e5b9b2ac2fa9cc9b2b", + "size_in_bytes": 49959 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/moduleinspect.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "c0c98ecd130f47b279e62bf0abc17775b227063bc7248aa750a606663a556f00", + "size_in_bytes": 10549 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/mro.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "35078efbb4eb8a3403c7f6bff0200ff03be4869227a2a94ad9461e48553eff00", + "size_in_bytes": 3759 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/nativeparse.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "2e889842320ff3ce30673cef6dbabfda4f2760dc2dcff131a6e701829e657973", + "size_in_bytes": 82697 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/nodes.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "fa7e87142add35fce098f6fb90bc425494383991f602da439b52b74eae9884a1", + "size_in_bytes": 253265 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/operators.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "8cf4679893ff2f8c4d4e0a1986a5cb66c56931d3527705f880363033288ac5df", + "size_in_bytes": 3413 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/options.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "a4e71bbc38d7a2f1fab8126b9455fccd69457ab108dc54550cda0bf4c3efa770", + "size_in_bytes": 22561 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/parse.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "8d6c319ef04421aefdf4d395868012f392b58bc0142292182de6c988457211a6", + "size_in_bytes": 5909 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/partially_defined.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "704470b6c7a863403cd285962fbf01b656d3edcf342d28f9e1a3f4831ec3d4f8", + "size_in_bytes": 52905 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/patterns.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "8536e00b193cffb6142ed37431a5ab5398364150f16bd0c67af847617e16ecb5", + "size_in_bytes": 9475 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/plugin.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "5855b1f1034a5e4c442af5a2f87a014097177871468e992892f21d0a0b0f121f", + "size_in_bytes": 49063 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/pyinfo.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "80c8ede4fd1f2243eed62e8d331237e03751caf1a9a86bef5f55b64f8f992c43", + "size_in_bytes": 3714 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/reachability.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "87833338559752a2943dba8b4f2500a2828d7942850e365c72420d3039e56683", + "size_in_bytes": 18995 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/refinfo.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "0b4748b14f5b8b18a17f5dd908272d910d8c35e90d575a206e85112b8af703de", + "size_in_bytes": 5939 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/renaming.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "a287a71492027b1093e02a4e9e03c2279b6ef99df90f8414bed6c2ab9231c1f9", + "size_in_bytes": 35662 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/report.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "3dbff6e91d2533bfa19fc46fc6a720afabe3e213d51e68a2ad1506e389237d69", + "size_in_bytes": 60078 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/scope.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "18e2bfc46f61e029f19d82d652361a1215dbe7a67d6e16725440d7e67a06191c", + "size_in_bytes": 8784 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/semanal.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "1ebb61a9404deb223b2d53e9af9e20daebd228bd7558ac2cec173a7a8d26a475", + "size_in_bytes": 452978 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/semanal_classprop.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "1bc8924c428918b5301b0d1919850ad5bb8b72bc542d476e841a8d3abdcdedfd", + "size_in_bytes": 9773 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/semanal_enum.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "f728cdea0f9dc63ae349fdbd59ffbd4a145853a1d9dd7b5bd8c21bc5f4562287", + "size_in_bytes": 13559 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/semanal_infer.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "d9b9505f4a3500f7f03ad7c91ab187a782797023b99cd18df34a0b6cad266639", + "size_in_bytes": 7341 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/semanal_main.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "60b2462a830196f4d63112671b2b8a6000bd081c0411100369fdfc91763b5b53", + "size_in_bytes": 26702 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/semanal_namedtuple.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "7688a85069b74765ee7217963f405b60b39a8a67df8b51f4f4665e3b264e554e", + "size_in_bytes": 32904 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/semanal_newtype.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "242aa3ad33fcfaffe3be4f7f96b8c381074c324244f45342f5d5c29c71e1273d", + "size_in_bytes": 14051 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/semanal_pass1.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "a45d839f0f23d82b5d58d632940e562ac0841369d0ee7a01b81af1ee646179bd", + "size_in_bytes": 10121 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/semanal_shared.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "8103886b351b812cfa4b043ae5e55b157d8bd009a8e7d9a78fefdfe96c0283eb", + "size_in_bytes": 25640 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/semanal_typeargs.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "486bc25b1cc6bffd351b62fcc75a836edf7e68814055c76ab054127ebf8a8178", + "size_in_bytes": 19253 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/semanal_typeddict.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "825a0a5e4c6559e1f65b1f1258dda75d3997b43663624854ca7c3ef96fa79fc5", + "size_in_bytes": 32298 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/sharedparse.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "d3d675c3ffc50d69e462def34727807237091453b9359585aac796611529ef4a", + "size_in_bytes": 3545 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/solve.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "db70513729ff504645c29401aabeffbaaf334084a9d929fa90e743c6e47a9c6d", + "size_in_bytes": 29119 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/split_namespace.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "152c4ff96a88059d72c74face9b5a58c5ae3ca390ea9cd0d53301f6a027d024d", + "size_in_bytes": 2899 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/state.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "95220adcf4329db9b68ac3da5a06da0838141153cb97d4b59752f68967d88702", + "size_in_bytes": 1655 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/stats.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "76b7ac2b6a6115cb3e679499745590c90a6453dfff605a87a57706a9c178f9c2", + "size_in_bytes": 35274 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/strconv.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "14af4bf61a9e22f0e42cb91aeb4f636e586f84a5f577b5ad1549c8bcfb2f431b", + "size_in_bytes": 65085 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/stubdoc.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "d0d1d353e4e339cd84e31fc9b8df0ce87066688aabdc43b98f39664abf1ea7e4", + "size_in_bytes": 30800 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/stubgen.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "6fc05da7d600987733dfd2aed72fcef24c89023d89c061e89884b5b7bcc2463c", + "size_in_bytes": 124861 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/stubgenc.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "3c104070d35f618fbbfff3e41f97e3988f7ce980660f5ff1cd9df1aa7c2d220c", + "size_in_bytes": 54401 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/stubinfo.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "2d006b300ab5d8db147e655b111370d0d26c4ed8646f01cdb8c76b4bb2fb483f", + "size_in_bytes": 14525 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/stubtest.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "fa056405c1b4885dc8c0f2649cc92f1c2b26fafd9c2b4cc1be7a3645005a55f7", + "size_in_bytes": 130326 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/stubutil.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "411527d797e1c6b36295d295e81281625396487df6046d180ee7e31ca22d5568", + "size_in_bytes": 48739 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/subtypes.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "b599ead8937ed6b354704abb81d10a6641384c345039feec9d794ee14a31f1c9", + "size_in_bytes": 105119 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/suggestions.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "39665c6f5dbfc21654cff1fc76c3ec0df5f11b854e652b2bf6213e8b572aab1e", + "size_in_bytes": 65888 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/traverser.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "194753e92f43810356a126fcf73c0b3b73c2229958893abd6859d6e39c320d76", + "size_in_bytes": 86423 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/treetransform.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "bf639761cafef1e55713c88d083cb435ba7b6edabd8adb0bb7424422666178c4", + "size_in_bytes": 64628 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/tvar_scope.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "88b645ee25fbb55ceeddd9aa5f9bb33f3f697eca579223b9ef8a3385625ea96e", + "size_in_bytes": 12295 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/type_visitor.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "624e18d56c038dc6308d211c805faed22ea68d451ecbc8827f1d2f6eef817084", + "size_in_bytes": 48249 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/typeanal.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "25933f7236770ecf16200d1b5505ac9cf5366a823ed67beaef0235ef1cc8f577", + "size_in_bytes": 154794 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/typeops.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "ec34e9a43ecc396c206366060ad078d849be2c9f53a8b185129d824ffdb31158", + "size_in_bytes": 64086 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/types.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "9d17128c68f9e18a804f9ee31362ffb88b2ea2e1e55e71c715714e11af2bfc58", + "size_in_bytes": 262665 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/types_utils.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "9ab0794968df0b4f4a4c6d9815551a48dde064c5c453b95d58a0033489dd7548", + "size_in_bytes": 10944 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/typestate.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "9d55a341ff770b4cfb524b5296a72414ee4ffa8c70d801f59a3e40d626b05199", + "size_in_bytes": 17230 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/typetraverser.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "314835692fef95e9a4b431aa6bf709e46da429b274b6cdb4fd3c5418c4478854", + "size_in_bytes": 12721 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/typevars.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "6545c7daf9b37f075d96987c34538b05562a46d8ebd81876ca6923f2aa061b86", + "size_in_bytes": 3743 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/typevartuples.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "a1d7082b1993e800448aae6be3dd75ea38b8cf3e16c763f3cba7a6a1478a472e", + "size_in_bytes": 1993 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/util.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "8fe430bc2ca1500aa37d522a3fd41c3d8e542b996c1aaa77ea9edc1eed691bf7", + "size_in_bytes": 51011 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/version.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "4d1e4b44afae18b0ca89f313dbf012ca68ea51f587b5fda12141265d3845377d", + "size_in_bytes": 159 + }, + { + "_path": "Lib/site-packages/mypy/__pycache__/visitor.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "c0d152149ad83d467c86dcbe79c684381704aa1dbca5e70a0b2596b6847e591c", + "size_in_bytes": 52550 + }, + { + "_path": "Lib/site-packages/mypy/api.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "6451501c2407cc0321cedf36223d6bf8423beed6f2d32b53ae78f11ce323a568", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/api.py", + "path_type": "hardlink", + "sha256": "425cdd2d141bf3a23c77aa7b3e1f473f1ab59a2460fe6ad79745180ebf55c6c7", + "size_in_bytes": 2949 + }, + { + "_path": "Lib/site-packages/mypy/applytype.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "bc1371ebabb46fc6c0c30cac6afe1e993be829d9905e43d85cf9675b38bb40f1", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/applytype.py", + "path_type": "hardlink", + "sha256": "312e43f256f1b02030570a1a45d77c4b2876fcf75d9674a59f1f6d200ef83a59", + "size_in_bytes": 12032 + }, + { + "_path": "Lib/site-packages/mypy/argmap.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "8db49561f8257be70b4313433a9b1e0dcbebcb784fdc9dfed5b94681b33a7a82", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/argmap.py", + "path_type": "hardlink", + "sha256": "d397b5ca7e20f3d85b5e43c332051bea22997dc0159a994c05b74a574bcbe602", + "size_in_bytes": 11416 + }, + { + "_path": "Lib/site-packages/mypy/binder.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "2ce75ec6f56de8f969f234e2681c7f2ef8e46849c8e5bfb496647605f9f66c7c", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/binder.py", + "path_type": "hardlink", + "sha256": "847e78067dc352a1da6b47a5efa29c2701c0bfe5eced522875d161af77a6ed78", + "size_in_bytes": 28610 + }, + { + "_path": "Lib/site-packages/mypy/bogus_type.py", + "path_type": "hardlink", + "sha256": "c371abb16a23e4529b7c452c73cece5453bcd761c2f41be75a749a5764f8bb57", + "size_in_bytes": 816 + }, + { + "_path": "Lib/site-packages/mypy/build.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "3451b112d07912d0c0c10cac0635bc892e66870fd4182c2401a1650ef1c17784", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/build.py", + "path_type": "hardlink", + "sha256": "e4005b1ed3726a104e334df040a8ac0e5a22a27b24a53ada7509066c4357a5a1", + "size_in_bytes": 193755 + }, + { + "_path": "Lib/site-packages/mypy/build_worker/__init__.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "678aa8827793ac2d0b9f3fd52d974d4302d3de627da33685db0710e0e2386365", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/build_worker/__init__.py", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypy/build_worker/__main__.py", + "path_type": "hardlink", + "sha256": "bfdefecb94ded6191ef30214263e00b58c9745ceaf2818a64f3f2f9761d4180c", + "size_in_bytes": 135 + }, + { + "_path": "Lib/site-packages/mypy/build_worker/__pycache__/__init__.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "8ce5067f0513dd5c56d213b73f40c2bf6ff7d22bf03be612ccfe31de6cadb962", + "size_in_bytes": 146 + }, + { + "_path": "Lib/site-packages/mypy/build_worker/__pycache__/__main__.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "0b03f0b95d128dd7e9643ac0830de81116df06edbced3dc4aa595c5aea9fbaf3", + "size_in_bytes": 328 + }, + { + "_path": "Lib/site-packages/mypy/build_worker/__pycache__/worker.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "a98f06cb736ac0a937bfd450f3aac3c819b3acfc1bd03f5b520de8005476d97e", + "size_in_bytes": 13718 + }, + { + "_path": "Lib/site-packages/mypy/build_worker/worker.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "caeb7bd284aa2f0e709127ddc7bcc88c85cf5002f78cd04aa3fdcff34708817e", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/build_worker/worker.py", + "path_type": "hardlink", + "sha256": "b2cf1b65a6da9916712161486a9e326e2b5c2b1e8e77602d0e9c2b3db5cd2197", + "size_in_bytes": 9272 + }, + { + "_path": "Lib/site-packages/mypy/cache.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "9f37b3609d407d48f831ca276a8f3fa5426110e66e9cda456a00be340698267f", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/cache.py", + "path_type": "hardlink", + "sha256": "8298507952ed1b6985d168ea966892746429427b3278a8495aedf32b18eb7513", + "size_in_bytes": 19278 + }, + { + "_path": "Lib/site-packages/mypy/checker.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "5f78a392df929d4068df7121975d0ef02b2d80cc5e45f742f9ce430cf549a9aa", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/checker.py", + "path_type": "hardlink", + "sha256": "a259272147aaab699a88d3f9ff5d123d70cf0797f80caf787ad166b4409f548b", + "size_in_bytes": 430682 + }, + { + "_path": "Lib/site-packages/mypy/checker_shared.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "a3fe1391d424f16178935d7c876856bcc24e0ddbfd6322402ef0b070efd7a6cf", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/checker_shared.py", + "path_type": "hardlink", + "sha256": "61d7943d1e26d1a04d071348e796aa08955433f590f99b3b6e845fa9f362ef2d", + "size_in_bytes": 10613 + }, + { + "_path": "Lib/site-packages/mypy/checker_state.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "8e44be99724f06dd1871a7b520490edab62d63a0dc3098ebf9cc4048f78a5192", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/checker_state.py", + "path_type": "hardlink", + "sha256": "26a5576671daaa1d285a62c858f65d2c472df6550251ef60505093bbc593d214", + "size_in_bytes": 858 + }, + { + "_path": "Lib/site-packages/mypy/checkexpr.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "843d0ed5250284727803e9742c78b2fb3752bd03ebc13956621a51886a4caa3e", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/checkexpr.py", + "path_type": "hardlink", + "sha256": "1dfadc3bffd626d01c60a0128b8baa510998fffaf5838924a9778a231bb91376", + "size_in_bytes": 303324 + }, + { + "_path": "Lib/site-packages/mypy/checkmember.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "f1fcbbe84a33ab74c15bef3cd3bea35275120fb8fa7240ef404c4524482154fd", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/checkmember.py", + "path_type": "hardlink", + "sha256": "8f9ccf4461b3d6874a246d6b190ed0c1acf25b8cefb1d561d165a2cd2d434b54", + "size_in_bytes": 64435 + }, + { + "_path": "Lib/site-packages/mypy/checkpattern.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "60c329f58d1df1119ee0df22ab53a48ceec874eec81b1996d8104951bf55c0bc", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/checkpattern.py", + "path_type": "hardlink", + "sha256": "88feebb541e792faceaa20d83817ee9e4a652472096fd62180be2b6f6510280b", + "size_in_bytes": 36820 + }, + { + "_path": "Lib/site-packages/mypy/checkstrformat.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "ff5c840d4947f2cb0663716e6691aaada21b84b99d4fb248893c94b9090eb80a", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/checkstrformat.py", + "path_type": "hardlink", + "sha256": "785c686204b920cef71eace2f9b50434999b51ef95a353c06c6a34e003232c5d", + "size_in_bytes": 46015 + }, + { + "_path": "Lib/site-packages/mypy/config_parser.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "c3387f1f53171caadc560764d5b33132a762ce036a0f1cf2fefea10f774cc324", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/config_parser.py", + "path_type": "hardlink", + "sha256": "a785231d2a5a3e0c809c6ad7b45dfee1006df59d819795d83292189762c35be9", + "size_in_bytes": 26326 + }, + { + "_path": "Lib/site-packages/mypy/constant_fold.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "d0a767c94863c45898ec98e6993ba826dc48716ef22a468c05bbafa6b1303037", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/constant_fold.py", + "path_type": "hardlink", + "sha256": "facd9a2791842143eecc03f91a1edbd65bfa10e3be20b30a69b4e50b9d3299e4", + "size_in_bytes": 6061 + }, + { + "_path": "Lib/site-packages/mypy/constraints.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "03c64244b6d229a70b0073a9ff9dc5a23f47633e72155e5719563d29142440e9", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/constraints.py", + "path_type": "hardlink", + "sha256": "d523fd65e54e0a8c08daf9a51c41bded56d988f718de724fda97b6d3395cdacf", + "size_in_bytes": 79294 + }, + { + "_path": "Lib/site-packages/mypy/copytype.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "916ab04a6387028354b8c221f6085223bcaeae0e48634f3b9f415c6c8bde844d", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/copytype.py", + "path_type": "hardlink", + "sha256": "6835503565c8f7cf83cb1bed07a8a751a10edc1fc864237d1c8a54b6691971d5", + "size_in_bytes": 4448 + }, + { + "_path": "Lib/site-packages/mypy/defaults.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "55fdc3acc5419c7c51844ffb7cc3f084958d0d70dc0b8ac232d2f3fa6ac32832", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/defaults.py", + "path_type": "hardlink", + "sha256": "f8cfefe29ae4e3a61c3441c6b121ff7ee45c8bf9e8104d13dd2f82a48c132a0d", + "size_in_bytes": 1666 + }, + { + "_path": "Lib/site-packages/mypy/dmypy/__init__.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "e511f7a77105350531c5b850550a6e314b96f9fb7337e460f5fafd718c4e50df", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/dmypy/__init__.py", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypy/dmypy/__main__.py", + "path_type": "hardlink", + "sha256": "bba658c39d9b7c8275d4ea3cf26cf1ee9e160f6594a35f87f4f46c4f8e5eb305", + "size_in_bytes": 128 + }, + { + "_path": "Lib/site-packages/mypy/dmypy/__pycache__/__init__.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "1b42cb0b3b7503a175c96806e912d4243aa32e2c1a74e3d8b94fc9a5031e104c", + "size_in_bytes": 139 + }, + { + "_path": "Lib/site-packages/mypy/dmypy/__pycache__/__main__.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "389f15c42a344542d8e1e7557dc5211edde5ef7e48f500d531f1a7624d94422d", + "size_in_bytes": 314 + }, + { + "_path": "Lib/site-packages/mypy/dmypy/__pycache__/client.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "f2723bc3694df88bf3a42549d3facf2a302e533284268a2a93052371a926a48e", + "size_in_bytes": 34105 + }, + { + "_path": "Lib/site-packages/mypy/dmypy/client.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "6246bdbd9020127007de9716146c71a46ac06f4aaa063a447c1712bdf2b8c8c4", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/dmypy/client.py", + "path_type": "hardlink", + "sha256": "f0b3761b53965d63b3ad6700e4b692461c2656d0422e019d1dd70ec6d9d55b34", + "size_in_bytes": 24276 + }, + { + "_path": "Lib/site-packages/mypy/dmypy_os.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "eb924ec9eba1a965e83c3e3e143faf288f4dea0782f7cfb8ebd08c209cc32cd9", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/dmypy_os.py", + "path_type": "hardlink", + "sha256": "38dd61fa41b2c2cb4a5de21890112ebfa4e4f976a69ab66b0f2d4f86c9044d7b", + "size_in_bytes": 1181 + }, + { + "_path": "Lib/site-packages/mypy/dmypy_server.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "fd13907c41656fa8c5914912b8930c6f5f2803a616db792d64a7f42f794d40d9", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/dmypy_server.py", + "path_type": "hardlink", + "sha256": "cbd770f0e1494bffdc0061f4e22727bd38a6c16dbdaa031b2edee9469db1dd44", + "size_in_bytes": 45611 + }, + { + "_path": "Lib/site-packages/mypy/dmypy_util.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "a27fcf2cfa9ca1af7c242616151335259f03bdd42f37dfc3a7d3eee0e71e33c0", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/dmypy_util.py", + "path_type": "hardlink", + "sha256": "4269b1a1fe89773cb9cc3ea55f8f83178edda8024d9a84662d8cbf9496a0f4f6", + "size_in_bytes": 3006 + }, + { + "_path": "Lib/site-packages/mypy/erasetype.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "803a19e689c6ffce5ab4ecbd7847da1e3253f0c36875fbcc0b037b84b3a41d5c", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/erasetype.py", + "path_type": "hardlink", + "sha256": "2c8f5baf81535aa2bb9ecfa5724b386e7ad3bb7d7147fdef3e67d6ba1148c9a5", + "size_in_bytes": 11309 + }, + { + "_path": "Lib/site-packages/mypy/error_formatter.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "9d0b273f97918e50eabf8cf0db8e6d444aba0e7eefe567dbe60e6c23e3786652", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/error_formatter.py", + "path_type": "hardlink", + "sha256": "c411ad50dac48f307e5ba4d96922cba703c7d97146723564dad96d68898d631a", + "size_in_bytes": 1165 + }, + { + "_path": "Lib/site-packages/mypy/errorcodes.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "66ce189fcf74a536d5f7a6ac617dc0ca363b20849b3759d9ef746b40fa838603", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/errorcodes.py", + "path_type": "hardlink", + "sha256": "c9da7bcb3f7c1b4947a9de8855157f864d3946feffb75a957d3481153525ca87", + "size_in_bytes": 11892 + }, + { + "_path": "Lib/site-packages/mypy/errors.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "cb6430a7a7d79234aafb24133ba4ee91d877851aa729798ad6d907ae1a73e49f", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/errors.py", + "path_type": "hardlink", + "sha256": "532b9ae12503d61a8e90ba82289b5493b465964e2e9cafb03826507891061159", + "size_in_bytes": 57154 + }, + { + "_path": "Lib/site-packages/mypy/evalexpr.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "1211144d1f97a950b3894925f88e921c5383321e67b57fa7cb53b43a619c6c5a", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/evalexpr.py", + "path_type": "hardlink", + "sha256": "5e17fb3ea611769f483d0f1a9c697ea3a8b2518241de8c46d23d145549d2c822", + "size_in_bytes": 6764 + }, + { + "_path": "Lib/site-packages/mypy/expandtype.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "d641cb8e8b8b452931a1c22436371af9a115eafccfb053e05278967c3e192b69", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/expandtype.py", + "path_type": "hardlink", + "sha256": "721f837e335dfc4f327c4d90e54a65607af4422ad73cd4937631e85e641206e3", + "size_in_bytes": 29037 + }, + { + "_path": "Lib/site-packages/mypy/exportjson.py", + "path_type": "hardlink", + "sha256": "2956767e665be9961a009c86dd672ca0105d16bc758c236c2b1bd549729a1aae", + "size_in_bytes": 20250 + }, + { + "_path": "Lib/site-packages/mypy/exprtotype.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "0272ac17a823049d798e922b537d70cd9e4048cd263a0e5cc652d27869e1ce1d", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/exprtotype.py", + "path_type": "hardlink", + "sha256": "f91259a1d28bef0859f3ce41186ad00cdbd3601cb2f405f01d76937e9762287c", + "size_in_bytes": 10598 + }, + { + "_path": "Lib/site-packages/mypy/fastparse.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "fc3af2866d76a581f8268b688df6d1ce1c5ac675a113398bcc5967085683ffd6", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/fastparse.py", + "path_type": "hardlink", + "sha256": "bb9a94ea8126241fc5885870a39b5bf07d17438da123131cd25c42484ceb569f", + "size_in_bytes": 87410 + }, + { + "_path": "Lib/site-packages/mypy/find_sources.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "51c8e33ae244bb6627222d02150cd091e41296e03ffdda53190b439b992626bf", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/find_sources.py", + "path_type": "hardlink", + "sha256": "e05a9ad47d63b34d3d5140d51a9696d41c13d129be866ec7cd452dc5e1208856", + "size_in_bytes": 9734 + }, + { + "_path": "Lib/site-packages/mypy/fixup.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "8407a42270ecd17e52fb272b6cbf77f678caab34dc9368fb81e61a6cc8248707", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/fixup.py", + "path_type": "hardlink", + "sha256": "38204e58b51a3afdfc33eecba7fe4267a95ec5fbe9e83e3eb3fbdf732d9388cd", + "size_in_bytes": 16600 + }, + { + "_path": "Lib/site-packages/mypy/freetree.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "d4bc7e7442d2ea22df507d0d46aa3af84c9a0c34f78221e06c80469d297a59e1", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/freetree.py", + "path_type": "hardlink", + "sha256": "cb3e3f654abc25af3dd7bea76c310088193e12dda73fbe3f297c8271a5b88a70", + "size_in_bytes": 617 + }, + { + "_path": "Lib/site-packages/mypy/fscache.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "30dea35104d343e3f46db552cd0808c43b07892b4fa0f0f10784984bddef7843", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/fscache.py", + "path_type": "hardlink", + "sha256": "f5824120a1cf8e4f15cddf58b9b7bab17233c6b39dabe6f66c6f2479bcc0515d", + "size_in_bytes": 11102 + }, + { + "_path": "Lib/site-packages/mypy/fswatcher.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "e88de1069ed9ee9ddeb5787c1efdcd5be4d3da8efaeaf6e4f155441b20b6d531", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/fswatcher.py", + "path_type": "hardlink", + "sha256": "1524c4695f4d9a035902b5ff03d5a8c7bc287dae6f83df863e04c4656ab1df26", + "size_in_bytes": 3985 + }, + { + "_path": "Lib/site-packages/mypy/gclogger.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "14fd49bcf67081846f4510d5d518180d7b7c21ed443305314c3c91fb9ff1e20a", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/gclogger.py", + "path_type": "hardlink", + "sha256": "13ec5dba403b874b6d83016ababba59ffb612a64448db600ddd2248fc7d80be9", + "size_in_bytes": 1639 + }, + { + "_path": "Lib/site-packages/mypy/git.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "01e6ddff17bcae79688650e5cde80e4a7803468d3a838ab2b6408aed8914feff", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/git.py", + "path_type": "hardlink", + "sha256": "15874c83eddf4ed8a42a35307c53d76d688d9a9388306e2b3603005883c1b0b3", + "size_in_bytes": 980 + }, + { + "_path": "Lib/site-packages/mypy/graph_utils.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "2de96659e75569614b4d897542ef9105c83c6b3545df563a1ba193f9ee3a3bb8", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/graph_utils.py", + "path_type": "hardlink", + "sha256": "5968d483f83d0e4c042fdc401e9aed9e475aec9dcb582fbc8044be34d392e570", + "size_in_bytes": 4983 + }, + { + "_path": "Lib/site-packages/mypy/indirection.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "b57f051ee162f7347229aff04642639eb1344a1004d6e0d0d5643bdde8f99f78", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/indirection.py", + "path_type": "hardlink", + "sha256": "2a4227a20144a67b37323b5242955780aeb84fb0dce7fe3fd316fca9485aa29c", + "size_in_bytes": 6432 + }, + { + "_path": "Lib/site-packages/mypy/infer.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "8bb2d4afa203dcc8777d6ff497b50ae71f0ade4aea075b9c38ab73daa618cb70", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/infer.py", + "path_type": "hardlink", + "sha256": "27c6dc0a36055fb559e148dacdb602f529804762c0f1e733b0bbe1d40cb5e18c", + "size_in_bytes": 2538 + }, + { + "_path": "Lib/site-packages/mypy/inspections.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "b733e6db58e696ef78c8c2d58cc8c812a0391fd669165cb898b9219f14b1720f", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/inspections.py", + "path_type": "hardlink", + "sha256": "3d605bce6804465b367ca8f9ff95066c122bd3176c0d40e7eda76de6984c59a9", + "size_in_bytes": 23813 + }, + { + "_path": "Lib/site-packages/mypy/ipc.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "fc1afeaa5ea8b0e72352d01eb95f853ca5b832d9ed18acf4bcd24d8bf3d4ec82", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/ipc.py", + "path_type": "hardlink", + "sha256": "a67e59dd3544745589d08c9544b4269107b772d9fea86bcfb5fdef437b398805", + "size_in_bytes": 17139 + }, + { + "_path": "Lib/site-packages/mypy/join.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "e24525c981113103067ce9b251a6811fff66720c70b0682d1ebb065e3a3e25c7", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/join.py", + "path_type": "hardlink", + "sha256": "da8dbbfdd2aa0b0f33bf6c26594aa414d004e071b9052be4291e101644c008bb", + "size_in_bytes": 39575 + }, + { + "_path": "Lib/site-packages/mypy/literals.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "abc229e34278ccb5f269259b81ddc0ebe7941598a63c46c5a4a59c5bd56b9729", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/literals.py", + "path_type": "hardlink", + "sha256": "3babad38be302cdcedc7c2e9d5b83b202439f12a6b875fc36057531ad526dfa6", + "size_in_bytes": 9412 + }, + { + "_path": "Lib/site-packages/mypy/lookup.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "fdc7150b9454e2f65828bb2c7fe812869cf162b0e8c8e22a048afe299792f10e", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/lookup.py", + "path_type": "hardlink", + "sha256": "75e899ee93553986621744a18c68f8ee73a0989e808111087446d8ac376218f9", + "size_in_bytes": 2454 + }, + { + "_path": "Lib/site-packages/mypy/main.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "9f14f9914def853b8a85832ca51ecaae06384d0d8b31041774988fadfc962e3f", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/main.py", + "path_type": "hardlink", + "sha256": "f78cfc5706b8129807372c0c7e8bb2599dc61a29d2875376916a9e461b311ea0", + "size_in_bytes": 64579 + }, + { + "_path": "Lib/site-packages/mypy/maptype.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "d47e1df61a442e81ef0937438237e06c7244f6b72d9ce7232fde1f4d5b37ec0a", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/maptype.py", + "path_type": "hardlink", + "sha256": "512120dcdff82c27ac7a439538b870168abae6eae1711e42a2d4a4a6b70995e5", + "size_in_bytes": 4331 + }, + { + "_path": "Lib/site-packages/mypy/meet.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "95328c2c757fd0f3052d76c2e7714ab09cecd5b96dee7c409ed3a0af2dced52a", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/meet.py", + "path_type": "hardlink", + "sha256": "66df7b0cc59f648a4069234611d5461308c3da42d39d8e2648edfd25a2a6310c", + "size_in_bytes": 54063 + }, + { + "_path": "Lib/site-packages/mypy/memprofile.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "08597a4e0fbeda1cd36948985eeef88ee2abd0687454ca4a36e2628d0f9e5f47", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/memprofile.py", + "path_type": "hardlink", + "sha256": "02be05c1a54138de36893d8e1c7a23ebf1b954bd583673c0654fdca789a0965f", + "size_in_bytes": 4174 + }, + { + "_path": "Lib/site-packages/mypy/message_registry.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "92ee8b916837ad45e1d17426487917d7ea54414962902a3a7492f09743a44ec4", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/message_registry.py", + "path_type": "hardlink", + "sha256": "2b80d32d5bd3e0ae93713dab9a0e80c429b91889d16a0ddce00c05dd6665877a", + "size_in_bytes": 17320 + }, + { + "_path": "Lib/site-packages/mypy/messages.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "42e28e30e86fd250988c8bc2ff5d0c47dfaae02e872a8b48bce9b10361238953", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/messages.py", + "path_type": "hardlink", + "sha256": "f533ebdd75daa9ae509ee48799fb60957e4ce5610b3ac101e24e4ac0c8452467", + "size_in_bytes": 137038 + }, + { + "_path": "Lib/site-packages/mypy/metastore.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "3d2d39837b7ff316988e245b5265f04cbb9124448785610e1a7ba6ae0c4e13b3", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/metastore.py", + "path_type": "hardlink", + "sha256": "f3ddf8a6583f30c85bca49ca606f3c8d198944e2064100f79e5acef7d23a937d", + "size_in_bytes": 7339 + }, + { + "_path": "Lib/site-packages/mypy/mixedtraverser.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "8841c18842c0db4dea549a245b7e644ca40b62f6e4eb9251beaa43d8d6b5561b", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/mixedtraverser.py", + "path_type": "hardlink", + "sha256": "ab45700d6b120e68e40f8874b414964a3ef85979245e20525dead215e0623738", + "size_in_bytes": 3852 + }, + { + "_path": "Lib/site-packages/mypy/modulefinder.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "3c682a63de4cddd0d42bdb63c5b84a5d101401ba8f1c040cd40a4ecea9ceca1c", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/modulefinder.py", + "path_type": "hardlink", + "sha256": "69b4c76a5998ab8331129571cdfbb2175ac020a4f9d367a0b8ee214290ff0ee2", + "size_in_bytes": 42875 + }, + { + "_path": "Lib/site-packages/mypy/moduleinspect.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "d79a9121a655d543a951d38711896220791ef9e8e9b69d0c5fff9cc68e9aa5eb", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/moduleinspect.py", + "path_type": "hardlink", + "sha256": "1c2108ef25bad4e90c345a94aa3b91074f477130e96a5726b550588e559fc72a", + "size_in_bytes": 6326 + }, + { + "_path": "Lib/site-packages/mypy/mro.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "77b407b9aac83cccebbc4e3fcdaf53843d4d5610c6ad1e1332ecfae303b11e6b", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/mro.py", + "path_type": "hardlink", + "sha256": "852ae087513c4215a9c6981329ef89b763b28d2ca322bf300f0a59a122ce7f58", + "size_in_bytes": 2002 + }, + { + "_path": "Lib/site-packages/mypy/nativeparse.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "fb999a1fc1566297863ed96fe3807aacee76f224ce9e6e1698c944c24632df40", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/nativeparse.py", + "path_type": "hardlink", + "sha256": "1bbce4212756dc980fc9505f986784f6d65341ec67a7f92f22ba84827004b876", + "size_in_bytes": 72662 + }, + { + "_path": "Lib/site-packages/mypy/nodes.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "d379a19c1ca07320b428efac04fd959f3c69cf769ecab1d1451dcf505b38f3ed", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/nodes.py", + "path_type": "hardlink", + "sha256": "2661140ae00b2530bf7288b40acb1ac230918b75d42a6093bd45b4230fdb5488", + "size_in_bytes": 179975 + }, + { + "_path": "Lib/site-packages/mypy/operators.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "fd4a5d8b12ee4b8678b8a147c49b72de6dd704ec154fd472c0959d1113aaebf3", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/operators.py", + "path_type": "hardlink", + "sha256": "04769faf610d6583e6532b4480a398312d46c0f28579b581b39a6793ca72664f", + "size_in_bytes": 2866 + }, + { + "_path": "Lib/site-packages/mypy/options.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "ab0cb27ef20ddd94e926a2f567c9a129b2bfd9adb9973fe27320cf867a28ddb4", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/options.py", + "path_type": "hardlink", + "sha256": "96ece33bd747aeaa1e90fefcff86a02abc3fbcad391b66e5d2ad4239ff62e964", + "size_in_bytes": 27389 + }, + { + "_path": "Lib/site-packages/mypy/parse.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "3c37658c1d3a9fab9b5c92c3a5f81e336f0378d68b9f91bf3f88572038b2d88c", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/parse.py", + "path_type": "hardlink", + "sha256": "3661565fa28729824de4a5bd7243f93344704afd4c912edc9f87bc4861f577c8", + "size_in_bytes": 4996 + }, + { + "_path": "Lib/site-packages/mypy/partially_defined.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "60182fa7e2d212b3a6cb1245e980f49a50e60b4705acc40c1ea92e290dfbbc90", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/partially_defined.py", + "path_type": "hardlink", + "sha256": "141a81f56e2fdbbaba323f4da3958d7f98e3b14b04913bf230a693b9e23baae4", + "size_in_bytes": 26746 + }, + { + "_path": "Lib/site-packages/mypy/patterns.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "6b72cd1d3550f89d08e9e1f7bbc0eff24b3253923b71d0e9c6cb825ff1ca1625", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/patterns.py", + "path_type": "hardlink", + "sha256": "7a94bf47d16fe669d2006b1ce84b54c6d9a8df8fc30f5949e417af4dd327f009", + "size_in_bytes": 4048 + }, + { + "_path": "Lib/site-packages/mypy/plugin.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "370902a754e31d84cb89e069e78329da70ed1468659dfb1f73c11ac29a165a8a", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/plugin.py", + "path_type": "hardlink", + "sha256": "c80702ba42165b6cdf947a5e8a5b483bac0ac57ce826be6cfdc81f2dea79360c", + "size_in_bytes": 36250 + }, + { + "_path": "Lib/site-packages/mypy/plugins/__init__.py", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypy/plugins/__pycache__/__init__.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "9339fb7354330a9e81132f797475ec5dde46e3570acaec5669a79cac03223aa7", + "size_in_bytes": 141 + }, + { + "_path": "Lib/site-packages/mypy/plugins/__pycache__/attrs.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "6da7a52502bdd174fe8340d35469d05c3551988df451603e7e006c1d6727c081", + "size_in_bytes": 59176 + }, + { + "_path": "Lib/site-packages/mypy/plugins/__pycache__/common.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "34f36ff5d44649b4a9e39f301ee9e71a8f567a1f150d08fa046ee67d05d08b70", + "size_in_bytes": 19005 + }, + { + "_path": "Lib/site-packages/mypy/plugins/__pycache__/constants.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "3284f276a0a932b99868c4e69e9eaf45c558cd5a8525e1654a898f813a45ce13", + "size_in_bytes": 1899 + }, + { + "_path": "Lib/site-packages/mypy/plugins/__pycache__/ctypes.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "78e1ab38bf5d4c9b080913ccb952a237867407dfcc826f75bba002cc3a3e4d07", + "size_in_bytes": 14011 + }, + { + "_path": "Lib/site-packages/mypy/plugins/__pycache__/dataclasses.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "aaac7304d65822fc01452d27c50c4f99798c1de9ee14536c0c256ecb02501e39", + "size_in_bytes": 55312 + }, + { + "_path": "Lib/site-packages/mypy/plugins/__pycache__/default.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "0f5613f8ebc9b1b08f710102c2bef4f9ad3831a2bb598f94fa505516bc61860e", + "size_in_bytes": 33280 + }, + { + "_path": "Lib/site-packages/mypy/plugins/__pycache__/enums.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "37ade6305287728b45084b42801559dd819166868f02076a965da30c9f440455", + "size_in_bytes": 14047 + }, + { + "_path": "Lib/site-packages/mypy/plugins/__pycache__/functools.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "5fa60fc0c6387dd75fffcc596066c10fce9b224d60a213a88010ac146efacec5", + "size_in_bytes": 20121 + }, + { + "_path": "Lib/site-packages/mypy/plugins/__pycache__/proper_plugin.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "225d678d0ba279374707eb475fbc7d7305bb74913cea82257d92ea910b6bd2e5", + "size_in_bytes": 10648 + }, + { + "_path": "Lib/site-packages/mypy/plugins/__pycache__/singledispatch.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "b7fb7f65c4d76c3d334542aeee73099195efb0223f35d0f33c01f9969b68f4d3", + "size_in_bytes": 10510 + }, + { + "_path": "Lib/site-packages/mypy/plugins/attrs.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "4ff104c55b30886b1ea906328ff4a390e01489334a9ca778b705c5afaed95717", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/plugins/attrs.py", + "path_type": "hardlink", + "sha256": "88cb2514e967403540871f6c6298ffc880ed29eff4b815d7d0b730444704b77d", + "size_in_bytes": 46508 + }, + { + "_path": "Lib/site-packages/mypy/plugins/common.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "2f9d983fd6ba9cf705cc9d022a0134a4214fcfdc0dce15c11f3a192c1cbba015", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/plugins/common.py", + "path_type": "hardlink", + "sha256": "8a41506f69deb6a9a6496ffbd98773ee3d53794a86e2d785b8fd439e938e2c36", + "size_in_bytes": 14117 + }, + { + "_path": "Lib/site-packages/mypy/plugins/constants.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "94113c23edbfcfd26fd2e67721067cd9efbc4bb1da185fd1f7f69cc58e22f18b", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/plugins/constants.py", + "path_type": "hardlink", + "sha256": "1215a7225914d651e417a0b0955a848ad404f5d33d3df7599f7e5b1cc237ee37", + "size_in_bytes": 819 + }, + { + "_path": "Lib/site-packages/mypy/plugins/ctypes.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "3307fa3ef95e7bbba4257dd413893454429e253f858b60e4ddd80048751460f8", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/plugins/ctypes.py", + "path_type": "hardlink", + "sha256": "b81f38c4d084cc255f78a8c2ec51f2edd145e68e795772fe46f7bd383dd8a313", + "size_in_bytes": 10675 + }, + { + "_path": "Lib/site-packages/mypy/plugins/dataclasses.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "2fd25ca2b9417cbb37e3b010f95a68c999fec7534d232a6e3502792be0153e76", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/plugins/dataclasses.py", + "path_type": "hardlink", + "sha256": "5bd20bf4333a9bcbd2d504a4d7d12b0a12d0b67dd1dc832b2421d69578f8f256", + "size_in_bytes": 47255 + }, + { + "_path": "Lib/site-packages/mypy/plugins/default.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "1261c04218c9ad523676d93d5c90204e899974b35d3440ee1b15b47dba516725", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/plugins/default.py", + "path_type": "hardlink", + "sha256": "973004e2706e76e27bfe10d191174553487563a9715cd8bf85e128b20cdf0d61", + "size_in_bytes": 24118 + }, + { + "_path": "Lib/site-packages/mypy/plugins/enums.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "b685bb1339140aefe0a8cf7492bd075b705bee41962472f33326219c089dab24", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/plugins/enums.py", + "path_type": "hardlink", + "sha256": "5e871155fefc9b0dec3a287c7d5823ae1b8459fa75b229a68ca3b25db71d819b", + "size_in_bytes": 12110 + }, + { + "_path": "Lib/site-packages/mypy/plugins/functools.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "1695f8b962b3507dc8db0288c81f4e1d1f2248a6cb8ad6e4410a59886a688e55", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/plugins/functools.py", + "path_type": "hardlink", + "sha256": "11cb029d06e1cdf441b1e3f2dcaed3dc73738835399fce062dd0096fd6b25f8b", + "size_in_bytes": 15527 + }, + { + "_path": "Lib/site-packages/mypy/plugins/proper_plugin.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "487fb2603fd414a064dab087a71e1481988c4380c27e312ee989c2861f0d6562", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/plugins/proper_plugin.py", + "path_type": "hardlink", + "sha256": "1dcace4443ca4d672f9c0d81456ee6ffec713909e7938c14d58dd82a4f5dba87", + "size_in_bytes": 6574 + }, + { + "_path": "Lib/site-packages/mypy/plugins/singledispatch.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "60700edb6b72d88f6189d21a7ef7dec9a29578330d990fb3b7fd3c1866358d26", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/plugins/singledispatch.py", + "path_type": "hardlink", + "sha256": "ac41ceaa4dc352fb78594708ed28673490a0fd01e3e2482012a0f03daf20732e", + "size_in_bytes": 8151 + }, + { + "_path": "Lib/site-packages/mypy/py.typed", + "path_type": "hardlink", + "sha256": "ce50614dd0100517c9c5e2570fe42795789962c880258624af799b12c9b049a7", + "size_in_bytes": 64 + }, + { + "_path": "Lib/site-packages/mypy/pyinfo.py", + "path_type": "hardlink", + "sha256": "511b4c42ae05c4f92b3d60768ddf304060de81916822f3bc8ccfc05936b23a26", + "size_in_bytes": 3014 + }, + { + "_path": "Lib/site-packages/mypy/reachability.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "1669b4d80bbd0de853ef5852e6936886eaf2f61fb4580bae408cd9f51bd0ef03", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/reachability.py", + "path_type": "hardlink", + "sha256": "b62ef84293f87c6a3fda3a8a744094e25036c9436d40a9e8385f57e60202be20", + "size_in_bytes": 12977 + }, + { + "_path": "Lib/site-packages/mypy/refinfo.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "7ea071f55b5d061fd90b7ef6bd80f180141c62fac0a09db898999c46d0a0cfe6", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/refinfo.py", + "path_type": "hardlink", + "sha256": "a9a58a5ad92076561057136e714dca1bee14d8eb0e042486f0af25aaea5cd92f", + "size_in_bytes": 2784 + }, + { + "_path": "Lib/site-packages/mypy/renaming.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "853088ab09ccd2bc4d12c2e6f7251b1641422c763562718a2d072b0b9162eb2f", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/renaming.py", + "path_type": "hardlink", + "sha256": "f89bb734aa549c9caf53c152cd947e2a08a9500229461acb888544db7f79355a", + "size_in_bytes": 20494 + }, + { + "_path": "Lib/site-packages/mypy/report.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "d09243610aa4f6fdb9500da5a18541270ee2fb90d5503e8ebfeb5b6c58db4dd5", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/report.py", + "path_type": "hardlink", + "sha256": "f3ce7e2eda91672d9c6b0819437370d4d44be615d26fe1008c29e68639b63371", + "size_in_bytes": 34700 + }, + { + "_path": "Lib/site-packages/mypy/scope.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "da9cd841af64a22ab27e359e876987347acadad610bd90c98b5675a37969e4f1", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/scope.py", + "path_type": "hardlink", + "sha256": "1bd44936b57f98992468d8169f91b8b8d80980db0cb00e990551aeecaec018b2", + "size_in_bytes": 4233 + }, + { + "_path": "Lib/site-packages/mypy/semanal.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "7f4443c752aba658037771de6a9d64566e2631d94cef8d7c71be0eae72e747fe", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/semanal.py", + "path_type": "hardlink", + "sha256": "eed1ca4ba0a12d87e3bcd99d15674ec8567ec68fb357aaa888ec09d13d96e34f", + "size_in_bytes": 361221 + }, + { + "_path": "Lib/site-packages/mypy/semanal_classprop.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "410de5df9d4029d158a99bace34eddb8eedf1d13189b99e542d499b700333941", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/semanal_classprop.py", + "path_type": "hardlink", + "sha256": "f350a5475280dbb4c3108974e2f3777292cf4d5304269845886a789fcee44636", + "size_in_bytes": 7673 + }, + { + "_path": "Lib/site-packages/mypy/semanal_enum.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "9dc89b6cec69ab2a639cc82e5244c466fe4142f47ec7a7a2025fe3dc6d05f0ee", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/semanal_enum.py", + "path_type": "hardlink", + "sha256": "35f1de5bbae51eed2acee5ce3961640ab213087b0d70c2716436f9f213686c2c", + "size_in_bytes": 10197 + }, + { + "_path": "Lib/site-packages/mypy/semanal_infer.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "6504c6d1524419f3bf397676eb293c32055d636a6553b7b421085c1818f8b4fb", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/semanal_infer.py", + "path_type": "hardlink", + "sha256": "cac721e2d2048b0c5e7f0ff52cf4aa076c13ca825b9e53a609f3b822afbf6c2e", + "size_in_bytes": 5350 + }, + { + "_path": "Lib/site-packages/mypy/semanal_main.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "b5a8745b188fee98f8e3877105029088cd85110bbf70bd9cac455ab499acd65b", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/semanal_main.py", + "path_type": "hardlink", + "sha256": "07ed6b20daca929bede09de2024e1f7cf80c656007e641a91b1df234c88623a4", + "size_in_bytes": 21554 + }, + { + "_path": "Lib/site-packages/mypy/semanal_namedtuple.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "c69482379de0988fd13fc6645878602f2deac9a8c44658854ce2482c1f9555cf", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/semanal_namedtuple.py", + "path_type": "hardlink", + "sha256": "69709abf29e73c35c64adc03da7383a583866060ae64f7d98db64da77d516462", + "size_in_bytes": 31368 + }, + { + "_path": "Lib/site-packages/mypy/semanal_newtype.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "0425cb9b049d5424af4f1170720eee59c16f25a192ffbc354ee58e6c431c1145", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/semanal_newtype.py", + "path_type": "hardlink", + "sha256": "fa429dcdb62f4ee52946a28c37d1a915206a90a199a8520329fe7ba64a2c714b", + "size_in_bytes": 10576 + }, + { + "_path": "Lib/site-packages/mypy/semanal_pass1.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "140e55ab035c092ef1e95140007e5d6bf88aa2ffe78fd358b6c99476fbb8fef5", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/semanal_pass1.py", + "path_type": "hardlink", + "sha256": "eab873105e95ee8aceb208d8b27187cfc96a686dd303e82bf10140ff2b628647", + "size_in_bytes": 5584 + }, + { + "_path": "Lib/site-packages/mypy/semanal_shared.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "ace5dad968cf67b882d8b9502b924101cd87ce263758bf85fb8e6b04f0ca7048", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/semanal_shared.py", + "path_type": "hardlink", + "sha256": "730f54640a75b0fcd70262ee888b932ffbcaf25031fd8f15e1f5bd88fe75e512", + "size_in_bytes": 15795 + }, + { + "_path": "Lib/site-packages/mypy/semanal_typeargs.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "ce0bd27ac739ab981eb9926712fc3d0060eead5c339072aaeda9fc2d8b4a0894", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/semanal_typeargs.py", + "path_type": "hardlink", + "sha256": "430f140b3a510135174882d548b8bc3ef3ea3b3b137f9062355d914e8af094fe", + "size_in_bytes": 13338 + }, + { + "_path": "Lib/site-packages/mypy/semanal_typeddict.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "40c5bbc28e72bd655063f501620978ce71947a6d05fc36a05d9d4d27b677428a", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/semanal_typeddict.py", + "path_type": "hardlink", + "sha256": "3f8f7dc3f4905eb4ddc3fe30ff3bce5b8630943c62c4ac10781d3219f3a7715e", + "size_in_bytes": 26043 + }, + { + "_path": "Lib/site-packages/mypy/server/__init__.py", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypy/server/__pycache__/__init__.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "42db1fedd1d5eec3c595723335d8e6ff318ca1eea9319f8006f2532f56d9ffc3", + "size_in_bytes": 140 + }, + { + "_path": "Lib/site-packages/mypy/server/__pycache__/astdiff.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "6c83f65e08a28dcc092b01888bd56689443459dac02771a989c195f0ae09666f", + "size_in_bytes": 31799 + }, + { + "_path": "Lib/site-packages/mypy/server/__pycache__/astmerge.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "396f33629b40602af2448996384489c1a839db3dd95de5a4ce59e1e8774ccb9b", + "size_in_bytes": 42266 + }, + { + "_path": "Lib/site-packages/mypy/server/__pycache__/aststrip.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "2a921a3e78869213bd4d7f02bde1e12c8266916f111e0095cbd7bff58c8f58be", + "size_in_bytes": 17002 + }, + { + "_path": "Lib/site-packages/mypy/server/__pycache__/deps.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "28f5a7e1e1a7fefc970c6fffcc9d1ae2788b8e7ff283b2e0f7e03629a91396c2", + "size_in_bytes": 76614 + }, + { + "_path": "Lib/site-packages/mypy/server/__pycache__/mergecheck.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "3fa25971f45997b55de9b7c690d9f8784994eac391d79d9656ba388a1a56c6ea", + "size_in_bytes": 3677 + }, + { + "_path": "Lib/site-packages/mypy/server/__pycache__/objgraph.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "274d521b484b0a5274a8247c88cfe34acf122fd7b8928cd11d9f18cbf7415234", + "size_in_bytes": 5567 + }, + { + "_path": "Lib/site-packages/mypy/server/__pycache__/subexpr.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "2bddf2e4e42acdd04db03b1d60c2cc533605a1ce3cbdf561c52476d46b3aa28c", + "size_in_bytes": 18428 + }, + { + "_path": "Lib/site-packages/mypy/server/__pycache__/target.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "5c132f5fb9678d3e02f77a220275387b5b641881c6ceb183d65d92876d856f4c", + "size_in_bytes": 673 + }, + { + "_path": "Lib/site-packages/mypy/server/__pycache__/trigger.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "26fde58643f4abf8aa3f15acbf301977b8cc5bd47315bc50430bfe2daa73efca", + "size_in_bytes": 1405 + }, + { + "_path": "Lib/site-packages/mypy/server/__pycache__/update.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "7c313b55ec68dd40a5be87276e5ae0ba53b739351a7ac94ace154d383e9d655b", + "size_in_bytes": 60382 + }, + { + "_path": "Lib/site-packages/mypy/server/astdiff.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "01ad05e47dcf9b0952689ac872c3600aa736c11ed6b8c4bcdf7326822cd15e8a", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/server/astdiff.py", + "path_type": "hardlink", + "sha256": "830eb38d1b044d7ef745be991852896629041fb7cafd37096f10747a9f0cd031", + "size_in_bytes": 21362 + }, + { + "_path": "Lib/site-packages/mypy/server/astmerge.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "e67684d0b3c78de3e5c53bcf62e24f6632d97a178ae192bb299526708fe63d68", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/server/astmerge.py", + "path_type": "hardlink", + "sha256": "e3fb8b11b076a9085da2ba6bf04c2b1ad067564e43c3c3e18c492e0659874e1c", + "size_in_bytes": 20982 + }, + { + "_path": "Lib/site-packages/mypy/server/aststrip.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "3698e799b92610b7ce2cf23172020559c81111c7d6bb76606b168555017f3351", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/server/aststrip.py", + "path_type": "hardlink", + "sha256": "7fc118d64cd10942ffb11d52b9f260c246cb0bb0392003a3c0344913d1e1af6a", + "size_in_bytes": 9789 + }, + { + "_path": "Lib/site-packages/mypy/server/deps.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "8677638ed3c226463d9c3867c60407d1c7fc286eba16453f2c0dd045c6897f3a", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/server/deps.py", + "path_type": "hardlink", + "sha256": "309c4e2d9174f136bd5e0cc187df36095b649d9d8327d40bf76f2fdfa3c11623", + "size_in_bytes": 49683 + }, + { + "_path": "Lib/site-packages/mypy/server/mergecheck.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "c2eee0a589e4aa365fb5b7501788fdead4a8c0eba2bed8431e48121b08d21a12", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/server/mergecheck.py", + "path_type": "hardlink", + "sha256": "c85a466f22bd257ff954207d574673f9bde8fff3ca99e8d1c2000bf4b1746d47", + "size_in_bytes": 2757 + }, + { + "_path": "Lib/site-packages/mypy/server/objgraph.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "e996c697217da3de4a10f9dd65172bad7a32f2cdf3548d27a78f7ae59c4d3a2b", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/server/objgraph.py", + "path_type": "hardlink", + "sha256": "976a2db84b72cba27aee97d6814d7b760f0b216903a8fdf862b04d8c3ae3cad7", + "size_in_bytes": 3230 + }, + { + "_path": "Lib/site-packages/mypy/server/subexpr.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "e319cac8f138cb1988c55a37354e5c4491d3f7af7b286040f23caf2552adf55d", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/server/subexpr.py", + "path_type": "hardlink", + "sha256": "d416623bb4e6b8e401a7044deadd43ca66c5a30452b20b8cfd343e37eea78f6f", + "size_in_bytes": 5494 + }, + { + "_path": "Lib/site-packages/mypy/server/target.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "f4011d8599ec630ee3ec5241e1019fc0677c1ab11c5cf2908888eea4e44cd298", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/server/target.py", + "path_type": "hardlink", + "sha256": "21bb8adaaaad32f10f0287fcdc1760609bfa0065b6abfa38090c42e539c1f818", + "size_in_bytes": 273 + }, + { + "_path": "Lib/site-packages/mypy/server/trigger.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "6eefe6aba68112a587fe7cf76f323e5cb58ff7f7e4fda06767e441376839bf0e", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/server/trigger.py", + "path_type": "hardlink", + "sha256": "aafa38b422f2ae1238f283d37c33bf9d639565f8cc7188e831d1a05aca1c10a8", + "size_in_bytes": 793 + }, + { + "_path": "Lib/site-packages/mypy/server/update.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "7e6bdf04f4d8dad28f2b23d58c15858781b1d270d814e9e61bf366c9b93dd463", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/server/update.py", + "path_type": "hardlink", + "sha256": "4fc4e6191b5cf76b9e6e10a155b797172c87a60176b1c356769e6e805d31848a", + "size_in_bytes": 54315 + }, + { + "_path": "Lib/site-packages/mypy/sharedparse.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "499a8cde5ec5713d59574ca94c69a87b0ce088feaf48dff6e324663b41e56306", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/sharedparse.py", + "path_type": "hardlink", + "sha256": "b4f2c6d1c51b064654ecf737ec6f342b9b36e056fc8647afa7ba89209053a659", + "size_in_bytes": 2146 + }, + { + "_path": "Lib/site-packages/mypy/solve.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "5becfae2b2eaee9fbbe59697f0765087c78df72c598b97532167074bd37d8fb6", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/solve.py", + "path_type": "hardlink", + "sha256": "cb3da9d8c7f5138219c69a61e4c4b05af4fc0f5c91a1576e8b69026075fc2968", + "size_in_bytes": 24530 + }, + { + "_path": "Lib/site-packages/mypy/split_namespace.py", + "path_type": "hardlink", + "sha256": "3faec789a9d2aec3126687ae4ba17db3033978af81d9f1015375c9e9116d628d", + "size_in_bytes": 1289 + }, + { + "_path": "Lib/site-packages/mypy/state.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "96a7238c2294fd4d7f564fa5e7f8e275c2ed3e540ca34d836f0f1304dd09019b", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/state.py", + "path_type": "hardlink", + "sha256": "c867d3752b5123d049dcca45bd94bcf6ebd538bbaa5b1372f43098f920c7c1cc", + "size_in_bytes": 850 + }, + { + "_path": "Lib/site-packages/mypy/stats.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "9395574d1ba29450460c15ceeb11114e0666043a176b7a99a7fe89a9acc16343", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/stats.py", + "path_type": "hardlink", + "sha256": "ebad72b2305e65acaf075eae2bf6c5afdf0a8ea2da98d9bd050a453bc891f730", + "size_in_bytes": 16846 + }, + { + "_path": "Lib/site-packages/mypy/strconv.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "de5fc53232fc91fa27babdc8bc1e32e3f8ce73018eaa1256de7a1f30b5cae555", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/strconv.py", + "path_type": "hardlink", + "sha256": "756de64ca779c07b94b30b7401fe4aaa649f09e33b411cc8c3bddabb38e36ec5", + "size_in_bytes": 25969 + }, + { + "_path": "Lib/site-packages/mypy/stubdoc.py", + "path_type": "hardlink", + "sha256": "96b160917e2408c6a65476c5c2e011273898db58527ac05bfb42d1e47228cc0c", + "size_in_bytes": 19328 + }, + { + "_path": "Lib/site-packages/mypy/stubgen.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "a973be980897bfcddb541b8bccda2fb076dc366100f62eeca171d5504d118c9a", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/stubgen.py", + "path_type": "hardlink", + "sha256": "74608fa79acb45c362d37ad02c9e37b3b2e09c7db7930659b88e883b9db219c6", + "size_in_bytes": 78760 + }, + { + "_path": "Lib/site-packages/mypy/stubgenc.py", + "path_type": "hardlink", + "sha256": "e3f4d2a523f20ae72916a4530dd8e7427f397593a972199e62bea8e0d450751d", + "size_in_bytes": 39265 + }, + { + "_path": "Lib/site-packages/mypy/stubinfo.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "d7c830b1a22ca8f54a27f21e2db9fb6066d0e9d71cbb56b4c430a7fa23bb45f0", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/stubinfo.py", + "path_type": "hardlink", + "sha256": "d51bc65665b47b56301513cd1edc631ee2d35bbb1d1223008f27b054b117cbba", + "size_in_bytes": 11681 + }, + { + "_path": "Lib/site-packages/mypy/stubtest.py", + "path_type": "hardlink", + "sha256": "bacf04ee90d8a2bdece634b52b954ed38fa8281c5763a4991985c4171d728afd", + "size_in_bytes": 103787 + }, + { + "_path": "Lib/site-packages/mypy/stubutil.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "776582178d7db60a61025402132b4826cafde00bc690f125ec60a49d289dc765", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/stubutil.py", + "path_type": "hardlink", + "sha256": "917dbb17305a21094d564e863b5a19123b14b0616c8d137d95e0c332743ad85e", + "size_in_bytes": 33495 + }, + { + "_path": "Lib/site-packages/mypy/subtypes.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "41ef81c9425846730fce80153bfb8e883736ce5699687d9ffd33e718394522a5", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/subtypes.py", + "path_type": "hardlink", + "sha256": "0b040765555bd861338571ac8cab0ccb6adcae239d841f2ca9af8e423dd3b2b8", + "size_in_bytes": 100651 + }, + { + "_path": "Lib/site-packages/mypy/suggestions.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "795e7bd407427f7fef59e462da020a909fd7a058f91a5555c56ed5497fa7cced", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/suggestions.py", + "path_type": "hardlink", + "sha256": "52bc5414ec02d661b80cd4cc63444e0d3caf710ad914a3d88982eab87c2d5416", + "size_in_bytes": 39056 + }, + { + "_path": "Lib/site-packages/mypy/test/__init__.py", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/__init__.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "f5bc88e00a74363a6053856f26c0ebe50c20d3a073b865350a73a1caaba1eee5", + "size_in_bytes": 138 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/config.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "0d31ad4ca08fa2fab33e3b298dd8eae2f6da53c70af4302bc3b0cec9f57a782d", + "size_in_bytes": 1165 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/data.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "15ad8ece3ca6433679bd0d13357982e319f5662cfbc860296a1eb483ab55ab98", + "size_in_bytes": 47164 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/helpers.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "754d2c45acfa9264582f08a3dd3bfc868eb4f461999678649ced7d2e1b786274", + "size_in_bytes": 27615 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/test_config_parser.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "36a254afeb3096990b7a4ae6ffcddfb1fb68711df516fef17e02ac910445c230", + "size_in_bytes": 7537 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/test_diff_cache.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "62764b11d2f771f5255d5049da582b9c8c8e877249a346da2a79c447482f7173", + "size_in_bytes": 11148 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/test_find_sources.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "cb4c8b7bf16785dd12beb63142e9f8c57ef0f7fc8b442477d56039731987b88c", + "size_in_bytes": 19638 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/test_nativeparse.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "dad9f42204df87c2600a00b1582aa5af83f7230205a36853c08e54aeb6dde765", + "size_in_bytes": 14095 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/test_ref_info.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "a0dcd533a13bae1c2350f21dd835dae198efa9da37c6860221a0d9d879d47410", + "size_in_bytes": 2783 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testapi.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "af3d7cf90620e8ab39119fa38e38b4a25cececbaa69686f543196890b51d8f32", + "size_in_bytes": 3828 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testargs.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "0def75bd57274093e1f4dd7d004095d740c1cc562228624b2d255a814bd93211", + "size_in_bytes": 4367 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testcheck.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "475401e1523ee8d0675498025a850904cc7dd87732edf7e52ed93fd41efe8152", + "size_in_bytes": 19991 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testcmdline.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "a56a5346de8ba8783400b07a626e0dcf892e2637fb7b6f876f06fa4e12ec52dc", + "size_in_bytes": 8454 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testconstraints.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "c22e189de3e2364da409e1ba85abb648c94b5bb41eeca3309294ea71383b44b1", + "size_in_bytes": 11499 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testdaemon.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "cc5e29de9f8b63e0e116123592ce08abb7ade080678699375e50b37e9ab12812", + "size_in_bytes": 8581 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testdeps.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "46670028f2793f90f7df328a77c080d6675ccdd99f6412a3c1602e87048734fc", + "size_in_bytes": 4780 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testdiff.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "7a54cf862e3ec11c323d47ecddc9e835cc6833cd736cf1cacaaddbaca3a5add2", + "size_in_bytes": 4043 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testerrorstream.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "070ede829915e2aaf81f526d71adf59cc5cd38bf6e367d2a65efa4801112f2c3", + "size_in_bytes": 3028 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testexportjson.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "138acd58615b4ce094ff62d4dc8913ff34a6abe224f2ac662580998583eda6c4", + "size_in_bytes": 5829 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testfinegrained.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "8c85a74c2aa388acc853ec930746249073851938c492e60d4f0855094f30fae4", + "size_in_bytes": 23908 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testfinegrainedcache.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "615c977b553c76699e78790f6f238db981c147ebefeba8d88edd4b7ec3d57dcc", + "size_in_bytes": 1003 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testformatter.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "d98b5e9652a714e8b5efe572c6e86a8d221eac4872b922a9a85d0960c58b6695", + "size_in_bytes": 3139 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testfscache.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "473e73edeb6d2118235652308335c472925e7a3cffbd686abf0a5b4b848f53fd", + "size_in_bytes": 8775 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testgraph.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "f8dc908d725257a806cd4e900c6230b944fd7fae0e7361fa47453b02663d83df", + "size_in_bytes": 9617 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testinfer.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "b6047dfbdf3f1ea642b849dc82a76971f830f9bd4efa1375f8f424eda78880ce", + "size_in_bytes": 25107 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testipc.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "8e5da43d4e7c162a5422e1615a171cd3159e7c2c8745cdf838dc78eefe8a1b7b", + "size_in_bytes": 7856 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testmerge.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "49026b17484d05bf2bb94f197b35607ac7858776570ff7083920b3c742218a29", + "size_in_bytes": 15224 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testmodulefinder.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "286e3f790df534393f98a04bdcd3ddd1dc8e632a6df487c34a1102ec6c707119", + "size_in_bytes": 20341 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testmypyc.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "e84339a208d90876eaae256c49f67cb9ab12f8924fd2139575abbbff343e0b05", + "size_in_bytes": 2184 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testoutput.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "84943c04490bbb99eb919228d950038b79f63fadaf9a947709acc4e748b1e6e2", + "size_in_bytes": 3571 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testparse.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "5b2edde15af049dfd4c54b561e034485ae054a2bb80640971bc90252fc74c25e", + "size_in_bytes": 6032 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testpep561.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "2099f11e9b5b10070181bd4daa0411e82e65441f338e3190165edf6006c59084", + "size_in_bytes": 11748 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testpythoneval.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "e2cd8dfb41b77dd1a4dde87beb978b11e70a4aeb4a01f1fe05e15d1c183ba179", + "size_in_bytes": 7240 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testreports.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "0d7980ab16f37d68723d04638efa1cd7dd2dcbee468bc3d91d5cb648a26d0a5a", + "size_in_bytes": 3235 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testsemanal.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "9842b0bb280cc9b6205527cc0adcfa2d4fe67bafc8f9def1eaea67e643101975", + "size_in_bytes": 11685 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testsolve.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "76024bd400af80cbf93440f60ffd8e2ce436591cd7b36d7716017b5f8feda81b", + "size_in_bytes": 26534 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/teststubgen.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "0ac3e67f56d4a889ecd67bfc8b6ef8e2a5f6114ced2dd86b8fb79f886aee916a", + "size_in_bytes": 100344 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/teststubinfo.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "5d67776e04467a8d9d2c8bbb321c561c72d8e5cf5cfe592bc095e0b0eadeb78f", + "size_in_bytes": 2789 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/teststubtest.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "270364a15f9cf34bce2aed06f7b545f8f69ecc0adb7dfd0826f4feaec03e0181", + "size_in_bytes": 111311 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testsubtypes.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "635fe92c7d0cb66edc0af48b22478e6ac10bf252671b99da2d775bb6a46a6765", + "size_in_bytes": 35939 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testtransform.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "22a560dbc33bc744cc19d3514ed7558eda8a7a88ba1346029767424f6b377c57", + "size_in_bytes": 3445 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testtypegen.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "8f06cc4b3e336616dd3267ba032a936ff16ebc6eb786429a8cac90b256b3d4c3", + "size_in_bytes": 4719 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testtypes.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "30eb3a0a170bd9c320ae584ae909c17fb4daf975fb16e20d9de88fafc1e1c151", + "size_in_bytes": 154513 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/testutil.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "fdba977973642630b0a3997e327089f6727d0e557aab66c02048c4009640b4c8", + "size_in_bytes": 6115 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/typefixture.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "19be09e3b0222602ab6f37b0dbaa87ad22f3d6a4be999b047e2aae6d12468643", + "size_in_bytes": 23992 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/update_data.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "c8117e1b62fd95823e5cefa29620ad7f7c60f4296ba6f84b0c7dd3da4c024dde", + "size_in_bytes": 5051 + }, + { + "_path": "Lib/site-packages/mypy/test/__pycache__/visitors.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "eff3bdd38db92d779393941d73d49d53cdd3da3e87100dcd0c50344aaf94a6c9", + "size_in_bytes": 4648 + }, + { + "_path": "Lib/site-packages/mypy/test/config.py", + "path_type": "hardlink", + "sha256": "54478fbf3ec11d670d0904b5a98e47fac3af0a036e20ddb263acd99976e8f645", + "size_in_bytes": 1301 + }, + { + "_path": "Lib/site-packages/mypy/test/data.py", + "path_type": "hardlink", + "sha256": "91d09c45fec49b8cb65aa0398d782bebf4854b8dc66b51b96307b6fe7ad77087", + "size_in_bytes": 30791 + }, + { + "_path": "Lib/site-packages/mypy/test/helpers.py", + "path_type": "hardlink", + "sha256": "2547aa509569e2f9babce8fb5405073f22767687def9603b6a5960b6e1f0f619", + "size_in_bytes": 16992 + }, + { + "_path": "Lib/site-packages/mypy/test/meta/__init__.py", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypy/test/meta/__pycache__/__init__.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "7c0f10efc6136167be92545b238a0f61bbaf6f03a13c0cf6ea8e98a0eba89297", + "size_in_bytes": 143 + }, + { + "_path": "Lib/site-packages/mypy/test/meta/__pycache__/_pytest.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "dd16375f54bd44c9cfa72b331227c4b0067723614d0d821862d040b8c4432a29", + "size_in_bytes": 4386 + }, + { + "_path": "Lib/site-packages/mypy/test/meta/__pycache__/test_diff_helper.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "25091055ea125298cf297228ecfbf365cbade87f928048f341824e78cffe1982", + "size_in_bytes": 2688 + }, + { + "_path": "Lib/site-packages/mypy/test/meta/__pycache__/test_parse_data.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "01324ad0f8772ed0e8560795a7b68316fcf2934ec3e1ebfbe5a3ffa12d46a6e8", + "size_in_bytes": 3698 + }, + { + "_path": "Lib/site-packages/mypy/test/meta/__pycache__/test_update_data.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "dfe51017d16a8587709eb3edf647ea8a0b72dac16e9dac07daf61ba111310b8c", + "size_in_bytes": 5624 + }, + { + "_path": "Lib/site-packages/mypy/test/meta/_pytest.py", + "path_type": "hardlink", + "sha256": "0471a85ee493d4dd88a950655ac24f02f052c5cd2a56900b0e3c8b59556fc4f0", + "size_in_bytes": 2276 + }, + { + "_path": "Lib/site-packages/mypy/test/meta/test_diff_helper.py", + "path_type": "hardlink", + "sha256": "1134e4d24c84bdd28ffc230829d758dac5faa12c13794cc4a8d8037813cb23a1", + "size_in_bytes": 1692 + }, + { + "_path": "Lib/site-packages/mypy/test/meta/test_parse_data.py", + "path_type": "hardlink", + "sha256": "dec7dbf6d41b81a33f8a8cb3c09f16b67fe2fef7b5ed52ebbf73e16123a9490b", + "size_in_bytes": 1895 + }, + { + "_path": "Lib/site-packages/mypy/test/meta/test_update_data.py", + "path_type": "hardlink", + "sha256": "0dd839bd1d9a453b2185ca22d3cdc532f54148ce4af79c9c06e931c0b9557ab5", + "size_in_bytes": 4770 + }, + { + "_path": "Lib/site-packages/mypy/test/test_config_parser.py", + "path_type": "hardlink", + "sha256": "e340ff6aa443e900aa254e01b03066ff8edbe17f839eed399f7e88d8163594e5", + "size_in_bytes": 4167 + }, + { + "_path": "Lib/site-packages/mypy/test/test_diff_cache.py", + "path_type": "hardlink", + "sha256": "c18b4788cce5e00cd04a864b0c7eb05babee33c34aa87e7c10a768ccd79f0f6c", + "size_in_bytes": 8601 + }, + { + "_path": "Lib/site-packages/mypy/test/test_find_sources.py", + "path_type": "hardlink", + "sha256": "5ff6111dc4ba17bb29d8c0b661ea5ab6282b7f1c5284803aab6ce3e9887425f0", + "size_in_bytes": 13693 + }, + { + "_path": "Lib/site-packages/mypy/test/test_nativeparse.py", + "path_type": "hardlink", + "sha256": "59afbb5f02bfbfbfe066449dbf7a69522e97854fc6bb7ace29827931a34c103d", + "size_in_bytes": 8609 + }, + { + "_path": "Lib/site-packages/mypy/test/test_ref_info.py", + "path_type": "hardlink", + "sha256": "30c6dc600f2d5ff90281584f74b5f9d3bbe4cc9b17d7770df77bbae61fb7d25b", + "size_in_bytes": 1469 + }, + { + "_path": "Lib/site-packages/mypy/test/testapi.py", + "path_type": "hardlink", + "sha256": "5e29ed7bd202a857a87bd014c1e2042a21ef8db803f07fd7bfa2de724fec5280", + "size_in_bytes": 1447 + }, + { + "_path": "Lib/site-packages/mypy/test/testargs.py", + "path_type": "hardlink", + "sha256": "4129080fbbace5f734633243a0aacf95d8bd81d3c8d10c10ec73819756d197cb", + "size_in_bytes": 3253 + }, + { + "_path": "Lib/site-packages/mypy/test/testcheck.py", + "path_type": "hardlink", + "sha256": "6ade6fa0a8f0277330cb915bfa07dfc9617d79439d62c0ce7dee1d3a5c249523", + "size_in_bytes": 14858 + }, + { + "_path": "Lib/site-packages/mypy/test/testcmdline.py", + "path_type": "hardlink", + "sha256": "3e25679546c7774d95f35113b3ccc70443862ef02be877110b7942b279b3a756", + "size_in_bytes": 5081 + }, + { + "_path": "Lib/site-packages/mypy/test/testconstraints.py", + "path_type": "hardlink", + "sha256": "b376b60ba25ca93cf341e87620548a1171c5fce72186d9adb57f934e65d8209f", + "size_in_bytes": 5267 + }, + { + "_path": "Lib/site-packages/mypy/test/testdaemon.py", + "path_type": "hardlink", + "sha256": "f4e00292299d20622cab1ef1ef2865efc66ac33fb1a43f3ad240a1d0971f6c8d", + "size_in_bytes": 4511 + }, + { + "_path": "Lib/site-packages/mypy/test/testdeps.py", + "path_type": "hardlink", + "sha256": "6d843f83ab070365425acadaa5e9c73ad65191f065b188383d41fa639b0d155c", + "size_in_bytes": 3236 + }, + { + "_path": "Lib/site-packages/mypy/test/testdiff.py", + "path_type": "hardlink", + "sha256": "55d33fd2fa743523b195889f974fc496f1841e1328aaca7a83dc1605f93946de", + "size_in_bytes": 2510 + }, + { + "_path": "Lib/site-packages/mypy/test/testerrorstream.py", + "path_type": "hardlink", + "sha256": "6c4030de43087d224d79cf06da247656072cbdbba982e1b1856ef5119fc289ab", + "size_in_bytes": 1441 + }, + { + "_path": "Lib/site-packages/mypy/test/testexportjson.py", + "path_type": "hardlink", + "sha256": "4957085fda2ff3f64623b4a6b4611d61eb307691786b84c93d08e01f2d4f2857", + "size_in_bytes": 3983 + }, + { + "_path": "Lib/site-packages/mypy/test/testfinegrained.py", + "path_type": "hardlink", + "sha256": "5740773d023458d30f8a069fac046a9730b2033bc1924870a3b274f36be4028f", + "size_in_bytes": 17820 + }, + { + "_path": "Lib/site-packages/mypy/test/testfinegrainedcache.py", + "path_type": "hardlink", + "sha256": "028720cd9591b3c76535c69a2b3c18dd0481c316db7708b7c70ab9a9c1fd5d32", + "size_in_bytes": 580 + }, + { + "_path": "Lib/site-packages/mypy/test/testformatter.py", + "path_type": "hardlink", + "sha256": "430b8575b942176f17d89e8ae37992530f79a65fd545dc2aac07ce90242bd713", + "size_in_bytes": 2639 + }, + { + "_path": "Lib/site-packages/mypy/test/testfscache.py", + "path_type": "hardlink", + "sha256": "d500d34e0ed3a30a39188df5348c1a99788885ba52f28d7356661c44dcc7c21f", + "size_in_bytes": 4465 + }, + { + "_path": "Lib/site-packages/mypy/test/testgraph.py", + "path_type": "hardlink", + "sha256": "348d59d45681794731b8b0502fc71e9766258940ad324f1074f59d9315ec8e46", + "size_in_bytes": 5303 + }, + { + "_path": "Lib/site-packages/mypy/test/testinfer.py", + "path_type": "hardlink", + "sha256": "777355f1b4c1acd25b698d5a3bf22261f3017a25887998e07b261e4154a14300", + "size_in_bytes": 13856 + }, + { + "_path": "Lib/site-packages/mypy/test/testipc.py", + "path_type": "hardlink", + "sha256": "a41cfd0e36733caffd97711956daddcef510afc69e9c81c26b26ad0e2d983ee6", + "size_in_bytes": 3966 + }, + { + "_path": "Lib/site-packages/mypy/test/testmerge.py", + "path_type": "hardlink", + "sha256": "f2de78234627f2e69a0535c27648c08a44f49caae3eccda7b7fcdb3c2d32fc5a", + "size_in_bytes": 8594 + }, + { + "_path": "Lib/site-packages/mypy/test/testmodulefinder.py", + "path_type": "hardlink", + "sha256": "4f86d0283d02e92409b107645c9d19a8528ce3b05d6a8a9ef2c502788a15a795", + "size_in_bytes": 13957 + }, + { + "_path": "Lib/site-packages/mypy/test/testmypyc.py", + "path_type": "hardlink", + "sha256": "ab1a8e24b386d6238a942b7efcaddae71fd7d45d1d798f156fb38dde6db15402", + "size_in_bytes": 869 + }, + { + "_path": "Lib/site-packages/mypy/test/testoutput.py", + "path_type": "hardlink", + "sha256": "609a9be54b71ae5dabd7c3cc69c807afd8d377af08fb5114936cbc3dda75d338", + "size_in_bytes": 1980 + }, + { + "_path": "Lib/site-packages/mypy/test/testparse.py", + "path_type": "hardlink", + "sha256": "403c31423e30ceadc462968d0b52bb6c9627849cc31da65a227b4ac70841ebb9", + "size_in_bytes": 3834 + }, + { + "_path": "Lib/site-packages/mypy/test/testpep561.py", + "path_type": "hardlink", + "sha256": "871a306442ac980e5b58baf89450f57f12c5f1a6665f8ee57f83a77297ba2e56", + "size_in_bytes": 6839 + }, + { + "_path": "Lib/site-packages/mypy/test/testpythoneval.py", + "path_type": "hardlink", + "sha256": "56b9b31dfc1e9db27b3b451e04ee96b577967610f73d810114474eea59fbb886", + "size_in_bytes": 4586 + }, + { + "_path": "Lib/site-packages/mypy/test/testreports.py", + "path_type": "hardlink", + "sha256": "18e3f92e05e7e6bf400c4aca344b23ca1cc170c2279bf432ffa418f5310ef612", + "size_in_bytes": 1953 + }, + { + "_path": "Lib/site-packages/mypy/test/testsemanal.py", + "path_type": "hardlink", + "sha256": "a868abe776a805c08986151163ee8d236fc8fd80ba7bee7230cca210aacbfa96", + "size_in_bytes": 6975 + }, + { + "_path": "Lib/site-packages/mypy/test/testsolve.py", + "path_type": "hardlink", + "sha256": "7bfd986a0c72ec0b00e1292ac0a5585ec8e1d73e73e95f43e64d9c333c0d75e5", + "size_in_bytes": 10069 + }, + { + "_path": "Lib/site-packages/mypy/test/teststubgen.py", + "path_type": "hardlink", + "sha256": "85a012af5f175c1b865cc5aae0f56b018cdee2eda3409a9ebf613e7a7c2a481f", + "size_in_bytes": 60928 + }, + { + "_path": "Lib/site-packages/mypy/test/teststubinfo.py", + "path_type": "hardlink", + "sha256": "cb1d557922f9dea87f3229a7702abc80a4fdb720fef386437982e4fed39fdb5e", + "size_in_bytes": 1587 + }, + { + "_path": "Lib/site-packages/mypy/test/teststubtest.py", + "path_type": "hardlink", + "sha256": "bcf65086ec663240c8776dd6950456a48dc41a8e4cb65c60affd36094a51aed4", + "size_in_bytes": 100706 + }, + { + "_path": "Lib/site-packages/mypy/test/testsubtypes.py", + "path_type": "hardlink", + "sha256": "52a7a1918949560b3e22c41af17b1952026a05ac0782c0c3efca60b972a2598a", + "size_in_bytes": 12426 + }, + { + "_path": "Lib/site-packages/mypy/test/testtransform.py", + "path_type": "hardlink", + "sha256": "920ffeed1978b7255fe7e16bb34effe9f04127c0e51ba6ba098fd78323597927", + "size_in_bytes": 2195 + }, + { + "_path": "Lib/site-packages/mypy/test/testtypegen.py", + "path_type": "hardlink", + "sha256": "b5cbcafd5d895ed84a6ab1b022f3a9969fa6dcfa7fde2fe61d348b57a39884d0", + "size_in_bytes": 3149 + }, + { + "_path": "Lib/site-packages/mypy/test/testtypes.py", + "path_type": "hardlink", + "sha256": "b4abea80ccf88f4c27f270d85d91f3aa07c972a752b397bbad205ded887a8cd6", + "size_in_bytes": 64454 + }, + { + "_path": "Lib/site-packages/mypy/test/testutil.py", + "path_type": "hardlink", + "sha256": "1ea9a48070b74c19e6ed5505e74e7d977f783ca2e14be608b4b85e2aaf21b4b5", + "size_in_bytes": 4233 + }, + { + "_path": "Lib/site-packages/mypy/test/typefixture.py", + "path_type": "hardlink", + "sha256": "faa583af95b197c8d446dacc57078304dbac504b896f49d6839af88b0c205f8d", + "size_in_bytes": 16014 + }, + { + "_path": "Lib/site-packages/mypy/test/update_data.py", + "path_type": "hardlink", + "sha256": "20ea93c8fe514ce776494b23d5f6af7a814a61cdead22d64a8ffbf5812d55665", + "size_in_bytes": 3685 + }, + { + "_path": "Lib/site-packages/mypy/test/visitors.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "7f38ed90f2dea6e2c5f1fa147a739832d939aadd56cc16d108d42ba4ccb5e9c6", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/test/visitors.py", + "path_type": "hardlink", + "sha256": "71fb0f6b014ef49d949e87991b39186c06d972e67c1d10dcd4528677d495d44d", + "size_in_bytes": 2089 + }, + { + "_path": "Lib/site-packages/mypy/traverser.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "1500a81cc665ba673b2f367316d0f6047f5545c1e3f0e760809087cb3469353a", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/traverser.py", + "path_type": "hardlink", + "sha256": "c7a4d85431418806babac113031ac4d375809ecdee38ddc29eedb3081384a910", + "size_in_bytes": 31313 + }, + { + "_path": "Lib/site-packages/mypy/treetransform.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "93915721a545d3bd39c046bdba8a6e8d9415531eb4199946d889146cfe47ba88", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/treetransform.py", + "path_type": "hardlink", + "sha256": "393f6b32366da38c49b991df06ad1cc765b54ef07e45bd380eca4abcb1c57a95", + "size_in_bytes": 29360 + }, + { + "_path": "Lib/site-packages/mypy/tvar_scope.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "fa57d10a8fc2f29729fdec7a4383c8de7ce4b910760434a157ec33e3100529bc", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/tvar_scope.py", + "path_type": "hardlink", + "sha256": "2ab8f3c59fc531f9910326ff993e4194a94a69d2b3a124b8c241d77e35e09a42", + "size_in_bytes": 7356 + }, + { + "_path": "Lib/site-packages/mypy/type_visitor.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "7307a0f621bcbe094b07eb310fbef8107940c6ace2a56648479a2269d9324673", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/type_visitor.py", + "path_type": "hardlink", + "sha256": "adf8c93acb6809b2366a1945f479fc1190680dc4b80a7f8bbceb913874503a27", + "size_in_bytes": 19975 + }, + { + "_path": "Lib/site-packages/mypy/typeanal.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "bb30c829ec3f380d649fec5028c65d833262965362d68d931199d2f8dbb7e01d", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/typeanal.py", + "path_type": "hardlink", + "sha256": "2df8cc8c72f17ccabe546666452b12e69b7e893e5635a6361fed33b56ec76ccd", + "size_in_bytes": 119559 + }, + { + "_path": "Lib/site-packages/mypy/typeops.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "e79a319d48e5dba87f80a8bddb8edb0194cd451391aaa64ff3e57ae77a1a3f9a", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/typeops.py", + "path_type": "hardlink", + "sha256": "e16de4051c2d1acf76d91d083a12549efc974a490dcb5d23ab321da857eba100", + "size_in_bytes": 51180 + }, + { + "_path": "Lib/site-packages/mypy/types.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "d1a05cb0b7963d9c9e3626dde9344caf5c2e973b64489189412c52c54eb2fffe", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/types.py", + "path_type": "hardlink", + "sha256": "8fc631dee3c7aa3751d42c4f651bad4d095d879d56c58b0ba303928e0807cc4d", + "size_in_bytes": 159937 + }, + { + "_path": "Lib/site-packages/mypy/types_utils.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "341b3554afdd6cbb889436bae97feaa5e5a845d1e2706db1597ac76fa0df36a8", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/types_utils.py", + "path_type": "hardlink", + "sha256": "7aab0299281c6f2788406949b303362030967a31843ec38299d399a5ad5b5e32", + "size_in_bytes": 6216 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/LICENSE", + "path_type": "hardlink", + "sha256": "295f8538c94ae5c3043301cf7cff1c852dab6a786a8ddee471e061b40d5ecabe", + "size_in_bytes": 12657 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/VERSIONS", + "path_type": "hardlink", + "sha256": "3c4b201500168d997db6829587ad910ae022b144ebae58b36edbdf8dadf3b3da", + "size_in_bytes": 6442 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/__future__.pyi", + "path_type": "hardlink", + "sha256": "a88c160e68dac375c28ae94a628281401fde2632f1c1e7ac50ac017699204245", + "size_in_bytes": 915 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/__main__.pyi", + "path_type": "hardlink", + "sha256": "85c7c729385046289b3971a73de1141ee9ebb6f88c768ae3d0cb5d9c8c0bb65f", + "size_in_bytes": 53 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_ast.pyi", + "path_type": "hardlink", + "sha256": "1e7db7c64f6debf33992e3191e47208c059e35cc24b68beec8c6cc2e365bb444", + "size_in_bytes": 3344 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_asyncio.pyi", + "path_type": "hardlink", + "sha256": "ef23d171e8c4519d64d426d115580fcafc75107a0ba82a243111e2286d18d3eb", + "size_in_bytes": 4872 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_bisect.pyi", + "path_type": "hardlink", + "sha256": "8e77419e17ebf869ab6785b5d6e5be2f5d3f7bb9eff670dddae165a504d43690", + "size_in_bytes": 4854 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_blake2.pyi", + "path_type": "hardlink", + "sha256": "fea6af330b394928bc7d61dcdc9e16b05965e8dd923915817a08fba905f9feee", + "size_in_bytes": 3542 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_bootlocale.pyi", + "path_type": "hardlink", + "sha256": "bd2567a01bd446c3738bb30f2d1d5bff0a6e87ecb248accf55a940c10dce553f", + "size_in_bytes": 64 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_bz2.pyi", + "path_type": "hardlink", + "sha256": "ac50abd406288d6bc4e7dad1cf99e31552b59b5bcc0b6c0d9939be17b9ebc7f1", + "size_in_bytes": 678 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_codecs.pyi", + "path_type": "hardlink", + "sha256": "af220230859d7cabd18f88d1413c27883c3b6cc39d8720ae76e497d276fa678d", + "size_in_bytes": 6721 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_collections_abc.pyi", + "path_type": "hardlink", + "sha256": "6fd94a87fcf869fa88d38a4f67511ca4f794cc6439b5f0bb48f228e0d9af8974", + "size_in_bytes": 3041 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_compat_pickle.pyi", + "path_type": "hardlink", + "sha256": "dd61f45c383c60c43f1337d3edc9c12ab5395a3a5721127969e73c874c6b0db5", + "size_in_bytes": 438 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_compression.pyi", + "path_type": "hardlink", + "sha256": "a847661338dc7d0f6b38a44b8d5b64a4f49fbcd115884738dc5a2e3c5dd701f0", + "size_in_bytes": 1377 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_contextvars.pyi", + "path_type": "hardlink", + "sha256": "09e3ade1e75d9c34f2755ab8475a8e13d27b9fb85037a328a3fbecb4263411f4", + "size_in_bytes": 2370 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_csv.pyi", + "path_type": "hardlink", + "sha256": "009b7781679bb0927081306c282dda0b058a227b8a673d34ff9a8d94abf8acac", + "size_in_bytes": 4041 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_ctypes.pyi", + "path_type": "hardlink", + "sha256": "e4db14fb61f131f652309559e4ba6eb014076e5458716b125351ccdb0165258f", + "size_in_bytes": 17676 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_curses.pyi", + "path_type": "hardlink", + "sha256": "8e5f631db04995bb8c7c5be5fe1a3dec88e6c0f5e8f89525f62289f4dab5dcc3", + "size_in_bytes": 16854 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_curses_panel.pyi", + "path_type": "hardlink", + "sha256": "c354711bae1b0f60bc3868b6b17426548acd46fdeaf5a07b5eb7d83060a43c5d", + "size_in_bytes": 757 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_dbm.pyi", + "path_type": "hardlink", + "sha256": "42d4c4ee5d316a1e9c2670e19672183a2ab0b0add4b0d223f719b458cfae567c", + "size_in_bytes": 1775 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_decimal.pyi", + "path_type": "hardlink", + "sha256": "994e7dbc2c597ba68578aede09f01f614513cbcee8c7cc83e1b6e9c344bef6c5", + "size_in_bytes": 2058 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_frozen_importlib.pyi", + "path_type": "hardlink", + "sha256": "eebe9d3c0ed6f5a38875199fe23343129a9b4900db4f821349599beaa9994167", + "size_in_bytes": 4679 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_frozen_importlib_external.pyi", + "path_type": "hardlink", + "sha256": "9e198e1646a0b5c908d46bc406ba11c026b193610234503fb97773588335bcc3", + "size_in_bytes": 9607 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_gdbm.pyi", + "path_type": "hardlink", + "sha256": "ff1af127373758ca5b252739bb359bd6fdbe436ae4cb1445b5483ce597bbafa8", + "size_in_bytes": 1946 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_hashlib.pyi", + "path_type": "hardlink", + "sha256": "0f073e96dd33c00be6ac9fe5bd5e7cb3b34a2bce73982d7d8974f61e40da62c8", + "size_in_bytes": 5593 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_heapq.pyi", + "path_type": "hardlink", + "sha256": "4906716fed2fdecba3ad40ef6ae143d6481b41ff4eba14442e9dc9ebcfa20b9d", + "size_in_bytes": 755 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_imp.pyi", + "path_type": "hardlink", + "sha256": "c9400976e52494daa9eec1d9f2657ee0c3e769c7216ad9f5c5de2fdb772535d7", + "size_in_bytes": 1185 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_interpchannels.pyi", + "path_type": "hardlink", + "sha256": "5af95f29a726157f3d1e854eac4125c80991b31a2d81b12248028acd4a784b5a", + "size_in_bytes": 3204 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_interpqueues.pyi", + "path_type": "hardlink", + "sha256": "d0e4e5240e6db337c41b20ab6a5caa6b5671c9575b7748db0d02e5a81ed878a8", + "size_in_bytes": 866 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_interpreters.pyi", + "path_type": "hardlink", + "sha256": "3d1f1f92b64f18bbcc6d3a2fb2cbae4e7da3d1236194b350354b749f1e1e13c3", + "size_in_bytes": 2654 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_io.pyi", + "path_type": "hardlink", + "sha256": "ac60b5fbf7bb9eada88ae173231eca3a521517beb6e98a3164015497a456a0ae", + "size_in_bytes": 13142 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_json.pyi", + "path_type": "hardlink", + "sha256": "ca16cd3693e581c36bed46cb5989492d14ff18902ce9c79ce6747565efe5bc3a", + "size_in_bytes": 1532 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_locale.pyi", + "path_type": "hardlink", + "sha256": "b8ae6ccc1e78ee1be2f9943d98885a417843283e7ea0ed615af5c085dda0e1f9", + "size_in_bytes": 3287 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_lsprof.pyi", + "path_type": "hardlink", + "sha256": "4a7acc459eeb7985293b86aca6ccef3e5d3ca3ecdfc886708b138dfd23fdedb5", + "size_in_bytes": 1323 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_lzma.pyi", + "path_type": "hardlink", + "sha256": "be14e42b3fa9b184537594b9cf7d4767bd4bb543e252ce63467c6d8bbc36dd50", + "size_in_bytes": 2090 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_markupbase.pyi", + "path_type": "hardlink", + "sha256": "8d787981a5d0baaaf62a69800b3b4673cc438d69b8f22b6ad4d91a1f57aea4c0", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_msi.pyi", + "path_type": "hardlink", + "sha256": "8e6d5b024fdf793a1162c5922dc4249c29764ff5f65f01ad4f00f3ce5df65491", + "size_in_bytes": 3652 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_multibytecodec.pyi", + "path_type": "hardlink", + "sha256": "e3c8cd4aadc81ff15e8e99c65f4fea3229d668b14e563a31d1bdbce3aeb2c2b5", + "size_in_bytes": 1890 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_operator.pyi", + "path_type": "hardlink", + "sha256": "b82d031569f5d4b308c47cc82d4cff446bf6572f1022b01d0c4bdc3d2230b2ca", + "size_in_bytes": 4867 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_osx_support.pyi", + "path_type": "hardlink", + "sha256": "ddcc1eb1104da148224e18c8b0088f34aa0e0c01a869183d8dee3e03e429394f", + "size_in_bytes": 1900 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_pickle.pyi", + "path_type": "hardlink", + "sha256": "12218904f59fca9d55945b970ec2d7dad340c0d2a965ce6802c81d4272543b69", + "size_in_bytes": 3295 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_posixsubprocess.pyi", + "path_type": "hardlink", + "sha256": "b2ccdbf7429f5160f532793c789b62f3e3bf3cfafde6ee2f1898785d2a321144", + "size_in_bytes": 1836 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_py_abc.pyi", + "path_type": "hardlink", + "sha256": "c8a8ac46ff6d9b0b9c06c581d482cba37e4d70dad95b02242912fa3eef061f9b", + "size_in_bytes": 397 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_pydecimal.pyi", + "path_type": "hardlink", + "sha256": "c2cb2e2ce20a22e05bc549724dcc71f1e721fef19b03503d107f61ab21e41bee", + "size_in_bytes": 995 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_queue.pyi", + "path_type": "hardlink", + "sha256": "297f86499ffeb690f498bc355aa7d75b9586097691ec2d74630699b9ec4e521a", + "size_in_bytes": 634 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_random.pyi", + "path_type": "hardlink", + "sha256": "b8e754280836cef728525030498479ff575cf0c77486cbc9ea1ec71b2bc07805", + "size_in_bytes": 571 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_sitebuiltins.pyi", + "path_type": "hardlink", + "sha256": "1f0d7b6d6cd0c9b25dc259d071e27c04c1f34ae4d88809fae51a3bb19bb93282", + "size_in_bytes": 538 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_socket.pyi", + "path_type": "hardlink", + "sha256": "5a990172acaf556d8f41e60d6cee3fcab6fa9f416b1bba3dd7721c26a2b9d470", + "size_in_bytes": 27852 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_sqlite3.pyi", + "path_type": "hardlink", + "sha256": "580a9fbc475863545c9f4a01c83105ff187cdc1c4912b4f516b297ee448b9001", + "size_in_bytes": 10622 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_ssl.pyi", + "path_type": "hardlink", + "sha256": "5fd26522e4a9e12205c6ef996b96285748b35bf4f6d01a77bcbf8f4d044df0dc", + "size_in_bytes": 10060 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_stat.pyi", + "path_type": "hardlink", + "sha256": "854979ae785b715e1490dbb83004908a7b8071c3435343221eb746f0187ff764", + "size_in_bytes": 3441 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_struct.pyi", + "path_type": "hardlink", + "sha256": "1f09505cb255fe321c91bba87fe84869c9b9450a46b0dcb3ea43bb2f4ecc8d01", + "size_in_bytes": 1196 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_thread.pyi", + "path_type": "hardlink", + "sha256": "08d4d98bf221640019b06a6c45c9288b05437aa8ecd15c765de67b0d5a3ec0d0", + "size_in_bytes": 4918 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_threading_local.pyi", + "path_type": "hardlink", + "sha256": "be7ce3e882cb3b787afd390b21796a41998a9df446eb0c417ef03620fd621c51", + "size_in_bytes": 880 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_tkinter.pyi", + "path_type": "hardlink", + "sha256": "82ab887e7842f18f1a05b8595e65fc2dd995dbe886c1e90e957c845fc05abe08", + "size_in_bytes": 5563 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_tracemalloc.pyi", + "path_type": "hardlink", + "sha256": "6cf3585e78947e1eaee8d0849249a93430a50b1ec90f511845d97ef3b718f29b", + "size_in_bytes": 500 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_typeshed/__init__.pyi", + "path_type": "hardlink", + "sha256": "5d4cf0443f6ba00125b926b8cb51f1932e3f9ca9e8ec366e863654c58bd47bbf", + "size_in_bytes": 13255 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_typeshed/_type_checker_internals.pyi", + "path_type": "hardlink", + "sha256": "692dc4fc2614d10d6cccd2ea2a3c867ee6f8fb4ad20572bece7bddf45555534f", + "size_in_bytes": 4157 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_typeshed/dbapi.pyi", + "path_type": "hardlink", + "sha256": "0db16f642eda79216ec3f868a6c85efa7cfa38bfdbb4f074eb322827c3bef6d0", + "size_in_bytes": 1636 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_typeshed/importlib.pyi", + "path_type": "hardlink", + "sha256": "892475490ac8807dfd759c2ed68d0cd2a93c66cc515249f80ed1b6fcae6d3b8a", + "size_in_bytes": 727 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_typeshed/wsgi.pyi", + "path_type": "hardlink", + "sha256": "a8d1fb4104fd63f8bc1b14a84b62d456215298ce261f7f8ae61c61eec193e4ae", + "size_in_bytes": 1637 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_typeshed/xml.pyi", + "path_type": "hardlink", + "sha256": "5b873d3dc1f0ef7ec55287b370f0247d1ba8301fbeed4a7bb8a959d1284d206d", + "size_in_bytes": 499 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_warnings.pyi", + "path_type": "hardlink", + "sha256": "7e46e970e781ed69c9b211d870dbd7181f3aa833240c3b4ce76a3fd3423a073c", + "size_in_bytes": 1569 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_weakref.pyi", + "path_type": "hardlink", + "sha256": "515204fa213a1b254e05e08a0b40970019ddeedf8fbf10bc66dad357a21a23c3", + "size_in_bytes": 643 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_weakrefset.pyi", + "path_type": "hardlink", + "sha256": "fe7fe45eacc2d0afea6f8b84b40e9652c8261c3ef4b82a7a62e4d4b59c5f2b77", + "size_in_bytes": 2345 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_winapi.pyi", + "path_type": "hardlink", + "sha256": "b08beb56f04e88bdcc5ebad32fb5c946e69836d80059c79fbfd0a909d2839c31", + "size_in_bytes": 11325 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/_zstd.pyi", + "path_type": "hardlink", + "sha256": "a23882e490babbbd20716903e0fa6d1c79c3cc00b1cadac8f0a382a116643ab2", + "size_in_bytes": 3647 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/abc.pyi", + "path_type": "hardlink", + "sha256": "a05be48bc141007961ad14435e4a0405c609550cdbf679d351d53b91277dc0f0", + "size_in_bytes": 2128 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/aifc.pyi", + "path_type": "hardlink", + "sha256": "8fbab1e2a108fd81fdd053df7a47fb7ea4410ecd875c02ea7effbe32e5e8d034", + "size_in_bytes": 2986 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/annotationlib.pyi", + "path_type": "hardlink", + "sha256": "9227ed539da2d12e5c22a51fff13e2ca5e928277b00d6b7fd1cf78d87846b2eb", + "size_in_bytes": 5435 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/antigravity.pyi", + "path_type": "hardlink", + "sha256": "013fee31776c651dc02fc35f3d4eda1f4e42010698a6233bcafda9066ec5efc9", + "size_in_bytes": 123 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/argparse.pyi", + "path_type": "hardlink", + "sha256": "397e7f09a0ada94bfe4ff8afe4d4b59f917d483b170bb4800eb71d67d0f21af2", + "size_in_bytes": 32065 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/array.pyi", + "path_type": "hardlink", + "sha256": "a4c5c045762c415716e101cf7b1c9d88838c318af6a900087def2f042c6e7951", + "size_in_bytes": 4741 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/ast.pyi", + "path_type": "hardlink", + "sha256": "3bb74ebbe069b9c635eda20a14488ed2040f01cc2292609399be0732ca278bef", + "size_in_bytes": 77826 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asynchat.pyi", + "path_type": "hardlink", + "sha256": "8c54e23925c295c9a136f59741cf497510f8e004f9a3d0aaef1482d9f6d50b69", + "size_in_bytes": 787 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/__init__.pyi", + "path_type": "hardlink", + "sha256": "28458b70888c0438a8f253546691eedf05b41bd26531cf870e3a5887490bdc27", + "size_in_bytes": 44530 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/base_events.pyi", + "path_type": "hardlink", + "sha256": "94f6068c7ec2afb8021f7fbcc6d39e506264e07b71bdf693662abd5832947f1b", + "size_in_bytes": 20014 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/base_futures.pyi", + "path_type": "hardlink", + "sha256": "272f4c89dace330092cbe664adb8cba0a34d3dcb952bd012397fd104b0c04b73", + "size_in_bytes": 609 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/base_subprocess.pyi", + "path_type": "hardlink", + "sha256": "0a3050caf5d071859c9a655f580ab7cfa658dcc8579edc4c87fc60b498702944", + "size_in_bytes": 2680 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/base_tasks.pyi", + "path_type": "hardlink", + "sha256": "d6a304348b174daaf9f9d5579f7deacbc8695b33ad14eb3f23e91fe48f7676c2", + "size_in_bytes": 404 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/constants.pyi", + "path_type": "hardlink", + "sha256": "f84bb7e67fa44fb23c5bd60d7e86359579ab64a0137430688f104ec0c88fc3a8", + "size_in_bytes": 556 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/coroutines.pyi", + "path_type": "hardlink", + "sha256": "cae0780065e20d539f3eb24e2f76906b1512e8dd5bafd583f73acda35f0944bb", + "size_in_bytes": 2296 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/events.pyi", + "path_type": "hardlink", + "sha256": "96e7fef5abbe80e60cb1366133a8ce3ef85614e8c193df42c45285fa3e5714e0", + "size_in_bytes": 25851 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/exceptions.pyi", + "path_type": "hardlink", + "sha256": "962bcf92b571dce915e53e415e59ae888d2b431f9a44b08f92b90439095a961f", + "size_in_bytes": 1163 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/format_helpers.pyi", + "path_type": "hardlink", + "sha256": "db0a10bbc7abcdd3fb8db6370d971f5b23b01148e42906d822f196e70c2ee7dc", + "size_in_bytes": 1353 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/futures.pyi", + "path_type": "hardlink", + "sha256": "99c52bacc060bb1e15bc22240181285e4894e6d6fc841ac9b16d03245713ec33", + "size_in_bytes": 721 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/graph.pyi", + "path_type": "hardlink", + "sha256": "10c1ca1c0ffdd2a60fe0e07a945b46d82181b4d2a479f07ec3387ccb5011fd64", + "size_in_bytes": 1194 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/locks.pyi", + "path_type": "hardlink", + "sha256": "4035c1b638d1b334fad86e767fa89c73fab3a330cf96bfeaad54fbb297278f91", + "size_in_bytes": 3514 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/log.pyi", + "path_type": "hardlink", + "sha256": "425f7b9e3c4d2a6367efa73cfafa2648033b3fe575e28fb5ed2388806e3b57e5", + "size_in_bytes": 39 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/mixins.pyi", + "path_type": "hardlink", + "sha256": "62a411bc5cea83127406f4ad77a179e80e0368810cdcabc3e1f0c42ca09885ca", + "size_in_bytes": 215 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/proactor_events.pyi", + "path_type": "hardlink", + "sha256": "bc264463becb9b28dc8c9b7f5201ae32a152086f414263935fed9aa80adc60ff", + "size_in_bytes": 2598 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/protocols.pyi", + "path_type": "hardlink", + "sha256": "315d1b996f6253f739ab0d2f39d1bd57b7ef300f91a01d0f8f14d13fbc0837ee", + "size_in_bytes": 1927 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/queues.pyi", + "path_type": "hardlink", + "sha256": "405351b2e7624d4150f5e1152af810e0b2821b3ed4c5116cdca12fb16aa95b4b", + "size_in_bytes": 1918 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/runners.pyi", + "path_type": "hardlink", + "sha256": "c54ede130b706a32bf013537ec16fd638076427229753c0616d755795e8144aa", + "size_in_bytes": 1369 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/selector_events.pyi", + "path_type": "hardlink", + "sha256": "f7d40998a8beef8939d0bea99a471f3bd07bd7aa0826de2e214f20da71baa424", + "size_in_bytes": 315 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/sslproto.pyi", + "path_type": "hardlink", + "sha256": "6ee8a1de4e7ac6992eee4c0359a8a820f3bb89b3a437f77a75fdba38d2860e0a", + "size_in_bytes": 6489 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/staggered.pyi", + "path_type": "hardlink", + "sha256": "bed943e577f26b80047ef93026620bf735d781196c23c32618e162b432bd87b8", + "size_in_bytes": 341 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/streams.pyi", + "path_type": "hardlink", + "sha256": "7d336d9d0abfeacea58d6ec1e3197e538b8efb30d336cb92e73422f9927ad62c", + "size_in_bytes": 6007 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/subprocess.pyi", + "path_type": "hardlink", + "sha256": "ee1748fc198b5acbcbb73cff9ab69bac60a26ee1cd1df6d4951c85d8107b3221", + "size_in_bytes": 9295 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/taskgroups.pyi", + "path_type": "hardlink", + "sha256": "11112be7085b708c8bd20743de728330b89b7d64a0280d3ec11c60a970c7d728", + "size_in_bytes": 1180 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/tasks.pyi", + "path_type": "hardlink", + "sha256": "154a862ed1bdcd6733fef4f087b475479b2d1857d411e1bfd1bbd40c8c928984", + "size_in_bytes": 17102 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/threads.pyi", + "path_type": "hardlink", + "sha256": "98f3374e5c2962ce5452eb3b77ea686f9bdcaec7a1129e8ba766bc271c016ea9", + "size_in_bytes": 330 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/timeouts.pyi", + "path_type": "hardlink", + "sha256": "3f2d953ebf39b09082e3cb3addc42f09040256c93e4fef739f28d00da22cfa8f", + "size_in_bytes": 717 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/tools.pyi", + "path_type": "hardlink", + "sha256": "ce387e9edba3899fdc20920082215b57847f093fdc62238a17e9a53f7d4f98cc", + "size_in_bytes": 1489 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/transports.pyi", + "path_type": "hardlink", + "sha256": "a732ea58a3c6266432aed0a808c68ae212957edf88f85c049af3497b8acfd3c9", + "size_in_bytes": 2390 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/trsock.pyi", + "path_type": "hardlink", + "sha256": "863d143320de85bed0c9656979abb0d8355cfb65f8636862f3f76a6c94c61ea2", + "size_in_bytes": 6096 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/unix_events.pyi", + "path_type": "hardlink", + "sha256": "96ffd02def60a4aa7bcc9581efc3092fda7584078c346d1256d079125a0845c6", + "size_in_bytes": 11341 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/windows_events.pyi", + "path_type": "hardlink", + "sha256": "7cbe63d8558b0f5b62c5a0059d73ae168bde5e053ef8f92dc9cc4b3e109600c1", + "size_in_bytes": 5397 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncio/windows_utils.pyi", + "path_type": "hardlink", + "sha256": "9ae372b8cff4d0da20d91564ea4e3a3425b093b0bbeb575b08d39ef87648a48f", + "size_in_bytes": 1955 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/asyncore.pyi", + "path_type": "hardlink", + "sha256": "c5100d93a8bcbf902c84d7c482d4422273d6544c0bd4d3f8d06eda451a9a696b", + "size_in_bytes": 3670 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/atexit.pyi", + "path_type": "hardlink", + "sha256": "60fce1c45c463ea2759391be21a6fc96a7c936e9b5910fd4b2623ce08ff9cc49", + "size_in_bytes": 398 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/audioop.pyi", + "path_type": "hardlink", + "sha256": "f64f6f0f5f80ac61376e5d224863e7e8e878f9739fb6ccae37931b162d56f31c", + "size_in_bytes": 2122 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/base64.pyi", + "path_type": "hardlink", + "sha256": "c31b6d90480f25139d0eb939e4dd6e627cc28938aa599a39e1f0c724b2974b62", + "size_in_bytes": 2264 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/bdb.pyi", + "path_type": "hardlink", + "sha256": "6fbcc7d0a7e65645818ded68a377301f0e955f6a6f7ce363df4d28b9ae36603b", + "size_in_bytes": 5866 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/binascii.pyi", + "path_type": "hardlink", + "sha256": "b6ad14e7c6973912f9960324b9f40711cc15cd89740547c9b175fc211d002459", + "size_in_bytes": 1822 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/binhex.pyi", + "path_type": "hardlink", + "sha256": "bf22d055b988113eadafdb070e1faf7b0009be97c271a448c3787d8511ace311", + "size_in_bytes": 1274 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/bisect.pyi", + "path_type": "hardlink", + "sha256": "b109fd5144b40b0e5764c1067048fc29ae5528f5686cbe373dec7f49a8235e0f", + "size_in_bytes": 67 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/builtins.pyi", + "path_type": "hardlink", + "sha256": "103a5afaf7c1c740b0be0b0c3a453348c140225722e4274137dc007500925af1", + "size_in_bytes": 92537 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/bz2.pyi", + "path_type": "hardlink", + "sha256": "c4e912c66c24d6562b6b20318e95a2e5d639f9689499ec84d38781997e6fc64c", + "size_in_bytes": 4008 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/cProfile.pyi", + "path_type": "hardlink", + "sha256": "8279213120d939d2e90376adb28b6294e5d6373aa893849772c9ef00a407df51", + "size_in_bytes": 1313 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/calendar.pyi", + "path_type": "hardlink", + "sha256": "2e69b86534ef27d8757d90bea1fbadcbd042bfa06410d0bb7687bb4efbaf002d", + "size_in_bytes": 7388 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/cgi.pyi", + "path_type": "hardlink", + "sha256": "d2ba130b4314517512e313bb9a1cd8d7739ad06be5683e94645e9485e12ce907", + "size_in_bytes": 3810 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/cgitb.pyi", + "path_type": "hardlink", + "sha256": "97b6a58afdf25eb7f0d0c335e695c376078da5b20ad4dd5ef383a3484b764c55", + "size_in_bytes": 1394 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/chunk.pyi", + "path_type": "hardlink", + "sha256": "ebdd5855f5a3c31db49e08c3481192e4f8ecec8acb5624229ee4c183c75d997e", + "size_in_bytes": 614 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/cmath.pyi", + "path_type": "hardlink", + "sha256": "8b764252cbc069e93449e6dbe6a630801c536ad1f3caaddffdff11b3632e1b3f", + "size_in_bytes": 1271 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/cmd.pyi", + "path_type": "hardlink", + "sha256": "31b97cbe3b2e87f157b13eb8344aca30ad4574f62539d6c2fa354b83bb622e87", + "size_in_bytes": 1783 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/code.pyi", + "path_type": "hardlink", + "sha256": "527049191ca2dc2e2536d5d8b02e3090cc80705fe4f05b8cf5a16adeea2848c7", + "size_in_bytes": 2140 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/codecs.pyi", + "path_type": "hardlink", + "sha256": "a0dea1f1b2207508643e21883b88a194158efe9402890f8739ccd7677889d89a", + "size_in_bytes": 14124 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/codeop.pyi", + "path_type": "hardlink", + "sha256": "0c092aa871ecc62ae4ccfa26cd19a9b0bd9d556e45ca12dd8f6ed84d9da373ba", + "size_in_bytes": 799 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/collections/__init__.pyi", + "path_type": "hardlink", + "sha256": "3ed39630d779e9ef86045000bfd99951d67fdea69242440c9492737b605250af", + "size_in_bytes": 23698 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/collections/abc.pyi", + "path_type": "hardlink", + "sha256": "90189900dd153dff2aa642276e3a8a65145ed0f5eb67b8f1366086b38a3950e7", + "size_in_bytes": 79 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/colorsys.pyi", + "path_type": "hardlink", + "sha256": "a3821c32fd8e03d47ee69c015af1295bf90ecc5b23656b56640469c0c1d392ff", + "size_in_bytes": 696 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/compileall.pyi", + "path_type": "hardlink", + "sha256": "7aa4b72db60d4b47ff68a857e60f8d3e04da32e1753c8cf0c53fd37519bfabb0", + "size_in_bytes": 2757 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/compression/__init__.pyi", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/compression/_common/__init__.pyi", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/compression/_common/_streams.pyi", + "path_type": "hardlink", + "sha256": "19b9b04cbc4296893b791b168604d7f7cf3878bc8f072c7fec2ceed57283f4d0", + "size_in_bytes": 1339 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/compression/bz2.pyi", + "path_type": "hardlink", + "sha256": "fd36fe5743eb4e8590b77f18fd75d2d059897d15887365f98e719e1301fb8261", + "size_in_bytes": 18 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/compression/gzip.pyi", + "path_type": "hardlink", + "sha256": "1d1a9583d8435ac289f3752bdbcbf5f9607bb0b433c400f3c493cfec54ee99e7", + "size_in_bytes": 19 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/compression/lzma.pyi", + "path_type": "hardlink", + "sha256": "9cd32287f98363e8f13b7b58eb9ce4a53f674faaf6f775fb7f1c179354802635", + "size_in_bytes": 19 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/compression/zlib.pyi", + "path_type": "hardlink", + "sha256": "510739592778e595a384473565ae693ad12ca018be91baeb3a2742bfb6a0b81c", + "size_in_bytes": 19 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/compression/zstd/__init__.pyi", + "path_type": "hardlink", + "sha256": "f00e993f6ffcddcee0ab8674bf0ae0c4a1414a0c49cc870ceb01120b6cdc9c97", + "size_in_bytes": 3102 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/compression/zstd/_zstdfile.pyi", + "path_type": "hardlink", + "sha256": "02ed74a000313e5ae5e84a527ec9ac7bbb3fe53bbd5fea3463991a2fbf6dc70e", + "size_in_bytes": 3781 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/concurrent/__init__.pyi", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/concurrent/futures/__init__.pyi", + "path_type": "hardlink", + "sha256": "31af1080cdb69e1a6db2d0b03da870acb9f7c9f608a243591817d58d11af5677", + "size_in_bytes": 1765 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/concurrent/futures/_base.pyi", + "path_type": "hardlink", + "sha256": "7294597f3cef3ad81686d9411a40a24dca6cf489e2b1d24853fa89543c9f8769", + "size_in_bytes": 4346 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/concurrent/futures/interpreter.pyi", + "path_type": "hardlink", + "sha256": "e8136dbdd02dd33e410d53bb6193c37a98139fd815f390b41542e30ca8fda0ec", + "size_in_bytes": 3053 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/concurrent/futures/process.pyi", + "path_type": "hardlink", + "sha256": "7014b24ebff620c76e8ef2c421a242593cc2aed25d4307318f79f2629a82fdf3", + "size_in_bytes": 8168 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/concurrent/futures/thread.pyi", + "path_type": "hardlink", + "sha256": "7a69c05e19361a61d0a0ac78d2f0b78a12c369c091cc0019b2c6d3d4eb57ec25", + "size_in_bytes": 4738 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/concurrent/interpreters/__init__.pyi", + "path_type": "hardlink", + "sha256": "e44ec007458da0806489de4b857972b3bf0ab9d847b872af7b776f2862f16c61", + "size_in_bytes": 2441 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/concurrent/interpreters/_crossinterp.pyi", + "path_type": "hardlink", + "sha256": "8085d5b1a55c3ef13a8003a59925420c5ce6678a5db2c76629066e7ca8a4ccd3", + "size_in_bytes": 1257 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/concurrent/interpreters/_queues.pyi", + "path_type": "hardlink", + "sha256": "bc73b8c22e2f44caad330ec635d1d365761edeff45a6d2aeda78610e820f48a1", + "size_in_bytes": 2603 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/configparser.pyi", + "path_type": "hardlink", + "sha256": "f01f2516c5e4bbd14273112071f4e87c36a384e2682e309a4fc7a0e5c90f617d", + "size_in_bytes": 19610 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/contextlib.pyi", + "path_type": "hardlink", + "sha256": "53cc988642f59dcd78722ec53563b66f72ee097855506af5da2b035d27cb251f", + "size_in_bytes": 9523 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/contextvars.pyi", + "path_type": "hardlink", + "sha256": "76a52f371969abdfb45e0bf3cca942cf8916b00eea5841085c89fbde3c6969fd", + "size_in_bytes": 178 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/copy.pyi", + "path_type": "hardlink", + "sha256": "7b4b95407397cae392c9e0a26e93c80ce8c189986b73ef81535a18289ca8b324", + "size_in_bytes": 856 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/copyreg.pyi", + "path_type": "hardlink", + "sha256": "e7d60f484090279a69b0499827172f6f534e69ce944c0bb90aa3f748c77a54be", + "size_in_bytes": 983 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/crypt.pyi", + "path_type": "hardlink", + "sha256": "380f4c5e38284d8d23c9de1c9fa672a572f54ea1ed38003fb9da2c14bd0e95d2", + "size_in_bytes": 792 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/csv.pyi", + "path_type": "hardlink", + "sha256": "42847d32bf04f701e2a4cdde84b3c73dbdd958d989a8a168bf5b1104639d4636", + "size_in_bytes": 4535 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/ctypes/__init__.pyi", + "path_type": "hardlink", + "sha256": "c4994fc78c59351577358efb11170d7df0a67eb3ed31b59139aa474b1ebbd238", + "size_in_bytes": 11584 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/ctypes/_endian.pyi", + "path_type": "hardlink", + "sha256": "ada8a8565b87d1d95c2e86b21acd6310ba5c0643ca98eed66f0af639ca590141", + "size_in_bytes": 461 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/ctypes/macholib/__init__.pyi", + "path_type": "hardlink", + "sha256": "1bc0f1ada46ee63106faf7b4ea6b29f57a07a90c2d9c512356d0922deeef693c", + "size_in_bytes": 50 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/ctypes/macholib/dyld.pyi", + "path_type": "hardlink", + "sha256": "2b4643835301fbf63f9f8f420e0ac4272b6c1153968178073754c7cdae5443d9", + "size_in_bytes": 467 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/ctypes/macholib/dylib.pyi", + "path_type": "hardlink", + "sha256": "1d5933d4eca897d40225c8dd9f0b64816e62abec85270890fa3642006ccf8d35", + "size_in_bytes": 326 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/ctypes/macholib/framework.pyi", + "path_type": "hardlink", + "sha256": "6d6c23b9b67fcca3a21aa025a81cb3a27a710f800941e98688521f4b87a61a6f", + "size_in_bytes": 342 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/ctypes/util.pyi", + "path_type": "hardlink", + "sha256": "e1dc96703973c3ac94b41142d63d7b26c9d2ce1255f2af786497efa3ed3b9278", + "size_in_bytes": 222 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/ctypes/wintypes.pyi", + "path_type": "hardlink", + "sha256": "b39f473adfb32f3cc47976d37824ac07ec1788404bfb0c62cb961f7f8dda82d7", + "size_in_bytes": 6967 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/curses/__init__.pyi", + "path_type": "hardlink", + "sha256": "60cd84a3bc184cffd0822125681ccc4d6b162451ec6871739e7a7ef68f1eaebb", + "size_in_bytes": 1284 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/curses/ascii.pyi", + "path_type": "hardlink", + "sha256": "ef129d987a9b349bbbcd7ccb737e8c295b84b0ea169aa0c0156add0f0553e997", + "size_in_bytes": 1465 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/curses/has_key.pyi", + "path_type": "hardlink", + "sha256": "d44a31814338c6507b82063846ee1eaa749ad169f698fef295413ba7d57b61cd", + "size_in_bytes": 40 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/curses/panel.pyi", + "path_type": "hardlink", + "sha256": "b62cfab048a8ce580aa77782ee0a173f48ab5e9f4fc161d27d688c6a158c451b", + "size_in_bytes": 28 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/curses/textpad.pyi", + "path_type": "hardlink", + "sha256": "d94b0bc088498798b059237ed52265cf0be7fbeb09aa1f3325843ca5808ff1ff", + "size_in_bytes": 422 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/dataclasses.pyi", + "path_type": "hardlink", + "sha256": "0a5e8bbe2e580333d9d2b7198e70e438c00e1ed1c97497984488c117dd8746cc", + "size_in_bytes": 14451 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/datetime.pyi", + "path_type": "hardlink", + "sha256": "0a258616e62525c1ac083c7205485819b4437ac7afbd7d15e4d762df0a25fdc3", + "size_in_bytes": 12256 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/dbm/__init__.pyi", + "path_type": "hardlink", + "sha256": "2996fd97482ea2586c8cec9fa99935febd3ebdd37c9ede1aeda721e653977b6d", + "size_in_bytes": 2143 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/dbm/dumb.pyi", + "path_type": "hardlink", + "sha256": "76c01fccb2899d7016eb124c9f0fb8ec3fb175a8b0b97c1a402ffe73521fd991", + "size_in_bytes": 1467 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/dbm/gnu.pyi", + "path_type": "hardlink", + "sha256": "411db9141edff91c62e51cd65a48bd9e9c8417524abb90394633960e647b4f65", + "size_in_bytes": 20 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/dbm/ndbm.pyi", + "path_type": "hardlink", + "sha256": "75cd0108363442219b1c0d2572a64be0da8e7c2112e21b6282a6f8b8ce54692a", + "size_in_bytes": 19 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/dbm/sqlite3.pyi", + "path_type": "hardlink", + "sha256": "bf5b9430f045207ec6df8b5827d1eb728600b78135ceaf0459819b5446c842c4", + "size_in_bytes": 1228 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/decimal.pyi", + "path_type": "hardlink", + "sha256": "4d52abaf7de6bafd35a02c96d63d5970cb6444c0d8826634dd1f085304eab354", + "size_in_bytes": 14077 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/difflib.pyi", + "path_type": "hardlink", + "sha256": "a6fd895e10db573405d5475f4ab6e530766f1c530f72576ef856d1c2d749b89c", + "size_in_bytes": 4512 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/dis.pyi", + "path_type": "hardlink", + "sha256": "1987eaae9696c34be586585d637ef1770ee64ea63ff61e6e19afaa79153c615a", + "size_in_bytes": 9643 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/__init__.pyi", + "path_type": "hardlink", + "sha256": "a3e0f42c00bff0b9914da86a3638d1517c9c452332279dfb34778569db992957", + "size_in_bytes": 351 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/_msvccompiler.pyi", + "path_type": "hardlink", + "sha256": "1ce4eb34f2856071a76888203b6ffe176053085f3bf1c4507fe81eecd838db99", + "size_in_bytes": 437 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/archive_util.pyi", + "path_type": "hardlink", + "sha256": "13a4f743b492596f14bf11242655db5bfc2be14698fdd74b11bf0c585374fca0", + "size_in_bytes": 1040 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/bcppcompiler.pyi", + "path_type": "hardlink", + "sha256": "7e07b670c6c6e23a7efa8d08db335cc32921db8b49599b64ea57908001f6349c", + "size_in_bytes": 78 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/ccompiler.pyi", + "path_type": "hardlink", + "sha256": "0424a0540bdf309561f04c97fc7a8d720830a45fcd11c4d39d5a2eae74be5149", + "size_in_bytes": 7358 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/cmd.pyi", + "path_type": "hardlink", + "sha256": "0e6fe7ef8d5cea7ec2fbc6e4dd104b3a35b984f3cecb816f458a71b804c8368e", + "size_in_bytes": 11116 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/command/__init__.pyi", + "path_type": "hardlink", + "sha256": "02d6699a1d6684baac58ed75986041f82aed456a6badd0eceb295b5e55de4de4", + "size_in_bytes": 711 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/command/bdist.pyi", + "path_type": "hardlink", + "sha256": "60b2de96e53a82a37f44d0cbe3add2884dda35068d283b1cb820bf666d1b8f72", + "size_in_bytes": 875 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/command/bdist_dumb.pyi", + "path_type": "hardlink", + "sha256": "b48b98ca3b0ec0fa65d614892b6e2d723a26e5d4c9f7c89dd1c9171f8c0de8c1", + "size_in_bytes": 614 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/command/bdist_msi.pyi", + "path_type": "hardlink", + "sha256": "1939f89fd0fab4bc32432b8fb4d1fe864d492f7ee5e8a92bdce1c0dd3315bfca", + "size_in_bytes": 1735 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/command/bdist_packager.pyi", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/command/bdist_rpm.pyi", + "path_type": "hardlink", + "sha256": "3de0903343ba416068583f6c7b4192ce82cfc017f5e872b9c80371749dfba81b", + "size_in_bytes": 1457 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/command/bdist_wininst.pyi", + "path_type": "hardlink", + "sha256": "c0e376b9cad245023c575ab6ff08bc5384d6f864298d47bf5d13ef5f867594ac", + "size_in_bytes": 646 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/command/build.pyi", + "path_type": "hardlink", + "sha256": "b9f9e3463b87eb63dbd1ef9c043caf544c3aecf155e1c398bf5fe03f83089151", + "size_in_bytes": 1081 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/command/build_clib.pyi", + "path_type": "hardlink", + "sha256": "a91deaf132dd17addcd29df7a5e528dbce221222c7f7ed952d42760e5782a490", + "size_in_bytes": 918 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/command/build_ext.pyi", + "path_type": "hardlink", + "sha256": "6bc906b459c2e94b57194ed7386f3475f49df46e73783d5f010ba5292edfd5a2", + "size_in_bytes": 1648 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/command/build_py.pyi", + "path_type": "hardlink", + "sha256": "a264539d7b168fb4c52a6802f48c21a86982e41ba1ec447d7b759d381f65e780", + "size_in_bytes": 1659 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/command/build_scripts.pyi", + "path_type": "hardlink", + "sha256": "16fd37306b5a070c1f748ebacd3a8934f783d8130017df2c7499c34730612e73", + "size_in_bytes": 703 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/command/check.pyi", + "path_type": "hardlink", + "sha256": "6ffec710412cd19afb96f21a0c3839c96790060a1722757e7e52d34de836286c", + "size_in_bytes": 1236 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/command/clean.pyi", + "path_type": "hardlink", + "sha256": "c1a811ddbc6a87a5005e7be1b037fba98418ff58cc4c43f7d105eeaba9892287", + "size_in_bytes": 513 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/command/config.pyi", + "path_type": "hardlink", + "sha256": "77687538831f91a7583064fde833d012d2f7f50a4b93eac24634110063860452", + "size_in_bytes": 2781 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/command/install.pyi", + "path_type": "hardlink", + "sha256": "ac557cba46a7769da2ee2136dec99d4fcc4bea389da70ddc63e1d34a9cc3317a", + "size_in_bytes": 2290 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/command/install_data.pyi", + "path_type": "hardlink", + "sha256": "d3d762896a5366fe60e4c6b2ff36bd5042b0fe6d9fbf055b7af3229fade5c41b", + "size_in_bytes": 558 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/command/install_egg_info.pyi", + "path_type": "hardlink", + "sha256": "a575772f77448cad0d9c688eeedc9783120ccf1e67c29bb9bfd3841788c5cb39", + "size_in_bytes": 532 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/command/install_headers.pyi", + "path_type": "hardlink", + "sha256": "d9978f9bfda2b3db88724d9cee22302f025eb7b11fe89a29155b8717a0fa6861", + "size_in_bytes": 488 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/command/install_lib.pyi", + "path_type": "hardlink", + "sha256": "f21373283b0d58b6ff4fd3b429cef93385ae5e96a74de241fbf0ab14779b0e75", + "size_in_bytes": 765 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/command/install_scripts.pyi", + "path_type": "hardlink", + "sha256": "96913182b087d709f22d2d92f9b670475da0a904dc1c47dfa9679eccbe75aaed", + "size_in_bytes": 548 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/command/register.pyi", + "path_type": "hardlink", + "sha256": "3fb9b8e1039a97aaac0edc3ae857c0fda98acb12e8bb29d1eece57b6204feb01", + "size_in_bytes": 697 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/command/sdist.pyi", + "path_type": "hardlink", + "sha256": "03192fbe7591d8aeb16264ca5ea88333b0d43da9deae23e24a0b49898306e0ed", + "size_in_bytes": 1517 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/command/upload.pyi", + "path_type": "hardlink", + "sha256": "aded045708139fa8d654ca0e5937ec652b4b5e8cd7eba2d2897a243c41ccffbe", + "size_in_bytes": 511 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/config.pyi", + "path_type": "hardlink", + "sha256": "066a66e7eb714ae51877dd979c39dfa407af4a5f5b93961f5cef88ff05c2d902", + "size_in_bytes": 497 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/core.pyi", + "path_type": "hardlink", + "sha256": "a1cdc4efd72d27dd1326c2e6cbcf233395ea92a995c9734ec5762e0cc398cbe1", + "size_in_bytes": 1973 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/cygwinccompiler.pyi", + "path_type": "hardlink", + "sha256": "036da58fe925ff4e8632841c97e33bca159b9a3cec4d79a5e8a0e30778a7e603", + "size_in_bytes": 586 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/debug.pyi", + "path_type": "hardlink", + "sha256": "c6c1e37c831dbaa4bd1390b6f1f14446a5ebf12b3ccb51863b5ad1f5547cbcbb", + "size_in_bytes": 51 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/dep_util.pyi", + "path_type": "hardlink", + "sha256": "1bfd5d7a12c1e0dabdbc498d285a936ac42d1be03c61ba6ac6cd4cdbe199c232", + "size_in_bytes": 647 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/dir_util.pyi", + "path_type": "hardlink", + "sha256": "a4626b012af409513d26a69031c3a157dae482c5d4088e2aa05a72bc5dd4075f", + "size_in_bytes": 875 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/dist.pyi", + "path_type": "hardlink", + "sha256": "fcd1e4540b465daaeef05c995fc726074c32d5650dd2e3357e925d88f08a501a", + "size_in_bytes": 15218 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/errors.pyi", + "path_type": "hardlink", + "sha256": "9755bf160a0ff4bf83fa110f140d81cd9bb26e3374955e16057974549fa4ec9f", + "size_in_bytes": 852 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/extension.pyi", + "path_type": "hardlink", + "sha256": "2a8b168cb4afbf27dd413b4e0aeddf89b6e51f28852179bc8871d6ad693dd7a1", + "size_in_bytes": 1236 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/fancy_getopt.pyi", + "path_type": "hardlink", + "sha256": "5a6196f04850a8bd7277a8cf80170273d245a3d3cca884bc76fb25bb622b5a91", + "size_in_bytes": 1673 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/file_util.pyi", + "path_type": "hardlink", + "sha256": "ce2921f1d859d22f1bd8f9b0dfe3adaaaa52fb0de0005e46c0df465c4cb511b3", + "size_in_bytes": 1323 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/filelist.pyi", + "path_type": "hardlink", + "sha256": "4625f2bab3c143f778534b22aaac47936daab14a803f61196d7e4b580e34966d", + "size_in_bytes": 2292 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/log.pyi", + "path_type": "hardlink", + "sha256": "f05bfc2583fec3a763c01eda7767e459a00123ed71935968a9d109399892fe0a", + "size_in_bytes": 940 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/msvccompiler.pyi", + "path_type": "hardlink", + "sha256": "a902ebdba9ac7e18f3fa8989bad59c4478a4dec84b875088b7b0832378c17772", + "size_in_bytes": 78 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/spawn.pyi", + "path_type": "hardlink", + "sha256": "a37e826c0c0e9779950679726acaaa60806b613fb7bfb7e3623c80c8be1d1739", + "size_in_bytes": 317 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/sysconfig.pyi", + "path_type": "hardlink", + "sha256": "0081f05809991ca45c442e1c7ba4e2f4d58924abbb3f6c7a6f7c538e33b03e27", + "size_in_bytes": 1210 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/text_file.pyi", + "path_type": "hardlink", + "sha256": "b7ea46b3a2e2e72494a1c48ed02114a11603525d9493e461b3059e1028a047f6", + "size_in_bytes": 787 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/unixccompiler.pyi", + "path_type": "hardlink", + "sha256": "47754a95d49f14f20f3c887281eab4284a61b53a748315332e8387774428596f", + "size_in_bytes": 79 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/util.pyi", + "path_type": "hardlink", + "sha256": "1c9a7161e6fee171bf539a38f863949c0b5447befa8ec8146ecddadc38a7d995", + "size_in_bytes": 1736 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/distutils/version.pyi", + "path_type": "hardlink", + "sha256": "c881a9daebe27bbeea4c15a54f67df04635720a2663df24b3f3684db3b9ad5f7", + "size_in_bytes": 1308 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/doctest.pyi", + "path_type": "hardlink", + "sha256": "22d1db42e2ff75c55ae1961923d232f7acaffe0f785f8aaf7aad465865f99345", + "size_in_bytes": 7932 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/email/__init__.pyi", + "path_type": "hardlink", + "sha256": "dfa332d03d3dcc239f4f6e86acc1ad5d0717f15e17a76a39288b93e192d15306", + "size_in_bytes": 2769 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/email/_header_value_parser.pyi", + "path_type": "hardlink", + "sha256": "42fe7460c88340253ffa866ffa7e4cf62022676a2f86581c3022374e7f69cd09", + "size_in_bytes": 11936 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/email/_policybase.pyi", + "path_type": "hardlink", + "sha256": "b3051e20e4031f795ff4d113677c5aff6d625bbf5b58fdd6c83b25281b95e6ef", + "size_in_bytes": 3331 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/email/base64mime.pyi", + "path_type": "hardlink", + "sha256": "83df00ee5bec12b21a89ff1d5633ff2f2a151525ddea536e27fa4e8931ee76ab", + "size_in_bytes": 559 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/email/charset.pyi", + "path_type": "hardlink", + "sha256": "2b691940f8955e3995f4ed5d45c464206f98903eb34738a6089ea2cbcf33d8a0", + "size_in_bytes": 1713 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/email/contentmanager.pyi", + "path_type": "hardlink", + "sha256": "53099e51c46e4530831d75440f30c0481378944b551b503d0689cd68c9afd1bf", + "size_in_bytes": 480 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/email/encoders.pyi", + "path_type": "hardlink", + "sha256": "749739b7a47a4ed6467dfcd10bf8e2d8ed8a363f67fdf247ce40272964db7dc4", + "size_in_bytes": 293 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/email/errors.pyi", + "path_type": "hardlink", + "sha256": "632b43b148cfac3a08e1fa5992d7fe9a12950a8b1939e76c4baa507c01610e0e", + "size_in_bytes": 1627 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/email/feedparser.pyi", + "path_type": "hardlink", + "sha256": "b4272458a7b29f7541c8663ca16b87589af2884320acc23e7a1260d1369078e2", + "size_in_bytes": 978 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/email/generator.pyi", + "path_type": "hardlink", + "sha256": "acf7bc26986f5fed3e3ed3e2c1658f69b8a4f40e4377295eb5e0425d2262e7b8", + "size_in_bytes": 2373 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/email/header.pyi", + "path_type": "hardlink", + "sha256": "a9211d3d230db40db6be435b67cd9e9c175d5b4b19eacabb1b10404a3d7e8ba5", + "size_in_bytes": 1332 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/email/headerregistry.pyi", + "path_type": "hardlink", + "sha256": "d364e2a5cbe256ef12d21c1d9c862cf019775e2f3484eb1c3e253efcb99f22a5", + "size_in_bytes": 6664 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/email/iterators.pyi", + "path_type": "hardlink", + "sha256": "568bbb2d2b1f539d9c916fa52b1e22e3d2868b4adde782dcb635c78a645b96b7", + "size_in_bytes": 648 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/email/message.pyi", + "path_type": "hardlink", + "sha256": "4b4463fb70bdfc0ca52af489100b531cf2d00c4426a70c4dd80a071693b4bc1c", + "size_in_bytes": 9210 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/email/mime/__init__.pyi", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/email/mime/application.pyi", + "path_type": "hardlink", + "sha256": "3e4a8241724c7484525c1575e2e9ef0a7a504ee35c1103b6dd6f0227c861b407", + "size_in_bytes": 498 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/email/mime/audio.pyi", + "path_type": "hardlink", + "sha256": "86c9cd0b9c40688da9bd2ec360caf9f18e3a53e86fe0c8c0294174c175a70dfb", + "size_in_bytes": 482 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/email/mime/base.pyi", + "path_type": "hardlink", + "sha256": "ccc50ecf2cd1170d348a7c0c15893e186f1aa7e48cf5db69d46453c637c08965", + "size_in_bytes": 271 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/email/mime/image.pyi", + "path_type": "hardlink", + "sha256": "137cde8c0edffe0d0d634f6dbd38fccb58f3190d083eb86c2830287dde9939b0", + "size_in_bytes": 482 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/email/mime/message.pyi", + "path_type": "hardlink", + "sha256": "6ec6a9ac7e29cd83644ef826c9cc7ecb974b047224f630a09e7ca206d559d150", + "size_in_bytes": 313 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/email/mime/multipart.pyi", + "path_type": "hardlink", + "sha256": "17636876448a1f1ff757369de371125941752d56331a3a491acce6f0d1ac6fe4", + "size_in_bytes": 504 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/email/mime/nonmultipart.pyi", + "path_type": "hardlink", + "sha256": "616effcf12011304ad18602ec3b9d0118612ed8cff4ccb935b8f99205a48a4ce", + "size_in_bytes": 108 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/email/mime/text.pyi", + "path_type": "hardlink", + "sha256": "c206053025e7a5e88cef3a7c829c642d12c287eef0ac6b9950dbd1a921f36c6f", + "size_in_bytes": 298 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/email/parser.pyi", + "path_type": "hardlink", + "sha256": "35fd06beaad915ca43dac433513072280b6f7af25551d9c06125ecefe93e42cd", + "size_in_bytes": 1975 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/email/policy.pyi", + "path_type": "hardlink", + "sha256": "1c867bb7f9d98afa8612e668b9983d3b07a110e8202a0ebe8adff0b2b29d6b9b", + "size_in_bytes": 2813 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/email/quoprimime.pyi", + "path_type": "hardlink", + "sha256": "6d216716549a744d695c79aa0f3bc01275b037279648b9be8b6d4a733c2bb7a0", + "size_in_bytes": 835 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/email/utils.pyi", + "path_type": "hardlink", + "sha256": "7a148117f21b5c43401822fed160a891b28d23741aa77ab98feb0e1783189fcb", + "size_in_bytes": 2735 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/__init__.pyi", + "path_type": "hardlink", + "sha256": "2d4b96c61bc0ad6b28ea706440f24b00bfeb6f3dc1cddf3ec9d1781569ff3097", + "size_in_bytes": 469 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/aliases.pyi", + "path_type": "hardlink", + "sha256": "341978928d4b794725bc7608d29ec02c5fea3399f66899d71f91d76a94d1f791", + "size_in_bytes": 24 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/ascii.pyi", + "path_type": "hardlink", + "sha256": "2574bdb69d831b6e97aeb8637f9fb727047fe842bfa9c66e2bc58b730fc6080f", + "size_in_bytes": 1346 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/base64_codec.pyi", + "path_type": "hardlink", + "sha256": "04fa9a05fe10a236e536a34005fe1b1e66a967d5091348e5541d82ddd7a967d2", + "size_in_bytes": 1105 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/big5.pyi", + "path_type": "hardlink", + "sha256": "9564886ba7353ce6726f0857c0d39e4e6c3996d26215389ec32185aab054dfe5", + "size_in_bytes": 920 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/big5hkscs.pyi", + "path_type": "hardlink", + "sha256": "9564886ba7353ce6726f0857c0d39e4e6c3996d26215389ec32185aab054dfe5", + "size_in_bytes": 920 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/bz2_codec.pyi", + "path_type": "hardlink", + "sha256": "b6957bf8cfd47904038fa8375b6c83433fab2a3a76262ffb037d1a09ceb5d6df", + "size_in_bytes": 1099 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/charmap.pyi", + "path_type": "hardlink", + "sha256": "32b6200f9afadb5bf29a11f4a4c4c93b2a03f4c06d7f718399b9c01bfedb85c0", + "size_in_bytes": 1652 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp037.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp1006.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp1026.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp1125.pyi", + "path_type": "hardlink", + "sha256": "22e29100d1453aa2195b8ae046ded4aa77761f1c9e82d60ab983b055b451f606", + "size_in_bytes": 733 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp1140.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp1250.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp1251.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp1252.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp1253.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp1254.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp1255.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp1256.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp1257.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp1258.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp273.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp424.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp437.pyi", + "path_type": "hardlink", + "sha256": "22e29100d1453aa2195b8ae046ded4aa77761f1c9e82d60ab983b055b451f606", + "size_in_bytes": 733 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp500.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp720.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp737.pyi", + "path_type": "hardlink", + "sha256": "22e29100d1453aa2195b8ae046ded4aa77761f1c9e82d60ab983b055b451f606", + "size_in_bytes": 733 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp775.pyi", + "path_type": "hardlink", + "sha256": "22e29100d1453aa2195b8ae046ded4aa77761f1c9e82d60ab983b055b451f606", + "size_in_bytes": 733 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp850.pyi", + "path_type": "hardlink", + "sha256": "22e29100d1453aa2195b8ae046ded4aa77761f1c9e82d60ab983b055b451f606", + "size_in_bytes": 733 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp852.pyi", + "path_type": "hardlink", + "sha256": "22e29100d1453aa2195b8ae046ded4aa77761f1c9e82d60ab983b055b451f606", + "size_in_bytes": 733 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp855.pyi", + "path_type": "hardlink", + "sha256": "22e29100d1453aa2195b8ae046ded4aa77761f1c9e82d60ab983b055b451f606", + "size_in_bytes": 733 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp856.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp857.pyi", + "path_type": "hardlink", + "sha256": "22e29100d1453aa2195b8ae046ded4aa77761f1c9e82d60ab983b055b451f606", + "size_in_bytes": 733 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp858.pyi", + "path_type": "hardlink", + "sha256": "22e29100d1453aa2195b8ae046ded4aa77761f1c9e82d60ab983b055b451f606", + "size_in_bytes": 733 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp860.pyi", + "path_type": "hardlink", + "sha256": "22e29100d1453aa2195b8ae046ded4aa77761f1c9e82d60ab983b055b451f606", + "size_in_bytes": 733 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp861.pyi", + "path_type": "hardlink", + "sha256": "22e29100d1453aa2195b8ae046ded4aa77761f1c9e82d60ab983b055b451f606", + "size_in_bytes": 733 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp862.pyi", + "path_type": "hardlink", + "sha256": "22e29100d1453aa2195b8ae046ded4aa77761f1c9e82d60ab983b055b451f606", + "size_in_bytes": 733 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp863.pyi", + "path_type": "hardlink", + "sha256": "22e29100d1453aa2195b8ae046ded4aa77761f1c9e82d60ab983b055b451f606", + "size_in_bytes": 733 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp864.pyi", + "path_type": "hardlink", + "sha256": "22e29100d1453aa2195b8ae046ded4aa77761f1c9e82d60ab983b055b451f606", + "size_in_bytes": 733 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp865.pyi", + "path_type": "hardlink", + "sha256": "22e29100d1453aa2195b8ae046ded4aa77761f1c9e82d60ab983b055b451f606", + "size_in_bytes": 733 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp866.pyi", + "path_type": "hardlink", + "sha256": "22e29100d1453aa2195b8ae046ded4aa77761f1c9e82d60ab983b055b451f606", + "size_in_bytes": 733 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp869.pyi", + "path_type": "hardlink", + "sha256": "22e29100d1453aa2195b8ae046ded4aa77761f1c9e82d60ab983b055b451f606", + "size_in_bytes": 733 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp874.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp875.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp932.pyi", + "path_type": "hardlink", + "sha256": "9564886ba7353ce6726f0857c0d39e4e6c3996d26215389ec32185aab054dfe5", + "size_in_bytes": 920 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp949.pyi", + "path_type": "hardlink", + "sha256": "9564886ba7353ce6726f0857c0d39e4e6c3996d26215389ec32185aab054dfe5", + "size_in_bytes": 920 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/cp950.pyi", + "path_type": "hardlink", + "sha256": "9564886ba7353ce6726f0857c0d39e4e6c3996d26215389ec32185aab054dfe5", + "size_in_bytes": 920 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/euc_jis_2004.pyi", + "path_type": "hardlink", + "sha256": "9564886ba7353ce6726f0857c0d39e4e6c3996d26215389ec32185aab054dfe5", + "size_in_bytes": 920 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/euc_jisx0213.pyi", + "path_type": "hardlink", + "sha256": "9564886ba7353ce6726f0857c0d39e4e6c3996d26215389ec32185aab054dfe5", + "size_in_bytes": 920 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/euc_jp.pyi", + "path_type": "hardlink", + "sha256": "9564886ba7353ce6726f0857c0d39e4e6c3996d26215389ec32185aab054dfe5", + "size_in_bytes": 920 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/euc_kr.pyi", + "path_type": "hardlink", + "sha256": "9564886ba7353ce6726f0857c0d39e4e6c3996d26215389ec32185aab054dfe5", + "size_in_bytes": 920 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/gb18030.pyi", + "path_type": "hardlink", + "sha256": "9564886ba7353ce6726f0857c0d39e4e6c3996d26215389ec32185aab054dfe5", + "size_in_bytes": 920 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/gb2312.pyi", + "path_type": "hardlink", + "sha256": "9564886ba7353ce6726f0857c0d39e4e6c3996d26215389ec32185aab054dfe5", + "size_in_bytes": 920 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/gbk.pyi", + "path_type": "hardlink", + "sha256": "9564886ba7353ce6726f0857c0d39e4e6c3996d26215389ec32185aab054dfe5", + "size_in_bytes": 920 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/hex_codec.pyi", + "path_type": "hardlink", + "sha256": "e9b101578ba7394a3c7a8a4a8eca487eb6ab027c8c4c271ca7bd5c64d5fdbac4", + "size_in_bytes": 1099 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/hp_roman8.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/hz.pyi", + "path_type": "hardlink", + "sha256": "9564886ba7353ce6726f0857c0d39e4e6c3996d26215389ec32185aab054dfe5", + "size_in_bytes": 920 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/idna.pyi", + "path_type": "hardlink", + "sha256": "07d6f85e1e4e780dd648c0fad90fb48bc37838e0558cfb2802d87a6708eaa629", + "size_in_bytes": 924 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/iso2022_jp.pyi", + "path_type": "hardlink", + "sha256": "9564886ba7353ce6726f0857c0d39e4e6c3996d26215389ec32185aab054dfe5", + "size_in_bytes": 920 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/iso2022_jp_1.pyi", + "path_type": "hardlink", + "sha256": "9564886ba7353ce6726f0857c0d39e4e6c3996d26215389ec32185aab054dfe5", + "size_in_bytes": 920 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/iso2022_jp_2.pyi", + "path_type": "hardlink", + "sha256": "9564886ba7353ce6726f0857c0d39e4e6c3996d26215389ec32185aab054dfe5", + "size_in_bytes": 920 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/iso2022_jp_2004.pyi", + "path_type": "hardlink", + "sha256": "9564886ba7353ce6726f0857c0d39e4e6c3996d26215389ec32185aab054dfe5", + "size_in_bytes": 920 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/iso2022_jp_3.pyi", + "path_type": "hardlink", + "sha256": "9564886ba7353ce6726f0857c0d39e4e6c3996d26215389ec32185aab054dfe5", + "size_in_bytes": 920 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/iso2022_jp_ext.pyi", + "path_type": "hardlink", + "sha256": "9564886ba7353ce6726f0857c0d39e4e6c3996d26215389ec32185aab054dfe5", + "size_in_bytes": 920 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/iso2022_kr.pyi", + "path_type": "hardlink", + "sha256": "9564886ba7353ce6726f0857c0d39e4e6c3996d26215389ec32185aab054dfe5", + "size_in_bytes": 920 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_1.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_10.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_11.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_13.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_14.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_15.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_16.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_2.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_3.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_4.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_5.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_6.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_7.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_8.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/iso8859_9.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/johab.pyi", + "path_type": "hardlink", + "sha256": "9564886ba7353ce6726f0857c0d39e4e6c3996d26215389ec32185aab054dfe5", + "size_in_bytes": 920 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/koi8_r.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/koi8_t.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/koi8_u.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/kz1048.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/latin_1.pyi", + "path_type": "hardlink", + "sha256": "746c0b8188d881c0d52c0a895f368e96d0cb0cd810342f80905bf07f3813da5b", + "size_in_bytes": 1354 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/mac_arabic.pyi", + "path_type": "hardlink", + "sha256": "22e29100d1453aa2195b8ae046ded4aa77761f1c9e82d60ab983b055b451f606", + "size_in_bytes": 733 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/mac_croatian.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/mac_cyrillic.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/mac_farsi.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/mac_greek.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/mac_iceland.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/mac_latin2.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/mac_roman.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/mac_romanian.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/mac_turkish.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/mbcs.pyi", + "path_type": "hardlink", + "sha256": "522529d166cc7443191c8b7c4a72a31e0ebdcad894348b4a540a85fc340c0467", + "size_in_bytes": 1091 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/oem.pyi", + "path_type": "hardlink", + "sha256": "37d0aa3260293a197b9d288bce3bab3a8344d912e199935d3fa1e49cda7f7e6d", + "size_in_bytes": 1087 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/palmos.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/ptcp154.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/punycode.pyi", + "path_type": "hardlink", + "sha256": "52455235810544f0dc44828c6c8df54734a552813bceb5740965ec5c11e59def", + "size_in_bytes": 1593 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/quopri_codec.pyi", + "path_type": "hardlink", + "sha256": "bc1038aa78d81d1e47809b577b87c2ce288fc476248af2a04b4915fa7a698d7f", + "size_in_bytes": 1105 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/raw_unicode_escape.pyi", + "path_type": "hardlink", + "sha256": "d1f5a8cefe5fd576327b78ba1d93e7aeb3141aacaac49a43c6adcac4972cba0d", + "size_in_bytes": 1000 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/rot_13.pyi", + "path_type": "hardlink", + "sha256": "754f0fcf4b53eea7bdc578a93af61c3ba99c74f3d75af208509ee7b095719234", + "size_in_bytes": 889 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/shift_jis.pyi", + "path_type": "hardlink", + "sha256": "9564886ba7353ce6726f0857c0d39e4e6c3996d26215389ec32185aab054dfe5", + "size_in_bytes": 920 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/shift_jis_2004.pyi", + "path_type": "hardlink", + "sha256": "9564886ba7353ce6726f0857c0d39e4e6c3996d26215389ec32185aab054dfe5", + "size_in_bytes": 920 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/shift_jisx0213.pyi", + "path_type": "hardlink", + "sha256": "9564886ba7353ce6726f0857c0d39e4e6c3996d26215389ec32185aab054dfe5", + "size_in_bytes": 920 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/tis_620.pyi", + "path_type": "hardlink", + "sha256": "08663c54b1b600c85ea305e6103d01bb350ae41c9f0cd52b264a3650974551be", + "size_in_bytes": 730 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/undefined.pyi", + "path_type": "hardlink", + "sha256": "90251b957d0e91df2146ca13bca1ba52f75051b9cb01b0abef3e0cadfba1a54f", + "size_in_bytes": 755 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/unicode_escape.pyi", + "path_type": "hardlink", + "sha256": "c3df3524eb1efd14c8ba44602a23aa6c2724b56e5e68151dc8b34ca0021e5b30", + "size_in_bytes": 992 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/utf_16.pyi", + "path_type": "hardlink", + "sha256": "49191adaddabbb6f8fb27d47f7cb21c9ca4fa66c598459faf701054d74ae0dc9", + "size_in_bytes": 761 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/utf_16_be.pyi", + "path_type": "hardlink", + "sha256": "93e0292feb69b73fd06f2e019c056c994c5f83303648355c64196035d2327deb", + "size_in_bytes": 1004 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/utf_16_le.pyi", + "path_type": "hardlink", + "sha256": "4a1037d0c20790a4aeacdceef021347753f11ab5ea70efc922912c86d20e00b8", + "size_in_bytes": 1004 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/utf_32.pyi", + "path_type": "hardlink", + "sha256": "3dfa89b45110825c3ae5e483267bd8a1f5168901be419f59f1163740762bd328", + "size_in_bytes": 761 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/utf_32_be.pyi", + "path_type": "hardlink", + "sha256": "445d8d36555621803367891df7b27919a498166d2ec2265e58c0dd6966d79745", + "size_in_bytes": 1004 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/utf_32_le.pyi", + "path_type": "hardlink", + "sha256": "c03c7e18f6e6086df3ffc54bbb8066e1521c8015d7731ae69320edf7e416ff46", + "size_in_bytes": 1004 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/utf_7.pyi", + "path_type": "hardlink", + "sha256": "3fef4b525e314d715e6687e07779fb39e47b7ae54eb399ccfb398c0ff30985fd", + "size_in_bytes": 988 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/utf_8.pyi", + "path_type": "hardlink", + "sha256": "b84346d337537cd1ba0fe1f0a639ada6c9fddfbc0693d2dc697074e5daa0298e", + "size_in_bytes": 988 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/utf_8_sig.pyi", + "path_type": "hardlink", + "sha256": "080bcaae99462eb5ca9a97445b8f8f8e2862039508091b5c0fc61a257e5d8623", + "size_in_bytes": 1059 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/uu_codec.pyi", + "path_type": "hardlink", + "sha256": "49edc1f5ac6633abc06f740e472dde2f765747dcab5bdebedcf86e8131345b0d", + "size_in_bytes": 1148 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/encodings/zlib_codec.pyi", + "path_type": "hardlink", + "sha256": "a952aa86a31f979fc03a3da0afa95f2e2fcac0e037928b53a728326862fa0599", + "size_in_bytes": 1101 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/ensurepip/__init__.pyi", + "path_type": "hardlink", + "sha256": "f2d9a80ccd42cbba231b39cd698ce9ffecf3a1360ffc5ba72a13ef2a9b155382", + "size_in_bytes": 264 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/enum.pyi", + "path_type": "hardlink", + "sha256": "09770946a8188bb6b8f62877f427ce8f0ad78556d37f75f68b1888a49eec4513", + "size_in_bytes": 13512 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/errno.pyi", + "path_type": "hardlink", + "sha256": "f66068bf3b4207b26205afd59ea77c21c2c4218d521909288976f451aea87ff1", + "size_in_bytes": 5522 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/faulthandler.pyi", + "path_type": "hardlink", + "sha256": "67df36ed5cf52751feece7bc4469f49f9fb61a449cb37da6574275a4f6607867", + "size_in_bytes": 957 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/fcntl.pyi", + "path_type": "hardlink", + "sha256": "fea1cede4ac8574df49e5964988532f436703edbace844c62775c65e5d361544", + "size_in_bytes": 5495 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/filecmp.pyi", + "path_type": "hardlink", + "sha256": "ffc91a9571f56f1cf66e16ca8cddfb0318db77ee15677e08777b96f342301c81", + "size_in_bytes": 2237 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/fileinput.pyi", + "path_type": "hardlink", + "sha256": "4de40420081fb3b736da68da6610ced7a2d29f5c5c838231136d930bfb734934", + "size_in_bytes": 7378 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/fnmatch.pyi", + "path_type": "hardlink", + "sha256": "6b8152e8371c3da16e7e673845a5b2c7afd8530267e446356357405a20de37a4", + "size_in_bytes": 525 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/formatter.pyi", + "path_type": "hardlink", + "sha256": "3e80856bb8c9ede7f3f993be20953bdcc2bf3bdb7b9a36d8c23c41692a69aa95", + "size_in_bytes": 3711 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/fractions.pyi", + "path_type": "hardlink", + "sha256": "22db64f04e58b7e3d36eb86482ca3242427dc7626f528d84d2a13b8dad14c2c5", + "size_in_bytes": 5879 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/ftplib.pyi", + "path_type": "hardlink", + "sha256": "f17e41cfd3f29a017b00f6aefb2d9657dc2eb094aeadeae43afb6a49cba1b3c7", + "size_in_bytes": 6471 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/functools.pyi", + "path_type": "hardlink", + "sha256": "15ff434f8d5cad12fa9f50d637ba3c5ebf87c550de089e22e01e18e112fd0924", + "size_in_bytes": 9984 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/gc.pyi", + "path_type": "hardlink", + "sha256": "da8a8f2b375a820d2c4d088dc1e2a583f19b94fd672a0967e525313b2b9f5bc4", + "size_in_bytes": 1153 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/genericpath.pyi", + "path_type": "hardlink", + "sha256": "cfc12ae2abf71ef8584e4f5603af52cd0ea7f3eedeab9f4a77444e5df2e4a479", + "size_in_bytes": 2384 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/getopt.pyi", + "path_type": "hardlink", + "sha256": "1a7fa4eecb2db7e6ca31174bcdd04e47066e585d76cdbcf9dd1e0bca9dba3549", + "size_in_bytes": 909 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/getpass.pyi", + "path_type": "hardlink", + "sha256": "7ed2471d73f0da7962e3213210869abe6a362cac5a7ae2ad862e27d20d6a4b6e", + "size_in_bytes": 401 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/gettext.pyi", + "path_type": "hardlink", + "sha256": "cf4a058cd51a954e584639c09cf1137ce36059cb8c760881e5ea01cb6b24dffb", + "size_in_bytes": 7574 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/glob.pyi", + "path_type": "hardlink", + "sha256": "9e13540a90745ee38d889eec5fd86c4553db730a34df7406e438fbc375d1edb8", + "size_in_bytes": 2201 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/graphlib.pyi", + "path_type": "hardlink", + "sha256": "de5a0c0e4324e23fafb69e5d19168e6bf44dab23371546422614c9232ae99731", + "size_in_bytes": 917 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/grp.pyi", + "path_type": "hardlink", + "sha256": "da12502f89022a143e40101af3ba0cf3795dbd6e1668e9164e5c921b307d5468", + "size_in_bytes": 702 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/gzip.pyi", + "path_type": "hardlink", + "sha256": "9d192cda6c2a09adac6fc470fa14b3bf8186a5dfb3dcb7cbb46bbeab27da9979", + "size_in_bytes": 5567 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/hashlib.pyi", + "path_type": "hardlink", + "sha256": "a49509126529be9f4c8a32bb0e56f8c390159331efd1d311f3ac7bb3ebda6873", + "size_in_bytes": 2208 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/heapq.pyi", + "path_type": "hardlink", + "sha256": "a64ddb8b13293c6d17bc7c2827a1dbed3705dd93556b032db3b4e5577007211a", + "size_in_bytes": 949 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/hmac.pyi", + "path_type": "hardlink", + "sha256": "e346eea46adafe783c8d9dc00ab2dfe9c87373ebdda3d61558304f75da2c832d", + "size_in_bytes": 1258 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/html/__init__.pyi", + "path_type": "hardlink", + "sha256": "4ca36dd8af43fa802f0939adf7f12d8119dd7296fefbcadac3160530f1d3482d", + "size_in_bytes": 157 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/html/entities.pyi", + "path_type": "hardlink", + "sha256": "442f0da09fc032ee4851656e497906bca0f93bee993528631ce2f4350817369a", + "size_in_bytes": 236 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/html/parser.pyi", + "path_type": "hardlink", + "sha256": "5ae0e95c445214add7689683238708c64165f48b9dbe27e99be26904bd976f25", + "size_in_bytes": 2098 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/http/__init__.pyi", + "path_type": "hardlink", + "sha256": "40fd3c6e35cae616ab044877d7dacc3704260775abb4560cbd234f1acdc21f4c", + "size_in_bytes": 3030 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/http/client.pyi", + "path_type": "hardlink", + "sha256": "fadded7b893a91f29eb9c77cfec9e9c4cdcea7a9fc3bb47bdebe9c91de0d3faa", + "size_in_bytes": 9790 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/http/cookiejar.pyi", + "path_type": "hardlink", + "sha256": "2b538a64cfeee137fe365213a9ce8390cce2eb712025e2f2c88ad0e99110235c", + "size_in_bytes": 6667 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/http/cookies.pyi", + "path_type": "hardlink", + "sha256": "ac39f1ba10ffdb8f2283e49d99e9d9a61906b9e0c29d06f06caa78785ef2a8ab", + "size_in_bytes": 2298 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/http/server.pyi", + "path_type": "hardlink", + "sha256": "f1a0acbf44c11bc75f97ff6fa9fd8175c28389562e5368fd77f0d11a12cd2760", + "size_in_bytes": 5726 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/imaplib.pyi", + "path_type": "hardlink", + "sha256": "255f9fbac4004015aa2accafbb865aa10cd08948788d3e860c412d5b2f234fef", + "size_in_bytes": 8949 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/imghdr.pyi", + "path_type": "hardlink", + "sha256": "b32aba8ca9e0bc41e0728a59134c4321946893681b8dd096e264fa0c13c336d2", + "size_in_bytes": 541 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/imp.pyi", + "path_type": "hardlink", + "sha256": "119ca89faabacdcb03172daa3347f9450ab2206027439f7c9adf39956893a39e", + "size_in_bytes": 2484 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/importlib/__init__.pyi", + "path_type": "hardlink", + "sha256": "b39ade495592a7571997e5361d23ec8394176ccd73a58d487079e742cad65795", + "size_in_bytes": 724 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/importlib/_abc.pyi", + "path_type": "hardlink", + "sha256": "0999cb951f31fdc902b10e16f6a192fa222fd42898a0e6266ba9fc6825530533", + "size_in_bytes": 858 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/importlib/_bootstrap.pyi", + "path_type": "hardlink", + "sha256": "a9da33f0e57a2f86d6c4596ba00ce733e29255fd1b60d0907984f3f949357145", + "size_in_bytes": 129 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/importlib/_bootstrap_external.pyi", + "path_type": "hardlink", + "sha256": "a5f773cb4bdc79674be50059c8c6a4eb22e2f542d1d314773e01906cee8cd812", + "size_in_bytes": 117 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/importlib/abc.pyi", + "path_type": "hardlink", + "sha256": "d131ca4b5164b7c33558577ecbec4226b94af078ecffcf30227304ede127f935", + "size_in_bytes": 8119 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/importlib/machinery.pyi", + "path_type": "hardlink", + "sha256": "52c0d907bac084a530430dd94561e2b31625f554fab08efae1e108542b7343f4", + "size_in_bytes": 1503 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/importlib/metadata/__init__.pyi", + "path_type": "hardlink", + "sha256": "ad1600268b0795f216dbd87786f9b73620d7c518be430189112d9c84d9466e7b", + "size_in_bytes": 10488 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/importlib/metadata/_meta.pyi", + "path_type": "hardlink", + "sha256": "76d029050d9188c53e9b663507fef22df31194b1c45d50f538009974f2b0195c", + "size_in_bytes": 2552 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/importlib/metadata/diagnose.pyi", + "path_type": "hardlink", + "sha256": "b1fe2ab0c954147b5dc645310906e8fa12f46a9a74f1c593abd73ecf41da1f2e", + "size_in_bytes": 59 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/importlib/readers.pyi", + "path_type": "hardlink", + "sha256": "ecbf15c02285a3697e5ce6dbce3148311c72d162441f7665da0ea1078acfb242", + "size_in_bytes": 2737 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/importlib/resources/__init__.pyi", + "path_type": "hardlink", + "sha256": "8ee0d13ebdbae737a711714ab694c7af944dd88ac6efe0ef922efb8221988d41", + "size_in_bytes": 2771 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/importlib/resources/_common.pyi", + "path_type": "hardlink", + "sha256": "e4d3edac404c89c071178a3353af5d563ec0b4044bca5f19d73b164a69019735", + "size_in_bytes": 1600 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/importlib/resources/_functional.pyi", + "path_type": "hardlink", + "sha256": "d9628b21320eb5fd32664aefb2bf4170507e467e39f13a858661fb6bfb54ab39", + "size_in_bytes": 1597 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/importlib/resources/abc.pyi", + "path_type": "hardlink", + "sha256": "298353ed07bd34cf729ba1f9c515268aaf579abdeca6f39765568489541464d9", + "size_in_bytes": 2325 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/importlib/resources/readers.pyi", + "path_type": "hardlink", + "sha256": "2fd212763ca2571f29a673f66d34a36dd77f773bebd65637fda467e997e2b6c3", + "size_in_bytes": 398 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/importlib/resources/simple.pyi", + "path_type": "hardlink", + "sha256": "8d7b67280030b278459b502c3c181b917c02c0c7613041b4f898797d380bb266", + "size_in_bytes": 2234 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/importlib/simple.pyi", + "path_type": "hardlink", + "sha256": "3f1f43d6630fa17ae1fff232d4969ca883760045124cb1eb5767d51914644d92", + "size_in_bytes": 354 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/importlib/util.pyi", + "path_type": "hardlink", + "sha256": "b9f35da6f270663902dab9c6b4872f7029c2241d3694b8fbac5a41840cd8c631", + "size_in_bytes": 2832 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/inspect.pyi", + "path_type": "hardlink", + "sha256": "3b3aee1afc56902311adc3245e1da410840ce5ef4f025ed8dfd90f4afc78c4f6", + "size_in_bytes": 24080 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/io.pyi", + "path_type": "hardlink", + "sha256": "555378a3acefd8161a0003bdb473ca980331ffe7ae376a86e84f00e67d36af3a", + "size_in_bytes": 1944 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/ipaddress.pyi", + "path_type": "hardlink", + "sha256": "42c0a928d520e5251fc2cc90c3ecae1bb970ddf346c886882f8f185d205488ca", + "size_in_bytes": 8469 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/itertools.pyi", + "path_type": "hardlink", + "sha256": "4302eef30dd6f4633d29371bcf971a9e552e2f19d4c784c8a6779dcf349a3f8d", + "size_in_bytes": 14005 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/json/__init__.pyi", + "path_type": "hardlink", + "sha256": "5e17291feef29d72276962727f64c6d0328ab777c2ff53b0be7dace84e9a79f6", + "size_in_bytes": 2061 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/json/decoder.pyi", + "path_type": "hardlink", + "sha256": "5dd5349e16128655996d25e9c4676c82eaed3374bf9740bd98360257d4df6a29", + "size_in_bytes": 1117 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/json/encoder.pyi", + "path_type": "hardlink", + "sha256": "7fd1633b84637ff94ba8b8cf92eb1846009daed1bc86aee6caaee9ebf73705e7", + "size_in_bytes": 1323 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/json/scanner.pyi", + "path_type": "hardlink", + "sha256": "e14844fb5e16f16ddc889a56a218c3ed8984f0d25be56d73f9cb2833f75efe86", + "size_in_bytes": 171 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/json/tool.pyi", + "path_type": "hardlink", + "sha256": "7787f6d901b0a5bd59b4393ed529fbd9fb6fa388a7702e44d890229268f37c92", + "size_in_bytes": 24 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/keyword.pyi", + "path_type": "hardlink", + "sha256": "7829b02c02496643591b98400c7f263ec89056648b3bc14629872d68572669ba", + "size_in_bytes": 434 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/__init__.pyi", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/btm_matcher.pyi", + "path_type": "hardlink", + "sha256": "cd63120da84d6af862e34864535acafb794fb1282f96c0c9b708507ea0259925", + "size_in_bytes": 860 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixer_base.pyi", + "path_type": "hardlink", + "sha256": "35a7105b57ba7e8a014aee5caebc1e302d0a29c0615c3426b106ded75537723d", + "size_in_bytes": 1692 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/__init__.pyi", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_apply.pyi", + "path_type": "hardlink", + "sha256": "c4ca9bbee5b2d6e8ce77da1d086262dd4a5e48b9a5624ea334af4be63c9d9c07", + "size_in_bytes": 215 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_asserts.pyi", + "path_type": "hardlink", + "sha256": "508eb4e6081145c0b37e1a3bfb3615ecd7a590a7cec4fe291bde75f292204093", + "size_in_bytes": 259 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_basestring.pyi", + "path_type": "hardlink", + "sha256": "958d61db47d0fc7a48fb9e025d78e14696b36e1f88f0f31ab23c4f6aed622637", + "size_in_bytes": 240 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_buffer.pyi", + "path_type": "hardlink", + "sha256": "472b0b64ded05f4a2e047c786c3e6c4424ed57fa7a190945f8f29316978fa87a", + "size_in_bytes": 224 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_dict.pyi", + "path_type": "hardlink", + "sha256": "a9c6d9444dd7edc142c0043e047ff4364c64d3012f4b4e2d3d439f25b71a7b87", + "size_in_bytes": 424 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_except.pyi", + "path_type": "hardlink", + "sha256": "0dfe8a5bc8eb6ed61653f91602a958e4544b73c76b902804f299a9a754b5e0ba", + "size_in_bytes": 415 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_exec.pyi", + "path_type": "hardlink", + "sha256": "daa9a9d439a2cdde99832782f09e47be32d7a580584f9a01046083f42ee27568", + "size_in_bytes": 214 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_execfile.pyi", + "path_type": "hardlink", + "sha256": "32ced22c85367b890e07fa33100b3b4393a8f3a91ad64db5e1dafc230fdd4277", + "size_in_bytes": 218 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_exitfunc.pyi", + "path_type": "hardlink", + "sha256": "82d5fdc26a3b01188251975c61315f98db276ce5d3b9d5cceb25335dfd07ba2f", + "size_in_bytes": 445 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_filter.pyi", + "path_type": "hardlink", + "sha256": "278aa851b44af2d7a880a9ebf75359035ed495c59ec54f1885c33c382a581bad", + "size_in_bytes": 280 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_funcattrs.pyi", + "path_type": "hardlink", + "sha256": "da03ee7969e0bbf153861bc535709b1f327325f75ecf49bcf3075fbbf141ac28", + "size_in_bytes": 227 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_future.pyi", + "path_type": "hardlink", + "sha256": "0f60bf9adae72f6059a1f32e580453457db522ce94d68293512cb94fbfbdf1dd", + "size_in_bytes": 216 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_getcwdu.pyi", + "path_type": "hardlink", + "sha256": "b6b79d97bac558100426cd993ed8847798c3d053f41f2afbb10930966b39e780", + "size_in_bytes": 225 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_has_key.pyi", + "path_type": "hardlink", + "sha256": "a02234c50700221e17f2a5ba645f79d9b3291c2829de538954564b5707539830", + "size_in_bytes": 216 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_idioms.pyi", + "path_type": "hardlink", + "sha256": "cfbdfffddc509c39d73a6b65f7b5ec0e3d0e730c175689b3d7ad51889f979936", + "size_in_bytes": 459 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_import.pyi", + "path_type": "hardlink", + "sha256": "6ad2d86d46bdc03118b26f089b21e69a57d3e9655d89d74f2b4154af48ed4bca", + "size_in_bytes": 507 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_imports.pyi", + "path_type": "hardlink", + "sha256": "70190327270dc3425c3d0dd4eb73836aa6f62cd556dcc59bbf1143d6fed20e68", + "size_in_bytes": 653 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_imports2.pyi", + "path_type": "hardlink", + "sha256": "403755ad161d0de14743b779a9aafc4caedd7ab356a4974caf07d4bcc9b63532", + "size_in_bytes": 150 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_input.pyi", + "path_type": "hardlink", + "sha256": "41816cec22788d967e270115975b637c574f66cc80087f557d8a18d865a45be2", + "size_in_bytes": 269 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_intern.pyi", + "path_type": "hardlink", + "sha256": "926234fc9141c90262467ba634eea51e31e9559a9d8b0d10b3ebd51688b1da79", + "size_in_bytes": 252 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_isinstance.pyi", + "path_type": "hardlink", + "sha256": "2c20f3b46631474341a0b68d7d4ea4071054506fd522732a71c3f1210dcb380f", + "size_in_bytes": 228 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_itertools.pyi", + "path_type": "hardlink", + "sha256": "2cc0a90bc3bdc7d12674bd902f2e505079c21b79cc871d21ad6f0a32c360c7ad", + "size_in_bytes": 245 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_itertools_imports.pyi", + "path_type": "hardlink", + "sha256": "45239a652fa9c81c8a356630983f75347139d4f08d669f0192847b57c3782b79", + "size_in_bytes": 230 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_long.pyi", + "path_type": "hardlink", + "sha256": "0c56015800247607f4f5fb54d0791dbfb5f728f88980755fe94447a67c82c824", + "size_in_bytes": 240 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_map.pyi", + "path_type": "hardlink", + "sha256": "2cf4798f1cc2c5a922705a05a8228617588ce3041b48cd597cefa09763a2c117", + "size_in_bytes": 274 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_metaclass.pyi", + "path_type": "hardlink", + "sha256": "bebd3f7c96df2440d782dd1118ca6b12c477270abddf820754e622b4ef98bdb9", + "size_in_bytes": 587 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_methodattrs.pyi", + "path_type": "hardlink", + "sha256": "ac246b2ac60471716c30b6b20d19d61bf5f8b44eef1eac4c1a03806d8336ea9c", + "size_in_bytes": 264 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_ne.pyi", + "path_type": "hardlink", + "sha256": "cdae7febdf54439bbb804c695b4ac54162e8cf48015a268bd9b74cf9493c5e41", + "size_in_bytes": 217 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_next.pyi", + "path_type": "hardlink", + "sha256": "e0e741224be114cd449374167bd0020145b66aa044e3c48b2a263af51206f580", + "size_in_bytes": 518 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_nonzero.pyi", + "path_type": "hardlink", + "sha256": "049fafb37a4af432d415f03e063144c623c4c66703c32a0da1fc2b63464fbb82", + "size_in_bytes": 225 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_numliterals.pyi", + "path_type": "hardlink", + "sha256": "0c0ff76aa3751c4886d8c6b19506269b01855f7524c46a1396ada2a49b248939", + "size_in_bytes": 226 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_operator.pyi", + "path_type": "hardlink", + "sha256": "42987d3d2ddc64cb09069c529f2aaf74b5e6e16cfa311a0cf4e8480a1be4041c", + "size_in_bytes": 312 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_paren.pyi", + "path_type": "hardlink", + "sha256": "2c703a3b7f8f7348954601714e79394b076b8730fd89bb6c6f6c58563c4de73c", + "size_in_bytes": 223 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_print.pyi", + "path_type": "hardlink", + "sha256": "3c29cd2639239f7d8ec8c6431adf48fadcae345dab0deba57021cf6827673756", + "size_in_bytes": 334 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_raise.pyi", + "path_type": "hardlink", + "sha256": "9162dd1ca82b0a33605b1cbcfd2f2dd462c4ffe4660b1cdd57a1140cf18544b0", + "size_in_bytes": 215 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_raw_input.pyi", + "path_type": "hardlink", + "sha256": "e89621abab6b78054454c2095a8826c3b6bfedbece4271900937524cf6948493", + "size_in_bytes": 226 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_reduce.pyi", + "path_type": "hardlink", + "sha256": "831fedb3a6dce4c3873b6448fee2b95ac1fe89b7d31e8a9ec273aae9b302b6d2", + "size_in_bytes": 264 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_reload.pyi", + "path_type": "hardlink", + "sha256": "8c3b79b4414fa5ee5ba56dbfc57fcaee0da65d91c1803e5d69fd582ead71ae09", + "size_in_bytes": 252 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_renames.pyi", + "path_type": "hardlink", + "sha256": "084d5903eb406a608caba19fb7d2a5f73d798edb80afa381cb03777e8e5f009f", + "size_in_bytes": 507 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_repr.pyi", + "path_type": "hardlink", + "sha256": "f7538b26b9b478ad64d45ce9138e7adff27f4671df111a1c1de4ab8fa0c4f2ac", + "size_in_bytes": 214 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_set_literal.pyi", + "path_type": "hardlink", + "sha256": "6fec072b6e985767364797013a1214eb781fdb9258a976f272d6b5cc7ab2ae29", + "size_in_bytes": 224 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_standarderror.pyi", + "path_type": "hardlink", + "sha256": "4503fba6b836dbb57b2e6e60ae1af30fb307837029a202dc6f94a583247b0f32", + "size_in_bytes": 223 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_sys_exc.pyi", + "path_type": "hardlink", + "sha256": "8b385e6530aa28f77e165d9a656ce185c14eb5d30863817f955aad3a671db678", + "size_in_bytes": 250 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_throw.pyi", + "path_type": "hardlink", + "sha256": "0327edd543fcf26c31343b0fdca5eec8451f69c27d9b284fd3bbcfde55c72f6f", + "size_in_bytes": 223 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_tuple_params.pyi", + "path_type": "hardlink", + "sha256": "6086448b345daeaa9cb89c0ae975bcece5125101e8f5a48c76418c265b359c79", + "size_in_bytes": 451 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_types.pyi", + "path_type": "hardlink", + "sha256": "a77aae86d1e0830320f8a0dcd9d98ef1cf684d3e923992d31b57de54fa97b95c", + "size_in_bytes": 215 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_unicode.pyi", + "path_type": "hardlink", + "sha256": "015526d101343b1c305e064b5884d74011eba77585406c90a3590f37cb45ea2a", + "size_in_bytes": 369 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_urllib.pyi", + "path_type": "hardlink", + "sha256": "44c105d34afca42df0aba3e01ca4e0e76fc8c28f1acca3d1b39a062a62802400", + "size_in_bytes": 556 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_ws_comma.pyi", + "path_type": "hardlink", + "sha256": "ed610233e4efcd23649f3856edfcbb4354400302cdb2770534ffee8e31ca3d90", + "size_in_bytes": 304 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_xrange.pyi", + "path_type": "hardlink", + "sha256": "204d39bd02a598c924f6d3dbbc7f88dc539f48d77e5cfd572ef7415fc2b445bf", + "size_in_bytes": 726 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_xreadlines.pyi", + "path_type": "hardlink", + "sha256": "697bfc706cb784baed65eaccb472c088d41a4804101a47b70ba58947ef00fce9", + "size_in_bytes": 228 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/fixes/fix_zip.pyi", + "path_type": "hardlink", + "sha256": "430e22f899f70362e81be8d2a4727c0685121e4dfc89e80ad45cb1b54aa7803f", + "size_in_bytes": 274 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/main.pyi", + "path_type": "hardlink", + "sha256": "3205169e8bd5f16383ae39a7479e5781e8fcb63052837a7d80e2b51916d5909b", + "size_in_bytes": 1532 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/pgen2/__init__.pyi", + "path_type": "hardlink", + "sha256": "275afb3baf910b9e515fd5ee214e10713f2c9beef2498d1ea308a26cd273d241", + "size_in_bytes": 287 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/pgen2/driver.pyi", + "path_type": "hardlink", + "sha256": "3cdbdec161437205829a61306042ad06b2ab1e4ba4319aa4af2afa59ab90675c", + "size_in_bytes": 1067 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/pgen2/grammar.pyi", + "path_type": "hardlink", + "sha256": "746d7bc85b1bb64883b2f282c96459bdcd3399a08b17cde6fe76936735338915", + "size_in_bytes": 682 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/pgen2/literals.pyi", + "path_type": "hardlink", + "sha256": "4edad79d72625d44d205720fff784952828cda1feb48d839693a9070be6d6487", + "size_in_bytes": 151 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/pgen2/parse.pyi", + "path_type": "hardlink", + "sha256": "7528c89ceae23eae07e988570afb16d2551e09928c57cd6662661cf596c48786", + "size_in_bytes": 1133 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/pgen2/pgen.pyi", + "path_type": "hardlink", + "sha256": "b2e1ed6ef4bbc7ae12ef3ef410c685770f99260bbcff0eedd16c11bead40cc1a", + "size_in_bytes": 2273 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/pgen2/token.pyi", + "path_type": "hardlink", + "sha256": "f642e542599f7ef2e055e4bb7100be3860eecf02a63fdd9838e7ea99a2034543", + "size_in_bytes": 1418 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/pgen2/tokenize.pyi", + "path_type": "hardlink", + "sha256": "99d8db1e82204c815619a18aa64cb516ac6963a5208a1e75e12bc094d513fbc9", + "size_in_bytes": 1972 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/pygram.pyi", + "path_type": "hardlink", + "sha256": "70c0c7a4935682ccb468956b1b67b6b810eaf436d7777d21b5740132300efe90", + "size_in_bytes": 2253 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/pytree.pyi", + "path_type": "hardlink", + "sha256": "468c33b9824a85250a5f7d84e95adffd21eef474bc7b3afdefebd0fb1d8c1566", + "size_in_bytes": 4185 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lib2to3/refactor.pyi", + "path_type": "hardlink", + "sha256": "be11a0b980c4e60c5d6d4c46fcb2b154f67d2a191baf20e3453fe12bb1526755", + "size_in_bytes": 3946 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/linecache.pyi", + "path_type": "hardlink", + "sha256": "1ca0f35093cac855c15dc78679ea18a4c8715c861aa50063f43d83c90ac9d91f", + "size_in_bytes": 852 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/locale.pyi", + "path_type": "hardlink", + "sha256": "7d062241ffb1afc774d859a811b30409a7cdbf8dc786ed3024af5f65a4fd9bcb", + "size_in_bytes": 4934 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/logging/__init__.pyi", + "path_type": "hardlink", + "sha256": "c9376456e8a6a752f5b340b99950a07e947deacc75148d190a77ccee2c3f1769", + "size_in_bytes": 21288 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/logging/config.pyi", + "path_type": "hardlink", + "sha256": "849c4dd8e89eab18a3f40de6ea362e34939895c72f789922ca7230864255bed0", + "size_in_bytes": 6323 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/logging/handlers.pyi", + "path_type": "hardlink", + "sha256": "fad13969022a7da1b7a0da93f0ef9bca6c8acf3314948f0314fb3c40db9e07c9", + "size_in_bytes": 9192 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/lzma.pyi", + "path_type": "hardlink", + "sha256": "8d6fe56496f0154dcbc875788ea0a6df67621b5424d46d3ed9c0c51e025525d9", + "size_in_bytes": 4926 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/mailbox.pyi", + "path_type": "hardlink", + "sha256": "039f6cabf8821759322b16618a851ebac66454b7d87d3c819e27f0be29d818ff", + "size_in_bytes": 10779 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/mailcap.pyi", + "path_type": "hardlink", + "sha256": "877c02ab2f520f60c0f3e681e64eef5b5ed28728652fe01957a8982a9453c8fe", + "size_in_bytes": 388 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/marshal.pyi", + "path_type": "hardlink", + "sha256": "2ea953403bcd48624648a363490f37da3fb7a2940591c69e315bb2dafe1158cd", + "size_in_bytes": 1605 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/math.pyi", + "path_type": "hardlink", + "sha256": "a41b36f2a7490aba9ff466d4167669584dd24500e39e7a1b46dd73ddf5cd312f", + "size_in_bytes": 6156 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/mimetypes.pyi", + "path_type": "hardlink", + "sha256": "c56e5f31d5cba96676f16db890e5d1bca24504bb41d03c3fc46aef85ae2723bc", + "size_in_bytes": 2128 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/mmap.pyi", + "path_type": "hardlink", + "sha256": "3b95367adbc161d603ab56a0837887db9f3b8cc410919e02c0b58c2bbd6dd646", + "size_in_bytes": 5692 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/modulefinder.pyi", + "path_type": "hardlink", + "sha256": "21b81076494c5a3f88f8364be1c788e4ace7899d5c36ec1d04f2c4e599c3d769", + "size_in_bytes": 3399 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/msilib/__init__.pyi", + "path_type": "hardlink", + "sha256": "00cb806a8444fdeaf322ca9acc13a7e775159764acf30228157fb382bfd83f64", + "size_in_bytes": 5854 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/msilib/schema.pyi", + "path_type": "hardlink", + "sha256": "d95edcc6c4ab7972abdd49c1415220a541158d74b581b046517b2082315496d3", + "size_in_bytes": 2173 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/msilib/sequence.pyi", + "path_type": "hardlink", + "sha256": "e8c964994b649c7c90539df92cffcf3d7198e7f402c49a3dd74fbe5df1342b03", + "size_in_bytes": 429 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/msilib/text.pyi", + "path_type": "hardlink", + "sha256": "d48e7ccaa880a40ee18c577386b86cc3a0fc5a555f1fc249b41d5be0d90c34bf", + "size_in_bytes": 216 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/msvcrt.pyi", + "path_type": "hardlink", + "sha256": "b564fc1f1d0e832d85c2ffc6b777558ee6f489bb4c7172d8a2218f2c6888e0c4", + "size_in_bytes": 1196 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/__init__.pyi", + "path_type": "hardlink", + "sha256": "29a7e41078ad5763665c7252f79e916b072831985757afe667e8a8d19a4c4afe", + "size_in_bytes": 3132 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/connection.pyi", + "path_type": "hardlink", + "sha256": "407c544a679379d3a65655e4fcd9fdaef96cd2ba7264bdd7312ba37d8b823ed5", + "size_in_bytes": 3723 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/context.pyi", + "path_type": "hardlink", + "sha256": "14216e3b795fb8c4b339e62e049649dcad7e3eb4bdc8de46acf339f62da2b167", + "size_in_bytes": 8578 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/dummy/__init__.pyi", + "path_type": "hardlink", + "sha256": "471b439b4a9802bbafc6918efa28e394ffce50d79a4de134bec6fb9a5c5b2ac7", + "size_in_bytes": 2353 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/dummy/connection.pyi", + "path_type": "hardlink", + "sha256": "58db2befc1de1f3ebb546d78a8badceb152414d4242add7c8f0f796a68450508", + "size_in_bytes": 1282 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/forkserver.pyi", + "path_type": "hardlink", + "sha256": "143cd458b5518d4b320eb393d61ee6bd90ff2486c67f898f9cae8e10ddd6c183", + "size_in_bytes": 1873 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/heap.pyi", + "path_type": "hardlink", + "sha256": "1d3238565a87bd9060820efbe43f03b069240c24cbb1d6b8cdb46a1ef18278bd", + "size_in_bytes": 1084 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/managers.pyi", + "path_type": "hardlink", + "sha256": "51a3800868b339ac390d588d3ca274bfd6b1bd8ac2429603d0a29865e0d576fd", + "size_in_bytes": 17215 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/pool.pyi", + "path_type": "hardlink", + "sha256": "b334f08b850d310677ee9482dcc310b874c3b3830bb3c02310e18ce6bf700c6d", + "size_in_bytes": 3938 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/popen_fork.pyi", + "path_type": "hardlink", + "sha256": "44768913fe3b39e4329269d78f1793e7643b165c739c555a9274ad43164994ff", + "size_in_bytes": 810 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/popen_forkserver.pyi", + "path_type": "hardlink", + "sha256": "f9ff39d5c1d011b33f2fda176b0e8fad41c8e9b28055ab11475ece8ab39277ad", + "size_in_bytes": 353 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/popen_spawn_posix.pyi", + "path_type": "hardlink", + "sha256": "92e299989c70e2277c4797534e9f81ec4fb9a8359349ec403a40aa4ad10ca0aa", + "size_in_bytes": 524 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/popen_spawn_win32.pyi", + "path_type": "hardlink", + "sha256": "6725dd3c5db2e30bdc82f7a258ea2ebfd63d3fd827867ec3e175e90fd585e3a4", + "size_in_bytes": 773 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/process.pyi", + "path_type": "hardlink", + "sha256": "936671b7f1648e4446ef014694684aebe5835e00c84de17ca48a656dac6b4439", + "size_in_bytes": 1266 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/queues.pyi", + "path_type": "hardlink", + "sha256": "d551a8c32335b3554325e9c72bbeab7657997c3180b9b8a2736a71efd1aa723c", + "size_in_bytes": 1949 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/reduction.pyi", + "path_type": "hardlink", + "sha256": "cbf230f00dd395ae31048db7dcafbecec7b21be4ac5f2556ca32c3d86bea8a0c", + "size_in_bytes": 3270 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/resource_sharer.pyi", + "path_type": "hardlink", + "sha256": "77d3a3884e4be1a0b7faedbe582edcb00ac2b64aacfc830e8613953048ba5236", + "size_in_bytes": 420 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/resource_tracker.pyi", + "path_type": "hardlink", + "sha256": "cc66042e81ed6c004edfb935056977fcb8125c79c58819c8523d5f72213c25bf", + "size_in_bytes": 695 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/shared_memory.pyi", + "path_type": "hardlink", + "sha256": "2518a69c11d6b3f4f01bde9a4e1d859ee54819cf60b548e27917b865825e1520", + "size_in_bytes": 1500 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/sharedctypes.pyi", + "path_type": "hardlink", + "sha256": "fecad132e16eed0831fd3f290b12679a2a03825606416a0cb08ca17783853899", + "size_in_bytes": 5254 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/spawn.pyi", + "path_type": "hardlink", + "sha256": "a32f0564bb5c6b6666675397cef53e9051922e2a1e0a08413b589aa8bc1fcbc7", + "size_in_bytes": 904 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/synchronize.pyi", + "path_type": "hardlink", + "sha256": "cb195d1b39ac99f486194604a9a95c51401829bd14d091cab9a0139bcec98a01", + "size_in_bytes": 2525 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/multiprocessing/util.pyi", + "path_type": "hardlink", + "sha256": "d47edcd5aa954ba0692d707b302987c54a79dec7a2b83dcee0c70c9365dbab95", + "size_in_bytes": 3090 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/netrc.pyi", + "path_type": "hardlink", + "sha256": "b6f7eb170f6ea8dcede97b7f7c95656c5dae5c8a09cbb6171003b3bde07c004a", + "size_in_bytes": 745 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/nis.pyi", + "path_type": "hardlink", + "sha256": "8e72a1d978f79aba0e4e96699be0bb0583d57b9335f1400855e87ae80146cb0d", + "size_in_bytes": 293 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/nntplib.pyi", + "path_type": "hardlink", + "sha256": "1581649d0df7ba4bbbb37bc416b20fc47944540d0a63cdbe6bb2fae8480f08ad", + "size_in_bytes": 4279 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/nt.pyi", + "path_type": "hardlink", + "sha256": "14d21170b4a84eb7110c0d8d218ac7880084af7af75a09320f03614ae8ce96c7", + "size_in_bytes": 3407 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/ntpath.pyi", + "path_type": "hardlink", + "sha256": "73f599e8f835826a324f18d95795f51dab180bbce7ad4ffd598e7f8580e0e4de", + "size_in_bytes": 3049 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/nturl2path.pyi", + "path_type": "hardlink", + "sha256": "31e5a715396a86faba9b642c9d80da5ffa0689481aeacc08edb9ff4633fa7a91", + "size_in_bytes": 412 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/numbers.pyi", + "path_type": "hardlink", + "sha256": "26187716322701c63beae2c7af4692e336c7395cb27630d1d2c1af0fc75d9cad", + "size_in_bytes": 7546 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/opcode.pyi", + "path_type": "hardlink", + "sha256": "3980f4fbe6d859af9e665d8814a0616f023f9d5b33d679a033d9d6cf22097ba9", + "size_in_bytes": 1119 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/operator.pyi", + "path_type": "hardlink", + "sha256": "ee5df511f6c208c0ccc0b595367eccec982dd96617d88cde9c3c6d0279208eff", + "size_in_bytes": 4927 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/optparse.pyi", + "path_type": "hardlink", + "sha256": "6e9c78593bd8f9cf264648e21771608cfcd4e13e1aa05e73953b4bcdfd8cc125", + "size_in_bytes": 13191 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/os/__init__.pyi", + "path_type": "hardlink", + "sha256": "aed583feac26732418f28fa80382bba0eb3a430dd0ad8386895fc66e1c9b5ebf", + "size_in_bytes": 57934 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/os/path.pyi", + "path_type": "hardlink", + "sha256": "1bbead25bbe51b5fe4cc577c8270aa4b8321b7780fce50b58a1201ab3babc433", + "size_in_bytes": 186 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/ossaudiodev.pyi", + "path_type": "hardlink", + "sha256": "9a31c5776cbc06b75e4e83700c8517dd826d447060b3dbda1a8df6b103fdb8f2", + "size_in_bytes": 4409 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/parser.pyi", + "path_type": "hardlink", + "sha256": "a84493be9088125d3a30994539e1adea955382a0efaf020d8f71da8ff836e831", + "size_in_bytes": 1100 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/pathlib/__init__.pyi", + "path_type": "hardlink", + "sha256": "1ab6660a75d64125d595a06e236e19457c135cc9cc374242c809adaee8dfab05", + "size_in_bytes": 14683 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/pathlib/types.pyi", + "path_type": "hardlink", + "sha256": "ccd8fcf4a200a24edf74df0bbe6f2e8e052744a4b99d9149b08892a27e4b1086", + "size_in_bytes": 333 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/pdb.pyi", + "path_type": "hardlink", + "sha256": "85d4ff1581eb5f8dd24ea311822901efdf99e4c4f6e7e21f3a3cd83834e80bb4", + "size_in_bytes": 11118 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/pickle.pyi", + "path_type": "hardlink", + "sha256": "0b07d1067c231d12a02edbd96b17d0ec95b581139e4cceec86d2c27ea23a82a3", + "size_in_bytes": 5306 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/pickletools.pyi", + "path_type": "hardlink", + "sha256": "02f970d8fca0aac68c8f8cdcc7e6f68d65f330515bcfde8d0bcda379f798b183", + "size_in_bytes": 4232 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/pipes.pyi", + "path_type": "hardlink", + "sha256": "16f135193039614f891c120efa608021fac00112fb8360a4d079a027beb980d7", + "size_in_bytes": 502 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/pkgutil.pyi", + "path_type": "hardlink", + "sha256": "029b07a2e693db55e709d5e25b85951bf724e5e0efdafaadf11592db3a679462", + "size_in_bytes": 2591 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/platform.pyi", + "path_type": "hardlink", + "sha256": "f988cf56e88225634bf16e1dd52e9c79c96bf2f5be2f4e22fbed7ef8daa8b0bb", + "size_in_bytes": 4109 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/plistlib.pyi", + "path_type": "hardlink", + "sha256": "61237614b721e8bec1109acd47e2e964f94d650cbaa815814189b087e73b2386", + "size_in_bytes": 2746 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/poplib.pyi", + "path_type": "hardlink", + "sha256": "6be32142b087bcabef2c00ab19a94718ce0e4cdedd325f142490dc8cd2e3898a", + "size_in_bytes": 3122 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/posix.pyi", + "path_type": "hardlink", + "sha256": "83029efa0be0ebe40e791088229319998866a42c9bc4619e879e09eaa4b6df62", + "size_in_bytes": 14052 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/posixpath.pyi", + "path_type": "hardlink", + "sha256": "74922494df13c4f367ff963e0922fac392372049f98105c605796373f09d84fb", + "size_in_bytes": 4744 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/pprint.pyi", + "path_type": "hardlink", + "sha256": "75995881af36bb4626b0ffcafd5e8834892a4dd661b2412c141a7bf65e50ae59", + "size_in_bytes": 4835 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/profile.pyi", + "path_type": "hardlink", + "sha256": "544348ebf5c1d49718d7c2a7ddb6364a6d3679f06e085306fdb7a22e5a593906", + "size_in_bytes": 1416 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/pstats.pyi", + "path_type": "hardlink", + "sha256": "70aa804f61dfec308ec7d6f940a1566526757a74bbd14743707556583dd200af", + "size_in_bytes": 3074 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/pty.pyi", + "path_type": "hardlink", + "sha256": "0349aac469cc8b99aa2b015e0db911502e1b0db81ad17f53a2f0837db30b66df", + "size_in_bytes": 1072 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/pwd.pyi", + "path_type": "hardlink", + "sha256": "ad703d8d7b54389790e43d3a76fe42f2dc10c6b39ab6a990ae583549915fc545", + "size_in_bytes": 905 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/py_compile.pyi", + "path_type": "hardlink", + "sha256": "a519692b8e07f7c0fdb671c68b90b478380e5faf1d93ff364a2cc2eefa169c7e", + "size_in_bytes": 894 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/pyclbr.pyi", + "path_type": "hardlink", + "sha256": "c59d8f387ac9653ef17bb79ab9e3bac31760a4516475fd4178f745d0fb926ea7", + "size_in_bytes": 2284 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/pydoc.pyi", + "path_type": "hardlink", + "sha256": "1ae0392cc955bf2b1ea91e54190513d092144a2e9715c39537e97b89bdba05f7", + "size_in_bytes": 14303 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/pydoc_data/__init__.pyi", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/pydoc_data/module_docs.pyi", + "path_type": "hardlink", + "sha256": "378d1e253062f25a178956fe4259a2a1b01a65061b0e4404b3558eeab51a724b", + "size_in_bytes": 61 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/pydoc_data/topics.pyi", + "path_type": "hardlink", + "sha256": "82a080635d3222345cac2084f21aa8515b39a39704d0d80e39fb7d5fec20dc01", + "size_in_bytes": 56 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/pyexpat/__init__.pyi", + "path_type": "hardlink", + "sha256": "b93f4f602c1ad6846bc4d91d9dd428236b71f4c59d71dbb0f25ddf6a4bbd4930", + "size_in_bytes": 3887 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/pyexpat/errors.pyi", + "path_type": "hardlink", + "sha256": "5c0e48934a1a8036124e695e68c405493aa471f30dff5c46c0fd7dbdaeb1787f", + "size_in_bytes": 2357 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/pyexpat/model.pyi", + "path_type": "hardlink", + "sha256": "58b60c7a2ca462753a829377e4322d8941234cf6f2fafbb40ca019e1a7c679f5", + "size_in_bytes": 291 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/queue.pyi", + "path_type": "hardlink", + "sha256": "fd9ab8a3cdb4421fe08802259d5ee19c0f4ec75c2cd1d463746c165453949851", + "size_in_bytes": 1910 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/quopri.pyi", + "path_type": "hardlink", + "sha256": "6be7723f6034c3fc509b70f6297219cc303df453d7d7929aab6f7b1894e72b5a", + "size_in_bytes": 669 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/random.pyi", + "path_type": "hardlink", + "sha256": "e2ff95419ebd019f31d2f18a2926bcd849c869ec89e7f33644de8a452405752d", + "size_in_bytes": 5214 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/re.pyi", + "path_type": "hardlink", + "sha256": "03712bfcc82cbe7017d93ed84cb0c6a48adcfdbcc8c69f4ffdc47bf538475a13", + "size_in_bytes": 12139 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/readline.pyi", + "path_type": "hardlink", + "sha256": "2681369db2b816ff942036e8ee5813a7fdfce76e210f1f24451a4be5086ea393", + "size_in_bytes": 1988 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/reprlib.pyi", + "path_type": "hardlink", + "sha256": "bac2ab52145c08d78e55d632dd2e88f278d13915c843dad7ac699ed34b8625de", + "size_in_bytes": 1986 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/resource.pyi", + "path_type": "hardlink", + "sha256": "380948c642ef2e47713969379e61bb921d063ef3d43e05371d5f30906c7c1647", + "size_in_bytes": 2972 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/rlcompleter.pyi", + "path_type": "hardlink", + "sha256": "16d4edd19d6c36b5b3e84302ca8c08440abcb7301e4e979eeab5152796fe4ecc", + "size_in_bytes": 322 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/runpy.pyi", + "path_type": "hardlink", + "sha256": "86b1edba191d53ebc96fb13ab6b5970fe213237dc03904ff1c7e4212c51155d4", + "size_in_bytes": 811 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/sched.pyi", + "path_type": "hardlink", + "sha256": "8884fa842d0dcf3e3b094066cd2a0195a99ec55f6ce4a443d3efaf5eeba62519", + "size_in_bytes": 1521 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/secrets.pyi", + "path_type": "hardlink", + "sha256": "22bc0d62c468f20905038164a8948f2b062a7008039c6720ae6dcfbba638631b", + "size_in_bytes": 660 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/select.pyi", + "path_type": "hardlink", + "sha256": "c4e86763c6c8660a94a555fec384715e03292a736c1824120e7a221d82cc2d67", + "size_in_bytes": 5805 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/selectors.pyi", + "path_type": "hardlink", + "sha256": "dab37ae88b59b61a9a3bd4826fa231f489a92df1a4767dbe85893d49ec511ade", + "size_in_bytes": 2927 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/shelve.pyi", + "path_type": "hardlink", + "sha256": "89701f8a264beb72183df51d212e20da931fc7ab61ab82ba36a43659f718e991", + "size_in_bytes": 2343 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/shlex.pyi", + "path_type": "hardlink", + "sha256": "08dabb441de3960483f25a595446f8d82a21de97de3a977ab63a775c2557a6d4", + "size_in_bytes": 2191 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/shutil.pyi", + "path_type": "hardlink", + "sha256": "4e3c15b1e47354d5b14207ab0e8101c2d39692be45e6763918c4cf7b2a2f35b5", + "size_in_bytes": 8362 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/signal.pyi", + "path_type": "hardlink", + "sha256": "603559ca3b9854a4d938aeccbdbd4b715c8c22a92a0dd7f219ffe244fb63103e", + "size_in_bytes": 6094 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/site.pyi", + "path_type": "hardlink", + "sha256": "94321a4455a826435e19f3ca6af72b32dbe26b86a400c58c4790480e50d8bf1d", + "size_in_bytes": 1547 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/smtpd.pyi", + "path_type": "hardlink", + "sha256": "fc31ec0cc906f224f8b836a5dbb51bd3e92cb040bbddb9dc63e03c7ff13f2041", + "size_in_bytes": 3082 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/smtplib.pyi", + "path_type": "hardlink", + "sha256": "3800c41c9e3029db2d6dc9275ad105c3f8da2743669b76875bcbfb9c83da2426", + "size_in_bytes": 7523 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/sndhdr.pyi", + "path_type": "hardlink", + "sha256": "e1ba1389659fda8dd55ba4212133fc24d11e3cfef7e00971c8c794d5c9fbe023", + "size_in_bytes": 353 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/socket.pyi", + "path_type": "hardlink", + "sha256": "de8132c8931e8db796b17adf14523e77f24498872982dd8fccb4139e7a24876c", + "size_in_bytes": 46182 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/socketserver.pyi", + "path_type": "hardlink", + "sha256": "80f378ed4d4a87b50f171baf2beca8bbc691c2f1dbb7382f3159edf710503350", + "size_in_bytes": 6991 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/spwd.pyi", + "path_type": "hardlink", + "sha256": "872650a745df346a4dd3972af2aa487a7c92dac526ebf1f7a1d3af4b2c5a70aa", + "size_in_bytes": 1299 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/sqlite3/__init__.pyi", + "path_type": "hardlink", + "sha256": "8134980bc6f7d078915c183ec8ec81e22c926f0a58e3695bdf281cf9639633d1", + "size_in_bytes": 22071 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/sqlite3/dbapi2.pyi", + "path_type": "hardlink", + "sha256": "e7f6ae3eb6d85062dde818ab47bc660c552bfc86dd9bb65301e67799e5392844", + "size_in_bytes": 11438 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/sqlite3/dump.pyi", + "path_type": "hardlink", + "sha256": "90aad0d82a33806f06a085cc0cc362309cfffc1eedcd9d1541bda3ce41faa798", + "size_in_bytes": 90 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/sre_compile.pyi", + "path_type": "hardlink", + "sha256": "5945a7426698301e5707a1fd8ba54053ea55aea29bf45a9e2989de3bdf5019a9", + "size_in_bytes": 401 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/sre_constants.pyi", + "path_type": "hardlink", + "sha256": "5d3cfcfd57841005c94a731d52f89020dacb30e5dc9676896f32a27cdff38ee5", + "size_in_bytes": 4781 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/sre_parse.pyi", + "path_type": "hardlink", + "sha256": "02c0524bcdf910fa46c61a4a968f027b667fb7f730381ec23702a6478f783a7d", + "size_in_bytes": 3906 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/ssl.pyi", + "path_type": "hardlink", + "sha256": "951cbd9ba7a4518bbf091c3f4b64a046f74e5ced67a194764fdb559de063ccf4", + "size_in_bytes": 22938 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/stat.pyi", + "path_type": "hardlink", + "sha256": "61b51b9876731a589e56728aeeebc08d1c2fefce0b8e29e6396b279aed391493", + "size_in_bytes": 3354 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/statistics.pyi", + "path_type": "hardlink", + "sha256": "6f8d22e0a76c43c362288e85e0116a030b8e52c4ce74fa72de67651b3ad3e8ba", + "size_in_bytes": 5916 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/string/__init__.pyi", + "path_type": "hardlink", + "sha256": "69122a7fea998b899cfcdeeedc70002cc5a95edb63538f00e9ad1b71b3cbba86", + "size_in_bytes": 3095 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/string/templatelib.pyi", + "path_type": "hardlink", + "sha256": "6f69704cf56e8e792936b98721fc1ed5ccff34585424fa5a33951b2cf588033b", + "size_in_bytes": 1324 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/stringprep.pyi", + "path_type": "hardlink", + "sha256": "e7797eed2bb38d27579c209be651d8487c4d5903415cb4336cbf035f8bac5d8b", + "size_in_bytes": 985 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/struct.pyi", + "path_type": "hardlink", + "sha256": "ef18c36d7f928750bf134ac567e6740e7c05e8fdbbbf4f3c78c334de42f64768", + "size_in_bytes": 155 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/subprocess.pyi", + "path_type": "hardlink", + "sha256": "072b25fdc9a996ddfd1e883cc6512abb08982b615cea1e63e644a19dd02a8f54", + "size_in_bytes": 73103 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/sunau.pyi", + "path_type": "hardlink", + "sha256": "a93bcb6da9b55209aa1fd1ebd262e02056778d0ab14af05c7883aae50727c0c5", + "size_in_bytes": 2991 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/symbol.pyi", + "path_type": "hardlink", + "sha256": "00346437fae1455fdfa02624b5bd0d1d1ee39bb87f3785ce1e8f553d61759453", + "size_in_bytes": 2144 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/symtable.pyi", + "path_type": "hardlink", + "sha256": "722b1a9013611545ea8f8a956390cf5476210909def445c6d31bcf14c658d122", + "size_in_bytes": 3095 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/sys/__init__.pyi", + "path_type": "hardlink", + "sha256": "3987b6f090625b9609340a6a4950bf2dc088e0a270d15109da3800df29f10fa7", + "size_in_bytes": 17286 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/sys/_monitoring.pyi", + "path_type": "hardlink", + "sha256": "4359bb3e2102630e86b0132b89802957866e356c331b66b3f2c5b7269b46af23", + "size_in_bytes": 2116 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/sysconfig.pyi", + "path_type": "hardlink", + "sha256": "972649c48945598277f15fc6973247e5966984a7751bcf5a74d97eaf259d3334", + "size_in_bytes": 2075 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/syslog.pyi", + "path_type": "hardlink", + "sha256": "8bbea587f7a181d5362d4edf27deb81c35e20d72fae3f05201d47517b8feae18", + "size_in_bytes": 1597 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/tabnanny.pyi", + "path_type": "hardlink", + "sha256": "a811d6f4c638e14f76c4a7456d882b497963825395b406341984dae35047c1b1", + "size_in_bytes": 514 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/tarfile.pyi", + "path_type": "hardlink", + "sha256": "0723f1bc92d9a1684fd36e49ab4df52e00e1c20514cfc5a1148cd3a36e19a65d", + "size_in_bytes": 29540 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/telnetlib.pyi", + "path_type": "hardlink", + "sha256": "4a1d0ce5c24223a5a272e1008430ac0d76317a362c31c64c70bb2ed25a347626", + "size_in_bytes": 3640 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/tempfile.pyi", + "path_type": "hardlink", + "sha256": "71bc37c58b39c20eab6e5d18bda01fbd3ce49f7a0fb0ea5b1e55a9d5fd201c8a", + "size_in_bytes": 16591 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/termios.pyi", + "path_type": "hardlink", + "sha256": "cfe750e0fcf57bb201055290c781ab68d8cdac70b8388f2f019538f8560ce136", + "size_in_bytes": 8171 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/textwrap.pyi", + "path_type": "hardlink", + "sha256": "e9e1065949260d153ff9f03e68e2165ac7bdfb5188abc4fcf52e1569ff5a27b6", + "size_in_bytes": 3233 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/this.pyi", + "path_type": "hardlink", + "sha256": "a9e8b0022a9b3caf2211c1f85befa350cfe272485914d9f1f1c12f4ea54fbc26", + "size_in_bytes": 25 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/threading.pyi", + "path_type": "hardlink", + "sha256": "5bcf5ed1efdb74078951f03f30d14af88093de3e51beafce6fbfb0aa1dc19416", + "size_in_bytes": 6878 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/time.pyi", + "path_type": "hardlink", + "sha256": "3607759857e41b3639c8f9390be5d6782a1316db455e9a6d8291a2cb2e3215af", + "size_in_bytes": 4317 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/timeit.pyi", + "path_type": "hardlink", + "sha256": "6c5f86a74d28de5d7f71c03512f4286ae009d6564e2e1abc4ce3761b9f94841a", + "size_in_bytes": 1344 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/tkinter/__init__.pyi", + "path_type": "hardlink", + "sha256": "68645ddcf7be075566a26237f15f7fd0613fbe1bfbb806c4da7bf64b015868c0", + "size_in_bytes": 163233 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/tkinter/colorchooser.pyi", + "path_type": "hardlink", + "sha256": "5a281845322cdbba32bb0ccfc21be775bdf3f0392e2ee66781dd8cb0a3370cd0", + "size_in_bytes": 360 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/tkinter/commondialog.pyi", + "path_type": "hardlink", + "sha256": "8c9466ca374ec53a2eba316f4b662d3a0d2a8759e02b21d028f734767a2e9a1c", + "size_in_bytes": 468 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/tkinter/constants.pyi", + "path_type": "hardlink", + "sha256": "b0ff613994a7bc1213a894429a98a018326ac0fff51a8380399d9e407d1b9646", + "size_in_bytes": 1853 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/tkinter/dialog.pyi", + "path_type": "hardlink", + "sha256": "a04576985695a7411293ff271493ae286957586e2ee4c01855c44b79d8e86629", + "size_in_bytes": 324 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/tkinter/dnd.pyi", + "path_type": "hardlink", + "sha256": "865b70d7e8ad1daa4e827aa50607263a0cd5d5718c96ee8212c1e3c30b6a1581", + "size_in_bytes": 774 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/tkinter/filedialog.pyi", + "path_type": "hardlink", + "sha256": "d53516516a54b5837b68f0ccec03473c40c85bdb50a137e66349bdac9869748d", + "size_in_bytes": 5176 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/tkinter/font.pyi", + "path_type": "hardlink", + "sha256": "ada53f4c78c7c832fa03ad55506c8147546da23c96b90861800ad8a90dc4fa1c", + "size_in_bytes": 4606 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/tkinter/messagebox.pyi", + "path_type": "hardlink", + "sha256": "bbfb3e0524fefb07acfa1f03d5dd6e4928fef6cf92ea145f2587306521cbf418", + "size_in_bytes": 2742 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/tkinter/scrolledtext.pyi", + "path_type": "hardlink", + "sha256": "1e9fcb9457f05704775b888364ab61ade194a1f3db21b88e9239753be1c42fda", + "size_in_bytes": 302 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/tkinter/simpledialog.pyi", + "path_type": "hardlink", + "sha256": "659c58293eee350eedd4527846a9575f9042260f5972cf777b7b8546ab7e6d25", + "size_in_bytes": 1596 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/tkinter/tix.pyi", + "path_type": "hardlink", + "sha256": "736393424a46699b485004645f576b183845c1d97d7df979d993621af92ddfd6", + "size_in_bytes": 14375 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/tkinter/ttk.pyi", + "path_type": "hardlink", + "sha256": "964a2c1d4939ce1ac969becdbdd674d2a0973fb7776af360e1a5f35f92c6911b", + "size_in_bytes": 54053 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/token.pyi", + "path_type": "hardlink", + "sha256": "e39bbc8f63ea15f72149ffbd30f712f84a7b9cbfc429bd6349a9516b5aabdcca", + "size_in_bytes": 3343 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/tokenize.pyi", + "path_type": "hardlink", + "sha256": "a41d22bbf4582b07a7e7f66d0d6fbe47b68a8b01fc269add4d0b09cca4420066", + "size_in_bytes": 5445 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/tomllib.pyi", + "path_type": "hardlink", + "sha256": "bf85d6a4ae9799c5d443c477b504a6401c2d6ceb81b2c3346796438e161521c3", + "size_in_bytes": 937 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/trace.pyi", + "path_type": "hardlink", + "sha256": "7304690ad2a1b00d08756ecef0e810277974de4fbb7fb130ad84e3de3430ae4a", + "size_in_bytes": 3605 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/traceback.pyi", + "path_type": "hardlink", + "sha256": "312998aa2924e5a106bd78f16442fef56b50dfbf259a0986b91a5f8b2af27fd9", + "size_in_bytes": 11677 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/tracemalloc.pyi", + "path_type": "hardlink", + "sha256": "89f01ab6002fb0a66ad81e0905209c761807cb8776d8521550c13234edec3782", + "size_in_bytes": 4581 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/tty.pyi", + "path_type": "hardlink", + "sha256": "7f0c53c9c65eea718be4305d5c686209c800d32025a85f615c850a1e60e44d64", + "size_in_bytes": 871 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/turtle.pyi", + "path_type": "hardlink", + "sha256": "a22c59b520307ace37b6e6df269de8005e5b99535e6d922105184dbdad72fed7", + "size_in_bytes": 25277 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/types.pyi", + "path_type": "hardlink", + "sha256": "79ec367ef8a991313c466a93c77a767091a213c03652d8176937af168efea10d", + "size_in_bytes": 26443 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/typing.pyi", + "path_type": "hardlink", + "sha256": "0334ef565b550eb114b8766ed815d2e5e2ca867c3a41736e41719e3bdec8c6dd", + "size_in_bytes": 42646 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/typing_extensions.pyi", + "path_type": "hardlink", + "sha256": "3ace10169e6b363a9af60b7ab627ae634c49ab9d63a078c5f3aa2119ae8e9541", + "size_in_bytes": 23359 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/unicodedata.pyi", + "path_type": "hardlink", + "sha256": "51d78751d2eb2a554c599d5bb6d4bc9e9516b4f7290e3b773f34b7cb7e920190", + "size_in_bytes": 2589 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/unittest/__init__.pyi", + "path_type": "hardlink", + "sha256": "01195ae1c1bd1399d67bb85117367cda41f5d20fdac331a9e79958d7a214eb10", + "size_in_bytes": 1848 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/unittest/_log.pyi", + "path_type": "hardlink", + "sha256": "4279922a8152fc3d5b7112ea140bdf2629d79f6fb4f838f2052a87ffddafaf88", + "size_in_bytes": 912 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/unittest/async_case.pyi", + "path_type": "hardlink", + "sha256": "a3040bb8bc07c56098e940efd7023a7950c6522f7138a93997f216542bc6a572", + "size_in_bytes": 850 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/unittest/case.pyi", + "path_type": "hardlink", + "sha256": "7ee54b60987ab399ec1a649686258c584952b0e937c05735c25e1ed93e619350", + "size_in_bytes": 14468 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/unittest/loader.pyi", + "path_type": "hardlink", + "sha256": "b6bfa5477347ba5ed0682eb593e30f5099e7e5145fa846d9657ae2dea527c5eb", + "size_in_bytes": 3332 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/unittest/main.pyi", + "path_type": "hardlink", + "sha256": "addd8b0d0e78abf8086a656561f2c14fded213af886129271e012909c9f55ddc", + "size_in_bytes": 2767 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/unittest/mock.pyi", + "path_type": "hardlink", + "sha256": "5adf1a8a35ce4413d7ecfcaf55c797e89bb21ff25e7f4a89f22f106a8175ba78", + "size_in_bytes": 20327 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/unittest/result.pyi", + "path_type": "hardlink", + "sha256": "1d7e435ea41a21e9ed542885b9f661fad1e949f9625141838dbd57f2202793ff", + "size_in_bytes": 2050 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/unittest/runner.pyi", + "path_type": "hardlink", + "sha256": "90a05da675356a15ff524cb5b8be02f839e48252c2d5090b50bd44aba5dfb255", + "size_in_bytes": 3502 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/unittest/signals.pyi", + "path_type": "hardlink", + "sha256": "eabaac5475cebd23c74a4785fef60f7f9b1468b82aa854a6162864683a8f852c", + "size_in_bytes": 488 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/unittest/suite.pyi", + "path_type": "hardlink", + "sha256": "1614b7d01bcbe278b3de023901c9e9d935f8e3d08d3ecd9abc4504a86b75e26a", + "size_in_bytes": 1047 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/unittest/util.pyi", + "path_type": "hardlink", + "sha256": "a2be00f00f00f80cc8256b3eef839f866f93684776f73518ce59c8461c20f9d0", + "size_in_bytes": 1656 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/urllib/__init__.pyi", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/urllib/error.pyi", + "path_type": "hardlink", + "sha256": "52a52a72a6f3f053ed962c5a24fd06a7779c51ce8ca4f25a60e3f276419140de", + "size_in_bytes": 978 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/urllib/parse.pyi", + "path_type": "hardlink", + "sha256": "63bc495692891e887113a6cf89fb9be3cc173bc6c9030600d3c953b4d028bf33", + "size_in_bytes": 6544 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/urllib/request.pyi", + "path_type": "hardlink", + "sha256": "3d859ae7ea48b6dff2d8a5b10003b41e6c2a9578e92a4e7e6913624e4ff781cc", + "size_in_bytes": 20041 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/urllib/response.pyi", + "path_type": "hardlink", + "sha256": "1d39d6324915ba8c0ba0d76db99f7d4a97729b1e0d2dc253486f8175c22b9339", + "size_in_bytes": 2002 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/urllib/robotparser.pyi", + "path_type": "hardlink", + "sha256": "b00ee7a4d8f6ac1ddbfda14e857a86950361f86ee41a6c98699df0cfffcdf7aa", + "size_in_bytes": 683 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/uu.pyi", + "path_type": "hardlink", + "sha256": "c8cb7965101ea564ab6bea96b62d77dd91a26c2b6b25790c660e642897be31d3", + "size_in_bytes": 431 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/uuid.pyi", + "path_type": "hardlink", + "sha256": "6aa78c4960c343468a3a5f18f9c393edee4e99f4a0ca6a08e20123cb8ebbbfc9", + "size_in_bytes": 3109 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/venv/__init__.pyi", + "path_type": "hardlink", + "sha256": "18b585a4c1126911135dfa07ec85ecebb75a04099b246d1a21f0c7314e4dc76e", + "size_in_bytes": 2951 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/warnings.pyi", + "path_type": "hardlink", + "sha256": "033b41d206f0532960647d80f93ec50375ffb8e7945b0a630cb68324e7bd710d", + "size_in_bytes": 4238 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/wave.pyi", + "path_type": "hardlink", + "sha256": "6db6d6c8c6b76a0e3be6cbd2926ea27412d7e9c39d37ad0820d929f89499870c", + "size_in_bytes": 3492 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/weakref.pyi", + "path_type": "hardlink", + "sha256": "89cd0605ed8492f1dbb175d2829c826390b1df7f6c32fdb501e8d9b0eaef357b", + "size_in_bytes": 8475 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/webbrowser.pyi", + "path_type": "hardlink", + "sha256": "09446f4e3ce73f64efb3cb13f3f84502c10a3815c6b2bd88607922d367d20661", + "size_in_bytes": 3040 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/winreg.pyi", + "path_type": "hardlink", + "sha256": "22ef132b194b2046983fc589b934bb45930081c29454e86a9efd76dc1b144bb3", + "size_in_bytes": 5567 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/winsound.pyi", + "path_type": "hardlink", + "sha256": "238a2035ebf14d6ab022a35121e839597bdc9bf6900c0c88e95297a8c1b5df1c", + "size_in_bytes": 1259 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/wsgiref/__init__.pyi", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/wsgiref/handlers.pyi", + "path_type": "hardlink", + "sha256": "778a8c27764d2cd0270e4d48ffffe5f272142bdbb10e897e6d7b23b5cf41b17d", + "size_in_bytes": 3068 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/wsgiref/headers.pyi", + "path_type": "hardlink", + "sha256": "8705ef28c4101db8e671db2f159809dcb78874d2dc9915037fb22b4fde19082a", + "size_in_bytes": 1050 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/wsgiref/simple_server.pyi", + "path_type": "hardlink", + "sha256": "086a6a25a15395aa3afa19e4cc2a87bf8b0770341fa41193d2c22e78be6384c4", + "size_in_bytes": 1426 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/wsgiref/types.pyi", + "path_type": "hardlink", + "sha256": "f3d3524a0a439ee396302b81a6b536d7416c9e7321dd5e933e64f6ea67756987", + "size_in_bytes": 1264 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/wsgiref/util.pyi", + "path_type": "hardlink", + "sha256": "371aab7c027b24174fe01b96b3dd31c9f75209f9f2c125d88bcd2e09746ddb54", + "size_in_bytes": 1060 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/wsgiref/validate.pyi", + "path_type": "hardlink", + "sha256": "342a5b44f3fd7d3b76d697863655cb81e82ae94d7265a780c453be4947c19678", + "size_in_bytes": 1737 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xdrlib.pyi", + "path_type": "hardlink", + "sha256": "c312551c27cee6b8eedbd8a1045f7a5e02b7763e5bf8b6ec5467a8b46829d799", + "size_in_bytes": 2368 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xml/__init__.pyi", + "path_type": "hardlink", + "sha256": "9ba6fb3ad09f93855f4e4b7080ca2fadc5328e1095d3aef58c092d48931b7701", + "size_in_bytes": 249 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xml/dom/NodeFilter.pyi", + "path_type": "hardlink", + "sha256": "5bc87da3c269d42b3153b3b7722bbee867a561ea0942856ecbc8de52ceb1448b", + "size_in_bytes": 735 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xml/dom/__init__.pyi", + "path_type": "hardlink", + "sha256": "e0ffb0cc250a5129326d526279096622ddf7f0ec2974ed10fe45279430d9e057", + "size_in_bytes": 2548 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xml/dom/domreg.pyi", + "path_type": "hardlink", + "sha256": "2cd460225efc3b4787de6ec4e4616a1b404a434252b07c53067c2be4ace766f2", + "size_in_bytes": 418 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xml/dom/expatbuilder.pyi", + "path_type": "hardlink", + "sha256": "0a5a62999e68b6310448e7ae9c0013d4aa0cf5dd85bdb749edaf3008ea96a301", + "size_in_bytes": 6487 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xml/dom/minicompat.pyi", + "path_type": "hardlink", + "sha256": "220cb028b5ad2866979cd039673b0077e56c5d4280823548ce33d00a99255057", + "size_in_bytes": 716 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xml/dom/minidom.pyi", + "path_type": "hardlink", + "sha256": "af1a85ecf6ac65a047eafba00f1c7f8d1ee9124c614e4588c9495a57a5bb886b", + "size_in_bytes": 28674 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xml/dom/pulldom.pyi", + "path_type": "hardlink", + "sha256": "9e5141d0b6e3d24cd5eff174b5e553313ca4677cbff9998f43874bd9c304587b", + "size_in_bytes": 4844 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xml/dom/xmlbuilder.pyi", + "path_type": "hardlink", + "sha256": "a902b7e4ccc4fd813684db7dd008501398ead237766e75532e218a3b41ad1209", + "size_in_bytes": 2952 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xml/etree/ElementInclude.pyi", + "path_type": "hardlink", + "sha256": "f06fed0df5ebbce1a6f60dcb4d520a9c7f097c1d59cc919c51f553380e0df966", + "size_in_bytes": 1176 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xml/etree/ElementPath.pyi", + "path_type": "hardlink", + "sha256": "4e266b10f4089e6df932220c5abf7807bee27ed39798130dbccd56c62c0a2d87", + "size_in_bytes": 2035 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xml/etree/ElementTree.pyi", + "path_type": "hardlink", + "sha256": "3560383bca148d77f365f6dd125dc9e0132bfbd2e6496996c7e7855b9425556a", + "size_in_bytes": 15176 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xml/etree/__init__.pyi", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xml/etree/cElementTree.pyi", + "path_type": "hardlink", + "sha256": "89847b79ba5d07783dcdf06f2029d5d55cef424b4cc9af8387a957e02f6ee14a", + "size_in_bytes": 36 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xml/parsers/__init__.pyi", + "path_type": "hardlink", + "sha256": "3d2ef997317a085ba8ff174ef37ccaf88390ae7a0943716452831238c7705893", + "size_in_bytes": 39 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xml/parsers/expat/__init__.pyi", + "path_type": "hardlink", + "sha256": "f299b7cf785e304c74f40f385233d5430de56fd707e97f942bceac903b1f11f9", + "size_in_bytes": 189 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xml/parsers/expat/errors.pyi", + "path_type": "hardlink", + "sha256": "987f58459b95e2abb392c0cc2c49b18a2b0016036130e865f29d3b673952d971", + "size_in_bytes": 29 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xml/parsers/expat/model.pyi", + "path_type": "hardlink", + "sha256": "33b19575df80c4e87aa06c3acdf38d1004cb32cc402185b6cbd9113979e7f998", + "size_in_bytes": 28 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xml/sax/__init__.pyi", + "path_type": "hardlink", + "sha256": "ed3537133f118ea474e35c6fa46cba78405a8f2b693b65bc0bb2fb03154ec01f", + "size_in_bytes": 1616 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xml/sax/_exceptions.pyi", + "path_type": "hardlink", + "sha256": "438d4b36de0045d0ece729c120018ff986a98d4d3c9b929a876643f77f5f3bd7", + "size_in_bytes": 804 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xml/sax/expatreader.pyi", + "path_type": "hardlink", + "sha256": "0fbee0c766422e8e0e235d645e2287507c2277102feb551f3d423993726a1558", + "size_in_bytes": 3800 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xml/sax/handler.pyi", + "path_type": "hardlink", + "sha256": "ad87d2837481368bba729a0eeec07070fe93fa41c29640b0ce3d100d95b9ed9c", + "size_in_bytes": 4528 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xml/sax/saxutils.pyi", + "path_type": "hardlink", + "sha256": "8fec883c0084fb2be39d2b4082ec5a47f1cb7c937f1eaf0a38b55df03046273a", + "size_in_bytes": 3804 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xml/sax/xmlreader.pyi", + "path_type": "hardlink", + "sha256": "7063fe8b63b347d6d44ae65cb798a303c6e3594029c5d3d5a29b89e327ab0e55", + "size_in_bytes": 4348 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xmlrpc/__init__.pyi", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xmlrpc/client.pyi", + "path_type": "hardlink", + "sha256": "74837c26a9183bbd77a1921d52374f75dc1ef3e33535aeefe78778cd147415d4", + "size_in_bytes": 12035 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xmlrpc/server.pyi", + "path_type": "hardlink", + "sha256": "385dafff55c08d162d6cc2dbfda90726b91750a1d7dbb71fce6ad7eec7e09bb1", + "size_in_bytes": 6231 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/xxlimited.pyi", + "path_type": "hardlink", + "sha256": "4825a75fc6cc2f42a4cbdb566fcb0c4120ab69f7bb823ed903fc6196d93d2e29", + "size_in_bytes": 491 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/zipapp.pyi", + "path_type": "hardlink", + "sha256": "80e90585c75f1a9cba3c86e85dee39c0e0ccc3ef7862d0b5ca95130b10714df5", + "size_in_bytes": 553 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/zipfile/__init__.pyi", + "path_type": "hardlink", + "sha256": "d1b21087a24fd14a9b04585c1613fa325a64570558574eb2784520b81c994fd0", + "size_in_bytes": 12968 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/zipfile/_path/__init__.pyi", + "path_type": "hardlink", + "sha256": "5742941f86b0340bc3e2b30d55d84cc869e7b56751f2e7690d7329f609012ab6", + "size_in_bytes": 3074 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/zipfile/_path/glob.pyi", + "path_type": "hardlink", + "sha256": "ef0ffced5311c725752a747b59a5e4b59b4f6e2d194bc89b77dc34aac2f192c7", + "size_in_bytes": 943 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/zipimport.pyi", + "path_type": "hardlink", + "sha256": "48cf71aa5f9cad4a2be1a3fb7c579f16f1884f17f432940f57774d7d3bfd8550", + "size_in_bytes": 2677 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/zlib.pyi", + "path_type": "hardlink", + "sha256": "0c8a066a42656f7a4e19efda01b49f3e92df689ab51e174108bd456c48a3a9c1", + "size_in_bytes": 2395 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/zoneinfo/__init__.pyi", + "path_type": "hardlink", + "sha256": "a8cfef82a4844cb44bec3e83e6ea429e6c1b9c4fcf93ff7a8b44439c78d6612f", + "size_in_bytes": 1326 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/zoneinfo/_common.pyi", + "path_type": "hardlink", + "sha256": "41da90164a9ef1ff8f374e5b49b1cb5bdd2a7c4aa07552db22c2a23db5b8967a", + "size_in_bytes": 462 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stdlib/zoneinfo/_tzpath.pyi", + "path_type": "hardlink", + "sha256": "0b9bded9ab218a2ab6266d04b5611d243b5c77135cfbf1307dff08e7aa457d91", + "size_in_bytes": 524 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stubs/librt/librt/__init__.pyi", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stubs/librt/librt/base64.pyi", + "path_type": "hardlink", + "sha256": "7a0d5033baf304f7f433abd1c9eb9f0733c4b3921521d8b421bcfc64123be66f", + "size_in_bytes": 180 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stubs/librt/librt/internal.pyi", + "path_type": "hardlink", + "sha256": "fcf604a147e9214adfcbd058c11e84d8a7984793c86ac5f527dc6322d2fc7b4b", + "size_in_bytes": 850 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stubs/librt/librt/strings.pyi", + "path_type": "hardlink", + "sha256": "4d9a7db03c7e5c9f680ac8d1287b5c77ac439bd62c9534bd52c9ee967649ad72", + "size_in_bytes": 1780 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stubs/librt/librt/time.pyi", + "path_type": "hardlink", + "sha256": "714c6f580205cb8579745e1b0719638f205d40303d74c2045e210ed245d5d88d", + "size_in_bytes": 25 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stubs/librt/librt/vecs.pyi", + "path_type": "hardlink", + "sha256": "e5b170fd14fe43b0cac536465253e987aa9e3918fcf8328fa330043886560655", + "size_in_bytes": 678 + }, + { + "_path": "Lib/site-packages/mypy/typeshed/stubs/mypy-extensions/mypy_extensions.pyi", + "path_type": "hardlink", + "sha256": "b58097f134f9dcae7d93e08659c3b40411fa7b4e32b20cad73a7fd2e23c31b0b", + "size_in_bytes": 9072 + }, + { + "_path": "Lib/site-packages/mypy/typestate.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "f42e17eb43ca61cc1787a0bb11676402d25a0b895c7064b13c7e90b64da24397", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/typestate.py", + "path_type": "hardlink", + "sha256": "f233d62f66a14d67de84d4fa59695514f0bce91159d79d8533b9eaaba3de1b60", + "size_in_bytes": 15958 + }, + { + "_path": "Lib/site-packages/mypy/typetraverser.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "9dd93956ed7970dc6412a913cdaa5b4e98ad80d78ac75de23bcf67d881b4d95e", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/typetraverser.py", + "path_type": "hardlink", + "sha256": "7acc05c65fbceadd9df67ba45c0d34f9ef24c16b25f14638c0ab9d41d0834b77", + "size_in_bytes": 4456 + }, + { + "_path": "Lib/site-packages/mypy/typevars.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "6961e8e69f110343d406ca7f61168e0f5a64179cc55721e7d1f2c87420657c11", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/typevars.py", + "path_type": "hardlink", + "sha256": "f2ac399007c268a9b986493965ed3c1c7f72333b134993a305e9e3c9d4f0e4e0", + "size_in_bytes": 2996 + }, + { + "_path": "Lib/site-packages/mypy/typevartuples.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "cb2c161976e0bb4aafb95ea3c2eaa1011ff62f74575817157ac0b336749463a9", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/typevartuples.py", + "path_type": "hardlink", + "sha256": "8e8e85d69bb7f6f71aa21237f016e456182d9af4b2fb66a80371fc5985f37c92", + "size_in_bytes": 1058 + }, + { + "_path": "Lib/site-packages/mypy/util.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "e1765185d71bb9ad76bc116785abdcbf903d3038f7280b4a3a96b67d14198177", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/util.py", + "path_type": "hardlink", + "sha256": "3238974c3fc1ccdd361fac51771d578500ccb2074743a3a1495124705bbdceaf", + "size_in_bytes": 33125 + }, + { + "_path": "Lib/site-packages/mypy/version.py", + "path_type": "hardlink", + "sha256": "ed60062fbdeec2778c7939cf9a2728e91eb911084a3e19837b45fb5ddd177aa3", + "size_in_bytes": 24 + }, + { + "_path": "Lib/site-packages/mypy/visitor.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "f070302a75a9825741c0c0a607f47fd288e15d04547551479673a7807e300707", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypy/visitor.py", + "path_type": "hardlink", + "sha256": "adebacfef349ec8e0f35687524d44eefe215c5d7db7d76cc7b802c195d3a0b77", + "size_in_bytes": 18785 + }, + { + "_path": "Lib/site-packages/mypy/xml/mypy-html.css", + "path_type": "hardlink", + "sha256": "f9edc840b99222ec3f4553fc073c8822c80683e78eb1e7d66b03a0d9bdc7d8a6", + "size_in_bytes": 1409 + }, + { + "_path": "Lib/site-packages/mypy/xml/mypy-html.xslt", + "path_type": "hardlink", + "sha256": "d7d414a0edfef0702b10dbb30359f9b204e222e50740497562e172f692427773", + "size_in_bytes": 3824 + }, + { + "_path": "Lib/site-packages/mypy/xml/mypy-txt.xslt", + "path_type": "hardlink", + "sha256": "afde08ed40494116fe415cad41d3e5a51562e11d40678f6f81fd4737e0cfa789", + "size_in_bytes": 4686 + }, + { + "_path": "Lib/site-packages/mypy/xml/mypy.xsd", + "path_type": "hardlink", + "sha256": "450c3a6ba986f5e4da5c34f9a76c712d7f2b4617c353208c09ec83ae62c885d1", + "size_in_bytes": 2173 + }, + { + "_path": "Lib/site-packages/mypyc/__init__.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "8b8d653a1ad98af950ea86ffffa7b4872c18f89961cf212324afc610597b11ae", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/__init__.py", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypyc/__main__.py", + "path_type": "hardlink", + "sha256": "d7d66ed99e850e9801654e3f2f8ee101f62e412f67be6620893afd5f49bc738b", + "size_in_bytes": 1928 + }, + { + "_path": "Lib/site-packages/mypyc/__pycache__/__init__.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "1644bbee1afef3881f22c2e1101a6dfcab5ffa14667ab98a76ac25920019307d", + "size_in_bytes": 134 + }, + { + "_path": "Lib/site-packages/mypyc/__pycache__/__main__.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "bc24b9555188026fc56d7bbceafd6f15c872772415b286b1ac27313750e33899", + "size_in_bytes": 3176 + }, + { + "_path": "Lib/site-packages/mypyc/__pycache__/annotate.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "df470173e4f4d9a8d2a644060aa81094401bb0978b07b81a606a17f0d6b9c09b", + "size_in_bytes": 29645 + }, + { + "_path": "Lib/site-packages/mypyc/__pycache__/build.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "f46d2ef2539c28b0ae264678a91902e94f963b5bd860b9cf41c8b5efae1a98cb", + "size_in_bytes": 36703 + }, + { + "_path": "Lib/site-packages/mypyc/__pycache__/build_setup.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "c5f81ebc8a97fac9a93fd001d316879908573e3dcca5b29205c3ab87718eb39f", + "size_in_bytes": 2572 + }, + { + "_path": "Lib/site-packages/mypyc/__pycache__/common.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "0a9f41070c00520b12d189d028770550f4864ba51c8ef0d6fc95dd012a72366b", + "size_in_bytes": 5704 + }, + { + "_path": "Lib/site-packages/mypyc/__pycache__/crash.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "b9c95ab2c419b1d6312dfbc4002292b4bac138d7f5e689508868d5a63011d952", + "size_in_bytes": 2172 + }, + { + "_path": "Lib/site-packages/mypyc/__pycache__/errors.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "8d4d2ff8ac1ef21fb36ea78c13413552b9e82277e944b2c1391f0106b8ea5c8b", + "size_in_bytes": 3554 + }, + { + "_path": "Lib/site-packages/mypyc/__pycache__/namegen.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "6080c67c0739b2f22a68109dca2d5f6533592e4a8f766dc397360fb77d88dec6", + "size_in_bytes": 6443 + }, + { + "_path": "Lib/site-packages/mypyc/__pycache__/options.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "c0c503a554ccae596951fcd19d6a29987426ff5b35206b6e9ada02bf3ccd1c5f", + "size_in_bytes": 2012 + }, + { + "_path": "Lib/site-packages/mypyc/__pycache__/rt_subtype.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "6c9310991116913ba47c0da7ac97d996371acf7d33f5f220d0413bceb2185969", + "size_in_bytes": 7203 + }, + { + "_path": "Lib/site-packages/mypyc/__pycache__/sametype.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "772628f29e64596d3ac0f727af28451ed7354cedfda63349f3f328231e44055d", + "size_in_bytes": 8788 + }, + { + "_path": "Lib/site-packages/mypyc/__pycache__/subtype.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "950ac1b3ccea6b13d14719fedc292ebbed8f553f99717d0616b84268e90aa0d3", + "size_in_bytes": 8595 + }, + { + "_path": "Lib/site-packages/mypyc/analysis/__init__.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "214a9ec1ff00089ab3da062893e512e6fb67c92852861fb63ebe78c984341bc7", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/analysis/__init__.py", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypyc/analysis/__pycache__/__init__.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "23d51aee65d0c0ec98a2ad20ae447cf79c354886b8087d51ada5da9311f86ce7", + "size_in_bytes": 143 + }, + { + "_path": "Lib/site-packages/mypyc/analysis/__pycache__/attrdefined.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "e74a8e3ef3bd653a2a7bfcff94dd758d7f248888389a355101408ae9058badde", + "size_in_bytes": 24202 + }, + { + "_path": "Lib/site-packages/mypyc/analysis/__pycache__/blockfreq.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "27a7b85eff1ab5e25906bdde6a420d3af8902c425335fbebb7d1d4d3766e93a4", + "size_in_bytes": 1746 + }, + { + "_path": "Lib/site-packages/mypyc/analysis/__pycache__/capsule_deps.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "0589c2f6e03bdfad7fd9a3133262d4267378a3ca41a82eb9e40cfc5fb382c17f", + "size_in_bytes": 4643 + }, + { + "_path": "Lib/site-packages/mypyc/analysis/__pycache__/dataflow.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "3b96d6485efe292b6c1bc37870448d3f84391812b7938ee7de37ab7e7028d683", + "size_in_bytes": 40090 + }, + { + "_path": "Lib/site-packages/mypyc/analysis/__pycache__/ircheck.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "04f54608e3030f1b6a75a63a7bf0325e8ac7a40be163cb5e90f496c9f46c1e8f", + "size_in_bytes": 35178 + }, + { + "_path": "Lib/site-packages/mypyc/analysis/__pycache__/selfleaks.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "62456c4b52e667108559c21ada6ad0723c343ca80928b8a41ce45bd96a16959f", + "size_in_bytes": 17457 + }, + { + "_path": "Lib/site-packages/mypyc/analysis/attrdefined.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "9c8bdfe6c5d673e37b589d7bb2ce16d38e66b411be19febb8f53adda53d85fdb", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/analysis/attrdefined.py", + "path_type": "hardlink", + "sha256": "e868b3104127b00fe93260e4050a3111515dd1b799f9699b3b76a5256526659a", + "size_in_bytes": 15419 + }, + { + "_path": "Lib/site-packages/mypyc/analysis/blockfreq.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "7ad1e2a9a68a0bce772a30c695ab56707fd6086fa3e541ed8ade03e0d231a896", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/analysis/blockfreq.py", + "path_type": "hardlink", + "sha256": "0a37554455e045db2e92c93a7b5d5ca9bb05763e1ed73ffc187bef9d8fcf81bf", + "size_in_bytes": 1004 + }, + { + "_path": "Lib/site-packages/mypyc/analysis/capsule_deps.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "8651588bfe1cf4c87b96c87a38ed6905e94d6aaf1d283adb01b1569a16fd5b72", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/analysis/capsule_deps.py", + "path_type": "hardlink", + "sha256": "ca2c9cf6c47c33d62ac60bcf3add94cf2344c480f8a782af577ce3fcb0d93979", + "size_in_bytes": 3026 + }, + { + "_path": "Lib/site-packages/mypyc/analysis/dataflow.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "14d0d6e376fe3aa9841ee6e8705583ddd0df5e6607b8f428b4524472c760ef15", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/analysis/dataflow.py", + "path_type": "hardlink", + "sha256": "9272e09533f24b135f39b2d13145eb9c73fcfe36523e97381a8d52655c8a631a", + "size_in_bytes": 20011 + }, + { + "_path": "Lib/site-packages/mypyc/analysis/ircheck.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "3f3209e7b25f050cc9bb65f7d676aa2dfa9cedd41759f9d4ec8092dbd70cd0aa", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/analysis/ircheck.py", + "path_type": "hardlink", + "sha256": "bca127a55198610b770131a17bd5a27ad9bbf9735c1f1ac5a1e27f4bb11674cf", + "size_in_bytes": 15810 + }, + { + "_path": "Lib/site-packages/mypyc/analysis/selfleaks.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "bdbcf4b109de3e21c776ba9ba0d53309dec9fe3c30773cdd924176bf2313d316", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/analysis/selfleaks.py", + "path_type": "hardlink", + "sha256": "1ac48108197e171aa0ee7ed3095e8c4e3fab1c36747204e7f54cd7897f6102b1", + "size_in_bytes": 6173 + }, + { + "_path": "Lib/site-packages/mypyc/annotate.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "45f6154e0059f9e176a0449935f7249a1ace1c6edd619f3dc9f6b5c183e99149", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/annotate.py", + "path_type": "hardlink", + "sha256": "5c0356256686cd7932527e49d639674a3f32e0e16e707dcf516c1f8ed30d7d4f", + "size_in_bytes": 17993 + }, + { + "_path": "Lib/site-packages/mypyc/build.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "f3128ff92ea7be804c8a1f9d79a5e97a962731019b211e3a7c748236123e2b9b", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/build.py", + "path_type": "hardlink", + "sha256": "2fa2c7febc997702826d5326660d12ac826539fb05d34fc000d725ec4228f926", + "size_in_bytes": 31474 + }, + { + "_path": "Lib/site-packages/mypyc/build_setup.py", + "path_type": "hardlink", + "sha256": "adb8288a87852dbc8afca36e2d8c3077db273779030c5bfe41add00bc3731e0c", + "size_in_bytes": 2653 + }, + { + "_path": "Lib/site-packages/mypyc/codegen/__init__.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "14d1d7c26461b589f4dac5bc589e6a17c69cb93adc5e0ed0d7bcef14f5b93c2d", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/codegen/__init__.py", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypyc/codegen/__pycache__/__init__.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "b8c8672cc8d43b032dd6973a905dfe9538bb26085884374a922d01b3b0d82edd", + "size_in_bytes": 142 + }, + { + "_path": "Lib/site-packages/mypyc/codegen/__pycache__/cstring.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "cafb960fb7b95fb189c6652d9311dff0944c646ee4a54ebc10c42b9de27d6024", + "size_in_bytes": 2864 + }, + { + "_path": "Lib/site-packages/mypyc/codegen/__pycache__/emit.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "2f982a97bebdf88dbb4648a5869da7283f50daeeb1734d00bc62dde5ff780531", + "size_in_bytes": 79376 + }, + { + "_path": "Lib/site-packages/mypyc/codegen/__pycache__/emitclass.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "ae9e685ce17fcf33a93450a026df12fd77488e920f789c7966e05a969cd55212", + "size_in_bytes": 72286 + }, + { + "_path": "Lib/site-packages/mypyc/codegen/__pycache__/emitfunc.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "1a405b069fbbf27cf26cde158ebb5b5ad2372e2224c4ce4f172ba20f86c50377", + "size_in_bytes": 68315 + }, + { + "_path": "Lib/site-packages/mypyc/codegen/__pycache__/emitmodule.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "fe472e7882809280dd871c2216223fc9a6eb4cb6c013530a79f4a41d2307c065", + "size_in_bytes": 79662 + }, + { + "_path": "Lib/site-packages/mypyc/codegen/__pycache__/emitwrapper.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "c3ee114db578bfae122237619d34f1cdea74b8449c8017e74f6fdd31149ebe2b", + "size_in_bytes": 53019 + }, + { + "_path": "Lib/site-packages/mypyc/codegen/__pycache__/literals.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "7ed1dccf0fcd545e0241dcd42901fd7830ae8e7478f5032fb5742d44f1e70d6b", + "size_in_bytes": 17931 + }, + { + "_path": "Lib/site-packages/mypyc/codegen/cstring.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "5439551aadf4273e281c12ced69cdb031fae3405f08d7b179332fa93a77aba97", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/codegen/cstring.py", + "path_type": "hardlink", + "sha256": "c81fd22666a10e94c2ed7ab7be50acb4f6618722e9473132f721c1c1da9d21ae", + "size_in_bytes": 2004 + }, + { + "_path": "Lib/site-packages/mypyc/codegen/emit.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "d937b4deb0ba44029371de71bbeaa4bac600ebd1b182e087cec2f638702a16c7", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/codegen/emit.py", + "path_type": "hardlink", + "sha256": "8e86d7bc6d5ef2295447cd2da27c2b0c848eb1e3363a0e58dcbce04dfad94daf", + "size_in_bytes": 58255 + }, + { + "_path": "Lib/site-packages/mypyc/codegen/emitclass.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "4374d4d191cab988e0732031a0d9ccd0d5a8f9bab544a918b578c4536d6dde08", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/codegen/emitclass.py", + "path_type": "hardlink", + "sha256": "24cb5bc5d3db17f240ffb562db8e17fd9fe092c8429f4ef3b6e3c4cb8ccc4e6f", + "size_in_bytes": 51670 + }, + { + "_path": "Lib/site-packages/mypyc/codegen/emitfunc.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "85ce4c3bd8c3d55a05cd1835c62e6bcec07dd50c32711ef675c55e741573bead", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/codegen/emitfunc.py", + "path_type": "hardlink", + "sha256": "ac29599f675da7bffa45b408f66a2f01721d0a44263eed92eedc139a2a1c8f56", + "size_in_bytes": 38208 + }, + { + "_path": "Lib/site-packages/mypyc/codegen/emitmodule.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "9cfd43697cc643cc3c0e1d83108c0776203d6fd84b51be14fa42891a857a03bb", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/codegen/emitmodule.py", + "path_type": "hardlink", + "sha256": "c9a5acfd2dfe76210ea6bb5ed66b8993199628b4a1f871eb7fbcaeb92fcfe97e", + "size_in_bytes": 62790 + }, + { + "_path": "Lib/site-packages/mypyc/codegen/emitwrapper.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "7ae41b7bf88a8377d4933b74ad334b186a1f8f6c14ee49add1161b1173212d51", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/codegen/emitwrapper.py", + "path_type": "hardlink", + "sha256": "d7c7775f08933f09dce3e425ebc239271c0b54423681fcee167e8c4e6f0644c1", + "size_in_bytes": 37886 + }, + { + "_path": "Lib/site-packages/mypyc/codegen/literals.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "2b0a28fe16d7a325464a1a946a883500758b4bc214c2b089825163f6a4a9fd4b", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/codegen/literals.py", + "path_type": "hardlink", + "sha256": "6530fbeca2c323f07a4df26cd4749ab4a6b90d4315cdb789b3aea55ee03c9466", + "size_in_bytes": 10602 + }, + { + "_path": "Lib/site-packages/mypyc/common.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "dd347f192cb8bbeac5b95759539e5fb92aba2f2537871d4b9bf1b3a3c836cb01", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/common.py", + "path_type": "hardlink", + "sha256": "72c4de4e3a1cde42239e46e61b5c0adbdc541de4f604427d8a148c3e7b9362f7", + "size_in_bytes": 5131 + }, + { + "_path": "Lib/site-packages/mypyc/crash.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "876667a86297c3b125fde0b2f785ccc857bfb8f0a489d1b3de812ef79f3a2782", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/crash.py", + "path_type": "hardlink", + "sha256": "50b6472d0a89a922bca0506ca03bebd5e3822c02287b69709150838be7fd7b0c", + "size_in_bytes": 953 + }, + { + "_path": "Lib/site-packages/mypyc/errors.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "028a44eb5a2640390916e62122fc64d4230b8d657ae58f5c0433f5414c719721", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/errors.py", + "path_type": "hardlink", + "sha256": "b149083d2590b67e1d92c479da20863304c4996f026468887608162733d83519", + "size_in_bytes": 1104 + }, + { + "_path": "Lib/site-packages/mypyc/ir/__init__.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "d4c963f0bad02b3845525897eeea8cd545941b34d29e633fac218a29c1f14c56", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/ir/__init__.py", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypyc/ir/__pycache__/__init__.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "03240192df412aab9f127bef68b4c95714825a5f58f3bd30820cf785a529769d", + "size_in_bytes": 137 + }, + { + "_path": "Lib/site-packages/mypyc/ir/__pycache__/class_ir.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "ff55f47516301cb3dd854eda34fac1973c9b0a577e30fce36a5526b4765dde31", + "size_in_bytes": 29281 + }, + { + "_path": "Lib/site-packages/mypyc/ir/__pycache__/deps.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "2ec93024064fa08dee772c92f284cea334d99f0ce2db1bb4da4e136bdd38c4e9", + "size_in_bytes": 5832 + }, + { + "_path": "Lib/site-packages/mypyc/ir/__pycache__/func_ir.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "f576c563c2f4b116d84ed42cfce8c8b00f149c764c7503907cdb7034a4173e38", + "size_in_bytes": 29449 + }, + { + "_path": "Lib/site-packages/mypyc/ir/__pycache__/module_ir.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "bfeefad7b4ccf63eeafbdaf4fe8458f03078e1fca08793ec4c781c53d2568f32", + "size_in_bytes": 6889 + }, + { + "_path": "Lib/site-packages/mypyc/ir/__pycache__/ops.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "81167e8e263e6719f3dc731686e1e04b82ab6e653d9a4156650094a3b5f5f4a4", + "size_in_bytes": 124858 + }, + { + "_path": "Lib/site-packages/mypyc/ir/__pycache__/pprint.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "e89e5430a4b04e069f14bfc7597b1c787055568622a3f3895988c2e91b7f25de", + "size_in_bytes": 39594 + }, + { + "_path": "Lib/site-packages/mypyc/ir/__pycache__/rtypes.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "6b79e242f4f2ad0de0f1f6d9e7a9257f6756347ec02e530260323ee59e10b79d", + "size_in_bytes": 75816 + }, + { + "_path": "Lib/site-packages/mypyc/ir/class_ir.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "a18fdfacb8c92df4c04b37428a2d36103be201f50343a0acfb83f1183c2ad85c", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/ir/class_ir.py", + "path_type": "hardlink", + "sha256": "7dbd0111de3a2d0d7efe9102aaca355c96c041fc2be0ae315ba62e13513bceb8", + "size_in_bytes": 24168 + }, + { + "_path": "Lib/site-packages/mypyc/ir/deps.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "f607c4b5b193969bf7b0228ebc728c4d06efc50b171fedd632e86e686bfb659b", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/ir/deps.py", + "path_type": "hardlink", + "sha256": "88038fc3fa03da2e4c82665265433b0cf18e8efd03bc61a74fa6ef9523262cbf", + "size_in_bytes": 1877 + }, + { + "_path": "Lib/site-packages/mypyc/ir/func_ir.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "9c2128b950ecc1394293e46e78a326a46d121ea3aa0d048515966ee46cfec363", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/ir/func_ir.py", + "path_type": "hardlink", + "sha256": "11146edf95f56568ab84886a6e1b30a4df5cbf5faaed9816594ed090f54f7f68", + "size_in_bytes": 15944 + }, + { + "_path": "Lib/site-packages/mypyc/ir/module_ir.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "356471677093495333ff46d141ee0d482fb77a5938943be47cc1f269ac0bbe64", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/ir/module_ir.py", + "path_type": "hardlink", + "sha256": "9c0af65635eee730cf3b9d7cf626538fe0d3d9a5aa7a2e2f1ddef2e82e2ac132", + "size_in_bytes": 4517 + }, + { + "_path": "Lib/site-packages/mypyc/ir/ops.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "ff5bfbba7962e30fe702ea86e9307ba685794d5273d135a4a54e16bff84ab62f", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/ir/ops.py", + "path_type": "hardlink", + "sha256": "9dafa1937a428b67a212f400b7fddac3dfcc1126d19e9be18e331098e612ca2d", + "size_in_bytes": 62481 + }, + { + "_path": "Lib/site-packages/mypyc/ir/pprint.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "58d580b9883cf767f511303993993077fc1120885e5660f30ad41431251f9cb6", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/ir/pprint.py", + "path_type": "hardlink", + "sha256": "ca782656341859bd1fadcfc974fdf68bb653529874ee7ea43903113114dff28a", + "size_in_bytes": 18668 + }, + { + "_path": "Lib/site-packages/mypyc/ir/rtypes.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "2b25e5c4210aeae79dfde13588c9bcf0463b4f51104d8707a98767badca089f8", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/ir/rtypes.py", + "path_type": "hardlink", + "sha256": "24d46c9694c0836716502a015284d34d8f1d421848a2c289adbd25fb1ecceda2", + "size_in_bytes": 46940 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__init__.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "f23b950af1673d53c165df1dfd9bdd5aa6ccac402603ce017cf8fbfa2cd6ef7a", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__init__.py", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/__init__.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "82b592eb7040eb36178607880de7d7f62e79a3abce8496d5af2643bfccf77802", + "size_in_bytes": 142 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/ast_helpers.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "2dceaf9d1ee3209d0532cee3f0c51b38ef07b1caaaaf2c6b15a194b079b0ab1a", + "size_in_bytes": 6001 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/builder.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "aa16993693236d76e96a236efddd2b50e81b7d88df4be175c913a1f3b728b214", + "size_in_bytes": 113092 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/callable_class.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "d2d7479af1cbe03910006ea31a55b8a9014eb88fe6a27356c361d90b7322f2d9", + "size_in_bytes": 12450 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/classdef.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "aeecd984351f3891613c182404e6f42911390ad0b7eccb97ac0b91cf93e239bd", + "size_in_bytes": 54803 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/constant_fold.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "5aeb4cbf0db36f7d556fdd1c672c3fa84381dde9a7cedfde9b7b2732c4ca9509", + "size_in_bytes": 4804 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/context.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "f600aa5df44f870e7263ce1df78b554a2590b3ee2c8088fdf678cf7e61cedea0", + "size_in_bytes": 11887 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/env_class.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "3de0af8661825b45640df02506269a498461e7f5b666001f08932a7f1d07f819", + "size_in_bytes": 17158 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/expression.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "d4885b92eea31383f3366048db42362dcc49d21fac20280d178ddaf4264efba8", + "size_in_bytes": 72002 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/for_helpers.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "624b6cec3999438b481fd12f6a0fc72c6920736dcbe608cda79785d3d5ed35be", + "size_in_bytes": 76337 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/format_str_tokenizer.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "563fdd63613cc381c85d04e4b829cfdee34cf29a691b83dd5e9d55db76dace77", + "size_in_bytes": 12242 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/function.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "3f056253826812c4087677af15b8c1b70937520bbae27ee5c0dd6196daf7a3db", + "size_in_bytes": 66234 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/generator.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "2eaf70ecbd58ff20032956700ad05c66c4bb0a6c9cb7455afe64be2eee232ef0", + "size_in_bytes": 23851 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/ll_builder.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "3c00798ab20ff42bdb929c04eea0a5a95569897e1c40900f640cd2759763461f", + "size_in_bytes": 167330 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/main.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "b369ebc0420edfb1d964c73d70486d5f0d963b3093bd0f00924dcb8c4f76a0f3", + "size_in_bytes": 6526 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/mapper.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "43e6577c8482c020f71cc586f53d0071be36efa75a755ea14db20937285d6757", + "size_in_bytes": 12818 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/match.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "3c1315817a87bd314911f69417e1068eda7c0341626fb85dba6289f2f88a49e5", + "size_in_bytes": 21318 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/missingtypevisitor.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "f678c64c10b5e6265ba50b78a777eae41ea542c16afc04dd3c1d57db0a27c122", + "size_in_bytes": 1775 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/nonlocalcontrol.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "8bb61e291ad86ec1455c730065c7d8140ace99c1eecdd848ba4cacce6b0b05ac", + "size_in_bytes": 15337 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/prebuildvisitor.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "fda136f73b03edc450da67f41e7b5c4f34401d5c309cd4960b09c07561b2431a", + "size_in_bytes": 15371 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/prepare.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "7cfa1ca32f0d5427bdc0c5d497a938f08f6565803eeca623f9638d106f785a94", + "size_in_bytes": 44132 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/specialize.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "88d3758267e79aa5b58db37df04fa6cc6712acd245376736031ac9063558af35", + "size_in_bytes": 78548 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/statement.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "a9e62b536a0a3ad87f1cca3b6e0004fa2a94e9197e79ca2720a95ca7d9d8ce48", + "size_in_bytes": 76050 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/targets.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "a6f6e5608e0802fb50dd3bf620b1024cac8d0befd0e12cfcef169ba3481a53cb", + "size_in_bytes": 5544 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/util.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "3243430f74a2cfeb4bc32865b5b2cef48f49fb740e3792ae062906b4e7a632e2", + "size_in_bytes": 16836 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/vec.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "bf75c239f595eaf49b67fb5cd365a9b8e3850f53fc97890a10598dc6e297e922", + "size_in_bytes": 26153 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/visitor.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "8530d49503360751b71a8082fc58a451722952bf9b4994239772e42d7f63ac6d", + "size_in_bytes": 32379 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/__pycache__/vtable.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "059c891bd75f57da64d6f3926422d86db97aca581e8530c65c1185cca3f5cf3c", + "size_in_bytes": 5119 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/ast_helpers.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "fa50e7fa732bed7682349cddea2327282b705cfd7a38e2d27455a7e6c2e88be0", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/ast_helpers.py", + "path_type": "hardlink", + "sha256": "68cdb300707f66cba657a3963929e5ed2b428e1ce52e73948e55dbafadda4786", + "size_in_bytes": 4339 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/builder.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "bcb9d323bdb850c49935df8da124e8f4088ff1a90218296fbc6e8389223e857f", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/builder.py", + "path_type": "hardlink", + "sha256": "8c25038e79c1f0f8bf368f9127d191a8e3c0b52e2d5cdb71059da3923e465828", + "size_in_bytes": 71361 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/callable_class.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "130aadabaecd4d9582838e9c189e679cb2702fd7ef5f3dd5c3d49e05d2ed1699", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/callable_class.py", + "path_type": "hardlink", + "sha256": "4cb4313ab64bf9447f35a618518ca2256aa664b835915d132d60af2b198b6ad7", + "size_in_bytes": 10378 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/classdef.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "87425118529fb4e3b5bde925e2413b764728015eb933a16ae5b251a72489716a", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/classdef.py", + "path_type": "hardlink", + "sha256": "e49957e33fb4f91c6faf1ec4560880ee31c1a923b13dd1b5770a9ee9c8d5bda4", + "size_in_bytes": 38980 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/constant_fold.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "3b90ad1b2d6806a4b37d0e5409a3c636e4bd97def99052e3e968dcb2ee075622", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/constant_fold.py", + "path_type": "hardlink", + "sha256": "eea2151094a069b1c8437ef2759ab6c1e6ab3c5b709ffced472dfaef4461330d", + "size_in_bytes": 3335 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/context.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "37c391b366636df1cd7b5f77085a7f71560ab7b89c0fc38e7d9497877ad4fd6f", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/context.py", + "path_type": "hardlink", + "sha256": "67584962acc8a1c8a19dd9bfadc359e74b8db45aba19c21d098878eb68d3eb81", + "size_in_bytes": 7858 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/env_class.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "61653b041a0a6d2126bcabdd9c852d79507e64af2b9f9d0e390223ec14c8aa0d", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/env_class.py", + "path_type": "hardlink", + "sha256": "4748bb171bf39bdcc320ae30fd9042f55d893a91be1a874f1777e1b6dd4427c2", + "size_in_bytes": 13034 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/expression.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "605e5c38e107b798dd6079afd72ce1a4989a58c9371fb21ee99ff03ef1552fdb", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/expression.py", + "path_type": "hardlink", + "sha256": "43e18dd7842f3f8ab3a3f51514048a534ed44a4b1038df218b90787c911bbc54", + "size_in_bytes": 48353 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/for_helpers.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "f23e44c2f2586ee5fa8bf9772573b5d385cd1245680eebdfd55da1adb2dda2ac", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/for_helpers.py", + "path_type": "hardlink", + "sha256": "76c92aa0d82d78bfdb4c83e8e9634e5079180122c952ff77ac5e827442689765", + "size_in_bytes": 52539 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/format_str_tokenizer.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "1edf7d20ef0683ed1b6ae6866fafd9e5fb23b6659e0996ac5a14437b3968e327", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/format_str_tokenizer.py", + "path_type": "hardlink", + "sha256": "488f2d05d28848967bbbcbaaafaed808ebefd55d39373fdc1802af1a391ad337", + "size_in_bytes": 9491 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/function.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "63287afec5d5d6bceb2211f788ed916b275757327ed29abf0784a427516b5a9e", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/function.py", + "path_type": "hardlink", + "sha256": "2e2e409da801a815cb5fe13dc0f5f0344ca7986fa95c1d6a94447b1bb4a6f2ad", + "size_in_bytes": 50088 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/generator.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "a3e9630cd80378d87b07a0b49438f9a8e024ce56acfb0af23f48f95060cb0325", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/generator.py", + "path_type": "hardlink", + "sha256": "b2bc7f0be672cc729affb3c733ea84e4d36c540a35e52bd86c97d0dbae6dc9bd", + "size_in_bytes": 17139 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/ll_builder.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "09864a5e9a7f34826b7bbc0311d95af3d1b26313d62e2805120c571d5aa457ee", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/ll_builder.py", + "path_type": "hardlink", + "sha256": "aed2cc55131fd4e8a5e7203ed504eaa5e151b9218036cfca1bbee0377b6dd021", + "size_in_bytes": 126260 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/main.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "dbb59d5a8040174010631cbcfbb3fbc9c85b2309b033d1c222e2b86bfbc078df", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/main.py", + "path_type": "hardlink", + "sha256": "01755f30bf2dc4c4bba9abdacdac1a209ab646b2c3ffc3cbacc49c22da270576", + "size_in_bytes": 5438 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/mapper.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "bbd8fb93ddda262ea0c5dcd39c3c7b93b396286e56f884fe1075e904e99eb3b9", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/mapper.py", + "path_type": "hardlink", + "sha256": "2852f22719e0aa468fa5e184f93046b7547146bfe1b5c38d8be6d22393507ada", + "size_in_bytes": 9861 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/match.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "bc0b3cd9398e395761c003e3e67b8845255a774b9eb34b443f5a66f670284ce5", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/match.py", + "path_type": "hardlink", + "sha256": "73e1dba64a59520552f942c28151d1942929f5e7d2cc07ce10c0b06b29fc6de0", + "size_in_bytes": 12420 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/missingtypevisitor.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "339f52beb9938f76648f5bce99a68fb024c65f5f397b789faf8198802812cec4", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/missingtypevisitor.py", + "path_type": "hardlink", + "sha256": "6b05cc3244615d9ab40276d218a7d4cecf4bc79dba805bc3ba261a2a37aa02ae", + "size_in_bytes": 699 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/nonlocalcontrol.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "135ca9a132aba22f73d69454477c939db363212b01d4c1cae0a9af5bcf26a06a", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/nonlocalcontrol.py", + "path_type": "hardlink", + "sha256": "dc07f19b0db586763611e39d0c2812995125578a8d18cd68f1be4518ee8555c9", + "size_in_bytes": 8035 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/prebuildvisitor.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "ef6368940fd32f2a06457bca225e34eb52ef53f58e92c620a31610526acd711c", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/prebuildvisitor.py", + "path_type": "hardlink", + "sha256": "2426edee3bfcfef4792d1b64862c61b40d0a29b5cab92e1f1b4da9bef0577823", + "size_in_bytes": 12085 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/prepare.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "06dc17c6a70eca2797374676a599994611a4a9b4aaf415a5d1f1b78a609ffe92", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/prepare.py", + "path_type": "hardlink", + "sha256": "a0e97d1ac6009253971ba753008bbc83569f7477efad849bb28b39a79fa8cd6b", + "size_in_bytes": 35992 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/specialize.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "9c070b6d02a9e45b7b1aa310b8ac3fc25bbdba9a771e8109055fa14e91a9a7af", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/specialize.py", + "path_type": "hardlink", + "sha256": "8f5d67485525702bd3514ee016dd3ec50a4d271b30783707ac69caa0e47badf8", + "size_in_bytes": 56112 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/statement.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "2ed9238e9ad700793455920291660f7b0ba5c826c31f9144b5c655f463c151d4", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/statement.py", + "path_type": "hardlink", + "sha256": "0a8589602edec6d2bb4995d464444c68e6f9bdc735d5d2c3c3b04552ba86ae6d", + "size_in_bytes": 53212 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/targets.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "027d3a172fe23cde367cb2309c4e7a342f161df9919a4faa747abf03cffb70de", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/targets.py", + "path_type": "hardlink", + "sha256": "af5db29cf854693988827995e5ce5e35b5896ea7f6fcbd7646d5bf3c841786af", + "size_in_bytes": 2313 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/util.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "3396dd15c973df1927998776b023bbfdda0f8e6e6b1455c0232c4c3f55e70b15", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/util.py", + "path_type": "hardlink", + "sha256": "3c5d70640cd12a8f1e175ad2351fb3c1e7e987ee933dff874f1f33d378be3031", + "size_in_bytes": 10094 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/vec.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "0fa224bdbe03a041bf27fb448b79d06d0a0a76c26d9ab46b4608ffd7dc76e28f", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/vec.py", + "path_type": "hardlink", + "sha256": "b4d6ccfecdb7655c7d4718b255ba0a6e38496bb432b5dfeecc70c25402af8263", + "size_in_bytes": 17774 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/visitor.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "121e25402ed13df0696dd950dd51a4d98f42e7638afd056057424256193d866f", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/visitor.py", + "path_type": "hardlink", + "sha256": "bbdabc3cd4aea25b64ba49999217a08c2a887d0d9722cb2df90ef685df2e4ce6", + "size_in_bytes": 13305 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/vtable.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "c3d7ca70ca9eba6c65baa8e3fadf492e5cfa3492ca489304e8af2eb09c6f8b42", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/irbuild/vtable.py", + "path_type": "hardlink", + "sha256": "ece66dc00697f74ba9ddd6906fbf77b9596a037ab697a59481301e2b0adb7c02", + "size_in_bytes": 3333 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/CPy.h", + "path_type": "hardlink", + "sha256": "2f0ce9195a30919484a6849c7fc9adb1303bd7e271ebc4ed5a52bcbf7b05494f", + "size_in_bytes": 37907 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/__pycache__/build_setup.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "2f41958337d6fa0a170efb2b82e3c25c7537cfeb4916ecdbec9a708ff75bc3ca", + "size_in_bytes": 2579 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/avx/codec.c", + "path_type": "hardlink", + "sha256": "bab4d62d33c8e4338550a4043357a9b691200025c0d0f2bda1708d64ccddd28e", + "size_in_bytes": 1691 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/avx/enc_loop_asm.c", + "path_type": "hardlink", + "sha256": "e71eca8029f2f600aebf43a8e7494d0a8d8b0edfad3ce620dede6fc93696fa46", + "size_in_bytes": 9314 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/avx2/codec.c", + "path_type": "hardlink", + "sha256": "dc76dc730bcc983a0ffd04be07a6335c83a0639d6fa7b1437bd9bcdfc2afe6d9", + "size_in_bytes": 1398 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/avx2/dec_loop.c", + "path_type": "hardlink", + "sha256": "86aff2785afdc2b94e5eb53894f510fbec695b50f4fe6e852647a703562df9f1", + "size_in_bytes": 3229 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/avx2/dec_reshuffle.c", + "path_type": "hardlink", + "sha256": "feaafaaf7fd04a27263a097cb4d323a125fd500474b4b63641393a769c03b774", + "size_in_bytes": 1304 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/avx2/enc_loop.c", + "path_type": "hardlink", + "sha256": "f9dc9da01c4ab755ffb1356949829926547cb1f21e60b5093b3bffe870fad173", + "size_in_bytes": 2293 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/avx2/enc_loop_asm.c", + "path_type": "hardlink", + "sha256": "2ec792d3d03fb322d7bf40b89f90bf9683c81a0dc1d2c8ce659e54559dc3fa9a", + "size_in_bytes": 10453 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/avx2/enc_reshuffle.c", + "path_type": "hardlink", + "sha256": "09638696f41012c397cc28e4039295e44625800c97ab232d85f0f4f6a41b27cc", + "size_in_bytes": 2714 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/avx2/enc_translate.c", + "path_type": "hardlink", + "sha256": "65bc56e2d4f4579b9910eaa28ae9ba0ad4675da60ad6077e25d1be3fbed14523", + "size_in_bytes": 1251 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/avx512/codec.c", + "path_type": "hardlink", + "sha256": "f36e381d23e802c8a57036e96c8da9bcf24cbaa3bbe3a54d51be701ac01b508f", + "size_in_bytes": 1139 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/avx512/enc_loop.c", + "path_type": "hardlink", + "sha256": "736eb89f15587e5de6ef602b82c1c6a25f7e1505b87b8ca2a734e6d72a12316f", + "size_in_bytes": 1506 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/avx512/enc_reshuffle_translate.c", + "path_type": "hardlink", + "sha256": "94449f3802bac95be23320b0010ae7a5640977176cd26d74f5ccc649bc5eb91c", + "size_in_bytes": 2277 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/generic/32/dec_loop.c", + "path_type": "hardlink", + "sha256": "5c2a34d3079be25e4bf7c74373fe193e3770461c09609272bfacd383689ade43", + "size_in_bytes": 2218 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/generic/32/enc_loop.c", + "path_type": "hardlink", + "sha256": "f1630c1c47fec66a397fa67b0d8e4955a4af01a7fcd29ce203dbe6fbe1af623d", + "size_in_bytes": 1932 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/generic/64/enc_loop.c", + "path_type": "hardlink", + "sha256": "ea3044281a61aca2b47f76b8654838a58d585ef127556e72bc9717b683003b21", + "size_in_bytes": 2128 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/generic/codec.c", + "path_type": "hardlink", + "sha256": "ef288ae217be9c0bd100c4b7445d9b90bdd0d24d7d3aeb23c808dcb8b9e24803", + "size_in_bytes": 790 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/generic/dec_head.c", + "path_type": "hardlink", + "sha256": "5c6effe19ecee732169186f28620aec86cfc910393d4fde177bdd6243b864ac9", + "size_in_bytes": 791 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/generic/dec_tail.c", + "path_type": "hardlink", + "sha256": "9784172e7ddb2586213c9cd3cf61e2d4eb884b0d2cbc902c80b90c9654c25fab", + "size_in_bytes": 1774 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/generic/enc_head.c", + "path_type": "hardlink", + "sha256": "818d4dad12150c12b3d64aeba9b981150097bd6ed3b084aee923f68744f2d56e", + "size_in_bytes": 585 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/generic/enc_tail.c", + "path_type": "hardlink", + "sha256": "a0868dc71d62bf9e1107fb237c2b7dcb78b070a798543ad7990763dbc453eac7", + "size_in_bytes": 637 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/neon32/codec.c", + "path_type": "hardlink", + "sha256": "3929d089c48139acc979c585b6a2c026cc313b85c543feb35d41326320f3970a", + "size_in_bytes": 1984 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/neon32/dec_loop.c", + "path_type": "hardlink", + "sha256": "44ff5400b4f6e7ed21f72d19653f947dc50f18f9d101dac263b0c54ffa90c2d6", + "size_in_bytes": 2906 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/neon32/enc_loop.c", + "path_type": "hardlink", + "sha256": "f4e173fdf265631147384592a9fb5213b0f596b2b6c185d6d17b3035c6752b55", + "size_in_bytes": 4655 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/neon32/enc_reshuffle.c", + "path_type": "hardlink", + "sha256": "d4a8b037c99b90c9471add55761f59a850b198f4866c57a2ad9175aff28dafaa", + "size_in_bytes": 982 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/neon32/enc_translate.c", + "path_type": "hardlink", + "sha256": "ea9dfa849a1fce2c9ad65828b0c5b65fb43c1e9ea9534d7e0c9996b23fe2350c", + "size_in_bytes": 2116 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/neon64/codec.c", + "path_type": "hardlink", + "sha256": "88f4b478f38d13a5478d200f7276b8d43cb769d84d9dba7fb4e86fefc7c97f1d", + "size_in_bytes": 2190 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/neon64/dec_loop.c", + "path_type": "hardlink", + "sha256": "403c21abf0af08ca3aa7524c8cd5b94bcf99e70a0c543c4c784c5e657c4efea0", + "size_in_bytes": 5263 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/neon64/enc_loop.c", + "path_type": "hardlink", + "sha256": "6e563202d7c631a3a3d6386a69e1db07146fc9745b244cd7b26bf64b96882fee", + "size_in_bytes": 1857 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/neon64/enc_loop_asm.c", + "path_type": "hardlink", + "sha256": "d44caa5b787ffcbb8a0176ef42348bec966896fce888455d7200d7c0331a9705", + "size_in_bytes": 5617 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/neon64/enc_reshuffle.c", + "path_type": "hardlink", + "sha256": "adeebcd7566bdd3cddf7c54f3167de4c3ea08b82d3ce7ca403d408a93c681297", + "size_in_bytes": 988 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/sse41/codec.c", + "path_type": "hardlink", + "sha256": "159e6025b826ffcf7f78ad7410b46ab24cc20deac90e3971a1e822bb6cdbfa49", + "size_in_bytes": 1456 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/sse42/codec.c", + "path_type": "hardlink", + "sha256": "3a43c44e470fb2e582deeab3dda349ddd22b9e53929706ae71f2547bc324ce78", + "size_in_bytes": 1456 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/ssse3/codec.c", + "path_type": "hardlink", + "sha256": "a7abe92c036918c490ae2ca696d28e906381430a1eb820c90a9ca6352b35311f", + "size_in_bytes": 1540 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/ssse3/dec_loop.c", + "path_type": "hardlink", + "sha256": "8a3184bb84aa89efb2a907ba48122c25409886dffffe5a1913e41687decb3899", + "size_in_bytes": 6891 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/ssse3/dec_reshuffle.c", + "path_type": "hardlink", + "sha256": "d617bf78d80d4678d8ceaf2080dfd44219b78aee8432b7d61082df27f3d50c82", + "size_in_bytes": 1118 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/ssse3/enc_loop.c", + "path_type": "hardlink", + "sha256": "8f4e30ddb1a67d48497c6d657dae50ecbfd1d8dcedcd2f7a03eaffbde1de4cb8", + "size_in_bytes": 1549 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/ssse3/enc_loop_asm.c", + "path_type": "hardlink", + "sha256": "c7cc43fa7b7c8596eb2f8d06bf00191d37216c27c110d816fec059fc007735ec", + "size_in_bytes": 9310 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/ssse3/enc_reshuffle.c", + "path_type": "hardlink", + "sha256": "3e67f35028d8b77d9de867de23e63bca1212cb014e37593ade44f7e0fa916402", + "size_in_bytes": 1514 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/arch/ssse3/enc_translate.c", + "path_type": "hardlink", + "sha256": "32e6cb6fa1f7350c720630e7a8579d9f04441e9f414a91abfee93fae218beb69", + "size_in_bytes": 1171 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/codec_choose.c", + "path_type": "hardlink", + "sha256": "6dcfe82c2fc756fe233675cab89ddc9712591e96bcb820f147f827ae2ef3837c", + "size_in_bytes": 7590 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/codecs.h", + "path_type": "hardlink", + "sha256": "509f9a169a428f8bb83680aff5626da9e0565d8305fc963c260f29d4fa1ead4a", + "size_in_bytes": 1188 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/config.h", + "path_type": "hardlink", + "sha256": "d4e6c29c39151cb056f237b304b1be544b4abb132b9e9e11984dc7c530fb123f", + "size_in_bytes": 600 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/env.h", + "path_type": "hardlink", + "sha256": "ec116b1008ceedeca68f8537b7e1879036f70a00e5453bc53aa40b97f1115af4", + "size_in_bytes": 2453 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/lib.c", + "path_type": "hardlink", + "sha256": "5acaf5e868d9927655175f6c998dfcd995f16d96fde0970bdbc8e4141d06fd6a", + "size_in_bytes": 3270 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/lib_openmp.c", + "path_type": "hardlink", + "sha256": "e54c99ff258c8e6c98dcb82bf024c03e748d07b060243abe4a8c20b162856b1a", + "size_in_bytes": 4457 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/libbase64.h", + "path_type": "hardlink", + "sha256": "35304a925d52e89ece184a8e01088723012e35c4bd0850bc1cceede32ed84676", + "size_in_bytes": 4789 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/librt_base64.c", + "path_type": "hardlink", + "sha256": "40d314f9874248f1928fdf6d6609bb88586d48f8a5f69a2593973cc9f52024a6", + "size_in_bytes": 11681 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/librt_base64.h", + "path_type": "hardlink", + "sha256": "52c00d62d7f333fff71309d93da1cf082b18438468663ef56eb5971fcb42412f", + "size_in_bytes": 1754 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/tables/table_dec_32bit.h", + "path_type": "hardlink", + "sha256": "86e1c13346d084efaa698e152905d977fb0f1abfa11ae2e809002c05850b6e8d", + "size_in_bytes": 25258 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/tables/table_enc_12bit.h", + "path_type": "hardlink", + "sha256": "779a46a7a8898e646fbb2e77a12f500d0fe89bd45ae18f41aa7293c910c0f261", + "size_in_bytes": 74858 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/tables/tables.c", + "path_type": "hardlink", + "sha256": "f0432ede883ae7ffcecda1cefe56c893c64cb5d5f21ea7b88fb5692d17cf8206", + "size_in_bytes": 2051 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/base64/tables/tables.h", + "path_type": "hardlink", + "sha256": "567a7d60b7e268594acccdc95928b7149146e77addceb325bb0cf55ea4914af2", + "size_in_bytes": 704 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/build_setup.py", + "path_type": "hardlink", + "sha256": "adb8288a87852dbc8afca36e2d8c3077db273779030c5bfe41add00bc3731e0c", + "size_in_bytes": 2653 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/bytearray_extra_ops.c", + "path_type": "hardlink", + "sha256": "f29b042bf9378026bc30e761601130f4f3760044fc02216f7fd032f70c5d3857", + "size_in_bytes": 122 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/bytearray_extra_ops.h", + "path_type": "hardlink", + "sha256": "15a68c46e9abf2d7eb16bcb5d20cbee2c239f0a9b33d8ace1c0c0bd83f0f7090", + "size_in_bytes": 182 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/bytes_extra_ops.c", + "path_type": "hardlink", + "sha256": "0b8411407d21a1777022baf9b18f42456666b74ee74e574ebd7c265cd7e9b338", + "size_in_bytes": 1531 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/bytes_extra_ops.h", + "path_type": "hardlink", + "sha256": "ade92ca8e13be4bf5a1aab40b9c7d487b1367919b17525ff0c62e52d3bc2050e", + "size_in_bytes": 896 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/bytes_ops.c", + "path_type": "hardlink", + "sha256": "3bb17f18952f25ed0c5b629223d3a073962969d37390508ff2a55d9e542c5487", + "size_in_bytes": 7018 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/byteswriter_extra_ops.c", + "path_type": "hardlink", + "sha256": "160837995c7c21bbd864a0b288089b09090e44fc61f29c2d077c6d34854df66b", + "size_in_bytes": 1377 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/byteswriter_extra_ops.h", + "path_type": "hardlink", + "sha256": "abc498c68cf08f60fcdc40a48a21e6edac0477652466a657fa5309e7c2a1b037", + "size_in_bytes": 9460 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/dict_ops.c", + "path_type": "hardlink", + "sha256": "0bdc5ce773cfb61399ceef5996b6c793bdb32eb98eb755907b9d29414b1cc758", + "size_in_bytes": 12310 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/exc_ops.c", + "path_type": "hardlink", + "sha256": "e14c3761ff7d22c1a151aee5151101a24a9553151de3daaaa485dde780cbad4d", + "size_in_bytes": 8337 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/float_ops.c", + "path_type": "hardlink", + "sha256": "31d732acf1d2e3872df042df2e7184b945ef783eca8b2e289d3612487c0a0a25", + "size_in_bytes": 6326 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/function_wrapper.c", + "path_type": "hardlink", + "sha256": "8268b98791eecec70b5d4ba609aec1946be895b79b62d877bb2e3a02a4b9414e", + "size_in_bytes": 8723 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/generic_ops.c", + "path_type": "hardlink", + "sha256": "c931e2086e1d896f41e5ae34eccfb9c1094812a88216cfde29508c6af1c2d59b", + "size_in_bytes": 2419 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/getargs.c", + "path_type": "hardlink", + "sha256": "10018655c24ab8d5af678aff2dfcb9854be2a9928e6e8917003cae451f91f255", + "size_in_bytes": 15769 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/getargsfast.c", + "path_type": "hardlink", + "sha256": "34455d79c09976e5a3b8166540adf47788cefbf6bc9313c5166cd3208c0ec6bb", + "size_in_bytes": 18808 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/init.c", + "path_type": "hardlink", + "sha256": "47acba0a8b9c01a3228d07d37ed883e5ca9f8c958d4fe56a2ac83cf4633bf8aa", + "size_in_bytes": 807 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/int_ops.c", + "path_type": "hardlink", + "sha256": "8a34459ebb5d8605757331376fcbcd8809033db440ba740fd8551d459326afa9", + "size_in_bytes": 21587 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/internal/librt_internal.c", + "path_type": "hardlink", + "sha256": "5607f27af4346b600855b5f9a6377f611e74c92470ec50b83e87a9bb89906d05", + "size_in_bytes": 31116 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/internal/librt_internal.h", + "path_type": "hardlink", + "sha256": "df3df71338d86a5692fc05110252dc0eb289927e7a9e71ee9c63307dc071e420", + "size_in_bytes": 5202 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/list_ops.c", + "path_type": "hardlink", + "sha256": "02ca34e73344d8f6f52e1859dab261f7a7e7707f68bf61739ee8177a63ca3f27", + "size_in_bytes": 11625 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/misc_ops.c", + "path_type": "hardlink", + "sha256": "fa556f021ef383059796b060017b02f79b635ef762db69396c7e418e0f9d5d17", + "size_in_bytes": 52384 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/module_shim.tmpl", + "path_type": "hardlink", + "sha256": "1dc88ee3e7d9599e1d7bf5e36f53f79f6d1a8c9b9a6f9b6de48360b793da6fb8", + "size_in_bytes": 670 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/module_shim_no_gil_multiphase.tmpl", + "path_type": "hardlink", + "sha256": "744cb2cda1bac6622008ec96357eea0b862386048773fe7feb2346f966d4294a", + "size_in_bytes": 1205 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/mypyc_util.h", + "path_type": "hardlink", + "sha256": "3cddf657ac788698a9ee27cc5a851ceb30b4795cdc99e06e2efd848392aa8037", + "size_in_bytes": 6103 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/pythoncapi_compat.h", + "path_type": "hardlink", + "sha256": "4c5e92205751e8a604fc595673ed892fc19c646a6c75ffcba104848f4b9ad3fa", + "size_in_bytes": 70628 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/pythonsupport.c", + "path_type": "hardlink", + "sha256": "c4f795a7870e3f0df377ad06875c4b15221bec220b30259bf29655b6ca0d6b47", + "size_in_bytes": 5252 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/pythonsupport.h", + "path_type": "hardlink", + "sha256": "02ef4c4a4d267cf04e90eaf7850d64c9f9a6a805364eae398effd210f59572e2", + "size_in_bytes": 10320 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/set_ops.c", + "path_type": "hardlink", + "sha256": "f9f2260cc2fa0286eaefe3426dbdbc3b5f60e82d98c8790627a345d60b9e1c93", + "size_in_bytes": 351 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/static_data.c", + "path_type": "hardlink", + "sha256": "5452bf1915ee44888158ee2ca9c6b32884e3a001121e72b0853a0dac56becaa3", + "size_in_bytes": 2651 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/static_data.h", + "path_type": "hardlink", + "sha256": "8a1e29050968a4546151d8fc47c4d41802ab4bb72434d66d717ef0c5af5c2b0e", + "size_in_bytes": 1569 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/str_extra_ops.c", + "path_type": "hardlink", + "sha256": "092c70e4a3083e20cb59acf51336ebd80a8d422b334cab701c38b23b99cc5d2c", + "size_in_bytes": 147 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/str_extra_ops.h", + "path_type": "hardlink", + "sha256": "95f585ecb807caf0ca95426ccdb8e218f0c8a441d4556ba6e90157657cb13399", + "size_in_bytes": 865 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/str_ops.c", + "path_type": "hardlink", + "sha256": "e1e563fe7df9273ba1401c77ab680cd8870d90a38ec36605c9c1269a6ed57eb5", + "size_in_bytes": 26284 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/strings/librt_strings.c", + "path_type": "hardlink", + "sha256": "eba2be933187536ceb062bcd19199eb330019784e2910d2696c5553b57aeefef", + "size_in_bytes": 39842 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/strings/librt_strings.h", + "path_type": "hardlink", + "sha256": "5e479ea8a116218fd66c047a0c2ffb51056a818d63abbdbb88b1a3fefdcc810d", + "size_in_bytes": 4285 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/strings/librt_strings_common.h", + "path_type": "hardlink", + "sha256": "069ea9c686657ca4ce8d2c905ed0bab62a324090d5746f99fd17e0ebafe391c4", + "size_in_bytes": 11644 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/stringwriter_extra_ops.c", + "path_type": "hardlink", + "sha256": "01c3336eb2566c63acf7ebb42c578f5d5d1bea0e250534e2e6e923737b989a18", + "size_in_bytes": 390 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/stringwriter_extra_ops.h", + "path_type": "hardlink", + "sha256": "4eba453d662b4b01baacbd90f54003b03175eb2c2b80a13453cf3b52d8aaede1", + "size_in_bytes": 2200 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/time/librt_time.c", + "path_type": "hardlink", + "sha256": "a4280fe577c2d8960615f34364b30d9e16203781cc9c9a480f09668439be085b", + "size_in_bytes": 3843 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/time/librt_time.h", + "path_type": "hardlink", + "sha256": "225b6dce5c72281e169e4c973d0932f814b8902952f3770f00a81938b8abc47b", + "size_in_bytes": 1773 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/tuple_ops.c", + "path_type": "hardlink", + "sha256": "15eed38fc65517a1d356b7e5abdba6fab0c276e17e33ce3ab09d5361ba57e29d", + "size_in_bytes": 1956 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/vecs/librt_vecs.c", + "path_type": "hardlink", + "sha256": "a409b8652447296c7ce6b847dc5f090b570604d8fa622cd65e84a242c1773609", + "size_in_bytes": 32578 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/vecs/librt_vecs.h", + "path_type": "hardlink", + "sha256": "df53970f7aa8f0bc72f42251387ec583958eeb78f0dc7a88d604f28a88a9ba17", + "size_in_bytes": 25801 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/vecs/vec_bool.c", + "path_type": "hardlink", + "sha256": "7a125cfc1aabf5a3dee074e8759bcb1421231949e1f02805f1ce85bf500e9a5a", + "size_in_bytes": 550 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/vecs/vec_float.c", + "path_type": "hardlink", + "sha256": "96c11955a11219ca96d1374f0719b6e3fd21e8d4ccaaba59f0a09e3e1d90a519", + "size_in_bytes": 565 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/vecs/vec_i16.c", + "path_type": "hardlink", + "sha256": "b54811b838844dfc7bdbc487bc33acffd2ccddf59f8573ebbdf4e83f83edda2c", + "size_in_bytes": 540 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/vecs/vec_i32.c", + "path_type": "hardlink", + "sha256": "f3bc8ea4d3acefe95697508a907593a9488c22a5065e9ff7bc41c102366de806", + "size_in_bytes": 540 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/vecs/vec_i64.c", + "path_type": "hardlink", + "sha256": "c9c1dc33134253e7cbb72286d32879c64448315cfff3dae46b484aed79841134", + "size_in_bytes": 540 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/vecs/vec_nested.c", + "path_type": "hardlink", + "sha256": "47209f2c746cc96ea301bd901f59b3dc4a254499aac157c46c7c6e568766aee2", + "size_in_bytes": 15911 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/vecs/vec_t.c", + "path_type": "hardlink", + "sha256": "83c3b1d7d1fd337db73acb3e29b5ccbeba4cbe4231c26cb5db82043b41dcf2a4", + "size_in_bytes": 14945 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/vecs/vec_template.c", + "path_type": "hardlink", + "sha256": "db2fb9541e61778ead890dadfceff62c6968a7d9dba9f396bed6c0600a98e6e5", + "size_in_bytes": 12055 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/vecs/vec_u8.c", + "path_type": "hardlink", + "sha256": "395cca1292e6123ecd9f841530ab5b87798f84b6d46f94c1d100068a6a986bc9", + "size_in_bytes": 527 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/vecs/vecs_internal.h", + "path_type": "hardlink", + "sha256": "f767a265eff8aead34c60d34925f8c0cbd9de0f13ba24b6c80be34dee642ad18", + "size_in_bytes": 220 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/vecs_extra_ops.c", + "path_type": "hardlink", + "sha256": "3b48fd2dfb3feeae7f4b9d4edf96376f1d6cd1d107cf3b0a77aa804280d87061", + "size_in_bytes": 299 + }, + { + "_path": "Lib/site-packages/mypyc/lib-rt/vecs_extra_ops.h", + "path_type": "hardlink", + "sha256": "896a30a29b2fde3bea64da97be7c0bb6fbcd5f2bc5a20e5f9af1e2934c9ac005", + "size_in_bytes": 323 + }, + { + "_path": "Lib/site-packages/mypyc/lower/__init__.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "d1212918e82cdc6d5076b146288487dbaa10550956e8eef39f7ee393dfc659fc", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/lower/__init__.py", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypyc/lower/__pycache__/__init__.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "fc162f53f583e727ea6f4248ff0b2d6bdbfb15bf0954ea3d041ed038bbe9aca8", + "size_in_bytes": 140 + }, + { + "_path": "Lib/site-packages/mypyc/lower/__pycache__/int_ops.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "a98f11ea6e84130d4bd3d33d2f14f61f2b2de4f9cd23593eb8b7fe62c272f2bd", + "size_in_bytes": 6654 + }, + { + "_path": "Lib/site-packages/mypyc/lower/__pycache__/list_ops.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "d41b7b82212004a69140b9a0508f55ede81c7729c83eab1917fc5b6d9b5a9429", + "size_in_bytes": 3898 + }, + { + "_path": "Lib/site-packages/mypyc/lower/__pycache__/misc_ops.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "81d59d721667367c4f57d396399e7b5020f3de33421ef4b05a71f8a8f7c0b9b7", + "size_in_bytes": 1778 + }, + { + "_path": "Lib/site-packages/mypyc/lower/__pycache__/registry.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "7296198d09e72d07ddfbefb915c4cbd9991355b8f091ecb4e6ff92383e44af62", + "size_in_bytes": 1684 + }, + { + "_path": "Lib/site-packages/mypyc/lower/int_ops.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "cc0ef81fdcb1fa1192b46cee371244a353a6b80fae64deba275875b4fa63013e", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/lower/int_ops.py", + "path_type": "hardlink", + "sha256": "dd8890d6a739723349c29fd79bff2dced61c05c2afc6bd7fd583e60aa0023a76", + "size_in_bytes": 4777 + }, + { + "_path": "Lib/site-packages/mypyc/lower/list_ops.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "0ab6bb3101245a83fc5c83c2ece86abbf878cb89f873b7a0df302f3ed91acd77", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/lower/list_ops.py", + "path_type": "hardlink", + "sha256": "3993fc10456af88a44526f2506742a28d07706f243bb720b26d6e6e7f7602727", + "size_in_bytes": 2522 + }, + { + "_path": "Lib/site-packages/mypyc/lower/misc_ops.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "b67c6b020c368c0bd0add1a21b8c05b4d1fd6be6497886c65dd56d720acc3f6e", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/lower/misc_ops.py", + "path_type": "hardlink", + "sha256": "370e475c18cc99a09e3e90d0e78c6237dc65afc4e5e55b1797e628eb39c079a8", + "size_in_bytes": 920 + }, + { + "_path": "Lib/site-packages/mypyc/lower/registry.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "73988f087ac73e876047a057e05e725a3e22f4b9c0d84423e8d3c62fcbcf4cb4", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/lower/registry.py", + "path_type": "hardlink", + "sha256": "c1b3b583dad9d1795d14f8cd4d5967ea0c5c65b1f57cc7172d7d3725fb4d10e1", + "size_in_bytes": 844 + }, + { + "_path": "Lib/site-packages/mypyc/namegen.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "646eea9c6d29a5cc1b8b50d523f197c60bc482473f64524b25483f52ce0b72d0", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/namegen.py", + "path_type": "hardlink", + "sha256": "739a7bcb1c54c96a8944da8a9a4542475c56d2ee392db22ba933e74749fe23ae", + "size_in_bytes": 4934 + }, + { + "_path": "Lib/site-packages/mypyc/options.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "f5555f3207fcd6b99034b34f13716f2049f0974be9d56c9c4d59c9d90e23a21e", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/options.py", + "path_type": "hardlink", + "sha256": "9caf04d597b50bcafc6b49bddf8f543965a143118fac95e0714256be34a5f917", + "size_in_bytes": 3890 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/__init__.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "a217a7d5afe74f6b4a7b612dec9004da42d35a81decd6aa43d10d6019ca8d75c", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/__init__.py", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/__pycache__/__init__.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "0ed0bb545c2d809ecf4b9b9e1f1f3bd98593d4381d3c4fd00e7e30dd22a1bb93", + "size_in_bytes": 145 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/__pycache__/bytearray_ops.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "137098944a18d5469bffd0af45fb2fea814100c8f6adc2d0d423932e4077464a", + "size_in_bytes": 1305 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/__pycache__/bytes_ops.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "d48439dc848711b68c7e6a4f0e3f30042b95dd8cd68b7f552c933b33d2b3255c", + "size_in_bytes": 3004 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/__pycache__/dict_ops.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "55aa2d290e4ede47e86e5cec604a935c5f91d240e9fcc825d6cdb1e221183c45", + "size_in_bytes": 4563 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/__pycache__/exc_ops.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "bbbddecc999a836038e952b23e3a8c1a4fdeb39928f651e7a635ea7d33ab86a2", + "size_in_bytes": 1844 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/__pycache__/float_ops.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "85a38e663aabb122d6b66e09e629f197bbc9df15e204cf9bae28106dcf84b043", + "size_in_bytes": 2309 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/__pycache__/generic_ops.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "486cade6e197c555d31da1d2cbd5968cba5bbdc1e16d9895febbf69337df8e84", + "size_in_bytes": 6240 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/__pycache__/int_ops.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "6c78bb16010f0f3c785e1712402b2beb11d13301c0809d64f9f6475902e461be", + "size_in_bytes": 6880 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/__pycache__/librt_strings_ops.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "e5e5b6e13237904709349d2ce8db1bf677f19f79adf71780ed25be1ff1b55323", + "size_in_bytes": 6195 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/__pycache__/librt_time_ops.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "c569007e1c790b7ab641168da8090f184b98e6842afd3f69b3084785fb479687", + "size_in_bytes": 566 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/__pycache__/librt_vecs_ops.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "bc16cc380520ddf5c8a95c4e6e5fa19fda51ab0290dc82791ff57dc834ad280f", + "size_in_bytes": 637 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/__pycache__/list_ops.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "62fd323ff16cd8779cfa0392db49eff7080a85ca0544cfed89c0d294c8d08400", + "size_in_bytes": 4823 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/__pycache__/misc_ops.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "ced96da68383deabc71ff5ddbf1d9cae25a69c9e419e4df94e05f022f5093bbe", + "size_in_bytes": 8484 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/__pycache__/registry.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "95fa75d0f93a71166dfa1d86218225f54bf2c7dda03d4b26156d62a96929f711", + "size_in_bytes": 12711 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/__pycache__/set_ops.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "2e537a0a2b872cf7c85e041bb473529672db576945d2d43a188088804014e4e9", + "size_in_bytes": 2241 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/__pycache__/str_ops.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "2ba35a68d2e42727bcc57244d653245a905d9ccf1ed656324d1e32a764d333b6", + "size_in_bytes": 8427 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/__pycache__/tuple_ops.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "a002a6a7183ae11631335ab6c73548696619d75814e4713ae686cb6f730ce8ed", + "size_in_bytes": 2427 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/__pycache__/weakref_ops.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "37e8d7027889404ea23f3d6e9b98f82caca3e586b5edfac2adb0de7215a99e7b", + "size_in_bytes": 897 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/bytearray_ops.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "c717b03bead498264ba0007cbdd1d459831c2041f0a8a531238b93f5725ed39f", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/bytearray_ops.py", + "path_type": "hardlink", + "sha256": "fce65990a2731591c761b9f60369ae32b09cdefcd1bd50dc3177557f1416bc1b", + "size_in_bytes": 1387 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/bytes_ops.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "3a8b05e83e6067233e7f747f4e653b52b2f9cb6b83218e1b9b6fef966e0af519", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/bytes_ops.py", + "path_type": "hardlink", + "sha256": "674f100eba8b6994bc174b85ae500e1935f740ff3089d68e0de0783d49dab85c", + "size_in_bytes": 4936 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/dict_ops.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "0bb622116cdd56aebd5755af8fa448a03d4760751028b3cde8273468d175128d", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/dict_ops.py", + "path_type": "hardlink", + "sha256": "3d61006555df19abdf186180f24c950b0903dfebd1ed0ae4b35dcd002545e302", + "size_in_bytes": 8825 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/exc_ops.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "06cee49781e14261976a988caae020b0c44957b057279773751fdb3f1a707b6d", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/exc_ops.py", + "path_type": "hardlink", + "sha256": "24c9a0e3514a3cec06171356c088521430aac03ec6688b713e659e0da8cd3101", + "size_in_bytes": 3650 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/float_ops.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "5a17f30ad14c46e13ec2c53ceb32cfd315770062c98e4f21de9f3433fa49d3f9", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/float_ops.py", + "path_type": "hardlink", + "sha256": "b9665f84dea2c4ce3aa3e472bbd9d148b37ece8a6897c727b9d22b9d24517fb2", + "size_in_bytes": 4090 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/generic_ops.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "23ed79b6120fdcc27e3ad4ad5bc0938c5e44088e79ca5fbf3bcc9926daab3e2c", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/generic_ops.py", + "path_type": "hardlink", + "sha256": "3e40144f56257e9c1b78390c34d2d3c1cd35782aa62cfbf7fa453466dc305ac0", + "size_in_bytes": 11749 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/int_ops.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "67cb6cd37dccf8c6950bdcae15b4cc8a297361bea789bbcbbf688c26e0df5c40", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/int_ops.py", + "path_type": "hardlink", + "sha256": "e778ea82e52dcaf004086766e39659c380af6c9361f574bc492decdf82f24680", + "size_in_bytes": 10566 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/librt_strings_ops.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "6b229f507dabe9e460c1be9deed19470896e939b9faf7e8369257021394c519e", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/librt_strings_ops.py", + "path_type": "hardlink", + "sha256": "930425731f3829b43d0daac418ca1963c83389ac67c206589e698b1a77ecac00", + "size_in_bytes": 12903 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/librt_time_ops.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "1e9f2be66c2c928060d00f498996f4e40e316cf30b2d87940f27d4faa7a9e538", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/librt_time_ops.py", + "path_type": "hardlink", + "sha256": "b32c27b8111dc5045a7fbff958a7526a941ae6b7bb05e26551fb6dc67c902f89", + "size_in_bytes": 405 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/librt_vecs_ops.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "3caa7a9baa453cb0c7ff92ff5eed358e56c3f4ff61dddc73a8046e94c98683ff", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/librt_vecs_ops.py", + "path_type": "hardlink", + "sha256": "9faee9e9d3f772dea2a2fc3e5451b644c9dbb01142329ecc43d8762b53a803a7", + "size_in_bytes": 487 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/list_ops.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "29cd07a0e9e1f0ddd88c287eac12426dd470e7c8912c25bebedd489dc58453f0", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/list_ops.py", + "path_type": "hardlink", + "sha256": "6ae0f2e1f479c9ffb0191a61a347a56da67958f40c7bd4beb3ab3145c3375d5b", + "size_in_bytes": 9121 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/misc_ops.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "621d2f2a9000c02c3a2fd84096249eff5d361de315947e27a48add8148700e5a", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/misc_ops.py", + "path_type": "hardlink", + "sha256": "637bd78ad5f84f87bbed7de93a84ae79627a17a063124eb1ed2e2cdc8077b6aa", + "size_in_bytes": 17949 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/registry.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "760889b82b3f9558f4a6375cbd7336e30f82690a4e765e7ded134ce47795963f", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/registry.py", + "path_type": "hardlink", + "sha256": "56402132c1880dbabc2bff527ff3d187da6b2e5216d8199e0882812285d3e0a0", + "size_in_bytes": 13239 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/set_ops.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "28bf5ae9137cea0d891d870c7b29ed876acf4c5d913fc9acf179dc371d84a946", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/set_ops.py", + "path_type": "hardlink", + "sha256": "760cbfe8cd99b9082511895ff805f560d40f81a60af6e290f55af7b2f31fefaf", + "size_in_bytes": 3795 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/str_ops.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "fbb885f805d25756b64a90d839e8a4399c6768f25a7b189f38fadd2e9479f083", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/str_ops.py", + "path_type": "hardlink", + "sha256": "bc323787d381eca419d2634e4add68161471f93edfab1c186704e54b6458e882", + "size_in_bytes": 15715 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/tuple_ops.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "498a193df7d917b1976935ff21985abda2d28e5921b96e07c78197167383a6cf", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/tuple_ops.py", + "path_type": "hardlink", + "sha256": "3de0d5770664bcec6f9e738ffe2522e1cfabccf885e0ba9a52abf9caef7cfa54", + "size_in_bytes": 3752 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/weakref_ops.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "c102dc8b2179f04a2e0c48c93067e415a430b9040c7844d46ff15f2699787e37", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/primitives/weakref_ops.py", + "path_type": "hardlink", + "sha256": "8df8788f6c8ee4e005297b1241e24a3c82969778f79989f20e98f0823f665072", + "size_in_bytes": 1160 + }, + { + "_path": "Lib/site-packages/mypyc/py.typed", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypyc/rt_subtype.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "3b255d71db126450e116627b916ced22a54a298e9c2e37345f69d33c67cf1542", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/rt_subtype.py", + "path_type": "hardlink", + "sha256": "1b57c4ecfa6d491978cf702889fa8d9a65422ad862af6cf7770e04b43cb5495c", + "size_in_bytes": 2743 + }, + { + "_path": "Lib/site-packages/mypyc/sametype.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "5db9484e5b5f6430ac2ffcaae183f33833cb62305f2cf061a225b361a52ec369", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/sametype.py", + "path_type": "hardlink", + "sha256": "0a9718d9c9393583ce33aa63ca0ef72f1ae058e718aa021188b3f45bbf1e7e93", + "size_in_bytes": 2608 + }, + { + "_path": "Lib/site-packages/mypyc/subtype.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "e2a98a0012549b83230e345f0ad05a15c667fff413b932b1f756cb26b77007da", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/subtype.py", + "path_type": "hardlink", + "sha256": "01aff0d646d159809bf2bc54c3055f5a9ed40ace34b8c3695a588352c0ff7eb6", + "size_in_bytes": 3354 + }, + { + "_path": "Lib/site-packages/mypyc/test/__init__.py", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/__init__.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "3840ed1d749c4d1e0a203acf79569d2bd4e0a4b981c9fef707ae9fd649d15e20", + "size_in_bytes": 139 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/config.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "f779a89551dc99c542c4ae8aac14eb1c7e688418b30e91a64e7d0cb6b4cbfa9c", + "size_in_bytes": 784 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/librt_cache.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "bb85cfc7371749891bbf4b7d8c980223fef8aa648133923a2d72d82341ff3763", + "size_in_bytes": 12006 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_alwaysdefined.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "1f299630fd916124c4a02df9fe2eab1444467ea70bcd1bb45e50572f666fac44", + "size_in_bytes": 2648 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_analysis.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "c2e591ccf28f95a24b01d02c1cbe92473a15e18421fde6b5d71fa16c8092e11c", + "size_in_bytes": 5289 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_annotate.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "842e4ff299e494c79b2ec31cc7d890f9c86cb736f2aef1fad633f58593aedcf3", + "size_in_bytes": 3938 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_capsule_deps.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "8c2419c528fc02e834acdc0b8de46d3d8d1bac3067404d074695d82abb0b9f63", + "size_in_bytes": 3058 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_cheader.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "9d91448b61e64374d25190b0bc2ce50c5dadc627e7f5530cea34282ac5a5a3d9", + "size_in_bytes": 5676 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_commandline.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "b25c06dce53ea257689fb0bc1fe48d8048ec90df7e7a7f51c587fc8aa36cb1c0", + "size_in_bytes": 4441 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_emit.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "74a63fe31286dd19526505c6435beb1cb07bf4dab5666b4a5c140399a6dd820f", + "size_in_bytes": 13816 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_emitclass.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "c7e1aa8ec7b3f1c045df859d84ba05e7544ba1480138b01f1301d76b2b75f1e7", + "size_in_bytes": 2415 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_emitfunc.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "122b281732bc5b729bbe6e0bfdc23fe541333892b7ea26c0926c1fb511fbd9fc", + "size_in_bytes": 67733 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_emitwrapper.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "8e2935f9eb95f96c9b9bab94f7c1987ff5cf5008215db8aad2281cefec194334", + "size_in_bytes": 3498 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_exceptions.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "410fb16531036ee6243ab5e5df4a7a5c023537d5883daa4d7afad1b94f2593dc", + "size_in_bytes": 3605 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_external.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "30adaa87dd27c4f1bc0671f1567c467c3927fd081d22bd0c46919a22f306a217", + "size_in_bytes": 5784 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_irbuild.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "4fea403ee6b6855d2d8fc9e8e6e7cfe412cd15fe7dfdd060c5307d08903b5269", + "size_in_bytes": 4433 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_ircheck.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "93882993542368a0fbf7b4b9d4489cd563fc210283c5edb82550c101b194b418", + "size_in_bytes": 12275 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_literals.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "28def29999d467ab4a912c7de050845237bdf3109cb26da9375f3098e24239e0", + "size_in_bytes": 7011 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_lowering.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "96566f49558a19a183493324a41e776bd145f1a8597fe3109e1bebcdf7568e21", + "size_in_bytes": 3314 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_misc.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "541b6c27e8562e1d1e517a431c73ba07d56d8ac949090976baf4c59d9b80863d", + "size_in_bytes": 1567 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_namegen.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "1201d4ff2b7c9c29e3dec30be236ef2af2ad8911923d420f561a5f6b5b7955fd", + "size_in_bytes": 4671 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_optimizations.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "e657a4b7e1e454004a0f3e267a629c2d77f95f899a61b25a5dfbe53478da5bd9", + "size_in_bytes": 4459 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_pprint.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "bd67f38d29a0af45fd159d0fd0eafb4f2f1af7e07a31c1af21f347d6fd5c21a2", + "size_in_bytes": 3534 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_rarray.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "4be3e5dc3e11a4a804df84db9cb9c106fe6f79ccfd6711c0080fbf57015f8138", + "size_in_bytes": 3843 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_refcount.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "dbcf1c94fc3cebcbaa634d8732ddabca1ede7f1052e1eb6027fe12b73cfb0246", + "size_in_bytes": 3086 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_run.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "0f3ccf7659f20322a4f11cd90f9ba2921884750b729eb040ca0ac63ef2ff18d5", + "size_in_bytes": 26123 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_serialization.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "10b2b0bfdd704d30f2a2a445b24c79bfd02cff03ab72d21b2b3b09e8d6b12aad", + "size_in_bytes": 6815 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_statement.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "482391cb2071f20d47acef5633e7fc425ef2f1e7a6493271538ff5d02ac7f544", + "size_in_bytes": 8271 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_struct.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "d81d52e03a9af516f5399dcc52a494cadef031c8bd19cd52e0d4ddc54cb17d4e", + "size_in_bytes": 5926 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_tuplename.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "bfe2b0c2f29e613792d4719286217c32bb3966fad280de8589dcd7c5cd4144a6", + "size_in_bytes": 2348 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/test_typeops.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "78adc05a6f702f87d1287252cebbd3af86e3924670637a3168a587eb2067ff0d", + "size_in_bytes": 8126 + }, + { + "_path": "Lib/site-packages/mypyc/test/__pycache__/testutil.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "1c6229a7648d36efd2088ca946775d9d6716801a931243162626e1049d968616", + "size_in_bytes": 16850 + }, + { + "_path": "Lib/site-packages/mypyc/test/config.py", + "path_type": "hardlink", + "sha256": "667aee62ba23893fd91b846b633a044a83538996356d6ba4d124360856474d00", + "size_in_bytes": 406 + }, + { + "_path": "Lib/site-packages/mypyc/test/librt_cache.py", + "path_type": "hardlink", + "sha256": "9efb1485ed3f839cd9a30cefec42eb2101f7a2da35678484e8a459b1d0dd4e13", + "size_in_bytes": 8596 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_alwaysdefined.py", + "path_type": "hardlink", + "sha256": "36d271f1c61e53dc1b97282556209cd56c34c91ca81211255b51d5f7eee2fe89", + "size_in_bytes": 1528 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_analysis.py", + "path_type": "hardlink", + "sha256": "f137ad2cd62da3788edca0a312160a38cbcf90e73a1ebe6d55b12a768f06f339", + "size_in_bytes": 3265 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_annotate.py", + "path_type": "hardlink", + "sha256": "5a05ad62b3c7407bbc3d585b1e49381ae1bd5dffebeb756ee5a741924cd13dfa", + "size_in_bytes": 2600 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_capsule_deps.py", + "path_type": "hardlink", + "sha256": "156900dcd3d74fcc6b26297c8594205f381056ab1681f680c1f6ee0d931aad2b", + "size_in_bytes": 2002 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_cheader.py", + "path_type": "hardlink", + "sha256": "eb949c23e246bbfbfa1e5299b056deb096265b85a1de9d65b5fa7fce6b5e122e", + "size_in_bytes": 2974 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_commandline.py", + "path_type": "hardlink", + "sha256": "50b61a37d8268015f09c6515608ba2ff1f186e7cb75b2e4a287a6e25a797c45b", + "size_in_bytes": 2823 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_emit.py", + "path_type": "hardlink", + "sha256": "5c70aa8930d3b7729342248b31d17c0ed8c3a3fec22d0a1dc0e1e53791a166fa", + "size_in_bytes": 6519 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_emitclass.py", + "path_type": "hardlink", + "sha256": "0c4f6c1bd2bed392e36c3bd3e825a2743241fa89da6fb3b4b7c9761958636253", + "size_in_bytes": 1228 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_emitfunc.py", + "path_type": "hardlink", + "sha256": "df983f7eb657a3a3ecee842a4625138f6a93cdb0b4766da1951a0c3da5507fe4", + "size_in_bytes": 39997 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_emitwrapper.py", + "path_type": "hardlink", + "sha256": "0b6708e2d265a6ff92e17384d4d2061b9fa152c9b460b56780d07320df7264bf", + "size_in_bytes": 2219 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_exceptions.py", + "path_type": "hardlink", + "sha256": "c4a28caf2f44715e8cb239efdf1fc121a5cea03d58d1509916a1cab421f15dc6", + "size_in_bytes": 2145 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_external.py", + "path_type": "hardlink", + "sha256": "29c8305bf6bb2fc6edc8f9a8f3c61a14d43cbff383729af83ad892d9a2da95e0", + "size_in_bytes": 4029 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_irbuild.py", + "path_type": "hardlink", + "sha256": "c14235d28757b1bfba1c5c7250d1b55cea614507a1b6be7150faf18ae72af15a", + "size_in_bytes": 3074 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_ircheck.py", + "path_type": "hardlink", + "sha256": "392e72662a72f9b3825bdcc278f93e6fcc7ec67d9e2b9ca57bf6a81fa0ab4a22", + "size_in_bytes": 6891 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_literals.py", + "path_type": "hardlink", + "sha256": "568b29a97f35fac3518489f09e7c02f352b393dcf586bed4b272038c2d4d5e1b", + "size_in_bytes": 3325 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_lowering.py", + "path_type": "hardlink", + "sha256": "f239653b4fa62306dd7095f1160a63e1752ccbc5e26607de60975d9326b97f95", + "size_in_bytes": 2473 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_misc.py", + "path_type": "hardlink", + "sha256": "9dc97e9e9261db3f1d78068d2b7d25abb2c7dd1ec509a6e21210ff5700a5c1f2", + "size_in_bytes": 740 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_namegen.py", + "path_type": "hardlink", + "sha256": "199684fce19402939ff91cc929efb95e55472f9fabc2820d1213e8b42bb0c794", + "size_in_bytes": 2720 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_optimizations.py", + "path_type": "hardlink", + "sha256": "96eb64a0b02a1772bfa6b2685c1c85187572901f15858d5241cca2611b979a08", + "size_in_bytes": 2318 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_pprint.py", + "path_type": "hardlink", + "sha256": "ea47d22c3c84bcd5cf1a675bbc3a23338c047561688bee8e876dc01ce8f1fafe", + "size_in_bytes": 1281 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_rarray.py", + "path_type": "hardlink", + "sha256": "79521f05e476b7a17ed7a417ce7a727043790e4446600bd1fa135b90891a44fc", + "size_in_bytes": 1488 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_refcount.py", + "path_type": "hardlink", + "sha256": "3d27c8e0db1eb65e8ee6ec3d2678c07f21cc0dc0fd537aad2e7b281c982b9d96", + "size_in_bytes": 2058 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_run.py", + "path_type": "hardlink", + "sha256": "aa168f26eec9abf3570aa76365c7d679629a1b7b891410c410f62daaa5d13d58", + "size_in_bytes": 19669 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_serialization.py", + "path_type": "hardlink", + "sha256": "0c4116e2c9aadc4c69ff8c899df95db05706116995abeb861f7a0210ec74194d", + "size_in_bytes": 3881 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_statement.py", + "path_type": "hardlink", + "sha256": "dbb8cf49909b5d558b64abfb5b0acfa5aa93903845d9b47ba68b555bbbeb4f63", + "size_in_bytes": 5515 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_struct.py", + "path_type": "hardlink", + "sha256": "1047eef3af2e4a6d70266c28c2ad52fe0d7022751a5115fcb488683ea1b3b3cc", + "size_in_bytes": 3903 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_tuplename.py", + "path_type": "hardlink", + "sha256": "3f4dff35c230d67fa0e2f14e8a0fda297e5180baa80643b7c61eccd99cdeae48", + "size_in_bytes": 1044 + }, + { + "_path": "Lib/site-packages/mypyc/test/test_typeops.py", + "path_type": "hardlink", + "sha256": "150bd47ec8d328bfde20f6c1c5c7211bacebb1526f816a5be54df5e8daef142c", + "size_in_bytes": 3935 + }, + { + "_path": "Lib/site-packages/mypyc/test/testutil.py", + "path_type": "hardlink", + "sha256": "d4f0070210d0620f67a454b12c745c6ec075cc97a66d6b03c117577f0643acb4", + "size_in_bytes": 10252 + }, + { + "_path": "Lib/site-packages/mypyc/transform/__init__.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "3941ca626ce1ac3017cf7b30a8ddf67f02725cd4291a3232dcfa2f5fafcf00a3", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/transform/__init__.py", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/mypyc/transform/__pycache__/__init__.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "4a345a918cc2eee018da890bdbb6083412299d981c4aa0b6d26e193ad78340b7", + "size_in_bytes": 144 + }, + { + "_path": "Lib/site-packages/mypyc/transform/__pycache__/copy_propagation.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "706e26b3d0ddf2deb8db124330a0b82ecacee70e4e72b3e5f943abe5de60a6f8", + "size_in_bytes": 4591 + }, + { + "_path": "Lib/site-packages/mypyc/transform/__pycache__/exceptions.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "94d111c543b94bf75ba8580548576d8cd4fa570d22f024fc9312f43311a0b3c1", + "size_in_bytes": 8835 + }, + { + "_path": "Lib/site-packages/mypyc/transform/__pycache__/flag_elimination.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "1fc10a542e5642dddf5b48556bf9d00bb28ca00cd0b48741425d5a2047b8d4d9", + "size_in_bytes": 6043 + }, + { + "_path": "Lib/site-packages/mypyc/transform/__pycache__/ir_transform.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "6ddf3d5d0e9812ec89a6cc258f24411b3d4166b0a7887e81c9baa7cc591730eb", + "size_in_bytes": 34677 + }, + { + "_path": "Lib/site-packages/mypyc/transform/__pycache__/log_trace.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "fb8281a96fd7766ad8d991da3d0ceab211be766b4f4ab5b15fa1070a9edfb73c", + "size_in_bytes": 11888 + }, + { + "_path": "Lib/site-packages/mypyc/transform/__pycache__/lower.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "789311c5d0062eaf5e32c94dae29ee8fa6badfd4bfdfcc6ad4425063ea1574be", + "size_in_bytes": 2318 + }, + { + "_path": "Lib/site-packages/mypyc/transform/__pycache__/refcount.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "7032971ab4c0dd6b3cdb7c2b45725e28cc327403306456321def8acfe265bf90", + "size_in_bytes": 14451 + }, + { + "_path": "Lib/site-packages/mypyc/transform/__pycache__/spill.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "da7e9b72baa952b29fc5ed958c8c18e01528ec259c55372089e9ec6d1eb1a80c", + "size_in_bytes": 5606 + }, + { + "_path": "Lib/site-packages/mypyc/transform/__pycache__/uninit.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "7416d107db1f99531dab52fe12825c01764a63529661911ae28f699ddcb5b77a", + "size_in_bytes": 8534 + }, + { + "_path": "Lib/site-packages/mypyc/transform/copy_propagation.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "06a7f3d99838b64c83c7d8047dc2e6e83213dd34ba8855fe3422033d24e73201", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/transform/copy_propagation.py", + "path_type": "hardlink", + "sha256": "26b6cbdd8faa3e57121b2588dbf8c13be51ecc70eb31fda920823dc11bba7c92", + "size_in_bytes": 3435 + }, + { + "_path": "Lib/site-packages/mypyc/transform/exceptions.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "bfd160b9a62e7509993559e15aaa44e15a05340de35e79b6773d2d7f5de41291", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/transform/exceptions.py", + "path_type": "hardlink", + "sha256": "fbadae68e3c46419576ed24d57123f6e7458dc6f479a1479463971e765d3dd6a", + "size_in_bytes": 6797 + }, + { + "_path": "Lib/site-packages/mypyc/transform/flag_elimination.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "0fe8d9a116e2bef5c469713e510f99ef509952406f3c7ca9c42f2f3c3c50f059", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/transform/flag_elimination.py", + "path_type": "hardlink", + "sha256": "f38339554b79ee2123fb2251d365d5789b15fa7be260ee58a2a883b8e2b49312", + "size_in_bytes": 3531 + }, + { + "_path": "Lib/site-packages/mypyc/transform/ir_transform.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "c1c43d8b68ac8ad725785954235b9faa0a1c909232a541d725d931bd7760f691", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/transform/ir_transform.py", + "path_type": "hardlink", + "sha256": "5971d766029a729dee8da8c3d23960a6cf967951b7e9f11e6393bd8055632945", + "size_in_bytes": 11693 + }, + { + "_path": "Lib/site-packages/mypyc/transform/log_trace.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "acc5d8f9655789bd368f9f2e6d4e89267d69f86798f7166f6b654b3baae5b226", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/transform/log_trace.py", + "path_type": "hardlink", + "sha256": "fef2e2f66a1646946a8b9c3ce5d2d9b7b3a58349f41c23f087f34932ed205ff1", + "size_in_bytes": 5374 + }, + { + "_path": "Lib/site-packages/mypyc/transform/lower.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "3407a4272c0af35c5542ddbe280c9733cf6d27fe4e9cad8643502cd00ada95a9", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/transform/lower.py", + "path_type": "hardlink", + "sha256": "2df1450aa379fd7a084a81e80070e08154e8f44e3979e062467210cc95961c08", + "size_in_bytes": 1344 + }, + { + "_path": "Lib/site-packages/mypyc/transform/refcount.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "05d0c6126964076c78492cdbbffee3d906dc09e444942fdbdbb35cb02c3a53d9", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/transform/refcount.py", + "path_type": "hardlink", + "sha256": "896d348a85e9b6765efc22bdc815ded5d21a8de1eac1ea372cd94aa8754ca1b4", + "size_in_bytes": 10109 + }, + { + "_path": "Lib/site-packages/mypyc/transform/spill.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "29fba773af055a67343cced2a101370be84480b1166cea4bdc4cb057b8445b01", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/transform/spill.py", + "path_type": "hardlink", + "sha256": "74eed6dad0a1cb3a5bdc4fd4b78443e75d1222bbc0bbe995338e7f911d7724b9", + "size_in_bytes": 4185 + }, + { + "_path": "Lib/site-packages/mypyc/transform/uninit.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "a813a4fe15ea0648d1473fccc0b15a9c80860c9457e80e862ad553d0e3d272c2", + "size_in_bytes": 10752 + }, + { + "_path": "Lib/site-packages/mypyc/transform/uninit.py", + "path_type": "hardlink", + "sha256": "a18ef68895ca0e45b0613e0db041cc647feed53a5c14aa76121b26913c058ded", + "size_in_bytes": 7307 + }, + { + "_path": "Scripts/dmypy-script.py", + "path_type": "hardlink", + "sha256": "019c096042f193592283534188ca5737cf859285aa5db80526430ac99f6d54e5", + "size_in_bytes": 229 + }, + { + "_path": "Scripts/dmypy.exe", + "path_type": "hardlink", + "sha256": "f24d102084620e54fe68d07f6e9169118b283f8d33d0c8f4b974c2e05a306059", + "size_in_bytes": 54032 + }, + { + "_path": "Scripts/mypy-script.py", + "path_type": "hardlink", + "sha256": "e349ec616acf9c4a7332ca0138a0a837cc5ed74ffafc6ad71a0a1f80c7e9e82f", + "size_in_bytes": 225 + }, + { + "_path": "Scripts/mypy.exe", + "path_type": "hardlink", + "sha256": "f24d102084620e54fe68d07f6e9169118b283f8d33d0c8f4b974c2e05a306059", + "size_in_bytes": 54032 + }, + { + "_path": "Scripts/mypyc-script.py", + "path_type": "hardlink", + "sha256": "4149c537e1c6874d3009ddc09477984d0d572ec6d8b6c006fa9faf54a467724a", + "size_in_bytes": 208 + }, + { + "_path": "Scripts/mypyc.exe", + "path_type": "hardlink", + "sha256": "f24d102084620e54fe68d07f6e9169118b283f8d33d0c8f4b974c2e05a306059", + "size_in_bytes": 54032 + }, + { + "_path": "Scripts/stubgen-script.py", + "path_type": "hardlink", + "sha256": "3fe4e91dc8e0d27cfc7690bf61fa94bd07069c9d9dfe19fefed8270145b60cfe", + "size_in_bytes": 206 + }, + { + "_path": "Scripts/stubgen.exe", + "path_type": "hardlink", + "sha256": "f24d102084620e54fe68d07f6e9169118b283f8d33d0c8f4b974c2e05a306059", + "size_in_bytes": 54032 + }, + { + "_path": "Scripts/stubtest-script.py", + "path_type": "hardlink", + "sha256": "87f550d5042b6959f1095114827bc582c72c4ad0a6d8874c03e82c7822e52623", + "size_in_bytes": 207 + }, + { + "_path": "Scripts/stubtest.exe", + "path_type": "hardlink", + "sha256": "f24d102084620e54fe68d07f6e9169118b283f8d33d0c8f4b974c2e05a306059", + "size_in_bytes": 54032 + } + ], + "paths_version": 1 +} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/info/repodata_record.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/info/repodata_record.json new file mode 100644 index 0000000000000000000000000000000000000000..ffd4d265a8a565713b95f0a1a8855ba275a0d401 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/info/repodata_record.json @@ -0,0 +1,32 @@ +{ + "arch": "x86_64", + "build": "py314hac7e1cd_0", + "build_number": 0, + "build_string": "py314hac7e1cd_0", + "channel": "conda-forge", + "constrains": [], + "depends": [ + "mypy_extensions >=1.0.0", + "pathspec >=1.0.0", + "psutil >=4.0", + "python >=3.14,<3.15.0a0", + "python-librt >=0.8.0", + "python_abi 3.14.* *_cp314t", + "typing_extensions >=4.6.0", + "ucrt >=10.0.20348.0", + "vc >=14.3,<15", + "vc14_runtime >=14.44.35208" + ], + "fn": "mypy-1.20.2-py314hac7e1cd_0.conda", + "license": "MIT", + "license_family": "MIT", + "md5": "8d59c9d09ccd6f5123d5964ebbd3c942", + "name": "mypy", + "platform": "win", + "sha256": "6deec2fd0ebf40aca71334a48b6c6a04b50e5f5ffe8d2146f0c0490de79e2018", + "size": 10540298, + "subdir": "win-64", + "timestamp": 1776802451, + "url": "https://conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0.conda", + "version": "1.20.2" +} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/bin/c_rehash.pl b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/bin/c_rehash.pl new file mode 100644 index 0000000000000000000000000000000000000000..3370d58227ba870e74140bb092237de406881d1c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/bin/c_rehash.pl @@ -0,0 +1,253 @@ +#!/usr/bin/env perl + +# WARNING: do not edit! +# Generated by makefile from tools\c_rehash.in +# Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved. +# +# Licensed under the Apache License 2.0 (the "License"). You may not use +# this file except in compliance with the License. You can obtain a copy +# in the file LICENSE in the source distribution or at +# https://www.openssl.org/source/license.html + +# Perl c_rehash script, scan all files in a directory +# and add symbolic links to their hash values. + +my $dir = "C:\\Program Files\\Common Files\\ssl"; +my $prefix = "D:\\bld\\openssl_split_1775587024900\\_h_env\\Library"; + +my $errorcount = 0; +my $openssl = $ENV{OPENSSL} || "openssl"; +my $pwd; +my $x509hash = "-subject_hash"; +my $crlhash = "-hash"; +my $verbose = 0; +my $symlink_exists=eval {symlink("",""); 1}; +my $removelinks = 1; + +## Parse flags. +while ( $ARGV[0] =~ /^-/ ) { + my $flag = shift @ARGV; + last if ( $flag eq '--'); + if ( $flag eq '-old') { + $x509hash = "-subject_hash_old"; + $crlhash = "-hash_old"; + } elsif ( $flag eq '-h' || $flag eq '-help' ) { + help(); + } elsif ( $flag eq '-n' ) { + $removelinks = 0; + } elsif ( $flag eq '-v' ) { + $verbose++; + } + else { + print STDERR "Usage error; try -h.\n"; + exit 1; + } +} + +sub help { + print "Usage: c_rehash [-old] [-h] [-help] [-v] [dirs...]\n"; + print " -old use old-style digest\n"; + print " -h or -help print this help text\n"; + print " -v print files removed and linked\n"; + exit 0; +} + +eval "require Cwd"; +if (defined(&Cwd::getcwd)) { + $pwd=Cwd::getcwd(); +} else { + $pwd=`pwd`; + chomp($pwd); +} + +# DOS/Win32 or Unix delimiter? Prefix our installdir, then search. +my $path_delim = ($pwd =~ /^[a-z]\:/i) ? ';' : ':'; +$ENV{PATH} = "$prefix/bin" . ($ENV{PATH} ? $path_delim . $ENV{PATH} : ""); + +if (!(-f $openssl && -x $openssl)) { + my $found = 0; + foreach (split /$path_delim/, $ENV{PATH}) { + if (-f "$_/$openssl" && -x "$_/$openssl") { + $found = 1; + $openssl = "$_/$openssl"; + last; + } + } + if ($found == 0) { + print STDERR "c_rehash: rehashing skipped ('openssl' program not available)\n"; + exit 0; + } +} + +if (@ARGV) { + @dirlist = @ARGV; +} elsif ($ENV{SSL_CERT_DIR}) { + @dirlist = split /$path_delim/, $ENV{SSL_CERT_DIR}; +} else { + $dirlist[0] = "$dir/certs"; +} + +if (-d $dirlist[0]) { + chdir $dirlist[0]; + $openssl="$pwd/$openssl" if (!(-f $openssl && -x $openssl)); + chdir $pwd; +} + +foreach (@dirlist) { + if (-d $_ ) { + if ( -w $_) { + hash_dir($_); + } else { + print "Skipping $_, can't write\n"; + $errorcount++; + } + } +} +exit($errorcount); + +sub copy_file { + my ($src_fname, $dst_fname) = @_; + + if (open(my $in, "<", $src_fname)) { + if (open(my $out, ">", $dst_fname)) { + print $out $_ while (<$in>); + close $out; + } else { + warn "Cannot open $dst_fname for write, $!"; + } + close $in; + } else { + warn "Cannot open $src_fname for read, $!"; + } +} + +sub hash_dir { + my $dir = shift; + my %hashlist; + + print "Doing $dir\n"; + + if (!chdir $dir) { + print STDERR "WARNING: Cannot chdir to '$dir', $!\n"; + return; + } + + opendir(DIR, ".") || print STDERR "WARNING: Cannot opendir '.', $!\n"; + my @flist = sort readdir(DIR); + closedir DIR; + if ( $removelinks ) { + # Delete any existing symbolic links + foreach (grep {/^[\da-f]+\.r{0,1}\d+$/} @flist) { + if (-l $_) { + print "unlink $_\n" if $verbose; + unlink $_ || warn "Can't unlink $_, $!\n"; + } + } + } + FILE: foreach $fname (grep {/\.(pem|crt|cer|crl)$/} @flist) { + # Check to see if certificates and/or CRLs present. + my ($cert, $crl) = check_file($fname); + if (!$cert && !$crl) { + print STDERR "WARNING: $fname does not contain a certificate or CRL: skipping\n"; + next; + } + link_hash_cert($fname) if ($cert); + link_hash_crl($fname) if ($crl); + } + + chdir $pwd; +} + +sub check_file { + my ($is_cert, $is_crl) = (0,0); + my $fname = $_[0]; + + open(my $in, "<", $fname); + while(<$in>) { + if (/^-----BEGIN (.*)-----/) { + my $hdr = $1; + if ($hdr =~ /^(X509 |TRUSTED |)CERTIFICATE$/) { + $is_cert = 1; + last if ($is_crl); + } elsif ($hdr eq "X509 CRL") { + $is_crl = 1; + last if ($is_cert); + } + } + } + close $in; + return ($is_cert, $is_crl); +} + +sub compute_hash { + my $fh; + if ( $^O eq "VMS" ) { + # VMS uses the open through shell + # The file names are safe there and list form is unsupported + if (!open($fh, "-|", join(' ', @_))) { + print STDERR "Cannot compute hash on '$fname'\n"; + return; + } + } else { + if (!open($fh, "-|", @_)) { + print STDERR "Cannot compute hash on '$fname'\n"; + return; + } + binmode($fh, ":crlf"); + } + return (<$fh>, <$fh>); +} + +# Link a certificate to its subject name hash value, each hash is of +# the form . where n is an integer. If the hash value already exists +# then we need to up the value of n, unless its a duplicate in which +# case we skip the link. We check for duplicates by comparing the +# certificate fingerprints + +sub link_hash_cert { + link_hash($_[0], 'cert'); +} + +# Same as above except for a CRL. CRL links are of the form .r + +sub link_hash_crl { + link_hash($_[0], 'crl'); +} + +sub link_hash { + my ($fname, $type) = @_; + my $is_cert = $type eq 'cert'; + + my ($hash, $fprint) = compute_hash($openssl, + $is_cert ? "x509" : "crl", + $is_cert ? $x509hash : $crlhash, + "-fingerprint", "-noout", + "-in", $fname); + chomp $hash; + $hash =~ s/^.*=// if !$is_cert; + chomp $fprint; + return if !$hash; + $fprint =~ s/^.*=//; + $fprint =~ tr/://d; + my $suffix = 0; + # Search for an unused hash filename + my $crlmark = $is_cert ? "" : "r"; + while(exists $hashlist{"$hash.$crlmark$suffix"}) { + # Hash matches: if fingerprint matches its a duplicate cert + if ($hashlist{"$hash.$crlmark$suffix"} eq $fprint) { + my $what = $is_cert ? 'certificate' : 'CRL'; + print STDERR "WARNING: Skipping duplicate $what $fname\n"; + return; + } + $suffix++; + } + $hash .= ".$crlmark$suffix"; + if ($symlink_exists) { + print "link $fname -> $hash\n" if $verbose; + symlink $fname, $hash || warn "Can't symlink, $!"; + } else { + print "copy $fname -> $hash\n" if $verbose; + copy_file($fname, $hash); + } + $hashlist{$hash} = $fprint; +} diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/__DECC_INCLUDE_EPILOGUE.H b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/__DECC_INCLUDE_EPILOGUE.H new file mode 100644 index 0000000000000000000000000000000000000000..d251d0a03cfdb5023bde332ca00ac1b5076db230 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/__DECC_INCLUDE_EPILOGUE.H @@ -0,0 +1,22 @@ +/* + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* + * This file is only used by HP C/C++ on VMS, and is included automatically + * after each header file from this directory + */ + +/* + * The C++ compiler doesn't understand these pragmas, even though it + * understands the corresponding command line qualifier. + */ +#ifndef __cplusplus +/* restore state. Must correspond to the save in __decc_include_prologue.h */ +# pragma names restore +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/__DECC_INCLUDE_PROLOGUE.H b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/__DECC_INCLUDE_PROLOGUE.H new file mode 100644 index 0000000000000000000000000000000000000000..91ac6b33caf402410e41b96a31da9ecb98a5b4c6 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/__DECC_INCLUDE_PROLOGUE.H @@ -0,0 +1,26 @@ +/* + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* + * This file is only used by HP C/C++ on VMS, and is included automatically + * after each header file from this directory + */ + +/* + * The C++ compiler doesn't understand these pragmas, even though it + * understands the corresponding command line qualifier. + */ +#ifndef __cplusplus +/* save state */ +# pragma names save +/* have the compiler shorten symbols larger than 31 chars to 23 chars + * followed by a 8 hex char CRC + */ +# pragma names as_is,shortened +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/aes.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/aes.h new file mode 100644 index 0000000000000000000000000000000000000000..2b6c683988266078d502579cbab340540ec30f25 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/aes.h @@ -0,0 +1,109 @@ +/* + * Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_AES_H +#define OPENSSL_AES_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_AES_H +#endif + +#include + +#include +#ifdef __cplusplus +extern "C" { +#endif + +#define AES_BLOCK_SIZE 16 + +#ifndef OPENSSL_NO_DEPRECATED_3_0 + +#define AES_ENCRYPT 1 +#define AES_DECRYPT 0 + +#define AES_MAXNR 14 + +/* This should be a hidden type, but EVP requires that the size be known */ +struct aes_key_st { +#ifdef AES_LONG + unsigned long rd_key[4 * (AES_MAXNR + 1)]; +#else + unsigned int rd_key[4 * (AES_MAXNR + 1)]; +#endif + int rounds; +}; +typedef struct aes_key_st AES_KEY; + +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 const char *AES_options(void); +OSSL_DEPRECATEDIN_3_0 +int AES_set_encrypt_key(const unsigned char *userKey, const int bits, + AES_KEY *key); +OSSL_DEPRECATEDIN_3_0 +int AES_set_decrypt_key(const unsigned char *userKey, const int bits, + AES_KEY *key); +OSSL_DEPRECATEDIN_3_0 +void AES_encrypt(const unsigned char *in, unsigned char *out, + const AES_KEY *key); +OSSL_DEPRECATEDIN_3_0 +void AES_decrypt(const unsigned char *in, unsigned char *out, + const AES_KEY *key); +OSSL_DEPRECATEDIN_3_0 +void AES_ecb_encrypt(const unsigned char *in, unsigned char *out, + const AES_KEY *key, const int enc); +OSSL_DEPRECATEDIN_3_0 +void AES_cbc_encrypt(const unsigned char *in, unsigned char *out, + size_t length, const AES_KEY *key, + unsigned char *ivec, const int enc); +OSSL_DEPRECATEDIN_3_0 +void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out, + size_t length, const AES_KEY *key, + unsigned char *ivec, int *num, const int enc); +OSSL_DEPRECATEDIN_3_0 +void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out, + size_t length, const AES_KEY *key, + unsigned char *ivec, int *num, const int enc); +OSSL_DEPRECATEDIN_3_0 +void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out, + size_t length, const AES_KEY *key, + unsigned char *ivec, int *num, const int enc); +OSSL_DEPRECATEDIN_3_0 +void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out, + size_t length, const AES_KEY *key, + unsigned char *ivec, int *num); + +/* NB: the IV is _two_ blocks long */ +OSSL_DEPRECATEDIN_3_0 +void AES_ige_encrypt(const unsigned char *in, unsigned char *out, + size_t length, const AES_KEY *key, + unsigned char *ivec, const int enc); +/* NB: the IV is _four_ blocks long */ +OSSL_DEPRECATEDIN_3_0 +void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out, + size_t length, const AES_KEY *key, const AES_KEY *key2, + const unsigned char *ivec, const int enc); +OSSL_DEPRECATEDIN_3_0 +int AES_wrap_key(AES_KEY *key, const unsigned char *iv, + unsigned char *out, const unsigned char *in, + unsigned int inlen); +OSSL_DEPRECATEDIN_3_0 +int AES_unwrap_key(AES_KEY *key, const unsigned char *iv, + unsigned char *out, const unsigned char *in, + unsigned int inlen); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/applink.c b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/applink.c new file mode 100644 index 0000000000000000000000000000000000000000..40aa9466757fb0fe1b8d1a8aeb73c80bf9974c40 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/applink.c @@ -0,0 +1,151 @@ +/* + * Copyright 2004-2023 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#define APPLINK_STDIN 1 +#define APPLINK_STDOUT 2 +#define APPLINK_STDERR 3 +#define APPLINK_FPRINTF 4 +#define APPLINK_FGETS 5 +#define APPLINK_FREAD 6 +#define APPLINK_FWRITE 7 +#define APPLINK_FSETMOD 8 +#define APPLINK_FEOF 9 +#define APPLINK_FCLOSE 10 /* should not be used */ + +#define APPLINK_FOPEN 11 /* solely for completeness */ +#define APPLINK_FSEEK 12 +#define APPLINK_FTELL 13 +#define APPLINK_FFLUSH 14 +#define APPLINK_FERROR 15 +#define APPLINK_CLEARERR 16 +#define APPLINK_FILENO 17 /* to be used with below */ + +#define APPLINK_OPEN 18 /* formally can't be used, as flags can vary */ +#define APPLINK_READ 19 +#define APPLINK_WRITE 20 +#define APPLINK_LSEEK 21 +#define APPLINK_CLOSE 22 +#define APPLINK_MAX 22 /* always same as last macro */ + +#ifndef APPMACROS_ONLY + +/* + * Normally, do not define APPLINK_NO_INCLUDES. Define it if you are using + * symbol preprocessing and do not want the preprocessing to affect the + * following included header files. You will need to put these + * include lines somewhere in the file that is including applink.c. + */ +#ifndef APPLINK_NO_INCLUDES +#include +#include +#include +#endif + +#ifdef __BORLANDC__ +/* _lseek in is a function-like macro so we can't take its address */ +#undef _lseek +#define _lseek lseek +#endif + +static void *app_stdin(void) +{ + return stdin; +} + +static void *app_stdout(void) +{ + return stdout; +} + +static void *app_stderr(void) +{ + return stderr; +} + +static int app_feof(FILE *fp) +{ + return feof(fp); +} + +static int app_ferror(FILE *fp) +{ + return ferror(fp); +} + +static void app_clearerr(FILE *fp) +{ + clearerr(fp); +} + +static int app_fileno(FILE *fp) +{ + return _fileno(fp); +} + +static int app_fsetmod(FILE *fp, char mod) +{ + return _setmode(_fileno(fp), mod == 'b' ? _O_BINARY : _O_TEXT); +} + +#ifdef __cplusplus +extern "C" { +#endif + +__declspec(dllexport) void ** +#if defined(__BORLANDC__) + /* + * __stdcall appears to be the only way to get the name + * decoration right with Borland C. Otherwise it works + * purely incidentally, as we pass no parameters. + */ + __stdcall +#else + __cdecl +#endif + OPENSSL_Applink(void) +{ + static int once = 1; + static void *OPENSSL_ApplinkTable[APPLINK_MAX + 1] = { (void *)APPLINK_MAX }; + + if (once) { + OPENSSL_ApplinkTable[APPLINK_STDIN] = app_stdin; + OPENSSL_ApplinkTable[APPLINK_STDOUT] = app_stdout; + OPENSSL_ApplinkTable[APPLINK_STDERR] = app_stderr; + OPENSSL_ApplinkTable[APPLINK_FPRINTF] = fprintf; + OPENSSL_ApplinkTable[APPLINK_FGETS] = fgets; + OPENSSL_ApplinkTable[APPLINK_FREAD] = fread; + OPENSSL_ApplinkTable[APPLINK_FWRITE] = fwrite; + OPENSSL_ApplinkTable[APPLINK_FSETMOD] = app_fsetmod; + OPENSSL_ApplinkTable[APPLINK_FEOF] = app_feof; + OPENSSL_ApplinkTable[APPLINK_FCLOSE] = fclose; + + OPENSSL_ApplinkTable[APPLINK_FOPEN] = fopen; + OPENSSL_ApplinkTable[APPLINK_FSEEK] = fseek; + OPENSSL_ApplinkTable[APPLINK_FTELL] = ftell; + OPENSSL_ApplinkTable[APPLINK_FFLUSH] = fflush; + OPENSSL_ApplinkTable[APPLINK_FERROR] = app_ferror; + OPENSSL_ApplinkTable[APPLINK_CLEARERR] = app_clearerr; + OPENSSL_ApplinkTable[APPLINK_FILENO] = app_fileno; + + OPENSSL_ApplinkTable[APPLINK_OPEN] = _open; + OPENSSL_ApplinkTable[APPLINK_READ] = _read; + OPENSSL_ApplinkTable[APPLINK_WRITE] = _write; + OPENSSL_ApplinkTable[APPLINK_LSEEK] = _lseek; + OPENSSL_ApplinkTable[APPLINK_CLOSE] = _close; + + once = 0; + } + + return OPENSSL_ApplinkTable; +} + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/asn1.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/asn1.h new file mode 100644 index 0000000000000000000000000000000000000000..480f4f396eb3af00ad4365241c12563569e709f1 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/asn1.h @@ -0,0 +1,1125 @@ +/* + * WARNING: do not edit! + * Generated by makefile from include\openssl\asn1.h.in + * + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* clang-format off */ + +/* clang-format on */ + +#ifndef OPENSSL_ASN1_H +#define OPENSSL_ASN1_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_ASN1_H +#endif + +#ifndef OPENSSL_NO_STDIO +#include +#endif +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#ifdef OPENSSL_BUILD_SHLIBCRYPTO +#undef OPENSSL_EXTERN +#define OPENSSL_EXTERN OPENSSL_EXPORT +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define V_ASN1_UNIVERSAL 0x00 +#define V_ASN1_APPLICATION 0x40 +#define V_ASN1_CONTEXT_SPECIFIC 0x80 +#define V_ASN1_PRIVATE 0xc0 + +#define V_ASN1_CONSTRUCTED 0x20 +#define V_ASN1_PRIMITIVE_TAG 0x1f +#define V_ASN1_PRIMATIVE_TAG /*compat*/ V_ASN1_PRIMITIVE_TAG + +#define V_ASN1_APP_CHOOSE -2 /* let the recipient choose */ +#define V_ASN1_OTHER -3 /* used in ASN1_TYPE */ +#define V_ASN1_ANY -4 /* used in ASN1 template code */ + +#define V_ASN1_UNDEF -1 +/* ASN.1 tag values */ +#define V_ASN1_EOC 0 +#define V_ASN1_BOOLEAN 1 +#define V_ASN1_INTEGER 2 +#define V_ASN1_BIT_STRING 3 +#define V_ASN1_OCTET_STRING 4 +#define V_ASN1_NULL 5 +#define V_ASN1_OBJECT 6 +#define V_ASN1_OBJECT_DESCRIPTOR 7 +#define V_ASN1_EXTERNAL 8 +#define V_ASN1_REAL 9 +#define V_ASN1_ENUMERATED 10 +#define V_ASN1_UTF8STRING 12 +#define V_ASN1_SEQUENCE 16 +#define V_ASN1_SET 17 +#define V_ASN1_NUMERICSTRING 18 +#define V_ASN1_PRINTABLESTRING 19 +#define V_ASN1_T61STRING 20 +#define V_ASN1_TELETEXSTRING 20 /* alias */ +#define V_ASN1_VIDEOTEXSTRING 21 +#define V_ASN1_IA5STRING 22 +#define V_ASN1_UTCTIME 23 +#define V_ASN1_GENERALIZEDTIME 24 +#define V_ASN1_GRAPHICSTRING 25 +#define V_ASN1_ISO64STRING 26 +#define V_ASN1_VISIBLESTRING 26 /* alias */ +#define V_ASN1_GENERALSTRING 27 +#define V_ASN1_UNIVERSALSTRING 28 +#define V_ASN1_BMPSTRING 30 + +/* + * NB the constants below are used internally by ASN1_INTEGER + * and ASN1_ENUMERATED to indicate the sign. They are *not* on + * the wire tag values. + */ + +#define V_ASN1_NEG 0x100 +#define V_ASN1_NEG_INTEGER (2 | V_ASN1_NEG) +#define V_ASN1_NEG_ENUMERATED (10 | V_ASN1_NEG) + +/* For use with d2i_ASN1_type_bytes() */ +#define B_ASN1_NUMERICSTRING 0x0001 +#define B_ASN1_PRINTABLESTRING 0x0002 +#define B_ASN1_T61STRING 0x0004 +#define B_ASN1_TELETEXSTRING 0x0004 +#define B_ASN1_VIDEOTEXSTRING 0x0008 +#define B_ASN1_IA5STRING 0x0010 +#define B_ASN1_GRAPHICSTRING 0x0020 +#define B_ASN1_ISO64STRING 0x0040 +#define B_ASN1_VISIBLESTRING 0x0040 +#define B_ASN1_GENERALSTRING 0x0080 +#define B_ASN1_UNIVERSALSTRING 0x0100 +#define B_ASN1_OCTET_STRING 0x0200 +#define B_ASN1_BIT_STRING 0x0400 +#define B_ASN1_BMPSTRING 0x0800 +#define B_ASN1_UNKNOWN 0x1000 +#define B_ASN1_UTF8STRING 0x2000 +#define B_ASN1_UTCTIME 0x4000 +#define B_ASN1_GENERALIZEDTIME 0x8000 +#define B_ASN1_SEQUENCE 0x10000 +/* For use with ASN1_mbstring_copy() */ +#define MBSTRING_FLAG 0x1000 +#define MBSTRING_UTF8 (MBSTRING_FLAG) +#define MBSTRING_ASC (MBSTRING_FLAG | 1) +#define MBSTRING_BMP (MBSTRING_FLAG | 2) +#define MBSTRING_UNIV (MBSTRING_FLAG | 4) +#define SMIME_OLDMIME 0x400 +#define SMIME_CRLFEOL 0x800 +#define SMIME_STREAM 0x1000 + +/* Stacks for types not otherwise defined in this header */ +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(X509_ALGOR, X509_ALGOR, X509_ALGOR) +#define sk_X509_ALGOR_num(sk) OPENSSL_sk_num(ossl_check_const_X509_ALGOR_sk_type(sk)) +#define sk_X509_ALGOR_value(sk, idx) ((X509_ALGOR *)OPENSSL_sk_value(ossl_check_const_X509_ALGOR_sk_type(sk), (idx))) +#define sk_X509_ALGOR_new(cmp) ((STACK_OF(X509_ALGOR) *)OPENSSL_sk_new(ossl_check_X509_ALGOR_compfunc_type(cmp))) +#define sk_X509_ALGOR_new_null() ((STACK_OF(X509_ALGOR) *)OPENSSL_sk_new_null()) +#define sk_X509_ALGOR_new_reserve(cmp, n) ((STACK_OF(X509_ALGOR) *)OPENSSL_sk_new_reserve(ossl_check_X509_ALGOR_compfunc_type(cmp), (n))) +#define sk_X509_ALGOR_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_ALGOR_sk_type(sk), (n)) +#define sk_X509_ALGOR_free(sk) OPENSSL_sk_free(ossl_check_X509_ALGOR_sk_type(sk)) +#define sk_X509_ALGOR_zero(sk) OPENSSL_sk_zero(ossl_check_X509_ALGOR_sk_type(sk)) +#define sk_X509_ALGOR_delete(sk, i) ((X509_ALGOR *)OPENSSL_sk_delete(ossl_check_X509_ALGOR_sk_type(sk), (i))) +#define sk_X509_ALGOR_delete_ptr(sk, ptr) ((X509_ALGOR *)OPENSSL_sk_delete_ptr(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr))) +#define sk_X509_ALGOR_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr)) +#define sk_X509_ALGOR_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr)) +#define sk_X509_ALGOR_pop(sk) ((X509_ALGOR *)OPENSSL_sk_pop(ossl_check_X509_ALGOR_sk_type(sk))) +#define sk_X509_ALGOR_shift(sk) ((X509_ALGOR *)OPENSSL_sk_shift(ossl_check_X509_ALGOR_sk_type(sk))) +#define sk_X509_ALGOR_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_freefunc_type(freefunc)) +#define sk_X509_ALGOR_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr), (idx)) +#define sk_X509_ALGOR_set(sk, idx, ptr) ((X509_ALGOR *)OPENSSL_sk_set(ossl_check_X509_ALGOR_sk_type(sk), (idx), ossl_check_X509_ALGOR_type(ptr))) +#define sk_X509_ALGOR_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr)) +#define sk_X509_ALGOR_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr)) +#define sk_X509_ALGOR_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr), pnum) +#define sk_X509_ALGOR_sort(sk) OPENSSL_sk_sort(ossl_check_X509_ALGOR_sk_type(sk)) +#define sk_X509_ALGOR_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_ALGOR_sk_type(sk)) +#define sk_X509_ALGOR_dup(sk) ((STACK_OF(X509_ALGOR) *)OPENSSL_sk_dup(ossl_check_const_X509_ALGOR_sk_type(sk))) +#define sk_X509_ALGOR_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_ALGOR) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_copyfunc_type(copyfunc), ossl_check_X509_ALGOR_freefunc_type(freefunc))) +#define sk_X509_ALGOR_set_cmp_func(sk, cmp) ((sk_X509_ALGOR_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_compfunc_type(cmp))) + +/* clang-format on */ + +#define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */ +/* + * This indicates that the ASN1_STRING is not a real value but just a place + * holder for the location where indefinite length constructed data should be + * inserted in the memory buffer + */ +#define ASN1_STRING_FLAG_NDEF 0x010 + +/* + * This flag is used by the CMS code to indicate that a string is not + * complete and is a place holder for content when it had all been accessed. + * The flag will be reset when content has been written to it. + */ + +#define ASN1_STRING_FLAG_CONT 0x020 +/* + * This flag is used by ASN1 code to indicate an ASN1_STRING is an MSTRING + * type. + */ +#define ASN1_STRING_FLAG_MSTRING 0x040 +/* String is embedded and only content should be freed */ +#define ASN1_STRING_FLAG_EMBED 0x080 +/* String should be parsed in RFC 5280's time format */ +#define ASN1_STRING_FLAG_X509_TIME 0x100 +/* This is the base type that holds just about everything :-) */ +struct asn1_string_st { + int length; + int type; + unsigned char *data; + /* + * The value of the following field depends on the type being held. It + * is mostly being used for BIT_STRING so if the input data has a + * non-zero 'unused bits' value, it will be handled correctly + */ + long flags; +}; + +/* + * ASN1_ENCODING structure: this is used to save the received encoding of an + * ASN1 type. This is useful to get round problems with invalid encodings + * which can break signatures. + */ + +typedef struct ASN1_ENCODING_st { + unsigned char *enc; /* DER encoding */ + long len; /* Length of encoding */ + int modified; /* set to 1 if 'enc' is invalid */ +} ASN1_ENCODING; + +/* Used with ASN1 LONG type: if a long is set to this it is omitted */ +#define ASN1_LONG_UNDEF 0x7fffffffL + +#define STABLE_FLAGS_MALLOC 0x01 +/* + * A zero passed to ASN1_STRING_TABLE_new_add for the flags is interpreted + * as "don't change" and STABLE_FLAGS_MALLOC is always set. By setting + * STABLE_FLAGS_MALLOC only we can clear the existing value. Use the alias + * STABLE_FLAGS_CLEAR to reflect this. + */ +#define STABLE_FLAGS_CLEAR STABLE_FLAGS_MALLOC +#define STABLE_NO_MASK 0x02 +#define DIRSTRING_TYPE \ + (B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING) +#define PKCS9STRING_TYPE (DIRSTRING_TYPE | B_ASN1_IA5STRING) + +struct asn1_string_table_st { + int nid; + long minsize; + long maxsize; + unsigned long mask; + unsigned long flags; +}; + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(ASN1_STRING_TABLE, ASN1_STRING_TABLE, ASN1_STRING_TABLE) +#define sk_ASN1_STRING_TABLE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_STRING_TABLE_sk_type(sk)) +#define sk_ASN1_STRING_TABLE_value(sk, idx) ((ASN1_STRING_TABLE *)OPENSSL_sk_value(ossl_check_const_ASN1_STRING_TABLE_sk_type(sk), (idx))) +#define sk_ASN1_STRING_TABLE_new(cmp) ((STACK_OF(ASN1_STRING_TABLE) *)OPENSSL_sk_new(ossl_check_ASN1_STRING_TABLE_compfunc_type(cmp))) +#define sk_ASN1_STRING_TABLE_new_null() ((STACK_OF(ASN1_STRING_TABLE) *)OPENSSL_sk_new_null()) +#define sk_ASN1_STRING_TABLE_new_reserve(cmp, n) ((STACK_OF(ASN1_STRING_TABLE) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_STRING_TABLE_compfunc_type(cmp), (n))) +#define sk_ASN1_STRING_TABLE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_STRING_TABLE_sk_type(sk), (n)) +#define sk_ASN1_STRING_TABLE_free(sk) OPENSSL_sk_free(ossl_check_ASN1_STRING_TABLE_sk_type(sk)) +#define sk_ASN1_STRING_TABLE_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_STRING_TABLE_sk_type(sk)) +#define sk_ASN1_STRING_TABLE_delete(sk, i) ((ASN1_STRING_TABLE *)OPENSSL_sk_delete(ossl_check_ASN1_STRING_TABLE_sk_type(sk), (i))) +#define sk_ASN1_STRING_TABLE_delete_ptr(sk, ptr) ((ASN1_STRING_TABLE *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr))) +#define sk_ASN1_STRING_TABLE_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr)) +#define sk_ASN1_STRING_TABLE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr)) +#define sk_ASN1_STRING_TABLE_pop(sk) ((ASN1_STRING_TABLE *)OPENSSL_sk_pop(ossl_check_ASN1_STRING_TABLE_sk_type(sk))) +#define sk_ASN1_STRING_TABLE_shift(sk) ((ASN1_STRING_TABLE *)OPENSSL_sk_shift(ossl_check_ASN1_STRING_TABLE_sk_type(sk))) +#define sk_ASN1_STRING_TABLE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_freefunc_type(freefunc)) +#define sk_ASN1_STRING_TABLE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr), (idx)) +#define sk_ASN1_STRING_TABLE_set(sk, idx, ptr) ((ASN1_STRING_TABLE *)OPENSSL_sk_set(ossl_check_ASN1_STRING_TABLE_sk_type(sk), (idx), ossl_check_ASN1_STRING_TABLE_type(ptr))) +#define sk_ASN1_STRING_TABLE_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr)) +#define sk_ASN1_STRING_TABLE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr)) +#define sk_ASN1_STRING_TABLE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr), pnum) +#define sk_ASN1_STRING_TABLE_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_STRING_TABLE_sk_type(sk)) +#define sk_ASN1_STRING_TABLE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_STRING_TABLE_sk_type(sk)) +#define sk_ASN1_STRING_TABLE_dup(sk) ((STACK_OF(ASN1_STRING_TABLE) *)OPENSSL_sk_dup(ossl_check_const_ASN1_STRING_TABLE_sk_type(sk))) +#define sk_ASN1_STRING_TABLE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_STRING_TABLE) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_copyfunc_type(copyfunc), ossl_check_ASN1_STRING_TABLE_freefunc_type(freefunc))) +#define sk_ASN1_STRING_TABLE_set_cmp_func(sk, cmp) ((sk_ASN1_STRING_TABLE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_compfunc_type(cmp))) + +/* clang-format on */ + +/* size limits: this stuff is taken straight from RFC 5280 */ + +#define ub_name 32768 +#define ub_common_name 64 +#define ub_locality_name 128 +#define ub_state_name 128 +#define ub_organization_name 64 +#define ub_organization_unit_name 64 +#define ub_title 64 +#define ub_email_address 128 + +/* + * Declarations for template structures: for full definitions see asn1t.h + */ +typedef struct ASN1_TEMPLATE_st ASN1_TEMPLATE; +typedef struct ASN1_TLC_st ASN1_TLC; +/* This is just an opaque pointer */ +typedef struct ASN1_VALUE_st ASN1_VALUE; + +/* Declare ASN1 functions: the implement macro is in asn1t.h */ + +/* + * The mysterious 'extern' that's passed to some macros is innocuous, + * and is there to quiet pre-C99 compilers that may complain about empty + * arguments in macro calls. + */ + +#define DECLARE_ASN1_FUNCTIONS_attr(attr, type) \ + DECLARE_ASN1_FUNCTIONS_name_attr(attr, type, type) +#define DECLARE_ASN1_FUNCTIONS(type) \ + DECLARE_ASN1_FUNCTIONS_attr(extern, type) + +#define DECLARE_ASN1_ALLOC_FUNCTIONS_attr(attr, type) \ + DECLARE_ASN1_ALLOC_FUNCTIONS_name_attr(attr, type, type) +#define DECLARE_ASN1_ALLOC_FUNCTIONS(type) \ + DECLARE_ASN1_ALLOC_FUNCTIONS_attr(extern, type) + +#define DECLARE_ASN1_FUNCTIONS_name_attr(attr, type, name) \ + DECLARE_ASN1_ALLOC_FUNCTIONS_name_attr(attr, type, name) \ + DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr(attr, type, name) +#define DECLARE_ASN1_FUNCTIONS_name(type, name) \ + DECLARE_ASN1_FUNCTIONS_name_attr(extern, type, name) + +#define DECLARE_ASN1_ENCODE_FUNCTIONS_attr(attr, type, itname, name) \ + DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(attr, type, name) \ + DECLARE_ASN1_ITEM_attr(attr, itname) +#define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \ + DECLARE_ASN1_ENCODE_FUNCTIONS_attr(extern, type, itname, name) + +#define DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr(attr, type, name) \ + DECLARE_ASN1_ENCODE_FUNCTIONS_attr(attr, type, name, name) +#define DECLARE_ASN1_ENCODE_FUNCTIONS_name(type, name) \ + DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr(extern, type, name) + +#define DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(attr, type, name) \ + attr type *d2i_##name(type **a, const unsigned char **in, long len); \ + attr int i2d_##name(const type *a, unsigned char **out); +#define DECLARE_ASN1_ENCODE_FUNCTIONS_only(type, name) \ + DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(extern, type, name) + +#define DECLARE_ASN1_NDEF_FUNCTION_attr(attr, name) \ + attr int i2d_##name##_NDEF(const name *a, unsigned char **out); +#define DECLARE_ASN1_NDEF_FUNCTION(name) \ + DECLARE_ASN1_NDEF_FUNCTION_attr(extern, name) + +#define DECLARE_ASN1_ALLOC_FUNCTIONS_name_attr(attr, type, name) \ + attr type *name##_new(void); \ + attr void name##_free(type *a); +#define DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \ + DECLARE_ASN1_ALLOC_FUNCTIONS_name_attr(extern, type, name) + +#define DECLARE_ASN1_DUP_FUNCTION_attr(attr, type) \ + DECLARE_ASN1_DUP_FUNCTION_name_attr(attr, type, type) +#define DECLARE_ASN1_DUP_FUNCTION(type) \ + DECLARE_ASN1_DUP_FUNCTION_attr(extern, type) + +#define DECLARE_ASN1_DUP_FUNCTION_name_attr(attr, type, name) \ + attr type *name##_dup(const type *a); +#define DECLARE_ASN1_DUP_FUNCTION_name(type, name) \ + DECLARE_ASN1_DUP_FUNCTION_name_attr(extern, type, name) + +#define DECLARE_ASN1_PRINT_FUNCTION_attr(attr, stname) \ + DECLARE_ASN1_PRINT_FUNCTION_fname_attr(attr, stname, stname) +#define DECLARE_ASN1_PRINT_FUNCTION(stname) \ + DECLARE_ASN1_PRINT_FUNCTION_attr(extern, stname) + +#define DECLARE_ASN1_PRINT_FUNCTION_fname_attr(attr, stname, fname) \ + attr int fname##_print_ctx(BIO *out, const stname *x, int indent, \ + const ASN1_PCTX *pctx); +#define DECLARE_ASN1_PRINT_FUNCTION_fname(stname, fname) \ + DECLARE_ASN1_PRINT_FUNCTION_fname_attr(extern, stname, fname) + +#define D2I_OF(type) type *(*)(type **, const unsigned char **, long) +#define I2D_OF(type) int (*)(const type *, unsigned char **) + +#define CHECKED_D2I_OF(type, d2i) \ + ((d2i_of_void *)(1 ? d2i : ((D2I_OF(type))0))) +#define CHECKED_I2D_OF(type, i2d) \ + ((i2d_of_void *)(1 ? i2d : ((I2D_OF(type))0))) +#define CHECKED_NEW_OF(type, xnew) \ + ((void *(*)(void))(1 ? xnew : ((type * (*)(void))0))) +#define CHECKED_PTR_OF(type, p) \ + ((void *)(1 ? p : (type *)0)) +#define CHECKED_PPTR_OF(type, p) \ + ((void **)(1 ? p : (type **)0)) + +#define TYPEDEF_D2I_OF(type) typedef type *d2i_of_##type(type **, const unsigned char **, long) +#define TYPEDEF_I2D_OF(type) typedef int i2d_of_##type(const type *, unsigned char **) +#define TYPEDEF_D2I2D_OF(type) \ + TYPEDEF_D2I_OF(type); \ + TYPEDEF_I2D_OF(type) + +typedef void *d2i_of_void(void **, const unsigned char **, long); +typedef int i2d_of_void(const void *, unsigned char **); +typedef int OSSL_i2d_of_void_ctx(const void *, unsigned char **, void *vctx); + +/*- + * The following macros and typedefs allow an ASN1_ITEM + * to be embedded in a structure and referenced. Since + * the ASN1_ITEM pointers need to be globally accessible + * (possibly from shared libraries) they may exist in + * different forms. On platforms that support it the + * ASN1_ITEM structure itself will be globally exported. + * Other platforms will export a function that returns + * an ASN1_ITEM pointer. + * + * To handle both cases transparently the macros below + * should be used instead of hard coding an ASN1_ITEM + * pointer in a structure. + * + * The structure will look like this: + * + * typedef struct SOMETHING_st { + * ... + * ASN1_ITEM_EXP *iptr; + * ... + * } SOMETHING; + * + * It would be initialised as e.g.: + * + * SOMETHING somevar = {...,ASN1_ITEM_ref(X509),...}; + * + * and the actual pointer extracted with: + * + * const ASN1_ITEM *it = ASN1_ITEM_ptr(somevar.iptr); + * + * Finally an ASN1_ITEM pointer can be extracted from an + * appropriate reference with: ASN1_ITEM_rptr(X509). This + * would be used when a function takes an ASN1_ITEM * argument. + * + */ + +/* + * Platforms that can't easily handle shared global variables are declared as + * functions returning ASN1_ITEM pointers. + */ + +/* ASN1_ITEM pointer exported type */ +typedef const ASN1_ITEM *ASN1_ITEM_EXP(void); + +/* Macro to obtain ASN1_ITEM pointer from exported type */ +#define ASN1_ITEM_ptr(iptr) (iptr()) + +/* Macro to include ASN1_ITEM pointer from base type */ +#define ASN1_ITEM_ref(iptr) (iptr##_it) + +#define ASN1_ITEM_rptr(ref) (ref##_it()) + +#define DECLARE_ASN1_ITEM_attr(attr, name) \ + attr const ASN1_ITEM *name##_it(void); +#define DECLARE_ASN1_ITEM(name) \ + DECLARE_ASN1_ITEM_attr(extern, name) + +/* Parameters used by ASN1_STRING_print_ex() */ + +/* + * These determine which characters to escape: RFC2253 special characters, + * control characters and MSB set characters + */ + +#define ASN1_STRFLGS_ESC_2253 1 +#define ASN1_STRFLGS_ESC_CTRL 2 +#define ASN1_STRFLGS_ESC_MSB 4 + +/* Lower 8 bits are reserved as an output type specifier */ +#define ASN1_DTFLGS_TYPE_MASK 0x0FUL +#define ASN1_DTFLGS_RFC822 0x00UL +#define ASN1_DTFLGS_ISO8601 0x01UL + +/* + * This flag determines how we do escaping: normally RC2253 backslash only, + * set this to use backslash and quote. + */ + +#define ASN1_STRFLGS_ESC_QUOTE 8 + +/* These three flags are internal use only. */ + +/* Character is a valid PrintableString character */ +#define CHARTYPE_PRINTABLESTRING 0x10 +/* Character needs escaping if it is the first character */ +#define CHARTYPE_FIRST_ESC_2253 0x20 +/* Character needs escaping if it is the last character */ +#define CHARTYPE_LAST_ESC_2253 0x40 + +/* + * NB the internal flags are safely reused below by flags handled at the top + * level. + */ + +/* + * If this is set we convert all character strings to UTF8 first + */ + +#define ASN1_STRFLGS_UTF8_CONVERT 0x10 + +/* + * If this is set we don't attempt to interpret content: just assume all + * strings are 1 byte per character. This will produce some pretty odd + * looking output! + */ + +#define ASN1_STRFLGS_IGNORE_TYPE 0x20 + +/* If this is set we include the string type in the output */ +#define ASN1_STRFLGS_SHOW_TYPE 0x40 + +/* + * This determines which strings to display and which to 'dump' (hex dump of + * content octets or DER encoding). We can only dump non character strings or + * everything. If we don't dump 'unknown' they are interpreted as character + * strings with 1 octet per character and are subject to the usual escaping + * options. + */ + +#define ASN1_STRFLGS_DUMP_ALL 0x80 +#define ASN1_STRFLGS_DUMP_UNKNOWN 0x100 + +/* + * These determine what 'dumping' does, we can dump the content octets or the + * DER encoding: both use the RFC2253 #XXXXX notation. + */ + +#define ASN1_STRFLGS_DUMP_DER 0x200 + +/* + * This flag specifies that RC2254 escaping shall be performed. + */ +#define ASN1_STRFLGS_ESC_2254 0x400 + +/* + * All the string flags consistent with RFC2253, escaping control characters + * isn't essential in RFC2253 but it is advisable anyway. + */ + +#define ASN1_STRFLGS_RFC2253 (ASN1_STRFLGS_ESC_2253 | ASN1_STRFLGS_ESC_CTRL | ASN1_STRFLGS_ESC_MSB | ASN1_STRFLGS_UTF8_CONVERT | ASN1_STRFLGS_DUMP_UNKNOWN | ASN1_STRFLGS_DUMP_DER) + +struct asn1_type_st { + int type; + union { + char *ptr; + ASN1_BOOLEAN boolean; + ASN1_STRING *asn1_string; + ASN1_OBJECT *object; + ASN1_INTEGER *integer; + ASN1_ENUMERATED *enumerated; + ASN1_BIT_STRING *bit_string; + ASN1_OCTET_STRING *octet_string; + ASN1_PRINTABLESTRING *printablestring; + ASN1_T61STRING *t61string; + ASN1_IA5STRING *ia5string; + ASN1_GENERALSTRING *generalstring; + ASN1_BMPSTRING *bmpstring; + ASN1_UNIVERSALSTRING *universalstring; + ASN1_UTCTIME *utctime; + ASN1_GENERALIZEDTIME *generalizedtime; + ASN1_VISIBLESTRING *visiblestring; + ASN1_UTF8STRING *utf8string; + /* + * set and sequence are left complete and still contain the set or + * sequence bytes + */ + ASN1_STRING *set; + ASN1_STRING *sequence; + ASN1_VALUE *asn1_value; + } value; +}; + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(ASN1_TYPE, ASN1_TYPE, ASN1_TYPE) +#define sk_ASN1_TYPE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_TYPE_sk_type(sk)) +#define sk_ASN1_TYPE_value(sk, idx) ((ASN1_TYPE *)OPENSSL_sk_value(ossl_check_const_ASN1_TYPE_sk_type(sk), (idx))) +#define sk_ASN1_TYPE_new(cmp) ((STACK_OF(ASN1_TYPE) *)OPENSSL_sk_new(ossl_check_ASN1_TYPE_compfunc_type(cmp))) +#define sk_ASN1_TYPE_new_null() ((STACK_OF(ASN1_TYPE) *)OPENSSL_sk_new_null()) +#define sk_ASN1_TYPE_new_reserve(cmp, n) ((STACK_OF(ASN1_TYPE) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_TYPE_compfunc_type(cmp), (n))) +#define sk_ASN1_TYPE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_TYPE_sk_type(sk), (n)) +#define sk_ASN1_TYPE_free(sk) OPENSSL_sk_free(ossl_check_ASN1_TYPE_sk_type(sk)) +#define sk_ASN1_TYPE_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_TYPE_sk_type(sk)) +#define sk_ASN1_TYPE_delete(sk, i) ((ASN1_TYPE *)OPENSSL_sk_delete(ossl_check_ASN1_TYPE_sk_type(sk), (i))) +#define sk_ASN1_TYPE_delete_ptr(sk, ptr) ((ASN1_TYPE *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr))) +#define sk_ASN1_TYPE_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr)) +#define sk_ASN1_TYPE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr)) +#define sk_ASN1_TYPE_pop(sk) ((ASN1_TYPE *)OPENSSL_sk_pop(ossl_check_ASN1_TYPE_sk_type(sk))) +#define sk_ASN1_TYPE_shift(sk) ((ASN1_TYPE *)OPENSSL_sk_shift(ossl_check_ASN1_TYPE_sk_type(sk))) +#define sk_ASN1_TYPE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_freefunc_type(freefunc)) +#define sk_ASN1_TYPE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr), (idx)) +#define sk_ASN1_TYPE_set(sk, idx, ptr) ((ASN1_TYPE *)OPENSSL_sk_set(ossl_check_ASN1_TYPE_sk_type(sk), (idx), ossl_check_ASN1_TYPE_type(ptr))) +#define sk_ASN1_TYPE_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr)) +#define sk_ASN1_TYPE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr)) +#define sk_ASN1_TYPE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr), pnum) +#define sk_ASN1_TYPE_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_TYPE_sk_type(sk)) +#define sk_ASN1_TYPE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_TYPE_sk_type(sk)) +#define sk_ASN1_TYPE_dup(sk) ((STACK_OF(ASN1_TYPE) *)OPENSSL_sk_dup(ossl_check_const_ASN1_TYPE_sk_type(sk))) +#define sk_ASN1_TYPE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_TYPE) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_copyfunc_type(copyfunc), ossl_check_ASN1_TYPE_freefunc_type(freefunc))) +#define sk_ASN1_TYPE_set_cmp_func(sk, cmp) ((sk_ASN1_TYPE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_compfunc_type(cmp))) + +/* clang-format on */ + +typedef STACK_OF(ASN1_TYPE) ASN1_SEQUENCE_ANY; + +DECLARE_ASN1_ENCODE_FUNCTIONS_name(ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY) +DECLARE_ASN1_ENCODE_FUNCTIONS_name(ASN1_SEQUENCE_ANY, ASN1_SET_ANY) + +/* This is used to contain a list of bit names */ +typedef struct BIT_STRING_BITNAME_st { + int bitnum; + const char *lname; + const char *sname; +} BIT_STRING_BITNAME; + +#define B_ASN1_TIME \ + B_ASN1_UTCTIME | B_ASN1_GENERALIZEDTIME + +#define B_ASN1_PRINTABLE \ + B_ASN1_NUMERICSTRING | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING | B_ASN1_BIT_STRING | B_ASN1_UNIVERSALSTRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING | B_ASN1_SEQUENCE | B_ASN1_UNKNOWN + +#define B_ASN1_DIRECTORYSTRING \ + B_ASN1_PRINTABLESTRING | B_ASN1_TELETEXSTRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING | B_ASN1_UTF8STRING + +#define B_ASN1_DISPLAYTEXT \ + B_ASN1_IA5STRING | B_ASN1_VISIBLESTRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING + +DECLARE_ASN1_ALLOC_FUNCTIONS_name(ASN1_TYPE, ASN1_TYPE) +DECLARE_ASN1_ENCODE_FUNCTIONS(ASN1_TYPE, ASN1_ANY, ASN1_TYPE) + +int ASN1_TYPE_get(const ASN1_TYPE *a); +void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value); +int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value); +int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b); + +ASN1_TYPE *ASN1_TYPE_pack_sequence(const ASN1_ITEM *it, void *s, ASN1_TYPE **t); +void *ASN1_TYPE_unpack_sequence(const ASN1_ITEM *it, const ASN1_TYPE *t); + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(ASN1_OBJECT, ASN1_OBJECT, ASN1_OBJECT) +#define sk_ASN1_OBJECT_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_OBJECT_sk_type(sk)) +#define sk_ASN1_OBJECT_value(sk, idx) ((ASN1_OBJECT *)OPENSSL_sk_value(ossl_check_const_ASN1_OBJECT_sk_type(sk), (idx))) +#define sk_ASN1_OBJECT_new(cmp) ((STACK_OF(ASN1_OBJECT) *)OPENSSL_sk_new(ossl_check_ASN1_OBJECT_compfunc_type(cmp))) +#define sk_ASN1_OBJECT_new_null() ((STACK_OF(ASN1_OBJECT) *)OPENSSL_sk_new_null()) +#define sk_ASN1_OBJECT_new_reserve(cmp, n) ((STACK_OF(ASN1_OBJECT) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_OBJECT_compfunc_type(cmp), (n))) +#define sk_ASN1_OBJECT_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_OBJECT_sk_type(sk), (n)) +#define sk_ASN1_OBJECT_free(sk) OPENSSL_sk_free(ossl_check_ASN1_OBJECT_sk_type(sk)) +#define sk_ASN1_OBJECT_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_OBJECT_sk_type(sk)) +#define sk_ASN1_OBJECT_delete(sk, i) ((ASN1_OBJECT *)OPENSSL_sk_delete(ossl_check_ASN1_OBJECT_sk_type(sk), (i))) +#define sk_ASN1_OBJECT_delete_ptr(sk, ptr) ((ASN1_OBJECT *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr))) +#define sk_ASN1_OBJECT_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr)) +#define sk_ASN1_OBJECT_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr)) +#define sk_ASN1_OBJECT_pop(sk) ((ASN1_OBJECT *)OPENSSL_sk_pop(ossl_check_ASN1_OBJECT_sk_type(sk))) +#define sk_ASN1_OBJECT_shift(sk) ((ASN1_OBJECT *)OPENSSL_sk_shift(ossl_check_ASN1_OBJECT_sk_type(sk))) +#define sk_ASN1_OBJECT_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_freefunc_type(freefunc)) +#define sk_ASN1_OBJECT_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr), (idx)) +#define sk_ASN1_OBJECT_set(sk, idx, ptr) ((ASN1_OBJECT *)OPENSSL_sk_set(ossl_check_ASN1_OBJECT_sk_type(sk), (idx), ossl_check_ASN1_OBJECT_type(ptr))) +#define sk_ASN1_OBJECT_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr)) +#define sk_ASN1_OBJECT_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr)) +#define sk_ASN1_OBJECT_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr), pnum) +#define sk_ASN1_OBJECT_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_OBJECT_sk_type(sk)) +#define sk_ASN1_OBJECT_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_OBJECT_sk_type(sk)) +#define sk_ASN1_OBJECT_dup(sk) ((STACK_OF(ASN1_OBJECT) *)OPENSSL_sk_dup(ossl_check_const_ASN1_OBJECT_sk_type(sk))) +#define sk_ASN1_OBJECT_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_OBJECT) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_copyfunc_type(copyfunc), ossl_check_ASN1_OBJECT_freefunc_type(freefunc))) +#define sk_ASN1_OBJECT_set_cmp_func(sk, cmp) ((sk_ASN1_OBJECT_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_compfunc_type(cmp))) + +/* clang-format on */ + +DECLARE_ASN1_FUNCTIONS(ASN1_OBJECT) + +ASN1_STRING *ASN1_STRING_new(void); +void ASN1_STRING_free(ASN1_STRING *a); +void ASN1_STRING_clear_free(ASN1_STRING *a); +int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str); +DECLARE_ASN1_DUP_FUNCTION(ASN1_STRING) +ASN1_STRING *ASN1_STRING_type_new(int type); +int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b); +/* + * Since this is used to store all sorts of things, via macros, for now, + * make its data void * + */ +int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len); +void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len); +int ASN1_STRING_length(const ASN1_STRING *x); +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 void ASN1_STRING_length_set(ASN1_STRING *x, int n); +#endif +int ASN1_STRING_type(const ASN1_STRING *x); +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +OSSL_DEPRECATEDIN_1_1_0 unsigned char *ASN1_STRING_data(ASN1_STRING *x); +#endif +const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x); + +DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING) +int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, int length); +int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value); +int ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n); +int ASN1_BIT_STRING_check(const ASN1_BIT_STRING *a, + const unsigned char *flags, int flags_len); + +int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, + BIT_STRING_BITNAME *tbl, int indent); +int ASN1_BIT_STRING_num_asc(const char *name, BIT_STRING_BITNAME *tbl); +int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, const char *name, int value, + BIT_STRING_BITNAME *tbl); + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(ASN1_INTEGER, ASN1_INTEGER, ASN1_INTEGER) +#define sk_ASN1_INTEGER_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_INTEGER_sk_type(sk)) +#define sk_ASN1_INTEGER_value(sk, idx) ((ASN1_INTEGER *)OPENSSL_sk_value(ossl_check_const_ASN1_INTEGER_sk_type(sk), (idx))) +#define sk_ASN1_INTEGER_new(cmp) ((STACK_OF(ASN1_INTEGER) *)OPENSSL_sk_new(ossl_check_ASN1_INTEGER_compfunc_type(cmp))) +#define sk_ASN1_INTEGER_new_null() ((STACK_OF(ASN1_INTEGER) *)OPENSSL_sk_new_null()) +#define sk_ASN1_INTEGER_new_reserve(cmp, n) ((STACK_OF(ASN1_INTEGER) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_INTEGER_compfunc_type(cmp), (n))) +#define sk_ASN1_INTEGER_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_INTEGER_sk_type(sk), (n)) +#define sk_ASN1_INTEGER_free(sk) OPENSSL_sk_free(ossl_check_ASN1_INTEGER_sk_type(sk)) +#define sk_ASN1_INTEGER_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_INTEGER_sk_type(sk)) +#define sk_ASN1_INTEGER_delete(sk, i) ((ASN1_INTEGER *)OPENSSL_sk_delete(ossl_check_ASN1_INTEGER_sk_type(sk), (i))) +#define sk_ASN1_INTEGER_delete_ptr(sk, ptr) ((ASN1_INTEGER *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr))) +#define sk_ASN1_INTEGER_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr)) +#define sk_ASN1_INTEGER_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr)) +#define sk_ASN1_INTEGER_pop(sk) ((ASN1_INTEGER *)OPENSSL_sk_pop(ossl_check_ASN1_INTEGER_sk_type(sk))) +#define sk_ASN1_INTEGER_shift(sk) ((ASN1_INTEGER *)OPENSSL_sk_shift(ossl_check_ASN1_INTEGER_sk_type(sk))) +#define sk_ASN1_INTEGER_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_freefunc_type(freefunc)) +#define sk_ASN1_INTEGER_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr), (idx)) +#define sk_ASN1_INTEGER_set(sk, idx, ptr) ((ASN1_INTEGER *)OPENSSL_sk_set(ossl_check_ASN1_INTEGER_sk_type(sk), (idx), ossl_check_ASN1_INTEGER_type(ptr))) +#define sk_ASN1_INTEGER_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr)) +#define sk_ASN1_INTEGER_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr)) +#define sk_ASN1_INTEGER_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr), pnum) +#define sk_ASN1_INTEGER_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_INTEGER_sk_type(sk)) +#define sk_ASN1_INTEGER_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_INTEGER_sk_type(sk)) +#define sk_ASN1_INTEGER_dup(sk) ((STACK_OF(ASN1_INTEGER) *)OPENSSL_sk_dup(ossl_check_const_ASN1_INTEGER_sk_type(sk))) +#define sk_ASN1_INTEGER_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_INTEGER) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_copyfunc_type(copyfunc), ossl_check_ASN1_INTEGER_freefunc_type(freefunc))) +#define sk_ASN1_INTEGER_set_cmp_func(sk, cmp) ((sk_ASN1_INTEGER_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_compfunc_type(cmp))) + +/* clang-format on */ + +DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER) +ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, + long length); +DECLARE_ASN1_DUP_FUNCTION(ASN1_INTEGER) +int ASN1_INTEGER_cmp(const ASN1_INTEGER *x, const ASN1_INTEGER *y); + +DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED) + +int ASN1_UTCTIME_check(const ASN1_UTCTIME *a); +ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t); +ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, + int offset_day, long offset_sec); +int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str); +int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t); + +int ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *a); +ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s, + time_t t); +ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, + time_t t, int offset_day, + long offset_sec); +int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str); + +int ASN1_TIME_diff(int *pday, int *psec, + const ASN1_TIME *from, const ASN1_TIME *to); + +DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING) +DECLARE_ASN1_DUP_FUNCTION(ASN1_OCTET_STRING) +int ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a, + const ASN1_OCTET_STRING *b); +int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data, + int len); + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(ASN1_UTF8STRING, ASN1_UTF8STRING, ASN1_UTF8STRING) +#define sk_ASN1_UTF8STRING_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_UTF8STRING_sk_type(sk)) +#define sk_ASN1_UTF8STRING_value(sk, idx) ((ASN1_UTF8STRING *)OPENSSL_sk_value(ossl_check_const_ASN1_UTF8STRING_sk_type(sk), (idx))) +#define sk_ASN1_UTF8STRING_new(cmp) ((STACK_OF(ASN1_UTF8STRING) *)OPENSSL_sk_new(ossl_check_ASN1_UTF8STRING_compfunc_type(cmp))) +#define sk_ASN1_UTF8STRING_new_null() ((STACK_OF(ASN1_UTF8STRING) *)OPENSSL_sk_new_null()) +#define sk_ASN1_UTF8STRING_new_reserve(cmp, n) ((STACK_OF(ASN1_UTF8STRING) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_UTF8STRING_compfunc_type(cmp), (n))) +#define sk_ASN1_UTF8STRING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_UTF8STRING_sk_type(sk), (n)) +#define sk_ASN1_UTF8STRING_free(sk) OPENSSL_sk_free(ossl_check_ASN1_UTF8STRING_sk_type(sk)) +#define sk_ASN1_UTF8STRING_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_UTF8STRING_sk_type(sk)) +#define sk_ASN1_UTF8STRING_delete(sk, i) ((ASN1_UTF8STRING *)OPENSSL_sk_delete(ossl_check_ASN1_UTF8STRING_sk_type(sk), (i))) +#define sk_ASN1_UTF8STRING_delete_ptr(sk, ptr) ((ASN1_UTF8STRING *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr))) +#define sk_ASN1_UTF8STRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr)) +#define sk_ASN1_UTF8STRING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr)) +#define sk_ASN1_UTF8STRING_pop(sk) ((ASN1_UTF8STRING *)OPENSSL_sk_pop(ossl_check_ASN1_UTF8STRING_sk_type(sk))) +#define sk_ASN1_UTF8STRING_shift(sk) ((ASN1_UTF8STRING *)OPENSSL_sk_shift(ossl_check_ASN1_UTF8STRING_sk_type(sk))) +#define sk_ASN1_UTF8STRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_freefunc_type(freefunc)) +#define sk_ASN1_UTF8STRING_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr), (idx)) +#define sk_ASN1_UTF8STRING_set(sk, idx, ptr) ((ASN1_UTF8STRING *)OPENSSL_sk_set(ossl_check_ASN1_UTF8STRING_sk_type(sk), (idx), ossl_check_ASN1_UTF8STRING_type(ptr))) +#define sk_ASN1_UTF8STRING_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr)) +#define sk_ASN1_UTF8STRING_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr)) +#define sk_ASN1_UTF8STRING_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr), pnum) +#define sk_ASN1_UTF8STRING_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_UTF8STRING_sk_type(sk)) +#define sk_ASN1_UTF8STRING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_UTF8STRING_sk_type(sk)) +#define sk_ASN1_UTF8STRING_dup(sk) ((STACK_OF(ASN1_UTF8STRING) *)OPENSSL_sk_dup(ossl_check_const_ASN1_UTF8STRING_sk_type(sk))) +#define sk_ASN1_UTF8STRING_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_UTF8STRING) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_copyfunc_type(copyfunc), ossl_check_ASN1_UTF8STRING_freefunc_type(freefunc))) +#define sk_ASN1_UTF8STRING_set_cmp_func(sk, cmp) ((sk_ASN1_UTF8STRING_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_compfunc_type(cmp))) + +/* clang-format on */ + +DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING) +DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING) +DECLARE_ASN1_FUNCTIONS(ASN1_UTF8STRING) +DECLARE_ASN1_FUNCTIONS(ASN1_NULL) +DECLARE_ASN1_FUNCTIONS(ASN1_BMPSTRING) + +int UTF8_getc(const unsigned char *str, int len, unsigned long *val); +int UTF8_putc(unsigned char *str, int len, unsigned long value); + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(ASN1_GENERALSTRING, ASN1_GENERALSTRING, ASN1_GENERALSTRING) +#define sk_ASN1_GENERALSTRING_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_GENERALSTRING_sk_type(sk)) +#define sk_ASN1_GENERALSTRING_value(sk, idx) ((ASN1_GENERALSTRING *)OPENSSL_sk_value(ossl_check_const_ASN1_GENERALSTRING_sk_type(sk), (idx))) +#define sk_ASN1_GENERALSTRING_new(cmp) ((STACK_OF(ASN1_GENERALSTRING) *)OPENSSL_sk_new(ossl_check_ASN1_GENERALSTRING_compfunc_type(cmp))) +#define sk_ASN1_GENERALSTRING_new_null() ((STACK_OF(ASN1_GENERALSTRING) *)OPENSSL_sk_new_null()) +#define sk_ASN1_GENERALSTRING_new_reserve(cmp, n) ((STACK_OF(ASN1_GENERALSTRING) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_GENERALSTRING_compfunc_type(cmp), (n))) +#define sk_ASN1_GENERALSTRING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_GENERALSTRING_sk_type(sk), (n)) +#define sk_ASN1_GENERALSTRING_free(sk) OPENSSL_sk_free(ossl_check_ASN1_GENERALSTRING_sk_type(sk)) +#define sk_ASN1_GENERALSTRING_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_GENERALSTRING_sk_type(sk)) +#define sk_ASN1_GENERALSTRING_delete(sk, i) ((ASN1_GENERALSTRING *)OPENSSL_sk_delete(ossl_check_ASN1_GENERALSTRING_sk_type(sk), (i))) +#define sk_ASN1_GENERALSTRING_delete_ptr(sk, ptr) ((ASN1_GENERALSTRING *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr))) +#define sk_ASN1_GENERALSTRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr)) +#define sk_ASN1_GENERALSTRING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr)) +#define sk_ASN1_GENERALSTRING_pop(sk) ((ASN1_GENERALSTRING *)OPENSSL_sk_pop(ossl_check_ASN1_GENERALSTRING_sk_type(sk))) +#define sk_ASN1_GENERALSTRING_shift(sk) ((ASN1_GENERALSTRING *)OPENSSL_sk_shift(ossl_check_ASN1_GENERALSTRING_sk_type(sk))) +#define sk_ASN1_GENERALSTRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_freefunc_type(freefunc)) +#define sk_ASN1_GENERALSTRING_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr), (idx)) +#define sk_ASN1_GENERALSTRING_set(sk, idx, ptr) ((ASN1_GENERALSTRING *)OPENSSL_sk_set(ossl_check_ASN1_GENERALSTRING_sk_type(sk), (idx), ossl_check_ASN1_GENERALSTRING_type(ptr))) +#define sk_ASN1_GENERALSTRING_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr)) +#define sk_ASN1_GENERALSTRING_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr)) +#define sk_ASN1_GENERALSTRING_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr), pnum) +#define sk_ASN1_GENERALSTRING_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_GENERALSTRING_sk_type(sk)) +#define sk_ASN1_GENERALSTRING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_GENERALSTRING_sk_type(sk)) +#define sk_ASN1_GENERALSTRING_dup(sk) ((STACK_OF(ASN1_GENERALSTRING) *)OPENSSL_sk_dup(ossl_check_const_ASN1_GENERALSTRING_sk_type(sk))) +#define sk_ASN1_GENERALSTRING_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_GENERALSTRING) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_copyfunc_type(copyfunc), ossl_check_ASN1_GENERALSTRING_freefunc_type(freefunc))) +#define sk_ASN1_GENERALSTRING_set_cmp_func(sk, cmp) ((sk_ASN1_GENERALSTRING_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_compfunc_type(cmp))) + +/* clang-format on */ + +DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE) + +DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING) +DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DISPLAYTEXT) +DECLARE_ASN1_FUNCTIONS(ASN1_PRINTABLESTRING) +DECLARE_ASN1_FUNCTIONS(ASN1_T61STRING) +DECLARE_ASN1_FUNCTIONS(ASN1_IA5STRING) +DECLARE_ASN1_FUNCTIONS(ASN1_GENERALSTRING) +DECLARE_ASN1_FUNCTIONS(ASN1_UTCTIME) +DECLARE_ASN1_FUNCTIONS(ASN1_GENERALIZEDTIME) +DECLARE_ASN1_FUNCTIONS(ASN1_TIME) + +DECLARE_ASN1_DUP_FUNCTION(ASN1_TIME) +DECLARE_ASN1_DUP_FUNCTION(ASN1_UTCTIME) +DECLARE_ASN1_DUP_FUNCTION(ASN1_GENERALIZEDTIME) + +DECLARE_ASN1_ITEM(ASN1_OCTET_STRING_NDEF) + +ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t); +ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t, + int offset_day, long offset_sec); +int ASN1_TIME_check(const ASN1_TIME *t); +ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(const ASN1_TIME *t, + ASN1_GENERALIZEDTIME **out); +int ASN1_TIME_set_string(ASN1_TIME *s, const char *str); +int ASN1_TIME_set_string_X509(ASN1_TIME *s, const char *str); +int ASN1_TIME_to_tm(const ASN1_TIME *s, struct tm *tm); +int ASN1_TIME_normalize(ASN1_TIME *s); +int ASN1_TIME_cmp_time_t(const ASN1_TIME *s, time_t t); +int ASN1_TIME_compare(const ASN1_TIME *a, const ASN1_TIME *b); + +int i2a_ASN1_INTEGER(BIO *bp, const ASN1_INTEGER *a); +int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size); +int i2a_ASN1_ENUMERATED(BIO *bp, const ASN1_ENUMERATED *a); +int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size); +int i2a_ASN1_OBJECT(BIO *bp, const ASN1_OBJECT *a); +int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size); +int i2a_ASN1_STRING(BIO *bp, const ASN1_STRING *a, int type); +int i2t_ASN1_OBJECT(char *buf, int buf_len, const ASN1_OBJECT *a); + +int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num); +ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len, + const char *sn, const char *ln); + +int ASN1_INTEGER_get_int64(int64_t *pr, const ASN1_INTEGER *a); +int ASN1_INTEGER_set_int64(ASN1_INTEGER *a, int64_t r); +int ASN1_INTEGER_get_uint64(uint64_t *pr, const ASN1_INTEGER *a); +int ASN1_INTEGER_set_uint64(ASN1_INTEGER *a, uint64_t r); + +int ASN1_INTEGER_set(ASN1_INTEGER *a, long v); +long ASN1_INTEGER_get(const ASN1_INTEGER *a); +ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai); +BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn); + +int ASN1_ENUMERATED_get_int64(int64_t *pr, const ASN1_ENUMERATED *a); +int ASN1_ENUMERATED_set_int64(ASN1_ENUMERATED *a, int64_t r); + +int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v); +long ASN1_ENUMERATED_get(const ASN1_ENUMERATED *a); +ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(const BIGNUM *bn, ASN1_ENUMERATED *ai); +BIGNUM *ASN1_ENUMERATED_to_BN(const ASN1_ENUMERATED *ai, BIGNUM *bn); + +/* General */ +/* given a string, return the correct type, max is the maximum length */ +int ASN1_PRINTABLE_type(const unsigned char *s, int max); + +unsigned long ASN1_tag2bit(int tag); + +/* SPECIALS */ +int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, + int *pclass, long omax); +int ASN1_check_infinite_end(unsigned char **p, long len); +int ASN1_const_check_infinite_end(const unsigned char **p, long len); +void ASN1_put_object(unsigned char **pp, int constructed, int length, + int tag, int xclass); +int ASN1_put_eoc(unsigned char **pp); +int ASN1_object_size(int constructed, int length, int tag); + +/* Used to implement other functions */ +void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, const void *x); + +#define ASN1_dup_of(type, i2d, d2i, x) \ + ((type *)ASN1_dup(CHECKED_I2D_OF(type, i2d), \ + CHECKED_D2I_OF(type, d2i), \ + CHECKED_PTR_OF(const type, x))) + +void *ASN1_item_dup(const ASN1_ITEM *it, const void *x); +int ASN1_item_sign_ex(const ASN1_ITEM *it, X509_ALGOR *algor1, + X509_ALGOR *algor2, ASN1_BIT_STRING *signature, + const void *data, const ASN1_OCTET_STRING *id, + EVP_PKEY *pkey, const EVP_MD *md, OSSL_LIB_CTX *libctx, + const char *propq); +int ASN1_item_verify_ex(const ASN1_ITEM *it, const X509_ALGOR *alg, + const ASN1_BIT_STRING *signature, const void *data, + const ASN1_OCTET_STRING *id, EVP_PKEY *pkey, + OSSL_LIB_CTX *libctx, const char *propq); + +/* ASN1 alloc/free macros for when a type is only used internally */ + +#define M_ASN1_new_of(type) (type *)ASN1_item_new(ASN1_ITEM_rptr(type)) +#define M_ASN1_free_of(x, type) \ + ASN1_item_free(CHECKED_PTR_OF(type, x), ASN1_ITEM_rptr(type)) + +#ifndef OPENSSL_NO_STDIO +void *ASN1_d2i_fp(void *(*xnew)(void), d2i_of_void *d2i, FILE *in, void **x); + +#define ASN1_d2i_fp_of(type, xnew, d2i, in, x) \ + ((type *)ASN1_d2i_fp(CHECKED_NEW_OF(type, xnew), \ + CHECKED_D2I_OF(type, d2i), \ + in, \ + CHECKED_PPTR_OF(type, x))) + +void *ASN1_item_d2i_fp_ex(const ASN1_ITEM *it, FILE *in, void *x, + OSSL_LIB_CTX *libctx, const char *propq); +void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x); +int ASN1_i2d_fp(i2d_of_void *i2d, FILE *out, const void *x); + +#define ASN1_i2d_fp_of(type, i2d, out, x) \ + (ASN1_i2d_fp(CHECKED_I2D_OF(type, i2d), \ + out, \ + CHECKED_PTR_OF(const type, x))) + +int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, const void *x); +int ASN1_STRING_print_ex_fp(FILE *fp, const ASN1_STRING *str, unsigned long flags); +#endif + +int ASN1_STRING_to_UTF8(unsigned char **out, const ASN1_STRING *in); + +void *ASN1_d2i_bio(void *(*xnew)(void), d2i_of_void *d2i, BIO *in, void **x); + +#define ASN1_d2i_bio_of(type, xnew, d2i, in, x) \ + ((type *)ASN1_d2i_bio(CHECKED_NEW_OF(type, xnew), \ + CHECKED_D2I_OF(type, d2i), \ + in, \ + CHECKED_PPTR_OF(type, x))) + +void *ASN1_item_d2i_bio_ex(const ASN1_ITEM *it, BIO *in, void *pval, + OSSL_LIB_CTX *libctx, const char *propq); +void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *pval); +int ASN1_i2d_bio(i2d_of_void *i2d, BIO *out, const void *x); + +#define ASN1_i2d_bio_of(type, i2d, out, x) \ + (ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \ + out, \ + CHECKED_PTR_OF(const type, x))) + +int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, const void *x); +BIO *ASN1_item_i2d_mem_bio(const ASN1_ITEM *it, const ASN1_VALUE *val); +int ASN1_UTCTIME_print(BIO *fp, const ASN1_UTCTIME *a); +int ASN1_GENERALIZEDTIME_print(BIO *fp, const ASN1_GENERALIZEDTIME *a); +int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm); +int ASN1_TIME_print_ex(BIO *bp, const ASN1_TIME *tm, unsigned long flags); +int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v); +int ASN1_STRING_print_ex(BIO *out, const ASN1_STRING *str, unsigned long flags); +int ASN1_buf_print(BIO *bp, const unsigned char *buf, size_t buflen, int off); +int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num, + unsigned char *buf, int off); +int ASN1_parse(BIO *bp, const unsigned char *pp, long len, int indent); +int ASN1_parse_dump(BIO *bp, const unsigned char *pp, long len, int indent, + int dump); +const char *ASN1_tag2str(int tag); + +/* Used to load and write Netscape format cert */ + +int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s); + +int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len); +int ASN1_TYPE_get_octetstring(const ASN1_TYPE *a, unsigned char *data, int max_len); +int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, + unsigned char *data, int len); +int ASN1_TYPE_get_int_octetstring(const ASN1_TYPE *a, long *num, + unsigned char *data, int max_len); + +void *ASN1_item_unpack(const ASN1_STRING *oct, const ASN1_ITEM *it); +void *ASN1_item_unpack_ex(const ASN1_STRING *oct, const ASN1_ITEM *it, + OSSL_LIB_CTX *libctx, const char *propq); + +ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, + ASN1_OCTET_STRING **oct); + +void ASN1_STRING_set_default_mask(unsigned long mask); +int ASN1_STRING_set_default_mask_asc(const char *p); +unsigned long ASN1_STRING_get_default_mask(void); +int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len, + int inform, unsigned long mask); +int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len, + int inform, unsigned long mask, + long minsize, long maxsize); + +ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out, + const unsigned char *in, int inlen, + int inform, int nid); +ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid); +int ASN1_STRING_TABLE_add(int, long, long, unsigned long, unsigned long); +void ASN1_STRING_TABLE_cleanup(void); + +/* ASN1 template functions */ + +/* Old API compatible functions */ +ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it); +ASN1_VALUE *ASN1_item_new_ex(const ASN1_ITEM *it, OSSL_LIB_CTX *libctx, + const char *propq); +void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it); +ASN1_VALUE *ASN1_item_d2i_ex(ASN1_VALUE **val, const unsigned char **in, + long len, const ASN1_ITEM *it, + OSSL_LIB_CTX *libctx, const char *propq); +ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in, + long len, const ASN1_ITEM *it); +int ASN1_item_i2d(const ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); +int ASN1_item_ndef_i2d(const ASN1_VALUE *val, unsigned char **out, + const ASN1_ITEM *it); + +void ASN1_add_oid_module(void); +void ASN1_add_stable_module(void); + +ASN1_TYPE *ASN1_generate_nconf(const char *str, CONF *nconf); +ASN1_TYPE *ASN1_generate_v3(const char *str, X509V3_CTX *cnf); +int ASN1_str2mask(const char *str, unsigned long *pmask); + +/* ASN1 Print flags */ + +/* Indicate missing OPTIONAL fields */ +#define ASN1_PCTX_FLAGS_SHOW_ABSENT 0x001 +/* Mark start and end of SEQUENCE */ +#define ASN1_PCTX_FLAGS_SHOW_SEQUENCE 0x002 +/* Mark start and end of SEQUENCE/SET OF */ +#define ASN1_PCTX_FLAGS_SHOW_SSOF 0x004 +/* Show the ASN1 type of primitives */ +#define ASN1_PCTX_FLAGS_SHOW_TYPE 0x008 +/* Don't show ASN1 type of ANY */ +#define ASN1_PCTX_FLAGS_NO_ANY_TYPE 0x010 +/* Don't show ASN1 type of MSTRINGs */ +#define ASN1_PCTX_FLAGS_NO_MSTRING_TYPE 0x020 +/* Don't show field names in SEQUENCE */ +#define ASN1_PCTX_FLAGS_NO_FIELD_NAME 0x040 +/* Show structure names of each SEQUENCE field */ +#define ASN1_PCTX_FLAGS_SHOW_FIELD_STRUCT_NAME 0x080 +/* Don't show structure name even at top level */ +#define ASN1_PCTX_FLAGS_NO_STRUCT_NAME 0x100 + +int ASN1_item_print(BIO *out, const ASN1_VALUE *ifld, int indent, + const ASN1_ITEM *it, const ASN1_PCTX *pctx); +ASN1_PCTX *ASN1_PCTX_new(void); +void ASN1_PCTX_free(ASN1_PCTX *p); +unsigned long ASN1_PCTX_get_flags(const ASN1_PCTX *p); +void ASN1_PCTX_set_flags(ASN1_PCTX *p, unsigned long flags); +unsigned long ASN1_PCTX_get_nm_flags(const ASN1_PCTX *p); +void ASN1_PCTX_set_nm_flags(ASN1_PCTX *p, unsigned long flags); +unsigned long ASN1_PCTX_get_cert_flags(const ASN1_PCTX *p); +void ASN1_PCTX_set_cert_flags(ASN1_PCTX *p, unsigned long flags); +unsigned long ASN1_PCTX_get_oid_flags(const ASN1_PCTX *p); +void ASN1_PCTX_set_oid_flags(ASN1_PCTX *p, unsigned long flags); +unsigned long ASN1_PCTX_get_str_flags(const ASN1_PCTX *p); +void ASN1_PCTX_set_str_flags(ASN1_PCTX *p, unsigned long flags); + +ASN1_SCTX *ASN1_SCTX_new(int (*scan_cb)(ASN1_SCTX *ctx)); +void ASN1_SCTX_free(ASN1_SCTX *p); +const ASN1_ITEM *ASN1_SCTX_get_item(ASN1_SCTX *p); +const ASN1_TEMPLATE *ASN1_SCTX_get_template(ASN1_SCTX *p); +unsigned long ASN1_SCTX_get_flags(ASN1_SCTX *p); +void ASN1_SCTX_set_app_data(ASN1_SCTX *p, void *data); +void *ASN1_SCTX_get_app_data(ASN1_SCTX *p); + +const BIO_METHOD *BIO_f_asn1(void); + +/* cannot constify val because of CMS_stream() */ +BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it); + +int i2d_ASN1_bio_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags, + const ASN1_ITEM *it); +int PEM_write_bio_ASN1_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags, + const char *hdr, const ASN1_ITEM *it); +/* cannot constify val because of CMS_dataFinal() */ +int SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags, + int ctype_nid, int econt_nid, + STACK_OF(X509_ALGOR) *mdalgs, const ASN1_ITEM *it); +int SMIME_write_ASN1_ex(BIO *bio, ASN1_VALUE *val, BIO *data, int flags, + int ctype_nid, int econt_nid, + STACK_OF(X509_ALGOR) *mdalgs, const ASN1_ITEM *it, + OSSL_LIB_CTX *libctx, const char *propq); +ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it); +ASN1_VALUE *SMIME_read_ASN1_ex(BIO *bio, int flags, BIO **bcont, + const ASN1_ITEM *it, ASN1_VALUE **x, + OSSL_LIB_CTX *libctx, const char *propq); +int SMIME_crlf_copy(BIO *in, BIO *out, int flags); +int SMIME_text(BIO *in, BIO *out); + +const ASN1_ITEM *ASN1_ITEM_lookup(const char *name); +const ASN1_ITEM *ASN1_ITEM_get(size_t i); + +/* Legacy compatibility */ +#define DECLARE_ASN1_FUNCTIONS_fname(type, itname, name) \ + DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \ + DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) +#define DECLARE_ASN1_FUNCTIONS_const(type) DECLARE_ASN1_FUNCTIONS(type) +#define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \ + DECLARE_ASN1_ENCODE_FUNCTIONS(type, name) +#define I2D_OF_const(type) I2D_OF(type) +#define ASN1_dup_of_const(type, i2d, d2i, x) ASN1_dup_of(type, i2d, d2i, x) +#define ASN1_i2d_fp_of_const(type, i2d, out, x) ASN1_i2d_fp_of(type, i2d, out, x) +#define ASN1_i2d_bio_of_const(type, i2d, out, x) ASN1_i2d_bio_of(type, i2d, out, x) + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/asn1err.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/asn1err.h new file mode 100644 index 0000000000000000000000000000000000000000..91756141b0f8322af57c8b29ee5feaf196f5d120 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/asn1err.h @@ -0,0 +1,140 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_ASN1ERR_H +#define OPENSSL_ASN1ERR_H +#pragma once + +#include +#include +#include + +/* + * ASN1 reason codes. + */ +#define ASN1_R_ADDING_OBJECT 171 +#define ASN1_R_ASN1_PARSE_ERROR 203 +#define ASN1_R_ASN1_SIG_PARSE_ERROR 204 +#define ASN1_R_AUX_ERROR 100 +#define ASN1_R_BAD_OBJECT_HEADER 102 +#define ASN1_R_BAD_TEMPLATE 230 +#define ASN1_R_BMPSTRING_IS_WRONG_LENGTH 214 +#define ASN1_R_BN_LIB 105 +#define ASN1_R_BOOLEAN_IS_WRONG_LENGTH 106 +#define ASN1_R_BUFFER_TOO_SMALL 107 +#define ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 108 +#define ASN1_R_CONTEXT_NOT_INITIALISED 217 +#define ASN1_R_DATA_IS_WRONG 109 +#define ASN1_R_DECODE_ERROR 110 +#define ASN1_R_DEPTH_EXCEEDED 174 +#define ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED 198 +#define ASN1_R_ENCODE_ERROR 112 +#define ASN1_R_ERROR_GETTING_TIME 173 +#define ASN1_R_ERROR_LOADING_SECTION 172 +#define ASN1_R_ERROR_SETTING_CIPHER_PARAMS 114 +#define ASN1_R_EXPECTING_AN_INTEGER 115 +#define ASN1_R_EXPECTING_AN_OBJECT 116 +#define ASN1_R_EXPLICIT_LENGTH_MISMATCH 119 +#define ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED 120 +#define ASN1_R_FIELD_MISSING 121 +#define ASN1_R_FIRST_NUM_TOO_LARGE 122 +#define ASN1_R_GENERALIZEDTIME_IS_TOO_SHORT 232 +#define ASN1_R_HEADER_TOO_LONG 123 +#define ASN1_R_ILLEGAL_BITSTRING_FORMAT 175 +#define ASN1_R_ILLEGAL_BOOLEAN 176 +#define ASN1_R_ILLEGAL_CHARACTERS 124 +#define ASN1_R_ILLEGAL_FORMAT 177 +#define ASN1_R_ILLEGAL_HEX 178 +#define ASN1_R_ILLEGAL_IMPLICIT_TAG 179 +#define ASN1_R_ILLEGAL_INTEGER 180 +#define ASN1_R_ILLEGAL_NEGATIVE_VALUE 226 +#define ASN1_R_ILLEGAL_NESTED_TAGGING 181 +#define ASN1_R_ILLEGAL_NULL 125 +#define ASN1_R_ILLEGAL_NULL_VALUE 182 +#define ASN1_R_ILLEGAL_OBJECT 183 +#define ASN1_R_ILLEGAL_OPTIONAL_ANY 126 +#define ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE 170 +#define ASN1_R_ILLEGAL_PADDING 221 +#define ASN1_R_ILLEGAL_TAGGED_ANY 127 +#define ASN1_R_ILLEGAL_TIME_VALUE 184 +#define ASN1_R_ILLEGAL_ZERO_CONTENT 222 +#define ASN1_R_INTEGER_NOT_ASCII_FORMAT 185 +#define ASN1_R_INTEGER_TOO_LARGE_FOR_LONG 128 +#define ASN1_R_INVALID_BIT_STRING_BITS_LEFT 220 +#define ASN1_R_INVALID_BMPSTRING_LENGTH 129 +#define ASN1_R_INVALID_DIGIT 130 +#define ASN1_R_INVALID_MIME_TYPE 205 +#define ASN1_R_INVALID_MODIFIER 186 +#define ASN1_R_INVALID_NUMBER 187 +#define ASN1_R_INVALID_OBJECT_ENCODING 216 +#define ASN1_R_INVALID_SCRYPT_PARAMETERS 227 +#define ASN1_R_INVALID_SEPARATOR 131 +#define ASN1_R_INVALID_STRING_TABLE_VALUE 218 +#define ASN1_R_INVALID_UNIVERSALSTRING_LENGTH 133 +#define ASN1_R_INVALID_UTF8STRING 134 +#define ASN1_R_INVALID_VALUE 219 +#define ASN1_R_LENGTH_TOO_LONG 231 +#define ASN1_R_LIST_ERROR 188 +#define ASN1_R_MIME_NO_CONTENT_TYPE 206 +#define ASN1_R_MIME_PARSE_ERROR 207 +#define ASN1_R_MIME_SIG_PARSE_ERROR 208 +#define ASN1_R_MISSING_EOC 137 +#define ASN1_R_MISSING_SECOND_NUMBER 138 +#define ASN1_R_MISSING_VALUE 189 +#define ASN1_R_MSTRING_NOT_UNIVERSAL 139 +#define ASN1_R_MSTRING_WRONG_TAG 140 +#define ASN1_R_NESTED_ASN1_STRING 197 +#define ASN1_R_NESTED_TOO_DEEP 201 +#define ASN1_R_NON_HEX_CHARACTERS 141 +#define ASN1_R_NOT_ASCII_FORMAT 190 +#define ASN1_R_NOT_ENOUGH_DATA 142 +#define ASN1_R_NO_CONTENT_TYPE 209 +#define ASN1_R_NO_MATCHING_CHOICE_TYPE 143 +#define ASN1_R_NO_MULTIPART_BODY_FAILURE 210 +#define ASN1_R_NO_MULTIPART_BOUNDARY 211 +#define ASN1_R_NO_SIG_CONTENT_TYPE 212 +#define ASN1_R_NULL_IS_WRONG_LENGTH 144 +#define ASN1_R_OBJECT_NOT_ASCII_FORMAT 191 +#define ASN1_R_ODD_NUMBER_OF_CHARS 145 +#define ASN1_R_SECOND_NUMBER_TOO_LARGE 147 +#define ASN1_R_SEQUENCE_LENGTH_MISMATCH 148 +#define ASN1_R_SEQUENCE_NOT_CONSTRUCTED 149 +#define ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG 192 +#define ASN1_R_SHORT_LINE 150 +#define ASN1_R_SIG_INVALID_MIME_TYPE 213 +#define ASN1_R_STREAMING_NOT_SUPPORTED 202 +#define ASN1_R_STRING_TOO_LONG 151 +#define ASN1_R_STRING_TOO_SHORT 152 +#define ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 154 +#define ASN1_R_TIME_NOT_ASCII_FORMAT 193 +#define ASN1_R_TOO_LARGE 223 +#define ASN1_R_TOO_LONG 155 +#define ASN1_R_TOO_SMALL 224 +#define ASN1_R_TYPE_NOT_CONSTRUCTED 156 +#define ASN1_R_TYPE_NOT_PRIMITIVE 195 +#define ASN1_R_UNEXPECTED_EOC 159 +#define ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH 215 +#define ASN1_R_UNKNOWN_DIGEST 229 +#define ASN1_R_UNKNOWN_FORMAT 160 +#define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM 161 +#define ASN1_R_UNKNOWN_OBJECT_TYPE 162 +#define ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE 163 +#define ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM 199 +#define ASN1_R_UNKNOWN_TAG 194 +#define ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE 164 +#define ASN1_R_UNSUPPORTED_CIPHER 228 +#define ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE 167 +#define ASN1_R_UNSUPPORTED_TYPE 196 +#define ASN1_R_UTCTIME_IS_TOO_SHORT 233 +#define ASN1_R_WRONG_INTEGER_TYPE 225 +#define ASN1_R_WRONG_PUBLIC_KEY_TYPE 200 +#define ASN1_R_WRONG_TAG 168 + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/asn1t.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/asn1t.h new file mode 100644 index 0000000000000000000000000000000000000000..6c89b27e571dee1d6bef465c71b6d5faaa0b6a8c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/asn1t.h @@ -0,0 +1,935 @@ +/* + * WARNING: do not edit! + * Generated by makefile from include\openssl\asn1t.h.in + * + * Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* clang-format off */ + +/* clang-format on */ + +#ifndef OPENSSL_ASN1T_H +#define OPENSSL_ASN1T_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_ASN1T_H +#endif + +#include +#include +#include + +#ifdef OPENSSL_BUILD_SHLIBCRYPTO +#undef OPENSSL_EXTERN +#define OPENSSL_EXTERN OPENSSL_EXPORT +#endif + +/* ASN1 template defines, structures and functions */ + +#ifdef __cplusplus +extern "C" { +#endif + +/*- + * These are the possible values for the itype field of the + * ASN1_ITEM structure and determine how it is interpreted. + * + * For PRIMITIVE types the underlying type + * determines the behaviour if items is NULL. + * + * Otherwise templates must contain a single + * template and the type is treated in the + * same way as the type specified in the template. + * + * For SEQUENCE types the templates field points + * to the members, the size field is the + * structure size. + * + * For CHOICE types the templates field points + * to each possible member (typically a union) + * and the 'size' field is the offset of the + * selector. + * + * The 'funcs' field is used for application-specific + * data and functions. + * + * The EXTERN type uses a new style d2i/i2d. + * The new style should be used where possible + * because it avoids things like the d2i IMPLICIT + * hack. + * + * MSTRING is a multiple string type, it is used + * for a CHOICE of character strings where the + * actual strings all occupy an ASN1_STRING + * structure. In this case the 'utype' field + * has a special meaning, it is used as a mask + * of acceptable types using the B_ASN1 constants. + * + * NDEF_SEQUENCE is the same as SEQUENCE except + * that it will use indefinite length constructed + * encoding if requested. + * + */ + +#define ASN1_ITYPE_PRIMITIVE 0x0 +#define ASN1_ITYPE_SEQUENCE 0x1 +#define ASN1_ITYPE_CHOICE 0x2 +/* unused value 0x3 */ +#define ASN1_ITYPE_EXTERN 0x4 +#define ASN1_ITYPE_MSTRING 0x5 +#define ASN1_ITYPE_NDEF_SEQUENCE 0x6 + +/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */ +#define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)((iptr)())) + +/* Macros for start and end of ASN1_ITEM definition */ + +#define ASN1_ITEM_start(itname) \ + const ASN1_ITEM *itname##_it(void) \ + { \ + static const ASN1_ITEM local_it = { + +#define static_ASN1_ITEM_start(itname) \ + static ASN1_ITEM_start(itname) + +#define ASN1_ITEM_end(itname) \ + } \ + ; \ + return &local_it; \ + } + +/* Macros to aid ASN1 template writing */ + +#define ASN1_ITEM_TEMPLATE(tname) \ + static const ASN1_TEMPLATE tname##_item_tt + +#define ASN1_ITEM_TEMPLATE_END(tname) \ + ; \ + ASN1_ITEM_start(tname) \ + ASN1_ITYPE_PRIMITIVE, \ + -1, \ + &tname##_item_tt, \ + 0, \ + NULL, \ + 0, \ + #tname ASN1_ITEM_end(tname) +#define static_ASN1_ITEM_TEMPLATE_END(tname) \ + ; \ + static_ASN1_ITEM_start(tname) \ + ASN1_ITYPE_PRIMITIVE, \ + -1, \ + &tname##_item_tt, \ + 0, \ + NULL, \ + 0, \ + #tname ASN1_ITEM_end(tname) + +/* This is a ASN1 type which just embeds a template */ + +/*- + * This pair helps declare a SEQUENCE. We can do: + * + * ASN1_SEQUENCE(stname) = { + * ... SEQUENCE components ... + * } ASN1_SEQUENCE_END(stname) + * + * This will produce an ASN1_ITEM called stname_it + * for a structure called stname. + * + * If you want the same structure but a different + * name then use: + * + * ASN1_SEQUENCE(itname) = { + * ... SEQUENCE components ... + * } ASN1_SEQUENCE_END_name(stname, itname) + * + * This will create an item called itname_it using + * a structure called stname. + */ + +#define ASN1_SEQUENCE(tname) \ + static const ASN1_TEMPLATE tname##_seq_tt[] + +#define ASN1_SEQUENCE_END(stname) ASN1_SEQUENCE_END_name(stname, stname) + +#define static_ASN1_SEQUENCE_END(stname) static_ASN1_SEQUENCE_END_name(stname, stname) + +#define ASN1_SEQUENCE_END_name(stname, tname) \ + ; \ + ASN1_ITEM_start(tname) \ + ASN1_ITYPE_SEQUENCE, \ + V_ASN1_SEQUENCE, \ + tname##_seq_tt, \ + sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE), \ + NULL, \ + sizeof(stname), \ + #tname ASN1_ITEM_end(tname) + +#define static_ASN1_SEQUENCE_END_name(stname, tname) \ + ; \ + static_ASN1_ITEM_start(tname) \ + ASN1_ITYPE_SEQUENCE, \ + V_ASN1_SEQUENCE, \ + tname##_seq_tt, \ + sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE), \ + NULL, \ + sizeof(stname), \ + #stname ASN1_ITEM_end(tname) + +#define ASN1_NDEF_SEQUENCE(tname) \ + ASN1_SEQUENCE(tname) + +#define ASN1_NDEF_SEQUENCE_cb(tname, cb) \ + ASN1_SEQUENCE_cb(tname, cb) + +#define ASN1_SEQUENCE_cb(tname, cb) \ + static const ASN1_AUX tname##_aux = { NULL, 0, 0, 0, cb, 0, NULL }; \ + ASN1_SEQUENCE(tname) + +#define ASN1_SEQUENCE_const_cb(tname, const_cb) \ + static const ASN1_AUX tname##_aux = { NULL, ASN1_AFLG_CONST_CB, 0, 0, NULL, 0, const_cb }; \ + ASN1_SEQUENCE(tname) + +#define ASN1_SEQUENCE_cb_const_cb(tname, cb, const_cb) \ + static const ASN1_AUX tname##_aux = { NULL, ASN1_AFLG_CONST_CB, 0, 0, cb, 0, const_cb }; \ + ASN1_SEQUENCE(tname) + +#define ASN1_SEQUENCE_ref(tname, cb) \ + static const ASN1_AUX tname##_aux = { NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), offsetof(tname, lock), cb, 0, NULL }; \ + ASN1_SEQUENCE(tname) + +#define ASN1_SEQUENCE_enc(tname, enc, cb) \ + static const ASN1_AUX tname##_aux = { NULL, ASN1_AFLG_ENCODING, 0, 0, cb, offsetof(tname, enc), NULL }; \ + ASN1_SEQUENCE(tname) + +#define ASN1_NDEF_SEQUENCE_END(tname) \ + ; \ + ASN1_ITEM_start(tname) \ + ASN1_ITYPE_NDEF_SEQUENCE, \ + V_ASN1_SEQUENCE, \ + tname##_seq_tt, \ + sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE), \ + NULL, \ + sizeof(tname), \ + #tname ASN1_ITEM_end(tname) +#define static_ASN1_NDEF_SEQUENCE_END(tname) \ + ; \ + static_ASN1_ITEM_start(tname) \ + ASN1_ITYPE_NDEF_SEQUENCE, \ + V_ASN1_SEQUENCE, \ + tname##_seq_tt, \ + sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE), \ + NULL, \ + sizeof(tname), \ + #tname ASN1_ITEM_end(tname) + +#define ASN1_SEQUENCE_END_enc(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname) + +#define ASN1_SEQUENCE_END_cb(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname) +#define static_ASN1_SEQUENCE_END_cb(stname, tname) static_ASN1_SEQUENCE_END_ref(stname, tname) + +#define ASN1_SEQUENCE_END_ref(stname, tname) \ + ; \ + ASN1_ITEM_start(tname) \ + ASN1_ITYPE_SEQUENCE, \ + V_ASN1_SEQUENCE, \ + tname##_seq_tt, \ + sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE), \ + &tname##_aux, \ + sizeof(stname), \ + #tname ASN1_ITEM_end(tname) +#define static_ASN1_SEQUENCE_END_ref(stname, tname) \ + ; \ + static_ASN1_ITEM_start(tname) \ + ASN1_ITYPE_SEQUENCE, \ + V_ASN1_SEQUENCE, \ + tname##_seq_tt, \ + sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE), \ + &tname##_aux, \ + sizeof(stname), \ + #stname ASN1_ITEM_end(tname) + +#define ASN1_NDEF_SEQUENCE_END_cb(stname, tname) \ + ; \ + ASN1_ITEM_start(tname) \ + ASN1_ITYPE_NDEF_SEQUENCE, \ + V_ASN1_SEQUENCE, \ + tname##_seq_tt, \ + sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE), \ + &tname##_aux, \ + sizeof(stname), \ + #stname ASN1_ITEM_end(tname) + +/*- + * This pair helps declare a CHOICE type. We can do: + * + * ASN1_CHOICE(chname) = { + * ... CHOICE options ... + * ASN1_CHOICE_END(chname) + * + * This will produce an ASN1_ITEM called chname_it + * for a structure called chname. The structure + * definition must look like this: + * typedef struct { + * int type; + * union { + * ASN1_SOMETHING *opt1; + * ASN1_SOMEOTHER *opt2; + * } value; + * } chname; + * + * the name of the selector must be 'type'. + * to use an alternative selector name use the + * ASN1_CHOICE_END_selector() version. + */ + +#define ASN1_CHOICE(tname) \ + static const ASN1_TEMPLATE tname##_ch_tt[] + +#define ASN1_CHOICE_cb(tname, cb) \ + static const ASN1_AUX tname##_aux = { NULL, 0, 0, 0, cb, 0, NULL }; \ + ASN1_CHOICE(tname) + +#define ASN1_CHOICE_END(stname) ASN1_CHOICE_END_name(stname, stname) + +#define static_ASN1_CHOICE_END(stname) static_ASN1_CHOICE_END_name(stname, stname) + +#define ASN1_CHOICE_END_name(stname, tname) ASN1_CHOICE_END_selector(stname, tname, type) + +#define static_ASN1_CHOICE_END_name(stname, tname) static_ASN1_CHOICE_END_selector(stname, tname, type) + +#define ASN1_CHOICE_END_selector(stname, tname, selname) \ + ; \ + ASN1_ITEM_start(tname) \ + ASN1_ITYPE_CHOICE, \ + offsetof(stname, selname), \ + tname##_ch_tt, \ + sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE), \ + NULL, \ + sizeof(stname), \ + #stname ASN1_ITEM_end(tname) + +#define static_ASN1_CHOICE_END_selector(stname, tname, selname) \ + ; \ + static_ASN1_ITEM_start(tname) \ + ASN1_ITYPE_CHOICE, \ + offsetof(stname, selname), \ + tname##_ch_tt, \ + sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE), \ + NULL, \ + sizeof(stname), \ + #stname ASN1_ITEM_end(tname) + +#define ASN1_CHOICE_END_cb(stname, tname, selname) \ + ; \ + ASN1_ITEM_start(tname) \ + ASN1_ITYPE_CHOICE, \ + offsetof(stname, selname), \ + tname##_ch_tt, \ + sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE), \ + &tname##_aux, \ + sizeof(stname), \ + #stname ASN1_ITEM_end(tname) + +/* This helps with the template wrapper form of ASN1_ITEM */ + +#define ASN1_EX_TEMPLATE_TYPE(flags, tag, name, type) { \ + (flags), (tag), 0, \ + #name, ASN1_ITEM_ref(type) \ +} + +/* These help with SEQUENCE or CHOICE components */ + +/* used to declare other types */ + +#define ASN1_EX_TYPE(flags, tag, stname, field, type) { \ + (flags), (tag), offsetof(stname, field), \ + #field, ASN1_ITEM_ref(type) \ +} + +/* implicit and explicit helper macros */ + +#define ASN1_IMP_EX(stname, field, type, tag, ex) \ + ASN1_EX_TYPE(ASN1_TFLG_IMPLICIT | (ex), tag, stname, field, type) + +#define ASN1_EXP_EX(stname, field, type, tag, ex) \ + ASN1_EX_TYPE(ASN1_TFLG_EXPLICIT | (ex), tag, stname, field, type) + +/* Any defined by macros: the field used is in the table itself */ + +#define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, tblname##_adb } +#define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, tblname##_adb } + +/* Plain simple type */ +#define ASN1_SIMPLE(stname, field, type) ASN1_EX_TYPE(0, 0, stname, field, type) +/* Embedded simple type */ +#define ASN1_EMBED(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_EMBED, 0, stname, field, type) + +/* OPTIONAL simple type */ +#define ASN1_OPT(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL, 0, stname, field, type) +#define ASN1_OPT_EMBED(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL | ASN1_TFLG_EMBED, 0, stname, field, type) + +/* IMPLICIT tagged simple type */ +#define ASN1_IMP(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, 0) +#define ASN1_IMP_EMBED(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_EMBED) + +/* IMPLICIT tagged OPTIONAL simple type */ +#define ASN1_IMP_OPT(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL) +#define ASN1_IMP_OPT_EMBED(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL | ASN1_TFLG_EMBED) + +/* Same as above but EXPLICIT */ + +#define ASN1_EXP(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0) +#define ASN1_EXP_EMBED(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_EMBED) +#define ASN1_EXP_OPT(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL) +#define ASN1_EXP_OPT_EMBED(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL | ASN1_TFLG_EMBED) + +/* SEQUENCE OF type */ +#define ASN1_SEQUENCE_OF(stname, field, type) \ + ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, stname, field, type) + +/* OPTIONAL SEQUENCE OF */ +#define ASN1_SEQUENCE_OF_OPT(stname, field, type) \ + ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF | ASN1_TFLG_OPTIONAL, 0, stname, field, type) + +/* Same as above but for SET OF */ + +#define ASN1_SET_OF(stname, field, type) \ + ASN1_EX_TYPE(ASN1_TFLG_SET_OF, 0, stname, field, type) + +#define ASN1_SET_OF_OPT(stname, field, type) \ + ASN1_EX_TYPE(ASN1_TFLG_SET_OF | ASN1_TFLG_OPTIONAL, 0, stname, field, type) + +/* Finally compound types of SEQUENCE, SET, IMPLICIT, EXPLICIT and OPTIONAL */ + +#define ASN1_IMP_SET_OF(stname, field, type, tag) \ + ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF) + +#define ASN1_EXP_SET_OF(stname, field, type, tag) \ + ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF) + +#define ASN1_IMP_SET_OF_OPT(stname, field, type, tag) \ + ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF | ASN1_TFLG_OPTIONAL) + +#define ASN1_EXP_SET_OF_OPT(stname, field, type, tag) \ + ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF | ASN1_TFLG_OPTIONAL) + +#define ASN1_IMP_SEQUENCE_OF(stname, field, type, tag) \ + ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF) + +#define ASN1_IMP_SEQUENCE_OF_OPT(stname, field, type, tag) \ + ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF | ASN1_TFLG_OPTIONAL) + +#define ASN1_EXP_SEQUENCE_OF(stname, field, type, tag) \ + ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF) + +#define ASN1_EXP_SEQUENCE_OF_OPT(stname, field, type, tag) \ + ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF | ASN1_TFLG_OPTIONAL) + +/* EXPLICIT using indefinite length constructed form */ +#define ASN1_NDEF_EXP(stname, field, type, tag) \ + ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_NDEF) + +/* EXPLICIT OPTIONAL using indefinite length constructed form */ +#define ASN1_NDEF_EXP_OPT(stname, field, type, tag) \ + ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL | ASN1_TFLG_NDEF) + +/* Macros for the ASN1_ADB structure */ + +#define ASN1_ADB(name) \ + static const ASN1_ADB_TABLE name##_adbtbl[] + +#define ASN1_ADB_END(name, flags, field, adb_cb, def, none) \ + ; \ + static const ASN1_ITEM *name##_adb(void) \ + { \ + static const ASN1_ADB internal_adb = { \ + flags, \ + offsetof(name, field), \ + adb_cb, \ + name##_adbtbl, \ + sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE), \ + def, \ + none \ + }; \ + return (const ASN1_ITEM *)&internal_adb; \ + } \ + void dummy_function(void) + +#define ADB_ENTRY(val, template) { val, template } + +#define ASN1_ADB_TEMPLATE(name) \ + static const ASN1_TEMPLATE name##_tt + +/* + * This is the ASN1 template structure that defines a wrapper round the + * actual type. It determines the actual position of the field in the value + * structure, various flags such as OPTIONAL and the field name. + */ + +struct ASN1_TEMPLATE_st { + unsigned long flags; /* Various flags */ + long tag; /* tag, not used if no tagging */ + unsigned long offset; /* Offset of this field in structure */ + const char *field_name; /* Field name */ + ASN1_ITEM_EXP *item; /* Relevant ASN1_ITEM or ASN1_ADB */ +}; + +/* Macro to extract ASN1_ITEM and ASN1_ADB pointer from ASN1_TEMPLATE */ + +#define ASN1_TEMPLATE_item(t) (t->item_ptr) +#define ASN1_TEMPLATE_adb(t) (t->item_ptr) + +typedef struct ASN1_ADB_TABLE_st ASN1_ADB_TABLE; +typedef struct ASN1_ADB_st ASN1_ADB; + +struct ASN1_ADB_st { + unsigned long flags; /* Various flags */ + unsigned long offset; /* Offset of selector field */ + int (*adb_cb)(long *psel); /* Application callback */ + const ASN1_ADB_TABLE *tbl; /* Table of possible types */ + long tblcount; /* Number of entries in tbl */ + const ASN1_TEMPLATE *default_tt; /* Type to use if no match */ + const ASN1_TEMPLATE *null_tt; /* Type to use if selector is NULL */ +}; + +struct ASN1_ADB_TABLE_st { + long value; /* NID for an object or value for an int */ + const ASN1_TEMPLATE tt; /* item for this value */ +}; + +/* template flags */ + +/* Field is optional */ +#define ASN1_TFLG_OPTIONAL (0x1) + +/* Field is a SET OF */ +#define ASN1_TFLG_SET_OF (0x1 << 1) + +/* Field is a SEQUENCE OF */ +#define ASN1_TFLG_SEQUENCE_OF (0x2 << 1) + +/* + * Special case: this refers to a SET OF that will be sorted into DER order + * when encoded *and* the corresponding STACK will be modified to match the + * new order. + */ +#define ASN1_TFLG_SET_ORDER (0x3 << 1) + +/* Mask for SET OF or SEQUENCE OF */ +#define ASN1_TFLG_SK_MASK (0x3 << 1) + +/* + * These flags mean the tag should be taken from the tag field. If EXPLICIT + * then the underlying type is used for the inner tag. + */ + +/* IMPLICIT tagging */ +#define ASN1_TFLG_IMPTAG (0x1 << 3) + +/* EXPLICIT tagging, inner tag from underlying type */ +#define ASN1_TFLG_EXPTAG (0x2 << 3) + +#define ASN1_TFLG_TAG_MASK (0x3 << 3) + +/* context specific IMPLICIT */ +#define ASN1_TFLG_IMPLICIT (ASN1_TFLG_IMPTAG | ASN1_TFLG_CONTEXT) + +/* context specific EXPLICIT */ +#define ASN1_TFLG_EXPLICIT (ASN1_TFLG_EXPTAG | ASN1_TFLG_CONTEXT) + +/* + * If tagging is in force these determine the type of tag to use. Otherwise + * the tag is determined by the underlying type. These values reflect the + * actual octet format. + */ + +/* Universal tag */ +#define ASN1_TFLG_UNIVERSAL (0x0 << 6) +/* Application tag */ +#define ASN1_TFLG_APPLICATION (0x1 << 6) +/* Context specific tag */ +#define ASN1_TFLG_CONTEXT (0x2 << 6) +/* Private tag */ +#define ASN1_TFLG_PRIVATE (0x3 << 6) + +#define ASN1_TFLG_TAG_CLASS (0x3 << 6) + +/* + * These are for ANY DEFINED BY type. In this case the 'item' field points to + * an ASN1_ADB structure which contains a table of values to decode the + * relevant type + */ + +#define ASN1_TFLG_ADB_MASK (0x3 << 8) + +#define ASN1_TFLG_ADB_OID (0x1 << 8) + +#define ASN1_TFLG_ADB_INT (0x1 << 9) + +/* + * This flag when present in a SEQUENCE OF, SET OF or EXPLICIT causes + * indefinite length constructed encoding to be used if required. + */ + +#define ASN1_TFLG_NDEF (0x1 << 11) + +/* Field is embedded and not a pointer */ +#define ASN1_TFLG_EMBED (0x1 << 12) + +/* This is the actual ASN1 item itself */ + +struct ASN1_ITEM_st { + char itype; /* The item type, primitive, SEQUENCE, CHOICE + * or extern */ + long utype; /* underlying type */ + const ASN1_TEMPLATE *templates; /* If SEQUENCE or CHOICE this contains + * the contents */ + long tcount; /* Number of templates if SEQUENCE or CHOICE */ + const void *funcs; /* further data and type-specific functions */ + /* funcs can be ASN1_PRIMITIVE_FUNCS*, ASN1_EXTERN_FUNCS*, or ASN1_AUX* */ + long size; /* Structure size (usually) */ + const char *sname; /* Structure name */ +}; + +/* + * Cache for ASN1 tag and length, so we don't keep re-reading it for things + * like CHOICE + */ + +struct ASN1_TLC_st { + char valid; /* Values below are valid */ + int ret; /* return value */ + long plen; /* length */ + int ptag; /* class value */ + int pclass; /* class value */ + int hdrlen; /* header length */ +}; + +/* Typedefs for ASN1 function pointers */ +typedef int ASN1_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, + const ASN1_ITEM *it, int tag, int aclass, char opt, + ASN1_TLC *ctx); + +typedef int ASN1_ex_d2i_ex(ASN1_VALUE **pval, const unsigned char **in, long len, + const ASN1_ITEM *it, int tag, int aclass, char opt, + ASN1_TLC *ctx, OSSL_LIB_CTX *libctx, + const char *propq); +typedef int ASN1_ex_i2d(const ASN1_VALUE **pval, unsigned char **out, + const ASN1_ITEM *it, int tag, int aclass); +typedef int ASN1_ex_new_func(ASN1_VALUE **pval, const ASN1_ITEM *it); +typedef int ASN1_ex_new_ex_func(ASN1_VALUE **pval, const ASN1_ITEM *it, + OSSL_LIB_CTX *libctx, const char *propq); +typedef void ASN1_ex_free_func(ASN1_VALUE **pval, const ASN1_ITEM *it); + +typedef int ASN1_ex_print_func(BIO *out, const ASN1_VALUE **pval, + int indent, const char *fname, + const ASN1_PCTX *pctx); + +typedef int ASN1_primitive_i2c(const ASN1_VALUE **pval, unsigned char *cont, + int *putype, const ASN1_ITEM *it); +typedef int ASN1_primitive_c2i(ASN1_VALUE **pval, const unsigned char *cont, + int len, int utype, char *free_cont, + const ASN1_ITEM *it); +typedef int ASN1_primitive_print(BIO *out, const ASN1_VALUE **pval, + const ASN1_ITEM *it, int indent, + const ASN1_PCTX *pctx); + +typedef struct ASN1_EXTERN_FUNCS_st { + void *app_data; + ASN1_ex_new_func *asn1_ex_new; + ASN1_ex_free_func *asn1_ex_free; + ASN1_ex_free_func *asn1_ex_clear; + ASN1_ex_d2i *asn1_ex_d2i; + ASN1_ex_i2d *asn1_ex_i2d; + ASN1_ex_print_func *asn1_ex_print; + ASN1_ex_new_ex_func *asn1_ex_new_ex; + ASN1_ex_d2i_ex *asn1_ex_d2i_ex; +} ASN1_EXTERN_FUNCS; + +typedef struct ASN1_PRIMITIVE_FUNCS_st { + void *app_data; + unsigned long flags; + ASN1_ex_new_func *prim_new; + ASN1_ex_free_func *prim_free; + ASN1_ex_free_func *prim_clear; + ASN1_primitive_c2i *prim_c2i; + ASN1_primitive_i2c *prim_i2c; + ASN1_primitive_print *prim_print; +} ASN1_PRIMITIVE_FUNCS; + +/* + * This is the ASN1_AUX structure: it handles various miscellaneous + * requirements. For example the use of reference counts and an informational + * callback. The "informational callback" is called at various points during + * the ASN1 encoding and decoding. It can be used to provide minor + * customisation of the structures used. This is most useful where the + * supplied routines *almost* do the right thing but need some extra help at + * a few points. If the callback returns zero then it is assumed a fatal + * error has occurred and the main operation should be abandoned. If major + * changes in the default behaviour are required then an external type is + * more appropriate. + * For the operations ASN1_OP_I2D_PRE, ASN1_OP_I2D_POST, ASN1_OP_PRINT_PRE, and + * ASN1_OP_PRINT_POST, meanwhile a variant of the callback with const parameter + * 'in' is provided to make clear statically that its input is not modified. If + * and only if this variant is in use the flag ASN1_AFLG_CONST_CB must be set. + */ + +typedef int ASN1_aux_cb(int operation, ASN1_VALUE **in, const ASN1_ITEM *it, + void *exarg); +typedef int ASN1_aux_const_cb(int operation, const ASN1_VALUE **in, + const ASN1_ITEM *it, void *exarg); + +typedef struct ASN1_AUX_st { + void *app_data; + int flags; + int ref_offset; /* Offset of reference value */ + int ref_lock; /* Offset of lock value */ + ASN1_aux_cb *asn1_cb; + int enc_offset; /* Offset of ASN1_ENCODING structure */ + ASN1_aux_const_cb *asn1_const_cb; /* for ASN1_OP_I2D_ and ASN1_OP_PRINT_ */ +} ASN1_AUX; + +/* For print related callbacks exarg points to this structure */ +typedef struct ASN1_PRINT_ARG_st { + BIO *out; + int indent; + const ASN1_PCTX *pctx; +} ASN1_PRINT_ARG; + +/* For streaming related callbacks exarg points to this structure */ +typedef struct ASN1_STREAM_ARG_st { + /* BIO to stream through */ + BIO *out; + /* BIO with filters appended */ + BIO *ndef_bio; + /* Streaming I/O boundary */ + unsigned char **boundary; +} ASN1_STREAM_ARG; + +/* Flags in ASN1_AUX */ + +/* Use a reference count */ +#define ASN1_AFLG_REFCOUNT 1 +/* Save the encoding of structure (useful for signatures) */ +#define ASN1_AFLG_ENCODING 2 +/* The Sequence length is invalid */ +#define ASN1_AFLG_BROKEN 4 +/* Use the new asn1_const_cb */ +#define ASN1_AFLG_CONST_CB 8 + +/* operation values for asn1_cb */ + +#define ASN1_OP_NEW_PRE 0 +#define ASN1_OP_NEW_POST 1 +#define ASN1_OP_FREE_PRE 2 +#define ASN1_OP_FREE_POST 3 +#define ASN1_OP_D2I_PRE 4 +#define ASN1_OP_D2I_POST 5 +#define ASN1_OP_I2D_PRE 6 +#define ASN1_OP_I2D_POST 7 +#define ASN1_OP_PRINT_PRE 8 +#define ASN1_OP_PRINT_POST 9 +#define ASN1_OP_STREAM_PRE 10 +#define ASN1_OP_STREAM_POST 11 +#define ASN1_OP_DETACHED_PRE 12 +#define ASN1_OP_DETACHED_POST 13 +#define ASN1_OP_DUP_PRE 14 +#define ASN1_OP_DUP_POST 15 +#define ASN1_OP_GET0_LIBCTX 16 +#define ASN1_OP_GET0_PROPQ 17 + +/* Macro to implement a primitive type */ +#define IMPLEMENT_ASN1_TYPE(stname) IMPLEMENT_ASN1_TYPE_ex(stname, stname, 0) +#define IMPLEMENT_ASN1_TYPE_ex(itname, vname, ex) \ + ASN1_ITEM_start(itname) \ + ASN1_ITYPE_PRIMITIVE, \ + V_##vname, NULL, 0, NULL, ex, #itname ASN1_ITEM_end(itname) + +/* Macro to implement a multi string type */ +#define IMPLEMENT_ASN1_MSTRING(itname, mask) \ + ASN1_ITEM_start(itname) \ + ASN1_ITYPE_MSTRING, \ + mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname ASN1_ITEM_end(itname) + +#define IMPLEMENT_EXTERN_ASN1(sname, tag, fptrs) \ + ASN1_ITEM_start(sname) \ + ASN1_ITYPE_EXTERN, \ + tag, \ + NULL, \ + 0, \ + &fptrs, \ + 0, \ + #sname ASN1_ITEM_end(sname) + +/* Macro to implement standard functions in terms of ASN1_ITEM structures */ + +#define IMPLEMENT_ASN1_FUNCTIONS(stname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, stname, stname) + +#define IMPLEMENT_ASN1_FUNCTIONS_name(stname, itname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, itname) + +#define IMPLEMENT_ASN1_FUNCTIONS_ENCODE_name(stname, itname) \ + IMPLEMENT_ASN1_FUNCTIONS_ENCODE_fname(stname, itname, itname) + +#define IMPLEMENT_STATIC_ASN1_ALLOC_FUNCTIONS(stname) \ + IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(static, stname, stname, stname) + +#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS(stname) \ + IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, stname, stname) + +#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(pre, stname, itname, fname) \ + pre stname *fname##_new(void) \ + { \ + return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \ + } \ + pre void fname##_free(stname *a) \ + { \ + ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \ + } + +#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) \ + stname *fname##_new(void) \ + { \ + return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \ + } \ + void fname##_free(stname *a) \ + { \ + ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \ + } + +#define IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, fname) \ + IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \ + IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) + +#define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \ + stname *d2i_##fname(stname **a, const unsigned char **in, long len) \ + { \ + return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname)); \ + } \ + int i2d_##fname(const stname *a, unsigned char **out) \ + { \ + return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname)); \ + } + +#define IMPLEMENT_ASN1_NDEF_FUNCTION(stname) \ + int i2d_##stname##_NDEF(const stname *a, unsigned char **out) \ + { \ + return ASN1_item_ndef_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(stname)); \ + } + +#define IMPLEMENT_STATIC_ASN1_ENCODE_FUNCTIONS(stname) \ + static stname *d2i_##stname(stname **a, \ + const unsigned char **in, long len) \ + { \ + return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, \ + ASN1_ITEM_rptr(stname)); \ + } \ + static int i2d_##stname(const stname *a, unsigned char **out) \ + { \ + return ASN1_item_i2d((const ASN1_VALUE *)a, out, \ + ASN1_ITEM_rptr(stname)); \ + } + +#define IMPLEMENT_ASN1_DUP_FUNCTION(stname) \ + stname *stname##_dup(const stname *x) \ + { \ + return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \ + } + +#define IMPLEMENT_ASN1_PRINT_FUNCTION(stname) \ + IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, stname, stname) + +#define IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, itname, fname) \ + int fname##_print_ctx(BIO *out, const stname *x, int indent, \ + const ASN1_PCTX *pctx) \ + { \ + return ASN1_item_print(out, (const ASN1_VALUE *)x, indent, \ + ASN1_ITEM_rptr(itname), pctx); \ + } + +/* external definitions for primitive types */ + +DECLARE_ASN1_ITEM(ASN1_BOOLEAN) +DECLARE_ASN1_ITEM(ASN1_TBOOLEAN) +DECLARE_ASN1_ITEM(ASN1_FBOOLEAN) +DECLARE_ASN1_ITEM(ASN1_SEQUENCE) +DECLARE_ASN1_ITEM(CBIGNUM) +DECLARE_ASN1_ITEM(BIGNUM) +DECLARE_ASN1_ITEM(INT32) +DECLARE_ASN1_ITEM(ZINT32) +DECLARE_ASN1_ITEM(UINT32) +DECLARE_ASN1_ITEM(ZUINT32) +DECLARE_ASN1_ITEM(INT64) +DECLARE_ASN1_ITEM(ZINT64) +DECLARE_ASN1_ITEM(UINT64) +DECLARE_ASN1_ITEM(ZUINT64) + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +/* + * LONG and ZLONG are strongly discouraged for use as stored data, as the + * underlying C type (long) differs in size depending on the architecture. + * They are designed with 32-bit longs in mind. + */ +DECLARE_ASN1_ITEM(LONG) +DECLARE_ASN1_ITEM(ZLONG) +#endif + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(ASN1_VALUE, ASN1_VALUE, ASN1_VALUE) +#define sk_ASN1_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_VALUE_sk_type(sk)) +#define sk_ASN1_VALUE_value(sk, idx) ((ASN1_VALUE *)OPENSSL_sk_value(ossl_check_const_ASN1_VALUE_sk_type(sk), (idx))) +#define sk_ASN1_VALUE_new(cmp) ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_new(ossl_check_ASN1_VALUE_compfunc_type(cmp))) +#define sk_ASN1_VALUE_new_null() ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_new_null()) +#define sk_ASN1_VALUE_new_reserve(cmp, n) ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_VALUE_compfunc_type(cmp), (n))) +#define sk_ASN1_VALUE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_VALUE_sk_type(sk), (n)) +#define sk_ASN1_VALUE_free(sk) OPENSSL_sk_free(ossl_check_ASN1_VALUE_sk_type(sk)) +#define sk_ASN1_VALUE_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_VALUE_sk_type(sk)) +#define sk_ASN1_VALUE_delete(sk, i) ((ASN1_VALUE *)OPENSSL_sk_delete(ossl_check_ASN1_VALUE_sk_type(sk), (i))) +#define sk_ASN1_VALUE_delete_ptr(sk, ptr) ((ASN1_VALUE *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr))) +#define sk_ASN1_VALUE_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr)) +#define sk_ASN1_VALUE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr)) +#define sk_ASN1_VALUE_pop(sk) ((ASN1_VALUE *)OPENSSL_sk_pop(ossl_check_ASN1_VALUE_sk_type(sk))) +#define sk_ASN1_VALUE_shift(sk) ((ASN1_VALUE *)OPENSSL_sk_shift(ossl_check_ASN1_VALUE_sk_type(sk))) +#define sk_ASN1_VALUE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_freefunc_type(freefunc)) +#define sk_ASN1_VALUE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr), (idx)) +#define sk_ASN1_VALUE_set(sk, idx, ptr) ((ASN1_VALUE *)OPENSSL_sk_set(ossl_check_ASN1_VALUE_sk_type(sk), (idx), ossl_check_ASN1_VALUE_type(ptr))) +#define sk_ASN1_VALUE_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr)) +#define sk_ASN1_VALUE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr)) +#define sk_ASN1_VALUE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr), pnum) +#define sk_ASN1_VALUE_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_VALUE_sk_type(sk)) +#define sk_ASN1_VALUE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_VALUE_sk_type(sk)) +#define sk_ASN1_VALUE_dup(sk) ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_dup(ossl_check_const_ASN1_VALUE_sk_type(sk))) +#define sk_ASN1_VALUE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_copyfunc_type(copyfunc), ossl_check_ASN1_VALUE_freefunc_type(freefunc))) +#define sk_ASN1_VALUE_set_cmp_func(sk, cmp) ((sk_ASN1_VALUE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_compfunc_type(cmp))) + +/* clang-format on */ + +/* Functions used internally by the ASN1 code */ + +int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it); +void ASN1_item_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it); + +int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, + const ASN1_ITEM *it, int tag, int aclass, char opt, + ASN1_TLC *ctx); + +int ASN1_item_ex_i2d(const ASN1_VALUE **pval, unsigned char **out, + const ASN1_ITEM *it, int tag, int aclass); + +/* Legacy compatibility */ +#define IMPLEMENT_ASN1_FUNCTIONS_const(name) IMPLEMENT_ASN1_FUNCTIONS(name) +#define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \ + IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/async.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/async.h new file mode 100644 index 0000000000000000000000000000000000000000..904438560f4de3ce7cb9a796e04425771fe72009 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/async.h @@ -0,0 +1,102 @@ +/* + * Copyright 2015-2022 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#include + +#ifndef OPENSSL_ASYNC_H +#define OPENSSL_ASYNC_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_ASYNC_H +#endif + +#if defined(_WIN32) +#if defined(BASETYPES) || defined(_WINDEF_H) +/* application has to include to use this */ +#define OSSL_ASYNC_FD HANDLE +#define OSSL_BAD_ASYNC_FD INVALID_HANDLE_VALUE +#endif +#else +#define OSSL_ASYNC_FD int +#define OSSL_BAD_ASYNC_FD -1 +#endif +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct async_job_st ASYNC_JOB; +typedef struct async_wait_ctx_st ASYNC_WAIT_CTX; +typedef int (*ASYNC_callback_fn)(void *arg); + +#define ASYNC_ERR 0 +#define ASYNC_NO_JOBS 1 +#define ASYNC_PAUSE 2 +#define ASYNC_FINISH 3 + +#define ASYNC_STATUS_UNSUPPORTED 0 +#define ASYNC_STATUS_ERR 1 +#define ASYNC_STATUS_OK 2 +#define ASYNC_STATUS_EAGAIN 3 + +int ASYNC_init_thread(size_t max_size, size_t init_size); +void ASYNC_cleanup_thread(void); + +#ifdef OSSL_ASYNC_FD +ASYNC_WAIT_CTX *ASYNC_WAIT_CTX_new(void); +void ASYNC_WAIT_CTX_free(ASYNC_WAIT_CTX *ctx); +int ASYNC_WAIT_CTX_set_wait_fd(ASYNC_WAIT_CTX *ctx, const void *key, + OSSL_ASYNC_FD fd, + void *custom_data, + void (*cleanup)(ASYNC_WAIT_CTX *, const void *, + OSSL_ASYNC_FD, void *)); +int ASYNC_WAIT_CTX_get_fd(ASYNC_WAIT_CTX *ctx, const void *key, + OSSL_ASYNC_FD *fd, void **custom_data); +int ASYNC_WAIT_CTX_get_all_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *fd, + size_t *numfds); +int ASYNC_WAIT_CTX_get_callback(ASYNC_WAIT_CTX *ctx, + ASYNC_callback_fn *callback, + void **callback_arg); +int ASYNC_WAIT_CTX_set_callback(ASYNC_WAIT_CTX *ctx, + ASYNC_callback_fn callback, + void *callback_arg); +int ASYNC_WAIT_CTX_set_status(ASYNC_WAIT_CTX *ctx, int status); +int ASYNC_WAIT_CTX_get_status(ASYNC_WAIT_CTX *ctx); +int ASYNC_WAIT_CTX_get_changed_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *addfd, + size_t *numaddfds, OSSL_ASYNC_FD *delfd, + size_t *numdelfds); +int ASYNC_WAIT_CTX_clear_fd(ASYNC_WAIT_CTX *ctx, const void *key); +#endif + +int ASYNC_is_capable(void); + +typedef void *(*ASYNC_stack_alloc_fn)(size_t *num); +typedef void (*ASYNC_stack_free_fn)(void *addr); + +int ASYNC_set_mem_functions(ASYNC_stack_alloc_fn alloc_fn, + ASYNC_stack_free_fn free_fn); +void ASYNC_get_mem_functions(ASYNC_stack_alloc_fn *alloc_fn, + ASYNC_stack_free_fn *free_fn); + +int ASYNC_start_job(ASYNC_JOB **job, ASYNC_WAIT_CTX *ctx, int *ret, + int (*func)(void *), void *args, size_t size); +int ASYNC_pause_job(void); + +ASYNC_JOB *ASYNC_get_current_job(void); +ASYNC_WAIT_CTX *ASYNC_get_wait_ctx(ASYNC_JOB *job); +void ASYNC_block_pause(void); +void ASYNC_unblock_pause(void); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/asyncerr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/asyncerr.h new file mode 100644 index 0000000000000000000000000000000000000000..41bd4a0391ad23d7f857613d526783fccf7d6673 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/asyncerr.h @@ -0,0 +1,27 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_ASYNCERR_H +#define OPENSSL_ASYNCERR_H +#pragma once + +#include +#include +#include + +/* + * ASYNC reason codes. + */ +#define ASYNC_R_FAILED_TO_SET_POOL 101 +#define ASYNC_R_FAILED_TO_SWAP_CONTEXT 102 +#define ASYNC_R_INIT_FAILED 105 +#define ASYNC_R_INVALID_POOL_SIZE 103 + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/bio.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/bio.h new file mode 100644 index 0000000000000000000000000000000000000000..3d89913ef52d9485c51c42feb4dd704cdbded88b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/bio.h @@ -0,0 +1,1028 @@ +/* + * WARNING: do not edit! + * Generated by makefile from include\openssl\bio.h.in + * + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ +/* clang-format off */ + +/* clang-format on */ + +#ifndef OPENSSL_BIO_H +#define OPENSSL_BIO_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_BIO_H +#endif + +#include + +#ifndef OPENSSL_NO_STDIO +#include +#endif +#include + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* There are the classes of BIOs */ +#define BIO_TYPE_DESCRIPTOR 0x0100 /* socket, fd, connect or accept */ +#define BIO_TYPE_FILTER 0x0200 +#define BIO_TYPE_SOURCE_SINK 0x0400 + +/* These are the 'types' of BIOs */ +#define BIO_TYPE_NONE 0 +#define BIO_TYPE_MEM (1 | BIO_TYPE_SOURCE_SINK) +#define BIO_TYPE_FILE (2 | BIO_TYPE_SOURCE_SINK) + +#define BIO_TYPE_FD (4 | BIO_TYPE_SOURCE_SINK | BIO_TYPE_DESCRIPTOR) +#define BIO_TYPE_SOCKET (5 | BIO_TYPE_SOURCE_SINK | BIO_TYPE_DESCRIPTOR) +#define BIO_TYPE_NULL (6 | BIO_TYPE_SOURCE_SINK) +#define BIO_TYPE_SSL (7 | BIO_TYPE_FILTER) +#define BIO_TYPE_MD (8 | BIO_TYPE_FILTER) +#define BIO_TYPE_BUFFER (9 | BIO_TYPE_FILTER) +#define BIO_TYPE_CIPHER (10 | BIO_TYPE_FILTER) +#define BIO_TYPE_BASE64 (11 | BIO_TYPE_FILTER) +#define BIO_TYPE_CONNECT (12 | BIO_TYPE_SOURCE_SINK | BIO_TYPE_DESCRIPTOR) +#define BIO_TYPE_ACCEPT (13 | BIO_TYPE_SOURCE_SINK | BIO_TYPE_DESCRIPTOR) + +#define BIO_TYPE_NBIO_TEST (16 | BIO_TYPE_FILTER) /* server proxy BIO */ +#define BIO_TYPE_NULL_FILTER (17 | BIO_TYPE_FILTER) +#define BIO_TYPE_BIO (19 | BIO_TYPE_SOURCE_SINK) /* half a BIO pair */ +#define BIO_TYPE_LINEBUFFER (20 | BIO_TYPE_FILTER) +#define BIO_TYPE_DGRAM (21 | BIO_TYPE_SOURCE_SINK | BIO_TYPE_DESCRIPTOR) +#define BIO_TYPE_ASN1 (22 | BIO_TYPE_FILTER) +#define BIO_TYPE_COMP (23 | BIO_TYPE_FILTER) +#ifndef OPENSSL_NO_SCTP +#define BIO_TYPE_DGRAM_SCTP (24 | BIO_TYPE_SOURCE_SINK | BIO_TYPE_DESCRIPTOR) +#endif +#define BIO_TYPE_CORE_TO_PROV (25 | BIO_TYPE_SOURCE_SINK) +#define BIO_TYPE_DGRAM_PAIR (26 | BIO_TYPE_SOURCE_SINK) +#define BIO_TYPE_DGRAM_MEM (27 | BIO_TYPE_SOURCE_SINK) + +/* Custom type starting index returned by BIO_get_new_index() */ +#define BIO_TYPE_START 128 +/* Custom type maximum index that can be returned by BIO_get_new_index() */ +#define BIO_TYPE_MASK 0xFF + +/* + * BIO_FILENAME_READ|BIO_CLOSE to open or close on free. + * BIO_set_fp(in,stdin,BIO_NOCLOSE); + */ +#define BIO_NOCLOSE 0x00 +#define BIO_CLOSE 0x01 + +/* + * These are used in the following macros and are passed to BIO_ctrl() + */ +#define BIO_CTRL_RESET 1 /* opt - rewind/zero etc */ +#define BIO_CTRL_EOF 2 /* opt - are we at the eof */ +#define BIO_CTRL_INFO 3 /* opt - extra tit-bits */ +#define BIO_CTRL_SET 4 /* man - set the 'IO' type */ +#define BIO_CTRL_GET 5 /* man - get the 'IO' type */ +#define BIO_CTRL_PUSH 6 /* opt - internal, used to signify change */ +#define BIO_CTRL_POP 7 /* opt - internal, used to signify change */ +#define BIO_CTRL_GET_CLOSE 8 /* man - set the 'close' on free */ +#define BIO_CTRL_SET_CLOSE 9 /* man - set the 'close' on free */ +#define BIO_CTRL_PENDING 10 /* opt - is their more data buffered */ +#define BIO_CTRL_FLUSH 11 /* opt - 'flush' buffered output */ +#define BIO_CTRL_DUP 12 /* man - extra stuff for 'duped' BIO */ +#define BIO_CTRL_WPENDING 13 /* opt - number of bytes still to write */ +#define BIO_CTRL_SET_CALLBACK 14 /* opt - set callback function */ +#define BIO_CTRL_GET_CALLBACK 15 /* opt - set callback function */ + +#define BIO_CTRL_PEEK 29 /* BIO_f_buffer special */ +#define BIO_CTRL_SET_FILENAME 30 /* BIO_s_file special */ + +/* dgram BIO stuff */ +#define BIO_CTRL_DGRAM_CONNECT 31 /* BIO dgram special */ +#define BIO_CTRL_DGRAM_SET_CONNECTED 32 /* allow for an externally connected \ + * socket to be passed in */ +#define BIO_CTRL_DGRAM_SET_RECV_TIMEOUT 33 /* setsockopt, essentially */ +#define BIO_CTRL_DGRAM_GET_RECV_TIMEOUT 34 /* getsockopt, essentially */ +#define BIO_CTRL_DGRAM_SET_SEND_TIMEOUT 35 /* setsockopt, essentially */ +#define BIO_CTRL_DGRAM_GET_SEND_TIMEOUT 36 /* getsockopt, essentially */ + +#define BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP 37 /* flag whether the last */ +#define BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP 38 /* I/O operation timed out */ + +/* #ifdef IP_MTU_DISCOVER */ +#define BIO_CTRL_DGRAM_MTU_DISCOVER 39 /* set DF bit on egress packets */ +/* #endif */ + +#define BIO_CTRL_DGRAM_QUERY_MTU 40 /* as kernel for current MTU */ +#define BIO_CTRL_DGRAM_GET_FALLBACK_MTU 47 +#define BIO_CTRL_DGRAM_GET_MTU 41 /* get cached value for MTU */ +#define BIO_CTRL_DGRAM_SET_MTU 42 /* set cached value for MTU. \ + * want to use this if asking \ + * the kernel fails */ + +#define BIO_CTRL_DGRAM_MTU_EXCEEDED 43 /* check whether the MTU was \ + * exceed in the previous write \ + * operation */ + +#define BIO_CTRL_DGRAM_GET_PEER 46 +#define BIO_CTRL_DGRAM_SET_PEER 44 /* Destination for the data */ + +#define BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT 45 /* Next DTLS handshake timeout \ + * to adjust socket timeouts */ +#define BIO_CTRL_DGRAM_SET_DONT_FRAG 48 + +#define BIO_CTRL_DGRAM_GET_MTU_OVERHEAD 49 + +/* Deliberately outside of OPENSSL_NO_SCTP - used in bss_dgram.c */ +#define BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE 50 +#ifndef OPENSSL_NO_SCTP +/* SCTP stuff */ +#define BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY 51 +#define BIO_CTRL_DGRAM_SCTP_NEXT_AUTH_KEY 52 +#define BIO_CTRL_DGRAM_SCTP_AUTH_CCS_RCVD 53 +#define BIO_CTRL_DGRAM_SCTP_GET_SNDINFO 60 +#define BIO_CTRL_DGRAM_SCTP_SET_SNDINFO 61 +#define BIO_CTRL_DGRAM_SCTP_GET_RCVINFO 62 +#define BIO_CTRL_DGRAM_SCTP_SET_RCVINFO 63 +#define BIO_CTRL_DGRAM_SCTP_GET_PRINFO 64 +#define BIO_CTRL_DGRAM_SCTP_SET_PRINFO 65 +#define BIO_CTRL_DGRAM_SCTP_SAVE_SHUTDOWN 70 +#endif + +#define BIO_CTRL_DGRAM_SET_PEEK_MODE 71 + +/* + * internal BIO: + * # define BIO_CTRL_SET_KTLS_SEND 72 + * # define BIO_CTRL_SET_KTLS_SEND_CTRL_MSG 74 + * # define BIO_CTRL_CLEAR_KTLS_CTRL_MSG 75 + */ + +#define BIO_CTRL_GET_KTLS_SEND 73 +#define BIO_CTRL_GET_KTLS_RECV 76 + +#define BIO_CTRL_DGRAM_SCTP_WAIT_FOR_DRY 77 +#define BIO_CTRL_DGRAM_SCTP_MSG_WAITING 78 + +/* BIO_f_prefix controls */ +#define BIO_CTRL_SET_PREFIX 79 +#define BIO_CTRL_SET_INDENT 80 +#define BIO_CTRL_GET_INDENT 81 + +#define BIO_CTRL_DGRAM_GET_LOCAL_ADDR_CAP 82 +#define BIO_CTRL_DGRAM_GET_LOCAL_ADDR_ENABLE 83 +#define BIO_CTRL_DGRAM_SET_LOCAL_ADDR_ENABLE 84 +#define BIO_CTRL_DGRAM_GET_EFFECTIVE_CAPS 85 +#define BIO_CTRL_DGRAM_GET_CAPS 86 +#define BIO_CTRL_DGRAM_SET_CAPS 87 +#define BIO_CTRL_DGRAM_GET_NO_TRUNC 88 +#define BIO_CTRL_DGRAM_SET_NO_TRUNC 89 + +/* + * internal BIO: + * # define BIO_CTRL_SET_KTLS_TX_ZEROCOPY_SENDFILE 90 + */ + +#define BIO_CTRL_GET_RPOLL_DESCRIPTOR 91 +#define BIO_CTRL_GET_WPOLL_DESCRIPTOR 92 +#define BIO_CTRL_DGRAM_DETECT_PEER_ADDR 93 +#define BIO_CTRL_DGRAM_SET0_LOCAL_ADDR 94 + +#define BIO_DGRAM_CAP_NONE 0U +#define BIO_DGRAM_CAP_HANDLES_SRC_ADDR (1U << 0) +#define BIO_DGRAM_CAP_HANDLES_DST_ADDR (1U << 1) +#define BIO_DGRAM_CAP_PROVIDES_SRC_ADDR (1U << 2) +#define BIO_DGRAM_CAP_PROVIDES_DST_ADDR (1U << 3) + +#ifndef OPENSSL_NO_KTLS +#define BIO_get_ktls_send(b) \ + (BIO_ctrl(b, BIO_CTRL_GET_KTLS_SEND, 0, NULL) > 0) +#define BIO_get_ktls_recv(b) \ + (BIO_ctrl(b, BIO_CTRL_GET_KTLS_RECV, 0, NULL) > 0) +#else +#define BIO_get_ktls_send(b) (0) +#define BIO_get_ktls_recv(b) (0) +#endif + +/* modifiers */ +#define BIO_FP_READ 0x02 +#define BIO_FP_WRITE 0x04 +#define BIO_FP_APPEND 0x08 +#define BIO_FP_TEXT 0x10 + +#define BIO_FLAGS_READ 0x01 +#define BIO_FLAGS_WRITE 0x02 +#define BIO_FLAGS_IO_SPECIAL 0x04 +#define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL) +#define BIO_FLAGS_SHOULD_RETRY 0x08 +#ifndef OPENSSL_NO_DEPRECATED_3_0 +/* This #define was replaced by an internal constant and should not be used. */ +#define BIO_FLAGS_UPLINK 0 +#endif + +#define BIO_FLAGS_BASE64_NO_NL 0x100 + +/* + * This is used with memory BIOs: + * BIO_FLAGS_MEM_RDONLY means we shouldn't free up or change the data in any way; + * BIO_FLAGS_NONCLEAR_RST means we shouldn't clear data on reset. + */ +#define BIO_FLAGS_MEM_RDONLY 0x200 +#define BIO_FLAGS_NONCLEAR_RST 0x400 +#define BIO_FLAGS_IN_EOF 0x800 + +/* the BIO FLAGS values 0x1000 to 0x8000 are reserved for internal KTLS flags */ + +typedef union bio_addr_st BIO_ADDR; +typedef struct bio_addrinfo_st BIO_ADDRINFO; + +int BIO_get_new_index(void); +void BIO_set_flags(BIO *b, int flags); +int BIO_test_flags(const BIO *b, int flags); +void BIO_clear_flags(BIO *b, int flags); + +#define BIO_get_flags(b) BIO_test_flags(b, ~(0x0)) +#define BIO_set_retry_special(b) \ + BIO_set_flags(b, (BIO_FLAGS_IO_SPECIAL | BIO_FLAGS_SHOULD_RETRY)) +#define BIO_set_retry_read(b) \ + BIO_set_flags(b, (BIO_FLAGS_READ | BIO_FLAGS_SHOULD_RETRY)) +#define BIO_set_retry_write(b) \ + BIO_set_flags(b, (BIO_FLAGS_WRITE | BIO_FLAGS_SHOULD_RETRY)) + +/* These are normally used internally in BIOs */ +#define BIO_clear_retry_flags(b) \ + BIO_clear_flags(b, (BIO_FLAGS_RWS | BIO_FLAGS_SHOULD_RETRY)) +#define BIO_get_retry_flags(b) \ + BIO_test_flags(b, (BIO_FLAGS_RWS | BIO_FLAGS_SHOULD_RETRY)) + +/* These should be used by the application to tell why we should retry */ +#define BIO_should_read(a) BIO_test_flags(a, BIO_FLAGS_READ) +#define BIO_should_write(a) BIO_test_flags(a, BIO_FLAGS_WRITE) +#define BIO_should_io_special(a) BIO_test_flags(a, BIO_FLAGS_IO_SPECIAL) +#define BIO_retry_type(a) BIO_test_flags(a, BIO_FLAGS_RWS) +#define BIO_should_retry(a) BIO_test_flags(a, BIO_FLAGS_SHOULD_RETRY) + +/* + * The next three are used in conjunction with the BIO_should_io_special() + * condition. After this returns true, BIO *BIO_get_retry_BIO(BIO *bio, int + * *reason); will walk the BIO stack and return the 'reason' for the special + * and the offending BIO. Given a BIO, BIO_get_retry_reason(bio) will return + * the code. + */ +/* + * Returned from the SSL bio when the certificate retrieval code had an error + */ +#define BIO_RR_SSL_X509_LOOKUP 0x01 +/* Returned from the connect BIO when a connect would have blocked */ +#define BIO_RR_CONNECT 0x02 +/* Returned from the accept BIO when an accept would have blocked */ +#define BIO_RR_ACCEPT 0x03 + +/* These are passed by the BIO callback */ +#define BIO_CB_FREE 0x01 +#define BIO_CB_READ 0x02 +#define BIO_CB_WRITE 0x03 +#define BIO_CB_PUTS 0x04 +#define BIO_CB_GETS 0x05 +#define BIO_CB_CTRL 0x06 +#define BIO_CB_RECVMMSG 0x07 +#define BIO_CB_SENDMMSG 0x08 + +/* + * The callback is called before and after the underling operation, The + * BIO_CB_RETURN flag indicates if it is after the call + */ +#define BIO_CB_RETURN 0x80 +#define BIO_CB_return(a) ((a) | BIO_CB_RETURN) +#define BIO_cb_pre(a) (!((a) & BIO_CB_RETURN)) +#define BIO_cb_post(a) ((a) & BIO_CB_RETURN) + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +typedef long (*BIO_callback_fn)(BIO *b, int oper, const char *argp, int argi, + long argl, long ret); +OSSL_DEPRECATEDIN_3_0 BIO_callback_fn BIO_get_callback(const BIO *b); +OSSL_DEPRECATEDIN_3_0 void BIO_set_callback(BIO *b, BIO_callback_fn callback); +OSSL_DEPRECATEDIN_3_0 long BIO_debug_callback(BIO *bio, int cmd, + const char *argp, int argi, + long argl, long ret); +#endif + +typedef long (*BIO_callback_fn_ex)(BIO *b, int oper, const char *argp, + size_t len, int argi, + long argl, int ret, size_t *processed); +BIO_callback_fn_ex BIO_get_callback_ex(const BIO *b); +void BIO_set_callback_ex(BIO *b, BIO_callback_fn_ex callback); +long BIO_debug_callback_ex(BIO *bio, int oper, const char *argp, size_t len, + int argi, long argl, int ret, size_t *processed); + +char *BIO_get_callback_arg(const BIO *b); +void BIO_set_callback_arg(BIO *b, char *arg); + +typedef struct bio_method_st BIO_METHOD; + +const char *BIO_method_name(const BIO *b); +int BIO_method_type(const BIO *b); + +typedef int BIO_info_cb(BIO *, int, int); +typedef BIO_info_cb bio_info_cb; /* backward compatibility */ + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(BIO, BIO, BIO) +#define sk_BIO_num(sk) OPENSSL_sk_num(ossl_check_const_BIO_sk_type(sk)) +#define sk_BIO_value(sk, idx) ((BIO *)OPENSSL_sk_value(ossl_check_const_BIO_sk_type(sk), (idx))) +#define sk_BIO_new(cmp) ((STACK_OF(BIO) *)OPENSSL_sk_new(ossl_check_BIO_compfunc_type(cmp))) +#define sk_BIO_new_null() ((STACK_OF(BIO) *)OPENSSL_sk_new_null()) +#define sk_BIO_new_reserve(cmp, n) ((STACK_OF(BIO) *)OPENSSL_sk_new_reserve(ossl_check_BIO_compfunc_type(cmp), (n))) +#define sk_BIO_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_BIO_sk_type(sk), (n)) +#define sk_BIO_free(sk) OPENSSL_sk_free(ossl_check_BIO_sk_type(sk)) +#define sk_BIO_zero(sk) OPENSSL_sk_zero(ossl_check_BIO_sk_type(sk)) +#define sk_BIO_delete(sk, i) ((BIO *)OPENSSL_sk_delete(ossl_check_BIO_sk_type(sk), (i))) +#define sk_BIO_delete_ptr(sk, ptr) ((BIO *)OPENSSL_sk_delete_ptr(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr))) +#define sk_BIO_push(sk, ptr) OPENSSL_sk_push(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr)) +#define sk_BIO_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr)) +#define sk_BIO_pop(sk) ((BIO *)OPENSSL_sk_pop(ossl_check_BIO_sk_type(sk))) +#define sk_BIO_shift(sk) ((BIO *)OPENSSL_sk_shift(ossl_check_BIO_sk_type(sk))) +#define sk_BIO_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_BIO_sk_type(sk), ossl_check_BIO_freefunc_type(freefunc)) +#define sk_BIO_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr), (idx)) +#define sk_BIO_set(sk, idx, ptr) ((BIO *)OPENSSL_sk_set(ossl_check_BIO_sk_type(sk), (idx), ossl_check_BIO_type(ptr))) +#define sk_BIO_find(sk, ptr) OPENSSL_sk_find(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr)) +#define sk_BIO_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr)) +#define sk_BIO_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr), pnum) +#define sk_BIO_sort(sk) OPENSSL_sk_sort(ossl_check_BIO_sk_type(sk)) +#define sk_BIO_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_BIO_sk_type(sk)) +#define sk_BIO_dup(sk) ((STACK_OF(BIO) *)OPENSSL_sk_dup(ossl_check_const_BIO_sk_type(sk))) +#define sk_BIO_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(BIO) *)OPENSSL_sk_deep_copy(ossl_check_const_BIO_sk_type(sk), ossl_check_BIO_copyfunc_type(copyfunc), ossl_check_BIO_freefunc_type(freefunc))) +#define sk_BIO_set_cmp_func(sk, cmp) ((sk_BIO_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_BIO_sk_type(sk), ossl_check_BIO_compfunc_type(cmp))) + +/* clang-format on */ + +/* Prefix and suffix callback in ASN1 BIO */ +typedef int asn1_ps_func(BIO *b, unsigned char **pbuf, int *plen, + void *parg); + +typedef void (*BIO_dgram_sctp_notification_handler_fn)(BIO *b, + void *context, + void *buf); +#ifndef OPENSSL_NO_SCTP +/* SCTP parameter structs */ +struct bio_dgram_sctp_sndinfo { + uint16_t snd_sid; + uint16_t snd_flags; + uint32_t snd_ppid; + uint32_t snd_context; +}; + +struct bio_dgram_sctp_rcvinfo { + uint16_t rcv_sid; + uint16_t rcv_ssn; + uint16_t rcv_flags; + uint32_t rcv_ppid; + uint32_t rcv_tsn; + uint32_t rcv_cumtsn; + uint32_t rcv_context; +}; + +struct bio_dgram_sctp_prinfo { + uint16_t pr_policy; + uint32_t pr_value; +}; +#endif + +/* BIO_sendmmsg/BIO_recvmmsg-related definitions */ +typedef struct bio_msg_st { + void *data; + size_t data_len; + BIO_ADDR *peer, *local; + uint64_t flags; +} BIO_MSG; + +typedef struct bio_mmsg_cb_args_st { + BIO_MSG *msg; + size_t stride, num_msg; + uint64_t flags; + size_t *msgs_processed; +} BIO_MMSG_CB_ARGS; + +#define BIO_POLL_DESCRIPTOR_TYPE_NONE 0 +#define BIO_POLL_DESCRIPTOR_TYPE_SOCK_FD 1 +#define BIO_POLL_DESCRIPTOR_TYPE_SSL 2 +#define BIO_POLL_DESCRIPTOR_CUSTOM_START 8192 + +typedef struct bio_poll_descriptor_st { + uint32_t type; + union { + int fd; + void *custom; + uintptr_t custom_ui; + SSL *ssl; + } value; +} BIO_POLL_DESCRIPTOR; + +/* + * #define BIO_CONN_get_param_hostname BIO_ctrl + */ + +#define BIO_C_SET_CONNECT 100 +#define BIO_C_DO_STATE_MACHINE 101 +#define BIO_C_SET_NBIO 102 +/* # define BIO_C_SET_PROXY_PARAM 103 */ +#define BIO_C_SET_FD 104 +#define BIO_C_GET_FD 105 +#define BIO_C_SET_FILE_PTR 106 +#define BIO_C_GET_FILE_PTR 107 +#define BIO_C_SET_FILENAME 108 +#define BIO_C_SET_SSL 109 +#define BIO_C_GET_SSL 110 +#define BIO_C_SET_MD 111 +#define BIO_C_GET_MD 112 +#define BIO_C_GET_CIPHER_STATUS 113 +#define BIO_C_SET_BUF_MEM 114 +#define BIO_C_GET_BUF_MEM_PTR 115 +#define BIO_C_GET_BUFF_NUM_LINES 116 +#define BIO_C_SET_BUFF_SIZE 117 +#define BIO_C_SET_ACCEPT 118 +#define BIO_C_SSL_MODE 119 +#define BIO_C_GET_MD_CTX 120 +/* # define BIO_C_GET_PROXY_PARAM 121 */ +#define BIO_C_SET_BUFF_READ_DATA 122 /* data to read first */ +#define BIO_C_GET_CONNECT 123 +#define BIO_C_GET_ACCEPT 124 +#define BIO_C_SET_SSL_RENEGOTIATE_BYTES 125 +#define BIO_C_GET_SSL_NUM_RENEGOTIATES 126 +#define BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT 127 +#define BIO_C_FILE_SEEK 128 +#define BIO_C_GET_CIPHER_CTX 129 +#define BIO_C_SET_BUF_MEM_EOF_RETURN 130 /* return end of input \ + * value */ +#define BIO_C_SET_BIND_MODE 131 +#define BIO_C_GET_BIND_MODE 132 +#define BIO_C_FILE_TELL 133 +#define BIO_C_GET_SOCKS 134 +#define BIO_C_SET_SOCKS 135 + +#define BIO_C_SET_WRITE_BUF_SIZE 136 /* for BIO_s_bio */ +#define BIO_C_GET_WRITE_BUF_SIZE 137 +#define BIO_C_MAKE_BIO_PAIR 138 +#define BIO_C_DESTROY_BIO_PAIR 139 +#define BIO_C_GET_WRITE_GUARANTEE 140 +#define BIO_C_GET_READ_REQUEST 141 +#define BIO_C_SHUTDOWN_WR 142 +#define BIO_C_NREAD0 143 +#define BIO_C_NREAD 144 +#define BIO_C_NWRITE0 145 +#define BIO_C_NWRITE 146 +#define BIO_C_RESET_READ_REQUEST 147 +#define BIO_C_SET_MD_CTX 148 + +#define BIO_C_SET_PREFIX 149 +#define BIO_C_GET_PREFIX 150 +#define BIO_C_SET_SUFFIX 151 +#define BIO_C_GET_SUFFIX 152 + +#define BIO_C_SET_EX_ARG 153 +#define BIO_C_GET_EX_ARG 154 + +#define BIO_C_SET_CONNECT_MODE 155 + +#define BIO_C_SET_TFO 156 /* like BIO_C_SET_NBIO */ + +#define BIO_C_SET_SOCK_TYPE 157 +#define BIO_C_GET_SOCK_TYPE 158 +#define BIO_C_GET_DGRAM_BIO 159 + +#define BIO_set_app_data(s, arg) BIO_set_ex_data(s, 0, arg) +#define BIO_get_app_data(s) BIO_get_ex_data(s, 0) + +#define BIO_set_nbio(b, n) BIO_ctrl(b, BIO_C_SET_NBIO, (n), NULL) +#define BIO_set_tfo(b, n) BIO_ctrl(b, BIO_C_SET_TFO, (n), NULL) + +#ifndef OPENSSL_NO_SOCK +/* IP families we support, for BIO_s_connect() and BIO_s_accept() */ +/* Note: the underlying operating system may not support some of them */ +#define BIO_FAMILY_IPV4 4 +#define BIO_FAMILY_IPV6 6 +#define BIO_FAMILY_IPANY 256 + +/* BIO_s_connect() */ +#define BIO_set_conn_hostname(b, name) BIO_ctrl(b, BIO_C_SET_CONNECT, 0, \ + (char *)(name)) +#define BIO_set_conn_port(b, port) BIO_ctrl(b, BIO_C_SET_CONNECT, 1, \ + (char *)(port)) +#define BIO_set_conn_address(b, addr) BIO_ctrl(b, BIO_C_SET_CONNECT, 2, \ + (char *)(addr)) +#define BIO_set_conn_ip_family(b, f) BIO_int_ctrl(b, BIO_C_SET_CONNECT, 3, f) +#define BIO_get_conn_hostname(b) ((const char *)BIO_ptr_ctrl(b, BIO_C_GET_CONNECT, 0)) +#define BIO_get_conn_port(b) ((const char *)BIO_ptr_ctrl(b, BIO_C_GET_CONNECT, 1)) +#define BIO_get_conn_address(b) ((const BIO_ADDR *)BIO_ptr_ctrl(b, BIO_C_GET_CONNECT, 2)) +#define BIO_get_conn_ip_family(b) BIO_ctrl(b, BIO_C_GET_CONNECT, 3, NULL) +#define BIO_get_conn_mode(b) BIO_ctrl(b, BIO_C_GET_CONNECT, 4, NULL) +#define BIO_set_conn_mode(b, n) BIO_ctrl(b, BIO_C_SET_CONNECT_MODE, (n), NULL) +#define BIO_set_sock_type(b, t) BIO_ctrl(b, BIO_C_SET_SOCK_TYPE, (t), NULL) +#define BIO_get_sock_type(b) BIO_ctrl(b, BIO_C_GET_SOCK_TYPE, 0, NULL) +#define BIO_get0_dgram_bio(b, p) BIO_ctrl(b, BIO_C_GET_DGRAM_BIO, 0, (void *)(BIO **)(p)) + +/* BIO_s_accept() */ +#define BIO_set_accept_name(b, name) BIO_ctrl(b, BIO_C_SET_ACCEPT, 0, \ + (char *)(name)) +#define BIO_set_accept_port(b, port) BIO_ctrl(b, BIO_C_SET_ACCEPT, 1, \ + (char *)(port)) +#define BIO_get_accept_name(b) ((const char *)BIO_ptr_ctrl(b, BIO_C_GET_ACCEPT, 0)) +#define BIO_get_accept_port(b) ((const char *)BIO_ptr_ctrl(b, BIO_C_GET_ACCEPT, 1)) +#define BIO_get_peer_name(b) ((const char *)BIO_ptr_ctrl(b, BIO_C_GET_ACCEPT, 2)) +#define BIO_get_peer_port(b) ((const char *)BIO_ptr_ctrl(b, BIO_C_GET_ACCEPT, 3)) +/* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) */ +#define BIO_set_nbio_accept(b, n) BIO_ctrl(b, BIO_C_SET_ACCEPT, 2, (n) ? (void *)"a" : NULL) +#define BIO_set_accept_bios(b, bio) BIO_ctrl(b, BIO_C_SET_ACCEPT, 3, \ + (char *)(bio)) +#define BIO_set_accept_ip_family(b, f) BIO_int_ctrl(b, BIO_C_SET_ACCEPT, 4, f) +#define BIO_get_accept_ip_family(b) BIO_ctrl(b, BIO_C_GET_ACCEPT, 4, NULL) +#define BIO_set_tfo_accept(b, n) BIO_ctrl(b, BIO_C_SET_ACCEPT, 5, (n) ? (void *)"a" : NULL) + +/* Aliases kept for backward compatibility */ +#define BIO_BIND_NORMAL 0 +#define BIO_BIND_REUSEADDR BIO_SOCK_REUSEADDR +#define BIO_BIND_REUSEADDR_IF_UNUSED BIO_SOCK_REUSEADDR +#define BIO_set_bind_mode(b, mode) BIO_ctrl(b, BIO_C_SET_BIND_MODE, mode, NULL) +#define BIO_get_bind_mode(b) BIO_ctrl(b, BIO_C_GET_BIND_MODE, 0, NULL) +#endif /* OPENSSL_NO_SOCK */ + +#define BIO_do_connect(b) BIO_do_handshake(b) +#define BIO_do_accept(b) BIO_do_handshake(b) + +#define BIO_do_handshake(b) BIO_ctrl(b, BIO_C_DO_STATE_MACHINE, 0, NULL) + +/* BIO_s_datagram(), BIO_s_fd(), BIO_s_socket(), BIO_s_accept() and BIO_s_connect() */ +#define BIO_set_fd(b, fd, c) BIO_int_ctrl(b, BIO_C_SET_FD, c, fd) +#define BIO_get_fd(b, c) BIO_ctrl(b, BIO_C_GET_FD, 0, (char *)(c)) + +/* BIO_s_file() */ +#define BIO_set_fp(b, fp, c) BIO_ctrl(b, BIO_C_SET_FILE_PTR, c, (char *)(fp)) +#define BIO_get_fp(b, fpp) BIO_ctrl(b, BIO_C_GET_FILE_PTR, 0, (char *)(fpp)) + +/* BIO_s_fd() and BIO_s_file() */ +#define BIO_seek(b, ofs) (int)BIO_ctrl(b, BIO_C_FILE_SEEK, ofs, NULL) +#define BIO_tell(b) (int)BIO_ctrl(b, BIO_C_FILE_TELL, 0, NULL) + +/* + * name is cast to lose const, but might be better to route through a + * function so we can do it safely + */ +#ifdef CONST_STRICT +/* + * If you are wondering why this isn't defined, its because CONST_STRICT is + * purely a compile-time kludge to allow const to be checked. + */ +int BIO_read_filename(BIO *b, const char *name); +#else +#define BIO_read_filename(b, name) (int)BIO_ctrl(b, BIO_C_SET_FILENAME, \ + BIO_CLOSE | BIO_FP_READ, (char *)(name)) +#endif +#define BIO_write_filename(b, name) (int)BIO_ctrl(b, BIO_C_SET_FILENAME, \ + BIO_CLOSE | BIO_FP_WRITE, name) +#define BIO_append_filename(b, name) (int)BIO_ctrl(b, BIO_C_SET_FILENAME, \ + BIO_CLOSE | BIO_FP_APPEND, name) +#define BIO_rw_filename(b, name) (int)BIO_ctrl(b, BIO_C_SET_FILENAME, \ + BIO_CLOSE | BIO_FP_READ | BIO_FP_WRITE, name) + +/* + * WARNING WARNING, this ups the reference count on the read bio of the SSL + * structure. This is because the ssl read BIO is now pointed to by the + * next_bio field in the bio. So when you free the BIO, make sure you are + * doing a BIO_free_all() to catch the underlying BIO. + */ +#define BIO_set_ssl(b, ssl, c) BIO_ctrl(b, BIO_C_SET_SSL, c, (char *)(ssl)) +#define BIO_get_ssl(b, sslp) BIO_ctrl(b, BIO_C_GET_SSL, 0, (char *)(sslp)) +#define BIO_set_ssl_mode(b, client) BIO_ctrl(b, BIO_C_SSL_MODE, client, NULL) +#define BIO_set_ssl_renegotiate_bytes(b, num) \ + BIO_ctrl(b, BIO_C_SET_SSL_RENEGOTIATE_BYTES, num, NULL) +#define BIO_get_num_renegotiates(b) \ + BIO_ctrl(b, BIO_C_GET_SSL_NUM_RENEGOTIATES, 0, NULL) +#define BIO_set_ssl_renegotiate_timeout(b, seconds) \ + BIO_ctrl(b, BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT, seconds, NULL) + +/* defined in evp.h */ +/* #define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,1,(char *)(md)) */ + +#define BIO_get_mem_data(b, pp) BIO_ctrl(b, BIO_CTRL_INFO, 0, (char *)(pp)) +#define BIO_set_mem_buf(b, bm, c) BIO_ctrl(b, BIO_C_SET_BUF_MEM, c, (char *)(bm)) +#define BIO_get_mem_ptr(b, pp) BIO_ctrl(b, BIO_C_GET_BUF_MEM_PTR, 0, \ + (char *)(pp)) +#define BIO_set_mem_eof_return(b, v) \ + BIO_ctrl(b, BIO_C_SET_BUF_MEM_EOF_RETURN, v, NULL) + +/* For the BIO_f_buffer() type */ +#define BIO_get_buffer_num_lines(b) BIO_ctrl(b, BIO_C_GET_BUFF_NUM_LINES, 0, NULL) +#define BIO_set_buffer_size(b, size) BIO_ctrl(b, BIO_C_SET_BUFF_SIZE, size, NULL) +#define BIO_set_read_buffer_size(b, size) BIO_int_ctrl(b, BIO_C_SET_BUFF_SIZE, size, 0) +#define BIO_set_write_buffer_size(b, size) BIO_int_ctrl(b, BIO_C_SET_BUFF_SIZE, size, 1) +#define BIO_set_buffer_read_data(b, buf, num) BIO_ctrl(b, BIO_C_SET_BUFF_READ_DATA, num, buf) + +/* Don't use the next one unless you know what you are doing :-) */ +#define BIO_dup_state(b, ret) BIO_ctrl(b, BIO_CTRL_DUP, 0, (char *)(ret)) + +#define BIO_reset(b) (int)BIO_ctrl(b, BIO_CTRL_RESET, 0, NULL) +#define BIO_eof(b) (int)BIO_ctrl(b, BIO_CTRL_EOF, 0, NULL) +#define BIO_set_close(b, c) (int)BIO_ctrl(b, BIO_CTRL_SET_CLOSE, (c), NULL) +#define BIO_get_close(b) (int)BIO_ctrl(b, BIO_CTRL_GET_CLOSE, 0, NULL) +#define BIO_pending(b) (int)BIO_ctrl(b, BIO_CTRL_PENDING, 0, NULL) +#define BIO_wpending(b) (int)BIO_ctrl(b, BIO_CTRL_WPENDING, 0, NULL) +/* ...pending macros have inappropriate return type */ +size_t BIO_ctrl_pending(BIO *b); +size_t BIO_ctrl_wpending(BIO *b); +#define BIO_flush(b) (int)BIO_ctrl(b, BIO_CTRL_FLUSH, 0, NULL) +#define BIO_get_info_callback(b, cbp) (int)BIO_ctrl(b, BIO_CTRL_GET_CALLBACK, 0, \ + cbp) +#define BIO_set_info_callback(b, cb) (int)BIO_callback_ctrl(b, BIO_CTRL_SET_CALLBACK, cb) + +/* For the BIO_f_buffer() type */ +#define BIO_buffer_get_num_lines(b) BIO_ctrl(b, BIO_CTRL_GET, 0, NULL) +#define BIO_buffer_peek(b, s, l) BIO_ctrl(b, BIO_CTRL_PEEK, (l), (s)) + +/* For BIO_s_bio() */ +#define BIO_set_write_buf_size(b, size) (int)BIO_ctrl(b, BIO_C_SET_WRITE_BUF_SIZE, size, NULL) +#define BIO_get_write_buf_size(b, size) (size_t)BIO_ctrl(b, BIO_C_GET_WRITE_BUF_SIZE, size, NULL) +#define BIO_make_bio_pair(b1, b2) (int)BIO_ctrl(b1, BIO_C_MAKE_BIO_PAIR, 0, b2) +#define BIO_destroy_bio_pair(b) (int)BIO_ctrl(b, BIO_C_DESTROY_BIO_PAIR, 0, NULL) +#define BIO_shutdown_wr(b) (int)BIO_ctrl(b, BIO_C_SHUTDOWN_WR, 0, NULL) +/* macros with inappropriate type -- but ...pending macros use int too: */ +#define BIO_get_write_guarantee(b) (int)BIO_ctrl(b, BIO_C_GET_WRITE_GUARANTEE, 0, NULL) +#define BIO_get_read_request(b) (int)BIO_ctrl(b, BIO_C_GET_READ_REQUEST, 0, NULL) +size_t BIO_ctrl_get_write_guarantee(BIO *b); +size_t BIO_ctrl_get_read_request(BIO *b); +int BIO_ctrl_reset_read_request(BIO *b); + +/* ctrl macros for dgram */ +#define BIO_ctrl_dgram_connect(b, peer) \ + (int)BIO_ctrl(b, BIO_CTRL_DGRAM_CONNECT, 0, (char *)(peer)) +#define BIO_ctrl_set_connected(b, peer) \ + (int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_CONNECTED, 0, (char *)(peer)) +#define BIO_dgram_recv_timedout(b) \ + (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP, 0, NULL) +#define BIO_dgram_send_timedout(b) \ + (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP, 0, NULL) +#define BIO_dgram_get_peer(b, peer) \ + (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_PEER, 0, (char *)(peer)) +#define BIO_dgram_set_peer(b, peer) \ + (int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, (char *)(peer)) +#define BIO_dgram_detect_peer_addr(b, peer) \ + (int)BIO_ctrl(b, BIO_CTRL_DGRAM_DETECT_PEER_ADDR, 0, (char *)(peer)) +#define BIO_dgram_get_mtu_overhead(b) \ + (unsigned int)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_MTU_OVERHEAD, 0, NULL) +#define BIO_dgram_get_local_addr_cap(b) \ + (int)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_LOCAL_ADDR_CAP, 0, NULL) +#define BIO_dgram_get_local_addr_enable(b, penable) \ + (int)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_LOCAL_ADDR_ENABLE, 0, (char *)(penable)) +#define BIO_dgram_set_local_addr_enable(b, enable) \ + (int)BIO_ctrl((b), BIO_CTRL_DGRAM_SET_LOCAL_ADDR_ENABLE, (enable), NULL) +#define BIO_dgram_get_effective_caps(b) \ + (uint32_t)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_EFFECTIVE_CAPS, 0, NULL) +#define BIO_dgram_get_caps(b) \ + (uint32_t)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_CAPS, 0, NULL) +#define BIO_dgram_set_caps(b, caps) \ + (int)BIO_ctrl((b), BIO_CTRL_DGRAM_SET_CAPS, (long)(caps), NULL) +#define BIO_dgram_get_no_trunc(b) \ + (unsigned int)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_NO_TRUNC, 0, NULL) +#define BIO_dgram_set_no_trunc(b, enable) \ + (int)BIO_ctrl((b), BIO_CTRL_DGRAM_SET_NO_TRUNC, (enable), NULL) +#define BIO_dgram_get_mtu(b) \ + (unsigned int)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_MTU, 0, NULL) +#define BIO_dgram_set_mtu(b, mtu) \ + (int)BIO_ctrl((b), BIO_CTRL_DGRAM_SET_MTU, (mtu), NULL) +#define BIO_dgram_set0_local_addr(b, addr) \ + (int)BIO_ctrl((b), BIO_CTRL_DGRAM_SET0_LOCAL_ADDR, 0, (addr)) + +/* ctrl macros for BIO_f_prefix */ +#define BIO_set_prefix(b, p) BIO_ctrl((b), BIO_CTRL_SET_PREFIX, 0, (void *)(p)) +#define BIO_set_indent(b, i) BIO_ctrl((b), BIO_CTRL_SET_INDENT, (i), NULL) +#define BIO_get_indent(b) BIO_ctrl((b), BIO_CTRL_GET_INDENT, 0, NULL) + +#define BIO_get_ex_new_index(l, p, newf, dupf, freef) \ + CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_BIO, l, p, newf, dupf, freef) +int BIO_set_ex_data(BIO *bio, int idx, void *data); +void *BIO_get_ex_data(const BIO *bio, int idx); +uint64_t BIO_number_read(BIO *bio); +uint64_t BIO_number_written(BIO *bio); + +/* For BIO_f_asn1() */ +int BIO_asn1_set_prefix(BIO *b, asn1_ps_func *prefix, + asn1_ps_func *prefix_free); +int BIO_asn1_get_prefix(BIO *b, asn1_ps_func **pprefix, + asn1_ps_func **pprefix_free); +int BIO_asn1_set_suffix(BIO *b, asn1_ps_func *suffix, + asn1_ps_func *suffix_free); +int BIO_asn1_get_suffix(BIO *b, asn1_ps_func **psuffix, + asn1_ps_func **psuffix_free); + +const BIO_METHOD *BIO_s_file(void); +BIO *BIO_new_file(const char *filename, const char *mode); +BIO *BIO_new_from_core_bio(OSSL_LIB_CTX *libctx, OSSL_CORE_BIO *corebio); +#ifndef OPENSSL_NO_STDIO +BIO *BIO_new_fp(FILE *stream, int close_flag); +#endif +BIO *BIO_new_ex(OSSL_LIB_CTX *libctx, const BIO_METHOD *method); +BIO *BIO_new(const BIO_METHOD *type); +int BIO_free(BIO *a); +void BIO_set_data(BIO *a, void *ptr); +void *BIO_get_data(BIO *a); +void BIO_set_init(BIO *a, int init); +int BIO_get_init(BIO *a); +void BIO_set_shutdown(BIO *a, int shut); +int BIO_get_shutdown(BIO *a); +void BIO_vfree(BIO *a); +int BIO_up_ref(BIO *a); +int BIO_read(BIO *b, void *data, int dlen); +int BIO_read_ex(BIO *b, void *data, size_t dlen, size_t *readbytes); +__owur int BIO_recvmmsg(BIO *b, BIO_MSG *msg, + size_t stride, size_t num_msg, uint64_t flags, + size_t *msgs_processed); +int BIO_gets(BIO *bp, char *buf, int size); +int BIO_get_line(BIO *bio, char *buf, int size); +int BIO_write(BIO *b, const void *data, int dlen); +int BIO_write_ex(BIO *b, const void *data, size_t dlen, size_t *written); +__owur int BIO_sendmmsg(BIO *b, BIO_MSG *msg, + size_t stride, size_t num_msg, uint64_t flags, + size_t *msgs_processed); +__owur int BIO_get_rpoll_descriptor(BIO *b, BIO_POLL_DESCRIPTOR *desc); +__owur int BIO_get_wpoll_descriptor(BIO *b, BIO_POLL_DESCRIPTOR *desc); +int BIO_puts(BIO *bp, const char *buf); +int BIO_indent(BIO *b, int indent, int max); +long BIO_ctrl(BIO *bp, int cmd, long larg, void *parg); +long BIO_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp); +void *BIO_ptr_ctrl(BIO *bp, int cmd, long larg); +long BIO_int_ctrl(BIO *bp, int cmd, long larg, int iarg); +BIO *BIO_push(BIO *b, BIO *append); +BIO *BIO_pop(BIO *b); +void BIO_free_all(BIO *a); +BIO *BIO_find_type(BIO *b, int bio_type); +BIO *BIO_next(BIO *b); +void BIO_set_next(BIO *b, BIO *next); +BIO *BIO_get_retry_BIO(BIO *bio, int *reason); +int BIO_get_retry_reason(BIO *bio); +void BIO_set_retry_reason(BIO *bio, int reason); +BIO *BIO_dup_chain(BIO *in); + +int BIO_nread0(BIO *bio, char **buf); +int BIO_nread(BIO *bio, char **buf, int num); +int BIO_nwrite0(BIO *bio, char **buf); +int BIO_nwrite(BIO *bio, char **buf, int num); + +const BIO_METHOD *BIO_s_mem(void); +#ifndef OPENSSL_NO_DGRAM +const BIO_METHOD *BIO_s_dgram_mem(void); +#endif +const BIO_METHOD *BIO_s_secmem(void); +BIO *BIO_new_mem_buf(const void *buf, int len); +#ifndef OPENSSL_NO_SOCK +const BIO_METHOD *BIO_s_socket(void); +const BIO_METHOD *BIO_s_connect(void); +const BIO_METHOD *BIO_s_accept(void); +#endif +const BIO_METHOD *BIO_s_fd(void); +const BIO_METHOD *BIO_s_log(void); +const BIO_METHOD *BIO_s_bio(void); +const BIO_METHOD *BIO_s_null(void); +const BIO_METHOD *BIO_f_null(void); +const BIO_METHOD *BIO_f_buffer(void); +const BIO_METHOD *BIO_f_readbuffer(void); +const BIO_METHOD *BIO_f_linebuffer(void); +const BIO_METHOD *BIO_f_nbio_test(void); +const BIO_METHOD *BIO_f_prefix(void); +const BIO_METHOD *BIO_s_core(void); +#ifndef OPENSSL_NO_DGRAM +const BIO_METHOD *BIO_s_dgram_pair(void); +const BIO_METHOD *BIO_s_datagram(void); +int BIO_dgram_non_fatal_error(int error); +BIO *BIO_new_dgram(int fd, int close_flag); +#ifndef OPENSSL_NO_SCTP +const BIO_METHOD *BIO_s_datagram_sctp(void); +BIO *BIO_new_dgram_sctp(int fd, int close_flag); +int BIO_dgram_is_sctp(BIO *bio); +int BIO_dgram_sctp_notification_cb(BIO *b, + BIO_dgram_sctp_notification_handler_fn handle_notifications, + void *context); +int BIO_dgram_sctp_wait_for_dry(BIO *b); +int BIO_dgram_sctp_msg_waiting(BIO *b); +#endif +#endif + +#ifndef OPENSSL_NO_SOCK +int BIO_sock_should_retry(int i); +int BIO_sock_non_fatal_error(int error); +int BIO_err_is_non_fatal(unsigned int errcode); +int BIO_socket_wait(int fd, int for_read, time_t max_time); +#endif +int BIO_wait(BIO *bio, time_t max_time, unsigned int nap_milliseconds); +int BIO_do_connect_retry(BIO *bio, int timeout, int nap_milliseconds); + +int BIO_fd_should_retry(int i); +int BIO_fd_non_fatal_error(int error); +int BIO_dump_cb(int (*cb)(const void *data, size_t len, void *u), + void *u, const void *s, int len); +int BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u), + void *u, const void *s, int len, int indent); +int BIO_dump(BIO *b, const void *bytes, int len); +int BIO_dump_indent(BIO *b, const void *bytes, int len, int indent); +#ifndef OPENSSL_NO_STDIO +int BIO_dump_fp(FILE *fp, const void *s, int len); +int BIO_dump_indent_fp(FILE *fp, const void *s, int len, int indent); +#endif +int BIO_hex_string(BIO *out, int indent, int width, const void *data, + int datalen); + +#ifndef OPENSSL_NO_SOCK +BIO_ADDR *BIO_ADDR_new(void); +int BIO_ADDR_copy(BIO_ADDR *dst, const BIO_ADDR *src); +BIO_ADDR *BIO_ADDR_dup(const BIO_ADDR *ap); +int BIO_ADDR_rawmake(BIO_ADDR *ap, int family, + const void *where, size_t wherelen, unsigned short port); +void BIO_ADDR_free(BIO_ADDR *); +void BIO_ADDR_clear(BIO_ADDR *ap); +int BIO_ADDR_family(const BIO_ADDR *ap); +int BIO_ADDR_rawaddress(const BIO_ADDR *ap, void *p, size_t *l); +unsigned short BIO_ADDR_rawport(const BIO_ADDR *ap); +char *BIO_ADDR_hostname_string(const BIO_ADDR *ap, int numeric); +char *BIO_ADDR_service_string(const BIO_ADDR *ap, int numeric); +char *BIO_ADDR_path_string(const BIO_ADDR *ap); + +const BIO_ADDRINFO *BIO_ADDRINFO_next(const BIO_ADDRINFO *bai); +int BIO_ADDRINFO_family(const BIO_ADDRINFO *bai); +int BIO_ADDRINFO_socktype(const BIO_ADDRINFO *bai); +int BIO_ADDRINFO_protocol(const BIO_ADDRINFO *bai); +const BIO_ADDR *BIO_ADDRINFO_address(const BIO_ADDRINFO *bai); +void BIO_ADDRINFO_free(BIO_ADDRINFO *bai); + +enum BIO_hostserv_priorities { + BIO_PARSE_PRIO_HOST, + BIO_PARSE_PRIO_SERV +}; +int BIO_parse_hostserv(const char *hostserv, char **host, char **service, + enum BIO_hostserv_priorities hostserv_prio); +enum BIO_lookup_type { + BIO_LOOKUP_CLIENT, + BIO_LOOKUP_SERVER +}; +int BIO_lookup(const char *host, const char *service, + enum BIO_lookup_type lookup_type, + int family, int socktype, BIO_ADDRINFO **res); +int BIO_lookup_ex(const char *host, const char *service, + int lookup_type, int family, int socktype, int protocol, + BIO_ADDRINFO **res); +int BIO_sock_error(int sock); +int BIO_socket_ioctl(int fd, long type, void *arg); +int BIO_socket_nbio(int fd, int mode); +int BIO_sock_init(void); +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define BIO_sock_cleanup() \ + while (0) \ + continue +#endif +int BIO_set_tcp_ndelay(int sock, int turn_on); +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +OSSL_DEPRECATEDIN_1_1_0 struct hostent *BIO_gethostbyname(const char *name); +OSSL_DEPRECATEDIN_1_1_0 int BIO_get_port(const char *str, unsigned short *port_ptr); +OSSL_DEPRECATEDIN_1_1_0 int BIO_get_host_ip(const char *str, unsigned char *ip); +OSSL_DEPRECATEDIN_1_1_0 int BIO_get_accept_socket(char *host_port, int mode); +OSSL_DEPRECATEDIN_1_1_0 int BIO_accept(int sock, char **ip_port); +#endif + +union BIO_sock_info_u { + BIO_ADDR *addr; +}; +enum BIO_sock_info_type { + BIO_SOCK_INFO_ADDRESS +}; +int BIO_sock_info(int sock, + enum BIO_sock_info_type type, union BIO_sock_info_u *info); + +#define BIO_SOCK_REUSEADDR 0x01 +#define BIO_SOCK_V6_ONLY 0x02 +#define BIO_SOCK_KEEPALIVE 0x04 +#define BIO_SOCK_NONBLOCK 0x08 +#define BIO_SOCK_NODELAY 0x10 +#define BIO_SOCK_TFO 0x20 + +int BIO_socket(int domain, int socktype, int protocol, int options); +int BIO_connect(int sock, const BIO_ADDR *addr, int options); +int BIO_bind(int sock, const BIO_ADDR *addr, int options); +int BIO_listen(int sock, const BIO_ADDR *addr, int options); +int BIO_accept_ex(int accept_sock, BIO_ADDR *addr, int options); +int BIO_closesocket(int sock); + +BIO *BIO_new_socket(int sock, int close_flag); +BIO *BIO_new_connect(const char *host_port); +BIO *BIO_new_accept(const char *host_port); +#endif /* OPENSSL_NO_SOCK*/ + +BIO *BIO_new_fd(int fd, int close_flag); + +int BIO_new_bio_pair(BIO **bio1, size_t writebuf1, + BIO **bio2, size_t writebuf2); +#ifndef OPENSSL_NO_DGRAM +int BIO_new_bio_dgram_pair(BIO **bio1, size_t writebuf1, + BIO **bio2, size_t writebuf2); +#endif + +/* + * If successful, returns 1 and in *bio1, *bio2 two BIO pair endpoints. + * Otherwise returns 0 and sets *bio1 and *bio2 to NULL. Size 0 uses default + * value. + */ + +void BIO_copy_next_retry(BIO *b); + +/* + * long BIO_ghbn_ctrl(int cmd,int iarg,char *parg); + */ + +#define ossl_bio__attr__(x) +#if defined(__GNUC__) && defined(__STDC_VERSION__) \ + && !defined(__MINGW32__) && !defined(__MINGW64__) \ + && !defined(__APPLE__) +/* + * Because we support the 'z' modifier, which made its appearance in C99, + * we can't use __attribute__ with pre C99 dialects. + */ +#if __STDC_VERSION__ >= 199901L +#undef ossl_bio__attr__ +#define ossl_bio__attr__ __attribute__ +#if __GNUC__ * 10 + __GNUC_MINOR__ >= 44 +#define ossl_bio__printf__ __gnu_printf__ +#else +#define ossl_bio__printf__ __printf__ +#endif +#endif +#endif +int BIO_printf(BIO *bio, const char *format, ...) + ossl_bio__attr__((__format__(ossl_bio__printf__, 2, 3))); +int BIO_vprintf(BIO *bio, const char *format, va_list args) + ossl_bio__attr__((__format__(ossl_bio__printf__, 2, 0))); +int BIO_snprintf(char *buf, size_t n, const char *format, ...) + ossl_bio__attr__((__format__(ossl_bio__printf__, 3, 4))); +int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args) + ossl_bio__attr__((__format__(ossl_bio__printf__, 3, 0))); +#undef ossl_bio__attr__ +#undef ossl_bio__printf__ + +BIO_METHOD *BIO_meth_new(int type, const char *name); +void BIO_meth_free(BIO_METHOD *biom); +int BIO_meth_set_write(BIO_METHOD *biom, + int (*write)(BIO *, const char *, int)); +int BIO_meth_set_write_ex(BIO_METHOD *biom, + int (*bwrite)(BIO *, const char *, size_t, size_t *)); +int BIO_meth_set_sendmmsg(BIO_METHOD *biom, + int (*f)(BIO *, BIO_MSG *, size_t, size_t, + uint64_t, size_t *)); +int BIO_meth_set_read(BIO_METHOD *biom, + int (*read)(BIO *, char *, int)); +int BIO_meth_set_read_ex(BIO_METHOD *biom, + int (*bread)(BIO *, char *, size_t, size_t *)); +int BIO_meth_set_recvmmsg(BIO_METHOD *biom, + int (*f)(BIO *, BIO_MSG *, size_t, size_t, + uint64_t, size_t *)); +int BIO_meth_set_puts(BIO_METHOD *biom, + int (*puts)(BIO *, const char *)); +int BIO_meth_set_gets(BIO_METHOD *biom, + int (*ossl_gets)(BIO *, char *, int)); +int BIO_meth_set_ctrl(BIO_METHOD *biom, + long (*ctrl)(BIO *, int, long, void *)); +int BIO_meth_set_create(BIO_METHOD *biom, int (*create)(BIO *)); +int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy)(BIO *)); +int BIO_meth_set_callback_ctrl(BIO_METHOD *biom, + long (*callback_ctrl)(BIO *, int, + BIO_info_cb *)); +#ifndef OPENSSL_NO_DEPRECATED_3_5 +OSSL_DEPRECATEDIN_3_5 int (*BIO_meth_get_write(const BIO_METHOD *biom))(BIO *, const char *, + int); +OSSL_DEPRECATEDIN_3_5 int (*BIO_meth_get_write_ex(const BIO_METHOD *biom))(BIO *, const char *, + size_t, size_t *); +OSSL_DEPRECATEDIN_3_5 int (*BIO_meth_get_sendmmsg(const BIO_METHOD *biom))(BIO *, BIO_MSG *, + size_t, size_t, + uint64_t, size_t *); +OSSL_DEPRECATEDIN_3_5 int (*BIO_meth_get_read(const BIO_METHOD *biom))(BIO *, char *, int); +OSSL_DEPRECATEDIN_3_5 int (*BIO_meth_get_read_ex(const BIO_METHOD *biom))(BIO *, char *, + size_t, size_t *); +OSSL_DEPRECATEDIN_3_5 int (*BIO_meth_get_recvmmsg(const BIO_METHOD *biom))(BIO *, BIO_MSG *, + size_t, size_t, + uint64_t, size_t *); +OSSL_DEPRECATEDIN_3_5 int (*BIO_meth_get_puts(const BIO_METHOD *biom))(BIO *, const char *); +OSSL_DEPRECATEDIN_3_5 int (*BIO_meth_get_gets(const BIO_METHOD *biom))(BIO *, char *, int); +OSSL_DEPRECATEDIN_3_5 long (*BIO_meth_get_ctrl(const BIO_METHOD *biom))(BIO *, int, + long, void *); +OSSL_DEPRECATEDIN_3_5 int (*BIO_meth_get_create(const BIO_METHOD *bion))(BIO *); +OSSL_DEPRECATEDIN_3_5 int (*BIO_meth_get_destroy(const BIO_METHOD *biom))(BIO *); +OSSL_DEPRECATEDIN_3_5 long (*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom))(BIO *, int, + BIO_info_cb *); +#endif +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/bioerr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/bioerr.h new file mode 100644 index 0000000000000000000000000000000000000000..b4ee5c68beec1c747eac51882e125393b285d376 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/bioerr.h @@ -0,0 +1,70 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_BIOERR_H +#define OPENSSL_BIOERR_H +#pragma once + +#include +#include +#include + +/* + * BIO reason codes. + */ +#define BIO_R_ACCEPT_ERROR 100 +#define BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET 141 +#define BIO_R_AMBIGUOUS_HOST_OR_SERVICE 129 +#define BIO_R_BAD_FOPEN_MODE 101 +#define BIO_R_BROKEN_PIPE 124 +#define BIO_R_CONNECT_ERROR 103 +#define BIO_R_CONNECT_TIMEOUT 147 +#define BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET 107 +#define BIO_R_GETSOCKNAME_ERROR 132 +#define BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS 133 +#define BIO_R_GETTING_SOCKTYPE 134 +#define BIO_R_INVALID_ARGUMENT 125 +#define BIO_R_INVALID_SOCKET 135 +#define BIO_R_IN_USE 123 +#define BIO_R_LENGTH_TOO_LONG 102 +#define BIO_R_LISTEN_V6_ONLY 136 +#define BIO_R_LOCAL_ADDR_NOT_AVAILABLE 111 +#define BIO_R_LOOKUP_RETURNED_NOTHING 142 +#define BIO_R_MALFORMED_HOST_OR_SERVICE 130 +#define BIO_R_NBIO_CONNECT_ERROR 110 +#define BIO_R_NON_FATAL 112 +#define BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED 143 +#define BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED 144 +#define BIO_R_NO_PORT_DEFINED 113 +#define BIO_R_NO_SUCH_FILE 128 +#define BIO_R_NULL_PARAMETER 115 /* unused */ +#define BIO_R_TFO_DISABLED 106 +#define BIO_R_TFO_NO_KERNEL_SUPPORT 108 +#define BIO_R_TRANSFER_ERROR 104 +#define BIO_R_TRANSFER_TIMEOUT 105 +#define BIO_R_UNABLE_TO_BIND_SOCKET 117 +#define BIO_R_UNABLE_TO_CREATE_SOCKET 118 +#define BIO_R_UNABLE_TO_KEEPALIVE 137 +#define BIO_R_UNABLE_TO_LISTEN_SOCKET 119 +#define BIO_R_UNABLE_TO_NODELAY 138 +#define BIO_R_UNABLE_TO_REUSEADDR 139 +#define BIO_R_UNABLE_TO_TFO 109 +#define BIO_R_UNAVAILABLE_IP_FAMILY 145 +#define BIO_R_UNINITIALIZED 120 +#define BIO_R_UNKNOWN_INFO_TYPE 140 +#define BIO_R_UNSUPPORTED_IP_FAMILY 146 +#define BIO_R_UNSUPPORTED_METHOD 121 +#define BIO_R_UNSUPPORTED_PROTOCOL_FAMILY 131 +#define BIO_R_WRITE_TO_READ_ONLY_BIO 126 +#define BIO_R_WSASTARTUP 122 +#define BIO_R_PORT_MISMATCH 150 +#define BIO_R_PEER_ADDR_NOT_AVAILABLE 151 + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/blowfish.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/blowfish.h new file mode 100644 index 0000000000000000000000000000000000000000..49c74e946ce7c9005ab3224992f3782b14cd28c7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/blowfish.h @@ -0,0 +1,78 @@ +/* + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_BLOWFISH_H +#define OPENSSL_BLOWFISH_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_BLOWFISH_H +#endif + +#include + +#ifndef OPENSSL_NO_BF +#include +#ifdef __cplusplus +extern "C" { +#endif + +#define BF_BLOCK 8 + +#ifndef OPENSSL_NO_DEPRECATED_3_0 + +#define BF_ENCRYPT 1 +#define BF_DECRYPT 0 + +/*- + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * ! BF_LONG has to be at least 32 bits wide. ! + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + */ +#define BF_LONG unsigned int + +#define BF_ROUNDS 16 + +typedef struct bf_key_st { + BF_LONG P[BF_ROUNDS + 2]; + BF_LONG S[4 * 256]; +} BF_KEY; + +#endif /* OPENSSL_NO_DEPRECATED_3_0 */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 void BF_set_key(BF_KEY *key, int len, + const unsigned char *data); +OSSL_DEPRECATEDIN_3_0 void BF_encrypt(BF_LONG *data, const BF_KEY *key); +OSSL_DEPRECATEDIN_3_0 void BF_decrypt(BF_LONG *data, const BF_KEY *key); +OSSL_DEPRECATEDIN_3_0 void BF_ecb_encrypt(const unsigned char *in, + unsigned char *out, const BF_KEY *key, + int enc); +OSSL_DEPRECATEDIN_3_0 void BF_cbc_encrypt(const unsigned char *in, + unsigned char *out, long length, + const BF_KEY *schedule, + unsigned char *ivec, int enc); +OSSL_DEPRECATEDIN_3_0 void BF_cfb64_encrypt(const unsigned char *in, + unsigned char *out, + long length, const BF_KEY *schedule, + unsigned char *ivec, int *num, + int enc); +OSSL_DEPRECATEDIN_3_0 void BF_ofb64_encrypt(const unsigned char *in, + unsigned char *out, + long length, const BF_KEY *schedule, + unsigned char *ivec, int *num); +OSSL_DEPRECATEDIN_3_0 const char *BF_options(void); +#endif + +#ifdef __cplusplus +} +#endif +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/bn.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/bn.h new file mode 100644 index 0000000000000000000000000000000000000000..d210b8bddd51131dd61eecff2f33236503bfe633 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/bn.h @@ -0,0 +1,588 @@ +/* + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. + * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_BN_H +#define OPENSSL_BN_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_BN_H +#endif + +#include +#ifndef OPENSSL_NO_STDIO +#include +#endif +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * 64-bit processor with LP64 ABI + */ +#ifdef SIXTY_FOUR_BIT_LONG +#define BN_ULONG unsigned long +#define BN_BYTES 8 +#endif + +/* + * 64-bit processor other than LP64 ABI + */ +#ifdef SIXTY_FOUR_BIT +#define BN_ULONG unsigned long long +#define BN_BYTES 8 +#endif + +#ifdef THIRTY_TWO_BIT +#define BN_ULONG unsigned int +#define BN_BYTES 4 +#endif + +#define BN_BITS2 (BN_BYTES * 8) +#define BN_BITS (BN_BITS2 * 2) +#define BN_TBIT ((BN_ULONG)1 << (BN_BITS2 - 1)) + +#define BN_FLG_MALLOCED 0x01 +#define BN_FLG_STATIC_DATA 0x02 + +/* + * avoid leaking exponent information through timing, + * BN_mod_exp_mont() will call BN_mod_exp_mont_consttime, + * BN_div() will call BN_div_no_branch, + * BN_mod_inverse() will call bn_mod_inverse_no_branch. + */ +#define BN_FLG_CONSTTIME 0x04 +#define BN_FLG_SECURE 0x08 + +#ifndef OPENSSL_NO_DEPRECATED_0_9_8 +/* deprecated name for the flag */ +#define BN_FLG_EXP_CONSTTIME BN_FLG_CONSTTIME +#define BN_FLG_FREE 0x8000 /* used for debugging */ +#endif + +void BN_set_flags(BIGNUM *b, int n); +int BN_get_flags(const BIGNUM *b, int n); + +/* Values for |top| in BN_rand() */ +#define BN_RAND_TOP_ANY -1 +#define BN_RAND_TOP_ONE 0 +#define BN_RAND_TOP_TWO 1 + +/* Values for |bottom| in BN_rand() */ +#define BN_RAND_BOTTOM_ANY 0 +#define BN_RAND_BOTTOM_ODD 1 + +/* + * get a clone of a BIGNUM with changed flags, for *temporary* use only (the + * two BIGNUMs cannot be used in parallel!). Also only for *read only* use. The + * value |dest| should be a newly allocated BIGNUM obtained via BN_new() that + * has not been otherwise initialised or used. + */ +void BN_with_flags(BIGNUM *dest, const BIGNUM *b, int flags); + +/* Wrapper function to make using BN_GENCB easier */ +int BN_GENCB_call(BN_GENCB *cb, int a, int b); + +BN_GENCB *BN_GENCB_new(void); +void BN_GENCB_free(BN_GENCB *cb); + +/* Populate a BN_GENCB structure with an "old"-style callback */ +void BN_GENCB_set_old(BN_GENCB *gencb, void (*callback)(int, int, void *), + void *cb_arg); + +/* Populate a BN_GENCB structure with a "new"-style callback */ +void BN_GENCB_set(BN_GENCB *gencb, int (*callback)(int, int, BN_GENCB *), + void *cb_arg); + +void *BN_GENCB_get_arg(BN_GENCB *cb); + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define BN_prime_checks 0 /* default: select number of iterations based \ + * on the size of the number */ + +/* + * BN_prime_checks_for_size() returns the number of Miller-Rabin iterations + * that will be done for checking that a random number is probably prime. The + * error rate for accepting a composite number as prime depends on the size of + * the prime |b|. The error rates used are for calculating an RSA key with 2 primes, + * and so the level is what you would expect for a key of double the size of the + * prime. + * + * This table is generated using the algorithm of FIPS PUB 186-4 + * Digital Signature Standard (DSS), section F.1, page 117. + * (https://dx.doi.org/10.6028/NIST.FIPS.186-4) + * + * The following magma script was used to generate the output: + * securitybits:=125; + * k:=1024; + * for t:=1 to 65 do + * for M:=3 to Floor(2*Sqrt(k-1)-1) do + * S:=0; + * // Sum over m + * for m:=3 to M do + * s:=0; + * // Sum over j + * for j:=2 to m do + * s+:=(RealField(32)!2)^-(j+(k-1)/j); + * end for; + * S+:=2^(m-(m-1)*t)*s; + * end for; + * A:=2^(k-2-M*t); + * B:=8*(Pi(RealField(32))^2-6)/3*2^(k-2)*S; + * pkt:=2.00743*Log(2)*k*2^-k*(A+B); + * seclevel:=Floor(-Log(2,pkt)); + * if seclevel ge securitybits then + * printf "k: %5o, security: %o bits (t: %o, M: %o)\n",k,seclevel,t,M; + * break; + * end if; + * end for; + * if seclevel ge securitybits then break; end if; + * end for; + * + * It can be run online at: + * http://magma.maths.usyd.edu.au/calc + * + * And will output: + * k: 1024, security: 129 bits (t: 6, M: 23) + * + * k is the number of bits of the prime, securitybits is the level we want to + * reach. + * + * prime length | RSA key size | # MR tests | security level + * -------------+--------------|------------+--------------- + * (b) >= 6394 | >= 12788 | 3 | 256 bit + * (b) >= 3747 | >= 7494 | 3 | 192 bit + * (b) >= 1345 | >= 2690 | 4 | 128 bit + * (b) >= 1080 | >= 2160 | 5 | 128 bit + * (b) >= 852 | >= 1704 | 5 | 112 bit + * (b) >= 476 | >= 952 | 5 | 80 bit + * (b) >= 400 | >= 800 | 6 | 80 bit + * (b) >= 347 | >= 694 | 7 | 80 bit + * (b) >= 308 | >= 616 | 8 | 80 bit + * (b) >= 55 | >= 110 | 27 | 64 bit + * (b) >= 6 | >= 12 | 34 | 64 bit + */ + +#define BN_prime_checks_for_size(b) ((b) >= 3747 ? 3 : (b) >= 1345 ? 4 \ + : (b) >= 476 ? 5 \ + : (b) >= 400 ? 6 \ + : (b) >= 347 ? 7 \ + : (b) >= 308 ? 8 \ + : (b) >= 55 ? 27 \ + : /* b >= 6 */ 34) +#endif + +#define BN_num_bytes(a) ((BN_num_bits(a) + 7) / 8) + +int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w); +int BN_is_zero(const BIGNUM *a); +int BN_is_one(const BIGNUM *a); +int BN_is_word(const BIGNUM *a, const BN_ULONG w); +int BN_is_odd(const BIGNUM *a); + +#define BN_one(a) (BN_set_word((a), 1)) + +void BN_zero_ex(BIGNUM *a); + +#if OPENSSL_API_LEVEL > 908 +#define BN_zero(a) BN_zero_ex(a) +#else +#define BN_zero(a) (BN_set_word((a), 0)) +#endif + +const BIGNUM *BN_value_one(void); +char *BN_options(void); +BN_CTX *BN_CTX_new_ex(OSSL_LIB_CTX *ctx); +BN_CTX *BN_CTX_new(void); +BN_CTX *BN_CTX_secure_new_ex(OSSL_LIB_CTX *ctx); +BN_CTX *BN_CTX_secure_new(void); +void BN_CTX_free(BN_CTX *c); +void BN_CTX_start(BN_CTX *ctx); +BIGNUM *BN_CTX_get(BN_CTX *ctx); +void BN_CTX_end(BN_CTX *ctx); +int BN_rand_ex(BIGNUM *rnd, int bits, int top, int bottom, + unsigned int strength, BN_CTX *ctx); +int BN_rand(BIGNUM *rnd, int bits, int top, int bottom); +int BN_priv_rand_ex(BIGNUM *rnd, int bits, int top, int bottom, + unsigned int strength, BN_CTX *ctx); +int BN_priv_rand(BIGNUM *rnd, int bits, int top, int bottom); +int BN_rand_range_ex(BIGNUM *r, const BIGNUM *range, unsigned int strength, + BN_CTX *ctx); +int BN_rand_range(BIGNUM *rnd, const BIGNUM *range); +int BN_priv_rand_range_ex(BIGNUM *r, const BIGNUM *range, + unsigned int strength, BN_CTX *ctx); +int BN_priv_rand_range(BIGNUM *rnd, const BIGNUM *range); +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom); +OSSL_DEPRECATEDIN_3_0 +int BN_pseudo_rand_range(BIGNUM *rnd, const BIGNUM *range); +#endif +int BN_num_bits(const BIGNUM *a); +int BN_num_bits_word(BN_ULONG l); +int BN_security_bits(int L, int N); +BIGNUM *BN_new(void); +BIGNUM *BN_secure_new(void); +void BN_clear_free(BIGNUM *a); +BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b); +void BN_swap(BIGNUM *a, BIGNUM *b); +BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret); +BIGNUM *BN_signed_bin2bn(const unsigned char *s, int len, BIGNUM *ret); +int BN_bn2bin(const BIGNUM *a, unsigned char *to); +int BN_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen); +int BN_signed_bn2bin(const BIGNUM *a, unsigned char *to, int tolen); +BIGNUM *BN_lebin2bn(const unsigned char *s, int len, BIGNUM *ret); +BIGNUM *BN_signed_lebin2bn(const unsigned char *s, int len, BIGNUM *ret); +int BN_bn2lebinpad(const BIGNUM *a, unsigned char *to, int tolen); +int BN_signed_bn2lebin(const BIGNUM *a, unsigned char *to, int tolen); +BIGNUM *BN_native2bn(const unsigned char *s, int len, BIGNUM *ret); +BIGNUM *BN_signed_native2bn(const unsigned char *s, int len, BIGNUM *ret); +int BN_bn2nativepad(const BIGNUM *a, unsigned char *to, int tolen); +int BN_signed_bn2native(const BIGNUM *a, unsigned char *to, int tolen); +BIGNUM *BN_mpi2bn(const unsigned char *s, int len, BIGNUM *ret); +int BN_bn2mpi(const BIGNUM *a, unsigned char *to); +int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); +int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); +int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); +int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); +int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); +int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx); +/** BN_set_negative sets sign of a BIGNUM + * \param b pointer to the BIGNUM object + * \param n 0 if the BIGNUM b should be positive and a value != 0 otherwise + */ +void BN_set_negative(BIGNUM *b, int n); +/** BN_is_negative returns 1 if the BIGNUM is negative + * \param b pointer to the BIGNUM object + * \return 1 if a < 0 and 0 otherwise + */ +int BN_is_negative(const BIGNUM *b); + +int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d, + BN_CTX *ctx); +#define BN_mod(rem, m, d, ctx) BN_div(NULL, (rem), (m), (d), (ctx)) +int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx); +int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, + BN_CTX *ctx); +int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m); +int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, + BN_CTX *ctx); +int BN_mod_sub_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m); +int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, + BN_CTX *ctx); +int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); +int BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); +int BN_mod_lshift1_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *m); +int BN_mod_lshift(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m, + BN_CTX *ctx); +int BN_mod_lshift_quick(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m); + +BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w); +BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w); +int BN_mul_word(BIGNUM *a, BN_ULONG w); +int BN_add_word(BIGNUM *a, BN_ULONG w); +int BN_sub_word(BIGNUM *a, BN_ULONG w); +int BN_set_word(BIGNUM *a, BN_ULONG w); +BN_ULONG BN_get_word(const BIGNUM *a); + +int BN_cmp(const BIGNUM *a, const BIGNUM *b); +void BN_free(BIGNUM *a); +int BN_is_bit_set(const BIGNUM *a, int n); +int BN_lshift(BIGNUM *r, const BIGNUM *a, int n); +int BN_lshift1(BIGNUM *r, const BIGNUM *a); +int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); + +int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx); +int BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); +int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx, + BN_MONT_CTX *in_mont); +int BN_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); +int BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1, const BIGNUM *p1, + const BIGNUM *a2, const BIGNUM *p2, const BIGNUM *m, + BN_CTX *ctx, BN_MONT_CTX *m_ctx); +int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx); +int BN_mod_exp_mont_consttime_x2(BIGNUM *rr1, const BIGNUM *a1, const BIGNUM *p1, + const BIGNUM *m1, BN_MONT_CTX *in_mont1, + BIGNUM *rr2, const BIGNUM *a2, const BIGNUM *p2, + const BIGNUM *m2, BN_MONT_CTX *in_mont2, + BN_CTX *ctx); + +int BN_mask_bits(BIGNUM *a, int n); +#ifndef OPENSSL_NO_STDIO +int BN_print_fp(FILE *fp, const BIGNUM *a); +#endif +int BN_print(BIO *bio, const BIGNUM *a); +int BN_reciprocal(BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx); +int BN_rshift(BIGNUM *r, const BIGNUM *a, int n); +int BN_rshift1(BIGNUM *r, const BIGNUM *a); +void BN_clear(BIGNUM *a); +BIGNUM *BN_dup(const BIGNUM *a); +int BN_ucmp(const BIGNUM *a, const BIGNUM *b); +int BN_set_bit(BIGNUM *a, int n); +int BN_clear_bit(BIGNUM *a, int n); +char *BN_bn2hex(const BIGNUM *a); +char *BN_bn2dec(const BIGNUM *a); +int BN_hex2bn(BIGNUM **a, const char *str); +int BN_dec2bn(BIGNUM **a, const char *str); +int BN_asc2bn(BIGNUM **a, const char *str); +int BN_gcd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); +int BN_kronecker(const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); /* returns + * -2 for + * error */ +int BN_are_coprime(BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); +BIGNUM *BN_mod_inverse(BIGNUM *ret, + const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx); +BIGNUM *BN_mod_sqrt(BIGNUM *ret, + const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx); + +void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords); + +/* Deprecated versions */ +#ifndef OPENSSL_NO_DEPRECATED_0_9_8 +OSSL_DEPRECATEDIN_0_9_8 +BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe, + const BIGNUM *add, const BIGNUM *rem, + void (*callback)(int, int, void *), + void *cb_arg); +OSSL_DEPRECATEDIN_0_9_8 +int BN_is_prime(const BIGNUM *p, int nchecks, + void (*callback)(int, int, void *), + BN_CTX *ctx, void *cb_arg); +OSSL_DEPRECATEDIN_0_9_8 +int BN_is_prime_fasttest(const BIGNUM *p, int nchecks, + void (*callback)(int, int, void *), + BN_CTX *ctx, void *cb_arg, + int do_trial_division); +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +int BN_is_prime_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx, BN_GENCB *cb); +OSSL_DEPRECATEDIN_3_0 +int BN_is_prime_fasttest_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx, + int do_trial_division, BN_GENCB *cb); +#endif +/* Newer versions */ +int BN_generate_prime_ex2(BIGNUM *ret, int bits, int safe, + const BIGNUM *add, const BIGNUM *rem, BN_GENCB *cb, + BN_CTX *ctx); +int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, const BIGNUM *add, + const BIGNUM *rem, BN_GENCB *cb); +int BN_check_prime(const BIGNUM *p, BN_CTX *ctx, BN_GENCB *cb); + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx); + +OSSL_DEPRECATEDIN_3_0 +int BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, + const BIGNUM *Xp, const BIGNUM *Xp1, + const BIGNUM *Xp2, const BIGNUM *e, BN_CTX *ctx, + BN_GENCB *cb); +OSSL_DEPRECATEDIN_3_0 +int BN_X931_generate_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, BIGNUM *Xp1, + BIGNUM *Xp2, const BIGNUM *Xp, const BIGNUM *e, + BN_CTX *ctx, BN_GENCB *cb); +#endif + +BN_MONT_CTX *BN_MONT_CTX_new(void); +int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + BN_MONT_CTX *mont, BN_CTX *ctx); +int BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, + BN_CTX *ctx); +int BN_from_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, + BN_CTX *ctx); +void BN_MONT_CTX_free(BN_MONT_CTX *mont); +int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx); +BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, BN_MONT_CTX *from); +BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, CRYPTO_RWLOCK *lock, + const BIGNUM *mod, BN_CTX *ctx); + +/* BN_BLINDING flags */ +#define BN_BLINDING_NO_UPDATE 0x00000001 +#define BN_BLINDING_NO_RECREATE 0x00000002 + +BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod); +void BN_BLINDING_free(BN_BLINDING *b); +int BN_BLINDING_update(BN_BLINDING *b, BN_CTX *ctx); +int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx); +int BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx); +int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *); +int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b, + BN_CTX *); + +int BN_BLINDING_is_current_thread(BN_BLINDING *b); +void BN_BLINDING_set_current_thread(BN_BLINDING *b); +int BN_BLINDING_lock(BN_BLINDING *b); +int BN_BLINDING_unlock(BN_BLINDING *b); + +unsigned long BN_BLINDING_get_flags(const BN_BLINDING *); +void BN_BLINDING_set_flags(BN_BLINDING *, unsigned long); +BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b, + const BIGNUM *e, BIGNUM *m, BN_CTX *ctx, + int (*bn_mod_exp)(BIGNUM *r, + const BIGNUM *a, + const BIGNUM *p, + const BIGNUM *m, + BN_CTX *ctx, + BN_MONT_CTX *m_ctx), + BN_MONT_CTX *m_ctx); +#ifndef OPENSSL_NO_DEPRECATED_0_9_8 +OSSL_DEPRECATEDIN_0_9_8 +void BN_set_params(int mul, int high, int low, int mont); +OSSL_DEPRECATEDIN_0_9_8 +int BN_get_params(int which); /* 0, mul, 1 high, 2 low, 3 mont */ +#endif + +BN_RECP_CTX *BN_RECP_CTX_new(void); +void BN_RECP_CTX_free(BN_RECP_CTX *recp); +int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *rdiv, BN_CTX *ctx); +int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y, + BN_RECP_CTX *recp, BN_CTX *ctx); +int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx); +int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, + BN_RECP_CTX *recp, BN_CTX *ctx); + +#ifndef OPENSSL_NO_EC2M + +/* + * Functions for arithmetic over binary polynomials represented by BIGNUMs. + * The BIGNUM::neg property of BIGNUMs representing binary polynomials is + * ignored. Note that input arguments are not const so that their bit arrays + * can be expanded to the appropriate size if needed. + */ + +/* + * r = a + b + */ +int BN_GF2m_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); +#define BN_GF2m_sub(r, a, b) BN_GF2m_add(r, a, b) +/* + * r=a mod p + */ +int BN_GF2m_mod(BIGNUM *r, const BIGNUM *a, const BIGNUM *p); +/* r = (a * b) mod p */ +int BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *p, BN_CTX *ctx); +/* r = (a * a) mod p */ +int BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); +/* r = (1 / b) mod p */ +int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *b, const BIGNUM *p, BN_CTX *ctx); +/* r = (a / b) mod p */ +int BN_GF2m_mod_div(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *p, BN_CTX *ctx); +/* r = (a ^ b) mod p */ +int BN_GF2m_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *p, BN_CTX *ctx); +/* r = sqrt(a) mod p */ +int BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + BN_CTX *ctx); +/* r^2 + r = a mod p */ +int BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + BN_CTX *ctx); +#define BN_GF2m_cmp(a, b) BN_ucmp((a), (b)) +/*- + * Some functions allow for representation of the irreducible polynomials + * as an unsigned int[], say p. The irreducible f(t) is then of the form: + * t^p[0] + t^p[1] + ... + t^p[k] + * where m = p[0] > p[1] > ... > p[k] = 0. + */ +/* r = a mod p */ +int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const int p[]); +/* r = (a * b) mod p */ +int BN_GF2m_mod_mul_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const int p[], BN_CTX *ctx); +/* r = (a * a) mod p */ +int BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[], + BN_CTX *ctx); +/* r = (1 / b) mod p */ +int BN_GF2m_mod_inv_arr(BIGNUM *r, const BIGNUM *b, const int p[], + BN_CTX *ctx); +/* r = (a / b) mod p */ +int BN_GF2m_mod_div_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const int p[], BN_CTX *ctx); +/* r = (a ^ b) mod p */ +int BN_GF2m_mod_exp_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const int p[], BN_CTX *ctx); +/* r = sqrt(a) mod p */ +int BN_GF2m_mod_sqrt_arr(BIGNUM *r, const BIGNUM *a, + const int p[], BN_CTX *ctx); +/* r^2 + r = a mod p */ +int BN_GF2m_mod_solve_quad_arr(BIGNUM *r, const BIGNUM *a, + const int p[], BN_CTX *ctx); +int BN_GF2m_poly2arr(const BIGNUM *a, int p[], int max); +int BN_GF2m_arr2poly(const int p[], BIGNUM *a); + +#endif + +/* + * faster mod functions for the 'NIST primes' 0 <= a < p^2 + */ +int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); +int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); +int BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); +int BN_nist_mod_384(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); +int BN_nist_mod_521(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); + +const BIGNUM *BN_get0_nist_prime_192(void); +const BIGNUM *BN_get0_nist_prime_224(void); +const BIGNUM *BN_get0_nist_prime_256(void); +const BIGNUM *BN_get0_nist_prime_384(void); +const BIGNUM *BN_get0_nist_prime_521(void); + +int (*BN_nist_mod_func(const BIGNUM *p))(BIGNUM *r, const BIGNUM *a, + const BIGNUM *field, BN_CTX *ctx); + +int BN_generate_dsa_nonce(BIGNUM *out, const BIGNUM *range, + const BIGNUM *priv, const unsigned char *message, + size_t message_len, BN_CTX *ctx); + +/* Primes from RFC 2409 */ +BIGNUM *BN_get_rfc2409_prime_768(BIGNUM *bn); +BIGNUM *BN_get_rfc2409_prime_1024(BIGNUM *bn); + +/* Primes from RFC 3526 */ +BIGNUM *BN_get_rfc3526_prime_1536(BIGNUM *bn); +BIGNUM *BN_get_rfc3526_prime_2048(BIGNUM *bn); +BIGNUM *BN_get_rfc3526_prime_3072(BIGNUM *bn); +BIGNUM *BN_get_rfc3526_prime_4096(BIGNUM *bn); +BIGNUM *BN_get_rfc3526_prime_6144(BIGNUM *bn); +BIGNUM *BN_get_rfc3526_prime_8192(BIGNUM *bn); + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define get_rfc2409_prime_768 BN_get_rfc2409_prime_768 +#define get_rfc2409_prime_1024 BN_get_rfc2409_prime_1024 +#define get_rfc3526_prime_1536 BN_get_rfc3526_prime_1536 +#define get_rfc3526_prime_2048 BN_get_rfc3526_prime_2048 +#define get_rfc3526_prime_3072 BN_get_rfc3526_prime_3072 +#define get_rfc3526_prime_4096 BN_get_rfc3526_prime_4096 +#define get_rfc3526_prime_6144 BN_get_rfc3526_prime_6144 +#define get_rfc3526_prime_8192 BN_get_rfc3526_prime_8192 +#endif + +int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/bnerr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/bnerr.h new file mode 100644 index 0000000000000000000000000000000000000000..dbbcd699bba486e84d0c24927e49a60259bedb8f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/bnerr.h @@ -0,0 +1,45 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_BNERR_H +#define OPENSSL_BNERR_H +#pragma once + +#include +#include +#include + +/* + * BN reason codes. + */ +#define BN_R_ARG2_LT_ARG3 100 +#define BN_R_BAD_RECIPROCAL 101 +#define BN_R_BIGNUM_TOO_LONG 114 +#define BN_R_BITS_TOO_SMALL 118 +#define BN_R_CALLED_WITH_EVEN_MODULUS 102 +#define BN_R_DIV_BY_ZERO 103 +#define BN_R_ENCODING_ERROR 104 +#define BN_R_EXPAND_ON_STATIC_BIGNUM_DATA 105 +#define BN_R_INPUT_NOT_REDUCED 110 +#define BN_R_INVALID_LENGTH 106 +#define BN_R_INVALID_RANGE 115 +#define BN_R_INVALID_SHIFT 119 +#define BN_R_NOT_A_SQUARE 111 +#define BN_R_NOT_INITIALIZED 107 +#define BN_R_NO_INVERSE 108 +#define BN_R_NO_PRIME_CANDIDATE 121 +#define BN_R_NO_SOLUTION 116 +#define BN_R_NO_SUITABLE_DIGEST 120 +#define BN_R_PRIVATE_KEY_TOO_LARGE 117 +#define BN_R_P_IS_NOT_PRIME 112 +#define BN_R_TOO_MANY_ITERATIONS 113 +#define BN_R_TOO_MANY_TEMPORARY_VARIABLES 109 + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/buffer.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/buffer.h new file mode 100644 index 0000000000000000000000000000000000000000..09b35e8e18e85f7cc49cdd0208ca6cb922b4842c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/buffer.h @@ -0,0 +1,60 @@ +/* + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_BUFFER_H +#define OPENSSL_BUFFER_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_BUFFER_H +#endif + +#include +#ifndef OPENSSL_CRYPTO_H +#include +#endif +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define BUF_strdup(s) OPENSSL_strdup(s) +#define BUF_strndup(s, size) OPENSSL_strndup(s, size) +#define BUF_memdup(data, size) OPENSSL_memdup(data, size) +#define BUF_strlcpy(dst, src, size) OPENSSL_strlcpy(dst, src, size) +#define BUF_strlcat(dst, src, size) OPENSSL_strlcat(dst, src, size) +#define BUF_strnlen(str, maxlen) OPENSSL_strnlen(str, maxlen) +#endif + +struct buf_mem_st { + size_t length; /* current number of bytes */ + char *data; + size_t max; /* size of buffer */ + unsigned long flags; +}; + +#define BUF_MEM_FLAG_SECURE 0x01 + +BUF_MEM *BUF_MEM_new(void); +BUF_MEM *BUF_MEM_new_ex(unsigned long flags); +void BUF_MEM_free(BUF_MEM *a); +size_t BUF_MEM_grow(BUF_MEM *str, size_t len); +size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len); +void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/buffererr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/buffererr.h new file mode 100644 index 0000000000000000000000000000000000000000..4fa0da44be2324d5c67ae9f696aff12e4edf045c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/buffererr.h @@ -0,0 +1,23 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_BUFFERERR_H +#define OPENSSL_BUFFERERR_H +#pragma once + +#include +#include +#include + +/* + * BUF reason codes. + */ + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/byteorder.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/byteorder.h new file mode 100644 index 0000000000000000000000000000000000000000..393f34b1c3d3dddbfcd0743052b821df2698e6ff --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/byteorder.h @@ -0,0 +1,339 @@ +/* + * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_BYTEORDER_H +#define OPENSSL_BYTEORDER_H +#pragma once + +#include +#include + +/* + * "Modern" compilers do a decent job of optimising these functions to just a + * couple of instruction ([swap +] store, or load [+ swap]) when either no + * swapping is required, or a suitable swap instruction is available. + */ + +#if defined(_MSC_VER) && _MSC_VER >= 1300 +#include +#pragma intrinsic(_byteswap_ushort) +#pragma intrinsic(_byteswap_ulong) +#pragma intrinsic(_byteswap_uint64) +#define OSSL_HTOBE16(x) _byteswap_ushort(x) +#define OSSL_HTOBE32(x) _byteswap_ulong(x) +#define OSSL_HTOBE64(x) _byteswap_uint64(x) +#define OSSL_BE16TOH(x) _byteswap_ushort(x) +#define OSSL_BE32TOH(x) _byteswap_ulong(x) +#define OSSL_BE64TOH(x) _byteswap_uint64(x) +#define OSSL_HTOLE16(x) (x) +#define OSSL_HTOLE32(x) (x) +#define OSSL_HTOLE64(x) (x) +#define OSSL_LE16TOH(x) (x) +#define OSSL_LE32TOH(x) (x) +#define OSSL_LE64TOH(x) (x) + +#elif defined(__GLIBC__) && defined(__GLIBC_PREREQ) +#if (__GLIBC_PREREQ(2, 19)) && defined(_DEFAULT_SOURCE) +#include +#define OSSL_HTOBE16(x) htobe16(x) +#define OSSL_HTOBE32(x) htobe32(x) +#define OSSL_HTOBE64(x) htobe64(x) +#define OSSL_BE16TOH(x) be16toh(x) +#define OSSL_BE32TOH(x) be32toh(x) +#define OSSL_BE64TOH(x) be64toh(x) +#define OSSL_HTOLE16(x) htole16(x) +#define OSSL_HTOLE32(x) htole32(x) +#define OSSL_HTOLE64(x) htole64(x) +#define OSSL_LE16TOH(x) le16toh(x) +#define OSSL_LE32TOH(x) le32toh(x) +#define OSSL_LE64TOH(x) le64toh(x) +#endif + +#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +#if defined(__OpenBSD__) +#include +#else +#include +#endif +#define OSSL_HTOBE16(x) htobe16(x) +#define OSSL_HTOBE32(x) htobe32(x) +#define OSSL_HTOBE64(x) htobe64(x) +#define OSSL_BE16TOH(x) be16toh(x) +#define OSSL_BE32TOH(x) be32toh(x) +#define OSSL_BE64TOH(x) be64toh(x) +#define OSSL_HTOLE16(x) htole16(x) +#define OSSL_HTOLE32(x) htole32(x) +#define OSSL_HTOLE64(x) htole64(x) +#define OSSL_LE16TOH(x) le16toh(x) +#define OSSL_LE32TOH(x) le32toh(x) +#define OSSL_LE64TOH(x) le64toh(x) + +#elif defined(__APPLE__) +#include +#define OSSL_HTOBE16(x) OSSwapHostToBigInt16(x) +#define OSSL_HTOBE32(x) OSSwapHostToBigInt32(x) +#define OSSL_HTOBE64(x) OSSwapHostToBigInt64(x) +#define OSSL_BE16TOH(x) OSSwapBigToHostInt16(x) +#define OSSL_BE32TOH(x) OSSwapBigToHostInt32(x) +#define OSSL_BE64TOH(x) OSSwapBigToHostInt64(x) +#define OSSL_HTOLE16(x) OSSwapHostToLittleInt16(x) +#define OSSL_HTOLE32(x) OSSwapHostToLittleInt32(x) +#define OSSL_HTOLE64(x) OSSwapHostToLittleInt64(x) +#define OSSL_LE16TOH(x) OSSwapLittleToHostInt16(x) +#define OSSL_LE32TOH(x) OSSwapLittleToHostInt32(x) +#define OSSL_LE64TOH(x) OSSwapLittleToHostInt64(x) + +#endif + +static ossl_inline ossl_unused unsigned char * +OPENSSL_store_u16_le(unsigned char *out, uint16_t val) +{ +#ifdef OSSL_HTOLE16 + uint16_t t = OSSL_HTOLE16(val); + + memcpy(out, (unsigned char *)&t, 2); + return out + 2; +#else + *out++ = (val & 0xff); + *out++ = (val >> 8) & 0xff; + return out; +#endif +} + +static ossl_inline ossl_unused unsigned char * +OPENSSL_store_u16_be(unsigned char *out, uint16_t val) +{ +#ifdef OSSL_HTOBE16 + uint16_t t = OSSL_HTOBE16(val); + + memcpy(out, (unsigned char *)&t, 2); + return out + 2; +#else + *out++ = (val >> 8) & 0xff; + *out++ = (val & 0xff); + return out; +#endif +} + +static ossl_inline ossl_unused unsigned char * +OPENSSL_store_u32_le(unsigned char *out, uint32_t val) +{ +#ifdef OSSL_HTOLE32 + uint32_t t = OSSL_HTOLE32(val); + + memcpy(out, (unsigned char *)&t, 4); + return out + 4; +#else + *out++ = (val & 0xff); + *out++ = (val >> 8) & 0xff; + *out++ = (val >> 16) & 0xff; + *out++ = (val >> 24) & 0xff; + return out; +#endif +} + +static ossl_inline ossl_unused unsigned char * +OPENSSL_store_u32_be(unsigned char *out, uint32_t val) +{ +#ifdef OSSL_HTOBE32 + uint32_t t = OSSL_HTOBE32(val); + + memcpy(out, (unsigned char *)&t, 4); + return out + 4; +#else + *out++ = (val >> 24) & 0xff; + *out++ = (val >> 16) & 0xff; + *out++ = (val >> 8) & 0xff; + *out++ = (val & 0xff); + return out; +#endif +} + +static ossl_inline ossl_unused unsigned char * +OPENSSL_store_u64_le(unsigned char *out, uint64_t val) +{ +#ifdef OSSL_HTOLE64 + uint64_t t = OSSL_HTOLE64(val); + + memcpy(out, (unsigned char *)&t, 8); + return out + 8; +#else + *out++ = (val & 0xff); + *out++ = (val >> 8) & 0xff; + *out++ = (val >> 16) & 0xff; + *out++ = (val >> 24) & 0xff; + *out++ = (val >> 32) & 0xff; + *out++ = (val >> 40) & 0xff; + *out++ = (val >> 48) & 0xff; + *out++ = (val >> 56) & 0xff; + return out; +#endif +} + +static ossl_inline ossl_unused unsigned char * +OPENSSL_store_u64_be(unsigned char *out, uint64_t val) +{ +#ifdef OSSL_HTOLE64 + uint64_t t = OSSL_HTOBE64(val); + + memcpy(out, (unsigned char *)&t, 8); + return out + 8; +#else + *out++ = (val >> 56) & 0xff; + *out++ = (val >> 48) & 0xff; + *out++ = (val >> 40) & 0xff; + *out++ = (val >> 32) & 0xff; + *out++ = (val >> 24) & 0xff; + *out++ = (val >> 16) & 0xff; + *out++ = (val >> 8) & 0xff; + *out++ = (val & 0xff); + return out; +#endif +} + +static ossl_inline ossl_unused const unsigned char * +OPENSSL_load_u16_le(uint16_t *val, const unsigned char *in) +{ +#ifdef OSSL_LE16TOH + uint16_t t; + + memcpy((unsigned char *)&t, in, 2); + *val = OSSL_LE16TOH(t); + return in + 2; +#else + uint16_t b0 = *in++; + uint16_t b1 = *in++; + + *val = b0 | (b1 << 8); + return in; +#endif +} + +static ossl_inline ossl_unused const unsigned char * +OPENSSL_load_u16_be(uint16_t *val, const unsigned char *in) +{ +#ifdef OSSL_LE16TOH + uint16_t t; + + memcpy((unsigned char *)&t, in, 2); + *val = OSSL_BE16TOH(t); + return in + 2; +#else + uint16_t b1 = *in++; + uint16_t b0 = *in++; + + *val = b0 | (b1 << 8); + return in; +#endif +} + +static ossl_inline ossl_unused const unsigned char * +OPENSSL_load_u32_le(uint32_t *val, const unsigned char *in) +{ +#ifdef OSSL_LE32TOH + uint32_t t; + + memcpy((unsigned char *)&t, in, 4); + *val = OSSL_LE32TOH(t); + return in + 4; +#else + uint32_t b0 = *in++; + uint32_t b1 = *in++; + uint32_t b2 = *in++; + uint32_t b3 = *in++; + + *val = b0 | (b1 << 8) | (b2 << 16) | (b3 << 24); + return in; +#endif +} + +static ossl_inline ossl_unused const unsigned char * +OPENSSL_load_u32_be(uint32_t *val, const unsigned char *in) +{ +#ifdef OSSL_LE32TOH + uint32_t t; + + memcpy((unsigned char *)&t, in, 4); + *val = OSSL_BE32TOH(t); + return in + 4; +#else + uint32_t b3 = *in++; + uint32_t b2 = *in++; + uint32_t b1 = *in++; + uint32_t b0 = *in++; + + *val = b0 | (b1 << 8) | (b2 << 16) | (b3 << 24); + return in; +#endif +} + +static ossl_inline ossl_unused const unsigned char * +OPENSSL_load_u64_le(uint64_t *val, const unsigned char *in) +{ +#ifdef OSSL_LE64TOH + uint64_t t; + + memcpy((unsigned char *)&t, in, 8); + *val = OSSL_LE64TOH(t); + return in + 8; +#else + uint64_t b0 = *in++; + uint64_t b1 = *in++; + uint64_t b2 = *in++; + uint64_t b3 = *in++; + uint64_t b4 = *in++; + uint64_t b5 = *in++; + uint64_t b6 = *in++; + uint64_t b7 = *in++; + + *val = b0 | (b1 << 8) | (b2 << 16) | (b3 << 24) + | (b4 << 32) | (b5 << 40) | (b6 << 48) | (b7 << 56); + return in; +#endif +} + +static ossl_inline ossl_unused const unsigned char * +OPENSSL_load_u64_be(uint64_t *val, const unsigned char *in) +{ +#ifdef OSSL_LE64TOH + uint64_t t; + + memcpy((unsigned char *)&t, in, 8); + *val = OSSL_BE64TOH(t); + return in + 8; +#else + uint64_t b7 = *in++; + uint64_t b6 = *in++; + uint64_t b5 = *in++; + uint64_t b4 = *in++; + uint64_t b3 = *in++; + uint64_t b2 = *in++; + uint64_t b1 = *in++; + uint64_t b0 = *in++; + + *val = b0 | (b1 << 8) | (b2 << 16) | (b3 << 24) + | (b4 << 32) | (b5 << 40) | (b6 << 48) | (b7 << 56); + return in; +#endif +} + +#undef OSSL_HTOBE16 +#undef OSSL_HTOBE32 +#undef OSSL_HTOBE64 +#undef OSSL_BE16TOH +#undef OSSL_BE32TOH +#undef OSSL_BE64TOH +#undef OSSL_HTOLE16 +#undef OSSL_HTOLE32 +#undef OSSL_HTOLE64 +#undef OSSL_LE16TOH +#undef OSSL_LE32TOH +#undef OSSL_LE64TOH + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/camellia.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/camellia.h new file mode 100644 index 0000000000000000000000000000000000000000..aec94e4efc942cdd18a105e946de4f22f19de6ac --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/camellia.h @@ -0,0 +1,117 @@ +/* + * Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_CAMELLIA_H +#define OPENSSL_CAMELLIA_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_CAMELLIA_H +#endif + +#include + +#ifndef OPENSSL_NO_CAMELLIA +#include +#ifdef __cplusplus +extern "C" { +#endif + +#define CAMELLIA_BLOCK_SIZE 16 + +#ifndef OPENSSL_NO_DEPRECATED_3_0 + +#define CAMELLIA_ENCRYPT 1 +#define CAMELLIA_DECRYPT 0 + +/* + * Because array size can't be a const in C, the following two are macros. + * Both sizes are in bytes. + */ + +/* This should be a hidden type, but EVP requires that the size be known */ + +#define CAMELLIA_TABLE_BYTE_LEN 272 +#define CAMELLIA_TABLE_WORD_LEN (CAMELLIA_TABLE_BYTE_LEN / 4) + +typedef unsigned int KEY_TABLE_TYPE[CAMELLIA_TABLE_WORD_LEN]; /* to match + * with WORD */ + +struct camellia_key_st { + union { + double d; /* ensures 64-bit align */ + KEY_TABLE_TYPE rd_key; + } u; + int grand_rounds; +}; +typedef struct camellia_key_st CAMELLIA_KEY; + +#endif /* OPENSSL_NO_DEPRECATED_3_0 */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int Camellia_set_key(const unsigned char *userKey, + const int bits, + CAMELLIA_KEY *key); +OSSL_DEPRECATEDIN_3_0 void Camellia_encrypt(const unsigned char *in, + unsigned char *out, + const CAMELLIA_KEY *key); +OSSL_DEPRECATEDIN_3_0 void Camellia_decrypt(const unsigned char *in, + unsigned char *out, + const CAMELLIA_KEY *key); +OSSL_DEPRECATEDIN_3_0 void Camellia_ecb_encrypt(const unsigned char *in, + unsigned char *out, + const CAMELLIA_KEY *key, + const int enc); +OSSL_DEPRECATEDIN_3_0 void Camellia_cbc_encrypt(const unsigned char *in, + unsigned char *out, + size_t length, + const CAMELLIA_KEY *key, + unsigned char *ivec, + const int enc); +OSSL_DEPRECATEDIN_3_0 void Camellia_cfb128_encrypt(const unsigned char *in, + unsigned char *out, + size_t length, + const CAMELLIA_KEY *key, + unsigned char *ivec, + int *num, + const int enc); +OSSL_DEPRECATEDIN_3_0 void Camellia_cfb1_encrypt(const unsigned char *in, + unsigned char *out, + size_t length, + const CAMELLIA_KEY *key, + unsigned char *ivec, + int *num, + const int enc); +OSSL_DEPRECATEDIN_3_0 void Camellia_cfb8_encrypt(const unsigned char *in, + unsigned char *out, + size_t length, + const CAMELLIA_KEY *key, + unsigned char *ivec, + int *num, + const int enc); +OSSL_DEPRECATEDIN_3_0 void Camellia_ofb128_encrypt(const unsigned char *in, + unsigned char *out, + size_t length, + const CAMELLIA_KEY *key, + unsigned char *ivec, + int *num); +OSSL_DEPRECATEDIN_3_0 +void Camellia_ctr128_encrypt(const unsigned char *in, unsigned char *out, + size_t length, const CAMELLIA_KEY *key, + unsigned char ivec[CAMELLIA_BLOCK_SIZE], + unsigned char ecount_buf[CAMELLIA_BLOCK_SIZE], + unsigned int *num); +#endif + +#ifdef __cplusplus +} +#endif +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cast.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cast.h new file mode 100644 index 0000000000000000000000000000000000000000..af943124821d9ab8b1dbcb5d8c5c63bda213699b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cast.h @@ -0,0 +1,71 @@ +/* + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_CAST_H +#define OPENSSL_CAST_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_CAST_H +#endif + +#include + +#ifndef OPENSSL_NO_CAST +#ifdef __cplusplus +extern "C" { +#endif + +#define CAST_BLOCK 8 +#define CAST_KEY_LENGTH 16 + +#ifndef OPENSSL_NO_DEPRECATED_3_0 + +#define CAST_ENCRYPT 1 +#define CAST_DECRYPT 0 + +#define CAST_LONG unsigned int + +typedef struct cast_key_st { + CAST_LONG data[32]; + int short_key; /* Use reduced rounds for short key */ +} CAST_KEY; + +#endif /* OPENSSL_NO_DEPRECATED_3_0 */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); +OSSL_DEPRECATEDIN_3_0 +void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out, + const CAST_KEY *key, int enc); +OSSL_DEPRECATEDIN_3_0 +void CAST_encrypt(CAST_LONG *data, const CAST_KEY *key); +OSSL_DEPRECATEDIN_3_0 +void CAST_decrypt(CAST_LONG *data, const CAST_KEY *key); +OSSL_DEPRECATEDIN_3_0 +void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out, + long length, const CAST_KEY *ks, unsigned char *iv, + int enc); +OSSL_DEPRECATEDIN_3_0 +void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out, + long length, const CAST_KEY *schedule, + unsigned char *ivec, int *num, int enc); +OSSL_DEPRECATEDIN_3_0 +void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out, + long length, const CAST_KEY *schedule, + unsigned char *ivec, int *num); +#endif + +#ifdef __cplusplus +} +#endif +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cmac.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cmac.h new file mode 100644 index 0000000000000000000000000000000000000000..c72da7ecdcb04f497d89fa06b6d45ea6906a8f31 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cmac.h @@ -0,0 +1,52 @@ +/* + * Copyright 2010-2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_CMAC_H +#define OPENSSL_CMAC_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_CMAC_H +#endif + +#ifndef OPENSSL_NO_CMAC + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +/* Opaque */ +typedef struct CMAC_CTX_st CMAC_CTX; +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 CMAC_CTX *CMAC_CTX_new(void); +OSSL_DEPRECATEDIN_3_0 void CMAC_CTX_cleanup(CMAC_CTX *ctx); +OSSL_DEPRECATEDIN_3_0 void CMAC_CTX_free(CMAC_CTX *ctx); +OSSL_DEPRECATEDIN_3_0 EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx); +OSSL_DEPRECATEDIN_3_0 int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in); +OSSL_DEPRECATEDIN_3_0 int CMAC_Init(CMAC_CTX *ctx, + const void *key, size_t keylen, + const EVP_CIPHER *cipher, ENGINE *impl); +OSSL_DEPRECATEDIN_3_0 int CMAC_Update(CMAC_CTX *ctx, + const void *data, size_t dlen); +OSSL_DEPRECATEDIN_3_0 int CMAC_Final(CMAC_CTX *ctx, + unsigned char *out, size_t *poutlen); +OSSL_DEPRECATEDIN_3_0 int CMAC_resume(CMAC_CTX *ctx); +#endif + +#ifdef __cplusplus +} +#endif + +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cmp.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cmp.h new file mode 100644 index 0000000000000000000000000000000000000000..9d727b79d7470a782d38d020808a46bc280f8db5 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cmp.h @@ -0,0 +1,741 @@ +/* + * WARNING: do not edit! + * Generated by makefile from include\openssl\cmp.h.in + * + * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright Nokia 2007-2019 + * Copyright Siemens AG 2015-2019 + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* clang-format off */ + +/* clang-format on */ + +#ifndef OPENSSL_CMP_H +#define OPENSSL_CMP_H + +#include +#ifndef OPENSSL_NO_CMP + +#include +#include +#include +#include + +/* explicit #includes not strictly needed since implied by the above: */ +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define OSSL_CMP_PVNO_2 2 +#define OSSL_CMP_PVNO_3 3 +#define OSSL_CMP_PVNO OSSL_CMP_PVNO_2 /* v2 is the default */ + +/*- + * PKIFailureInfo ::= BIT STRING { + * -- since we can fail in more than one way! + * -- More codes may be added in the future if/when required. + * badAlg (0), + * -- unrecognized or unsupported Algorithm Identifier + * badMessageCheck (1), + * -- integrity check failed (e.g., signature did not verify) + * badRequest (2), + * -- transaction not permitted or supported + * badTime (3), + * -- messageTime was not sufficiently close to the system time, + * -- as defined by local policy + * badCertId (4), + * -- no certificate could be found matching the provided criteria + * badDataFormat (5), + * -- the data submitted has the wrong format + * wrongAuthority (6), + * -- the authority indicated in the request is different from the + * -- one creating the response token + * incorrectData (7), + * -- the requester's data is incorrect (for notary services) + * missingTimeStamp (8), + * -- when the timestamp is missing but should be there + * -- (by policy) + * badPOP (9), + * -- the proof-of-possession failed + * certRevoked (10), + * -- the certificate has already been revoked + * certConfirmed (11), + * -- the certificate has already been confirmed + * wrongIntegrity (12), + * -- invalid integrity, password based instead of signature or + * -- vice versa + * badRecipientNonce (13), + * -- invalid recipient nonce, either missing or wrong value + * timeNotAvailable (14), + * -- the TSA's time source is not available + * unacceptedPolicy (15), + * -- the requested TSA policy is not supported by the TSA. + * unacceptedExtension (16), + * -- the requested extension is not supported by the TSA. + * addInfoNotAvailable (17), + * -- the additional information requested could not be + * -- understood or is not available + * badSenderNonce (18), + * -- invalid sender nonce, either missing or wrong size + * badCertTemplate (19), + * -- invalid cert. template or missing mandatory information + * signerNotTrusted (20), + * -- signer of the message unknown or not trusted + * transactionIdInUse (21), + * -- the transaction identifier is already in use + * unsupportedVersion (22), + * -- the version of the message is not supported + * notAuthorized (23), + * -- the sender was not authorized to make the preceding + * -- request or perform the preceding action + * systemUnavail (24), + * -- the request cannot be handled due to system unavailability + * systemFailure (25), + * -- the request cannot be handled due to system failure + * duplicateCertReq (26) + * -- certificate cannot be issued because a duplicate + * -- certificate already exists + * } + */ +#define OSSL_CMP_PKIFAILUREINFO_badAlg 0 +#define OSSL_CMP_PKIFAILUREINFO_badMessageCheck 1 +#define OSSL_CMP_PKIFAILUREINFO_badRequest 2 +#define OSSL_CMP_PKIFAILUREINFO_badTime 3 +#define OSSL_CMP_PKIFAILUREINFO_badCertId 4 +#define OSSL_CMP_PKIFAILUREINFO_badDataFormat 5 +#define OSSL_CMP_PKIFAILUREINFO_wrongAuthority 6 +#define OSSL_CMP_PKIFAILUREINFO_incorrectData 7 +#define OSSL_CMP_PKIFAILUREINFO_missingTimeStamp 8 +#define OSSL_CMP_PKIFAILUREINFO_badPOP 9 +#define OSSL_CMP_PKIFAILUREINFO_certRevoked 10 +#define OSSL_CMP_PKIFAILUREINFO_certConfirmed 11 +#define OSSL_CMP_PKIFAILUREINFO_wrongIntegrity 12 +#define OSSL_CMP_PKIFAILUREINFO_badRecipientNonce 13 +#define OSSL_CMP_PKIFAILUREINFO_timeNotAvailable 14 +#define OSSL_CMP_PKIFAILUREINFO_unacceptedPolicy 15 +#define OSSL_CMP_PKIFAILUREINFO_unacceptedExtension 16 +#define OSSL_CMP_PKIFAILUREINFO_addInfoNotAvailable 17 +#define OSSL_CMP_PKIFAILUREINFO_badSenderNonce 18 +#define OSSL_CMP_PKIFAILUREINFO_badCertTemplate 19 +#define OSSL_CMP_PKIFAILUREINFO_signerNotTrusted 20 +#define OSSL_CMP_PKIFAILUREINFO_transactionIdInUse 21 +#define OSSL_CMP_PKIFAILUREINFO_unsupportedVersion 22 +#define OSSL_CMP_PKIFAILUREINFO_notAuthorized 23 +#define OSSL_CMP_PKIFAILUREINFO_systemUnavail 24 +#define OSSL_CMP_PKIFAILUREINFO_systemFailure 25 +#define OSSL_CMP_PKIFAILUREINFO_duplicateCertReq 26 +#define OSSL_CMP_PKIFAILUREINFO_MAX 26 +#define OSSL_CMP_PKIFAILUREINFO_MAX_BIT_PATTERN \ + ((1 << (OSSL_CMP_PKIFAILUREINFO_MAX + 1)) - 1) +#if OSSL_CMP_PKIFAILUREINFO_MAX_BIT_PATTERN > INT_MAX +#error CMP_PKIFAILUREINFO_MAX bit pattern does not fit in type int +#endif +typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; + +#define OSSL_CMP_CTX_FAILINFO_badAlg (1 << 0) +#define OSSL_CMP_CTX_FAILINFO_badMessageCheck (1 << 1) +#define OSSL_CMP_CTX_FAILINFO_badRequest (1 << 2) +#define OSSL_CMP_CTX_FAILINFO_badTime (1 << 3) +#define OSSL_CMP_CTX_FAILINFO_badCertId (1 << 4) +#define OSSL_CMP_CTX_FAILINFO_badDataFormat (1 << 5) +#define OSSL_CMP_CTX_FAILINFO_wrongAuthority (1 << 6) +#define OSSL_CMP_CTX_FAILINFO_incorrectData (1 << 7) +#define OSSL_CMP_CTX_FAILINFO_missingTimeStamp (1 << 8) +#define OSSL_CMP_CTX_FAILINFO_badPOP (1 << 9) +#define OSSL_CMP_CTX_FAILINFO_certRevoked (1 << 10) +#define OSSL_CMP_CTX_FAILINFO_certConfirmed (1 << 11) +#define OSSL_CMP_CTX_FAILINFO_wrongIntegrity (1 << 12) +#define OSSL_CMP_CTX_FAILINFO_badRecipientNonce (1 << 13) +#define OSSL_CMP_CTX_FAILINFO_timeNotAvailable (1 << 14) +#define OSSL_CMP_CTX_FAILINFO_unacceptedPolicy (1 << 15) +#define OSSL_CMP_CTX_FAILINFO_unacceptedExtension (1 << 16) +#define OSSL_CMP_CTX_FAILINFO_addInfoNotAvailable (1 << 17) +#define OSSL_CMP_CTX_FAILINFO_badSenderNonce (1 << 18) +#define OSSL_CMP_CTX_FAILINFO_badCertTemplate (1 << 19) +#define OSSL_CMP_CTX_FAILINFO_signerNotTrusted (1 << 20) +#define OSSL_CMP_CTX_FAILINFO_transactionIdInUse (1 << 21) +#define OSSL_CMP_CTX_FAILINFO_unsupportedVersion (1 << 22) +#define OSSL_CMP_CTX_FAILINFO_notAuthorized (1 << 23) +#define OSSL_CMP_CTX_FAILINFO_systemUnavail (1 << 24) +#define OSSL_CMP_CTX_FAILINFO_systemFailure (1 << 25) +#define OSSL_CMP_CTX_FAILINFO_duplicateCertReq (1 << 26) + +/*- + * PKIStatus ::= INTEGER { + * accepted (0), + * -- you got exactly what you asked for + * grantedWithMods (1), + * -- you got something like what you asked for; the + * -- requester is responsible for ascertaining the differences + * rejection (2), + * -- you don't get it, more information elsewhere in the message + * waiting (3), + * -- the request body part has not yet been processed; expect to + * -- hear more later (note: proper handling of this status + * -- response MAY use the polling req/rep PKIMessages specified + * -- in Section 5.3.22; alternatively, polling in the underlying + * -- transport layer MAY have some utility in this regard) + * revocationWarning (4), + * -- this message contains a warning that a revocation is + * -- imminent + * revocationNotification (5), + * -- notification that a revocation has occurred + * keyUpdateWarning (6) + * -- update already done for the oldCertId specified in + * -- CertReqMsg + * } + */ +#define OSSL_CMP_PKISTATUS_rejected_by_client -5 +#define OSSL_CMP_PKISTATUS_checking_response -4 +#define OSSL_CMP_PKISTATUS_request -3 +#define OSSL_CMP_PKISTATUS_trans -2 +#define OSSL_CMP_PKISTATUS_unspecified -1 +#define OSSL_CMP_PKISTATUS_accepted 0 +#define OSSL_CMP_PKISTATUS_grantedWithMods 1 +#define OSSL_CMP_PKISTATUS_rejection 2 +#define OSSL_CMP_PKISTATUS_waiting 3 +#define OSSL_CMP_PKISTATUS_revocationWarning 4 +#define OSSL_CMP_PKISTATUS_revocationNotification 5 +#define OSSL_CMP_PKISTATUS_keyUpdateWarning 6 +typedef ASN1_INTEGER OSSL_CMP_PKISTATUS; + +DECLARE_ASN1_ITEM(OSSL_CMP_PKISTATUS) + +#define OSSL_CMP_CERTORENCCERT_CERTIFICATE 0 +#define OSSL_CMP_CERTORENCCERT_ENCRYPTEDCERT 1 + +/* data type declarations */ +typedef struct ossl_cmp_ctx_st OSSL_CMP_CTX; +typedef struct ossl_cmp_pkiheader_st OSSL_CMP_PKIHEADER; +DECLARE_ASN1_FUNCTIONS(OSSL_CMP_PKIHEADER) +typedef struct ossl_cmp_msg_st OSSL_CMP_MSG; +DECLARE_ASN1_DUP_FUNCTION(OSSL_CMP_MSG) +DECLARE_ASN1_ENCODE_FUNCTIONS(OSSL_CMP_MSG, OSSL_CMP_MSG, OSSL_CMP_MSG) +typedef struct ossl_cmp_certstatus_st OSSL_CMP_CERTSTATUS; +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CMP_CERTSTATUS, OSSL_CMP_CERTSTATUS, OSSL_CMP_CERTSTATUS) +#define sk_OSSL_CMP_CERTSTATUS_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CMP_CERTSTATUS_sk_type(sk)) +#define sk_OSSL_CMP_CERTSTATUS_value(sk, idx) ((OSSL_CMP_CERTSTATUS *)OPENSSL_sk_value(ossl_check_const_OSSL_CMP_CERTSTATUS_sk_type(sk), (idx))) +#define sk_OSSL_CMP_CERTSTATUS_new(cmp) ((STACK_OF(OSSL_CMP_CERTSTATUS) *)OPENSSL_sk_new(ossl_check_OSSL_CMP_CERTSTATUS_compfunc_type(cmp))) +#define sk_OSSL_CMP_CERTSTATUS_new_null() ((STACK_OF(OSSL_CMP_CERTSTATUS) *)OPENSSL_sk_new_null()) +#define sk_OSSL_CMP_CERTSTATUS_new_reserve(cmp, n) ((STACK_OF(OSSL_CMP_CERTSTATUS) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_CMP_CERTSTATUS_compfunc_type(cmp), (n))) +#define sk_OSSL_CMP_CERTSTATUS_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk), (n)) +#define sk_OSSL_CMP_CERTSTATUS_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk)) +#define sk_OSSL_CMP_CERTSTATUS_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk)) +#define sk_OSSL_CMP_CERTSTATUS_delete(sk, i) ((OSSL_CMP_CERTSTATUS *)OPENSSL_sk_delete(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk), (i))) +#define sk_OSSL_CMP_CERTSTATUS_delete_ptr(sk, ptr) ((OSSL_CMP_CERTSTATUS *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CERTSTATUS_type(ptr))) +#define sk_OSSL_CMP_CERTSTATUS_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CERTSTATUS_type(ptr)) +#define sk_OSSL_CMP_CERTSTATUS_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CERTSTATUS_type(ptr)) +#define sk_OSSL_CMP_CERTSTATUS_pop(sk) ((OSSL_CMP_CERTSTATUS *)OPENSSL_sk_pop(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk))) +#define sk_OSSL_CMP_CERTSTATUS_shift(sk) ((OSSL_CMP_CERTSTATUS *)OPENSSL_sk_shift(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk))) +#define sk_OSSL_CMP_CERTSTATUS_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CERTSTATUS_freefunc_type(freefunc)) +#define sk_OSSL_CMP_CERTSTATUS_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CERTSTATUS_type(ptr), (idx)) +#define sk_OSSL_CMP_CERTSTATUS_set(sk, idx, ptr) ((OSSL_CMP_CERTSTATUS *)OPENSSL_sk_set(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk), (idx), ossl_check_OSSL_CMP_CERTSTATUS_type(ptr))) +#define sk_OSSL_CMP_CERTSTATUS_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CERTSTATUS_type(ptr)) +#define sk_OSSL_CMP_CERTSTATUS_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CERTSTATUS_type(ptr)) +#define sk_OSSL_CMP_CERTSTATUS_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CERTSTATUS_type(ptr), pnum) +#define sk_OSSL_CMP_CERTSTATUS_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk)) +#define sk_OSSL_CMP_CERTSTATUS_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_CMP_CERTSTATUS_sk_type(sk)) +#define sk_OSSL_CMP_CERTSTATUS_dup(sk) ((STACK_OF(OSSL_CMP_CERTSTATUS) *)OPENSSL_sk_dup(ossl_check_const_OSSL_CMP_CERTSTATUS_sk_type(sk))) +#define sk_OSSL_CMP_CERTSTATUS_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CMP_CERTSTATUS) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CMP_CERTSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CERTSTATUS_copyfunc_type(copyfunc), ossl_check_OSSL_CMP_CERTSTATUS_freefunc_type(freefunc))) +#define sk_OSSL_CMP_CERTSTATUS_set_cmp_func(sk, cmp) ((sk_OSSL_CMP_CERTSTATUS_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CERTSTATUS_compfunc_type(cmp))) + +/* clang-format on */ +typedef struct ossl_cmp_itav_st OSSL_CMP_ITAV; +DECLARE_ASN1_DUP_FUNCTION(OSSL_CMP_ITAV) +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CMP_ITAV, OSSL_CMP_ITAV, OSSL_CMP_ITAV) +#define sk_OSSL_CMP_ITAV_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CMP_ITAV_sk_type(sk)) +#define sk_OSSL_CMP_ITAV_value(sk, idx) ((OSSL_CMP_ITAV *)OPENSSL_sk_value(ossl_check_const_OSSL_CMP_ITAV_sk_type(sk), (idx))) +#define sk_OSSL_CMP_ITAV_new(cmp) ((STACK_OF(OSSL_CMP_ITAV) *)OPENSSL_sk_new(ossl_check_OSSL_CMP_ITAV_compfunc_type(cmp))) +#define sk_OSSL_CMP_ITAV_new_null() ((STACK_OF(OSSL_CMP_ITAV) *)OPENSSL_sk_new_null()) +#define sk_OSSL_CMP_ITAV_new_reserve(cmp, n) ((STACK_OF(OSSL_CMP_ITAV) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_CMP_ITAV_compfunc_type(cmp), (n))) +#define sk_OSSL_CMP_ITAV_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CMP_ITAV_sk_type(sk), (n)) +#define sk_OSSL_CMP_ITAV_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CMP_ITAV_sk_type(sk)) +#define sk_OSSL_CMP_ITAV_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CMP_ITAV_sk_type(sk)) +#define sk_OSSL_CMP_ITAV_delete(sk, i) ((OSSL_CMP_ITAV *)OPENSSL_sk_delete(ossl_check_OSSL_CMP_ITAV_sk_type(sk), (i))) +#define sk_OSSL_CMP_ITAV_delete_ptr(sk, ptr) ((OSSL_CMP_ITAV *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_CMP_ITAV_sk_type(sk), ossl_check_OSSL_CMP_ITAV_type(ptr))) +#define sk_OSSL_CMP_ITAV_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_CMP_ITAV_sk_type(sk), ossl_check_OSSL_CMP_ITAV_type(ptr)) +#define sk_OSSL_CMP_ITAV_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_CMP_ITAV_sk_type(sk), ossl_check_OSSL_CMP_ITAV_type(ptr)) +#define sk_OSSL_CMP_ITAV_pop(sk) ((OSSL_CMP_ITAV *)OPENSSL_sk_pop(ossl_check_OSSL_CMP_ITAV_sk_type(sk))) +#define sk_OSSL_CMP_ITAV_shift(sk) ((OSSL_CMP_ITAV *)OPENSSL_sk_shift(ossl_check_OSSL_CMP_ITAV_sk_type(sk))) +#define sk_OSSL_CMP_ITAV_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_CMP_ITAV_sk_type(sk), ossl_check_OSSL_CMP_ITAV_freefunc_type(freefunc)) +#define sk_OSSL_CMP_ITAV_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_CMP_ITAV_sk_type(sk), ossl_check_OSSL_CMP_ITAV_type(ptr), (idx)) +#define sk_OSSL_CMP_ITAV_set(sk, idx, ptr) ((OSSL_CMP_ITAV *)OPENSSL_sk_set(ossl_check_OSSL_CMP_ITAV_sk_type(sk), (idx), ossl_check_OSSL_CMP_ITAV_type(ptr))) +#define sk_OSSL_CMP_ITAV_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_CMP_ITAV_sk_type(sk), ossl_check_OSSL_CMP_ITAV_type(ptr)) +#define sk_OSSL_CMP_ITAV_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_CMP_ITAV_sk_type(sk), ossl_check_OSSL_CMP_ITAV_type(ptr)) +#define sk_OSSL_CMP_ITAV_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_CMP_ITAV_sk_type(sk), ossl_check_OSSL_CMP_ITAV_type(ptr), pnum) +#define sk_OSSL_CMP_ITAV_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_CMP_ITAV_sk_type(sk)) +#define sk_OSSL_CMP_ITAV_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_CMP_ITAV_sk_type(sk)) +#define sk_OSSL_CMP_ITAV_dup(sk) ((STACK_OF(OSSL_CMP_ITAV) *)OPENSSL_sk_dup(ossl_check_const_OSSL_CMP_ITAV_sk_type(sk))) +#define sk_OSSL_CMP_ITAV_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CMP_ITAV) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CMP_ITAV_sk_type(sk), ossl_check_OSSL_CMP_ITAV_copyfunc_type(copyfunc), ossl_check_OSSL_CMP_ITAV_freefunc_type(freefunc))) +#define sk_OSSL_CMP_ITAV_set_cmp_func(sk, cmp) ((sk_OSSL_CMP_ITAV_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CMP_ITAV_sk_type(sk), ossl_check_OSSL_CMP_ITAV_compfunc_type(cmp))) + +/* clang-format on */ + +typedef struct ossl_cmp_crlstatus_st OSSL_CMP_CRLSTATUS; +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CMP_CRLSTATUS, OSSL_CMP_CRLSTATUS, OSSL_CMP_CRLSTATUS) +#define sk_OSSL_CMP_CRLSTATUS_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CMP_CRLSTATUS_sk_type(sk)) +#define sk_OSSL_CMP_CRLSTATUS_value(sk, idx) ((OSSL_CMP_CRLSTATUS *)OPENSSL_sk_value(ossl_check_const_OSSL_CMP_CRLSTATUS_sk_type(sk), (idx))) +#define sk_OSSL_CMP_CRLSTATUS_new(cmp) ((STACK_OF(OSSL_CMP_CRLSTATUS) *)OPENSSL_sk_new(ossl_check_OSSL_CMP_CRLSTATUS_compfunc_type(cmp))) +#define sk_OSSL_CMP_CRLSTATUS_new_null() ((STACK_OF(OSSL_CMP_CRLSTATUS) *)OPENSSL_sk_new_null()) +#define sk_OSSL_CMP_CRLSTATUS_new_reserve(cmp, n) ((STACK_OF(OSSL_CMP_CRLSTATUS) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_CMP_CRLSTATUS_compfunc_type(cmp), (n))) +#define sk_OSSL_CMP_CRLSTATUS_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), (n)) +#define sk_OSSL_CMP_CRLSTATUS_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk)) +#define sk_OSSL_CMP_CRLSTATUS_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk)) +#define sk_OSSL_CMP_CRLSTATUS_delete(sk, i) ((OSSL_CMP_CRLSTATUS *)OPENSSL_sk_delete(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), (i))) +#define sk_OSSL_CMP_CRLSTATUS_delete_ptr(sk, ptr) ((OSSL_CMP_CRLSTATUS *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_type(ptr))) +#define sk_OSSL_CMP_CRLSTATUS_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_type(ptr)) +#define sk_OSSL_CMP_CRLSTATUS_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_type(ptr)) +#define sk_OSSL_CMP_CRLSTATUS_pop(sk) ((OSSL_CMP_CRLSTATUS *)OPENSSL_sk_pop(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk))) +#define sk_OSSL_CMP_CRLSTATUS_shift(sk) ((OSSL_CMP_CRLSTATUS *)OPENSSL_sk_shift(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk))) +#define sk_OSSL_CMP_CRLSTATUS_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_freefunc_type(freefunc)) +#define sk_OSSL_CMP_CRLSTATUS_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_type(ptr), (idx)) +#define sk_OSSL_CMP_CRLSTATUS_set(sk, idx, ptr) ((OSSL_CMP_CRLSTATUS *)OPENSSL_sk_set(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), (idx), ossl_check_OSSL_CMP_CRLSTATUS_type(ptr))) +#define sk_OSSL_CMP_CRLSTATUS_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_type(ptr)) +#define sk_OSSL_CMP_CRLSTATUS_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_type(ptr)) +#define sk_OSSL_CMP_CRLSTATUS_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_type(ptr), pnum) +#define sk_OSSL_CMP_CRLSTATUS_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk)) +#define sk_OSSL_CMP_CRLSTATUS_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_CMP_CRLSTATUS_sk_type(sk)) +#define sk_OSSL_CMP_CRLSTATUS_dup(sk) ((STACK_OF(OSSL_CMP_CRLSTATUS) *)OPENSSL_sk_dup(ossl_check_const_OSSL_CMP_CRLSTATUS_sk_type(sk))) +#define sk_OSSL_CMP_CRLSTATUS_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CMP_CRLSTATUS) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_copyfunc_type(copyfunc), ossl_check_OSSL_CMP_CRLSTATUS_freefunc_type(freefunc))) +#define sk_OSSL_CMP_CRLSTATUS_set_cmp_func(sk, cmp) ((sk_OSSL_CMP_CRLSTATUS_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_compfunc_type(cmp))) + +/* clang-format on */ + +typedef OSSL_CRMF_ATTRIBUTETYPEANDVALUE OSSL_CMP_ATAV; +#define OSSL_CMP_ATAV_free OSSL_CRMF_ATTRIBUTETYPEANDVALUE_free +typedef STACK_OF(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) OSSL_CMP_ATAVS; +DECLARE_ASN1_FUNCTIONS(OSSL_CMP_ATAVS) +#define stack_st_OSSL_CMP_ATAV stack_st_OSSL_CRMF_ATTRIBUTETYPEANDVALUE +#define sk_OSSL_CMP_ATAV_num sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_num +#define sk_OSSL_CMP_ATAV_value sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_value +#define sk_OSSL_CMP_ATAV_push sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_push +#define sk_OSSL_CMP_ATAV_pop_free sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_pop_free + +typedef struct ossl_cmp_revrepcontent_st OSSL_CMP_REVREPCONTENT; +typedef struct ossl_cmp_pkisi_st OSSL_CMP_PKISI; +DECLARE_ASN1_FUNCTIONS(OSSL_CMP_PKISI) +DECLARE_ASN1_DUP_FUNCTION(OSSL_CMP_PKISI) +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CMP_PKISI, OSSL_CMP_PKISI, OSSL_CMP_PKISI) +#define sk_OSSL_CMP_PKISI_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CMP_PKISI_sk_type(sk)) +#define sk_OSSL_CMP_PKISI_value(sk, idx) ((OSSL_CMP_PKISI *)OPENSSL_sk_value(ossl_check_const_OSSL_CMP_PKISI_sk_type(sk), (idx))) +#define sk_OSSL_CMP_PKISI_new(cmp) ((STACK_OF(OSSL_CMP_PKISI) *)OPENSSL_sk_new(ossl_check_OSSL_CMP_PKISI_compfunc_type(cmp))) +#define sk_OSSL_CMP_PKISI_new_null() ((STACK_OF(OSSL_CMP_PKISI) *)OPENSSL_sk_new_null()) +#define sk_OSSL_CMP_PKISI_new_reserve(cmp, n) ((STACK_OF(OSSL_CMP_PKISI) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_CMP_PKISI_compfunc_type(cmp), (n))) +#define sk_OSSL_CMP_PKISI_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CMP_PKISI_sk_type(sk), (n)) +#define sk_OSSL_CMP_PKISI_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CMP_PKISI_sk_type(sk)) +#define sk_OSSL_CMP_PKISI_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CMP_PKISI_sk_type(sk)) +#define sk_OSSL_CMP_PKISI_delete(sk, i) ((OSSL_CMP_PKISI *)OPENSSL_sk_delete(ossl_check_OSSL_CMP_PKISI_sk_type(sk), (i))) +#define sk_OSSL_CMP_PKISI_delete_ptr(sk, ptr) ((OSSL_CMP_PKISI *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_CMP_PKISI_sk_type(sk), ossl_check_OSSL_CMP_PKISI_type(ptr))) +#define sk_OSSL_CMP_PKISI_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_CMP_PKISI_sk_type(sk), ossl_check_OSSL_CMP_PKISI_type(ptr)) +#define sk_OSSL_CMP_PKISI_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_CMP_PKISI_sk_type(sk), ossl_check_OSSL_CMP_PKISI_type(ptr)) +#define sk_OSSL_CMP_PKISI_pop(sk) ((OSSL_CMP_PKISI *)OPENSSL_sk_pop(ossl_check_OSSL_CMP_PKISI_sk_type(sk))) +#define sk_OSSL_CMP_PKISI_shift(sk) ((OSSL_CMP_PKISI *)OPENSSL_sk_shift(ossl_check_OSSL_CMP_PKISI_sk_type(sk))) +#define sk_OSSL_CMP_PKISI_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_CMP_PKISI_sk_type(sk), ossl_check_OSSL_CMP_PKISI_freefunc_type(freefunc)) +#define sk_OSSL_CMP_PKISI_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_CMP_PKISI_sk_type(sk), ossl_check_OSSL_CMP_PKISI_type(ptr), (idx)) +#define sk_OSSL_CMP_PKISI_set(sk, idx, ptr) ((OSSL_CMP_PKISI *)OPENSSL_sk_set(ossl_check_OSSL_CMP_PKISI_sk_type(sk), (idx), ossl_check_OSSL_CMP_PKISI_type(ptr))) +#define sk_OSSL_CMP_PKISI_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_CMP_PKISI_sk_type(sk), ossl_check_OSSL_CMP_PKISI_type(ptr)) +#define sk_OSSL_CMP_PKISI_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_CMP_PKISI_sk_type(sk), ossl_check_OSSL_CMP_PKISI_type(ptr)) +#define sk_OSSL_CMP_PKISI_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_CMP_PKISI_sk_type(sk), ossl_check_OSSL_CMP_PKISI_type(ptr), pnum) +#define sk_OSSL_CMP_PKISI_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_CMP_PKISI_sk_type(sk)) +#define sk_OSSL_CMP_PKISI_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_CMP_PKISI_sk_type(sk)) +#define sk_OSSL_CMP_PKISI_dup(sk) ((STACK_OF(OSSL_CMP_PKISI) *)OPENSSL_sk_dup(ossl_check_const_OSSL_CMP_PKISI_sk_type(sk))) +#define sk_OSSL_CMP_PKISI_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CMP_PKISI) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CMP_PKISI_sk_type(sk), ossl_check_OSSL_CMP_PKISI_copyfunc_type(copyfunc), ossl_check_OSSL_CMP_PKISI_freefunc_type(freefunc))) +#define sk_OSSL_CMP_PKISI_set_cmp_func(sk, cmp) ((sk_OSSL_CMP_PKISI_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CMP_PKISI_sk_type(sk), ossl_check_OSSL_CMP_PKISI_compfunc_type(cmp))) + +/* clang-format on */ +typedef struct ossl_cmp_certrepmessage_st OSSL_CMP_CERTREPMESSAGE; +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CMP_CERTREPMESSAGE, OSSL_CMP_CERTREPMESSAGE, OSSL_CMP_CERTREPMESSAGE) +#define sk_OSSL_CMP_CERTREPMESSAGE_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CMP_CERTREPMESSAGE_sk_type(sk)) +#define sk_OSSL_CMP_CERTREPMESSAGE_value(sk, idx) ((OSSL_CMP_CERTREPMESSAGE *)OPENSSL_sk_value(ossl_check_const_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), (idx))) +#define sk_OSSL_CMP_CERTREPMESSAGE_new(cmp) ((STACK_OF(OSSL_CMP_CERTREPMESSAGE) *)OPENSSL_sk_new(ossl_check_OSSL_CMP_CERTREPMESSAGE_compfunc_type(cmp))) +#define sk_OSSL_CMP_CERTREPMESSAGE_new_null() ((STACK_OF(OSSL_CMP_CERTREPMESSAGE) *)OPENSSL_sk_new_null()) +#define sk_OSSL_CMP_CERTREPMESSAGE_new_reserve(cmp, n) ((STACK_OF(OSSL_CMP_CERTREPMESSAGE) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_CMP_CERTREPMESSAGE_compfunc_type(cmp), (n))) +#define sk_OSSL_CMP_CERTREPMESSAGE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), (n)) +#define sk_OSSL_CMP_CERTREPMESSAGE_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk)) +#define sk_OSSL_CMP_CERTREPMESSAGE_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk)) +#define sk_OSSL_CMP_CERTREPMESSAGE_delete(sk, i) ((OSSL_CMP_CERTREPMESSAGE *)OPENSSL_sk_delete(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), (i))) +#define sk_OSSL_CMP_CERTREPMESSAGE_delete_ptr(sk, ptr) ((OSSL_CMP_CERTREPMESSAGE *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), ossl_check_OSSL_CMP_CERTREPMESSAGE_type(ptr))) +#define sk_OSSL_CMP_CERTREPMESSAGE_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), ossl_check_OSSL_CMP_CERTREPMESSAGE_type(ptr)) +#define sk_OSSL_CMP_CERTREPMESSAGE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), ossl_check_OSSL_CMP_CERTREPMESSAGE_type(ptr)) +#define sk_OSSL_CMP_CERTREPMESSAGE_pop(sk) ((OSSL_CMP_CERTREPMESSAGE *)OPENSSL_sk_pop(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk))) +#define sk_OSSL_CMP_CERTREPMESSAGE_shift(sk) ((OSSL_CMP_CERTREPMESSAGE *)OPENSSL_sk_shift(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk))) +#define sk_OSSL_CMP_CERTREPMESSAGE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), ossl_check_OSSL_CMP_CERTREPMESSAGE_freefunc_type(freefunc)) +#define sk_OSSL_CMP_CERTREPMESSAGE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), ossl_check_OSSL_CMP_CERTREPMESSAGE_type(ptr), (idx)) +#define sk_OSSL_CMP_CERTREPMESSAGE_set(sk, idx, ptr) ((OSSL_CMP_CERTREPMESSAGE *)OPENSSL_sk_set(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), (idx), ossl_check_OSSL_CMP_CERTREPMESSAGE_type(ptr))) +#define sk_OSSL_CMP_CERTREPMESSAGE_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), ossl_check_OSSL_CMP_CERTREPMESSAGE_type(ptr)) +#define sk_OSSL_CMP_CERTREPMESSAGE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), ossl_check_OSSL_CMP_CERTREPMESSAGE_type(ptr)) +#define sk_OSSL_CMP_CERTREPMESSAGE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), ossl_check_OSSL_CMP_CERTREPMESSAGE_type(ptr), pnum) +#define sk_OSSL_CMP_CERTREPMESSAGE_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk)) +#define sk_OSSL_CMP_CERTREPMESSAGE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_CMP_CERTREPMESSAGE_sk_type(sk)) +#define sk_OSSL_CMP_CERTREPMESSAGE_dup(sk) ((STACK_OF(OSSL_CMP_CERTREPMESSAGE) *)OPENSSL_sk_dup(ossl_check_const_OSSL_CMP_CERTREPMESSAGE_sk_type(sk))) +#define sk_OSSL_CMP_CERTREPMESSAGE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CMP_CERTREPMESSAGE) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), ossl_check_OSSL_CMP_CERTREPMESSAGE_copyfunc_type(copyfunc), ossl_check_OSSL_CMP_CERTREPMESSAGE_freefunc_type(freefunc))) +#define sk_OSSL_CMP_CERTREPMESSAGE_set_cmp_func(sk, cmp) ((sk_OSSL_CMP_CERTREPMESSAGE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), ossl_check_OSSL_CMP_CERTREPMESSAGE_compfunc_type(cmp))) + +/* clang-format on */ +typedef struct ossl_cmp_pollrep_st OSSL_CMP_POLLREP; +typedef STACK_OF(OSSL_CMP_POLLREP) OSSL_CMP_POLLREPCONTENT; +typedef struct ossl_cmp_certresponse_st OSSL_CMP_CERTRESPONSE; +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CMP_CERTRESPONSE, OSSL_CMP_CERTRESPONSE, OSSL_CMP_CERTRESPONSE) +#define sk_OSSL_CMP_CERTRESPONSE_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CMP_CERTRESPONSE_sk_type(sk)) +#define sk_OSSL_CMP_CERTRESPONSE_value(sk, idx) ((OSSL_CMP_CERTRESPONSE *)OPENSSL_sk_value(ossl_check_const_OSSL_CMP_CERTRESPONSE_sk_type(sk), (idx))) +#define sk_OSSL_CMP_CERTRESPONSE_new(cmp) ((STACK_OF(OSSL_CMP_CERTRESPONSE) *)OPENSSL_sk_new(ossl_check_OSSL_CMP_CERTRESPONSE_compfunc_type(cmp))) +#define sk_OSSL_CMP_CERTRESPONSE_new_null() ((STACK_OF(OSSL_CMP_CERTRESPONSE) *)OPENSSL_sk_new_null()) +#define sk_OSSL_CMP_CERTRESPONSE_new_reserve(cmp, n) ((STACK_OF(OSSL_CMP_CERTRESPONSE) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_CMP_CERTRESPONSE_compfunc_type(cmp), (n))) +#define sk_OSSL_CMP_CERTRESPONSE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk), (n)) +#define sk_OSSL_CMP_CERTRESPONSE_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk)) +#define sk_OSSL_CMP_CERTRESPONSE_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk)) +#define sk_OSSL_CMP_CERTRESPONSE_delete(sk, i) ((OSSL_CMP_CERTRESPONSE *)OPENSSL_sk_delete(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk), (i))) +#define sk_OSSL_CMP_CERTRESPONSE_delete_ptr(sk, ptr) ((OSSL_CMP_CERTRESPONSE *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk), ossl_check_OSSL_CMP_CERTRESPONSE_type(ptr))) +#define sk_OSSL_CMP_CERTRESPONSE_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk), ossl_check_OSSL_CMP_CERTRESPONSE_type(ptr)) +#define sk_OSSL_CMP_CERTRESPONSE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk), ossl_check_OSSL_CMP_CERTRESPONSE_type(ptr)) +#define sk_OSSL_CMP_CERTRESPONSE_pop(sk) ((OSSL_CMP_CERTRESPONSE *)OPENSSL_sk_pop(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk))) +#define sk_OSSL_CMP_CERTRESPONSE_shift(sk) ((OSSL_CMP_CERTRESPONSE *)OPENSSL_sk_shift(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk))) +#define sk_OSSL_CMP_CERTRESPONSE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk), ossl_check_OSSL_CMP_CERTRESPONSE_freefunc_type(freefunc)) +#define sk_OSSL_CMP_CERTRESPONSE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk), ossl_check_OSSL_CMP_CERTRESPONSE_type(ptr), (idx)) +#define sk_OSSL_CMP_CERTRESPONSE_set(sk, idx, ptr) ((OSSL_CMP_CERTRESPONSE *)OPENSSL_sk_set(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk), (idx), ossl_check_OSSL_CMP_CERTRESPONSE_type(ptr))) +#define sk_OSSL_CMP_CERTRESPONSE_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk), ossl_check_OSSL_CMP_CERTRESPONSE_type(ptr)) +#define sk_OSSL_CMP_CERTRESPONSE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk), ossl_check_OSSL_CMP_CERTRESPONSE_type(ptr)) +#define sk_OSSL_CMP_CERTRESPONSE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk), ossl_check_OSSL_CMP_CERTRESPONSE_type(ptr), pnum) +#define sk_OSSL_CMP_CERTRESPONSE_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk)) +#define sk_OSSL_CMP_CERTRESPONSE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_CMP_CERTRESPONSE_sk_type(sk)) +#define sk_OSSL_CMP_CERTRESPONSE_dup(sk) ((STACK_OF(OSSL_CMP_CERTRESPONSE) *)OPENSSL_sk_dup(ossl_check_const_OSSL_CMP_CERTRESPONSE_sk_type(sk))) +#define sk_OSSL_CMP_CERTRESPONSE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CMP_CERTRESPONSE) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CMP_CERTRESPONSE_sk_type(sk), ossl_check_OSSL_CMP_CERTRESPONSE_copyfunc_type(copyfunc), ossl_check_OSSL_CMP_CERTRESPONSE_freefunc_type(freefunc))) +#define sk_OSSL_CMP_CERTRESPONSE_set_cmp_func(sk, cmp) ((sk_OSSL_CMP_CERTRESPONSE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk), ossl_check_OSSL_CMP_CERTRESPONSE_compfunc_type(cmp))) + +/* clang-format on */ +typedef STACK_OF(ASN1_UTF8STRING) OSSL_CMP_PKIFREETEXT; + +/* + * function DECLARATIONS + */ + +/* from cmp_asn.c */ +OSSL_CMP_ITAV *OSSL_CMP_ITAV_create(ASN1_OBJECT *type, ASN1_TYPE *value); +void OSSL_CMP_ITAV_set0(OSSL_CMP_ITAV *itav, ASN1_OBJECT *type, + ASN1_TYPE *value); +ASN1_OBJECT *OSSL_CMP_ITAV_get0_type(const OSSL_CMP_ITAV *itav); +ASN1_TYPE *OSSL_CMP_ITAV_get0_value(const OSSL_CMP_ITAV *itav); +int OSSL_CMP_ITAV_push0_stack_item(STACK_OF(OSSL_CMP_ITAV) **sk_p, + OSSL_CMP_ITAV *itav); +void OSSL_CMP_ITAV_free(OSSL_CMP_ITAV *itav); + +OSSL_CMP_ITAV *OSSL_CMP_ITAV_new0_certProfile(STACK_OF(ASN1_UTF8STRING) + *certProfile); +int OSSL_CMP_ITAV_get0_certProfile(const OSSL_CMP_ITAV *itav, + STACK_OF(ASN1_UTF8STRING) **out); +OSSL_CMP_ITAV *OSSL_CMP_ITAV_new_caCerts(const STACK_OF(X509) *caCerts); +int OSSL_CMP_ITAV_get0_caCerts(const OSSL_CMP_ITAV *itav, STACK_OF(X509) **out); + +OSSL_CMP_ITAV *OSSL_CMP_ITAV_new_rootCaCert(const X509 *rootCaCert); +int OSSL_CMP_ITAV_get0_rootCaCert(const OSSL_CMP_ITAV *itav, X509 **out); +OSSL_CMP_ITAV *OSSL_CMP_ITAV_new_rootCaKeyUpdate(const X509 *newWithNew, + const X509 *newWithOld, + const X509 *oldWithNew); +int OSSL_CMP_ITAV_get0_rootCaKeyUpdate(const OSSL_CMP_ITAV *itav, + X509 **newWithNew, + X509 **newWithOld, + X509 **oldWithNew); + +OSSL_CMP_CRLSTATUS *OSSL_CMP_CRLSTATUS_create(const X509_CRL *crl, + const X509 *cert, int only_DN); +OSSL_CMP_CRLSTATUS *OSSL_CMP_CRLSTATUS_new1(const DIST_POINT_NAME *dpn, + const GENERAL_NAMES *issuer, + const ASN1_TIME *thisUpdate); +int OSSL_CMP_CRLSTATUS_get0(const OSSL_CMP_CRLSTATUS *crlstatus, + DIST_POINT_NAME **dpn, GENERAL_NAMES **issuer, + ASN1_TIME **thisUpdate); +void OSSL_CMP_CRLSTATUS_free(OSSL_CMP_CRLSTATUS *crlstatus); +OSSL_CMP_ITAV +*OSSL_CMP_ITAV_new0_crlStatusList(STACK_OF(OSSL_CMP_CRLSTATUS) *crlStatusList); +int OSSL_CMP_ITAV_get0_crlStatusList(const OSSL_CMP_ITAV *itav, + STACK_OF(OSSL_CMP_CRLSTATUS) **out); +OSSL_CMP_ITAV *OSSL_CMP_ITAV_new_crls(const X509_CRL *crls); +int OSSL_CMP_ITAV_get0_crls(const OSSL_CMP_ITAV *it, STACK_OF(X509_CRL) **out); +OSSL_CMP_ITAV +*OSSL_CMP_ITAV_new0_certReqTemplate(OSSL_CRMF_CERTTEMPLATE *certTemplate, + OSSL_CMP_ATAVS *keySpec); +int OSSL_CMP_ITAV_get1_certReqTemplate(const OSSL_CMP_ITAV *itav, + OSSL_CRMF_CERTTEMPLATE **certTemplate, + OSSL_CMP_ATAVS **keySpec); + +OSSL_CMP_ATAV *OSSL_CMP_ATAV_create(ASN1_OBJECT *type, ASN1_TYPE *value); +void OSSL_CMP_ATAV_set0(OSSL_CMP_ATAV *itav, ASN1_OBJECT *type, + ASN1_TYPE *value); +ASN1_OBJECT *OSSL_CMP_ATAV_get0_type(const OSSL_CMP_ATAV *itav); +ASN1_TYPE *OSSL_CMP_ATAV_get0_value(const OSSL_CMP_ATAV *itav); +OSSL_CMP_ATAV *OSSL_CMP_ATAV_new_algId(const X509_ALGOR *alg); +X509_ALGOR *OSSL_CMP_ATAV_get0_algId(const OSSL_CMP_ATAV *atav); +OSSL_CMP_ATAV *OSSL_CMP_ATAV_new_rsaKeyLen(int len); +int OSSL_CMP_ATAV_get_rsaKeyLen(const OSSL_CMP_ATAV *atav); +int OSSL_CMP_ATAV_push1(OSSL_CMP_ATAVS **sk_p, const OSSL_CMP_ATAV *atav); + +void OSSL_CMP_MSG_free(OSSL_CMP_MSG *msg); + +/* from cmp_ctx.c */ +OSSL_CMP_CTX *OSSL_CMP_CTX_new(OSSL_LIB_CTX *libctx, const char *propq); +void OSSL_CMP_CTX_free(OSSL_CMP_CTX *ctx); +int OSSL_CMP_CTX_reinit(OSSL_CMP_CTX *ctx); +OSSL_LIB_CTX *OSSL_CMP_CTX_get0_libctx(const OSSL_CMP_CTX *ctx); +const char *OSSL_CMP_CTX_get0_propq(const OSSL_CMP_CTX *ctx); +/* CMP general options: */ +#define OSSL_CMP_OPT_LOG_VERBOSITY 0 +/* CMP transfer options: */ +#define OSSL_CMP_OPT_KEEP_ALIVE 10 +#define OSSL_CMP_OPT_MSG_TIMEOUT 11 +#define OSSL_CMP_OPT_TOTAL_TIMEOUT 12 +#define OSSL_CMP_OPT_USE_TLS 13 +/* CMP request options: */ +#define OSSL_CMP_OPT_VALIDITY_DAYS 20 +#define OSSL_CMP_OPT_SUBJECTALTNAME_NODEFAULT 21 +#define OSSL_CMP_OPT_SUBJECTALTNAME_CRITICAL 22 +#define OSSL_CMP_OPT_POLICIES_CRITICAL 23 +#define OSSL_CMP_OPT_POPO_METHOD 24 +#define OSSL_CMP_OPT_IMPLICIT_CONFIRM 25 +#define OSSL_CMP_OPT_DISABLE_CONFIRM 26 +#define OSSL_CMP_OPT_REVOCATION_REASON 27 +/* CMP protection options: */ +#define OSSL_CMP_OPT_UNPROTECTED_SEND 30 +#define OSSL_CMP_OPT_UNPROTECTED_ERRORS 31 +#define OSSL_CMP_OPT_OWF_ALGNID 32 +#define OSSL_CMP_OPT_MAC_ALGNID 33 +#define OSSL_CMP_OPT_DIGEST_ALGNID 34 +#define OSSL_CMP_OPT_IGNORE_KEYUSAGE 35 +#define OSSL_CMP_OPT_PERMIT_TA_IN_EXTRACERTS_FOR_IR 36 +#define OSSL_CMP_OPT_NO_CACHE_EXTRACERTS 37 +int OSSL_CMP_CTX_set_option(OSSL_CMP_CTX *ctx, int opt, int val); +int OSSL_CMP_CTX_get_option(const OSSL_CMP_CTX *ctx, int opt); +/* CMP-specific callback for logging and outputting the error queue: */ +int OSSL_CMP_CTX_set_log_cb(OSSL_CMP_CTX *ctx, OSSL_CMP_log_cb_t cb); +#define OSSL_CMP_CTX_set_log_verbosity(ctx, level) \ + OSSL_CMP_CTX_set_option(ctx, OSSL_CMP_OPT_LOG_VERBOSITY, level) +void OSSL_CMP_CTX_print_errors(const OSSL_CMP_CTX *ctx); +/* message transfer: */ +int OSSL_CMP_CTX_set1_serverPath(OSSL_CMP_CTX *ctx, const char *path); +int OSSL_CMP_CTX_set1_server(OSSL_CMP_CTX *ctx, const char *address); +int OSSL_CMP_CTX_set_serverPort(OSSL_CMP_CTX *ctx, int port); +int OSSL_CMP_CTX_set1_proxy(OSSL_CMP_CTX *ctx, const char *name); +int OSSL_CMP_CTX_set1_no_proxy(OSSL_CMP_CTX *ctx, const char *names); +#ifndef OPENSSL_NO_HTTP +int OSSL_CMP_CTX_set_http_cb(OSSL_CMP_CTX *ctx, OSSL_HTTP_bio_cb_t cb); +int OSSL_CMP_CTX_set_http_cb_arg(OSSL_CMP_CTX *ctx, void *arg); +void *OSSL_CMP_CTX_get_http_cb_arg(const OSSL_CMP_CTX *ctx); +#endif +typedef OSSL_CMP_MSG *(*OSSL_CMP_transfer_cb_t)(OSSL_CMP_CTX *ctx, + const OSSL_CMP_MSG *req); +int OSSL_CMP_CTX_set_transfer_cb(OSSL_CMP_CTX *ctx, OSSL_CMP_transfer_cb_t cb); +int OSSL_CMP_CTX_set_transfer_cb_arg(OSSL_CMP_CTX *ctx, void *arg); +void *OSSL_CMP_CTX_get_transfer_cb_arg(const OSSL_CMP_CTX *ctx); +/* server authentication: */ +int OSSL_CMP_CTX_set1_srvCert(OSSL_CMP_CTX *ctx, X509 *cert); +int OSSL_CMP_CTX_set1_expected_sender(OSSL_CMP_CTX *ctx, const X509_NAME *name); +int OSSL_CMP_CTX_set0_trustedStore(OSSL_CMP_CTX *ctx, X509_STORE *store); +#define OSSL_CMP_CTX_set0_trusted OSSL_CMP_CTX_set0_trustedStore +X509_STORE *OSSL_CMP_CTX_get0_trustedStore(const OSSL_CMP_CTX *ctx); +#define OSSL_CMP_CTX_get0_trusted OSSL_CMP_CTX_get0_trustedStore +int OSSL_CMP_CTX_set1_untrusted(OSSL_CMP_CTX *ctx, STACK_OF(X509) *certs); +STACK_OF(X509) *OSSL_CMP_CTX_get0_untrusted(const OSSL_CMP_CTX *ctx); +/* client authentication: */ +int OSSL_CMP_CTX_set1_cert(OSSL_CMP_CTX *ctx, X509 *cert); +int OSSL_CMP_CTX_build_cert_chain(OSSL_CMP_CTX *ctx, X509_STORE *own_trusted, + STACK_OF(X509) *candidates); +int OSSL_CMP_CTX_set1_pkey(OSSL_CMP_CTX *ctx, EVP_PKEY *pkey); +int OSSL_CMP_CTX_set1_referenceValue(OSSL_CMP_CTX *ctx, + const unsigned char *ref, int len); +int OSSL_CMP_CTX_set1_secretValue(OSSL_CMP_CTX *ctx, + const unsigned char *sec, int len); +/* CMP message header and extra certificates: */ +int OSSL_CMP_CTX_set1_recipient(OSSL_CMP_CTX *ctx, const X509_NAME *name); +int OSSL_CMP_CTX_push0_geninfo_ITAV(OSSL_CMP_CTX *ctx, OSSL_CMP_ITAV *itav); +int OSSL_CMP_CTX_reset_geninfo_ITAVs(OSSL_CMP_CTX *ctx); +STACK_OF(OSSL_CMP_ITAV) +*OSSL_CMP_CTX_get0_geninfo_ITAVs(const OSSL_CMP_CTX *ctx); +int OSSL_CMP_CTX_set1_extraCertsOut(OSSL_CMP_CTX *ctx, + STACK_OF(X509) *extraCertsOut); +/* certificate template: */ +int OSSL_CMP_CTX_set0_newPkey(OSSL_CMP_CTX *ctx, int priv, EVP_PKEY *pkey); +EVP_PKEY *OSSL_CMP_CTX_get0_newPkey(const OSSL_CMP_CTX *ctx, int priv); +int OSSL_CMP_CTX_set1_issuer(OSSL_CMP_CTX *ctx, const X509_NAME *name); +int OSSL_CMP_CTX_set1_serialNumber(OSSL_CMP_CTX *ctx, const ASN1_INTEGER *sn); +int OSSL_CMP_CTX_set1_subjectName(OSSL_CMP_CTX *ctx, const X509_NAME *name); +int OSSL_CMP_CTX_push1_subjectAltName(OSSL_CMP_CTX *ctx, + const GENERAL_NAME *name); +int OSSL_CMP_CTX_set0_reqExtensions(OSSL_CMP_CTX *ctx, X509_EXTENSIONS *exts); +int OSSL_CMP_CTX_reqExtensions_have_SAN(OSSL_CMP_CTX *ctx); +int OSSL_CMP_CTX_push0_policy(OSSL_CMP_CTX *ctx, POLICYINFO *pinfo); +int OSSL_CMP_CTX_set1_oldCert(OSSL_CMP_CTX *ctx, X509 *cert); +int OSSL_CMP_CTX_set1_p10CSR(OSSL_CMP_CTX *ctx, const X509_REQ *csr); +/* misc body contents: */ +int OSSL_CMP_CTX_push0_genm_ITAV(OSSL_CMP_CTX *ctx, OSSL_CMP_ITAV *itav); +/* certificate confirmation: */ +typedef int (*OSSL_CMP_certConf_cb_t)(OSSL_CMP_CTX *ctx, X509 *cert, + int fail_info, const char **txt); +int OSSL_CMP_certConf_cb(OSSL_CMP_CTX *ctx, X509 *cert, int fail_info, + const char **text); +int OSSL_CMP_CTX_set_certConf_cb(OSSL_CMP_CTX *ctx, OSSL_CMP_certConf_cb_t cb); +int OSSL_CMP_CTX_set_certConf_cb_arg(OSSL_CMP_CTX *ctx, void *arg); +void *OSSL_CMP_CTX_get_certConf_cb_arg(const OSSL_CMP_CTX *ctx); +/* result fetching: */ +int OSSL_CMP_CTX_get_status(const OSSL_CMP_CTX *ctx); +OSSL_CMP_PKIFREETEXT *OSSL_CMP_CTX_get0_statusString(const OSSL_CMP_CTX *ctx); +int OSSL_CMP_CTX_get_failInfoCode(const OSSL_CMP_CTX *ctx); +#define OSSL_CMP_PKISI_BUFLEN 1024 +X509 *OSSL_CMP_CTX_get0_validatedSrvCert(const OSSL_CMP_CTX *ctx); +X509 *OSSL_CMP_CTX_get0_newCert(const OSSL_CMP_CTX *ctx); +STACK_OF(X509) *OSSL_CMP_CTX_get1_newChain(const OSSL_CMP_CTX *ctx); +STACK_OF(X509) *OSSL_CMP_CTX_get1_caPubs(const OSSL_CMP_CTX *ctx); +STACK_OF(X509) *OSSL_CMP_CTX_get1_extraCertsIn(const OSSL_CMP_CTX *ctx); +int OSSL_CMP_CTX_set1_transactionID(OSSL_CMP_CTX *ctx, + const ASN1_OCTET_STRING *id); +int OSSL_CMP_CTX_set1_senderNonce(OSSL_CMP_CTX *ctx, + const ASN1_OCTET_STRING *nonce); + +/* from cmp_status.c */ +char *OSSL_CMP_CTX_snprint_PKIStatus(const OSSL_CMP_CTX *ctx, char *buf, + size_t bufsize); +char *OSSL_CMP_snprint_PKIStatusInfo(const OSSL_CMP_PKISI *statusInfo, + char *buf, size_t bufsize); +OSSL_CMP_PKISI * +OSSL_CMP_STATUSINFO_new(int status, int fail_info, const char *text); + +/* from cmp_hdr.c */ +ASN1_OCTET_STRING *OSSL_CMP_HDR_get0_transactionID(const OSSL_CMP_PKIHEADER *hdr); +ASN1_OCTET_STRING *OSSL_CMP_HDR_get0_recipNonce(const OSSL_CMP_PKIHEADER *hdr); +STACK_OF(OSSL_CMP_ITAV) +*OSSL_CMP_HDR_get0_geninfo_ITAVs(const OSSL_CMP_PKIHEADER *hdr); + +/* from cmp_msg.c */ +OSSL_CMP_PKIHEADER *OSSL_CMP_MSG_get0_header(const OSSL_CMP_MSG *msg); +int OSSL_CMP_MSG_get_bodytype(const OSSL_CMP_MSG *msg); +X509_PUBKEY *OSSL_CMP_MSG_get0_certreq_publickey(const OSSL_CMP_MSG *msg); +int OSSL_CMP_MSG_update_transactionID(OSSL_CMP_CTX *ctx, OSSL_CMP_MSG *msg); +int OSSL_CMP_MSG_update_recipNonce(OSSL_CMP_CTX *ctx, OSSL_CMP_MSG *msg); +OSSL_CRMF_MSG *OSSL_CMP_CTX_setup_CRM(OSSL_CMP_CTX *ctx, int for_KUR, int rid); +OSSL_CMP_MSG *OSSL_CMP_MSG_read(const char *file, OSSL_LIB_CTX *libctx, + const char *propq); +int OSSL_CMP_MSG_write(const char *file, const OSSL_CMP_MSG *msg); +OSSL_CMP_MSG *d2i_OSSL_CMP_MSG_bio(BIO *bio, OSSL_CMP_MSG **msg); +int i2d_OSSL_CMP_MSG_bio(BIO *bio, const OSSL_CMP_MSG *msg); + +/* from cmp_vfy.c */ +int OSSL_CMP_validate_msg(OSSL_CMP_CTX *ctx, const OSSL_CMP_MSG *msg); +int OSSL_CMP_validate_cert_path(const OSSL_CMP_CTX *ctx, + X509_STORE *trusted_store, X509 *cert); + +/* from cmp_http.c */ +#ifndef OPENSSL_NO_HTTP +OSSL_CMP_MSG *OSSL_CMP_MSG_http_perform(OSSL_CMP_CTX *ctx, + const OSSL_CMP_MSG *req); +#endif + +/* from cmp_server.c */ +typedef struct ossl_cmp_srv_ctx_st OSSL_CMP_SRV_CTX; +OSSL_CMP_MSG *OSSL_CMP_SRV_process_request(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *req); +OSSL_CMP_MSG *OSSL_CMP_CTX_server_perform(OSSL_CMP_CTX *client_ctx, + const OSSL_CMP_MSG *req); +OSSL_CMP_SRV_CTX *OSSL_CMP_SRV_CTX_new(OSSL_LIB_CTX *libctx, const char *propq); +void OSSL_CMP_SRV_CTX_free(OSSL_CMP_SRV_CTX *srv_ctx); +typedef OSSL_CMP_PKISI *(*OSSL_CMP_SRV_cert_request_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx, const OSSL_CMP_MSG *req, int certReqId, + const OSSL_CRMF_MSG *crm, const X509_REQ *p10cr, + X509 **certOut, STACK_OF(X509) **chainOut, STACK_OF(X509) **caPubs); +typedef OSSL_CMP_PKISI *(*OSSL_CMP_SRV_rr_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *req, + const X509_NAME *issuer, + const ASN1_INTEGER *serial); +typedef int (*OSSL_CMP_SRV_genm_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *req, + const STACK_OF(OSSL_CMP_ITAV) *in, + STACK_OF(OSSL_CMP_ITAV) **out); +typedef void (*OSSL_CMP_SRV_error_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *req, + const OSSL_CMP_PKISI *statusInfo, + const ASN1_INTEGER *errorCode, + const OSSL_CMP_PKIFREETEXT *errDetails); +typedef int (*OSSL_CMP_SRV_certConf_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *req, + int certReqId, + const ASN1_OCTET_STRING *certHash, + const OSSL_CMP_PKISI *si); +typedef int (*OSSL_CMP_SRV_pollReq_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *req, int certReqId, + OSSL_CMP_MSG **certReq, + int64_t *check_after); +int OSSL_CMP_SRV_CTX_init(OSSL_CMP_SRV_CTX *srv_ctx, void *custom_ctx, + OSSL_CMP_SRV_cert_request_cb_t process_cert_request, + OSSL_CMP_SRV_rr_cb_t process_rr, + OSSL_CMP_SRV_genm_cb_t process_genm, + OSSL_CMP_SRV_error_cb_t process_error, + OSSL_CMP_SRV_certConf_cb_t process_certConf, + OSSL_CMP_SRV_pollReq_cb_t process_pollReq); +typedef int (*OSSL_CMP_SRV_delayed_delivery_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx, + const OSSL_CMP_MSG *req); +typedef int (*OSSL_CMP_SRV_clean_transaction_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx, + const ASN1_OCTET_STRING *id); +int OSSL_CMP_SRV_CTX_init_trans(OSSL_CMP_SRV_CTX *srv_ctx, + OSSL_CMP_SRV_delayed_delivery_cb_t delay, + OSSL_CMP_SRV_clean_transaction_cb_t clean); +OSSL_CMP_CTX *OSSL_CMP_SRV_CTX_get0_cmp_ctx(const OSSL_CMP_SRV_CTX *srv_ctx); +void *OSSL_CMP_SRV_CTX_get0_custom_ctx(const OSSL_CMP_SRV_CTX *srv_ctx); +int OSSL_CMP_SRV_CTX_set_send_unprotected_errors(OSSL_CMP_SRV_CTX *srv_ctx, + int val); +int OSSL_CMP_SRV_CTX_set_accept_unprotected(OSSL_CMP_SRV_CTX *srv_ctx, int val); +int OSSL_CMP_SRV_CTX_set_accept_raverified(OSSL_CMP_SRV_CTX *srv_ctx, int val); +int OSSL_CMP_SRV_CTX_set_grant_implicit_confirm(OSSL_CMP_SRV_CTX *srv_ctx, + int val); + +/* from cmp_client.c */ +X509 *OSSL_CMP_exec_certreq(OSSL_CMP_CTX *ctx, int req_type, + const OSSL_CRMF_MSG *crm); +#define OSSL_CMP_IR 0 +#define OSSL_CMP_CR 2 +#define OSSL_CMP_P10CR 4 +#define OSSL_CMP_KUR 7 +#define OSSL_CMP_GENM 21 +#define OSSL_CMP_ERROR 23 +#define OSSL_CMP_exec_IR_ses(ctx) \ + OSSL_CMP_exec_certreq(ctx, OSSL_CMP_IR, NULL) +#define OSSL_CMP_exec_CR_ses(ctx) \ + OSSL_CMP_exec_certreq(ctx, OSSL_CMP_CR, NULL) +#define OSSL_CMP_exec_P10CR_ses(ctx) \ + OSSL_CMP_exec_certreq(ctx, OSSL_CMP_P10CR, NULL) +#define OSSL_CMP_exec_KUR_ses(ctx) \ + OSSL_CMP_exec_certreq(ctx, OSSL_CMP_KUR, NULL) +int OSSL_CMP_try_certreq(OSSL_CMP_CTX *ctx, int req_type, + const OSSL_CRMF_MSG *crm, int *checkAfter); +int OSSL_CMP_exec_RR_ses(OSSL_CMP_CTX *ctx); +STACK_OF(OSSL_CMP_ITAV) *OSSL_CMP_exec_GENM_ses(OSSL_CMP_CTX *ctx); + +/* from cmp_genm.c */ +int OSSL_CMP_get1_caCerts(OSSL_CMP_CTX *ctx, STACK_OF(X509) **out); +int OSSL_CMP_get1_rootCaKeyUpdate(OSSL_CMP_CTX *ctx, + const X509 *oldWithOld, X509 **newWithNew, + X509 **newWithOld, X509 **oldWithNew); +int OSSL_CMP_get1_crlUpdate(OSSL_CMP_CTX *ctx, const X509 *crlcert, + const X509_CRL *last_crl, + X509_CRL **crl); +int OSSL_CMP_get1_certReqTemplate(OSSL_CMP_CTX *ctx, + OSSL_CRMF_CERTTEMPLATE **certTemplate, + OSSL_CMP_ATAVS **keySpec); + +#ifdef __cplusplus +} +#endif +#endif /* !defined(OPENSSL_NO_CMP) */ +#endif /* !defined(OPENSSL_CMP_H) */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cmp_util.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cmp_util.h new file mode 100644 index 0000000000000000000000000000000000000000..a0ee20f473a176d17dc4da4b602757c2eb3f4de3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cmp_util.h @@ -0,0 +1,56 @@ +/* + * Copyright 2007-2021 The OpenSSL Project Authors. All Rights Reserved. + * Copyright Nokia 2007-2019 + * Copyright Siemens AG 2015-2019 + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_CMP_UTIL_H +#define OPENSSL_CMP_UTIL_H +#pragma once + +#include +#ifndef OPENSSL_NO_CMP + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +int OSSL_CMP_log_open(void); +void OSSL_CMP_log_close(void); +#define OSSL_CMP_LOG_PREFIX "CMP " + +/* + * generalized logging/error callback mirroring the severity levels of syslog.h + */ +typedef int OSSL_CMP_severity; +#define OSSL_CMP_LOG_EMERG 0 +#define OSSL_CMP_LOG_ALERT 1 +#define OSSL_CMP_LOG_CRIT 2 +#define OSSL_CMP_LOG_ERR 3 +#define OSSL_CMP_LOG_WARNING 4 +#define OSSL_CMP_LOG_NOTICE 5 +#define OSSL_CMP_LOG_INFO 6 +#define OSSL_CMP_LOG_DEBUG 7 +#define OSSL_CMP_LOG_TRACE 8 +#define OSSL_CMP_LOG_MAX OSSL_CMP_LOG_TRACE +typedef int (*OSSL_CMP_log_cb_t)(const char *func, const char *file, int line, + OSSL_CMP_severity level, const char *msg); + +int OSSL_CMP_print_to_bio(BIO *bio, const char *component, const char *file, + int line, OSSL_CMP_severity level, const char *msg); +/* use of the logging callback for outputting error queue */ +void OSSL_CMP_print_errors_cb(OSSL_CMP_log_cb_t log_fn); + +#ifdef __cplusplus +} +#endif +#endif /* !defined(OPENSSL_NO_CMP) */ +#endif /* !defined(OPENSSL_CMP_UTIL_H) */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cmperr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cmperr.h new file mode 100644 index 0000000000000000000000000000000000000000..b07ac6d6c6db11e1c83e80d088a3a7d26cddea8b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cmperr.h @@ -0,0 +1,132 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_CMPERR_H +#define OPENSSL_CMPERR_H +#pragma once + +#include +#include +#include + +#ifndef OPENSSL_NO_CMP + +/* + * CMP reason codes. + */ +#define CMP_R_ALGORITHM_NOT_SUPPORTED 139 +#define CMP_R_BAD_CHECKAFTER_IN_POLLREP 167 +#define CMP_R_BAD_REQUEST_ID 108 +#define CMP_R_CERTHASH_UNMATCHED 156 +#define CMP_R_CERTID_NOT_FOUND 109 +#define CMP_R_CERTIFICATE_NOT_ACCEPTED 169 +#define CMP_R_CERTIFICATE_NOT_FOUND 112 +#define CMP_R_CERTREQMSG_NOT_FOUND 157 +#define CMP_R_CERTRESPONSE_NOT_FOUND 113 +#define CMP_R_CERT_AND_KEY_DO_NOT_MATCH 114 +#define CMP_R_CHECKAFTER_OUT_OF_RANGE 181 +#define CMP_R_ENCOUNTERED_KEYUPDATEWARNING 176 +#define CMP_R_ENCOUNTERED_WAITING 162 +#define CMP_R_ERROR_CALCULATING_PROTECTION 115 +#define CMP_R_ERROR_CREATING_CERTCONF 116 +#define CMP_R_ERROR_CREATING_CERTREP 117 +#define CMP_R_ERROR_CREATING_CERTREQ 163 +#define CMP_R_ERROR_CREATING_ERROR 118 +#define CMP_R_ERROR_CREATING_GENM 119 +#define CMP_R_ERROR_CREATING_GENP 120 +#define CMP_R_ERROR_CREATING_PKICONF 122 +#define CMP_R_ERROR_CREATING_POLLREP 123 +#define CMP_R_ERROR_CREATING_POLLREQ 124 +#define CMP_R_ERROR_CREATING_RP 125 +#define CMP_R_ERROR_CREATING_RR 126 +#define CMP_R_ERROR_PARSING_PKISTATUS 107 +#define CMP_R_ERROR_PROCESSING_MESSAGE 158 +#define CMP_R_ERROR_PROTECTING_MESSAGE 127 +#define CMP_R_ERROR_SETTING_CERTHASH 128 +#define CMP_R_ERROR_UNEXPECTED_CERTCONF 160 +#define CMP_R_ERROR_VALIDATING_PROTECTION 140 +#define CMP_R_ERROR_VALIDATING_SIGNATURE 171 +#define CMP_R_EXPECTED_POLLREQ 104 +#define CMP_R_FAILED_BUILDING_OWN_CHAIN 164 +#define CMP_R_FAILED_EXTRACTING_CENTRAL_GEN_KEY 203 +#define CMP_R_FAILED_EXTRACTING_PUBKEY 141 +#define CMP_R_FAILURE_OBTAINING_RANDOM 110 +#define CMP_R_FAIL_INFO_OUT_OF_RANGE 129 +#define CMP_R_GENERATE_CERTREQTEMPLATE 197 +#define CMP_R_GENERATE_CRLSTATUS 198 +#define CMP_R_GETTING_GENP 192 +#define CMP_R_GET_ITAV 199 +#define CMP_R_INVALID_ARGS 100 +#define CMP_R_INVALID_GENP 193 +#define CMP_R_INVALID_KEYSPEC 202 +#define CMP_R_INVALID_OPTION 174 +#define CMP_R_INVALID_ROOTCAKEYUPDATE 195 +#define CMP_R_MISSING_CENTRAL_GEN_KEY 204 +#define CMP_R_MISSING_CERTID 165 +#define CMP_R_MISSING_KEY_INPUT_FOR_CREATING_PROTECTION 130 +#define CMP_R_MISSING_KEY_USAGE_DIGITALSIGNATURE 142 +#define CMP_R_MISSING_P10CSR 121 +#define CMP_R_MISSING_PBM_SECRET 166 +#define CMP_R_MISSING_PRIVATE_KEY 131 +#define CMP_R_MISSING_PRIVATE_KEY_FOR_POPO 190 +#define CMP_R_MISSING_PROTECTION 143 +#define CMP_R_MISSING_PUBLIC_KEY 183 +#define CMP_R_MISSING_REFERENCE_CERT 168 +#define CMP_R_MISSING_SECRET 178 +#define CMP_R_MISSING_SENDER_IDENTIFICATION 111 +#define CMP_R_MISSING_TRUST_ANCHOR 179 +#define CMP_R_MISSING_TRUST_STORE 144 +#define CMP_R_MULTIPLE_REQUESTS_NOT_SUPPORTED 161 +#define CMP_R_MULTIPLE_RESPONSES_NOT_SUPPORTED 170 +#define CMP_R_MULTIPLE_SAN_SOURCES 102 +#define CMP_R_NO_STDIO 194 +#define CMP_R_NO_SUITABLE_SENDER_CERT 145 +#define CMP_R_NULL_ARGUMENT 103 +#define CMP_R_PKIBODY_ERROR 146 +#define CMP_R_PKISTATUSINFO_NOT_FOUND 132 +#define CMP_R_POLLING_FAILED 172 +#define CMP_R_POTENTIALLY_INVALID_CERTIFICATE 147 +#define CMP_R_RECEIVED_ERROR 180 +#define CMP_R_RECIPNONCE_UNMATCHED 148 +#define CMP_R_REQUEST_NOT_ACCEPTED 149 +#define CMP_R_REQUEST_REJECTED_BY_SERVER 182 +#define CMP_R_SENDER_GENERALNAME_TYPE_NOT_SUPPORTED 150 +#define CMP_R_SRVCERT_DOES_NOT_VALIDATE_MSG 151 +#define CMP_R_TOTAL_TIMEOUT 184 +#define CMP_R_TRANSACTIONID_UNMATCHED 152 +#define CMP_R_TRANSFER_ERROR 159 +#define CMP_R_UNCLEAN_CTX 191 +#define CMP_R_UNEXPECTED_CENTRAL_GEN_KEY 205 +#define CMP_R_UNEXPECTED_CERTPROFILE 196 +#define CMP_R_UNEXPECTED_CRLSTATUSLIST 201 +#define CMP_R_UNEXPECTED_PKIBODY 133 +#define CMP_R_UNEXPECTED_PKISTATUS 185 +#define CMP_R_UNEXPECTED_POLLREQ 105 +#define CMP_R_UNEXPECTED_PVNO 153 +#define CMP_R_UNEXPECTED_SENDER 106 +#define CMP_R_UNKNOWN_ALGORITHM_ID 134 +#define CMP_R_UNKNOWN_CERT_TYPE 135 +#define CMP_R_UNKNOWN_CRL_ISSUER 200 +#define CMP_R_UNKNOWN_PKISTATUS 186 +#define CMP_R_UNSUPPORTED_ALGORITHM 136 +#define CMP_R_UNSUPPORTED_KEY_TYPE 137 +#define CMP_R_UNSUPPORTED_PKIBODY 101 +#define CMP_R_UNSUPPORTED_PROTECTION_ALG_DHBASEDMAC 154 +#define CMP_R_VALUE_TOO_LARGE 175 +#define CMP_R_VALUE_TOO_SMALL 177 +#define CMP_R_WRONG_ALGORITHM_OID 138 +#define CMP_R_WRONG_CERTID 189 +#define CMP_R_WRONG_CERTID_IN_RP 187 +#define CMP_R_WRONG_PBM_VALUE 155 +#define CMP_R_WRONG_RP_COMPONENT_COUNT 188 +#define CMP_R_WRONG_SERIAL_IN_RP 173 + +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cms.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cms.h new file mode 100644 index 0000000000000000000000000000000000000000..a5d068b215b43c76c255dc0263ab6df51aa0a793 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cms.h @@ -0,0 +1,524 @@ +/* + * WARNING: do not edit! + * Generated by makefile from include\openssl\cms.h.in + * + * Copyright 2008-2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* clang-format off */ + +/* clang-format on */ + +#ifndef OPENSSL_CMS_H +#define OPENSSL_CMS_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_CMS_H +#endif + +#include + +#ifndef OPENSSL_NO_CMS +#include +#include +#include +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct CMS_EnvelopedData_st CMS_EnvelopedData; +typedef struct CMS_ContentInfo_st CMS_ContentInfo; +typedef struct CMS_SignerInfo_st CMS_SignerInfo; +typedef struct CMS_SignedData_st CMS_SignedData; +typedef struct CMS_CertificateChoices CMS_CertificateChoices; +typedef struct CMS_RevocationInfoChoice_st CMS_RevocationInfoChoice; +typedef struct CMS_RecipientInfo_st CMS_RecipientInfo; +typedef struct CMS_ReceiptRequest_st CMS_ReceiptRequest; +typedef struct CMS_Receipt_st CMS_Receipt; +typedef struct CMS_RecipientEncryptedKey_st CMS_RecipientEncryptedKey; +typedef struct CMS_OtherKeyAttribute_st CMS_OtherKeyAttribute; + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(CMS_SignerInfo, CMS_SignerInfo, CMS_SignerInfo) +#define sk_CMS_SignerInfo_num(sk) OPENSSL_sk_num(ossl_check_const_CMS_SignerInfo_sk_type(sk)) +#define sk_CMS_SignerInfo_value(sk, idx) ((CMS_SignerInfo *)OPENSSL_sk_value(ossl_check_const_CMS_SignerInfo_sk_type(sk), (idx))) +#define sk_CMS_SignerInfo_new(cmp) ((STACK_OF(CMS_SignerInfo) *)OPENSSL_sk_new(ossl_check_CMS_SignerInfo_compfunc_type(cmp))) +#define sk_CMS_SignerInfo_new_null() ((STACK_OF(CMS_SignerInfo) *)OPENSSL_sk_new_null()) +#define sk_CMS_SignerInfo_new_reserve(cmp, n) ((STACK_OF(CMS_SignerInfo) *)OPENSSL_sk_new_reserve(ossl_check_CMS_SignerInfo_compfunc_type(cmp), (n))) +#define sk_CMS_SignerInfo_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CMS_SignerInfo_sk_type(sk), (n)) +#define sk_CMS_SignerInfo_free(sk) OPENSSL_sk_free(ossl_check_CMS_SignerInfo_sk_type(sk)) +#define sk_CMS_SignerInfo_zero(sk) OPENSSL_sk_zero(ossl_check_CMS_SignerInfo_sk_type(sk)) +#define sk_CMS_SignerInfo_delete(sk, i) ((CMS_SignerInfo *)OPENSSL_sk_delete(ossl_check_CMS_SignerInfo_sk_type(sk), (i))) +#define sk_CMS_SignerInfo_delete_ptr(sk, ptr) ((CMS_SignerInfo *)OPENSSL_sk_delete_ptr(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr))) +#define sk_CMS_SignerInfo_push(sk, ptr) OPENSSL_sk_push(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr)) +#define sk_CMS_SignerInfo_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr)) +#define sk_CMS_SignerInfo_pop(sk) ((CMS_SignerInfo *)OPENSSL_sk_pop(ossl_check_CMS_SignerInfo_sk_type(sk))) +#define sk_CMS_SignerInfo_shift(sk) ((CMS_SignerInfo *)OPENSSL_sk_shift(ossl_check_CMS_SignerInfo_sk_type(sk))) +#define sk_CMS_SignerInfo_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_freefunc_type(freefunc)) +#define sk_CMS_SignerInfo_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr), (idx)) +#define sk_CMS_SignerInfo_set(sk, idx, ptr) ((CMS_SignerInfo *)OPENSSL_sk_set(ossl_check_CMS_SignerInfo_sk_type(sk), (idx), ossl_check_CMS_SignerInfo_type(ptr))) +#define sk_CMS_SignerInfo_find(sk, ptr) OPENSSL_sk_find(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr)) +#define sk_CMS_SignerInfo_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr)) +#define sk_CMS_SignerInfo_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr), pnum) +#define sk_CMS_SignerInfo_sort(sk) OPENSSL_sk_sort(ossl_check_CMS_SignerInfo_sk_type(sk)) +#define sk_CMS_SignerInfo_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CMS_SignerInfo_sk_type(sk)) +#define sk_CMS_SignerInfo_dup(sk) ((STACK_OF(CMS_SignerInfo) *)OPENSSL_sk_dup(ossl_check_const_CMS_SignerInfo_sk_type(sk))) +#define sk_CMS_SignerInfo_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CMS_SignerInfo) *)OPENSSL_sk_deep_copy(ossl_check_const_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_copyfunc_type(copyfunc), ossl_check_CMS_SignerInfo_freefunc_type(freefunc))) +#define sk_CMS_SignerInfo_set_cmp_func(sk, cmp) ((sk_CMS_SignerInfo_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_compfunc_type(cmp))) +SKM_DEFINE_STACK_OF_INTERNAL(CMS_RecipientEncryptedKey, CMS_RecipientEncryptedKey, CMS_RecipientEncryptedKey) +#define sk_CMS_RecipientEncryptedKey_num(sk) OPENSSL_sk_num(ossl_check_const_CMS_RecipientEncryptedKey_sk_type(sk)) +#define sk_CMS_RecipientEncryptedKey_value(sk, idx) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_value(ossl_check_const_CMS_RecipientEncryptedKey_sk_type(sk), (idx))) +#define sk_CMS_RecipientEncryptedKey_new(cmp) ((STACK_OF(CMS_RecipientEncryptedKey) *)OPENSSL_sk_new(ossl_check_CMS_RecipientEncryptedKey_compfunc_type(cmp))) +#define sk_CMS_RecipientEncryptedKey_new_null() ((STACK_OF(CMS_RecipientEncryptedKey) *)OPENSSL_sk_new_null()) +#define sk_CMS_RecipientEncryptedKey_new_reserve(cmp, n) ((STACK_OF(CMS_RecipientEncryptedKey) *)OPENSSL_sk_new_reserve(ossl_check_CMS_RecipientEncryptedKey_compfunc_type(cmp), (n))) +#define sk_CMS_RecipientEncryptedKey_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), (n)) +#define sk_CMS_RecipientEncryptedKey_free(sk) OPENSSL_sk_free(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk)) +#define sk_CMS_RecipientEncryptedKey_zero(sk) OPENSSL_sk_zero(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk)) +#define sk_CMS_RecipientEncryptedKey_delete(sk, i) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_delete(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), (i))) +#define sk_CMS_RecipientEncryptedKey_delete_ptr(sk, ptr) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_delete_ptr(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr))) +#define sk_CMS_RecipientEncryptedKey_push(sk, ptr) OPENSSL_sk_push(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr)) +#define sk_CMS_RecipientEncryptedKey_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr)) +#define sk_CMS_RecipientEncryptedKey_pop(sk) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_pop(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk))) +#define sk_CMS_RecipientEncryptedKey_shift(sk) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_shift(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk))) +#define sk_CMS_RecipientEncryptedKey_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_freefunc_type(freefunc)) +#define sk_CMS_RecipientEncryptedKey_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr), (idx)) +#define sk_CMS_RecipientEncryptedKey_set(sk, idx, ptr) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_set(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), (idx), ossl_check_CMS_RecipientEncryptedKey_type(ptr))) +#define sk_CMS_RecipientEncryptedKey_find(sk, ptr) OPENSSL_sk_find(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr)) +#define sk_CMS_RecipientEncryptedKey_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr)) +#define sk_CMS_RecipientEncryptedKey_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr), pnum) +#define sk_CMS_RecipientEncryptedKey_sort(sk) OPENSSL_sk_sort(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk)) +#define sk_CMS_RecipientEncryptedKey_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CMS_RecipientEncryptedKey_sk_type(sk)) +#define sk_CMS_RecipientEncryptedKey_dup(sk) ((STACK_OF(CMS_RecipientEncryptedKey) *)OPENSSL_sk_dup(ossl_check_const_CMS_RecipientEncryptedKey_sk_type(sk))) +#define sk_CMS_RecipientEncryptedKey_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CMS_RecipientEncryptedKey) *)OPENSSL_sk_deep_copy(ossl_check_const_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_copyfunc_type(copyfunc), ossl_check_CMS_RecipientEncryptedKey_freefunc_type(freefunc))) +#define sk_CMS_RecipientEncryptedKey_set_cmp_func(sk, cmp) ((sk_CMS_RecipientEncryptedKey_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_compfunc_type(cmp))) +SKM_DEFINE_STACK_OF_INTERNAL(CMS_RecipientInfo, CMS_RecipientInfo, CMS_RecipientInfo) +#define sk_CMS_RecipientInfo_num(sk) OPENSSL_sk_num(ossl_check_const_CMS_RecipientInfo_sk_type(sk)) +#define sk_CMS_RecipientInfo_value(sk, idx) ((CMS_RecipientInfo *)OPENSSL_sk_value(ossl_check_const_CMS_RecipientInfo_sk_type(sk), (idx))) +#define sk_CMS_RecipientInfo_new(cmp) ((STACK_OF(CMS_RecipientInfo) *)OPENSSL_sk_new(ossl_check_CMS_RecipientInfo_compfunc_type(cmp))) +#define sk_CMS_RecipientInfo_new_null() ((STACK_OF(CMS_RecipientInfo) *)OPENSSL_sk_new_null()) +#define sk_CMS_RecipientInfo_new_reserve(cmp, n) ((STACK_OF(CMS_RecipientInfo) *)OPENSSL_sk_new_reserve(ossl_check_CMS_RecipientInfo_compfunc_type(cmp), (n))) +#define sk_CMS_RecipientInfo_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CMS_RecipientInfo_sk_type(sk), (n)) +#define sk_CMS_RecipientInfo_free(sk) OPENSSL_sk_free(ossl_check_CMS_RecipientInfo_sk_type(sk)) +#define sk_CMS_RecipientInfo_zero(sk) OPENSSL_sk_zero(ossl_check_CMS_RecipientInfo_sk_type(sk)) +#define sk_CMS_RecipientInfo_delete(sk, i) ((CMS_RecipientInfo *)OPENSSL_sk_delete(ossl_check_CMS_RecipientInfo_sk_type(sk), (i))) +#define sk_CMS_RecipientInfo_delete_ptr(sk, ptr) ((CMS_RecipientInfo *)OPENSSL_sk_delete_ptr(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr))) +#define sk_CMS_RecipientInfo_push(sk, ptr) OPENSSL_sk_push(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr)) +#define sk_CMS_RecipientInfo_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr)) +#define sk_CMS_RecipientInfo_pop(sk) ((CMS_RecipientInfo *)OPENSSL_sk_pop(ossl_check_CMS_RecipientInfo_sk_type(sk))) +#define sk_CMS_RecipientInfo_shift(sk) ((CMS_RecipientInfo *)OPENSSL_sk_shift(ossl_check_CMS_RecipientInfo_sk_type(sk))) +#define sk_CMS_RecipientInfo_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_freefunc_type(freefunc)) +#define sk_CMS_RecipientInfo_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr), (idx)) +#define sk_CMS_RecipientInfo_set(sk, idx, ptr) ((CMS_RecipientInfo *)OPENSSL_sk_set(ossl_check_CMS_RecipientInfo_sk_type(sk), (idx), ossl_check_CMS_RecipientInfo_type(ptr))) +#define sk_CMS_RecipientInfo_find(sk, ptr) OPENSSL_sk_find(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr)) +#define sk_CMS_RecipientInfo_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr)) +#define sk_CMS_RecipientInfo_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr), pnum) +#define sk_CMS_RecipientInfo_sort(sk) OPENSSL_sk_sort(ossl_check_CMS_RecipientInfo_sk_type(sk)) +#define sk_CMS_RecipientInfo_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CMS_RecipientInfo_sk_type(sk)) +#define sk_CMS_RecipientInfo_dup(sk) ((STACK_OF(CMS_RecipientInfo) *)OPENSSL_sk_dup(ossl_check_const_CMS_RecipientInfo_sk_type(sk))) +#define sk_CMS_RecipientInfo_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CMS_RecipientInfo) *)OPENSSL_sk_deep_copy(ossl_check_const_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_copyfunc_type(copyfunc), ossl_check_CMS_RecipientInfo_freefunc_type(freefunc))) +#define sk_CMS_RecipientInfo_set_cmp_func(sk, cmp) ((sk_CMS_RecipientInfo_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_compfunc_type(cmp))) +SKM_DEFINE_STACK_OF_INTERNAL(CMS_RevocationInfoChoice, CMS_RevocationInfoChoice, CMS_RevocationInfoChoice) +#define sk_CMS_RevocationInfoChoice_num(sk) OPENSSL_sk_num(ossl_check_const_CMS_RevocationInfoChoice_sk_type(sk)) +#define sk_CMS_RevocationInfoChoice_value(sk, idx) ((CMS_RevocationInfoChoice *)OPENSSL_sk_value(ossl_check_const_CMS_RevocationInfoChoice_sk_type(sk), (idx))) +#define sk_CMS_RevocationInfoChoice_new(cmp) ((STACK_OF(CMS_RevocationInfoChoice) *)OPENSSL_sk_new(ossl_check_CMS_RevocationInfoChoice_compfunc_type(cmp))) +#define sk_CMS_RevocationInfoChoice_new_null() ((STACK_OF(CMS_RevocationInfoChoice) *)OPENSSL_sk_new_null()) +#define sk_CMS_RevocationInfoChoice_new_reserve(cmp, n) ((STACK_OF(CMS_RevocationInfoChoice) *)OPENSSL_sk_new_reserve(ossl_check_CMS_RevocationInfoChoice_compfunc_type(cmp), (n))) +#define sk_CMS_RevocationInfoChoice_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), (n)) +#define sk_CMS_RevocationInfoChoice_free(sk) OPENSSL_sk_free(ossl_check_CMS_RevocationInfoChoice_sk_type(sk)) +#define sk_CMS_RevocationInfoChoice_zero(sk) OPENSSL_sk_zero(ossl_check_CMS_RevocationInfoChoice_sk_type(sk)) +#define sk_CMS_RevocationInfoChoice_delete(sk, i) ((CMS_RevocationInfoChoice *)OPENSSL_sk_delete(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), (i))) +#define sk_CMS_RevocationInfoChoice_delete_ptr(sk, ptr) ((CMS_RevocationInfoChoice *)OPENSSL_sk_delete_ptr(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr))) +#define sk_CMS_RevocationInfoChoice_push(sk, ptr) OPENSSL_sk_push(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr)) +#define sk_CMS_RevocationInfoChoice_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr)) +#define sk_CMS_RevocationInfoChoice_pop(sk) ((CMS_RevocationInfoChoice *)OPENSSL_sk_pop(ossl_check_CMS_RevocationInfoChoice_sk_type(sk))) +#define sk_CMS_RevocationInfoChoice_shift(sk) ((CMS_RevocationInfoChoice *)OPENSSL_sk_shift(ossl_check_CMS_RevocationInfoChoice_sk_type(sk))) +#define sk_CMS_RevocationInfoChoice_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_freefunc_type(freefunc)) +#define sk_CMS_RevocationInfoChoice_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr), (idx)) +#define sk_CMS_RevocationInfoChoice_set(sk, idx, ptr) ((CMS_RevocationInfoChoice *)OPENSSL_sk_set(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), (idx), ossl_check_CMS_RevocationInfoChoice_type(ptr))) +#define sk_CMS_RevocationInfoChoice_find(sk, ptr) OPENSSL_sk_find(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr)) +#define sk_CMS_RevocationInfoChoice_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr)) +#define sk_CMS_RevocationInfoChoice_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr), pnum) +#define sk_CMS_RevocationInfoChoice_sort(sk) OPENSSL_sk_sort(ossl_check_CMS_RevocationInfoChoice_sk_type(sk)) +#define sk_CMS_RevocationInfoChoice_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CMS_RevocationInfoChoice_sk_type(sk)) +#define sk_CMS_RevocationInfoChoice_dup(sk) ((STACK_OF(CMS_RevocationInfoChoice) *)OPENSSL_sk_dup(ossl_check_const_CMS_RevocationInfoChoice_sk_type(sk))) +#define sk_CMS_RevocationInfoChoice_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CMS_RevocationInfoChoice) *)OPENSSL_sk_deep_copy(ossl_check_const_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_copyfunc_type(copyfunc), ossl_check_CMS_RevocationInfoChoice_freefunc_type(freefunc))) +#define sk_CMS_RevocationInfoChoice_set_cmp_func(sk, cmp) ((sk_CMS_RevocationInfoChoice_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_compfunc_type(cmp))) + +/* clang-format on */ + +DECLARE_ASN1_ITEM(CMS_EnvelopedData) +DECLARE_ASN1_ALLOC_FUNCTIONS(CMS_SignedData) +DECLARE_ASN1_FUNCTIONS(CMS_ContentInfo) +DECLARE_ASN1_FUNCTIONS(CMS_ReceiptRequest) +DECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo) + +DECLARE_ASN1_DUP_FUNCTION(CMS_EnvelopedData) + +CMS_ContentInfo *CMS_ContentInfo_new_ex(OSSL_LIB_CTX *libctx, const char *propq); + +#define CMS_SIGNERINFO_ISSUER_SERIAL 0 +#define CMS_SIGNERINFO_KEYIDENTIFIER 1 + +#define CMS_RECIPINFO_NONE -1 +#define CMS_RECIPINFO_TRANS 0 +#define CMS_RECIPINFO_AGREE 1 +#define CMS_RECIPINFO_KEK 2 +#define CMS_RECIPINFO_PASS 3 +#define CMS_RECIPINFO_OTHER 4 +#define CMS_RECIPINFO_KEM 5 + +/* S/MIME related flags */ + +#define CMS_TEXT 0x1 +#define CMS_NOCERTS 0x2 +#define CMS_NO_CONTENT_VERIFY 0x4 +#define CMS_NO_ATTR_VERIFY 0x8 +#define CMS_NOSIGS \ + (CMS_NO_CONTENT_VERIFY | CMS_NO_ATTR_VERIFY) +#define CMS_NOINTERN 0x10 +#define CMS_NO_SIGNER_CERT_VERIFY 0x20 +#define CMS_NOVERIFY 0x20 +#define CMS_DETACHED 0x40 +#define CMS_BINARY 0x80 +#define CMS_NOATTR 0x100 +#define CMS_NOSMIMECAP 0x200 +#define CMS_NOOLDMIMETYPE 0x400 +#define CMS_CRLFEOL 0x800 +#define CMS_STREAM 0x1000 +#define CMS_NOCRL 0x2000 +#define CMS_PARTIAL 0x4000 +#define CMS_REUSE_DIGEST 0x8000 +#define CMS_USE_KEYID 0x10000 +#define CMS_DEBUG_DECRYPT 0x20000 +#define CMS_KEY_PARAM 0x40000 +#define CMS_ASCIICRLF 0x80000 +#define CMS_CADES 0x100000 +#define CMS_USE_ORIGINATOR_KEYID 0x200000 +#define CMS_NO_SIGNING_TIME 0x400000 + +const ASN1_OBJECT *CMS_get0_type(const CMS_ContentInfo *cms); + +BIO *CMS_dataInit(CMS_ContentInfo *cms, BIO *icont); +int CMS_dataFinal(CMS_ContentInfo *cms, BIO *bio); + +ASN1_OCTET_STRING **CMS_get0_content(CMS_ContentInfo *cms); +int CMS_is_detached(CMS_ContentInfo *cms); +int CMS_set_detached(CMS_ContentInfo *cms, int detached); + +#ifdef OPENSSL_PEM_H +DECLARE_PEM_rw(CMS, CMS_ContentInfo) +#endif +int CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms); +CMS_ContentInfo *d2i_CMS_bio(BIO *bp, CMS_ContentInfo **cms); +int i2d_CMS_bio(BIO *bp, CMS_ContentInfo *cms); + +BIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms); +int i2d_CMS_bio_stream(BIO *out, CMS_ContentInfo *cms, BIO *in, int flags); +int PEM_write_bio_CMS_stream(BIO *out, CMS_ContentInfo *cms, BIO *in, + int flags); +CMS_ContentInfo *SMIME_read_CMS(BIO *bio, BIO **bcont); +CMS_ContentInfo *SMIME_read_CMS_ex(BIO *bio, int flags, BIO **bcont, CMS_ContentInfo **ci); +int SMIME_write_CMS(BIO *bio, CMS_ContentInfo *cms, BIO *data, int flags); + +int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont, + unsigned int flags); +int CMS_final_digest(CMS_ContentInfo *cms, + const unsigned char *md, unsigned int mdlen, BIO *dcont, + unsigned int flags); + +CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey, + STACK_OF(X509) *certs, BIO *data, + unsigned int flags); +CMS_ContentInfo *CMS_sign_ex(X509 *signcert, EVP_PKEY *pkey, + STACK_OF(X509) *certs, BIO *data, + unsigned int flags, OSSL_LIB_CTX *libctx, + const char *propq); + +CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si, + X509 *signcert, EVP_PKEY *pkey, + STACK_OF(X509) *certs, unsigned int flags); + +int CMS_data(CMS_ContentInfo *cms, BIO *out, unsigned int flags); +CMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags); +CMS_ContentInfo *CMS_data_create_ex(BIO *in, unsigned int flags, + OSSL_LIB_CTX *libctx, const char *propq); + +int CMS_digest_verify(CMS_ContentInfo *cms, BIO *dcont, BIO *out, + unsigned int flags); +CMS_ContentInfo *CMS_digest_create(BIO *in, const EVP_MD *md, + unsigned int flags); +CMS_ContentInfo *CMS_digest_create_ex(BIO *in, const EVP_MD *md, + unsigned int flags, OSSL_LIB_CTX *libctx, + const char *propq); + +int CMS_EncryptedData_decrypt(CMS_ContentInfo *cms, + const unsigned char *key, size_t keylen, + BIO *dcont, BIO *out, unsigned int flags); +CMS_ContentInfo *CMS_EncryptedData_encrypt(BIO *in, const EVP_CIPHER *cipher, + const unsigned char *key, + size_t keylen, unsigned int flags); +CMS_ContentInfo *CMS_EncryptedData_encrypt_ex(BIO *in, const EVP_CIPHER *cipher, + const unsigned char *key, + size_t keylen, unsigned int flags, + OSSL_LIB_CTX *libctx, + const char *propq); + +int CMS_EncryptedData_set1_key(CMS_ContentInfo *cms, const EVP_CIPHER *ciph, + const unsigned char *key, size_t keylen); + +int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs, + X509_STORE *store, BIO *dcont, BIO *out, unsigned int flags); + +int CMS_verify_receipt(CMS_ContentInfo *rcms, CMS_ContentInfo *ocms, + STACK_OF(X509) *certs, + X509_STORE *store, unsigned int flags); + +STACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms); + +CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *in, + const EVP_CIPHER *cipher, unsigned int flags); +CMS_ContentInfo *CMS_encrypt_ex(STACK_OF(X509) *certs, BIO *in, + const EVP_CIPHER *cipher, unsigned int flags, + OSSL_LIB_CTX *libctx, const char *propq); + +int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pkey, X509 *cert, + BIO *dcont, BIO *out, unsigned int flags); + +int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert); +int CMS_decrypt_set1_pkey_and_peer(CMS_ContentInfo *cms, EVP_PKEY *pk, + X509 *cert, X509 *peer); +int CMS_decrypt_set1_key(CMS_ContentInfo *cms, + unsigned char *key, size_t keylen, + const unsigned char *id, size_t idlen); +int CMS_decrypt_set1_password(CMS_ContentInfo *cms, + unsigned char *pass, ossl_ssize_t passlen); + +STACK_OF(CMS_RecipientInfo) *CMS_get0_RecipientInfos(CMS_ContentInfo *cms); +int CMS_RecipientInfo_type(CMS_RecipientInfo *ri); +EVP_PKEY_CTX *CMS_RecipientInfo_get0_pkey_ctx(CMS_RecipientInfo *ri); +CMS_ContentInfo *CMS_AuthEnvelopedData_create(const EVP_CIPHER *cipher); +CMS_ContentInfo * +CMS_AuthEnvelopedData_create_ex(const EVP_CIPHER *cipher, OSSL_LIB_CTX *libctx, + const char *propq); +CMS_ContentInfo *CMS_EnvelopedData_create(const EVP_CIPHER *cipher); +CMS_ContentInfo *CMS_EnvelopedData_create_ex(const EVP_CIPHER *cipher, + OSSL_LIB_CTX *libctx, + const char *propq); +BIO *CMS_EnvelopedData_decrypt(CMS_EnvelopedData *env, BIO *detached_data, + EVP_PKEY *pkey, X509 *cert, + ASN1_OCTET_STRING *secret, unsigned int flags, + OSSL_LIB_CTX *libctx, const char *propq); + +CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms, + X509 *recip, unsigned int flags); +CMS_RecipientInfo *CMS_add1_recipient(CMS_ContentInfo *cms, X509 *recip, + EVP_PKEY *originatorPrivKey, X509 *originator, unsigned int flags); +int CMS_RecipientInfo_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pkey); +int CMS_RecipientInfo_ktri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert); +int CMS_RecipientInfo_ktri_get0_algs(CMS_RecipientInfo *ri, + EVP_PKEY **pk, X509 **recip, + X509_ALGOR **palg); +int CMS_RecipientInfo_ktri_get0_signer_id(CMS_RecipientInfo *ri, + ASN1_OCTET_STRING **keyid, + X509_NAME **issuer, + ASN1_INTEGER **sno); + +CMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid, + unsigned char *key, size_t keylen, + unsigned char *id, size_t idlen, + ASN1_GENERALIZEDTIME *date, + ASN1_OBJECT *otherTypeId, + ASN1_TYPE *otherType); + +int CMS_RecipientInfo_kekri_get0_id(CMS_RecipientInfo *ri, + X509_ALGOR **palg, + ASN1_OCTET_STRING **pid, + ASN1_GENERALIZEDTIME **pdate, + ASN1_OBJECT **potherid, + ASN1_TYPE **pothertype); + +int CMS_RecipientInfo_set0_key(CMS_RecipientInfo *ri, + unsigned char *key, size_t keylen); + +int CMS_RecipientInfo_kekri_id_cmp(CMS_RecipientInfo *ri, + const unsigned char *id, size_t idlen); + +int CMS_RecipientInfo_set0_password(CMS_RecipientInfo *ri, + unsigned char *pass, + ossl_ssize_t passlen); + +CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms, + int iter, int wrap_nid, + int pbe_nid, + unsigned char *pass, + ossl_ssize_t passlen, + const EVP_CIPHER *kekciph); + +int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri); +int CMS_RecipientInfo_encrypt(const CMS_ContentInfo *cms, CMS_RecipientInfo *ri); + +int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out, + unsigned int flags); +CMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags); + +int CMS_set1_eContentType(CMS_ContentInfo *cms, const ASN1_OBJECT *oid); +const ASN1_OBJECT *CMS_get0_eContentType(CMS_ContentInfo *cms); + +CMS_CertificateChoices *CMS_add0_CertificateChoices(CMS_ContentInfo *cms); +int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert); +int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert); +STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms); + +CMS_RevocationInfoChoice *CMS_add0_RevocationInfoChoice(CMS_ContentInfo *cms); +int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl); +int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl); +STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms); + +int CMS_SignedData_init(CMS_ContentInfo *cms); +CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms, + X509 *signer, EVP_PKEY *pk, const EVP_MD *md, + unsigned int flags); +EVP_PKEY_CTX *CMS_SignerInfo_get0_pkey_ctx(CMS_SignerInfo *si); +EVP_MD_CTX *CMS_SignerInfo_get0_md_ctx(CMS_SignerInfo *si); +STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms); + +void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer); +int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si, + ASN1_OCTET_STRING **keyid, + X509_NAME **issuer, ASN1_INTEGER **sno); +int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert); +int CMS_set1_signers_certs(CMS_ContentInfo *cms, STACK_OF(X509) *certs, + unsigned int flags); +void CMS_SignerInfo_get0_algs(CMS_SignerInfo *si, EVP_PKEY **pk, + X509 **signer, X509_ALGOR **pdig, + X509_ALGOR **psig); +ASN1_OCTET_STRING *CMS_SignerInfo_get0_signature(CMS_SignerInfo *si); +int CMS_SignerInfo_sign(CMS_SignerInfo *si); +int CMS_SignerInfo_verify(CMS_SignerInfo *si); +int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain); +BIO *CMS_SignedData_verify(CMS_SignedData *sd, BIO *detached_data, + STACK_OF(X509) *scerts, X509_STORE *store, + STACK_OF(X509) *extra, STACK_OF(X509_CRL) *crls, + unsigned int flags, + OSSL_LIB_CTX *libctx, const char *propq); + +int CMS_add_smimecap(CMS_SignerInfo *si, STACK_OF(X509_ALGOR) *algs); +int CMS_add_simple_smimecap(STACK_OF(X509_ALGOR) **algs, + int algnid, int keysize); +int CMS_add_standard_smimecap(STACK_OF(X509_ALGOR) **smcap); + +int CMS_signed_get_attr_count(const CMS_SignerInfo *si); +int CMS_signed_get_attr_by_NID(const CMS_SignerInfo *si, int nid, + int lastpos); +int CMS_signed_get_attr_by_OBJ(const CMS_SignerInfo *si, const ASN1_OBJECT *obj, + int lastpos); +X509_ATTRIBUTE *CMS_signed_get_attr(const CMS_SignerInfo *si, int loc); +X509_ATTRIBUTE *CMS_signed_delete_attr(CMS_SignerInfo *si, int loc); +int CMS_signed_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr); +int CMS_signed_add1_attr_by_OBJ(CMS_SignerInfo *si, + const ASN1_OBJECT *obj, int type, + const void *bytes, int len); +int CMS_signed_add1_attr_by_NID(CMS_SignerInfo *si, + int nid, int type, + const void *bytes, int len); +int CMS_signed_add1_attr_by_txt(CMS_SignerInfo *si, + const char *attrname, int type, + const void *bytes, int len); +void *CMS_signed_get0_data_by_OBJ(const CMS_SignerInfo *si, + const ASN1_OBJECT *oid, + int lastpos, int type); + +int CMS_unsigned_get_attr_count(const CMS_SignerInfo *si); +int CMS_unsigned_get_attr_by_NID(const CMS_SignerInfo *si, int nid, + int lastpos); +int CMS_unsigned_get_attr_by_OBJ(const CMS_SignerInfo *si, + const ASN1_OBJECT *obj, int lastpos); +X509_ATTRIBUTE *CMS_unsigned_get_attr(const CMS_SignerInfo *si, int loc); +X509_ATTRIBUTE *CMS_unsigned_delete_attr(CMS_SignerInfo *si, int loc); +int CMS_unsigned_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr); +int CMS_unsigned_add1_attr_by_OBJ(CMS_SignerInfo *si, + const ASN1_OBJECT *obj, int type, + const void *bytes, int len); +int CMS_unsigned_add1_attr_by_NID(CMS_SignerInfo *si, + int nid, int type, + const void *bytes, int len); +int CMS_unsigned_add1_attr_by_txt(CMS_SignerInfo *si, + const char *attrname, int type, + const void *bytes, int len); +void *CMS_unsigned_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid, + int lastpos, int type); + +int CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr); +CMS_ReceiptRequest *CMS_ReceiptRequest_create0( + unsigned char *id, int idlen, int allorfirst, + STACK_OF(GENERAL_NAMES) *receiptList, + STACK_OF(GENERAL_NAMES) *receiptsTo); +CMS_ReceiptRequest *CMS_ReceiptRequest_create0_ex( + unsigned char *id, int idlen, int allorfirst, + STACK_OF(GENERAL_NAMES) *receiptList, + STACK_OF(GENERAL_NAMES) *receiptsTo, + OSSL_LIB_CTX *libctx); + +int CMS_add1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest *rr); +void CMS_ReceiptRequest_get0_values(CMS_ReceiptRequest *rr, + ASN1_STRING **pcid, + int *pallorfirst, + STACK_OF(GENERAL_NAMES) **plist, + STACK_OF(GENERAL_NAMES) **prto); +int CMS_RecipientInfo_kari_get0_alg(CMS_RecipientInfo *ri, + X509_ALGOR **palg, + ASN1_OCTET_STRING **pukm); +STACK_OF(CMS_RecipientEncryptedKey) +*CMS_RecipientInfo_kari_get0_reks(CMS_RecipientInfo *ri); + +int CMS_RecipientInfo_kari_get0_orig_id(CMS_RecipientInfo *ri, + X509_ALGOR **pubalg, + ASN1_BIT_STRING **pubkey, + ASN1_OCTET_STRING **keyid, + X509_NAME **issuer, + ASN1_INTEGER **sno); + +int CMS_RecipientInfo_kari_orig_id_cmp(CMS_RecipientInfo *ri, X509 *cert); + +int CMS_RecipientEncryptedKey_get0_id(CMS_RecipientEncryptedKey *rek, + ASN1_OCTET_STRING **keyid, + ASN1_GENERALIZEDTIME **tm, + CMS_OtherKeyAttribute **other, + X509_NAME **issuer, ASN1_INTEGER **sno); +int CMS_RecipientEncryptedKey_cert_cmp(CMS_RecipientEncryptedKey *rek, + X509 *cert); +int CMS_RecipientInfo_kari_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk); +int CMS_RecipientInfo_kari_set0_pkey_and_peer(CMS_RecipientInfo *ri, EVP_PKEY *pk, X509 *peer); +EVP_CIPHER_CTX *CMS_RecipientInfo_kari_get0_ctx(CMS_RecipientInfo *ri); +int CMS_RecipientInfo_kari_decrypt(CMS_ContentInfo *cms, + CMS_RecipientInfo *ri, + CMS_RecipientEncryptedKey *rek); + +int CMS_SharedInfo_encode(unsigned char **pder, X509_ALGOR *kekalg, + ASN1_OCTET_STRING *ukm, int keylen); + +int CMS_RecipientInfo_kemri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert); +int CMS_RecipientInfo_kemri_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk); +EVP_CIPHER_CTX *CMS_RecipientInfo_kemri_get0_ctx(CMS_RecipientInfo *ri); +X509_ALGOR *CMS_RecipientInfo_kemri_get0_kdf_alg(CMS_RecipientInfo *ri); +int CMS_RecipientInfo_kemri_set_ukm(CMS_RecipientInfo *ri, + const unsigned char *ukm, + int ukmLength); + +/* Backward compatibility for spelling errors. */ +#define CMS_R_UNKNOWN_DIGEST_ALGORITM CMS_R_UNKNOWN_DIGEST_ALGORITHM +#define CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE \ + CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE + +#ifdef __cplusplus +} +#endif +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cmserr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cmserr.h new file mode 100644 index 0000000000000000000000000000000000000000..49c22c2bddb49e40486f936b841fb885d19f0cf0 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cmserr.h @@ -0,0 +1,128 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_CMSERR_H +#define OPENSSL_CMSERR_H +#pragma once + +#include +#include +#include + +#ifndef OPENSSL_NO_CMS + +/* + * CMS reason codes. + */ +#define CMS_R_ADD_SIGNER_ERROR 99 +#define CMS_R_ATTRIBUTE_ERROR 161 +#define CMS_R_CERTIFICATE_ALREADY_PRESENT 175 +#define CMS_R_CERTIFICATE_HAS_NO_KEYID 160 +#define CMS_R_CERTIFICATE_VERIFY_ERROR 100 +#define CMS_R_CIPHER_AEAD_IN_ENVELOPED_DATA 200 +#define CMS_R_CIPHER_AEAD_SET_TAG_ERROR 184 +#define CMS_R_CIPHER_GET_TAG 185 +#define CMS_R_CIPHER_INITIALISATION_ERROR 101 +#define CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR 102 +#define CMS_R_CMS_DATAFINAL_ERROR 103 +#define CMS_R_CMS_LIB 104 +#define CMS_R_CONTENTIDENTIFIER_MISMATCH 170 +#define CMS_R_CONTENT_NOT_FOUND 105 +#define CMS_R_CONTENT_TYPE_MISMATCH 171 +#define CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA 106 +#define CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA 107 +#define CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA 108 +#define CMS_R_CONTENT_VERIFY_ERROR 109 +#define CMS_R_CTRL_ERROR 110 +#define CMS_R_CTRL_FAILURE 111 +#define CMS_R_DECODE_ERROR 187 +#define CMS_R_DECRYPT_ERROR 112 +#define CMS_R_ERROR_GETTING_PUBLIC_KEY 113 +#define CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE 114 +#define CMS_R_ERROR_SETTING_KEY 115 +#define CMS_R_ERROR_SETTING_RECIPIENTINFO 116 +#define CMS_R_ERROR_UNSUPPORTED_STATIC_KEY_AGREEMENT 196 +#define CMS_R_ESS_SIGNING_CERTID_MISMATCH_ERROR 183 +#define CMS_R_INVALID_ENCRYPTED_KEY_LENGTH 117 +#define CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER 176 +#define CMS_R_INVALID_KEY_LENGTH 118 +#define CMS_R_INVALID_LABEL 190 +#define CMS_R_INVALID_OAEP_PARAMETERS 191 +#define CMS_R_KDF_PARAMETER_ERROR 186 +#define CMS_R_MD_BIO_INIT_ERROR 119 +#define CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH 120 +#define CMS_R_MESSAGEDIGEST_WRONG_LENGTH 121 +#define CMS_R_MSGSIGDIGEST_ERROR 172 +#define CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE 162 +#define CMS_R_MSGSIGDIGEST_WRONG_LENGTH 163 +#define CMS_R_NEED_ONE_SIGNER 164 +#define CMS_R_NOT_A_SIGNED_RECEIPT 165 +#define CMS_R_NOT_ENCRYPTED_DATA 122 +#define CMS_R_NOT_KEK 123 +#define CMS_R_NOT_KEM 197 +#define CMS_R_NOT_KEY_AGREEMENT 181 +#define CMS_R_NOT_KEY_TRANSPORT 124 +#define CMS_R_NOT_PWRI 177 +#define CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 125 +#define CMS_R_NO_CIPHER 126 +#define CMS_R_NO_CONTENT 127 +#define CMS_R_NO_CONTENT_TYPE 173 +#define CMS_R_NO_DEFAULT_DIGEST 128 +#define CMS_R_NO_DIGEST_SET 129 +#define CMS_R_NO_KEY 130 +#define CMS_R_NO_KEY_OR_CERT 174 +#define CMS_R_NO_MATCHING_DIGEST 131 +#define CMS_R_NO_MATCHING_RECIPIENT 132 +#define CMS_R_NO_MATCHING_SIGNATURE 166 +#define CMS_R_NO_MSGSIGDIGEST 167 +#define CMS_R_NO_PASSWORD 178 +#define CMS_R_NO_PRIVATE_KEY 133 +#define CMS_R_NO_PUBLIC_KEY 134 +#define CMS_R_NO_RECEIPT_REQUEST 168 +#define CMS_R_NO_SIGNERS 135 +#define CMS_R_OPERATION_UNSUPPORTED 182 +#define CMS_R_PEER_KEY_ERROR 188 +#define CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 136 +#define CMS_R_RECEIPT_DECODE_ERROR 169 +#define CMS_R_RECIPIENT_ERROR 137 +#define CMS_R_SHARED_INFO_ERROR 189 +#define CMS_R_SIGNER_CERTIFICATE_NOT_FOUND 138 +#define CMS_R_SIGNFINAL_ERROR 139 +#define CMS_R_SMIME_TEXT_ERROR 140 +#define CMS_R_STORE_INIT_ERROR 141 +#define CMS_R_TYPE_NOT_COMPRESSED_DATA 142 +#define CMS_R_TYPE_NOT_DATA 143 +#define CMS_R_TYPE_NOT_DIGESTED_DATA 144 +#define CMS_R_TYPE_NOT_ENCRYPTED_DATA 145 +#define CMS_R_TYPE_NOT_ENVELOPED_DATA 146 +#define CMS_R_UNABLE_TO_FINALIZE_CONTEXT 147 +#define CMS_R_UNKNOWN_CIPHER 148 +#define CMS_R_UNKNOWN_DIGEST_ALGORITHM 149 +#define CMS_R_UNKNOWN_ID 150 +#define CMS_R_UNKNOWN_KDF_ALGORITHM 198 +#define CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM 151 +#define CMS_R_UNSUPPORTED_CONTENT_ENCRYPTION_ALGORITHM 194 +#define CMS_R_UNSUPPORTED_CONTENT_TYPE 152 +#define CMS_R_UNSUPPORTED_ENCRYPTION_TYPE 192 +#define CMS_R_UNSUPPORTED_KDF_ALGORITHM 199 +#define CMS_R_UNSUPPORTED_KEK_ALGORITHM 153 +#define CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM 179 +#define CMS_R_UNSUPPORTED_LABEL_SOURCE 193 +#define CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE 155 +#define CMS_R_UNSUPPORTED_RECIPIENT_TYPE 154 +#define CMS_R_UNSUPPORTED_SIGNATURE_ALGORITHM 195 +#define CMS_R_UNSUPPORTED_TYPE 156 +#define CMS_R_UNWRAP_ERROR 157 +#define CMS_R_UNWRAP_FAILURE 180 +#define CMS_R_VERIFICATION_FAILURE 158 +#define CMS_R_WRAP_ERROR 159 + +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/comp.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/comp.h new file mode 100644 index 0000000000000000000000000000000000000000..9094dec0c427be4b344078c8b3338637201dcad4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/comp.h @@ -0,0 +1,101 @@ +/* + * Copyright 2015-2024 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* clang-format off */ + +/* clang-format on */ + +#ifndef OPENSSL_COMP_H +#define OPENSSL_COMP_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_COMP_H +#endif + +#include + +#include +#include +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef OPENSSL_NO_COMP + +COMP_CTX *COMP_CTX_new(COMP_METHOD *meth); +const COMP_METHOD *COMP_CTX_get_method(const COMP_CTX *ctx); +int COMP_CTX_get_type(const COMP_CTX *comp); +int COMP_get_type(const COMP_METHOD *meth); +const char *COMP_get_name(const COMP_METHOD *meth); +void COMP_CTX_free(COMP_CTX *ctx); + +int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, + unsigned char *in, int ilen); +int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen, + unsigned char *in, int ilen); + +COMP_METHOD *COMP_zlib(void); +COMP_METHOD *COMP_zlib_oneshot(void); +COMP_METHOD *COMP_brotli(void); +COMP_METHOD *COMP_brotli_oneshot(void); +COMP_METHOD *COMP_zstd(void); +COMP_METHOD *COMP_zstd_oneshot(void); + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define COMP_zlib_cleanup() \ + while (0) \ + continue +#endif + +#ifdef OPENSSL_BIO_H +const BIO_METHOD *BIO_f_zlib(void); +const BIO_METHOD *BIO_f_brotli(void); +const BIO_METHOD *BIO_f_zstd(void); +#endif + +#endif + +typedef struct ssl_comp_st SSL_COMP; + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(SSL_COMP, SSL_COMP, SSL_COMP) +#define sk_SSL_COMP_num(sk) OPENSSL_sk_num(ossl_check_const_SSL_COMP_sk_type(sk)) +#define sk_SSL_COMP_value(sk, idx) ((SSL_COMP *)OPENSSL_sk_value(ossl_check_const_SSL_COMP_sk_type(sk), (idx))) +#define sk_SSL_COMP_new(cmp) ((STACK_OF(SSL_COMP) *)OPENSSL_sk_new(ossl_check_SSL_COMP_compfunc_type(cmp))) +#define sk_SSL_COMP_new_null() ((STACK_OF(SSL_COMP) *)OPENSSL_sk_new_null()) +#define sk_SSL_COMP_new_reserve(cmp, n) ((STACK_OF(SSL_COMP) *)OPENSSL_sk_new_reserve(ossl_check_SSL_COMP_compfunc_type(cmp), (n))) +#define sk_SSL_COMP_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_SSL_COMP_sk_type(sk), (n)) +#define sk_SSL_COMP_free(sk) OPENSSL_sk_free(ossl_check_SSL_COMP_sk_type(sk)) +#define sk_SSL_COMP_zero(sk) OPENSSL_sk_zero(ossl_check_SSL_COMP_sk_type(sk)) +#define sk_SSL_COMP_delete(sk, i) ((SSL_COMP *)OPENSSL_sk_delete(ossl_check_SSL_COMP_sk_type(sk), (i))) +#define sk_SSL_COMP_delete_ptr(sk, ptr) ((SSL_COMP *)OPENSSL_sk_delete_ptr(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr))) +#define sk_SSL_COMP_push(sk, ptr) OPENSSL_sk_push(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr)) +#define sk_SSL_COMP_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr)) +#define sk_SSL_COMP_pop(sk) ((SSL_COMP *)OPENSSL_sk_pop(ossl_check_SSL_COMP_sk_type(sk))) +#define sk_SSL_COMP_shift(sk) ((SSL_COMP *)OPENSSL_sk_shift(ossl_check_SSL_COMP_sk_type(sk))) +#define sk_SSL_COMP_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_freefunc_type(freefunc)) +#define sk_SSL_COMP_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr), (idx)) +#define sk_SSL_COMP_set(sk, idx, ptr) ((SSL_COMP *)OPENSSL_sk_set(ossl_check_SSL_COMP_sk_type(sk), (idx), ossl_check_SSL_COMP_type(ptr))) +#define sk_SSL_COMP_find(sk, ptr) OPENSSL_sk_find(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr)) +#define sk_SSL_COMP_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr)) +#define sk_SSL_COMP_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr), pnum) +#define sk_SSL_COMP_sort(sk) OPENSSL_sk_sort(ossl_check_SSL_COMP_sk_type(sk)) +#define sk_SSL_COMP_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_SSL_COMP_sk_type(sk)) +#define sk_SSL_COMP_dup(sk) ((STACK_OF(SSL_COMP) *)OPENSSL_sk_dup(ossl_check_const_SSL_COMP_sk_type(sk))) +#define sk_SSL_COMP_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(SSL_COMP) *)OPENSSL_sk_deep_copy(ossl_check_const_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_copyfunc_type(copyfunc), ossl_check_SSL_COMP_freefunc_type(freefunc))) +#define sk_SSL_COMP_set_cmp_func(sk, cmp) ((sk_SSL_COMP_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_compfunc_type(cmp))) + +/* clang-format on */ + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/comperr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/comperr.h new file mode 100644 index 0000000000000000000000000000000000000000..90ec7c1144be7636ff9743b87aaa6c50dce258c9 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/comperr.h @@ -0,0 +1,36 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_COMPERR_H +#define OPENSSL_COMPERR_H +#pragma once + +#include +#include +#include + +#ifndef OPENSSL_NO_COMP + +/* + * COMP reason codes. + */ +#define COMP_R_BROTLI_DECODE_ERROR 102 +#define COMP_R_BROTLI_ENCODE_ERROR 103 +#define COMP_R_BROTLI_NOT_SUPPORTED 104 +#define COMP_R_ZLIB_DEFLATE_ERROR 99 +#define COMP_R_ZLIB_INFLATE_ERROR 100 +#define COMP_R_ZLIB_NOT_SUPPORTED 101 +#define COMP_R_ZSTD_COMPRESS_ERROR 105 +#define COMP_R_ZSTD_DECODE_ERROR 106 +#define COMP_R_ZSTD_DECOMPRESS_ERROR 107 +#define COMP_R_ZSTD_NOT_SUPPORTED 108 + +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/conf.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/conf.h new file mode 100644 index 0000000000000000000000000000000000000000..c1f4a087edae3b47e256aa611622455b86d65bd4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/conf.h @@ -0,0 +1,219 @@ +/* + * WARNING: do not edit! + * Generated by makefile from include\openssl\conf.h.in + * + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* clang-format off */ + +/* clang-format on */ + +#ifndef OPENSSL_CONF_H +#define OPENSSL_CONF_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_CONF_H +#endif + +#include +#include +#include +#include +#include +#include +#ifndef OPENSSL_NO_STDIO +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + char *section; + char *name; + char *value; +} CONF_VALUE; + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(CONF_VALUE, CONF_VALUE, CONF_VALUE) +#define sk_CONF_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_CONF_VALUE_sk_type(sk)) +#define sk_CONF_VALUE_value(sk, idx) ((CONF_VALUE *)OPENSSL_sk_value(ossl_check_const_CONF_VALUE_sk_type(sk), (idx))) +#define sk_CONF_VALUE_new(cmp) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_new(ossl_check_CONF_VALUE_compfunc_type(cmp))) +#define sk_CONF_VALUE_new_null() ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_new_null()) +#define sk_CONF_VALUE_new_reserve(cmp, n) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_new_reserve(ossl_check_CONF_VALUE_compfunc_type(cmp), (n))) +#define sk_CONF_VALUE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CONF_VALUE_sk_type(sk), (n)) +#define sk_CONF_VALUE_free(sk) OPENSSL_sk_free(ossl_check_CONF_VALUE_sk_type(sk)) +#define sk_CONF_VALUE_zero(sk) OPENSSL_sk_zero(ossl_check_CONF_VALUE_sk_type(sk)) +#define sk_CONF_VALUE_delete(sk, i) ((CONF_VALUE *)OPENSSL_sk_delete(ossl_check_CONF_VALUE_sk_type(sk), (i))) +#define sk_CONF_VALUE_delete_ptr(sk, ptr) ((CONF_VALUE *)OPENSSL_sk_delete_ptr(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr))) +#define sk_CONF_VALUE_push(sk, ptr) OPENSSL_sk_push(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr)) +#define sk_CONF_VALUE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr)) +#define sk_CONF_VALUE_pop(sk) ((CONF_VALUE *)OPENSSL_sk_pop(ossl_check_CONF_VALUE_sk_type(sk))) +#define sk_CONF_VALUE_shift(sk) ((CONF_VALUE *)OPENSSL_sk_shift(ossl_check_CONF_VALUE_sk_type(sk))) +#define sk_CONF_VALUE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_freefunc_type(freefunc)) +#define sk_CONF_VALUE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr), (idx)) +#define sk_CONF_VALUE_set(sk, idx, ptr) ((CONF_VALUE *)OPENSSL_sk_set(ossl_check_CONF_VALUE_sk_type(sk), (idx), ossl_check_CONF_VALUE_type(ptr))) +#define sk_CONF_VALUE_find(sk, ptr) OPENSSL_sk_find(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr)) +#define sk_CONF_VALUE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr)) +#define sk_CONF_VALUE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr), pnum) +#define sk_CONF_VALUE_sort(sk) OPENSSL_sk_sort(ossl_check_CONF_VALUE_sk_type(sk)) +#define sk_CONF_VALUE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CONF_VALUE_sk_type(sk)) +#define sk_CONF_VALUE_dup(sk) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_dup(ossl_check_const_CONF_VALUE_sk_type(sk))) +#define sk_CONF_VALUE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_deep_copy(ossl_check_const_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_copyfunc_type(copyfunc), ossl_check_CONF_VALUE_freefunc_type(freefunc))) +#define sk_CONF_VALUE_set_cmp_func(sk, cmp) ((sk_CONF_VALUE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_compfunc_type(cmp))) +DEFINE_LHASH_OF_INTERNAL(CONF_VALUE); +#define lh_CONF_VALUE_new(hfn, cmp) ((LHASH_OF(CONF_VALUE) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new(ossl_check_CONF_VALUE_lh_hashfunc_type(hfn), ossl_check_CONF_VALUE_lh_compfunc_type(cmp)), lh_CONF_VALUE_hash_thunk, lh_CONF_VALUE_comp_thunk, lh_CONF_VALUE_doall_thunk, lh_CONF_VALUE_doall_arg_thunk)) +#define lh_CONF_VALUE_free(lh) OPENSSL_LH_free(ossl_check_CONF_VALUE_lh_type(lh)) +#define lh_CONF_VALUE_flush(lh) OPENSSL_LH_flush(ossl_check_CONF_VALUE_lh_type(lh)) +#define lh_CONF_VALUE_insert(lh, ptr) ((CONF_VALUE *)OPENSSL_LH_insert(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_CONF_VALUE_lh_plain_type(ptr))) +#define lh_CONF_VALUE_delete(lh, ptr) ((CONF_VALUE *)OPENSSL_LH_delete(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_const_CONF_VALUE_lh_plain_type(ptr))) +#define lh_CONF_VALUE_retrieve(lh, ptr) ((CONF_VALUE *)OPENSSL_LH_retrieve(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_const_CONF_VALUE_lh_plain_type(ptr))) +#define lh_CONF_VALUE_error(lh) OPENSSL_LH_error(ossl_check_CONF_VALUE_lh_type(lh)) +#define lh_CONF_VALUE_num_items(lh) OPENSSL_LH_num_items(ossl_check_CONF_VALUE_lh_type(lh)) +#define lh_CONF_VALUE_node_stats_bio(lh, out) OPENSSL_LH_node_stats_bio(ossl_check_const_CONF_VALUE_lh_type(lh), out) +#define lh_CONF_VALUE_node_usage_stats_bio(lh, out) OPENSSL_LH_node_usage_stats_bio(ossl_check_const_CONF_VALUE_lh_type(lh), out) +#define lh_CONF_VALUE_stats_bio(lh, out) OPENSSL_LH_stats_bio(ossl_check_const_CONF_VALUE_lh_type(lh), out) +#define lh_CONF_VALUE_get_down_load(lh) OPENSSL_LH_get_down_load(ossl_check_CONF_VALUE_lh_type(lh)) +#define lh_CONF_VALUE_set_down_load(lh, dl) OPENSSL_LH_set_down_load(ossl_check_CONF_VALUE_lh_type(lh), dl) +#define lh_CONF_VALUE_doall(lh, dfn) OPENSSL_LH_doall(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_CONF_VALUE_lh_doallfunc_type(dfn)) + +/* clang-format on */ + +struct conf_st; +struct conf_method_st; +typedef struct conf_method_st CONF_METHOD; + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#include +#endif + +/* Module definitions */ +typedef struct conf_imodule_st CONF_IMODULE; +typedef struct conf_module_st CONF_MODULE; + +STACK_OF(CONF_MODULE); +STACK_OF(CONF_IMODULE); + +/* DSO module function typedefs */ +typedef int conf_init_func(CONF_IMODULE *md, const CONF *cnf); +typedef void conf_finish_func(CONF_IMODULE *md); + +#define CONF_MFLAGS_IGNORE_ERRORS 0x1 +#define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2 +#define CONF_MFLAGS_SILENT 0x4 +#define CONF_MFLAGS_NO_DSO 0x8 +#define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10 +#define CONF_MFLAGS_DEFAULT_SECTION 0x20 + +int CONF_set_default_method(CONF_METHOD *meth); +void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash); +LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file, + long *eline); +#ifndef OPENSSL_NO_STDIO +LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp, + long *eline); +#endif +LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp, + long *eline); +STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf, + const char *section); +char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group, + const char *name); +long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group, + const char *name); +void CONF_free(LHASH_OF(CONF_VALUE) *conf); +#ifndef OPENSSL_NO_STDIO +int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out); +#endif +int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out); +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +OSSL_DEPRECATEDIN_1_1_0 void OPENSSL_config(const char *config_name); +#endif + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define OPENSSL_no_config() \ + OPENSSL_init_crypto(OPENSSL_INIT_NO_LOAD_CONFIG, NULL) +#endif + +/* + * New conf code. The semantics are different from the functions above. If + * that wasn't the case, the above functions would have been replaced + */ + +CONF *NCONF_new_ex(OSSL_LIB_CTX *libctx, CONF_METHOD *meth); +OSSL_LIB_CTX *NCONF_get0_libctx(const CONF *conf); +CONF *NCONF_new(CONF_METHOD *meth); +CONF_METHOD *NCONF_default(void); +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 CONF_METHOD *NCONF_WIN32(void); +#endif +void NCONF_free(CONF *conf); +void NCONF_free_data(CONF *conf); + +int NCONF_load(CONF *conf, const char *file, long *eline); +#ifndef OPENSSL_NO_STDIO +int NCONF_load_fp(CONF *conf, FILE *fp, long *eline); +#endif +int NCONF_load_bio(CONF *conf, BIO *bp, long *eline); +STACK_OF(OPENSSL_CSTRING) *NCONF_get_section_names(const CONF *conf); +STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf, + const char *section); +char *NCONF_get_string(const CONF *conf, const char *group, const char *name); +int NCONF_get_number_e(const CONF *conf, const char *group, const char *name, + long *result); +#ifndef OPENSSL_NO_STDIO +int NCONF_dump_fp(const CONF *conf, FILE *out); +#endif +int NCONF_dump_bio(const CONF *conf, BIO *out); + +#define NCONF_get_number(c, g, n, r) NCONF_get_number_e(c, g, n, r) + +/* Module functions */ + +int CONF_modules_load(const CONF *cnf, const char *appname, + unsigned long flags); +int CONF_modules_load_file_ex(OSSL_LIB_CTX *libctx, const char *filename, + const char *appname, unsigned long flags); +int CONF_modules_load_file(const char *filename, const char *appname, + unsigned long flags); +void CONF_modules_unload(int all); +void CONF_modules_finish(void); +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define CONF_modules_free() \ + while (0) \ + continue +#endif +int CONF_module_add(const char *name, conf_init_func *ifunc, + conf_finish_func *ffunc); + +const char *CONF_imodule_get_name(const CONF_IMODULE *md); +const char *CONF_imodule_get_value(const CONF_IMODULE *md); +void *CONF_imodule_get_usr_data(const CONF_IMODULE *md); +void CONF_imodule_set_usr_data(CONF_IMODULE *md, void *usr_data); +CONF_MODULE *CONF_imodule_get_module(const CONF_IMODULE *md); +unsigned long CONF_imodule_get_flags(const CONF_IMODULE *md); +void CONF_imodule_set_flags(CONF_IMODULE *md, unsigned long flags); +void *CONF_module_get_usr_data(CONF_MODULE *pmod); +void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data); + +char *CONF_get1_default_config_file(void); + +int CONF_parse_list(const char *list, int sep, int nospc, + int (*list_cb)(const char *elem, int len, void *usr), + void *arg); + +void OPENSSL_load_builtin_modules(void); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/conf_api.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/conf_api.h new file mode 100644 index 0000000000000000000000000000000000000000..f3f3c640853ad27feecd710fa6c9c2aa49346cd1 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/conf_api.h @@ -0,0 +1,46 @@ +/* + * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_CONF_API_H +#define OPENSSL_CONF_API_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_CONF_API_H +#endif + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Up until OpenSSL 0.9.5a, this was new_section */ +CONF_VALUE *_CONF_new_section(CONF *conf, const char *section); +/* Up until OpenSSL 0.9.5a, this was get_section */ +CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section); +/* Up until OpenSSL 0.9.5a, this was CONF_get_section */ +STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf, + const char *section); + +int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value); +char *_CONF_get_string(const CONF *conf, const char *section, + const char *name); +long _CONF_get_number(const CONF *conf, const char *section, + const char *name); + +int _CONF_new_data(CONF *conf); +void _CONF_free_data(CONF *conf); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/conferr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/conferr.h new file mode 100644 index 0000000000000000000000000000000000000000..0b984dd65d4d0dafcb2b6731a77da625a50b43ea --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/conferr.h @@ -0,0 +1,50 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_CONFERR_H +#define OPENSSL_CONFERR_H +#pragma once + +#include +#include +#include + +/* + * CONF reason codes. + */ +#define CONF_R_ERROR_LOADING_DSO 110 +#define CONF_R_INVALID_PRAGMA 122 +#define CONF_R_LIST_CANNOT_BE_NULL 115 +#define CONF_R_MANDATORY_BRACES_IN_VARIABLE_EXPANSION 123 +#define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 100 +#define CONF_R_MISSING_EQUAL_SIGN 101 +#define CONF_R_MISSING_INIT_FUNCTION 112 +#define CONF_R_MODULE_INITIALIZATION_ERROR 109 +#define CONF_R_NO_CLOSE_BRACE 102 +#define CONF_R_NO_CONF 105 +#define CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE 106 +#define CONF_R_NO_SECTION 107 +#define CONF_R_NO_SUCH_FILE 114 +#define CONF_R_NO_VALUE 108 +#define CONF_R_NUMBER_TOO_LARGE 121 +#define CONF_R_OPENSSL_CONF_REFERENCES_MISSING_SECTION 124 +#define CONF_R_RECURSIVE_DIRECTORY_INCLUDE 111 +#define CONF_R_RECURSIVE_SECTION_REFERENCE 126 +#define CONF_R_RELATIVE_PATH 125 +#define CONF_R_SSL_COMMAND_SECTION_EMPTY 117 +#define CONF_R_SSL_COMMAND_SECTION_NOT_FOUND 118 +#define CONF_R_SSL_SECTION_EMPTY 119 +#define CONF_R_SSL_SECTION_NOT_FOUND 120 +#define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103 +#define CONF_R_UNKNOWN_MODULE_NAME 113 +#define CONF_R_VARIABLE_EXPANSION_TOO_LONG 116 +#define CONF_R_VARIABLE_HAS_NO_VALUE 104 + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/configuration.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/configuration.h new file mode 100644 index 0000000000000000000000000000000000000000..f1cea891443783153167b6cd9ce00dcedd7088f9 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/configuration.h @@ -0,0 +1,208 @@ +/* + * WARNING: do not edit! + * Generated by configdata.pm from Configurations\common0.tmpl, Configurations\windows-makefile.tmpl + * via makefile.in + * + * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_CONFIGURATION_H +#define OPENSSL_CONFIGURATION_H +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef OPENSSL_ALGORITHM_DEFINES +#error OPENSSL_ALGORITHM_DEFINES no longer supported +#endif + +/* + * OpenSSL was configured with the following options: + */ + +/* clang-format off */ +# ifndef OPENSSL_SYS_WIN64A +# define OPENSSL_SYS_WIN64A 1 +# endif +# define OPENSSL_CONFIGURED_API 30600 +# ifndef OPENSSL_RAND_SEED_OS +# define OPENSSL_RAND_SEED_OS +# endif +# ifndef OPENSSL_THREADS +# define OPENSSL_THREADS +# endif +# ifndef OPENSSL_NO_ACVP_TESTS +# define OPENSSL_NO_ACVP_TESTS +# endif +# ifndef OPENSSL_NO_AFALGENG +# define OPENSSL_NO_AFALGENG +# endif +# ifndef OPENSSL_NO_ALLOCFAIL_TESTS +# define OPENSSL_NO_ALLOCFAIL_TESTS +# endif +# ifndef OPENSSL_NO_ASAN +# define OPENSSL_NO_ASAN +# endif +# ifndef OPENSSL_NO_BROTLI +# define OPENSSL_NO_BROTLI +# endif +# ifndef OPENSSL_NO_BROTLI_DYNAMIC +# define OPENSSL_NO_BROTLI_DYNAMIC +# endif +# ifndef OPENSSL_NO_CRYPTO_MDEBUG +# define OPENSSL_NO_CRYPTO_MDEBUG +# endif +# ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE +# define OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE +# endif +# ifndef OPENSSL_NO_DEMOS +# define OPENSSL_NO_DEMOS +# endif +# ifndef OPENSSL_NO_DEVCRYPTOENG +# define OPENSSL_NO_DEVCRYPTOENG +# endif +# ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 +# define OPENSSL_NO_EC_NISTP_64_GCC_128 +# endif +# ifndef OPENSSL_NO_EGD +# define OPENSSL_NO_EGD +# endif +# ifndef OPENSSL_NO_EXTERNAL_TESTS +# define OPENSSL_NO_EXTERNAL_TESTS +# endif +# ifndef OPENSSL_NO_FIPS_JITTER +# define OPENSSL_NO_FIPS_JITTER +# endif +# ifndef OPENSSL_NO_FIPS_POST +# define OPENSSL_NO_FIPS_POST +# endif +# ifndef OPENSSL_NO_FIPS_SECURITYCHECKS +# define OPENSSL_NO_FIPS_SECURITYCHECKS +# endif +# ifndef OPENSSL_NO_FUZZ_AFL +# define OPENSSL_NO_FUZZ_AFL +# endif +# ifndef OPENSSL_NO_FUZZ_LIBFUZZER +# define OPENSSL_NO_FUZZ_LIBFUZZER +# endif +# ifndef OPENSSL_NO_H3DEMO +# define OPENSSL_NO_H3DEMO +# endif +# ifndef OPENSSL_NO_HQINTEROP +# define OPENSSL_NO_HQINTEROP +# endif +# ifndef OPENSSL_NO_JITTER +# define OPENSSL_NO_JITTER +# endif +# ifndef OPENSSL_NO_KTLS +# define OPENSSL_NO_KTLS +# endif +# ifndef OPENSSL_NO_LMS +# define OPENSSL_NO_LMS +# endif +# ifndef OPENSSL_NO_LOADERENG +# define OPENSSL_NO_LOADERENG +# endif +# ifndef OPENSSL_NO_MD2 +# define OPENSSL_NO_MD2 +# endif +# ifndef OPENSSL_NO_MSAN +# define OPENSSL_NO_MSAN +# endif +# ifndef OPENSSL_NO_PIE +# define OPENSSL_NO_PIE +# endif +# ifndef OPENSSL_NO_RC5 +# define OPENSSL_NO_RC5 +# endif +# ifndef OPENSSL_NO_SCTP +# define OPENSSL_NO_SCTP +# endif +# ifndef OPENSSL_NO_SSL3 +# define OPENSSL_NO_SSL3 +# endif +# ifndef OPENSSL_NO_SSL3_METHOD +# define OPENSSL_NO_SSL3_METHOD +# endif +# ifndef OPENSSL_NO_SSLKEYLOG +# define OPENSSL_NO_SSLKEYLOG +# endif +# ifndef OPENSSL_NO_TFO +# define OPENSSL_NO_TFO +# endif +# ifndef OPENSSL_NO_TRACE +# define OPENSSL_NO_TRACE +# endif +# ifndef OPENSSL_NO_UBSAN +# define OPENSSL_NO_UBSAN +# endif +# ifndef OPENSSL_NO_UNIT_TEST +# define OPENSSL_NO_UNIT_TEST +# endif +# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS +# define OPENSSL_NO_WEAK_SSL_CIPHERS +# endif +# ifndef OPENSSL_NO_ZLIB +# define OPENSSL_NO_ZLIB +# endif +# ifndef OPENSSL_NO_ZLIB_DYNAMIC +# define OPENSSL_NO_ZLIB_DYNAMIC +# endif +# ifndef OPENSSL_NO_ZSTD +# define OPENSSL_NO_ZSTD +# endif +# ifndef OPENSSL_NO_ZSTD_DYNAMIC +# define OPENSSL_NO_ZSTD_DYNAMIC +# endif +# ifndef OPENSSL_NO_DYNAMIC_ENGINE +# define OPENSSL_NO_DYNAMIC_ENGINE +# endif + +/* clang-format on */ + +/* Generate 80386 code? */ +/* clang-format off */ +# undef I386_ONLY +/* clang-format on */ + +/* + * The following are cipher-specific, but are part of the public API. + */ +#if !defined(OPENSSL_SYS_UEFI) + /* clang-format off */ +# undef BN_LLONG + /* clang-format on */ + /* Only one for the following should be defined */ + /* clang-format off */ +# undef SIXTY_FOUR_BIT_LONG + /* clang-format on */ + /* clang-format off */ +# define SIXTY_FOUR_BIT + /* clang-format on */ + /* clang-format off */ +# undef THIRTY_TWO_BIT +/* clang-format on */ +#endif + +/* clang-format off */ +# define RC4_INT unsigned int +/* clang-format on */ + +#if defined(OPENSSL_NO_COMP) || (defined(OPENSSL_NO_BROTLI) && defined(OPENSSL_NO_ZSTD) && defined(OPENSSL_NO_ZLIB)) +#define OPENSSL_NO_COMP_ALG +#else +#undef OPENSSL_NO_COMP_ALG +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* OPENSSL_CONFIGURATION_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/conftypes.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/conftypes.h new file mode 100644 index 0000000000000000000000000000000000000000..f2d2be19d0674e1033faaa9880bac708871a6471 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/conftypes.h @@ -0,0 +1,44 @@ +/* + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_CONFTYPES_H +#define OPENSSL_CONFTYPES_H +#pragma once + +#ifndef OPENSSL_CONF_H +#include +#endif + +/* + * The contents of this file are deprecated and will be made opaque + */ +struct conf_method_st { + const char *name; + CONF *(*create)(CONF_METHOD *meth); + int (*init)(CONF *conf); + int (*destroy)(CONF *conf); + int (*destroy_data)(CONF *conf); + int (*load_bio)(CONF *conf, BIO *bp, long *eline); + int (*dump)(const CONF *conf, BIO *bp); + int (*is_number)(const CONF *conf, char c); + int (*to_int)(const CONF *conf, char c); + int (*load)(CONF *conf, const char *name, long *eline); +}; + +struct conf_st { + CONF_METHOD *meth; + void *meth_data; + LHASH_OF(CONF_VALUE) *data; + int flag_dollarid; + int flag_abspath; + char *includedir; + OSSL_LIB_CTX *libctx; +}; + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/core.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/core.h new file mode 100644 index 0000000000000000000000000000000000000000..a883173ddd2abcad78c5ebc75351261466be3931 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/core.h @@ -0,0 +1,235 @@ +/* + * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_CORE_H +#define OPENSSL_CORE_H +#pragma once + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/*- + * Base types + * ---------- + * + * These are the types that the OpenSSL core and providers have in common + * to communicate data between them. + */ + +/* Opaque handles to be used with core upcall functions from providers */ +typedef struct ossl_core_handle_st OSSL_CORE_HANDLE; +typedef struct openssl_core_ctx_st OPENSSL_CORE_CTX; +typedef struct ossl_core_bio_st OSSL_CORE_BIO; + +/* + * Dispatch table element. function_id numbers and the functions are defined + * in core_dispatch.h, see macros with 'OSSL_CORE_MAKE_FUNC' in their names. + * + * An array of these is always terminated by function_id == 0 + */ +struct ossl_dispatch_st { + int function_id; + void (*function)(void); +}; + +#define OSSL_DISPATCH_END \ + { 0, NULL } + +/* + * Other items, essentially an int<->pointer map element. + * + * We make this type distinct from OSSL_DISPATCH to ensure that dispatch + * tables remain tables with function pointers only. + * + * This is used whenever we need to pass things like a table of error reason + * codes <-> reason string maps, ... + * + * Usage determines which field works as key if any, rather than field order. + * + * An array of these is always terminated by id == 0 && ptr == NULL + */ +struct ossl_item_st { + unsigned int id; + void *ptr; +}; + +/* + * Type to tie together algorithm names, property definition string and + * the algorithm implementation in the form of a dispatch table. + * + * An array of these is always terminated by algorithm_names == NULL + */ +struct ossl_algorithm_st { + const char *algorithm_names; /* key */ + const char *property_definition; /* key */ + const OSSL_DISPATCH *implementation; + const char *algorithm_description; +}; + +/* + * Type to pass object data in a uniform way, without exposing the object + * structure. + * + * An array of these is always terminated by key == NULL + */ +struct ossl_param_st { + const char *key; /* the name of the parameter */ + unsigned int data_type; /* declare what kind of content is in buffer */ + void *data; /* value being passed in or out */ + size_t data_size; /* data size */ + size_t return_size; /* returned content size */ +}; + +/* Currently supported OSSL_PARAM data types */ +/* + * OSSL_PARAM_INTEGER and OSSL_PARAM_UNSIGNED_INTEGER + * are arbitrary length and therefore require an arbitrarily sized buffer, + * since they may be used to pass numbers larger than what is natively + * available. + * + * The number must be buffered in native form, i.e. MSB first on B_ENDIAN + * systems and LSB first on L_ENDIAN systems. This means that arbitrary + * native integers can be stored in the buffer, just make sure that the + * buffer size is correct and the buffer itself is properly aligned (for + * example by having the buffer field point at a C integer). + */ +#define OSSL_PARAM_INTEGER 1 +#define OSSL_PARAM_UNSIGNED_INTEGER 2 +/*- + * OSSL_PARAM_REAL + * is a C binary floating point values in native form and alignment. + */ +#define OSSL_PARAM_REAL 3 +/*- + * OSSL_PARAM_UTF8_STRING + * is a printable string. It is expected to be printed as it is. + */ +#define OSSL_PARAM_UTF8_STRING 4 +/*- + * OSSL_PARAM_OCTET_STRING + * is a string of bytes with no further specification. It is expected to be + * printed as a hexdump. + */ +#define OSSL_PARAM_OCTET_STRING 5 +/*- + * OSSL_PARAM_UTF8_PTR + * is a pointer to a printable string. It is expected to be printed as it is. + * + * The difference between this and OSSL_PARAM_UTF8_STRING is that only pointers + * are manipulated for this type. + * + * This is more relevant for parameter requests, where the responding + * function doesn't need to copy the data to the provided buffer, but + * sets the provided buffer to point at the actual data instead. + * + * WARNING! Using these is FRAGILE, as it assumes that the actual + * data and its location are constant. + * + * EXTRA WARNING! If you are not completely sure you most likely want + * to use the OSSL_PARAM_UTF8_STRING type. + */ +#define OSSL_PARAM_UTF8_PTR 6 +/*- + * OSSL_PARAM_OCTET_PTR + * is a pointer to a string of bytes with no further specification. It is + * expected to be printed as a hexdump. + * + * The difference between this and OSSL_PARAM_OCTET_STRING is that only pointers + * are manipulated for this type. + * + * This is more relevant for parameter requests, where the responding + * function doesn't need to copy the data to the provided buffer, but + * sets the provided buffer to point at the actual data instead. + * + * WARNING! Using these is FRAGILE, as it assumes that the actual + * data and its location are constant. + * + * EXTRA WARNING! If you are not completely sure you most likely want + * to use the OSSL_PARAM_OCTET_STRING type. + */ +#define OSSL_PARAM_OCTET_PTR 7 + +/* + * Typedef for the thread stop handling callback. Used both internally and by + * providers. + * + * Providers may register for notifications about threads stopping by + * registering a callback to hear about such events. Providers register the + * callback using the OSSL_FUNC_CORE_THREAD_START function in the |in| dispatch + * table passed to OSSL_provider_init(). The arg passed back to a provider will + * be the provider side context object. + */ +typedef void (*OSSL_thread_stop_handler_fn)(void *arg); + +/*- + * Provider entry point + * -------------------- + * + * This function is expected to be present in any dynamically loadable + * provider module. By definition, if this function doesn't exist in a + * module, that module is not an OpenSSL provider module. + */ +/*- + * |handle| pointer to opaque type OSSL_CORE_HANDLE. This can be used + * together with some functions passed via |in| to query data. + * |in| is the array of functions that the Core passes to the provider. + * |out| will be the array of base functions that the provider passes + * back to the Core. + * |provctx| a provider side context object, optionally created if the + * provider needs it. This value is passed to other provider + * functions, notably other context constructors. + */ +typedef int(OSSL_provider_init_fn)(const OSSL_CORE_HANDLE *handle, + const OSSL_DISPATCH *in, + const OSSL_DISPATCH **out, + void **provctx); +#ifdef __VMS +#pragma names save +#pragma names uppercase, truncated +#endif +OPENSSL_EXPORT OSSL_provider_init_fn OSSL_provider_init; +#ifdef __VMS +#pragma names restore +#endif + +/* + * Generic callback function signature. + * + * The expectation is that any provider function that wants to offer + * a callback / hook can do so by taking an argument with this type, + * as well as a pointer to caller-specific data. When calling the + * callback, the provider function can populate an OSSL_PARAM array + * with data of its choice and pass that in the callback call, along + * with the caller data argument. + * + * libcrypto may use the OSSL_PARAM array to create arguments for an + * application callback it knows about. + */ +typedef int(OSSL_CALLBACK)(const OSSL_PARAM params[], void *arg); +typedef int(OSSL_INOUT_CALLBACK)(const OSSL_PARAM in_params[], + OSSL_PARAM out_params[], void *arg); +/* + * Passphrase callback function signature + * + * This is similar to the generic callback function above, but adds a + * result parameter. + */ +typedef int(OSSL_PASSPHRASE_CALLBACK)(char *pass, size_t pass_size, + size_t *pass_len, + const OSSL_PARAM params[], void *arg); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/core_dispatch.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/core_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..d645916f9ee9fbdc932b64cb5693d754895b1df3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/core_dispatch.h @@ -0,0 +1,1061 @@ +/* + * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_CORE_NUMBERS_H +#define OPENSSL_CORE_NUMBERS_H +#pragma once + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Generic function pointer for provider method arrays, or other contexts where + * functions of various signatures must occupy a common slot in an array of + * structures. + */ +typedef void (*OSSL_FUNC)(void); + +/*- + * Identities + * ---------- + * + * All series start with 1, to allow 0 to be an array terminator. + * For any FUNC identity, we also provide a function signature typedef + * and a static inline function to extract a function pointer from a + * OSSL_DISPATCH element in a type safe manner. + * + * Names: + * for any function base name 'foo' (uppercase form 'FOO'), we will have + * the following: + * - a macro for the identity with the name OSSL_FUNC_'FOO' or derivatives + * thereof (to be specified further down) + * - a function signature typedef with the name OSSL_FUNC_'foo'_fn + * - a function pointer extractor function with the name OSSL_FUNC_'foo' + */ + +/* + * Helper macro to create the function signature typedef and the extractor + * |type| is the return-type of the function, |name| is the name of the + * function to fetch, and |args| is a parenthesized list of parameters + * for the function (that is, it is |name|'s function signature). + * Note: This is considered a "reserved" internal macro. Applications should + * not use this or assume its existence. + */ +#define OSSL_CORE_MAKE_FUNC(type, name, args) \ + typedef type(OSSL_FUNC_##name##_fn) args; \ + static ossl_unused ossl_inline \ + OSSL_FUNC_##name##_fn * \ + OSSL_FUNC_##name(const OSSL_DISPATCH *opf) \ + { \ + return (OSSL_FUNC_##name##_fn *)opf->function; \ + } + +/* + * Core function identities, for the two OSSL_DISPATCH tables being passed + * in the OSSL_provider_init call. + * + * 0 serves as a marker for the end of the OSSL_DISPATCH array, and must + * therefore NEVER be used as a function identity. + */ +/* Functions provided by the Core to the provider, reserved numbers 1-1023 */ +#define OSSL_FUNC_CORE_GETTABLE_PARAMS 1 +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, + core_gettable_params, (const OSSL_CORE_HANDLE *prov)) +#define OSSL_FUNC_CORE_GET_PARAMS 2 +OSSL_CORE_MAKE_FUNC(int, core_get_params, (const OSSL_CORE_HANDLE *prov, OSSL_PARAM params[])) +#define OSSL_FUNC_CORE_THREAD_START 3 +OSSL_CORE_MAKE_FUNC(int, core_thread_start, (const OSSL_CORE_HANDLE *prov, OSSL_thread_stop_handler_fn handfn, void *arg)) +#define OSSL_FUNC_CORE_GET_LIBCTX 4 +OSSL_CORE_MAKE_FUNC(OPENSSL_CORE_CTX *, core_get_libctx, + (const OSSL_CORE_HANDLE *prov)) +#define OSSL_FUNC_CORE_NEW_ERROR 5 +OSSL_CORE_MAKE_FUNC(void, core_new_error, (const OSSL_CORE_HANDLE *prov)) +#define OSSL_FUNC_CORE_SET_ERROR_DEBUG 6 +OSSL_CORE_MAKE_FUNC(void, core_set_error_debug, + (const OSSL_CORE_HANDLE *prov, + const char *file, int line, const char *func)) +#define OSSL_FUNC_CORE_VSET_ERROR 7 +OSSL_CORE_MAKE_FUNC(void, core_vset_error, + (const OSSL_CORE_HANDLE *prov, + uint32_t reason, const char *fmt, va_list args)) +#define OSSL_FUNC_CORE_SET_ERROR_MARK 8 +OSSL_CORE_MAKE_FUNC(int, core_set_error_mark, (const OSSL_CORE_HANDLE *prov)) +#define OSSL_FUNC_CORE_CLEAR_LAST_ERROR_MARK 9 +OSSL_CORE_MAKE_FUNC(int, core_clear_last_error_mark, + (const OSSL_CORE_HANDLE *prov)) +#define OSSL_FUNC_CORE_POP_ERROR_TO_MARK 10 +OSSL_CORE_MAKE_FUNC(int, core_pop_error_to_mark, (const OSSL_CORE_HANDLE *prov)) + +/* Functions to access the OBJ database */ + +#define OSSL_FUNC_CORE_OBJ_ADD_SIGID 11 +#define OSSL_FUNC_CORE_OBJ_CREATE 12 + +OSSL_CORE_MAKE_FUNC(int, core_obj_add_sigid, + (const OSSL_CORE_HANDLE *prov, const char *sign_name, + const char *digest_name, const char *pkey_name)) +OSSL_CORE_MAKE_FUNC(int, core_obj_create, + (const OSSL_CORE_HANDLE *prov, const char *oid, + const char *sn, const char *ln)) + +/* Memory allocation, freeing, clearing. */ +#define OSSL_FUNC_CRYPTO_MALLOC 20 +OSSL_CORE_MAKE_FUNC(void *, + CRYPTO_malloc, (size_t num, const char *file, int line)) +#define OSSL_FUNC_CRYPTO_ZALLOC 21 +OSSL_CORE_MAKE_FUNC(void *, + CRYPTO_zalloc, (size_t num, const char *file, int line)) +#define OSSL_FUNC_CRYPTO_FREE 22 +OSSL_CORE_MAKE_FUNC(void, + CRYPTO_free, (void *ptr, const char *file, int line)) +#define OSSL_FUNC_CRYPTO_CLEAR_FREE 23 +OSSL_CORE_MAKE_FUNC(void, + CRYPTO_clear_free, (void *ptr, size_t num, const char *file, int line)) +#define OSSL_FUNC_CRYPTO_REALLOC 24 +OSSL_CORE_MAKE_FUNC(void *, + CRYPTO_realloc, (void *addr, size_t num, const char *file, int line)) +#define OSSL_FUNC_CRYPTO_CLEAR_REALLOC 25 +OSSL_CORE_MAKE_FUNC(void *, + CRYPTO_clear_realloc, (void *addr, size_t old_num, size_t num, const char *file, int line)) +#define OSSL_FUNC_CRYPTO_SECURE_MALLOC 26 +OSSL_CORE_MAKE_FUNC(void *, + CRYPTO_secure_malloc, (size_t num, const char *file, int line)) +#define OSSL_FUNC_CRYPTO_SECURE_ZALLOC 27 +OSSL_CORE_MAKE_FUNC(void *, + CRYPTO_secure_zalloc, (size_t num, const char *file, int line)) +#define OSSL_FUNC_CRYPTO_SECURE_FREE 28 +OSSL_CORE_MAKE_FUNC(void, + CRYPTO_secure_free, (void *ptr, const char *file, int line)) +#define OSSL_FUNC_CRYPTO_SECURE_CLEAR_FREE 29 +OSSL_CORE_MAKE_FUNC(void, + CRYPTO_secure_clear_free, (void *ptr, size_t num, const char *file, int line)) +#define OSSL_FUNC_CRYPTO_SECURE_ALLOCATED 30 +OSSL_CORE_MAKE_FUNC(int, + CRYPTO_secure_allocated, (const void *ptr)) +#define OSSL_FUNC_OPENSSL_CLEANSE 31 +OSSL_CORE_MAKE_FUNC(void, + OPENSSL_cleanse, (void *ptr, size_t len)) + +/* Bio functions provided by the core */ +#define OSSL_FUNC_BIO_NEW_FILE 40 +#define OSSL_FUNC_BIO_NEW_MEMBUF 41 +#define OSSL_FUNC_BIO_READ_EX 42 +#define OSSL_FUNC_BIO_WRITE_EX 43 +#define OSSL_FUNC_BIO_UP_REF 44 +#define OSSL_FUNC_BIO_FREE 45 +#define OSSL_FUNC_BIO_VPRINTF 46 +#define OSSL_FUNC_BIO_VSNPRINTF 47 +#define OSSL_FUNC_BIO_PUTS 48 +#define OSSL_FUNC_BIO_GETS 49 +#define OSSL_FUNC_BIO_CTRL 50 + +OSSL_CORE_MAKE_FUNC(OSSL_CORE_BIO *, BIO_new_file, (const char *filename, const char *mode)) +OSSL_CORE_MAKE_FUNC(OSSL_CORE_BIO *, BIO_new_membuf, (const void *buf, int len)) +OSSL_CORE_MAKE_FUNC(int, BIO_read_ex, (OSSL_CORE_BIO *bio, void *data, size_t data_len, size_t *bytes_read)) +OSSL_CORE_MAKE_FUNC(int, BIO_write_ex, (OSSL_CORE_BIO *bio, const void *data, size_t data_len, size_t *written)) +OSSL_CORE_MAKE_FUNC(int, BIO_gets, (OSSL_CORE_BIO *bio, char *buf, int size)) +OSSL_CORE_MAKE_FUNC(int, BIO_puts, (OSSL_CORE_BIO *bio, const char *str)) +OSSL_CORE_MAKE_FUNC(int, BIO_up_ref, (OSSL_CORE_BIO *bio)) +OSSL_CORE_MAKE_FUNC(int, BIO_free, (OSSL_CORE_BIO *bio)) +OSSL_CORE_MAKE_FUNC(int, BIO_vprintf, (OSSL_CORE_BIO *bio, const char *format, va_list args)) +OSSL_CORE_MAKE_FUNC(int, BIO_vsnprintf, + (char *buf, size_t n, const char *fmt, va_list args)) +OSSL_CORE_MAKE_FUNC(int, BIO_ctrl, (OSSL_CORE_BIO *bio, int cmd, long num, void *ptr)) + +/* New seeding functions prototypes with the 101-104 series */ +#define OSSL_FUNC_CLEANUP_USER_ENTROPY 96 +#define OSSL_FUNC_CLEANUP_USER_NONCE 97 +#define OSSL_FUNC_GET_USER_ENTROPY 98 +#define OSSL_FUNC_GET_USER_NONCE 99 + +#define OSSL_FUNC_INDICATOR_CB 95 +OSSL_CORE_MAKE_FUNC(void, indicator_cb, (OPENSSL_CORE_CTX *ctx, OSSL_INDICATOR_CALLBACK **cb)) +#define OSSL_FUNC_SELF_TEST_CB 100 +OSSL_CORE_MAKE_FUNC(void, self_test_cb, (OPENSSL_CORE_CTX *ctx, OSSL_CALLBACK **cb, void **cbarg)) + +/* Functions to get seed material from the operating system */ +#define OSSL_FUNC_GET_ENTROPY 101 +#define OSSL_FUNC_CLEANUP_ENTROPY 102 +#define OSSL_FUNC_GET_NONCE 103 +#define OSSL_FUNC_CLEANUP_NONCE 104 +OSSL_CORE_MAKE_FUNC(size_t, get_entropy, (const OSSL_CORE_HANDLE *handle, unsigned char **pout, int entropy, size_t min_len, size_t max_len)) +OSSL_CORE_MAKE_FUNC(size_t, get_user_entropy, (const OSSL_CORE_HANDLE *handle, unsigned char **pout, int entropy, size_t min_len, size_t max_len)) +OSSL_CORE_MAKE_FUNC(void, cleanup_entropy, (const OSSL_CORE_HANDLE *handle, unsigned char *buf, size_t len)) +OSSL_CORE_MAKE_FUNC(void, cleanup_user_entropy, (const OSSL_CORE_HANDLE *handle, unsigned char *buf, size_t len)) +OSSL_CORE_MAKE_FUNC(size_t, get_nonce, (const OSSL_CORE_HANDLE *handle, unsigned char **pout, size_t min_len, size_t max_len, const void *salt, size_t salt_len)) +OSSL_CORE_MAKE_FUNC(size_t, get_user_nonce, (const OSSL_CORE_HANDLE *handle, unsigned char **pout, size_t min_len, size_t max_len, const void *salt, size_t salt_len)) +OSSL_CORE_MAKE_FUNC(void, cleanup_nonce, (const OSSL_CORE_HANDLE *handle, unsigned char *buf, size_t len)) +OSSL_CORE_MAKE_FUNC(void, cleanup_user_nonce, (const OSSL_CORE_HANDLE *handle, unsigned char *buf, size_t len)) + +/* Functions to access the core's providers */ +#define OSSL_FUNC_PROVIDER_REGISTER_CHILD_CB 105 +#define OSSL_FUNC_PROVIDER_DEREGISTER_CHILD_CB 106 +#define OSSL_FUNC_PROVIDER_NAME 107 +#define OSSL_FUNC_PROVIDER_GET0_PROVIDER_CTX 108 +#define OSSL_FUNC_PROVIDER_GET0_DISPATCH 109 +#define OSSL_FUNC_PROVIDER_UP_REF 110 +#define OSSL_FUNC_PROVIDER_FREE 111 + +OSSL_CORE_MAKE_FUNC(int, provider_register_child_cb, + (const OSSL_CORE_HANDLE *handle, + int (*create_cb)(const OSSL_CORE_HANDLE *provider, void *cbdata), + int (*remove_cb)(const OSSL_CORE_HANDLE *provider, void *cbdata), + int (*global_props_cb)(const char *props, void *cbdata), + void *cbdata)) +OSSL_CORE_MAKE_FUNC(void, provider_deregister_child_cb, + (const OSSL_CORE_HANDLE *handle)) +OSSL_CORE_MAKE_FUNC(const char *, provider_name, + (const OSSL_CORE_HANDLE *prov)) +OSSL_CORE_MAKE_FUNC(void *, provider_get0_provider_ctx, + (const OSSL_CORE_HANDLE *prov)) +OSSL_CORE_MAKE_FUNC(const OSSL_DISPATCH *, provider_get0_dispatch, + (const OSSL_CORE_HANDLE *prov)) +OSSL_CORE_MAKE_FUNC(int, provider_up_ref, + (const OSSL_CORE_HANDLE *prov, int activate)) +OSSL_CORE_MAKE_FUNC(int, provider_free, + (const OSSL_CORE_HANDLE *prov, int deactivate)) + +/* Additional error functions provided by the core */ +#define OSSL_FUNC_CORE_COUNT_TO_MARK 120 +OSSL_CORE_MAKE_FUNC(int, core_count_to_mark, (const OSSL_CORE_HANDLE *prov)) + +/* Functions provided by the provider to the Core, reserved numbers 1024-1535 */ +#define OSSL_FUNC_PROVIDER_TEARDOWN 1024 +OSSL_CORE_MAKE_FUNC(void, provider_teardown, (void *provctx)) +#define OSSL_FUNC_PROVIDER_GETTABLE_PARAMS 1025 +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, + provider_gettable_params, (void *provctx)) +#define OSSL_FUNC_PROVIDER_GET_PARAMS 1026 +OSSL_CORE_MAKE_FUNC(int, provider_get_params, (void *provctx, OSSL_PARAM params[])) +#define OSSL_FUNC_PROVIDER_QUERY_OPERATION 1027 +OSSL_CORE_MAKE_FUNC(const OSSL_ALGORITHM *, provider_query_operation, + (void *provctx, int operation_id, int *no_store)) +#define OSSL_FUNC_PROVIDER_UNQUERY_OPERATION 1028 +OSSL_CORE_MAKE_FUNC(void, provider_unquery_operation, + (void *provctx, int operation_id, const OSSL_ALGORITHM *)) +#define OSSL_FUNC_PROVIDER_GET_REASON_STRINGS 1029 +OSSL_CORE_MAKE_FUNC(const OSSL_ITEM *, provider_get_reason_strings, + (void *provctx)) +#define OSSL_FUNC_PROVIDER_GET_CAPABILITIES 1030 +OSSL_CORE_MAKE_FUNC(int, provider_get_capabilities, (void *provctx, const char *capability, OSSL_CALLBACK *cb, void *arg)) +#define OSSL_FUNC_PROVIDER_SELF_TEST 1031 +OSSL_CORE_MAKE_FUNC(int, provider_self_test, (void *provctx)) +#define OSSL_FUNC_PROVIDER_RANDOM_BYTES 1032 +OSSL_CORE_MAKE_FUNC(int, provider_random_bytes, (void *provctx, int which, void *buf, size_t n, unsigned int strength)) + +/* Libssl related functions */ +#define OSSL_FUNC_SSL_QUIC_TLS_CRYPTO_SEND 2001 +OSSL_CORE_MAKE_FUNC(int, SSL_QUIC_TLS_crypto_send, + (SSL *s, const unsigned char *buf, size_t buf_len, + size_t *consumed, void *arg)) +#define OSSL_FUNC_SSL_QUIC_TLS_CRYPTO_RECV_RCD 2002 +OSSL_CORE_MAKE_FUNC(int, SSL_QUIC_TLS_crypto_recv_rcd, + (SSL *s, const unsigned char **buf, size_t *bytes_read, + void *arg)) +#define OSSL_FUNC_SSL_QUIC_TLS_CRYPTO_RELEASE_RCD 2003 +OSSL_CORE_MAKE_FUNC(int, SSL_QUIC_TLS_crypto_release_rcd, + (SSL *s, size_t bytes_read, void *arg)) +#define OSSL_FUNC_SSL_QUIC_TLS_YIELD_SECRET 2004 +OSSL_CORE_MAKE_FUNC(int, SSL_QUIC_TLS_yield_secret, + (SSL *s, uint32_t prot_level, int direction, + const unsigned char *secret, size_t secret_len, void *arg)) +#define OSSL_FUNC_SSL_QUIC_TLS_GOT_TRANSPORT_PARAMS 2005 +OSSL_CORE_MAKE_FUNC(int, SSL_QUIC_TLS_got_transport_params, + (SSL *s, const unsigned char *params, size_t params_len, + void *arg)) +#define OSSL_FUNC_SSL_QUIC_TLS_ALERT 2006 +OSSL_CORE_MAKE_FUNC(int, SSL_QUIC_TLS_alert, + (SSL *s, unsigned char alert_code, void *arg)) + +/* Operations */ + +#define OSSL_OP_DIGEST 1 +#define OSSL_OP_CIPHER 2 /* Symmetric Ciphers */ +#define OSSL_OP_MAC 3 +#define OSSL_OP_KDF 4 +#define OSSL_OP_RAND 5 +#define OSSL_OP_KEYMGMT 10 +#define OSSL_OP_KEYEXCH 11 +#define OSSL_OP_SIGNATURE 12 +#define OSSL_OP_ASYM_CIPHER 13 +#define OSSL_OP_KEM 14 +#define OSSL_OP_SKEYMGMT 15 +/* New section for non-EVP operations */ +#define OSSL_OP_ENCODER 20 +#define OSSL_OP_DECODER 21 +#define OSSL_OP_STORE 22 +/* Highest known operation number */ +#define OSSL_OP__HIGHEST 22 + +/* Digests */ + +#define OSSL_FUNC_DIGEST_NEWCTX 1 +#define OSSL_FUNC_DIGEST_INIT 2 +#define OSSL_FUNC_DIGEST_UPDATE 3 +#define OSSL_FUNC_DIGEST_FINAL 4 +#define OSSL_FUNC_DIGEST_DIGEST 5 +#define OSSL_FUNC_DIGEST_FREECTX 6 +#define OSSL_FUNC_DIGEST_DUPCTX 7 +#define OSSL_FUNC_DIGEST_GET_PARAMS 8 +#define OSSL_FUNC_DIGEST_SET_CTX_PARAMS 9 +#define OSSL_FUNC_DIGEST_GET_CTX_PARAMS 10 +#define OSSL_FUNC_DIGEST_GETTABLE_PARAMS 11 +#define OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS 12 +#define OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS 13 +#define OSSL_FUNC_DIGEST_SQUEEZE 14 +#define OSSL_FUNC_DIGEST_COPYCTX 15 + +OSSL_CORE_MAKE_FUNC(void *, digest_newctx, (void *provctx)) +OSSL_CORE_MAKE_FUNC(int, digest_init, (void *dctx, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, digest_update, + (void *dctx, const unsigned char *in, size_t inl)) +OSSL_CORE_MAKE_FUNC(int, digest_final, + (void *dctx, + unsigned char *out, size_t *outl, size_t outsz)) +OSSL_CORE_MAKE_FUNC(int, digest_squeeze, + (void *dctx, + unsigned char *out, size_t *outl, size_t outsz)) +OSSL_CORE_MAKE_FUNC(int, digest_digest, + (void *provctx, const unsigned char *in, size_t inl, + unsigned char *out, size_t *outl, size_t outsz)) + +OSSL_CORE_MAKE_FUNC(void, digest_freectx, (void *dctx)) +OSSL_CORE_MAKE_FUNC(void *, digest_dupctx, (void *dctx)) +OSSL_CORE_MAKE_FUNC(void, digest_copyctx, (void *outctx, void *inctx)) + +OSSL_CORE_MAKE_FUNC(int, digest_get_params, (OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, digest_set_ctx_params, + (void *vctx, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, digest_get_ctx_params, + (void *vctx, OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, digest_gettable_params, + (void *provctx)) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, digest_settable_ctx_params, + (void *dctx, void *provctx)) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, digest_gettable_ctx_params, + (void *dctx, void *provctx)) + +/* Symmetric Ciphers */ + +#define OSSL_FUNC_CIPHER_NEWCTX 1 +#define OSSL_FUNC_CIPHER_ENCRYPT_INIT 2 +#define OSSL_FUNC_CIPHER_DECRYPT_INIT 3 +#define OSSL_FUNC_CIPHER_UPDATE 4 +#define OSSL_FUNC_CIPHER_FINAL 5 +#define OSSL_FUNC_CIPHER_CIPHER 6 +#define OSSL_FUNC_CIPHER_FREECTX 7 +#define OSSL_FUNC_CIPHER_DUPCTX 8 +#define OSSL_FUNC_CIPHER_GET_PARAMS 9 +#define OSSL_FUNC_CIPHER_GET_CTX_PARAMS 10 +#define OSSL_FUNC_CIPHER_SET_CTX_PARAMS 11 +#define OSSL_FUNC_CIPHER_GETTABLE_PARAMS 12 +#define OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS 13 +#define OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS 14 +#define OSSL_FUNC_CIPHER_PIPELINE_ENCRYPT_INIT 15 +#define OSSL_FUNC_CIPHER_PIPELINE_DECRYPT_INIT 16 +#define OSSL_FUNC_CIPHER_PIPELINE_UPDATE 17 +#define OSSL_FUNC_CIPHER_PIPELINE_FINAL 18 +#define OSSL_FUNC_CIPHER_ENCRYPT_SKEY_INIT 19 +#define OSSL_FUNC_CIPHER_DECRYPT_SKEY_INIT 20 + +OSSL_CORE_MAKE_FUNC(void *, cipher_newctx, (void *provctx)) +OSSL_CORE_MAKE_FUNC(int, cipher_encrypt_init, (void *cctx, const unsigned char *key, size_t keylen, const unsigned char *iv, size_t ivlen, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, cipher_decrypt_init, (void *cctx, const unsigned char *key, size_t keylen, const unsigned char *iv, size_t ivlen, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, cipher_update, + (void *cctx, + unsigned char *out, size_t *outl, size_t outsize, + const unsigned char *in, size_t inl)) +OSSL_CORE_MAKE_FUNC(int, cipher_final, + (void *cctx, + unsigned char *out, size_t *outl, size_t outsize)) +OSSL_CORE_MAKE_FUNC(int, cipher_cipher, + (void *cctx, + unsigned char *out, size_t *outl, size_t outsize, + const unsigned char *in, size_t inl)) +OSSL_CORE_MAKE_FUNC(int, cipher_pipeline_encrypt_init, + (void *cctx, + const unsigned char *key, size_t keylen, + size_t numpipes, const unsigned char **iv, size_t ivlen, + const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, cipher_pipeline_decrypt_init, + (void *cctx, + const unsigned char *key, size_t keylen, + size_t numpipes, const unsigned char **iv, size_t ivlen, + const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, cipher_pipeline_update, + (void *cctx, size_t numpipes, + unsigned char **out, size_t *outl, const size_t *outsize, + const unsigned char **in, const size_t *inl)) +OSSL_CORE_MAKE_FUNC(int, cipher_pipeline_final, + (void *cctx, size_t numpipes, + unsigned char **out, size_t *outl, const size_t *outsize)) +OSSL_CORE_MAKE_FUNC(void, cipher_freectx, (void *cctx)) +OSSL_CORE_MAKE_FUNC(void *, cipher_dupctx, (void *cctx)) +OSSL_CORE_MAKE_FUNC(int, cipher_get_params, (OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, cipher_get_ctx_params, (void *cctx, OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, cipher_set_ctx_params, (void *cctx, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, cipher_gettable_params, + (void *provctx)) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, cipher_settable_ctx_params, + (void *cctx, void *provctx)) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, cipher_gettable_ctx_params, + (void *cctx, void *provctx)) +OSSL_CORE_MAKE_FUNC(int, cipher_encrypt_skey_init, (void *cctx, void *skeydata, const unsigned char *iv, size_t ivlen, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, cipher_decrypt_skey_init, (void *cctx, void *skeydata, const unsigned char *iv, size_t ivlen, const OSSL_PARAM params[])) + +/* MACs */ + +#define OSSL_FUNC_MAC_NEWCTX 1 +#define OSSL_FUNC_MAC_DUPCTX 2 +#define OSSL_FUNC_MAC_FREECTX 3 +#define OSSL_FUNC_MAC_INIT 4 +#define OSSL_FUNC_MAC_UPDATE 5 +#define OSSL_FUNC_MAC_FINAL 6 +#define OSSL_FUNC_MAC_GET_PARAMS 7 +#define OSSL_FUNC_MAC_GET_CTX_PARAMS 8 +#define OSSL_FUNC_MAC_SET_CTX_PARAMS 9 +#define OSSL_FUNC_MAC_GETTABLE_PARAMS 10 +#define OSSL_FUNC_MAC_GETTABLE_CTX_PARAMS 11 +#define OSSL_FUNC_MAC_SETTABLE_CTX_PARAMS 12 +#define OSSL_FUNC_MAC_INIT_SKEY 13 + +OSSL_CORE_MAKE_FUNC(void *, mac_newctx, (void *provctx)) +OSSL_CORE_MAKE_FUNC(void *, mac_dupctx, (void *src)) +OSSL_CORE_MAKE_FUNC(void, mac_freectx, (void *mctx)) +OSSL_CORE_MAKE_FUNC(int, mac_init, (void *mctx, const unsigned char *key, size_t keylen, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, mac_update, + (void *mctx, const unsigned char *in, size_t inl)) +OSSL_CORE_MAKE_FUNC(int, mac_final, + (void *mctx, + unsigned char *out, size_t *outl, size_t outsize)) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, mac_gettable_params, (void *provctx)) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, mac_gettable_ctx_params, + (void *mctx, void *provctx)) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, mac_settable_ctx_params, + (void *mctx, void *provctx)) +OSSL_CORE_MAKE_FUNC(int, mac_get_params, (OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, mac_get_ctx_params, + (void *mctx, OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, mac_set_ctx_params, + (void *mctx, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, mac_init_skey, (void *mctx, void *key, const OSSL_PARAM params[])) + +/*- + * Symmetric key management + * + * The Key Management takes care of provider side of symmetric key objects, and + * includes essentially everything that manipulates the keys themselves and + * their parameters. + * + * The key objects are commonly referred to as |keydata|, and it MUST be able + * to contain parameters if the key has any, and the secret key. + * + * Key objects are created with OSSL_FUNC_skeymgmt_import() (there is no + * dedicated memory allocation function), exported with + * OSSL_FUNC_skeymgmt_export() and destroyed with OSSL_FUNC_keymgmt_free(). + * + */ + +/* Key data subset selection - individual bits */ +#define OSSL_SKEYMGMT_SELECT_PARAMETERS 0x01 +#define OSSL_SKEYMGMT_SELECT_SECRET_KEY 0x02 + +/* Key data subset selection - combinations */ +#define OSSL_SKEYMGMT_SELECT_ALL \ + (OSSL_SKEYMGMT_SELECT_PARAMETERS | OSSL_SKEYMGMT_SELECT_SECRET_KEY) + +#define OSSL_FUNC_SKEYMGMT_FREE 1 +#define OSSL_FUNC_SKEYMGMT_IMPORT 2 +#define OSSL_FUNC_SKEYMGMT_EXPORT 3 +#define OSSL_FUNC_SKEYMGMT_GENERATE 4 +#define OSSL_FUNC_SKEYMGMT_GET_KEY_ID 5 +#define OSSL_FUNC_SKEYMGMT_IMP_SETTABLE_PARAMS 6 +#define OSSL_FUNC_SKEYMGMT_GEN_SETTABLE_PARAMS 7 + +OSSL_CORE_MAKE_FUNC(void, skeymgmt_free, (void *keydata)) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, + skeymgmt_imp_settable_params, (void *provctx)) +OSSL_CORE_MAKE_FUNC(void *, skeymgmt_import, (void *provctx, int selection, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, skeymgmt_export, + (void *keydata, int selection, + OSSL_CALLBACK *param_cb, void *cbarg)) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, + skeymgmt_gen_settable_params, (void *provctx)) +OSSL_CORE_MAKE_FUNC(void *, skeymgmt_generate, (void *provctx, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(const char *, skeymgmt_get_key_id, (void *keydata)) + +/* KDFs and PRFs */ + +#define OSSL_FUNC_KDF_NEWCTX 1 +#define OSSL_FUNC_KDF_DUPCTX 2 +#define OSSL_FUNC_KDF_FREECTX 3 +#define OSSL_FUNC_KDF_RESET 4 +#define OSSL_FUNC_KDF_DERIVE 5 +#define OSSL_FUNC_KDF_GETTABLE_PARAMS 6 +#define OSSL_FUNC_KDF_GETTABLE_CTX_PARAMS 7 +#define OSSL_FUNC_KDF_SETTABLE_CTX_PARAMS 8 +#define OSSL_FUNC_KDF_GET_PARAMS 9 +#define OSSL_FUNC_KDF_GET_CTX_PARAMS 10 +#define OSSL_FUNC_KDF_SET_CTX_PARAMS 11 +#define OSSL_FUNC_KDF_SET_SKEY 12 +#define OSSL_FUNC_KDF_DERIVE_SKEY 13 + +OSSL_CORE_MAKE_FUNC(void *, kdf_newctx, (void *provctx)) +OSSL_CORE_MAKE_FUNC(void *, kdf_dupctx, (void *src)) +OSSL_CORE_MAKE_FUNC(void, kdf_freectx, (void *kctx)) +OSSL_CORE_MAKE_FUNC(void, kdf_reset, (void *kctx)) +OSSL_CORE_MAKE_FUNC(int, kdf_derive, (void *kctx, unsigned char *key, size_t keylen, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, kdf_gettable_params, (void *provctx)) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, kdf_gettable_ctx_params, + (void *kctx, void *provctx)) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, kdf_settable_ctx_params, + (void *kctx, void *provctx)) +OSSL_CORE_MAKE_FUNC(int, kdf_get_params, (OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, kdf_get_ctx_params, + (void *kctx, OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, kdf_set_ctx_params, + (void *kctx, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, kdf_set_skey, + (void *kctx, void *skeydata, const char *paramname)) +OSSL_CORE_MAKE_FUNC(void *, kdf_derive_skey, (void *ctx, const char *key_type, void *provctx, OSSL_FUNC_skeymgmt_import_fn *import, size_t keylen, const OSSL_PARAM params[])) + +/* RAND */ + +#define OSSL_FUNC_RAND_NEWCTX 1 +#define OSSL_FUNC_RAND_FREECTX 2 +#define OSSL_FUNC_RAND_INSTANTIATE 3 +#define OSSL_FUNC_RAND_UNINSTANTIATE 4 +#define OSSL_FUNC_RAND_GENERATE 5 +#define OSSL_FUNC_RAND_RESEED 6 +#define OSSL_FUNC_RAND_NONCE 7 +#define OSSL_FUNC_RAND_ENABLE_LOCKING 8 +#define OSSL_FUNC_RAND_LOCK 9 +#define OSSL_FUNC_RAND_UNLOCK 10 +#define OSSL_FUNC_RAND_GETTABLE_PARAMS 11 +#define OSSL_FUNC_RAND_GETTABLE_CTX_PARAMS 12 +#define OSSL_FUNC_RAND_SETTABLE_CTX_PARAMS 13 +#define OSSL_FUNC_RAND_GET_PARAMS 14 +#define OSSL_FUNC_RAND_GET_CTX_PARAMS 15 +#define OSSL_FUNC_RAND_SET_CTX_PARAMS 16 +#define OSSL_FUNC_RAND_VERIFY_ZEROIZATION 17 +#define OSSL_FUNC_RAND_GET_SEED 18 +#define OSSL_FUNC_RAND_CLEAR_SEED 19 + +OSSL_CORE_MAKE_FUNC(void *, rand_newctx, + (void *provctx, void *parent, + const OSSL_DISPATCH *parent_calls)) +OSSL_CORE_MAKE_FUNC(void, rand_freectx, (void *vctx)) +OSSL_CORE_MAKE_FUNC(int, rand_instantiate, + (void *vdrbg, unsigned int strength, + int prediction_resistance, + const unsigned char *pstr, size_t pstr_len, + const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, rand_uninstantiate, (void *vdrbg)) +OSSL_CORE_MAKE_FUNC(int, rand_generate, + (void *vctx, unsigned char *out, size_t outlen, + unsigned int strength, int prediction_resistance, + const unsigned char *addin, size_t addin_len)) +OSSL_CORE_MAKE_FUNC(int, rand_reseed, + (void *vctx, int prediction_resistance, + const unsigned char *ent, size_t ent_len, + const unsigned char *addin, size_t addin_len)) +OSSL_CORE_MAKE_FUNC(size_t, rand_nonce, + (void *vctx, unsigned char *out, unsigned int strength, + size_t min_noncelen, size_t max_noncelen)) +OSSL_CORE_MAKE_FUNC(int, rand_enable_locking, (void *vctx)) +OSSL_CORE_MAKE_FUNC(int, rand_lock, (void *vctx)) +OSSL_CORE_MAKE_FUNC(void, rand_unlock, (void *vctx)) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, rand_gettable_params, (void *provctx)) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, rand_gettable_ctx_params, + (void *vctx, void *provctx)) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, rand_settable_ctx_params, + (void *vctx, void *provctx)) +OSSL_CORE_MAKE_FUNC(int, rand_get_params, (OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, rand_get_ctx_params, + (void *vctx, OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, rand_set_ctx_params, + (void *vctx, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(void, rand_set_callbacks, + (void *vctx, OSSL_INOUT_CALLBACK *get_entropy, + OSSL_CALLBACK *cleanup_entropy, + OSSL_INOUT_CALLBACK *get_nonce, + OSSL_CALLBACK *cleanup_nonce, void *arg)) +OSSL_CORE_MAKE_FUNC(int, rand_verify_zeroization, + (void *vctx)) +OSSL_CORE_MAKE_FUNC(size_t, rand_get_seed, + (void *vctx, unsigned char **buffer, + int entropy, size_t min_len, size_t max_len, + int prediction_resistance, + const unsigned char *adin, size_t adin_len)) +OSSL_CORE_MAKE_FUNC(void, rand_clear_seed, + (void *vctx, unsigned char *buffer, size_t b_len)) + +/*- + * Key management + * + * The Key Management takes care of provider side key objects, and includes + * all current functionality to create them, destroy them, set parameters + * and key material, etc, essentially everything that manipulates the keys + * themselves and their parameters. + * + * The key objects are commonly referred to as |keydata|, and it MUST be able + * to contain parameters if the key has any, the public key and the private + * key. All parts are optional, but their presence determines what can be + * done with the key object in terms of encryption, signature, and so on. + * The assumption from libcrypto is that the key object contains any of the + * following data combinations: + * + * - parameters only + * - public key only + * - public key + private key + * - parameters + public key + * - parameters + public key + private key + * + * What "parameters", "public key" and "private key" means in detail is left + * to the implementation. In the case of DH and DSA, they would typically + * include domain parameters, while for certain variants of RSA, they would + * typically include PSS or OAEP parameters. + * + * Key objects are created with OSSL_FUNC_keymgmt_new() and destroyed with + * OSSL_FUNC_keymgmt_free(). Key objects can have data filled in with + * OSSL_FUNC_keymgmt_import(). + * + * Three functions are made available to check what selection of data is + * present in a key object: OSSL_FUNC_keymgmt_has_parameters(), + * OSSL_FUNC_keymgmt_has_public_key(), and OSSL_FUNC_keymgmt_has_private_key(), + */ + +/* Key data subset selection - individual bits */ +#define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01 +#define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02 +#define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS 0x04 +#define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS 0x80 + +/* Key data subset selection - combinations */ +#define OSSL_KEYMGMT_SELECT_ALL_PARAMETERS \ + (OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS \ + | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS) +#define OSSL_KEYMGMT_SELECT_KEYPAIR \ + (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY) +#define OSSL_KEYMGMT_SELECT_ALL \ + (OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS) + +#define OSSL_KEYMGMT_VALIDATE_FULL_CHECK 0 +#define OSSL_KEYMGMT_VALIDATE_QUICK_CHECK 1 + +/* Basic key object creation */ +#define OSSL_FUNC_KEYMGMT_NEW 1 +OSSL_CORE_MAKE_FUNC(void *, keymgmt_new, (void *provctx)) + +/* Generation, a more complex constructor */ +#define OSSL_FUNC_KEYMGMT_GEN_INIT 2 +#define OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE 3 +#define OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS 4 +#define OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS 5 +#define OSSL_FUNC_KEYMGMT_GEN 6 +#define OSSL_FUNC_KEYMGMT_GEN_CLEANUP 7 +#define OSSL_FUNC_KEYMGMT_GEN_GET_PARAMS 15 +#define OSSL_FUNC_KEYMGMT_GEN_GETTABLE_PARAMS 16 + +OSSL_CORE_MAKE_FUNC(void *, keymgmt_gen_init, + (void *provctx, int selection, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, keymgmt_gen_set_template, + (void *genctx, void *templ)) +OSSL_CORE_MAKE_FUNC(int, keymgmt_gen_set_params, + (void *genctx, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, + keymgmt_gen_settable_params, + (void *genctx, void *provctx)) +OSSL_CORE_MAKE_FUNC(int, keymgmt_gen_get_params, + (void *genctx, OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keymgmt_gen_gettable_params, + (void *genctx, void *provctx)) +OSSL_CORE_MAKE_FUNC(void *, keymgmt_gen, + (void *genctx, OSSL_CALLBACK *cb, void *cbarg)) +OSSL_CORE_MAKE_FUNC(void, keymgmt_gen_cleanup, (void *genctx)) + +/* Key loading by object reference */ +#define OSSL_FUNC_KEYMGMT_LOAD 8 +OSSL_CORE_MAKE_FUNC(void *, keymgmt_load, + (const void *reference, size_t reference_sz)) + +/* Basic key object destruction */ +#define OSSL_FUNC_KEYMGMT_FREE 10 +OSSL_CORE_MAKE_FUNC(void, keymgmt_free, (void *keydata)) + +/* Key object information, with discovery */ +#define OSSL_FUNC_KEYMGMT_GET_PARAMS 11 +#define OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS 12 +OSSL_CORE_MAKE_FUNC(int, keymgmt_get_params, + (void *keydata, OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keymgmt_gettable_params, + (void *provctx)) + +#define OSSL_FUNC_KEYMGMT_SET_PARAMS 13 +#define OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS 14 +OSSL_CORE_MAKE_FUNC(int, keymgmt_set_params, + (void *keydata, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keymgmt_settable_params, + (void *provctx)) + +/* Key checks - discovery of supported operations */ +#define OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME 20 +OSSL_CORE_MAKE_FUNC(const char *, keymgmt_query_operation_name, + (int operation_id)) + +/* Key checks - key data content checks */ +#define OSSL_FUNC_KEYMGMT_HAS 21 +OSSL_CORE_MAKE_FUNC(int, keymgmt_has, (const void *keydata, int selection)) + +/* Key checks - validation */ +#define OSSL_FUNC_KEYMGMT_VALIDATE 22 +OSSL_CORE_MAKE_FUNC(int, keymgmt_validate, (const void *keydata, int selection, int checktype)) + +/* Key checks - matching */ +#define OSSL_FUNC_KEYMGMT_MATCH 23 +OSSL_CORE_MAKE_FUNC(int, keymgmt_match, + (const void *keydata1, const void *keydata2, + int selection)) + +/* Import and export functions, with discovery */ +#define OSSL_FUNC_KEYMGMT_IMPORT 40 +#define OSSL_FUNC_KEYMGMT_IMPORT_TYPES 41 +#define OSSL_FUNC_KEYMGMT_EXPORT 42 +#define OSSL_FUNC_KEYMGMT_EXPORT_TYPES 43 +OSSL_CORE_MAKE_FUNC(int, keymgmt_import, + (void *keydata, int selection, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keymgmt_import_types, + (int selection)) +OSSL_CORE_MAKE_FUNC(int, keymgmt_export, + (void *keydata, int selection, + OSSL_CALLBACK *param_cb, void *cbarg)) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keymgmt_export_types, + (int selection)) + +/* Dup function, constructor */ +#define OSSL_FUNC_KEYMGMT_DUP 44 +OSSL_CORE_MAKE_FUNC(void *, keymgmt_dup, + (const void *keydata_from, int selection)) + +/* Extended import and export functions */ +#define OSSL_FUNC_KEYMGMT_IMPORT_TYPES_EX 45 +#define OSSL_FUNC_KEYMGMT_EXPORT_TYPES_EX 46 +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keymgmt_import_types_ex, + (void *provctx, int selection)) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keymgmt_export_types_ex, + (void *provctx, int selection)) + +/* Key Exchange */ + +#define OSSL_FUNC_KEYEXCH_NEWCTX 1 +#define OSSL_FUNC_KEYEXCH_INIT 2 +#define OSSL_FUNC_KEYEXCH_DERIVE 3 +#define OSSL_FUNC_KEYEXCH_SET_PEER 4 +#define OSSL_FUNC_KEYEXCH_FREECTX 5 +#define OSSL_FUNC_KEYEXCH_DUPCTX 6 +#define OSSL_FUNC_KEYEXCH_SET_CTX_PARAMS 7 +#define OSSL_FUNC_KEYEXCH_SETTABLE_CTX_PARAMS 8 +#define OSSL_FUNC_KEYEXCH_GET_CTX_PARAMS 9 +#define OSSL_FUNC_KEYEXCH_GETTABLE_CTX_PARAMS 10 +#define OSSL_FUNC_KEYEXCH_DERIVE_SKEY 11 + +OSSL_CORE_MAKE_FUNC(void *, keyexch_newctx, (void *provctx)) +OSSL_CORE_MAKE_FUNC(int, keyexch_init, (void *ctx, void *provkey, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, keyexch_derive, (void *ctx, unsigned char *secret, size_t *secretlen, size_t outlen)) +OSSL_CORE_MAKE_FUNC(int, keyexch_set_peer, (void *ctx, void *provkey)) +OSSL_CORE_MAKE_FUNC(void, keyexch_freectx, (void *ctx)) +OSSL_CORE_MAKE_FUNC(void *, keyexch_dupctx, (void *ctx)) +OSSL_CORE_MAKE_FUNC(int, keyexch_set_ctx_params, (void *ctx, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keyexch_settable_ctx_params, + (void *ctx, void *provctx)) +OSSL_CORE_MAKE_FUNC(int, keyexch_get_ctx_params, (void *ctx, OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keyexch_gettable_ctx_params, + (void *ctx, void *provctx)) +OSSL_CORE_MAKE_FUNC(void *, keyexch_derive_skey, (void *ctx, const char *key_type, void *provctx, OSSL_FUNC_skeymgmt_import_fn *import, size_t keylen, const OSSL_PARAM params[])) + +/* Signature */ + +#define OSSL_FUNC_SIGNATURE_NEWCTX 1 +#define OSSL_FUNC_SIGNATURE_SIGN_INIT 2 +#define OSSL_FUNC_SIGNATURE_SIGN 3 +#define OSSL_FUNC_SIGNATURE_VERIFY_INIT 4 +#define OSSL_FUNC_SIGNATURE_VERIFY 5 +#define OSSL_FUNC_SIGNATURE_VERIFY_RECOVER_INIT 6 +#define OSSL_FUNC_SIGNATURE_VERIFY_RECOVER 7 +#define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_INIT 8 +#define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_UPDATE 9 +#define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_FINAL 10 +#define OSSL_FUNC_SIGNATURE_DIGEST_SIGN 11 +#define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_INIT 12 +#define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_UPDATE 13 +#define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_FINAL 14 +#define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY 15 +#define OSSL_FUNC_SIGNATURE_FREECTX 16 +#define OSSL_FUNC_SIGNATURE_DUPCTX 17 +#define OSSL_FUNC_SIGNATURE_GET_CTX_PARAMS 18 +#define OSSL_FUNC_SIGNATURE_GETTABLE_CTX_PARAMS 19 +#define OSSL_FUNC_SIGNATURE_SET_CTX_PARAMS 20 +#define OSSL_FUNC_SIGNATURE_SETTABLE_CTX_PARAMS 21 +#define OSSL_FUNC_SIGNATURE_GET_CTX_MD_PARAMS 22 +#define OSSL_FUNC_SIGNATURE_GETTABLE_CTX_MD_PARAMS 23 +#define OSSL_FUNC_SIGNATURE_SET_CTX_MD_PARAMS 24 +#define OSSL_FUNC_SIGNATURE_SETTABLE_CTX_MD_PARAMS 25 +#define OSSL_FUNC_SIGNATURE_QUERY_KEY_TYPES 26 +#define OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_INIT 27 +#define OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_UPDATE 28 +#define OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_FINAL 29 +#define OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_INIT 30 +#define OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_UPDATE 31 +#define OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_FINAL 32 + +OSSL_CORE_MAKE_FUNC(void *, signature_newctx, (void *provctx, const char *propq)) +OSSL_CORE_MAKE_FUNC(int, signature_sign_init, (void *ctx, void *provkey, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, signature_sign, (void *ctx, unsigned char *sig, size_t *siglen, size_t sigsize, const unsigned char *tbs, size_t tbslen)) +OSSL_CORE_MAKE_FUNC(int, signature_sign_message_init, + (void *ctx, void *provkey, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, signature_sign_message_update, + (void *ctx, const unsigned char *in, size_t inlen)) +OSSL_CORE_MAKE_FUNC(int, signature_sign_message_final, + (void *ctx, unsigned char *sig, + size_t *siglen, size_t sigsize)) +OSSL_CORE_MAKE_FUNC(int, signature_verify_init, (void *ctx, void *provkey, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, signature_verify, (void *ctx, const unsigned char *sig, size_t siglen, const unsigned char *tbs, size_t tbslen)) +OSSL_CORE_MAKE_FUNC(int, signature_verify_message_init, + (void *ctx, void *provkey, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, signature_verify_message_update, + (void *ctx, const unsigned char *in, size_t inlen)) +/* + * signature_verify_final requires that the signature to be verified against + * is specified via an OSSL_PARAM. + */ +OSSL_CORE_MAKE_FUNC(int, signature_verify_message_final, (void *ctx)) +OSSL_CORE_MAKE_FUNC(int, signature_verify_recover_init, + (void *ctx, void *provkey, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, signature_verify_recover, + (void *ctx, unsigned char *rout, size_t *routlen, + size_t routsize, const unsigned char *sig, size_t siglen)) +OSSL_CORE_MAKE_FUNC(int, signature_digest_sign_init, + (void *ctx, const char *mdname, void *provkey, + const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, signature_digest_sign_update, + (void *ctx, const unsigned char *data, size_t datalen)) +OSSL_CORE_MAKE_FUNC(int, signature_digest_sign_final, + (void *ctx, unsigned char *sig, size_t *siglen, + size_t sigsize)) +OSSL_CORE_MAKE_FUNC(int, signature_digest_sign, + (void *ctx, unsigned char *sigret, size_t *siglen, + size_t sigsize, const unsigned char *tbs, size_t tbslen)) +OSSL_CORE_MAKE_FUNC(int, signature_digest_verify_init, + (void *ctx, const char *mdname, void *provkey, + const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, signature_digest_verify_update, + (void *ctx, const unsigned char *data, size_t datalen)) +OSSL_CORE_MAKE_FUNC(int, signature_digest_verify_final, + (void *ctx, const unsigned char *sig, size_t siglen)) +OSSL_CORE_MAKE_FUNC(int, signature_digest_verify, + (void *ctx, const unsigned char *sig, size_t siglen, + const unsigned char *tbs, size_t tbslen)) +OSSL_CORE_MAKE_FUNC(void, signature_freectx, (void *ctx)) +OSSL_CORE_MAKE_FUNC(void *, signature_dupctx, (void *ctx)) +OSSL_CORE_MAKE_FUNC(int, signature_get_ctx_params, + (void *ctx, OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, signature_gettable_ctx_params, + (void *ctx, void *provctx)) +OSSL_CORE_MAKE_FUNC(int, signature_set_ctx_params, + (void *ctx, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, signature_settable_ctx_params, + (void *ctx, void *provctx)) +OSSL_CORE_MAKE_FUNC(int, signature_get_ctx_md_params, + (void *ctx, OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, signature_gettable_ctx_md_params, + (void *ctx)) +OSSL_CORE_MAKE_FUNC(int, signature_set_ctx_md_params, + (void *ctx, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, signature_settable_ctx_md_params, + (void *ctx)) +OSSL_CORE_MAKE_FUNC(const char **, signature_query_key_types, (void)) + +/* Asymmetric Ciphers */ + +#define OSSL_FUNC_ASYM_CIPHER_NEWCTX 1 +#define OSSL_FUNC_ASYM_CIPHER_ENCRYPT_INIT 2 +#define OSSL_FUNC_ASYM_CIPHER_ENCRYPT 3 +#define OSSL_FUNC_ASYM_CIPHER_DECRYPT_INIT 4 +#define OSSL_FUNC_ASYM_CIPHER_DECRYPT 5 +#define OSSL_FUNC_ASYM_CIPHER_FREECTX 6 +#define OSSL_FUNC_ASYM_CIPHER_DUPCTX 7 +#define OSSL_FUNC_ASYM_CIPHER_GET_CTX_PARAMS 8 +#define OSSL_FUNC_ASYM_CIPHER_GETTABLE_CTX_PARAMS 9 +#define OSSL_FUNC_ASYM_CIPHER_SET_CTX_PARAMS 10 +#define OSSL_FUNC_ASYM_CIPHER_SETTABLE_CTX_PARAMS 11 + +OSSL_CORE_MAKE_FUNC(void *, asym_cipher_newctx, (void *provctx)) +OSSL_CORE_MAKE_FUNC(int, asym_cipher_encrypt_init, (void *ctx, void *provkey, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, asym_cipher_encrypt, (void *ctx, unsigned char *out, size_t *outlen, size_t outsize, const unsigned char *in, size_t inlen)) +OSSL_CORE_MAKE_FUNC(int, asym_cipher_decrypt_init, (void *ctx, void *provkey, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, asym_cipher_decrypt, (void *ctx, unsigned char *out, size_t *outlen, size_t outsize, const unsigned char *in, size_t inlen)) +OSSL_CORE_MAKE_FUNC(void, asym_cipher_freectx, (void *ctx)) +OSSL_CORE_MAKE_FUNC(void *, asym_cipher_dupctx, (void *ctx)) +OSSL_CORE_MAKE_FUNC(int, asym_cipher_get_ctx_params, + (void *ctx, OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, asym_cipher_gettable_ctx_params, + (void *ctx, void *provctx)) +OSSL_CORE_MAKE_FUNC(int, asym_cipher_set_ctx_params, + (void *ctx, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, asym_cipher_settable_ctx_params, + (void *ctx, void *provctx)) + +/* Asymmetric Key encapsulation */ +#define OSSL_FUNC_KEM_NEWCTX 1 +#define OSSL_FUNC_KEM_ENCAPSULATE_INIT 2 +#define OSSL_FUNC_KEM_ENCAPSULATE 3 +#define OSSL_FUNC_KEM_DECAPSULATE_INIT 4 +#define OSSL_FUNC_KEM_DECAPSULATE 5 +#define OSSL_FUNC_KEM_FREECTX 6 +#define OSSL_FUNC_KEM_DUPCTX 7 +#define OSSL_FUNC_KEM_GET_CTX_PARAMS 8 +#define OSSL_FUNC_KEM_GETTABLE_CTX_PARAMS 9 +#define OSSL_FUNC_KEM_SET_CTX_PARAMS 10 +#define OSSL_FUNC_KEM_SETTABLE_CTX_PARAMS 11 +#define OSSL_FUNC_KEM_AUTH_ENCAPSULATE_INIT 12 +#define OSSL_FUNC_KEM_AUTH_DECAPSULATE_INIT 13 + +OSSL_CORE_MAKE_FUNC(void *, kem_newctx, (void *provctx)) +OSSL_CORE_MAKE_FUNC(int, kem_encapsulate_init, (void *ctx, void *provkey, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, kem_auth_encapsulate_init, (void *ctx, void *provkey, void *authprivkey, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, kem_encapsulate, (void *ctx, unsigned char *out, size_t *outlen, unsigned char *secret, size_t *secretlen)) +OSSL_CORE_MAKE_FUNC(int, kem_decapsulate_init, (void *ctx, void *provkey, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, kem_auth_decapsulate_init, (void *ctx, void *provkey, void *authpubkey, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, kem_decapsulate, (void *ctx, unsigned char *out, size_t *outlen, const unsigned char *in, size_t inlen)) +OSSL_CORE_MAKE_FUNC(void, kem_freectx, (void *ctx)) +OSSL_CORE_MAKE_FUNC(void *, kem_dupctx, (void *ctx)) +OSSL_CORE_MAKE_FUNC(int, kem_get_ctx_params, (void *ctx, OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, kem_gettable_ctx_params, + (void *ctx, void *provctx)) +OSSL_CORE_MAKE_FUNC(int, kem_set_ctx_params, + (void *ctx, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, kem_settable_ctx_params, + (void *ctx, void *provctx)) + +/* Encoders and decoders */ +#define OSSL_FUNC_ENCODER_NEWCTX 1 +#define OSSL_FUNC_ENCODER_FREECTX 2 +#define OSSL_FUNC_ENCODER_GET_PARAMS 3 +#define OSSL_FUNC_ENCODER_GETTABLE_PARAMS 4 +#define OSSL_FUNC_ENCODER_SET_CTX_PARAMS 5 +#define OSSL_FUNC_ENCODER_SETTABLE_CTX_PARAMS 6 +#define OSSL_FUNC_ENCODER_DOES_SELECTION 10 +#define OSSL_FUNC_ENCODER_ENCODE 11 +#define OSSL_FUNC_ENCODER_IMPORT_OBJECT 20 +#define OSSL_FUNC_ENCODER_FREE_OBJECT 21 +OSSL_CORE_MAKE_FUNC(void *, encoder_newctx, (void *provctx)) +OSSL_CORE_MAKE_FUNC(void, encoder_freectx, (void *ctx)) +OSSL_CORE_MAKE_FUNC(int, encoder_get_params, (OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, encoder_gettable_params, + (void *provctx)) +OSSL_CORE_MAKE_FUNC(int, encoder_set_ctx_params, + (void *ctx, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, encoder_settable_ctx_params, + (void *provctx)) + +OSSL_CORE_MAKE_FUNC(int, encoder_does_selection, + (void *provctx, int selection)) +OSSL_CORE_MAKE_FUNC(int, encoder_encode, + (void *ctx, OSSL_CORE_BIO *out, + const void *obj_raw, const OSSL_PARAM obj_abstract[], + int selection, + OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg)) + +OSSL_CORE_MAKE_FUNC(void *, encoder_import_object, + (void *ctx, int selection, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(void, encoder_free_object, (void *obj)) + +#define OSSL_FUNC_DECODER_NEWCTX 1 +#define OSSL_FUNC_DECODER_FREECTX 2 +#define OSSL_FUNC_DECODER_GET_PARAMS 3 +#define OSSL_FUNC_DECODER_GETTABLE_PARAMS 4 +#define OSSL_FUNC_DECODER_SET_CTX_PARAMS 5 +#define OSSL_FUNC_DECODER_SETTABLE_CTX_PARAMS 6 +#define OSSL_FUNC_DECODER_DOES_SELECTION 10 +#define OSSL_FUNC_DECODER_DECODE 11 +#define OSSL_FUNC_DECODER_EXPORT_OBJECT 20 +OSSL_CORE_MAKE_FUNC(void *, decoder_newctx, (void *provctx)) +OSSL_CORE_MAKE_FUNC(void, decoder_freectx, (void *ctx)) +OSSL_CORE_MAKE_FUNC(int, decoder_get_params, (OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, decoder_gettable_params, + (void *provctx)) +OSSL_CORE_MAKE_FUNC(int, decoder_set_ctx_params, + (void *ctx, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, decoder_settable_ctx_params, + (void *provctx)) + +OSSL_CORE_MAKE_FUNC(int, decoder_does_selection, + (void *provctx, int selection)) +OSSL_CORE_MAKE_FUNC(int, decoder_decode, + (void *ctx, OSSL_CORE_BIO *in, int selection, + OSSL_CALLBACK *data_cb, void *data_cbarg, + OSSL_PASSPHRASE_CALLBACK *pw_cb, void *pw_cbarg)) +OSSL_CORE_MAKE_FUNC(int, decoder_export_object, + (void *ctx, const void *objref, size_t objref_sz, + OSSL_CALLBACK *export_cb, void *export_cbarg)) + +/*- + * Store + * + * Objects are scanned by using the 'open', 'load', 'eof' and 'close' + * functions, which implement an OSSL_STORE loader. + * + * store_load() works in a way that's very similar to the decoders, in + * that they pass an abstract object through a callback, either as a DER + * octet string or as an object reference, which libcrypto will have to + * deal with. + */ + +#define OSSL_FUNC_STORE_OPEN 1 +#define OSSL_FUNC_STORE_ATTACH 2 +#define OSSL_FUNC_STORE_SETTABLE_CTX_PARAMS 3 +#define OSSL_FUNC_STORE_SET_CTX_PARAMS 4 +#define OSSL_FUNC_STORE_LOAD 5 +#define OSSL_FUNC_STORE_EOF 6 +#define OSSL_FUNC_STORE_CLOSE 7 +#define OSSL_FUNC_STORE_EXPORT_OBJECT 8 +#define OSSL_FUNC_STORE_DELETE 9 +#define OSSL_FUNC_STORE_OPEN_EX 10 +OSSL_CORE_MAKE_FUNC(void *, store_open, (void *provctx, const char *uri)) +OSSL_CORE_MAKE_FUNC(void *, store_attach, (void *provctx, OSSL_CORE_BIO *in)) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, store_settable_ctx_params, + (void *provctx)) +OSSL_CORE_MAKE_FUNC(int, store_set_ctx_params, + (void *loaderctx, const OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, store_load, + (void *loaderctx, + OSSL_CALLBACK *object_cb, void *object_cbarg, + OSSL_PASSPHRASE_CALLBACK *pw_cb, void *pw_cbarg)) +OSSL_CORE_MAKE_FUNC(int, store_eof, (void *loaderctx)) +OSSL_CORE_MAKE_FUNC(int, store_close, (void *loaderctx)) +OSSL_CORE_MAKE_FUNC(int, store_export_object, + (void *loaderctx, const void *objref, size_t objref_sz, + OSSL_CALLBACK *export_cb, void *export_cbarg)) +OSSL_CORE_MAKE_FUNC(int, store_delete, + (void *provctx, const char *uri, const OSSL_PARAM params[], + OSSL_PASSPHRASE_CALLBACK *pw_cb, void *pw_cbarg)) +OSSL_CORE_MAKE_FUNC(void *, store_open_ex, + (void *provctx, const char *uri, const OSSL_PARAM params[], + OSSL_PASSPHRASE_CALLBACK *pw_cb, void *pw_cbarg)) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/core_names.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/core_names.h new file mode 100644 index 0000000000000000000000000000000000000000..ba444dcaf61b6dc1305d9ede0410b3efbf56cf63 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/core_names.h @@ -0,0 +1,588 @@ +/* + * WARNING: do not edit! + * Generated by makefile from include\openssl\core_names.h.in + * + * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ +/* clang-format off */ + +/* clang-format on */ + +#ifndef OPENSSL_CORE_NAMES_H +#define OPENSSL_CORE_NAMES_H +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +/* OSSL_CIPHER_PARAM_CTS_MODE Values */ +#define OSSL_CIPHER_CTS_MODE_CS1 "CS1" +#define OSSL_CIPHER_CTS_MODE_CS2 "CS2" +#define OSSL_CIPHER_CTS_MODE_CS3 "CS3" + +/* Known CIPHER names (not a complete list) */ +#define OSSL_CIPHER_NAME_AES_128_GCM_SIV "AES-128-GCM-SIV" +#define OSSL_CIPHER_NAME_AES_192_GCM_SIV "AES-192-GCM-SIV" +#define OSSL_CIPHER_NAME_AES_256_GCM_SIV "AES-256-GCM-SIV" + +/* Known DIGEST names (not a complete list) */ +#define OSSL_DIGEST_NAME_MD5 "MD5" +#define OSSL_DIGEST_NAME_MD5_SHA1 "MD5-SHA1" +#define OSSL_DIGEST_NAME_SHA1 "SHA1" +#define OSSL_DIGEST_NAME_SHA2_224 "SHA2-224" +#define OSSL_DIGEST_NAME_SHA2_256 "SHA2-256" +#define OSSL_DIGEST_NAME_SHA2_256_192 "SHA2-256/192" +#define OSSL_DIGEST_NAME_SHA2_384 "SHA2-384" +#define OSSL_DIGEST_NAME_SHA2_512 "SHA2-512" +#define OSSL_DIGEST_NAME_SHA2_512_224 "SHA2-512/224" +#define OSSL_DIGEST_NAME_SHA2_512_256 "SHA2-512/256" +#define OSSL_DIGEST_NAME_MD2 "MD2" +#define OSSL_DIGEST_NAME_MD4 "MD4" +#define OSSL_DIGEST_NAME_MDC2 "MDC2" +#define OSSL_DIGEST_NAME_RIPEMD160 "RIPEMD160" +#define OSSL_DIGEST_NAME_SHA3_224 "SHA3-224" +#define OSSL_DIGEST_NAME_SHA3_256 "SHA3-256" +#define OSSL_DIGEST_NAME_SHA3_384 "SHA3-384" +#define OSSL_DIGEST_NAME_SHA3_512 "SHA3-512" +#define OSSL_DIGEST_NAME_KECCAK_KMAC128 "KECCAK-KMAC-128" +#define OSSL_DIGEST_NAME_KECCAK_KMAC256 "KECCAK-KMAC-256" +#define OSSL_DIGEST_NAME_SM3 "SM3" + +/* Known MAC names */ +#define OSSL_MAC_NAME_BLAKE2BMAC "BLAKE2BMAC" +#define OSSL_MAC_NAME_BLAKE2SMAC "BLAKE2SMAC" +#define OSSL_MAC_NAME_CMAC "CMAC" +#define OSSL_MAC_NAME_GMAC "GMAC" +#define OSSL_MAC_NAME_HMAC "HMAC" +#define OSSL_MAC_NAME_KMAC128 "KMAC128" +#define OSSL_MAC_NAME_KMAC256 "KMAC256" +#define OSSL_MAC_NAME_POLY1305 "POLY1305" +#define OSSL_MAC_NAME_SIPHASH "SIPHASH" + +/* Known KDF names */ +#define OSSL_KDF_NAME_HKDF "HKDF" +#define OSSL_KDF_NAME_HKDF_SHA256 "HKDF-SHA256" +#define OSSL_KDF_NAME_HKDF_SHA384 "HKDF-SHA384" +#define OSSL_KDF_NAME_HKDF_SHA512 "HKDF-SHA512" +#define OSSL_KDF_NAME_TLS1_3_KDF "TLS13-KDF" +#define OSSL_KDF_NAME_PBKDF1 "PBKDF1" +#define OSSL_KDF_NAME_PBKDF2 "PBKDF2" +#define OSSL_KDF_NAME_SCRYPT "SCRYPT" +#define OSSL_KDF_NAME_SSHKDF "SSHKDF" +#define OSSL_KDF_NAME_SSKDF "SSKDF" +#define OSSL_KDF_NAME_TLS1_PRF "TLS1-PRF" +#define OSSL_KDF_NAME_X942KDF_ASN1 "X942KDF-ASN1" +#define OSSL_KDF_NAME_X942KDF_CONCAT "X942KDF-CONCAT" +#define OSSL_KDF_NAME_X963KDF "X963KDF" +#define OSSL_KDF_NAME_KBKDF "KBKDF" +#define OSSL_KDF_NAME_KRB5KDF "KRB5KDF" +#define OSSL_KDF_NAME_HMACDRBGKDF "HMAC-DRBG-KDF" + +/* RSA padding modes */ +#define OSSL_PKEY_RSA_PAD_MODE_NONE "none" +#define OSSL_PKEY_RSA_PAD_MODE_PKCSV15 "pkcs1" +#define OSSL_PKEY_RSA_PAD_MODE_OAEP "oaep" +#define OSSL_PKEY_RSA_PAD_MODE_X931 "x931" +#define OSSL_PKEY_RSA_PAD_MODE_PSS "pss" + +/* RSA pss padding salt length */ +#define OSSL_PKEY_RSA_PSS_SALT_LEN_DIGEST "digest" +#define OSSL_PKEY_RSA_PSS_SALT_LEN_MAX "max" +#define OSSL_PKEY_RSA_PSS_SALT_LEN_AUTO "auto" +#define OSSL_PKEY_RSA_PSS_SALT_LEN_AUTO_DIGEST_MAX "auto-digestmax" + +/* OSSL_PKEY_PARAM_EC_ENCODING values */ +#define OSSL_PKEY_EC_ENCODING_EXPLICIT "explicit" +#define OSSL_PKEY_EC_ENCODING_GROUP "named_curve" + +#define OSSL_PKEY_EC_POINT_CONVERSION_FORMAT_UNCOMPRESSED "uncompressed" +#define OSSL_PKEY_EC_POINT_CONVERSION_FORMAT_COMPRESSED "compressed" +#define OSSL_PKEY_EC_POINT_CONVERSION_FORMAT_HYBRID "hybrid" + +#define OSSL_PKEY_EC_GROUP_CHECK_DEFAULT "default" +#define OSSL_PKEY_EC_GROUP_CHECK_NAMED "named" +#define OSSL_PKEY_EC_GROUP_CHECK_NAMED_NIST "named-nist" + +/* PROV_SKEY well known key types */ +#define OSSL_SKEY_TYPE_GENERIC "GENERIC-SECRET" +#define OSSL_SKEY_TYPE_AES "AES" + +/* OSSL_KEM_PARAM_OPERATION values */ +#define OSSL_KEM_PARAM_OPERATION_RSASVE "RSASVE" +#define OSSL_KEM_PARAM_OPERATION_DHKEM "DHKEM" + +/* Provider configuration variables */ +#define OSSL_PKEY_RETAIN_SEED "pkey_retain_seed" + +/* Parameter name definitions - generated by util/perl/OpenSSL/paramnames.pm */ +/* clang-format off */ +# define OSSL_ALG_PARAM_ALGORITHM_ID "algorithm-id" +# define OSSL_ALG_PARAM_ALGORITHM_ID_PARAMS "algorithm-id-params" +# define OSSL_ALG_PARAM_CIPHER "cipher" +# define OSSL_ALG_PARAM_DIGEST "digest" +# define OSSL_ALG_PARAM_ENGINE "engine" +# define OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR "fips-indicator" +# define OSSL_ALG_PARAM_MAC "mac" +# define OSSL_ALG_PARAM_PROPERTIES "properties" +# define OSSL_ALG_PARAM_SECURITY_CATEGORY "security-category" +# define OSSL_ASYM_CIPHER_PARAM_DIGEST OSSL_PKEY_PARAM_DIGEST +# define OSSL_ASYM_CIPHER_PARAM_ENGINE OSSL_PKEY_PARAM_ENGINE +# define OSSL_ASYM_CIPHER_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR +# define OSSL_ASYM_CIPHER_PARAM_FIPS_KEY_CHECK OSSL_PKEY_PARAM_FIPS_KEY_CHECK +# define OSSL_ASYM_CIPHER_PARAM_FIPS_RSA_PKCS15_PAD_DISABLED OSSL_PROV_PARAM_RSA_PKCS15_PAD_DISABLED +# define OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION "implicit-rejection" +# define OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST OSSL_PKEY_PARAM_MGF1_DIGEST +# define OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST_PROPS OSSL_PKEY_PARAM_MGF1_PROPERTIES +# define OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST OSSL_ALG_PARAM_DIGEST +# define OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST_PROPS "digest-props" +# define OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL "oaep-label" +# define OSSL_ASYM_CIPHER_PARAM_PAD_MODE OSSL_PKEY_PARAM_PAD_MODE +# define OSSL_ASYM_CIPHER_PARAM_PROPERTIES OSSL_PKEY_PARAM_PROPERTIES +# define OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION "tls-client-version" +# define OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION "tls-negotiated-version" +# define OSSL_CAPABILITY_TLS_GROUP_ALG "tls-group-alg" +# define OSSL_CAPABILITY_TLS_GROUP_ID "tls-group-id" +# define OSSL_CAPABILITY_TLS_GROUP_IS_KEM "tls-group-is-kem" +# define OSSL_CAPABILITY_TLS_GROUP_MAX_DTLS "tls-max-dtls" +# define OSSL_CAPABILITY_TLS_GROUP_MAX_TLS "tls-max-tls" +# define OSSL_CAPABILITY_TLS_GROUP_MIN_DTLS "tls-min-dtls" +# define OSSL_CAPABILITY_TLS_GROUP_MIN_TLS "tls-min-tls" +# define OSSL_CAPABILITY_TLS_GROUP_NAME "tls-group-name" +# define OSSL_CAPABILITY_TLS_GROUP_NAME_INTERNAL "tls-group-name-internal" +# define OSSL_CAPABILITY_TLS_GROUP_SECURITY_BITS "tls-group-sec-bits" +# define OSSL_CAPABILITY_TLS_SIGALG_CODE_POINT "tls-sigalg-code-point" +# define OSSL_CAPABILITY_TLS_SIGALG_HASH_NAME "tls-sigalg-hash-name" +# define OSSL_CAPABILITY_TLS_SIGALG_HASH_OID "tls-sigalg-hash-oid" +# define OSSL_CAPABILITY_TLS_SIGALG_IANA_NAME "tls-sigalg-iana-name" +# define OSSL_CAPABILITY_TLS_SIGALG_KEYTYPE "tls-sigalg-keytype" +# define OSSL_CAPABILITY_TLS_SIGALG_KEYTYPE_OID "tls-sigalg-keytype-oid" +# define OSSL_CAPABILITY_TLS_SIGALG_MAX_DTLS "tls-max-dtls" +# define OSSL_CAPABILITY_TLS_SIGALG_MAX_TLS "tls-max-tls" +# define OSSL_CAPABILITY_TLS_SIGALG_MIN_DTLS "tls-min-dtls" +# define OSSL_CAPABILITY_TLS_SIGALG_MIN_TLS "tls-min-tls" +# define OSSL_CAPABILITY_TLS_SIGALG_NAME "tls-sigalg-name" +# define OSSL_CAPABILITY_TLS_SIGALG_OID "tls-sigalg-oid" +# define OSSL_CAPABILITY_TLS_SIGALG_SECURITY_BITS "tls-sigalg-sec-bits" +# define OSSL_CAPABILITY_TLS_SIGALG_SIG_NAME "tls-sigalg-sig-name" +# define OSSL_CAPABILITY_TLS_SIGALG_SIG_OID "tls-sigalg-sig-oid" +# define OSSL_CIPHER_HMAC_PARAM_MAC OSSL_CIPHER_PARAM_AEAD_TAG +# define OSSL_CIPHER_PARAM_AEAD "aead" +# define OSSL_CIPHER_PARAM_AEAD_IVLEN OSSL_CIPHER_PARAM_IVLEN +# define OSSL_CIPHER_PARAM_AEAD_IV_GENERATED "iv-generated" +# define OSSL_CIPHER_PARAM_AEAD_MAC_KEY "mackey" +# define OSSL_CIPHER_PARAM_AEAD_TAG "tag" +# define OSSL_CIPHER_PARAM_AEAD_TAGLEN "taglen" +# define OSSL_CIPHER_PARAM_AEAD_TLS1_AAD "tlsaad" +# define OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD "tlsaadpad" +# define OSSL_CIPHER_PARAM_AEAD_TLS1_GET_IV_GEN "tlsivgen" +# define OSSL_CIPHER_PARAM_AEAD_TLS1_IV_FIXED "tlsivfixed" +# define OSSL_CIPHER_PARAM_AEAD_TLS1_SET_IV_INV "tlsivinv" +# define OSSL_CIPHER_PARAM_ALGORITHM_ID OSSL_ALG_PARAM_ALGORITHM_ID +# define OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS OSSL_ALG_PARAM_ALGORITHM_ID_PARAMS +# define OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS_OLD "alg_id_param" +# define OSSL_CIPHER_PARAM_BLOCK_SIZE "blocksize" +# define OSSL_CIPHER_PARAM_CTS "cts" +# define OSSL_CIPHER_PARAM_CTS_MODE "cts_mode" +# define OSSL_CIPHER_PARAM_CUSTOM_IV "custom-iv" +# define OSSL_CIPHER_PARAM_DECRYPT_ONLY "decrypt-only" +# define OSSL_CIPHER_PARAM_ENCRYPT_THEN_MAC "encrypt-then-mac" +# define OSSL_CIPHER_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR +# define OSSL_CIPHER_PARAM_FIPS_ENCRYPT_CHECK "encrypt-check" +# define OSSL_CIPHER_PARAM_HAS_RAND_KEY "has-randkey" +# define OSSL_CIPHER_PARAM_IV "iv" +# define OSSL_CIPHER_PARAM_IVLEN "ivlen" +# define OSSL_CIPHER_PARAM_KEYLEN "keylen" +# define OSSL_CIPHER_PARAM_MODE "mode" +# define OSSL_CIPHER_PARAM_NUM "num" +# define OSSL_CIPHER_PARAM_PADDING "padding" +# define OSSL_CIPHER_PARAM_PIPELINE_AEAD_TAG "pipeline-tag" +# define OSSL_CIPHER_PARAM_RANDOM_KEY "randkey" +# define OSSL_CIPHER_PARAM_RC2_KEYBITS "keybits" +# define OSSL_CIPHER_PARAM_ROUNDS "rounds" +# define OSSL_CIPHER_PARAM_SPEED "speed" +# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK "tls-multi" +# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD "tls1multi_aad" +# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD_PACKLEN "tls1multi_aadpacklen" +# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC "tls1multi_enc" +# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_IN "tls1multi_encin" +# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_LEN "tls1multi_enclen" +# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE "tls1multi_interleave" +# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_BUFSIZE "tls1multi_maxbufsz" +# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_SEND_FRAGMENT "tls1multi_maxsndfrag" +# define OSSL_CIPHER_PARAM_TLS_MAC "tls-mac" +# define OSSL_CIPHER_PARAM_TLS_MAC_SIZE "tls-mac-size" +# define OSSL_CIPHER_PARAM_TLS_VERSION "tls-version" +# define OSSL_CIPHER_PARAM_UPDATED_IV "updated-iv" +# define OSSL_CIPHER_PARAM_USE_BITS "use-bits" +# define OSSL_CIPHER_PARAM_XTS_STANDARD "xts_standard" +# define OSSL_DECODER_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES +# define OSSL_DIGEST_PARAM_ALGID_ABSENT "algid-absent" +# define OSSL_DIGEST_PARAM_BLOCK_SIZE "blocksize" +# define OSSL_DIGEST_PARAM_MICALG "micalg" +# define OSSL_DIGEST_PARAM_PAD_TYPE "pad-type" +# define OSSL_DIGEST_PARAM_SIZE "size" +# define OSSL_DIGEST_PARAM_SSL3_MS "ssl3-ms" +# define OSSL_DIGEST_PARAM_XOF "xof" +# define OSSL_DIGEST_PARAM_XOFLEN "xoflen" +# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER +# define OSSL_DRBG_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST +# define OSSL_DRBG_PARAM_ENTROPY_REQUIRED "entropy_required" +# define OSSL_DRBG_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR +# define OSSL_DRBG_PARAM_FIPS_DIGEST_CHECK OSSL_PKEY_PARAM_FIPS_DIGEST_CHECK +# define OSSL_DRBG_PARAM_MAC OSSL_ALG_PARAM_MAC +# define OSSL_DRBG_PARAM_MAX_ADINLEN "max_adinlen" +# define OSSL_DRBG_PARAM_MAX_ENTROPYLEN "max_entropylen" +# define OSSL_DRBG_PARAM_MAX_LENGTH "maxium_length" +# define OSSL_DRBG_PARAM_MAX_NONCELEN "max_noncelen" +# define OSSL_DRBG_PARAM_MAX_PERSLEN "max_perslen" +# define OSSL_DRBG_PARAM_MIN_ENTROPYLEN "min_entropylen" +# define OSSL_DRBG_PARAM_MIN_LENGTH "minium_length" +# define OSSL_DRBG_PARAM_MIN_NONCELEN "min_noncelen" +# define OSSL_DRBG_PARAM_PREDICTION_RESISTANCE "prediction_resistance" +# define OSSL_DRBG_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES +# define OSSL_DRBG_PARAM_RANDOM_DATA "random_data" +# define OSSL_DRBG_PARAM_RESEED_COUNTER "reseed_counter" +# define OSSL_DRBG_PARAM_RESEED_REQUESTS "reseed_requests" +# define OSSL_DRBG_PARAM_RESEED_TIME "reseed_time" +# define OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL "reseed_time_interval" +# define OSSL_DRBG_PARAM_SIZE "size" +# define OSSL_DRBG_PARAM_USE_DF "use_derivation_function" +# define OSSL_ENCODER_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER +# define OSSL_ENCODER_PARAM_ENCRYPT_LEVEL "encrypt-level" +# define OSSL_ENCODER_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES +# define OSSL_ENCODER_PARAM_SAVE_PARAMETERS "save-parameters" +# define OSSL_EXCHANGE_PARAM_EC_ECDH_COFACTOR_MODE "ecdh-cofactor-mode" +# define OSSL_EXCHANGE_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR +# define OSSL_EXCHANGE_PARAM_FIPS_DIGEST_CHECK OSSL_PKEY_PARAM_FIPS_DIGEST_CHECK +# define OSSL_EXCHANGE_PARAM_FIPS_ECDH_COFACTOR_CHECK OSSL_PROV_PARAM_ECDH_COFACTOR_CHECK +# define OSSL_EXCHANGE_PARAM_FIPS_KEY_CHECK OSSL_PKEY_PARAM_FIPS_KEY_CHECK +# define OSSL_EXCHANGE_PARAM_KDF_DIGEST "kdf-digest" +# define OSSL_EXCHANGE_PARAM_KDF_DIGEST_PROPS "kdf-digest-props" +# define OSSL_EXCHANGE_PARAM_KDF_OUTLEN "kdf-outlen" +# define OSSL_EXCHANGE_PARAM_KDF_TYPE "kdf-type" +# define OSSL_EXCHANGE_PARAM_KDF_UKM "kdf-ukm" +# define OSSL_EXCHANGE_PARAM_PAD "pad" +# define OSSL_GEN_PARAM_ITERATION "iteration" +# define OSSL_GEN_PARAM_POTENTIAL "potential" +# define OSSL_KDF_PARAM_ARGON2_AD "ad" +# define OSSL_KDF_PARAM_ARGON2_LANES "lanes" +# define OSSL_KDF_PARAM_ARGON2_MEMCOST "memcost" +# define OSSL_KDF_PARAM_ARGON2_VERSION "version" +# define OSSL_KDF_PARAM_CEK_ALG "cekalg" +# define OSSL_KDF_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER +# define OSSL_KDF_PARAM_CONSTANT "constant" +# define OSSL_KDF_PARAM_DATA "data" +# define OSSL_KDF_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST +# define OSSL_KDF_PARAM_EARLY_CLEAN "early_clean" +# define OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR +# define OSSL_KDF_PARAM_FIPS_DIGEST_CHECK OSSL_PKEY_PARAM_FIPS_DIGEST_CHECK +# define OSSL_KDF_PARAM_FIPS_EMS_CHECK "ems_check" +# define OSSL_KDF_PARAM_FIPS_KEY_CHECK OSSL_PKEY_PARAM_FIPS_KEY_CHECK +# define OSSL_KDF_PARAM_HMACDRBG_ENTROPY "entropy" +# define OSSL_KDF_PARAM_HMACDRBG_NONCE "nonce" +# define OSSL_KDF_PARAM_INFO "info" +# define OSSL_KDF_PARAM_ITER "iter" +# define OSSL_KDF_PARAM_KBKDF_R "r" +# define OSSL_KDF_PARAM_KBKDF_USE_L "use-l" +# define OSSL_KDF_PARAM_KBKDF_USE_SEPARATOR "use-separator" +# define OSSL_KDF_PARAM_KEY "key" +# define OSSL_KDF_PARAM_LABEL "label" +# define OSSL_KDF_PARAM_MAC OSSL_ALG_PARAM_MAC +# define OSSL_KDF_PARAM_MAC_SIZE "maclen" +# define OSSL_KDF_PARAM_MODE "mode" +# define OSSL_KDF_PARAM_PASSWORD "pass" +# define OSSL_KDF_PARAM_PKCS12_ID "id" +# define OSSL_KDF_PARAM_PKCS5 "pkcs5" +# define OSSL_KDF_PARAM_PREFIX "prefix" +# define OSSL_KDF_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES +# define OSSL_KDF_PARAM_SALT "salt" +# define OSSL_KDF_PARAM_SCRYPT_MAXMEM "maxmem_bytes" +# define OSSL_KDF_PARAM_SCRYPT_N "n" +# define OSSL_KDF_PARAM_SCRYPT_P "p" +# define OSSL_KDF_PARAM_SCRYPT_R "r" +# define OSSL_KDF_PARAM_SECRET "secret" +# define OSSL_KDF_PARAM_SEED "seed" +# define OSSL_KDF_PARAM_SIZE "size" +# define OSSL_KDF_PARAM_SSHKDF_SESSION_ID "session_id" +# define OSSL_KDF_PARAM_SSHKDF_TYPE "type" +# define OSSL_KDF_PARAM_SSHKDF_XCGHASH "xcghash" +# define OSSL_KDF_PARAM_THREADS "threads" +# define OSSL_KDF_PARAM_UKM "ukm" +# define OSSL_KDF_PARAM_X942_ACVPINFO "acvp-info" +# define OSSL_KDF_PARAM_X942_PARTYUINFO "partyu-info" +# define OSSL_KDF_PARAM_X942_PARTYVINFO "partyv-info" +# define OSSL_KDF_PARAM_X942_SUPP_PRIVINFO "supp-privinfo" +# define OSSL_KDF_PARAM_X942_SUPP_PUBINFO "supp-pubinfo" +# define OSSL_KDF_PARAM_X942_USE_KEYBITS "use-keybits" +# define OSSL_KEM_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR +# define OSSL_KEM_PARAM_FIPS_KEY_CHECK OSSL_PKEY_PARAM_FIPS_KEY_CHECK +# define OSSL_KEM_PARAM_IKME "ikme" +# define OSSL_KEM_PARAM_OPERATION "operation" +# define OSSL_LIBSSL_RECORD_LAYER_PARAM_BLOCK_PADDING "block_padding" +# define OSSL_LIBSSL_RECORD_LAYER_PARAM_HS_PADDING "hs_padding" +# define OSSL_LIBSSL_RECORD_LAYER_PARAM_MAX_EARLY_DATA "max_early_data" +# define OSSL_LIBSSL_RECORD_LAYER_PARAM_MAX_FRAG_LEN "max_frag_len" +# define OSSL_LIBSSL_RECORD_LAYER_PARAM_MODE "mode" +# define OSSL_LIBSSL_RECORD_LAYER_PARAM_OPTIONS "options" +# define OSSL_LIBSSL_RECORD_LAYER_PARAM_READ_AHEAD "read_ahead" +# define OSSL_LIBSSL_RECORD_LAYER_PARAM_STREAM_MAC "stream_mac" +# define OSSL_LIBSSL_RECORD_LAYER_PARAM_TLSTREE "tlstree" +# define OSSL_LIBSSL_RECORD_LAYER_PARAM_USE_ETM "use_etm" +# define OSSL_LIBSSL_RECORD_LAYER_READ_BUFFER_LEN "read_buffer_len" +# define OSSL_MAC_PARAM_BLOCK_SIZE "block-size" +# define OSSL_MAC_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER +# define OSSL_MAC_PARAM_CUSTOM "custom" +# define OSSL_MAC_PARAM_C_ROUNDS "c-rounds" +# define OSSL_MAC_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST +# define OSSL_MAC_PARAM_DIGEST_NOINIT "digest-noinit" +# define OSSL_MAC_PARAM_DIGEST_ONESHOT "digest-oneshot" +# define OSSL_MAC_PARAM_D_ROUNDS "d-rounds" +# define OSSL_MAC_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR +# define OSSL_MAC_PARAM_FIPS_KEY_CHECK OSSL_PKEY_PARAM_FIPS_KEY_CHECK +# define OSSL_MAC_PARAM_FIPS_NO_SHORT_MAC OSSL_PROV_PARAM_NO_SHORT_MAC +# define OSSL_MAC_PARAM_IV "iv" +# define OSSL_MAC_PARAM_KEY "key" +# define OSSL_MAC_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES +# define OSSL_MAC_PARAM_SALT "salt" +# define OSSL_MAC_PARAM_SIZE "size" +# define OSSL_MAC_PARAM_TLS_DATA_SIZE "tls-data-size" +# define OSSL_MAC_PARAM_XOF "xof" +# define OSSL_OBJECT_PARAM_DATA "data" +# define OSSL_OBJECT_PARAM_DATA_STRUCTURE "data-structure" +# define OSSL_OBJECT_PARAM_DATA_TYPE "data-type" +# define OSSL_OBJECT_PARAM_DESC "desc" +# define OSSL_OBJECT_PARAM_INPUT_TYPE "input-type" +# define OSSL_OBJECT_PARAM_REFERENCE "reference" +# define OSSL_OBJECT_PARAM_TYPE "type" +# define OSSL_PASSPHRASE_PARAM_INFO "info" +# define OSSL_PKEY_PARAM_ALGORITHM_ID OSSL_ALG_PARAM_ALGORITHM_ID +# define OSSL_PKEY_PARAM_ALGORITHM_ID_PARAMS OSSL_ALG_PARAM_ALGORITHM_ID_PARAMS +# define OSSL_PKEY_PARAM_BITS "bits" +# define OSSL_PKEY_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER +# define OSSL_PKEY_PARAM_CMS_KEMRI_KDF_ALGORITHM "kemri-kdf-alg" +# define OSSL_PKEY_PARAM_CMS_RI_TYPE "ri-type" +# define OSSL_PKEY_PARAM_DEFAULT_DIGEST "default-digest" +# define OSSL_PKEY_PARAM_DHKEM_IKM "dhkem-ikm" +# define OSSL_PKEY_PARAM_DH_GENERATOR "safeprime-generator" +# define OSSL_PKEY_PARAM_DH_PRIV_LEN "priv_len" +# define OSSL_PKEY_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST +# define OSSL_PKEY_PARAM_DIGEST_SIZE "digest-size" +# define OSSL_PKEY_PARAM_DIST_ID "distid" +# define OSSL_PKEY_PARAM_EC_A "a" +# define OSSL_PKEY_PARAM_EC_B "b" +# define OSSL_PKEY_PARAM_EC_CHAR2_M "m" +# define OSSL_PKEY_PARAM_EC_CHAR2_PP_K1 "k1" +# define OSSL_PKEY_PARAM_EC_CHAR2_PP_K2 "k2" +# define OSSL_PKEY_PARAM_EC_CHAR2_PP_K3 "k3" +# define OSSL_PKEY_PARAM_EC_CHAR2_TP_BASIS "tp" +# define OSSL_PKEY_PARAM_EC_CHAR2_TYPE "basis-type" +# define OSSL_PKEY_PARAM_EC_COFACTOR "cofactor" +# define OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS "decoded-from-explicit" +# define OSSL_PKEY_PARAM_EC_ENCODING "encoding" +# define OSSL_PKEY_PARAM_EC_FIELD_TYPE "field-type" +# define OSSL_PKEY_PARAM_EC_GENERATOR "generator" +# define OSSL_PKEY_PARAM_EC_GROUP_CHECK_TYPE "group-check" +# define OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC "include-public" +# define OSSL_PKEY_PARAM_EC_ORDER "order" +# define OSSL_PKEY_PARAM_EC_P "p" +# define OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT "point-format" +# define OSSL_PKEY_PARAM_EC_PUB_X "qx" +# define OSSL_PKEY_PARAM_EC_PUB_Y "qy" +# define OSSL_PKEY_PARAM_EC_SEED "seed" +# define OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY "encoded-pub-key" +# define OSSL_PKEY_PARAM_ENGINE OSSL_ALG_PARAM_ENGINE +# define OSSL_PKEY_PARAM_FFC_COFACTOR "j" +# define OSSL_PKEY_PARAM_FFC_DIGEST OSSL_PKEY_PARAM_DIGEST +# define OSSL_PKEY_PARAM_FFC_DIGEST_PROPS OSSL_PKEY_PARAM_PROPERTIES +# define OSSL_PKEY_PARAM_FFC_G "g" +# define OSSL_PKEY_PARAM_FFC_GINDEX "gindex" +# define OSSL_PKEY_PARAM_FFC_H "hindex" +# define OSSL_PKEY_PARAM_FFC_P "p" +# define OSSL_PKEY_PARAM_FFC_PBITS "pbits" +# define OSSL_PKEY_PARAM_FFC_PCOUNTER "pcounter" +# define OSSL_PKEY_PARAM_FFC_Q "q" +# define OSSL_PKEY_PARAM_FFC_QBITS "qbits" +# define OSSL_PKEY_PARAM_FFC_SEED "seed" +# define OSSL_PKEY_PARAM_FFC_TYPE "type" +# define OSSL_PKEY_PARAM_FFC_VALIDATE_G "validate-g" +# define OSSL_PKEY_PARAM_FFC_VALIDATE_LEGACY "validate-legacy" +# define OSSL_PKEY_PARAM_FFC_VALIDATE_PQ "validate-pq" +# define OSSL_PKEY_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR +# define OSSL_PKEY_PARAM_FIPS_DIGEST_CHECK "digest-check" +# define OSSL_PKEY_PARAM_FIPS_KEY_CHECK "key-check" +# define OSSL_PKEY_PARAM_FIPS_SIGN_CHECK "sign-check" +# define OSSL_PKEY_PARAM_GROUP_NAME "group" +# define OSSL_PKEY_PARAM_IMPLICIT_REJECTION "implicit-rejection" +# define OSSL_PKEY_PARAM_MANDATORY_DIGEST "mandatory-digest" +# define OSSL_PKEY_PARAM_MASKGENFUNC "mgf" +# define OSSL_PKEY_PARAM_MAX_SIZE "max-size" +# define OSSL_PKEY_PARAM_MGF1_DIGEST "mgf1-digest" +# define OSSL_PKEY_PARAM_MGF1_PROPERTIES "mgf1-properties" +# define OSSL_PKEY_PARAM_ML_DSA_INPUT_FORMATS "ml-dsa.input_formats" +# define OSSL_PKEY_PARAM_ML_DSA_OUTPUT_FORMATS "ml-dsa.output_formats" +# define OSSL_PKEY_PARAM_ML_DSA_PREFER_SEED "ml-dsa.prefer_seed" +# define OSSL_PKEY_PARAM_ML_DSA_RETAIN_SEED "ml-dsa.retain_seed" +# define OSSL_PKEY_PARAM_ML_DSA_SEED "seed" +# define OSSL_PKEY_PARAM_ML_KEM_IMPORT_PCT_TYPE "ml-kem.import_pct_type" +# define OSSL_PKEY_PARAM_ML_KEM_INPUT_FORMATS "ml-kem.input_formats" +# define OSSL_PKEY_PARAM_ML_KEM_OUTPUT_FORMATS "ml-kem.output_formats" +# define OSSL_PKEY_PARAM_ML_KEM_PREFER_SEED "ml-kem.prefer_seed" +# define OSSL_PKEY_PARAM_ML_KEM_RETAIN_SEED "ml-kem.retain_seed" +# define OSSL_PKEY_PARAM_ML_KEM_SEED "seed" +# define OSSL_PKEY_PARAM_PAD_MODE "pad-mode" +# define OSSL_PKEY_PARAM_PRIV_KEY "priv" +# define OSSL_PKEY_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES +# define OSSL_PKEY_PARAM_PUB_KEY "pub" +# define OSSL_PKEY_PARAM_RSA_BITS OSSL_PKEY_PARAM_BITS +# define OSSL_PKEY_PARAM_RSA_COEFFICIENT "rsa-coefficient" +# define OSSL_PKEY_PARAM_RSA_COEFFICIENT1 "rsa-coefficient1" +# define OSSL_PKEY_PARAM_RSA_COEFFICIENT2 "rsa-coefficient2" +# define OSSL_PKEY_PARAM_RSA_COEFFICIENT3 "rsa-coefficient3" +# define OSSL_PKEY_PARAM_RSA_COEFFICIENT4 "rsa-coefficient4" +# define OSSL_PKEY_PARAM_RSA_COEFFICIENT5 "rsa-coefficient5" +# define OSSL_PKEY_PARAM_RSA_COEFFICIENT6 "rsa-coefficient6" +# define OSSL_PKEY_PARAM_RSA_COEFFICIENT7 "rsa-coefficient7" +# define OSSL_PKEY_PARAM_RSA_COEFFICIENT8 "rsa-coefficient8" +# define OSSL_PKEY_PARAM_RSA_COEFFICIENT9 "rsa-coefficient9" +# define OSSL_PKEY_PARAM_RSA_D "d" +# define OSSL_PKEY_PARAM_RSA_DERIVE_FROM_PQ "rsa-derive-from-pq" +# define OSSL_PKEY_PARAM_RSA_DIGEST OSSL_PKEY_PARAM_DIGEST +# define OSSL_PKEY_PARAM_RSA_DIGEST_PROPS OSSL_PKEY_PARAM_PROPERTIES +# define OSSL_PKEY_PARAM_RSA_E "e" +# define OSSL_PKEY_PARAM_RSA_EXPONENT "rsa-exponent" +# define OSSL_PKEY_PARAM_RSA_EXPONENT1 "rsa-exponent1" +# define OSSL_PKEY_PARAM_RSA_EXPONENT10 "rsa-exponent10" +# define OSSL_PKEY_PARAM_RSA_EXPONENT2 "rsa-exponent2" +# define OSSL_PKEY_PARAM_RSA_EXPONENT3 "rsa-exponent3" +# define OSSL_PKEY_PARAM_RSA_EXPONENT4 "rsa-exponent4" +# define OSSL_PKEY_PARAM_RSA_EXPONENT5 "rsa-exponent5" +# define OSSL_PKEY_PARAM_RSA_EXPONENT6 "rsa-exponent6" +# define OSSL_PKEY_PARAM_RSA_EXPONENT7 "rsa-exponent7" +# define OSSL_PKEY_PARAM_RSA_EXPONENT8 "rsa-exponent8" +# define OSSL_PKEY_PARAM_RSA_EXPONENT9 "rsa-exponent9" +# define OSSL_PKEY_PARAM_RSA_FACTOR "rsa-factor" +# define OSSL_PKEY_PARAM_RSA_FACTOR1 "rsa-factor1" +# define OSSL_PKEY_PARAM_RSA_FACTOR10 "rsa-factor10" +# define OSSL_PKEY_PARAM_RSA_FACTOR2 "rsa-factor2" +# define OSSL_PKEY_PARAM_RSA_FACTOR3 "rsa-factor3" +# define OSSL_PKEY_PARAM_RSA_FACTOR4 "rsa-factor4" +# define OSSL_PKEY_PARAM_RSA_FACTOR5 "rsa-factor5" +# define OSSL_PKEY_PARAM_RSA_FACTOR6 "rsa-factor6" +# define OSSL_PKEY_PARAM_RSA_FACTOR7 "rsa-factor7" +# define OSSL_PKEY_PARAM_RSA_FACTOR8 "rsa-factor8" +# define OSSL_PKEY_PARAM_RSA_FACTOR9 "rsa-factor9" +# define OSSL_PKEY_PARAM_RSA_MASKGENFUNC OSSL_PKEY_PARAM_MASKGENFUNC +# define OSSL_PKEY_PARAM_RSA_MGF1_DIGEST OSSL_PKEY_PARAM_MGF1_DIGEST +# define OSSL_PKEY_PARAM_RSA_N "n" +# define OSSL_PKEY_PARAM_RSA_PRIMES "primes" +# define OSSL_PKEY_PARAM_RSA_PSS_SALTLEN "saltlen" +# define OSSL_PKEY_PARAM_RSA_TEST_P1 "p1" +# define OSSL_PKEY_PARAM_RSA_TEST_P2 "p2" +# define OSSL_PKEY_PARAM_RSA_TEST_Q1 "q1" +# define OSSL_PKEY_PARAM_RSA_TEST_Q2 "q2" +# define OSSL_PKEY_PARAM_RSA_TEST_XP "xp" +# define OSSL_PKEY_PARAM_RSA_TEST_XP1 "xp1" +# define OSSL_PKEY_PARAM_RSA_TEST_XP2 "xp2" +# define OSSL_PKEY_PARAM_RSA_TEST_XQ "xq" +# define OSSL_PKEY_PARAM_RSA_TEST_XQ1 "xq1" +# define OSSL_PKEY_PARAM_RSA_TEST_XQ2 "xq2" +# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits" +# define OSSL_PKEY_PARAM_SECURITY_CATEGORY OSSL_ALG_PARAM_SECURITY_CATEGORY +# define OSSL_PKEY_PARAM_SLH_DSA_SEED "seed" +# define OSSL_PKEY_PARAM_USE_COFACTOR_ECDH OSSL_PKEY_PARAM_USE_COFACTOR_FLAG +# define OSSL_PKEY_PARAM_USE_COFACTOR_FLAG "use-cofactor-flag" +# define OSSL_PROV_PARAM_BUILDINFO "buildinfo" +# define OSSL_PROV_PARAM_CORE_MODULE_FILENAME "module-filename" +# define OSSL_PROV_PARAM_CORE_PROV_NAME "provider-name" +# define OSSL_PROV_PARAM_CORE_VERSION "openssl-version" +# define OSSL_PROV_PARAM_DRBG_TRUNC_DIGEST "drbg-no-trunc-md" +# define OSSL_PROV_PARAM_DSA_SIGN_DISABLED "dsa-sign-disabled" +# define OSSL_PROV_PARAM_ECDH_COFACTOR_CHECK "ecdh-cofactor-check" +# define OSSL_PROV_PARAM_HKDF_DIGEST_CHECK "hkdf-digest-check" +# define OSSL_PROV_PARAM_HKDF_KEY_CHECK "hkdf-key-check" +# define OSSL_PROV_PARAM_HMAC_KEY_CHECK "hmac-key-check" +# define OSSL_PROV_PARAM_KBKDF_KEY_CHECK "kbkdf-key-check" +# define OSSL_PROV_PARAM_KMAC_KEY_CHECK "kmac-key-check" +# define OSSL_PROV_PARAM_NAME "name" +# define OSSL_PROV_PARAM_NO_SHORT_MAC "no-short-mac" +# define OSSL_PROV_PARAM_PBKDF2_LOWER_BOUND_CHECK "pbkdf2-lower-bound-check" +# define OSSL_PROV_PARAM_RSA_PKCS15_PAD_DISABLED "rsa-pkcs15-pad-disabled" +# define OSSL_PROV_PARAM_RSA_PSS_SALTLEN_CHECK "rsa-pss-saltlen-check" +# define OSSL_PROV_PARAM_RSA_SIGN_X931_PAD_DISABLED "rsa-sign-x931-pad-disabled" +# define OSSL_PROV_PARAM_SECURITY_CHECKS "security-checks" +# define OSSL_PROV_PARAM_SELF_TEST_DESC "st-desc" +# define OSSL_PROV_PARAM_SELF_TEST_PHASE "st-phase" +# define OSSL_PROV_PARAM_SELF_TEST_TYPE "st-type" +# define OSSL_PROV_PARAM_SIGNATURE_DIGEST_CHECK "signature-digest-check" +# define OSSL_PROV_PARAM_SSHKDF_DIGEST_CHECK "sshkdf-digest-check" +# define OSSL_PROV_PARAM_SSHKDF_KEY_CHECK "sshkdf-key-check" +# define OSSL_PROV_PARAM_SSKDF_DIGEST_CHECK "sskdf-digest-check" +# define OSSL_PROV_PARAM_SSKDF_KEY_CHECK "sskdf-key-check" +# define OSSL_PROV_PARAM_STATUS "status" +# define OSSL_PROV_PARAM_TDES_ENCRYPT_DISABLED "tdes-encrypt-disabled" +# define OSSL_PROV_PARAM_TLS13_KDF_DIGEST_CHECK "tls13-kdf-digest-check" +# define OSSL_PROV_PARAM_TLS13_KDF_KEY_CHECK "tls13-kdf-key-check" +# define OSSL_PROV_PARAM_TLS1_PRF_DIGEST_CHECK "tls1-prf-digest-check" +# define OSSL_PROV_PARAM_TLS1_PRF_EMS_CHECK "tls1-prf-ems-check" +# define OSSL_PROV_PARAM_TLS1_PRF_KEY_CHECK "tls1-prf-key-check" +# define OSSL_PROV_PARAM_VERSION "version" +# define OSSL_PROV_PARAM_X942KDF_KEY_CHECK "x942kdf-key-check" +# define OSSL_PROV_PARAM_X963KDF_DIGEST_CHECK "x963kdf-digest-check" +# define OSSL_PROV_PARAM_X963KDF_KEY_CHECK "x963kdf-key-check" +# define OSSL_RAND_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR +# define OSSL_RAND_PARAM_GENERATE "generate" +# define OSSL_RAND_PARAM_MAX_REQUEST "max_request" +# define OSSL_RAND_PARAM_STATE "state" +# define OSSL_RAND_PARAM_STRENGTH "strength" +# define OSSL_RAND_PARAM_TEST_ENTROPY "test_entropy" +# define OSSL_RAND_PARAM_TEST_NONCE "test_nonce" +# define OSSL_SIGNATURE_PARAM_ADD_RANDOM "additional-random" +# define OSSL_SIGNATURE_PARAM_ALGORITHM_ID OSSL_PKEY_PARAM_ALGORITHM_ID +# define OSSL_SIGNATURE_PARAM_ALGORITHM_ID_PARAMS OSSL_PKEY_PARAM_ALGORITHM_ID_PARAMS +# define OSSL_SIGNATURE_PARAM_CONTEXT_STRING "context-string" +# define OSSL_SIGNATURE_PARAM_DETERMINISTIC "deterministic" +# define OSSL_SIGNATURE_PARAM_DIGEST OSSL_PKEY_PARAM_DIGEST +# define OSSL_SIGNATURE_PARAM_DIGEST_SIZE OSSL_PKEY_PARAM_DIGEST_SIZE +# define OSSL_SIGNATURE_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR +# define OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK OSSL_PKEY_PARAM_FIPS_DIGEST_CHECK +# define OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK OSSL_PKEY_PARAM_FIPS_KEY_CHECK +# define OSSL_SIGNATURE_PARAM_FIPS_RSA_PSS_SALTLEN_CHECK "rsa-pss-saltlen-check" +# define OSSL_SIGNATURE_PARAM_FIPS_SIGN_CHECK OSSL_PKEY_PARAM_FIPS_SIGN_CHECK +# define OSSL_SIGNATURE_PARAM_FIPS_SIGN_X931_PAD_CHECK "sign-x931-pad-check" +# define OSSL_SIGNATURE_PARAM_FIPS_VERIFY_MESSAGE "verify-message" +# define OSSL_SIGNATURE_PARAM_INSTANCE "instance" +# define OSSL_SIGNATURE_PARAM_KAT "kat" +# define OSSL_SIGNATURE_PARAM_MESSAGE_ENCODING "message-encoding" +# define OSSL_SIGNATURE_PARAM_MGF1_DIGEST OSSL_PKEY_PARAM_MGF1_DIGEST +# define OSSL_SIGNATURE_PARAM_MGF1_PROPERTIES OSSL_PKEY_PARAM_MGF1_PROPERTIES +# define OSSL_SIGNATURE_PARAM_MU "mu" +# define OSSL_SIGNATURE_PARAM_NONCE_TYPE "nonce-type" +# define OSSL_SIGNATURE_PARAM_PAD_MODE OSSL_PKEY_PARAM_PAD_MODE +# define OSSL_SIGNATURE_PARAM_PROPERTIES OSSL_PKEY_PARAM_PROPERTIES +# define OSSL_SIGNATURE_PARAM_PSS_SALTLEN "saltlen" +# define OSSL_SIGNATURE_PARAM_SIGNATURE "signature" +# define OSSL_SIGNATURE_PARAM_TEST_ENTROPY "test-entropy" +# define OSSL_SKEY_PARAM_KEY_LENGTH "key-length" +# define OSSL_SKEY_PARAM_RAW_BYTES "raw-bytes" +# define OSSL_STORE_PARAM_ALIAS "alias" +# define OSSL_STORE_PARAM_DIGEST "digest" +# define OSSL_STORE_PARAM_EXPECT "expect" +# define OSSL_STORE_PARAM_FINGERPRINT "fingerprint" +# define OSSL_STORE_PARAM_INPUT_TYPE "input-type" +# define OSSL_STORE_PARAM_ISSUER "name" +# define OSSL_STORE_PARAM_PROPERTIES "properties" +# define OSSL_STORE_PARAM_SERIAL "serial" +# define OSSL_STORE_PARAM_SUBJECT "subject" +/* clang-format on */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/core_object.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/core_object.h new file mode 100644 index 0000000000000000000000000000000000000000..df0c79436d880ee96cca41d4a1d0271692879788 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/core_object.h @@ -0,0 +1,41 @@ +/* + * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_CORE_OBJECT_H +#define OPENSSL_CORE_OBJECT_H +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +/*- + * Known object types + * + * These numbers are used as values for the OSSL_PARAM parameter + * OSSL_OBJECT_PARAM_TYPE. + * + * For most of these types, there's a corresponding libcrypto object type. + * The corresponding type is indicated with a comment after the number. + */ +#define OSSL_OBJECT_UNKNOWN 0 +#define OSSL_OBJECT_NAME 1 /* char * */ +#define OSSL_OBJECT_PKEY 2 /* EVP_PKEY * */ +#define OSSL_OBJECT_CERT 3 /* X509 * */ +#define OSSL_OBJECT_CRL 4 /* X509_CRL * */ + +/* + * The rest of the associated OSSL_PARAM elements is described in core_names.h + */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/crmf.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/crmf.h new file mode 100644 index 0000000000000000000000000000000000000000..1907a3476bcd19ec34c7897747531ba722426169 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/crmf.h @@ -0,0 +1,279 @@ +/*- + * WARNING: do not edit! + * Generated by makefile from include\openssl\crmf.h.in + * + * Copyright 2007-2025 The OpenSSL Project Authors. All Rights Reserved. + * Copyright Nokia 2007-2019 + * Copyright Siemens AG 2015-2019 + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + * + * CRMF (RFC 4211) implementation by M. Peylo, M. Viljanen, and D. von Oheimb. + */ + +/* clang-format off */ + +/* clang-format on */ + +#ifndef OPENSSL_CRMF_H +#define OPENSSL_CRMF_H + +#include + +#ifndef OPENSSL_NO_CRMF +#include +#include +#include +#include /* for GENERAL_NAME etc. */ +#include + +/* explicit #includes not strictly needed since implied by the above: */ +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define OSSL_CRMF_POPOPRIVKEY_THISMESSAGE 0 +#define OSSL_CRMF_POPOPRIVKEY_SUBSEQUENTMESSAGE 1 +#define OSSL_CRMF_POPOPRIVKEY_DHMAC 2 +#define OSSL_CRMF_POPOPRIVKEY_AGREEMAC 3 +#define OSSL_CRMF_POPOPRIVKEY_ENCRYPTEDKEY 4 + +#define OSSL_CRMF_SUBSEQUENTMESSAGE_ENCRCERT 0 +#define OSSL_CRMF_SUBSEQUENTMESSAGE_CHALLENGERESP 1 +typedef struct ossl_crmf_encryptedvalue_st OSSL_CRMF_ENCRYPTEDVALUE; +DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_ENCRYPTEDVALUE) + +typedef struct ossl_crmf_encryptedkey_st OSSL_CRMF_ENCRYPTEDKEY; +DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_ENCRYPTEDKEY) + +typedef struct ossl_crmf_msg_st OSSL_CRMF_MSG; +DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_MSG) +DECLARE_ASN1_DUP_FUNCTION(OSSL_CRMF_MSG) +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CRMF_MSG, OSSL_CRMF_MSG, OSSL_CRMF_MSG) +#define sk_OSSL_CRMF_MSG_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CRMF_MSG_sk_type(sk)) +#define sk_OSSL_CRMF_MSG_value(sk, idx) ((OSSL_CRMF_MSG *)OPENSSL_sk_value(ossl_check_const_OSSL_CRMF_MSG_sk_type(sk), (idx))) +#define sk_OSSL_CRMF_MSG_new(cmp) ((STACK_OF(OSSL_CRMF_MSG) *)OPENSSL_sk_new(ossl_check_OSSL_CRMF_MSG_compfunc_type(cmp))) +#define sk_OSSL_CRMF_MSG_new_null() ((STACK_OF(OSSL_CRMF_MSG) *)OPENSSL_sk_new_null()) +#define sk_OSSL_CRMF_MSG_new_reserve(cmp, n) ((STACK_OF(OSSL_CRMF_MSG) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_CRMF_MSG_compfunc_type(cmp), (n))) +#define sk_OSSL_CRMF_MSG_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CRMF_MSG_sk_type(sk), (n)) +#define sk_OSSL_CRMF_MSG_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CRMF_MSG_sk_type(sk)) +#define sk_OSSL_CRMF_MSG_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CRMF_MSG_sk_type(sk)) +#define sk_OSSL_CRMF_MSG_delete(sk, i) ((OSSL_CRMF_MSG *)OPENSSL_sk_delete(ossl_check_OSSL_CRMF_MSG_sk_type(sk), (i))) +#define sk_OSSL_CRMF_MSG_delete_ptr(sk, ptr) ((OSSL_CRMF_MSG *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_type(ptr))) +#define sk_OSSL_CRMF_MSG_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_type(ptr)) +#define sk_OSSL_CRMF_MSG_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_type(ptr)) +#define sk_OSSL_CRMF_MSG_pop(sk) ((OSSL_CRMF_MSG *)OPENSSL_sk_pop(ossl_check_OSSL_CRMF_MSG_sk_type(sk))) +#define sk_OSSL_CRMF_MSG_shift(sk) ((OSSL_CRMF_MSG *)OPENSSL_sk_shift(ossl_check_OSSL_CRMF_MSG_sk_type(sk))) +#define sk_OSSL_CRMF_MSG_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_freefunc_type(freefunc)) +#define sk_OSSL_CRMF_MSG_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_type(ptr), (idx)) +#define sk_OSSL_CRMF_MSG_set(sk, idx, ptr) ((OSSL_CRMF_MSG *)OPENSSL_sk_set(ossl_check_OSSL_CRMF_MSG_sk_type(sk), (idx), ossl_check_OSSL_CRMF_MSG_type(ptr))) +#define sk_OSSL_CRMF_MSG_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_type(ptr)) +#define sk_OSSL_CRMF_MSG_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_type(ptr)) +#define sk_OSSL_CRMF_MSG_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_type(ptr), pnum) +#define sk_OSSL_CRMF_MSG_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_CRMF_MSG_sk_type(sk)) +#define sk_OSSL_CRMF_MSG_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_CRMF_MSG_sk_type(sk)) +#define sk_OSSL_CRMF_MSG_dup(sk) ((STACK_OF(OSSL_CRMF_MSG) *)OPENSSL_sk_dup(ossl_check_const_OSSL_CRMF_MSG_sk_type(sk))) +#define sk_OSSL_CRMF_MSG_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CRMF_MSG) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_copyfunc_type(copyfunc), ossl_check_OSSL_CRMF_MSG_freefunc_type(freefunc))) +#define sk_OSSL_CRMF_MSG_set_cmp_func(sk, cmp) ((sk_OSSL_CRMF_MSG_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_compfunc_type(cmp))) + +/* clang-format on */ +typedef struct ossl_crmf_attributetypeandvalue_st OSSL_CRMF_ATTRIBUTETYPEANDVALUE; +void OSSL_CRMF_ATTRIBUTETYPEANDVALUE_free(OSSL_CRMF_ATTRIBUTETYPEANDVALUE *v); +DECLARE_ASN1_DUP_FUNCTION(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CRMF_ATTRIBUTETYPEANDVALUE, OSSL_CRMF_ATTRIBUTETYPEANDVALUE, OSSL_CRMF_ATTRIBUTETYPEANDVALUE) +#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk)) +#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_value(sk, idx) ((OSSL_CRMF_ATTRIBUTETYPEANDVALUE *)OPENSSL_sk_value(ossl_check_const_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), (idx))) +#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_new(cmp) ((STACK_OF(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) *)OPENSSL_sk_new(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_compfunc_type(cmp))) +#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_new_null() ((STACK_OF(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) *)OPENSSL_sk_new_null()) +#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_new_reserve(cmp, n) ((STACK_OF(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_compfunc_type(cmp), (n))) +#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), (n)) +#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk)) +#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk)) +#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_delete(sk, i) ((OSSL_CRMF_ATTRIBUTETYPEANDVALUE *)OPENSSL_sk_delete(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), (i))) +#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_delete_ptr(sk, ptr) ((OSSL_CRMF_ATTRIBUTETYPEANDVALUE *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_type(ptr))) +#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_type(ptr)) +#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_type(ptr)) +#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_pop(sk) ((OSSL_CRMF_ATTRIBUTETYPEANDVALUE *)OPENSSL_sk_pop(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk))) +#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_shift(sk) ((OSSL_CRMF_ATTRIBUTETYPEANDVALUE *)OPENSSL_sk_shift(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk))) +#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_freefunc_type(freefunc)) +#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_type(ptr), (idx)) +#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_set(sk, idx, ptr) ((OSSL_CRMF_ATTRIBUTETYPEANDVALUE *)OPENSSL_sk_set(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), (idx), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_type(ptr))) +#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_type(ptr)) +#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_type(ptr)) +#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_type(ptr), pnum) +#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk)) +#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk)) +#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_dup(sk) ((STACK_OF(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) *)OPENSSL_sk_dup(ossl_check_const_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk))) +#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_copyfunc_type(copyfunc), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_freefunc_type(freefunc))) +#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_set_cmp_func(sk, cmp) ((sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_compfunc_type(cmp))) + +/* clang-format on */ + +typedef struct ossl_crmf_pbmparameter_st OSSL_CRMF_PBMPARAMETER; +DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_PBMPARAMETER) +typedef struct ossl_crmf_poposigningkey_st OSSL_CRMF_POPOSIGNINGKEY; +typedef struct ossl_crmf_certrequest_st OSSL_CRMF_CERTREQUEST; +typedef struct ossl_crmf_certid_st OSSL_CRMF_CERTID; +DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_CERTID) +DECLARE_ASN1_DUP_FUNCTION(OSSL_CRMF_CERTID) +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CRMF_CERTID, OSSL_CRMF_CERTID, OSSL_CRMF_CERTID) +#define sk_OSSL_CRMF_CERTID_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CRMF_CERTID_sk_type(sk)) +#define sk_OSSL_CRMF_CERTID_value(sk, idx) ((OSSL_CRMF_CERTID *)OPENSSL_sk_value(ossl_check_const_OSSL_CRMF_CERTID_sk_type(sk), (idx))) +#define sk_OSSL_CRMF_CERTID_new(cmp) ((STACK_OF(OSSL_CRMF_CERTID) *)OPENSSL_sk_new(ossl_check_OSSL_CRMF_CERTID_compfunc_type(cmp))) +#define sk_OSSL_CRMF_CERTID_new_null() ((STACK_OF(OSSL_CRMF_CERTID) *)OPENSSL_sk_new_null()) +#define sk_OSSL_CRMF_CERTID_new_reserve(cmp, n) ((STACK_OF(OSSL_CRMF_CERTID) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_CRMF_CERTID_compfunc_type(cmp), (n))) +#define sk_OSSL_CRMF_CERTID_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), (n)) +#define sk_OSSL_CRMF_CERTID_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CRMF_CERTID_sk_type(sk)) +#define sk_OSSL_CRMF_CERTID_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CRMF_CERTID_sk_type(sk)) +#define sk_OSSL_CRMF_CERTID_delete(sk, i) ((OSSL_CRMF_CERTID *)OPENSSL_sk_delete(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), (i))) +#define sk_OSSL_CRMF_CERTID_delete_ptr(sk, ptr) ((OSSL_CRMF_CERTID *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_type(ptr))) +#define sk_OSSL_CRMF_CERTID_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_type(ptr)) +#define sk_OSSL_CRMF_CERTID_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_type(ptr)) +#define sk_OSSL_CRMF_CERTID_pop(sk) ((OSSL_CRMF_CERTID *)OPENSSL_sk_pop(ossl_check_OSSL_CRMF_CERTID_sk_type(sk))) +#define sk_OSSL_CRMF_CERTID_shift(sk) ((OSSL_CRMF_CERTID *)OPENSSL_sk_shift(ossl_check_OSSL_CRMF_CERTID_sk_type(sk))) +#define sk_OSSL_CRMF_CERTID_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_freefunc_type(freefunc)) +#define sk_OSSL_CRMF_CERTID_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_type(ptr), (idx)) +#define sk_OSSL_CRMF_CERTID_set(sk, idx, ptr) ((OSSL_CRMF_CERTID *)OPENSSL_sk_set(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), (idx), ossl_check_OSSL_CRMF_CERTID_type(ptr))) +#define sk_OSSL_CRMF_CERTID_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_type(ptr)) +#define sk_OSSL_CRMF_CERTID_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_type(ptr)) +#define sk_OSSL_CRMF_CERTID_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_type(ptr), pnum) +#define sk_OSSL_CRMF_CERTID_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_CRMF_CERTID_sk_type(sk)) +#define sk_OSSL_CRMF_CERTID_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_CRMF_CERTID_sk_type(sk)) +#define sk_OSSL_CRMF_CERTID_dup(sk) ((STACK_OF(OSSL_CRMF_CERTID) *)OPENSSL_sk_dup(ossl_check_const_OSSL_CRMF_CERTID_sk_type(sk))) +#define sk_OSSL_CRMF_CERTID_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CRMF_CERTID) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_copyfunc_type(copyfunc), ossl_check_OSSL_CRMF_CERTID_freefunc_type(freefunc))) +#define sk_OSSL_CRMF_CERTID_set_cmp_func(sk, cmp) ((sk_OSSL_CRMF_CERTID_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_compfunc_type(cmp))) + +/* clang-format on */ + +typedef struct ossl_crmf_pkipublicationinfo_st OSSL_CRMF_PKIPUBLICATIONINFO; +DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_PKIPUBLICATIONINFO) +typedef struct ossl_crmf_singlepubinfo_st OSSL_CRMF_SINGLEPUBINFO; +DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_SINGLEPUBINFO) +typedef struct ossl_crmf_certtemplate_st OSSL_CRMF_CERTTEMPLATE; +DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_CERTTEMPLATE) +DECLARE_ASN1_DUP_FUNCTION(OSSL_CRMF_CERTTEMPLATE) +typedef STACK_OF(OSSL_CRMF_MSG) OSSL_CRMF_MSGS; +DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_MSGS) + +typedef struct ossl_crmf_optionalvalidity_st OSSL_CRMF_OPTIONALVALIDITY; + +/* crmf_pbm.c */ +OSSL_CRMF_PBMPARAMETER *OSSL_CRMF_pbmp_new(OSSL_LIB_CTX *libctx, size_t slen, + int owfnid, size_t itercnt, + int macnid); +int OSSL_CRMF_pbm_new(OSSL_LIB_CTX *libctx, const char *propq, + const OSSL_CRMF_PBMPARAMETER *pbmp, + const unsigned char *msg, size_t msglen, + const unsigned char *sec, size_t seclen, + unsigned char **mac, size_t *maclen); + +/* crmf_lib.c */ +int OSSL_CRMF_MSG_set1_regCtrl_regToken(OSSL_CRMF_MSG *msg, + const ASN1_UTF8STRING *tok); +ASN1_UTF8STRING +*OSSL_CRMF_MSG_get0_regCtrl_regToken(const OSSL_CRMF_MSG *msg); +int OSSL_CRMF_MSG_set1_regCtrl_authenticator(OSSL_CRMF_MSG *msg, + const ASN1_UTF8STRING *auth); +ASN1_UTF8STRING +*OSSL_CRMF_MSG_get0_regCtrl_authenticator(const OSSL_CRMF_MSG *msg); +int OSSL_CRMF_MSG_PKIPublicationInfo_push0_SinglePubInfo(OSSL_CRMF_PKIPUBLICATIONINFO *pi, + OSSL_CRMF_SINGLEPUBINFO *spi); +#define OSSL_CRMF_PUB_METHOD_DONTCARE 0 +#define OSSL_CRMF_PUB_METHOD_X500 1 +#define OSSL_CRMF_PUB_METHOD_WEB 2 +#define OSSL_CRMF_PUB_METHOD_LDAP 3 +int OSSL_CRMF_MSG_set0_SinglePubInfo(OSSL_CRMF_SINGLEPUBINFO *spi, + int method, GENERAL_NAME *nm); +#define OSSL_CRMF_PUB_ACTION_DONTPUBLISH 0 +#define OSSL_CRMF_PUB_ACTION_PLEASEPUBLISH 1 +int OSSL_CRMF_MSG_set_PKIPublicationInfo_action(OSSL_CRMF_PKIPUBLICATIONINFO *pi, + int action); +int OSSL_CRMF_MSG_set1_regCtrl_pkiPublicationInfo(OSSL_CRMF_MSG *msg, + const OSSL_CRMF_PKIPUBLICATIONINFO *pi); +OSSL_CRMF_PKIPUBLICATIONINFO +*OSSL_CRMF_MSG_get0_regCtrl_pkiPublicationInfo(const OSSL_CRMF_MSG *msg); +int OSSL_CRMF_MSG_set1_regCtrl_protocolEncrKey(OSSL_CRMF_MSG *msg, + const X509_PUBKEY *pubkey); +X509_PUBKEY +*OSSL_CRMF_MSG_get0_regCtrl_protocolEncrKey(const OSSL_CRMF_MSG *msg); +int OSSL_CRMF_MSG_set1_regCtrl_oldCertID(OSSL_CRMF_MSG *msg, + const OSSL_CRMF_CERTID *cid); +OSSL_CRMF_CERTID +*OSSL_CRMF_MSG_get0_regCtrl_oldCertID(const OSSL_CRMF_MSG *msg); +OSSL_CRMF_CERTID *OSSL_CRMF_CERTID_gen(const X509_NAME *issuer, + const ASN1_INTEGER *serial); + +int OSSL_CRMF_MSG_set1_regInfo_utf8Pairs(OSSL_CRMF_MSG *msg, + const ASN1_UTF8STRING *utf8pairs); +ASN1_UTF8STRING +*OSSL_CRMF_MSG_get0_regInfo_utf8Pairs(const OSSL_CRMF_MSG *msg); +int OSSL_CRMF_MSG_set1_regInfo_certReq(OSSL_CRMF_MSG *msg, + const OSSL_CRMF_CERTREQUEST *cr); +OSSL_CRMF_CERTREQUEST +*OSSL_CRMF_MSG_get0_regInfo_certReq(const OSSL_CRMF_MSG *msg); + +int OSSL_CRMF_MSG_set0_validity(OSSL_CRMF_MSG *crm, + ASN1_TIME *notBefore, ASN1_TIME *notAfter); +int OSSL_CRMF_MSG_set_certReqId(OSSL_CRMF_MSG *crm, int rid); +int OSSL_CRMF_MSG_get_certReqId(const OSSL_CRMF_MSG *crm); +int OSSL_CRMF_MSG_set0_extensions(OSSL_CRMF_MSG *crm, X509_EXTENSIONS *exts); + +int OSSL_CRMF_MSG_push0_extension(OSSL_CRMF_MSG *crm, X509_EXTENSION *ext); +#define OSSL_CRMF_POPO_NONE -1 +#define OSSL_CRMF_POPO_RAVERIFIED 0 +#define OSSL_CRMF_POPO_SIGNATURE 1 +#define OSSL_CRMF_POPO_KEYENC 2 +#define OSSL_CRMF_POPO_KEYAGREE 3 +int OSSL_CRMF_MSG_create_popo(int meth, OSSL_CRMF_MSG *crm, + EVP_PKEY *pkey, const EVP_MD *digest, + OSSL_LIB_CTX *libctx, const char *propq); +int OSSL_CRMF_MSGS_verify_popo(const OSSL_CRMF_MSGS *reqs, + int rid, int acceptRAVerified, + OSSL_LIB_CTX *libctx, const char *propq); +OSSL_CRMF_CERTTEMPLATE *OSSL_CRMF_MSG_get0_tmpl(const OSSL_CRMF_MSG *crm); +X509_PUBKEY +*OSSL_CRMF_CERTTEMPLATE_get0_publicKey(const OSSL_CRMF_CERTTEMPLATE *tmpl); +const X509_NAME *OSSL_CRMF_CERTTEMPLATE_get0_subject(const OSSL_CRMF_CERTTEMPLATE *tmpl); +const X509_NAME *OSSL_CRMF_CERTTEMPLATE_get0_issuer(const OSSL_CRMF_CERTTEMPLATE *tmpl); +const ASN1_INTEGER *OSSL_CRMF_CERTTEMPLATE_get0_serialNumber(const OSSL_CRMF_CERTTEMPLATE *tmpl); +X509_EXTENSIONS +*OSSL_CRMF_CERTTEMPLATE_get0_extensions(const OSSL_CRMF_CERTTEMPLATE *tmpl); +const X509_NAME *OSSL_CRMF_CERTID_get0_issuer(const OSSL_CRMF_CERTID *cid); +const ASN1_INTEGER *OSSL_CRMF_CERTID_get0_serialNumber(const OSSL_CRMF_CERTID *cid); +int OSSL_CRMF_CERTTEMPLATE_fill(OSSL_CRMF_CERTTEMPLATE *tmpl, + EVP_PKEY *pubkey, + const X509_NAME *subject, + const X509_NAME *issuer, + const ASN1_INTEGER *serial); +X509 *OSSL_CRMF_ENCRYPTEDVALUE_get1_encCert(const OSSL_CRMF_ENCRYPTEDVALUE *ecert, + OSSL_LIB_CTX *libctx, const char *propq, + EVP_PKEY *pkey); +X509 *OSSL_CRMF_ENCRYPTEDKEY_get1_encCert(const OSSL_CRMF_ENCRYPTEDKEY *ecert, + OSSL_LIB_CTX *libctx, const char *propq, + EVP_PKEY *pkey, unsigned int flags); +unsigned char *OSSL_CRMF_ENCRYPTEDVALUE_decrypt(const OSSL_CRMF_ENCRYPTEDVALUE *enc, + OSSL_LIB_CTX *libctx, const char *propq, + EVP_PKEY *pkey, int *outlen); +EVP_PKEY *OSSL_CRMF_ENCRYPTEDKEY_get1_pkey(const OSSL_CRMF_ENCRYPTEDKEY *encryptedKey, + X509_STORE *ts, STACK_OF(X509) *extra, EVP_PKEY *pkey, + X509 *cert, ASN1_OCTET_STRING *secret, + OSSL_LIB_CTX *libctx, const char *propq); +int OSSL_CRMF_MSG_centralkeygen_requested(const OSSL_CRMF_MSG *crm, const X509_REQ *p10cr); +#ifndef OPENSSL_NO_CMS +OSSL_CRMF_ENCRYPTEDKEY *OSSL_CRMF_ENCRYPTEDKEY_init_envdata(CMS_EnvelopedData *envdata); +#endif + +#ifdef __cplusplus +} +#endif +#endif /* !defined(OPENSSL_NO_CRMF) */ +#endif /* !defined(OPENSSL_CRMF_H) */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/crmferr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/crmferr.h new file mode 100644 index 0000000000000000000000000000000000000000..22153940eeb90760d5eab608566cd3493ad1daed --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/crmferr.h @@ -0,0 +1,55 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_CRMFERR_H +#define OPENSSL_CRMFERR_H +#pragma once + +#include +#include +#include + +#ifndef OPENSSL_NO_CRMF + +/* + * CRMF reason codes. + */ +#define CRMF_R_BAD_PBM_ITERATIONCOUNT 100 +#define CRMF_R_CMS_NOT_SUPPORTED 122 +#define CRMF_R_CRMFERROR 102 +#define CRMF_R_ERROR 103 +#define CRMF_R_ERROR_DECODING_CERTIFICATE 104 +#define CRMF_R_ERROR_DECODING_ENCRYPTEDKEY 123 +#define CRMF_R_ERROR_DECRYPTING_CERTIFICATE 105 +#define CRMF_R_ERROR_DECRYPTING_ENCRYPTEDKEY 124 +#define CRMF_R_ERROR_DECRYPTING_ENCRYPTEDVALUE 125 +#define CRMF_R_ERROR_DECRYPTING_SYMMETRIC_KEY 106 +#define CRMF_R_ERROR_SETTING_PURPOSE 126 +#define CRMF_R_ERROR_VERIFYING_ENCRYPTEDKEY 127 +#define CRMF_R_FAILURE_OBTAINING_RANDOM 107 +#define CRMF_R_ITERATIONCOUNT_BELOW_100 108 +#define CRMF_R_MALFORMED_IV 101 +#define CRMF_R_NULL_ARGUMENT 109 +#define CRMF_R_POPOSKINPUT_NOT_SUPPORTED 113 +#define CRMF_R_POPO_INCONSISTENT_CENTRAL_KEYGEN 128 +#define CRMF_R_POPO_INCONSISTENT_PUBLIC_KEY 117 +#define CRMF_R_POPO_MISSING 121 +#define CRMF_R_POPO_MISSING_PUBLIC_KEY 118 +#define CRMF_R_POPO_MISSING_SUBJECT 119 +#define CRMF_R_POPO_RAVERIFIED_NOT_ACCEPTED 120 +#define CRMF_R_SETTING_MAC_ALGOR_FAILURE 110 +#define CRMF_R_SETTING_OWF_ALGOR_FAILURE 111 +#define CRMF_R_UNSUPPORTED_ALGORITHM 112 +#define CRMF_R_UNSUPPORTED_CIPHER 114 +#define CRMF_R_UNSUPPORTED_METHOD_FOR_CREATING_POPO 115 +#define CRMF_R_UNSUPPORTED_POPO_METHOD 116 + +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/crypto.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/crypto.h new file mode 100644 index 0000000000000000000000000000000000000000..cf31bcda7ae1cac05c1465be362d10395cd3a106 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/crypto.h @@ -0,0 +1,619 @@ +/* + * WARNING: do not edit! + * Generated by makefile from include\openssl\crypto.h.in + * + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. + * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* clang-format off */ + +/* clang-format on */ + +#ifndef OPENSSL_CRYPTO_H +#define OPENSSL_CRYPTO_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_CRYPTO_H +#endif + +#include +#include + +#include + +#ifndef OPENSSL_NO_STDIO +#include +#endif + +#include +#include +#include +#include +#include +#include + +#ifdef CHARSET_EBCDIC +#include +#endif + +/* + * Resolve problems on some operating systems with symbol names that clash + * one way or another + */ +#include + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define SSLeay OpenSSL_version_num +#define SSLeay_version OpenSSL_version +#define SSLEAY_VERSION_NUMBER OPENSSL_VERSION_NUMBER +#define SSLEAY_VERSION OPENSSL_VERSION +#define SSLEAY_CFLAGS OPENSSL_CFLAGS +#define SSLEAY_BUILT_ON OPENSSL_BUILT_ON +#define SSLEAY_PLATFORM OPENSSL_PLATFORM +#define SSLEAY_DIR OPENSSL_DIR + +/* + * Old type for allocating dynamic locks. No longer used. Use the new thread + * API instead. + */ +typedef struct { + int dummy; +} CRYPTO_dynlock; + +#endif /* OPENSSL_NO_DEPRECATED_1_1_0 */ + +typedef void CRYPTO_RWLOCK; + +CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void); +__owur int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock); +__owur int CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock); +int CRYPTO_THREAD_unlock(CRYPTO_RWLOCK *lock); +void CRYPTO_THREAD_lock_free(CRYPTO_RWLOCK *lock); + +int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock); +int CRYPTO_atomic_add64(uint64_t *val, uint64_t op, uint64_t *ret, + CRYPTO_RWLOCK *lock); +int CRYPTO_atomic_and(uint64_t *val, uint64_t op, uint64_t *ret, + CRYPTO_RWLOCK *lock); +int CRYPTO_atomic_or(uint64_t *val, uint64_t op, uint64_t *ret, + CRYPTO_RWLOCK *lock); +int CRYPTO_atomic_load(uint64_t *val, uint64_t *ret, CRYPTO_RWLOCK *lock); +int CRYPTO_atomic_load_int(int *val, int *ret, CRYPTO_RWLOCK *lock); +int CRYPTO_atomic_store(uint64_t *dst, uint64_t val, CRYPTO_RWLOCK *lock); + +/* No longer needed, so this is a no-op */ +#define OPENSSL_malloc_init() \ + while (0) \ + continue + +#define OPENSSL_malloc(num) \ + CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE) +#define OPENSSL_zalloc(num) \ + CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE) +#define OPENSSL_malloc_array(num, size) \ + CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE) +#define OPENSSL_calloc(num, size) \ + CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE) +#define OPENSSL_aligned_alloc(num, alignment, freeptr) \ + CRYPTO_aligned_alloc(num, alignment, freeptr, \ + OPENSSL_FILE, OPENSSL_LINE) +#define OPENSSL_aligned_alloc_array(num, size, alignment, freeptr) \ + CRYPTO_aligned_alloc_array(num, size, alignment, freeptr, \ + OPENSSL_FILE, OPENSSL_LINE) +#define OPENSSL_realloc(addr, num) \ + CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE) +#define OPENSSL_clear_realloc(addr, old_num, num) \ + CRYPTO_clear_realloc(addr, old_num, num, OPENSSL_FILE, OPENSSL_LINE) +#define OPENSSL_realloc_array(addr, num, size) \ + CRYPTO_realloc_array(addr, num, size, OPENSSL_FILE, OPENSSL_LINE) +#define OPENSSL_clear_realloc_array(addr, old_num, num, size) \ + CRYPTO_clear_realloc_array(addr, old_num, num, size, \ + OPENSSL_FILE, OPENSSL_LINE) +#define OPENSSL_clear_free(addr, num) \ + CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE) +#define OPENSSL_free(addr) \ + CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE) +#define OPENSSL_memdup(str, s) \ + CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE) +#define OPENSSL_strdup(str) \ + CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE) +#define OPENSSL_strndup(str, n) \ + CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE) +#define OPENSSL_secure_malloc(num) \ + CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE) +#define OPENSSL_secure_zalloc(num) \ + CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE) +#define OPENSSL_secure_malloc_array(num, size) \ + CRYPTO_secure_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE) +#define OPENSSL_secure_calloc(num, size) \ + CRYPTO_secure_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE) +#define OPENSSL_secure_free(addr) \ + CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE) +#define OPENSSL_secure_clear_free(addr, num) \ + CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE) +#define OPENSSL_secure_actual_size(ptr) \ + CRYPTO_secure_actual_size(ptr) + +size_t OPENSSL_strlcpy(char *dst, const char *src, size_t siz); +size_t OPENSSL_strlcat(char *dst, const char *src, size_t siz); +size_t OPENSSL_strnlen(const char *str, size_t maxlen); +int OPENSSL_strtoul(const char *str, char **endptr, int base, unsigned long *num); +int OPENSSL_buf2hexstr_ex(char *str, size_t str_n, size_t *strlength, + const unsigned char *buf, size_t buflen, + const char sep); +char *OPENSSL_buf2hexstr(const unsigned char *buf, long buflen); +int OPENSSL_hexstr2buf_ex(unsigned char *buf, size_t buf_n, size_t *buflen, + const char *str, const char sep); +unsigned char *OPENSSL_hexstr2buf(const char *str, long *buflen); +int OPENSSL_hexchar2int(unsigned char c); +int OPENSSL_strcasecmp(const char *s1, const char *s2); +int OPENSSL_strncasecmp(const char *s1, const char *s2, size_t n); + +#define OPENSSL_MALLOC_MAX_NELEMS(type) (((1U << (sizeof(int) * 8 - 1)) - 1) / sizeof(type)) + +/* + * These functions return the values of OPENSSL_VERSION_MAJOR, + * OPENSSL_VERSION_MINOR, OPENSSL_VERSION_PATCH, OPENSSL_VERSION_PRE_RELEASE + * and OPENSSL_VERSION_BUILD_METADATA, respectively. + */ +unsigned int OPENSSL_version_major(void); +unsigned int OPENSSL_version_minor(void); +unsigned int OPENSSL_version_patch(void); +const char *OPENSSL_version_pre_release(void); +const char *OPENSSL_version_build_metadata(void); + +unsigned long OpenSSL_version_num(void); +const char *OpenSSL_version(int type); +#define OPENSSL_VERSION 0 +#define OPENSSL_CFLAGS 1 +#define OPENSSL_BUILT_ON 2 +#define OPENSSL_PLATFORM 3 +#define OPENSSL_DIR 4 +#define OPENSSL_ENGINES_DIR 5 +#define OPENSSL_VERSION_STRING 6 +#define OPENSSL_FULL_VERSION_STRING 7 +#define OPENSSL_MODULES_DIR 8 +#define OPENSSL_CPU_INFO 9 +#define OPENSSL_WINCTX 10 + +const char *OPENSSL_info(int type); +/* + * The series starts at 1001 to avoid confusion with the OpenSSL_version + * types. + */ +#define OPENSSL_INFO_CONFIG_DIR 1001 +#define OPENSSL_INFO_ENGINES_DIR 1002 +#define OPENSSL_INFO_MODULES_DIR 1003 +#define OPENSSL_INFO_DSO_EXTENSION 1004 +#define OPENSSL_INFO_DIR_FILENAME_SEPARATOR 1005 +#define OPENSSL_INFO_LIST_SEPARATOR 1006 +#define OPENSSL_INFO_SEED_SOURCE 1007 +#define OPENSSL_INFO_CPU_SETTINGS 1008 +#define OPENSSL_INFO_WINDOWS_CONTEXT 1009 + +int OPENSSL_issetugid(void); + +struct crypto_ex_data_st { + OSSL_LIB_CTX *ctx; + STACK_OF(void) *sk; +}; + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(void, void, void) +#define sk_void_num(sk) OPENSSL_sk_num(ossl_check_const_void_sk_type(sk)) +#define sk_void_value(sk, idx) ((void *)OPENSSL_sk_value(ossl_check_const_void_sk_type(sk), (idx))) +#define sk_void_new(cmp) ((STACK_OF(void) *)OPENSSL_sk_new(ossl_check_void_compfunc_type(cmp))) +#define sk_void_new_null() ((STACK_OF(void) *)OPENSSL_sk_new_null()) +#define sk_void_new_reserve(cmp, n) ((STACK_OF(void) *)OPENSSL_sk_new_reserve(ossl_check_void_compfunc_type(cmp), (n))) +#define sk_void_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_void_sk_type(sk), (n)) +#define sk_void_free(sk) OPENSSL_sk_free(ossl_check_void_sk_type(sk)) +#define sk_void_zero(sk) OPENSSL_sk_zero(ossl_check_void_sk_type(sk)) +#define sk_void_delete(sk, i) ((void *)OPENSSL_sk_delete(ossl_check_void_sk_type(sk), (i))) +#define sk_void_delete_ptr(sk, ptr) ((void *)OPENSSL_sk_delete_ptr(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr))) +#define sk_void_push(sk, ptr) OPENSSL_sk_push(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr)) +#define sk_void_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr)) +#define sk_void_pop(sk) ((void *)OPENSSL_sk_pop(ossl_check_void_sk_type(sk))) +#define sk_void_shift(sk) ((void *)OPENSSL_sk_shift(ossl_check_void_sk_type(sk))) +#define sk_void_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_void_sk_type(sk), ossl_check_void_freefunc_type(freefunc)) +#define sk_void_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr), (idx)) +#define sk_void_set(sk, idx, ptr) ((void *)OPENSSL_sk_set(ossl_check_void_sk_type(sk), (idx), ossl_check_void_type(ptr))) +#define sk_void_find(sk, ptr) OPENSSL_sk_find(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr)) +#define sk_void_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr)) +#define sk_void_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr), pnum) +#define sk_void_sort(sk) OPENSSL_sk_sort(ossl_check_void_sk_type(sk)) +#define sk_void_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_void_sk_type(sk)) +#define sk_void_dup(sk) ((STACK_OF(void) *)OPENSSL_sk_dup(ossl_check_const_void_sk_type(sk))) +#define sk_void_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(void) *)OPENSSL_sk_deep_copy(ossl_check_const_void_sk_type(sk), ossl_check_void_copyfunc_type(copyfunc), ossl_check_void_freefunc_type(freefunc))) +#define sk_void_set_cmp_func(sk, cmp) ((sk_void_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_void_sk_type(sk), ossl_check_void_compfunc_type(cmp))) + +/* clang-format on */ + +/* + * Per class, we have a STACK of function pointers. + */ +#define CRYPTO_EX_INDEX_SSL 0 +#define CRYPTO_EX_INDEX_SSL_CTX 1 +#define CRYPTO_EX_INDEX_SSL_SESSION 2 +#define CRYPTO_EX_INDEX_X509 3 +#define CRYPTO_EX_INDEX_X509_STORE 4 +#define CRYPTO_EX_INDEX_X509_STORE_CTX 5 +#define CRYPTO_EX_INDEX_DH 6 +#define CRYPTO_EX_INDEX_DSA 7 +#define CRYPTO_EX_INDEX_EC_KEY 8 +#define CRYPTO_EX_INDEX_RSA 9 +#define CRYPTO_EX_INDEX_ENGINE 10 +#define CRYPTO_EX_INDEX_UI 11 +#define CRYPTO_EX_INDEX_BIO 12 +#define CRYPTO_EX_INDEX_APP 13 +#define CRYPTO_EX_INDEX_UI_METHOD 14 +#define CRYPTO_EX_INDEX_RAND_DRBG 15 +#define CRYPTO_EX_INDEX_DRBG CRYPTO_EX_INDEX_RAND_DRBG +#define CRYPTO_EX_INDEX_OSSL_LIB_CTX 16 +#define CRYPTO_EX_INDEX_EVP_PKEY 17 +#define CRYPTO_EX_INDEX__COUNT 18 + +typedef void CRYPTO_EX_new(void *parent, void *ptr, CRYPTO_EX_DATA *ad, + int idx, long argl, void *argp); +typedef void CRYPTO_EX_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad, + int idx, long argl, void *argp); +typedef int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from, + void **from_d, int idx, long argl, void *argp); +__owur int CRYPTO_get_ex_new_index(int class_index, long argl, void *argp, + CRYPTO_EX_new *new_func, + CRYPTO_EX_dup *dup_func, + CRYPTO_EX_free *free_func); +/* No longer use an index. */ +int CRYPTO_free_ex_index(int class_index, int idx); + +/* + * Initialise/duplicate/free CRYPTO_EX_DATA variables corresponding to a + * given class (invokes whatever per-class callbacks are applicable) + */ +int CRYPTO_new_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad); +int CRYPTO_dup_ex_data(int class_index, CRYPTO_EX_DATA *to, + const CRYPTO_EX_DATA *from); + +void CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad); + +/* Allocate a single item in the CRYPTO_EX_DATA variable */ +int CRYPTO_alloc_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad, + int idx); + +/* + * Get/set data in a CRYPTO_EX_DATA variable corresponding to a particular + * index (relative to the class type involved) + */ +int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int idx, void *val); +void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx); + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +/* + * This function cleans up all "ex_data" state. It mustn't be called under + * potential race-conditions. + */ +#define CRYPTO_cleanup_all_ex_data() \ + while (0) \ + continue + +/* + * The old locking functions have been removed completely without compatibility + * macros. This is because the old functions either could not properly report + * errors, or the returned error values were not clearly documented. + * Replacing the locking functions with no-ops would cause race condition + * issues in the affected applications. It is far better for them to fail at + * compile time. + * On the other hand, the locking callbacks are no longer used. Consequently, + * the callback management functions can be safely replaced with no-op macros. + */ +#define CRYPTO_num_locks() (1) +#define CRYPTO_set_locking_callback(func) +#define CRYPTO_get_locking_callback() (NULL) +#define CRYPTO_set_add_lock_callback(func) +#define CRYPTO_get_add_lock_callback() (NULL) + +/* + * These defines where used in combination with the old locking callbacks, + * they are not called anymore, but old code that's not called might still + * use them. + */ +#define CRYPTO_LOCK 1 +#define CRYPTO_UNLOCK 2 +#define CRYPTO_READ 4 +#define CRYPTO_WRITE 8 + +/* This structure is no longer used */ +typedef struct crypto_threadid_st { + int dummy; +} CRYPTO_THREADID; +/* Only use CRYPTO_THREADID_set_[numeric|pointer]() within callbacks */ +#define CRYPTO_THREADID_set_numeric(id, val) +#define CRYPTO_THREADID_set_pointer(id, ptr) +#define CRYPTO_THREADID_set_callback(threadid_func) (0) +#define CRYPTO_THREADID_get_callback() (NULL) +#define CRYPTO_THREADID_current(id) +#define CRYPTO_THREADID_cmp(a, b) (-1) +#define CRYPTO_THREADID_cpy(dest, src) +#define CRYPTO_THREADID_hash(id) (0UL) + +#ifndef OPENSSL_NO_DEPRECATED_1_0_0 +#define CRYPTO_set_id_callback(func) +#define CRYPTO_get_id_callback() (NULL) +#define CRYPTO_thread_id() (0UL) +#endif /* OPENSSL_NO_DEPRECATED_1_0_0 */ + +#define CRYPTO_set_dynlock_create_callback(dyn_create_function) +#define CRYPTO_set_dynlock_lock_callback(dyn_lock_function) +#define CRYPTO_set_dynlock_destroy_callback(dyn_destroy_function) +#define CRYPTO_get_dynlock_create_callback() (NULL) +#define CRYPTO_get_dynlock_lock_callback() (NULL) +#define CRYPTO_get_dynlock_destroy_callback() (NULL) +#endif /* OPENSSL_NO_DEPRECATED_1_1_0 */ + +typedef void *(*CRYPTO_malloc_fn)(size_t num, const char *file, int line); +typedef void *(*CRYPTO_realloc_fn)(void *addr, size_t num, const char *file, + int line); +typedef void (*CRYPTO_free_fn)(void *addr, const char *file, int line); +int CRYPTO_set_mem_functions(CRYPTO_malloc_fn malloc_fn, + CRYPTO_realloc_fn realloc_fn, + CRYPTO_free_fn free_fn); +void CRYPTO_get_mem_functions(CRYPTO_malloc_fn *malloc_fn, + CRYPTO_realloc_fn *realloc_fn, + CRYPTO_free_fn *free_fn); + +OSSL_CRYPTO_ALLOC void *CRYPTO_malloc(size_t num, const char *file, int line); +OSSL_CRYPTO_ALLOC void *CRYPTO_zalloc(size_t num, const char *file, int line); +OSSL_CRYPTO_ALLOC void *CRYPTO_malloc_array(size_t num, size_t size, + const char *file, int line); +OSSL_CRYPTO_ALLOC void *CRYPTO_calloc(size_t num, size_t size, + const char *file, int line); +OSSL_CRYPTO_ALLOC void *CRYPTO_aligned_alloc(size_t num, size_t align, + void **freeptr, const char *file, + int line); +OSSL_CRYPTO_ALLOC void *CRYPTO_aligned_alloc_array(size_t num, size_t size, + size_t align, void **freeptr, + const char *file, int line); +void *CRYPTO_memdup(const void *str, size_t siz, const char *file, int line); +char *CRYPTO_strdup(const char *str, const char *file, int line); +char *CRYPTO_strndup(const char *str, size_t s, const char *file, int line); +void CRYPTO_free(void *ptr, const char *file, int line); +void CRYPTO_clear_free(void *ptr, size_t num, const char *file, int line); +void *CRYPTO_realloc(void *addr, size_t num, const char *file, int line); +void *CRYPTO_clear_realloc(void *addr, size_t old_num, size_t num, + const char *file, int line); +void *CRYPTO_realloc_array(void *addr, size_t num, size_t size, + const char *file, int line); +void *CRYPTO_clear_realloc_array(void *addr, size_t old_num, size_t num, + size_t size, const char *file, int line); + +int CRYPTO_secure_malloc_init(size_t sz, size_t minsize); +int CRYPTO_secure_malloc_done(void); +OSSL_CRYPTO_ALLOC void *CRYPTO_secure_malloc(size_t num, const char *file, int line); +OSSL_CRYPTO_ALLOC void *CRYPTO_secure_zalloc(size_t num, const char *file, int line); +OSSL_CRYPTO_ALLOC void *CRYPTO_secure_malloc_array(size_t num, size_t size, + const char *file, int line); +OSSL_CRYPTO_ALLOC void *CRYPTO_secure_calloc(size_t num, size_t size, + const char *file, int line); +void CRYPTO_secure_free(void *ptr, const char *file, int line); +void CRYPTO_secure_clear_free(void *ptr, size_t num, + const char *file, int line); +int CRYPTO_secure_allocated(const void *ptr); +int CRYPTO_secure_malloc_initialized(void); +size_t CRYPTO_secure_actual_size(void *ptr); +size_t CRYPTO_secure_used(void); + +void OPENSSL_cleanse(void *ptr, size_t len); + +#ifndef OPENSSL_NO_CRYPTO_MDEBUG +/* + * The following can be used to detect memory leaks in the library. If + * used, it turns on malloc checking + */ +#define CRYPTO_MEM_CHECK_OFF 0x0 /* Control only */ +#define CRYPTO_MEM_CHECK_ON 0x1 /* Control and mode bit */ +#define CRYPTO_MEM_CHECK_ENABLE 0x2 /* Control and mode bit */ +#define CRYPTO_MEM_CHECK_DISABLE 0x3 /* Control only */ + +/* max allowed length for value of OPENSSL_MALLOC_FAILURES env var. */ +#define CRYPTO_MEM_CHECK_MAX_FS 256 + +void CRYPTO_get_alloc_counts(int *mcount, int *rcount, int *fcount); +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define OPENSSL_mem_debug_push(info) \ + CRYPTO_mem_debug_push(info, OPENSSL_FILE, OPENSSL_LINE) +#define OPENSSL_mem_debug_pop() \ + CRYPTO_mem_debug_pop() +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int CRYPTO_set_mem_debug(int flag); +OSSL_DEPRECATEDIN_3_0 int CRYPTO_mem_ctrl(int mode); +OSSL_DEPRECATEDIN_3_0 int CRYPTO_mem_debug_push(const char *info, + const char *file, int line); +OSSL_DEPRECATEDIN_3_0 int CRYPTO_mem_debug_pop(void); +OSSL_DEPRECATEDIN_3_0 void CRYPTO_mem_debug_malloc(void *addr, size_t num, + int flag, + const char *file, int line); +OSSL_DEPRECATEDIN_3_0 void CRYPTO_mem_debug_realloc(void *addr1, void *addr2, + size_t num, int flag, + const char *file, int line); +OSSL_DEPRECATEDIN_3_0 void CRYPTO_mem_debug_free(void *addr, int flag, + const char *file, int line); +OSSL_DEPRECATEDIN_3_0 +int CRYPTO_mem_leaks_cb(int (*cb)(const char *str, size_t len, void *u), + void *u); +#endif +#ifndef OPENSSL_NO_STDIO +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int CRYPTO_mem_leaks_fp(FILE *); +#endif +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int CRYPTO_mem_leaks(BIO *bio); +#endif +#endif /* OPENSSL_NO_CRYPTO_MDEBUG */ + +/* die if we have to */ +ossl_noreturn void OPENSSL_die(const char *assertion, const char *file, int line); +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define OpenSSLDie(f, l, a) OPENSSL_die((a), (f), (l)) +#endif +#define OPENSSL_assert(e) \ + (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1)) + +int OPENSSL_isservice(void); + +void OPENSSL_init(void); +#ifdef OPENSSL_SYS_UNIX +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 void OPENSSL_fork_prepare(void); +OSSL_DEPRECATEDIN_3_0 void OPENSSL_fork_parent(void); +OSSL_DEPRECATEDIN_3_0 void OPENSSL_fork_child(void); +#endif +#endif + +struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result); +int OPENSSL_gmtime_adj(struct tm *tm, int offset_day, long offset_sec); +int OPENSSL_gmtime_diff(int *pday, int *psec, + const struct tm *from, const struct tm *to); + +/* + * CRYPTO_memcmp returns zero iff the |len| bytes at |a| and |b| are equal. + * It takes an amount of time dependent on |len|, but independent of the + * contents of |a| and |b|. Unlike memcmp, it cannot be used to put elements + * into a defined order as the return value when a != b is undefined, other + * than to be non-zero. + */ +int CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len); + +/* Standard initialisation options */ +#define OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS 0x00000001L +#define OPENSSL_INIT_LOAD_CRYPTO_STRINGS 0x00000002L +#define OPENSSL_INIT_ADD_ALL_CIPHERS 0x00000004L +#define OPENSSL_INIT_ADD_ALL_DIGESTS 0x00000008L +#define OPENSSL_INIT_NO_ADD_ALL_CIPHERS 0x00000010L +#define OPENSSL_INIT_NO_ADD_ALL_DIGESTS 0x00000020L +#define OPENSSL_INIT_LOAD_CONFIG 0x00000040L +#define OPENSSL_INIT_NO_LOAD_CONFIG 0x00000080L +#define OPENSSL_INIT_ASYNC 0x00000100L +#define OPENSSL_INIT_ENGINE_RDRAND 0x00000200L +#define OPENSSL_INIT_ENGINE_DYNAMIC 0x00000400L +#define OPENSSL_INIT_ENGINE_OPENSSL 0x00000800L +#define OPENSSL_INIT_ENGINE_CRYPTODEV 0x00001000L +#define OPENSSL_INIT_ENGINE_CAPI 0x00002000L +#define OPENSSL_INIT_ENGINE_PADLOCK 0x00004000L +#define OPENSSL_INIT_ENGINE_AFALG 0x00008000L +/* FREE: 0x00010000L */ +#define OPENSSL_INIT_ATFORK 0x00020000L +/* OPENSSL_INIT_BASE_ONLY 0x00040000L */ +#define OPENSSL_INIT_NO_ATEXIT 0x00080000L +/* OPENSSL_INIT flag range 0x03f00000 reserved for OPENSSL_init_ssl() */ +/* FREE: 0x04000000L */ +/* FREE: 0x08000000L */ +/* FREE: 0x10000000L */ +/* FREE: 0x20000000L */ +/* FREE: 0x40000000L */ +/* FREE: 0x80000000L */ +/* Max OPENSSL_INIT flag value is 0x80000000 */ + +/* openssl and dasync not counted as builtin */ +#define OPENSSL_INIT_ENGINE_ALL_BUILTIN \ + (OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \ + | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | OPENSSL_INIT_ENGINE_PADLOCK) + +/* Library initialisation functions */ +void OPENSSL_cleanup(void); +int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings); +int OPENSSL_atexit(void (*handler)(void)); +void OPENSSL_thread_stop(void); +void OPENSSL_thread_stop_ex(OSSL_LIB_CTX *ctx); + +/* Low-level control of initialization */ +OPENSSL_INIT_SETTINGS *OPENSSL_INIT_new(void); +#ifndef OPENSSL_NO_STDIO +int OPENSSL_INIT_set_config_filename(OPENSSL_INIT_SETTINGS *settings, + const char *config_filename); +void OPENSSL_INIT_set_config_file_flags(OPENSSL_INIT_SETTINGS *settings, + unsigned long flags); +int OPENSSL_INIT_set_config_appname(OPENSSL_INIT_SETTINGS *settings, + const char *config_appname); +#endif +void OPENSSL_INIT_free(OPENSSL_INIT_SETTINGS *settings); + +#if defined(OPENSSL_THREADS) && !defined(CRYPTO_TDEBUG) +#if defined(_WIN32) +#if defined(BASETYPES) || defined(_WINDEF_H) +/* application has to include in order to use this */ +typedef DWORD CRYPTO_THREAD_LOCAL; +typedef DWORD CRYPTO_THREAD_ID; + +typedef LONG CRYPTO_ONCE; +#define CRYPTO_ONCE_STATIC_INIT 0 +#endif +#else +#if defined(__TANDEM) && defined(_SPT_MODEL_) +#define SPT_THREAD_SIGNAL 1 +#define SPT_THREAD_AWARE 1 +#include +#else +#include +#endif +typedef pthread_once_t CRYPTO_ONCE; +typedef pthread_key_t CRYPTO_THREAD_LOCAL; +typedef pthread_t CRYPTO_THREAD_ID; + +#define CRYPTO_ONCE_STATIC_INIT PTHREAD_ONCE_INIT +#endif +#endif + +#if !defined(CRYPTO_ONCE_STATIC_INIT) +typedef unsigned int CRYPTO_ONCE; +typedef unsigned int CRYPTO_THREAD_LOCAL; +typedef unsigned int CRYPTO_THREAD_ID; +#define CRYPTO_ONCE_STATIC_INIT 0 +#endif + +int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void)); + +int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *)); +void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key); +int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val); +int CRYPTO_THREAD_cleanup_local(CRYPTO_THREAD_LOCAL *key); + +CRYPTO_THREAD_ID CRYPTO_THREAD_get_current_id(void); +int CRYPTO_THREAD_compare_id(CRYPTO_THREAD_ID a, CRYPTO_THREAD_ID b); + +OSSL_LIB_CTX *OSSL_LIB_CTX_new(void); +OSSL_LIB_CTX *OSSL_LIB_CTX_new_from_dispatch(const OSSL_CORE_HANDLE *handle, + const OSSL_DISPATCH *in); +OSSL_LIB_CTX *OSSL_LIB_CTX_new_child(const OSSL_CORE_HANDLE *handle, + const OSSL_DISPATCH *in); +int OSSL_LIB_CTX_load_config(OSSL_LIB_CTX *ctx, const char *config_file); +void OSSL_LIB_CTX_free(OSSL_LIB_CTX *); +OSSL_LIB_CTX *OSSL_LIB_CTX_get0_global_default(void); +OSSL_LIB_CTX *OSSL_LIB_CTX_set0_default(OSSL_LIB_CTX *libctx); +int OSSL_LIB_CTX_get_conf_diagnostics(OSSL_LIB_CTX *ctx); +void OSSL_LIB_CTX_set_conf_diagnostics(OSSL_LIB_CTX *ctx, int value); + +void OSSL_sleep(uint64_t millis); + +void *OSSL_LIB_CTX_get_data(OSSL_LIB_CTX *ctx, int index); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cryptoerr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cryptoerr.h new file mode 100644 index 0000000000000000000000000000000000000000..626e3e9be57bdb934a309b599ca0188798d47d1f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cryptoerr.h @@ -0,0 +1,54 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_CRYPTOERR_H +#define OPENSSL_CRYPTOERR_H +#pragma once + +#include +#include +#include + +/* + * CRYPTO reason codes. + */ +#define CRYPTO_R_BAD_ALGORITHM_NAME 117 +#define CRYPTO_R_CONFLICTING_NAMES 118 +#define CRYPTO_R_HEX_STRING_TOO_SHORT 121 +#define CRYPTO_R_ILLEGAL_HEX_DIGIT 102 +#define CRYPTO_R_INSUFFICIENT_DATA_SPACE 106 +#define CRYPTO_R_INSUFFICIENT_PARAM_SIZE 107 +#define CRYPTO_R_INSUFFICIENT_SECURE_DATA_SPACE 108 +#define CRYPTO_R_INTEGER_OVERFLOW 127 +#define CRYPTO_R_INVALID_NEGATIVE_VALUE 122 +#define CRYPTO_R_INVALID_NULL_ARGUMENT 109 +#define CRYPTO_R_INVALID_OSSL_PARAM_TYPE 110 +#define CRYPTO_R_NO_PARAMS_TO_MERGE 131 +#define CRYPTO_R_NO_SPACE_FOR_TERMINATING_NULL 128 +#define CRYPTO_R_ODD_NUMBER_OF_DIGITS 103 +#define CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY 123 +#define CRYPTO_R_PARAM_NOT_INTEGER_TYPE 124 +#define CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE 129 +#define CRYPTO_R_PARAM_UNSIGNED_INTEGER_NEGATIVE_VALUE_UNSUPPORTED 125 +#define CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT 130 +#define CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION 126 +#define CRYPTO_R_PROVIDER_ALREADY_EXISTS 104 +#define CRYPTO_R_PROVIDER_SECTION_ERROR 105 +#define CRYPTO_R_RANDOM_SECTION_ERROR 119 +#define CRYPTO_R_SECURE_MALLOC_FAILURE 111 +#define CRYPTO_R_STRING_TOO_LONG 112 +#define CRYPTO_R_TOO_MANY_BYTES 113 +#define CRYPTO_R_TOO_MANY_NAMES 132 +#define CRYPTO_R_TOO_MANY_RECORDS 114 +#define CRYPTO_R_TOO_SMALL_BUFFER 116 +#define CRYPTO_R_UNKNOWN_NAME_IN_RANDOM_SECTION 120 +#define CRYPTO_R_ZERO_LENGTH_NUMBER 115 + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cryptoerr_legacy.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cryptoerr_legacy.h new file mode 100644 index 0000000000000000000000000000000000000000..b1388a5b57b369ce9c2a02f2981578ba5c47ab23 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cryptoerr_legacy.h @@ -0,0 +1,1466 @@ +/* + * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* + * This header file preserves symbols from pre-3.0 OpenSSL. + * It should never be included directly, as it's already included + * by the public {lib}err.h headers, and since it will go away some + * time in the future. + */ + +#ifndef OPENSSL_CRYPTOERR_LEGACY_H +#define OPENSSL_CRYPTOERR_LEGACY_H +#pragma once + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int ERR_load_ASN1_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_ASYNC_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_BIO_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_BN_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_BUF_strings(void); +#ifndef OPENSSL_NO_CMS +OSSL_DEPRECATEDIN_3_0 int ERR_load_CMS_strings(void); +#endif +#ifndef OPENSSL_NO_COMP +OSSL_DEPRECATEDIN_3_0 int ERR_load_COMP_strings(void); +#endif +OSSL_DEPRECATEDIN_3_0 int ERR_load_CONF_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_CRYPTO_strings(void); +#ifndef OPENSSL_NO_CT +OSSL_DEPRECATEDIN_3_0 int ERR_load_CT_strings(void); +#endif +#ifndef OPENSSL_NO_DH +OSSL_DEPRECATEDIN_3_0 int ERR_load_DH_strings(void); +#endif +#ifndef OPENSSL_NO_DSA +OSSL_DEPRECATEDIN_3_0 int ERR_load_DSA_strings(void); +#endif +#ifndef OPENSSL_NO_EC +OSSL_DEPRECATEDIN_3_0 int ERR_load_EC_strings(void); +#endif +#ifndef OPENSSL_NO_ENGINE +OSSL_DEPRECATEDIN_3_0 int ERR_load_ENGINE_strings(void); +#endif +OSSL_DEPRECATEDIN_3_0 int ERR_load_ERR_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_EVP_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_KDF_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_OBJ_strings(void); +#ifndef OPENSSL_NO_OCSP +OSSL_DEPRECATEDIN_3_0 int ERR_load_OCSP_strings(void); +#endif +OSSL_DEPRECATEDIN_3_0 int ERR_load_PEM_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_PKCS12_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_PKCS7_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_RAND_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_RSA_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_OSSL_STORE_strings(void); +#ifndef OPENSSL_NO_TS +OSSL_DEPRECATEDIN_3_0 int ERR_load_TS_strings(void); +#endif +OSSL_DEPRECATEDIN_3_0 int ERR_load_UI_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_X509_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_X509V3_strings(void); + +/* Collected _F_ macros from OpenSSL 1.1.1 */ + +/* + * ASN1 function codes. + */ +#define ASN1_F_A2D_ASN1_OBJECT 0 +#define ASN1_F_A2I_ASN1_INTEGER 0 +#define ASN1_F_A2I_ASN1_STRING 0 +#define ASN1_F_APPEND_EXP 0 +#define ASN1_F_ASN1_BIO_INIT 0 +#define ASN1_F_ASN1_BIT_STRING_SET_BIT 0 +#define ASN1_F_ASN1_CB 0 +#define ASN1_F_ASN1_CHECK_TLEN 0 +#define ASN1_F_ASN1_COLLECT 0 +#define ASN1_F_ASN1_D2I_EX_PRIMITIVE 0 +#define ASN1_F_ASN1_D2I_FP 0 +#define ASN1_F_ASN1_D2I_READ_BIO 0 +#define ASN1_F_ASN1_DIGEST 0 +#define ASN1_F_ASN1_DO_ADB 0 +#define ASN1_F_ASN1_DO_LOCK 0 +#define ASN1_F_ASN1_DUP 0 +#define ASN1_F_ASN1_ENC_SAVE 0 +#define ASN1_F_ASN1_EX_C2I 0 +#define ASN1_F_ASN1_FIND_END 0 +#define ASN1_F_ASN1_GENERALIZEDTIME_ADJ 0 +#define ASN1_F_ASN1_GENERATE_V3 0 +#define ASN1_F_ASN1_GET_INT64 0 +#define ASN1_F_ASN1_GET_OBJECT 0 +#define ASN1_F_ASN1_GET_UINT64 0 +#define ASN1_F_ASN1_I2D_BIO 0 +#define ASN1_F_ASN1_I2D_FP 0 +#define ASN1_F_ASN1_ITEM_D2I_FP 0 +#define ASN1_F_ASN1_ITEM_DUP 0 +#define ASN1_F_ASN1_ITEM_EMBED_D2I 0 +#define ASN1_F_ASN1_ITEM_EMBED_NEW 0 +#define ASN1_F_ASN1_ITEM_FLAGS_I2D 0 +#define ASN1_F_ASN1_ITEM_I2D_BIO 0 +#define ASN1_F_ASN1_ITEM_I2D_FP 0 +#define ASN1_F_ASN1_ITEM_PACK 0 +#define ASN1_F_ASN1_ITEM_SIGN 0 +#define ASN1_F_ASN1_ITEM_SIGN_CTX 0 +#define ASN1_F_ASN1_ITEM_UNPACK 0 +#define ASN1_F_ASN1_ITEM_VERIFY 0 +#define ASN1_F_ASN1_MBSTRING_NCOPY 0 +#define ASN1_F_ASN1_OBJECT_NEW 0 +#define ASN1_F_ASN1_OUTPUT_DATA 0 +#define ASN1_F_ASN1_PCTX_NEW 0 +#define ASN1_F_ASN1_PRIMITIVE_NEW 0 +#define ASN1_F_ASN1_SCTX_NEW 0 +#define ASN1_F_ASN1_SIGN 0 +#define ASN1_F_ASN1_STR2TYPE 0 +#define ASN1_F_ASN1_STRING_GET_INT64 0 +#define ASN1_F_ASN1_STRING_GET_UINT64 0 +#define ASN1_F_ASN1_STRING_SET 0 +#define ASN1_F_ASN1_STRING_TABLE_ADD 0 +#define ASN1_F_ASN1_STRING_TO_BN 0 +#define ASN1_F_ASN1_STRING_TYPE_NEW 0 +#define ASN1_F_ASN1_TEMPLATE_EX_D2I 0 +#define ASN1_F_ASN1_TEMPLATE_NEW 0 +#define ASN1_F_ASN1_TEMPLATE_NOEXP_D2I 0 +#define ASN1_F_ASN1_TIME_ADJ 0 +#define ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING 0 +#define ASN1_F_ASN1_TYPE_GET_OCTETSTRING 0 +#define ASN1_F_ASN1_UTCTIME_ADJ 0 +#define ASN1_F_ASN1_VERIFY 0 +#define ASN1_F_B64_READ_ASN1 0 +#define ASN1_F_B64_WRITE_ASN1 0 +#define ASN1_F_BIO_NEW_NDEF 0 +#define ASN1_F_BITSTR_CB 0 +#define ASN1_F_BN_TO_ASN1_STRING 0 +#define ASN1_F_C2I_ASN1_BIT_STRING 0 +#define ASN1_F_C2I_ASN1_INTEGER 0 +#define ASN1_F_C2I_ASN1_OBJECT 0 +#define ASN1_F_C2I_IBUF 0 +#define ASN1_F_C2I_UINT64_INT 0 +#define ASN1_F_COLLECT_DATA 0 +#define ASN1_F_D2I_ASN1_OBJECT 0 +#define ASN1_F_D2I_ASN1_UINTEGER 0 +#define ASN1_F_D2I_AUTOPRIVATEKEY 0 +#define ASN1_F_D2I_PRIVATEKEY 0 +#define ASN1_F_D2I_PUBLICKEY 0 +#define ASN1_F_DO_BUF 0 +#define ASN1_F_DO_CREATE 0 +#define ASN1_F_DO_DUMP 0 +#define ASN1_F_DO_TCREATE 0 +#define ASN1_F_I2A_ASN1_OBJECT 0 +#define ASN1_F_I2D_ASN1_BIO_STREAM 0 +#define ASN1_F_I2D_ASN1_OBJECT 0 +#define ASN1_F_I2D_DSA_PUBKEY 0 +#define ASN1_F_I2D_EC_PUBKEY 0 +#define ASN1_F_I2D_PRIVATEKEY 0 +#define ASN1_F_I2D_PUBLICKEY 0 +#define ASN1_F_I2D_RSA_PUBKEY 0 +#define ASN1_F_LONG_C2I 0 +#define ASN1_F_NDEF_PREFIX 0 +#define ASN1_F_NDEF_SUFFIX 0 +#define ASN1_F_OID_MODULE_INIT 0 +#define ASN1_F_PARSE_TAGGING 0 +#define ASN1_F_PKCS5_PBE2_SET_IV 0 +#define ASN1_F_PKCS5_PBE2_SET_SCRYPT 0 +#define ASN1_F_PKCS5_PBE_SET 0 +#define ASN1_F_PKCS5_PBE_SET0_ALGOR 0 +#define ASN1_F_PKCS5_PBKDF2_SET 0 +#define ASN1_F_PKCS5_SCRYPT_SET 0 +#define ASN1_F_SMIME_READ_ASN1 0 +#define ASN1_F_SMIME_TEXT 0 +#define ASN1_F_STABLE_GET 0 +#define ASN1_F_STBL_MODULE_INIT 0 +#define ASN1_F_UINT32_C2I 0 +#define ASN1_F_UINT32_NEW 0 +#define ASN1_F_UINT64_C2I 0 +#define ASN1_F_UINT64_NEW 0 +#define ASN1_F_X509_CRL_ADD0_REVOKED 0 +#define ASN1_F_X509_INFO_NEW 0 +#define ASN1_F_X509_NAME_ENCODE 0 +#define ASN1_F_X509_NAME_EX_D2I 0 +#define ASN1_F_X509_NAME_EX_NEW 0 +#define ASN1_F_X509_PKEY_NEW 0 + +/* + * ASYNC function codes. + */ +#define ASYNC_F_ASYNC_CTX_NEW 0 +#define ASYNC_F_ASYNC_INIT_THREAD 0 +#define ASYNC_F_ASYNC_JOB_NEW 0 +#define ASYNC_F_ASYNC_PAUSE_JOB 0 +#define ASYNC_F_ASYNC_START_FUNC 0 +#define ASYNC_F_ASYNC_START_JOB 0 +#define ASYNC_F_ASYNC_WAIT_CTX_SET_WAIT_FD 0 + +/* + * BIO function codes. + */ +#define BIO_F_ACPT_STATE 0 +#define BIO_F_ADDRINFO_WRAP 0 +#define BIO_F_ADDR_STRINGS 0 +#define BIO_F_BIO_ACCEPT 0 +#define BIO_F_BIO_ACCEPT_EX 0 +#define BIO_F_BIO_ACCEPT_NEW 0 +#define BIO_F_BIO_ADDR_NEW 0 +#define BIO_F_BIO_BIND 0 +#define BIO_F_BIO_CALLBACK_CTRL 0 +#define BIO_F_BIO_CONNECT 0 +#define BIO_F_BIO_CONNECT_NEW 0 +#define BIO_F_BIO_CTRL 0 +#define BIO_F_BIO_GETS 0 +#define BIO_F_BIO_GET_HOST_IP 0 +#define BIO_F_BIO_GET_NEW_INDEX 0 +#define BIO_F_BIO_GET_PORT 0 +#define BIO_F_BIO_LISTEN 0 +#define BIO_F_BIO_LOOKUP 0 +#define BIO_F_BIO_LOOKUP_EX 0 +#define BIO_F_BIO_MAKE_PAIR 0 +#define BIO_F_BIO_METH_NEW 0 +#define BIO_F_BIO_NEW 0 +#define BIO_F_BIO_NEW_DGRAM_SCTP 0 +#define BIO_F_BIO_NEW_FILE 0 +#define BIO_F_BIO_NEW_MEM_BUF 0 +#define BIO_F_BIO_NREAD 0 +#define BIO_F_BIO_NREAD0 0 +#define BIO_F_BIO_NWRITE 0 +#define BIO_F_BIO_NWRITE0 0 +#define BIO_F_BIO_PARSE_HOSTSERV 0 +#define BIO_F_BIO_PUTS 0 +#define BIO_F_BIO_READ 0 +#define BIO_F_BIO_READ_EX 0 +#define BIO_F_BIO_READ_INTERN 0 +#define BIO_F_BIO_SOCKET 0 +#define BIO_F_BIO_SOCKET_NBIO 0 +#define BIO_F_BIO_SOCK_INFO 0 +#define BIO_F_BIO_SOCK_INIT 0 +#define BIO_F_BIO_WRITE 0 +#define BIO_F_BIO_WRITE_EX 0 +#define BIO_F_BIO_WRITE_INTERN 0 +#define BIO_F_BUFFER_CTRL 0 +#define BIO_F_CONN_CTRL 0 +#define BIO_F_CONN_STATE 0 +#define BIO_F_DGRAM_SCTP_NEW 0 +#define BIO_F_DGRAM_SCTP_READ 0 +#define BIO_F_DGRAM_SCTP_WRITE 0 +#define BIO_F_DOAPR_OUTCH 0 +#define BIO_F_FILE_CTRL 0 +#define BIO_F_FILE_READ 0 +#define BIO_F_LINEBUFFER_CTRL 0 +#define BIO_F_LINEBUFFER_NEW 0 +#define BIO_F_MEM_WRITE 0 +#define BIO_F_NBIOF_NEW 0 +#define BIO_F_SLG_WRITE 0 +#define BIO_F_SSL_NEW 0 + +/* + * BN function codes. + */ +#define BN_F_BNRAND 0 +#define BN_F_BNRAND_RANGE 0 +#define BN_F_BN_BLINDING_CONVERT_EX 0 +#define BN_F_BN_BLINDING_CREATE_PARAM 0 +#define BN_F_BN_BLINDING_INVERT_EX 0 +#define BN_F_BN_BLINDING_NEW 0 +#define BN_F_BN_BLINDING_UPDATE 0 +#define BN_F_BN_BN2DEC 0 +#define BN_F_BN_BN2HEX 0 +#define BN_F_BN_COMPUTE_WNAF 0 +#define BN_F_BN_CTX_GET 0 +#define BN_F_BN_CTX_NEW 0 +#define BN_F_BN_CTX_START 0 +#define BN_F_BN_DIV 0 +#define BN_F_BN_DIV_RECP 0 +#define BN_F_BN_EXP 0 +#define BN_F_BN_EXPAND_INTERNAL 0 +#define BN_F_BN_GENCB_NEW 0 +#define BN_F_BN_GENERATE_DSA_NONCE 0 +#define BN_F_BN_GENERATE_PRIME_EX 0 +#define BN_F_BN_GF2M_MOD 0 +#define BN_F_BN_GF2M_MOD_EXP 0 +#define BN_F_BN_GF2M_MOD_MUL 0 +#define BN_F_BN_GF2M_MOD_SOLVE_QUAD 0 +#define BN_F_BN_GF2M_MOD_SOLVE_QUAD_ARR 0 +#define BN_F_BN_GF2M_MOD_SQR 0 +#define BN_F_BN_GF2M_MOD_SQRT 0 +#define BN_F_BN_LSHIFT 0 +#define BN_F_BN_MOD_EXP2_MONT 0 +#define BN_F_BN_MOD_EXP_MONT 0 +#define BN_F_BN_MOD_EXP_MONT_CONSTTIME 0 +#define BN_F_BN_MOD_EXP_MONT_WORD 0 +#define BN_F_BN_MOD_EXP_RECP 0 +#define BN_F_BN_MOD_EXP_SIMPLE 0 +#define BN_F_BN_MOD_INVERSE 0 +#define BN_F_BN_MOD_INVERSE_NO_BRANCH 0 +#define BN_F_BN_MOD_LSHIFT_QUICK 0 +#define BN_F_BN_MOD_SQRT 0 +#define BN_F_BN_MONT_CTX_NEW 0 +#define BN_F_BN_MPI2BN 0 +#define BN_F_BN_NEW 0 +#define BN_F_BN_POOL_GET 0 +#define BN_F_BN_RAND 0 +#define BN_F_BN_RAND_RANGE 0 +#define BN_F_BN_RECP_CTX_NEW 0 +#define BN_F_BN_RSHIFT 0 +#define BN_F_BN_SET_WORDS 0 +#define BN_F_BN_STACK_PUSH 0 +#define BN_F_BN_USUB 0 + +/* + * BUF function codes. + */ +#define BUF_F_BUF_MEM_GROW 0 +#define BUF_F_BUF_MEM_GROW_CLEAN 0 +#define BUF_F_BUF_MEM_NEW 0 + +#ifndef OPENSSL_NO_CMS +/* + * CMS function codes. + */ +#define CMS_F_CHECK_CONTENT 0 +#define CMS_F_CMS_ADD0_CERT 0 +#define CMS_F_CMS_ADD0_RECIPIENT_KEY 0 +#define CMS_F_CMS_ADD0_RECIPIENT_PASSWORD 0 +#define CMS_F_CMS_ADD1_RECEIPTREQUEST 0 +#define CMS_F_CMS_ADD1_RECIPIENT_CERT 0 +#define CMS_F_CMS_ADD1_SIGNER 0 +#define CMS_F_CMS_ADD1_SIGNINGTIME 0 +#define CMS_F_CMS_COMPRESS 0 +#define CMS_F_CMS_COMPRESSEDDATA_CREATE 0 +#define CMS_F_CMS_COMPRESSEDDATA_INIT_BIO 0 +#define CMS_F_CMS_COPY_CONTENT 0 +#define CMS_F_CMS_COPY_MESSAGEDIGEST 0 +#define CMS_F_CMS_DATA 0 +#define CMS_F_CMS_DATAFINAL 0 +#define CMS_F_CMS_DATAINIT 0 +#define CMS_F_CMS_DECRYPT 0 +#define CMS_F_CMS_DECRYPT_SET1_KEY 0 +#define CMS_F_CMS_DECRYPT_SET1_PASSWORD 0 +#define CMS_F_CMS_DECRYPT_SET1_PKEY 0 +#define CMS_F_CMS_DIGESTALGORITHM_FIND_CTX 0 +#define CMS_F_CMS_DIGESTALGORITHM_INIT_BIO 0 +#define CMS_F_CMS_DIGESTEDDATA_DO_FINAL 0 +#define CMS_F_CMS_DIGEST_VERIFY 0 +#define CMS_F_CMS_ENCODE_RECEIPT 0 +#define CMS_F_CMS_ENCRYPT 0 +#define CMS_F_CMS_ENCRYPTEDCONTENT_INIT 0 +#define CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO 0 +#define CMS_F_CMS_ENCRYPTEDDATA_DECRYPT 0 +#define CMS_F_CMS_ENCRYPTEDDATA_ENCRYPT 0 +#define CMS_F_CMS_ENCRYPTEDDATA_SET1_KEY 0 +#define CMS_F_CMS_ENVELOPEDDATA_CREATE 0 +#define CMS_F_CMS_ENVELOPEDDATA_INIT_BIO 0 +#define CMS_F_CMS_ENVELOPED_DATA_INIT 0 +#define CMS_F_CMS_ENV_ASN1_CTRL 0 +#define CMS_F_CMS_FINAL 0 +#define CMS_F_CMS_GET0_CERTIFICATE_CHOICES 0 +#define CMS_F_CMS_GET0_CONTENT 0 +#define CMS_F_CMS_GET0_ECONTENT_TYPE 0 +#define CMS_F_CMS_GET0_ENVELOPED 0 +#define CMS_F_CMS_GET0_REVOCATION_CHOICES 0 +#define CMS_F_CMS_GET0_SIGNED 0 +#define CMS_F_CMS_MSGSIGDIGEST_ADD1 0 +#define CMS_F_CMS_RECEIPTREQUEST_CREATE0 0 +#define CMS_F_CMS_RECEIPT_VERIFY 0 +#define CMS_F_CMS_RECIPIENTINFO_DECRYPT 0 +#define CMS_F_CMS_RECIPIENTINFO_ENCRYPT 0 +#define CMS_F_CMS_RECIPIENTINFO_KARI_ENCRYPT 0 +#define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ALG 0 +#define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ORIG_ID 0 +#define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_REKS 0 +#define CMS_F_CMS_RECIPIENTINFO_KARI_ORIG_ID_CMP 0 +#define CMS_F_CMS_RECIPIENTINFO_KEKRI_DECRYPT 0 +#define CMS_F_CMS_RECIPIENTINFO_KEKRI_ENCRYPT 0 +#define CMS_F_CMS_RECIPIENTINFO_KEKRI_GET0_ID 0 +#define CMS_F_CMS_RECIPIENTINFO_KEKRI_ID_CMP 0 +#define CMS_F_CMS_RECIPIENTINFO_KTRI_CERT_CMP 0 +#define CMS_F_CMS_RECIPIENTINFO_KTRI_DECRYPT 0 +#define CMS_F_CMS_RECIPIENTINFO_KTRI_ENCRYPT 0 +#define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_ALGS 0 +#define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_SIGNER_ID 0 +#define CMS_F_CMS_RECIPIENTINFO_PWRI_CRYPT 0 +#define CMS_F_CMS_RECIPIENTINFO_SET0_KEY 0 +#define CMS_F_CMS_RECIPIENTINFO_SET0_PASSWORD 0 +#define CMS_F_CMS_RECIPIENTINFO_SET0_PKEY 0 +#define CMS_F_CMS_SD_ASN1_CTRL 0 +#define CMS_F_CMS_SET1_IAS 0 +#define CMS_F_CMS_SET1_KEYID 0 +#define CMS_F_CMS_SET1_SIGNERIDENTIFIER 0 +#define CMS_F_CMS_SET_DETACHED 0 +#define CMS_F_CMS_SIGN 0 +#define CMS_F_CMS_SIGNED_DATA_INIT 0 +#define CMS_F_CMS_SIGNERINFO_CONTENT_SIGN 0 +#define CMS_F_CMS_SIGNERINFO_SIGN 0 +#define CMS_F_CMS_SIGNERINFO_VERIFY 0 +#define CMS_F_CMS_SIGNERINFO_VERIFY_CERT 0 +#define CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT 0 +#define CMS_F_CMS_SIGN_RECEIPT 0 +#define CMS_F_CMS_SI_CHECK_ATTRIBUTES 0 +#define CMS_F_CMS_STREAM 0 +#define CMS_F_CMS_UNCOMPRESS 0 +#define CMS_F_CMS_VERIFY 0 +#define CMS_F_KEK_UNWRAP_KEY 0 +#endif + +#ifndef OPENSSL_NO_COMP +/* + * COMP function codes. + */ +#define COMP_F_BIO_ZLIB_FLUSH 0 +#define COMP_F_BIO_ZLIB_NEW 0 +#define COMP_F_BIO_ZLIB_READ 0 +#define COMP_F_BIO_ZLIB_WRITE 0 +#define COMP_F_COMP_CTX_NEW 0 +#endif + +/* + * CONF function codes. + */ +#define CONF_F_CONF_DUMP_FP 0 +#define CONF_F_CONF_LOAD 0 +#define CONF_F_CONF_LOAD_FP 0 +#define CONF_F_CONF_PARSE_LIST 0 +#define CONF_F_DEF_LOAD 0 +#define CONF_F_DEF_LOAD_BIO 0 +#define CONF_F_GET_NEXT_FILE 0 +#define CONF_F_MODULE_ADD 0 +#define CONF_F_MODULE_INIT 0 +#define CONF_F_MODULE_LOAD_DSO 0 +#define CONF_F_MODULE_RUN 0 +#define CONF_F_NCONF_DUMP_BIO 0 +#define CONF_F_NCONF_DUMP_FP 0 +#define CONF_F_NCONF_GET_NUMBER_E 0 +#define CONF_F_NCONF_GET_SECTION 0 +#define CONF_F_NCONF_GET_STRING 0 +#define CONF_F_NCONF_LOAD 0 +#define CONF_F_NCONF_LOAD_BIO 0 +#define CONF_F_NCONF_LOAD_FP 0 +#define CONF_F_NCONF_NEW 0 +#define CONF_F_PROCESS_INCLUDE 0 +#define CONF_F_SSL_MODULE_INIT 0 +#define CONF_F_STR_COPY 0 + +/* + * CRYPTO function codes. + */ +#define CRYPTO_F_CMAC_CTX_NEW 0 +#define CRYPTO_F_CRYPTO_DUP_EX_DATA 0 +#define CRYPTO_F_CRYPTO_FREE_EX_DATA 0 +#define CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX 0 +#define CRYPTO_F_CRYPTO_MEMDUP 0 +#define CRYPTO_F_CRYPTO_NEW_EX_DATA 0 +#define CRYPTO_F_CRYPTO_OCB128_COPY_CTX 0 +#define CRYPTO_F_CRYPTO_OCB128_INIT 0 +#define CRYPTO_F_CRYPTO_SET_EX_DATA 0 +#define CRYPTO_F_GET_AND_LOCK 0 +#define CRYPTO_F_OPENSSL_ATEXIT 0 +#define CRYPTO_F_OPENSSL_BUF2HEXSTR 0 +#define CRYPTO_F_OPENSSL_FOPEN 0 +#define CRYPTO_F_OPENSSL_HEXSTR2BUF 0 +#define CRYPTO_F_OPENSSL_INIT_CRYPTO 0 +#define CRYPTO_F_OPENSSL_LH_NEW 0 +#define CRYPTO_F_OPENSSL_SK_DEEP_COPY 0 +#define CRYPTO_F_OPENSSL_SK_DUP 0 +#define CRYPTO_F_PKEY_HMAC_INIT 0 +#define CRYPTO_F_PKEY_POLY1305_INIT 0 +#define CRYPTO_F_PKEY_SIPHASH_INIT 0 +#define CRYPTO_F_SK_RESERVE 0 + +#ifndef OPENSSL_NO_CT +/* + * CT function codes. + */ +#define CT_F_CTLOG_NEW 0 +#define CT_F_CTLOG_NEW_FROM_BASE64 0 +#define CT_F_CTLOG_NEW_FROM_CONF 0 +#define CT_F_CTLOG_STORE_LOAD_CTX_NEW 0 +#define CT_F_CTLOG_STORE_LOAD_FILE 0 +#define CT_F_CTLOG_STORE_LOAD_LOG 0 +#define CT_F_CTLOG_STORE_NEW 0 +#define CT_F_CT_BASE64_DECODE 0 +#define CT_F_CT_POLICY_EVAL_CTX_NEW 0 +#define CT_F_CT_V1_LOG_ID_FROM_PKEY 0 +#define CT_F_I2O_SCT 0 +#define CT_F_I2O_SCT_LIST 0 +#define CT_F_I2O_SCT_SIGNATURE 0 +#define CT_F_O2I_SCT 0 +#define CT_F_O2I_SCT_LIST 0 +#define CT_F_O2I_SCT_SIGNATURE 0 +#define CT_F_SCT_CTX_NEW 0 +#define CT_F_SCT_CTX_VERIFY 0 +#define CT_F_SCT_NEW 0 +#define CT_F_SCT_NEW_FROM_BASE64 0 +#define CT_F_SCT_SET0_LOG_ID 0 +#define CT_F_SCT_SET1_EXTENSIONS 0 +#define CT_F_SCT_SET1_LOG_ID 0 +#define CT_F_SCT_SET1_SIGNATURE 0 +#define CT_F_SCT_SET_LOG_ENTRY_TYPE 0 +#define CT_F_SCT_SET_SIGNATURE_NID 0 +#define CT_F_SCT_SET_VERSION 0 +#endif + +#ifndef OPENSSL_NO_DH +/* + * DH function codes. + */ +#define DH_F_COMPUTE_KEY 0 +#define DH_F_DHPARAMS_PRINT_FP 0 +#define DH_F_DH_BUILTIN_GENPARAMS 0 +#define DH_F_DH_CHECK_EX 0 +#define DH_F_DH_CHECK_PARAMS_EX 0 +#define DH_F_DH_CHECK_PUB_KEY_EX 0 +#define DH_F_DH_CMS_DECRYPT 0 +#define DH_F_DH_CMS_SET_PEERKEY 0 +#define DH_F_DH_CMS_SET_SHARED_INFO 0 +#define DH_F_DH_METH_DUP 0 +#define DH_F_DH_METH_NEW 0 +#define DH_F_DH_METH_SET1_NAME 0 +#define DH_F_DH_NEW_BY_NID 0 +#define DH_F_DH_NEW_METHOD 0 +#define DH_F_DH_PARAM_DECODE 0 +#define DH_F_DH_PKEY_PUBLIC_CHECK 0 +#define DH_F_DH_PRIV_DECODE 0 +#define DH_F_DH_PRIV_ENCODE 0 +#define DH_F_DH_PUB_DECODE 0 +#define DH_F_DH_PUB_ENCODE 0 +#define DH_F_DO_DH_PRINT 0 +#define DH_F_GENERATE_KEY 0 +#define DH_F_PKEY_DH_CTRL_STR 0 +#define DH_F_PKEY_DH_DERIVE 0 +#define DH_F_PKEY_DH_INIT 0 +#define DH_F_PKEY_DH_KEYGEN 0 +#endif + +#ifndef OPENSSL_NO_DSA +/* + * DSA function codes. + */ +#define DSA_F_DSAPARAMS_PRINT 0 +#define DSA_F_DSAPARAMS_PRINT_FP 0 +#define DSA_F_DSA_BUILTIN_PARAMGEN 0 +#define DSA_F_DSA_BUILTIN_PARAMGEN2 0 +#define DSA_F_DSA_DO_SIGN 0 +#define DSA_F_DSA_DO_VERIFY 0 +#define DSA_F_DSA_METH_DUP 0 +#define DSA_F_DSA_METH_NEW 0 +#define DSA_F_DSA_METH_SET1_NAME 0 +#define DSA_F_DSA_NEW_METHOD 0 +#define DSA_F_DSA_PARAM_DECODE 0 +#define DSA_F_DSA_PRINT_FP 0 +#define DSA_F_DSA_PRIV_DECODE 0 +#define DSA_F_DSA_PRIV_ENCODE 0 +#define DSA_F_DSA_PUB_DECODE 0 +#define DSA_F_DSA_PUB_ENCODE 0 +#define DSA_F_DSA_SIGN 0 +#define DSA_F_DSA_SIGN_SETUP 0 +#define DSA_F_DSA_SIG_NEW 0 +#define DSA_F_OLD_DSA_PRIV_DECODE 0 +#define DSA_F_PKEY_DSA_CTRL 0 +#define DSA_F_PKEY_DSA_CTRL_STR 0 +#define DSA_F_PKEY_DSA_KEYGEN 0 +#endif + +#ifndef OPENSSL_NO_EC +/* + * EC function codes. + */ +#define EC_F_BN_TO_FELEM 0 +#define EC_F_D2I_ECPARAMETERS 0 +#define EC_F_D2I_ECPKPARAMETERS 0 +#define EC_F_D2I_ECPRIVATEKEY 0 +#define EC_F_DO_EC_KEY_PRINT 0 +#define EC_F_ECDH_CMS_DECRYPT 0 +#define EC_F_ECDH_CMS_SET_SHARED_INFO 0 +#define EC_F_ECDH_COMPUTE_KEY 0 +#define EC_F_ECDH_SIMPLE_COMPUTE_KEY 0 +#define EC_F_ECDSA_DO_SIGN_EX 0 +#define EC_F_ECDSA_DO_VERIFY 0 +#define EC_F_ECDSA_SIGN_EX 0 +#define EC_F_ECDSA_SIGN_SETUP 0 +#define EC_F_ECDSA_SIG_NEW 0 +#define EC_F_ECDSA_VERIFY 0 +#define EC_F_ECD_ITEM_VERIFY 0 +#define EC_F_ECKEY_PARAM2TYPE 0 +#define EC_F_ECKEY_PARAM_DECODE 0 +#define EC_F_ECKEY_PRIV_DECODE 0 +#define EC_F_ECKEY_PRIV_ENCODE 0 +#define EC_F_ECKEY_PUB_DECODE 0 +#define EC_F_ECKEY_PUB_ENCODE 0 +#define EC_F_ECKEY_TYPE2PARAM 0 +#define EC_F_ECPARAMETERS_PRINT 0 +#define EC_F_ECPARAMETERS_PRINT_FP 0 +#define EC_F_ECPKPARAMETERS_PRINT 0 +#define EC_F_ECPKPARAMETERS_PRINT_FP 0 +#define EC_F_ECP_NISTZ256_GET_AFFINE 0 +#define EC_F_ECP_NISTZ256_INV_MOD_ORD 0 +#define EC_F_ECP_NISTZ256_MULT_PRECOMPUTE 0 +#define EC_F_ECP_NISTZ256_POINTS_MUL 0 +#define EC_F_ECP_NISTZ256_PRE_COMP_NEW 0 +#define EC_F_ECP_NISTZ256_WINDOWED_MUL 0 +#define EC_F_ECX_KEY_OP 0 +#define EC_F_ECX_PRIV_ENCODE 0 +#define EC_F_ECX_PUB_ENCODE 0 +#define EC_F_EC_ASN1_GROUP2CURVE 0 +#define EC_F_EC_ASN1_GROUP2FIELDID 0 +#define EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY 0 +#define EC_F_EC_GF2M_SIMPLE_FIELD_INV 0 +#define EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT 0 +#define EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE 0 +#define EC_F_EC_GF2M_SIMPLE_LADDER_POST 0 +#define EC_F_EC_GF2M_SIMPLE_LADDER_PRE 0 +#define EC_F_EC_GF2M_SIMPLE_OCT2POINT 0 +#define EC_F_EC_GF2M_SIMPLE_POINT2OCT 0 +#define EC_F_EC_GF2M_SIMPLE_POINTS_MUL 0 +#define EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES 0 +#define EC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATES 0 +#define EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES 0 +#define EC_F_EC_GFP_MONT_FIELD_DECODE 0 +#define EC_F_EC_GFP_MONT_FIELD_ENCODE 0 +#define EC_F_EC_GFP_MONT_FIELD_INV 0 +#define EC_F_EC_GFP_MONT_FIELD_MUL 0 +#define EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE 0 +#define EC_F_EC_GFP_MONT_FIELD_SQR 0 +#define EC_F_EC_GFP_MONT_GROUP_SET_CURVE 0 +#define EC_F_EC_GFP_NISTP224_GROUP_SET_CURVE 0 +#define EC_F_EC_GFP_NISTP224_POINTS_MUL 0 +#define EC_F_EC_GFP_NISTP224_POINT_GET_AFFINE_COORDINATES 0 +#define EC_F_EC_GFP_NISTP256_GROUP_SET_CURVE 0 +#define EC_F_EC_GFP_NISTP256_POINTS_MUL 0 +#define EC_F_EC_GFP_NISTP256_POINT_GET_AFFINE_COORDINATES 0 +#define EC_F_EC_GFP_NISTP521_GROUP_SET_CURVE 0 +#define EC_F_EC_GFP_NISTP521_POINTS_MUL 0 +#define EC_F_EC_GFP_NISTP521_POINT_GET_AFFINE_COORDINATES 0 +#define EC_F_EC_GFP_NIST_FIELD_MUL 0 +#define EC_F_EC_GFP_NIST_FIELD_SQR 0 +#define EC_F_EC_GFP_NIST_GROUP_SET_CURVE 0 +#define EC_F_EC_GFP_SIMPLE_BLIND_COORDINATES 0 +#define EC_F_EC_GFP_SIMPLE_FIELD_INV 0 +#define EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT 0 +#define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE 0 +#define EC_F_EC_GFP_SIMPLE_MAKE_AFFINE 0 +#define EC_F_EC_GFP_SIMPLE_OCT2POINT 0 +#define EC_F_EC_GFP_SIMPLE_POINT2OCT 0 +#define EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE 0 +#define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES 0 +#define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES 0 +#define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES 0 +#define EC_F_EC_GROUP_CHECK 0 +#define EC_F_EC_GROUP_CHECK_DISCRIMINANT 0 +#define EC_F_EC_GROUP_COPY 0 +#define EC_F_EC_GROUP_GET_CURVE 0 +#define EC_F_EC_GROUP_GET_CURVE_GF2M 0 +#define EC_F_EC_GROUP_GET_CURVE_GFP 0 +#define EC_F_EC_GROUP_GET_DEGREE 0 +#define EC_F_EC_GROUP_GET_ECPARAMETERS 0 +#define EC_F_EC_GROUP_GET_ECPKPARAMETERS 0 +#define EC_F_EC_GROUP_GET_PENTANOMIAL_BASIS 0 +#define EC_F_EC_GROUP_GET_TRINOMIAL_BASIS 0 +#define EC_F_EC_GROUP_NEW 0 +#define EC_F_EC_GROUP_NEW_BY_CURVE_NAME 0 +#define EC_F_EC_GROUP_NEW_FROM_DATA 0 +#define EC_F_EC_GROUP_NEW_FROM_ECPARAMETERS 0 +#define EC_F_EC_GROUP_NEW_FROM_ECPKPARAMETERS 0 +#define EC_F_EC_GROUP_SET_CURVE 0 +#define EC_F_EC_GROUP_SET_CURVE_GF2M 0 +#define EC_F_EC_GROUP_SET_CURVE_GFP 0 +#define EC_F_EC_GROUP_SET_GENERATOR 0 +#define EC_F_EC_GROUP_SET_SEED 0 +#define EC_F_EC_KEY_CHECK_KEY 0 +#define EC_F_EC_KEY_COPY 0 +#define EC_F_EC_KEY_GENERATE_KEY 0 +#define EC_F_EC_KEY_NEW 0 +#define EC_F_EC_KEY_NEW_METHOD 0 +#define EC_F_EC_KEY_OCT2PRIV 0 +#define EC_F_EC_KEY_PRINT 0 +#define EC_F_EC_KEY_PRINT_FP 0 +#define EC_F_EC_KEY_PRIV2BUF 0 +#define EC_F_EC_KEY_PRIV2OCT 0 +#define EC_F_EC_KEY_SET_PUBLIC_KEY_AFFINE_COORDINATES 0 +#define EC_F_EC_KEY_SIMPLE_CHECK_KEY 0 +#define EC_F_EC_KEY_SIMPLE_OCT2PRIV 0 +#define EC_F_EC_KEY_SIMPLE_PRIV2OCT 0 +#define EC_F_EC_PKEY_CHECK 0 +#define EC_F_EC_PKEY_PARAM_CHECK 0 +#define EC_F_EC_POINTS_MAKE_AFFINE 0 +#define EC_F_EC_POINTS_MUL 0 +#define EC_F_EC_POINT_ADD 0 +#define EC_F_EC_POINT_BN2POINT 0 +#define EC_F_EC_POINT_CMP 0 +#define EC_F_EC_POINT_COPY 0 +#define EC_F_EC_POINT_DBL 0 +#define EC_F_EC_POINT_GET_AFFINE_COORDINATES 0 +#define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M 0 +#define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP 0 +#define EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP 0 +#define EC_F_EC_POINT_INVERT 0 +#define EC_F_EC_POINT_IS_AT_INFINITY 0 +#define EC_F_EC_POINT_IS_ON_CURVE 0 +#define EC_F_EC_POINT_MAKE_AFFINE 0 +#define EC_F_EC_POINT_NEW 0 +#define EC_F_EC_POINT_OCT2POINT 0 +#define EC_F_EC_POINT_POINT2BUF 0 +#define EC_F_EC_POINT_POINT2OCT 0 +#define EC_F_EC_POINT_SET_AFFINE_COORDINATES 0 +#define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2M 0 +#define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GFP 0 +#define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES 0 +#define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M 0 +#define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP 0 +#define EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP 0 +#define EC_F_EC_POINT_SET_TO_INFINITY 0 +#define EC_F_EC_PRE_COMP_NEW 0 +#define EC_F_EC_SCALAR_MUL_LADDER 0 +#define EC_F_EC_WNAF_MUL 0 +#define EC_F_EC_WNAF_PRECOMPUTE_MULT 0 +#define EC_F_I2D_ECPARAMETERS 0 +#define EC_F_I2D_ECPKPARAMETERS 0 +#define EC_F_I2D_ECPRIVATEKEY 0 +#define EC_F_I2O_ECPUBLICKEY 0 +#define EC_F_NISTP224_PRE_COMP_NEW 0 +#define EC_F_NISTP256_PRE_COMP_NEW 0 +#define EC_F_NISTP521_PRE_COMP_NEW 0 +#define EC_F_O2I_ECPUBLICKEY 0 +#define EC_F_OLD_EC_PRIV_DECODE 0 +#define EC_F_OSSL_ECDH_COMPUTE_KEY 0 +#define EC_F_OSSL_ECDSA_SIGN_SIG 0 +#define EC_F_OSSL_ECDSA_VERIFY_SIG 0 +#define EC_F_PKEY_ECD_CTRL 0 +#define EC_F_PKEY_ECD_DIGESTSIGN 0 +#define EC_F_PKEY_ECD_DIGESTSIGN25519 0 +#define EC_F_PKEY_ECD_DIGESTSIGN448 0 +#define EC_F_PKEY_ECX_DERIVE 0 +#define EC_F_PKEY_EC_CTRL 0 +#define EC_F_PKEY_EC_CTRL_STR 0 +#define EC_F_PKEY_EC_DERIVE 0 +#define EC_F_PKEY_EC_INIT 0 +#define EC_F_PKEY_EC_KDF_DERIVE 0 +#define EC_F_PKEY_EC_KEYGEN 0 +#define EC_F_PKEY_EC_PARAMGEN 0 +#define EC_F_PKEY_EC_SIGN 0 +#define EC_F_VALIDATE_ECX_DERIVE 0 +#endif + +#ifndef OPENSSL_NO_ENGINE +/* + * ENGINE function codes. + */ +#define ENGINE_F_DIGEST_UPDATE 0 +#define ENGINE_F_DYNAMIC_CTRL 0 +#define ENGINE_F_DYNAMIC_GET_DATA_CTX 0 +#define ENGINE_F_DYNAMIC_LOAD 0 +#define ENGINE_F_DYNAMIC_SET_DATA_CTX 0 +#define ENGINE_F_ENGINE_ADD 0 +#define ENGINE_F_ENGINE_BY_ID 0 +#define ENGINE_F_ENGINE_CMD_IS_EXECUTABLE 0 +#define ENGINE_F_ENGINE_CTRL 0 +#define ENGINE_F_ENGINE_CTRL_CMD 0 +#define ENGINE_F_ENGINE_CTRL_CMD_STRING 0 +#define ENGINE_F_ENGINE_FINISH 0 +#define ENGINE_F_ENGINE_GET_CIPHER 0 +#define ENGINE_F_ENGINE_GET_DIGEST 0 +#define ENGINE_F_ENGINE_GET_FIRST 0 +#define ENGINE_F_ENGINE_GET_LAST 0 +#define ENGINE_F_ENGINE_GET_NEXT 0 +#define ENGINE_F_ENGINE_GET_PKEY_ASN1_METH 0 +#define ENGINE_F_ENGINE_GET_PKEY_METH 0 +#define ENGINE_F_ENGINE_GET_PREV 0 +#define ENGINE_F_ENGINE_INIT 0 +#define ENGINE_F_ENGINE_LIST_ADD 0 +#define ENGINE_F_ENGINE_LIST_REMOVE 0 +#define ENGINE_F_ENGINE_LOAD_PRIVATE_KEY 0 +#define ENGINE_F_ENGINE_LOAD_PUBLIC_KEY 0 +#define ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT 0 +#define ENGINE_F_ENGINE_NEW 0 +#define ENGINE_F_ENGINE_PKEY_ASN1_FIND_STR 0 +#define ENGINE_F_ENGINE_REMOVE 0 +#define ENGINE_F_ENGINE_SET_DEFAULT_STRING 0 +#define ENGINE_F_ENGINE_SET_ID 0 +#define ENGINE_F_ENGINE_SET_NAME 0 +#define ENGINE_F_ENGINE_TABLE_REGISTER 0 +#define ENGINE_F_ENGINE_UNLOCKED_FINISH 0 +#define ENGINE_F_ENGINE_UP_REF 0 +#define ENGINE_F_INT_CLEANUP_ITEM 0 +#define ENGINE_F_INT_CTRL_HELPER 0 +#define ENGINE_F_INT_ENGINE_CONFIGURE 0 +#define ENGINE_F_INT_ENGINE_MODULE_INIT 0 +#define ENGINE_F_OSSL_HMAC_INIT 0 +#endif + +/* + * EVP function codes. + */ +#define EVP_F_AESNI_INIT_KEY 0 +#define EVP_F_AESNI_XTS_INIT_KEY 0 +#define EVP_F_AES_GCM_CTRL 0 +#define EVP_F_AES_INIT_KEY 0 +#define EVP_F_AES_OCB_CIPHER 0 +#define EVP_F_AES_T4_INIT_KEY 0 +#define EVP_F_AES_T4_XTS_INIT_KEY 0 +#define EVP_F_AES_WRAP_CIPHER 0 +#define EVP_F_AES_XTS_INIT_KEY 0 +#define EVP_F_ALG_MODULE_INIT 0 +#define EVP_F_ARIA_CCM_INIT_KEY 0 +#define EVP_F_ARIA_GCM_CTRL 0 +#define EVP_F_ARIA_GCM_INIT_KEY 0 +#define EVP_F_ARIA_INIT_KEY 0 +#define EVP_F_B64_NEW 0 +#define EVP_F_CAMELLIA_INIT_KEY 0 +#define EVP_F_CHACHA20_POLY1305_CTRL 0 +#define EVP_F_CMLL_T4_INIT_KEY 0 +#define EVP_F_DES_EDE3_WRAP_CIPHER 0 +#define EVP_F_DO_SIGVER_INIT 0 +#define EVP_F_ENC_NEW 0 +#define EVP_F_EVP_CIPHERINIT_EX 0 +#define EVP_F_EVP_CIPHER_ASN1_TO_PARAM 0 +#define EVP_F_EVP_CIPHER_CTX_COPY 0 +#define EVP_F_EVP_CIPHER_CTX_CTRL 0 +#define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH 0 +#define EVP_F_EVP_CIPHER_PARAM_TO_ASN1 0 +#define EVP_F_EVP_DECRYPTFINAL_EX 0 +#define EVP_F_EVP_DECRYPTUPDATE 0 +#define EVP_F_EVP_DIGESTFINALXOF 0 +#define EVP_F_EVP_DIGESTINIT_EX 0 +#define EVP_F_EVP_ENCRYPTDECRYPTUPDATE 0 +#define EVP_F_EVP_ENCRYPTFINAL_EX 0 +#define EVP_F_EVP_ENCRYPTUPDATE 0 +#define EVP_F_EVP_MD_CTX_COPY_EX 0 +#define EVP_F_EVP_MD_SIZE 0 +#define EVP_F_EVP_OPENINIT 0 +#define EVP_F_EVP_PBE_ALG_ADD 0 +#define EVP_F_EVP_PBE_ALG_ADD_TYPE 0 +#define EVP_F_EVP_PBE_CIPHERINIT 0 +#define EVP_F_EVP_PBE_SCRYPT 0 +#define EVP_F_EVP_PKCS82PKEY 0 +#define EVP_F_EVP_PKEY2PKCS8 0 +#define EVP_F_EVP_PKEY_ASN1_ADD0 0 +#define EVP_F_EVP_PKEY_CHECK 0 +#define EVP_F_EVP_PKEY_COPY_PARAMETERS 0 +#define EVP_F_EVP_PKEY_CTX_CTRL 0 +#define EVP_F_EVP_PKEY_CTX_CTRL_STR 0 +#define EVP_F_EVP_PKEY_CTX_DUP 0 +#define EVP_F_EVP_PKEY_CTX_MD 0 +#define EVP_F_EVP_PKEY_DECRYPT 0 +#define EVP_F_EVP_PKEY_DECRYPT_INIT 0 +#define EVP_F_EVP_PKEY_DECRYPT_OLD 0 +#define EVP_F_EVP_PKEY_DERIVE 0 +#define EVP_F_EVP_PKEY_DERIVE_INIT 0 +#define EVP_F_EVP_PKEY_DERIVE_SET_PEER 0 +#define EVP_F_EVP_PKEY_ENCRYPT 0 +#define EVP_F_EVP_PKEY_ENCRYPT_INIT 0 +#define EVP_F_EVP_PKEY_ENCRYPT_OLD 0 +#define EVP_F_EVP_PKEY_GET0_DH 0 +#define EVP_F_EVP_PKEY_GET0_DSA 0 +#define EVP_F_EVP_PKEY_GET0_EC_KEY 0 +#define EVP_F_EVP_PKEY_GET0_HMAC 0 +#define EVP_F_EVP_PKEY_GET0_POLY1305 0 +#define EVP_F_EVP_PKEY_GET0_RSA 0 +#define EVP_F_EVP_PKEY_GET0_SIPHASH 0 +#define EVP_F_EVP_PKEY_GET_RAW_PRIVATE_KEY 0 +#define EVP_F_EVP_PKEY_GET_RAW_PUBLIC_KEY 0 +#define EVP_F_EVP_PKEY_KEYGEN 0 +#define EVP_F_EVP_PKEY_KEYGEN_INIT 0 +#define EVP_F_EVP_PKEY_METH_ADD0 0 +#define EVP_F_EVP_PKEY_METH_NEW 0 +#define EVP_F_EVP_PKEY_NEW 0 +#define EVP_F_EVP_PKEY_NEW_CMAC_KEY 0 +#define EVP_F_EVP_PKEY_NEW_RAW_PRIVATE_KEY 0 +#define EVP_F_EVP_PKEY_NEW_RAW_PUBLIC_KEY 0 +#define EVP_F_EVP_PKEY_PARAMGEN 0 +#define EVP_F_EVP_PKEY_PARAMGEN_INIT 0 +#define EVP_F_EVP_PKEY_PARAM_CHECK 0 +#define EVP_F_EVP_PKEY_PUBLIC_CHECK 0 +#define EVP_F_EVP_PKEY_SET1_ENGINE 0 +#define EVP_F_EVP_PKEY_SET_ALIAS_TYPE 0 +#define EVP_F_EVP_PKEY_SIGN 0 +#define EVP_F_EVP_PKEY_SIGN_INIT 0 +#define EVP_F_EVP_PKEY_VERIFY 0 +#define EVP_F_EVP_PKEY_VERIFY_INIT 0 +#define EVP_F_EVP_PKEY_VERIFY_RECOVER 0 +#define EVP_F_EVP_PKEY_VERIFY_RECOVER_INIT 0 +#define EVP_F_EVP_SIGNFINAL 0 +#define EVP_F_EVP_VERIFYFINAL 0 +#define EVP_F_INT_CTX_NEW 0 +#define EVP_F_OK_NEW 0 +#define EVP_F_PKCS5_PBE_KEYIVGEN 0 +#define EVP_F_PKCS5_V2_PBE_KEYIVGEN 0 +#define EVP_F_PKCS5_V2_PBKDF2_KEYIVGEN 0 +#define EVP_F_PKCS5_V2_SCRYPT_KEYIVGEN 0 +#define EVP_F_PKEY_SET_TYPE 0 +#define EVP_F_RC2_MAGIC_TO_METH 0 +#define EVP_F_RC5_CTRL 0 +#define EVP_F_R_32_12_16_INIT_KEY 0 +#define EVP_F_S390X_AES_GCM_CTRL 0 +#define EVP_F_UPDATE 0 + +/* + * KDF function codes. + */ +#define KDF_F_PKEY_HKDF_CTRL_STR 0 +#define KDF_F_PKEY_HKDF_DERIVE 0 +#define KDF_F_PKEY_HKDF_INIT 0 +#define KDF_F_PKEY_SCRYPT_CTRL_STR 0 +#define KDF_F_PKEY_SCRYPT_CTRL_UINT64 0 +#define KDF_F_PKEY_SCRYPT_DERIVE 0 +#define KDF_F_PKEY_SCRYPT_INIT 0 +#define KDF_F_PKEY_SCRYPT_SET_MEMBUF 0 +#define KDF_F_PKEY_TLS1_PRF_CTRL_STR 0 +#define KDF_F_PKEY_TLS1_PRF_DERIVE 0 +#define KDF_F_PKEY_TLS1_PRF_INIT 0 +#define KDF_F_TLS1_PRF_ALG 0 + +/* + * KDF reason codes. + */ +#define KDF_R_INVALID_DIGEST 0 +#define KDF_R_MISSING_ITERATION_COUNT 0 +#define KDF_R_MISSING_KEY 0 +#define KDF_R_MISSING_MESSAGE_DIGEST 0 +#define KDF_R_MISSING_PARAMETER 0 +#define KDF_R_MISSING_PASS 0 +#define KDF_R_MISSING_SALT 0 +#define KDF_R_MISSING_SECRET 0 +#define KDF_R_MISSING_SEED 0 +#define KDF_R_UNKNOWN_PARAMETER_TYPE 0 +#define KDF_R_VALUE_ERROR 0 +#define KDF_R_VALUE_MISSING 0 + +/* + * OBJ function codes. + */ +#define OBJ_F_OBJ_ADD_OBJECT 0 +#define OBJ_F_OBJ_ADD_SIGID 0 +#define OBJ_F_OBJ_CREATE 0 +#define OBJ_F_OBJ_DUP 0 +#define OBJ_F_OBJ_NAME_NEW_INDEX 0 +#define OBJ_F_OBJ_NID2LN 0 +#define OBJ_F_OBJ_NID2OBJ 0 +#define OBJ_F_OBJ_NID2SN 0 +#define OBJ_F_OBJ_TXT2OBJ 0 + +#ifndef OPENSSL_NO_OCSP +/* + * OCSP function codes. + */ +#define OCSP_F_D2I_OCSP_NONCE 0 +#define OCSP_F_OCSP_BASIC_ADD1_STATUS 0 +#define OCSP_F_OCSP_BASIC_SIGN 0 +#define OCSP_F_OCSP_BASIC_SIGN_CTX 0 +#define OCSP_F_OCSP_BASIC_VERIFY 0 +#define OCSP_F_OCSP_CERT_ID_NEW 0 +#define OCSP_F_OCSP_CHECK_DELEGATED 0 +#define OCSP_F_OCSP_CHECK_IDS 0 +#define OCSP_F_OCSP_CHECK_ISSUER 0 +#define OCSP_F_OCSP_CHECK_VALIDITY 0 +#define OCSP_F_OCSP_MATCH_ISSUERID 0 +#define OCSP_F_OCSP_PARSE_URL 0 +#define OCSP_F_OCSP_REQUEST_SIGN 0 +#define OCSP_F_OCSP_REQUEST_VERIFY 0 +#define OCSP_F_OCSP_RESPONSE_GET1_BASIC 0 +#define OCSP_F_PARSE_HTTP_LINE1 0 +#endif + +/* + * PEM function codes. + */ +#define PEM_F_B2I_DSS 0 +#define PEM_F_B2I_PVK_BIO 0 +#define PEM_F_B2I_RSA 0 +#define PEM_F_CHECK_BITLEN_DSA 0 +#define PEM_F_CHECK_BITLEN_RSA 0 +#define PEM_F_D2I_PKCS8PRIVATEKEY_BIO 0 +#define PEM_F_D2I_PKCS8PRIVATEKEY_FP 0 +#define PEM_F_DO_B2I 0 +#define PEM_F_DO_B2I_BIO 0 +#define PEM_F_DO_BLOB_HEADER 0 +#define PEM_F_DO_I2B 0 +#define PEM_F_DO_PK8PKEY 0 +#define PEM_F_DO_PK8PKEY_FP 0 +#define PEM_F_DO_PVK_BODY 0 +#define PEM_F_DO_PVK_HEADER 0 +#define PEM_F_GET_HEADER_AND_DATA 0 +#define PEM_F_GET_NAME 0 +#define PEM_F_I2B_PVK 0 +#define PEM_F_I2B_PVK_BIO 0 +#define PEM_F_LOAD_IV 0 +#define PEM_F_PEM_ASN1_READ 0 +#define PEM_F_PEM_ASN1_READ_BIO 0 +#define PEM_F_PEM_ASN1_WRITE 0 +#define PEM_F_PEM_ASN1_WRITE_BIO 0 +#define PEM_F_PEM_DEF_CALLBACK 0 +#define PEM_F_PEM_DO_HEADER 0 +#define PEM_F_PEM_GET_EVP_CIPHER_INFO 0 +#define PEM_F_PEM_READ 0 +#define PEM_F_PEM_READ_BIO 0 +#define PEM_F_PEM_READ_BIO_DHPARAMS 0 +#define PEM_F_PEM_READ_BIO_EX 0 +#define PEM_F_PEM_READ_BIO_PARAMETERS 0 +#define PEM_F_PEM_READ_BIO_PRIVATEKEY 0 +#define PEM_F_PEM_READ_DHPARAMS 0 +#define PEM_F_PEM_READ_PRIVATEKEY 0 +#define PEM_F_PEM_SIGNFINAL 0 +#define PEM_F_PEM_WRITE 0 +#define PEM_F_PEM_WRITE_BIO 0 +#define PEM_F_PEM_WRITE_BIO_PRIVATEKEY_TRADITIONAL 0 +#define PEM_F_PEM_WRITE_PRIVATEKEY 0 +#define PEM_F_PEM_X509_INFO_READ 0 +#define PEM_F_PEM_X509_INFO_READ_BIO 0 +#define PEM_F_PEM_X509_INFO_WRITE_BIO 0 + +/* + * PKCS12 function codes. + */ +#define PKCS12_F_OPENSSL_ASC2UNI 0 +#define PKCS12_F_OPENSSL_UNI2ASC 0 +#define PKCS12_F_OPENSSL_UNI2UTF8 0 +#define PKCS12_F_OPENSSL_UTF82UNI 0 +#define PKCS12_F_PKCS12_CREATE 0 +#define PKCS12_F_PKCS12_GEN_MAC 0 +#define PKCS12_F_PKCS12_INIT 0 +#define PKCS12_F_PKCS12_ITEM_DECRYPT_D2I 0 +#define PKCS12_F_PKCS12_ITEM_I2D_ENCRYPT 0 +#define PKCS12_F_PKCS12_ITEM_PACK_SAFEBAG 0 +#define PKCS12_F_PKCS12_KEY_GEN_ASC 0 +#define PKCS12_F_PKCS12_KEY_GEN_UNI 0 +#define PKCS12_F_PKCS12_KEY_GEN_UTF8 0 +#define PKCS12_F_PKCS12_NEWPASS 0 +#define PKCS12_F_PKCS12_PACK_P7DATA 0 +#define PKCS12_F_PKCS12_PACK_P7ENCDATA 0 +#define PKCS12_F_PKCS12_PARSE 0 +#define PKCS12_F_PKCS12_PBE_CRYPT 0 +#define PKCS12_F_PKCS12_PBE_KEYIVGEN 0 +#define PKCS12_F_PKCS12_SAFEBAG_CREATE0_P8INF 0 +#define PKCS12_F_PKCS12_SAFEBAG_CREATE0_PKCS8 0 +#define PKCS12_F_PKCS12_SAFEBAG_CREATE_PKCS8_ENCRYPT 0 +#define PKCS12_F_PKCS12_SETUP_MAC 0 +#define PKCS12_F_PKCS12_SET_MAC 0 +#define PKCS12_F_PKCS12_UNPACK_AUTHSAFES 0 +#define PKCS12_F_PKCS12_UNPACK_P7DATA 0 +#define PKCS12_F_PKCS12_VERIFY_MAC 0 +#define PKCS12_F_PKCS8_ENCRYPT 0 +#define PKCS12_F_PKCS8_SET0_PBE 0 + +/* + * PKCS7 function codes. + */ +#define PKCS7_F_DO_PKCS7_SIGNED_ATTRIB 0 +#define PKCS7_F_PKCS7_ADD0_ATTRIB_SIGNING_TIME 0 +#define PKCS7_F_PKCS7_ADD_ATTRIB_SMIMECAP 0 +#define PKCS7_F_PKCS7_ADD_CERTIFICATE 0 +#define PKCS7_F_PKCS7_ADD_CRL 0 +#define PKCS7_F_PKCS7_ADD_RECIPIENT_INFO 0 +#define PKCS7_F_PKCS7_ADD_SIGNATURE 0 +#define PKCS7_F_PKCS7_ADD_SIGNER 0 +#define PKCS7_F_PKCS7_BIO_ADD_DIGEST 0 +#define PKCS7_F_PKCS7_COPY_EXISTING_DIGEST 0 +#define PKCS7_F_PKCS7_CTRL 0 +#define PKCS7_F_PKCS7_DATADECODE 0 +#define PKCS7_F_PKCS7_DATAFINAL 0 +#define PKCS7_F_PKCS7_DATAINIT 0 +#define PKCS7_F_PKCS7_DATAVERIFY 0 +#define PKCS7_F_PKCS7_DECRYPT 0 +#define PKCS7_F_PKCS7_DECRYPT_RINFO 0 +#define PKCS7_F_PKCS7_ENCODE_RINFO 0 +#define PKCS7_F_PKCS7_ENCRYPT 0 +#define PKCS7_F_PKCS7_FINAL 0 +#define PKCS7_F_PKCS7_FIND_DIGEST 0 +#define PKCS7_F_PKCS7_GET0_SIGNERS 0 +#define PKCS7_F_PKCS7_RECIP_INFO_SET 0 +#define PKCS7_F_PKCS7_SET_CIPHER 0 +#define PKCS7_F_PKCS7_SET_CONTENT 0 +#define PKCS7_F_PKCS7_SET_DIGEST 0 +#define PKCS7_F_PKCS7_SET_TYPE 0 +#define PKCS7_F_PKCS7_SIGN 0 +#define PKCS7_F_PKCS7_SIGNATUREVERIFY 0 +#define PKCS7_F_PKCS7_SIGNER_INFO_SET 0 +#define PKCS7_F_PKCS7_SIGNER_INFO_SIGN 0 +#define PKCS7_F_PKCS7_SIGN_ADD_SIGNER 0 +#define PKCS7_F_PKCS7_SIMPLE_SMIMECAP 0 +#define PKCS7_F_PKCS7_VERIFY 0 + +/* + * RAND function codes. + */ +#define RAND_F_DATA_COLLECT_METHOD 0 +#define RAND_F_DRBG_BYTES 0 +#define RAND_F_DRBG_GET_ENTROPY 0 +#define RAND_F_DRBG_SETUP 0 +#define RAND_F_GET_ENTROPY 0 +#define RAND_F_RAND_BYTES 0 +#define RAND_F_RAND_DRBG_ENABLE_LOCKING 0 +#define RAND_F_RAND_DRBG_GENERATE 0 +#define RAND_F_RAND_DRBG_GET_ENTROPY 0 +#define RAND_F_RAND_DRBG_GET_NONCE 0 +#define RAND_F_RAND_DRBG_INSTANTIATE 0 +#define RAND_F_RAND_DRBG_NEW 0 +#define RAND_F_RAND_DRBG_RESEED 0 +#define RAND_F_RAND_DRBG_RESTART 0 +#define RAND_F_RAND_DRBG_SET 0 +#define RAND_F_RAND_DRBG_SET_DEFAULTS 0 +#define RAND_F_RAND_DRBG_UNINSTANTIATE 0 +#define RAND_F_RAND_LOAD_FILE 0 +#define RAND_F_RAND_POOL_ACQUIRE_ENTROPY 0 +#define RAND_F_RAND_POOL_ADD 0 +#define RAND_F_RAND_POOL_ADD_BEGIN 0 +#define RAND_F_RAND_POOL_ADD_END 0 +#define RAND_F_RAND_POOL_ATTACH 0 +#define RAND_F_RAND_POOL_BYTES_NEEDED 0 +#define RAND_F_RAND_POOL_GROW 0 +#define RAND_F_RAND_POOL_NEW 0 +#define RAND_F_RAND_PSEUDO_BYTES 0 +#define RAND_F_RAND_WRITE_FILE 0 + +/* + * RSA function codes. + */ +#define RSA_F_CHECK_PADDING_MD 0 +#define RSA_F_ENCODE_PKCS1 0 +#define RSA_F_INT_RSA_VERIFY 0 +#define RSA_F_OLD_RSA_PRIV_DECODE 0 +#define RSA_F_PKEY_PSS_INIT 0 +#define RSA_F_PKEY_RSA_CTRL 0 +#define RSA_F_PKEY_RSA_CTRL_STR 0 +#define RSA_F_PKEY_RSA_SIGN 0 +#define RSA_F_PKEY_RSA_VERIFY 0 +#define RSA_F_PKEY_RSA_VERIFYRECOVER 0 +#define RSA_F_RSA_ALGOR_TO_MD 0 +#define RSA_F_RSA_BUILTIN_KEYGEN 0 +#define RSA_F_RSA_CHECK_KEY 0 +#define RSA_F_RSA_CHECK_KEY_EX 0 +#define RSA_F_RSA_CMS_DECRYPT 0 +#define RSA_F_RSA_CMS_VERIFY 0 +#define RSA_F_RSA_ITEM_VERIFY 0 +#define RSA_F_RSA_METH_DUP 0 +#define RSA_F_RSA_METH_NEW 0 +#define RSA_F_RSA_METH_SET1_NAME 0 +#define RSA_F_RSA_MGF1_TO_MD 0 +#define RSA_F_RSA_MULTIP_INFO_NEW 0 +#define RSA_F_RSA_NEW_METHOD 0 +#define RSA_F_RSA_NULL 0 +#define RSA_F_RSA_NULL_PRIVATE_DECRYPT 0 +#define RSA_F_RSA_NULL_PRIVATE_ENCRYPT 0 +#define RSA_F_RSA_NULL_PUBLIC_DECRYPT 0 +#define RSA_F_RSA_NULL_PUBLIC_ENCRYPT 0 +#define RSA_F_RSA_OSSL_PRIVATE_DECRYPT 0 +#define RSA_F_RSA_OSSL_PRIVATE_ENCRYPT 0 +#define RSA_F_RSA_OSSL_PUBLIC_DECRYPT 0 +#define RSA_F_RSA_OSSL_PUBLIC_ENCRYPT 0 +#define RSA_F_RSA_PADDING_ADD_NONE 0 +#define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP 0 +#define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP_MGF1 0 +#define RSA_F_RSA_PADDING_ADD_PKCS1_PSS 0 +#define RSA_F_RSA_PADDING_ADD_PKCS1_PSS_MGF1 0 +#define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1 0 +#define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2 0 +#define RSA_F_RSA_PADDING_ADD_SSLV23 0 +#define RSA_F_RSA_PADDING_ADD_X931 0 +#define RSA_F_RSA_PADDING_CHECK_NONE 0 +#define RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP 0 +#define RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP_MGF1 0 +#define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1 0 +#define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2 0 +#define RSA_F_RSA_PADDING_CHECK_SSLV23 0 +#define RSA_F_RSA_PADDING_CHECK_X931 0 +#define RSA_F_RSA_PARAM_DECODE 0 +#define RSA_F_RSA_PRINT 0 +#define RSA_F_RSA_PRINT_FP 0 +#define RSA_F_RSA_PRIV_DECODE 0 +#define RSA_F_RSA_PRIV_ENCODE 0 +#define RSA_F_RSA_PSS_GET_PARAM 0 +#define RSA_F_RSA_PSS_TO_CTX 0 +#define RSA_F_RSA_PUB_DECODE 0 +#define RSA_F_RSA_SETUP_BLINDING 0 +#define RSA_F_RSA_SIGN 0 +#define RSA_F_RSA_SIGN_ASN1_OCTET_STRING 0 +#define RSA_F_RSA_VERIFY 0 +#define RSA_F_RSA_VERIFY_ASN1_OCTET_STRING 0 +#define RSA_F_RSA_VERIFY_PKCS1_PSS_MGF1 0 +#define RSA_F_SETUP_TBUF 0 + +/* + * OSSL_STORE function codes. + */ +#define OSSL_STORE_F_FILE_CTRL 0 +#define OSSL_STORE_F_FILE_FIND 0 +#define OSSL_STORE_F_FILE_GET_PASS 0 +#define OSSL_STORE_F_FILE_LOAD 0 +#define OSSL_STORE_F_FILE_LOAD_TRY_DECODE 0 +#define OSSL_STORE_F_FILE_NAME_TO_URI 0 +#define OSSL_STORE_F_FILE_OPEN 0 +#define OSSL_STORE_F_OSSL_STORE_ATTACH_PEM_BIO 0 +#define OSSL_STORE_F_OSSL_STORE_EXPECT 0 +#define OSSL_STORE_F_OSSL_STORE_FILE_ATTACH_PEM_BIO_INT 0 +#define OSSL_STORE_F_OSSL_STORE_FIND 0 +#define OSSL_STORE_F_OSSL_STORE_GET0_LOADER_INT 0 +#define OSSL_STORE_F_OSSL_STORE_INFO_GET1_CERT 0 +#define OSSL_STORE_F_OSSL_STORE_INFO_GET1_CRL 0 +#define OSSL_STORE_F_OSSL_STORE_INFO_GET1_NAME 0 +#define OSSL_STORE_F_OSSL_STORE_INFO_GET1_NAME_DESCRIPTION 0 +#define OSSL_STORE_F_OSSL_STORE_INFO_GET1_PARAMS 0 +#define OSSL_STORE_F_OSSL_STORE_INFO_GET1_PKEY 0 +#define OSSL_STORE_F_OSSL_STORE_INFO_NEW_CERT 0 +#define OSSL_STORE_F_OSSL_STORE_INFO_NEW_CRL 0 +#define OSSL_STORE_F_OSSL_STORE_INFO_NEW_EMBEDDED 0 +#define OSSL_STORE_F_OSSL_STORE_INFO_NEW_NAME 0 +#define OSSL_STORE_F_OSSL_STORE_INFO_NEW_PARAMS 0 +#define OSSL_STORE_F_OSSL_STORE_INFO_NEW_PKEY 0 +#define OSSL_STORE_F_OSSL_STORE_INFO_SET0_NAME_DESCRIPTION 0 +#define OSSL_STORE_F_OSSL_STORE_INIT_ONCE 0 +#define OSSL_STORE_F_OSSL_STORE_LOADER_NEW 0 +#define OSSL_STORE_F_OSSL_STORE_OPEN 0 +#define OSSL_STORE_F_OSSL_STORE_OPEN_INT 0 +#define OSSL_STORE_F_OSSL_STORE_REGISTER_LOADER_INT 0 +#define OSSL_STORE_F_OSSL_STORE_SEARCH_BY_ALIAS 0 +#define OSSL_STORE_F_OSSL_STORE_SEARCH_BY_ISSUER_SERIAL 0 +#define OSSL_STORE_F_OSSL_STORE_SEARCH_BY_KEY_FINGERPRINT 0 +#define OSSL_STORE_F_OSSL_STORE_SEARCH_BY_NAME 0 +#define OSSL_STORE_F_OSSL_STORE_UNREGISTER_LOADER_INT 0 +#define OSSL_STORE_F_TRY_DECODE_PARAMS 0 +#define OSSL_STORE_F_TRY_DECODE_PKCS12 0 +#define OSSL_STORE_F_TRY_DECODE_PKCS8ENCRYPTED 0 + +#ifndef OPENSSL_NO_TS +/* + * TS function codes. + */ +#define TS_F_DEF_SERIAL_CB 0 +#define TS_F_DEF_TIME_CB 0 +#define TS_F_ESS_ADD_SIGNING_CERT 0 +#define TS_F_ESS_ADD_SIGNING_CERT_V2 0 +#define TS_F_ESS_CERT_ID_NEW_INIT 0 +#define TS_F_ESS_CERT_ID_V2_NEW_INIT 0 +#define TS_F_ESS_SIGNING_CERT_NEW_INIT 0 +#define TS_F_ESS_SIGNING_CERT_V2_NEW_INIT 0 +#define TS_F_INT_TS_RESP_VERIFY_TOKEN 0 +#define TS_F_PKCS7_TO_TS_TST_INFO 0 +#define TS_F_TS_ACCURACY_SET_MICROS 0 +#define TS_F_TS_ACCURACY_SET_MILLIS 0 +#define TS_F_TS_ACCURACY_SET_SECONDS 0 +#define TS_F_TS_CHECK_IMPRINTS 0 +#define TS_F_TS_CHECK_NONCES 0 +#define TS_F_TS_CHECK_POLICY 0 +#define TS_F_TS_CHECK_SIGNING_CERTS 0 +#define TS_F_TS_CHECK_STATUS_INFO 0 +#define TS_F_TS_COMPUTE_IMPRINT 0 +#define TS_F_TS_CONF_INVALID 0 +#define TS_F_TS_CONF_LOAD_CERT 0 +#define TS_F_TS_CONF_LOAD_CERTS 0 +#define TS_F_TS_CONF_LOAD_KEY 0 +#define TS_F_TS_CONF_LOOKUP_FAIL 0 +#define TS_F_TS_CONF_SET_DEFAULT_ENGINE 0 +#define TS_F_TS_GET_STATUS_TEXT 0 +#define TS_F_TS_MSG_IMPRINT_SET_ALGO 0 +#define TS_F_TS_REQ_SET_MSG_IMPRINT 0 +#define TS_F_TS_REQ_SET_NONCE 0 +#define TS_F_TS_REQ_SET_POLICY_ID 0 +#define TS_F_TS_RESP_CREATE_RESPONSE 0 +#define TS_F_TS_RESP_CREATE_TST_INFO 0 +#define TS_F_TS_RESP_CTX_ADD_FAILURE_INFO 0 +#define TS_F_TS_RESP_CTX_ADD_MD 0 +#define TS_F_TS_RESP_CTX_ADD_POLICY 0 +#define TS_F_TS_RESP_CTX_NEW 0 +#define TS_F_TS_RESP_CTX_SET_ACCURACY 0 +#define TS_F_TS_RESP_CTX_SET_CERTS 0 +#define TS_F_TS_RESP_CTX_SET_DEF_POLICY 0 +#define TS_F_TS_RESP_CTX_SET_SIGNER_CERT 0 +#define TS_F_TS_RESP_CTX_SET_STATUS_INFO 0 +#define TS_F_TS_RESP_GET_POLICY 0 +#define TS_F_TS_RESP_SET_GENTIME_WITH_PRECISION 0 +#define TS_F_TS_RESP_SET_STATUS_INFO 0 +#define TS_F_TS_RESP_SET_TST_INFO 0 +#define TS_F_TS_RESP_SIGN 0 +#define TS_F_TS_RESP_VERIFY_SIGNATURE 0 +#define TS_F_TS_TST_INFO_SET_ACCURACY 0 +#define TS_F_TS_TST_INFO_SET_MSG_IMPRINT 0 +#define TS_F_TS_TST_INFO_SET_NONCE 0 +#define TS_F_TS_TST_INFO_SET_POLICY_ID 0 +#define TS_F_TS_TST_INFO_SET_SERIAL 0 +#define TS_F_TS_TST_INFO_SET_TIME 0 +#define TS_F_TS_TST_INFO_SET_TSA 0 +#define TS_F_TS_VERIFY 0 +#define TS_F_TS_VERIFY_CERT 0 +#define TS_F_TS_VERIFY_CTX_NEW 0 +#endif + +/* + * UI function codes. + */ +#define UI_F_CLOSE_CONSOLE 0 +#define UI_F_ECHO_CONSOLE 0 +#define UI_F_GENERAL_ALLOCATE_BOOLEAN 0 +#define UI_F_GENERAL_ALLOCATE_PROMPT 0 +#define UI_F_NOECHO_CONSOLE 0 +#define UI_F_OPEN_CONSOLE 0 +#define UI_F_UI_CONSTRUCT_PROMPT 0 +#define UI_F_UI_CREATE_METHOD 0 +#define UI_F_UI_CTRL 0 +#define UI_F_UI_DUP_ERROR_STRING 0 +#define UI_F_UI_DUP_INFO_STRING 0 +#define UI_F_UI_DUP_INPUT_BOOLEAN 0 +#define UI_F_UI_DUP_INPUT_STRING 0 +#define UI_F_UI_DUP_USER_DATA 0 +#define UI_F_UI_DUP_VERIFY_STRING 0 +#define UI_F_UI_GET0_RESULT 0 +#define UI_F_UI_GET_RESULT_LENGTH 0 +#define UI_F_UI_NEW_METHOD 0 +#define UI_F_UI_PROCESS 0 +#define UI_F_UI_SET_RESULT 0 +#define UI_F_UI_SET_RESULT_EX 0 + +/* + * X509 function codes. + */ +#define X509_F_ADD_CERT_DIR 0 +#define X509_F_BUILD_CHAIN 0 +#define X509_F_BY_FILE_CTRL 0 +#define X509_F_CHECK_NAME_CONSTRAINTS 0 +#define X509_F_CHECK_POLICY 0 +#define X509_F_DANE_I2D 0 +#define X509_F_DIR_CTRL 0 +#define X509_F_GET_CERT_BY_SUBJECT 0 +#define X509_F_I2D_X509_AUX 0 +#define X509_F_LOOKUP_CERTS_SK 0 +#define X509_F_NETSCAPE_SPKI_B64_DECODE 0 +#define X509_F_NETSCAPE_SPKI_B64_ENCODE 0 +#define X509_F_NEW_DIR 0 +#define X509_F_X509AT_ADD1_ATTR 0 +#define X509_F_X509V3_ADD_EXT 0 +#define X509_F_X509_ATTRIBUTE_CREATE_BY_NID 0 +#define X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ 0 +#define X509_F_X509_ATTRIBUTE_CREATE_BY_TXT 0 +#define X509_F_X509_ATTRIBUTE_GET0_DATA 0 +#define X509_F_X509_ATTRIBUTE_SET1_DATA 0 +#define X509_F_X509_CHECK_PRIVATE_KEY 0 +#define X509_F_X509_CRL_DIFF 0 +#define X509_F_X509_CRL_METHOD_NEW 0 +#define X509_F_X509_CRL_PRINT_FP 0 +#define X509_F_X509_EXTENSION_CREATE_BY_NID 0 +#define X509_F_X509_EXTENSION_CREATE_BY_OBJ 0 +#define X509_F_X509_GET_PUBKEY_PARAMETERS 0 +#define X509_F_X509_LOAD_CERT_CRL_FILE 0 +#define X509_F_X509_LOAD_CERT_FILE 0 +#define X509_F_X509_LOAD_CRL_FILE 0 +#define X509_F_X509_LOOKUP_METH_NEW 0 +#define X509_F_X509_LOOKUP_NEW 0 +#define X509_F_X509_NAME_ADD_ENTRY 0 +#define X509_F_X509_NAME_CANON 0 +#define X509_F_X509_NAME_ENTRY_CREATE_BY_NID 0 +#define X509_F_X509_NAME_ENTRY_CREATE_BY_TXT 0 +#define X509_F_X509_NAME_ENTRY_SET_OBJECT 0 +#define X509_F_X509_NAME_ONELINE 0 +#define X509_F_X509_NAME_PRINT 0 +#define X509_F_X509_OBJECT_NEW 0 +#define X509_F_X509_PRINT_EX_FP 0 +#define X509_F_X509_PUBKEY_DECODE 0 +#define X509_F_X509_PUBKEY_GET 0 +#define X509_F_X509_PUBKEY_GET0 0 +#define X509_F_X509_PUBKEY_SET 0 +#define X509_F_X509_REQ_CHECK_PRIVATE_KEY 0 +#define X509_F_X509_REQ_PRINT_EX 0 +#define X509_F_X509_REQ_PRINT_FP 0 +#define X509_F_X509_REQ_TO_X509 0 +#define X509_F_X509_STORE_ADD_CERT 0 +#define X509_F_X509_STORE_ADD_CRL 0 +#define X509_F_X509_STORE_ADD_LOOKUP 0 +#define X509_F_X509_STORE_CTX_GET1_ISSUER 0 +#define X509_F_X509_STORE_CTX_INIT 0 +#define X509_F_X509_STORE_CTX_NEW 0 +#define X509_F_X509_STORE_CTX_PURPOSE_INHERIT 0 +#define X509_F_X509_STORE_NEW 0 +#define X509_F_X509_TO_X509_REQ 0 +#define X509_F_X509_TRUST_ADD 0 +#define X509_F_X509_TRUST_SET 0 +#define X509_F_X509_VERIFY_CERT 0 +#define X509_F_X509_VERIFY_PARAM_NEW 0 + +/* + * X509V3 function codes. + */ +#define X509V3_F_A2I_GENERAL_NAME 0 +#define X509V3_F_ADDR_VALIDATE_PATH_INTERNAL 0 +#define X509V3_F_ASIDENTIFIERCHOICE_CANONIZE 0 +#define X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL 0 +#define X509V3_F_BIGNUM_TO_STRING 0 +#define X509V3_F_COPY_EMAIL 0 +#define X509V3_F_COPY_ISSUER 0 +#define X509V3_F_DO_DIRNAME 0 +#define X509V3_F_DO_EXT_I2D 0 +#define X509V3_F_DO_EXT_NCONF 0 +#define X509V3_F_GNAMES_FROM_SECTNAME 0 +#define X509V3_F_I2S_ASN1_ENUMERATED 0 +#define X509V3_F_I2S_ASN1_IA5STRING 0 +#define X509V3_F_I2S_ASN1_INTEGER 0 +#define X509V3_F_I2V_AUTHORITY_INFO_ACCESS 0 +#define X509V3_F_LEVEL_ADD_NODE 0 +#define X509V3_F_NOTICE_SECTION 0 +#define X509V3_F_NREF_NOS 0 +#define X509V3_F_POLICY_CACHE_CREATE 0 +#define X509V3_F_POLICY_CACHE_NEW 0 +#define X509V3_F_POLICY_DATA_NEW 0 +#define X509V3_F_POLICY_SECTION 0 +#define X509V3_F_PROCESS_PCI_VALUE 0 +#define X509V3_F_R2I_CERTPOL 0 +#define X509V3_F_R2I_PCI 0 +#define X509V3_F_S2I_ASN1_IA5STRING 0 +#define X509V3_F_S2I_ASN1_INTEGER 0 +#define X509V3_F_S2I_ASN1_OCTET_STRING 0 +#define X509V3_F_S2I_SKEY_ID 0 +#define X509V3_F_SET_DIST_POINT_NAME 0 +#define X509V3_F_SXNET_ADD_ID_ASC 0 +#define X509V3_F_SXNET_ADD_ID_INTEGER 0 +#define X509V3_F_SXNET_ADD_ID_ULONG 0 +#define X509V3_F_SXNET_GET_ID_ASC 0 +#define X509V3_F_SXNET_GET_ID_ULONG 0 +#define X509V3_F_TREE_INIT 0 +#define X509V3_F_V2I_ASIDENTIFIERS 0 +#define X509V3_F_V2I_ASN1_BIT_STRING 0 +#define X509V3_F_V2I_AUTHORITY_INFO_ACCESS 0 +#define X509V3_F_V2I_AUTHORITY_KEYID 0 +#define X509V3_F_V2I_BASIC_CONSTRAINTS 0 +#define X509V3_F_V2I_CRLD 0 +#define X509V3_F_V2I_EXTENDED_KEY_USAGE 0 +#define X509V3_F_V2I_GENERAL_NAMES 0 +#define X509V3_F_V2I_GENERAL_NAME_EX 0 +#define X509V3_F_V2I_IDP 0 +#define X509V3_F_V2I_IPADDRBLOCKS 0 +#define X509V3_F_V2I_ISSUER_ALT 0 +#define X509V3_F_V2I_NAME_CONSTRAINTS 0 +#define X509V3_F_V2I_POLICY_CONSTRAINTS 0 +#define X509V3_F_V2I_POLICY_MAPPINGS 0 +#define X509V3_F_V2I_SUBJECT_ALT 0 +#define X509V3_F_V2I_TLS_FEATURE 0 +#define X509V3_F_V3_GENERIC_EXTENSION 0 +#define X509V3_F_X509V3_ADD1_I2D 0 +#define X509V3_F_X509V3_ADD_VALUE 0 +#define X509V3_F_X509V3_EXT_ADD 0 +#define X509V3_F_X509V3_EXT_ADD_ALIAS 0 +#define X509V3_F_X509V3_EXT_I2D 0 +#define X509V3_F_X509V3_EXT_NCONF 0 +#define X509V3_F_X509V3_GET_SECTION 0 +#define X509V3_F_X509V3_GET_STRING 0 +#define X509V3_F_X509V3_GET_VALUE_BOOL 0 +#define X509V3_F_X509V3_PARSE_LIST 0 +#define X509V3_F_X509_PURPOSE_ADD 0 +#define X509V3_F_X509_PURPOSE_SET 0 + +/* + * Compatibility defines. + */ +#define EVP_R_OPERATON_NOT_INITIALIZED EVP_R_OPERATION_NOT_INITIALIZED + +#endif + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ct.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ct.h new file mode 100644 index 0000000000000000000000000000000000000000..4d48a40f314747fffd3de030af6f15238774d317 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ct.h @@ -0,0 +1,574 @@ +/* + * WARNING: do not edit! + * Generated by makefile from include\openssl\ct.h.in + * + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* clang-format off */ + +/* clang-format on */ + +#ifndef OPENSSL_CT_H +#define OPENSSL_CT_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_CT_H +#endif + +#include + +#ifndef OPENSSL_NO_CT +#include +#include +#include +#include +#ifdef __cplusplus +extern "C" { +#endif + +/* Minimum RSA key size, from RFC6962 */ +#define SCT_MIN_RSA_BITS 2048 + +/* All hashes are SHA256 in v1 of Certificate Transparency */ +#define CT_V1_HASHLEN SHA256_DIGEST_LENGTH + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(SCT, SCT, SCT) +#define sk_SCT_num(sk) OPENSSL_sk_num(ossl_check_const_SCT_sk_type(sk)) +#define sk_SCT_value(sk, idx) ((SCT *)OPENSSL_sk_value(ossl_check_const_SCT_sk_type(sk), (idx))) +#define sk_SCT_new(cmp) ((STACK_OF(SCT) *)OPENSSL_sk_new(ossl_check_SCT_compfunc_type(cmp))) +#define sk_SCT_new_null() ((STACK_OF(SCT) *)OPENSSL_sk_new_null()) +#define sk_SCT_new_reserve(cmp, n) ((STACK_OF(SCT) *)OPENSSL_sk_new_reserve(ossl_check_SCT_compfunc_type(cmp), (n))) +#define sk_SCT_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_SCT_sk_type(sk), (n)) +#define sk_SCT_free(sk) OPENSSL_sk_free(ossl_check_SCT_sk_type(sk)) +#define sk_SCT_zero(sk) OPENSSL_sk_zero(ossl_check_SCT_sk_type(sk)) +#define sk_SCT_delete(sk, i) ((SCT *)OPENSSL_sk_delete(ossl_check_SCT_sk_type(sk), (i))) +#define sk_SCT_delete_ptr(sk, ptr) ((SCT *)OPENSSL_sk_delete_ptr(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr))) +#define sk_SCT_push(sk, ptr) OPENSSL_sk_push(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr)) +#define sk_SCT_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr)) +#define sk_SCT_pop(sk) ((SCT *)OPENSSL_sk_pop(ossl_check_SCT_sk_type(sk))) +#define sk_SCT_shift(sk) ((SCT *)OPENSSL_sk_shift(ossl_check_SCT_sk_type(sk))) +#define sk_SCT_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SCT_sk_type(sk), ossl_check_SCT_freefunc_type(freefunc)) +#define sk_SCT_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr), (idx)) +#define sk_SCT_set(sk, idx, ptr) ((SCT *)OPENSSL_sk_set(ossl_check_SCT_sk_type(sk), (idx), ossl_check_SCT_type(ptr))) +#define sk_SCT_find(sk, ptr) OPENSSL_sk_find(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr)) +#define sk_SCT_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr)) +#define sk_SCT_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr), pnum) +#define sk_SCT_sort(sk) OPENSSL_sk_sort(ossl_check_SCT_sk_type(sk)) +#define sk_SCT_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_SCT_sk_type(sk)) +#define sk_SCT_dup(sk) ((STACK_OF(SCT) *)OPENSSL_sk_dup(ossl_check_const_SCT_sk_type(sk))) +#define sk_SCT_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(SCT) *)OPENSSL_sk_deep_copy(ossl_check_const_SCT_sk_type(sk), ossl_check_SCT_copyfunc_type(copyfunc), ossl_check_SCT_freefunc_type(freefunc))) +#define sk_SCT_set_cmp_func(sk, cmp) ((sk_SCT_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_SCT_sk_type(sk), ossl_check_SCT_compfunc_type(cmp))) +SKM_DEFINE_STACK_OF_INTERNAL(CTLOG, CTLOG, CTLOG) +#define sk_CTLOG_num(sk) OPENSSL_sk_num(ossl_check_const_CTLOG_sk_type(sk)) +#define sk_CTLOG_value(sk, idx) ((CTLOG *)OPENSSL_sk_value(ossl_check_const_CTLOG_sk_type(sk), (idx))) +#define sk_CTLOG_new(cmp) ((STACK_OF(CTLOG) *)OPENSSL_sk_new(ossl_check_CTLOG_compfunc_type(cmp))) +#define sk_CTLOG_new_null() ((STACK_OF(CTLOG) *)OPENSSL_sk_new_null()) +#define sk_CTLOG_new_reserve(cmp, n) ((STACK_OF(CTLOG) *)OPENSSL_sk_new_reserve(ossl_check_CTLOG_compfunc_type(cmp), (n))) +#define sk_CTLOG_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CTLOG_sk_type(sk), (n)) +#define sk_CTLOG_free(sk) OPENSSL_sk_free(ossl_check_CTLOG_sk_type(sk)) +#define sk_CTLOG_zero(sk) OPENSSL_sk_zero(ossl_check_CTLOG_sk_type(sk)) +#define sk_CTLOG_delete(sk, i) ((CTLOG *)OPENSSL_sk_delete(ossl_check_CTLOG_sk_type(sk), (i))) +#define sk_CTLOG_delete_ptr(sk, ptr) ((CTLOG *)OPENSSL_sk_delete_ptr(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr))) +#define sk_CTLOG_push(sk, ptr) OPENSSL_sk_push(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr)) +#define sk_CTLOG_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr)) +#define sk_CTLOG_pop(sk) ((CTLOG *)OPENSSL_sk_pop(ossl_check_CTLOG_sk_type(sk))) +#define sk_CTLOG_shift(sk) ((CTLOG *)OPENSSL_sk_shift(ossl_check_CTLOG_sk_type(sk))) +#define sk_CTLOG_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_freefunc_type(freefunc)) +#define sk_CTLOG_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr), (idx)) +#define sk_CTLOG_set(sk, idx, ptr) ((CTLOG *)OPENSSL_sk_set(ossl_check_CTLOG_sk_type(sk), (idx), ossl_check_CTLOG_type(ptr))) +#define sk_CTLOG_find(sk, ptr) OPENSSL_sk_find(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr)) +#define sk_CTLOG_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr)) +#define sk_CTLOG_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr), pnum) +#define sk_CTLOG_sort(sk) OPENSSL_sk_sort(ossl_check_CTLOG_sk_type(sk)) +#define sk_CTLOG_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CTLOG_sk_type(sk)) +#define sk_CTLOG_dup(sk) ((STACK_OF(CTLOG) *)OPENSSL_sk_dup(ossl_check_const_CTLOG_sk_type(sk))) +#define sk_CTLOG_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CTLOG) *)OPENSSL_sk_deep_copy(ossl_check_const_CTLOG_sk_type(sk), ossl_check_CTLOG_copyfunc_type(copyfunc), ossl_check_CTLOG_freefunc_type(freefunc))) +#define sk_CTLOG_set_cmp_func(sk, cmp) ((sk_CTLOG_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_compfunc_type(cmp))) + +/* clang-format on */ + +typedef enum { + CT_LOG_ENTRY_TYPE_NOT_SET = -1, + CT_LOG_ENTRY_TYPE_X509 = 0, + CT_LOG_ENTRY_TYPE_PRECERT = 1 +} ct_log_entry_type_t; + +typedef enum { + SCT_VERSION_NOT_SET = -1, + SCT_VERSION_V1 = 0 +} sct_version_t; + +typedef enum { + SCT_SOURCE_UNKNOWN, + SCT_SOURCE_TLS_EXTENSION, + SCT_SOURCE_X509V3_EXTENSION, + SCT_SOURCE_OCSP_STAPLED_RESPONSE +} sct_source_t; + +typedef enum { + SCT_VALIDATION_STATUS_NOT_SET, + SCT_VALIDATION_STATUS_UNKNOWN_LOG, + SCT_VALIDATION_STATUS_VALID, + SCT_VALIDATION_STATUS_INVALID, + SCT_VALIDATION_STATUS_UNVERIFIED, + SCT_VALIDATION_STATUS_UNKNOWN_VERSION +} sct_validation_status_t; + +/****************************************** + * CT policy evaluation context functions * + ******************************************/ + +/* + * Creates a new, empty policy evaluation context associated with the given + * library context and property query string. + * The caller is responsible for calling CT_POLICY_EVAL_CTX_free when finished + * with the CT_POLICY_EVAL_CTX. + */ +CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new_ex(OSSL_LIB_CTX *libctx, + const char *propq); + +/* + * The same as CT_POLICY_EVAL_CTX_new_ex() but the default library + * context and property query string is used. + */ +CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new(void); + +/* Deletes a policy evaluation context and anything it owns. */ +void CT_POLICY_EVAL_CTX_free(CT_POLICY_EVAL_CTX *ctx); + +/* Gets the peer certificate that the SCTs are for */ +X509 *CT_POLICY_EVAL_CTX_get0_cert(const CT_POLICY_EVAL_CTX *ctx); + +/* + * Sets the certificate associated with the received SCTs. + * Increments the reference count of cert. + * Returns 1 on success, 0 otherwise. + */ +int CT_POLICY_EVAL_CTX_set1_cert(CT_POLICY_EVAL_CTX *ctx, X509 *cert); + +/* Gets the issuer of the aforementioned certificate */ +X509 *CT_POLICY_EVAL_CTX_get0_issuer(const CT_POLICY_EVAL_CTX *ctx); + +/* + * Sets the issuer of the certificate associated with the received SCTs. + * Increments the reference count of issuer. + * Returns 1 on success, 0 otherwise. + */ +int CT_POLICY_EVAL_CTX_set1_issuer(CT_POLICY_EVAL_CTX *ctx, X509 *issuer); + +/* Gets the CT logs that are trusted sources of SCTs */ +const CTLOG_STORE *CT_POLICY_EVAL_CTX_get0_log_store(const CT_POLICY_EVAL_CTX *ctx); + +/* Sets the log store that is in use. It must outlive the CT_POLICY_EVAL_CTX. */ +void CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE(CT_POLICY_EVAL_CTX *ctx, + CTLOG_STORE *log_store); + +/* + * Gets the time, in milliseconds since the Unix epoch, that will be used as the + * current time when checking whether an SCT was issued in the future. + * Such SCTs will fail validation, as required by RFC6962. + */ +uint64_t CT_POLICY_EVAL_CTX_get_time(const CT_POLICY_EVAL_CTX *ctx); + +/* + * Sets the time to evaluate SCTs against, in milliseconds since the Unix epoch. + * If an SCT's timestamp is after this time, it will be interpreted as having + * been issued in the future. RFC6962 states that "TLS clients MUST reject SCTs + * whose timestamp is in the future", so an SCT will not validate in this case. + */ +void CT_POLICY_EVAL_CTX_set_time(CT_POLICY_EVAL_CTX *ctx, uint64_t time_in_ms); + +/***************** + * SCT functions * + *****************/ + +/* + * Creates a new, blank SCT. + * The caller is responsible for calling SCT_free when finished with the SCT. + */ +SCT *SCT_new(void); + +/* + * Creates a new SCT from some base64-encoded strings. + * The caller is responsible for calling SCT_free when finished with the SCT. + */ +SCT *SCT_new_from_base64(unsigned char version, + const char *logid_base64, + ct_log_entry_type_t entry_type, + uint64_t timestamp, + const char *extensions_base64, + const char *signature_base64); + +/* + * Frees the SCT and the underlying data structures. + */ +void SCT_free(SCT *sct); + +/* + * Free a stack of SCTs, and the underlying SCTs themselves. + * Intended to be compatible with X509V3_EXT_FREE. + */ +void SCT_LIST_free(STACK_OF(SCT) *a); + +/* + * Returns the version of the SCT. + */ +sct_version_t SCT_get_version(const SCT *sct); + +/* + * Set the version of an SCT. + * Returns 1 on success, 0 if the version is unrecognized. + */ +__owur int SCT_set_version(SCT *sct, sct_version_t version); + +/* + * Returns the log entry type of the SCT. + */ +ct_log_entry_type_t SCT_get_log_entry_type(const SCT *sct); + +/* + * Set the log entry type of an SCT. + * Returns 1 on success, 0 otherwise. + */ +__owur int SCT_set_log_entry_type(SCT *sct, ct_log_entry_type_t entry_type); + +/* + * Gets the ID of the log that an SCT came from. + * Ownership of the log ID remains with the SCT. + * Returns the length of the log ID. + */ +size_t SCT_get0_log_id(const SCT *sct, unsigned char **log_id); + +/* + * Set the log ID of an SCT to point directly to the *log_id specified. + * The SCT takes ownership of the specified pointer. + * Returns 1 on success, 0 otherwise. + */ +__owur int SCT_set0_log_id(SCT *sct, unsigned char *log_id, size_t log_id_len); + +/* + * Set the log ID of an SCT. + * This makes a copy of the log_id. + * Returns 1 on success, 0 otherwise. + */ +__owur int SCT_set1_log_id(SCT *sct, const unsigned char *log_id, + size_t log_id_len); + +/* + * Returns the timestamp for the SCT (epoch time in milliseconds). + */ +uint64_t SCT_get_timestamp(const SCT *sct); + +/* + * Set the timestamp of an SCT (epoch time in milliseconds). + */ +void SCT_set_timestamp(SCT *sct, uint64_t timestamp); + +/* + * Return the NID for the signature used by the SCT. + * For CT v1, this will be either NID_sha256WithRSAEncryption or + * NID_ecdsa_with_SHA256 (or NID_undef if incorrect/unset). + */ +int SCT_get_signature_nid(const SCT *sct); + +/* + * Set the signature type of an SCT + * For CT v1, this should be either NID_sha256WithRSAEncryption or + * NID_ecdsa_with_SHA256. + * Returns 1 on success, 0 otherwise. + */ +__owur int SCT_set_signature_nid(SCT *sct, int nid); + +/* + * Set *ext to point to the extension data for the SCT. ext must not be NULL. + * The SCT retains ownership of this pointer. + * Returns length of the data pointed to. + */ +size_t SCT_get0_extensions(const SCT *sct, unsigned char **ext); + +/* + * Set the extensions of an SCT to point directly to the *ext specified. + * The SCT takes ownership of the specified pointer. + */ +void SCT_set0_extensions(SCT *sct, unsigned char *ext, size_t ext_len); + +/* + * Set the extensions of an SCT. + * This takes a copy of the ext. + * Returns 1 on success, 0 otherwise. + */ +__owur int SCT_set1_extensions(SCT *sct, const unsigned char *ext, + size_t ext_len); + +/* + * Set *sig to point to the signature for the SCT. sig must not be NULL. + * The SCT retains ownership of this pointer. + * Returns length of the data pointed to. + */ +size_t SCT_get0_signature(const SCT *sct, unsigned char **sig); + +/* + * Set the signature of an SCT to point directly to the *sig specified. + * The SCT takes ownership of the specified pointer. + */ +void SCT_set0_signature(SCT *sct, unsigned char *sig, size_t sig_len); + +/* + * Set the signature of an SCT to be a copy of the *sig specified. + * Returns 1 on success, 0 otherwise. + */ +__owur int SCT_set1_signature(SCT *sct, const unsigned char *sig, + size_t sig_len); + +/* + * The origin of this SCT, e.g. TLS extension, OCSP response, etc. + */ +sct_source_t SCT_get_source(const SCT *sct); + +/* + * Set the origin of this SCT, e.g. TLS extension, OCSP response, etc. + * Returns 1 on success, 0 otherwise. + */ +__owur int SCT_set_source(SCT *sct, sct_source_t source); + +/* + * Returns a text string describing the validation status of |sct|. + */ +const char *SCT_validation_status_string(const SCT *sct); + +/* + * Pretty-prints an |sct| to |out|. + * It will be indented by the number of spaces specified by |indent|. + * If |logs| is not NULL, it will be used to lookup the CT log that the SCT came + * from, so that the log name can be printed. + */ +void SCT_print(const SCT *sct, BIO *out, int indent, const CTLOG_STORE *logs); + +/* + * Pretty-prints an |sct_list| to |out|. + * It will be indented by the number of spaces specified by |indent|. + * SCTs will be delimited by |separator|. + * If |logs| is not NULL, it will be used to lookup the CT log that each SCT + * came from, so that the log names can be printed. + */ +void SCT_LIST_print(const STACK_OF(SCT) *sct_list, BIO *out, int indent, + const char *separator, const CTLOG_STORE *logs); + +/* + * Gets the last result of validating this SCT. + * If it has not been validated yet, returns SCT_VALIDATION_STATUS_NOT_SET. + */ +sct_validation_status_t SCT_get_validation_status(const SCT *sct); + +/* + * Validates the given SCT with the provided context. + * Sets the "validation_status" field of the SCT. + * Returns 1 if the SCT is valid and the signature verifies. + * Returns 0 if the SCT is invalid or could not be verified. + * Returns -1 if an error occurs. + */ +__owur int SCT_validate(SCT *sct, const CT_POLICY_EVAL_CTX *ctx); + +/* + * Validates the given list of SCTs with the provided context. + * Sets the "validation_status" field of each SCT. + * Returns 1 if there are no invalid SCTs and all signatures verify. + * Returns 0 if at least one SCT is invalid or could not be verified. + * Returns a negative integer if an error occurs. + */ +__owur int SCT_LIST_validate(const STACK_OF(SCT) *scts, + CT_POLICY_EVAL_CTX *ctx); + +/********************************* + * SCT parsing and serialization * + *********************************/ + +/* + * Serialize (to TLS format) a stack of SCTs and return the length. + * "a" must not be NULL. + * If "pp" is NULL, just return the length of what would have been serialized. + * If "pp" is not NULL and "*pp" is null, function will allocate a new pointer + * for data that caller is responsible for freeing (only if function returns + * successfully). + * If "pp" is NULL and "*pp" is not NULL, caller is responsible for ensuring + * that "*pp" is large enough to accept all of the serialized data. + * Returns < 0 on error, >= 0 indicating bytes written (or would have been) + * on success. + */ +__owur int i2o_SCT_LIST(const STACK_OF(SCT) *a, unsigned char **pp); + +/* + * Convert TLS format SCT list to a stack of SCTs. + * If "a" or "*a" is NULL, a new stack will be created that the caller is + * responsible for freeing (by calling SCT_LIST_free). + * "**pp" and "*pp" must not be NULL. + * Upon success, "*pp" will point to after the last bytes read, and a stack + * will be returned. + * Upon failure, a NULL pointer will be returned, and the position of "*pp" is + * not defined. + */ +STACK_OF(SCT) *o2i_SCT_LIST(STACK_OF(SCT) **a, const unsigned char **pp, + size_t len); + +/* + * Serialize (to DER format) a stack of SCTs and return the length. + * "a" must not be NULL. + * If "pp" is NULL, just returns the length of what would have been serialized. + * If "pp" is not NULL and "*pp" is null, function will allocate a new pointer + * for data that caller is responsible for freeing (only if function returns + * successfully). + * If "pp" is NULL and "*pp" is not NULL, caller is responsible for ensuring + * that "*pp" is large enough to accept all of the serialized data. + * Returns < 0 on error, >= 0 indicating bytes written (or would have been) + * on success. + */ +__owur int i2d_SCT_LIST(const STACK_OF(SCT) *a, unsigned char **pp); + +/* + * Parses an SCT list in DER format and returns it. + * If "a" or "*a" is NULL, a new stack will be created that the caller is + * responsible for freeing (by calling SCT_LIST_free). + * "**pp" and "*pp" must not be NULL. + * Upon success, "*pp" will point to after the last bytes read, and a stack + * will be returned. + * Upon failure, a NULL pointer will be returned, and the position of "*pp" is + * not defined. + */ +STACK_OF(SCT) *d2i_SCT_LIST(STACK_OF(SCT) **a, const unsigned char **pp, + long len); + +/* + * Serialize (to TLS format) an |sct| and write it to |out|. + * If |out| is null, no SCT will be output but the length will still be returned. + * If |out| points to a null pointer, a string will be allocated to hold the + * TLS-format SCT. It is the responsibility of the caller to free it. + * If |out| points to an allocated string, the TLS-format SCT will be written + * to it. + * The length of the SCT in TLS format will be returned. + */ +__owur int i2o_SCT(const SCT *sct, unsigned char **out); + +/* + * Parses an SCT in TLS format and returns it. + * If |psct| is not null, it will end up pointing to the parsed SCT. If it + * already points to a non-null pointer, the pointer will be free'd. + * |in| should be a pointer to a string containing the TLS-format SCT. + * |in| will be advanced to the end of the SCT if parsing succeeds. + * |len| should be the length of the SCT in |in|. + * Returns NULL if an error occurs. + * If the SCT is an unsupported version, only the SCT's 'sct' and 'sct_len' + * fields will be populated (with |in| and |len| respectively). + */ +SCT *o2i_SCT(SCT **psct, const unsigned char **in, size_t len); + +/******************** + * CT log functions * + ********************/ + +/* + * Creates a new CT log instance with the given |public_key| and |name| and + * associates it with the give library context |libctx| and property query + * string |propq|. + * Takes ownership of |public_key| but copies |name|. + * Returns NULL if malloc fails or if |public_key| cannot be converted to DER. + * Should be deleted by the caller using CTLOG_free when no longer needed. + */ +CTLOG *CTLOG_new_ex(EVP_PKEY *public_key, const char *name, OSSL_LIB_CTX *libctx, + const char *propq); + +/* + * The same as CTLOG_new_ex except that the default library context and + * property query string are used. + */ +CTLOG *CTLOG_new(EVP_PKEY *public_key, const char *name); + +/* + * Creates a new CTLOG instance with the base64-encoded SubjectPublicKeyInfo DER + * in |pkey_base64| and associated with the given library context |libctx| and + * property query string |propq|. The |name| is a string to help users identify + * this log. + * Returns 1 on success, 0 on failure. + * Should be deleted by the caller using CTLOG_free when no longer needed. + */ +int CTLOG_new_from_base64_ex(CTLOG **ct_log, const char *pkey_base64, + const char *name, OSSL_LIB_CTX *libctx, + const char *propq); + +/* + * The same as CTLOG_new_from_base64_ex() except that the default + * library context and property query string are used. + * Returns 1 on success, 0 on failure. + */ +int CTLOG_new_from_base64(CTLOG **ct_log, + const char *pkey_base64, const char *name); + +/* + * Deletes a CT log instance and its fields. + */ +void CTLOG_free(CTLOG *log); + +/* Gets the name of the CT log */ +const char *CTLOG_get0_name(const CTLOG *log); +/* Gets the ID of the CT log */ +void CTLOG_get0_log_id(const CTLOG *log, const uint8_t **log_id, + size_t *log_id_len); +/* Gets the public key of the CT log */ +EVP_PKEY *CTLOG_get0_public_key(const CTLOG *log); + +/************************** + * CT log store functions * + **************************/ + +/* + * Creates a new CT log store and associates it with the given libctx and + * property query string. + * Should be deleted by the caller using CTLOG_STORE_free when no longer needed. + */ +CTLOG_STORE *CTLOG_STORE_new_ex(OSSL_LIB_CTX *libctx, const char *propq); + +/* + * Same as CTLOG_STORE_new_ex except that the default libctx and + * property query string are used. + * Should be deleted by the caller using CTLOG_STORE_free when no longer needed. + */ +CTLOG_STORE *CTLOG_STORE_new(void); + +/* + * Deletes a CT log store and all of the CT log instances held within. + */ +void CTLOG_STORE_free(CTLOG_STORE *store); + +/* + * Finds a CT log in the store based on its log ID. + * Returns the CT log, or NULL if no match is found. + */ +const CTLOG *CTLOG_STORE_get0_log_by_id(const CTLOG_STORE *store, + const uint8_t *log_id, + size_t log_id_len); + +/* + * Loads a CT log list into a |store| from a |file|. + * Returns 1 if loading is successful, or 0 otherwise. + */ +__owur int CTLOG_STORE_load_file(CTLOG_STORE *store, const char *file); + +/* + * Loads the default CT log list into a |store|. + * Returns 1 if loading is successful, or 0 otherwise. + */ +__owur int CTLOG_STORE_load_default_file(CTLOG_STORE *store); + +#ifdef __cplusplus +} +#endif +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cterr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cterr.h new file mode 100644 index 0000000000000000000000000000000000000000..950b7b388cc7812d39767951c60ccd6509aa3593 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/cterr.h @@ -0,0 +1,43 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_CTERR_H +#define OPENSSL_CTERR_H +#pragma once + +#include +#include +#include + +#ifndef OPENSSL_NO_CT + +/* + * CT reason codes. + */ +#define CT_R_BASE64_DECODE_ERROR 108 +#define CT_R_INVALID_LOG_ID_LENGTH 100 +#define CT_R_LOG_CONF_INVALID 109 +#define CT_R_LOG_CONF_INVALID_KEY 110 +#define CT_R_LOG_CONF_MISSING_DESCRIPTION 111 +#define CT_R_LOG_CONF_MISSING_KEY 112 +#define CT_R_LOG_KEY_INVALID 113 +#define CT_R_SCT_FUTURE_TIMESTAMP 116 +#define CT_R_SCT_INVALID 104 +#define CT_R_SCT_INVALID_SIGNATURE 107 +#define CT_R_SCT_LIST_INVALID 105 +#define CT_R_SCT_LOG_ID_MISMATCH 114 +#define CT_R_SCT_NOT_SET 106 +#define CT_R_SCT_UNSUPPORTED_VERSION 115 +#define CT_R_UNRECOGNIZED_SIGNATURE_NID 101 +#define CT_R_UNSUPPORTED_ENTRY_TYPE 102 +#define CT_R_UNSUPPORTED_VERSION 103 + +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/decoder.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/decoder.h new file mode 100644 index 0000000000000000000000000000000000000000..8194c2492acb8625d11fbd33f1afeb7ad130c6bc --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/decoder.h @@ -0,0 +1,133 @@ +/* + * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_DECODER_H +#define OPENSSL_DECODER_H +#pragma once + +#include + +#ifndef OPENSSL_NO_STDIO +#include +#endif +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +OSSL_DECODER *OSSL_DECODER_fetch(OSSL_LIB_CTX *libctx, const char *name, + const char *properties); +int OSSL_DECODER_up_ref(OSSL_DECODER *encoder); +void OSSL_DECODER_free(OSSL_DECODER *encoder); + +const OSSL_PROVIDER *OSSL_DECODER_get0_provider(const OSSL_DECODER *encoder); +const char *OSSL_DECODER_get0_properties(const OSSL_DECODER *encoder); +const char *OSSL_DECODER_get0_name(const OSSL_DECODER *decoder); +const char *OSSL_DECODER_get0_description(const OSSL_DECODER *decoder); +int OSSL_DECODER_is_a(const OSSL_DECODER *encoder, const char *name); + +void OSSL_DECODER_do_all_provided(OSSL_LIB_CTX *libctx, + void (*fn)(OSSL_DECODER *encoder, void *arg), + void *arg); +int OSSL_DECODER_names_do_all(const OSSL_DECODER *encoder, + void (*fn)(const char *name, void *data), + void *data); +const OSSL_PARAM *OSSL_DECODER_gettable_params(OSSL_DECODER *decoder); +int OSSL_DECODER_get_params(OSSL_DECODER *decoder, OSSL_PARAM params[]); + +const OSSL_PARAM *OSSL_DECODER_settable_ctx_params(OSSL_DECODER *encoder); +OSSL_DECODER_CTX *OSSL_DECODER_CTX_new(void); +int OSSL_DECODER_CTX_set_params(OSSL_DECODER_CTX *ctx, + const OSSL_PARAM params[]); +void OSSL_DECODER_CTX_free(OSSL_DECODER_CTX *ctx); + +/* Utilities that help set specific parameters */ +int OSSL_DECODER_CTX_set_passphrase(OSSL_DECODER_CTX *ctx, + const unsigned char *kstr, size_t klen); +int OSSL_DECODER_CTX_set_pem_password_cb(OSSL_DECODER_CTX *ctx, + pem_password_cb *cb, void *cbarg); +int OSSL_DECODER_CTX_set_passphrase_cb(OSSL_DECODER_CTX *ctx, + OSSL_PASSPHRASE_CALLBACK *cb, + void *cbarg); +int OSSL_DECODER_CTX_set_passphrase_ui(OSSL_DECODER_CTX *ctx, + const UI_METHOD *ui_method, + void *ui_data); + +/* + * Utilities to read the object to decode, with the result sent to cb. + * These will discover all provided methods + */ + +int OSSL_DECODER_CTX_set_selection(OSSL_DECODER_CTX *ctx, int selection); +int OSSL_DECODER_CTX_set_input_type(OSSL_DECODER_CTX *ctx, + const char *input_type); +int OSSL_DECODER_CTX_set_input_structure(OSSL_DECODER_CTX *ctx, + const char *input_structure); +int OSSL_DECODER_CTX_add_decoder(OSSL_DECODER_CTX *ctx, OSSL_DECODER *decoder); +int OSSL_DECODER_CTX_add_extra(OSSL_DECODER_CTX *ctx, + OSSL_LIB_CTX *libctx, const char *propq); +int OSSL_DECODER_CTX_get_num_decoders(OSSL_DECODER_CTX *ctx); + +typedef struct ossl_decoder_instance_st OSSL_DECODER_INSTANCE; +OSSL_DECODER * +OSSL_DECODER_INSTANCE_get_decoder(OSSL_DECODER_INSTANCE *decoder_inst); +void * +OSSL_DECODER_INSTANCE_get_decoder_ctx(OSSL_DECODER_INSTANCE *decoder_inst); +const char * +OSSL_DECODER_INSTANCE_get_input_type(OSSL_DECODER_INSTANCE *decoder_inst); +const char * +OSSL_DECODER_INSTANCE_get_input_structure(OSSL_DECODER_INSTANCE *decoder_inst, + int *was_set); + +typedef int OSSL_DECODER_CONSTRUCT(OSSL_DECODER_INSTANCE *decoder_inst, + const OSSL_PARAM *params, + void *construct_data); +typedef void OSSL_DECODER_CLEANUP(void *construct_data); + +int OSSL_DECODER_CTX_set_construct(OSSL_DECODER_CTX *ctx, + OSSL_DECODER_CONSTRUCT *construct); +int OSSL_DECODER_CTX_set_construct_data(OSSL_DECODER_CTX *ctx, + void *construct_data); +int OSSL_DECODER_CTX_set_cleanup(OSSL_DECODER_CTX *ctx, + OSSL_DECODER_CLEANUP *cleanup); +OSSL_DECODER_CONSTRUCT *OSSL_DECODER_CTX_get_construct(OSSL_DECODER_CTX *ctx); +void *OSSL_DECODER_CTX_get_construct_data(OSSL_DECODER_CTX *ctx); +OSSL_DECODER_CLEANUP *OSSL_DECODER_CTX_get_cleanup(OSSL_DECODER_CTX *ctx); + +int OSSL_DECODER_export(OSSL_DECODER_INSTANCE *decoder_inst, + void *reference, size_t reference_sz, + OSSL_CALLBACK *export_cb, void *export_cbarg); + +int OSSL_DECODER_from_bio(OSSL_DECODER_CTX *ctx, BIO *in); +#ifndef OPENSSL_NO_STDIO +int OSSL_DECODER_from_fp(OSSL_DECODER_CTX *ctx, FILE *in); +#endif +int OSSL_DECODER_from_data(OSSL_DECODER_CTX *ctx, const unsigned char **pdata, + size_t *pdata_len); + +/* + * Create the OSSL_DECODER_CTX with an associated type. This will perform + * an implicit OSSL_DECODER_fetch(), suitable for the object of that type. + */ +OSSL_DECODER_CTX * +OSSL_DECODER_CTX_new_for_pkey(EVP_PKEY **pkey, + const char *input_type, + const char *input_struct, + const char *keytype, int selection, + OSSL_LIB_CTX *libctx, const char *propquery); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/decodererr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/decodererr.h new file mode 100644 index 0000000000000000000000000000000000000000..5fdeace4f971af74c4aa655819258934f01f7056 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/decodererr.h @@ -0,0 +1,26 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_DECODERERR_H +#define OPENSSL_DECODERERR_H +#pragma once + +#include +#include +#include + +/* + * OSSL_DECODER reason codes. + */ +#define OSSL_DECODER_R_COULD_NOT_DECODE_OBJECT 101 +#define OSSL_DECODER_R_DECODER_NOT_FOUND 102 +#define OSSL_DECODER_R_MISSING_GET_PARAMS 100 + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/des.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/des.h new file mode 100644 index 0000000000000000000000000000000000000000..daaef4e820b6c5d05efcf0be4c00ed73cbbd4f74 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/des.h @@ -0,0 +1,211 @@ +/* + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_DES_H +#define OPENSSL_DES_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_DES_H +#endif + +#include + +#ifndef OPENSSL_NO_DES +#ifdef __cplusplus +extern "C" { +#endif +#include + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +typedef unsigned int DES_LONG; + +#ifdef OPENSSL_BUILD_SHLIBCRYPTO +#undef OPENSSL_EXTERN +#define OPENSSL_EXTERN OPENSSL_EXPORT +#endif + +typedef unsigned char DES_cblock[8]; +typedef /* const */ unsigned char const_DES_cblock[8]; +/* + * With "const", gcc 2.8.1 on Solaris thinks that DES_cblock * and + * const_DES_cblock * are incompatible pointer types. + */ + +typedef struct DES_ks { + union { + DES_cblock cblock; + /* + * make sure things are correct size on machines with 8 byte longs + */ + DES_LONG deslong[2]; + } ks[16]; +} DES_key_schedule; + +#define DES_KEY_SZ (sizeof(DES_cblock)) +#define DES_SCHEDULE_SZ (sizeof(DES_key_schedule)) + +#define DES_ENCRYPT 1 +#define DES_DECRYPT 0 + +#define DES_CBC_MODE 0 +#define DES_PCBC_MODE 1 + +#define DES_ecb2_encrypt(i, o, k1, k2, e) \ + DES_ecb3_encrypt((i), (o), (k1), (k2), (k1), (e)) + +#define DES_ede2_cbc_encrypt(i, o, l, k1, k2, iv, e) \ + DES_ede3_cbc_encrypt((i), (o), (l), (k1), (k2), (k1), (iv), (e)) + +#define DES_ede2_cfb64_encrypt(i, o, l, k1, k2, iv, n, e) \ + DES_ede3_cfb64_encrypt((i), (o), (l), (k1), (k2), (k1), (iv), (n), (e)) + +#define DES_ede2_ofb64_encrypt(i, o, l, k1, k2, iv, n) \ + DES_ede3_ofb64_encrypt((i), (o), (l), (k1), (k2), (k1), (iv), (n)) + +#define DES_fixup_key_parity DES_set_odd_parity +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 const char *DES_options(void); +OSSL_DEPRECATEDIN_3_0 +void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output, + DES_key_schedule *ks1, DES_key_schedule *ks2, + DES_key_schedule *ks3, int enc); +OSSL_DEPRECATEDIN_3_0 +DES_LONG DES_cbc_cksum(const unsigned char *input, DES_cblock *output, + long length, DES_key_schedule *schedule, + const_DES_cblock *ivec); +#endif +/* DES_cbc_encrypt does not update the IV! Use DES_ncbc_encrypt instead. */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +void DES_cbc_encrypt(const unsigned char *input, unsigned char *output, + long length, DES_key_schedule *schedule, DES_cblock *ivec, + int enc); +OSSL_DEPRECATEDIN_3_0 +void DES_ncbc_encrypt(const unsigned char *input, unsigned char *output, + long length, DES_key_schedule *schedule, DES_cblock *ivec, + int enc); +OSSL_DEPRECATEDIN_3_0 +void DES_xcbc_encrypt(const unsigned char *input, unsigned char *output, + long length, DES_key_schedule *schedule, DES_cblock *ivec, + const_DES_cblock *inw, const_DES_cblock *outw, int enc); +OSSL_DEPRECATEDIN_3_0 +void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, + long length, DES_key_schedule *schedule, DES_cblock *ivec, + int enc); +OSSL_DEPRECATEDIN_3_0 +void DES_ecb_encrypt(const_DES_cblock *input, DES_cblock *output, + DES_key_schedule *ks, int enc); +#endif + +/* + * This is the DES encryption function that gets called by just about every + * other DES routine in the library. You should not use this function except + * to implement 'modes' of DES. I say this because the functions that call + * this routine do the conversion from 'char *' to long, and this needs to be + * done to make sure 'non-aligned' memory access do not occur. The + * characters are loaded 'little endian'. Data is a pointer to 2 unsigned + * long's and ks is the DES_key_schedule to use. enc, is non zero specifies + * encryption, zero if decryption. + */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc); +#endif + +/* + * This functions is the same as DES_encrypt1() except that the DES initial + * permutation (IP) and final permutation (FP) have been left out. As for + * DES_encrypt1(), you should not use this function. It is used by the + * routines in the library that implement triple DES. IP() DES_encrypt2() + * DES_encrypt2() DES_encrypt2() FP() is the same as DES_encrypt1() + * DES_encrypt1() DES_encrypt1() except faster :-). + */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +void DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc); +OSSL_DEPRECATEDIN_3_0 +void DES_encrypt3(DES_LONG *data, DES_key_schedule *ks1, DES_key_schedule *ks2, + DES_key_schedule *ks3); +OSSL_DEPRECATEDIN_3_0 +void DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1, DES_key_schedule *ks2, + DES_key_schedule *ks3); +OSSL_DEPRECATEDIN_3_0 +void DES_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output, + long length, DES_key_schedule *ks1, + DES_key_schedule *ks2, DES_key_schedule *ks3, + DES_cblock *ivec, int enc); +OSSL_DEPRECATEDIN_3_0 +void DES_ede3_cfb64_encrypt(const unsigned char *in, unsigned char *out, + long length, DES_key_schedule *ks1, + DES_key_schedule *ks2, DES_key_schedule *ks3, + DES_cblock *ivec, int *num, int enc); +OSSL_DEPRECATEDIN_3_0 +void DES_ede3_cfb_encrypt(const unsigned char *in, unsigned char *out, + int numbits, long length, DES_key_schedule *ks1, + DES_key_schedule *ks2, DES_key_schedule *ks3, + DES_cblock *ivec, int enc); +OSSL_DEPRECATEDIN_3_0 +void DES_ede3_ofb64_encrypt(const unsigned char *in, unsigned char *out, + long length, DES_key_schedule *ks1, + DES_key_schedule *ks2, DES_key_schedule *ks3, + DES_cblock *ivec, int *num); +OSSL_DEPRECATEDIN_3_0 +char *DES_fcrypt(const char *buf, const char *salt, char *ret); +OSSL_DEPRECATEDIN_3_0 +char *DES_crypt(const char *buf, const char *salt); +OSSL_DEPRECATEDIN_3_0 +void DES_ofb_encrypt(const unsigned char *in, unsigned char *out, int numbits, + long length, DES_key_schedule *schedule, DES_cblock *ivec); +OSSL_DEPRECATEDIN_3_0 +void DES_pcbc_encrypt(const unsigned char *input, unsigned char *output, + long length, DES_key_schedule *schedule, + DES_cblock *ivec, int enc); +OSSL_DEPRECATEDIN_3_0 +DES_LONG DES_quad_cksum(const unsigned char *input, DES_cblock output[], + long length, int out_count, DES_cblock *seed); +OSSL_DEPRECATEDIN_3_0 int DES_random_key(DES_cblock *ret); +OSSL_DEPRECATEDIN_3_0 void DES_set_odd_parity(DES_cblock *key); +OSSL_DEPRECATEDIN_3_0 int DES_check_key_parity(const_DES_cblock *key); +OSSL_DEPRECATEDIN_3_0 int DES_is_weak_key(const_DES_cblock *key); +#endif +/* + * DES_set_key (= set_key = DES_key_sched = key_sched) calls + * DES_set_key_checked + */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +int DES_set_key(const_DES_cblock *key, DES_key_schedule *schedule); +OSSL_DEPRECATEDIN_3_0 +int DES_key_sched(const_DES_cblock *key, DES_key_schedule *schedule); +OSSL_DEPRECATEDIN_3_0 +int DES_set_key_checked(const_DES_cblock *key, DES_key_schedule *schedule); +OSSL_DEPRECATEDIN_3_0 +void DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule); +OSSL_DEPRECATEDIN_3_0 void DES_string_to_key(const char *str, DES_cblock *key); +OSSL_DEPRECATEDIN_3_0 +void DES_string_to_2keys(const char *str, DES_cblock *key1, DES_cblock *key2); +OSSL_DEPRECATEDIN_3_0 +void DES_cfb64_encrypt(const unsigned char *in, unsigned char *out, + long length, DES_key_schedule *schedule, + DES_cblock *ivec, int *num, int enc); +OSSL_DEPRECATEDIN_3_0 +void DES_ofb64_encrypt(const unsigned char *in, unsigned char *out, + long length, DES_key_schedule *schedule, + DES_cblock *ivec, int *num); +#endif + +#ifdef __cplusplus +} +#endif +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/dh.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/dh.h new file mode 100644 index 0000000000000000000000000000000000000000..6d0abe2d217d2750ce988ca91a60131119629365 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/dh.h @@ -0,0 +1,333 @@ +/* + * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_DH_H +#define OPENSSL_DH_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_DH_H +#endif + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/* + * DH parameter generation types used by EVP_PKEY_CTX_set_dh_paramgen_type() + * Note that additions/changes to this set of values requires corresponding + * adjustments to range checks in dh_gen() + */ +#define DH_PARAMGEN_TYPE_GENERATOR 0 /* Use a safe prime generator */ +#define DH_PARAMGEN_TYPE_FIPS_186_2 1 /* Use FIPS186-2 standard */ +#define DH_PARAMGEN_TYPE_FIPS_186_4 2 /* Use FIPS186-4 standard */ +#define DH_PARAMGEN_TYPE_GROUP 3 /* Use a named safe prime group */ + +int EVP_PKEY_CTX_set_dh_paramgen_type(EVP_PKEY_CTX *ctx, int typ); +int EVP_PKEY_CTX_set_dh_paramgen_gindex(EVP_PKEY_CTX *ctx, int gindex); +int EVP_PKEY_CTX_set_dh_paramgen_seed(EVP_PKEY_CTX *ctx, + const unsigned char *seed, + size_t seedlen); +int EVP_PKEY_CTX_set_dh_paramgen_prime_len(EVP_PKEY_CTX *ctx, int pbits); +int EVP_PKEY_CTX_set_dh_paramgen_subprime_len(EVP_PKEY_CTX *ctx, int qlen); +int EVP_PKEY_CTX_set_dh_paramgen_generator(EVP_PKEY_CTX *ctx, int gen); +int EVP_PKEY_CTX_set_dh_nid(EVP_PKEY_CTX *ctx, int nid); +int EVP_PKEY_CTX_set_dh_rfc5114(EVP_PKEY_CTX *ctx, int gen); +int EVP_PKEY_CTX_set_dhx_rfc5114(EVP_PKEY_CTX *ctx, int gen); +int EVP_PKEY_CTX_set_dh_pad(EVP_PKEY_CTX *ctx, int pad); + +int EVP_PKEY_CTX_set_dh_kdf_type(EVP_PKEY_CTX *ctx, int kdf); +int EVP_PKEY_CTX_get_dh_kdf_type(EVP_PKEY_CTX *ctx); +int EVP_PKEY_CTX_set0_dh_kdf_oid(EVP_PKEY_CTX *ctx, ASN1_OBJECT *oid); +int EVP_PKEY_CTX_get0_dh_kdf_oid(EVP_PKEY_CTX *ctx, ASN1_OBJECT **oid); +int EVP_PKEY_CTX_set_dh_kdf_md(EVP_PKEY_CTX *ctx, const EVP_MD *md); +int EVP_PKEY_CTX_get_dh_kdf_md(EVP_PKEY_CTX *ctx, const EVP_MD **md); +int EVP_PKEY_CTX_set_dh_kdf_outlen(EVP_PKEY_CTX *ctx, int len); +int EVP_PKEY_CTX_get_dh_kdf_outlen(EVP_PKEY_CTX *ctx, int *len); +int EVP_PKEY_CTX_set0_dh_kdf_ukm(EVP_PKEY_CTX *ctx, unsigned char *ukm, int len); +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +int EVP_PKEY_CTX_get0_dh_kdf_ukm(EVP_PKEY_CTX *ctx, unsigned char **ukm); +#endif + +#define EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN (EVP_PKEY_ALG_CTRL + 1) +#define EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR (EVP_PKEY_ALG_CTRL + 2) +#define EVP_PKEY_CTRL_DH_RFC5114 (EVP_PKEY_ALG_CTRL + 3) +#define EVP_PKEY_CTRL_DH_PARAMGEN_SUBPRIME_LEN (EVP_PKEY_ALG_CTRL + 4) +#define EVP_PKEY_CTRL_DH_PARAMGEN_TYPE (EVP_PKEY_ALG_CTRL + 5) +#define EVP_PKEY_CTRL_DH_KDF_TYPE (EVP_PKEY_ALG_CTRL + 6) +#define EVP_PKEY_CTRL_DH_KDF_MD (EVP_PKEY_ALG_CTRL + 7) +#define EVP_PKEY_CTRL_GET_DH_KDF_MD (EVP_PKEY_ALG_CTRL + 8) +#define EVP_PKEY_CTRL_DH_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 9) +#define EVP_PKEY_CTRL_GET_DH_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 10) +#define EVP_PKEY_CTRL_DH_KDF_UKM (EVP_PKEY_ALG_CTRL + 11) +#define EVP_PKEY_CTRL_GET_DH_KDF_UKM (EVP_PKEY_ALG_CTRL + 12) +#define EVP_PKEY_CTRL_DH_KDF_OID (EVP_PKEY_ALG_CTRL + 13) +#define EVP_PKEY_CTRL_GET_DH_KDF_OID (EVP_PKEY_ALG_CTRL + 14) +#define EVP_PKEY_CTRL_DH_NID (EVP_PKEY_ALG_CTRL + 15) +#define EVP_PKEY_CTRL_DH_PAD (EVP_PKEY_ALG_CTRL + 16) + +/* KDF types */ +#define EVP_PKEY_DH_KDF_NONE 1 +#define EVP_PKEY_DH_KDF_X9_42 2 + +#ifndef OPENSSL_NO_STDIO +#include +#endif +#ifndef OPENSSL_NO_DH +#include +#include +#include +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#include +#endif +#include + +#ifndef OPENSSL_DH_MAX_MODULUS_BITS +#define OPENSSL_DH_MAX_MODULUS_BITS 10000 +#endif + +#ifndef OPENSSL_DH_CHECK_MAX_MODULUS_BITS +#define OPENSSL_DH_CHECK_MAX_MODULUS_BITS 32768 +#endif + +#define OPENSSL_DH_FIPS_MIN_MODULUS_BITS 1024 + +#define DH_FLAG_CACHE_MONT_P 0x01 + +#define DH_FLAG_TYPE_MASK 0xF000 +#define DH_FLAG_TYPE_DH 0x0000 +#define DH_FLAG_TYPE_DHX 0x1000 + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +/* + * Does nothing. Previously this switched off constant time behaviour. + */ +#define DH_FLAG_NO_EXP_CONSTTIME 0x00 +#endif + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +/* + * If this flag is set the DH method is FIPS compliant and can be used in + * FIPS mode. This is set in the validated module method. If an application + * sets this flag in its own methods it is its responsibility to ensure the + * result is compliant. + */ + +#define DH_FLAG_FIPS_METHOD 0x0400 + +/* + * If this flag is set the operations normally disabled in FIPS mode are + * permitted it is then the applications responsibility to ensure that the + * usage is compliant. + */ + +#define DH_FLAG_NON_FIPS_ALLOW 0x0400 +#endif + +/* Already defined in ossl_typ.h */ +/* typedef struct dh_st DH; */ +/* typedef struct dh_method DH_METHOD; */ + +DECLARE_ASN1_ITEM(DHparams) + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define DH_GENERATOR_2 2 +#define DH_GENERATOR_3 3 +#define DH_GENERATOR_5 5 + +/* DH_check error codes, some of them shared with DH_check_pub_key */ +/* + * NB: These values must align with the equivalently named macros in + * internal/ffc.h. + */ +#define DH_CHECK_P_NOT_PRIME 0x01 +#define DH_CHECK_P_NOT_SAFE_PRIME 0x02 +#define DH_UNABLE_TO_CHECK_GENERATOR 0x04 +#define DH_NOT_SUITABLE_GENERATOR 0x08 +#define DH_CHECK_Q_NOT_PRIME 0x10 +#define DH_CHECK_INVALID_Q_VALUE 0x20 /* +DH_check_pub_key */ +#define DH_CHECK_INVALID_J_VALUE 0x40 +#define DH_MODULUS_TOO_SMALL 0x80 +#define DH_MODULUS_TOO_LARGE 0x100 /* +DH_check_pub_key */ + +/* DH_check_pub_key error codes */ +#define DH_CHECK_PUBKEY_TOO_SMALL 0x01 +#define DH_CHECK_PUBKEY_TOO_LARGE 0x02 +#define DH_CHECK_PUBKEY_INVALID 0x04 + +/* + * primes p where (p-1)/2 is prime too are called "safe"; we define this for + * backward compatibility: + */ +#define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME + +#define d2i_DHparams_fp(fp, x) \ + (DH *)ASN1_d2i_fp((void *(*)(void))DH_new, \ + (d2i_of_void *)d2i_DHparams, \ + (fp), \ + (void **)(x)) +#define i2d_DHparams_fp(fp, x) \ + ASN1_i2d_fp(i2d_DHparams, (fp), (unsigned char *)(x)) +#define d2i_DHparams_bio(bp, x) \ + ASN1_d2i_bio_of(DH, DH_new, d2i_DHparams, bp, x) +#define i2d_DHparams_bio(bp, x) \ + ASN1_i2d_bio_of(DH, i2d_DHparams, bp, x) + +#define d2i_DHxparams_fp(fp, x) \ + (DH *)ASN1_d2i_fp((void *(*)(void))DH_new, \ + (d2i_of_void *)d2i_DHxparams, \ + (fp), \ + (void **)(x)) +#define i2d_DHxparams_fp(fp, x) \ + ASN1_i2d_fp(i2d_DHxparams, (fp), (unsigned char *)(x)) +#define d2i_DHxparams_bio(bp, x) \ + ASN1_d2i_bio_of(DH, DH_new, d2i_DHxparams, bp, x) +#define i2d_DHxparams_bio(bp, x) \ + ASN1_i2d_bio_of(DH, i2d_DHxparams, bp, x) + +DECLARE_ASN1_DUP_FUNCTION_name_attr(OSSL_DEPRECATEDIN_3_0, DH, DHparams) + +OSSL_DEPRECATEDIN_3_0 const DH_METHOD *DH_OpenSSL(void); + +OSSL_DEPRECATEDIN_3_0 void DH_set_default_method(const DH_METHOD *meth); +OSSL_DEPRECATEDIN_3_0 const DH_METHOD *DH_get_default_method(void); +OSSL_DEPRECATEDIN_3_0 int DH_set_method(DH *dh, const DH_METHOD *meth); +OSSL_DEPRECATEDIN_3_0 DH *DH_new_method(ENGINE *engine); + +OSSL_DEPRECATEDIN_3_0 DH *DH_new(void); +OSSL_DEPRECATEDIN_3_0 void DH_free(DH *dh); +OSSL_DEPRECATEDIN_3_0 int DH_up_ref(DH *dh); +OSSL_DEPRECATEDIN_3_0 int DH_bits(const DH *dh); +OSSL_DEPRECATEDIN_3_0 int DH_size(const DH *dh); +OSSL_DEPRECATEDIN_3_0 int DH_security_bits(const DH *dh); + +#define DH_get_ex_new_index(l, p, newf, dupf, freef) \ + CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_DH, l, p, newf, dupf, freef) + +OSSL_DEPRECATEDIN_3_0 int DH_set_ex_data(DH *d, int idx, void *arg); +OSSL_DEPRECATEDIN_3_0 void *DH_get_ex_data(const DH *d, int idx); + +OSSL_DEPRECATEDIN_3_0 int DH_generate_parameters_ex(DH *dh, int prime_len, + int generator, + BN_GENCB *cb); + +OSSL_DEPRECATEDIN_3_0 int DH_check_params_ex(const DH *dh); +OSSL_DEPRECATEDIN_3_0 int DH_check_ex(const DH *dh); +OSSL_DEPRECATEDIN_3_0 int DH_check_pub_key_ex(const DH *dh, const BIGNUM *pub_key); +OSSL_DEPRECATEDIN_3_0 int DH_check_params(const DH *dh, int *ret); +OSSL_DEPRECATEDIN_3_0 int DH_check(const DH *dh, int *codes); +OSSL_DEPRECATEDIN_3_0 int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, + int *codes); +OSSL_DEPRECATEDIN_3_0 int DH_generate_key(DH *dh); +OSSL_DEPRECATEDIN_3_0 int DH_compute_key(unsigned char *key, + const BIGNUM *pub_key, DH *dh); +OSSL_DEPRECATEDIN_3_0 int DH_compute_key_padded(unsigned char *key, + const BIGNUM *pub_key, DH *dh); + +DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0, DH, DHparams) +DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0, DH, DHxparams) + +#ifndef OPENSSL_NO_STDIO +OSSL_DEPRECATEDIN_3_0 int DHparams_print_fp(FILE *fp, const DH *x); +#endif +OSSL_DEPRECATEDIN_3_0 int DHparams_print(BIO *bp, const DH *x); + +/* RFC 5114 parameters */ +OSSL_DEPRECATEDIN_3_0 DH *DH_get_1024_160(void); +OSSL_DEPRECATEDIN_3_0 DH *DH_get_2048_224(void); +OSSL_DEPRECATEDIN_3_0 DH *DH_get_2048_256(void); + +/* Named parameters, currently RFC7919 and RFC3526 */ +OSSL_DEPRECATEDIN_3_0 DH *DH_new_by_nid(int nid); +OSSL_DEPRECATEDIN_3_0 int DH_get_nid(const DH *dh); + +/* RFC2631 KDF */ +OSSL_DEPRECATEDIN_3_0 int DH_KDF_X9_42(unsigned char *out, size_t outlen, + const unsigned char *Z, size_t Zlen, + ASN1_OBJECT *key_oid, + const unsigned char *ukm, + size_t ukmlen, const EVP_MD *md); + +OSSL_DEPRECATEDIN_3_0 void DH_get0_pqg(const DH *dh, const BIGNUM **p, + const BIGNUM **q, const BIGNUM **g); +OSSL_DEPRECATEDIN_3_0 int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g); +OSSL_DEPRECATEDIN_3_0 void DH_get0_key(const DH *dh, const BIGNUM **pub_key, + const BIGNUM **priv_key); +OSSL_DEPRECATEDIN_3_0 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key); +OSSL_DEPRECATEDIN_3_0 const BIGNUM *DH_get0_p(const DH *dh); +OSSL_DEPRECATEDIN_3_0 const BIGNUM *DH_get0_q(const DH *dh); +OSSL_DEPRECATEDIN_3_0 const BIGNUM *DH_get0_g(const DH *dh); +OSSL_DEPRECATEDIN_3_0 const BIGNUM *DH_get0_priv_key(const DH *dh); +OSSL_DEPRECATEDIN_3_0 const BIGNUM *DH_get0_pub_key(const DH *dh); +OSSL_DEPRECATEDIN_3_0 void DH_clear_flags(DH *dh, int flags); +OSSL_DEPRECATEDIN_3_0 int DH_test_flags(const DH *dh, int flags); +OSSL_DEPRECATEDIN_3_0 void DH_set_flags(DH *dh, int flags); +OSSL_DEPRECATEDIN_3_0 ENGINE *DH_get0_engine(DH *d); +OSSL_DEPRECATEDIN_3_0 long DH_get_length(const DH *dh); +OSSL_DEPRECATEDIN_3_0 int DH_set_length(DH *dh, long length); + +OSSL_DEPRECATEDIN_3_0 DH_METHOD *DH_meth_new(const char *name, int flags); +OSSL_DEPRECATEDIN_3_0 void DH_meth_free(DH_METHOD *dhm); +OSSL_DEPRECATEDIN_3_0 DH_METHOD *DH_meth_dup(const DH_METHOD *dhm); +OSSL_DEPRECATEDIN_3_0 const char *DH_meth_get0_name(const DH_METHOD *dhm); +OSSL_DEPRECATEDIN_3_0 int DH_meth_set1_name(DH_METHOD *dhm, const char *name); +OSSL_DEPRECATEDIN_3_0 int DH_meth_get_flags(const DH_METHOD *dhm); +OSSL_DEPRECATEDIN_3_0 int DH_meth_set_flags(DH_METHOD *dhm, int flags); +OSSL_DEPRECATEDIN_3_0 void *DH_meth_get0_app_data(const DH_METHOD *dhm); +OSSL_DEPRECATEDIN_3_0 int DH_meth_set0_app_data(DH_METHOD *dhm, void *app_data); +OSSL_DEPRECATEDIN_3_0 int (*DH_meth_get_generate_key(const DH_METHOD *dhm))(DH *); +OSSL_DEPRECATEDIN_3_0 int DH_meth_set_generate_key(DH_METHOD *dhm, + int (*generate_key)(DH *)); +OSSL_DEPRECATEDIN_3_0 int (*DH_meth_get_compute_key(const DH_METHOD *dhm))(unsigned char *key, + const BIGNUM *pub_key, + DH *dh); +OSSL_DEPRECATEDIN_3_0 int DH_meth_set_compute_key(DH_METHOD *dhm, + int (*compute_key)(unsigned char *key, + const BIGNUM *pub_key, + DH *dh)); +OSSL_DEPRECATEDIN_3_0 int (*DH_meth_get_bn_mod_exp(const DH_METHOD *dhm))(const DH *, BIGNUM *, + const BIGNUM *, + const BIGNUM *, + const BIGNUM *, BN_CTX *, + BN_MONT_CTX *); +OSSL_DEPRECATEDIN_3_0 int DH_meth_set_bn_mod_exp(DH_METHOD *dhm, + int (*bn_mod_exp)(const DH *, BIGNUM *, + const BIGNUM *, const BIGNUM *, + const BIGNUM *, BN_CTX *, + BN_MONT_CTX *)); +OSSL_DEPRECATEDIN_3_0 int (*DH_meth_get_init(const DH_METHOD *dhm))(DH *); +OSSL_DEPRECATEDIN_3_0 int DH_meth_set_init(DH_METHOD *dhm, int (*init)(DH *)); +OSSL_DEPRECATEDIN_3_0 int (*DH_meth_get_finish(const DH_METHOD *dhm))(DH *); +OSSL_DEPRECATEDIN_3_0 int DH_meth_set_finish(DH_METHOD *dhm, int (*finish)(DH *)); +OSSL_DEPRECATEDIN_3_0 int (*DH_meth_get_generate_params(const DH_METHOD *dhm))(DH *, int, int, + BN_GENCB *); +OSSL_DEPRECATEDIN_3_0 int DH_meth_set_generate_params(DH_METHOD *dhm, + int (*generate_params)(DH *, int, int, + BN_GENCB *)); +#endif /* OPENSSL_NO_DEPRECATED_3_0 */ + +#ifndef OPENSSL_NO_DEPRECATED_0_9_8 +OSSL_DEPRECATEDIN_0_9_8 DH *DH_generate_parameters(int prime_len, int generator, + void (*callback)(int, int, + void *), + void *cb_arg); +#endif + +#endif +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/dherr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/dherr.h new file mode 100644 index 0000000000000000000000000000000000000000..753659be16f823a49e8f03f7db1cd3773d832987 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/dherr.h @@ -0,0 +1,57 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_DHERR_H +#define OPENSSL_DHERR_H +#pragma once + +#include +#include +#include + +#ifndef OPENSSL_NO_DH + +/* + * DH reason codes. + */ +#define DH_R_BAD_FFC_PARAMETERS 127 +#define DH_R_BAD_GENERATOR 101 +#define DH_R_BN_DECODE_ERROR 109 +#define DH_R_BN_ERROR 106 +#define DH_R_CHECK_INVALID_J_VALUE 115 +#define DH_R_CHECK_INVALID_Q_VALUE 116 +#define DH_R_CHECK_PUBKEY_INVALID 122 +#define DH_R_CHECK_PUBKEY_TOO_LARGE 123 +#define DH_R_CHECK_PUBKEY_TOO_SMALL 124 +#define DH_R_CHECK_P_NOT_PRIME 117 +#define DH_R_CHECK_P_NOT_SAFE_PRIME 118 +#define DH_R_CHECK_Q_NOT_PRIME 119 +#define DH_R_DECODE_ERROR 104 +#define DH_R_INVALID_PARAMETER_NAME 110 +#define DH_R_INVALID_PARAMETER_NID 114 +#define DH_R_INVALID_PUBKEY 102 +#define DH_R_INVALID_SECRET 128 +#define DH_R_INVALID_SIZE 129 +#define DH_R_KDF_PARAMETER_ERROR 112 +#define DH_R_KEYS_NOT_SET 108 +#define DH_R_MISSING_PUBKEY 125 +#define DH_R_MODULUS_TOO_LARGE 103 +#define DH_R_MODULUS_TOO_SMALL 126 +#define DH_R_NOT_SUITABLE_GENERATOR 120 +#define DH_R_NO_PARAMETERS_SET 107 +#define DH_R_NO_PRIVATE_VALUE 100 +#define DH_R_PARAMETER_ENCODING_ERROR 105 +#define DH_R_PEER_KEY_ERROR 111 +#define DH_R_Q_TOO_LARGE 130 +#define DH_R_SHARED_INFO_ERROR 113 +#define DH_R_UNABLE_TO_CHECK_GENERATOR 121 + +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/dsa.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/dsa.h new file mode 100644 index 0000000000000000000000000000000000000000..61baa64bee7e9ffbef7ce5f8bdbb70c284012776 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/dsa.h @@ -0,0 +1,273 @@ +/* + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_DSA_H +#define OPENSSL_DSA_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_DSA_H +#endif + +#include +#include + +#include + +#ifndef OPENSSL_NO_DSA +#include +#include +#include +#include +#include +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#include +#endif +#include +#ifndef OPENSSL_NO_STDIO +#include +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +int EVP_PKEY_CTX_set_dsa_paramgen_bits(EVP_PKEY_CTX *ctx, int nbits); +int EVP_PKEY_CTX_set_dsa_paramgen_q_bits(EVP_PKEY_CTX *ctx, int qbits); +int EVP_PKEY_CTX_set_dsa_paramgen_md_props(EVP_PKEY_CTX *ctx, + const char *md_name, + const char *md_properties); +int EVP_PKEY_CTX_set_dsa_paramgen_gindex(EVP_PKEY_CTX *ctx, int gindex); +int EVP_PKEY_CTX_set_dsa_paramgen_type(EVP_PKEY_CTX *ctx, const char *name); +int EVP_PKEY_CTX_set_dsa_paramgen_seed(EVP_PKEY_CTX *ctx, + const unsigned char *seed, + size_t seedlen); +int EVP_PKEY_CTX_set_dsa_paramgen_md(EVP_PKEY_CTX *ctx, const EVP_MD *md); + +#define EVP_PKEY_CTRL_DSA_PARAMGEN_BITS (EVP_PKEY_ALG_CTRL + 1) +#define EVP_PKEY_CTRL_DSA_PARAMGEN_Q_BITS (EVP_PKEY_ALG_CTRL + 2) +#define EVP_PKEY_CTRL_DSA_PARAMGEN_MD (EVP_PKEY_ALG_CTRL + 3) + +#ifndef OPENSSL_NO_DSA +#ifndef OPENSSL_DSA_MAX_MODULUS_BITS +#define OPENSSL_DSA_MAX_MODULUS_BITS 10000 +#endif + +#define OPENSSL_DSA_FIPS_MIN_MODULUS_BITS 1024 + +typedef struct DSA_SIG_st DSA_SIG; +DSA_SIG *DSA_SIG_new(void); +void DSA_SIG_free(DSA_SIG *a); +DECLARE_ASN1_ENCODE_FUNCTIONS_only(DSA_SIG, DSA_SIG) +void DSA_SIG_get0(const DSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps); +int DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s); + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +/* + * Does nothing. Previously this switched off constant time behaviour. + */ +#define DSA_FLAG_NO_EXP_CONSTTIME 0x00 +#endif + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define DSA_FLAG_CACHE_MONT_P 0x01 + +/* + * If this flag is set the DSA method is FIPS compliant and can be used in + * FIPS mode. This is set in the validated module method. If an application + * sets this flag in its own methods it is its responsibility to ensure the + * result is compliant. + */ + +#define DSA_FLAG_FIPS_METHOD 0x0400 + +/* + * If this flag is set the operations normally disabled in FIPS mode are + * permitted it is then the applications responsibility to ensure that the + * usage is compliant. + */ + +#define DSA_FLAG_NON_FIPS_ALLOW 0x0400 +#define DSA_FLAG_FIPS_CHECKED 0x0800 + +/* Already defined in ossl_typ.h */ +/* typedef struct dsa_st DSA; */ +/* typedef struct dsa_method DSA_METHOD; */ + +#define d2i_DSAparams_fp(fp, x) \ + (DSA *)ASN1_d2i_fp((void *(*)(void))DSA_new, \ + (d2i_of_void *)d2i_DSAparams, (fp), \ + (void **)(x)) +#define i2d_DSAparams_fp(fp, x) \ + ASN1_i2d_fp(i2d_DSAparams, (fp), (unsigned char *)(x)) +#define d2i_DSAparams_bio(bp, x) \ + ASN1_d2i_bio_of(DSA, DSA_new, d2i_DSAparams, bp, x) +#define i2d_DSAparams_bio(bp, x) \ + ASN1_i2d_bio_of(DSA, i2d_DSAparams, bp, x) + +DECLARE_ASN1_DUP_FUNCTION_name_attr(OSSL_DEPRECATEDIN_3_0, DSA, DSAparams) +OSSL_DEPRECATEDIN_3_0 DSA_SIG *DSA_do_sign(const unsigned char *dgst, int dlen, + DSA *dsa); +OSSL_DEPRECATEDIN_3_0 int DSA_do_verify(const unsigned char *dgst, int dgst_len, + DSA_SIG *sig, DSA *dsa); + +OSSL_DEPRECATEDIN_3_0 const DSA_METHOD *DSA_OpenSSL(void); + +OSSL_DEPRECATEDIN_3_0 void DSA_set_default_method(const DSA_METHOD *); +OSSL_DEPRECATEDIN_3_0 const DSA_METHOD *DSA_get_default_method(void); +OSSL_DEPRECATEDIN_3_0 int DSA_set_method(DSA *dsa, const DSA_METHOD *); +OSSL_DEPRECATEDIN_3_0 const DSA_METHOD *DSA_get_method(DSA *d); + +OSSL_DEPRECATEDIN_3_0 DSA *DSA_new(void); +OSSL_DEPRECATEDIN_3_0 DSA *DSA_new_method(ENGINE *engine); +OSSL_DEPRECATEDIN_3_0 void DSA_free(DSA *r); +/* "up" the DSA object's reference count */ +OSSL_DEPRECATEDIN_3_0 int DSA_up_ref(DSA *r); +OSSL_DEPRECATEDIN_3_0 int DSA_size(const DSA *); +OSSL_DEPRECATEDIN_3_0 int DSA_bits(const DSA *d); +OSSL_DEPRECATEDIN_3_0 int DSA_security_bits(const DSA *d); +/* next 4 return -1 on error */ +OSSL_DEPRECATEDIN_3_0 int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, + BIGNUM **kinvp, BIGNUM **rp); +OSSL_DEPRECATEDIN_3_0 int DSA_sign(int type, const unsigned char *dgst, + int dlen, unsigned char *sig, + unsigned int *siglen, DSA *dsa); +OSSL_DEPRECATEDIN_3_0 int DSA_verify(int type, const unsigned char *dgst, + int dgst_len, const unsigned char *sigbuf, + int siglen, DSA *dsa); + +#define DSA_get_ex_new_index(l, p, newf, dupf, freef) \ + CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_DSA, l, p, newf, dupf, freef) +OSSL_DEPRECATEDIN_3_0 int DSA_set_ex_data(DSA *d, int idx, void *arg); +OSSL_DEPRECATEDIN_3_0 void *DSA_get_ex_data(const DSA *d, int idx); + +DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0, + DSA, DSAPublicKey) +DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0, + DSA, DSAPrivateKey) +DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0, + DSA, DSAparams) +#endif + +#ifndef OPENSSL_NO_DEPRECATED_0_9_8 +/* Deprecated version */ +OSSL_DEPRECATEDIN_0_9_8 +DSA *DSA_generate_parameters(int bits, unsigned char *seed, int seed_len, + int *counter_ret, unsigned long *h_ret, + void (*callback)(int, int, void *), + void *cb_arg); +#endif + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +/* New version */ +OSSL_DEPRECATEDIN_3_0 int DSA_generate_parameters_ex(DSA *dsa, int bits, + const unsigned char *seed, + int seed_len, + int *counter_ret, + unsigned long *h_ret, + BN_GENCB *cb); + +OSSL_DEPRECATEDIN_3_0 int DSA_generate_key(DSA *a); + +OSSL_DEPRECATEDIN_3_0 int DSAparams_print(BIO *bp, const DSA *x); +OSSL_DEPRECATEDIN_3_0 int DSA_print(BIO *bp, const DSA *x, int off); +#ifndef OPENSSL_NO_STDIO +OSSL_DEPRECATEDIN_3_0 int DSAparams_print_fp(FILE *fp, const DSA *x); +OSSL_DEPRECATEDIN_3_0 int DSA_print_fp(FILE *bp, const DSA *x, int off); +#endif + +#define DSS_prime_checks 64 +/* + * Primality test according to FIPS PUB 186-4, Appendix C.3. Since we only + * have one value here we set the number of checks to 64 which is the 128 bit + * security level that is the highest level and valid for creating a 3072 bit + * DSA key. + */ +#define DSA_is_prime(n, callback, cb_arg) \ + BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg) + +#ifndef OPENSSL_NO_DH +/* + * Convert DSA structure (key or just parameters) into DH structure (be + * careful to avoid small subgroup attacks when using this!) + */ +OSSL_DEPRECATEDIN_3_0 DH *DSA_dup_DH(const DSA *r); +#endif + +OSSL_DEPRECATEDIN_3_0 void DSA_get0_pqg(const DSA *d, const BIGNUM **p, + const BIGNUM **q, const BIGNUM **g); +OSSL_DEPRECATEDIN_3_0 int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g); +OSSL_DEPRECATEDIN_3_0 void DSA_get0_key(const DSA *d, const BIGNUM **pub_key, + const BIGNUM **priv_key); +OSSL_DEPRECATEDIN_3_0 int DSA_set0_key(DSA *d, BIGNUM *pub_key, + BIGNUM *priv_key); +OSSL_DEPRECATEDIN_3_0 const BIGNUM *DSA_get0_p(const DSA *d); +OSSL_DEPRECATEDIN_3_0 const BIGNUM *DSA_get0_q(const DSA *d); +OSSL_DEPRECATEDIN_3_0 const BIGNUM *DSA_get0_g(const DSA *d); +OSSL_DEPRECATEDIN_3_0 const BIGNUM *DSA_get0_pub_key(const DSA *d); +OSSL_DEPRECATEDIN_3_0 const BIGNUM *DSA_get0_priv_key(const DSA *d); +OSSL_DEPRECATEDIN_3_0 void DSA_clear_flags(DSA *d, int flags); +OSSL_DEPRECATEDIN_3_0 int DSA_test_flags(const DSA *d, int flags); +OSSL_DEPRECATEDIN_3_0 void DSA_set_flags(DSA *d, int flags); +OSSL_DEPRECATEDIN_3_0 ENGINE *DSA_get0_engine(DSA *d); + +OSSL_DEPRECATEDIN_3_0 DSA_METHOD *DSA_meth_new(const char *name, int flags); +OSSL_DEPRECATEDIN_3_0 void DSA_meth_free(DSA_METHOD *dsam); +OSSL_DEPRECATEDIN_3_0 DSA_METHOD *DSA_meth_dup(const DSA_METHOD *dsam); +OSSL_DEPRECATEDIN_3_0 const char *DSA_meth_get0_name(const DSA_METHOD *dsam); +OSSL_DEPRECATEDIN_3_0 int DSA_meth_set1_name(DSA_METHOD *dsam, + const char *name); +OSSL_DEPRECATEDIN_3_0 int DSA_meth_get_flags(const DSA_METHOD *dsam); +OSSL_DEPRECATEDIN_3_0 int DSA_meth_set_flags(DSA_METHOD *dsam, int flags); +OSSL_DEPRECATEDIN_3_0 void *DSA_meth_get0_app_data(const DSA_METHOD *dsam); +OSSL_DEPRECATEDIN_3_0 int DSA_meth_set0_app_data(DSA_METHOD *dsam, + void *app_data); +OSSL_DEPRECATEDIN_3_0 DSA_SIG *(*DSA_meth_get_sign(const DSA_METHOD *dsam))(const unsigned char *, int, DSA *); +OSSL_DEPRECATEDIN_3_0 int DSA_meth_set_sign(DSA_METHOD *dsam, + DSA_SIG *(*sign)(const unsigned char *, int, DSA *)); +OSSL_DEPRECATEDIN_3_0 int (*DSA_meth_get_sign_setup(const DSA_METHOD *dsam))(DSA *, BN_CTX *, BIGNUM **, BIGNUM **); +OSSL_DEPRECATEDIN_3_0 int DSA_meth_set_sign_setup(DSA_METHOD *dsam, + int (*sign_setup)(DSA *, BN_CTX *, BIGNUM **, BIGNUM **)); +OSSL_DEPRECATEDIN_3_0 int (*DSA_meth_get_verify(const DSA_METHOD *dsam))(const unsigned char *, int, DSA_SIG *, DSA *); +OSSL_DEPRECATEDIN_3_0 int DSA_meth_set_verify(DSA_METHOD *dsam, + int (*verify)(const unsigned char *, int, DSA_SIG *, DSA *)); +OSSL_DEPRECATEDIN_3_0 int (*DSA_meth_get_mod_exp(const DSA_METHOD *dsam))(DSA *, BIGNUM *, const BIGNUM *, const BIGNUM *, const BIGNUM *, + const BIGNUM *, const BIGNUM *, BN_CTX *, BN_MONT_CTX *); +OSSL_DEPRECATEDIN_3_0 int DSA_meth_set_mod_exp(DSA_METHOD *dsam, + int (*mod_exp)(DSA *, BIGNUM *, const BIGNUM *, const BIGNUM *, + const BIGNUM *, const BIGNUM *, const BIGNUM *, BN_CTX *, + BN_MONT_CTX *)); +OSSL_DEPRECATEDIN_3_0 int (*DSA_meth_get_bn_mod_exp(const DSA_METHOD *dsam))(DSA *, BIGNUM *, const BIGNUM *, const BIGNUM *, const BIGNUM *, + BN_CTX *, BN_MONT_CTX *); +OSSL_DEPRECATEDIN_3_0 int DSA_meth_set_bn_mod_exp(DSA_METHOD *dsam, + int (*bn_mod_exp)(DSA *, BIGNUM *, const BIGNUM *, const BIGNUM *, + const BIGNUM *, BN_CTX *, BN_MONT_CTX *)); +OSSL_DEPRECATEDIN_3_0 int (*DSA_meth_get_init(const DSA_METHOD *dsam))(DSA *); +OSSL_DEPRECATEDIN_3_0 int DSA_meth_set_init(DSA_METHOD *dsam, + int (*init)(DSA *)); +OSSL_DEPRECATEDIN_3_0 int (*DSA_meth_get_finish(const DSA_METHOD *dsam))(DSA *); +OSSL_DEPRECATEDIN_3_0 int DSA_meth_set_finish(DSA_METHOD *dsam, + int (*finish)(DSA *)); +OSSL_DEPRECATEDIN_3_0 int (*DSA_meth_get_paramgen(const DSA_METHOD *dsam))(DSA *, int, const unsigned char *, int, int *, unsigned long *, + BN_GENCB *); +OSSL_DEPRECATEDIN_3_0 int DSA_meth_set_paramgen(DSA_METHOD *dsam, + int (*paramgen)(DSA *, int, const unsigned char *, int, int *, + unsigned long *, BN_GENCB *)); +OSSL_DEPRECATEDIN_3_0 int (*DSA_meth_get_keygen(const DSA_METHOD *dsam))(DSA *); +OSSL_DEPRECATEDIN_3_0 int DSA_meth_set_keygen(DSA_METHOD *dsam, + int (*keygen)(DSA *)); + +#endif +#endif +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/dsaerr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/dsaerr.h new file mode 100644 index 0000000000000000000000000000000000000000..cc5f4bfbb7c3ac6807f9957ec055ca594676bba3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/dsaerr.h @@ -0,0 +1,42 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_DSAERR_H +#define OPENSSL_DSAERR_H +#pragma once + +#include +#include +#include + +#ifndef OPENSSL_NO_DSA + +/* + * DSA reason codes. + */ +#define DSA_R_BAD_FFC_PARAMETERS 114 +#define DSA_R_BAD_Q_VALUE 102 +#define DSA_R_BN_DECODE_ERROR 108 +#define DSA_R_BN_ERROR 109 +#define DSA_R_DECODE_ERROR 104 +#define DSA_R_INVALID_DIGEST_TYPE 106 +#define DSA_R_INVALID_PARAMETERS 112 +#define DSA_R_MISSING_PARAMETERS 101 +#define DSA_R_MISSING_PRIVATE_KEY 111 +#define DSA_R_MODULUS_TOO_LARGE 103 +#define DSA_R_NO_PARAMETERS_SET 107 +#define DSA_R_PARAMETER_ENCODING_ERROR 105 +#define DSA_R_P_NOT_PRIME 115 +#define DSA_R_Q_NOT_PRIME 113 +#define DSA_R_SEED_LEN_SMALL 110 +#define DSA_R_TOO_MANY_RETRIES 116 + +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/dtls1.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/dtls1.h new file mode 100644 index 0000000000000000000000000000000000000000..0b42948d02d8cbc089a70bc82e479d46dc3618f2 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/dtls1.h @@ -0,0 +1,57 @@ +/* + * Copyright 2005-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_DTLS1_H +#define OPENSSL_DTLS1_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_DTLS1_H +#endif + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/* DTLS*_VERSION constants are defined in prov_ssl.h */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define DTLS_MIN_VERSION DTLS1_VERSION +#define DTLS_MAX_VERSION DTLS1_2_VERSION +#endif +#define DTLS1_VERSION_MAJOR 0xFE + +/* Special value for method supporting multiple versions */ +#define DTLS_ANY_VERSION 0x1FFFF + +/* lengths of messages */ + +#define DTLS1_COOKIE_LENGTH 255 + +#define DTLS1_RT_HEADER_LENGTH 13 + +#define DTLS1_HM_HEADER_LENGTH 12 + +#define DTLS1_HM_BAD_FRAGMENT -2 +#define DTLS1_HM_FRAGMENT_RETRY -3 + +#define DTLS1_CCS_HEADER_LENGTH 1 + +#define DTLS1_AL_HEADER_LENGTH 2 + +#define DTLS1_TMO_ALERT_COUNT 12 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/e_os2.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/e_os2.h new file mode 100644 index 0000000000000000000000000000000000000000..86a572bb12e3f40df82c490d01176fc04236909c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/e_os2.h @@ -0,0 +1,306 @@ +/* + * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_E_OS2_H +#define OPENSSL_E_OS2_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_E_OS2_H +#endif + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/****************************************************************************** + * Detect operating systems. This probably needs completing. + * The result is that at least one OPENSSL_SYS_os macro should be defined. + * However, if none is defined, Unix is assumed. + **/ + +#define OPENSSL_SYS_UNIX + +/* --------------------- Microsoft operating systems ---------------------- */ + +/* + * Note that MSDOS actually denotes 32-bit environments running on top of + * MS-DOS, such as DJGPP one. + */ +#if defined(OPENSSL_SYS_MSDOS) +#undef OPENSSL_SYS_UNIX +#endif + +/* + * For 32 bit environment, there seems to be the CygWin environment and then + * all the others that try to do the same thing Microsoft does... + */ +/* + * UEFI lives here because it might be built with a Microsoft toolchain and + * we need to avoid the false positive match on Windows. + */ +#if defined(OPENSSL_SYS_UEFI) +#undef OPENSSL_SYS_UNIX +#elif defined(OPENSSL_SYS_UWIN) +#undef OPENSSL_SYS_UNIX +#define OPENSSL_SYS_WIN32_UWIN +#else +#if defined(__CYGWIN__) || defined(OPENSSL_SYS_CYGWIN) +#define OPENSSL_SYS_WIN32_CYGWIN +#else +#if defined(_WIN32) || defined(OPENSSL_SYS_WIN32) +#undef OPENSSL_SYS_UNIX +#if !defined(OPENSSL_SYS_WIN32) +#define OPENSSL_SYS_WIN32 +#endif +#endif +#if defined(_WIN64) || defined(OPENSSL_SYS_WIN64) +#undef OPENSSL_SYS_UNIX +#if !defined(OPENSSL_SYS_WIN64) +#define OPENSSL_SYS_WIN64 +#endif +#endif +#if defined(OPENSSL_SYS_WINNT) +#undef OPENSSL_SYS_UNIX +#endif +#if defined(OPENSSL_SYS_WINCE) +#undef OPENSSL_SYS_UNIX +#endif +#endif +#endif + +/* Anything that tries to look like Microsoft is "Windows" */ +#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN64) || defined(OPENSSL_SYS_WINNT) || defined(OPENSSL_SYS_WINCE) +#undef OPENSSL_SYS_UNIX +#define OPENSSL_SYS_WINDOWS +#ifndef OPENSSL_SYS_MSDOS +#define OPENSSL_SYS_MSDOS +#endif +#endif + +/* + * DLL settings. This part is a bit tough, because it's up to the + * application implementer how he or she will link the application, so it + * requires some macro to be used. + */ +#ifdef OPENSSL_SYS_WINDOWS +#ifndef OPENSSL_OPT_WINDLL +#if defined(_WINDLL) /* This is used when building OpenSSL to \ + * indicate that DLL linkage should be used */ +#define OPENSSL_OPT_WINDLL +#endif +#endif +#endif + +/* ------------------------------- OpenVMS -------------------------------- */ +#if defined(__VMS) || defined(VMS) +#if !defined(OPENSSL_SYS_VMS) +#undef OPENSSL_SYS_UNIX +#define OPENSSL_SYS_VMS +#endif +#if defined(__DECC) +#define OPENSSL_SYS_VMS_DECC +#elif defined(__DECCXX) +#define OPENSSL_SYS_VMS_DECC +#define OPENSSL_SYS_VMS_DECCXX +#else +#define OPENSSL_SYS_VMS_NODECC +#endif +#endif + +/* -------------------------------- Unix ---------------------------------- */ +#ifdef OPENSSL_SYS_UNIX +#if defined(linux) || defined(__linux__) && !defined(OPENSSL_SYS_LINUX) +#define OPENSSL_SYS_LINUX +#endif +#if defined(_AIX) && !defined(OPENSSL_SYS_AIX) +#define OPENSSL_SYS_AIX +#endif +#endif + +/* -------------------------------- VOS ----------------------------------- */ +#if defined(__VOS__) && !defined(OPENSSL_SYS_VOS) +#define OPENSSL_SYS_VOS +#ifdef __HPPA__ +#define OPENSSL_SYS_VOS_HPPA +#endif +#ifdef __IA32__ +#define OPENSSL_SYS_VOS_IA32 +#endif +#endif + +/* ---------------------------- HP NonStop -------------------------------- */ +#ifdef __TANDEM +#ifdef _STRING +#include +#endif +#define OPENSSL_USE_BUILD_DATE +#if defined(OPENSSL_THREADS) && defined(_SPT_MODEL_) +#define SPT_THREAD_SIGNAL 1 +#define SPT_THREAD_AWARE 1 +#include +#elif defined(OPENSSL_THREADS) && defined(_PUT_MODEL_) +#include +#endif +#endif + +/** + * That's it for OS-specific stuff + *****************************************************************************/ + +/*- + * OPENSSL_EXTERN is normally used to declare a symbol with possible extra + * attributes to handle its presence in a shared library. + * OPENSSL_EXPORT is used to define a symbol with extra possible attributes + * to make it visible in a shared library. + * Care needs to be taken when a header file is used both to declare and + * define symbols. Basically, for any library that exports some global + * variables, the following code must be present in the header file that + * declares them, before OPENSSL_EXTERN is used: + * + * #ifdef SOME_BUILD_FLAG_MACRO + * # undef OPENSSL_EXTERN + * # define OPENSSL_EXTERN OPENSSL_EXPORT + * #endif + * + * The default is to have OPENSSL_EXPORT and OPENSSL_EXTERN + * have some generally sensible values. + */ + +#if defined(OPENSSL_SYS_WINDOWS) && defined(OPENSSL_OPT_WINDLL) +#define OPENSSL_EXPORT extern __declspec(dllexport) +#define OPENSSL_EXTERN extern __declspec(dllimport) +#else +#define OPENSSL_EXPORT extern +#define OPENSSL_EXTERN extern +#endif + +#ifdef _WIN32 +#ifdef _WIN64 +#define ossl_ssize_t __int64 +#define OSSL_SSIZE_MAX _I64_MAX +#else +#define ossl_ssize_t int +#define OSSL_SSIZE_MAX INT_MAX +#endif +#endif + +#if defined(OPENSSL_SYS_UEFI) && !defined(ossl_ssize_t) +#define ossl_ssize_t INTN +#define OSSL_SSIZE_MAX MAX_INTN +#endif + +#ifndef ossl_ssize_t +#include +#define ossl_ssize_t ssize_t +#if defined(SSIZE_MAX) +#define OSSL_SSIZE_MAX SSIZE_MAX +#elif defined(_POSIX_SSIZE_MAX) +#define OSSL_SSIZE_MAX _POSIX_SSIZE_MAX +#else +#define OSSL_SSIZE_MAX ((ssize_t)(SIZE_MAX >> 1)) +#endif +#endif + +#if defined(UNUSEDRESULT_DEBUG) +#define __owur __attribute__((__warn_unused_result__)) +#else +#define __owur +#endif + +/* Standard integer types */ +#define OPENSSL_NO_INTTYPES_H +#define OPENSSL_NO_STDINT_H +#if defined(OPENSSL_SYS_UEFI) +typedef INT8 int8_t; +typedef UINT8 uint8_t; +typedef INT16 int16_t; +typedef UINT16 uint16_t; +typedef INT32 int32_t; +typedef UINT32 uint32_t; +typedef INT64 int64_t; +typedef UINT64 uint64_t; +typedef UINTN uintptr_t; +#elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__osf__) || defined(__sgi) || defined(__hpux) || defined(OPENSSL_SYS_VMS) || defined(__OpenBSD__) +#include +#undef OPENSSL_NO_INTTYPES_H +/* Because the specs say that inttypes.h includes stdint.h if present */ +#undef OPENSSL_NO_STDINT_H +#elif defined(_MSC_VER) && _MSC_VER < 1600 +/* + * minimally required typdefs for systems not supporting inttypes.h or + * stdint.h: currently just older VC++ + */ +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef short int16_t; +typedef unsigned short uint16_t; +typedef int int32_t; +typedef unsigned int uint32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#elif defined(OPENSSL_SYS_TANDEM) +#include +#include +#else +#include +#undef OPENSSL_NO_STDINT_H +#endif +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L && defined(INTMAX_MAX) && defined(UINTMAX_MAX) +typedef intmax_t ossl_intmax_t; +typedef uintmax_t ossl_uintmax_t; +#else +/* Fall back to the largest we know we require and can handle */ +typedef int64_t ossl_intmax_t; +typedef uint64_t ossl_uintmax_t; +#endif + +/* ossl_inline: portable inline definition usable in public headers */ +#if !defined(inline) && !defined(__cplusplus) +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +/* just use inline */ +#define ossl_inline inline +#elif defined(__GNUC__) && __GNUC__ >= 2 +#define ossl_inline __inline__ +#elif defined(_MSC_VER) +/* + * Visual Studio: inline is available in C++ only, however + * __inline is available for C, see + * http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx + */ +#define ossl_inline __inline +#else +#define ossl_inline +#endif +#else +#define ossl_inline inline +#endif + +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && !defined(__cplusplus) +#define ossl_noreturn _Noreturn +#elif defined(__GNUC__) && __GNUC__ >= 2 +#define ossl_noreturn __attribute__((noreturn)) +#else +#define ossl_noreturn +#endif + +/* ossl_unused: portable unused attribute for use in public headers */ +#if defined(__GNUC__) +#define ossl_unused __attribute__((unused)) +#else +#define ossl_unused +#endif + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/e_ostime.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/e_ostime.h new file mode 100644 index 0000000000000000000000000000000000000000..c0f1c547db72b49be4cfe437fa1b7b3c2ab64c52 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/e_ostime.h @@ -0,0 +1,38 @@ +/* + * Copyright 2023 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_E_OSTIME_H +#define OPENSSL_E_OSTIME_H +#pragma once + +#include +#include +#include + +/* + * This header guarantees that 'struct timeval' will be available. It includes + * the minimum headers needed to facilitate this. This may still be a + * substantial set of headers on some platforms (e.g. on Win32). + */ + +#if defined(OPENSSL_SYS_WINDOWS) +#if !defined(_WINSOCKAPI_) +/* + * winsock2.h defines _WINSOCK2API_ and both winsock2.h and winsock.h define + * _WINSOCKAPI_. Both of these provide struct timeval. Don't include + * winsock2.h if either header has been included to avoid breakage with + * applications that prefer to use over . + */ +#include +#endif +#else +#include +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ebcdic.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ebcdic.h new file mode 100644 index 0000000000000000000000000000000000000000..f2171bb055464f5792deb2f7b3dc386f52eb6c7d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ebcdic.h @@ -0,0 +1,39 @@ +/* + * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_EBCDIC_H +#define OPENSSL_EBCDIC_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_EBCDIC_H +#endif + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Avoid name clashes with other applications */ +#define os_toascii _openssl_os_toascii +#define os_toebcdic _openssl_os_toebcdic +#define ebcdic2ascii _openssl_ebcdic2ascii +#define ascii2ebcdic _openssl_ascii2ebcdic + +extern const unsigned char os_toascii[256]; +extern const unsigned char os_toebcdic[256]; +void *ebcdic2ascii(void *dest, const void *srce, size_t count); +void *ascii2ebcdic(void *dest, const void *srce, size_t count); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ec.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ec.h new file mode 100644 index 0000000000000000000000000000000000000000..cdde09ca62b66e2778cc6d5f9ec736858228f194 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ec.h @@ -0,0 +1,1569 @@ +/* + * Copyright 2002-2023 The OpenSSL Project Authors. All Rights Reserved. + * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_EC_H +#define OPENSSL_EC_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_EC_H +#endif + +#include +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Values for EVP_PKEY_CTX_set_ec_param_enc() */ +#define OPENSSL_EC_EXPLICIT_CURVE 0x000 +#define OPENSSL_EC_NAMED_CURVE 0x001 + +int EVP_PKEY_CTX_set_ec_paramgen_curve_nid(EVP_PKEY_CTX *ctx, int nid); +int EVP_PKEY_CTX_set_ec_param_enc(EVP_PKEY_CTX *ctx, int param_enc); +int EVP_PKEY_CTX_set_ecdh_cofactor_mode(EVP_PKEY_CTX *ctx, int cofactor_mode); +int EVP_PKEY_CTX_get_ecdh_cofactor_mode(EVP_PKEY_CTX *ctx); + +int EVP_PKEY_CTX_set_ecdh_kdf_type(EVP_PKEY_CTX *ctx, int kdf); +int EVP_PKEY_CTX_get_ecdh_kdf_type(EVP_PKEY_CTX *ctx); + +int EVP_PKEY_CTX_set_ecdh_kdf_md(EVP_PKEY_CTX *ctx, const EVP_MD *md); +int EVP_PKEY_CTX_get_ecdh_kdf_md(EVP_PKEY_CTX *ctx, const EVP_MD **md); + +int EVP_PKEY_CTX_set_ecdh_kdf_outlen(EVP_PKEY_CTX *ctx, int len); +int EVP_PKEY_CTX_get_ecdh_kdf_outlen(EVP_PKEY_CTX *ctx, int *len); + +int EVP_PKEY_CTX_set0_ecdh_kdf_ukm(EVP_PKEY_CTX *ctx, unsigned char *ukm, + int len); +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +int EVP_PKEY_CTX_get0_ecdh_kdf_ukm(EVP_PKEY_CTX *ctx, unsigned char **ukm); +#endif + +#define EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID (EVP_PKEY_ALG_CTRL + 1) +#define EVP_PKEY_CTRL_EC_PARAM_ENC (EVP_PKEY_ALG_CTRL + 2) +#define EVP_PKEY_CTRL_EC_ECDH_COFACTOR (EVP_PKEY_ALG_CTRL + 3) +#define EVP_PKEY_CTRL_EC_KDF_TYPE (EVP_PKEY_ALG_CTRL + 4) +#define EVP_PKEY_CTRL_EC_KDF_MD (EVP_PKEY_ALG_CTRL + 5) +#define EVP_PKEY_CTRL_GET_EC_KDF_MD (EVP_PKEY_ALG_CTRL + 6) +#define EVP_PKEY_CTRL_EC_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 7) +#define EVP_PKEY_CTRL_GET_EC_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 8) +#define EVP_PKEY_CTRL_EC_KDF_UKM (EVP_PKEY_ALG_CTRL + 9) +#define EVP_PKEY_CTRL_GET_EC_KDF_UKM (EVP_PKEY_ALG_CTRL + 10) + +/* KDF types */ +#define EVP_PKEY_ECDH_KDF_NONE 1 +#define EVP_PKEY_ECDH_KDF_X9_63 2 +/* + * The old name for EVP_PKEY_ECDH_KDF_X9_63 + * The ECDH KDF specification has been mistakenly attributed to ANSI X9.62, + * it is actually specified in ANSI X9.63. + * This identifier is retained for backwards compatibility + */ +#define EVP_PKEY_ECDH_KDF_X9_62 EVP_PKEY_ECDH_KDF_X9_63 + +/** Enum for the point conversion form as defined in X9.62 (ECDSA) + * for the encoding of a elliptic curve point (x,y) */ +typedef enum { + /** the point is encoded as z||x, where the octet z specifies + * which solution of the quadratic equation y is */ + POINT_CONVERSION_COMPRESSED = 2, + /** the point is encoded as z||x||y, where z is the octet 0x04 */ + POINT_CONVERSION_UNCOMPRESSED = 4, + /** the point is encoded as z||x||y, where the octet z specifies + * which solution of the quadratic equation y is */ + POINT_CONVERSION_HYBRID = 6 +} point_conversion_form_t; + +const char *OSSL_EC_curve_nid2name(int nid); + +#ifndef OPENSSL_NO_STDIO +#include +#endif +#ifndef OPENSSL_NO_EC +#include +#include +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#include +#endif +#include + +#ifndef OPENSSL_ECC_MAX_FIELD_BITS +#define OPENSSL_ECC_MAX_FIELD_BITS 661 +#endif + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +typedef struct ec_method_st EC_METHOD; +#endif +typedef struct ec_group_st EC_GROUP; +typedef struct ec_point_st EC_POINT; +typedef struct ecpk_parameters_st ECPKPARAMETERS; +typedef struct ec_parameters_st ECPARAMETERS; + +/********************************************************************/ +/* EC_METHODs for curves over GF(p) */ +/********************************************************************/ + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +/** Returns the basic GFp ec methods which provides the basis for the + * optimized methods. + * \return EC_METHOD object + */ +OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GFp_simple_method(void); + +/** Returns GFp methods using montgomery multiplication. + * \return EC_METHOD object + */ +OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GFp_mont_method(void); + +/** Returns GFp methods using optimized methods for NIST recommended curves + * \return EC_METHOD object + */ +OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GFp_nist_method(void); + +#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 +/** Returns 64-bit optimized methods for nistp224 + * \return EC_METHOD object + */ +OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GFp_nistp224_method(void); + +/** Returns 64-bit optimized methods for nistp256 + * \return EC_METHOD object + */ +OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GFp_nistp256_method(void); + +/** Returns 64-bit optimized methods for nistp521 + * \return EC_METHOD object + */ +OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GFp_nistp521_method(void); +#endif /* OPENSSL_NO_EC_NISTP_64_GCC_128 */ + +#ifndef OPENSSL_NO_EC2M +/********************************************************************/ +/* EC_METHOD for curves over GF(2^m) */ +/********************************************************************/ + +/** Returns the basic GF2m ec method + * \return EC_METHOD object + */ +OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GF2m_simple_method(void); + +#endif + +/********************************************************************/ +/* EC_GROUP functions */ +/********************************************************************/ + +/** + * Creates a new EC_GROUP object + * \param meth EC_METHOD to use + * \return newly created EC_GROUP object or NULL in case of an error. + */ +OSSL_DEPRECATEDIN_3_0 EC_GROUP *EC_GROUP_new(const EC_METHOD *meth); + +/** Clears and frees a EC_GROUP object + * \param group EC_GROUP object to be cleared and freed. + */ +OSSL_DEPRECATEDIN_3_0 void EC_GROUP_clear_free(EC_GROUP *group); + +/** Returns the EC_METHOD of the EC_GROUP object. + * \param group EC_GROUP object + * \return EC_METHOD used in this EC_GROUP object. + */ +OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group); + +/** Returns the field type of the EC_METHOD. + * \param meth EC_METHOD object + * \return NID of the underlying field type OID. + */ +OSSL_DEPRECATEDIN_3_0 int EC_METHOD_get_field_type(const EC_METHOD *meth); +#endif /* OPENSSL_NO_DEPRECATED_3_0 */ + +/** Frees a EC_GROUP object + * \param group EC_GROUP object to be freed. + */ +void EC_GROUP_free(EC_GROUP *group); + +/** Copies EC_GROUP objects. Note: both EC_GROUPs must use the same EC_METHOD. + * \param dst destination EC_GROUP object + * \param src source EC_GROUP object + * \return 1 on success and 0 if an error occurred. + */ +int EC_GROUP_copy(EC_GROUP *dst, const EC_GROUP *src); + +/** Creates a new EC_GROUP object and copies the content + * form src to the newly created EC_KEY object + * \param src source EC_GROUP object + * \return newly created EC_GROUP object or NULL in case of an error. + */ +EC_GROUP *EC_GROUP_dup(const EC_GROUP *src); + +/** Sets the generator and its order/cofactor of a EC_GROUP object. + * \param group EC_GROUP object + * \param generator EC_POINT object with the generator. + * \param order the order of the group generated by the generator. + * \param cofactor the index of the sub-group generated by the generator + * in the group of all points on the elliptic curve. + * \return 1 on success and 0 if an error occurred + */ +int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, + const BIGNUM *order, const BIGNUM *cofactor); + +/** Returns the generator of a EC_GROUP object. + * \param group EC_GROUP object + * \return the currently used generator (possibly NULL). + */ +const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group); + +/** Returns the montgomery data for order(Generator) + * \param group EC_GROUP object + * \return the currently used montgomery data (possibly NULL). + */ +BN_MONT_CTX *EC_GROUP_get_mont_data(const EC_GROUP *group); + +/** Gets the order of a EC_GROUP + * \param group EC_GROUP object + * \param order BIGNUM to which the order is copied + * \param ctx unused + * \return 1 on success and 0 if an error occurred + */ +int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx); + +/** Gets the order of an EC_GROUP + * \param group EC_GROUP object + * \return the group order + */ +const BIGNUM *EC_GROUP_get0_order(const EC_GROUP *group); + +/** Gets the number of bits of the order of an EC_GROUP + * \param group EC_GROUP object + * \return number of bits of group order. + */ +int EC_GROUP_order_bits(const EC_GROUP *group); + +/** Gets the cofactor of a EC_GROUP + * \param group EC_GROUP object + * \param cofactor BIGNUM to which the cofactor is copied + * \param ctx unused + * \return 1 on success and 0 if an error occurred + */ +int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, + BN_CTX *ctx); + +/** Gets the cofactor of an EC_GROUP + * \param group EC_GROUP object + * \return the group cofactor + */ +const BIGNUM *EC_GROUP_get0_cofactor(const EC_GROUP *group); + +/** Sets the name of a EC_GROUP object + * \param group EC_GROUP object + * \param nid NID of the curve name OID + */ +void EC_GROUP_set_curve_name(EC_GROUP *group, int nid); + +/** Returns the curve name of a EC_GROUP object + * \param group EC_GROUP object + * \return NID of the curve name OID or 0 if not set. + */ +int EC_GROUP_get_curve_name(const EC_GROUP *group); + +/** Gets the field of an EC_GROUP + * \param group EC_GROUP object + * \return the group field + */ +const BIGNUM *EC_GROUP_get0_field(const EC_GROUP *group); + +/** Returns the field type of the EC_GROUP. + * \param group EC_GROUP object + * \return NID of the underlying field type OID. + */ +int EC_GROUP_get_field_type(const EC_GROUP *group); + +void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag); +int EC_GROUP_get_asn1_flag(const EC_GROUP *group); + +void EC_GROUP_set_point_conversion_form(EC_GROUP *group, + point_conversion_form_t form); +point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *); + +unsigned char *EC_GROUP_get0_seed(const EC_GROUP *x); +size_t EC_GROUP_get_seed_len(const EC_GROUP *); +size_t EC_GROUP_set_seed(EC_GROUP *, const unsigned char *, size_t len); + +/** Sets the parameters of an ec curve defined by y^2 = x^3 + a*x + b (for GFp) + * or y^2 + x*y = x^3 + a*x^2 + b (for GF2m) + * \param group EC_GROUP object + * \param p BIGNUM with the prime number (GFp) or the polynomial + * defining the underlying field (GF2m) + * \param a BIGNUM with parameter a of the equation + * \param b BIGNUM with parameter b of the equation + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occurred + */ +int EC_GROUP_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, + const BIGNUM *b, BN_CTX *ctx); + +/** Gets the parameters of the ec curve defined by y^2 = x^3 + a*x + b (for GFp) + * or y^2 + x*y = x^3 + a*x^2 + b (for GF2m) + * \param group EC_GROUP object + * \param p BIGNUM with the prime number (GFp) or the polynomial + * defining the underlying field (GF2m) + * \param a BIGNUM for parameter a of the equation + * \param b BIGNUM for parameter b of the equation + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occurred + */ +int EC_GROUP_get_curve(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, + BN_CTX *ctx); + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +/** Sets the parameters of an ec curve. Synonym for EC_GROUP_set_curve + * \param group EC_GROUP object + * \param p BIGNUM with the prime number (GFp) or the polynomial + * defining the underlying field (GF2m) + * \param a BIGNUM with parameter a of the equation + * \param b BIGNUM with parameter b of the equation + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occurred + */ +OSSL_DEPRECATEDIN_3_0 int EC_GROUP_set_curve_GFp(EC_GROUP *group, + const BIGNUM *p, + const BIGNUM *a, + const BIGNUM *b, + BN_CTX *ctx); + +/** Gets the parameters of an ec curve. Synonym for EC_GROUP_get_curve + * \param group EC_GROUP object + * \param p BIGNUM with the prime number (GFp) or the polynomial + * defining the underlying field (GF2m) + * \param a BIGNUM for parameter a of the equation + * \param b BIGNUM for parameter b of the equation + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occurred + */ +OSSL_DEPRECATEDIN_3_0 int EC_GROUP_get_curve_GFp(const EC_GROUP *group, + BIGNUM *p, + BIGNUM *a, BIGNUM *b, + BN_CTX *ctx); + +#ifndef OPENSSL_NO_EC2M +/** Sets the parameter of an ec curve. Synonym for EC_GROUP_set_curve + * \param group EC_GROUP object + * \param p BIGNUM with the prime number (GFp) or the polynomial + * defining the underlying field (GF2m) + * \param a BIGNUM with parameter a of the equation + * \param b BIGNUM with parameter b of the equation + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occurred + */ +OSSL_DEPRECATEDIN_3_0 int EC_GROUP_set_curve_GF2m(EC_GROUP *group, + const BIGNUM *p, + const BIGNUM *a, + const BIGNUM *b, + BN_CTX *ctx); + +/** Gets the parameters of an ec curve. Synonym for EC_GROUP_get_curve + * \param group EC_GROUP object + * \param p BIGNUM with the prime number (GFp) or the polynomial + * defining the underlying field (GF2m) + * \param a BIGNUM for parameter a of the equation + * \param b BIGNUM for parameter b of the equation + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occurred + */ +OSSL_DEPRECATEDIN_3_0 int EC_GROUP_get_curve_GF2m(const EC_GROUP *group, + BIGNUM *p, + BIGNUM *a, BIGNUM *b, + BN_CTX *ctx); +#endif /* OPENSSL_NO_EC2M */ +#endif /* OPENSSL_NO_DEPRECATED_3_0 */ + +/** Returns the number of bits needed to represent a field element + * \param group EC_GROUP object + * \return number of bits needed to represent a field element + */ +int EC_GROUP_get_degree(const EC_GROUP *group); + +/** Checks whether the parameter in the EC_GROUP define a valid ec group + * \param group EC_GROUP object + * \param ctx BN_CTX object (optional) + * \return 1 if group is a valid ec group and 0 otherwise + */ +int EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx); + +/** Checks whether the discriminant of the elliptic curve is zero or not + * \param group EC_GROUP object + * \param ctx BN_CTX object (optional) + * \return 1 if the discriminant is not zero and 0 otherwise + */ +int EC_GROUP_check_discriminant(const EC_GROUP *group, BN_CTX *ctx); + +/** Compares two EC_GROUP objects + * \param a first EC_GROUP object + * \param b second EC_GROUP object + * \param ctx BN_CTX object (optional) + * \return 0 if the groups are equal, 1 if not, or -1 on error + */ +int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx); + +/* + * EC_GROUP_new_GF*() calls EC_GROUP_new() and EC_GROUP_set_GF*() after + * choosing an appropriate EC_METHOD + */ + +/** Creates a new EC_GROUP object with the specified parameters defined + * over GFp (defined by the equation y^2 = x^3 + a*x + b) + * \param p BIGNUM with the prime number + * \param a BIGNUM with the parameter a of the equation + * \param b BIGNUM with the parameter b of the equation + * \param ctx BN_CTX object (optional) + * \return newly created EC_GROUP object with the specified parameters + */ +EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, + const BIGNUM *b, BN_CTX *ctx); +#ifndef OPENSSL_NO_EC2M +/** Creates a new EC_GROUP object with the specified parameters defined + * over GF2m (defined by the equation y^2 + x*y = x^3 + a*x^2 + b) + * \param p BIGNUM with the polynomial defining the underlying field + * \param a BIGNUM with the parameter a of the equation + * \param b BIGNUM with the parameter b of the equation + * \param ctx BN_CTX object (optional) + * \return newly created EC_GROUP object with the specified parameters + */ +EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, + const BIGNUM *b, BN_CTX *ctx); +#endif + +/** + * Creates a EC_GROUP object with a curve specified by parameters. + * The parameters may be explicit or a named curve, + * \param params A list of parameters describing the group. + * \param libctx The associated library context or NULL for the default + * context + * \param propq A property query string + * \return newly created EC_GROUP object with specified parameters or NULL + * if an error occurred + */ +EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[], + OSSL_LIB_CTX *libctx, const char *propq); + +/** + * Creates an OSSL_PARAM array with the parameters describing the given + * EC_GROUP. + * The resulting parameters may contain an explicit or a named curve depending + * on the EC_GROUP. + * \param group pointer to the EC_GROUP object + * \param libctx The associated library context or NULL for the default + * context + * \param propq A property query string + * \param bnctx BN_CTX object (optional) + * \return newly created OSSL_PARAM array with the parameters + * describing the given EC_GROUP or NULL if an error occurred + */ +OSSL_PARAM *EC_GROUP_to_params(const EC_GROUP *group, OSSL_LIB_CTX *libctx, + const char *propq, BN_CTX *bnctx); + +/** + * Creates a EC_GROUP object with a curve specified by a NID + * \param libctx The associated library context or NULL for the default + * context + * \param propq A property query string + * \param nid NID of the OID of the curve name + * \return newly created EC_GROUP object with specified curve or NULL + * if an error occurred + */ +EC_GROUP *EC_GROUP_new_by_curve_name_ex(OSSL_LIB_CTX *libctx, const char *propq, + int nid); + +/** + * Creates a EC_GROUP object with a curve specified by a NID. Same as + * EC_GROUP_new_by_curve_name_ex but the libctx and propq are always + * NULL. + * \param nid NID of the OID of the curve name + * \return newly created EC_GROUP object with specified curve or NULL + * if an error occurred + */ +EC_GROUP *EC_GROUP_new_by_curve_name(int nid); + +/** Creates a new EC_GROUP object from an ECPARAMETERS object + * \param params pointer to the ECPARAMETERS object + * \return newly created EC_GROUP object with specified curve or NULL + * if an error occurred + */ +EC_GROUP *EC_GROUP_new_from_ecparameters(const ECPARAMETERS *params); + +/** Creates an ECPARAMETERS object for the given EC_GROUP object. + * \param group pointer to the EC_GROUP object + * \param params pointer to an existing ECPARAMETERS object or NULL + * \return pointer to the new ECPARAMETERS object or NULL + * if an error occurred. + */ +ECPARAMETERS *EC_GROUP_get_ecparameters(const EC_GROUP *group, + ECPARAMETERS *params); + +/** Creates a new EC_GROUP object from an ECPKPARAMETERS object + * \param params pointer to an existing ECPKPARAMETERS object, or NULL + * \return newly created EC_GROUP object with specified curve, or NULL + * if an error occurred + */ +EC_GROUP *EC_GROUP_new_from_ecpkparameters(const ECPKPARAMETERS *params); + +/** Creates an ECPKPARAMETERS object for the given EC_GROUP object. + * \param group pointer to the EC_GROUP object + * \param params pointer to an existing ECPKPARAMETERS object or NULL + * \return pointer to the new ECPKPARAMETERS object or NULL + * if an error occurred. + */ +ECPKPARAMETERS *EC_GROUP_get_ecpkparameters(const EC_GROUP *group, + ECPKPARAMETERS *params); + +/********************************************************************/ +/* handling of internal curves */ +/********************************************************************/ + +typedef struct { + int nid; + const char *comment; +} EC_builtin_curve; + +/* + * EC_builtin_curves(EC_builtin_curve *r, size_t size) returns number of all + * available curves or zero if a error occurred. In case r is not zero, + * nitems EC_builtin_curve structures are filled with the data of the first + * nitems internal groups + */ +size_t EC_get_builtin_curves(EC_builtin_curve *r, size_t nitems); + +const char *EC_curve_nid2nist(int nid); +int EC_curve_nist2nid(const char *name); +int EC_GROUP_check_named_curve(const EC_GROUP *group, int nist_only, + BN_CTX *ctx); + +/********************************************************************/ +/* EC_POINT functions */ +/********************************************************************/ + +/** Creates a new EC_POINT object for the specified EC_GROUP + * \param group EC_GROUP the underlying EC_GROUP object + * \return newly created EC_POINT object or NULL if an error occurred + */ +EC_POINT *EC_POINT_new(const EC_GROUP *group); + +/** Frees a EC_POINT object + * \param point EC_POINT object to be freed + */ +void EC_POINT_free(EC_POINT *point); + +/** Clears and frees a EC_POINT object + * \param point EC_POINT object to be cleared and freed + */ +void EC_POINT_clear_free(EC_POINT *point); + +/** Copies EC_POINT object + * \param dst destination EC_POINT object + * \param src source EC_POINT object + * \return 1 on success and 0 if an error occurred + */ +int EC_POINT_copy(EC_POINT *dst, const EC_POINT *src); + +/** Creates a new EC_POINT object and copies the content of the supplied + * EC_POINT + * \param src source EC_POINT object + * \param group underlying the EC_GROUP object + * \return newly created EC_POINT object or NULL if an error occurred + */ +EC_POINT *EC_POINT_dup(const EC_POINT *src, const EC_GROUP *group); + +/** Sets a point to infinity (neutral element) + * \param group underlying EC_GROUP object + * \param point EC_POINT to set to infinity + * \return 1 on success and 0 if an error occurred + */ +int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point); + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +/** Returns the EC_METHOD used in EC_POINT object + * \param point EC_POINT object + * \return the EC_METHOD used + */ +OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_POINT_method_of(const EC_POINT *point); + +/** Sets the jacobian projective coordinates of a EC_POINT over GFp + * \param group underlying EC_GROUP object + * \param p EC_POINT object + * \param x BIGNUM with the x-coordinate + * \param y BIGNUM with the y-coordinate + * \param z BIGNUM with the z-coordinate + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occurred + */ +OSSL_DEPRECATEDIN_3_0 int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, + const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, + BN_CTX *ctx); + +/** Gets the jacobian projective coordinates of a EC_POINT over GFp + * \param group underlying EC_GROUP object + * \param p EC_POINT object + * \param x BIGNUM for the x-coordinate + * \param y BIGNUM for the y-coordinate + * \param z BIGNUM for the z-coordinate + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occurred + */ +OSSL_DEPRECATEDIN_3_0 int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group, const EC_POINT *p, + BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx); +#endif /* OPENSSL_NO_DEPRECATED_3_0 */ + +/** Sets the affine coordinates of an EC_POINT + * \param group underlying EC_GROUP object + * \param p EC_POINT object + * \param x BIGNUM with the x-coordinate + * \param y BIGNUM with the y-coordinate + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occurred + */ +int EC_POINT_set_affine_coordinates(const EC_GROUP *group, EC_POINT *p, + const BIGNUM *x, const BIGNUM *y, + BN_CTX *ctx); + +/** Gets the affine coordinates of an EC_POINT. + * \param group underlying EC_GROUP object + * \param p EC_POINT object + * \param x BIGNUM for the x-coordinate + * \param y BIGNUM for the y-coordinate + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occurred + */ +int EC_POINT_get_affine_coordinates(const EC_GROUP *group, const EC_POINT *p, + BIGNUM *x, BIGNUM *y, BN_CTX *ctx); + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +/** Sets the affine coordinates of an EC_POINT. A synonym of + * EC_POINT_set_affine_coordinates + * \param group underlying EC_GROUP object + * \param p EC_POINT object + * \param x BIGNUM with the x-coordinate + * \param y BIGNUM with the y-coordinate + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occurred + */ +OSSL_DEPRECATEDIN_3_0 int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, + const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx); + +/** Gets the affine coordinates of an EC_POINT. A synonym of + * EC_POINT_get_affine_coordinates + * \param group underlying EC_GROUP object + * \param p EC_POINT object + * \param x BIGNUM for the x-coordinate + * \param y BIGNUM for the y-coordinate + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occurred + */ +OSSL_DEPRECATEDIN_3_0 int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, const EC_POINT *p, + BIGNUM *x, BIGNUM *y, BN_CTX *ctx); +#endif /* OPENSSL_NO_DEPRECATED_3_0 */ + +/** Sets the x9.62 compressed coordinates of a EC_POINT + * \param group underlying EC_GROUP object + * \param p EC_POINT object + * \param x BIGNUM with x-coordinate + * \param y_bit integer with the y-Bit (either 0 or 1) + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occurred + */ +int EC_POINT_set_compressed_coordinates(const EC_GROUP *group, EC_POINT *p, + const BIGNUM *x, int y_bit, + BN_CTX *ctx); + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +/** Sets the x9.62 compressed coordinates of a EC_POINT. A synonym of + * EC_POINT_set_compressed_coordinates + * \param group underlying EC_GROUP object + * \param p EC_POINT object + * \param x BIGNUM with x-coordinate + * \param y_bit integer with the y-Bit (either 0 or 1) + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occurred + */ +OSSL_DEPRECATEDIN_3_0 int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, + const BIGNUM *x, int y_bit, BN_CTX *ctx); +#ifndef OPENSSL_NO_EC2M +/** Sets the affine coordinates of an EC_POINT. A synonym of + * EC_POINT_set_affine_coordinates + * \param group underlying EC_GROUP object + * \param p EC_POINT object + * \param x BIGNUM with the x-coordinate + * \param y BIGNUM with the y-coordinate + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occurred + */ +OSSL_DEPRECATEDIN_3_0 int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p, + const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx); + +/** Gets the affine coordinates of an EC_POINT. A synonym of + * EC_POINT_get_affine_coordinates + * \param group underlying EC_GROUP object + * \param p EC_POINT object + * \param x BIGNUM for the x-coordinate + * \param y BIGNUM for the y-coordinate + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occurred + */ +OSSL_DEPRECATEDIN_3_0 int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group, const EC_POINT *p, + BIGNUM *x, BIGNUM *y, BN_CTX *ctx); + +/** Sets the x9.62 compressed coordinates of a EC_POINT. A synonym of + * EC_POINT_set_compressed_coordinates + * \param group underlying EC_GROUP object + * \param p EC_POINT object + * \param x BIGNUM with x-coordinate + * \param y_bit integer with the y-Bit (either 0 or 1) + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occurred + */ +OSSL_DEPRECATEDIN_3_0 int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p, + const BIGNUM *x, int y_bit, BN_CTX *ctx); +#endif +#endif /* OPENSSL_NO_DEPRECATED_3_0 */ + +/** Encodes a EC_POINT object to a octet string + * \param group underlying EC_GROUP object + * \param p EC_POINT object + * \param form point conversion form + * \param buf memory buffer for the result. If NULL the function returns + * required buffer size. + * \param len length of the memory buffer + * \param ctx BN_CTX object (optional) + * \return the length of the encoded octet string or 0 if an error occurred + */ +size_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *p, + point_conversion_form_t form, + unsigned char *buf, size_t len, BN_CTX *ctx); + +/** Decodes a EC_POINT from a octet string + * \param group underlying EC_GROUP object + * \param p EC_POINT object + * \param buf memory buffer with the encoded ec point + * \param len length of the encoded ec point + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occurred + */ +int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *p, + const unsigned char *buf, size_t len, BN_CTX *ctx); + +/** Encodes an EC_POINT object to an allocated octet string + * \param group underlying EC_GROUP object + * \param point EC_POINT object + * \param form point conversion form + * \param pbuf returns pointer to allocated buffer + * \param ctx BN_CTX object (optional) + * \return the length of the encoded octet string or 0 if an error occurred + */ +size_t EC_POINT_point2buf(const EC_GROUP *group, const EC_POINT *point, + point_conversion_form_t form, + unsigned char **pbuf, BN_CTX *ctx); + +/* other interfaces to point2oct/oct2point: */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 BIGNUM *EC_POINT_point2bn(const EC_GROUP *, + const EC_POINT *, + point_conversion_form_t form, + BIGNUM *, BN_CTX *); +OSSL_DEPRECATEDIN_3_0 EC_POINT *EC_POINT_bn2point(const EC_GROUP *, + const BIGNUM *, + EC_POINT *, BN_CTX *); +#endif /* OPENSSL_NO_DEPRECATED_3_0 */ + +char *EC_POINT_point2hex(const EC_GROUP *, const EC_POINT *, + point_conversion_form_t form, BN_CTX *); +EC_POINT *EC_POINT_hex2point(const EC_GROUP *, const char *, + EC_POINT *, BN_CTX *); + +/********************************************************************/ +/* functions for doing EC_POINT arithmetic */ +/********************************************************************/ + +/** Computes the sum of two EC_POINT + * \param group underlying EC_GROUP object + * \param r EC_POINT object for the result (r = a + b) + * \param a EC_POINT object with the first summand + * \param b EC_POINT object with the second summand + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occurred + */ +int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, + const EC_POINT *b, BN_CTX *ctx); + +/** Computes the double of a EC_POINT + * \param group underlying EC_GROUP object + * \param r EC_POINT object for the result (r = 2 * a) + * \param a EC_POINT object + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occurred + */ +int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, + BN_CTX *ctx); + +/** Computes the inverse of a EC_POINT + * \param group underlying EC_GROUP object + * \param a EC_POINT object to be inverted (it's used for the result as well) + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occurred + */ +int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx); + +/** Checks whether the point is the neutral element of the group + * \param group the underlying EC_GROUP object + * \param p EC_POINT object + * \return 1 if the point is the neutral element and 0 otherwise + */ +int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *p); + +/** Checks whether the point is on the curve + * \param group underlying EC_GROUP object + * \param point EC_POINT object to check + * \param ctx BN_CTX object (optional) + * \return 1 if the point is on the curve, 0 if not, or -1 on error + */ +int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point, + BN_CTX *ctx); + +/** Compares two EC_POINTs + * \param group underlying EC_GROUP object + * \param a first EC_POINT object + * \param b second EC_POINT object + * \param ctx BN_CTX object (optional) + * \return 1 if the points are not equal, 0 if they are, or -1 on error + */ +int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, + BN_CTX *ctx); + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int EC_POINT_make_affine(const EC_GROUP *group, + EC_POINT *point, BN_CTX *ctx); +OSSL_DEPRECATEDIN_3_0 int EC_POINTs_make_affine(const EC_GROUP *group, size_t num, + EC_POINT *points[], BN_CTX *ctx); + +/** Computes r = generator * n + sum_{i=0}^{num-1} p[i] * m[i] + * \param group underlying EC_GROUP object + * \param r EC_POINT object for the result + * \param n BIGNUM with the multiplier for the group generator (optional) + * \param num number further summands + * \param p array of size num of EC_POINT objects + * \param m array of size num of BIGNUM objects + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occurred + */ +OSSL_DEPRECATEDIN_3_0 int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, + const BIGNUM *n, size_t num, + const EC_POINT *p[], const BIGNUM *m[], + BN_CTX *ctx); +#endif /* OPENSSL_NO_DEPRECATED_3_0 */ + +/** Computes r = generator * n + q * m + * \param group underlying EC_GROUP object + * \param r EC_POINT object for the result + * \param n BIGNUM with the multiplier for the group generator (optional) + * \param q EC_POINT object with the first factor of the second summand + * \param m BIGNUM with the second factor of the second summand + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occurred + */ +int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, + const EC_POINT *q, const BIGNUM *m, BN_CTX *ctx); + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +/** Stores multiples of generator for faster point multiplication + * \param group EC_GROUP object + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occurred + */ +OSSL_DEPRECATEDIN_3_0 int EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx); + +/** Reports whether a precomputation has been done + * \param group EC_GROUP object + * \return 1 if a pre-computation has been done and 0 otherwise + */ +OSSL_DEPRECATEDIN_3_0 int EC_GROUP_have_precompute_mult(const EC_GROUP *group); +#endif /* OPENSSL_NO_DEPRECATED_3_0 */ + +/********************************************************************/ +/* ASN1 stuff */ +/********************************************************************/ + +DECLARE_ASN1_ITEM(ECPKPARAMETERS) +DECLARE_ASN1_ALLOC_FUNCTIONS(ECPKPARAMETERS) +DECLARE_ASN1_ITEM(ECPARAMETERS) +DECLARE_ASN1_ALLOC_FUNCTIONS(ECPARAMETERS) + +/* + * EC_GROUP_get_basis_type() returns the NID of the basis type used to + * represent the field elements + */ +int EC_GROUP_get_basis_type(const EC_GROUP *); +#ifndef OPENSSL_NO_EC2M +int EC_GROUP_get_trinomial_basis(const EC_GROUP *, unsigned int *k); +int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1, + unsigned int *k2, unsigned int *k3); +#endif + +EC_GROUP *d2i_ECPKParameters(EC_GROUP **, const unsigned char **in, long len); +int i2d_ECPKParameters(const EC_GROUP *, unsigned char **out); + +#define d2i_ECPKParameters_bio(bp, x) \ + ASN1_d2i_bio_of(EC_GROUP, NULL, d2i_ECPKParameters, bp, x) +#define i2d_ECPKParameters_bio(bp, x) \ + ASN1_i2d_bio_of(EC_GROUP, i2d_ECPKParameters, bp, x) +#define d2i_ECPKParameters_fp(fp, x) \ + (EC_GROUP *)ASN1_d2i_fp(NULL, (d2i_of_void *)d2i_ECPKParameters, (fp), \ + (void **)(x)) +#define i2d_ECPKParameters_fp(fp, x) \ + ASN1_i2d_fp((i2d_of_void *)i2d_ECPKParameters, (fp), (void *)(x)) + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int ECPKParameters_print(BIO *bp, const EC_GROUP *x, + int off); +#ifndef OPENSSL_NO_STDIO +OSSL_DEPRECATEDIN_3_0 int ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, + int off); +#endif +#endif /* OPENSSL_NO_DEPRECATED_3_0 */ + +/********************************************************************/ +/* EC_KEY functions */ +/********************************************************************/ + +/* some values for the encoding_flag */ +#define EC_PKEY_NO_PARAMETERS 0x001 +#define EC_PKEY_NO_PUBKEY 0x002 + +/* some values for the flags field */ +#define EC_FLAG_SM2_RANGE 0x0004 +#define EC_FLAG_COFACTOR_ECDH 0x1000 +#define EC_FLAG_CHECK_NAMED_GROUP 0x2000 +#define EC_FLAG_CHECK_NAMED_GROUP_NIST 0x4000 +#define EC_FLAG_CHECK_NAMED_GROUP_MASK \ + (EC_FLAG_CHECK_NAMED_GROUP | EC_FLAG_CHECK_NAMED_GROUP_NIST) + +/* Deprecated flags - it was using 0x01..0x02 */ +#define EC_FLAG_NON_FIPS_ALLOW 0x0000 +#define EC_FLAG_FIPS_CHECKED 0x0000 + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +/** + * Creates a new EC_KEY object. + * \param ctx The library context for to use for this EC_KEY. May be NULL in + * which case the default library context is used. + * \return EC_KEY object or NULL if an error occurred. + */ +OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new_ex(OSSL_LIB_CTX *ctx, const char *propq); + +/** + * Creates a new EC_KEY object. Same as calling EC_KEY_new_ex with a + * NULL library context + * \return EC_KEY object or NULL if an error occurred. + */ +OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new(void); + +OSSL_DEPRECATEDIN_3_0 int EC_KEY_get_flags(const EC_KEY *key); + +OSSL_DEPRECATEDIN_3_0 void EC_KEY_set_flags(EC_KEY *key, int flags); + +OSSL_DEPRECATEDIN_3_0 void EC_KEY_clear_flags(EC_KEY *key, int flags); + +OSSL_DEPRECATEDIN_3_0 int EC_KEY_decoded_from_explicit_params(const EC_KEY *key); + +/** + * Creates a new EC_KEY object using a named curve as underlying + * EC_GROUP object. + * \param ctx The library context for to use for this EC_KEY. May be NULL in + * which case the default library context is used. + * \param propq Any property query string + * \param nid NID of the named curve. + * \return EC_KEY object or NULL if an error occurred. + */ +OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new_by_curve_name_ex(OSSL_LIB_CTX *ctx, + const char *propq, + int nid); + +/** + * Creates a new EC_KEY object using a named curve as underlying + * EC_GROUP object. Same as calling EC_KEY_new_by_curve_name_ex with a NULL + * library context and property query string. + * \param nid NID of the named curve. + * \return EC_KEY object or NULL if an error occurred. + */ +OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new_by_curve_name(int nid); + +/** Frees a EC_KEY object. + * \param key EC_KEY object to be freed. + */ +OSSL_DEPRECATEDIN_3_0 void EC_KEY_free(EC_KEY *key); + +/** Copies a EC_KEY object. + * \param dst destination EC_KEY object + * \param src src EC_KEY object + * \return dst or NULL if an error occurred. + */ +OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_copy(EC_KEY *dst, const EC_KEY *src); + +/** Creates a new EC_KEY object and copies the content from src to it. + * \param src the source EC_KEY object + * \return newly created EC_KEY object or NULL if an error occurred. + */ +OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_dup(const EC_KEY *src); + +/** Increases the internal reference count of a EC_KEY object. + * \param key EC_KEY object + * \return 1 on success and 0 if an error occurred. + */ +OSSL_DEPRECATEDIN_3_0 int EC_KEY_up_ref(EC_KEY *key); + +/** Returns the ENGINE object of a EC_KEY object + * \param eckey EC_KEY object + * \return the ENGINE object (possibly NULL). + */ +OSSL_DEPRECATEDIN_3_0 ENGINE *EC_KEY_get0_engine(const EC_KEY *eckey); + +/** Returns the EC_GROUP object of a EC_KEY object + * \param key EC_KEY object + * \return the EC_GROUP object (possibly NULL). + */ +OSSL_DEPRECATEDIN_3_0 const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key); + +/** Sets the EC_GROUP of a EC_KEY object. + * \param key EC_KEY object + * \param group EC_GROUP to use in the EC_KEY object (note: the EC_KEY + * object will use an own copy of the EC_GROUP). + * \return 1 on success and 0 if an error occurred. + */ +OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_group(EC_KEY *key, const EC_GROUP *group); + +/** Returns the private key of a EC_KEY object. + * \param key EC_KEY object + * \return a BIGNUM with the private key (possibly NULL). + */ +OSSL_DEPRECATEDIN_3_0 const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *key); + +/** Sets the private key of a EC_KEY object. + * \param key EC_KEY object + * \param prv BIGNUM with the private key (note: the EC_KEY object + * will use an own copy of the BIGNUM). + * \return 1 on success and 0 if an error occurred. + */ +OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *prv); + +/** Returns the public key of a EC_KEY object. + * \param key the EC_KEY object + * \return a EC_POINT object with the public key (possibly NULL) + */ +OSSL_DEPRECATEDIN_3_0 const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *key); + +/** Sets the public key of a EC_KEY object. + * \param key EC_KEY object + * \param pub EC_POINT object with the public key (note: the EC_KEY object + * will use an own copy of the EC_POINT object). + * \return 1 on success and 0 if an error occurred. + */ +OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub); + +OSSL_DEPRECATEDIN_3_0 unsigned EC_KEY_get_enc_flags(const EC_KEY *key); +OSSL_DEPRECATEDIN_3_0 void EC_KEY_set_enc_flags(EC_KEY *eckey, unsigned int flags); +OSSL_DEPRECATEDIN_3_0 point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *key); +OSSL_DEPRECATEDIN_3_0 void EC_KEY_set_conv_form(EC_KEY *eckey, + point_conversion_form_t cform); +#endif /*OPENSSL_NO_DEPRECATED_3_0 */ + +#define EC_KEY_get_ex_new_index(l, p, newf, dupf, freef) \ + CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_EC_KEY, l, p, newf, dupf, freef) + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_ex_data(EC_KEY *key, int idx, void *arg); +OSSL_DEPRECATEDIN_3_0 void *EC_KEY_get_ex_data(const EC_KEY *key, int idx); + +/* wrapper functions for the underlying EC_GROUP object */ +OSSL_DEPRECATEDIN_3_0 void EC_KEY_set_asn1_flag(EC_KEY *eckey, int asn1_flag); + +/** Creates a table of pre-computed multiples of the generator to + * accelerate further EC_KEY operations. + * \param key EC_KEY object + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occurred. + */ +OSSL_DEPRECATEDIN_3_0 int EC_KEY_precompute_mult(EC_KEY *key, BN_CTX *ctx); + +/** Creates a new ec private (and optional a new public) key. + * \param key EC_KEY object + * \return 1 on success and 0 if an error occurred. + */ +OSSL_DEPRECATEDIN_3_0 int EC_KEY_generate_key(EC_KEY *key); + +/** Verifies that a private and/or public key is valid. + * \param key the EC_KEY object + * \return 1 on success and 0 otherwise. + */ +OSSL_DEPRECATEDIN_3_0 int EC_KEY_check_key(const EC_KEY *key); + +/** Indicates if an EC_KEY can be used for signing. + * \param eckey the EC_KEY object + * \return 1 if can sign and 0 otherwise. + */ +OSSL_DEPRECATEDIN_3_0 int EC_KEY_can_sign(const EC_KEY *eckey); + +/** Sets a public key from affine coordinates performing + * necessary NIST PKV tests. + * \param key the EC_KEY object + * \param x public key x coordinate + * \param y public key y coordinate + * \return 1 on success and 0 otherwise. + */ +OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, + BIGNUM *x, + BIGNUM *y); + +/** Encodes an EC_KEY public key to an allocated octet string + * \param key key to encode + * \param form point conversion form + * \param pbuf returns pointer to allocated buffer + * \param ctx BN_CTX object (optional) + * \return the length of the encoded octet string or 0 if an error occurred + */ +OSSL_DEPRECATEDIN_3_0 size_t EC_KEY_key2buf(const EC_KEY *key, + point_conversion_form_t form, + unsigned char **pbuf, BN_CTX *ctx); + +/** Decodes a EC_KEY public key from a octet string + * \param key key to decode + * \param buf memory buffer with the encoded ec point + * \param len length of the encoded ec point + * \param ctx BN_CTX object (optional) + * \return 1 on success and 0 if an error occurred + */ + +OSSL_DEPRECATEDIN_3_0 int EC_KEY_oct2key(EC_KEY *key, const unsigned char *buf, + size_t len, BN_CTX *ctx); + +/** Decodes an EC_KEY private key from an octet string + * \param key key to decode + * \param buf memory buffer with the encoded private key + * \param len length of the encoded key + * \return 1 on success and 0 if an error occurred + */ + +OSSL_DEPRECATEDIN_3_0 int EC_KEY_oct2priv(EC_KEY *key, const unsigned char *buf, + size_t len); + +/** Encodes a EC_KEY private key to an octet string + * \param key key to encode + * \param buf memory buffer for the result. If NULL the function returns + * required buffer size. + * \param len length of the memory buffer + * \return the length of the encoded octet string or 0 if an error occurred + */ + +OSSL_DEPRECATEDIN_3_0 size_t EC_KEY_priv2oct(const EC_KEY *key, + unsigned char *buf, size_t len); + +/** Encodes an EC_KEY private key to an allocated octet string + * \param eckey key to encode + * \param pbuf returns pointer to allocated buffer + * \return the length of the encoded octet string or 0 if an error occurred + */ +OSSL_DEPRECATEDIN_3_0 size_t EC_KEY_priv2buf(const EC_KEY *eckey, + unsigned char **pbuf); + +/********************************************************************/ +/* de- and encoding functions for SEC1 ECPrivateKey */ +/********************************************************************/ + +/** Decodes a private key from a memory buffer. + * \param key a pointer to a EC_KEY object which should be used (or NULL) + * \param in pointer to memory with the DER encoded private key + * \param len length of the DER encoded private key + * \return the decoded private key or NULL if an error occurred. + */ +OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_ECPrivateKey(EC_KEY **key, + const unsigned char **in, + long len); + +/** Encodes a private key object and stores the result in a buffer. + * \param key the EC_KEY object to encode + * \param out the buffer for the result (if NULL the function returns number + * of bytes needed). + * \return 1 on success and 0 if an error occurred. + */ +OSSL_DEPRECATEDIN_3_0 int i2d_ECPrivateKey(const EC_KEY *key, + unsigned char **out); + +/********************************************************************/ +/* de- and encoding functions for EC parameters */ +/********************************************************************/ + +/** Decodes ec parameter from a memory buffer. + * \param key a pointer to a EC_KEY object which should be used (or NULL) + * \param in pointer to memory with the DER encoded ec parameters + * \param len length of the DER encoded ec parameters + * \return a EC_KEY object with the decoded parameters or NULL if an error + * occurred. + */ +OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_ECParameters(EC_KEY **key, + const unsigned char **in, + long len); + +/** Encodes ec parameter and stores the result in a buffer. + * \param key the EC_KEY object with ec parameters to encode + * \param out the buffer for the result (if NULL the function returns number + * of bytes needed). + * \return 1 on success and 0 if an error occurred. + */ +OSSL_DEPRECATEDIN_3_0 int i2d_ECParameters(const EC_KEY *key, + unsigned char **out); + +/********************************************************************/ +/* de- and encoding functions for EC public key */ +/* (octet string, not DER -- hence 'o2i' and 'i2o') */ +/********************************************************************/ + +/** Decodes an ec public key from a octet string. + * \param key a pointer to a EC_KEY object which should be used + * \param in memory buffer with the encoded public key + * \param len length of the encoded public key + * \return EC_KEY object with decoded public key or NULL if an error + * occurred. + */ +OSSL_DEPRECATEDIN_3_0 EC_KEY *o2i_ECPublicKey(EC_KEY **key, + const unsigned char **in, long len); + +/** Encodes an ec public key in an octet string. + * \param key the EC_KEY object with the public key + * \param out the buffer for the result (if NULL the function returns number + * of bytes needed). + * \return 1 on success and 0 if an error occurred + */ +OSSL_DEPRECATEDIN_3_0 int i2o_ECPublicKey(const EC_KEY *key, unsigned char **out); + +/** Prints out the ec parameters on human readable form. + * \param bp BIO object to which the information is printed + * \param key EC_KEY object + * \return 1 on success and 0 if an error occurred + */ +OSSL_DEPRECATEDIN_3_0 int ECParameters_print(BIO *bp, const EC_KEY *key); + +/** Prints out the contents of a EC_KEY object + * \param bp BIO object to which the information is printed + * \param key EC_KEY object + * \param off line offset + * \return 1 on success and 0 if an error occurred + */ +OSSL_DEPRECATEDIN_3_0 int EC_KEY_print(BIO *bp, const EC_KEY *key, int off); + +#ifndef OPENSSL_NO_STDIO +/** Prints out the ec parameters on human readable form. + * \param fp file descriptor to which the information is printed + * \param key EC_KEY object + * \return 1 on success and 0 if an error occurred + */ +OSSL_DEPRECATEDIN_3_0 int ECParameters_print_fp(FILE *fp, const EC_KEY *key); + +/** Prints out the contents of a EC_KEY object + * \param fp file descriptor to which the information is printed + * \param key EC_KEY object + * \param off line offset + * \return 1 on success and 0 if an error occurred + */ +OSSL_DEPRECATEDIN_3_0 int EC_KEY_print_fp(FILE *fp, const EC_KEY *key, int off); +#endif /* OPENSSL_NO_STDIO */ + +OSSL_DEPRECATEDIN_3_0 const EC_KEY_METHOD *EC_KEY_OpenSSL(void); +OSSL_DEPRECATEDIN_3_0 const EC_KEY_METHOD *EC_KEY_get_default_method(void); +OSSL_DEPRECATEDIN_3_0 void EC_KEY_set_default_method(const EC_KEY_METHOD *meth); +OSSL_DEPRECATEDIN_3_0 const EC_KEY_METHOD *EC_KEY_get_method(const EC_KEY *key); +OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_method(EC_KEY *key, const EC_KEY_METHOD *meth); +OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new_method(ENGINE *engine); + +/** The old name for ecdh_KDF_X9_63 + * The ECDH KDF specification has been mistakenly attributed to ANSI X9.62, + * it is actually specified in ANSI X9.63. + * This identifier is retained for backwards compatibility + */ +OSSL_DEPRECATEDIN_3_0 int ECDH_KDF_X9_62(unsigned char *out, size_t outlen, + const unsigned char *Z, size_t Zlen, + const unsigned char *sinfo, + size_t sinfolen, const EVP_MD *md); + +OSSL_DEPRECATEDIN_3_0 int ECDH_compute_key(void *out, size_t outlen, + const EC_POINT *pub_key, + const EC_KEY *ecdh, + void *(*KDF)(const void *in, + size_t inlen, void *out, + size_t *outlen)); +#endif /* OPENSSL_NO_DEPRECATED_3_0 */ + +typedef struct ECDSA_SIG_st ECDSA_SIG; + +/** Allocates and initialize a ECDSA_SIG structure + * \return pointer to a ECDSA_SIG structure or NULL if an error occurred + */ +ECDSA_SIG *ECDSA_SIG_new(void); + +/** frees a ECDSA_SIG structure + * \param sig pointer to the ECDSA_SIG structure + */ +void ECDSA_SIG_free(ECDSA_SIG *sig); + +/** i2d_ECDSA_SIG encodes content of ECDSA_SIG (note: this function modifies *pp + * (*pp += length of the DER encoded signature)). + * \param sig pointer to the ECDSA_SIG object + * \param pp pointer to a unsigned char pointer for the output or NULL + * \return the length of the DER encoded ECDSA_SIG object or a negative value + * on error + */ +DECLARE_ASN1_ENCODE_FUNCTIONS_only(ECDSA_SIG, ECDSA_SIG) + +/** d2i_ECDSA_SIG decodes an ECDSA signature (note: this function modifies *pp + * (*pp += len)). + * \param sig pointer to ECDSA_SIG pointer (may be NULL) + * \param pp memory buffer with the DER encoded signature + * \param len length of the buffer + * \return pointer to the decoded ECDSA_SIG structure (or NULL) + */ + +/** Accessor for r and s fields of ECDSA_SIG + * \param sig pointer to ECDSA_SIG structure + * \param pr pointer to BIGNUM pointer for r (may be NULL) + * \param ps pointer to BIGNUM pointer for s (may be NULL) + */ +void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps); + +/** Accessor for r field of ECDSA_SIG + * \param sig pointer to ECDSA_SIG structure + */ +const BIGNUM *ECDSA_SIG_get0_r(const ECDSA_SIG *sig); + +/** Accessor for s field of ECDSA_SIG + * \param sig pointer to ECDSA_SIG structure + */ +const BIGNUM *ECDSA_SIG_get0_s(const ECDSA_SIG *sig); + +/** Setter for r and s fields of ECDSA_SIG + * \param sig pointer to ECDSA_SIG structure + * \param r pointer to BIGNUM for r + * \param s pointer to BIGNUM for s + */ +int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s); + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +/** Computes the ECDSA signature of the given hash value using + * the supplied private key and returns the created signature. + * \param dgst pointer to the hash value + * \param dgst_len length of the hash value + * \param eckey EC_KEY object containing a private EC key + * \return pointer to a ECDSA_SIG structure or NULL if an error occurred + */ +OSSL_DEPRECATEDIN_3_0 ECDSA_SIG *ECDSA_do_sign(const unsigned char *dgst, + int dgst_len, EC_KEY *eckey); + +/** Computes ECDSA signature of a given hash value using the supplied + * private key (note: sig must point to ECDSA_size(eckey) bytes of memory). + * \param dgst pointer to the hash value to sign + * \param dgstlen length of the hash value + * \param kinv BIGNUM with a pre-computed inverse k (optional) + * \param rp BIGNUM with a pre-computed rp value (optional), + * see ECDSA_sign_setup + * \param eckey EC_KEY object containing a private EC key + * \return pointer to a ECDSA_SIG structure or NULL if an error occurred + */ +OSSL_DEPRECATEDIN_3_0 ECDSA_SIG *ECDSA_do_sign_ex(const unsigned char *dgst, + int dgstlen, const BIGNUM *kinv, + const BIGNUM *rp, EC_KEY *eckey); + +/** Verifies that the supplied signature is a valid ECDSA + * signature of the supplied hash value using the supplied public key. + * \param dgst pointer to the hash value + * \param dgst_len length of the hash value + * \param sig ECDSA_SIG structure + * \param eckey EC_KEY object containing a public EC key + * \return 1 if the signature is valid, 0 if the signature is invalid + * and -1 on error + */ +OSSL_DEPRECATEDIN_3_0 int ECDSA_do_verify(const unsigned char *dgst, int dgst_len, + const ECDSA_SIG *sig, EC_KEY *eckey); + +/** Precompute parts of the signing operation + * \param eckey EC_KEY object containing a private EC key + * \param ctx BN_CTX object (optional) + * \param kinv BIGNUM pointer for the inverse of k + * \param rp BIGNUM pointer for x coordinate of k * generator + * \return 1 on success and 0 otherwise + */ +OSSL_DEPRECATEDIN_3_0 int ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx, + BIGNUM **kinv, BIGNUM **rp); + +/** Computes ECDSA signature of a given hash value using the supplied + * private key (note: sig must point to ECDSA_size(eckey) bytes of memory). + * \param type this parameter is ignored + * \param dgst pointer to the hash value to sign + * \param dgstlen length of the hash value + * \param sig memory for the DER encoded created signature + * \param siglen pointer to the length of the returned signature + * \param eckey EC_KEY object containing a private EC key + * \return 1 on success and 0 otherwise + */ +OSSL_DEPRECATEDIN_3_0 int ECDSA_sign(int type, const unsigned char *dgst, + int dgstlen, unsigned char *sig, + unsigned int *siglen, EC_KEY *eckey); + +/** Computes ECDSA signature of a given hash value using the supplied + * private key (note: sig must point to ECDSA_size(eckey) bytes of memory). + * \param type this parameter is ignored + * \param dgst pointer to the hash value to sign + * \param dgstlen length of the hash value + * \param sig buffer to hold the DER encoded signature + * \param siglen pointer to the length of the returned signature + * \param kinv BIGNUM with a pre-computed inverse k (optional) + * \param rp BIGNUM with a pre-computed rp value (optional), + * see ECDSA_sign_setup + * \param eckey EC_KEY object containing a private EC key + * \return 1 on success and 0 otherwise + */ +OSSL_DEPRECATEDIN_3_0 int ECDSA_sign_ex(int type, const unsigned char *dgst, + int dgstlen, unsigned char *sig, + unsigned int *siglen, const BIGNUM *kinv, + const BIGNUM *rp, EC_KEY *eckey); + +/** Verifies that the given signature is valid ECDSA signature + * of the supplied hash value using the specified public key. + * \param type this parameter is ignored + * \param dgst pointer to the hash value + * \param dgstlen length of the hash value + * \param sig pointer to the DER encoded signature + * \param siglen length of the DER encoded signature + * \param eckey EC_KEY object containing a public EC key + * \return 1 if the signature is valid, 0 if the signature is invalid + * and -1 on error + */ +OSSL_DEPRECATEDIN_3_0 int ECDSA_verify(int type, const unsigned char *dgst, + int dgstlen, const unsigned char *sig, + int siglen, EC_KEY *eckey); + +/** Returns the maximum length of the DER encoded signature + * \param eckey EC_KEY object + * \return numbers of bytes required for the DER encoded signature + */ +OSSL_DEPRECATEDIN_3_0 int ECDSA_size(const EC_KEY *eckey); + +/********************************************************************/ +/* EC_KEY_METHOD constructors, destructors, writers and accessors */ +/********************************************************************/ + +OSSL_DEPRECATEDIN_3_0 EC_KEY_METHOD *EC_KEY_METHOD_new(const EC_KEY_METHOD *meth); +OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_free(EC_KEY_METHOD *meth); +OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_set_init(EC_KEY_METHOD *meth, + int (*init)(EC_KEY *key), + void (*finish)(EC_KEY *key), + int (*copy)(EC_KEY *dest, const EC_KEY *src), + int (*set_group)(EC_KEY *key, const EC_GROUP *grp), + int (*set_private)(EC_KEY *key, const BIGNUM *priv_key), + int (*set_public)(EC_KEY *key, const EC_POINT *pub_key)); + +OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_set_keygen(EC_KEY_METHOD *meth, + int (*keygen)(EC_KEY *key)); + +OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_set_compute_key(EC_KEY_METHOD *meth, + int (*ckey)(unsigned char **psec, size_t *pseclen, + const EC_POINT *pub_key, const EC_KEY *ecdh)); + +OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_set_sign(EC_KEY_METHOD *meth, + int (*sign)(int type, const unsigned char *dgst, + int dlen, unsigned char *sig, + unsigned int *siglen, + const BIGNUM *kinv, const BIGNUM *r, + EC_KEY *eckey), + int (*sign_setup)(EC_KEY *eckey, BN_CTX *ctx_in, + BIGNUM **kinvp, BIGNUM **rp), + ECDSA_SIG *(*sign_sig)(const unsigned char *dgst, + int dgst_len, + const BIGNUM *in_kinv, + const BIGNUM *in_r, + EC_KEY *eckey)); + +OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_set_verify(EC_KEY_METHOD *meth, + int (*verify)(int type, const unsigned char *dgst, int dgst_len, + const unsigned char *sigbuf, + int sig_len, EC_KEY *eckey), + int (*verify_sig)(const unsigned char *dgst, + int dgst_len, const ECDSA_SIG *sig, + EC_KEY *eckey)); + +OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_get_init(const EC_KEY_METHOD *meth, + int (**pinit)(EC_KEY *key), + void (**pfinish)(EC_KEY *key), + int (**pcopy)(EC_KEY *dest, const EC_KEY *src), + int (**pset_group)(EC_KEY *key, const EC_GROUP *grp), + int (**pset_private)(EC_KEY *key, const BIGNUM *priv_key), + int (**pset_public)(EC_KEY *key, const EC_POINT *pub_key)); + +OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_get_keygen(const EC_KEY_METHOD *meth, int (**pkeygen)(EC_KEY *key)); + +OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_get_compute_key(const EC_KEY_METHOD *meth, + int (**pck)(unsigned char **psec, + size_t *pseclen, + const EC_POINT *pub_key, + const EC_KEY *ecdh)); + +OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_get_sign(const EC_KEY_METHOD *meth, + int (**psign)(int type, const unsigned char *dgst, + int dlen, unsigned char *sig, + unsigned int *siglen, + const BIGNUM *kinv, const BIGNUM *r, + EC_KEY *eckey), + int (**psign_setup)(EC_KEY *eckey, BN_CTX *ctx_in, + BIGNUM **kinvp, BIGNUM **rp), + ECDSA_SIG *(**psign_sig)(const unsigned char *dgst, + int dgst_len, + const BIGNUM *in_kinv, + const BIGNUM *in_r, + EC_KEY *eckey)); + +OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_get_verify(const EC_KEY_METHOD *meth, + int (**pverify)(int type, const unsigned char *dgst, int dgst_len, + const unsigned char *sigbuf, + int sig_len, EC_KEY *eckey), + int (**pverify_sig)(const unsigned char *dgst, + int dgst_len, + const ECDSA_SIG *sig, + EC_KEY *eckey)); +#endif /* OPENSSL_NO_DEPRECATED_3_0 */ + +#define EVP_EC_gen(curve) \ + EVP_PKEY_Q_keygen(NULL, NULL, "EC", (char *)(strstr(curve, ""))) +/* strstr is used to enable type checking for the variadic string arg */ +#define ECParameters_dup(x) ASN1_dup_of(EC_KEY, i2d_ECParameters, \ + d2i_ECParameters, x) + +#ifndef __cplusplus +#if defined(__SUNPRO_C) +#if __SUNPRO_C >= 0x520 +#pragma error_messages(default, E_ARRAY_OF_INCOMPLETE_NONAME, E_ARRAY_OF_INCOMPLETE) +#endif +#endif +#endif + +#endif +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ecdh.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ecdh.h new file mode 100644 index 0000000000000000000000000000000000000000..56bd4cc2ce0de4c0f34180c7ef51201f061f0172 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ecdh.h @@ -0,0 +1,10 @@ +/* + * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#include diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ecdsa.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ecdsa.h new file mode 100644 index 0000000000000000000000000000000000000000..56bd4cc2ce0de4c0f34180c7ef51201f061f0172 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ecdsa.h @@ -0,0 +1,10 @@ +/* + * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#include diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ecerr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ecerr.h new file mode 100644 index 0000000000000000000000000000000000000000..e4d26aa1115122d391297fa3b126bd14a9f25342 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ecerr.h @@ -0,0 +1,102 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_ECERR_H +#define OPENSSL_ECERR_H +#pragma once + +#include +#include +#include + +#ifndef OPENSSL_NO_EC + +/* + * EC reason codes. + */ +#define EC_R_ASN1_ERROR 115 +#define EC_R_BAD_SIGNATURE 156 +#define EC_R_BIGNUM_OUT_OF_RANGE 144 +#define EC_R_BUFFER_TOO_SMALL 100 +#define EC_R_CANNOT_INVERT 165 +#define EC_R_COORDINATES_OUT_OF_RANGE 146 +#define EC_R_CURVE_DOES_NOT_SUPPORT_ECDH 160 +#define EC_R_CURVE_DOES_NOT_SUPPORT_ECDSA 170 +#define EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING 159 +#define EC_R_DECODE_ERROR 142 +#define EC_R_DISCRIMINANT_IS_ZERO 118 +#define EC_R_EC_GROUP_NEW_BY_NAME_FAILURE 119 +#define EC_R_EXPLICIT_PARAMS_NOT_SUPPORTED 127 +#define EC_R_FAILED_MAKING_PUBLIC_KEY 166 +#define EC_R_FIELD_TOO_LARGE 143 +#define EC_R_GF2M_NOT_SUPPORTED 147 +#define EC_R_GROUP2PKPARAMETERS_FAILURE 120 +#define EC_R_I2D_ECPKPARAMETERS_FAILURE 121 +#define EC_R_INCOMPATIBLE_OBJECTS 101 +#define EC_R_INVALID_A 168 +#define EC_R_INVALID_ARGUMENT 112 +#define EC_R_INVALID_B 169 +#define EC_R_INVALID_COFACTOR 171 +#define EC_R_INVALID_COMPRESSED_POINT 110 +#define EC_R_INVALID_COMPRESSION_BIT 109 +#define EC_R_INVALID_CURVE 141 +#define EC_R_INVALID_DIGEST 151 +#define EC_R_INVALID_DIGEST_TYPE 138 +#define EC_R_INVALID_ENCODING 102 +#define EC_R_INVALID_FIELD 103 +#define EC_R_INVALID_FORM 104 +#define EC_R_INVALID_GENERATOR 173 +#define EC_R_INVALID_GROUP_ORDER 122 +#define EC_R_INVALID_KEY 116 +#define EC_R_INVALID_LENGTH 117 +#define EC_R_INVALID_NAMED_GROUP_CONVERSION 174 +#define EC_R_INVALID_OUTPUT_LENGTH 161 +#define EC_R_INVALID_P 172 +#define EC_R_INVALID_PEER_KEY 133 +#define EC_R_INVALID_PENTANOMIAL_BASIS 132 +#define EC_R_INVALID_PRIVATE_KEY 123 +#define EC_R_INVALID_SEED 175 +#define EC_R_INVALID_TRINOMIAL_BASIS 137 +#define EC_R_KDF_PARAMETER_ERROR 148 +#define EC_R_KEYS_NOT_SET 140 +#define EC_R_LADDER_POST_FAILURE 136 +#define EC_R_LADDER_PRE_FAILURE 153 +#define EC_R_LADDER_STEP_FAILURE 162 +#define EC_R_MISSING_OID 167 +#define EC_R_MISSING_PARAMETERS 124 +#define EC_R_MISSING_PRIVATE_KEY 125 +#define EC_R_NEED_NEW_SETUP_VALUES 157 +#define EC_R_NOT_A_NIST_PRIME 135 +#define EC_R_NOT_IMPLEMENTED 126 +#define EC_R_NOT_INITIALIZED 111 +#define EC_R_NO_PARAMETERS_SET 139 +#define EC_R_NO_PRIVATE_VALUE 154 +#define EC_R_OPERATION_NOT_SUPPORTED 152 +#define EC_R_PASSED_NULL_PARAMETER 134 +#define EC_R_PEER_KEY_ERROR 149 +#define EC_R_POINT_ARITHMETIC_FAILURE 155 +#define EC_R_POINT_AT_INFINITY 106 +#define EC_R_POINT_COORDINATES_BLIND_FAILURE 163 +#define EC_R_POINT_IS_NOT_ON_CURVE 107 +#define EC_R_RANDOM_NUMBER_GENERATION_FAILED 158 +#define EC_R_SHARED_INFO_ERROR 150 +#define EC_R_SLOT_FULL 108 +#define EC_R_TOO_MANY_RETRIES 176 +#define EC_R_UNDEFINED_GENERATOR 113 +#define EC_R_UNDEFINED_ORDER 128 +#define EC_R_UNKNOWN_COFACTOR 164 +#define EC_R_UNKNOWN_GROUP 129 +#define EC_R_UNKNOWN_ORDER 114 +#define EC_R_UNSUPPORTED_FIELD 131 +#define EC_R_WRONG_CURVE_PARAMETERS 145 +#define EC_R_WRONG_ORDER 130 + +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/encoder.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/encoder.h new file mode 100644 index 0000000000000000000000000000000000000000..9138c07276b6983f551200c68286c9fec026767a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/encoder.h @@ -0,0 +1,124 @@ +/* + * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_ENCODER_H +#define OPENSSL_ENCODER_H +#pragma once + +#include + +#ifndef OPENSSL_NO_STDIO +#include +#endif +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +OSSL_ENCODER *OSSL_ENCODER_fetch(OSSL_LIB_CTX *libctx, const char *name, + const char *properties); +int OSSL_ENCODER_up_ref(OSSL_ENCODER *encoder); +void OSSL_ENCODER_free(OSSL_ENCODER *encoder); + +const OSSL_PROVIDER *OSSL_ENCODER_get0_provider(const OSSL_ENCODER *encoder); +const char *OSSL_ENCODER_get0_properties(const OSSL_ENCODER *encoder); +const char *OSSL_ENCODER_get0_name(const OSSL_ENCODER *kdf); +const char *OSSL_ENCODER_get0_description(const OSSL_ENCODER *kdf); +int OSSL_ENCODER_is_a(const OSSL_ENCODER *encoder, const char *name); + +void OSSL_ENCODER_do_all_provided(OSSL_LIB_CTX *libctx, + void (*fn)(OSSL_ENCODER *encoder, void *arg), + void *arg); +int OSSL_ENCODER_names_do_all(const OSSL_ENCODER *encoder, + void (*fn)(const char *name, void *data), + void *data); +const OSSL_PARAM *OSSL_ENCODER_gettable_params(OSSL_ENCODER *encoder); +int OSSL_ENCODER_get_params(OSSL_ENCODER *encoder, OSSL_PARAM params[]); + +const OSSL_PARAM *OSSL_ENCODER_settable_ctx_params(OSSL_ENCODER *encoder); +OSSL_ENCODER_CTX *OSSL_ENCODER_CTX_new(void); +int OSSL_ENCODER_CTX_set_params(OSSL_ENCODER_CTX *ctx, + const OSSL_PARAM params[]); +void OSSL_ENCODER_CTX_free(OSSL_ENCODER_CTX *ctx); + +/* Utilities that help set specific parameters */ +int OSSL_ENCODER_CTX_set_passphrase(OSSL_ENCODER_CTX *ctx, + const unsigned char *kstr, size_t klen); +int OSSL_ENCODER_CTX_set_pem_password_cb(OSSL_ENCODER_CTX *ctx, + pem_password_cb *cb, void *cbarg); +int OSSL_ENCODER_CTX_set_passphrase_cb(OSSL_ENCODER_CTX *ctx, + OSSL_PASSPHRASE_CALLBACK *cb, + void *cbarg); +int OSSL_ENCODER_CTX_set_passphrase_ui(OSSL_ENCODER_CTX *ctx, + const UI_METHOD *ui_method, + void *ui_data); +int OSSL_ENCODER_CTX_set_cipher(OSSL_ENCODER_CTX *ctx, + const char *cipher_name, + const char *propquery); +int OSSL_ENCODER_CTX_set_selection(OSSL_ENCODER_CTX *ctx, int selection); +int OSSL_ENCODER_CTX_set_output_type(OSSL_ENCODER_CTX *ctx, + const char *output_type); +int OSSL_ENCODER_CTX_set_output_structure(OSSL_ENCODER_CTX *ctx, + const char *output_structure); + +/* Utilities to add encoders */ +int OSSL_ENCODER_CTX_add_encoder(OSSL_ENCODER_CTX *ctx, OSSL_ENCODER *encoder); +int OSSL_ENCODER_CTX_add_extra(OSSL_ENCODER_CTX *ctx, + OSSL_LIB_CTX *libctx, const char *propq); +int OSSL_ENCODER_CTX_get_num_encoders(OSSL_ENCODER_CTX *ctx); + +typedef struct ossl_encoder_instance_st OSSL_ENCODER_INSTANCE; +OSSL_ENCODER * +OSSL_ENCODER_INSTANCE_get_encoder(OSSL_ENCODER_INSTANCE *encoder_inst); +void * +OSSL_ENCODER_INSTANCE_get_encoder_ctx(OSSL_ENCODER_INSTANCE *encoder_inst); +const char * +OSSL_ENCODER_INSTANCE_get_output_type(OSSL_ENCODER_INSTANCE *encoder_inst); +const char * +OSSL_ENCODER_INSTANCE_get_output_structure(OSSL_ENCODER_INSTANCE *encoder_inst); + +typedef const void *OSSL_ENCODER_CONSTRUCT(OSSL_ENCODER_INSTANCE *encoder_inst, + void *construct_data); +typedef void OSSL_ENCODER_CLEANUP(void *construct_data); + +int OSSL_ENCODER_CTX_set_construct(OSSL_ENCODER_CTX *ctx, + OSSL_ENCODER_CONSTRUCT *construct); +int OSSL_ENCODER_CTX_set_construct_data(OSSL_ENCODER_CTX *ctx, + void *construct_data); +int OSSL_ENCODER_CTX_set_cleanup(OSSL_ENCODER_CTX *ctx, + OSSL_ENCODER_CLEANUP *cleanup); + +/* Utilities to output the object to encode */ +int OSSL_ENCODER_to_bio(OSSL_ENCODER_CTX *ctx, BIO *out); +#ifndef OPENSSL_NO_STDIO +int OSSL_ENCODER_to_fp(OSSL_ENCODER_CTX *ctx, FILE *fp); +#endif +int OSSL_ENCODER_to_data(OSSL_ENCODER_CTX *ctx, unsigned char **pdata, + size_t *pdata_len); + +/* + * Create the OSSL_ENCODER_CTX with an associated type. This will perform + * an implicit OSSL_ENCODER_fetch(), suitable for the object of that type. + * This is more useful than calling OSSL_ENCODER_CTX_new(). + */ +OSSL_ENCODER_CTX *OSSL_ENCODER_CTX_new_for_pkey(const EVP_PKEY *pkey, + int selection, + const char *output_type, + const char *output_struct, + const char *propquery); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/encodererr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/encodererr.h new file mode 100644 index 0000000000000000000000000000000000000000..e07174c3acd23020fec8edcb8d541a0e34fa430f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/encodererr.h @@ -0,0 +1,26 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_ENCODERERR_H +#define OPENSSL_ENCODERERR_H +#pragma once + +#include +#include +#include + +/* + * OSSL_ENCODER reason codes. + */ +#define OSSL_ENCODER_R_ENCODER_NOT_FOUND 101 +#define OSSL_ENCODER_R_INCORRECT_PROPERTY_QUERY 100 +#define OSSL_ENCODER_R_MISSING_GET_PARAMS 102 + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/engine.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/engine.h new file mode 100644 index 0000000000000000000000000000000000000000..73f6d86aaf70402451462a05c957160b0f5d0d86 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/engine.h @@ -0,0 +1,841 @@ +/* + * Copyright 2000-2022 The OpenSSL Project Authors. All Rights Reserved. + * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_ENGINE_H +#define OPENSSL_ENGINE_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_ENGINE_H +#endif + +#include + +#ifndef OPENSSL_NO_ENGINE +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#include +#include +#include +#include +#include +#include +#include +#include +#endif +#include +#include +#include +#include +#ifdef __cplusplus +extern "C" { +#endif + +/* + * These flags are used to control combinations of algorithm (methods) by + * bitwise "OR"ing. + */ +#define ENGINE_METHOD_RSA (unsigned int)0x0001 +#define ENGINE_METHOD_DSA (unsigned int)0x0002 +#define ENGINE_METHOD_DH (unsigned int)0x0004 +#define ENGINE_METHOD_RAND (unsigned int)0x0008 +#define ENGINE_METHOD_CIPHERS (unsigned int)0x0040 +#define ENGINE_METHOD_DIGESTS (unsigned int)0x0080 +#define ENGINE_METHOD_PKEY_METHS (unsigned int)0x0200 +#define ENGINE_METHOD_PKEY_ASN1_METHS (unsigned int)0x0400 +#define ENGINE_METHOD_EC (unsigned int)0x0800 +/* Obvious all-or-nothing cases. */ +#define ENGINE_METHOD_ALL (unsigned int)0xFFFF +#define ENGINE_METHOD_NONE (unsigned int)0x0000 + +/* + * This(ese) flag(s) controls behaviour of the ENGINE_TABLE mechanism used + * internally to control registration of ENGINE implementations, and can be + * set by ENGINE_set_table_flags(). The "NOINIT" flag prevents attempts to + * initialise registered ENGINEs if they are not already initialised. + */ +#define ENGINE_TABLE_FLAG_NOINIT (unsigned int)0x0001 + +/* ENGINE flags that can be set by ENGINE_set_flags(). */ +/* Not used */ +/* #define ENGINE_FLAGS_MALLOCED 0x0001 */ + +/* + * This flag is for ENGINEs that wish to handle the various 'CMD'-related + * control commands on their own. Without this flag, ENGINE_ctrl() handles + * these control commands on behalf of the ENGINE using their "cmd_defns" + * data. + */ +#define ENGINE_FLAGS_MANUAL_CMD_CTRL (int)0x0002 + +/* + * This flag is for ENGINEs who return new duplicate structures when found + * via "ENGINE_by_id()". When an ENGINE must store state (eg. if + * ENGINE_ctrl() commands are called in sequence as part of some stateful + * process like key-generation setup and execution), it can set this flag - + * then each attempt to obtain the ENGINE will result in it being copied into + * a new structure. Normally, ENGINEs don't declare this flag so + * ENGINE_by_id() just increments the existing ENGINE's structural reference + * count. + */ +#define ENGINE_FLAGS_BY_ID_COPY (int)0x0004 + +/* + * This flag is for an ENGINE that does not want its methods registered as + * part of ENGINE_register_all_complete() for example if the methods are not + * usable as default methods. + */ + +#define ENGINE_FLAGS_NO_REGISTER_ALL (int)0x0008 + +/* + * ENGINEs can support their own command types, and these flags are used in + * ENGINE_CTRL_GET_CMD_FLAGS to indicate to the caller what kind of input + * each command expects. Currently only numeric and string input is + * supported. If a control command supports none of the _NUMERIC, _STRING, or + * _NO_INPUT options, then it is regarded as an "internal" control command - + * and not for use in config setting situations. As such, they're not + * available to the ENGINE_ctrl_cmd_string() function, only raw ENGINE_ctrl() + * access. Changes to this list of 'command types' should be reflected + * carefully in ENGINE_cmd_is_executable() and ENGINE_ctrl_cmd_string(). + */ + +/* accepts a 'long' input value (3rd parameter to ENGINE_ctrl) */ +#define ENGINE_CMD_FLAG_NUMERIC (unsigned int)0x0001 +/* + * accepts string input (cast from 'void*' to 'const char *', 4th parameter + * to ENGINE_ctrl) + */ +#define ENGINE_CMD_FLAG_STRING (unsigned int)0x0002 +/* + * Indicates that the control command takes *no* input. Ie. the control + * command is unparameterised. + */ +#define ENGINE_CMD_FLAG_NO_INPUT (unsigned int)0x0004 +/* + * Indicates that the control command is internal. This control command won't + * be shown in any output, and is only usable through the ENGINE_ctrl_cmd() + * function. + */ +#define ENGINE_CMD_FLAG_INTERNAL (unsigned int)0x0008 + +/* + * NB: These 3 control commands are deprecated and should not be used. + * ENGINEs relying on these commands should compile conditional support for + * compatibility (eg. if these symbols are defined) but should also migrate + * the same functionality to their own ENGINE-specific control functions that + * can be "discovered" by calling applications. The fact these control + * commands wouldn't be "executable" (ie. usable by text-based config) + * doesn't change the fact that application code can find and use them + * without requiring per-ENGINE hacking. + */ + +/* + * These flags are used to tell the ctrl function what should be done. All + * command numbers are shared between all engines, even if some don't make + * sense to some engines. In such a case, they do nothing but return the + * error ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED. + */ +#define ENGINE_CTRL_SET_LOGSTREAM 1 +#define ENGINE_CTRL_SET_PASSWORD_CALLBACK 2 +#define ENGINE_CTRL_HUP 3 /* Close and reinitialise \ + * any handles/connections \ + * etc. */ +#define ENGINE_CTRL_SET_USER_INTERFACE 4 /* Alternative to callback */ +#define ENGINE_CTRL_SET_CALLBACK_DATA 5 /* User-specific data, used \ + * when calling the password \ + * callback and the user \ + * interface */ +#define ENGINE_CTRL_LOAD_CONFIGURATION 6 /* Load a configuration, \ + * given a string that \ + * represents a file name \ + * or so */ +#define ENGINE_CTRL_LOAD_SECTION 7 /* Load data from a given \ + * section in the already \ + * loaded configuration */ + +/* + * These control commands allow an application to deal with an arbitrary + * engine in a dynamic way. Warn: Negative return values indicate errors FOR + * THESE COMMANDS because zero is used to indicate 'end-of-list'. Other + * commands, including ENGINE-specific command types, return zero for an + * error. An ENGINE can choose to implement these ctrl functions, and can + * internally manage things however it chooses - it does so by setting the + * ENGINE_FLAGS_MANUAL_CMD_CTRL flag (using ENGINE_set_flags()). Otherwise + * the ENGINE_ctrl() code handles this on the ENGINE's behalf using the + * cmd_defns data (set using ENGINE_set_cmd_defns()). This means an ENGINE's + * ctrl() handler need only implement its own commands - the above "meta" + * commands will be taken care of. + */ + +/* + * Returns non-zero if the supplied ENGINE has a ctrl() handler. If "not", + * then all the remaining control commands will return failure, so it is + * worth checking this first if the caller is trying to "discover" the + * engine's capabilities and doesn't want errors generated unnecessarily. + */ +#define ENGINE_CTRL_HAS_CTRL_FUNCTION 10 +/* + * Returns a positive command number for the first command supported by the + * engine. Returns zero if no ctrl commands are supported. + */ +#define ENGINE_CTRL_GET_FIRST_CMD_TYPE 11 +/* + * The 'long' argument specifies a command implemented by the engine, and the + * return value is the next command supported, or zero if there are no more. + */ +#define ENGINE_CTRL_GET_NEXT_CMD_TYPE 12 +/* + * The 'void*' argument is a command name (cast from 'const char *'), and the + * return value is the command that corresponds to it. + */ +#define ENGINE_CTRL_GET_CMD_FROM_NAME 13 +/* + * The next two allow a command to be converted into its corresponding string + * form. In each case, the 'long' argument supplies the command. In the + * NAME_LEN case, the return value is the length of the command name (not + * counting a trailing EOL). In the NAME case, the 'void*' argument must be a + * string buffer large enough, and it will be populated with the name of the + * command (WITH a trailing EOL). + */ +#define ENGINE_CTRL_GET_NAME_LEN_FROM_CMD 14 +#define ENGINE_CTRL_GET_NAME_FROM_CMD 15 +/* The next two are similar but give a "short description" of a command. */ +#define ENGINE_CTRL_GET_DESC_LEN_FROM_CMD 16 +#define ENGINE_CTRL_GET_DESC_FROM_CMD 17 +/* + * With this command, the return value is the OR'd combination of + * ENGINE_CMD_FLAG_*** values that indicate what kind of input a given + * engine-specific ctrl command expects. + */ +#define ENGINE_CTRL_GET_CMD_FLAGS 18 + +/* + * ENGINE implementations should start the numbering of their own control + * commands from this value. (ie. ENGINE_CMD_BASE, ENGINE_CMD_BASE + 1, etc). + */ +#define ENGINE_CMD_BASE 200 + +/* + * NB: These 2 nCipher "chil" control commands are deprecated, and their + * functionality is now available through ENGINE-specific control commands + * (exposed through the above-mentioned 'CMD'-handling). Code using these 2 + * commands should be migrated to the more general command handling before + * these are removed. + */ + +/* Flags specific to the nCipher "chil" engine */ +#define ENGINE_CTRL_CHIL_SET_FORKCHECK 100 +/* + * Depending on the value of the (long)i argument, this sets or + * unsets the SimpleForkCheck flag in the CHIL API to enable or + * disable checking and workarounds for applications that fork(). + */ +#define ENGINE_CTRL_CHIL_NO_LOCKING 101 +/* + * This prevents the initialisation function from providing mutex + * callbacks to the nCipher library. + */ + +/* + * If an ENGINE supports its own specific control commands and wishes the + * framework to handle the above 'ENGINE_CMD_***'-manipulation commands on + * its behalf, it should supply a null-terminated array of ENGINE_CMD_DEFN + * entries to ENGINE_set_cmd_defns(). It should also implement a ctrl() + * handler that supports the stated commands (ie. the "cmd_num" entries as + * described by the array). NB: The array must be ordered in increasing order + * of cmd_num. "null-terminated" means that the last ENGINE_CMD_DEFN element + * has cmd_num set to zero and/or cmd_name set to NULL. + */ +typedef struct ENGINE_CMD_DEFN_st { + unsigned int cmd_num; /* The command number */ + const char *cmd_name; /* The command name itself */ + const char *cmd_desc; /* A short description of the command */ + unsigned int cmd_flags; /* The input the command expects */ +} ENGINE_CMD_DEFN; + +/* Generic function pointer */ +typedef int (*ENGINE_GEN_FUNC_PTR)(void); +/* Generic function pointer taking no arguments */ +typedef int (*ENGINE_GEN_INT_FUNC_PTR)(ENGINE *); +/* Specific control function pointer */ +typedef int (*ENGINE_CTRL_FUNC_PTR)(ENGINE *, int, long, void *, + void (*f)(void)); +/* Generic load_key function pointer */ +typedef EVP_PKEY *(*ENGINE_LOAD_KEY_PTR)(ENGINE *, const char *, + UI_METHOD *ui_method, + void *callback_data); +typedef int (*ENGINE_SSL_CLIENT_CERT_PTR)(ENGINE *, SSL *ssl, + STACK_OF(X509_NAME) *ca_dn, + X509 **pcert, EVP_PKEY **pkey, + STACK_OF(X509) **pother, + UI_METHOD *ui_method, + void *callback_data); +/*- + * These callback types are for an ENGINE's handler for cipher and digest logic. + * These handlers have these prototypes; + * int foo(ENGINE *e, const EVP_CIPHER **cipher, const int **nids, int nid); + * int foo(ENGINE *e, const EVP_MD **digest, const int **nids, int nid); + * Looking at how to implement these handlers in the case of cipher support, if + * the framework wants the EVP_CIPHER for 'nid', it will call; + * foo(e, &p_evp_cipher, NULL, nid); (return zero for failure) + * If the framework wants a list of supported 'nid's, it will call; + * foo(e, NULL, &p_nids, 0); (returns number of 'nids' or -1 for error) + */ +/* + * Returns to a pointer to the array of supported cipher 'nid's. If the + * second parameter is non-NULL it is set to the size of the returned array. + */ +typedef int (*ENGINE_CIPHERS_PTR)(ENGINE *, const EVP_CIPHER **, + const int **, int); +typedef int (*ENGINE_DIGESTS_PTR)(ENGINE *, const EVP_MD **, const int **, + int); +typedef int (*ENGINE_PKEY_METHS_PTR)(ENGINE *, EVP_PKEY_METHOD **, + const int **, int); +typedef int (*ENGINE_PKEY_ASN1_METHS_PTR)(ENGINE *, EVP_PKEY_ASN1_METHOD **, + const int **, int); +/* + * STRUCTURE functions ... all of these functions deal with pointers to + * ENGINE structures where the pointers have a "structural reference". This + * means that their reference is to allowed access to the structure but it + * does not imply that the structure is functional. To simply increment or + * decrement the structural reference count, use ENGINE_by_id and + * ENGINE_free. NB: This is not required when iterating using ENGINE_get_next + * as it will automatically decrement the structural reference count of the + * "current" ENGINE and increment the structural reference count of the + * ENGINE it returns (unless it is NULL). + */ + +/* Get the first/last "ENGINE" type available. */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_first(void); +OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_last(void); +#endif +/* Iterate to the next/previous "ENGINE" type (NULL = end of the list). */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_next(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_prev(ENGINE *e); +#endif +/* Add another "ENGINE" type into the array. */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int ENGINE_add(ENGINE *e); +#endif +/* Remove an existing "ENGINE" type from the array. */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int ENGINE_remove(ENGINE *e); +#endif +/* Retrieve an engine from the list by its unique "id" value. */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_by_id(const char *id); +#endif + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define ENGINE_load_openssl() \ + OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_OPENSSL, NULL) +#define ENGINE_load_dynamic() \ + OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_DYNAMIC, NULL) +#ifndef OPENSSL_NO_STATIC_ENGINE +#define ENGINE_load_padlock() \ + OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_PADLOCK, NULL) +#define ENGINE_load_capi() \ + OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_CAPI, NULL) +#define ENGINE_load_afalg() \ + OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_AFALG, NULL) +#endif +#define ENGINE_load_cryptodev() \ + OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_CRYPTODEV, NULL) +#define ENGINE_load_rdrand() \ + OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_RDRAND, NULL) +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 void ENGINE_load_builtin_engines(void); +#endif + +/* + * Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation + * "registry" handling. + */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 unsigned int ENGINE_get_table_flags(void); +OSSL_DEPRECATEDIN_3_0 void ENGINE_set_table_flags(unsigned int flags); +#endif + +/*- Manage registration of ENGINEs per "table". For each type, there are 3 + * functions; + * ENGINE_register_***(e) - registers the implementation from 'e' (if it has one) + * ENGINE_unregister_***(e) - unregister the implementation from 'e' + * ENGINE_register_all_***() - call ENGINE_register_***() for each 'e' in the list + * Cleanup is automatically registered from each table when required. + */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int ENGINE_register_RSA(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_RSA(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_RSA(void); +OSSL_DEPRECATEDIN_3_0 int ENGINE_register_DSA(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_DSA(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_DSA(void); +OSSL_DEPRECATEDIN_3_0 int ENGINE_register_EC(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_EC(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_EC(void); +OSSL_DEPRECATEDIN_3_0 int ENGINE_register_DH(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_DH(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_DH(void); +OSSL_DEPRECATEDIN_3_0 int ENGINE_register_RAND(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_RAND(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_RAND(void); +OSSL_DEPRECATEDIN_3_0 int ENGINE_register_ciphers(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_ciphers(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_ciphers(void); +OSSL_DEPRECATEDIN_3_0 int ENGINE_register_digests(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_digests(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_digests(void); +OSSL_DEPRECATEDIN_3_0 int ENGINE_register_pkey_meths(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_pkey_meths(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_pkey_meths(void); +OSSL_DEPRECATEDIN_3_0 int ENGINE_register_pkey_asn1_meths(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_pkey_asn1_meths(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_pkey_asn1_meths(void); +#endif + +/* + * These functions register all support from the above categories. Note, use + * of these functions can result in static linkage of code your application + * may not need. If you only need a subset of functionality, consider using + * more selective initialisation. + */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int ENGINE_register_complete(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 int ENGINE_register_all_complete(void); +#endif + +/* + * Send parameterised control commands to the engine. The possibilities to + * send down an integer, a pointer to data or a function pointer are + * provided. Any of the parameters may or may not be NULL, depending on the + * command number. In actuality, this function only requires a structural + * (rather than functional) reference to an engine, but many control commands + * may require the engine be functional. The caller should be aware of trying + * commands that require an operational ENGINE, and only use functional + * references in such situations. + */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p, + void (*f)(void)); +#endif + +/* + * This function tests if an ENGINE-specific command is usable as a + * "setting". Eg. in an application's config file that gets processed through + * ENGINE_ctrl_cmd_string(). If this returns zero, it is not available to + * ENGINE_ctrl_cmd_string(), only ENGINE_ctrl(). + */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int ENGINE_cmd_is_executable(ENGINE *e, int cmd); +#endif + +/* + * This function works like ENGINE_ctrl() with the exception of taking a + * command name instead of a command number, and can handle optional + * commands. See the comment on ENGINE_ctrl_cmd_string() for an explanation + * on how to use the cmd_name and cmd_optional. + */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name, + long i, void *p, void (*f)(void), + int cmd_optional); +#endif + +/* + * This function passes a command-name and argument to an ENGINE. The + * cmd_name is converted to a command number and the control command is + * called using 'arg' as an argument (unless the ENGINE doesn't support such + * a command, in which case no control command is called). The command is + * checked for input flags, and if necessary the argument will be converted + * to a numeric value. If cmd_optional is non-zero, then if the ENGINE + * doesn't support the given cmd_name the return value will be success + * anyway. This function is intended for applications to use so that users + * (or config files) can supply engine-specific config data to the ENGINE at + * run-time to control behaviour of specific engines. As such, it shouldn't + * be used for calling ENGINE_ctrl() functions that return data, deal with + * binary data, or that are otherwise supposed to be used directly through + * ENGINE_ctrl() in application code. Any "return" data from an ENGINE_ctrl() + * operation in this function will be lost - the return value is interpreted + * as failure if the return value is zero, success otherwise, and this + * function returns a boolean value as a result. In other words, vendors of + * 'ENGINE'-enabled devices should write ENGINE implementations with + * parameterisations that work in this scheme, so that compliant ENGINE-based + * applications can work consistently with the same configuration for the + * same ENGINE-enabled devices, across applications. + */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg, + int cmd_optional); +#endif + +/* + * These functions are useful for manufacturing new ENGINE structures. They + * don't address reference counting at all - one uses them to populate an + * ENGINE structure with personalised implementations of things prior to + * using it directly or adding it to the builtin ENGINE list in OpenSSL. + * These are also here so that the ENGINE structure doesn't have to be + * exposed and break binary compatibility! + */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_new(void); +OSSL_DEPRECATEDIN_3_0 int ENGINE_free(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 int ENGINE_up_ref(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 int ENGINE_set_id(ENGINE *e, const char *id); +OSSL_DEPRECATEDIN_3_0 int ENGINE_set_name(ENGINE *e, const char *name); +OSSL_DEPRECATEDIN_3_0 int ENGINE_set_RSA(ENGINE *e, const RSA_METHOD *rsa_meth); +OSSL_DEPRECATEDIN_3_0 int ENGINE_set_DSA(ENGINE *e, const DSA_METHOD *dsa_meth); +OSSL_DEPRECATEDIN_3_0 int ENGINE_set_EC(ENGINE *e, const EC_KEY_METHOD *ecdsa_meth); +OSSL_DEPRECATEDIN_3_0 int ENGINE_set_DH(ENGINE *e, const DH_METHOD *dh_meth); +OSSL_DEPRECATEDIN_3_0 int ENGINE_set_RAND(ENGINE *e, const RAND_METHOD *rand_meth); +OSSL_DEPRECATEDIN_3_0 +int ENGINE_set_destroy_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR destroy_f); +OSSL_DEPRECATEDIN_3_0 +int ENGINE_set_init_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f); +OSSL_DEPRECATEDIN_3_0 +int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f); +OSSL_DEPRECATEDIN_3_0 +int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f); +OSSL_DEPRECATEDIN_3_0 +int ENGINE_set_load_privkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpriv_f); +OSSL_DEPRECATEDIN_3_0 +int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f); +OSSL_DEPRECATEDIN_3_0 +int ENGINE_set_load_ssl_client_cert_function(ENGINE *e, + ENGINE_SSL_CLIENT_CERT_PTR loadssl_f); +OSSL_DEPRECATEDIN_3_0 +int ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f); +OSSL_DEPRECATEDIN_3_0 +int ENGINE_set_digests(ENGINE *e, ENGINE_DIGESTS_PTR f); +OSSL_DEPRECATEDIN_3_0 +int ENGINE_set_pkey_meths(ENGINE *e, ENGINE_PKEY_METHS_PTR f); +OSSL_DEPRECATEDIN_3_0 +int ENGINE_set_pkey_asn1_meths(ENGINE *e, ENGINE_PKEY_ASN1_METHS_PTR f); +OSSL_DEPRECATEDIN_3_0 int ENGINE_set_flags(ENGINE *e, int flags); +OSSL_DEPRECATEDIN_3_0 int ENGINE_set_cmd_defns(ENGINE *e, + const ENGINE_CMD_DEFN *defns); +#endif +/* These functions allow control over any per-structure ENGINE data. */ +#define ENGINE_get_ex_new_index(l, p, newf, dupf, freef) \ + CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_ENGINE, l, p, newf, dupf, freef) +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg); +OSSL_DEPRECATEDIN_3_0 void *ENGINE_get_ex_data(const ENGINE *e, int idx); +#endif + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +/* + * This function previously cleaned up anything that needs it. Auto-deinit will + * now take care of it so it is no longer required to call this function. + */ +#define ENGINE_cleanup() \ + while (0) \ + continue +#endif + +/* + * These return values from within the ENGINE structure. These can be useful + * with functional references as well as structural references - it depends + * which you obtained. Using the result for functional purposes if you only + * obtained a structural reference may be problematic! + */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 const char *ENGINE_get_id(const ENGINE *e); +OSSL_DEPRECATEDIN_3_0 const char *ENGINE_get_name(const ENGINE *e); +OSSL_DEPRECATEDIN_3_0 const RSA_METHOD *ENGINE_get_RSA(const ENGINE *e); +OSSL_DEPRECATEDIN_3_0 const DSA_METHOD *ENGINE_get_DSA(const ENGINE *e); +OSSL_DEPRECATEDIN_3_0 const EC_KEY_METHOD *ENGINE_get_EC(const ENGINE *e); +OSSL_DEPRECATEDIN_3_0 const DH_METHOD *ENGINE_get_DH(const ENGINE *e); +OSSL_DEPRECATEDIN_3_0 const RAND_METHOD *ENGINE_get_RAND(const ENGINE *e); +OSSL_DEPRECATEDIN_3_0 +ENGINE_GEN_INT_FUNC_PTR ENGINE_get_destroy_function(const ENGINE *e); +OSSL_DEPRECATEDIN_3_0 +ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(const ENGINE *e); +OSSL_DEPRECATEDIN_3_0 +ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(const ENGINE *e); +OSSL_DEPRECATEDIN_3_0 +ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(const ENGINE *e); +OSSL_DEPRECATEDIN_3_0 +ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e); +OSSL_DEPRECATEDIN_3_0 +ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e); +OSSL_DEPRECATEDIN_3_0 +ENGINE_SSL_CLIENT_CERT_PTR ENGINE_get_ssl_client_cert_function(const ENGINE *e); +OSSL_DEPRECATEDIN_3_0 +ENGINE_CIPHERS_PTR ENGINE_get_ciphers(const ENGINE *e); +OSSL_DEPRECATEDIN_3_0 +ENGINE_DIGESTS_PTR ENGINE_get_digests(const ENGINE *e); +OSSL_DEPRECATEDIN_3_0 +ENGINE_PKEY_METHS_PTR ENGINE_get_pkey_meths(const ENGINE *e); +OSSL_DEPRECATEDIN_3_0 +ENGINE_PKEY_ASN1_METHS_PTR ENGINE_get_pkey_asn1_meths(const ENGINE *e); +OSSL_DEPRECATEDIN_3_0 +const EVP_CIPHER *ENGINE_get_cipher(ENGINE *e, int nid); +OSSL_DEPRECATEDIN_3_0 +const EVP_MD *ENGINE_get_digest(ENGINE *e, int nid); +OSSL_DEPRECATEDIN_3_0 +const EVP_PKEY_METHOD *ENGINE_get_pkey_meth(ENGINE *e, int nid); +OSSL_DEPRECATEDIN_3_0 +const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth(ENGINE *e, int nid); +OSSL_DEPRECATEDIN_3_0 +const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth_str(ENGINE *e, + const char *str, + int len); +OSSL_DEPRECATEDIN_3_0 +const EVP_PKEY_ASN1_METHOD *ENGINE_pkey_asn1_find_str(ENGINE **pe, + const char *str, int len); +OSSL_DEPRECATEDIN_3_0 +const ENGINE_CMD_DEFN *ENGINE_get_cmd_defns(const ENGINE *e); +OSSL_DEPRECATEDIN_3_0 int ENGINE_get_flags(const ENGINE *e); +#endif + +/* + * FUNCTIONAL functions. These functions deal with ENGINE structures that + * have (or will) be initialised for use. Broadly speaking, the structural + * functions are useful for iterating the list of available engine types, + * creating new engine types, and other "list" operations. These functions + * actually deal with ENGINEs that are to be used. As such these functions + * can fail (if applicable) when particular engines are unavailable - eg. if + * a hardware accelerator is not attached or not functioning correctly. Each + * ENGINE has 2 reference counts; structural and functional. Every time a + * functional reference is obtained or released, a corresponding structural + * reference is automatically obtained or released too. + */ + +/* + * Initialise an engine type for use (or up its reference count if it's + * already in use). This will fail if the engine is not currently operational + * and cannot initialise. + */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int ENGINE_init(ENGINE *e); +#endif +/* + * Free a functional reference to an engine type. This does not require a + * corresponding call to ENGINE_free as it also releases a structural + * reference. + */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int ENGINE_finish(ENGINE *e); +#endif + +/* + * The following functions handle keys that are stored in some secondary + * location, handled by the engine. The storage may be on a card or + * whatever. + */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id, + UI_METHOD *ui_method, void *callback_data); +OSSL_DEPRECATEDIN_3_0 +EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id, + UI_METHOD *ui_method, void *callback_data); +OSSL_DEPRECATEDIN_3_0 +int ENGINE_load_ssl_client_cert(ENGINE *e, SSL *s, STACK_OF(X509_NAME) *ca_dn, + X509 **pcert, EVP_PKEY **ppkey, + STACK_OF(X509) **pother, + UI_METHOD *ui_method, void *callback_data); +#endif + +/* + * This returns a pointer for the current ENGINE structure that is (by + * default) performing any RSA operations. The value returned is an + * incremented reference, so it should be free'd (ENGINE_finish) before it is + * discarded. + */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_RSA(void); +#endif +/* Same for the other "methods" */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_DSA(void); +OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_EC(void); +OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_DH(void); +OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_RAND(void); +#endif +/* + * These functions can be used to get a functional reference to perform + * ciphering or digesting corresponding to "nid". + */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_cipher_engine(int nid); +OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_digest_engine(int nid); +OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_pkey_meth_engine(int nid); +OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_pkey_asn1_meth_engine(int nid); +#endif + +/* + * This sets a new default ENGINE structure for performing RSA operations. If + * the result is non-zero (success) then the ENGINE structure will have had + * its reference count up'd so the caller should still free their own + * reference 'e'. + */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_RSA(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_string(ENGINE *e, + const char *def_list); +#endif +/* Same for the other "methods" */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_DSA(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_EC(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_DH(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_RAND(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_ciphers(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_digests(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_pkey_meths(ENGINE *e); +OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_pkey_asn1_meths(ENGINE *e); +#endif + +/* + * The combination "set" - the flags are bitwise "OR"d from the + * ENGINE_METHOD_*** defines above. As with the "ENGINE_register_complete()" + * function, this function can result in unnecessary static linkage. If your + * application requires only specific functionality, consider using more + * selective functions. + */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default(ENGINE *e, unsigned int flags); +OSSL_DEPRECATEDIN_3_0 void ENGINE_add_conf_module(void); +#endif + +/* Deprecated functions ... */ +/* int ENGINE_clear_defaults(void); */ + +/**************************/ +/* DYNAMIC ENGINE SUPPORT */ +/**************************/ + +/* Binary/behaviour compatibility levels */ +#define OSSL_DYNAMIC_VERSION (unsigned long)0x00030000 +/* + * Binary versions older than this are too old for us (whether we're a loader + * or a loadee) + */ +#define OSSL_DYNAMIC_OLDEST (unsigned long)0x00030000 + +/* + * When compiling an ENGINE entirely as an external shared library, loadable + * by the "dynamic" ENGINE, these types are needed. The 'dynamic_fns' + * structure type provides the calling application's (or library's) error + * functionality and memory management function pointers to the loaded + * library. These should be used/set in the loaded library code so that the + * loading application's 'state' will be used/changed in all operations. The + * 'static_state' pointer allows the loaded library to know if it shares the + * same static data as the calling application (or library), and thus whether + * these callbacks need to be set or not. + */ +typedef void *(*dyn_MEM_malloc_fn)(size_t, const char *, int); +typedef void *(*dyn_MEM_realloc_fn)(void *, size_t, const char *, int); +typedef void (*dyn_MEM_free_fn)(void *, const char *, int); +typedef struct st_dynamic_MEM_fns { + dyn_MEM_malloc_fn malloc_fn; + dyn_MEM_realloc_fn realloc_fn; + dyn_MEM_free_fn free_fn; +} dynamic_MEM_fns; +/* + * FIXME: Perhaps the memory and locking code (crypto.h) should declare and + * use these types so we (and any other dependent code) can simplify a bit?? + */ +/* The top-level structure */ +typedef struct st_dynamic_fns { + void *static_state; + dynamic_MEM_fns mem_fns; +} dynamic_fns; + +/* + * The version checking function should be of this prototype. NB: The + * ossl_version value passed in is the OSSL_DYNAMIC_VERSION of the loading + * code. If this function returns zero, it indicates a (potential) version + * incompatibility and the loaded library doesn't believe it can proceed. + * Otherwise, the returned value is the (latest) version supported by the + * loading library. The loader may still decide that the loaded code's + * version is unsatisfactory and could veto the load. The function is + * expected to be implemented with the symbol name "v_check", and a default + * implementation can be fully instantiated with + * IMPLEMENT_DYNAMIC_CHECK_FN(). + */ +typedef unsigned long (*dynamic_v_check_fn)(unsigned long ossl_version); +#define IMPLEMENT_DYNAMIC_CHECK_FN() \ + OPENSSL_EXPORT unsigned long v_check(unsigned long v); \ + OPENSSL_EXPORT unsigned long v_check(unsigned long v) \ + { \ + if (v >= OSSL_DYNAMIC_OLDEST) \ + return OSSL_DYNAMIC_VERSION; \ + return 0; \ + } + +/* + * This function is passed the ENGINE structure to initialise with its own + * function and command settings. It should not adjust the structural or + * functional reference counts. If this function returns zero, (a) the load + * will be aborted, (b) the previous ENGINE state will be memcpy'd back onto + * the structure, and (c) the shared library will be unloaded. So + * implementations should do their own internal cleanup in failure + * circumstances otherwise they could leak. The 'id' parameter, if non-NULL, + * represents the ENGINE id that the loader is looking for. If this is NULL, + * the shared library can choose to return failure or to initialise a + * 'default' ENGINE. If non-NULL, the shared library must initialise only an + * ENGINE matching the passed 'id'. The function is expected to be + * implemented with the symbol name "bind_engine". A standard implementation + * can be instantiated with IMPLEMENT_DYNAMIC_BIND_FN(fn) where the parameter + * 'fn' is a callback function that populates the ENGINE structure and + * returns an int value (zero for failure). 'fn' should have prototype; + * [static] int fn(ENGINE *e, const char *id); + */ +typedef int (*dynamic_bind_engine)(ENGINE *e, const char *id, + const dynamic_fns *fns); +#define IMPLEMENT_DYNAMIC_BIND_FN(fn) \ + OPENSSL_EXPORT \ + int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns); \ + OPENSSL_EXPORT \ + int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) \ + { \ + if (ENGINE_get_static_state() == fns->static_state) \ + goto skip_cbs; \ + CRYPTO_set_mem_functions(fns->mem_fns.malloc_fn, \ + fns->mem_fns.realloc_fn, \ + fns->mem_fns.free_fn); \ + OPENSSL_init_crypto(OPENSSL_INIT_NO_ATEXIT, NULL); \ + skip_cbs: \ + if (!fn(e, id)) \ + return 0; \ + return 1; \ + } + +/* + * If the loading application (or library) and the loaded ENGINE library + * share the same static data (eg. they're both dynamically linked to the + * same libcrypto.so) we need a way to avoid trying to set system callbacks - + * this would fail, and for the same reason that it's unnecessary to try. If + * the loaded ENGINE has (or gets from through the loader) its own copy of + * the libcrypto static data, we will need to set the callbacks. The easiest + * way to detect this is to have a function that returns a pointer to some + * static data and let the loading application and loaded ENGINE compare + * their respective values. + */ +void *ENGINE_get_static_state(void); + +#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +OSSL_DEPRECATEDIN_1_1_0 void ENGINE_setup_bsd_cryptodev(void); +#endif +#endif + +#ifdef __cplusplus +} +#endif +#endif /* OPENSSL_NO_ENGINE */ +#endif /* OPENSSL_ENGINE_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/engineerr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/engineerr.h new file mode 100644 index 0000000000000000000000000000000000000000..7cdfb8aa64882bc271d76dad9a1b83d03749a033 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/engineerr.h @@ -0,0 +1,61 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_ENGINEERR_H +#define OPENSSL_ENGINEERR_H +#pragma once + +#include +#include +#include + +#ifndef OPENSSL_NO_ENGINE + +/* + * ENGINE reason codes. + */ +#define ENGINE_R_ALREADY_LOADED 100 +#define ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER 133 +#define ENGINE_R_CMD_NOT_EXECUTABLE 134 +#define ENGINE_R_COMMAND_TAKES_INPUT 135 +#define ENGINE_R_COMMAND_TAKES_NO_INPUT 136 +#define ENGINE_R_CONFLICTING_ENGINE_ID 103 +#define ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED 119 +#define ENGINE_R_DSO_FAILURE 104 +#define ENGINE_R_DSO_NOT_FOUND 132 +#define ENGINE_R_ENGINES_SECTION_ERROR 148 +#define ENGINE_R_ENGINE_CONFIGURATION_ERROR 102 +#define ENGINE_R_ENGINE_IS_NOT_IN_LIST 105 +#define ENGINE_R_ENGINE_SECTION_ERROR 149 +#define ENGINE_R_FAILED_LOADING_PRIVATE_KEY 128 +#define ENGINE_R_FAILED_LOADING_PUBLIC_KEY 129 +#define ENGINE_R_FINISH_FAILED 106 +#define ENGINE_R_ID_OR_NAME_MISSING 108 +#define ENGINE_R_INIT_FAILED 109 +#define ENGINE_R_INTERNAL_LIST_ERROR 110 +#define ENGINE_R_INVALID_ARGUMENT 143 +#define ENGINE_R_INVALID_CMD_NAME 137 +#define ENGINE_R_INVALID_CMD_NUMBER 138 +#define ENGINE_R_INVALID_INIT_VALUE 151 +#define ENGINE_R_INVALID_STRING 150 +#define ENGINE_R_NOT_INITIALISED 117 +#define ENGINE_R_NOT_LOADED 112 +#define ENGINE_R_NO_CONTROL_FUNCTION 120 +#define ENGINE_R_NO_INDEX 144 +#define ENGINE_R_NO_LOAD_FUNCTION 125 +#define ENGINE_R_NO_REFERENCE 130 +#define ENGINE_R_NO_SUCH_ENGINE 116 +#define ENGINE_R_UNIMPLEMENTED_CIPHER 146 +#define ENGINE_R_UNIMPLEMENTED_DIGEST 147 +#define ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD 101 +#define ENGINE_R_VERSION_INCOMPATIBILITY 145 + +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/err.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/err.h new file mode 100644 index 0000000000000000000000000000000000000000..9370364dd118b4e9d531bb595a1b30d877ed3dc4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/err.h @@ -0,0 +1,517 @@ +/* + * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* clang-format off */ + +/* clang-format on */ + +#ifndef OPENSSL_ERR_H +#define OPENSSL_ERR_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_ERR_H +#endif + +#include + +#ifndef OPENSSL_NO_STDIO +#include +#include +#endif + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#ifndef OPENSSL_NO_FILENAMES +#define ERR_PUT_error(l, f, r, fn, ln) ERR_put_error(l, f, r, fn, ln) +#else +#define ERR_PUT_error(l, f, r, fn, ln) ERR_put_error(l, f, r, NULL, 0) +#endif +#endif + +#include +#include + +#define ERR_TXT_MALLOCED 0x01 +#define ERR_TXT_STRING 0x02 + +#if !defined(OPENSSL_NO_DEPRECATED_3_0) || defined(OSSL_FORCE_ERR_STATE) +#define ERR_FLAG_MARK 0x01 +#define ERR_FLAG_CLEAR 0x02 + +#define ERR_NUM_ERRORS 16 +struct err_state_st { + int err_flags[ERR_NUM_ERRORS]; + int err_marks[ERR_NUM_ERRORS]; + unsigned long err_buffer[ERR_NUM_ERRORS]; + char *err_data[ERR_NUM_ERRORS]; + size_t err_data_size[ERR_NUM_ERRORS]; + int err_data_flags[ERR_NUM_ERRORS]; + char *err_file[ERR_NUM_ERRORS]; + int err_line[ERR_NUM_ERRORS]; + char *err_func[ERR_NUM_ERRORS]; + int top, bottom; +}; +#endif + +/* library */ +#define ERR_LIB_NONE 1 +#define ERR_LIB_SYS 2 +#define ERR_LIB_BN 3 +#define ERR_LIB_RSA 4 +#define ERR_LIB_DH 5 +#define ERR_LIB_EVP 6 +#define ERR_LIB_BUF 7 +#define ERR_LIB_OBJ 8 +#define ERR_LIB_PEM 9 +#define ERR_LIB_DSA 10 +#define ERR_LIB_X509 11 +/* #define ERR_LIB_METH 12 */ +#define ERR_LIB_ASN1 13 +#define ERR_LIB_CONF 14 +#define ERR_LIB_CRYPTO 15 +#define ERR_LIB_EC 16 +#define ERR_LIB_SSL 20 +/* #define ERR_LIB_SSL23 21 */ +/* #define ERR_LIB_SSL2 22 */ +/* #define ERR_LIB_SSL3 23 */ +/* #define ERR_LIB_RSAREF 30 */ +/* #define ERR_LIB_PROXY 31 */ +#define ERR_LIB_BIO 32 +#define ERR_LIB_PKCS7 33 +#define ERR_LIB_X509V3 34 +#define ERR_LIB_PKCS12 35 +#define ERR_LIB_RAND 36 +#define ERR_LIB_DSO 37 +#define ERR_LIB_ENGINE 38 +#define ERR_LIB_OCSP 39 +#define ERR_LIB_UI 40 +#define ERR_LIB_COMP 41 +#define ERR_LIB_ECDSA 42 +#define ERR_LIB_ECDH 43 +#define ERR_LIB_OSSL_STORE 44 +#define ERR_LIB_FIPS 45 +#define ERR_LIB_CMS 46 +#define ERR_LIB_TS 47 +#define ERR_LIB_HMAC 48 +/* # define ERR_LIB_JPAKE 49 */ +#define ERR_LIB_CT 50 +#define ERR_LIB_ASYNC 51 +#define ERR_LIB_KDF 52 +#define ERR_LIB_SM2 53 +#define ERR_LIB_ESS 54 +#define ERR_LIB_PROP 55 +#define ERR_LIB_CRMF 56 +#define ERR_LIB_PROV 57 +#define ERR_LIB_CMP 58 +#define ERR_LIB_OSSL_ENCODER 59 +#define ERR_LIB_OSSL_DECODER 60 +#define ERR_LIB_HTTP 61 + +#define ERR_LIB_USER 128 + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define ASN1err(f, r) ERR_raise_data(ERR_LIB_ASN1, (r), NULL) +#define ASYNCerr(f, r) ERR_raise_data(ERR_LIB_ASYNC, (r), NULL) +#define BIOerr(f, r) ERR_raise_data(ERR_LIB_BIO, (r), NULL) +#define BNerr(f, r) ERR_raise_data(ERR_LIB_BN, (r), NULL) +#define BUFerr(f, r) ERR_raise_data(ERR_LIB_BUF, (r), NULL) +#define CMPerr(f, r) ERR_raise_data(ERR_LIB_CMP, (r), NULL) +#define CMSerr(f, r) ERR_raise_data(ERR_LIB_CMS, (r), NULL) +#define COMPerr(f, r) ERR_raise_data(ERR_LIB_COMP, (r), NULL) +#define CONFerr(f, r) ERR_raise_data(ERR_LIB_CONF, (r), NULL) +#define CRMFerr(f, r) ERR_raise_data(ERR_LIB_CRMF, (r), NULL) +#define CRYPTOerr(f, r) ERR_raise_data(ERR_LIB_CRYPTO, (r), NULL) +#define CTerr(f, r) ERR_raise_data(ERR_LIB_CT, (r), NULL) +#define DHerr(f, r) ERR_raise_data(ERR_LIB_DH, (r), NULL) +#define DSAerr(f, r) ERR_raise_data(ERR_LIB_DSA, (r), NULL) +#define DSOerr(f, r) ERR_raise_data(ERR_LIB_DSO, (r), NULL) +#define ECDHerr(f, r) ERR_raise_data(ERR_LIB_ECDH, (r), NULL) +#define ECDSAerr(f, r) ERR_raise_data(ERR_LIB_ECDSA, (r), NULL) +#define ECerr(f, r) ERR_raise_data(ERR_LIB_EC, (r), NULL) +#define ENGINEerr(f, r) ERR_raise_data(ERR_LIB_ENGINE, (r), NULL) +#define ESSerr(f, r) ERR_raise_data(ERR_LIB_ESS, (r), NULL) +#define EVPerr(f, r) ERR_raise_data(ERR_LIB_EVP, (r), NULL) +#define FIPSerr(f, r) ERR_raise_data(ERR_LIB_FIPS, (r), NULL) +#define HMACerr(f, r) ERR_raise_data(ERR_LIB_HMAC, (r), NULL) +#define HTTPerr(f, r) ERR_raise_data(ERR_LIB_HTTP, (r), NULL) +#define KDFerr(f, r) ERR_raise_data(ERR_LIB_KDF, (r), NULL) +#define OBJerr(f, r) ERR_raise_data(ERR_LIB_OBJ, (r), NULL) +#define OCSPerr(f, r) ERR_raise_data(ERR_LIB_OCSP, (r), NULL) +#define OSSL_STOREerr(f, r) ERR_raise_data(ERR_LIB_OSSL_STORE, (r), NULL) +#define PEMerr(f, r) ERR_raise_data(ERR_LIB_PEM, (r), NULL) +#define PKCS12err(f, r) ERR_raise_data(ERR_LIB_PKCS12, (r), NULL) +#define PKCS7err(f, r) ERR_raise_data(ERR_LIB_PKCS7, (r), NULL) +#define PROPerr(f, r) ERR_raise_data(ERR_LIB_PROP, (r), NULL) +#define PROVerr(f, r) ERR_raise_data(ERR_LIB_PROV, (r), NULL) +#define RANDerr(f, r) ERR_raise_data(ERR_LIB_RAND, (r), NULL) +#define RSAerr(f, r) ERR_raise_data(ERR_LIB_RSA, (r), NULL) +#define KDFerr(f, r) ERR_raise_data(ERR_LIB_KDF, (r), NULL) +#define SM2err(f, r) ERR_raise_data(ERR_LIB_SM2, (r), NULL) +#define SSLerr(f, r) ERR_raise_data(ERR_LIB_SSL, (r), NULL) +#define SYSerr(f, r) ERR_raise_data(ERR_LIB_SYS, (r), NULL) +#define TSerr(f, r) ERR_raise_data(ERR_LIB_TS, (r), NULL) +#define UIerr(f, r) ERR_raise_data(ERR_LIB_UI, (r), NULL) +#define X509V3err(f, r) ERR_raise_data(ERR_LIB_X509V3, (r), NULL) +#define X509err(f, r) ERR_raise_data(ERR_LIB_X509, (r), NULL) +#endif + +/*- + * The error code packs differently depending on if it records a system + * error or an OpenSSL error. + * + * A system error packs like this (we follow POSIX and only allow positive + * numbers that fit in an |int|): + * + * +-+-------------------------------------------------------------+ + * |1| system error number | + * +-+-------------------------------------------------------------+ + * + * An OpenSSL error packs like this: + * + * <---------------------------- 32 bits --------------------------> + * <--- 8 bits ---><------------------ 23 bits -----------------> + * +-+---------------+---------------------------------------------+ + * |0| library | reason | + * +-+---------------+---------------------------------------------+ + * + * A few of the reason bits are reserved as flags with special meaning: + * + * <5 bits-<>--------- 19 bits -----------------> + * +-------+-+-----------------------------------+ + * | rflags| | reason | + * +-------+-+-----------------------------------+ + * ^ + * | + * ERR_RFLAG_FATAL = ERR_R_FATAL + * + * The reason flags are part of the overall reason code for practical + * reasons, as they provide an easy way to place different types of + * reason codes in different numeric ranges. + * + * The currently known reason flags are: + * + * ERR_RFLAG_FATAL Flags that the reason code is considered fatal. + * For backward compatibility reasons, this flag + * is also the code for ERR_R_FATAL (that reason + * code served the dual purpose of flag and reason + * code in one in pre-3.0 OpenSSL). + * ERR_RFLAG_COMMON Flags that the reason code is common to all + * libraries. All ERR_R_ macros must use this flag, + * and no other _R_ macro is allowed to use it. + */ + +/* Macros to help decode recorded system errors */ +#define ERR_SYSTEM_FLAG ((unsigned int)INT_MAX + 1) +#define ERR_SYSTEM_MASK ((unsigned int)INT_MAX) + +/* + * Macros to help decode recorded OpenSSL errors + * As expressed above, RFLAGS and REASON overlap by one bit to allow + * ERR_R_FATAL to use ERR_RFLAG_FATAL as its reason code. + */ +#define ERR_LIB_OFFSET 23L +#define ERR_LIB_MASK 0xFF +#define ERR_RFLAGS_OFFSET 18L +#define ERR_RFLAGS_MASK 0x1F +#define ERR_REASON_MASK 0X7FFFFF + +/* + * Reason flags are defined pre-shifted to easily combine with the reason + * number. + */ +#define ERR_RFLAG_FATAL (0x1 << ERR_RFLAGS_OFFSET) +#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET) + +#define ERR_SYSTEM_ERROR(errcode) (((errcode) & ERR_SYSTEM_FLAG) != 0) + +static ossl_unused ossl_inline int ERR_GET_LIB(unsigned long errcode) +{ + if (ERR_SYSTEM_ERROR(errcode)) + return ERR_LIB_SYS; + return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK; +} + +static ossl_unused ossl_inline int ERR_GET_RFLAGS(unsigned long errcode) +{ + if (ERR_SYSTEM_ERROR(errcode)) + return 0; + return errcode & (ERR_RFLAGS_MASK << ERR_RFLAGS_OFFSET); +} + +static ossl_unused ossl_inline int ERR_GET_REASON(unsigned long errcode) +{ + if (ERR_SYSTEM_ERROR(errcode)) + return errcode & ERR_SYSTEM_MASK; + return errcode & ERR_REASON_MASK; +} + +static ossl_unused ossl_inline int ERR_FATAL_ERROR(unsigned long errcode) +{ + return (ERR_GET_RFLAGS(errcode) & ERR_RFLAG_FATAL) != 0; +} + +static ossl_unused ossl_inline int ERR_COMMON_ERROR(unsigned long errcode) +{ + return (ERR_GET_RFLAGS(errcode) & ERR_RFLAG_COMMON) != 0; +} + +/* + * ERR_PACK is a helper macro to properly pack OpenSSL error codes and may + * only be used for that purpose. System errors are packed internally. + * ERR_PACK takes reason flags and reason code combined in |reason|. + * ERR_PACK ignores |func|, that parameter is just legacy from pre-3.0 OpenSSL. + */ +#define ERR_PACK(lib, func, reason) \ + ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK))) + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define SYS_F_FOPEN 0 +#define SYS_F_CONNECT 0 +#define SYS_F_GETSERVBYNAME 0 +#define SYS_F_SOCKET 0 +#define SYS_F_IOCTLSOCKET 0 +#define SYS_F_BIND 0 +#define SYS_F_LISTEN 0 +#define SYS_F_ACCEPT 0 +#define SYS_F_WSASTARTUP 0 +#define SYS_F_OPENDIR 0 +#define SYS_F_FREAD 0 +#define SYS_F_GETADDRINFO 0 +#define SYS_F_GETNAMEINFO 0 +#define SYS_F_SETSOCKOPT 0 +#define SYS_F_GETSOCKOPT 0 +#define SYS_F_GETSOCKNAME 0 +#define SYS_F_GETHOSTBYNAME 0 +#define SYS_F_FFLUSH 0 +#define SYS_F_OPEN 0 +#define SYS_F_CLOSE 0 +#define SYS_F_IOCTL 0 +#define SYS_F_STAT 0 +#define SYS_F_FCNTL 0 +#define SYS_F_FSTAT 0 +#define SYS_F_SENDFILE 0 +#endif + +/* + * All ERR_R_ codes must be combined with ERR_RFLAG_COMMON. + */ + +/* "we came from here" global reason codes, range 1..255 */ +#define ERR_R_SYS_LIB (ERR_LIB_SYS /* 2 */ | ERR_RFLAG_COMMON) +#define ERR_R_BN_LIB (ERR_LIB_BN /* 3 */ | ERR_RFLAG_COMMON) +#define ERR_R_RSA_LIB (ERR_LIB_RSA /* 4 */ | ERR_RFLAG_COMMON) +#define ERR_R_DH_LIB (ERR_LIB_DH /* 5 */ | ERR_RFLAG_COMMON) +#define ERR_R_EVP_LIB (ERR_LIB_EVP /* 6 */ | ERR_RFLAG_COMMON) +#define ERR_R_BUF_LIB (ERR_LIB_BUF /* 7 */ | ERR_RFLAG_COMMON) +#define ERR_R_OBJ_LIB (ERR_LIB_OBJ /* 8 */ | ERR_RFLAG_COMMON) +#define ERR_R_PEM_LIB (ERR_LIB_PEM /* 9 */ | ERR_RFLAG_COMMON) +#define ERR_R_DSA_LIB (ERR_LIB_DSA /* 10 */ | ERR_RFLAG_COMMON) +#define ERR_R_X509_LIB (ERR_LIB_X509 /* 11 */ | ERR_RFLAG_COMMON) +#define ERR_R_ASN1_LIB (ERR_LIB_ASN1 /* 13 */ | ERR_RFLAG_COMMON) +#define ERR_R_CONF_LIB (ERR_LIB_CONF /* 14 */ | ERR_RFLAG_COMMON) +#define ERR_R_CRYPTO_LIB (ERR_LIB_CRYPTO /* 15 */ | ERR_RFLAG_COMMON) +#define ERR_R_EC_LIB (ERR_LIB_EC /* 16 */ | ERR_RFLAG_COMMON) +#define ERR_R_SSL_LIB (ERR_LIB_SSL /* 20 */ | ERR_RFLAG_COMMON) +#define ERR_R_BIO_LIB (ERR_LIB_BIO /* 32 */ | ERR_RFLAG_COMMON) +#define ERR_R_PKCS7_LIB (ERR_LIB_PKCS7 /* 33 */ | ERR_RFLAG_COMMON) +#define ERR_R_X509V3_LIB (ERR_LIB_X509V3 /* 34 */ | ERR_RFLAG_COMMON) +#define ERR_R_PKCS12_LIB (ERR_LIB_PKCS12 /* 35 */ | ERR_RFLAG_COMMON) +#define ERR_R_RAND_LIB (ERR_LIB_RAND /* 36 */ | ERR_RFLAG_COMMON) +#define ERR_R_DSO_LIB (ERR_LIB_DSO /* 37 */ | ERR_RFLAG_COMMON) +#define ERR_R_ENGINE_LIB (ERR_LIB_ENGINE /* 38 */ | ERR_RFLAG_COMMON) +#define ERR_R_UI_LIB (ERR_LIB_UI /* 40 */ | ERR_RFLAG_COMMON) +#define ERR_R_ECDSA_LIB (ERR_LIB_ECDSA /* 42 */ | ERR_RFLAG_COMMON) +#define ERR_R_OSSL_STORE_LIB (ERR_LIB_OSSL_STORE /* 44 */ | ERR_RFLAG_COMMON) +#define ERR_R_CMS_LIB (ERR_LIB_CMS /* 46 */ | ERR_RFLAG_COMMON) +#define ERR_R_TS_LIB (ERR_LIB_TS /* 47 */ | ERR_RFLAG_COMMON) +#define ERR_R_CT_LIB (ERR_LIB_CT /* 50 */ | ERR_RFLAG_COMMON) +#define ERR_R_PROV_LIB (ERR_LIB_PROV /* 57 */ | ERR_RFLAG_COMMON) +#define ERR_R_ESS_LIB (ERR_LIB_ESS /* 54 */ | ERR_RFLAG_COMMON) +#define ERR_R_CMP_LIB (ERR_LIB_CMP /* 58 */ | ERR_RFLAG_COMMON) +#define ERR_R_OSSL_ENCODER_LIB (ERR_LIB_OSSL_ENCODER /* 59 */ | ERR_RFLAG_COMMON) +#define ERR_R_OSSL_DECODER_LIB (ERR_LIB_OSSL_DECODER /* 60 */ | ERR_RFLAG_COMMON) + +/* Other common error codes, range 256..2^ERR_RFLAGS_OFFSET-1 */ +#define ERR_R_FATAL (ERR_RFLAG_FATAL | ERR_RFLAG_COMMON) +#define ERR_R_MALLOC_FAILURE (256 | ERR_R_FATAL) +#define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED (257 | ERR_R_FATAL) +#define ERR_R_PASSED_NULL_PARAMETER (258 | ERR_R_FATAL) +#define ERR_R_INTERNAL_ERROR (259 | ERR_R_FATAL) +#define ERR_R_DISABLED (260 | ERR_R_FATAL) +#define ERR_R_INIT_FAIL (261 | ERR_R_FATAL) +#define ERR_R_PASSED_INVALID_ARGUMENT (262 | ERR_RFLAG_COMMON) +#define ERR_R_OPERATION_FAIL (263 | ERR_R_FATAL) +#define ERR_R_INVALID_PROVIDER_FUNCTIONS (264 | ERR_R_FATAL) +#define ERR_R_INTERRUPTED_OR_CANCELLED (265 | ERR_RFLAG_COMMON) +#define ERR_R_NESTED_ASN1_ERROR (266 | ERR_RFLAG_COMMON) +#define ERR_R_MISSING_ASN1_EOS (267 | ERR_RFLAG_COMMON) +#define ERR_R_UNSUPPORTED (268 | ERR_RFLAG_COMMON) +#define ERR_R_FETCH_FAILED (269 | ERR_RFLAG_COMMON) +#define ERR_R_INVALID_PROPERTY_DEFINITION (270 | ERR_RFLAG_COMMON) +#define ERR_R_UNABLE_TO_GET_READ_LOCK (271 | ERR_R_FATAL) +#define ERR_R_UNABLE_TO_GET_WRITE_LOCK (272 | ERR_R_FATAL) + +typedef struct ERR_string_data_st { + unsigned long error; + const char *string; +} ERR_STRING_DATA; + +/* clang-format off */ +DEFINE_LHASH_OF_INTERNAL(ERR_STRING_DATA); +#define lh_ERR_STRING_DATA_new(hfn, cmp) ((LHASH_OF(ERR_STRING_DATA) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new(ossl_check_ERR_STRING_DATA_lh_hashfunc_type(hfn), ossl_check_ERR_STRING_DATA_lh_compfunc_type(cmp)), lh_ERR_STRING_DATA_hash_thunk, lh_ERR_STRING_DATA_comp_thunk, lh_ERR_STRING_DATA_doall_thunk, lh_ERR_STRING_DATA_doall_arg_thunk)) +#define lh_ERR_STRING_DATA_free(lh) OPENSSL_LH_free(ossl_check_ERR_STRING_DATA_lh_type(lh)) +#define lh_ERR_STRING_DATA_flush(lh) OPENSSL_LH_flush(ossl_check_ERR_STRING_DATA_lh_type(lh)) +#define lh_ERR_STRING_DATA_insert(lh, ptr) ((ERR_STRING_DATA *)OPENSSL_LH_insert(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_ERR_STRING_DATA_lh_plain_type(ptr))) +#define lh_ERR_STRING_DATA_delete(lh, ptr) ((ERR_STRING_DATA *)OPENSSL_LH_delete(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_const_ERR_STRING_DATA_lh_plain_type(ptr))) +#define lh_ERR_STRING_DATA_retrieve(lh, ptr) ((ERR_STRING_DATA *)OPENSSL_LH_retrieve(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_const_ERR_STRING_DATA_lh_plain_type(ptr))) +#define lh_ERR_STRING_DATA_error(lh) OPENSSL_LH_error(ossl_check_ERR_STRING_DATA_lh_type(lh)) +#define lh_ERR_STRING_DATA_num_items(lh) OPENSSL_LH_num_items(ossl_check_ERR_STRING_DATA_lh_type(lh)) +#define lh_ERR_STRING_DATA_node_stats_bio(lh, out) OPENSSL_LH_node_stats_bio(ossl_check_const_ERR_STRING_DATA_lh_type(lh), out) +#define lh_ERR_STRING_DATA_node_usage_stats_bio(lh, out) OPENSSL_LH_node_usage_stats_bio(ossl_check_const_ERR_STRING_DATA_lh_type(lh), out) +#define lh_ERR_STRING_DATA_stats_bio(lh, out) OPENSSL_LH_stats_bio(ossl_check_const_ERR_STRING_DATA_lh_type(lh), out) +#define lh_ERR_STRING_DATA_get_down_load(lh) OPENSSL_LH_get_down_load(ossl_check_ERR_STRING_DATA_lh_type(lh)) +#define lh_ERR_STRING_DATA_set_down_load(lh, dl) OPENSSL_LH_set_down_load(ossl_check_ERR_STRING_DATA_lh_type(lh), dl) +#define lh_ERR_STRING_DATA_doall(lh, dfn) OPENSSL_LH_doall(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_ERR_STRING_DATA_lh_doallfunc_type(dfn)) + +/* clang-format on */ + +/* 12 lines and some on an 80 column terminal */ +#define ERR_MAX_DATA_SIZE 1024 + +/* Building blocks */ +void ERR_new(void); +void ERR_set_debug(const char *file, int line, const char *func); +void ERR_set_error(int lib, int reason, const char *fmt, ...); +void ERR_vset_error(int lib, int reason, const char *fmt, va_list args); + +/* Main error raising functions */ +#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL) +#define ERR_raise_data \ + (ERR_new(), \ + ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \ + ERR_set_error) + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +/* Backward compatibility */ +#define ERR_put_error(lib, func, reason, file, line) \ + (ERR_new(), \ + ERR_set_debug((file), (line), OPENSSL_FUNC), \ + ERR_set_error((lib), (reason), NULL)) +#endif + +void ERR_set_error_data(char *data, int flags); + +unsigned long ERR_get_error(void); +unsigned long ERR_get_error_all(const char **file, int *line, + const char **func, + const char **data, int *flags); +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +unsigned long ERR_get_error_line(const char **file, int *line); +OSSL_DEPRECATEDIN_3_0 +unsigned long ERR_get_error_line_data(const char **file, int *line, + const char **data, int *flags); +#endif +unsigned long ERR_peek_error(void); +unsigned long ERR_peek_error_line(const char **file, int *line); +unsigned long ERR_peek_error_func(const char **func); +unsigned long ERR_peek_error_data(const char **data, int *flags); +unsigned long ERR_peek_error_all(const char **file, int *line, + const char **func, + const char **data, int *flags); +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +unsigned long ERR_peek_error_line_data(const char **file, int *line, + const char **data, int *flags); +#endif +unsigned long ERR_peek_last_error(void); +unsigned long ERR_peek_last_error_line(const char **file, int *line); +unsigned long ERR_peek_last_error_func(const char **func); +unsigned long ERR_peek_last_error_data(const char **data, int *flags); +unsigned long ERR_peek_last_error_all(const char **file, int *line, + const char **func, + const char **data, int *flags); +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +unsigned long ERR_peek_last_error_line_data(const char **file, int *line, + const char **data, int *flags); +#endif + +void ERR_clear_error(void); + +char *ERR_error_string(unsigned long e, char *buf); +void ERR_error_string_n(unsigned long e, char *buf, size_t len); +const char *ERR_lib_error_string(unsigned long e); +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 const char *ERR_func_error_string(unsigned long e); +#endif +const char *ERR_reason_error_string(unsigned long e); + +void ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u), + void *u); +#ifndef OPENSSL_NO_STDIO +void ERR_print_errors_fp(FILE *fp); +#endif +void ERR_print_errors(BIO *bp); + +void ERR_add_error_data(int num, ...); +void ERR_add_error_vdata(int num, va_list args); +void ERR_add_error_txt(const char *sepr, const char *txt); +void ERR_add_error_mem_bio(const char *sep, BIO *bio); + +int ERR_load_strings(int lib, ERR_STRING_DATA *str); +int ERR_load_strings_const(const ERR_STRING_DATA *str); +int ERR_unload_strings(int lib, ERR_STRING_DATA *str); + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define ERR_load_crypto_strings() \ + OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL) +#define ERR_free_strings() \ + while (0) \ + continue +#endif +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +OSSL_DEPRECATEDIN_1_1_0 void ERR_remove_thread_state(void *); +#endif +#ifndef OPENSSL_NO_DEPRECATED_1_0_0 +OSSL_DEPRECATEDIN_1_0_0 void ERR_remove_state(unsigned long pid); +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 ERR_STATE *ERR_get_state(void); +#endif + +int ERR_get_next_error_library(void); + +int ERR_set_mark(void); +int ERR_pop_to_mark(void); +int ERR_clear_last_mark(void); +int ERR_count_to_mark(void); +int ERR_pop(void); + +ERR_STATE *OSSL_ERR_STATE_new(void); +void OSSL_ERR_STATE_save(ERR_STATE *es); +void OSSL_ERR_STATE_save_to_mark(ERR_STATE *es); +void OSSL_ERR_STATE_restore(const ERR_STATE *es); +void OSSL_ERR_STATE_free(ERR_STATE *es); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ess.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ess.h new file mode 100644 index 0000000000000000000000000000000000000000..6f672043ebedf699c84c57610d43711aab27722d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ess.h @@ -0,0 +1,131 @@ +/* + * WARNING: do not edit! + * Generated by makefile from include\openssl\ess.h.in + * + * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* clang-format off */ + +/* clang-format on */ + +#ifndef OPENSSL_ESS_H +#define OPENSSL_ESS_H +#pragma once + +#include + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct ESS_issuer_serial ESS_ISSUER_SERIAL; +typedef struct ESS_cert_id ESS_CERT_ID; +typedef struct ESS_signing_cert ESS_SIGNING_CERT; + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(ESS_CERT_ID, ESS_CERT_ID, ESS_CERT_ID) +#define sk_ESS_CERT_ID_num(sk) OPENSSL_sk_num(ossl_check_const_ESS_CERT_ID_sk_type(sk)) +#define sk_ESS_CERT_ID_value(sk, idx) ((ESS_CERT_ID *)OPENSSL_sk_value(ossl_check_const_ESS_CERT_ID_sk_type(sk), (idx))) +#define sk_ESS_CERT_ID_new(cmp) ((STACK_OF(ESS_CERT_ID) *)OPENSSL_sk_new(ossl_check_ESS_CERT_ID_compfunc_type(cmp))) +#define sk_ESS_CERT_ID_new_null() ((STACK_OF(ESS_CERT_ID) *)OPENSSL_sk_new_null()) +#define sk_ESS_CERT_ID_new_reserve(cmp, n) ((STACK_OF(ESS_CERT_ID) *)OPENSSL_sk_new_reserve(ossl_check_ESS_CERT_ID_compfunc_type(cmp), (n))) +#define sk_ESS_CERT_ID_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ESS_CERT_ID_sk_type(sk), (n)) +#define sk_ESS_CERT_ID_free(sk) OPENSSL_sk_free(ossl_check_ESS_CERT_ID_sk_type(sk)) +#define sk_ESS_CERT_ID_zero(sk) OPENSSL_sk_zero(ossl_check_ESS_CERT_ID_sk_type(sk)) +#define sk_ESS_CERT_ID_delete(sk, i) ((ESS_CERT_ID *)OPENSSL_sk_delete(ossl_check_ESS_CERT_ID_sk_type(sk), (i))) +#define sk_ESS_CERT_ID_delete_ptr(sk, ptr) ((ESS_CERT_ID *)OPENSSL_sk_delete_ptr(ossl_check_ESS_CERT_ID_sk_type(sk), ossl_check_ESS_CERT_ID_type(ptr))) +#define sk_ESS_CERT_ID_push(sk, ptr) OPENSSL_sk_push(ossl_check_ESS_CERT_ID_sk_type(sk), ossl_check_ESS_CERT_ID_type(ptr)) +#define sk_ESS_CERT_ID_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ESS_CERT_ID_sk_type(sk), ossl_check_ESS_CERT_ID_type(ptr)) +#define sk_ESS_CERT_ID_pop(sk) ((ESS_CERT_ID *)OPENSSL_sk_pop(ossl_check_ESS_CERT_ID_sk_type(sk))) +#define sk_ESS_CERT_ID_shift(sk) ((ESS_CERT_ID *)OPENSSL_sk_shift(ossl_check_ESS_CERT_ID_sk_type(sk))) +#define sk_ESS_CERT_ID_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ESS_CERT_ID_sk_type(sk), ossl_check_ESS_CERT_ID_freefunc_type(freefunc)) +#define sk_ESS_CERT_ID_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ESS_CERT_ID_sk_type(sk), ossl_check_ESS_CERT_ID_type(ptr), (idx)) +#define sk_ESS_CERT_ID_set(sk, idx, ptr) ((ESS_CERT_ID *)OPENSSL_sk_set(ossl_check_ESS_CERT_ID_sk_type(sk), (idx), ossl_check_ESS_CERT_ID_type(ptr))) +#define sk_ESS_CERT_ID_find(sk, ptr) OPENSSL_sk_find(ossl_check_ESS_CERT_ID_sk_type(sk), ossl_check_ESS_CERT_ID_type(ptr)) +#define sk_ESS_CERT_ID_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ESS_CERT_ID_sk_type(sk), ossl_check_ESS_CERT_ID_type(ptr)) +#define sk_ESS_CERT_ID_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ESS_CERT_ID_sk_type(sk), ossl_check_ESS_CERT_ID_type(ptr), pnum) +#define sk_ESS_CERT_ID_sort(sk) OPENSSL_sk_sort(ossl_check_ESS_CERT_ID_sk_type(sk)) +#define sk_ESS_CERT_ID_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ESS_CERT_ID_sk_type(sk)) +#define sk_ESS_CERT_ID_dup(sk) ((STACK_OF(ESS_CERT_ID) *)OPENSSL_sk_dup(ossl_check_const_ESS_CERT_ID_sk_type(sk))) +#define sk_ESS_CERT_ID_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ESS_CERT_ID) *)OPENSSL_sk_deep_copy(ossl_check_const_ESS_CERT_ID_sk_type(sk), ossl_check_ESS_CERT_ID_copyfunc_type(copyfunc), ossl_check_ESS_CERT_ID_freefunc_type(freefunc))) +#define sk_ESS_CERT_ID_set_cmp_func(sk, cmp) ((sk_ESS_CERT_ID_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ESS_CERT_ID_sk_type(sk), ossl_check_ESS_CERT_ID_compfunc_type(cmp))) + +/* clang-format on */ + +typedef struct ESS_signing_cert_v2_st ESS_SIGNING_CERT_V2; +typedef struct ESS_cert_id_v2_st ESS_CERT_ID_V2; + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(ESS_CERT_ID_V2, ESS_CERT_ID_V2, ESS_CERT_ID_V2) +#define sk_ESS_CERT_ID_V2_num(sk) OPENSSL_sk_num(ossl_check_const_ESS_CERT_ID_V2_sk_type(sk)) +#define sk_ESS_CERT_ID_V2_value(sk, idx) ((ESS_CERT_ID_V2 *)OPENSSL_sk_value(ossl_check_const_ESS_CERT_ID_V2_sk_type(sk), (idx))) +#define sk_ESS_CERT_ID_V2_new(cmp) ((STACK_OF(ESS_CERT_ID_V2) *)OPENSSL_sk_new(ossl_check_ESS_CERT_ID_V2_compfunc_type(cmp))) +#define sk_ESS_CERT_ID_V2_new_null() ((STACK_OF(ESS_CERT_ID_V2) *)OPENSSL_sk_new_null()) +#define sk_ESS_CERT_ID_V2_new_reserve(cmp, n) ((STACK_OF(ESS_CERT_ID_V2) *)OPENSSL_sk_new_reserve(ossl_check_ESS_CERT_ID_V2_compfunc_type(cmp), (n))) +#define sk_ESS_CERT_ID_V2_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ESS_CERT_ID_V2_sk_type(sk), (n)) +#define sk_ESS_CERT_ID_V2_free(sk) OPENSSL_sk_free(ossl_check_ESS_CERT_ID_V2_sk_type(sk)) +#define sk_ESS_CERT_ID_V2_zero(sk) OPENSSL_sk_zero(ossl_check_ESS_CERT_ID_V2_sk_type(sk)) +#define sk_ESS_CERT_ID_V2_delete(sk, i) ((ESS_CERT_ID_V2 *)OPENSSL_sk_delete(ossl_check_ESS_CERT_ID_V2_sk_type(sk), (i))) +#define sk_ESS_CERT_ID_V2_delete_ptr(sk, ptr) ((ESS_CERT_ID_V2 *)OPENSSL_sk_delete_ptr(ossl_check_ESS_CERT_ID_V2_sk_type(sk), ossl_check_ESS_CERT_ID_V2_type(ptr))) +#define sk_ESS_CERT_ID_V2_push(sk, ptr) OPENSSL_sk_push(ossl_check_ESS_CERT_ID_V2_sk_type(sk), ossl_check_ESS_CERT_ID_V2_type(ptr)) +#define sk_ESS_CERT_ID_V2_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ESS_CERT_ID_V2_sk_type(sk), ossl_check_ESS_CERT_ID_V2_type(ptr)) +#define sk_ESS_CERT_ID_V2_pop(sk) ((ESS_CERT_ID_V2 *)OPENSSL_sk_pop(ossl_check_ESS_CERT_ID_V2_sk_type(sk))) +#define sk_ESS_CERT_ID_V2_shift(sk) ((ESS_CERT_ID_V2 *)OPENSSL_sk_shift(ossl_check_ESS_CERT_ID_V2_sk_type(sk))) +#define sk_ESS_CERT_ID_V2_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ESS_CERT_ID_V2_sk_type(sk), ossl_check_ESS_CERT_ID_V2_freefunc_type(freefunc)) +#define sk_ESS_CERT_ID_V2_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ESS_CERT_ID_V2_sk_type(sk), ossl_check_ESS_CERT_ID_V2_type(ptr), (idx)) +#define sk_ESS_CERT_ID_V2_set(sk, idx, ptr) ((ESS_CERT_ID_V2 *)OPENSSL_sk_set(ossl_check_ESS_CERT_ID_V2_sk_type(sk), (idx), ossl_check_ESS_CERT_ID_V2_type(ptr))) +#define sk_ESS_CERT_ID_V2_find(sk, ptr) OPENSSL_sk_find(ossl_check_ESS_CERT_ID_V2_sk_type(sk), ossl_check_ESS_CERT_ID_V2_type(ptr)) +#define sk_ESS_CERT_ID_V2_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ESS_CERT_ID_V2_sk_type(sk), ossl_check_ESS_CERT_ID_V2_type(ptr)) +#define sk_ESS_CERT_ID_V2_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ESS_CERT_ID_V2_sk_type(sk), ossl_check_ESS_CERT_ID_V2_type(ptr), pnum) +#define sk_ESS_CERT_ID_V2_sort(sk) OPENSSL_sk_sort(ossl_check_ESS_CERT_ID_V2_sk_type(sk)) +#define sk_ESS_CERT_ID_V2_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ESS_CERT_ID_V2_sk_type(sk)) +#define sk_ESS_CERT_ID_V2_dup(sk) ((STACK_OF(ESS_CERT_ID_V2) *)OPENSSL_sk_dup(ossl_check_const_ESS_CERT_ID_V2_sk_type(sk))) +#define sk_ESS_CERT_ID_V2_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ESS_CERT_ID_V2) *)OPENSSL_sk_deep_copy(ossl_check_const_ESS_CERT_ID_V2_sk_type(sk), ossl_check_ESS_CERT_ID_V2_copyfunc_type(copyfunc), ossl_check_ESS_CERT_ID_V2_freefunc_type(freefunc))) +#define sk_ESS_CERT_ID_V2_set_cmp_func(sk, cmp) ((sk_ESS_CERT_ID_V2_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ESS_CERT_ID_V2_sk_type(sk), ossl_check_ESS_CERT_ID_V2_compfunc_type(cmp))) + +/* clang-format on */ + +DECLARE_ASN1_ALLOC_FUNCTIONS(ESS_ISSUER_SERIAL) +DECLARE_ASN1_ENCODE_FUNCTIONS_only(ESS_ISSUER_SERIAL, ESS_ISSUER_SERIAL) +DECLARE_ASN1_DUP_FUNCTION(ESS_ISSUER_SERIAL) + +DECLARE_ASN1_ALLOC_FUNCTIONS(ESS_CERT_ID) +DECLARE_ASN1_ENCODE_FUNCTIONS_only(ESS_CERT_ID, ESS_CERT_ID) +DECLARE_ASN1_DUP_FUNCTION(ESS_CERT_ID) + +DECLARE_ASN1_FUNCTIONS(ESS_SIGNING_CERT) +DECLARE_ASN1_DUP_FUNCTION(ESS_SIGNING_CERT) + +DECLARE_ASN1_ALLOC_FUNCTIONS(ESS_CERT_ID_V2) +DECLARE_ASN1_ENCODE_FUNCTIONS_only(ESS_CERT_ID_V2, ESS_CERT_ID_V2) +DECLARE_ASN1_DUP_FUNCTION(ESS_CERT_ID_V2) + +DECLARE_ASN1_FUNCTIONS(ESS_SIGNING_CERT_V2) +DECLARE_ASN1_DUP_FUNCTION(ESS_SIGNING_CERT_V2) + +ESS_SIGNING_CERT *OSSL_ESS_signing_cert_new_init(const X509 *signcert, + const STACK_OF(X509) *certs, + int set_issuer_serial); +ESS_SIGNING_CERT_V2 *OSSL_ESS_signing_cert_v2_new_init(const EVP_MD *hash_alg, + const X509 *signcert, + const STACK_OF(X509) *certs, + int set_issuer_serial); +int OSSL_ESS_check_signing_certs(const ESS_SIGNING_CERT *ss, + const ESS_SIGNING_CERT_V2 *ssv2, + const STACK_OF(X509) *chain, + int require_signing_cert); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/esserr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/esserr.h new file mode 100644 index 0000000000000000000000000000000000000000..46881293cb071fde79319dbc0830ccb45b5e0936 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/esserr.h @@ -0,0 +1,32 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_ESSERR_H +#define OPENSSL_ESSERR_H +#pragma once + +#include +#include +#include + +/* + * ESS reason codes. + */ +#define ESS_R_EMPTY_ESS_CERT_ID_LIST 107 +#define ESS_R_ESS_CERT_DIGEST_ERROR 103 +#define ESS_R_ESS_CERT_ID_NOT_FOUND 104 +#define ESS_R_ESS_CERT_ID_WRONG_ORDER 105 +#define ESS_R_ESS_DIGEST_ALG_UNKNOWN 106 +#define ESS_R_ESS_SIGNING_CERTIFICATE_ERROR 102 +#define ESS_R_ESS_SIGNING_CERT_ADD_ERROR 100 +#define ESS_R_ESS_SIGNING_CERT_V2_ADD_ERROR 101 +#define ESS_R_MISSING_SIGNING_CERTIFICATE_ATTRIBUTE 108 + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/evp.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/evp.h new file mode 100644 index 0000000000000000000000000000000000000000..de6f5030f14bb3b8bcd20a8cf194321da5ce1ae0 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/evp.h @@ -0,0 +1,2290 @@ +/* + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_EVP_H +#define OPENSSL_EVP_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_ENVELOPE_H +#endif + +#include + +#ifndef OPENSSL_NO_STDIO +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +#define EVP_MAX_MD_SIZE 64 /* longest known is SHA512 */ +#define EVP_MAX_KEY_LENGTH 64 +#define EVP_MAX_IV_LENGTH 16 +#define EVP_MAX_BLOCK_LENGTH 32 +#define EVP_MAX_AEAD_TAG_LENGTH 16 + +/* Maximum pipes in cipher pipelining */ +#define EVP_MAX_PIPES 32 + +#define PKCS5_SALT_LEN 8 +/* Default PKCS#5 iteration count */ +#define PKCS5_DEFAULT_ITER 2048 + +#include + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define EVP_PK_RSA 0x0001 +#define EVP_PK_DSA 0x0002 +#define EVP_PK_DH 0x0004 +#define EVP_PK_EC 0x0008 +#define EVP_PKT_SIGN 0x0010 +#define EVP_PKT_ENC 0x0020 +#define EVP_PKT_EXCH 0x0040 +#define EVP_PKS_RSA 0x0100 +#define EVP_PKS_DSA 0x0200 +#define EVP_PKS_EC 0x0400 +#endif + +#define EVP_PKEY_NONE NID_undef +#define EVP_PKEY_RSA NID_rsaEncryption +#define EVP_PKEY_RSA2 NID_rsa +#define EVP_PKEY_RSA_PSS NID_rsassaPss +#define EVP_PKEY_DSA NID_dsa +#define EVP_PKEY_DSA1 NID_dsa_2 +#define EVP_PKEY_DSA2 NID_dsaWithSHA +#define EVP_PKEY_DSA3 NID_dsaWithSHA1 +#define EVP_PKEY_DSA4 NID_dsaWithSHA1_2 +#define EVP_PKEY_DH NID_dhKeyAgreement +#define EVP_PKEY_DHX NID_dhpublicnumber +#define EVP_PKEY_EC NID_X9_62_id_ecPublicKey +#define EVP_PKEY_SM2 NID_sm2 +#define EVP_PKEY_HMAC NID_hmac +#define EVP_PKEY_CMAC NID_cmac +#define EVP_PKEY_SCRYPT NID_id_scrypt +#define EVP_PKEY_TLS1_PRF NID_tls1_prf +#define EVP_PKEY_HKDF NID_hkdf +#define EVP_PKEY_POLY1305 NID_poly1305 +#define EVP_PKEY_SIPHASH NID_siphash +#define EVP_PKEY_X25519 NID_X25519 +#define EVP_PKEY_ED25519 NID_ED25519 +#define EVP_PKEY_X448 NID_X448 +#define EVP_PKEY_ED448 NID_ED448 +#define EVP_PKEY_ML_DSA_44 NID_ML_DSA_44 +#define EVP_PKEY_ML_DSA_65 NID_ML_DSA_65 +#define EVP_PKEY_ML_DSA_87 NID_ML_DSA_87 +#define EVP_PKEY_SLH_DSA_SHA2_128S NID_SLH_DSA_SHA2_128s +#define EVP_PKEY_SLH_DSA_SHA2_128F NID_SLH_DSA_SHA2_128f +#define EVP_PKEY_SLH_DSA_SHA2_192S NID_SLH_DSA_SHA2_192s +#define EVP_PKEY_SLH_DSA_SHA2_192F NID_SLH_DSA_SHA2_192f +#define EVP_PKEY_SLH_DSA_SHA2_256S NID_SLH_DSA_SHA2_256s +#define EVP_PKEY_SLH_DSA_SHA2_256F NID_SLH_DSA_SHA2_256f +#define EVP_PKEY_SLH_DSA_SHAKE_128S NID_SLH_DSA_SHAKE_128s +#define EVP_PKEY_SLH_DSA_SHAKE_128F NID_SLH_DSA_SHAKE_128f +#define EVP_PKEY_SLH_DSA_SHAKE_192S NID_SLH_DSA_SHAKE_192s +#define EVP_PKEY_SLH_DSA_SHAKE_192F NID_SLH_DSA_SHAKE_192f +#define EVP_PKEY_SLH_DSA_SHAKE_256S NID_SLH_DSA_SHAKE_256s +#define EVP_PKEY_SLH_DSA_SHAKE_256F NID_SLH_DSA_SHAKE_256f + +/* Special indicator that the object is uniquely provider side */ +#define EVP_PKEY_KEYMGMT -1 + +/* Easy to use macros for EVP_PKEY related selections */ +#define EVP_PKEY_KEY_PARAMETERS \ + (OSSL_KEYMGMT_SELECT_ALL_PARAMETERS) +#define EVP_PKEY_PRIVATE_KEY \ + (EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PRIVATE_KEY) +#define EVP_PKEY_PUBLIC_KEY \ + (EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY) +#define EVP_PKEY_KEYPAIR \ + (EVP_PKEY_PUBLIC_KEY | OSSL_KEYMGMT_SELECT_PRIVATE_KEY) + +#ifdef __cplusplus +extern "C" { +#endif + +int EVP_set_default_properties(OSSL_LIB_CTX *libctx, const char *propq); +char *EVP_get1_default_properties(OSSL_LIB_CTX *libctx); +int EVP_default_properties_is_fips_enabled(OSSL_LIB_CTX *libctx); +int EVP_default_properties_enable_fips(OSSL_LIB_CTX *libctx, int enable); + +#define EVP_PKEY_MO_SIGN 0x0001 +#define EVP_PKEY_MO_VERIFY 0x0002 +#define EVP_PKEY_MO_ENCRYPT 0x0004 +#define EVP_PKEY_MO_DECRYPT 0x0008 + +#ifndef EVP_MD +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 EVP_MD *EVP_MD_meth_new(int md_type, int pkey_type); +OSSL_DEPRECATEDIN_3_0 EVP_MD *EVP_MD_meth_dup(const EVP_MD *md); +OSSL_DEPRECATEDIN_3_0 void EVP_MD_meth_free(EVP_MD *md); +OSSL_DEPRECATEDIN_3_0 +int EVP_MD_meth_set_input_blocksize(EVP_MD *md, int blocksize); +OSSL_DEPRECATEDIN_3_0 +int EVP_MD_meth_set_result_size(EVP_MD *md, int resultsize); +OSSL_DEPRECATEDIN_3_0 +int EVP_MD_meth_set_app_datasize(EVP_MD *md, int datasize); +OSSL_DEPRECATEDIN_3_0 +int EVP_MD_meth_set_flags(EVP_MD *md, unsigned long flags); +OSSL_DEPRECATEDIN_3_0 +int EVP_MD_meth_set_init(EVP_MD *md, int (*init)(EVP_MD_CTX *ctx)); +OSSL_DEPRECATEDIN_3_0 +int EVP_MD_meth_set_update(EVP_MD *md, int (*update)(EVP_MD_CTX *ctx, const void *data, size_t count)); +OSSL_DEPRECATEDIN_3_0 +int EVP_MD_meth_set_final(EVP_MD *md, int (*final)(EVP_MD_CTX *ctx, unsigned char *md)); +OSSL_DEPRECATEDIN_3_0 +int EVP_MD_meth_set_copy(EVP_MD *md, int (*copy)(EVP_MD_CTX *to, const EVP_MD_CTX *from)); +OSSL_DEPRECATEDIN_3_0 +int EVP_MD_meth_set_cleanup(EVP_MD *md, int (*cleanup)(EVP_MD_CTX *ctx)); +OSSL_DEPRECATEDIN_3_0 +int EVP_MD_meth_set_ctrl(EVP_MD *md, int (*ctrl)(EVP_MD_CTX *ctx, int cmd, int p1, void *p2)); +OSSL_DEPRECATEDIN_3_0 int EVP_MD_meth_get_input_blocksize(const EVP_MD *md); +OSSL_DEPRECATEDIN_3_0 int EVP_MD_meth_get_result_size(const EVP_MD *md); +OSSL_DEPRECATEDIN_3_0 int EVP_MD_meth_get_app_datasize(const EVP_MD *md); +OSSL_DEPRECATEDIN_3_0 unsigned long EVP_MD_meth_get_flags(const EVP_MD *md); +OSSL_DEPRECATEDIN_3_0 +int (*EVP_MD_meth_get_init(const EVP_MD *md))(EVP_MD_CTX *ctx); +OSSL_DEPRECATEDIN_3_0 +int (*EVP_MD_meth_get_update(const EVP_MD *md))(EVP_MD_CTX *ctx, + const void *data, size_t count); +OSSL_DEPRECATEDIN_3_0 +int (*EVP_MD_meth_get_final(const EVP_MD *md))(EVP_MD_CTX *ctx, + unsigned char *md); +OSSL_DEPRECATEDIN_3_0 +int (*EVP_MD_meth_get_copy(const EVP_MD *md))(EVP_MD_CTX *to, + const EVP_MD_CTX *from); +OSSL_DEPRECATEDIN_3_0 +int (*EVP_MD_meth_get_cleanup(const EVP_MD *md))(EVP_MD_CTX *ctx); +OSSL_DEPRECATEDIN_3_0 +int (*EVP_MD_meth_get_ctrl(const EVP_MD *md))(EVP_MD_CTX *ctx, int cmd, + int p1, void *p2); +#endif +/* digest can only handle a single block */ +#define EVP_MD_FLAG_ONESHOT 0x0001 + +/* digest is extensible-output function, XOF */ +#define EVP_MD_FLAG_XOF 0x0002 + +/* DigestAlgorithmIdentifier flags... */ + +#define EVP_MD_FLAG_DIGALGID_MASK 0x0018 + +/* NULL or absent parameter accepted. Use NULL */ + +#define EVP_MD_FLAG_DIGALGID_NULL 0x0000 + +/* NULL or absent parameter accepted. Use NULL for PKCS#1 otherwise absent */ + +#define EVP_MD_FLAG_DIGALGID_ABSENT 0x0008 + +/* Custom handling via ctrl */ + +#define EVP_MD_FLAG_DIGALGID_CUSTOM 0x0018 + +/* Note if suitable for use in FIPS mode */ +#define EVP_MD_FLAG_FIPS 0x0400 + +/* Digest ctrls */ + +#define EVP_MD_CTRL_DIGALGID 0x1 +#define EVP_MD_CTRL_MICALG 0x2 +#define EVP_MD_CTRL_XOF_LEN 0x3 +#define EVP_MD_CTRL_TLSTREE 0x4 + +/* Minimum Algorithm specific ctrl value */ + +#define EVP_MD_CTRL_ALG_CTRL 0x1000 + +#endif /* !EVP_MD */ + +/* values for EVP_MD_CTX flags */ + +#define EVP_MD_CTX_FLAG_ONESHOT 0x0001 /* digest update will be \ + * called once only */ +#define EVP_MD_CTX_FLAG_CLEANED 0x0002 /* context has already been \ + * cleaned */ +#define EVP_MD_CTX_FLAG_REUSE 0x0004 /* Don't free up ctx->md_data \ + * in EVP_MD_CTX_reset */ +/* + * FIPS and pad options are ignored in 1.0.0, definitions are here so we + * don't accidentally reuse the values for other purposes. + */ + +/* This flag has no effect from openssl-3.0 onwards */ +#define EVP_MD_CTX_FLAG_NON_FIPS_ALLOW 0x0008 + +/* + * The following PAD options are also currently ignored in 1.0.0, digest + * parameters are handled through EVP_DigestSign*() and EVP_DigestVerify*() + * instead. + */ +#define EVP_MD_CTX_FLAG_PAD_MASK 0xF0 /* RSA mode to use */ +#define EVP_MD_CTX_FLAG_PAD_PKCS1 0x00 /* PKCS#1 v1.5 mode */ +#define EVP_MD_CTX_FLAG_PAD_X931 0x10 /* X9.31 mode */ +#define EVP_MD_CTX_FLAG_PAD_PSS 0x20 /* PSS mode */ + +#define EVP_MD_CTX_FLAG_NO_INIT 0x0100 /* Don't initialize md_data */ +/* + * Some functions such as EVP_DigestSign only finalise copies of internal + * contexts so additional data can be included after the finalisation call. + * This is inefficient if this functionality is not required: it is disabled + * if the following flag is set. + */ +#define EVP_MD_CTX_FLAG_FINALISE 0x0200 +/* NOTE: 0x0400 and 0x0800 are reserved for internal usage */ + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +EVP_CIPHER *EVP_CIPHER_meth_new(int cipher_type, int block_size, int key_len); +OSSL_DEPRECATEDIN_3_0 +EVP_CIPHER *EVP_CIPHER_meth_dup(const EVP_CIPHER *cipher); +OSSL_DEPRECATEDIN_3_0 +void EVP_CIPHER_meth_free(EVP_CIPHER *cipher); +OSSL_DEPRECATEDIN_3_0 +int EVP_CIPHER_meth_set_iv_length(EVP_CIPHER *cipher, int iv_len); +OSSL_DEPRECATEDIN_3_0 +int EVP_CIPHER_meth_set_flags(EVP_CIPHER *cipher, unsigned long flags); +OSSL_DEPRECATEDIN_3_0 +int EVP_CIPHER_meth_set_impl_ctx_size(EVP_CIPHER *cipher, int ctx_size); +OSSL_DEPRECATEDIN_3_0 +int EVP_CIPHER_meth_set_init(EVP_CIPHER *cipher, + int (*init)(EVP_CIPHER_CTX *ctx, + const unsigned char *key, + const unsigned char *iv, + int enc)); +OSSL_DEPRECATEDIN_3_0 +int EVP_CIPHER_meth_set_do_cipher(EVP_CIPHER *cipher, + int (*do_cipher)(EVP_CIPHER_CTX *ctx, + unsigned char *out, + const unsigned char *in, + size_t inl)); +OSSL_DEPRECATEDIN_3_0 +int EVP_CIPHER_meth_set_cleanup(EVP_CIPHER *cipher, + int (*cleanup)(EVP_CIPHER_CTX *)); +OSSL_DEPRECATEDIN_3_0 +int EVP_CIPHER_meth_set_set_asn1_params(EVP_CIPHER *cipher, + int (*set_asn1_parameters)(EVP_CIPHER_CTX *, + ASN1_TYPE *)); +OSSL_DEPRECATEDIN_3_0 +int EVP_CIPHER_meth_set_get_asn1_params(EVP_CIPHER *cipher, + int (*get_asn1_parameters)(EVP_CIPHER_CTX *, + ASN1_TYPE *)); +OSSL_DEPRECATEDIN_3_0 +int EVP_CIPHER_meth_set_ctrl(EVP_CIPHER *cipher, + int (*ctrl)(EVP_CIPHER_CTX *, int type, + int arg, void *ptr)); +OSSL_DEPRECATEDIN_3_0 int (*EVP_CIPHER_meth_get_init(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *ctx, + const unsigned char *key, + const unsigned char *iv, + int enc); +OSSL_DEPRECATEDIN_3_0 int (*EVP_CIPHER_meth_get_do_cipher(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *ctx, + unsigned char *out, + const unsigned char *in, + size_t inl); +OSSL_DEPRECATEDIN_3_0 int (*EVP_CIPHER_meth_get_cleanup(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *); +OSSL_DEPRECATEDIN_3_0 int (*EVP_CIPHER_meth_get_set_asn1_params(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *, + ASN1_TYPE *); +OSSL_DEPRECATEDIN_3_0 int (*EVP_CIPHER_meth_get_get_asn1_params(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *, + ASN1_TYPE *); +OSSL_DEPRECATEDIN_3_0 int (*EVP_CIPHER_meth_get_ctrl(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *, int type, + int arg, void *ptr); +#endif + +/* Values for cipher flags */ + +/* Modes for ciphers */ + +#define EVP_CIPH_STREAM_CIPHER 0x0 +#define EVP_CIPH_ECB_MODE 0x1 +#define EVP_CIPH_CBC_MODE 0x2 +#define EVP_CIPH_CFB_MODE 0x3 +#define EVP_CIPH_OFB_MODE 0x4 +#define EVP_CIPH_CTR_MODE 0x5 +#define EVP_CIPH_GCM_MODE 0x6 +#define EVP_CIPH_CCM_MODE 0x7 +#define EVP_CIPH_XTS_MODE 0x10001 +#define EVP_CIPH_WRAP_MODE 0x10002 +#define EVP_CIPH_OCB_MODE 0x10003 +#define EVP_CIPH_SIV_MODE 0x10004 +#define EVP_CIPH_GCM_SIV_MODE 0x10005 +#define EVP_CIPH_MODE 0xF0007 +/* Set if variable length cipher */ +#define EVP_CIPH_VARIABLE_LENGTH 0x8 +/* Set if the iv handling should be done by the cipher itself */ +#define EVP_CIPH_CUSTOM_IV 0x10 +/* Set if the cipher's init() function should be called if key is NULL */ +#define EVP_CIPH_ALWAYS_CALL_INIT 0x20 +/* Call ctrl() to init cipher parameters */ +#define EVP_CIPH_CTRL_INIT 0x40 +/* Don't use standard key length function */ +#define EVP_CIPH_CUSTOM_KEY_LENGTH 0x80 +/* Don't use standard block padding */ +#define EVP_CIPH_NO_PADDING 0x100 +/* cipher handles random key generation */ +#define EVP_CIPH_RAND_KEY 0x200 +/* cipher has its own additional copying logic */ +#define EVP_CIPH_CUSTOM_COPY 0x400 +/* Don't use standard iv length function */ +#define EVP_CIPH_CUSTOM_IV_LENGTH 0x800 +/* Legacy and no longer relevant: Allow use default ASN1 get/set iv */ +#define EVP_CIPH_FLAG_DEFAULT_ASN1 0 +/* Free: 0x1000 */ +/* Buffer length in bits not bytes: CFB1 mode only */ +#define EVP_CIPH_FLAG_LENGTH_BITS 0x2000 +/* Deprecated FIPS flag: was 0x4000 */ +#define EVP_CIPH_FLAG_FIPS 0 +/* Deprecated FIPS flag: was 0x8000 */ +#define EVP_CIPH_FLAG_NON_FIPS_ALLOW 0 + +/* + * Cipher handles any and all padding logic as well as finalisation. + */ +#define EVP_CIPH_FLAG_CTS 0x4000 +#define EVP_CIPH_FLAG_CUSTOM_CIPHER 0x100000 +#define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000 +#define EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK 0x400000 +/* Cipher can handle pipeline operations */ +#define EVP_CIPH_FLAG_PIPELINE 0X800000 +/* For provider implementations that handle ASN1 get/set param themselves */ +#define EVP_CIPH_FLAG_CUSTOM_ASN1 0x1000000 +/* For ciphers generating unprotected CMS attributes */ +#define EVP_CIPH_FLAG_CIPHER_WITH_MAC 0x2000000 +/* For supplementary wrap cipher support */ +#define EVP_CIPH_FLAG_GET_WRAP_CIPHER 0x4000000 +#define EVP_CIPH_FLAG_INVERSE_CIPHER 0x8000000 +#define EVP_CIPH_FLAG_ENC_THEN_MAC 0x10000000 + +/* + * Cipher context flag to indicate we can handle wrap mode: if allowed in + * older applications it could overflow buffers. + */ + +#define EVP_CIPHER_CTX_FLAG_WRAP_ALLOW 0x1 + +/* ctrl() values */ + +#define EVP_CTRL_INIT 0x0 +#define EVP_CTRL_SET_KEY_LENGTH 0x1 +#define EVP_CTRL_GET_RC2_KEY_BITS 0x2 +#define EVP_CTRL_SET_RC2_KEY_BITS 0x3 +#define EVP_CTRL_GET_RC5_ROUNDS 0x4 +#define EVP_CTRL_SET_RC5_ROUNDS 0x5 +#define EVP_CTRL_RAND_KEY 0x6 +#define EVP_CTRL_PBE_PRF_NID 0x7 +#define EVP_CTRL_COPY 0x8 +#define EVP_CTRL_AEAD_SET_IVLEN 0x9 +#define EVP_CTRL_AEAD_GET_TAG 0x10 +#define EVP_CTRL_AEAD_SET_TAG 0x11 +#define EVP_CTRL_AEAD_SET_IV_FIXED 0x12 +#define EVP_CTRL_GCM_SET_IVLEN EVP_CTRL_AEAD_SET_IVLEN +#define EVP_CTRL_GCM_GET_TAG EVP_CTRL_AEAD_GET_TAG +#define EVP_CTRL_GCM_SET_TAG EVP_CTRL_AEAD_SET_TAG +#define EVP_CTRL_GCM_SET_IV_FIXED EVP_CTRL_AEAD_SET_IV_FIXED +#define EVP_CTRL_GCM_IV_GEN 0x13 +#define EVP_CTRL_CCM_SET_IVLEN EVP_CTRL_AEAD_SET_IVLEN +#define EVP_CTRL_CCM_GET_TAG EVP_CTRL_AEAD_GET_TAG +#define EVP_CTRL_CCM_SET_TAG EVP_CTRL_AEAD_SET_TAG +#define EVP_CTRL_CCM_SET_IV_FIXED EVP_CTRL_AEAD_SET_IV_FIXED +#define EVP_CTRL_CCM_SET_L 0x14 +#define EVP_CTRL_CCM_SET_MSGLEN 0x15 +/* + * AEAD cipher deduces payload length and returns number of bytes required to + * store MAC and eventual padding. Subsequent call to EVP_Cipher even + * appends/verifies MAC. + */ +#define EVP_CTRL_AEAD_TLS1_AAD 0x16 +/* Used by composite AEAD ciphers, no-op in GCM, CCM... */ +#define EVP_CTRL_AEAD_SET_MAC_KEY 0x17 +/* Set the GCM invocation field, decrypt only */ +#define EVP_CTRL_GCM_SET_IV_INV 0x18 + +#define EVP_CTRL_TLS1_1_MULTIBLOCK_AAD 0x19 +#define EVP_CTRL_TLS1_1_MULTIBLOCK_ENCRYPT 0x1a +#define EVP_CTRL_TLS1_1_MULTIBLOCK_DECRYPT 0x1b +#define EVP_CTRL_TLS1_1_MULTIBLOCK_MAX_BUFSIZE 0x1c + +#define EVP_CTRL_SSL3_MASTER_SECRET 0x1d + +/* EVP_CTRL_SET_SBOX takes the char * specifying S-boxes */ +#define EVP_CTRL_SET_SBOX 0x1e +/* + * EVP_CTRL_SBOX_USED takes a 'size_t' and 'char *', pointing at a + * pre-allocated buffer with specified size + */ +#define EVP_CTRL_SBOX_USED 0x1f +/* EVP_CTRL_KEY_MESH takes 'size_t' number of bytes to mesh the key after, + * 0 switches meshing off + */ +#define EVP_CTRL_KEY_MESH 0x20 +/* EVP_CTRL_BLOCK_PADDING_MODE takes the padding mode */ +#define EVP_CTRL_BLOCK_PADDING_MODE 0x21 + +/* Set the output buffers to use for a pipelined operation */ +#define EVP_CTRL_SET_PIPELINE_OUTPUT_BUFS 0x22 +/* Set the input buffers to use for a pipelined operation */ +#define EVP_CTRL_SET_PIPELINE_INPUT_BUFS 0x23 +/* Set the input buffer lengths to use for a pipelined operation */ +#define EVP_CTRL_SET_PIPELINE_INPUT_LENS 0x24 +/* Get the IV length used by the cipher */ +#define EVP_CTRL_GET_IVLEN 0x25 +/* 0x26 is unused */ +/* Tell the cipher it's doing a speed test (SIV disallows multiple ops) */ +#define EVP_CTRL_SET_SPEED 0x27 +/* Get the unprotectedAttrs from cipher ctx */ +#define EVP_CTRL_PROCESS_UNPROTECTED 0x28 +/* Get the supplementary wrap cipher */ +#define EVP_CTRL_GET_WRAP_CIPHER 0x29 +/* TLSTREE key diversification */ +#define EVP_CTRL_TLSTREE 0x2A + +/* Padding modes */ +#define EVP_PADDING_PKCS7 1 +#define EVP_PADDING_ISO7816_4 2 +#define EVP_PADDING_ANSI923 3 +#define EVP_PADDING_ISO10126 4 +#define EVP_PADDING_ZERO 5 + +/* RFC 5246 defines additional data to be 13 bytes in length */ +#define EVP_AEAD_TLS1_AAD_LEN 13 + +typedef struct { + unsigned char *out; + const unsigned char *inp; + size_t len; + unsigned int interleave; +} EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM; + +/* GCM TLS constants */ +/* Length of fixed part of IV derived from PRF */ +#define EVP_GCM_TLS_FIXED_IV_LEN 4 +/* Length of explicit part of IV part of TLS records */ +#define EVP_GCM_TLS_EXPLICIT_IV_LEN 8 +/* Length of tag for TLS */ +#define EVP_GCM_TLS_TAG_LEN 16 + +/* CCM TLS constants */ +/* Length of fixed part of IV derived from PRF */ +#define EVP_CCM_TLS_FIXED_IV_LEN 4 +/* Length of explicit part of IV part of TLS records */ +#define EVP_CCM_TLS_EXPLICIT_IV_LEN 8 +/* Total length of CCM IV length for TLS */ +#define EVP_CCM_TLS_IV_LEN 12 +/* Length of tag for TLS */ +#define EVP_CCM_TLS_TAG_LEN 16 +/* Length of CCM8 tag for TLS */ +#define EVP_CCM8_TLS_TAG_LEN 8 + +/* Length of tag for TLS */ +#define EVP_CHACHAPOLY_TLS_TAG_LEN 16 + +typedef struct evp_cipher_info_st { + const EVP_CIPHER *cipher; + unsigned char iv[EVP_MAX_IV_LENGTH]; +} EVP_CIPHER_INFO; + +/* Password based encryption function */ +typedef int(EVP_PBE_KEYGEN)(EVP_CIPHER_CTX *ctx, const char *pass, + int passlen, ASN1_TYPE *param, + const EVP_CIPHER *cipher, const EVP_MD *md, + int en_de); + +typedef int(EVP_PBE_KEYGEN_EX)(EVP_CIPHER_CTX *ctx, const char *pass, + int passlen, ASN1_TYPE *param, + const EVP_CIPHER *cipher, const EVP_MD *md, + int en_de, OSSL_LIB_CTX *libctx, const char *propq); + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define EVP_PKEY_assign_RSA(pkey, rsa) EVP_PKEY_assign((pkey), EVP_PKEY_RSA, \ + (rsa)) +#endif + +#ifndef OPENSSL_NO_DEPRECATED_3_6 +#ifndef OPENSSL_NO_DSA +#define EVP_PKEY_assign_DSA(pkey, dsa) EVP_PKEY_assign((pkey), EVP_PKEY_DSA, \ + (dsa)) +#endif +#endif + +#if !defined(OPENSSL_NO_DH) && !defined(OPENSSL_NO_DEPRECATED_3_0) +#define EVP_PKEY_assign_DH(pkey, dh) EVP_PKEY_assign((pkey), EVP_PKEY_DH, (dh)) +#endif + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#ifndef OPENSSL_NO_EC +#define EVP_PKEY_assign_EC_KEY(pkey, eckey) EVP_PKEY_assign((pkey), \ + EVP_PKEY_EC, \ + (eckey)) +#endif +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_6 +#ifndef OPENSSL_NO_SIPHASH +#define EVP_PKEY_assign_SIPHASH(pkey, shkey) EVP_PKEY_assign((pkey), \ + EVP_PKEY_SIPHASH, \ + (shkey)) +#endif + +#ifndef OPENSSL_NO_POLY1305 +#define EVP_PKEY_assign_POLY1305(pkey, polykey) EVP_PKEY_assign((pkey), \ + EVP_PKEY_POLY1305, \ + (polykey)) +#endif +#endif + +/* Add some extra combinations */ +#define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a)) +#define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a)) +#define EVP_get_cipherbynid(a) EVP_get_cipherbyname(OBJ_nid2sn(a)) +#define EVP_get_cipherbyobj(a) EVP_get_cipherbynid(OBJ_obj2nid(a)) + +int EVP_MD_get_type(const EVP_MD *md); +#define EVP_MD_type EVP_MD_get_type +#define EVP_MD_nid EVP_MD_get_type +const char *EVP_MD_get0_name(const EVP_MD *md); +#define EVP_MD_name EVP_MD_get0_name +const char *EVP_MD_get0_description(const EVP_MD *md); +int EVP_MD_is_a(const EVP_MD *md, const char *name); +int EVP_MD_names_do_all(const EVP_MD *md, + void (*fn)(const char *name, void *data), + void *data); +const OSSL_PROVIDER *EVP_MD_get0_provider(const EVP_MD *md); +int EVP_MD_get_pkey_type(const EVP_MD *md); +#define EVP_MD_pkey_type EVP_MD_get_pkey_type +int EVP_MD_get_size(const EVP_MD *md); +#define EVP_MD_size EVP_MD_get_size +int EVP_MD_get_block_size(const EVP_MD *md); +#define EVP_MD_block_size EVP_MD_get_block_size +unsigned long EVP_MD_get_flags(const EVP_MD *md); +#define EVP_MD_flags EVP_MD_get_flags +int EVP_MD_xof(const EVP_MD *md); + +const EVP_MD *EVP_MD_CTX_get0_md(const EVP_MD_CTX *ctx); +EVP_MD *EVP_MD_CTX_get1_md(EVP_MD_CTX *ctx); +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx); +OSSL_DEPRECATEDIN_3_0 +int (*EVP_MD_CTX_update_fn(EVP_MD_CTX *ctx))(EVP_MD_CTX *ctx, + const void *data, size_t count); +OSSL_DEPRECATEDIN_3_0 +void EVP_MD_CTX_set_update_fn(EVP_MD_CTX *ctx, + int (*update)(EVP_MD_CTX *ctx, + const void *data, size_t count)); +#endif +int EVP_MD_CTX_get_size_ex(const EVP_MD_CTX *ctx); + +#define EVP_MD_CTX_get0_name(e) EVP_MD_get0_name(EVP_MD_CTX_get0_md(e)) +#define EVP_MD_CTX_get_size(e) EVP_MD_CTX_get_size_ex(e) +#define EVP_MD_CTX_size EVP_MD_CTX_get_size_ex +#define EVP_MD_CTX_get_block_size(e) EVP_MD_get_block_size(EVP_MD_CTX_get0_md(e)) +#define EVP_MD_CTX_block_size EVP_MD_CTX_get_block_size +#define EVP_MD_CTX_get_type(e) EVP_MD_get_type(EVP_MD_CTX_get0_md(e)) +#define EVP_MD_CTX_type EVP_MD_CTX_get_type +EVP_PKEY_CTX *EVP_MD_CTX_get_pkey_ctx(const EVP_MD_CTX *ctx); +#define EVP_MD_CTX_pkey_ctx EVP_MD_CTX_get_pkey_ctx +void EVP_MD_CTX_set_pkey_ctx(EVP_MD_CTX *ctx, EVP_PKEY_CTX *pctx); +void *EVP_MD_CTX_get0_md_data(const EVP_MD_CTX *ctx); +#define EVP_MD_CTX_md_data EVP_MD_CTX_get0_md_data + +int EVP_CIPHER_get_nid(const EVP_CIPHER *cipher); +#define EVP_CIPHER_nid EVP_CIPHER_get_nid +const char *EVP_CIPHER_get0_name(const EVP_CIPHER *cipher); +#define EVP_CIPHER_name EVP_CIPHER_get0_name +const char *EVP_CIPHER_get0_description(const EVP_CIPHER *cipher); +int EVP_CIPHER_is_a(const EVP_CIPHER *cipher, const char *name); +int EVP_CIPHER_names_do_all(const EVP_CIPHER *cipher, + void (*fn)(const char *name, void *data), + void *data); +const OSSL_PROVIDER *EVP_CIPHER_get0_provider(const EVP_CIPHER *cipher); +int EVP_CIPHER_get_block_size(const EVP_CIPHER *cipher); +#define EVP_CIPHER_block_size EVP_CIPHER_get_block_size +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +int EVP_CIPHER_impl_ctx_size(const EVP_CIPHER *cipher); +#endif +int EVP_CIPHER_get_key_length(const EVP_CIPHER *cipher); +#define EVP_CIPHER_key_length EVP_CIPHER_get_key_length +int EVP_CIPHER_get_iv_length(const EVP_CIPHER *cipher); +#define EVP_CIPHER_iv_length EVP_CIPHER_get_iv_length +unsigned long EVP_CIPHER_get_flags(const EVP_CIPHER *cipher); +#define EVP_CIPHER_flags EVP_CIPHER_get_flags +int EVP_CIPHER_get_mode(const EVP_CIPHER *cipher); +#define EVP_CIPHER_mode EVP_CIPHER_get_mode +int EVP_CIPHER_get_type(const EVP_CIPHER *cipher); +#define EVP_CIPHER_type EVP_CIPHER_get_type +EVP_CIPHER *EVP_CIPHER_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, + const char *properties); +int EVP_CIPHER_can_pipeline(const EVP_CIPHER *cipher, int enc); +int EVP_CIPHER_up_ref(EVP_CIPHER *cipher); +void EVP_CIPHER_free(EVP_CIPHER *cipher); + +const EVP_CIPHER *EVP_CIPHER_CTX_get0_cipher(const EVP_CIPHER_CTX *ctx); +EVP_CIPHER *EVP_CIPHER_CTX_get1_cipher(EVP_CIPHER_CTX *ctx); +int EVP_CIPHER_CTX_is_encrypting(const EVP_CIPHER_CTX *ctx); +#define EVP_CIPHER_CTX_encrypting EVP_CIPHER_CTX_is_encrypting +int EVP_CIPHER_CTX_get_nid(const EVP_CIPHER_CTX *ctx); +#define EVP_CIPHER_CTX_nid EVP_CIPHER_CTX_get_nid +int EVP_CIPHER_CTX_get_block_size(const EVP_CIPHER_CTX *ctx); +#define EVP_CIPHER_CTX_block_size EVP_CIPHER_CTX_get_block_size +int EVP_CIPHER_CTX_get_key_length(const EVP_CIPHER_CTX *ctx); +#define EVP_CIPHER_CTX_key_length EVP_CIPHER_CTX_get_key_length +int EVP_CIPHER_CTX_get_iv_length(const EVP_CIPHER_CTX *ctx); +#define EVP_CIPHER_CTX_iv_length EVP_CIPHER_CTX_get_iv_length +int EVP_CIPHER_CTX_get_tag_length(const EVP_CIPHER_CTX *ctx); +#define EVP_CIPHER_CTX_tag_length EVP_CIPHER_CTX_get_tag_length +#ifndef OPENSSL_NO_DEPRECATED_3_0 +const EVP_CIPHER *EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx); +OSSL_DEPRECATEDIN_3_0 const unsigned char *EVP_CIPHER_CTX_iv(const EVP_CIPHER_CTX *ctx); +OSSL_DEPRECATEDIN_3_0 const unsigned char *EVP_CIPHER_CTX_original_iv(const EVP_CIPHER_CTX *ctx); +OSSL_DEPRECATEDIN_3_0 unsigned char *EVP_CIPHER_CTX_iv_noconst(EVP_CIPHER_CTX *ctx); +#endif +int EVP_CIPHER_CTX_get_updated_iv(EVP_CIPHER_CTX *ctx, void *buf, size_t len); +int EVP_CIPHER_CTX_get_original_iv(EVP_CIPHER_CTX *ctx, void *buf, size_t len); +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +unsigned char *EVP_CIPHER_CTX_buf_noconst(EVP_CIPHER_CTX *ctx); +#endif +int EVP_CIPHER_CTX_get_num(const EVP_CIPHER_CTX *ctx); +#define EVP_CIPHER_CTX_num EVP_CIPHER_CTX_get_num +int EVP_CIPHER_CTX_set_num(EVP_CIPHER_CTX *ctx, int num); +EVP_CIPHER_CTX *EVP_CIPHER_CTX_dup(const EVP_CIPHER_CTX *in); +int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in); +void *EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx); +void EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, void *data); +void *EVP_CIPHER_CTX_get_cipher_data(const EVP_CIPHER_CTX *ctx); +void *EVP_CIPHER_CTX_set_cipher_data(EVP_CIPHER_CTX *ctx, void *cipher_data); +#define EVP_CIPHER_CTX_get0_name(c) EVP_CIPHER_get0_name(EVP_CIPHER_CTX_get0_cipher(c)) +#define EVP_CIPHER_CTX_get_type(c) EVP_CIPHER_get_type(EVP_CIPHER_CTX_get0_cipher(c)) +#define EVP_CIPHER_CTX_type EVP_CIPHER_CTX_get_type +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define EVP_CIPHER_CTX_flags(c) EVP_CIPHER_get_flags(EVP_CIPHER_CTX_get0_cipher(c)) +#endif +#define EVP_CIPHER_CTX_get_mode(c) EVP_CIPHER_get_mode(EVP_CIPHER_CTX_get0_cipher(c)) +#define EVP_CIPHER_CTX_mode EVP_CIPHER_CTX_get_mode + +#define EVP_ENCODE_LENGTH(l) ((((l) + 2) / 3 * 4) + ((l) / 48 + 1) * 2 + 80) +#define EVP_DECODE_LENGTH(l) (((l) + 3) / 4 * 3 + 80) + +#define EVP_SignInit_ex(a, b, c) EVP_DigestInit_ex(a, b, c) +#define EVP_SignInit(a, b) EVP_DigestInit(a, b) +#define EVP_SignUpdate(a, b, c) EVP_DigestUpdate(a, b, c) +#define EVP_VerifyInit_ex(a, b, c) EVP_DigestInit_ex(a, b, c) +#define EVP_VerifyInit(a, b) EVP_DigestInit(a, b) +#define EVP_VerifyUpdate(a, b, c) EVP_DigestUpdate(a, b, c) +#define EVP_OpenUpdate(a, b, c, d, e) EVP_DecryptUpdate(a, b, c, d, e) +#define EVP_SealUpdate(a, b, c, d, e) EVP_EncryptUpdate(a, b, c, d, e) + +#ifdef CONST_STRICT +void BIO_set_md(BIO *, const EVP_MD *md); +#else +#define BIO_set_md(b, md) BIO_ctrl(b, BIO_C_SET_MD, 0, (void *)(md)) +#endif +#define BIO_get_md(b, mdp) BIO_ctrl(b, BIO_C_GET_MD, 0, (mdp)) +#define BIO_get_md_ctx(b, mdcp) BIO_ctrl(b, BIO_C_GET_MD_CTX, 0, (mdcp)) +#define BIO_set_md_ctx(b, mdcp) BIO_ctrl(b, BIO_C_SET_MD_CTX, 0, (mdcp)) +#define BIO_get_cipher_status(b) BIO_ctrl(b, BIO_C_GET_CIPHER_STATUS, 0, NULL) +#define BIO_get_cipher_ctx(b, c_pp) BIO_ctrl(b, BIO_C_GET_CIPHER_CTX, 0, (c_pp)) + +__owur int EVP_Cipher(EVP_CIPHER_CTX *c, + unsigned char *out, + const unsigned char *in, unsigned int inl); + +#define EVP_add_cipher_alias(n, alias) \ + OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n)) +#define EVP_add_digest_alias(n, alias) \ + OBJ_NAME_add((alias), OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, (n)) +#define EVP_delete_cipher_alias(alias) \ + OBJ_NAME_remove(alias, OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS); +#define EVP_delete_digest_alias(alias) \ + OBJ_NAME_remove(alias, OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS); + +int EVP_MD_get_params(const EVP_MD *digest, OSSL_PARAM params[]); +int EVP_MD_CTX_set_params(EVP_MD_CTX *ctx, const OSSL_PARAM params[]); +int EVP_MD_CTX_get_params(EVP_MD_CTX *ctx, OSSL_PARAM params[]); +const OSSL_PARAM *EVP_MD_gettable_params(const EVP_MD *digest); +const OSSL_PARAM *EVP_MD_settable_ctx_params(const EVP_MD *md); +const OSSL_PARAM *EVP_MD_gettable_ctx_params(const EVP_MD *md); +const OSSL_PARAM *EVP_MD_CTX_settable_params(EVP_MD_CTX *ctx); +const OSSL_PARAM *EVP_MD_CTX_gettable_params(EVP_MD_CTX *ctx); +int EVP_MD_CTX_ctrl(EVP_MD_CTX *ctx, int cmd, int p1, void *p2); +EVP_MD_CTX *EVP_MD_CTX_new(void); +int EVP_MD_CTX_reset(EVP_MD_CTX *ctx); +void EVP_MD_CTX_free(EVP_MD_CTX *ctx); +#define EVP_MD_CTX_create() EVP_MD_CTX_new() +#define EVP_MD_CTX_init(ctx) EVP_MD_CTX_reset((ctx)) +#define EVP_MD_CTX_destroy(ctx) EVP_MD_CTX_free((ctx)) +__owur EVP_MD_CTX *EVP_MD_CTX_dup(const EVP_MD_CTX *in); +__owur int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in); +void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags); +void EVP_MD_CTX_clear_flags(EVP_MD_CTX *ctx, int flags); +int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx, int flags); +__owur int EVP_DigestInit_ex2(EVP_MD_CTX *ctx, const EVP_MD *type, + const OSSL_PARAM params[]); +__owur int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, + ENGINE *impl); +__owur int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d, + size_t cnt); +__owur int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, + unsigned int *s); +__owur int EVP_Digest(const void *data, size_t count, + unsigned char *md, unsigned int *size, + const EVP_MD *type, ENGINE *impl); +__owur int EVP_Q_digest(OSSL_LIB_CTX *libctx, const char *name, + const char *propq, const void *data, size_t datalen, + unsigned char *md, size_t *mdlen); + +__owur int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in); +__owur int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type); +__owur int EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, + unsigned int *s); +__owur int EVP_DigestFinalXOF(EVP_MD_CTX *ctx, unsigned char *out, + size_t outlen); +__owur int EVP_DigestSqueeze(EVP_MD_CTX *ctx, unsigned char *out, + size_t outlen); + +__owur EVP_MD *EVP_MD_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, + const char *properties); + +int EVP_MD_up_ref(EVP_MD *md); +void EVP_MD_free(EVP_MD *md); + +int EVP_read_pw_string(char *buf, int length, const char *prompt, int verify); +int EVP_read_pw_string_min(char *buf, int minlen, int maxlen, + const char *prompt, int verify); +void EVP_set_pw_prompt(const char *prompt); +char *EVP_get_pw_prompt(void); + +__owur int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md, + const unsigned char *salt, + const unsigned char *data, int datal, int count, + unsigned char *key, unsigned char *iv); + +void EVP_CIPHER_CTX_set_flags(EVP_CIPHER_CTX *ctx, int flags); +void EVP_CIPHER_CTX_clear_flags(EVP_CIPHER_CTX *ctx, int flags); +int EVP_CIPHER_CTX_test_flags(const EVP_CIPHER_CTX *ctx, int flags); + +__owur int EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + const unsigned char *key, const unsigned char *iv); +__owur int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx, + const EVP_CIPHER *cipher, ENGINE *impl, + const unsigned char *key, + const unsigned char *iv); +__owur int EVP_EncryptInit_ex2(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + const unsigned char *key, + const unsigned char *iv, + const OSSL_PARAM params[]); +__owur int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, + int *outl, const unsigned char *in, int inl); +__owur int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, + int *outl); +__owur int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, + int *outl); + +__owur int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + const unsigned char *key, const unsigned char *iv); +__owur int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx, + const EVP_CIPHER *cipher, ENGINE *impl, + const unsigned char *key, + const unsigned char *iv); +__owur int EVP_DecryptInit_ex2(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + const unsigned char *key, + const unsigned char *iv, + const OSSL_PARAM params[]); +__owur int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, + int *outl, const unsigned char *in, int inl); +__owur int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, + int *outl); +__owur int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, + int *outl); + +__owur int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + const unsigned char *key, const unsigned char *iv, + int enc); +__owur int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, + const EVP_CIPHER *cipher, ENGINE *impl, + const unsigned char *key, + const unsigned char *iv, int enc); +__owur int EVP_CipherInit_SKEY(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + EVP_SKEY *skey, const unsigned char *iv, size_t iv_len, + int enc, const OSSL_PARAM params[]); +__owur int EVP_CipherInit_ex2(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + const unsigned char *key, const unsigned char *iv, + int enc, const OSSL_PARAM params[]); +__owur int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, + int *outl, const unsigned char *in, int inl); +__owur int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, + int *outl); +__owur int EVP_CipherPipelineEncryptInit(EVP_CIPHER_CTX *ctx, + const EVP_CIPHER *cipher, + const unsigned char *key, size_t keylen, + size_t numpipes, + const unsigned char **iv, size_t ivlen); +__owur int EVP_CipherPipelineDecryptInit(EVP_CIPHER_CTX *ctx, + const EVP_CIPHER *cipher, + const unsigned char *key, size_t keylen, + size_t numpipes, + const unsigned char **iv, size_t ivlen); +__owur int EVP_CipherPipelineUpdate(EVP_CIPHER_CTX *ctx, + unsigned char **out, size_t *outl, + const size_t *outsize, + const unsigned char **in, const size_t *inl); +__owur int EVP_CipherPipelineFinal(EVP_CIPHER_CTX *ctx, + unsigned char **outm, size_t *outl, + const size_t *outsize); +__owur int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, + int *outl); + +__owur int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s, + EVP_PKEY *pkey); +__owur int EVP_SignFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s, + EVP_PKEY *pkey, OSSL_LIB_CTX *libctx, + const char *propq); + +__owur int EVP_DigestSign(EVP_MD_CTX *ctx, unsigned char *sigret, + size_t *siglen, const unsigned char *tbs, + size_t tbslen); + +__owur int EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf, + unsigned int siglen, EVP_PKEY *pkey); +__owur int EVP_VerifyFinal_ex(EVP_MD_CTX *ctx, const unsigned char *sigbuf, + unsigned int siglen, EVP_PKEY *pkey, + OSSL_LIB_CTX *libctx, const char *propq); + +__owur int EVP_DigestVerify(EVP_MD_CTX *ctx, const unsigned char *sigret, + size_t siglen, const unsigned char *tbs, + size_t tbslen); + +__owur int EVP_DigestSignInit_ex(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, + const char *mdname, OSSL_LIB_CTX *libctx, + const char *props, EVP_PKEY *pkey, + const OSSL_PARAM params[]); +__owur int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, + const EVP_MD *type, ENGINE *e, + EVP_PKEY *pkey); +__owur int EVP_DigestSignUpdate(EVP_MD_CTX *ctx, const void *data, size_t dsize); +__owur int EVP_DigestSignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, + size_t *siglen); + +__owur int EVP_DigestVerifyInit_ex(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, + const char *mdname, OSSL_LIB_CTX *libctx, + const char *props, EVP_PKEY *pkey, + const OSSL_PARAM params[]); +__owur int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, + const EVP_MD *type, ENGINE *e, + EVP_PKEY *pkey); +int EVP_DigestVerifyUpdate(EVP_MD_CTX *ctx, const void *data, size_t dsize); +__owur int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sig, + size_t siglen); + +__owur int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, + const unsigned char *ek, int ekl, + const unsigned char *iv, EVP_PKEY *priv); +__owur int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); + +__owur int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, + unsigned char **ek, int *ekl, unsigned char *iv, + EVP_PKEY **pubk, int npubk); +__owur int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); + +EVP_ENCODE_CTX *EVP_ENCODE_CTX_new(void); +void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx); +int EVP_ENCODE_CTX_copy(EVP_ENCODE_CTX *dctx, const EVP_ENCODE_CTX *sctx); +int EVP_ENCODE_CTX_num(EVP_ENCODE_CTX *ctx); +void EVP_EncodeInit(EVP_ENCODE_CTX *ctx); +int EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, + const unsigned char *in, int inl); +void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl); +int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int n); + +void EVP_DecodeInit(EVP_ENCODE_CTX *ctx); +int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, + const unsigned char *in, int inl); +int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl); +int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n); + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define EVP_CIPHER_CTX_init(c) EVP_CIPHER_CTX_reset(c) +#define EVP_CIPHER_CTX_cleanup(c) EVP_CIPHER_CTX_reset(c) +#endif +EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void); +int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *c); +void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *c); +int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen); +int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *c, int pad); +int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr); +int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key); +int EVP_CIPHER_get_params(EVP_CIPHER *cipher, OSSL_PARAM params[]); +int EVP_CIPHER_CTX_set_params(EVP_CIPHER_CTX *ctx, const OSSL_PARAM params[]); +int EVP_CIPHER_CTX_get_params(EVP_CIPHER_CTX *ctx, OSSL_PARAM params[]); +const OSSL_PARAM *EVP_CIPHER_gettable_params(const EVP_CIPHER *cipher); +const OSSL_PARAM *EVP_CIPHER_settable_ctx_params(const EVP_CIPHER *cipher); +const OSSL_PARAM *EVP_CIPHER_gettable_ctx_params(const EVP_CIPHER *cipher); +const OSSL_PARAM *EVP_CIPHER_CTX_settable_params(EVP_CIPHER_CTX *ctx); +const OSSL_PARAM *EVP_CIPHER_CTX_gettable_params(EVP_CIPHER_CTX *ctx); + +int EVP_CIPHER_CTX_set_algor_params(EVP_CIPHER_CTX *ctx, const X509_ALGOR *alg); +int EVP_CIPHER_CTX_get_algor_params(EVP_CIPHER_CTX *ctx, X509_ALGOR *alg); +int EVP_CIPHER_CTX_get_algor(EVP_CIPHER_CTX *ctx, X509_ALGOR **alg); + +const BIO_METHOD *BIO_f_md(void); +const BIO_METHOD *BIO_f_base64(void); +const BIO_METHOD *BIO_f_cipher(void); +const BIO_METHOD *BIO_f_reliable(void); +__owur int BIO_set_cipher(BIO *b, const EVP_CIPHER *c, const unsigned char *k, + const unsigned char *i, int enc); + +const EVP_MD *EVP_md_null(void); +#ifndef OPENSSL_NO_MD2 +const EVP_MD *EVP_md2(void); +#endif +#ifndef OPENSSL_NO_MD4 +const EVP_MD *EVP_md4(void); +#endif +#ifndef OPENSSL_NO_MD5 +const EVP_MD *EVP_md5(void); +const EVP_MD *EVP_md5_sha1(void); +#endif +#ifndef OPENSSL_NO_BLAKE2 +const EVP_MD *EVP_blake2b512(void); +const EVP_MD *EVP_blake2s256(void); +#endif +const EVP_MD *EVP_sha1(void); +const EVP_MD *EVP_sha224(void); +const EVP_MD *EVP_sha256(void); +const EVP_MD *EVP_sha384(void); +const EVP_MD *EVP_sha512(void); +const EVP_MD *EVP_sha512_224(void); +const EVP_MD *EVP_sha512_256(void); +const EVP_MD *EVP_sha3_224(void); +const EVP_MD *EVP_sha3_256(void); +const EVP_MD *EVP_sha3_384(void); +const EVP_MD *EVP_sha3_512(void); +const EVP_MD *EVP_shake128(void); +const EVP_MD *EVP_shake256(void); + +#ifndef OPENSSL_NO_MDC2 +const EVP_MD *EVP_mdc2(void); +#endif +#ifndef OPENSSL_NO_RMD160 +const EVP_MD *EVP_ripemd160(void); +#endif +#ifndef OPENSSL_NO_WHIRLPOOL +const EVP_MD *EVP_whirlpool(void); +#endif +#ifndef OPENSSL_NO_SM3 +const EVP_MD *EVP_sm3(void); +#endif +const EVP_CIPHER *EVP_enc_null(void); /* does nothing :-) */ +#ifndef OPENSSL_NO_DES +const EVP_CIPHER *EVP_des_ecb(void); +const EVP_CIPHER *EVP_des_ede(void); +const EVP_CIPHER *EVP_des_ede3(void); +const EVP_CIPHER *EVP_des_ede_ecb(void); +const EVP_CIPHER *EVP_des_ede3_ecb(void); +const EVP_CIPHER *EVP_des_cfb64(void); +#define EVP_des_cfb EVP_des_cfb64 +const EVP_CIPHER *EVP_des_cfb1(void); +const EVP_CIPHER *EVP_des_cfb8(void); +const EVP_CIPHER *EVP_des_ede_cfb64(void); +#define EVP_des_ede_cfb EVP_des_ede_cfb64 +const EVP_CIPHER *EVP_des_ede3_cfb64(void); +#define EVP_des_ede3_cfb EVP_des_ede3_cfb64 +const EVP_CIPHER *EVP_des_ede3_cfb1(void); +const EVP_CIPHER *EVP_des_ede3_cfb8(void); +const EVP_CIPHER *EVP_des_ofb(void); +const EVP_CIPHER *EVP_des_ede_ofb(void); +const EVP_CIPHER *EVP_des_ede3_ofb(void); +const EVP_CIPHER *EVP_des_cbc(void); +const EVP_CIPHER *EVP_des_ede_cbc(void); +const EVP_CIPHER *EVP_des_ede3_cbc(void); +const EVP_CIPHER *EVP_desx_cbc(void); +const EVP_CIPHER *EVP_des_ede3_wrap(void); +/* + * This should now be supported through the dev_crypto ENGINE. But also, why + * are rc4 and md5 declarations made here inside a "NO_DES" precompiler + * branch? + */ +#endif +#ifndef OPENSSL_NO_RC4 +const EVP_CIPHER *EVP_rc4(void); +const EVP_CIPHER *EVP_rc4_40(void); +#ifndef OPENSSL_NO_MD5 +const EVP_CIPHER *EVP_rc4_hmac_md5(void); +#endif +#endif +#ifndef OPENSSL_NO_IDEA +const EVP_CIPHER *EVP_idea_ecb(void); +const EVP_CIPHER *EVP_idea_cfb64(void); +#define EVP_idea_cfb EVP_idea_cfb64 +const EVP_CIPHER *EVP_idea_ofb(void); +const EVP_CIPHER *EVP_idea_cbc(void); +#endif +#ifndef OPENSSL_NO_RC2 +const EVP_CIPHER *EVP_rc2_ecb(void); +const EVP_CIPHER *EVP_rc2_cbc(void); +const EVP_CIPHER *EVP_rc2_40_cbc(void); +const EVP_CIPHER *EVP_rc2_64_cbc(void); +const EVP_CIPHER *EVP_rc2_cfb64(void); +#define EVP_rc2_cfb EVP_rc2_cfb64 +const EVP_CIPHER *EVP_rc2_ofb(void); +#endif +#ifndef OPENSSL_NO_BF +const EVP_CIPHER *EVP_bf_ecb(void); +const EVP_CIPHER *EVP_bf_cbc(void); +const EVP_CIPHER *EVP_bf_cfb64(void); +#define EVP_bf_cfb EVP_bf_cfb64 +const EVP_CIPHER *EVP_bf_ofb(void); +#endif +#ifndef OPENSSL_NO_CAST +const EVP_CIPHER *EVP_cast5_ecb(void); +const EVP_CIPHER *EVP_cast5_cbc(void); +const EVP_CIPHER *EVP_cast5_cfb64(void); +#define EVP_cast5_cfb EVP_cast5_cfb64 +const EVP_CIPHER *EVP_cast5_ofb(void); +#endif +#ifndef OPENSSL_NO_RC5 +const EVP_CIPHER *EVP_rc5_32_12_16_cbc(void); +const EVP_CIPHER *EVP_rc5_32_12_16_ecb(void); +const EVP_CIPHER *EVP_rc5_32_12_16_cfb64(void); +#define EVP_rc5_32_12_16_cfb EVP_rc5_32_12_16_cfb64 +const EVP_CIPHER *EVP_rc5_32_12_16_ofb(void); +#endif +const EVP_CIPHER *EVP_aes_128_ecb(void); +const EVP_CIPHER *EVP_aes_128_cbc(void); +const EVP_CIPHER *EVP_aes_128_cfb1(void); +const EVP_CIPHER *EVP_aes_128_cfb8(void); +const EVP_CIPHER *EVP_aes_128_cfb128(void); +#define EVP_aes_128_cfb EVP_aes_128_cfb128 +const EVP_CIPHER *EVP_aes_128_ofb(void); +const EVP_CIPHER *EVP_aes_128_ctr(void); +const EVP_CIPHER *EVP_aes_128_ccm(void); +const EVP_CIPHER *EVP_aes_128_gcm(void); +const EVP_CIPHER *EVP_aes_128_xts(void); +const EVP_CIPHER *EVP_aes_128_wrap(void); +const EVP_CIPHER *EVP_aes_128_wrap_pad(void); +#ifndef OPENSSL_NO_OCB +const EVP_CIPHER *EVP_aes_128_ocb(void); +#endif +const EVP_CIPHER *EVP_aes_192_ecb(void); +const EVP_CIPHER *EVP_aes_192_cbc(void); +const EVP_CIPHER *EVP_aes_192_cfb1(void); +const EVP_CIPHER *EVP_aes_192_cfb8(void); +const EVP_CIPHER *EVP_aes_192_cfb128(void); +#define EVP_aes_192_cfb EVP_aes_192_cfb128 +const EVP_CIPHER *EVP_aes_192_ofb(void); +const EVP_CIPHER *EVP_aes_192_ctr(void); +const EVP_CIPHER *EVP_aes_192_ccm(void); +const EVP_CIPHER *EVP_aes_192_gcm(void); +const EVP_CIPHER *EVP_aes_192_wrap(void); +const EVP_CIPHER *EVP_aes_192_wrap_pad(void); +#ifndef OPENSSL_NO_OCB +const EVP_CIPHER *EVP_aes_192_ocb(void); +#endif +const EVP_CIPHER *EVP_aes_256_ecb(void); +const EVP_CIPHER *EVP_aes_256_cbc(void); +const EVP_CIPHER *EVP_aes_256_cfb1(void); +const EVP_CIPHER *EVP_aes_256_cfb8(void); +const EVP_CIPHER *EVP_aes_256_cfb128(void); +#define EVP_aes_256_cfb EVP_aes_256_cfb128 +const EVP_CIPHER *EVP_aes_256_ofb(void); +const EVP_CIPHER *EVP_aes_256_ctr(void); +const EVP_CIPHER *EVP_aes_256_ccm(void); +const EVP_CIPHER *EVP_aes_256_gcm(void); +const EVP_CIPHER *EVP_aes_256_xts(void); +const EVP_CIPHER *EVP_aes_256_wrap(void); +const EVP_CIPHER *EVP_aes_256_wrap_pad(void); +#ifndef OPENSSL_NO_OCB +const EVP_CIPHER *EVP_aes_256_ocb(void); +#endif +const EVP_CIPHER *EVP_aes_128_cbc_hmac_sha1(void); +const EVP_CIPHER *EVP_aes_256_cbc_hmac_sha1(void); +const EVP_CIPHER *EVP_aes_128_cbc_hmac_sha256(void); +const EVP_CIPHER *EVP_aes_256_cbc_hmac_sha256(void); +#ifndef OPENSSL_NO_ARIA +const EVP_CIPHER *EVP_aria_128_ecb(void); +const EVP_CIPHER *EVP_aria_128_cbc(void); +const EVP_CIPHER *EVP_aria_128_cfb1(void); +const EVP_CIPHER *EVP_aria_128_cfb8(void); +const EVP_CIPHER *EVP_aria_128_cfb128(void); +#define EVP_aria_128_cfb EVP_aria_128_cfb128 +const EVP_CIPHER *EVP_aria_128_ctr(void); +const EVP_CIPHER *EVP_aria_128_ofb(void); +const EVP_CIPHER *EVP_aria_128_gcm(void); +const EVP_CIPHER *EVP_aria_128_ccm(void); +const EVP_CIPHER *EVP_aria_192_ecb(void); +const EVP_CIPHER *EVP_aria_192_cbc(void); +const EVP_CIPHER *EVP_aria_192_cfb1(void); +const EVP_CIPHER *EVP_aria_192_cfb8(void); +const EVP_CIPHER *EVP_aria_192_cfb128(void); +#define EVP_aria_192_cfb EVP_aria_192_cfb128 +const EVP_CIPHER *EVP_aria_192_ctr(void); +const EVP_CIPHER *EVP_aria_192_ofb(void); +const EVP_CIPHER *EVP_aria_192_gcm(void); +const EVP_CIPHER *EVP_aria_192_ccm(void); +const EVP_CIPHER *EVP_aria_256_ecb(void); +const EVP_CIPHER *EVP_aria_256_cbc(void); +const EVP_CIPHER *EVP_aria_256_cfb1(void); +const EVP_CIPHER *EVP_aria_256_cfb8(void); +const EVP_CIPHER *EVP_aria_256_cfb128(void); +#define EVP_aria_256_cfb EVP_aria_256_cfb128 +const EVP_CIPHER *EVP_aria_256_ctr(void); +const EVP_CIPHER *EVP_aria_256_ofb(void); +const EVP_CIPHER *EVP_aria_256_gcm(void); +const EVP_CIPHER *EVP_aria_256_ccm(void); +#endif +#ifndef OPENSSL_NO_CAMELLIA +const EVP_CIPHER *EVP_camellia_128_ecb(void); +const EVP_CIPHER *EVP_camellia_128_cbc(void); +const EVP_CIPHER *EVP_camellia_128_cfb1(void); +const EVP_CIPHER *EVP_camellia_128_cfb8(void); +const EVP_CIPHER *EVP_camellia_128_cfb128(void); +#define EVP_camellia_128_cfb EVP_camellia_128_cfb128 +const EVP_CIPHER *EVP_camellia_128_ofb(void); +const EVP_CIPHER *EVP_camellia_128_ctr(void); +const EVP_CIPHER *EVP_camellia_192_ecb(void); +const EVP_CIPHER *EVP_camellia_192_cbc(void); +const EVP_CIPHER *EVP_camellia_192_cfb1(void); +const EVP_CIPHER *EVP_camellia_192_cfb8(void); +const EVP_CIPHER *EVP_camellia_192_cfb128(void); +#define EVP_camellia_192_cfb EVP_camellia_192_cfb128 +const EVP_CIPHER *EVP_camellia_192_ofb(void); +const EVP_CIPHER *EVP_camellia_192_ctr(void); +const EVP_CIPHER *EVP_camellia_256_ecb(void); +const EVP_CIPHER *EVP_camellia_256_cbc(void); +const EVP_CIPHER *EVP_camellia_256_cfb1(void); +const EVP_CIPHER *EVP_camellia_256_cfb8(void); +const EVP_CIPHER *EVP_camellia_256_cfb128(void); +#define EVP_camellia_256_cfb EVP_camellia_256_cfb128 +const EVP_CIPHER *EVP_camellia_256_ofb(void); +const EVP_CIPHER *EVP_camellia_256_ctr(void); +#endif +#ifndef OPENSSL_NO_CHACHA +const EVP_CIPHER *EVP_chacha20(void); +#ifndef OPENSSL_NO_POLY1305 +const EVP_CIPHER *EVP_chacha20_poly1305(void); +#endif +#endif + +#ifndef OPENSSL_NO_SEED +const EVP_CIPHER *EVP_seed_ecb(void); +const EVP_CIPHER *EVP_seed_cbc(void); +const EVP_CIPHER *EVP_seed_cfb128(void); +#define EVP_seed_cfb EVP_seed_cfb128 +const EVP_CIPHER *EVP_seed_ofb(void); +#endif + +#ifndef OPENSSL_NO_SM4 +const EVP_CIPHER *EVP_sm4_ecb(void); +const EVP_CIPHER *EVP_sm4_cbc(void); +const EVP_CIPHER *EVP_sm4_cfb128(void); +#define EVP_sm4_cfb EVP_sm4_cfb128 +const EVP_CIPHER *EVP_sm4_ofb(void); +const EVP_CIPHER *EVP_sm4_ctr(void); +#endif + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define OPENSSL_add_all_algorithms_conf() \ + OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \ + | OPENSSL_INIT_ADD_ALL_DIGESTS \ + | OPENSSL_INIT_LOAD_CONFIG, \ + NULL) +#define OPENSSL_add_all_algorithms_noconf() \ + OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \ + | OPENSSL_INIT_ADD_ALL_DIGESTS, \ + NULL) + +#ifdef OPENSSL_LOAD_CONF +#define OpenSSL_add_all_algorithms() OPENSSL_add_all_algorithms_conf() +#else +#define OpenSSL_add_all_algorithms() OPENSSL_add_all_algorithms_noconf() +#endif + +#define OpenSSL_add_all_ciphers() \ + OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS, NULL) +#define OpenSSL_add_all_digests() \ + OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_DIGESTS, NULL) + +#define EVP_cleanup() \ + while (0) \ + continue +#endif + +int EVP_add_cipher(const EVP_CIPHER *cipher); +int EVP_add_digest(const EVP_MD *digest); + +const EVP_CIPHER *EVP_get_cipherbyname(const char *name); +const EVP_MD *EVP_get_digestbyname(const char *name); + +void EVP_CIPHER_do_all(void (*fn)(const EVP_CIPHER *ciph, + const char *from, const char *to, void *x), + void *arg); +void EVP_CIPHER_do_all_sorted(void (*fn)(const EVP_CIPHER *ciph, const char *from, + const char *to, void *x), + void *arg); +void EVP_CIPHER_do_all_provided(OSSL_LIB_CTX *libctx, + void (*fn)(EVP_CIPHER *cipher, void *arg), + void *arg); + +void EVP_MD_do_all(void (*fn)(const EVP_MD *ciph, + const char *from, const char *to, void *x), + void *arg); +void EVP_MD_do_all_sorted(void (*fn)(const EVP_MD *ciph, const char *from, + const char *to, void *x), + void *arg); +void EVP_MD_do_all_provided(OSSL_LIB_CTX *libctx, + void (*fn)(EVP_MD *md, void *arg), + void *arg); + +/* MAC stuff */ + +EVP_MAC *EVP_MAC_fetch(OSSL_LIB_CTX *libctx, const char *algorithm, + const char *properties); +int EVP_MAC_up_ref(EVP_MAC *mac); +void EVP_MAC_free(EVP_MAC *mac); +const char *EVP_MAC_get0_name(const EVP_MAC *mac); +const char *EVP_MAC_get0_description(const EVP_MAC *mac); +int EVP_MAC_is_a(const EVP_MAC *mac, const char *name); +const OSSL_PROVIDER *EVP_MAC_get0_provider(const EVP_MAC *mac); +int EVP_MAC_get_params(EVP_MAC *mac, OSSL_PARAM params[]); + +EVP_MAC_CTX *EVP_MAC_CTX_new(EVP_MAC *mac); +void EVP_MAC_CTX_free(EVP_MAC_CTX *ctx); +EVP_MAC_CTX *EVP_MAC_CTX_dup(const EVP_MAC_CTX *src); +EVP_MAC *EVP_MAC_CTX_get0_mac(EVP_MAC_CTX *ctx); +int EVP_MAC_CTX_get_params(EVP_MAC_CTX *ctx, OSSL_PARAM params[]); +int EVP_MAC_CTX_set_params(EVP_MAC_CTX *ctx, const OSSL_PARAM params[]); + +size_t EVP_MAC_CTX_get_mac_size(EVP_MAC_CTX *ctx); +size_t EVP_MAC_CTX_get_block_size(EVP_MAC_CTX *ctx); +unsigned char *EVP_Q_mac(OSSL_LIB_CTX *libctx, const char *name, const char *propq, + const char *subalg, const OSSL_PARAM *params, + const void *key, size_t keylen, + const unsigned char *data, size_t datalen, + unsigned char *out, size_t outsize, size_t *outlen); +int EVP_MAC_init(EVP_MAC_CTX *ctx, const unsigned char *key, size_t keylen, + const OSSL_PARAM params[]); +int EVP_MAC_init_SKEY(EVP_MAC_CTX *ctx, EVP_SKEY *skey, const OSSL_PARAM params[]); +int EVP_MAC_update(EVP_MAC_CTX *ctx, const unsigned char *data, size_t datalen); +int EVP_MAC_final(EVP_MAC_CTX *ctx, + unsigned char *out, size_t *outl, size_t outsize); +int EVP_MAC_finalXOF(EVP_MAC_CTX *ctx, unsigned char *out, size_t outsize); +const OSSL_PARAM *EVP_MAC_gettable_params(const EVP_MAC *mac); +const OSSL_PARAM *EVP_MAC_gettable_ctx_params(const EVP_MAC *mac); +const OSSL_PARAM *EVP_MAC_settable_ctx_params(const EVP_MAC *mac); +const OSSL_PARAM *EVP_MAC_CTX_gettable_params(EVP_MAC_CTX *ctx); +const OSSL_PARAM *EVP_MAC_CTX_settable_params(EVP_MAC_CTX *ctx); + +void EVP_MAC_do_all_provided(OSSL_LIB_CTX *libctx, + void (*fn)(EVP_MAC *mac, void *arg), + void *arg); +int EVP_MAC_names_do_all(const EVP_MAC *mac, + void (*fn)(const char *name, void *data), + void *data); + +/* RAND stuff */ +EVP_RAND *EVP_RAND_fetch(OSSL_LIB_CTX *libctx, const char *algorithm, + const char *properties); +int EVP_RAND_up_ref(EVP_RAND *rand); +void EVP_RAND_free(EVP_RAND *rand); +const char *EVP_RAND_get0_name(const EVP_RAND *rand); +const char *EVP_RAND_get0_description(const EVP_RAND *md); +int EVP_RAND_is_a(const EVP_RAND *rand, const char *name); +const OSSL_PROVIDER *EVP_RAND_get0_provider(const EVP_RAND *rand); +int EVP_RAND_get_params(EVP_RAND *rand, OSSL_PARAM params[]); + +EVP_RAND_CTX *EVP_RAND_CTX_new(EVP_RAND *rand, EVP_RAND_CTX *parent); +int EVP_RAND_CTX_up_ref(EVP_RAND_CTX *ctx); +void EVP_RAND_CTX_free(EVP_RAND_CTX *ctx); +EVP_RAND *EVP_RAND_CTX_get0_rand(EVP_RAND_CTX *ctx); +int EVP_RAND_CTX_get_params(EVP_RAND_CTX *ctx, OSSL_PARAM params[]); +int EVP_RAND_CTX_set_params(EVP_RAND_CTX *ctx, const OSSL_PARAM params[]); +const OSSL_PARAM *EVP_RAND_gettable_params(const EVP_RAND *rand); +const OSSL_PARAM *EVP_RAND_gettable_ctx_params(const EVP_RAND *rand); +const OSSL_PARAM *EVP_RAND_settable_ctx_params(const EVP_RAND *rand); +const OSSL_PARAM *EVP_RAND_CTX_gettable_params(EVP_RAND_CTX *ctx); +const OSSL_PARAM *EVP_RAND_CTX_settable_params(EVP_RAND_CTX *ctx); + +void EVP_RAND_do_all_provided(OSSL_LIB_CTX *libctx, + void (*fn)(EVP_RAND *rand, void *arg), + void *arg); +int EVP_RAND_names_do_all(const EVP_RAND *rand, + void (*fn)(const char *name, void *data), + void *data); + +__owur int EVP_RAND_instantiate(EVP_RAND_CTX *ctx, unsigned int strength, + int prediction_resistance, + const unsigned char *pstr, size_t pstr_len, + const OSSL_PARAM params[]); +int EVP_RAND_uninstantiate(EVP_RAND_CTX *ctx); +__owur int EVP_RAND_generate(EVP_RAND_CTX *ctx, unsigned char *out, + size_t outlen, unsigned int strength, + int prediction_resistance, + const unsigned char *addin, size_t addin_len); +int EVP_RAND_reseed(EVP_RAND_CTX *ctx, int prediction_resistance, + const unsigned char *ent, size_t ent_len, + const unsigned char *addin, size_t addin_len); +__owur int EVP_RAND_nonce(EVP_RAND_CTX *ctx, unsigned char *out, size_t outlen); +__owur int EVP_RAND_enable_locking(EVP_RAND_CTX *ctx); + +int EVP_RAND_verify_zeroization(EVP_RAND_CTX *ctx); +unsigned int EVP_RAND_get_strength(EVP_RAND_CTX *ctx); +int EVP_RAND_get_state(EVP_RAND_CTX *ctx); + +#define EVP_RAND_STATE_UNINITIALISED 0 +#define EVP_RAND_STATE_READY 1 +#define EVP_RAND_STATE_ERROR 2 + +/* PKEY stuff */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int EVP_PKEY_decrypt_old(unsigned char *dec_key, + const unsigned char *enc_key, + int enc_key_len, + EVP_PKEY *private_key); +OSSL_DEPRECATEDIN_3_0 int EVP_PKEY_encrypt_old(unsigned char *enc_key, + const unsigned char *key, + int key_len, EVP_PKEY *pub_key); +#endif +int EVP_PKEY_is_a(const EVP_PKEY *pkey, const char *name); +int EVP_PKEY_type_names_do_all(const EVP_PKEY *pkey, + void (*fn)(const char *name, void *data), + void *data); +int EVP_PKEY_type(int type); +int EVP_PKEY_get_id(const EVP_PKEY *pkey); +#define EVP_PKEY_id EVP_PKEY_get_id +int EVP_PKEY_get_base_id(const EVP_PKEY *pkey); +#define EVP_PKEY_base_id EVP_PKEY_get_base_id +int EVP_PKEY_get_bits(const EVP_PKEY *pkey); +#define EVP_PKEY_bits EVP_PKEY_get_bits +int EVP_PKEY_get_security_bits(const EVP_PKEY *pkey); +#define EVP_PKEY_security_bits EVP_PKEY_get_security_bits +int EVP_PKEY_get_security_category(const EVP_PKEY *pkey); +int EVP_PKEY_get_size(const EVP_PKEY *pkey); +#define EVP_PKEY_size EVP_PKEY_get_size +int EVP_PKEY_can_sign(const EVP_PKEY *pkey); +int EVP_PKEY_set_type(EVP_PKEY *pkey, int type); +int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len); +int EVP_PKEY_set_type_by_keymgmt(EVP_PKEY *pkey, EVP_KEYMGMT *keymgmt); +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#ifndef OPENSSL_NO_ENGINE +OSSL_DEPRECATEDIN_3_0 +int EVP_PKEY_set1_engine(EVP_PKEY *pkey, ENGINE *e); +OSSL_DEPRECATEDIN_3_0 +ENGINE *EVP_PKEY_get0_engine(const EVP_PKEY *pkey); +#endif +OSSL_DEPRECATEDIN_3_0 +int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key); +OSSL_DEPRECATEDIN_3_0 +void *EVP_PKEY_get0(const EVP_PKEY *pkey); +OSSL_DEPRECATEDIN_3_0 +const unsigned char *EVP_PKEY_get0_hmac(const EVP_PKEY *pkey, size_t *len); +#ifndef OPENSSL_NO_POLY1305 +OSSL_DEPRECATEDIN_3_0 +const unsigned char *EVP_PKEY_get0_poly1305(const EVP_PKEY *pkey, size_t *len); +#endif +#ifndef OPENSSL_NO_SIPHASH +OSSL_DEPRECATEDIN_3_0 +const unsigned char *EVP_PKEY_get0_siphash(const EVP_PKEY *pkey, size_t *len); +#endif + +struct rsa_st; +OSSL_DEPRECATEDIN_3_0 +int EVP_PKEY_set1_RSA(EVP_PKEY *pkey, struct rsa_st *key); +OSSL_DEPRECATEDIN_3_0 +const struct rsa_st *EVP_PKEY_get0_RSA(const EVP_PKEY *pkey); +OSSL_DEPRECATEDIN_3_0 +struct rsa_st *EVP_PKEY_get1_RSA(EVP_PKEY *pkey); + +#ifndef OPENSSL_NO_DSA +struct dsa_st; +OSSL_DEPRECATEDIN_3_0 +int EVP_PKEY_set1_DSA(EVP_PKEY *pkey, struct dsa_st *key); +OSSL_DEPRECATEDIN_3_0 +const struct dsa_st *EVP_PKEY_get0_DSA(const EVP_PKEY *pkey); +OSSL_DEPRECATEDIN_3_0 +struct dsa_st *EVP_PKEY_get1_DSA(EVP_PKEY *pkey); +#endif + +#ifndef OPENSSL_NO_DH +struct dh_st; +OSSL_DEPRECATEDIN_3_0 int EVP_PKEY_set1_DH(EVP_PKEY *pkey, struct dh_st *key); +OSSL_DEPRECATEDIN_3_0 const struct dh_st *EVP_PKEY_get0_DH(const EVP_PKEY *pkey); +OSSL_DEPRECATEDIN_3_0 struct dh_st *EVP_PKEY_get1_DH(EVP_PKEY *pkey); +#endif + +#ifndef OPENSSL_NO_EC +struct ec_key_st; +OSSL_DEPRECATEDIN_3_0 +int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey, struct ec_key_st *key); +OSSL_DEPRECATEDIN_3_0 +const struct ec_key_st *EVP_PKEY_get0_EC_KEY(const EVP_PKEY *pkey); +OSSL_DEPRECATEDIN_3_0 +struct ec_key_st *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey); +#endif +#endif /* OPENSSL_NO_DEPRECATED_3_0 */ + +EVP_PKEY *EVP_PKEY_new(void); +int EVP_PKEY_up_ref(EVP_PKEY *pkey); +EVP_PKEY *EVP_PKEY_dup(EVP_PKEY *pkey); +void EVP_PKEY_free(EVP_PKEY *pkey); +const char *EVP_PKEY_get0_description(const EVP_PKEY *pkey); +const OSSL_PROVIDER *EVP_PKEY_get0_provider(const EVP_PKEY *key); + +EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp, + long length); +int i2d_PublicKey(const EVP_PKEY *a, unsigned char **pp); + +EVP_PKEY *d2i_PrivateKey_ex(int type, EVP_PKEY **a, const unsigned char **pp, + long length, OSSL_LIB_CTX *libctx, + const char *propq); +EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp, + long length); +EVP_PKEY *d2i_AutoPrivateKey_ex(EVP_PKEY **a, const unsigned char **pp, + long length, OSSL_LIB_CTX *libctx, + const char *propq); +EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp, + long length); +int i2d_PrivateKey(const EVP_PKEY *a, unsigned char **pp); +int i2d_PKCS8PrivateKey(const EVP_PKEY *a, unsigned char **pp); + +int i2d_KeyParams(const EVP_PKEY *a, unsigned char **pp); +EVP_PKEY *d2i_KeyParams(int type, EVP_PKEY **a, const unsigned char **pp, + long length); +int i2d_KeyParams_bio(BIO *bp, const EVP_PKEY *pkey); +EVP_PKEY *d2i_KeyParams_bio(int type, EVP_PKEY **a, BIO *in); + +int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from); +int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey); +int EVP_PKEY_save_parameters(EVP_PKEY *pkey, int mode); +int EVP_PKEY_parameters_eq(const EVP_PKEY *a, const EVP_PKEY *b); +int EVP_PKEY_eq(const EVP_PKEY *a, const EVP_PKEY *b); + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b); +OSSL_DEPRECATEDIN_3_0 +int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b); +#endif + +int EVP_PKEY_print_public(BIO *out, const EVP_PKEY *pkey, + int indent, ASN1_PCTX *pctx); +int EVP_PKEY_print_private(BIO *out, const EVP_PKEY *pkey, + int indent, ASN1_PCTX *pctx); +int EVP_PKEY_print_params(BIO *out, const EVP_PKEY *pkey, + int indent, ASN1_PCTX *pctx); +#ifndef OPENSSL_NO_STDIO +int EVP_PKEY_print_public_fp(FILE *fp, const EVP_PKEY *pkey, + int indent, ASN1_PCTX *pctx); +int EVP_PKEY_print_private_fp(FILE *fp, const EVP_PKEY *pkey, + int indent, ASN1_PCTX *pctx); +int EVP_PKEY_print_params_fp(FILE *fp, const EVP_PKEY *pkey, + int indent, ASN1_PCTX *pctx); +#endif + +int EVP_PKEY_get_default_digest_nid(EVP_PKEY *pkey, int *pnid); +int EVP_PKEY_get_default_digest_name(EVP_PKEY *pkey, + char *mdname, size_t mdname_sz); +int EVP_PKEY_digestsign_supports_digest(EVP_PKEY *pkey, OSSL_LIB_CTX *libctx, + const char *name, const char *propq); + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +/* + * For backwards compatibility. Use EVP_PKEY_set1_encoded_public_key in + * preference + */ +#define EVP_PKEY_set1_tls_encodedpoint(pkey, pt, ptlen) \ + EVP_PKEY_set1_encoded_public_key((pkey), (pt), (ptlen)) +#endif + +int EVP_PKEY_set1_encoded_public_key(EVP_PKEY *pkey, + const unsigned char *pub, size_t publen); + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +/* + * For backwards compatibility. Use EVP_PKEY_get1_encoded_public_key in + * preference + */ +#define EVP_PKEY_get1_tls_encodedpoint(pkey, ppt) \ + EVP_PKEY_get1_encoded_public_key((pkey), (ppt)) +#endif + +size_t EVP_PKEY_get1_encoded_public_key(EVP_PKEY *pkey, unsigned char **ppub); + +/* calls methods */ +int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type); +int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type); + +/* These are used by EVP_CIPHER methods */ +int EVP_CIPHER_set_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type); +int EVP_CIPHER_get_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type); + +/* PKCS5 password based encryption */ +int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, + ASN1_TYPE *param, const EVP_CIPHER *cipher, + const EVP_MD *md, int en_de); +int PKCS5_PBE_keyivgen_ex(EVP_CIPHER_CTX *cctx, const char *pass, int passlen, + ASN1_TYPE *param, const EVP_CIPHER *cipher, + const EVP_MD *md, int en_de, OSSL_LIB_CTX *libctx, + const char *propq); +int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen, + const unsigned char *salt, int saltlen, int iter, + int keylen, unsigned char *out); +int PKCS5_PBKDF2_HMAC(const char *pass, int passlen, + const unsigned char *salt, int saltlen, int iter, + const EVP_MD *digest, int keylen, unsigned char *out); +int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, + ASN1_TYPE *param, const EVP_CIPHER *cipher, + const EVP_MD *md, int en_de); +int PKCS5_v2_PBE_keyivgen_ex(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, + ASN1_TYPE *param, const EVP_CIPHER *cipher, + const EVP_MD *md, int en_de, + OSSL_LIB_CTX *libctx, const char *propq); + +#ifndef OPENSSL_NO_SCRYPT +int EVP_PBE_scrypt(const char *pass, size_t passlen, + const unsigned char *salt, size_t saltlen, + uint64_t N, uint64_t r, uint64_t p, uint64_t maxmem, + unsigned char *key, size_t keylen); +int EVP_PBE_scrypt_ex(const char *pass, size_t passlen, + const unsigned char *salt, size_t saltlen, + uint64_t N, uint64_t r, uint64_t p, uint64_t maxmem, + unsigned char *key, size_t keylen, + OSSL_LIB_CTX *ctx, const char *propq); + +int PKCS5_v2_scrypt_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, + int passlen, ASN1_TYPE *param, + const EVP_CIPHER *c, const EVP_MD *md, int en_de); +int PKCS5_v2_scrypt_keyivgen_ex(EVP_CIPHER_CTX *ctx, const char *pass, + int passlen, ASN1_TYPE *param, + const EVP_CIPHER *c, const EVP_MD *md, int en_de, + OSSL_LIB_CTX *libctx, const char *propq); +#endif + +void PKCS5_PBE_add(void); + +int EVP_PBE_CipherInit(ASN1_OBJECT *pbe_obj, const char *pass, int passlen, + ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de); + +int EVP_PBE_CipherInit_ex(ASN1_OBJECT *pbe_obj, const char *pass, int passlen, + ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de, + OSSL_LIB_CTX *libctx, const char *propq); + +/* PBE type */ + +/* Can appear as the outermost AlgorithmIdentifier */ +#define EVP_PBE_TYPE_OUTER 0x0 +/* Is an PRF type OID */ +#define EVP_PBE_TYPE_PRF 0x1 +/* Is a PKCS#5 v2.0 KDF */ +#define EVP_PBE_TYPE_KDF 0x2 + +int EVP_PBE_alg_add_type(int pbe_type, int pbe_nid, int cipher_nid, + int md_nid, EVP_PBE_KEYGEN *keygen); +int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md, + EVP_PBE_KEYGEN *keygen); +int EVP_PBE_find(int type, int pbe_nid, int *pcnid, int *pmnid, + EVP_PBE_KEYGEN **pkeygen); +int EVP_PBE_find_ex(int type, int pbe_nid, int *pcnid, int *pmnid, + EVP_PBE_KEYGEN **pkeygen, EVP_PBE_KEYGEN_EX **pkeygen_ex); +void EVP_PBE_cleanup(void); +int EVP_PBE_get(int *ptype, int *ppbe_nid, size_t num); + +#define ASN1_PKEY_ALIAS 0x1 +#define ASN1_PKEY_DYNAMIC 0x2 +#define ASN1_PKEY_SIGPARAM_NULL 0x4 + +#define ASN1_PKEY_CTRL_PKCS7_SIGN 0x1 +#define ASN1_PKEY_CTRL_PKCS7_ENCRYPT 0x2 +#define ASN1_PKEY_CTRL_DEFAULT_MD_NID 0x3 +#define ASN1_PKEY_CTRL_CMS_SIGN 0x5 +#define ASN1_PKEY_CTRL_CMS_ENVELOPE 0x7 +#define ASN1_PKEY_CTRL_CMS_RI_TYPE 0x8 + +#define ASN1_PKEY_CTRL_SET1_TLS_ENCPT 0x9 +#define ASN1_PKEY_CTRL_GET1_TLS_ENCPT 0xa +#define ASN1_PKEY_CTRL_CMS_IS_RI_TYPE_SUPPORTED 0xb + +#ifndef OPENSSL_NO_DEPRECATED_3_6 +OSSL_DEPRECATEDIN_3_6 int EVP_PKEY_asn1_get_count(void); +OSSL_DEPRECATEDIN_3_6 const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_get0(int idx); +OSSL_DEPRECATEDIN_3_6 +const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find(ENGINE **pe, int type); +OSSL_DEPRECATEDIN_3_6 +const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find_str(ENGINE **pe, + const char *str, int len); +OSSL_DEPRECATEDIN_3_6 int EVP_PKEY_asn1_add0(const EVP_PKEY_ASN1_METHOD *ameth); +OSSL_DEPRECATEDIN_3_6 int EVP_PKEY_asn1_add_alias(int to, int from); +OSSL_DEPRECATEDIN_3_6 +int EVP_PKEY_asn1_get0_info(int *ppkey_id, int *pkey_base_id, + int *ppkey_flags, const char **pinfo, + const char **ppem_str, + const EVP_PKEY_ASN1_METHOD *ameth); + +OSSL_DEPRECATEDIN_3_6 const EVP_PKEY_ASN1_METHOD *EVP_PKEY_get0_asn1(const EVP_PKEY *pkey); +OSSL_DEPRECATEDIN_3_6 EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_new(int id, int flags, + const char *pem_str, + const char *info); +OSSL_DEPRECATEDIN_3_6 void EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst, + const EVP_PKEY_ASN1_METHOD *src); +OSSL_DEPRECATEDIN_3_6 void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth); +OSSL_DEPRECATEDIN_3_6 +void EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth, + int (*pub_decode)(EVP_PKEY *pk, + const X509_PUBKEY *pub), + int (*pub_encode)(X509_PUBKEY *pub, + const EVP_PKEY *pk), + int (*pub_cmp)(const EVP_PKEY *a, + const EVP_PKEY *b), + int (*pub_print)(BIO *out, + const EVP_PKEY *pkey, + int indent, ASN1_PCTX *pctx), + int (*pkey_size)(const EVP_PKEY *pk), + int (*pkey_bits)(const EVP_PKEY *pk)); +OSSL_DEPRECATEDIN_3_6 +void EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth, + int (*priv_decode)(EVP_PKEY *pk, + const PKCS8_PRIV_KEY_INFO + *p8inf), + int (*priv_encode)(PKCS8_PRIV_KEY_INFO *p8, + const EVP_PKEY *pk), + int (*priv_print)(BIO *out, + const EVP_PKEY *pkey, + int indent, + ASN1_PCTX *pctx)); +OSSL_DEPRECATEDIN_3_6 +void EVP_PKEY_asn1_set_param(EVP_PKEY_ASN1_METHOD *ameth, + int (*param_decode)(EVP_PKEY *pkey, + const unsigned char **pder, + int derlen), + int (*param_encode)(const EVP_PKEY *pkey, + unsigned char **pder), + int (*param_missing)(const EVP_PKEY *pk), + int (*param_copy)(EVP_PKEY *to, + const EVP_PKEY *from), + int (*param_cmp)(const EVP_PKEY *a, + const EVP_PKEY *b), + int (*param_print)(BIO *out, + const EVP_PKEY *pkey, + int indent, + ASN1_PCTX *pctx)); + +OSSL_DEPRECATEDIN_3_6 +void EVP_PKEY_asn1_set_free(EVP_PKEY_ASN1_METHOD *ameth, + void (*pkey_free)(EVP_PKEY *pkey)); +OSSL_DEPRECATEDIN_3_6 +void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth, + int (*pkey_ctrl)(EVP_PKEY *pkey, int op, + long arg1, void *arg2)); +OSSL_DEPRECATEDIN_3_6 +void EVP_PKEY_asn1_set_item(EVP_PKEY_ASN1_METHOD *ameth, + int (*item_verify)(EVP_MD_CTX *ctx, + const ASN1_ITEM *it, + const void *data, + const X509_ALGOR *a, + const ASN1_BIT_STRING *sig, + EVP_PKEY *pkey), + int (*item_sign)(EVP_MD_CTX *ctx, + const ASN1_ITEM *it, + const void *data, + X509_ALGOR *alg1, + X509_ALGOR *alg2, + ASN1_BIT_STRING *sig)); + +OSSL_DEPRECATEDIN_3_6 +void EVP_PKEY_asn1_set_siginf(EVP_PKEY_ASN1_METHOD *ameth, + int (*siginf_set)(X509_SIG_INFO *siginf, + const X509_ALGOR *alg, + const ASN1_STRING *sig)); + +OSSL_DEPRECATEDIN_3_6 +void EVP_PKEY_asn1_set_check(EVP_PKEY_ASN1_METHOD *ameth, + int (*pkey_check)(const EVP_PKEY *pk)); + +OSSL_DEPRECATEDIN_3_6 +void EVP_PKEY_asn1_set_public_check(EVP_PKEY_ASN1_METHOD *ameth, + int (*pkey_pub_check)(const EVP_PKEY *pk)); + +OSSL_DEPRECATEDIN_3_6 +void EVP_PKEY_asn1_set_param_check(EVP_PKEY_ASN1_METHOD *ameth, + int (*pkey_param_check)(const EVP_PKEY *pk)); + +OSSL_DEPRECATEDIN_3_6 +void EVP_PKEY_asn1_set_set_priv_key(EVP_PKEY_ASN1_METHOD *ameth, + int (*set_priv_key)(EVP_PKEY *pk, + const unsigned char + *priv, + size_t len)); +OSSL_DEPRECATEDIN_3_6 +void EVP_PKEY_asn1_set_set_pub_key(EVP_PKEY_ASN1_METHOD *ameth, + int (*set_pub_key)(EVP_PKEY *pk, + const unsigned char *pub, + size_t len)); +OSSL_DEPRECATEDIN_3_6 +void EVP_PKEY_asn1_set_get_priv_key(EVP_PKEY_ASN1_METHOD *ameth, + int (*get_priv_key)(const EVP_PKEY *pk, + unsigned char *priv, + size_t *len)); +OSSL_DEPRECATEDIN_3_6 +void EVP_PKEY_asn1_set_get_pub_key(EVP_PKEY_ASN1_METHOD *ameth, + int (*get_pub_key)(const EVP_PKEY *pk, + unsigned char *pub, + size_t *len)); + +OSSL_DEPRECATEDIN_3_6 +void EVP_PKEY_asn1_set_security_bits(EVP_PKEY_ASN1_METHOD *ameth, + int (*pkey_security_bits)(const EVP_PKEY + *pk)); +#endif /* OPENSSL_NO_DEPRECATED_3_6 */ + +int EVP_PKEY_CTX_get_signature_md(EVP_PKEY_CTX *ctx, const EVP_MD **md); +int EVP_PKEY_CTX_set_signature_md(EVP_PKEY_CTX *ctx, const EVP_MD *md); + +int EVP_PKEY_CTX_set1_id(EVP_PKEY_CTX *ctx, const void *id, int len); +int EVP_PKEY_CTX_get1_id(EVP_PKEY_CTX *ctx, void *id); +int EVP_PKEY_CTX_get1_id_len(EVP_PKEY_CTX *ctx, size_t *id_len); + +int EVP_PKEY_CTX_set_kem_op(EVP_PKEY_CTX *ctx, const char *op); + +const char *EVP_PKEY_get0_type_name(const EVP_PKEY *key); + +#define EVP_PKEY_OP_UNDEFINED 0 +#define EVP_PKEY_OP_PARAMGEN (1 << 1) +#define EVP_PKEY_OP_KEYGEN (1 << 2) +#define EVP_PKEY_OP_FROMDATA (1 << 3) +#define EVP_PKEY_OP_SIGN (1 << 4) +#define EVP_PKEY_OP_VERIFY (1 << 5) +#define EVP_PKEY_OP_VERIFYRECOVER (1 << 6) +#define EVP_PKEY_OP_SIGNCTX (1 << 7) +#define EVP_PKEY_OP_VERIFYCTX (1 << 8) +#define EVP_PKEY_OP_ENCRYPT (1 << 9) +#define EVP_PKEY_OP_DECRYPT (1 << 10) +#define EVP_PKEY_OP_DERIVE (1 << 11) +#define EVP_PKEY_OP_ENCAPSULATE (1 << 12) +#define EVP_PKEY_OP_DECAPSULATE (1 << 13) +#define EVP_PKEY_OP_SIGNMSG (1 << 14) +#define EVP_PKEY_OP_VERIFYMSG (1 << 15) +/* Update the following when adding new EVP_PKEY_OPs */ +#define EVP_PKEY_OP_ALL ((1 << 16) - 1) + +#define EVP_PKEY_OP_TYPE_SIG \ + (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG \ + | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG \ + | EVP_PKEY_OP_VERIFYRECOVER \ + | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX) + +#define EVP_PKEY_OP_TYPE_CRYPT \ + (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT) + +#define EVP_PKEY_OP_TYPE_DERIVE \ + (EVP_PKEY_OP_DERIVE) + +#define EVP_PKEY_OP_TYPE_DATA \ + (EVP_PKEY_OP_FROMDATA) + +#define EVP_PKEY_OP_TYPE_KEM \ + (EVP_PKEY_OP_ENCAPSULATE | EVP_PKEY_OP_DECAPSULATE) + +#define EVP_PKEY_OP_TYPE_GEN \ + (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN) + +#define EVP_PKEY_OP_TYPE_NOGEN \ + (EVP_PKEY_OP_ALL & ~EVP_PKEY_OP_TYPE_GEN) + +int EVP_PKEY_CTX_set_mac_key(EVP_PKEY_CTX *ctx, const unsigned char *key, + int keylen); + +#define EVP_PKEY_CTRL_MD 1 +#define EVP_PKEY_CTRL_PEER_KEY 2 +#define EVP_PKEY_CTRL_SET_MAC_KEY 6 +#define EVP_PKEY_CTRL_DIGESTINIT 7 +/* Used by GOST key encryption in TLS */ +#define EVP_PKEY_CTRL_SET_IV 8 +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define EVP_PKEY_CTRL_PKCS7_ENCRYPT 3 +#define EVP_PKEY_CTRL_PKCS7_DECRYPT 4 +#define EVP_PKEY_CTRL_PKCS7_SIGN 5 +#define EVP_PKEY_CTRL_CMS_ENCRYPT 9 +#define EVP_PKEY_CTRL_CMS_DECRYPT 10 +#define EVP_PKEY_CTRL_CMS_SIGN 11 +#endif +#define EVP_PKEY_CTRL_CIPHER 12 +#define EVP_PKEY_CTRL_GET_MD 13 +#define EVP_PKEY_CTRL_SET_DIGEST_SIZE 14 +#define EVP_PKEY_CTRL_SET1_ID 15 +#define EVP_PKEY_CTRL_GET1_ID 16 +#define EVP_PKEY_CTRL_GET1_ID_LEN 17 + +#define EVP_PKEY_ALG_CTRL 0x1000 + +#define EVP_PKEY_FLAG_AUTOARGLEN 2 +/* + * Method handles all operations: don't assume any digest related defaults. + */ +#define EVP_PKEY_FLAG_SIGCTX_CUSTOM 4 +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 const EVP_PKEY_METHOD *EVP_PKEY_meth_find(int type); +OSSL_DEPRECATEDIN_3_0 EVP_PKEY_METHOD *EVP_PKEY_meth_new(int id, int flags); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get0_info(int *ppkey_id, int *pflags, + const EVP_PKEY_METHOD *meth); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_copy(EVP_PKEY_METHOD *dst, + const EVP_PKEY_METHOD *src); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_free(EVP_PKEY_METHOD *pmeth); +OSSL_DEPRECATEDIN_3_0 int EVP_PKEY_meth_add0(const EVP_PKEY_METHOD *pmeth); +OSSL_DEPRECATEDIN_3_0 int EVP_PKEY_meth_remove(const EVP_PKEY_METHOD *pmeth); +OSSL_DEPRECATEDIN_3_0 size_t EVP_PKEY_meth_get_count(void); +OSSL_DEPRECATEDIN_3_0 const EVP_PKEY_METHOD *EVP_PKEY_meth_get0(size_t idx); +#endif + +EVP_KEYMGMT *EVP_KEYMGMT_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, + const char *properties); +int EVP_KEYMGMT_up_ref(EVP_KEYMGMT *keymgmt); +void EVP_KEYMGMT_free(EVP_KEYMGMT *keymgmt); +const OSSL_PROVIDER *EVP_KEYMGMT_get0_provider(const EVP_KEYMGMT *keymgmt); +const char *EVP_KEYMGMT_get0_name(const EVP_KEYMGMT *keymgmt); +const char *EVP_KEYMGMT_get0_description(const EVP_KEYMGMT *keymgmt); +int EVP_KEYMGMT_is_a(const EVP_KEYMGMT *keymgmt, const char *name); +void EVP_KEYMGMT_do_all_provided(OSSL_LIB_CTX *libctx, + void (*fn)(EVP_KEYMGMT *keymgmt, void *arg), + void *arg); +int EVP_KEYMGMT_names_do_all(const EVP_KEYMGMT *keymgmt, + void (*fn)(const char *name, void *data), + void *data); +const OSSL_PARAM *EVP_KEYMGMT_gettable_params(const EVP_KEYMGMT *keymgmt); +const OSSL_PARAM *EVP_KEYMGMT_settable_params(const EVP_KEYMGMT *keymgmt); +const OSSL_PARAM *EVP_KEYMGMT_gen_settable_params(const EVP_KEYMGMT *keymgmt); +const OSSL_PARAM *EVP_KEYMGMT_gen_gettable_params(const EVP_KEYMGMT *keymgmt); + +EVP_SKEYMGMT *EVP_SKEYMGMT_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, + const char *properties); +int EVP_SKEYMGMT_up_ref(EVP_SKEYMGMT *keymgmt); +void EVP_SKEYMGMT_free(EVP_SKEYMGMT *keymgmt); +const OSSL_PROVIDER *EVP_SKEYMGMT_get0_provider(const EVP_SKEYMGMT *keymgmt); +const char *EVP_SKEYMGMT_get0_name(const EVP_SKEYMGMT *keymgmt); +const char *EVP_SKEYMGMT_get0_description(const EVP_SKEYMGMT *keymgmt); +int EVP_SKEYMGMT_is_a(const EVP_SKEYMGMT *keymgmt, const char *name); +void EVP_SKEYMGMT_do_all_provided(OSSL_LIB_CTX *libctx, + void (*fn)(EVP_SKEYMGMT *keymgmt, void *arg), + void *arg); +int EVP_SKEYMGMT_names_do_all(const EVP_SKEYMGMT *keymgmt, + void (*fn)(const char *name, void *data), + void *data); +const OSSL_PARAM *EVP_SKEYMGMT_get0_gen_settable_params(const EVP_SKEYMGMT *skeymgmt); +const OSSL_PARAM *EVP_SKEYMGMT_get0_imp_settable_params(const EVP_SKEYMGMT *skeymgmt); + +EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e); +EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e); +EVP_PKEY_CTX *EVP_PKEY_CTX_new_from_name(OSSL_LIB_CTX *libctx, + const char *name, + const char *propquery); +EVP_PKEY_CTX *EVP_PKEY_CTX_new_from_pkey(OSSL_LIB_CTX *libctx, + EVP_PKEY *pkey, const char *propquery); +EVP_PKEY_CTX *EVP_PKEY_CTX_dup(const EVP_PKEY_CTX *ctx); +void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx); +int EVP_PKEY_CTX_is_a(EVP_PKEY_CTX *ctx, const char *keytype); + +int EVP_PKEY_CTX_get_params(EVP_PKEY_CTX *ctx, OSSL_PARAM *params); +const OSSL_PARAM *EVP_PKEY_CTX_gettable_params(const EVP_PKEY_CTX *ctx); +int EVP_PKEY_CTX_set_params(EVP_PKEY_CTX *ctx, const OSSL_PARAM *params); +const OSSL_PARAM *EVP_PKEY_CTX_settable_params(const EVP_PKEY_CTX *ctx); + +int EVP_PKEY_CTX_set_algor_params(EVP_PKEY_CTX *ctx, const X509_ALGOR *alg); +int EVP_PKEY_CTX_get_algor_params(EVP_PKEY_CTX *ctx, X509_ALGOR *alg); +int EVP_PKEY_CTX_get_algor(EVP_PKEY_CTX *ctx, X509_ALGOR **alg); + +int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype, + int cmd, int p1, void *p2); +int EVP_PKEY_CTX_ctrl_str(EVP_PKEY_CTX *ctx, const char *type, + const char *value); +int EVP_PKEY_CTX_ctrl_uint64(EVP_PKEY_CTX *ctx, int keytype, int optype, + int cmd, uint64_t value); + +int EVP_PKEY_CTX_str2ctrl(EVP_PKEY_CTX *ctx, int cmd, const char *str); +int EVP_PKEY_CTX_hex2ctrl(EVP_PKEY_CTX *ctx, int cmd, const char *hex); + +int EVP_PKEY_CTX_md(EVP_PKEY_CTX *ctx, int optype, int cmd, const char *md); + +int EVP_PKEY_CTX_get_operation(EVP_PKEY_CTX *ctx); +void EVP_PKEY_CTX_set0_keygen_info(EVP_PKEY_CTX *ctx, int *dat, int datlen); + +EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e, + const unsigned char *key, int keylen); +EVP_PKEY *EVP_PKEY_new_raw_private_key_ex(OSSL_LIB_CTX *libctx, + const char *keytype, + const char *propq, + const unsigned char *priv, size_t len); +EVP_PKEY *EVP_PKEY_new_raw_private_key(int type, ENGINE *e, + const unsigned char *priv, + size_t len); +EVP_PKEY *EVP_PKEY_new_raw_public_key_ex(OSSL_LIB_CTX *libctx, + const char *keytype, const char *propq, + const unsigned char *pub, size_t len); +EVP_PKEY *EVP_PKEY_new_raw_public_key(int type, ENGINE *e, + const unsigned char *pub, + size_t len); +int EVP_PKEY_get_raw_private_key(const EVP_PKEY *pkey, unsigned char *priv, + size_t *len); +int EVP_PKEY_get_raw_public_key(const EVP_PKEY *pkey, unsigned char *pub, + size_t *len); + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +EVP_PKEY *EVP_PKEY_new_CMAC_key(ENGINE *e, const unsigned char *priv, + size_t len, const EVP_CIPHER *cipher); +#endif + +void EVP_PKEY_CTX_set_data(EVP_PKEY_CTX *ctx, void *data); +void *EVP_PKEY_CTX_get_data(const EVP_PKEY_CTX *ctx); +EVP_PKEY *EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx); + +EVP_PKEY *EVP_PKEY_CTX_get0_peerkey(EVP_PKEY_CTX *ctx); + +void EVP_PKEY_CTX_set_app_data(EVP_PKEY_CTX *ctx, void *data); +void *EVP_PKEY_CTX_get_app_data(EVP_PKEY_CTX *ctx); + +int EVP_PKEY_CTX_set_signature(EVP_PKEY_CTX *pctx, + const unsigned char *sig, size_t siglen); + +void EVP_SIGNATURE_free(EVP_SIGNATURE *signature); +int EVP_SIGNATURE_up_ref(EVP_SIGNATURE *signature); +OSSL_PROVIDER *EVP_SIGNATURE_get0_provider(const EVP_SIGNATURE *signature); +EVP_SIGNATURE *EVP_SIGNATURE_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, + const char *properties); +int EVP_SIGNATURE_is_a(const EVP_SIGNATURE *signature, const char *name); +const char *EVP_SIGNATURE_get0_name(const EVP_SIGNATURE *signature); +const char *EVP_SIGNATURE_get0_description(const EVP_SIGNATURE *signature); +void EVP_SIGNATURE_do_all_provided(OSSL_LIB_CTX *libctx, + void (*fn)(EVP_SIGNATURE *signature, + void *data), + void *data); +int EVP_SIGNATURE_names_do_all(const EVP_SIGNATURE *signature, + void (*fn)(const char *name, void *data), + void *data); +const OSSL_PARAM *EVP_SIGNATURE_gettable_ctx_params(const EVP_SIGNATURE *sig); +const OSSL_PARAM *EVP_SIGNATURE_settable_ctx_params(const EVP_SIGNATURE *sig); + +void EVP_ASYM_CIPHER_free(EVP_ASYM_CIPHER *cipher); +int EVP_ASYM_CIPHER_up_ref(EVP_ASYM_CIPHER *cipher); +OSSL_PROVIDER *EVP_ASYM_CIPHER_get0_provider(const EVP_ASYM_CIPHER *cipher); +EVP_ASYM_CIPHER *EVP_ASYM_CIPHER_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, + const char *properties); +int EVP_ASYM_CIPHER_is_a(const EVP_ASYM_CIPHER *cipher, const char *name); +const char *EVP_ASYM_CIPHER_get0_name(const EVP_ASYM_CIPHER *cipher); +const char *EVP_ASYM_CIPHER_get0_description(const EVP_ASYM_CIPHER *cipher); +void EVP_ASYM_CIPHER_do_all_provided(OSSL_LIB_CTX *libctx, + void (*fn)(EVP_ASYM_CIPHER *cipher, + void *arg), + void *arg); +int EVP_ASYM_CIPHER_names_do_all(const EVP_ASYM_CIPHER *cipher, + void (*fn)(const char *name, void *data), + void *data); +const OSSL_PARAM *EVP_ASYM_CIPHER_gettable_ctx_params(const EVP_ASYM_CIPHER *ciph); +const OSSL_PARAM *EVP_ASYM_CIPHER_settable_ctx_params(const EVP_ASYM_CIPHER *ciph); + +void EVP_KEM_free(EVP_KEM *wrap); +int EVP_KEM_up_ref(EVP_KEM *wrap); +OSSL_PROVIDER *EVP_KEM_get0_provider(const EVP_KEM *wrap); +EVP_KEM *EVP_KEM_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, + const char *properties); +int EVP_KEM_is_a(const EVP_KEM *wrap, const char *name); +const char *EVP_KEM_get0_name(const EVP_KEM *wrap); +const char *EVP_KEM_get0_description(const EVP_KEM *wrap); +void EVP_KEM_do_all_provided(OSSL_LIB_CTX *libctx, + void (*fn)(EVP_KEM *wrap, void *arg), void *arg); +int EVP_KEM_names_do_all(const EVP_KEM *wrap, + void (*fn)(const char *name, void *data), void *data); +const OSSL_PARAM *EVP_KEM_gettable_ctx_params(const EVP_KEM *kem); +const OSSL_PARAM *EVP_KEM_settable_ctx_params(const EVP_KEM *kem); + +int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx); +int EVP_PKEY_sign_init_ex(EVP_PKEY_CTX *ctx, const OSSL_PARAM params[]); +int EVP_PKEY_sign_init_ex2(EVP_PKEY_CTX *ctx, + EVP_SIGNATURE *algo, const OSSL_PARAM params[]); +int EVP_PKEY_sign(EVP_PKEY_CTX *ctx, + unsigned char *sig, size_t *siglen, + const unsigned char *tbs, size_t tbslen); +int EVP_PKEY_sign_message_init(EVP_PKEY_CTX *ctx, + EVP_SIGNATURE *algo, const OSSL_PARAM params[]); +int EVP_PKEY_sign_message_update(EVP_PKEY_CTX *ctx, + const unsigned char *in, size_t inlen); +int EVP_PKEY_sign_message_final(EVP_PKEY_CTX *ctx, + unsigned char *sig, size_t *siglen); +int EVP_PKEY_verify_init(EVP_PKEY_CTX *ctx); +int EVP_PKEY_verify_init_ex(EVP_PKEY_CTX *ctx, const OSSL_PARAM params[]); +int EVP_PKEY_verify_init_ex2(EVP_PKEY_CTX *ctx, + EVP_SIGNATURE *algo, const OSSL_PARAM params[]); +int EVP_PKEY_verify(EVP_PKEY_CTX *ctx, + const unsigned char *sig, size_t siglen, + const unsigned char *tbs, size_t tbslen); +int EVP_PKEY_verify_message_init(EVP_PKEY_CTX *ctx, + EVP_SIGNATURE *algo, const OSSL_PARAM params[]); +int EVP_PKEY_verify_message_update(EVP_PKEY_CTX *ctx, + const unsigned char *in, size_t inlen); +int EVP_PKEY_verify_message_final(EVP_PKEY_CTX *ctx); +int EVP_PKEY_verify_recover_init(EVP_PKEY_CTX *ctx); +int EVP_PKEY_verify_recover_init_ex(EVP_PKEY_CTX *ctx, + const OSSL_PARAM params[]); +int EVP_PKEY_verify_recover_init_ex2(EVP_PKEY_CTX *ctx, + EVP_SIGNATURE *algo, + const OSSL_PARAM params[]); +int EVP_PKEY_verify_recover(EVP_PKEY_CTX *ctx, + unsigned char *rout, size_t *routlen, + const unsigned char *sig, size_t siglen); +int EVP_PKEY_encrypt_init(EVP_PKEY_CTX *ctx); +int EVP_PKEY_encrypt_init_ex(EVP_PKEY_CTX *ctx, const OSSL_PARAM params[]); +int EVP_PKEY_encrypt(EVP_PKEY_CTX *ctx, + unsigned char *out, size_t *outlen, + const unsigned char *in, size_t inlen); +int EVP_PKEY_decrypt_init(EVP_PKEY_CTX *ctx); +int EVP_PKEY_decrypt_init_ex(EVP_PKEY_CTX *ctx, const OSSL_PARAM params[]); +int EVP_PKEY_decrypt(EVP_PKEY_CTX *ctx, + unsigned char *out, size_t *outlen, + const unsigned char *in, size_t inlen); + +int EVP_PKEY_derive_init(EVP_PKEY_CTX *ctx); +int EVP_PKEY_derive_init_ex(EVP_PKEY_CTX *ctx, const OSSL_PARAM params[]); +int EVP_PKEY_derive_set_peer_ex(EVP_PKEY_CTX *ctx, EVP_PKEY *peer, + int validate_peer); +int EVP_PKEY_derive_set_peer(EVP_PKEY_CTX *ctx, EVP_PKEY *peer); +int EVP_PKEY_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen); +EVP_SKEY *EVP_PKEY_derive_SKEY(EVP_PKEY_CTX *ctx, EVP_SKEYMGMT *mgmt, + const char *key_type, const char *propquery, + size_t keylen, const OSSL_PARAM params[]); + +int EVP_PKEY_encapsulate_init(EVP_PKEY_CTX *ctx, const OSSL_PARAM params[]); +int EVP_PKEY_auth_encapsulate_init(EVP_PKEY_CTX *ctx, EVP_PKEY *authpriv, + const OSSL_PARAM params[]); +int EVP_PKEY_encapsulate(EVP_PKEY_CTX *ctx, + unsigned char *wrappedkey, size_t *wrappedkeylen, + unsigned char *genkey, size_t *genkeylen); +int EVP_PKEY_decapsulate_init(EVP_PKEY_CTX *ctx, const OSSL_PARAM params[]); +int EVP_PKEY_auth_decapsulate_init(EVP_PKEY_CTX *ctx, EVP_PKEY *authpub, + const OSSL_PARAM params[]); +int EVP_PKEY_decapsulate(EVP_PKEY_CTX *ctx, + unsigned char *unwrapped, size_t *unwrappedlen, + const unsigned char *wrapped, size_t wrappedlen); +typedef int EVP_PKEY_gen_cb(EVP_PKEY_CTX *ctx); + +int EVP_PKEY_fromdata_init(EVP_PKEY_CTX *ctx); +int EVP_PKEY_fromdata(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey, int selection, + OSSL_PARAM param[]); +const OSSL_PARAM *EVP_PKEY_fromdata_settable(EVP_PKEY_CTX *ctx, int selection); + +int EVP_PKEY_todata(const EVP_PKEY *pkey, int selection, OSSL_PARAM **params); +int EVP_PKEY_export(const EVP_PKEY *pkey, int selection, + OSSL_CALLBACK *export_cb, void *export_cbarg); + +const OSSL_PARAM *EVP_PKEY_gettable_params(const EVP_PKEY *pkey); +int EVP_PKEY_get_params(const EVP_PKEY *pkey, OSSL_PARAM params[]); +int EVP_PKEY_get_int_param(const EVP_PKEY *pkey, const char *key_name, + int *out); +int EVP_PKEY_get_size_t_param(const EVP_PKEY *pkey, const char *key_name, + size_t *out); +int EVP_PKEY_get_bn_param(const EVP_PKEY *pkey, const char *key_name, + BIGNUM **bn); +int EVP_PKEY_get_utf8_string_param(const EVP_PKEY *pkey, const char *key_name, + char *str, size_t max_buf_sz, size_t *out_sz); +int EVP_PKEY_get_octet_string_param(const EVP_PKEY *pkey, const char *key_name, + unsigned char *buf, size_t max_buf_sz, + size_t *out_sz); + +const OSSL_PARAM *EVP_PKEY_settable_params(const EVP_PKEY *pkey); +int EVP_PKEY_set_params(EVP_PKEY *pkey, OSSL_PARAM params[]); +int EVP_PKEY_set_int_param(EVP_PKEY *pkey, const char *key_name, int in); +int EVP_PKEY_set_size_t_param(EVP_PKEY *pkey, const char *key_name, size_t in); +int EVP_PKEY_set_bn_param(EVP_PKEY *pkey, const char *key_name, + const BIGNUM *bn); +int EVP_PKEY_set_utf8_string_param(EVP_PKEY *pkey, const char *key_name, + const char *str); +int EVP_PKEY_set_octet_string_param(EVP_PKEY *pkey, const char *key_name, + const unsigned char *buf, size_t bsize); + +int EVP_PKEY_get_ec_point_conv_form(const EVP_PKEY *pkey); +int EVP_PKEY_get_field_type(const EVP_PKEY *pkey); + +EVP_PKEY *EVP_PKEY_Q_keygen(OSSL_LIB_CTX *libctx, const char *propq, + const char *type, ...); +int EVP_PKEY_paramgen_init(EVP_PKEY_CTX *ctx); +int EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey); +int EVP_PKEY_keygen_init(EVP_PKEY_CTX *ctx); +int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey); +int EVP_PKEY_generate(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey); +int EVP_PKEY_check(EVP_PKEY_CTX *ctx); +int EVP_PKEY_public_check(EVP_PKEY_CTX *ctx); +int EVP_PKEY_public_check_quick(EVP_PKEY_CTX *ctx); +int EVP_PKEY_param_check(EVP_PKEY_CTX *ctx); +int EVP_PKEY_param_check_quick(EVP_PKEY_CTX *ctx); +int EVP_PKEY_private_check(EVP_PKEY_CTX *ctx); +int EVP_PKEY_pairwise_check(EVP_PKEY_CTX *ctx); + +#define EVP_PKEY_get_ex_new_index(l, p, newf, dupf, freef) \ + CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_EVP_PKEY, l, p, newf, dupf, freef) +int EVP_PKEY_set_ex_data(EVP_PKEY *key, int idx, void *arg); +void *EVP_PKEY_get_ex_data(const EVP_PKEY *key, int idx); + +void EVP_PKEY_CTX_set_cb(EVP_PKEY_CTX *ctx, EVP_PKEY_gen_cb *cb); +EVP_PKEY_gen_cb *EVP_PKEY_CTX_get_cb(EVP_PKEY_CTX *ctx); + +int EVP_PKEY_CTX_get_keygen_info(EVP_PKEY_CTX *ctx, int idx); +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_init(EVP_PKEY_METHOD *pmeth, + int (*init)(EVP_PKEY_CTX *ctx)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_copy(EVP_PKEY_METHOD *pmeth, int (*copy)(EVP_PKEY_CTX *dst, const EVP_PKEY_CTX *src)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_cleanup(EVP_PKEY_METHOD *pmeth, void (*cleanup)(EVP_PKEY_CTX *ctx)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_paramgen(EVP_PKEY_METHOD *pmeth, int (*paramgen_init)(EVP_PKEY_CTX *ctx), + int (*paramgen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_keygen(EVP_PKEY_METHOD *pmeth, int (*keygen_init)(EVP_PKEY_CTX *ctx), + int (*keygen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_sign(EVP_PKEY_METHOD *pmeth, int (*sign_init)(EVP_PKEY_CTX *ctx), + int (*sign)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, + const unsigned char *tbs, size_t tbslen)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_verify(EVP_PKEY_METHOD *pmeth, int (*verify_init)(EVP_PKEY_CTX *ctx), + int (*verify)(EVP_PKEY_CTX *ctx, const unsigned char *sig, size_t siglen, + const unsigned char *tbs, size_t tbslen)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_verify_recover(EVP_PKEY_METHOD *pmeth, int (*verify_recover_init)(EVP_PKEY_CTX *ctx), + int (*verify_recover)(EVP_PKEY_CTX *ctx, unsigned char *sig, + size_t *siglen, const unsigned char *tbs, + size_t tbslen)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_signctx(EVP_PKEY_METHOD *pmeth, int (*signctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx), + int (*signctx)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, + EVP_MD_CTX *mctx)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_verifyctx(EVP_PKEY_METHOD *pmeth, int (*verifyctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx), + int (*verifyctx)(EVP_PKEY_CTX *ctx, const unsigned char *sig, int siglen, + EVP_MD_CTX *mctx)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_encrypt(EVP_PKEY_METHOD *pmeth, int (*encrypt_init)(EVP_PKEY_CTX *ctx), + int (*encryptfn)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, + const unsigned char *in, size_t inlen)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_decrypt(EVP_PKEY_METHOD *pmeth, int (*decrypt_init)(EVP_PKEY_CTX *ctx), + int (*decrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, + const unsigned char *in, size_t inlen)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_derive(EVP_PKEY_METHOD *pmeth, int (*derive_init)(EVP_PKEY_CTX *ctx), + int (*derive)(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_ctrl(EVP_PKEY_METHOD *pmeth, int (*ctrl)(EVP_PKEY_CTX *ctx, int type, int p1, void *p2), + int (*ctrl_str)(EVP_PKEY_CTX *ctx, const char *type, const char *value)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_digestsign(EVP_PKEY_METHOD *pmeth, + int (*digestsign)(EVP_MD_CTX *ctx, unsigned char *sig, size_t *siglen, + const unsigned char *tbs, size_t tbslen)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_digestverify(EVP_PKEY_METHOD *pmeth, + int (*digestverify)(EVP_MD_CTX *ctx, const unsigned char *sig, + size_t siglen, const unsigned char *tbs, + size_t tbslen)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_check(EVP_PKEY_METHOD *pmeth, int (*check)(EVP_PKEY *pkey)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_public_check(EVP_PKEY_METHOD *pmeth, int (*check)(EVP_PKEY *pkey)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_param_check(EVP_PKEY_METHOD *pmeth, int (*check)(EVP_PKEY *pkey)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_set_digest_custom(EVP_PKEY_METHOD *pmeth, int (*digest_custom)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_init(const EVP_PKEY_METHOD *pmeth, int (**pinit)(EVP_PKEY_CTX *ctx)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_copy(const EVP_PKEY_METHOD *pmeth, int (**pcopy)(EVP_PKEY_CTX *dst, const EVP_PKEY_CTX *src)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_cleanup(const EVP_PKEY_METHOD *pmeth, void (**pcleanup)(EVP_PKEY_CTX *ctx)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_paramgen(const EVP_PKEY_METHOD *pmeth, int (**pparamgen_init)(EVP_PKEY_CTX *ctx), + int (**pparamgen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_keygen(const EVP_PKEY_METHOD *pmeth, int (**pkeygen_init)(EVP_PKEY_CTX *ctx), + int (**pkeygen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_sign(const EVP_PKEY_METHOD *pmeth, int (**psign_init)(EVP_PKEY_CTX *ctx), + int (**psign)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, + const unsigned char *tbs, size_t tbslen)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_verify(const EVP_PKEY_METHOD *pmeth, int (**pverify_init)(EVP_PKEY_CTX *ctx), + int (**pverify)(EVP_PKEY_CTX *ctx, const unsigned char *sig, + size_t siglen, const unsigned char *tbs, size_t tbslen)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_verify_recover(const EVP_PKEY_METHOD *pmeth, + int (**pverify_recover_init)(EVP_PKEY_CTX *ctx), + int (**pverify_recover)(EVP_PKEY_CTX *ctx, unsigned char *sig, + size_t *siglen, const unsigned char *tbs, + size_t tbslen)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_signctx(const EVP_PKEY_METHOD *pmeth, + int (**psignctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx), + int (**psignctx)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, + EVP_MD_CTX *mctx)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_verifyctx(const EVP_PKEY_METHOD *pmeth, + int (**pverifyctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx), + int (**pverifyctx)(EVP_PKEY_CTX *ctx, const unsigned char *sig, + int siglen, EVP_MD_CTX *mctx)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_encrypt(const EVP_PKEY_METHOD *pmeth, int (**pencrypt_init)(EVP_PKEY_CTX *ctx), + int (**pencryptfn)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, + const unsigned char *in, size_t inlen)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_decrypt(const EVP_PKEY_METHOD *pmeth, int (**pdecrypt_init)(EVP_PKEY_CTX *ctx), + int (**pdecrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, + const unsigned char *in, size_t inlen)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_derive(const EVP_PKEY_METHOD *pmeth, int (**pderive_init)(EVP_PKEY_CTX *ctx), + int (**pderive)(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_ctrl(const EVP_PKEY_METHOD *pmeth, + int (**pctrl)(EVP_PKEY_CTX *ctx, int type, int p1, void *p2), + int (**pctrl_str)(EVP_PKEY_CTX *ctx, const char *type, + const char *value)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_digestsign(const EVP_PKEY_METHOD *pmeth, + int (**digestsign)(EVP_MD_CTX *ctx, unsigned char *sig, size_t *siglen, + const unsigned char *tbs, size_t tbslen)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_digestverify(const EVP_PKEY_METHOD *pmeth, + int (**digestverify)(EVP_MD_CTX *ctx, const unsigned char *sig, + size_t siglen, const unsigned char *tbs, + size_t tbslen)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_check(const EVP_PKEY_METHOD *pmeth, int (**pcheck)(EVP_PKEY *pkey)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_public_check(const EVP_PKEY_METHOD *pmeth, int (**pcheck)(EVP_PKEY *pkey)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_param_check(const EVP_PKEY_METHOD *pmeth, int (**pcheck)(EVP_PKEY *pkey)); +OSSL_DEPRECATEDIN_3_0 void EVP_PKEY_meth_get_digest_custom(const EVP_PKEY_METHOD *pmeth, + int (**pdigest_custom)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx)); +#endif + +void EVP_KEYEXCH_free(EVP_KEYEXCH *exchange); +int EVP_KEYEXCH_up_ref(EVP_KEYEXCH *exchange); +EVP_KEYEXCH *EVP_KEYEXCH_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, + const char *properties); +OSSL_PROVIDER *EVP_KEYEXCH_get0_provider(const EVP_KEYEXCH *exchange); +int EVP_KEYEXCH_is_a(const EVP_KEYEXCH *keyexch, const char *name); +const char *EVP_KEYEXCH_get0_name(const EVP_KEYEXCH *keyexch); +const char *EVP_KEYEXCH_get0_description(const EVP_KEYEXCH *keyexch); +void EVP_KEYEXCH_do_all_provided(OSSL_LIB_CTX *libctx, + void (*fn)(EVP_KEYEXCH *keyexch, void *data), + void *data); +int EVP_KEYEXCH_names_do_all(const EVP_KEYEXCH *keyexch, + void (*fn)(const char *name, void *data), + void *data); +const OSSL_PARAM *EVP_KEYEXCH_gettable_ctx_params(const EVP_KEYEXCH *keyexch); +const OSSL_PARAM *EVP_KEYEXCH_settable_ctx_params(const EVP_KEYEXCH *keyexch); + +void EVP_add_alg_module(void); + +int EVP_PKEY_CTX_set_group_name(EVP_PKEY_CTX *ctx, const char *name); +int EVP_PKEY_CTX_get_group_name(EVP_PKEY_CTX *ctx, char *name, size_t namelen); +int EVP_PKEY_get_group_name(const EVP_PKEY *pkey, char *name, size_t name_sz, + size_t *gname_len); + +OSSL_LIB_CTX *EVP_PKEY_CTX_get0_libctx(EVP_PKEY_CTX *ctx); +const char *EVP_PKEY_CTX_get0_propq(const EVP_PKEY_CTX *ctx); +const OSSL_PROVIDER *EVP_PKEY_CTX_get0_provider(const EVP_PKEY_CTX *ctx); + +int EVP_SKEY_is_a(const EVP_SKEY *skey, const char *name); +EVP_SKEY *EVP_SKEY_import(OSSL_LIB_CTX *libctx, const char *skeymgmtname, const char *propquery, + int selection, const OSSL_PARAM *params); +EVP_SKEY *EVP_SKEY_generate(OSSL_LIB_CTX *libctx, const char *skeymgmtname, + const char *propquery, const OSSL_PARAM *params); +EVP_SKEY *EVP_SKEY_import_raw_key(OSSL_LIB_CTX *libctx, const char *skeymgmtname, + unsigned char *key, size_t keylen, + const char *propquery); +EVP_SKEY *EVP_SKEY_import_SKEYMGMT(OSSL_LIB_CTX *libctx, EVP_SKEYMGMT *skeymgmt, + int selection, const OSSL_PARAM *params); +int EVP_SKEY_get0_raw_key(const EVP_SKEY *skey, const unsigned char **key, + size_t *len); +const char *EVP_SKEY_get0_key_id(const EVP_SKEY *skey); +int EVP_SKEY_export(const EVP_SKEY *skey, int selection, + OSSL_CALLBACK *export_cb, void *export_cbarg); +int EVP_SKEY_up_ref(EVP_SKEY *skey); +void EVP_SKEY_free(EVP_SKEY *skey); +const char *EVP_SKEY_get0_skeymgmt_name(const EVP_SKEY *skey); +const char *EVP_SKEY_get0_provider_name(const EVP_SKEY *skey); +EVP_SKEY *EVP_SKEY_to_provider(EVP_SKEY *skey, OSSL_LIB_CTX *libctx, + OSSL_PROVIDER *prov, const char *propquery); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/evperr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/evperr.h new file mode 100644 index 0000000000000000000000000000000000000000..06dd95f4e2541e6de79de7fa94368358dfa5dc16 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/evperr.h @@ -0,0 +1,146 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_EVPERR_H +#define OPENSSL_EVPERR_H +#pragma once + +#include +#include +#include + +/* + * EVP reason codes. + */ +#define EVP_R_AES_KEY_SETUP_FAILED 143 +#define EVP_R_ARIA_KEY_SETUP_FAILED 176 +#define EVP_R_BAD_ALGORITHM_NAME 200 +#define EVP_R_BAD_DECRYPT 100 +#define EVP_R_BAD_KEY_LENGTH 195 +#define EVP_R_BUFFER_TOO_SMALL 155 +#define EVP_R_CACHE_CONSTANTS_FAILED 225 +#define EVP_R_CAMELLIA_KEY_SETUP_FAILED 157 +#define EVP_R_CANNOT_GET_PARAMETERS 197 +#define EVP_R_CANNOT_SET_PARAMETERS 198 +#define EVP_R_CIPHER_NOT_GCM_MODE 184 +#define EVP_R_CIPHER_PARAMETER_ERROR 122 +#define EVP_R_COMMAND_NOT_SUPPORTED 147 +#define EVP_R_CONFLICTING_ALGORITHM_NAME 201 +#define EVP_R_COPY_ERROR 173 +#define EVP_R_CTRL_NOT_IMPLEMENTED 132 +#define EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED 133 +#define EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH 138 +#define EVP_R_DECODE_ERROR 114 +#define EVP_R_DEFAULT_QUERY_PARSE_ERROR 210 +#define EVP_R_DIFFERENT_KEY_TYPES 101 +#define EVP_R_DIFFERENT_PARAMETERS 153 +#define EVP_R_ERROR_LOADING_SECTION 165 +#define EVP_R_EXPECTING_AN_HMAC_KEY 174 +#define EVP_R_EXPECTING_AN_RSA_KEY 127 +#define EVP_R_EXPECTING_A_DH_KEY 128 +#define EVP_R_EXPECTING_A_DSA_KEY 129 +#define EVP_R_EXPECTING_A_ECX_KEY 219 +#define EVP_R_EXPECTING_A_EC_KEY 142 +#define EVP_R_EXPECTING_A_POLY1305_KEY 164 +#define EVP_R_EXPECTING_A_SIPHASH_KEY 175 +#define EVP_R_FINAL_ERROR 188 +#define EVP_R_GENERATE_ERROR 214 +#define EVP_R_GETTING_ALGORITHMIDENTIFIER_NOT_SUPPORTED 229 +#define EVP_R_GET_RAW_KEY_FAILED 182 +#define EVP_R_ILLEGAL_SCRYPT_PARAMETERS 171 +#define EVP_R_INACCESSIBLE_DOMAIN_PARAMETERS 204 +#define EVP_R_INACCESSIBLE_KEY 203 +#define EVP_R_INITIALIZATION_ERROR 134 +#define EVP_R_INPUT_NOT_INITIALIZED 111 +#define EVP_R_INVALID_CUSTOM_LENGTH 185 +#define EVP_R_INVALID_DIGEST 152 +#define EVP_R_INVALID_IV_LENGTH 194 +#define EVP_R_INVALID_KEY 163 +#define EVP_R_INVALID_KEY_LENGTH 130 +#define EVP_R_INVALID_LENGTH 221 +#define EVP_R_INVALID_NULL_ALGORITHM 218 +#define EVP_R_INVALID_OPERATION 148 +#define EVP_R_INVALID_PROVIDER_FUNCTIONS 193 +#define EVP_R_INVALID_SALT_LENGTH 186 +#define EVP_R_INVALID_SECRET_LENGTH 223 +#define EVP_R_INVALID_SEED_LENGTH 220 +#define EVP_R_INVALID_VALUE 222 +#define EVP_R_KEYMGMT_EXPORT_FAILURE 205 +#define EVP_R_KEY_SETUP_FAILED 180 +#define EVP_R_LOCKING_NOT_SUPPORTED 213 +#define EVP_R_MEMORY_LIMIT_EXCEEDED 172 +#define EVP_R_MESSAGE_DIGEST_IS_NULL 159 +#define EVP_R_METHOD_NOT_SUPPORTED 144 +#define EVP_R_MISSING_PARAMETERS 103 +#define EVP_R_NOT_ABLE_TO_COPY_CTX 190 +#define EVP_R_NOT_XOF_OR_INVALID_LENGTH 178 +#define EVP_R_NO_CIPHER_SET 131 +#define EVP_R_NO_DEFAULT_DIGEST 158 +#define EVP_R_NO_DIGEST_SET 139 +#define EVP_R_NO_IMPORT_FUNCTION 206 +#define EVP_R_NO_KEYMGMT_AVAILABLE 199 +#define EVP_R_NO_KEYMGMT_PRESENT 196 +#define EVP_R_NO_KEY_SET 154 +#define EVP_R_NO_OPERATION_SET 149 +#define EVP_R_NULL_MAC_PKEY_CTX 208 +#define EVP_R_ONLY_ONESHOT_SUPPORTED 177 +#define EVP_R_OPERATION_NOT_INITIALIZED 151 +#define EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 150 +#define EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_SIGNATURE_TYPE 226 +#define EVP_R_OUTPUT_WOULD_OVERFLOW 202 +#define EVP_R_PARAMETER_TOO_LARGE 187 +#define EVP_R_PARTIALLY_OVERLAPPING 162 +#define EVP_R_PBKDF2_ERROR 181 +#define EVP_R_PIPELINE_NOT_SUPPORTED 230 +#define EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED 179 +#define EVP_R_PRIVATE_KEY_DECODE_ERROR 145 +#define EVP_R_PRIVATE_KEY_ENCODE_ERROR 146 +#define EVP_R_PROVIDER_ASYM_CIPHER_FAILURE 232 +#define EVP_R_PROVIDER_ASYM_CIPHER_NOT_SUPPORTED 235 +#define EVP_R_PROVIDER_KEYMGMT_FAILURE 233 +#define EVP_R_PROVIDER_KEYMGMT_NOT_SUPPORTED 236 +#define EVP_R_PROVIDER_SIGNATURE_FAILURE 234 +#define EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED 237 +#define EVP_R_PUBLIC_KEY_NOT_RSA 106 +#define EVP_R_SETTING_XOF_FAILED 227 +#define EVP_R_SET_DEFAULT_PROPERTY_FAILURE 209 +#define EVP_R_SIGNATURE_TYPE_AND_KEY_TYPE_INCOMPATIBLE 228 +#define EVP_R_TOO_MANY_PIPES 231 +#define EVP_R_TOO_MANY_RECORDS 183 +#define EVP_R_UNABLE_TO_ENABLE_LOCKING 212 +#define EVP_R_UNABLE_TO_GET_MAXIMUM_REQUEST_SIZE 215 +#define EVP_R_UNABLE_TO_GET_RANDOM_STRENGTH 216 +#define EVP_R_UNABLE_TO_LOCK_CONTEXT 211 +#define EVP_R_UNABLE_TO_SET_CALLBACKS 217 +#define EVP_R_UNKNOWN_BITS 166 +#define EVP_R_UNKNOWN_CIPHER 160 +#define EVP_R_UNKNOWN_DIGEST 161 +#define EVP_R_UNKNOWN_KEY_TYPE 207 +#define EVP_R_UNKNOWN_MAX_SIZE 167 +#define EVP_R_UNKNOWN_OPTION 169 +#define EVP_R_UNKNOWN_PBE_ALGORITHM 121 +#define EVP_R_UNKNOWN_SECURITY_BITS 168 +#define EVP_R_UNSUPPORTED_ALGORITHM 156 +#define EVP_R_UNSUPPORTED_CIPHER 107 +#define EVP_R_UNSUPPORTED_KEYLENGTH 123 +#define EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION 124 +#define EVP_R_UNSUPPORTED_KEY_SIZE 108 +#define EVP_R_UNSUPPORTED_KEY_TYPE 224 +#define EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS 135 +#define EVP_R_UNSUPPORTED_PRF 125 +#define EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM 118 +#define EVP_R_UNSUPPORTED_SALT_TYPE 126 +#define EVP_R_UPDATE_ERROR 189 +#define EVP_R_WRAP_MODE_NOT_ALLOWED 170 +#define EVP_R_WRONG_FINAL_BLOCK_LENGTH 109 +#define EVP_R_XTS_DATA_UNIT_IS_TOO_LARGE 191 +#define EVP_R_XTS_DUPLICATED_KEYS 192 + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/fips_names.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/fips_names.h new file mode 100644 index 0000000000000000000000000000000000000000..3e310bb4a8f2ac5994f26e0d3823e908c9dc2a44 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/fips_names.h @@ -0,0 +1,50 @@ +/* + * Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_FIPS_NAMES_H +#define OPENSSL_FIPS_NAMES_H +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Parameter names that the FIPS Provider defines + * All parameters are of type: OSSL_PARAM_UTF8_STRING + */ + +/* The following 4 Parameters are used for FIPS Self Testing */ + +/* The calculated MAC of the module file */ +#define OSSL_PROV_FIPS_PARAM_MODULE_MAC "module-mac" +/* The Version number for the fips install process */ +#define OSSL_PROV_FIPS_PARAM_INSTALL_VERSION "install-version" +/* The calculated MAC of the install status indicator */ +#define OSSL_PROV_FIPS_PARAM_INSTALL_MAC "install-mac" +/* The install status indicator */ +#define OSSL_PROV_FIPS_PARAM_INSTALL_STATUS "install-status" + +/* + * A boolean that determines if the FIPS conditional test errors result in + * the module entering an error state. + * Type: OSSL_PARAM_UTF8_STRING + */ +#define OSSL_PROV_FIPS_PARAM_CONDITIONAL_ERRORS "conditional-errors" + +/* The following are provided for backwards compatibility */ +#define OSSL_PROV_FIPS_PARAM_SECURITY_CHECKS OSSL_PROV_PARAM_SECURITY_CHECKS +#define OSSL_PROV_FIPS_PARAM_TLS1_PRF_EMS_CHECK OSSL_PROV_PARAM_TLS1_PRF_EMS_CHECK +#define OSSL_PROV_FIPS_PARAM_DRBG_TRUNC_DIGEST OSSL_PROV_PARAM_DRBG_TRUNC_DIGEST + +#ifdef __cplusplus +} +#endif + +#endif /* OPENSSL_FIPS_NAMES_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/fipskey.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/fipskey.h new file mode 100644 index 0000000000000000000000000000000000000000..078ae049fd3a87989dda9d6ffda234df17d36920 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/fipskey.h @@ -0,0 +1,47 @@ +/* + * WARNING: do not edit! + * Generated by makefile from include\openssl\fipskey.h.in + * + * Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_FIPSKEY_H +#define OPENSSL_FIPSKEY_H +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The FIPS validation HMAC key, usable as an array initializer. + */ +/* clang-format off */ +#define FIPS_KEY_ELEMENTS \ + 0xf4, 0x55, 0x66, 0x50, 0xac, 0x31, 0xd3, 0x54, 0x61, 0x61, 0x0b, 0xac, 0x4e, 0xd8, 0x1b, 0x1a, 0x18, 0x1b, 0x2d, 0x8a, 0x43, 0xea, 0x28, 0x54, 0xcb, 0xae, 0x22, 0xca, 0x74, 0x56, 0x08, 0x13 +/* clang-format on */ + +/* + * The FIPS validation key, as a string. + */ +/* clang-format off */ +#define FIPS_KEY_STRING "f4556650ac31d35461610bac4ed81b1a181b2d8a43ea2854cbae22ca74560813" +/* clang-format on */ + +/* + * The FIPS provider vendor name, as a string. + */ +/* clang-format off */ +#define FIPS_VENDOR "OpenSSL non-compliant FIPS Provider" +/* clang-format on */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/hmac.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/hmac.h new file mode 100644 index 0000000000000000000000000000000000000000..cb866b22787b0644c519aa7f806e04e3dfc896a6 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/hmac.h @@ -0,0 +1,62 @@ +/* + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_HMAC_H +#define OPENSSL_HMAC_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_HMAC_H +#endif + +#include + +#include + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HMAC_MAX_MD_CBLOCK 200 /* Deprecated */ +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 size_t HMAC_size(const HMAC_CTX *e); +OSSL_DEPRECATEDIN_3_0 HMAC_CTX *HMAC_CTX_new(void); +OSSL_DEPRECATEDIN_3_0 int HMAC_CTX_reset(HMAC_CTX *ctx); +OSSL_DEPRECATEDIN_3_0 void HMAC_CTX_free(HMAC_CTX *ctx); +#endif +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +OSSL_DEPRECATEDIN_1_1_0 __owur int HMAC_Init(HMAC_CTX *ctx, + const void *key, int len, + const EVP_MD *md); +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, + const EVP_MD *md, ENGINE *impl); +OSSL_DEPRECATEDIN_3_0 int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, + size_t len); +OSSL_DEPRECATEDIN_3_0 int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, + unsigned int *len); +OSSL_DEPRECATEDIN_3_0 __owur int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx); +OSSL_DEPRECATEDIN_3_0 void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags); +OSSL_DEPRECATEDIN_3_0 const EVP_MD *HMAC_CTX_get_md(const HMAC_CTX *ctx); +#endif + +unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, + const unsigned char *data, size_t data_len, + unsigned char *md, unsigned int *md_len); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/hpke.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/hpke.h new file mode 100644 index 0000000000000000000000000000000000000000..12496ffe60ee819a9f7c9107cc995067a54cbb58 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/hpke.h @@ -0,0 +1,169 @@ +/* + * Copyright 2022-2024 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* APIs and data structures for HPKE (RFC9180) */ +#ifndef OSSL_HPKE_H +#define OSSL_HPKE_H +#pragma once + +#include + +/* HPKE modes */ +#define OSSL_HPKE_MODE_BASE 0 /* Base mode */ +#define OSSL_HPKE_MODE_PSK 1 /* Pre-shared key mode */ +#define OSSL_HPKE_MODE_AUTH 2 /* Authenticated mode */ +#define OSSL_HPKE_MODE_PSKAUTH 3 /* PSK+authenticated mode */ + +/* + * Max for ikm, psk, pskid, info and exporter contexts. + * RFC9180, section 7.2.1 RECOMMENDS 64 octets but we have test vectors from + * Appendix A.6.1 with a 66 octet IKM so we'll allow that. + */ +#define OSSL_HPKE_MAX_PARMLEN 66 +#define OSSL_HPKE_MIN_PSKLEN 32 +#define OSSL_HPKE_MAX_INFOLEN 1024 + +/* + * The (16bit) HPKE algorithm ID IANA codepoints + * If/when new IANA codepoints are added there are tables in + * crypto/hpke/hpke_util.c that must also be updated. + */ +#define OSSL_HPKE_KEM_ID_RESERVED 0x0000 /* not used */ +#define OSSL_HPKE_KEM_ID_P256 0x0010 /* NIST P-256 */ +#define OSSL_HPKE_KEM_ID_P384 0x0011 /* NIST P-384 */ +#define OSSL_HPKE_KEM_ID_P521 0x0012 /* NIST P-521 */ +#define OSSL_HPKE_KEM_ID_X25519 0x0020 /* Curve25519 */ +#define OSSL_HPKE_KEM_ID_X448 0x0021 /* Curve448 */ + +#define OSSL_HPKE_KDF_ID_RESERVED 0x0000 /* not used */ +#define OSSL_HPKE_KDF_ID_HKDF_SHA256 0x0001 /* HKDF-SHA256 */ +#define OSSL_HPKE_KDF_ID_HKDF_SHA384 0x0002 /* HKDF-SHA384 */ +#define OSSL_HPKE_KDF_ID_HKDF_SHA512 0x0003 /* HKDF-SHA512 */ + +#define OSSL_HPKE_AEAD_ID_RESERVED 0x0000 /* not used */ +#define OSSL_HPKE_AEAD_ID_AES_GCM_128 0x0001 /* AES-GCM-128 */ +#define OSSL_HPKE_AEAD_ID_AES_GCM_256 0x0002 /* AES-GCM-256 */ +#define OSSL_HPKE_AEAD_ID_CHACHA_POLY1305 0x0003 /* Chacha20-Poly1305 */ +#define OSSL_HPKE_AEAD_ID_EXPORTONLY 0xFFFF /* export-only fake ID */ + +/* strings for suite components */ +#define OSSL_HPKE_KEMSTR_P256 "P-256" /* KEM id 0x10 */ +#define OSSL_HPKE_KEMSTR_P384 "P-384" /* KEM id 0x11 */ +#define OSSL_HPKE_KEMSTR_P521 "P-521" /* KEM id 0x12 */ +#define OSSL_HPKE_KEMSTR_X25519 "X25519" /* KEM id 0x20 */ +#define OSSL_HPKE_KEMSTR_X448 "X448" /* KEM id 0x21 */ +#define OSSL_HPKE_KDFSTR_256 "hkdf-sha256" /* KDF id 1 */ +#define OSSL_HPKE_KDFSTR_384 "hkdf-sha384" /* KDF id 2 */ +#define OSSL_HPKE_KDFSTR_512 "hkdf-sha512" /* KDF id 3 */ +#define OSSL_HPKE_AEADSTR_AES128GCM "aes-128-gcm" /* AEAD id 1 */ +#define OSSL_HPKE_AEADSTR_AES256GCM "aes-256-gcm" /* AEAD id 2 */ +#define OSSL_HPKE_AEADSTR_CP "chacha20-poly1305" /* AEAD id 3 */ +#define OSSL_HPKE_AEADSTR_EXP "exporter" /* AEAD id 0xff */ + +/* + * Roles for use in creating an OSSL_HPKE_CTX, most + * important use of this is to control nonce reuse. + */ +#define OSSL_HPKE_ROLE_SENDER 0 +#define OSSL_HPKE_ROLE_RECEIVER 1 + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + uint16_t kem_id; /* Key Encapsulation Method id */ + uint16_t kdf_id; /* Key Derivation Function id */ + uint16_t aead_id; /* AEAD alg id */ +} OSSL_HPKE_SUITE; + +/** + * Suite constants, use this like: + * OSSL_HPKE_SUITE myvar = OSSL_HPKE_SUITE_DEFAULT; + */ +#ifndef OPENSSL_NO_ECX +#define OSSL_HPKE_SUITE_DEFAULT \ + { \ + OSSL_HPKE_KEM_ID_X25519, \ + OSSL_HPKE_KDF_ID_HKDF_SHA256, \ + OSSL_HPKE_AEAD_ID_AES_GCM_128 \ + } +#else +#define OSSL_HPKE_SUITE_DEFAULT \ + { \ + OSSL_HPKE_KEM_ID_P256, \ + OSSL_HPKE_KDF_ID_HKDF_SHA256, \ + OSSL_HPKE_AEAD_ID_AES_GCM_128 \ + } +#endif + +typedef struct ossl_hpke_ctx_st OSSL_HPKE_CTX; + +OSSL_HPKE_CTX *OSSL_HPKE_CTX_new(int mode, OSSL_HPKE_SUITE suite, int role, + OSSL_LIB_CTX *libctx, const char *propq); +void OSSL_HPKE_CTX_free(OSSL_HPKE_CTX *ctx); + +int OSSL_HPKE_encap(OSSL_HPKE_CTX *ctx, + unsigned char *enc, size_t *enclen, + const unsigned char *pub, size_t publen, + const unsigned char *info, size_t infolen); +int OSSL_HPKE_seal(OSSL_HPKE_CTX *ctx, + unsigned char *ct, size_t *ctlen, + const unsigned char *aad, size_t aadlen, + const unsigned char *pt, size_t ptlen); + +int OSSL_HPKE_keygen(OSSL_HPKE_SUITE suite, + unsigned char *pub, size_t *publen, EVP_PKEY **priv, + const unsigned char *ikm, size_t ikmlen, + OSSL_LIB_CTX *libctx, const char *propq); +int OSSL_HPKE_decap(OSSL_HPKE_CTX *ctx, + const unsigned char *enc, size_t enclen, + EVP_PKEY *recippriv, + const unsigned char *info, size_t infolen); +int OSSL_HPKE_open(OSSL_HPKE_CTX *ctx, + unsigned char *pt, size_t *ptlen, + const unsigned char *aad, size_t aadlen, + const unsigned char *ct, size_t ctlen); + +int OSSL_HPKE_export(OSSL_HPKE_CTX *ctx, + unsigned char *secret, + size_t secretlen, + const unsigned char *label, + size_t labellen); + +int OSSL_HPKE_CTX_set1_authpriv(OSSL_HPKE_CTX *ctx, EVP_PKEY *priv); +int OSSL_HPKE_CTX_set1_authpub(OSSL_HPKE_CTX *ctx, + const unsigned char *pub, + size_t publen); +int OSSL_HPKE_CTX_set1_psk(OSSL_HPKE_CTX *ctx, + const char *pskid, + const unsigned char *psk, size_t psklen); + +int OSSL_HPKE_CTX_set1_ikme(OSSL_HPKE_CTX *ctx, + const unsigned char *ikme, size_t ikmelen); + +int OSSL_HPKE_CTX_set_seq(OSSL_HPKE_CTX *ctx, uint64_t seq); +int OSSL_HPKE_CTX_get_seq(OSSL_HPKE_CTX *ctx, uint64_t *seq); + +int OSSL_HPKE_suite_check(OSSL_HPKE_SUITE suite); +int OSSL_HPKE_get_grease_value(const OSSL_HPKE_SUITE *suite_in, + OSSL_HPKE_SUITE *suite, + unsigned char *enc, size_t *enclen, + unsigned char *ct, size_t ctlen, + OSSL_LIB_CTX *libctx, const char *propq); +int OSSL_HPKE_str2suite(const char *str, OSSL_HPKE_SUITE *suite); +size_t OSSL_HPKE_get_ciphertext_size(OSSL_HPKE_SUITE suite, size_t clearlen); +size_t OSSL_HPKE_get_public_encap_size(OSSL_HPKE_SUITE suite); +size_t OSSL_HPKE_get_recommended_ikmelen(OSSL_HPKE_SUITE suite); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/http.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/http.h new file mode 100644 index 0000000000000000000000000000000000000000..91aa923282a2347832d59274b7090ef2fe0f1df6 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/http.h @@ -0,0 +1,117 @@ +/* + * Copyright 2000-2025 The OpenSSL Project Authors. All Rights Reserved. + * Copyright Siemens AG 2018-2020 + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_HTTP_H +#define OPENSSL_HTTP_H +#pragma once + +#include + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define OSSL_HTTP_NAME "http" +#define OSSL_HTTPS_NAME "https" +#define OSSL_HTTP_PREFIX OSSL_HTTP_NAME "://" +#define OSSL_HTTPS_PREFIX OSSL_HTTPS_NAME "://" +#define OSSL_HTTP_PORT "80" +#define OSSL_HTTPS_PORT "443" +#define OPENSSL_NO_PROXY "NO_PROXY" +#define OPENSSL_HTTP_PROXY "HTTP_PROXY" +#define OPENSSL_HTTPS_PROXY "HTTPS_PROXY" + +/* We want to have this even in case of OPENSSL_NO_HTTP */ +int OSSL_parse_url(const char *url, char **pscheme, char **puser, char **phost, + char **pport, int *pport_num, + char **ppath, char **pquery, char **pfrag); + +#ifndef OPENSSL_NO_HTTP + +#define OSSL_HTTP_DEFAULT_MAX_LINE_LEN (4 * 1024) +#define OSSL_HTTP_DEFAULT_MAX_RESP_LEN (100 * 1024) +#define OSSL_HTTP_DEFAULT_MAX_CRL_LEN (32 * 1024 * 1024) +#define OSSL_HTTP_DEFAULT_MAX_RESP_HDR_LINES 256 + +/* Low-level HTTP API */ +OSSL_HTTP_REQ_CTX *OSSL_HTTP_REQ_CTX_new(BIO *wbio, BIO *rbio, int buf_size); +void OSSL_HTTP_REQ_CTX_free(OSSL_HTTP_REQ_CTX *rctx); +int OSSL_HTTP_REQ_CTX_set_request_line(OSSL_HTTP_REQ_CTX *rctx, int method_POST, + const char *server, const char *port, + const char *path); +int OSSL_HTTP_REQ_CTX_add1_header(OSSL_HTTP_REQ_CTX *rctx, + const char *name, const char *value); +int OSSL_HTTP_REQ_CTX_set_expected(OSSL_HTTP_REQ_CTX *rctx, + const char *content_type, int asn1, + int timeout, int keep_alive); +int OSSL_HTTP_REQ_CTX_set1_req(OSSL_HTTP_REQ_CTX *rctx, const char *content_type, + const ASN1_ITEM *it, const ASN1_VALUE *req); +int OSSL_HTTP_REQ_CTX_nbio(OSSL_HTTP_REQ_CTX *rctx); +int OSSL_HTTP_REQ_CTX_nbio_d2i(OSSL_HTTP_REQ_CTX *rctx, + ASN1_VALUE **pval, const ASN1_ITEM *it); +BIO *OSSL_HTTP_REQ_CTX_exchange(OSSL_HTTP_REQ_CTX *rctx); +BIO *OSSL_HTTP_REQ_CTX_get0_mem_bio(const OSSL_HTTP_REQ_CTX *rctx); +size_t OSSL_HTTP_REQ_CTX_get_resp_len(const OSSL_HTTP_REQ_CTX *rctx); +void OSSL_HTTP_REQ_CTX_set_max_response_length(OSSL_HTTP_REQ_CTX *rctx, + unsigned long len); +void OSSL_HTTP_REQ_CTX_set_max_response_hdr_lines(OSSL_HTTP_REQ_CTX *rctx, + size_t count); +int OSSL_HTTP_is_alive(const OSSL_HTTP_REQ_CTX *rctx); + +/* High-level HTTP API */ +typedef BIO *(*OSSL_HTTP_bio_cb_t)(BIO *bio, void *arg, int connect, int detail); +OSSL_HTTP_REQ_CTX *OSSL_HTTP_open(const char *server, const char *port, + const char *proxy, const char *no_proxy, + int use_ssl, BIO *bio, BIO *rbio, + OSSL_HTTP_bio_cb_t bio_update_fn, void *arg, + int buf_size, int overall_timeout); +int OSSL_HTTP_proxy_connect(BIO *bio, const char *server, const char *port, + const char *proxyuser, const char *proxypass, + int timeout, BIO *bio_err, const char *prog); +int OSSL_HTTP_set1_request(OSSL_HTTP_REQ_CTX *rctx, const char *path, + const STACK_OF(CONF_VALUE) *headers, + const char *content_type, BIO *req, + const char *expected_content_type, int expect_asn1, + size_t max_resp_len, int timeout, int keep_alive); +BIO *OSSL_HTTP_exchange(OSSL_HTTP_REQ_CTX *rctx, char **redirection_url); +BIO *OSSL_HTTP_get(const char *url, const char *proxy, const char *no_proxy, + BIO *bio, BIO *rbio, + OSSL_HTTP_bio_cb_t bio_update_fn, void *arg, + int buf_size, const STACK_OF(CONF_VALUE) *headers, + const char *expected_content_type, int expect_asn1, + size_t max_resp_len, int timeout); +BIO *OSSL_HTTP_transfer(OSSL_HTTP_REQ_CTX **prctx, + const char *server, const char *port, + const char *path, int use_ssl, + const char *proxy, const char *no_proxy, + BIO *bio, BIO *rbio, + OSSL_HTTP_bio_cb_t bio_update_fn, void *arg, + int buf_size, const STACK_OF(CONF_VALUE) *headers, + const char *content_type, BIO *req, + const char *expected_content_type, int expect_asn1, + size_t max_resp_len, int timeout, int keep_alive); +int OSSL_HTTP_close(OSSL_HTTP_REQ_CTX *rctx, int ok); + +/* Auxiliary functions */ +int OSSL_HTTP_parse_url(const char *url, int *pssl, char **puser, char **phost, + char **pport, int *pport_num, + char **ppath, char **pquery, char **pfrag); +const char *OSSL_HTTP_adapt_proxy(const char *proxy, const char *no_proxy, + const char *server, int use_ssl); + +#endif /* !defined(OPENSSL_NO_HTTP) */ +#ifdef __cplusplus +} +#endif +#endif /* !defined(OPENSSL_HTTP_H) */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/httperr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/httperr.h new file mode 100644 index 0000000000000000000000000000000000000000..4c1cc6ad6bf7707b18dbf72a49cede502519e894 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/httperr.h @@ -0,0 +1,55 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_HTTPERR_H +#define OPENSSL_HTTPERR_H +#pragma once + +#include +#include +#include + +/* + * HTTP reason codes. + */ +#define HTTP_R_ASN1_LEN_EXCEEDS_MAX_RESP_LEN 108 +#define HTTP_R_CONNECT_FAILURE 100 +#define HTTP_R_CONTENT_TYPE_MISMATCH 131 +#define HTTP_R_ERROR_PARSING_ASN1_LENGTH 109 +#define HTTP_R_ERROR_PARSING_CONTENT_LENGTH 119 +#define HTTP_R_ERROR_PARSING_URL 101 +#define HTTP_R_ERROR_RECEIVING 103 +#define HTTP_R_ERROR_SENDING 102 +#define HTTP_R_FAILED_READING_DATA 128 +#define HTTP_R_HEADER_PARSE_ERROR 126 +#define HTTP_R_INCONSISTENT_CONTENT_LENGTH 120 +#define HTTP_R_INVALID_PORT_NUMBER 123 +#define HTTP_R_INVALID_URL_PATH 125 +#define HTTP_R_INVALID_URL_SCHEME 124 +#define HTTP_R_MAX_RESP_LEN_EXCEEDED 117 +#define HTTP_R_MISSING_ASN1_ENCODING 110 +#define HTTP_R_MISSING_CONTENT_TYPE 121 +#define HTTP_R_MISSING_REDIRECT_LOCATION 111 +#define HTTP_R_RECEIVED_ERROR 105 +#define HTTP_R_RECEIVED_WRONG_HTTP_VERSION 106 +#define HTTP_R_REDIRECTION_FROM_HTTPS_TO_HTTP 112 +#define HTTP_R_REDIRECTION_NOT_ENABLED 116 +#define HTTP_R_RESPONSE_LINE_TOO_LONG 113 +#define HTTP_R_RESPONSE_PARSE_ERROR 104 +#define HTTP_R_RESPONSE_TOO_MANY_HDRLINES 130 +#define HTTP_R_RETRY_TIMEOUT 129 +#define HTTP_R_SERVER_CANCELED_CONNECTION 127 +#define HTTP_R_SOCK_NOT_SUPPORTED 122 +#define HTTP_R_STATUS_CODE_UNSUPPORTED 114 +#define HTTP_R_TLS_NOT_ENABLED 107 +#define HTTP_R_TOO_MANY_REDIRECTIONS 115 +#define HTTP_R_UNEXPECTED_CONTENT_TYPE 118 + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/idea.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/idea.h new file mode 100644 index 0000000000000000000000000000000000000000..674a941b1a3ab1c0d127eea024df2f5d4afe6845 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/idea.h @@ -0,0 +1,82 @@ +/* + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_IDEA_H +#define OPENSSL_IDEA_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_IDEA_H +#endif + +#include + +#ifndef OPENSSL_NO_IDEA +#ifdef __cplusplus +extern "C" { +#endif + +#define IDEA_BLOCK 8 +#define IDEA_KEY_LENGTH 16 + +#ifndef OPENSSL_NO_DEPRECATED_3_0 + +typedef unsigned int IDEA_INT; + +#define IDEA_ENCRYPT 1 +#define IDEA_DECRYPT 0 + +typedef struct idea_key_st { + IDEA_INT data[9][6]; +} IDEA_KEY_SCHEDULE; +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 const char *IDEA_options(void); +OSSL_DEPRECATEDIN_3_0 void IDEA_ecb_encrypt(const unsigned char *in, + unsigned char *out, + IDEA_KEY_SCHEDULE *ks); +OSSL_DEPRECATEDIN_3_0 void IDEA_set_encrypt_key(const unsigned char *key, + IDEA_KEY_SCHEDULE *ks); +OSSL_DEPRECATEDIN_3_0 void IDEA_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, + IDEA_KEY_SCHEDULE *dk); +OSSL_DEPRECATEDIN_3_0 void IDEA_cbc_encrypt(const unsigned char *in, + unsigned char *out, long length, + IDEA_KEY_SCHEDULE *ks, + unsigned char *iv, int enc); +OSSL_DEPRECATEDIN_3_0 void IDEA_cfb64_encrypt(const unsigned char *in, + unsigned char *out, long length, + IDEA_KEY_SCHEDULE *ks, + unsigned char *iv, int *num, + int enc); +OSSL_DEPRECATEDIN_3_0 void IDEA_ofb64_encrypt(const unsigned char *in, + unsigned char *out, long length, + IDEA_KEY_SCHEDULE *ks, + unsigned char *iv, int *num); +OSSL_DEPRECATEDIN_3_0 void IDEA_encrypt(unsigned long *in, + IDEA_KEY_SCHEDULE *ks); +#endif + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define idea_options IDEA_options +#define idea_ecb_encrypt IDEA_ecb_encrypt +#define idea_set_encrypt_key IDEA_set_encrypt_key +#define idea_set_decrypt_key IDEA_set_decrypt_key +#define idea_cbc_encrypt IDEA_cbc_encrypt +#define idea_cfb64_encrypt IDEA_cfb64_encrypt +#define idea_ofb64_encrypt IDEA_ofb64_encrypt +#define idea_encrypt IDEA_encrypt +#endif + +#ifdef __cplusplus +} +#endif +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/indicator.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/indicator.h new file mode 100644 index 0000000000000000000000000000000000000000..66d6f4234a65c1c67c559bad06300195e5f66004 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/indicator.h @@ -0,0 +1,31 @@ +/* + * Copyright 2024 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_INDICATOR_H +#define OPENSSL_INDICATOR_H +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +typedef int(OSSL_INDICATOR_CALLBACK)(const char *type, const char *desc, + const OSSL_PARAM params[]); + +void OSSL_INDICATOR_set_callback(OSSL_LIB_CTX *libctx, + OSSL_INDICATOR_CALLBACK *cb); +void OSSL_INDICATOR_get_callback(OSSL_LIB_CTX *libctx, + OSSL_INDICATOR_CALLBACK **cb); + +#ifdef __cplusplus +} +#endif +#endif /* OPENSSL_INDICATOR_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/kdf.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/kdf.h new file mode 100644 index 0000000000000000000000000000000000000000..f3267eae38daf0853b37fb75907263a60590b29e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/kdf.h @@ -0,0 +1,141 @@ +/* + * Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_KDF_H +#define OPENSSL_KDF_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_KDF_H +#endif + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +int EVP_KDF_up_ref(EVP_KDF *kdf); +void EVP_KDF_free(EVP_KDF *kdf); +EVP_KDF *EVP_KDF_fetch(OSSL_LIB_CTX *libctx, const char *algorithm, + const char *properties); + +EVP_KDF_CTX *EVP_KDF_CTX_new(EVP_KDF *kdf); +void EVP_KDF_CTX_free(EVP_KDF_CTX *ctx); +EVP_KDF_CTX *EVP_KDF_CTX_dup(const EVP_KDF_CTX *src); +const char *EVP_KDF_get0_description(const EVP_KDF *kdf); +int EVP_KDF_is_a(const EVP_KDF *kdf, const char *name); +const char *EVP_KDF_get0_name(const EVP_KDF *kdf); +const OSSL_PROVIDER *EVP_KDF_get0_provider(const EVP_KDF *kdf); +const EVP_KDF *EVP_KDF_CTX_kdf(EVP_KDF_CTX *ctx); + +void EVP_KDF_CTX_reset(EVP_KDF_CTX *ctx); +size_t EVP_KDF_CTX_get_kdf_size(EVP_KDF_CTX *ctx); +int EVP_KDF_derive(EVP_KDF_CTX *ctx, unsigned char *key, size_t keylen, + const OSSL_PARAM params[]); +int EVP_KDF_CTX_set_SKEY(EVP_KDF_CTX *ctx, EVP_SKEY *key, const char *paramname); +EVP_SKEY *EVP_KDF_derive_SKEY(EVP_KDF_CTX *ctx, EVP_SKEYMGMT *mgmt, + const char *key_type, const char *propquery, + size_t keylen, const OSSL_PARAM params[]); +int EVP_KDF_get_params(EVP_KDF *kdf, OSSL_PARAM params[]); +int EVP_KDF_CTX_get_params(EVP_KDF_CTX *ctx, OSSL_PARAM params[]); +int EVP_KDF_CTX_set_params(EVP_KDF_CTX *ctx, const OSSL_PARAM params[]); +const OSSL_PARAM *EVP_KDF_gettable_params(const EVP_KDF *kdf); +const OSSL_PARAM *EVP_KDF_gettable_ctx_params(const EVP_KDF *kdf); +const OSSL_PARAM *EVP_KDF_settable_ctx_params(const EVP_KDF *kdf); +const OSSL_PARAM *EVP_KDF_CTX_gettable_params(EVP_KDF_CTX *ctx); +const OSSL_PARAM *EVP_KDF_CTX_settable_params(EVP_KDF_CTX *ctx); + +void EVP_KDF_do_all_provided(OSSL_LIB_CTX *libctx, + void (*fn)(EVP_KDF *kdf, void *arg), + void *arg); +int EVP_KDF_names_do_all(const EVP_KDF *kdf, + void (*fn)(const char *name, void *data), + void *data); + +#define EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND 0 +#define EVP_KDF_HKDF_MODE_EXTRACT_ONLY 1 +#define EVP_KDF_HKDF_MODE_EXPAND_ONLY 2 + +#define EVP_KDF_SSHKDF_TYPE_INITIAL_IV_CLI_TO_SRV 65 +#define EVP_KDF_SSHKDF_TYPE_INITIAL_IV_SRV_TO_CLI 66 +#define EVP_KDF_SSHKDF_TYPE_ENCRYPTION_KEY_CLI_TO_SRV 67 +#define EVP_KDF_SSHKDF_TYPE_ENCRYPTION_KEY_SRV_TO_CLI 68 +#define EVP_KDF_SSHKDF_TYPE_INTEGRITY_KEY_CLI_TO_SRV 69 +#define EVP_KDF_SSHKDF_TYPE_INTEGRITY_KEY_SRV_TO_CLI 70 + +/**** The legacy PKEY-based KDF API follows. ****/ + +#define EVP_PKEY_CTRL_TLS_MD (EVP_PKEY_ALG_CTRL) +#define EVP_PKEY_CTRL_TLS_SECRET (EVP_PKEY_ALG_CTRL + 1) +#define EVP_PKEY_CTRL_TLS_SEED (EVP_PKEY_ALG_CTRL + 2) +#define EVP_PKEY_CTRL_HKDF_MD (EVP_PKEY_ALG_CTRL + 3) +#define EVP_PKEY_CTRL_HKDF_SALT (EVP_PKEY_ALG_CTRL + 4) +#define EVP_PKEY_CTRL_HKDF_KEY (EVP_PKEY_ALG_CTRL + 5) +#define EVP_PKEY_CTRL_HKDF_INFO (EVP_PKEY_ALG_CTRL + 6) +#define EVP_PKEY_CTRL_HKDF_MODE (EVP_PKEY_ALG_CTRL + 7) +#define EVP_PKEY_CTRL_PASS (EVP_PKEY_ALG_CTRL + 8) +#define EVP_PKEY_CTRL_SCRYPT_SALT (EVP_PKEY_ALG_CTRL + 9) +#define EVP_PKEY_CTRL_SCRYPT_N (EVP_PKEY_ALG_CTRL + 10) +#define EVP_PKEY_CTRL_SCRYPT_R (EVP_PKEY_ALG_CTRL + 11) +#define EVP_PKEY_CTRL_SCRYPT_P (EVP_PKEY_ALG_CTRL + 12) +#define EVP_PKEY_CTRL_SCRYPT_MAXMEM_BYTES (EVP_PKEY_ALG_CTRL + 13) + +#define EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND \ + EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND +#define EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY \ + EVP_KDF_HKDF_MODE_EXTRACT_ONLY +#define EVP_PKEY_HKDEF_MODE_EXPAND_ONLY \ + EVP_KDF_HKDF_MODE_EXPAND_ONLY + +int EVP_PKEY_CTX_set_tls1_prf_md(EVP_PKEY_CTX *ctx, const EVP_MD *md); + +int EVP_PKEY_CTX_set1_tls1_prf_secret(EVP_PKEY_CTX *pctx, + const unsigned char *sec, int seclen); + +int EVP_PKEY_CTX_add1_tls1_prf_seed(EVP_PKEY_CTX *pctx, + const unsigned char *seed, int seedlen); + +int EVP_PKEY_CTX_set_hkdf_md(EVP_PKEY_CTX *ctx, const EVP_MD *md); + +int EVP_PKEY_CTX_set1_hkdf_salt(EVP_PKEY_CTX *ctx, + const unsigned char *salt, int saltlen); + +int EVP_PKEY_CTX_set1_hkdf_key(EVP_PKEY_CTX *ctx, + const unsigned char *key, int keylen); + +int EVP_PKEY_CTX_add1_hkdf_info(EVP_PKEY_CTX *ctx, + const unsigned char *info, int infolen); + +int EVP_PKEY_CTX_set_hkdf_mode(EVP_PKEY_CTX *ctx, int mode); +#define EVP_PKEY_CTX_hkdf_mode EVP_PKEY_CTX_set_hkdf_mode + +int EVP_PKEY_CTX_set1_pbe_pass(EVP_PKEY_CTX *ctx, const char *pass, + int passlen); + +int EVP_PKEY_CTX_set1_scrypt_salt(EVP_PKEY_CTX *ctx, + const unsigned char *salt, int saltlen); + +int EVP_PKEY_CTX_set_scrypt_N(EVP_PKEY_CTX *ctx, uint64_t n); + +int EVP_PKEY_CTX_set_scrypt_r(EVP_PKEY_CTX *ctx, uint64_t r); + +int EVP_PKEY_CTX_set_scrypt_p(EVP_PKEY_CTX *ctx, uint64_t p); + +int EVP_PKEY_CTX_set_scrypt_maxmem_bytes(EVP_PKEY_CTX *ctx, + uint64_t maxmem_bytes); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/kdferr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/kdferr.h new file mode 100644 index 0000000000000000000000000000000000000000..a2c1f24e046df7164c706fc99693747c74c21413 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/kdferr.h @@ -0,0 +1,16 @@ +/* + * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_KDFERR_H +#define OPENSSL_KDFERR_H +#pragma once + +#include + +#endif /* !defined(OPENSSL_KDFERR_H) */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/lhash.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/lhash.h new file mode 100644 index 0000000000000000000000000000000000000000..c481f74d96968ffa9a570f83e5e92ce5f7396fd8 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/lhash.h @@ -0,0 +1,417 @@ +/* + * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* clang-format off */ + +/* clang-format on */ + +/* + * Header for dynamic hash table routines Author - Eric Young + */ + +#ifndef OPENSSL_LHASH_H +#define OPENSSL_LHASH_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_LHASH_H +#endif + +#include +#include +#ifndef OPENSSL_NO_STDIO +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct lhash_node_st OPENSSL_LH_NODE; +typedef int (*OPENSSL_LH_COMPFUNC)(const void *, const void *); +typedef int (*OPENSSL_LH_COMPFUNCTHUNK)(const void *, const void *, OPENSSL_LH_COMPFUNC cfn); +typedef unsigned long (*OPENSSL_LH_HASHFUNC)(const void *); +typedef unsigned long (*OPENSSL_LH_HASHFUNCTHUNK)(const void *, OPENSSL_LH_HASHFUNC hfn); +typedef void (*OPENSSL_LH_DOALL_FUNC)(void *); +typedef void (*OPENSSL_LH_DOALL_FUNC_THUNK)(void *, OPENSSL_LH_DOALL_FUNC doall); +typedef void (*OPENSSL_LH_DOALL_FUNCARG)(void *, void *); +typedef void (*OPENSSL_LH_DOALL_FUNCARG_THUNK)(void *, void *, OPENSSL_LH_DOALL_FUNCARG doall); +typedef struct lhash_st OPENSSL_LHASH; + +/* + * Macros for declaring and implementing type-safe wrappers for LHASH + * callbacks. This way, callbacks can be provided to LHASH structures without + * function pointer casting and the macro-defined callbacks provide + * per-variable casting before deferring to the underlying type-specific + * callbacks. NB: It is possible to place a "static" in front of both the + * DECLARE and IMPLEMENT macros if the functions are strictly internal. + */ + +/* First: "hash" functions */ +#define DECLARE_LHASH_HASH_FN(name, o_type) \ + unsigned long name##_LHASH_HASH(const void *); +#define IMPLEMENT_LHASH_HASH_FN(name, o_type) \ + unsigned long name##_LHASH_HASH(const void *arg) \ + { \ + const o_type *a = arg; \ + return name##_hash(a); \ + } +#define LHASH_HASH_FN(name) name##_LHASH_HASH + +/* Second: "compare" functions */ +#define DECLARE_LHASH_COMP_FN(name, o_type) \ + int name##_LHASH_COMP(const void *, const void *); +#define IMPLEMENT_LHASH_COMP_FN(name, o_type) \ + int name##_LHASH_COMP(const void *arg1, const void *arg2) \ + { \ + const o_type *a = arg1; \ + const o_type *b = arg2; \ + return name##_cmp(a, b); \ + } +#define LHASH_COMP_FN(name) name##_LHASH_COMP + +/* Fourth: "doall_arg" functions */ +#define DECLARE_LHASH_DOALL_ARG_FN(name, o_type, a_type) \ + void name##_LHASH_DOALL_ARG(void *, void *); +#define IMPLEMENT_LHASH_DOALL_ARG_FN(name, o_type, a_type) \ + void name##_LHASH_DOALL_ARG(void *arg1, void *arg2) \ + { \ + o_type *a = arg1; \ + a_type *b = arg2; \ + name##_doall_arg(a, b); \ + } +#define LHASH_DOALL_ARG_FN(name) name##_LHASH_DOALL_ARG + +#define LH_LOAD_MULT 256 + +int OPENSSL_LH_error(OPENSSL_LHASH *lh); +OPENSSL_LHASH *OPENSSL_LH_new(OPENSSL_LH_HASHFUNC h, OPENSSL_LH_COMPFUNC c); +OPENSSL_LHASH *OPENSSL_LH_set_thunks(OPENSSL_LHASH *lh, + OPENSSL_LH_HASHFUNCTHUNK hw, + OPENSSL_LH_COMPFUNCTHUNK cw, + OPENSSL_LH_DOALL_FUNC_THUNK daw, + OPENSSL_LH_DOALL_FUNCARG_THUNK daaw); +void OPENSSL_LH_free(OPENSSL_LHASH *lh); +void OPENSSL_LH_flush(OPENSSL_LHASH *lh); +void *OPENSSL_LH_insert(OPENSSL_LHASH *lh, void *data); +void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data); +void *OPENSSL_LH_retrieve(OPENSSL_LHASH *lh, const void *data); +void OPENSSL_LH_doall(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNC func); +void OPENSSL_LH_doall_arg(OPENSSL_LHASH *lh, + OPENSSL_LH_DOALL_FUNCARG func, void *arg); +void OPENSSL_LH_doall_arg_thunk(OPENSSL_LHASH *lh, + OPENSSL_LH_DOALL_FUNCARG_THUNK daaw, + OPENSSL_LH_DOALL_FUNCARG fn, void *arg); + +unsigned long OPENSSL_LH_strhash(const char *c); +unsigned long OPENSSL_LH_num_items(const OPENSSL_LHASH *lh); +unsigned long OPENSSL_LH_get_down_load(const OPENSSL_LHASH *lh); +void OPENSSL_LH_set_down_load(OPENSSL_LHASH *lh, unsigned long down_load); + +#ifndef OPENSSL_NO_STDIO +#ifndef OPENSSL_NO_DEPRECATED_3_1 +OSSL_DEPRECATEDIN_3_1 void OPENSSL_LH_stats(const OPENSSL_LHASH *lh, FILE *fp); +OSSL_DEPRECATEDIN_3_1 void OPENSSL_LH_node_stats(const OPENSSL_LHASH *lh, FILE *fp); +OSSL_DEPRECATEDIN_3_1 void OPENSSL_LH_node_usage_stats(const OPENSSL_LHASH *lh, FILE *fp); +#endif +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_1 +OSSL_DEPRECATEDIN_3_1 void OPENSSL_LH_stats_bio(const OPENSSL_LHASH *lh, BIO *out); +OSSL_DEPRECATEDIN_3_1 void OPENSSL_LH_node_stats_bio(const OPENSSL_LHASH *lh, BIO *out); +OSSL_DEPRECATEDIN_3_1 void OPENSSL_LH_node_usage_stats_bio(const OPENSSL_LHASH *lh, BIO *out); +#endif + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define _LHASH OPENSSL_LHASH +#define LHASH_NODE OPENSSL_LH_NODE +#define lh_error OPENSSL_LH_error +#define lh_new OPENSSL_LH_new +#define lh_free OPENSSL_LH_free +#define lh_insert OPENSSL_LH_insert +#define lh_delete OPENSSL_LH_delete +#define lh_retrieve OPENSSL_LH_retrieve +#define lh_doall OPENSSL_LH_doall +#define lh_doall_arg OPENSSL_LH_doall_arg +#define lh_strhash OPENSSL_LH_strhash +#define lh_num_items OPENSSL_LH_num_items +#ifndef OPENSSL_NO_STDIO +#define lh_stats OPENSSL_LH_stats +#define lh_node_stats OPENSSL_LH_node_stats +#define lh_node_usage_stats OPENSSL_LH_node_usage_stats +#endif +#define lh_stats_bio OPENSSL_LH_stats_bio +#define lh_node_stats_bio OPENSSL_LH_node_stats_bio +#define lh_node_usage_stats_bio OPENSSL_LH_node_usage_stats_bio +#endif + +/* Type checking... */ + +#define LHASH_OF(type) struct lhash_st_##type + +/* Helper macro for internal use */ +#define DEFINE_LHASH_OF_INTERNAL(type) \ + LHASH_OF(type) \ + { \ + union lh_##type##_dummy { \ + void *d1; \ + unsigned long d2; \ + int d3; \ + } dummy; \ + }; \ + typedef int (*lh_##type##_compfunc)(const type *a, const type *b); \ + typedef unsigned long (*lh_##type##_hashfunc)(const type *a); \ + typedef void (*lh_##type##_doallfunc)(type * a); \ + static ossl_inline unsigned long lh_##type##_hash_thunk(const void *data, OPENSSL_LH_HASHFUNC hfn) \ + { \ + unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \ + return hfn_conv((const type *)data); \ + } \ + static ossl_inline int lh_##type##_comp_thunk(const void *da, const void *db, OPENSSL_LH_COMPFUNC cfn) \ + { \ + int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \ + return cfn_conv((const type *)da, (const type *)db); \ + } \ + static ossl_inline void lh_##type##_doall_thunk(void *node, OPENSSL_LH_DOALL_FUNC doall) \ + { \ + void (*doall_conv)(type *) = (void (*)(type *))doall; \ + doall_conv((type *)node); \ + } \ + static ossl_inline void lh_##type##_doall_arg_thunk(void *node, void *arg, OPENSSL_LH_DOALL_FUNCARG doall) \ + { \ + void (*doall_conv)(type *, void *) = (void (*)(type *, void *))doall; \ + doall_conv((type *)node, arg); \ + } \ + static ossl_unused ossl_inline type * \ + ossl_check_##type##_lh_plain_type(type *ptr) \ + { \ + return ptr; \ + } \ + static ossl_unused ossl_inline const type * \ + ossl_check_const_##type##_lh_plain_type(const type *ptr) \ + { \ + return ptr; \ + } \ + static ossl_unused ossl_inline const OPENSSL_LHASH * \ + ossl_check_const_##type##_lh_type(const LHASH_OF(type) *lh) \ + { \ + return (const OPENSSL_LHASH *)lh; \ + } \ + static ossl_unused ossl_inline OPENSSL_LHASH * \ + ossl_check_##type##_lh_type(LHASH_OF(type) *lh) \ + { \ + return (OPENSSL_LHASH *)lh; \ + } \ + static ossl_unused ossl_inline OPENSSL_LH_COMPFUNC \ + ossl_check_##type##_lh_compfunc_type(lh_##type##_compfunc cmp) \ + { \ + return (OPENSSL_LH_COMPFUNC)cmp; \ + } \ + static ossl_unused ossl_inline OPENSSL_LH_HASHFUNC \ + ossl_check_##type##_lh_hashfunc_type(lh_##type##_hashfunc hfn) \ + { \ + return (OPENSSL_LH_HASHFUNC)hfn; \ + } \ + static ossl_unused ossl_inline OPENSSL_LH_DOALL_FUNC \ + ossl_check_##type##_lh_doallfunc_type(lh_##type##_doallfunc dfn) \ + { \ + return (OPENSSL_LH_DOALL_FUNC)dfn; \ + } \ + LHASH_OF(type) + +#ifndef OPENSSL_NO_DEPRECATED_3_1 +#define DEFINE_LHASH_OF_DEPRECATED(type) \ + static ossl_unused ossl_inline void \ + lh_##type##_node_stats_bio(const LHASH_OF(type) *lh, BIO *out) \ + { \ + OPENSSL_LH_node_stats_bio((const OPENSSL_LHASH *)lh, out); \ + } \ + static ossl_unused ossl_inline void \ + lh_##type##_node_usage_stats_bio(const LHASH_OF(type) *lh, BIO *out) \ + { \ + OPENSSL_LH_node_usage_stats_bio((const OPENSSL_LHASH *)lh, out); \ + } \ + static ossl_unused ossl_inline void \ + lh_##type##_stats_bio(const LHASH_OF(type) *lh, BIO *out) \ + { \ + OPENSSL_LH_stats_bio((const OPENSSL_LHASH *)lh, out); \ + } +#else +#define DEFINE_LHASH_OF_DEPRECATED(type) +#endif + +#define DEFINE_LHASH_OF_EX(type) \ + LHASH_OF(type) \ + { \ + union lh_##type##_dummy { \ + void *d1; \ + unsigned long d2; \ + int d3; \ + } dummy; \ + }; \ + static unsigned long \ + lh_##type##_hfn_thunk(const void *data, OPENSSL_LH_HASHFUNC hfn) \ + { \ + unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \ + return hfn_conv((const type *)data); \ + } \ + static int lh_##type##_cfn_thunk(const void *da, const void *db, OPENSSL_LH_COMPFUNC cfn) \ + { \ + int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \ + return cfn_conv((const type *)da, (const type *)db); \ + } \ + static ossl_unused ossl_inline void \ + lh_##type##_free(LHASH_OF(type) *lh) \ + { \ + OPENSSL_LH_free((OPENSSL_LHASH *)lh); \ + } \ + static ossl_unused ossl_inline void \ + lh_##type##_flush(LHASH_OF(type) *lh) \ + { \ + OPENSSL_LH_flush((OPENSSL_LHASH *)lh); \ + } \ + static ossl_unused ossl_inline type * \ + lh_##type##_insert(LHASH_OF(type) *lh, type *d) \ + { \ + return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \ + } \ + static ossl_unused ossl_inline type * \ + lh_##type##_delete(LHASH_OF(type) *lh, const type *d) \ + { \ + return (type *)OPENSSL_LH_delete((OPENSSL_LHASH *)lh, d); \ + } \ + static ossl_unused ossl_inline type * \ + lh_##type##_retrieve(LHASH_OF(type) *lh, const type *d) \ + { \ + return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \ + } \ + static ossl_unused ossl_inline int \ + lh_##type##_error(LHASH_OF(type) *lh) \ + { \ + return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \ + } \ + static ossl_unused ossl_inline unsigned long \ + lh_##type##_num_items(LHASH_OF(type) *lh) \ + { \ + return OPENSSL_LH_num_items((OPENSSL_LHASH *)lh); \ + } \ + static ossl_unused ossl_inline unsigned long \ + lh_##type##_get_down_load(LHASH_OF(type) *lh) \ + { \ + return OPENSSL_LH_get_down_load((OPENSSL_LHASH *)lh); \ + } \ + static ossl_unused ossl_inline void \ + lh_##type##_set_down_load(LHASH_OF(type) *lh, unsigned long dl) \ + { \ + OPENSSL_LH_set_down_load((OPENSSL_LHASH *)lh, dl); \ + } \ + static ossl_unused ossl_inline void \ + lh_##type##_doall_thunk(void *node, OPENSSL_LH_DOALL_FUNC doall) \ + { \ + void (*doall_conv)(type *) = (void (*)(type *))doall; \ + doall_conv((type *)node); \ + } \ + static ossl_unused ossl_inline void \ + lh_##type##_doall_arg_thunk(void *node, void *arg, OPENSSL_LH_DOALL_FUNCARG doall) \ + { \ + void (*doall_conv)(type *, void *) = (void (*)(type *, void *))doall; \ + doall_conv((type *)node, arg); \ + } \ + static ossl_unused ossl_inline void \ + lh_##type##_doall(LHASH_OF(type) *lh, void (*doall)(type *)) \ + { \ + OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \ + } \ + static ossl_unused ossl_inline LHASH_OF(type) * \ + lh_##type##_new(unsigned long (*hfn)(const type *), \ + int (*cfn)(const type *, const type *)) \ + { \ + return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \ + lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \ + lh_##type##_doall_thunk, \ + lh_##type##_doall_arg_thunk); \ + } \ + static ossl_unused ossl_inline void \ + lh_##type##_doall_arg(LHASH_OF(type) *lh, \ + void (*doallarg)(type *, void *), void *arg) \ + { \ + OPENSSL_LH_doall_arg((OPENSSL_LHASH *)lh, \ + (OPENSSL_LH_DOALL_FUNCARG)doallarg, arg); \ + } \ + LHASH_OF(type) + +#define DEFINE_LHASH_OF(type) \ + DEFINE_LHASH_OF_EX(type); \ + DEFINE_LHASH_OF_DEPRECATED(type) \ + LHASH_OF(type) + +#define IMPLEMENT_LHASH_DOALL_ARG_CONST(type, argtype) \ + int_implement_lhash_doall(type, argtype, const type) + +#define IMPLEMENT_LHASH_DOALL_ARG(type, argtype) \ + int_implement_lhash_doall(type, argtype, type) + +#define int_implement_lhash_doall(type, argtype, cbargtype) \ + static ossl_unused ossl_inline void \ + lh_##type##_doall_##argtype##_thunk(void *node, void *arg, OPENSSL_LH_DOALL_FUNCARG fn) \ + { \ + void (*fn_conv)(cbargtype *, argtype *) = (void (*)(cbargtype *, argtype *))fn; \ + fn_conv((cbargtype *)node, (argtype *)arg); \ + } \ + static ossl_unused ossl_inline void \ + lh_##type##_doall_##argtype(LHASH_OF(type) *lh, \ + void (*fn)(cbargtype *, argtype *), \ + argtype *arg) \ + { \ + OPENSSL_LH_doall_arg_thunk((OPENSSL_LHASH *)lh, \ + lh_##type##_doall_##argtype##_thunk, \ + (OPENSSL_LH_DOALL_FUNCARG)fn, \ + (void *)arg); \ + } \ + LHASH_OF(type) + +/* clang-format off */ +DEFINE_LHASH_OF_INTERNAL(OPENSSL_STRING); +#define lh_OPENSSL_STRING_new(hfn, cmp) ((LHASH_OF(OPENSSL_STRING) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new(ossl_check_OPENSSL_STRING_lh_hashfunc_type(hfn), ossl_check_OPENSSL_STRING_lh_compfunc_type(cmp)), lh_OPENSSL_STRING_hash_thunk, lh_OPENSSL_STRING_comp_thunk, lh_OPENSSL_STRING_doall_thunk, lh_OPENSSL_STRING_doall_arg_thunk)) +#define lh_OPENSSL_STRING_free(lh) OPENSSL_LH_free(ossl_check_OPENSSL_STRING_lh_type(lh)) +#define lh_OPENSSL_STRING_flush(lh) OPENSSL_LH_flush(ossl_check_OPENSSL_STRING_lh_type(lh)) +#define lh_OPENSSL_STRING_insert(lh, ptr) ((OPENSSL_STRING *)OPENSSL_LH_insert(ossl_check_OPENSSL_STRING_lh_type(lh), ossl_check_OPENSSL_STRING_lh_plain_type(ptr))) +#define lh_OPENSSL_STRING_delete(lh, ptr) ((OPENSSL_STRING *)OPENSSL_LH_delete(ossl_check_OPENSSL_STRING_lh_type(lh), ossl_check_const_OPENSSL_STRING_lh_plain_type(ptr))) +#define lh_OPENSSL_STRING_retrieve(lh, ptr) ((OPENSSL_STRING *)OPENSSL_LH_retrieve(ossl_check_OPENSSL_STRING_lh_type(lh), ossl_check_const_OPENSSL_STRING_lh_plain_type(ptr))) +#define lh_OPENSSL_STRING_error(lh) OPENSSL_LH_error(ossl_check_OPENSSL_STRING_lh_type(lh)) +#define lh_OPENSSL_STRING_num_items(lh) OPENSSL_LH_num_items(ossl_check_OPENSSL_STRING_lh_type(lh)) +#define lh_OPENSSL_STRING_node_stats_bio(lh, out) OPENSSL_LH_node_stats_bio(ossl_check_const_OPENSSL_STRING_lh_type(lh), out) +#define lh_OPENSSL_STRING_node_usage_stats_bio(lh, out) OPENSSL_LH_node_usage_stats_bio(ossl_check_const_OPENSSL_STRING_lh_type(lh), out) +#define lh_OPENSSL_STRING_stats_bio(lh, out) OPENSSL_LH_stats_bio(ossl_check_const_OPENSSL_STRING_lh_type(lh), out) +#define lh_OPENSSL_STRING_get_down_load(lh) OPENSSL_LH_get_down_load(ossl_check_OPENSSL_STRING_lh_type(lh)) +#define lh_OPENSSL_STRING_set_down_load(lh, dl) OPENSSL_LH_set_down_load(ossl_check_OPENSSL_STRING_lh_type(lh), dl) +#define lh_OPENSSL_STRING_doall(lh, dfn) OPENSSL_LH_doall(ossl_check_OPENSSL_STRING_lh_type(lh), ossl_check_OPENSSL_STRING_lh_doallfunc_type(dfn)) +DEFINE_LHASH_OF_INTERNAL(OPENSSL_CSTRING); +#define lh_OPENSSL_CSTRING_new(hfn, cmp) ((LHASH_OF(OPENSSL_CSTRING) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new(ossl_check_OPENSSL_CSTRING_lh_hashfunc_type(hfn), ossl_check_OPENSSL_CSTRING_lh_compfunc_type(cmp)), lh_OPENSSL_CSTRING_hash_thunk, lh_OPENSSL_CSTRING_comp_thunk, lh_OPENSSL_CSTRING_doall_thunk, lh_OPENSSL_CSTRING_doall_arg_thunk)) +#define lh_OPENSSL_CSTRING_free(lh) OPENSSL_LH_free(ossl_check_OPENSSL_CSTRING_lh_type(lh)) +#define lh_OPENSSL_CSTRING_flush(lh) OPENSSL_LH_flush(ossl_check_OPENSSL_CSTRING_lh_type(lh)) +#define lh_OPENSSL_CSTRING_insert(lh, ptr) ((OPENSSL_CSTRING *)OPENSSL_LH_insert(ossl_check_OPENSSL_CSTRING_lh_type(lh), ossl_check_OPENSSL_CSTRING_lh_plain_type(ptr))) +#define lh_OPENSSL_CSTRING_delete(lh, ptr) ((OPENSSL_CSTRING *)OPENSSL_LH_delete(ossl_check_OPENSSL_CSTRING_lh_type(lh), ossl_check_const_OPENSSL_CSTRING_lh_plain_type(ptr))) +#define lh_OPENSSL_CSTRING_retrieve(lh, ptr) ((OPENSSL_CSTRING *)OPENSSL_LH_retrieve(ossl_check_OPENSSL_CSTRING_lh_type(lh), ossl_check_const_OPENSSL_CSTRING_lh_plain_type(ptr))) +#define lh_OPENSSL_CSTRING_error(lh) OPENSSL_LH_error(ossl_check_OPENSSL_CSTRING_lh_type(lh)) +#define lh_OPENSSL_CSTRING_num_items(lh) OPENSSL_LH_num_items(ossl_check_OPENSSL_CSTRING_lh_type(lh)) +#define lh_OPENSSL_CSTRING_node_stats_bio(lh, out) OPENSSL_LH_node_stats_bio(ossl_check_const_OPENSSL_CSTRING_lh_type(lh), out) +#define lh_OPENSSL_CSTRING_node_usage_stats_bio(lh, out) OPENSSL_LH_node_usage_stats_bio(ossl_check_const_OPENSSL_CSTRING_lh_type(lh), out) +#define lh_OPENSSL_CSTRING_stats_bio(lh, out) OPENSSL_LH_stats_bio(ossl_check_const_OPENSSL_CSTRING_lh_type(lh), out) +#define lh_OPENSSL_CSTRING_get_down_load(lh) OPENSSL_LH_get_down_load(ossl_check_OPENSSL_CSTRING_lh_type(lh)) +#define lh_OPENSSL_CSTRING_set_down_load(lh, dl) OPENSSL_LH_set_down_load(ossl_check_OPENSSL_CSTRING_lh_type(lh), dl) +#define lh_OPENSSL_CSTRING_doall(lh, dfn) OPENSSL_LH_doall(ossl_check_OPENSSL_CSTRING_lh_type(lh), ossl_check_OPENSSL_CSTRING_lh_doallfunc_type(dfn)) + +/* clang-format on */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/macros.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/macros.h new file mode 100644 index 0000000000000000000000000000000000000000..598d3fcd4bdff32d7fdcfc9825e577f521423505 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/macros.h @@ -0,0 +1,361 @@ +/* + * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_MACROS_H +#define OPENSSL_MACROS_H +#pragma once + +#include +#include + +/* Helper macros for CPP string composition */ +#define OPENSSL_MSTR_HELPER(x) #x +#define OPENSSL_MSTR(x) OPENSSL_MSTR_HELPER(x) + +/* + * Sometimes OPENSSL_NO_xxx ends up with an empty file and some compilers + * don't like that. This will hopefully silence them. + */ +#define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy; + +/* + * Generic deprecation macro + * + * If OPENSSL_SUPPRESS_DEPRECATED is defined, then OSSL_DEPRECATED and + * OSSL_DEPRECATED_FOR become no-ops + */ +#ifndef OSSL_DEPRECATED +#undef OSSL_DEPRECATED_FOR +#ifndef OPENSSL_SUPPRESS_DEPRECATED +#if defined(_MSC_VER) +/* + * MSVC supports __declspec(deprecated) since MSVC 2003 (13.10), + * and __declspec(deprecated(message)) since MSVC 2005 (14.00) + */ +#if _MSC_VER >= 1400 +#define OSSL_DEPRECATED(since) \ + __declspec(deprecated("Since OpenSSL " #since)) +#define OSSL_DEPRECATED_FOR(since, message) \ + __declspec(deprecated("Since OpenSSL " #since ";" message)) +#elif _MSC_VER >= 1310 +#define OSSL_DEPRECATED(since) __declspec(deprecated) +#define OSSL_DEPRECATED_FOR(since, message) __declspec(deprecated) +#endif +#elif defined(__GNUC__) +/* + * According to GCC documentation, deprecations with message appeared in + * GCC 4.5.0 + */ +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +#define OSSL_DEPRECATED(since) \ + __attribute__((deprecated("Since OpenSSL " #since))) +#define OSSL_DEPRECATED_FOR(since, message) \ + __attribute__((deprecated("Since OpenSSL " #since ";" message))) +#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +#define OSSL_DEPRECATED(since) __attribute__((deprecated)) +#define OSSL_DEPRECATED_FOR(since, message) __attribute__((deprecated)) +#endif +#elif defined(__SUNPRO_C) +#if (__SUNPRO_C >= 0x5130) +#define OSSL_DEPRECATED(since) __attribute__((deprecated)) +#define OSSL_DEPRECATED_FOR(since, message) __attribute__((deprecated)) +#endif +#endif +#endif +#endif + +/* + * Still not defined? Then define no-op macros. This means these macros + * are unsuitable for use in a typedef. + */ +#ifndef OSSL_DEPRECATED +#define OSSL_DEPRECATED(since) extern +#define OSSL_DEPRECATED_FOR(since, message) extern +#endif + +/* + * Applications should use -DOPENSSL_API_COMPAT= to suppress the + * declarations of functions deprecated in or before . If this is + * undefined, the value of the macro OPENSSL_CONFIGURED_API (defined in + * ) is the default. + * + * For any version number up until version 1.1.x, is expected to be + * the calculated version number 0xMNNFFPPSL. + * For version numbers 3.0 and on, is expected to be a computation + * of the major and minor numbers in decimal using this formula: + * + * MAJOR * 10000 + MINOR * 100 + * + * So version 3.0 becomes 30000, version 3.2 becomes 30200, etc. + */ + +/* + * We use the OPENSSL_API_COMPAT value to define API level macros. These + * macros are used to enable or disable features at that API version boundary. + */ + +#ifdef OPENSSL_API_LEVEL +#error "OPENSSL_API_LEVEL must not be defined by application" +#endif + +/* + * We figure out what API level was intended by simple numeric comparison. + * The lowest old style number we recognise is 0x00908000L, so we take some + * safety margin and assume that anything below 0x00900000L is a new style + * number. This allows new versions up to and including v943.71.83. + */ +#ifdef OPENSSL_API_COMPAT +#if OPENSSL_API_COMPAT < 0x900000L +#define OPENSSL_API_LEVEL (OPENSSL_API_COMPAT) +#else +#define OPENSSL_API_LEVEL \ + (((OPENSSL_API_COMPAT >> 28) & 0xF) * 10000 \ + + ((OPENSSL_API_COMPAT >> 20) & 0xFF) * 100 \ + + ((OPENSSL_API_COMPAT >> 12) & 0xFF)) +#endif +#endif + +/* + * If OPENSSL_API_COMPAT wasn't given, we use default numbers to set + * the API compatibility level. + */ +#ifndef OPENSSL_API_LEVEL +#if OPENSSL_CONFIGURED_API > 0 +#define OPENSSL_API_LEVEL (OPENSSL_CONFIGURED_API) +#else +#define OPENSSL_API_LEVEL \ + (OPENSSL_VERSION_MAJOR * 10000 + OPENSSL_VERSION_MINOR * 100) +#endif +#endif + +#if OPENSSL_API_LEVEL > OPENSSL_CONFIGURED_API +#error "The requested API level higher than the configured API compatibility level" +#endif + +/* + * Check of sane values. + */ +/* Can't go higher than the current version. */ +#if OPENSSL_API_LEVEL > (OPENSSL_VERSION_MAJOR * 10000 + OPENSSL_VERSION_MINOR * 100) +#error "OPENSSL_API_COMPAT expresses an impossible API compatibility level" +#endif +/* OpenSSL will have no version 2.y.z */ +#if OPENSSL_API_LEVEL < 30000 && OPENSSL_API_LEVEL >= 20000 +#error "OPENSSL_API_COMPAT expresses an impossible API compatibility level" +#endif +/* Below 0.9.8 is unacceptably low */ +#if OPENSSL_API_LEVEL < 908 +#error "OPENSSL_API_COMPAT expresses an impossible API compatibility level" +#endif + +/* + * Define macros for deprecation and simulated removal purposes. + * + * The macros OSSL_DEPRECATEDIN_{major}_{minor} are always defined for + * all OpenSSL versions we care for. They can be used as attributes + * in function declarations where appropriate. + * + * The macros OPENSSL_NO_DEPRECATED_{major}_{minor} are defined for + * all OpenSSL versions up to or equal to the version given with + * OPENSSL_API_COMPAT. They are used as guards around anything that's + * deprecated up to that version, as an effect of the developer option + * 'no-deprecated'. + */ + +#undef OPENSSL_NO_DEPRECATED_3_6 +#undef OPENSSL_NO_DEPRECATED_3_5 +#undef OPENSSL_NO_DEPRECATED_3_4 +#undef OPENSSL_NO_DEPRECATED_3_1 +#undef OPENSSL_NO_DEPRECATED_3_0 +#undef OPENSSL_NO_DEPRECATED_1_1_1 +#undef OPENSSL_NO_DEPRECATED_1_1_0 +#undef OPENSSL_NO_DEPRECATED_1_0_2 +#undef OPENSSL_NO_DEPRECATED_1_0_1 +#undef OPENSSL_NO_DEPRECATED_1_0_0 +#undef OPENSSL_NO_DEPRECATED_0_9_8 + +#if OPENSSL_API_LEVEL >= 30600 +#ifndef OPENSSL_NO_DEPRECATED +#define OSSL_DEPRECATEDIN_3_6 OSSL_DEPRECATED(3.6) +#define OSSL_DEPRECATEDIN_3_6_FOR(msg) OSSL_DEPRECATED_FOR(3.6, msg) +#else +#define OPENSSL_NO_DEPRECATED_3_6 +#endif +#else +#define OSSL_DEPRECATEDIN_3_6 +#define OSSL_DEPRECATEDIN_3_6_FOR(msg) +#endif +#if OPENSSL_API_LEVEL >= 30500 +#ifndef OPENSSL_NO_DEPRECATED +#define OSSL_DEPRECATEDIN_3_5 OSSL_DEPRECATED(3.5) +#define OSSL_DEPRECATEDIN_3_5_FOR(msg) OSSL_DEPRECATED_FOR(3.5, msg) +#else +#define OPENSSL_NO_DEPRECATED_3_5 +#endif +#else +#define OSSL_DEPRECATEDIN_3_5 +#define OSSL_DEPRECATEDIN_3_5_FOR(msg) +#endif +#if OPENSSL_API_LEVEL >= 30400 +#ifndef OPENSSL_NO_DEPRECATED +#define OSSL_DEPRECATEDIN_3_4 OSSL_DEPRECATED(3.4) +#define OSSL_DEPRECATEDIN_3_4_FOR(msg) OSSL_DEPRECATED_FOR(3.4, msg) +#else +#define OPENSSL_NO_DEPRECATED_3_4 +#endif +#else +#define OSSL_DEPRECATEDIN_3_4 +#define OSSL_DEPRECATEDIN_3_4_FOR(msg) +#endif +#if OPENSSL_API_LEVEL >= 30100 +#ifndef OPENSSL_NO_DEPRECATED +#define OSSL_DEPRECATEDIN_3_1 OSSL_DEPRECATED(3.1) +#define OSSL_DEPRECATEDIN_3_1_FOR(msg) OSSL_DEPRECATED_FOR(3.1, msg) +#else +#define OPENSSL_NO_DEPRECATED_3_1 +#endif +#else +#define OSSL_DEPRECATEDIN_3_1 +#define OSSL_DEPRECATEDIN_3_1_FOR(msg) +#endif +#if OPENSSL_API_LEVEL >= 30000 +#ifndef OPENSSL_NO_DEPRECATED +#define OSSL_DEPRECATEDIN_3_0 OSSL_DEPRECATED(3.0) +#define OSSL_DEPRECATEDIN_3_0_FOR(msg) OSSL_DEPRECATED_FOR(3.0, msg) +#else +#define OPENSSL_NO_DEPRECATED_3_0 +#endif +#else +#define OSSL_DEPRECATEDIN_3_0 +#define OSSL_DEPRECATEDIN_3_0_FOR(msg) +#endif +#if OPENSSL_API_LEVEL >= 10101 +#ifndef OPENSSL_NO_DEPRECATED +#define OSSL_DEPRECATEDIN_1_1_1 OSSL_DEPRECATED(1.1.1) +#define OSSL_DEPRECATEDIN_1_1_1_FOR(msg) OSSL_DEPRECATED_FOR(1.1.1, msg) +#else +#define OPENSSL_NO_DEPRECATED_1_1_1 +#endif +#else +#define OSSL_DEPRECATEDIN_1_1_1 +#define OSSL_DEPRECATEDIN_1_1_1_FOR(msg) +#endif +#if OPENSSL_API_LEVEL >= 10100 +#ifndef OPENSSL_NO_DEPRECATED +#define OSSL_DEPRECATEDIN_1_1_0 OSSL_DEPRECATED(1.1.0) +#define OSSL_DEPRECATEDIN_1_1_0_FOR(msg) OSSL_DEPRECATED_FOR(1.1.0, msg) +#else +#define OPENSSL_NO_DEPRECATED_1_1_0 +#endif +#else +#define OSSL_DEPRECATEDIN_1_1_0 +#define OSSL_DEPRECATEDIN_1_1_0_FOR(msg) +#endif +#if OPENSSL_API_LEVEL >= 10002 +#ifndef OPENSSL_NO_DEPRECATED +#define OSSL_DEPRECATEDIN_1_0_2 OSSL_DEPRECATED(1.0.2) +#define OSSL_DEPRECATEDIN_1_0_2_FOR(msg) OSSL_DEPRECATED_FOR(1.0.2, msg) +#else +#define OPENSSL_NO_DEPRECATED_1_0_2 +#endif +#else +#define OSSL_DEPRECATEDIN_1_0_2 +#define OSSL_DEPRECATEDIN_1_0_2_FOR(msg) +#endif +#if OPENSSL_API_LEVEL >= 10001 +#ifndef OPENSSL_NO_DEPRECATED +#define OSSL_DEPRECATEDIN_1_0_1 OSSL_DEPRECATED(1.0.1) +#define OSSL_DEPRECATEDIN_1_0_1_FOR(msg) OSSL_DEPRECATED_FOR(1.0.1, msg) +#else +#define OPENSSL_NO_DEPRECATED_1_0_1 +#endif +#else +#define OSSL_DEPRECATEDIN_1_0_1 +#define OSSL_DEPRECATEDIN_1_0_1_FOR(msg) +#endif +#if OPENSSL_API_LEVEL >= 10000 +#ifndef OPENSSL_NO_DEPRECATED +#define OSSL_DEPRECATEDIN_1_0_0 OSSL_DEPRECATED(1.0.0) +#define OSSL_DEPRECATEDIN_1_0_0_FOR(msg) OSSL_DEPRECATED_FOR(1.0.0, msg) +#else +#define OPENSSL_NO_DEPRECATED_1_0_0 +#endif +#else +#define OSSL_DEPRECATEDIN_1_0_0 +#define OSSL_DEPRECATEDIN_1_0_0_FOR(msg) +#endif +#if OPENSSL_API_LEVEL >= 908 +#ifndef OPENSSL_NO_DEPRECATED +#define OSSL_DEPRECATEDIN_0_9_8 OSSL_DEPRECATED(0.9.8) +#define OSSL_DEPRECATEDIN_0_9_8_FOR(msg) OSSL_DEPRECATED_FOR(0.9.8, msg) +#else +#define OPENSSL_NO_DEPRECATED_0_9_8 +#endif +#else +#define OSSL_DEPRECATEDIN_0_9_8 +#define OSSL_DEPRECATEDIN_0_9_8_FOR(msg) +#endif + +/* + * Make our own variants of __FILE__ and __LINE__, depending on configuration + */ + +#ifndef OPENSSL_FILE +#ifdef OPENSSL_NO_FILENAMES +#define OPENSSL_FILE "" +#define OPENSSL_LINE 0 +#else +#define OPENSSL_FILE __FILE__ +#define OPENSSL_LINE __LINE__ +#endif +#endif + +/* + * __func__ was standardized in C99, so for any compiler that claims + * to implement that language level or newer, we assume we can safely + * use that symbol. + * + * GNU C also provides __FUNCTION__ since version 2, which predates + * C99. We can, however, only use this if __STDC_VERSION__ exists, + * as it's otherwise not allowed according to ISO C standards (C90). + * (compiling with GNU C's -pedantic tells us so) + * + * If none of the above applies, we check if the compiler is MSVC, + * and use __FUNCTION__ if that's the case. + */ +#ifndef OPENSSL_FUNC +#if defined(__STDC_VERSION__) +#if __STDC_VERSION__ >= 199901L +#define OPENSSL_FUNC __func__ +#elif defined(__GNUC__) && __GNUC__ >= 2 +#define OPENSSL_FUNC __FUNCTION__ +#endif +#elif defined(_MSC_VER) +#define OPENSSL_FUNC __FUNCTION__ +#endif +/* + * If all these possibilities are exhausted, we give up and use a + * static string. + */ +#ifndef OPENSSL_FUNC +#define OPENSSL_FUNC "(unknown function)" +#endif +#endif + +#ifndef OSSL_CRYPTO_ALLOC +#if defined(__GNUC__) +#define OSSL_CRYPTO_ALLOC __attribute__((__malloc__)) +#elif defined(_MSC_VER) +#define OSSL_CRYPTO_ALLOC __declspec(restrict) +#else +#define OSSL_CRYPTO_ALLOC +#endif +#endif + +#endif /* OPENSSL_MACROS_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/md2.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/md2.h new file mode 100644 index 0000000000000000000000000000000000000000..10d9a0f216266b2ee8c02ffcb0511fa2cb6b064f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/md2.h @@ -0,0 +1,56 @@ +/* + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_MD2_H +#define OPENSSL_MD2_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_MD2_H +#endif + +#include + +#ifndef OPENSSL_NO_MD2 +#include +#ifdef __cplusplus +extern "C" { +#endif + +#define MD2_DIGEST_LENGTH 16 + +#if !defined(OPENSSL_NO_DEPRECATED_3_0) + +typedef unsigned char MD2_INT; + +#define MD2_BLOCK 16 + +typedef struct MD2state_st { + unsigned int num; + unsigned char data[MD2_BLOCK]; + MD2_INT cksm[MD2_BLOCK]; + MD2_INT state[MD2_BLOCK]; +} MD2_CTX; +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 const char *MD2_options(void); +OSSL_DEPRECATEDIN_3_0 int MD2_Init(MD2_CTX *c); +OSSL_DEPRECATEDIN_3_0 int MD2_Update(MD2_CTX *c, const unsigned char *data, + size_t len); +OSSL_DEPRECATEDIN_3_0 int MD2_Final(unsigned char *md, MD2_CTX *c); +OSSL_DEPRECATEDIN_3_0 unsigned char *MD2(const unsigned char *d, size_t n, + unsigned char *md); +#endif + +#ifdef __cplusplus +} +#endif +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/md4.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/md4.h new file mode 100644 index 0000000000000000000000000000000000000000..d60fe4a667dab639325468b73e2a5accc0b22b6e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/md4.h @@ -0,0 +1,63 @@ +/* + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_MD4_H +#define OPENSSL_MD4_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_MD4_H +#endif + +#include + +#ifndef OPENSSL_NO_MD4 +#include +#include +#ifdef __cplusplus +extern "C" { +#endif + +#define MD4_DIGEST_LENGTH 16 + +#if !defined(OPENSSL_NO_DEPRECATED_3_0) + +/*- + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * ! MD4_LONG has to be at least 32 bits wide. ! + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + */ +#define MD4_LONG unsigned int + +#define MD4_CBLOCK 64 +#define MD4_LBLOCK (MD4_CBLOCK / 4) + +typedef struct MD4state_st { + MD4_LONG A, B, C, D; + MD4_LONG Nl, Nh; + MD4_LONG data[MD4_LBLOCK]; + unsigned int num; +} MD4_CTX; +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int MD4_Init(MD4_CTX *c); +OSSL_DEPRECATEDIN_3_0 int MD4_Update(MD4_CTX *c, const void *data, size_t len); +OSSL_DEPRECATEDIN_3_0 int MD4_Final(unsigned char *md, MD4_CTX *c); +OSSL_DEPRECATEDIN_3_0 unsigned char *MD4(const unsigned char *d, size_t n, + unsigned char *md); +OSSL_DEPRECATEDIN_3_0 void MD4_Transform(MD4_CTX *c, const unsigned char *b); +#endif + +#ifdef __cplusplus +} +#endif +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/md5.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/md5.h new file mode 100644 index 0000000000000000000000000000000000000000..0ec3d1ce956dacc1c2e93534d0eef329db60e446 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/md5.h @@ -0,0 +1,62 @@ +/* + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_MD5_H +#define OPENSSL_MD5_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_MD5_H +#endif + +#include + +#ifndef OPENSSL_NO_MD5 +#include +#include +#ifdef __cplusplus +extern "C" { +#endif + +#define MD5_DIGEST_LENGTH 16 + +#if !defined(OPENSSL_NO_DEPRECATED_3_0) +/* + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * ! MD5_LONG has to be at least 32 bits wide. ! + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + */ +#define MD5_LONG unsigned int + +#define MD5_CBLOCK 64 +#define MD5_LBLOCK (MD5_CBLOCK / 4) + +typedef struct MD5state_st { + MD5_LONG A, B, C, D; + MD5_LONG Nl, Nh; + MD5_LONG data[MD5_LBLOCK]; + unsigned int num; +} MD5_CTX; +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int MD5_Init(MD5_CTX *c); +OSSL_DEPRECATEDIN_3_0 int MD5_Update(MD5_CTX *c, const void *data, size_t len); +OSSL_DEPRECATEDIN_3_0 int MD5_Final(unsigned char *md, MD5_CTX *c); +OSSL_DEPRECATEDIN_3_0 unsigned char *MD5(const unsigned char *d, size_t n, + unsigned char *md); +OSSL_DEPRECATEDIN_3_0 void MD5_Transform(MD5_CTX *c, const unsigned char *b); +#endif + +#ifdef __cplusplus +} +#endif +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/mdc2.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/mdc2.h new file mode 100644 index 0000000000000000000000000000000000000000..46c96525deee03b6443342da9ff4a2b39a965007 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/mdc2.h @@ -0,0 +1,55 @@ +/* + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_MDC2_H +#define OPENSSL_MDC2_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_MDC2_H +#endif + +#include + +#ifndef OPENSSL_NO_MDC2 +#include +#include +#ifdef __cplusplus +extern "C" { +#endif + +#define MDC2_DIGEST_LENGTH 16 + +#if !defined(OPENSSL_NO_DEPRECATED_3_0) + +#define MDC2_BLOCK 8 + +typedef struct mdc2_ctx_st { + unsigned int num; + unsigned char data[MDC2_BLOCK]; + DES_cblock h, hh; + unsigned int pad_type; /* either 1 or 2, default 1 */ +} MDC2_CTX; +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int MDC2_Init(MDC2_CTX *c); +OSSL_DEPRECATEDIN_3_0 int MDC2_Update(MDC2_CTX *c, const unsigned char *data, + size_t len); +OSSL_DEPRECATEDIN_3_0 int MDC2_Final(unsigned char *md, MDC2_CTX *c); +OSSL_DEPRECATEDIN_3_0 unsigned char *MDC2(const unsigned char *d, size_t n, + unsigned char *md); +#endif + +#ifdef __cplusplus +} +#endif +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ml_kem.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ml_kem.h new file mode 100644 index 0000000000000000000000000000000000000000..fe5b0e2b7b89dda9712bc2189929986fb63dce8a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ml_kem.h @@ -0,0 +1,31 @@ +/* + * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_ML_KEM_H +#define OPENSSL_ML_KEM_H +#pragma once + +#define OSSL_ML_KEM_SHARED_SECRET_BYTES 32 + +#define OSSL_ML_KEM_512_BITS 512 +#define OSSL_ML_KEM_512_SECURITY_BITS 128 +#define OSSL_ML_KEM_512_CIPHERTEXT_BYTES 768 +#define OSSL_ML_KEM_512_PUBLIC_KEY_BYTES 800 + +#define OSSL_ML_KEM_768_BITS 768 +#define OSSL_ML_KEM_768_SECURITY_BITS 192 +#define OSSL_ML_KEM_768_CIPHERTEXT_BYTES 1088 +#define OSSL_ML_KEM_768_PUBLIC_KEY_BYTES 1184 + +#define OSSL_ML_KEM_1024_BITS 1024 +#define OSSL_ML_KEM_1024_SECURITY_BITS 256 +#define OSSL_ML_KEM_1024_CIPHERTEXT_BYTES 1568 +#define OSSL_ML_KEM_1024_PUBLIC_KEY_BYTES 1568 + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/modes.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/modes.h new file mode 100644 index 0000000000000000000000000000000000000000..df11114569f249be69914dfab4f9ecc35a07b74c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/modes.h @@ -0,0 +1,219 @@ +/* + * Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_MODES_H +#define OPENSSL_MODES_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_MODES_H +#endif + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif +typedef void (*block128_f)(const unsigned char in[16], + unsigned char out[16], const void *key); + +typedef void (*cbc128_f)(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], int enc); + +typedef void (*ecb128_f)(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + int enc); + +typedef void (*ctr128_f)(const unsigned char *in, unsigned char *out, + size_t blocks, const void *key, + const unsigned char ivec[16]); + +typedef void (*ccm128_f)(const unsigned char *in, unsigned char *out, + size_t blocks, const void *key, + const unsigned char ivec[16], + unsigned char cmac[16]); + +void CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], block128_f block); +void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], block128_f block); + +void CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], + unsigned char ecount_buf[16], unsigned int *num, + block128_f block); + +void CRYPTO_ctr128_encrypt_ctr32(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], + unsigned char ecount_buf[16], + unsigned int *num, ctr128_f ctr); + +void CRYPTO_ofb128_encrypt(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], int *num, + block128_f block); + +void CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], int *num, + int enc, block128_f block); +void CRYPTO_cfb128_8_encrypt(const unsigned char *in, unsigned char *out, + size_t length, const void *key, + unsigned char ivec[16], int *num, + int enc, block128_f block); +void CRYPTO_cfb128_1_encrypt(const unsigned char *in, unsigned char *out, + size_t bits, const void *key, + unsigned char ivec[16], int *num, + int enc, block128_f block); + +size_t CRYPTO_cts128_encrypt_block(const unsigned char *in, + unsigned char *out, size_t len, + const void *key, unsigned char ivec[16], + block128_f block); +size_t CRYPTO_cts128_encrypt(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], cbc128_f cbc); +size_t CRYPTO_cts128_decrypt_block(const unsigned char *in, + unsigned char *out, size_t len, + const void *key, unsigned char ivec[16], + block128_f block); +size_t CRYPTO_cts128_decrypt(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], cbc128_f cbc); + +size_t CRYPTO_nistcts128_encrypt_block(const unsigned char *in, + unsigned char *out, size_t len, + const void *key, + unsigned char ivec[16], + block128_f block); +size_t CRYPTO_nistcts128_encrypt(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], cbc128_f cbc); +size_t CRYPTO_nistcts128_decrypt_block(const unsigned char *in, + unsigned char *out, size_t len, + const void *key, + unsigned char ivec[16], + block128_f block); +size_t CRYPTO_nistcts128_decrypt(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], cbc128_f cbc); + +typedef struct gcm128_context GCM128_CONTEXT; + +GCM128_CONTEXT *CRYPTO_gcm128_new(void *key, block128_f block); +void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx, void *key, block128_f block); +void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const unsigned char *iv, + size_t len); +int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const unsigned char *aad, + size_t len); +int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, + const unsigned char *in, unsigned char *out, + size_t len); +int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, + const unsigned char *in, unsigned char *out, + size_t len); +int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, + const unsigned char *in, unsigned char *out, + size_t len, ctr128_f stream); +int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, + const unsigned char *in, unsigned char *out, + size_t len, ctr128_f stream); +int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const unsigned char *tag, + size_t len); +void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len); +void CRYPTO_gcm128_release(GCM128_CONTEXT *ctx); + +typedef struct ccm128_context CCM128_CONTEXT; + +void CRYPTO_ccm128_init(CCM128_CONTEXT *ctx, + unsigned int M, unsigned int L, void *key, + block128_f block); +int CRYPTO_ccm128_setiv(CCM128_CONTEXT *ctx, const unsigned char *nonce, + size_t nlen, size_t mlen); +void CRYPTO_ccm128_aad(CCM128_CONTEXT *ctx, const unsigned char *aad, + size_t alen); +int CRYPTO_ccm128_encrypt(CCM128_CONTEXT *ctx, const unsigned char *inp, + unsigned char *out, size_t len); +int CRYPTO_ccm128_decrypt(CCM128_CONTEXT *ctx, const unsigned char *inp, + unsigned char *out, size_t len); +int CRYPTO_ccm128_encrypt_ccm64(CCM128_CONTEXT *ctx, const unsigned char *inp, + unsigned char *out, size_t len, + ccm128_f stream); +int CRYPTO_ccm128_decrypt_ccm64(CCM128_CONTEXT *ctx, const unsigned char *inp, + unsigned char *out, size_t len, + ccm128_f stream); +size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len); + +typedef struct xts128_context XTS128_CONTEXT; + +int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, + const unsigned char iv[16], + const unsigned char *inp, unsigned char *out, + size_t len, int enc); + +size_t CRYPTO_128_wrap(void *key, const unsigned char *iv, + unsigned char *out, + const unsigned char *in, size_t inlen, + block128_f block); + +size_t CRYPTO_128_unwrap(void *key, const unsigned char *iv, + unsigned char *out, + const unsigned char *in, size_t inlen, + block128_f block); +size_t CRYPTO_128_wrap_pad(void *key, const unsigned char *icv, + unsigned char *out, const unsigned char *in, + size_t inlen, block128_f block); +size_t CRYPTO_128_unwrap_pad(void *key, const unsigned char *icv, + unsigned char *out, const unsigned char *in, + size_t inlen, block128_f block); + +#ifndef OPENSSL_NO_OCB +typedef struct ocb128_context OCB128_CONTEXT; + +typedef void (*ocb128_f)(const unsigned char *in, unsigned char *out, + size_t blocks, const void *key, + size_t start_block_num, + unsigned char offset_i[16], + const unsigned char L_[][16], + unsigned char checksum[16]); + +OCB128_CONTEXT *CRYPTO_ocb128_new(void *keyenc, void *keydec, + block128_f encrypt, block128_f decrypt, + ocb128_f stream); +int CRYPTO_ocb128_init(OCB128_CONTEXT *ctx, void *keyenc, void *keydec, + block128_f encrypt, block128_f decrypt, + ocb128_f stream); +int CRYPTO_ocb128_copy_ctx(OCB128_CONTEXT *dest, OCB128_CONTEXT *src, + void *keyenc, void *keydec); +int CRYPTO_ocb128_setiv(OCB128_CONTEXT *ctx, const unsigned char *iv, + size_t len, size_t taglen); +int CRYPTO_ocb128_aad(OCB128_CONTEXT *ctx, const unsigned char *aad, + size_t len); +int CRYPTO_ocb128_encrypt(OCB128_CONTEXT *ctx, const unsigned char *in, + unsigned char *out, size_t len); +int CRYPTO_ocb128_decrypt(OCB128_CONTEXT *ctx, const unsigned char *in, + unsigned char *out, size_t len); +int CRYPTO_ocb128_finish(OCB128_CONTEXT *ctx, const unsigned char *tag, + size_t len); +int CRYPTO_ocb128_tag(OCB128_CONTEXT *ctx, unsigned char *tag, size_t len); +void CRYPTO_ocb128_cleanup(OCB128_CONTEXT *ctx); +#endif /* OPENSSL_NO_OCB */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/obj_mac.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/obj_mac.h new file mode 100644 index 0000000000000000000000000000000000000000..236e88fdfced796aad28e4c4463b169263de130c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/obj_mac.h @@ -0,0 +1,6695 @@ +/* + * WARNING: do not edit! + * Generated by crypto/objects/objects.pl + * + * Copyright 2000-2025 The OpenSSL Project Authors. All Rights Reserved. + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_OBJ_MAC_H +# define OPENSSL_OBJ_MAC_H +# pragma once + +#define SN_undef "UNDEF" +#define LN_undef "undefined" +#define NID_undef 0 +#define OBJ_undef 0L + +#define SN_itu_t "ITU-T" +#define LN_itu_t "itu-t" +#define NID_itu_t 645 +#define OBJ_itu_t 0L + +#define NID_ccitt 404 +#define OBJ_ccitt OBJ_itu_t + +#define SN_iso "ISO" +#define LN_iso "iso" +#define NID_iso 181 +#define OBJ_iso 1L + +#define SN_joint_iso_itu_t "JOINT-ISO-ITU-T" +#define LN_joint_iso_itu_t "joint-iso-itu-t" +#define NID_joint_iso_itu_t 646 +#define OBJ_joint_iso_itu_t 2L + +#define NID_joint_iso_ccitt 393 +#define OBJ_joint_iso_ccitt OBJ_joint_iso_itu_t + +#define SN_member_body "member-body" +#define LN_member_body "ISO Member Body" +#define NID_member_body 182 +#define OBJ_member_body OBJ_iso,2L + +#define SN_identified_organization "identified-organization" +#define NID_identified_organization 676 +#define OBJ_identified_organization OBJ_iso,3L + +#define SN_gmac "GMAC" +#define LN_gmac "gmac" +#define NID_gmac 1195 +#define OBJ_gmac OBJ_iso,0L,9797L,3L,4L + +#define SN_hmac_md5 "HMAC-MD5" +#define LN_hmac_md5 "hmac-md5" +#define NID_hmac_md5 780 +#define OBJ_hmac_md5 OBJ_identified_organization,6L,1L,5L,5L,8L,1L,1L + +#define SN_hmac_sha1 "HMAC-SHA1" +#define LN_hmac_sha1 "hmac-sha1" +#define NID_hmac_sha1 781 +#define OBJ_hmac_sha1 OBJ_identified_organization,6L,1L,5L,5L,8L,1L,2L + +#define SN_x509ExtAdmission "x509ExtAdmission" +#define LN_x509ExtAdmission "Professional Information or basis for Admission" +#define NID_x509ExtAdmission 1093 +#define OBJ_x509ExtAdmission OBJ_identified_organization,36L,8L,3L,3L + +#define SN_certicom_arc "certicom-arc" +#define NID_certicom_arc 677 +#define OBJ_certicom_arc OBJ_identified_organization,132L + +#define SN_ieee "ieee" +#define NID_ieee 1170 +#define OBJ_ieee OBJ_identified_organization,111L + +#define SN_ieee_siswg "ieee-siswg" +#define LN_ieee_siswg "IEEE Security in Storage Working Group" +#define NID_ieee_siswg 1171 +#define OBJ_ieee_siswg OBJ_ieee,2L,1619L + +#define SN_international_organizations "international-organizations" +#define LN_international_organizations "International Organizations" +#define NID_international_organizations 647 +#define OBJ_international_organizations OBJ_joint_iso_itu_t,23L + +#define SN_wap "wap" +#define NID_wap 678 +#define OBJ_wap OBJ_international_organizations,43L + +#define SN_wap_wsg "wap-wsg" +#define NID_wap_wsg 679 +#define OBJ_wap_wsg OBJ_wap,1L + +#define SN_selected_attribute_types "selected-attribute-types" +#define LN_selected_attribute_types "Selected Attribute Types" +#define NID_selected_attribute_types 394 +#define OBJ_selected_attribute_types OBJ_joint_iso_itu_t,5L,1L,5L + +#define SN_clearance "clearance" +#define NID_clearance 395 +#define OBJ_clearance OBJ_selected_attribute_types,55L + +#define SN_ISO_US "ISO-US" +#define LN_ISO_US "ISO US Member Body" +#define NID_ISO_US 183 +#define OBJ_ISO_US OBJ_member_body,840L + +#define SN_X9_57 "X9-57" +#define LN_X9_57 "X9.57" +#define NID_X9_57 184 +#define OBJ_X9_57 OBJ_ISO_US,10040L + +#define SN_X9cm "X9cm" +#define LN_X9cm "X9.57 CM ?" +#define NID_X9cm 185 +#define OBJ_X9cm OBJ_X9_57,4L + +#define SN_ISO_CN "ISO-CN" +#define LN_ISO_CN "ISO CN Member Body" +#define NID_ISO_CN 1140 +#define OBJ_ISO_CN OBJ_member_body,156L + +#define SN_oscca "oscca" +#define NID_oscca 1141 +#define OBJ_oscca OBJ_ISO_CN,10197L + +#define SN_sm_scheme "sm-scheme" +#define NID_sm_scheme 1142 +#define OBJ_sm_scheme OBJ_oscca,1L + +#define SN_dsa "DSA" +#define LN_dsa "dsaEncryption" +#define NID_dsa 116 +#define OBJ_dsa OBJ_X9cm,1L + +#define SN_dsaWithSHA1 "DSA-SHA1" +#define LN_dsaWithSHA1 "dsaWithSHA1" +#define NID_dsaWithSHA1 113 +#define OBJ_dsaWithSHA1 OBJ_X9cm,3L + +#define SN_ansi_X9_62 "ansi-X9-62" +#define LN_ansi_X9_62 "ANSI X9.62" +#define NID_ansi_X9_62 405 +#define OBJ_ansi_X9_62 OBJ_ISO_US,10045L + +#define OBJ_X9_62_id_fieldType OBJ_ansi_X9_62,1L + +#define SN_X9_62_prime_field "prime-field" +#define NID_X9_62_prime_field 406 +#define OBJ_X9_62_prime_field OBJ_X9_62_id_fieldType,1L + +#define SN_X9_62_characteristic_two_field "characteristic-two-field" +#define NID_X9_62_characteristic_two_field 407 +#define OBJ_X9_62_characteristic_two_field OBJ_X9_62_id_fieldType,2L + +#define SN_X9_62_id_characteristic_two_basis "id-characteristic-two-basis" +#define NID_X9_62_id_characteristic_two_basis 680 +#define OBJ_X9_62_id_characteristic_two_basis OBJ_X9_62_characteristic_two_field,3L + +#define SN_X9_62_onBasis "onBasis" +#define NID_X9_62_onBasis 681 +#define OBJ_X9_62_onBasis OBJ_X9_62_id_characteristic_two_basis,1L + +#define SN_X9_62_tpBasis "tpBasis" +#define NID_X9_62_tpBasis 682 +#define OBJ_X9_62_tpBasis OBJ_X9_62_id_characteristic_two_basis,2L + +#define SN_X9_62_ppBasis "ppBasis" +#define NID_X9_62_ppBasis 683 +#define OBJ_X9_62_ppBasis OBJ_X9_62_id_characteristic_two_basis,3L + +#define OBJ_X9_62_id_publicKeyType OBJ_ansi_X9_62,2L + +#define SN_X9_62_id_ecPublicKey "id-ecPublicKey" +#define NID_X9_62_id_ecPublicKey 408 +#define OBJ_X9_62_id_ecPublicKey OBJ_X9_62_id_publicKeyType,1L + +#define OBJ_X9_62_ellipticCurve OBJ_ansi_X9_62,3L + +#define OBJ_X9_62_c_TwoCurve OBJ_X9_62_ellipticCurve,0L + +#define SN_X9_62_c2pnb163v1 "c2pnb163v1" +#define NID_X9_62_c2pnb163v1 684 +#define OBJ_X9_62_c2pnb163v1 OBJ_X9_62_c_TwoCurve,1L + +#define SN_X9_62_c2pnb163v2 "c2pnb163v2" +#define NID_X9_62_c2pnb163v2 685 +#define OBJ_X9_62_c2pnb163v2 OBJ_X9_62_c_TwoCurve,2L + +#define SN_X9_62_c2pnb163v3 "c2pnb163v3" +#define NID_X9_62_c2pnb163v3 686 +#define OBJ_X9_62_c2pnb163v3 OBJ_X9_62_c_TwoCurve,3L + +#define SN_X9_62_c2pnb176v1 "c2pnb176v1" +#define NID_X9_62_c2pnb176v1 687 +#define OBJ_X9_62_c2pnb176v1 OBJ_X9_62_c_TwoCurve,4L + +#define SN_X9_62_c2tnb191v1 "c2tnb191v1" +#define NID_X9_62_c2tnb191v1 688 +#define OBJ_X9_62_c2tnb191v1 OBJ_X9_62_c_TwoCurve,5L + +#define SN_X9_62_c2tnb191v2 "c2tnb191v2" +#define NID_X9_62_c2tnb191v2 689 +#define OBJ_X9_62_c2tnb191v2 OBJ_X9_62_c_TwoCurve,6L + +#define SN_X9_62_c2tnb191v3 "c2tnb191v3" +#define NID_X9_62_c2tnb191v3 690 +#define OBJ_X9_62_c2tnb191v3 OBJ_X9_62_c_TwoCurve,7L + +#define SN_X9_62_c2onb191v4 "c2onb191v4" +#define NID_X9_62_c2onb191v4 691 +#define OBJ_X9_62_c2onb191v4 OBJ_X9_62_c_TwoCurve,8L + +#define SN_X9_62_c2onb191v5 "c2onb191v5" +#define NID_X9_62_c2onb191v5 692 +#define OBJ_X9_62_c2onb191v5 OBJ_X9_62_c_TwoCurve,9L + +#define SN_X9_62_c2pnb208w1 "c2pnb208w1" +#define NID_X9_62_c2pnb208w1 693 +#define OBJ_X9_62_c2pnb208w1 OBJ_X9_62_c_TwoCurve,10L + +#define SN_X9_62_c2tnb239v1 "c2tnb239v1" +#define NID_X9_62_c2tnb239v1 694 +#define OBJ_X9_62_c2tnb239v1 OBJ_X9_62_c_TwoCurve,11L + +#define SN_X9_62_c2tnb239v2 "c2tnb239v2" +#define NID_X9_62_c2tnb239v2 695 +#define OBJ_X9_62_c2tnb239v2 OBJ_X9_62_c_TwoCurve,12L + +#define SN_X9_62_c2tnb239v3 "c2tnb239v3" +#define NID_X9_62_c2tnb239v3 696 +#define OBJ_X9_62_c2tnb239v3 OBJ_X9_62_c_TwoCurve,13L + +#define SN_X9_62_c2onb239v4 "c2onb239v4" +#define NID_X9_62_c2onb239v4 697 +#define OBJ_X9_62_c2onb239v4 OBJ_X9_62_c_TwoCurve,14L + +#define SN_X9_62_c2onb239v5 "c2onb239v5" +#define NID_X9_62_c2onb239v5 698 +#define OBJ_X9_62_c2onb239v5 OBJ_X9_62_c_TwoCurve,15L + +#define SN_X9_62_c2pnb272w1 "c2pnb272w1" +#define NID_X9_62_c2pnb272w1 699 +#define OBJ_X9_62_c2pnb272w1 OBJ_X9_62_c_TwoCurve,16L + +#define SN_X9_62_c2pnb304w1 "c2pnb304w1" +#define NID_X9_62_c2pnb304w1 700 +#define OBJ_X9_62_c2pnb304w1 OBJ_X9_62_c_TwoCurve,17L + +#define SN_X9_62_c2tnb359v1 "c2tnb359v1" +#define NID_X9_62_c2tnb359v1 701 +#define OBJ_X9_62_c2tnb359v1 OBJ_X9_62_c_TwoCurve,18L + +#define SN_X9_62_c2pnb368w1 "c2pnb368w1" +#define NID_X9_62_c2pnb368w1 702 +#define OBJ_X9_62_c2pnb368w1 OBJ_X9_62_c_TwoCurve,19L + +#define SN_X9_62_c2tnb431r1 "c2tnb431r1" +#define NID_X9_62_c2tnb431r1 703 +#define OBJ_X9_62_c2tnb431r1 OBJ_X9_62_c_TwoCurve,20L + +#define OBJ_X9_62_primeCurve OBJ_X9_62_ellipticCurve,1L + +#define SN_X9_62_prime192v1 "prime192v1" +#define NID_X9_62_prime192v1 409 +#define OBJ_X9_62_prime192v1 OBJ_X9_62_primeCurve,1L + +#define SN_X9_62_prime192v2 "prime192v2" +#define NID_X9_62_prime192v2 410 +#define OBJ_X9_62_prime192v2 OBJ_X9_62_primeCurve,2L + +#define SN_X9_62_prime192v3 "prime192v3" +#define NID_X9_62_prime192v3 411 +#define OBJ_X9_62_prime192v3 OBJ_X9_62_primeCurve,3L + +#define SN_X9_62_prime239v1 "prime239v1" +#define NID_X9_62_prime239v1 412 +#define OBJ_X9_62_prime239v1 OBJ_X9_62_primeCurve,4L + +#define SN_X9_62_prime239v2 "prime239v2" +#define NID_X9_62_prime239v2 413 +#define OBJ_X9_62_prime239v2 OBJ_X9_62_primeCurve,5L + +#define SN_X9_62_prime239v3 "prime239v3" +#define NID_X9_62_prime239v3 414 +#define OBJ_X9_62_prime239v3 OBJ_X9_62_primeCurve,6L + +#define SN_X9_62_prime256v1 "prime256v1" +#define NID_X9_62_prime256v1 415 +#define OBJ_X9_62_prime256v1 OBJ_X9_62_primeCurve,7L + +#define OBJ_X9_62_id_ecSigType OBJ_ansi_X9_62,4L + +#define SN_ecdsa_with_SHA1 "ecdsa-with-SHA1" +#define NID_ecdsa_with_SHA1 416 +#define OBJ_ecdsa_with_SHA1 OBJ_X9_62_id_ecSigType,1L + +#define SN_ecdsa_with_Recommended "ecdsa-with-Recommended" +#define NID_ecdsa_with_Recommended 791 +#define OBJ_ecdsa_with_Recommended OBJ_X9_62_id_ecSigType,2L + +#define SN_ecdsa_with_Specified "ecdsa-with-Specified" +#define NID_ecdsa_with_Specified 792 +#define OBJ_ecdsa_with_Specified OBJ_X9_62_id_ecSigType,3L + +#define SN_ecdsa_with_SHA224 "ecdsa-with-SHA224" +#define NID_ecdsa_with_SHA224 793 +#define OBJ_ecdsa_with_SHA224 OBJ_ecdsa_with_Specified,1L + +#define SN_ecdsa_with_SHA256 "ecdsa-with-SHA256" +#define NID_ecdsa_with_SHA256 794 +#define OBJ_ecdsa_with_SHA256 OBJ_ecdsa_with_Specified,2L + +#define SN_ecdsa_with_SHA384 "ecdsa-with-SHA384" +#define NID_ecdsa_with_SHA384 795 +#define OBJ_ecdsa_with_SHA384 OBJ_ecdsa_with_Specified,3L + +#define SN_ecdsa_with_SHA512 "ecdsa-with-SHA512" +#define NID_ecdsa_with_SHA512 796 +#define OBJ_ecdsa_with_SHA512 OBJ_ecdsa_with_Specified,4L + +#define OBJ_secg_ellipticCurve OBJ_certicom_arc,0L + +#define SN_secp112r1 "secp112r1" +#define NID_secp112r1 704 +#define OBJ_secp112r1 OBJ_secg_ellipticCurve,6L + +#define SN_secp112r2 "secp112r2" +#define NID_secp112r2 705 +#define OBJ_secp112r2 OBJ_secg_ellipticCurve,7L + +#define SN_secp128r1 "secp128r1" +#define NID_secp128r1 706 +#define OBJ_secp128r1 OBJ_secg_ellipticCurve,28L + +#define SN_secp128r2 "secp128r2" +#define NID_secp128r2 707 +#define OBJ_secp128r2 OBJ_secg_ellipticCurve,29L + +#define SN_secp160k1 "secp160k1" +#define NID_secp160k1 708 +#define OBJ_secp160k1 OBJ_secg_ellipticCurve,9L + +#define SN_secp160r1 "secp160r1" +#define NID_secp160r1 709 +#define OBJ_secp160r1 OBJ_secg_ellipticCurve,8L + +#define SN_secp160r2 "secp160r2" +#define NID_secp160r2 710 +#define OBJ_secp160r2 OBJ_secg_ellipticCurve,30L + +#define SN_secp192k1 "secp192k1" +#define NID_secp192k1 711 +#define OBJ_secp192k1 OBJ_secg_ellipticCurve,31L + +#define SN_secp224k1 "secp224k1" +#define NID_secp224k1 712 +#define OBJ_secp224k1 OBJ_secg_ellipticCurve,32L + +#define SN_secp224r1 "secp224r1" +#define NID_secp224r1 713 +#define OBJ_secp224r1 OBJ_secg_ellipticCurve,33L + +#define SN_secp256k1 "secp256k1" +#define NID_secp256k1 714 +#define OBJ_secp256k1 OBJ_secg_ellipticCurve,10L + +#define SN_secp384r1 "secp384r1" +#define NID_secp384r1 715 +#define OBJ_secp384r1 OBJ_secg_ellipticCurve,34L + +#define SN_secp521r1 "secp521r1" +#define NID_secp521r1 716 +#define OBJ_secp521r1 OBJ_secg_ellipticCurve,35L + +#define SN_sect113r1 "sect113r1" +#define NID_sect113r1 717 +#define OBJ_sect113r1 OBJ_secg_ellipticCurve,4L + +#define SN_sect113r2 "sect113r2" +#define NID_sect113r2 718 +#define OBJ_sect113r2 OBJ_secg_ellipticCurve,5L + +#define SN_sect131r1 "sect131r1" +#define NID_sect131r1 719 +#define OBJ_sect131r1 OBJ_secg_ellipticCurve,22L + +#define SN_sect131r2 "sect131r2" +#define NID_sect131r2 720 +#define OBJ_sect131r2 OBJ_secg_ellipticCurve,23L + +#define SN_sect163k1 "sect163k1" +#define NID_sect163k1 721 +#define OBJ_sect163k1 OBJ_secg_ellipticCurve,1L + +#define SN_sect163r1 "sect163r1" +#define NID_sect163r1 722 +#define OBJ_sect163r1 OBJ_secg_ellipticCurve,2L + +#define SN_sect163r2 "sect163r2" +#define NID_sect163r2 723 +#define OBJ_sect163r2 OBJ_secg_ellipticCurve,15L + +#define SN_sect193r1 "sect193r1" +#define NID_sect193r1 724 +#define OBJ_sect193r1 OBJ_secg_ellipticCurve,24L + +#define SN_sect193r2 "sect193r2" +#define NID_sect193r2 725 +#define OBJ_sect193r2 OBJ_secg_ellipticCurve,25L + +#define SN_sect233k1 "sect233k1" +#define NID_sect233k1 726 +#define OBJ_sect233k1 OBJ_secg_ellipticCurve,26L + +#define SN_sect233r1 "sect233r1" +#define NID_sect233r1 727 +#define OBJ_sect233r1 OBJ_secg_ellipticCurve,27L + +#define SN_sect239k1 "sect239k1" +#define NID_sect239k1 728 +#define OBJ_sect239k1 OBJ_secg_ellipticCurve,3L + +#define SN_sect283k1 "sect283k1" +#define NID_sect283k1 729 +#define OBJ_sect283k1 OBJ_secg_ellipticCurve,16L + +#define SN_sect283r1 "sect283r1" +#define NID_sect283r1 730 +#define OBJ_sect283r1 OBJ_secg_ellipticCurve,17L + +#define SN_sect409k1 "sect409k1" +#define NID_sect409k1 731 +#define OBJ_sect409k1 OBJ_secg_ellipticCurve,36L + +#define SN_sect409r1 "sect409r1" +#define NID_sect409r1 732 +#define OBJ_sect409r1 OBJ_secg_ellipticCurve,37L + +#define SN_sect571k1 "sect571k1" +#define NID_sect571k1 733 +#define OBJ_sect571k1 OBJ_secg_ellipticCurve,38L + +#define SN_sect571r1 "sect571r1" +#define NID_sect571r1 734 +#define OBJ_sect571r1 OBJ_secg_ellipticCurve,39L + +#define OBJ_wap_wsg_idm_ecid OBJ_wap_wsg,4L + +#define SN_wap_wsg_idm_ecid_wtls1 "wap-wsg-idm-ecid-wtls1" +#define NID_wap_wsg_idm_ecid_wtls1 735 +#define OBJ_wap_wsg_idm_ecid_wtls1 OBJ_wap_wsg_idm_ecid,1L + +#define SN_wap_wsg_idm_ecid_wtls3 "wap-wsg-idm-ecid-wtls3" +#define NID_wap_wsg_idm_ecid_wtls3 736 +#define OBJ_wap_wsg_idm_ecid_wtls3 OBJ_wap_wsg_idm_ecid,3L + +#define SN_wap_wsg_idm_ecid_wtls4 "wap-wsg-idm-ecid-wtls4" +#define NID_wap_wsg_idm_ecid_wtls4 737 +#define OBJ_wap_wsg_idm_ecid_wtls4 OBJ_wap_wsg_idm_ecid,4L + +#define SN_wap_wsg_idm_ecid_wtls5 "wap-wsg-idm-ecid-wtls5" +#define NID_wap_wsg_idm_ecid_wtls5 738 +#define OBJ_wap_wsg_idm_ecid_wtls5 OBJ_wap_wsg_idm_ecid,5L + +#define SN_wap_wsg_idm_ecid_wtls6 "wap-wsg-idm-ecid-wtls6" +#define NID_wap_wsg_idm_ecid_wtls6 739 +#define OBJ_wap_wsg_idm_ecid_wtls6 OBJ_wap_wsg_idm_ecid,6L + +#define SN_wap_wsg_idm_ecid_wtls7 "wap-wsg-idm-ecid-wtls7" +#define NID_wap_wsg_idm_ecid_wtls7 740 +#define OBJ_wap_wsg_idm_ecid_wtls7 OBJ_wap_wsg_idm_ecid,7L + +#define SN_wap_wsg_idm_ecid_wtls8 "wap-wsg-idm-ecid-wtls8" +#define NID_wap_wsg_idm_ecid_wtls8 741 +#define OBJ_wap_wsg_idm_ecid_wtls8 OBJ_wap_wsg_idm_ecid,8L + +#define SN_wap_wsg_idm_ecid_wtls9 "wap-wsg-idm-ecid-wtls9" +#define NID_wap_wsg_idm_ecid_wtls9 742 +#define OBJ_wap_wsg_idm_ecid_wtls9 OBJ_wap_wsg_idm_ecid,9L + +#define SN_wap_wsg_idm_ecid_wtls10 "wap-wsg-idm-ecid-wtls10" +#define NID_wap_wsg_idm_ecid_wtls10 743 +#define OBJ_wap_wsg_idm_ecid_wtls10 OBJ_wap_wsg_idm_ecid,10L + +#define SN_wap_wsg_idm_ecid_wtls11 "wap-wsg-idm-ecid-wtls11" +#define NID_wap_wsg_idm_ecid_wtls11 744 +#define OBJ_wap_wsg_idm_ecid_wtls11 OBJ_wap_wsg_idm_ecid,11L + +#define SN_wap_wsg_idm_ecid_wtls12 "wap-wsg-idm-ecid-wtls12" +#define NID_wap_wsg_idm_ecid_wtls12 745 +#define OBJ_wap_wsg_idm_ecid_wtls12 OBJ_wap_wsg_idm_ecid,12L + +#define SN_cast5_cbc "CAST5-CBC" +#define LN_cast5_cbc "cast5-cbc" +#define NID_cast5_cbc 108 +#define OBJ_cast5_cbc OBJ_ISO_US,113533L,7L,66L,10L + +#define SN_cast5_ecb "CAST5-ECB" +#define LN_cast5_ecb "cast5-ecb" +#define NID_cast5_ecb 109 + +#define SN_cast5_cfb64 "CAST5-CFB" +#define LN_cast5_cfb64 "cast5-cfb" +#define NID_cast5_cfb64 110 + +#define SN_cast5_ofb64 "CAST5-OFB" +#define LN_cast5_ofb64 "cast5-ofb" +#define NID_cast5_ofb64 111 + +#define LN_pbeWithMD5AndCast5_CBC "pbeWithMD5AndCast5CBC" +#define NID_pbeWithMD5AndCast5_CBC 112 +#define OBJ_pbeWithMD5AndCast5_CBC OBJ_ISO_US,113533L,7L,66L,12L + +#define SN_id_PasswordBasedMAC "id-PasswordBasedMAC" +#define LN_id_PasswordBasedMAC "password based MAC" +#define NID_id_PasswordBasedMAC 782 +#define OBJ_id_PasswordBasedMAC OBJ_ISO_US,113533L,7L,66L,13L + +#define SN_id_DHBasedMac "id-DHBasedMac" +#define LN_id_DHBasedMac "Diffie-Hellman based MAC" +#define NID_id_DHBasedMac 783 +#define OBJ_id_DHBasedMac OBJ_ISO_US,113533L,7L,66L,30L + +#define SN_rsadsi "rsadsi" +#define LN_rsadsi "RSA Data Security, Inc." +#define NID_rsadsi 1 +#define OBJ_rsadsi OBJ_ISO_US,113549L + +#define SN_pkcs "pkcs" +#define LN_pkcs "RSA Data Security, Inc. PKCS" +#define NID_pkcs 2 +#define OBJ_pkcs OBJ_rsadsi,1L + +#define SN_pkcs1 "pkcs1" +#define NID_pkcs1 186 +#define OBJ_pkcs1 OBJ_pkcs,1L + +#define LN_rsaEncryption "rsaEncryption" +#define NID_rsaEncryption 6 +#define OBJ_rsaEncryption OBJ_pkcs1,1L + +#define SN_md2WithRSAEncryption "RSA-MD2" +#define LN_md2WithRSAEncryption "md2WithRSAEncryption" +#define NID_md2WithRSAEncryption 7 +#define OBJ_md2WithRSAEncryption OBJ_pkcs1,2L + +#define SN_md4WithRSAEncryption "RSA-MD4" +#define LN_md4WithRSAEncryption "md4WithRSAEncryption" +#define NID_md4WithRSAEncryption 396 +#define OBJ_md4WithRSAEncryption OBJ_pkcs1,3L + +#define SN_md5WithRSAEncryption "RSA-MD5" +#define LN_md5WithRSAEncryption "md5WithRSAEncryption" +#define NID_md5WithRSAEncryption 8 +#define OBJ_md5WithRSAEncryption OBJ_pkcs1,4L + +#define SN_sha1WithRSAEncryption "RSA-SHA1" +#define LN_sha1WithRSAEncryption "sha1WithRSAEncryption" +#define NID_sha1WithRSAEncryption 65 +#define OBJ_sha1WithRSAEncryption OBJ_pkcs1,5L + +#define SN_rsaesOaep "RSAES-OAEP" +#define LN_rsaesOaep "rsaesOaep" +#define NID_rsaesOaep 919 +#define OBJ_rsaesOaep OBJ_pkcs1,7L + +#define SN_mgf1 "MGF1" +#define LN_mgf1 "mgf1" +#define NID_mgf1 911 +#define OBJ_mgf1 OBJ_pkcs1,8L + +#define SN_pSpecified "PSPECIFIED" +#define LN_pSpecified "pSpecified" +#define NID_pSpecified 935 +#define OBJ_pSpecified OBJ_pkcs1,9L + +#define SN_rsassaPss "RSASSA-PSS" +#define LN_rsassaPss "rsassaPss" +#define NID_rsassaPss 912 +#define OBJ_rsassaPss OBJ_pkcs1,10L + +#define SN_sha256WithRSAEncryption "RSA-SHA256" +#define LN_sha256WithRSAEncryption "sha256WithRSAEncryption" +#define NID_sha256WithRSAEncryption 668 +#define OBJ_sha256WithRSAEncryption OBJ_pkcs1,11L + +#define SN_sha384WithRSAEncryption "RSA-SHA384" +#define LN_sha384WithRSAEncryption "sha384WithRSAEncryption" +#define NID_sha384WithRSAEncryption 669 +#define OBJ_sha384WithRSAEncryption OBJ_pkcs1,12L + +#define SN_sha512WithRSAEncryption "RSA-SHA512" +#define LN_sha512WithRSAEncryption "sha512WithRSAEncryption" +#define NID_sha512WithRSAEncryption 670 +#define OBJ_sha512WithRSAEncryption OBJ_pkcs1,13L + +#define SN_sha224WithRSAEncryption "RSA-SHA224" +#define LN_sha224WithRSAEncryption "sha224WithRSAEncryption" +#define NID_sha224WithRSAEncryption 671 +#define OBJ_sha224WithRSAEncryption OBJ_pkcs1,14L + +#define SN_sha512_224WithRSAEncryption "RSA-SHA512/224" +#define LN_sha512_224WithRSAEncryption "sha512-224WithRSAEncryption" +#define NID_sha512_224WithRSAEncryption 1145 +#define OBJ_sha512_224WithRSAEncryption OBJ_pkcs1,15L + +#define SN_sha512_256WithRSAEncryption "RSA-SHA512/256" +#define LN_sha512_256WithRSAEncryption "sha512-256WithRSAEncryption" +#define NID_sha512_256WithRSAEncryption 1146 +#define OBJ_sha512_256WithRSAEncryption OBJ_pkcs1,16L + +#define SN_pkcs3 "pkcs3" +#define NID_pkcs3 27 +#define OBJ_pkcs3 OBJ_pkcs,3L + +#define LN_dhKeyAgreement "dhKeyAgreement" +#define NID_dhKeyAgreement 28 +#define OBJ_dhKeyAgreement OBJ_pkcs3,1L + +#define SN_pkcs5 "pkcs5" +#define NID_pkcs5 187 +#define OBJ_pkcs5 OBJ_pkcs,5L + +#define SN_pbeWithMD2AndDES_CBC "PBE-MD2-DES" +#define LN_pbeWithMD2AndDES_CBC "pbeWithMD2AndDES-CBC" +#define NID_pbeWithMD2AndDES_CBC 9 +#define OBJ_pbeWithMD2AndDES_CBC OBJ_pkcs5,1L + +#define SN_pbeWithMD5AndDES_CBC "PBE-MD5-DES" +#define LN_pbeWithMD5AndDES_CBC "pbeWithMD5AndDES-CBC" +#define NID_pbeWithMD5AndDES_CBC 10 +#define OBJ_pbeWithMD5AndDES_CBC OBJ_pkcs5,3L + +#define SN_pbeWithMD2AndRC2_CBC "PBE-MD2-RC2-64" +#define LN_pbeWithMD2AndRC2_CBC "pbeWithMD2AndRC2-CBC" +#define NID_pbeWithMD2AndRC2_CBC 168 +#define OBJ_pbeWithMD2AndRC2_CBC OBJ_pkcs5,4L + +#define SN_pbeWithMD5AndRC2_CBC "PBE-MD5-RC2-64" +#define LN_pbeWithMD5AndRC2_CBC "pbeWithMD5AndRC2-CBC" +#define NID_pbeWithMD5AndRC2_CBC 169 +#define OBJ_pbeWithMD5AndRC2_CBC OBJ_pkcs5,6L + +#define SN_pbeWithSHA1AndDES_CBC "PBE-SHA1-DES" +#define LN_pbeWithSHA1AndDES_CBC "pbeWithSHA1AndDES-CBC" +#define NID_pbeWithSHA1AndDES_CBC 170 +#define OBJ_pbeWithSHA1AndDES_CBC OBJ_pkcs5,10L + +#define SN_pbeWithSHA1AndRC2_CBC "PBE-SHA1-RC2-64" +#define LN_pbeWithSHA1AndRC2_CBC "pbeWithSHA1AndRC2-CBC" +#define NID_pbeWithSHA1AndRC2_CBC 68 +#define OBJ_pbeWithSHA1AndRC2_CBC OBJ_pkcs5,11L + +#define LN_id_pbkdf2 "PBKDF2" +#define NID_id_pbkdf2 69 +#define OBJ_id_pbkdf2 OBJ_pkcs5,12L + +#define LN_pbes2 "PBES2" +#define NID_pbes2 161 +#define OBJ_pbes2 OBJ_pkcs5,13L + +#define LN_pbmac1 "PBMAC1" +#define NID_pbmac1 162 +#define OBJ_pbmac1 OBJ_pkcs5,14L + +#define SN_pkcs7 "pkcs7" +#define NID_pkcs7 20 +#define OBJ_pkcs7 OBJ_pkcs,7L + +#define LN_pkcs7_data "pkcs7-data" +#define NID_pkcs7_data 21 +#define OBJ_pkcs7_data OBJ_pkcs7,1L + +#define LN_pkcs7_signed "pkcs7-signedData" +#define NID_pkcs7_signed 22 +#define OBJ_pkcs7_signed OBJ_pkcs7,2L + +#define LN_pkcs7_enveloped "pkcs7-envelopedData" +#define NID_pkcs7_enveloped 23 +#define OBJ_pkcs7_enveloped OBJ_pkcs7,3L + +#define LN_pkcs7_signedAndEnveloped "pkcs7-signedAndEnvelopedData" +#define NID_pkcs7_signedAndEnveloped 24 +#define OBJ_pkcs7_signedAndEnveloped OBJ_pkcs7,4L + +#define LN_pkcs7_digest "pkcs7-digestData" +#define NID_pkcs7_digest 25 +#define OBJ_pkcs7_digest OBJ_pkcs7,5L + +#define LN_pkcs7_encrypted "pkcs7-encryptedData" +#define NID_pkcs7_encrypted 26 +#define OBJ_pkcs7_encrypted OBJ_pkcs7,6L + +#define SN_pkcs9 "pkcs9" +#define NID_pkcs9 47 +#define OBJ_pkcs9 OBJ_pkcs,9L + +#define LN_pkcs9_emailAddress "emailAddress" +#define NID_pkcs9_emailAddress 48 +#define OBJ_pkcs9_emailAddress OBJ_pkcs9,1L + +#define LN_pkcs9_unstructuredName "unstructuredName" +#define NID_pkcs9_unstructuredName 49 +#define OBJ_pkcs9_unstructuredName OBJ_pkcs9,2L + +#define LN_pkcs9_contentType "contentType" +#define NID_pkcs9_contentType 50 +#define OBJ_pkcs9_contentType OBJ_pkcs9,3L + +#define LN_pkcs9_messageDigest "messageDigest" +#define NID_pkcs9_messageDigest 51 +#define OBJ_pkcs9_messageDigest OBJ_pkcs9,4L + +#define LN_pkcs9_signingTime "signingTime" +#define NID_pkcs9_signingTime 52 +#define OBJ_pkcs9_signingTime OBJ_pkcs9,5L + +#define LN_pkcs9_countersignature "countersignature" +#define NID_pkcs9_countersignature 53 +#define OBJ_pkcs9_countersignature OBJ_pkcs9,6L + +#define LN_pkcs9_challengePassword "challengePassword" +#define NID_pkcs9_challengePassword 54 +#define OBJ_pkcs9_challengePassword OBJ_pkcs9,7L + +#define LN_pkcs9_unstructuredAddress "unstructuredAddress" +#define NID_pkcs9_unstructuredAddress 55 +#define OBJ_pkcs9_unstructuredAddress OBJ_pkcs9,8L + +#define LN_pkcs9_extCertAttributes "extendedCertificateAttributes" +#define NID_pkcs9_extCertAttributes 56 +#define OBJ_pkcs9_extCertAttributes OBJ_pkcs9,9L + +#define SN_ext_req "extReq" +#define LN_ext_req "Extension Request" +#define NID_ext_req 172 +#define OBJ_ext_req OBJ_pkcs9,14L + +#define SN_SMIMECapabilities "SMIME-CAPS" +#define LN_SMIMECapabilities "S/MIME Capabilities" +#define NID_SMIMECapabilities 167 +#define OBJ_SMIMECapabilities OBJ_pkcs9,15L + +#define SN_SMIME "SMIME" +#define LN_SMIME "S/MIME" +#define NID_SMIME 188 +#define OBJ_SMIME OBJ_pkcs9,16L + +#define SN_id_smime_mod "id-smime-mod" +#define NID_id_smime_mod 189 +#define OBJ_id_smime_mod OBJ_SMIME,0L + +#define SN_id_smime_ct "id-smime-ct" +#define NID_id_smime_ct 190 +#define OBJ_id_smime_ct OBJ_SMIME,1L + +#define SN_id_smime_aa "id-smime-aa" +#define NID_id_smime_aa 191 +#define OBJ_id_smime_aa OBJ_SMIME,2L + +#define SN_id_smime_alg "id-smime-alg" +#define NID_id_smime_alg 192 +#define OBJ_id_smime_alg OBJ_SMIME,3L + +#define SN_id_smime_cd "id-smime-cd" +#define NID_id_smime_cd 193 +#define OBJ_id_smime_cd OBJ_SMIME,4L + +#define SN_id_smime_spq "id-smime-spq" +#define NID_id_smime_spq 194 +#define OBJ_id_smime_spq OBJ_SMIME,5L + +#define SN_id_smime_cti "id-smime-cti" +#define NID_id_smime_cti 195 +#define OBJ_id_smime_cti OBJ_SMIME,6L + +#define SN_id_smime_ori "id-smime-ori" +#define NID_id_smime_ori 1499 +#define OBJ_id_smime_ori OBJ_SMIME,13L + +#define SN_id_smime_mod_cms "id-smime-mod-cms" +#define NID_id_smime_mod_cms 196 +#define OBJ_id_smime_mod_cms OBJ_id_smime_mod,1L + +#define SN_id_smime_mod_ess "id-smime-mod-ess" +#define NID_id_smime_mod_ess 197 +#define OBJ_id_smime_mod_ess OBJ_id_smime_mod,2L + +#define SN_id_smime_mod_oid "id-smime-mod-oid" +#define NID_id_smime_mod_oid 198 +#define OBJ_id_smime_mod_oid OBJ_id_smime_mod,3L + +#define SN_id_smime_mod_msg_v3 "id-smime-mod-msg-v3" +#define NID_id_smime_mod_msg_v3 199 +#define OBJ_id_smime_mod_msg_v3 OBJ_id_smime_mod,4L + +#define SN_id_smime_mod_ets_eSignature_88 "id-smime-mod-ets-eSignature-88" +#define NID_id_smime_mod_ets_eSignature_88 200 +#define OBJ_id_smime_mod_ets_eSignature_88 OBJ_id_smime_mod,5L + +#define SN_id_smime_mod_ets_eSignature_97 "id-smime-mod-ets-eSignature-97" +#define NID_id_smime_mod_ets_eSignature_97 201 +#define OBJ_id_smime_mod_ets_eSignature_97 OBJ_id_smime_mod,6L + +#define SN_id_smime_mod_ets_eSigPolicy_88 "id-smime-mod-ets-eSigPolicy-88" +#define NID_id_smime_mod_ets_eSigPolicy_88 202 +#define OBJ_id_smime_mod_ets_eSigPolicy_88 OBJ_id_smime_mod,7L + +#define SN_id_smime_mod_ets_eSigPolicy_97 "id-smime-mod-ets-eSigPolicy-97" +#define NID_id_smime_mod_ets_eSigPolicy_97 203 +#define OBJ_id_smime_mod_ets_eSigPolicy_97 OBJ_id_smime_mod,8L + +#define SN_id_smime_ct_receipt "id-smime-ct-receipt" +#define NID_id_smime_ct_receipt 204 +#define OBJ_id_smime_ct_receipt OBJ_id_smime_ct,1L + +#define SN_id_smime_ct_authData "id-smime-ct-authData" +#define NID_id_smime_ct_authData 205 +#define OBJ_id_smime_ct_authData OBJ_id_smime_ct,2L + +#define SN_id_smime_ct_publishCert "id-smime-ct-publishCert" +#define NID_id_smime_ct_publishCert 206 +#define OBJ_id_smime_ct_publishCert OBJ_id_smime_ct,3L + +#define SN_id_smime_ct_TSTInfo "id-smime-ct-TSTInfo" +#define NID_id_smime_ct_TSTInfo 207 +#define OBJ_id_smime_ct_TSTInfo OBJ_id_smime_ct,4L + +#define SN_id_smime_ct_TDTInfo "id-smime-ct-TDTInfo" +#define NID_id_smime_ct_TDTInfo 208 +#define OBJ_id_smime_ct_TDTInfo OBJ_id_smime_ct,5L + +#define SN_id_smime_ct_contentInfo "id-smime-ct-contentInfo" +#define NID_id_smime_ct_contentInfo 209 +#define OBJ_id_smime_ct_contentInfo OBJ_id_smime_ct,6L + +#define SN_id_smime_ct_DVCSRequestData "id-smime-ct-DVCSRequestData" +#define NID_id_smime_ct_DVCSRequestData 210 +#define OBJ_id_smime_ct_DVCSRequestData OBJ_id_smime_ct,7L + +#define SN_id_smime_ct_DVCSResponseData "id-smime-ct-DVCSResponseData" +#define NID_id_smime_ct_DVCSResponseData 211 +#define OBJ_id_smime_ct_DVCSResponseData OBJ_id_smime_ct,8L + +#define SN_id_smime_ct_compressedData "id-smime-ct-compressedData" +#define NID_id_smime_ct_compressedData 786 +#define OBJ_id_smime_ct_compressedData OBJ_id_smime_ct,9L + +#define SN_id_smime_ct_contentCollection "id-smime-ct-contentCollection" +#define NID_id_smime_ct_contentCollection 1058 +#define OBJ_id_smime_ct_contentCollection OBJ_id_smime_ct,19L + +#define SN_id_smime_ct_authEnvelopedData "id-smime-ct-authEnvelopedData" +#define NID_id_smime_ct_authEnvelopedData 1059 +#define OBJ_id_smime_ct_authEnvelopedData OBJ_id_smime_ct,23L + +#define SN_id_ct_routeOriginAuthz "id-ct-routeOriginAuthz" +#define NID_id_ct_routeOriginAuthz 1234 +#define OBJ_id_ct_routeOriginAuthz OBJ_id_smime_ct,24L + +#define SN_id_ct_rpkiManifest "id-ct-rpkiManifest" +#define NID_id_ct_rpkiManifest 1235 +#define OBJ_id_ct_rpkiManifest OBJ_id_smime_ct,26L + +#define SN_id_ct_asciiTextWithCRLF "id-ct-asciiTextWithCRLF" +#define NID_id_ct_asciiTextWithCRLF 787 +#define OBJ_id_ct_asciiTextWithCRLF OBJ_id_smime_ct,27L + +#define SN_id_ct_xml "id-ct-xml" +#define NID_id_ct_xml 1060 +#define OBJ_id_ct_xml OBJ_id_smime_ct,28L + +#define SN_id_ct_rpkiGhostbusters "id-ct-rpkiGhostbusters" +#define NID_id_ct_rpkiGhostbusters 1236 +#define OBJ_id_ct_rpkiGhostbusters OBJ_id_smime_ct,35L + +#define SN_id_ct_resourceTaggedAttest "id-ct-resourceTaggedAttest" +#define NID_id_ct_resourceTaggedAttest 1237 +#define OBJ_id_ct_resourceTaggedAttest OBJ_id_smime_ct,36L + +#define SN_id_ct_geofeedCSVwithCRLF "id-ct-geofeedCSVwithCRLF" +#define NID_id_ct_geofeedCSVwithCRLF 1246 +#define OBJ_id_ct_geofeedCSVwithCRLF OBJ_id_smime_ct,47L + +#define SN_id_ct_signedChecklist "id-ct-signedChecklist" +#define NID_id_ct_signedChecklist 1247 +#define OBJ_id_ct_signedChecklist OBJ_id_smime_ct,48L + +#define SN_id_ct_ASPA "id-ct-ASPA" +#define NID_id_ct_ASPA 1250 +#define OBJ_id_ct_ASPA OBJ_id_smime_ct,49L + +#define SN_id_ct_signedTAL "id-ct-signedTAL" +#define NID_id_ct_signedTAL 1284 +#define OBJ_id_ct_signedTAL OBJ_id_smime_ct,50L + +#define SN_id_ct_rpkiSignedPrefixList "id-ct-rpkiSignedPrefixList" +#define NID_id_ct_rpkiSignedPrefixList 1320 +#define OBJ_id_ct_rpkiSignedPrefixList OBJ_id_smime_ct,51L + +#define SN_id_smime_aa_receiptRequest "id-smime-aa-receiptRequest" +#define NID_id_smime_aa_receiptRequest 212 +#define OBJ_id_smime_aa_receiptRequest OBJ_id_smime_aa,1L + +#define SN_id_smime_aa_securityLabel "id-smime-aa-securityLabel" +#define NID_id_smime_aa_securityLabel 213 +#define OBJ_id_smime_aa_securityLabel OBJ_id_smime_aa,2L + +#define SN_id_smime_aa_mlExpandHistory "id-smime-aa-mlExpandHistory" +#define NID_id_smime_aa_mlExpandHistory 214 +#define OBJ_id_smime_aa_mlExpandHistory OBJ_id_smime_aa,3L + +#define SN_id_smime_aa_contentHint "id-smime-aa-contentHint" +#define NID_id_smime_aa_contentHint 215 +#define OBJ_id_smime_aa_contentHint OBJ_id_smime_aa,4L + +#define SN_id_smime_aa_msgSigDigest "id-smime-aa-msgSigDigest" +#define NID_id_smime_aa_msgSigDigest 216 +#define OBJ_id_smime_aa_msgSigDigest OBJ_id_smime_aa,5L + +#define SN_id_smime_aa_encapContentType "id-smime-aa-encapContentType" +#define NID_id_smime_aa_encapContentType 217 +#define OBJ_id_smime_aa_encapContentType OBJ_id_smime_aa,6L + +#define SN_id_smime_aa_contentIdentifier "id-smime-aa-contentIdentifier" +#define NID_id_smime_aa_contentIdentifier 218 +#define OBJ_id_smime_aa_contentIdentifier OBJ_id_smime_aa,7L + +#define SN_id_smime_aa_macValue "id-smime-aa-macValue" +#define NID_id_smime_aa_macValue 219 +#define OBJ_id_smime_aa_macValue OBJ_id_smime_aa,8L + +#define SN_id_smime_aa_equivalentLabels "id-smime-aa-equivalentLabels" +#define NID_id_smime_aa_equivalentLabels 220 +#define OBJ_id_smime_aa_equivalentLabels OBJ_id_smime_aa,9L + +#define SN_id_smime_aa_contentReference "id-smime-aa-contentReference" +#define NID_id_smime_aa_contentReference 221 +#define OBJ_id_smime_aa_contentReference OBJ_id_smime_aa,10L + +#define SN_id_smime_aa_encrypKeyPref "id-smime-aa-encrypKeyPref" +#define NID_id_smime_aa_encrypKeyPref 222 +#define OBJ_id_smime_aa_encrypKeyPref OBJ_id_smime_aa,11L + +#define SN_id_smime_aa_signingCertificate "id-smime-aa-signingCertificate" +#define NID_id_smime_aa_signingCertificate 223 +#define OBJ_id_smime_aa_signingCertificate OBJ_id_smime_aa,12L + +#define SN_id_smime_aa_smimeEncryptCerts "id-smime-aa-smimeEncryptCerts" +#define NID_id_smime_aa_smimeEncryptCerts 224 +#define OBJ_id_smime_aa_smimeEncryptCerts OBJ_id_smime_aa,13L + +#define SN_id_smime_aa_timeStampToken "id-smime-aa-timeStampToken" +#define NID_id_smime_aa_timeStampToken 225 +#define OBJ_id_smime_aa_timeStampToken OBJ_id_smime_aa,14L + +#define SN_id_smime_aa_ets_sigPolicyId "id-smime-aa-ets-sigPolicyId" +#define NID_id_smime_aa_ets_sigPolicyId 226 +#define OBJ_id_smime_aa_ets_sigPolicyId OBJ_id_smime_aa,15L + +#define SN_id_smime_aa_ets_commitmentType "id-smime-aa-ets-commitmentType" +#define NID_id_smime_aa_ets_commitmentType 227 +#define OBJ_id_smime_aa_ets_commitmentType OBJ_id_smime_aa,16L + +#define SN_id_smime_aa_ets_signerLocation "id-smime-aa-ets-signerLocation" +#define NID_id_smime_aa_ets_signerLocation 228 +#define OBJ_id_smime_aa_ets_signerLocation OBJ_id_smime_aa,17L + +#define SN_id_smime_aa_ets_signerAttr "id-smime-aa-ets-signerAttr" +#define NID_id_smime_aa_ets_signerAttr 229 +#define OBJ_id_smime_aa_ets_signerAttr OBJ_id_smime_aa,18L + +#define SN_id_smime_aa_ets_otherSigCert "id-smime-aa-ets-otherSigCert" +#define NID_id_smime_aa_ets_otherSigCert 230 +#define OBJ_id_smime_aa_ets_otherSigCert OBJ_id_smime_aa,19L + +#define SN_id_smime_aa_ets_contentTimestamp "id-smime-aa-ets-contentTimestamp" +#define NID_id_smime_aa_ets_contentTimestamp 231 +#define OBJ_id_smime_aa_ets_contentTimestamp OBJ_id_smime_aa,20L + +#define SN_id_smime_aa_ets_CertificateRefs "id-smime-aa-ets-CertificateRefs" +#define NID_id_smime_aa_ets_CertificateRefs 232 +#define OBJ_id_smime_aa_ets_CertificateRefs OBJ_id_smime_aa,21L + +#define SN_id_smime_aa_ets_RevocationRefs "id-smime-aa-ets-RevocationRefs" +#define NID_id_smime_aa_ets_RevocationRefs 233 +#define OBJ_id_smime_aa_ets_RevocationRefs OBJ_id_smime_aa,22L + +#define SN_id_smime_aa_ets_certValues "id-smime-aa-ets-certValues" +#define NID_id_smime_aa_ets_certValues 234 +#define OBJ_id_smime_aa_ets_certValues OBJ_id_smime_aa,23L + +#define SN_id_smime_aa_ets_revocationValues "id-smime-aa-ets-revocationValues" +#define NID_id_smime_aa_ets_revocationValues 235 +#define OBJ_id_smime_aa_ets_revocationValues OBJ_id_smime_aa,24L + +#define SN_id_smime_aa_ets_escTimeStamp "id-smime-aa-ets-escTimeStamp" +#define NID_id_smime_aa_ets_escTimeStamp 236 +#define OBJ_id_smime_aa_ets_escTimeStamp OBJ_id_smime_aa,25L + +#define SN_id_smime_aa_ets_certCRLTimestamp "id-smime-aa-ets-certCRLTimestamp" +#define NID_id_smime_aa_ets_certCRLTimestamp 237 +#define OBJ_id_smime_aa_ets_certCRLTimestamp OBJ_id_smime_aa,26L + +#define SN_id_smime_aa_ets_archiveTimeStamp "id-smime-aa-ets-archiveTimeStamp" +#define NID_id_smime_aa_ets_archiveTimeStamp 238 +#define OBJ_id_smime_aa_ets_archiveTimeStamp OBJ_id_smime_aa,27L + +#define SN_id_smime_aa_signatureType "id-smime-aa-signatureType" +#define NID_id_smime_aa_signatureType 239 +#define OBJ_id_smime_aa_signatureType OBJ_id_smime_aa,28L + +#define SN_id_smime_aa_dvcs_dvc "id-smime-aa-dvcs-dvc" +#define NID_id_smime_aa_dvcs_dvc 240 +#define OBJ_id_smime_aa_dvcs_dvc OBJ_id_smime_aa,29L + +#define SN_id_aa_ets_attrCertificateRefs "id-aa-ets-attrCertificateRefs" +#define NID_id_aa_ets_attrCertificateRefs 1261 +#define OBJ_id_aa_ets_attrCertificateRefs OBJ_id_smime_aa,44L + +#define SN_id_aa_ets_attrRevocationRefs "id-aa-ets-attrRevocationRefs" +#define NID_id_aa_ets_attrRevocationRefs 1262 +#define OBJ_id_aa_ets_attrRevocationRefs OBJ_id_smime_aa,45L + +#define SN_id_smime_aa_signingCertificateV2 "id-smime-aa-signingCertificateV2" +#define NID_id_smime_aa_signingCertificateV2 1086 +#define OBJ_id_smime_aa_signingCertificateV2 OBJ_id_smime_aa,47L + +#define SN_id_aa_ets_archiveTimestampV2 "id-aa-ets-archiveTimestampV2" +#define NID_id_aa_ets_archiveTimestampV2 1280 +#define OBJ_id_aa_ets_archiveTimestampV2 OBJ_id_smime_aa,48L + +#define SN_id_smime_alg_ESDHwith3DES "id-smime-alg-ESDHwith3DES" +#define NID_id_smime_alg_ESDHwith3DES 241 +#define OBJ_id_smime_alg_ESDHwith3DES OBJ_id_smime_alg,1L + +#define SN_id_smime_alg_ESDHwithRC2 "id-smime-alg-ESDHwithRC2" +#define NID_id_smime_alg_ESDHwithRC2 242 +#define OBJ_id_smime_alg_ESDHwithRC2 OBJ_id_smime_alg,2L + +#define SN_id_smime_alg_3DESwrap "id-smime-alg-3DESwrap" +#define NID_id_smime_alg_3DESwrap 243 +#define OBJ_id_smime_alg_3DESwrap OBJ_id_smime_alg,3L + +#define SN_id_smime_alg_RC2wrap "id-smime-alg-RC2wrap" +#define NID_id_smime_alg_RC2wrap 244 +#define OBJ_id_smime_alg_RC2wrap OBJ_id_smime_alg,4L + +#define SN_id_smime_alg_ESDH "id-smime-alg-ESDH" +#define NID_id_smime_alg_ESDH 245 +#define OBJ_id_smime_alg_ESDH OBJ_id_smime_alg,5L + +#define SN_id_smime_alg_CMS3DESwrap "id-smime-alg-CMS3DESwrap" +#define NID_id_smime_alg_CMS3DESwrap 246 +#define OBJ_id_smime_alg_CMS3DESwrap OBJ_id_smime_alg,6L + +#define SN_id_smime_alg_CMSRC2wrap "id-smime-alg-CMSRC2wrap" +#define NID_id_smime_alg_CMSRC2wrap 247 +#define OBJ_id_smime_alg_CMSRC2wrap OBJ_id_smime_alg,7L + +#define SN_id_alg_PWRI_KEK "id-alg-PWRI-KEK" +#define NID_id_alg_PWRI_KEK 893 +#define OBJ_id_alg_PWRI_KEK OBJ_id_smime_alg,9L + +#define SN_HKDF_SHA256 "id-alg-hkdf-with-sha256" +#define LN_HKDF_SHA256 "HKDF-SHA256" +#define NID_HKDF_SHA256 1496 +#define OBJ_HKDF_SHA256 OBJ_id_smime_alg,28L + +#define SN_HKDF_SHA384 "id-alg-hkdf-with-sha384" +#define LN_HKDF_SHA384 "HKDF-SHA384" +#define NID_HKDF_SHA384 1497 +#define OBJ_HKDF_SHA384 OBJ_id_smime_alg,29L + +#define SN_HKDF_SHA512 "id-alg-hkdf-with-sha512" +#define LN_HKDF_SHA512 "HKDF-SHA512" +#define NID_HKDF_SHA512 1498 +#define OBJ_HKDF_SHA512 OBJ_id_smime_alg,30L + +#define SN_id_smime_cd_ldap "id-smime-cd-ldap" +#define NID_id_smime_cd_ldap 248 +#define OBJ_id_smime_cd_ldap OBJ_id_smime_cd,1L + +#define SN_id_smime_spq_ets_sqt_uri "id-smime-spq-ets-sqt-uri" +#define NID_id_smime_spq_ets_sqt_uri 249 +#define OBJ_id_smime_spq_ets_sqt_uri OBJ_id_smime_spq,1L + +#define SN_id_smime_spq_ets_sqt_unotice "id-smime-spq-ets-sqt-unotice" +#define NID_id_smime_spq_ets_sqt_unotice 250 +#define OBJ_id_smime_spq_ets_sqt_unotice OBJ_id_smime_spq,2L + +#define SN_id_smime_cti_ets_proofOfOrigin "id-smime-cti-ets-proofOfOrigin" +#define NID_id_smime_cti_ets_proofOfOrigin 251 +#define OBJ_id_smime_cti_ets_proofOfOrigin OBJ_id_smime_cti,1L + +#define SN_id_smime_cti_ets_proofOfReceipt "id-smime-cti-ets-proofOfReceipt" +#define NID_id_smime_cti_ets_proofOfReceipt 252 +#define OBJ_id_smime_cti_ets_proofOfReceipt OBJ_id_smime_cti,2L + +#define SN_id_smime_cti_ets_proofOfDelivery "id-smime-cti-ets-proofOfDelivery" +#define NID_id_smime_cti_ets_proofOfDelivery 253 +#define OBJ_id_smime_cti_ets_proofOfDelivery OBJ_id_smime_cti,3L + +#define SN_id_smime_cti_ets_proofOfSender "id-smime-cti-ets-proofOfSender" +#define NID_id_smime_cti_ets_proofOfSender 254 +#define OBJ_id_smime_cti_ets_proofOfSender OBJ_id_smime_cti,4L + +#define SN_id_smime_cti_ets_proofOfApproval "id-smime-cti-ets-proofOfApproval" +#define NID_id_smime_cti_ets_proofOfApproval 255 +#define OBJ_id_smime_cti_ets_proofOfApproval OBJ_id_smime_cti,5L + +#define SN_id_smime_cti_ets_proofOfCreation "id-smime-cti-ets-proofOfCreation" +#define NID_id_smime_cti_ets_proofOfCreation 256 +#define OBJ_id_smime_cti_ets_proofOfCreation OBJ_id_smime_cti,6L + +#define SN_id_smime_ori_kem "id-smime-ori-kem" +#define NID_id_smime_ori_kem 1500 +#define OBJ_id_smime_ori_kem OBJ_id_smime_ori,3L + +#define LN_friendlyName "friendlyName" +#define NID_friendlyName 156 +#define OBJ_friendlyName OBJ_pkcs9,20L + +#define LN_localKeyID "localKeyID" +#define NID_localKeyID 157 +#define OBJ_localKeyID OBJ_pkcs9,21L + +#define OBJ_ms_corp 1L,3L,6L,1L,4L,1L,311L + +#define SN_ms_csp_name "CSPName" +#define LN_ms_csp_name "Microsoft CSP Name" +#define NID_ms_csp_name 417 +#define OBJ_ms_csp_name OBJ_ms_corp,17L,1L + +#define SN_LocalKeySet "LocalKeySet" +#define LN_LocalKeySet "Microsoft Local Key set" +#define NID_LocalKeySet 856 +#define OBJ_LocalKeySet OBJ_ms_corp,17L,2L + +#define OBJ_certTypes OBJ_pkcs9,22L + +#define LN_x509Certificate "x509Certificate" +#define NID_x509Certificate 158 +#define OBJ_x509Certificate OBJ_certTypes,1L + +#define LN_sdsiCertificate "sdsiCertificate" +#define NID_sdsiCertificate 159 +#define OBJ_sdsiCertificate OBJ_certTypes,2L + +#define OBJ_crlTypes OBJ_pkcs9,23L + +#define LN_x509Crl "x509Crl" +#define NID_x509Crl 160 +#define OBJ_x509Crl OBJ_crlTypes,1L + +#define SN_id_aa_CMSAlgorithmProtection "id-aa-CMSAlgorithmProtection" +#define NID_id_aa_CMSAlgorithmProtection 1263 +#define OBJ_id_aa_CMSAlgorithmProtection OBJ_pkcs9,52L + +#define OBJ_pkcs12 OBJ_pkcs,12L + +#define OBJ_pkcs12_pbeids OBJ_pkcs12,1L + +#define SN_pbe_WithSHA1And128BitRC4 "PBE-SHA1-RC4-128" +#define LN_pbe_WithSHA1And128BitRC4 "pbeWithSHA1And128BitRC4" +#define NID_pbe_WithSHA1And128BitRC4 144 +#define OBJ_pbe_WithSHA1And128BitRC4 OBJ_pkcs12_pbeids,1L + +#define SN_pbe_WithSHA1And40BitRC4 "PBE-SHA1-RC4-40" +#define LN_pbe_WithSHA1And40BitRC4 "pbeWithSHA1And40BitRC4" +#define NID_pbe_WithSHA1And40BitRC4 145 +#define OBJ_pbe_WithSHA1And40BitRC4 OBJ_pkcs12_pbeids,2L + +#define SN_pbe_WithSHA1And3_Key_TripleDES_CBC "PBE-SHA1-3DES" +#define LN_pbe_WithSHA1And3_Key_TripleDES_CBC "pbeWithSHA1And3-KeyTripleDES-CBC" +#define NID_pbe_WithSHA1And3_Key_TripleDES_CBC 146 +#define OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC OBJ_pkcs12_pbeids,3L + +#define SN_pbe_WithSHA1And2_Key_TripleDES_CBC "PBE-SHA1-2DES" +#define LN_pbe_WithSHA1And2_Key_TripleDES_CBC "pbeWithSHA1And2-KeyTripleDES-CBC" +#define NID_pbe_WithSHA1And2_Key_TripleDES_CBC 147 +#define OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC OBJ_pkcs12_pbeids,4L + +#define SN_pbe_WithSHA1And128BitRC2_CBC "PBE-SHA1-RC2-128" +#define LN_pbe_WithSHA1And128BitRC2_CBC "pbeWithSHA1And128BitRC2-CBC" +#define NID_pbe_WithSHA1And128BitRC2_CBC 148 +#define OBJ_pbe_WithSHA1And128BitRC2_CBC OBJ_pkcs12_pbeids,5L + +#define SN_pbe_WithSHA1And40BitRC2_CBC "PBE-SHA1-RC2-40" +#define LN_pbe_WithSHA1And40BitRC2_CBC "pbeWithSHA1And40BitRC2-CBC" +#define NID_pbe_WithSHA1And40BitRC2_CBC 149 +#define OBJ_pbe_WithSHA1And40BitRC2_CBC OBJ_pkcs12_pbeids,6L + +#define OBJ_pkcs12_Version1 OBJ_pkcs12,10L + +#define OBJ_pkcs12_BagIds OBJ_pkcs12_Version1,1L + +#define LN_keyBag "keyBag" +#define NID_keyBag 150 +#define OBJ_keyBag OBJ_pkcs12_BagIds,1L + +#define LN_pkcs8ShroudedKeyBag "pkcs8ShroudedKeyBag" +#define NID_pkcs8ShroudedKeyBag 151 +#define OBJ_pkcs8ShroudedKeyBag OBJ_pkcs12_BagIds,2L + +#define LN_certBag "certBag" +#define NID_certBag 152 +#define OBJ_certBag OBJ_pkcs12_BagIds,3L + +#define LN_crlBag "crlBag" +#define NID_crlBag 153 +#define OBJ_crlBag OBJ_pkcs12_BagIds,4L + +#define LN_secretBag "secretBag" +#define NID_secretBag 154 +#define OBJ_secretBag OBJ_pkcs12_BagIds,5L + +#define LN_safeContentsBag "safeContentsBag" +#define NID_safeContentsBag 155 +#define OBJ_safeContentsBag OBJ_pkcs12_BagIds,6L + +#define SN_md2 "MD2" +#define LN_md2 "md2" +#define NID_md2 3 +#define OBJ_md2 OBJ_rsadsi,2L,2L + +#define SN_md4 "MD4" +#define LN_md4 "md4" +#define NID_md4 257 +#define OBJ_md4 OBJ_rsadsi,2L,4L + +#define SN_md5 "MD5" +#define LN_md5 "md5" +#define NID_md5 4 +#define OBJ_md5 OBJ_rsadsi,2L,5L + +#define SN_md5_sha1 "MD5-SHA1" +#define LN_md5_sha1 "md5-sha1" +#define NID_md5_sha1 114 + +#define LN_hmacWithMD5 "hmacWithMD5" +#define NID_hmacWithMD5 797 +#define OBJ_hmacWithMD5 OBJ_rsadsi,2L,6L + +#define LN_hmacWithSHA1 "hmacWithSHA1" +#define NID_hmacWithSHA1 163 +#define OBJ_hmacWithSHA1 OBJ_rsadsi,2L,7L + +#define SN_sm2 "SM2" +#define LN_sm2 "sm2" +#define NID_sm2 1172 +#define OBJ_sm2 OBJ_sm_scheme,301L + +#define SN_sm3 "SM3" +#define LN_sm3 "sm3" +#define NID_sm3 1143 +#define OBJ_sm3 OBJ_sm_scheme,401L + +#define SN_sm3WithRSAEncryption "RSA-SM3" +#define LN_sm3WithRSAEncryption "sm3WithRSAEncryption" +#define NID_sm3WithRSAEncryption 1144 +#define OBJ_sm3WithRSAEncryption OBJ_sm_scheme,504L + +#define SN_SM2_with_SM3 "SM2-SM3" +#define LN_SM2_with_SM3 "SM2-with-SM3" +#define NID_SM2_with_SM3 1204 +#define OBJ_SM2_with_SM3 OBJ_sm_scheme,501L + +#define LN_hmacWithSM3 "hmacWithSM3" +#define NID_hmacWithSM3 1281 +#define OBJ_hmacWithSM3 OBJ_sm3,3L,1L + +#define LN_hmacWithSHA224 "hmacWithSHA224" +#define NID_hmacWithSHA224 798 +#define OBJ_hmacWithSHA224 OBJ_rsadsi,2L,8L + +#define LN_hmacWithSHA256 "hmacWithSHA256" +#define NID_hmacWithSHA256 799 +#define OBJ_hmacWithSHA256 OBJ_rsadsi,2L,9L + +#define LN_hmacWithSHA384 "hmacWithSHA384" +#define NID_hmacWithSHA384 800 +#define OBJ_hmacWithSHA384 OBJ_rsadsi,2L,10L + +#define LN_hmacWithSHA512 "hmacWithSHA512" +#define NID_hmacWithSHA512 801 +#define OBJ_hmacWithSHA512 OBJ_rsadsi,2L,11L + +#define LN_hmacWithSHA512_224 "hmacWithSHA512-224" +#define NID_hmacWithSHA512_224 1193 +#define OBJ_hmacWithSHA512_224 OBJ_rsadsi,2L,12L + +#define LN_hmacWithSHA512_256 "hmacWithSHA512-256" +#define NID_hmacWithSHA512_256 1194 +#define OBJ_hmacWithSHA512_256 OBJ_rsadsi,2L,13L + +#define SN_rc2_cbc "RC2-CBC" +#define LN_rc2_cbc "rc2-cbc" +#define NID_rc2_cbc 37 +#define OBJ_rc2_cbc OBJ_rsadsi,3L,2L + +#define SN_rc2_ecb "RC2-ECB" +#define LN_rc2_ecb "rc2-ecb" +#define NID_rc2_ecb 38 + +#define SN_rc2_cfb64 "RC2-CFB" +#define LN_rc2_cfb64 "rc2-cfb" +#define NID_rc2_cfb64 39 + +#define SN_rc2_ofb64 "RC2-OFB" +#define LN_rc2_ofb64 "rc2-ofb" +#define NID_rc2_ofb64 40 + +#define SN_rc2_40_cbc "RC2-40-CBC" +#define LN_rc2_40_cbc "rc2-40-cbc" +#define NID_rc2_40_cbc 98 + +#define SN_rc2_64_cbc "RC2-64-CBC" +#define LN_rc2_64_cbc "rc2-64-cbc" +#define NID_rc2_64_cbc 166 + +#define SN_rc4 "RC4" +#define LN_rc4 "rc4" +#define NID_rc4 5 +#define OBJ_rc4 OBJ_rsadsi,3L,4L + +#define SN_rc4_40 "RC4-40" +#define LN_rc4_40 "rc4-40" +#define NID_rc4_40 97 + +#define SN_des_ede3_cbc "DES-EDE3-CBC" +#define LN_des_ede3_cbc "des-ede3-cbc" +#define NID_des_ede3_cbc 44 +#define OBJ_des_ede3_cbc OBJ_rsadsi,3L,7L + +#define SN_rc5_cbc "RC5-CBC" +#define LN_rc5_cbc "rc5-cbc" +#define NID_rc5_cbc 120 +#define OBJ_rc5_cbc OBJ_rsadsi,3L,8L + +#define SN_rc5_ecb "RC5-ECB" +#define LN_rc5_ecb "rc5-ecb" +#define NID_rc5_ecb 121 + +#define SN_rc5_cfb64 "RC5-CFB" +#define LN_rc5_cfb64 "rc5-cfb" +#define NID_rc5_cfb64 122 + +#define SN_rc5_ofb64 "RC5-OFB" +#define LN_rc5_ofb64 "rc5-ofb" +#define NID_rc5_ofb64 123 + +#define SN_ms_ext_req "msExtReq" +#define LN_ms_ext_req "Microsoft Extension Request" +#define NID_ms_ext_req 171 +#define OBJ_ms_ext_req OBJ_ms_corp,2L,1L,14L + +#define SN_ms_code_ind "msCodeInd" +#define LN_ms_code_ind "Microsoft Individual Code Signing" +#define NID_ms_code_ind 134 +#define OBJ_ms_code_ind OBJ_ms_corp,2L,1L,21L + +#define SN_ms_code_com "msCodeCom" +#define LN_ms_code_com "Microsoft Commercial Code Signing" +#define NID_ms_code_com 135 +#define OBJ_ms_code_com OBJ_ms_corp,2L,1L,22L + +#define SN_ms_ctl_sign "msCTLSign" +#define LN_ms_ctl_sign "Microsoft Trust List Signing" +#define NID_ms_ctl_sign 136 +#define OBJ_ms_ctl_sign OBJ_ms_corp,10L,3L,1L + +#define SN_ms_sgc "msSGC" +#define LN_ms_sgc "Microsoft Server Gated Crypto" +#define NID_ms_sgc 137 +#define OBJ_ms_sgc OBJ_ms_corp,10L,3L,3L + +#define SN_ms_efs "msEFS" +#define LN_ms_efs "Microsoft Encrypted File System" +#define NID_ms_efs 138 +#define OBJ_ms_efs OBJ_ms_corp,10L,3L,4L + +#define SN_ms_smartcard_login "msSmartcardLogin" +#define LN_ms_smartcard_login "Microsoft Smartcard Login" +#define NID_ms_smartcard_login 648 +#define OBJ_ms_smartcard_login OBJ_ms_corp,20L,2L,2L + +#define SN_ms_upn "msUPN" +#define LN_ms_upn "Microsoft User Principal Name" +#define NID_ms_upn 649 +#define OBJ_ms_upn OBJ_ms_corp,20L,2L,3L + +#define SN_ms_ntds_sec_ext "ms-ntds-sec-ext" +#define LN_ms_ntds_sec_ext "Microsoft NTDS CA Extension" +#define NID_ms_ntds_sec_ext 1292 +#define OBJ_ms_ntds_sec_ext OBJ_ms_corp,25L,2L + +#define SN_ms_ntds_obj_sid "ms-ntds-obj-sid" +#define LN_ms_ntds_obj_sid "Microsoft NTDS AD objectSid" +#define NID_ms_ntds_obj_sid 1291 +#define OBJ_ms_ntds_obj_sid OBJ_ms_corp,25L,2L,1L + +#define SN_ms_cert_templ "ms-cert-templ" +#define LN_ms_cert_templ "Microsoft certificate template" +#define NID_ms_cert_templ 1293 +#define OBJ_ms_cert_templ OBJ_ms_corp,21L,7L + +#define SN_ms_app_policies "ms-app-policies" +#define LN_ms_app_policies "Microsoft Application Policies Extension" +#define NID_ms_app_policies 1294 +#define OBJ_ms_app_policies OBJ_ms_corp,21L,10L + +#define SN_idea_cbc "IDEA-CBC" +#define LN_idea_cbc "idea-cbc" +#define NID_idea_cbc 34 +#define OBJ_idea_cbc 1L,3L,6L,1L,4L,1L,188L,7L,1L,1L,2L + +#define SN_idea_ecb "IDEA-ECB" +#define LN_idea_ecb "idea-ecb" +#define NID_idea_ecb 36 + +#define SN_idea_cfb64 "IDEA-CFB" +#define LN_idea_cfb64 "idea-cfb" +#define NID_idea_cfb64 35 + +#define SN_idea_ofb64 "IDEA-OFB" +#define LN_idea_ofb64 "idea-ofb" +#define NID_idea_ofb64 46 + +#define SN_bf_cbc "BF-CBC" +#define LN_bf_cbc "bf-cbc" +#define NID_bf_cbc 91 +#define OBJ_bf_cbc 1L,3L,6L,1L,4L,1L,3029L,1L,2L + +#define SN_bf_ecb "BF-ECB" +#define LN_bf_ecb "bf-ecb" +#define NID_bf_ecb 92 + +#define SN_bf_cfb64 "BF-CFB" +#define LN_bf_cfb64 "bf-cfb" +#define NID_bf_cfb64 93 + +#define SN_bf_ofb64 "BF-OFB" +#define LN_bf_ofb64 "bf-ofb" +#define NID_bf_ofb64 94 + +#define SN_id_pkix "PKIX" +#define NID_id_pkix 127 +#define OBJ_id_pkix 1L,3L,6L,1L,5L,5L,7L + +#define SN_id_pkix_mod "id-pkix-mod" +#define NID_id_pkix_mod 258 +#define OBJ_id_pkix_mod OBJ_id_pkix,0L + +#define SN_id_pe "id-pe" +#define NID_id_pe 175 +#define OBJ_id_pe OBJ_id_pkix,1L + +#define SN_id_qt "id-qt" +#define NID_id_qt 259 +#define OBJ_id_qt OBJ_id_pkix,2L + +#define SN_id_kp "id-kp" +#define NID_id_kp 128 +#define OBJ_id_kp OBJ_id_pkix,3L + +#define SN_id_it "id-it" +#define NID_id_it 260 +#define OBJ_id_it OBJ_id_pkix,4L + +#define SN_id_pkip "id-pkip" +#define NID_id_pkip 261 +#define OBJ_id_pkip OBJ_id_pkix,5L + +#define SN_id_alg "id-alg" +#define NID_id_alg 262 +#define OBJ_id_alg OBJ_id_pkix,6L + +#define SN_id_cmc "id-cmc" +#define NID_id_cmc 263 +#define OBJ_id_cmc OBJ_id_pkix,7L + +#define SN_id_on "id-on" +#define NID_id_on 264 +#define OBJ_id_on OBJ_id_pkix,8L + +#define SN_id_pda "id-pda" +#define NID_id_pda 265 +#define OBJ_id_pda OBJ_id_pkix,9L + +#define SN_id_aca "id-aca" +#define NID_id_aca 266 +#define OBJ_id_aca OBJ_id_pkix,10L + +#define SN_id_qcs "id-qcs" +#define NID_id_qcs 267 +#define OBJ_id_qcs OBJ_id_pkix,11L + +#define SN_id_cp "id-cp" +#define NID_id_cp 1238 +#define OBJ_id_cp OBJ_id_pkix,14L + +#define SN_id_cct "id-cct" +#define NID_id_cct 268 +#define OBJ_id_cct OBJ_id_pkix,12L + +#define SN_id_ppl "id-ppl" +#define NID_id_ppl 662 +#define OBJ_id_ppl OBJ_id_pkix,21L + +#define SN_id_ad "id-ad" +#define NID_id_ad 176 +#define OBJ_id_ad OBJ_id_pkix,48L + +#define SN_id_pkix1_explicit_88 "id-pkix1-explicit-88" +#define NID_id_pkix1_explicit_88 269 +#define OBJ_id_pkix1_explicit_88 OBJ_id_pkix_mod,1L + +#define SN_id_pkix1_implicit_88 "id-pkix1-implicit-88" +#define NID_id_pkix1_implicit_88 270 +#define OBJ_id_pkix1_implicit_88 OBJ_id_pkix_mod,2L + +#define SN_id_pkix1_explicit_93 "id-pkix1-explicit-93" +#define NID_id_pkix1_explicit_93 271 +#define OBJ_id_pkix1_explicit_93 OBJ_id_pkix_mod,3L + +#define SN_id_pkix1_implicit_93 "id-pkix1-implicit-93" +#define NID_id_pkix1_implicit_93 272 +#define OBJ_id_pkix1_implicit_93 OBJ_id_pkix_mod,4L + +#define SN_id_mod_crmf "id-mod-crmf" +#define NID_id_mod_crmf 273 +#define OBJ_id_mod_crmf OBJ_id_pkix_mod,5L + +#define SN_id_mod_cmc "id-mod-cmc" +#define NID_id_mod_cmc 274 +#define OBJ_id_mod_cmc OBJ_id_pkix_mod,6L + +#define SN_id_mod_kea_profile_88 "id-mod-kea-profile-88" +#define NID_id_mod_kea_profile_88 275 +#define OBJ_id_mod_kea_profile_88 OBJ_id_pkix_mod,7L + +#define SN_id_mod_kea_profile_93 "id-mod-kea-profile-93" +#define NID_id_mod_kea_profile_93 276 +#define OBJ_id_mod_kea_profile_93 OBJ_id_pkix_mod,8L + +#define SN_id_mod_cmp "id-mod-cmp" +#define NID_id_mod_cmp 277 +#define OBJ_id_mod_cmp OBJ_id_pkix_mod,9L + +#define SN_id_mod_qualified_cert_88 "id-mod-qualified-cert-88" +#define NID_id_mod_qualified_cert_88 278 +#define OBJ_id_mod_qualified_cert_88 OBJ_id_pkix_mod,10L + +#define SN_id_mod_qualified_cert_93 "id-mod-qualified-cert-93" +#define NID_id_mod_qualified_cert_93 279 +#define OBJ_id_mod_qualified_cert_93 OBJ_id_pkix_mod,11L + +#define SN_id_mod_attribute_cert "id-mod-attribute-cert" +#define NID_id_mod_attribute_cert 280 +#define OBJ_id_mod_attribute_cert OBJ_id_pkix_mod,12L + +#define SN_id_mod_timestamp_protocol "id-mod-timestamp-protocol" +#define NID_id_mod_timestamp_protocol 281 +#define OBJ_id_mod_timestamp_protocol OBJ_id_pkix_mod,13L + +#define SN_id_mod_ocsp "id-mod-ocsp" +#define NID_id_mod_ocsp 282 +#define OBJ_id_mod_ocsp OBJ_id_pkix_mod,14L + +#define SN_id_mod_dvcs "id-mod-dvcs" +#define NID_id_mod_dvcs 283 +#define OBJ_id_mod_dvcs OBJ_id_pkix_mod,15L + +#define SN_id_mod_cmp2000 "id-mod-cmp2000" +#define NID_id_mod_cmp2000 284 +#define OBJ_id_mod_cmp2000 OBJ_id_pkix_mod,16L + +#define SN_id_mod_cmp2000_02 "id-mod-cmp2000-02" +#define NID_id_mod_cmp2000_02 1251 +#define OBJ_id_mod_cmp2000_02 OBJ_id_pkix_mod,50L + +#define SN_id_mod_cmp2021_88 "id-mod-cmp2021-88" +#define NID_id_mod_cmp2021_88 1252 +#define OBJ_id_mod_cmp2021_88 OBJ_id_pkix_mod,99L + +#define SN_id_mod_cmp2021_02 "id-mod-cmp2021-02" +#define NID_id_mod_cmp2021_02 1253 +#define OBJ_id_mod_cmp2021_02 OBJ_id_pkix_mod,100L + +#define SN_info_access "authorityInfoAccess" +#define LN_info_access "Authority Information Access" +#define NID_info_access 177 +#define OBJ_info_access OBJ_id_pe,1L + +#define SN_biometricInfo "biometricInfo" +#define LN_biometricInfo "Biometric Info" +#define NID_biometricInfo 285 +#define OBJ_biometricInfo OBJ_id_pe,2L + +#define SN_qcStatements "qcStatements" +#define NID_qcStatements 286 +#define OBJ_qcStatements OBJ_id_pe,3L + +#define SN_ac_auditIdentity "ac-auditIdentity" +#define LN_ac_auditIdentity "X509v3 Audit Identity" +#define NID_ac_auditIdentity 287 +#define OBJ_ac_auditIdentity OBJ_id_pe,4L + +#define NID_ac_auditEntity 1323 +#define OBJ_ac_auditEntity OBJ_ac_auditIdentity + +#define SN_ac_targeting "ac-targeting" +#define NID_ac_targeting 288 +#define OBJ_ac_targeting OBJ_id_pe,5L + +#define SN_aaControls "aaControls" +#define NID_aaControls 289 +#define OBJ_aaControls OBJ_id_pe,6L + +#define SN_sbgp_ipAddrBlock "sbgp-ipAddrBlock" +#define NID_sbgp_ipAddrBlock 290 +#define OBJ_sbgp_ipAddrBlock OBJ_id_pe,7L + +#define SN_sbgp_autonomousSysNum "sbgp-autonomousSysNum" +#define NID_sbgp_autonomousSysNum 291 +#define OBJ_sbgp_autonomousSysNum OBJ_id_pe,8L + +#define SN_sbgp_routerIdentifier "sbgp-routerIdentifier" +#define NID_sbgp_routerIdentifier 292 +#define OBJ_sbgp_routerIdentifier OBJ_id_pe,9L + +#define SN_ac_proxying "ac-proxying" +#define NID_ac_proxying 397 +#define OBJ_ac_proxying OBJ_id_pe,10L + +#define SN_sinfo_access "subjectInfoAccess" +#define LN_sinfo_access "Subject Information Access" +#define NID_sinfo_access 398 +#define OBJ_sinfo_access OBJ_id_pe,11L + +#define SN_proxyCertInfo "proxyCertInfo" +#define LN_proxyCertInfo "Proxy Certificate Information" +#define NID_proxyCertInfo 663 +#define OBJ_proxyCertInfo OBJ_id_pe,14L + +#define SN_tlsfeature "tlsfeature" +#define LN_tlsfeature "TLS Feature" +#define NID_tlsfeature 1020 +#define OBJ_tlsfeature OBJ_id_pe,24L + +#define SN_sbgp_ipAddrBlockv2 "sbgp-ipAddrBlockv2" +#define NID_sbgp_ipAddrBlockv2 1239 +#define OBJ_sbgp_ipAddrBlockv2 OBJ_id_pe,28L + +#define SN_sbgp_autonomousSysNumv2 "sbgp-autonomousSysNumv2" +#define NID_sbgp_autonomousSysNumv2 1240 +#define OBJ_sbgp_autonomousSysNumv2 OBJ_id_pe,29L + +#define SN_id_qt_cps "id-qt-cps" +#define LN_id_qt_cps "Policy Qualifier CPS" +#define NID_id_qt_cps 164 +#define OBJ_id_qt_cps OBJ_id_qt,1L + +#define SN_id_qt_unotice "id-qt-unotice" +#define LN_id_qt_unotice "Policy Qualifier User Notice" +#define NID_id_qt_unotice 165 +#define OBJ_id_qt_unotice OBJ_id_qt,2L + +#define SN_textNotice "textNotice" +#define NID_textNotice 293 +#define OBJ_textNotice OBJ_id_qt,3L + +#define SN_server_auth "serverAuth" +#define LN_server_auth "TLS Web Server Authentication" +#define NID_server_auth 129 +#define OBJ_server_auth OBJ_id_kp,1L + +#define SN_client_auth "clientAuth" +#define LN_client_auth "TLS Web Client Authentication" +#define NID_client_auth 130 +#define OBJ_client_auth OBJ_id_kp,2L + +#define SN_code_sign "codeSigning" +#define LN_code_sign "Code Signing" +#define NID_code_sign 131 +#define OBJ_code_sign OBJ_id_kp,3L + +#define SN_email_protect "emailProtection" +#define LN_email_protect "E-mail Protection" +#define NID_email_protect 132 +#define OBJ_email_protect OBJ_id_kp,4L + +#define SN_ipsecEndSystem "ipsecEndSystem" +#define LN_ipsecEndSystem "IPSec End System" +#define NID_ipsecEndSystem 294 +#define OBJ_ipsecEndSystem OBJ_id_kp,5L + +#define SN_ipsecTunnel "ipsecTunnel" +#define LN_ipsecTunnel "IPSec Tunnel" +#define NID_ipsecTunnel 295 +#define OBJ_ipsecTunnel OBJ_id_kp,6L + +#define SN_ipsecUser "ipsecUser" +#define LN_ipsecUser "IPSec User" +#define NID_ipsecUser 296 +#define OBJ_ipsecUser OBJ_id_kp,7L + +#define SN_time_stamp "timeStamping" +#define LN_time_stamp "Time Stamping" +#define NID_time_stamp 133 +#define OBJ_time_stamp OBJ_id_kp,8L + +#define SN_OCSP_sign "OCSPSigning" +#define LN_OCSP_sign "OCSP Signing" +#define NID_OCSP_sign 180 +#define OBJ_OCSP_sign OBJ_id_kp,9L + +#define SN_dvcs "DVCS" +#define LN_dvcs "dvcs" +#define NID_dvcs 297 +#define OBJ_dvcs OBJ_id_kp,10L + +#define SN_ipsec_IKE "ipsecIKE" +#define LN_ipsec_IKE "ipsec Internet Key Exchange" +#define NID_ipsec_IKE 1022 +#define OBJ_ipsec_IKE OBJ_id_kp,17L + +#define SN_capwapAC "capwapAC" +#define LN_capwapAC "Ctrl/provision WAP Access" +#define NID_capwapAC 1023 +#define OBJ_capwapAC OBJ_id_kp,18L + +#define SN_capwapWTP "capwapWTP" +#define LN_capwapWTP "Ctrl/Provision WAP Termination" +#define NID_capwapWTP 1024 +#define OBJ_capwapWTP OBJ_id_kp,19L + +#define SN_sshClient "secureShellClient" +#define LN_sshClient "SSH Client" +#define NID_sshClient 1025 +#define OBJ_sshClient OBJ_id_kp,21L + +#define SN_sshServer "secureShellServer" +#define LN_sshServer "SSH Server" +#define NID_sshServer 1026 +#define OBJ_sshServer OBJ_id_kp,22L + +#define SN_sendRouter "sendRouter" +#define LN_sendRouter "Send Router" +#define NID_sendRouter 1027 +#define OBJ_sendRouter OBJ_id_kp,23L + +#define SN_sendProxiedRouter "sendProxiedRouter" +#define LN_sendProxiedRouter "Send Proxied Router" +#define NID_sendProxiedRouter 1028 +#define OBJ_sendProxiedRouter OBJ_id_kp,24L + +#define SN_sendOwner "sendOwner" +#define LN_sendOwner "Send Owner" +#define NID_sendOwner 1029 +#define OBJ_sendOwner OBJ_id_kp,25L + +#define SN_sendProxiedOwner "sendProxiedOwner" +#define LN_sendProxiedOwner "Send Proxied Owner" +#define NID_sendProxiedOwner 1030 +#define OBJ_sendProxiedOwner OBJ_id_kp,26L + +#define SN_cmcCA "cmcCA" +#define LN_cmcCA "CMC Certificate Authority" +#define NID_cmcCA 1131 +#define OBJ_cmcCA OBJ_id_kp,27L + +#define SN_cmcRA "cmcRA" +#define LN_cmcRA "CMC Registration Authority" +#define NID_cmcRA 1132 +#define OBJ_cmcRA OBJ_id_kp,28L + +#define SN_cmcArchive "cmcArchive" +#define LN_cmcArchive "CMC Archive Server" +#define NID_cmcArchive 1219 +#define OBJ_cmcArchive OBJ_id_kp,29L + +#define SN_id_kp_bgpsec_router "id-kp-bgpsec-router" +#define LN_id_kp_bgpsec_router "BGPsec Router" +#define NID_id_kp_bgpsec_router 1220 +#define OBJ_id_kp_bgpsec_router OBJ_id_kp,30L + +#define SN_id_kp_BrandIndicatorforMessageIdentification "id-kp-BrandIndicatorforMessageIdentification" +#define LN_id_kp_BrandIndicatorforMessageIdentification "Brand Indicator for Message Identification" +#define NID_id_kp_BrandIndicatorforMessageIdentification 1221 +#define OBJ_id_kp_BrandIndicatorforMessageIdentification OBJ_id_kp,31L + +#define SN_cmKGA "cmKGA" +#define LN_cmKGA "Certificate Management Key Generation Authority" +#define NID_cmKGA 1222 +#define OBJ_cmKGA OBJ_id_kp,32L + +#define SN_id_it_caProtEncCert "id-it-caProtEncCert" +#define NID_id_it_caProtEncCert 298 +#define OBJ_id_it_caProtEncCert OBJ_id_it,1L + +#define SN_id_it_signKeyPairTypes "id-it-signKeyPairTypes" +#define NID_id_it_signKeyPairTypes 299 +#define OBJ_id_it_signKeyPairTypes OBJ_id_it,2L + +#define SN_id_it_encKeyPairTypes "id-it-encKeyPairTypes" +#define NID_id_it_encKeyPairTypes 300 +#define OBJ_id_it_encKeyPairTypes OBJ_id_it,3L + +#define SN_id_it_preferredSymmAlg "id-it-preferredSymmAlg" +#define NID_id_it_preferredSymmAlg 301 +#define OBJ_id_it_preferredSymmAlg OBJ_id_it,4L + +#define SN_id_it_caKeyUpdateInfo "id-it-caKeyUpdateInfo" +#define NID_id_it_caKeyUpdateInfo 302 +#define OBJ_id_it_caKeyUpdateInfo OBJ_id_it,5L + +#define SN_id_it_currentCRL "id-it-currentCRL" +#define NID_id_it_currentCRL 303 +#define OBJ_id_it_currentCRL OBJ_id_it,6L + +#define SN_id_it_unsupportedOIDs "id-it-unsupportedOIDs" +#define NID_id_it_unsupportedOIDs 304 +#define OBJ_id_it_unsupportedOIDs OBJ_id_it,7L + +#define SN_id_it_subscriptionRequest "id-it-subscriptionRequest" +#define NID_id_it_subscriptionRequest 305 +#define OBJ_id_it_subscriptionRequest OBJ_id_it,8L + +#define SN_id_it_subscriptionResponse "id-it-subscriptionResponse" +#define NID_id_it_subscriptionResponse 306 +#define OBJ_id_it_subscriptionResponse OBJ_id_it,9L + +#define SN_id_it_keyPairParamReq "id-it-keyPairParamReq" +#define NID_id_it_keyPairParamReq 307 +#define OBJ_id_it_keyPairParamReq OBJ_id_it,10L + +#define SN_id_it_keyPairParamRep "id-it-keyPairParamRep" +#define NID_id_it_keyPairParamRep 308 +#define OBJ_id_it_keyPairParamRep OBJ_id_it,11L + +#define SN_id_it_revPassphrase "id-it-revPassphrase" +#define NID_id_it_revPassphrase 309 +#define OBJ_id_it_revPassphrase OBJ_id_it,12L + +#define SN_id_it_implicitConfirm "id-it-implicitConfirm" +#define NID_id_it_implicitConfirm 310 +#define OBJ_id_it_implicitConfirm OBJ_id_it,13L + +#define SN_id_it_confirmWaitTime "id-it-confirmWaitTime" +#define NID_id_it_confirmWaitTime 311 +#define OBJ_id_it_confirmWaitTime OBJ_id_it,14L + +#define SN_id_it_origPKIMessage "id-it-origPKIMessage" +#define NID_id_it_origPKIMessage 312 +#define OBJ_id_it_origPKIMessage OBJ_id_it,15L + +#define SN_id_it_suppLangTags "id-it-suppLangTags" +#define NID_id_it_suppLangTags 784 +#define OBJ_id_it_suppLangTags OBJ_id_it,16L + +#define SN_id_it_caCerts "id-it-caCerts" +#define NID_id_it_caCerts 1223 +#define OBJ_id_it_caCerts OBJ_id_it,17L + +#define SN_id_it_rootCaKeyUpdate "id-it-rootCaKeyUpdate" +#define NID_id_it_rootCaKeyUpdate 1224 +#define OBJ_id_it_rootCaKeyUpdate OBJ_id_it,18L + +#define SN_id_it_certReqTemplate "id-it-certReqTemplate" +#define NID_id_it_certReqTemplate 1225 +#define OBJ_id_it_certReqTemplate OBJ_id_it,19L + +#define SN_id_it_rootCaCert "id-it-rootCaCert" +#define NID_id_it_rootCaCert 1254 +#define OBJ_id_it_rootCaCert OBJ_id_it,20L + +#define SN_id_it_certProfile "id-it-certProfile" +#define NID_id_it_certProfile 1255 +#define OBJ_id_it_certProfile OBJ_id_it,21L + +#define SN_id_it_crlStatusList "id-it-crlStatusList" +#define NID_id_it_crlStatusList 1256 +#define OBJ_id_it_crlStatusList OBJ_id_it,22L + +#define SN_id_it_crls "id-it-crls" +#define NID_id_it_crls 1257 +#define OBJ_id_it_crls OBJ_id_it,23L + +#define SN_id_regCtrl "id-regCtrl" +#define NID_id_regCtrl 313 +#define OBJ_id_regCtrl OBJ_id_pkip,1L + +#define SN_id_regInfo "id-regInfo" +#define NID_id_regInfo 314 +#define OBJ_id_regInfo OBJ_id_pkip,2L + +#define SN_id_regCtrl_regToken "id-regCtrl-regToken" +#define NID_id_regCtrl_regToken 315 +#define OBJ_id_regCtrl_regToken OBJ_id_regCtrl,1L + +#define SN_id_regCtrl_authenticator "id-regCtrl-authenticator" +#define NID_id_regCtrl_authenticator 316 +#define OBJ_id_regCtrl_authenticator OBJ_id_regCtrl,2L + +#define SN_id_regCtrl_pkiPublicationInfo "id-regCtrl-pkiPublicationInfo" +#define NID_id_regCtrl_pkiPublicationInfo 317 +#define OBJ_id_regCtrl_pkiPublicationInfo OBJ_id_regCtrl,3L + +#define SN_id_regCtrl_pkiArchiveOptions "id-regCtrl-pkiArchiveOptions" +#define NID_id_regCtrl_pkiArchiveOptions 318 +#define OBJ_id_regCtrl_pkiArchiveOptions OBJ_id_regCtrl,4L + +#define SN_id_regCtrl_oldCertID "id-regCtrl-oldCertID" +#define NID_id_regCtrl_oldCertID 319 +#define OBJ_id_regCtrl_oldCertID OBJ_id_regCtrl,5L + +#define SN_id_regCtrl_protocolEncrKey "id-regCtrl-protocolEncrKey" +#define NID_id_regCtrl_protocolEncrKey 320 +#define OBJ_id_regCtrl_protocolEncrKey OBJ_id_regCtrl,6L + +#define SN_id_regCtrl_altCertTemplate "id-regCtrl-altCertTemplate" +#define NID_id_regCtrl_altCertTemplate 1258 +#define OBJ_id_regCtrl_altCertTemplate OBJ_id_regCtrl,7L + +#define SN_id_regCtrl_algId "id-regCtrl-algId" +#define NID_id_regCtrl_algId 1259 +#define OBJ_id_regCtrl_algId OBJ_id_regCtrl,11L + +#define SN_id_regCtrl_rsaKeyLen "id-regCtrl-rsaKeyLen" +#define NID_id_regCtrl_rsaKeyLen 1260 +#define OBJ_id_regCtrl_rsaKeyLen OBJ_id_regCtrl,12L + +#define SN_id_regInfo_utf8Pairs "id-regInfo-utf8Pairs" +#define NID_id_regInfo_utf8Pairs 321 +#define OBJ_id_regInfo_utf8Pairs OBJ_id_regInfo,1L + +#define SN_id_regInfo_certReq "id-regInfo-certReq" +#define NID_id_regInfo_certReq 322 +#define OBJ_id_regInfo_certReq OBJ_id_regInfo,2L + +#define SN_id_alg_des40 "id-alg-des40" +#define NID_id_alg_des40 323 +#define OBJ_id_alg_des40 OBJ_id_alg,1L + +#define SN_id_alg_noSignature "id-alg-noSignature" +#define NID_id_alg_noSignature 324 +#define OBJ_id_alg_noSignature OBJ_id_alg,2L + +#define SN_id_alg_dh_sig_hmac_sha1 "id-alg-dh-sig-hmac-sha1" +#define NID_id_alg_dh_sig_hmac_sha1 325 +#define OBJ_id_alg_dh_sig_hmac_sha1 OBJ_id_alg,3L + +#define SN_id_alg_dh_pop "id-alg-dh-pop" +#define NID_id_alg_dh_pop 326 +#define OBJ_id_alg_dh_pop OBJ_id_alg,4L + +#define SN_id_cmc_statusInfo "id-cmc-statusInfo" +#define NID_id_cmc_statusInfo 327 +#define OBJ_id_cmc_statusInfo OBJ_id_cmc,1L + +#define SN_id_cmc_identification "id-cmc-identification" +#define NID_id_cmc_identification 328 +#define OBJ_id_cmc_identification OBJ_id_cmc,2L + +#define SN_id_cmc_identityProof "id-cmc-identityProof" +#define NID_id_cmc_identityProof 329 +#define OBJ_id_cmc_identityProof OBJ_id_cmc,3L + +#define SN_id_cmc_dataReturn "id-cmc-dataReturn" +#define NID_id_cmc_dataReturn 330 +#define OBJ_id_cmc_dataReturn OBJ_id_cmc,4L + +#define SN_id_cmc_transactionId "id-cmc-transactionId" +#define NID_id_cmc_transactionId 331 +#define OBJ_id_cmc_transactionId OBJ_id_cmc,5L + +#define SN_id_cmc_senderNonce "id-cmc-senderNonce" +#define NID_id_cmc_senderNonce 332 +#define OBJ_id_cmc_senderNonce OBJ_id_cmc,6L + +#define SN_id_cmc_recipientNonce "id-cmc-recipientNonce" +#define NID_id_cmc_recipientNonce 333 +#define OBJ_id_cmc_recipientNonce OBJ_id_cmc,7L + +#define SN_id_cmc_addExtensions "id-cmc-addExtensions" +#define NID_id_cmc_addExtensions 334 +#define OBJ_id_cmc_addExtensions OBJ_id_cmc,8L + +#define SN_id_cmc_encryptedPOP "id-cmc-encryptedPOP" +#define NID_id_cmc_encryptedPOP 335 +#define OBJ_id_cmc_encryptedPOP OBJ_id_cmc,9L + +#define SN_id_cmc_decryptedPOP "id-cmc-decryptedPOP" +#define NID_id_cmc_decryptedPOP 336 +#define OBJ_id_cmc_decryptedPOP OBJ_id_cmc,10L + +#define SN_id_cmc_lraPOPWitness "id-cmc-lraPOPWitness" +#define NID_id_cmc_lraPOPWitness 337 +#define OBJ_id_cmc_lraPOPWitness OBJ_id_cmc,11L + +#define SN_id_cmc_getCert "id-cmc-getCert" +#define NID_id_cmc_getCert 338 +#define OBJ_id_cmc_getCert OBJ_id_cmc,15L + +#define SN_id_cmc_getCRL "id-cmc-getCRL" +#define NID_id_cmc_getCRL 339 +#define OBJ_id_cmc_getCRL OBJ_id_cmc,16L + +#define SN_id_cmc_revokeRequest "id-cmc-revokeRequest" +#define NID_id_cmc_revokeRequest 340 +#define OBJ_id_cmc_revokeRequest OBJ_id_cmc,17L + +#define SN_id_cmc_regInfo "id-cmc-regInfo" +#define NID_id_cmc_regInfo 341 +#define OBJ_id_cmc_regInfo OBJ_id_cmc,18L + +#define SN_id_cmc_responseInfo "id-cmc-responseInfo" +#define NID_id_cmc_responseInfo 342 +#define OBJ_id_cmc_responseInfo OBJ_id_cmc,19L + +#define SN_id_cmc_queryPending "id-cmc-queryPending" +#define NID_id_cmc_queryPending 343 +#define OBJ_id_cmc_queryPending OBJ_id_cmc,21L + +#define SN_id_cmc_popLinkRandom "id-cmc-popLinkRandom" +#define NID_id_cmc_popLinkRandom 344 +#define OBJ_id_cmc_popLinkRandom OBJ_id_cmc,22L + +#define SN_id_cmc_popLinkWitness "id-cmc-popLinkWitness" +#define NID_id_cmc_popLinkWitness 345 +#define OBJ_id_cmc_popLinkWitness OBJ_id_cmc,23L + +#define SN_id_cmc_confirmCertAcceptance "id-cmc-confirmCertAcceptance" +#define NID_id_cmc_confirmCertAcceptance 346 +#define OBJ_id_cmc_confirmCertAcceptance OBJ_id_cmc,24L + +#define SN_id_on_personalData "id-on-personalData" +#define NID_id_on_personalData 347 +#define OBJ_id_on_personalData OBJ_id_on,1L + +#define SN_id_on_permanentIdentifier "id-on-permanentIdentifier" +#define LN_id_on_permanentIdentifier "Permanent Identifier" +#define NID_id_on_permanentIdentifier 858 +#define OBJ_id_on_permanentIdentifier OBJ_id_on,3L + +#define SN_id_on_hardwareModuleName "id-on-hardwareModuleName" +#define LN_id_on_hardwareModuleName "Hardware Module Name" +#define NID_id_on_hardwareModuleName 1321 +#define OBJ_id_on_hardwareModuleName OBJ_id_on,4L + +#define SN_XmppAddr "id-on-xmppAddr" +#define LN_XmppAddr "XmppAddr" +#define NID_XmppAddr 1209 +#define OBJ_XmppAddr OBJ_id_on,5L + +#define SN_SRVName "id-on-dnsSRV" +#define LN_SRVName "SRVName" +#define NID_SRVName 1210 +#define OBJ_SRVName OBJ_id_on,7L + +#define SN_NAIRealm "id-on-NAIRealm" +#define LN_NAIRealm "NAIRealm" +#define NID_NAIRealm 1211 +#define OBJ_NAIRealm OBJ_id_on,8L + +#define SN_id_on_SmtpUTF8Mailbox "id-on-SmtpUTF8Mailbox" +#define LN_id_on_SmtpUTF8Mailbox "Smtp UTF8 Mailbox" +#define NID_id_on_SmtpUTF8Mailbox 1208 +#define OBJ_id_on_SmtpUTF8Mailbox OBJ_id_on,9L + +#define SN_id_pda_dateOfBirth "id-pda-dateOfBirth" +#define NID_id_pda_dateOfBirth 348 +#define OBJ_id_pda_dateOfBirth OBJ_id_pda,1L + +#define SN_id_pda_placeOfBirth "id-pda-placeOfBirth" +#define NID_id_pda_placeOfBirth 349 +#define OBJ_id_pda_placeOfBirth OBJ_id_pda,2L + +#define SN_id_pda_gender "id-pda-gender" +#define NID_id_pda_gender 351 +#define OBJ_id_pda_gender OBJ_id_pda,3L + +#define SN_id_pda_countryOfCitizenship "id-pda-countryOfCitizenship" +#define NID_id_pda_countryOfCitizenship 352 +#define OBJ_id_pda_countryOfCitizenship OBJ_id_pda,4L + +#define SN_id_pda_countryOfResidence "id-pda-countryOfResidence" +#define NID_id_pda_countryOfResidence 353 +#define OBJ_id_pda_countryOfResidence OBJ_id_pda,5L + +#define SN_id_aca_authenticationInfo "id-aca-authenticationInfo" +#define NID_id_aca_authenticationInfo 354 +#define OBJ_id_aca_authenticationInfo OBJ_id_aca,1L + +#define SN_id_aca_accessIdentity "id-aca-accessIdentity" +#define NID_id_aca_accessIdentity 355 +#define OBJ_id_aca_accessIdentity OBJ_id_aca,2L + +#define SN_id_aca_chargingIdentity "id-aca-chargingIdentity" +#define NID_id_aca_chargingIdentity 356 +#define OBJ_id_aca_chargingIdentity OBJ_id_aca,3L + +#define SN_id_aca_group "id-aca-group" +#define NID_id_aca_group 357 +#define OBJ_id_aca_group OBJ_id_aca,4L + +#define SN_id_aca_role "id-aca-role" +#define NID_id_aca_role 358 +#define OBJ_id_aca_role OBJ_id_aca,5L + +#define SN_id_aca_encAttrs "id-aca-encAttrs" +#define NID_id_aca_encAttrs 399 +#define OBJ_id_aca_encAttrs OBJ_id_aca,6L + +#define SN_id_qcs_pkixQCSyntax_v1 "id-qcs-pkixQCSyntax-v1" +#define NID_id_qcs_pkixQCSyntax_v1 359 +#define OBJ_id_qcs_pkixQCSyntax_v1 OBJ_id_qcs,1L + +#define SN_ipAddr_asNumber "ipAddr-asNumber" +#define NID_ipAddr_asNumber 1241 +#define OBJ_ipAddr_asNumber OBJ_id_cp,2L + +#define SN_ipAddr_asNumberv2 "ipAddr-asNumberv2" +#define NID_ipAddr_asNumberv2 1242 +#define OBJ_ipAddr_asNumberv2 OBJ_id_cp,3L + +#define SN_id_cct_crs "id-cct-crs" +#define NID_id_cct_crs 360 +#define OBJ_id_cct_crs OBJ_id_cct,1L + +#define SN_id_cct_PKIData "id-cct-PKIData" +#define NID_id_cct_PKIData 361 +#define OBJ_id_cct_PKIData OBJ_id_cct,2L + +#define SN_id_cct_PKIResponse "id-cct-PKIResponse" +#define NID_id_cct_PKIResponse 362 +#define OBJ_id_cct_PKIResponse OBJ_id_cct,3L + +#define SN_id_ppl_anyLanguage "id-ppl-anyLanguage" +#define LN_id_ppl_anyLanguage "Any language" +#define NID_id_ppl_anyLanguage 664 +#define OBJ_id_ppl_anyLanguage OBJ_id_ppl,0L + +#define SN_id_ppl_inheritAll "id-ppl-inheritAll" +#define LN_id_ppl_inheritAll "Inherit all" +#define NID_id_ppl_inheritAll 665 +#define OBJ_id_ppl_inheritAll OBJ_id_ppl,1L + +#define SN_Independent "id-ppl-independent" +#define LN_Independent "Independent" +#define NID_Independent 667 +#define OBJ_Independent OBJ_id_ppl,2L + +#define SN_ad_OCSP "OCSP" +#define LN_ad_OCSP "OCSP" +#define NID_ad_OCSP 178 +#define OBJ_ad_OCSP OBJ_id_ad,1L + +#define SN_ad_ca_issuers "caIssuers" +#define LN_ad_ca_issuers "CA Issuers" +#define NID_ad_ca_issuers 179 +#define OBJ_ad_ca_issuers OBJ_id_ad,2L + +#define SN_ad_timeStamping "ad_timestamping" +#define LN_ad_timeStamping "AD Time Stamping" +#define NID_ad_timeStamping 363 +#define OBJ_ad_timeStamping OBJ_id_ad,3L + +#define SN_ad_dvcs "AD_DVCS" +#define LN_ad_dvcs "ad dvcs" +#define NID_ad_dvcs 364 +#define OBJ_ad_dvcs OBJ_id_ad,4L + +#define SN_caRepository "caRepository" +#define LN_caRepository "CA Repository" +#define NID_caRepository 785 +#define OBJ_caRepository OBJ_id_ad,5L + +#define SN_rpkiManifest "rpkiManifest" +#define LN_rpkiManifest "RPKI Manifest" +#define NID_rpkiManifest 1243 +#define OBJ_rpkiManifest OBJ_id_ad,10L + +#define SN_signedObject "signedObject" +#define LN_signedObject "Signed Object" +#define NID_signedObject 1244 +#define OBJ_signedObject OBJ_id_ad,11L + +#define SN_rpkiNotify "rpkiNotify" +#define LN_rpkiNotify "RPKI Notify" +#define NID_rpkiNotify 1245 +#define OBJ_rpkiNotify OBJ_id_ad,13L + +#define OBJ_id_pkix_OCSP OBJ_ad_OCSP + +#define SN_id_pkix_OCSP_basic "basicOCSPResponse" +#define LN_id_pkix_OCSP_basic "Basic OCSP Response" +#define NID_id_pkix_OCSP_basic 365 +#define OBJ_id_pkix_OCSP_basic OBJ_id_pkix_OCSP,1L + +#define SN_id_pkix_OCSP_Nonce "Nonce" +#define LN_id_pkix_OCSP_Nonce "OCSP Nonce" +#define NID_id_pkix_OCSP_Nonce 366 +#define OBJ_id_pkix_OCSP_Nonce OBJ_id_pkix_OCSP,2L + +#define SN_id_pkix_OCSP_CrlID "CrlID" +#define LN_id_pkix_OCSP_CrlID "OCSP CRL ID" +#define NID_id_pkix_OCSP_CrlID 367 +#define OBJ_id_pkix_OCSP_CrlID OBJ_id_pkix_OCSP,3L + +#define SN_id_pkix_OCSP_acceptableResponses "acceptableResponses" +#define LN_id_pkix_OCSP_acceptableResponses "Acceptable OCSP Responses" +#define NID_id_pkix_OCSP_acceptableResponses 368 +#define OBJ_id_pkix_OCSP_acceptableResponses OBJ_id_pkix_OCSP,4L + +#define SN_id_pkix_OCSP_noCheck "noCheck" +#define LN_id_pkix_OCSP_noCheck "OCSP No Check" +#define NID_id_pkix_OCSP_noCheck 369 +#define OBJ_id_pkix_OCSP_noCheck OBJ_id_pkix_OCSP,5L + +#define SN_id_pkix_OCSP_archiveCutoff "archiveCutoff" +#define LN_id_pkix_OCSP_archiveCutoff "OCSP Archive Cutoff" +#define NID_id_pkix_OCSP_archiveCutoff 370 +#define OBJ_id_pkix_OCSP_archiveCutoff OBJ_id_pkix_OCSP,6L + +#define SN_id_pkix_OCSP_serviceLocator "serviceLocator" +#define LN_id_pkix_OCSP_serviceLocator "OCSP Service Locator" +#define NID_id_pkix_OCSP_serviceLocator 371 +#define OBJ_id_pkix_OCSP_serviceLocator OBJ_id_pkix_OCSP,7L + +#define SN_id_pkix_OCSP_extendedStatus "extendedStatus" +#define LN_id_pkix_OCSP_extendedStatus "Extended OCSP Status" +#define NID_id_pkix_OCSP_extendedStatus 372 +#define OBJ_id_pkix_OCSP_extendedStatus OBJ_id_pkix_OCSP,8L + +#define SN_id_pkix_OCSP_valid "valid" +#define NID_id_pkix_OCSP_valid 373 +#define OBJ_id_pkix_OCSP_valid OBJ_id_pkix_OCSP,9L + +#define SN_id_pkix_OCSP_path "path" +#define NID_id_pkix_OCSP_path 374 +#define OBJ_id_pkix_OCSP_path OBJ_id_pkix_OCSP,10L + +#define SN_id_pkix_OCSP_trustRoot "trustRoot" +#define LN_id_pkix_OCSP_trustRoot "Trust Root" +#define NID_id_pkix_OCSP_trustRoot 375 +#define OBJ_id_pkix_OCSP_trustRoot OBJ_id_pkix_OCSP,11L + +#define SN_algorithm "algorithm" +#define LN_algorithm "algorithm" +#define NID_algorithm 376 +#define OBJ_algorithm 1L,3L,14L,3L,2L + +#define SN_md5WithRSA "RSA-NP-MD5" +#define LN_md5WithRSA "md5WithRSA" +#define NID_md5WithRSA 104 +#define OBJ_md5WithRSA OBJ_algorithm,3L + +#define SN_des_ecb "DES-ECB" +#define LN_des_ecb "des-ecb" +#define NID_des_ecb 29 +#define OBJ_des_ecb OBJ_algorithm,6L + +#define SN_des_cbc "DES-CBC" +#define LN_des_cbc "des-cbc" +#define NID_des_cbc 31 +#define OBJ_des_cbc OBJ_algorithm,7L + +#define SN_des_ofb64 "DES-OFB" +#define LN_des_ofb64 "des-ofb" +#define NID_des_ofb64 45 +#define OBJ_des_ofb64 OBJ_algorithm,8L + +#define SN_des_cfb64 "DES-CFB" +#define LN_des_cfb64 "des-cfb" +#define NID_des_cfb64 30 +#define OBJ_des_cfb64 OBJ_algorithm,9L + +#define SN_rsaSignature "rsaSignature" +#define NID_rsaSignature 377 +#define OBJ_rsaSignature OBJ_algorithm,11L + +#define SN_dsa_2 "DSA-old" +#define LN_dsa_2 "dsaEncryption-old" +#define NID_dsa_2 67 +#define OBJ_dsa_2 OBJ_algorithm,12L + +#define SN_dsaWithSHA "DSA-SHA" +#define LN_dsaWithSHA "dsaWithSHA" +#define NID_dsaWithSHA 66 +#define OBJ_dsaWithSHA OBJ_algorithm,13L + +#define SN_shaWithRSAEncryption "RSA-SHA" +#define LN_shaWithRSAEncryption "shaWithRSAEncryption" +#define NID_shaWithRSAEncryption 42 +#define OBJ_shaWithRSAEncryption OBJ_algorithm,15L + +#define SN_des_ede_ecb "DES-EDE" +#define LN_des_ede_ecb "des-ede" +#define NID_des_ede_ecb 32 +#define OBJ_des_ede_ecb OBJ_algorithm,17L + +#define SN_des_ede3_ecb "DES-EDE3" +#define LN_des_ede3_ecb "des-ede3" +#define NID_des_ede3_ecb 33 + +#define SN_des_ede_cbc "DES-EDE-CBC" +#define LN_des_ede_cbc "des-ede-cbc" +#define NID_des_ede_cbc 43 + +#define SN_des_ede_cfb64 "DES-EDE-CFB" +#define LN_des_ede_cfb64 "des-ede-cfb" +#define NID_des_ede_cfb64 60 + +#define SN_des_ede3_cfb64 "DES-EDE3-CFB" +#define LN_des_ede3_cfb64 "des-ede3-cfb" +#define NID_des_ede3_cfb64 61 + +#define SN_des_ede_ofb64 "DES-EDE-OFB" +#define LN_des_ede_ofb64 "des-ede-ofb" +#define NID_des_ede_ofb64 62 + +#define SN_des_ede3_ofb64 "DES-EDE3-OFB" +#define LN_des_ede3_ofb64 "des-ede3-ofb" +#define NID_des_ede3_ofb64 63 + +#define SN_desx_cbc "DESX-CBC" +#define LN_desx_cbc "desx-cbc" +#define NID_desx_cbc 80 + +#define SN_sha "SHA" +#define LN_sha "sha" +#define NID_sha 41 +#define OBJ_sha OBJ_algorithm,18L + +#define SN_sha1 "SHA1" +#define LN_sha1 "sha1" +#define NID_sha1 64 +#define OBJ_sha1 OBJ_algorithm,26L + +#define SN_dsaWithSHA1_2 "DSA-SHA1-old" +#define LN_dsaWithSHA1_2 "dsaWithSHA1-old" +#define NID_dsaWithSHA1_2 70 +#define OBJ_dsaWithSHA1_2 OBJ_algorithm,27L + +#define SN_sha1WithRSA "RSA-SHA1-2" +#define LN_sha1WithRSA "sha1WithRSA" +#define NID_sha1WithRSA 115 +#define OBJ_sha1WithRSA OBJ_algorithm,29L + +#define SN_ripemd160 "RIPEMD160" +#define LN_ripemd160 "ripemd160" +#define NID_ripemd160 117 +#define OBJ_ripemd160 1L,3L,36L,3L,2L,1L + +#define SN_ripemd160WithRSA "RSA-RIPEMD160" +#define LN_ripemd160WithRSA "ripemd160WithRSA" +#define NID_ripemd160WithRSA 119 +#define OBJ_ripemd160WithRSA 1L,3L,36L,3L,3L,1L,2L + +#define SN_blake2bmac "BLAKE2BMAC" +#define LN_blake2bmac "blake2bmac" +#define NID_blake2bmac 1201 +#define OBJ_blake2bmac 1L,3L,6L,1L,4L,1L,1722L,12L,2L,1L + +#define SN_blake2smac "BLAKE2SMAC" +#define LN_blake2smac "blake2smac" +#define NID_blake2smac 1202 +#define OBJ_blake2smac 1L,3L,6L,1L,4L,1L,1722L,12L,2L,2L + +#define SN_blake2b512 "BLAKE2b512" +#define LN_blake2b512 "blake2b512" +#define NID_blake2b512 1056 +#define OBJ_blake2b512 OBJ_blake2bmac,16L + +#define SN_blake2s256 "BLAKE2s256" +#define LN_blake2s256 "blake2s256" +#define NID_blake2s256 1057 +#define OBJ_blake2s256 OBJ_blake2smac,8L + +#define SN_sxnet "SXNetID" +#define LN_sxnet "Strong Extranet ID" +#define NID_sxnet 143 +#define OBJ_sxnet 1L,3L,101L,1L,4L,1L + +#define SN_X500 "X500" +#define LN_X500 "directory services (X.500)" +#define NID_X500 11 +#define OBJ_X500 2L,5L + +#define SN_X509 "X509" +#define NID_X509 12 +#define OBJ_X509 OBJ_X500,4L + +#define SN_commonName "CN" +#define LN_commonName "commonName" +#define NID_commonName 13 +#define OBJ_commonName OBJ_X509,3L + +#define SN_surname "SN" +#define LN_surname "surname" +#define NID_surname 100 +#define OBJ_surname OBJ_X509,4L + +#define LN_serialNumber "serialNumber" +#define NID_serialNumber 105 +#define OBJ_serialNumber OBJ_X509,5L + +#define SN_countryName "C" +#define LN_countryName "countryName" +#define NID_countryName 14 +#define OBJ_countryName OBJ_X509,6L + +#define SN_localityName "L" +#define LN_localityName "localityName" +#define NID_localityName 15 +#define OBJ_localityName OBJ_X509,7L + +#define SN_stateOrProvinceName "ST" +#define LN_stateOrProvinceName "stateOrProvinceName" +#define NID_stateOrProvinceName 16 +#define OBJ_stateOrProvinceName OBJ_X509,8L + +#define SN_streetAddress "street" +#define LN_streetAddress "streetAddress" +#define NID_streetAddress 660 +#define OBJ_streetAddress OBJ_X509,9L + +#define SN_organizationName "O" +#define LN_organizationName "organizationName" +#define NID_organizationName 17 +#define OBJ_organizationName OBJ_X509,10L + +#define SN_organizationalUnitName "OU" +#define LN_organizationalUnitName "organizationalUnitName" +#define NID_organizationalUnitName 18 +#define OBJ_organizationalUnitName OBJ_X509,11L + +#define SN_title "title" +#define LN_title "title" +#define NID_title 106 +#define OBJ_title OBJ_X509,12L + +#define LN_description "description" +#define NID_description 107 +#define OBJ_description OBJ_X509,13L + +#define LN_searchGuide "searchGuide" +#define NID_searchGuide 859 +#define OBJ_searchGuide OBJ_X509,14L + +#define LN_businessCategory "businessCategory" +#define NID_businessCategory 860 +#define OBJ_businessCategory OBJ_X509,15L + +#define LN_postalAddress "postalAddress" +#define NID_postalAddress 861 +#define OBJ_postalAddress OBJ_X509,16L + +#define LN_postalCode "postalCode" +#define NID_postalCode 661 +#define OBJ_postalCode OBJ_X509,17L + +#define LN_postOfficeBox "postOfficeBox" +#define NID_postOfficeBox 862 +#define OBJ_postOfficeBox OBJ_X509,18L + +#define LN_physicalDeliveryOfficeName "physicalDeliveryOfficeName" +#define NID_physicalDeliveryOfficeName 863 +#define OBJ_physicalDeliveryOfficeName OBJ_X509,19L + +#define LN_telephoneNumber "telephoneNumber" +#define NID_telephoneNumber 864 +#define OBJ_telephoneNumber OBJ_X509,20L + +#define LN_telexNumber "telexNumber" +#define NID_telexNumber 865 +#define OBJ_telexNumber OBJ_X509,21L + +#define LN_teletexTerminalIdentifier "teletexTerminalIdentifier" +#define NID_teletexTerminalIdentifier 866 +#define OBJ_teletexTerminalIdentifier OBJ_X509,22L + +#define LN_facsimileTelephoneNumber "facsimileTelephoneNumber" +#define NID_facsimileTelephoneNumber 867 +#define OBJ_facsimileTelephoneNumber OBJ_X509,23L + +#define LN_x121Address "x121Address" +#define NID_x121Address 868 +#define OBJ_x121Address OBJ_X509,24L + +#define LN_internationaliSDNNumber "internationaliSDNNumber" +#define NID_internationaliSDNNumber 869 +#define OBJ_internationaliSDNNumber OBJ_X509,25L + +#define LN_registeredAddress "registeredAddress" +#define NID_registeredAddress 870 +#define OBJ_registeredAddress OBJ_X509,26L + +#define LN_destinationIndicator "destinationIndicator" +#define NID_destinationIndicator 871 +#define OBJ_destinationIndicator OBJ_X509,27L + +#define LN_preferredDeliveryMethod "preferredDeliveryMethod" +#define NID_preferredDeliveryMethod 872 +#define OBJ_preferredDeliveryMethod OBJ_X509,28L + +#define LN_presentationAddress "presentationAddress" +#define NID_presentationAddress 873 +#define OBJ_presentationAddress OBJ_X509,29L + +#define LN_supportedApplicationContext "supportedApplicationContext" +#define NID_supportedApplicationContext 874 +#define OBJ_supportedApplicationContext OBJ_X509,30L + +#define SN_member "member" +#define NID_member 875 +#define OBJ_member OBJ_X509,31L + +#define SN_owner "owner" +#define NID_owner 876 +#define OBJ_owner OBJ_X509,32L + +#define LN_roleOccupant "roleOccupant" +#define NID_roleOccupant 877 +#define OBJ_roleOccupant OBJ_X509,33L + +#define SN_seeAlso "seeAlso" +#define NID_seeAlso 878 +#define OBJ_seeAlso OBJ_X509,34L + +#define LN_userPassword "userPassword" +#define NID_userPassword 879 +#define OBJ_userPassword OBJ_X509,35L + +#define LN_userCertificate "userCertificate" +#define NID_userCertificate 880 +#define OBJ_userCertificate OBJ_X509,36L + +#define LN_cACertificate "cACertificate" +#define NID_cACertificate 881 +#define OBJ_cACertificate OBJ_X509,37L + +#define LN_authorityRevocationList "authorityRevocationList" +#define NID_authorityRevocationList 882 +#define OBJ_authorityRevocationList OBJ_X509,38L + +#define LN_certificateRevocationList "certificateRevocationList" +#define NID_certificateRevocationList 883 +#define OBJ_certificateRevocationList OBJ_X509,39L + +#define LN_crossCertificatePair "crossCertificatePair" +#define NID_crossCertificatePair 884 +#define OBJ_crossCertificatePair OBJ_X509,40L + +#define SN_name "name" +#define LN_name "name" +#define NID_name 173 +#define OBJ_name OBJ_X509,41L + +#define SN_givenName "GN" +#define LN_givenName "givenName" +#define NID_givenName 99 +#define OBJ_givenName OBJ_X509,42L + +#define SN_initials "initials" +#define LN_initials "initials" +#define NID_initials 101 +#define OBJ_initials OBJ_X509,43L + +#define LN_generationQualifier "generationQualifier" +#define NID_generationQualifier 509 +#define OBJ_generationQualifier OBJ_X509,44L + +#define LN_x500UniqueIdentifier "x500UniqueIdentifier" +#define NID_x500UniqueIdentifier 503 +#define OBJ_x500UniqueIdentifier OBJ_X509,45L + +#define SN_dnQualifier "dnQualifier" +#define LN_dnQualifier "dnQualifier" +#define NID_dnQualifier 174 +#define OBJ_dnQualifier OBJ_X509,46L + +#define LN_enhancedSearchGuide "enhancedSearchGuide" +#define NID_enhancedSearchGuide 885 +#define OBJ_enhancedSearchGuide OBJ_X509,47L + +#define LN_protocolInformation "protocolInformation" +#define NID_protocolInformation 886 +#define OBJ_protocolInformation OBJ_X509,48L + +#define LN_distinguishedName "distinguishedName" +#define NID_distinguishedName 887 +#define OBJ_distinguishedName OBJ_X509,49L + +#define LN_uniqueMember "uniqueMember" +#define NID_uniqueMember 888 +#define OBJ_uniqueMember OBJ_X509,50L + +#define LN_houseIdentifier "houseIdentifier" +#define NID_houseIdentifier 889 +#define OBJ_houseIdentifier OBJ_X509,51L + +#define LN_supportedAlgorithms "supportedAlgorithms" +#define NID_supportedAlgorithms 890 +#define OBJ_supportedAlgorithms OBJ_X509,52L + +#define LN_deltaRevocationList "deltaRevocationList" +#define NID_deltaRevocationList 891 +#define OBJ_deltaRevocationList OBJ_X509,53L + +#define SN_dmdName "dmdName" +#define NID_dmdName 892 +#define OBJ_dmdName OBJ_X509,54L + +#define LN_pseudonym "pseudonym" +#define NID_pseudonym 510 +#define OBJ_pseudonym OBJ_X509,65L + +#define SN_role "role" +#define LN_role "role" +#define NID_role 400 +#define OBJ_role OBJ_X509,72L + +#define LN_organizationIdentifier "organizationIdentifier" +#define NID_organizationIdentifier 1089 +#define OBJ_organizationIdentifier OBJ_X509,97L + +#define SN_countryCode3c "c3" +#define LN_countryCode3c "countryCode3c" +#define NID_countryCode3c 1090 +#define OBJ_countryCode3c OBJ_X509,98L + +#define SN_countryCode3n "n3" +#define LN_countryCode3n "countryCode3n" +#define NID_countryCode3n 1091 +#define OBJ_countryCode3n OBJ_X509,99L + +#define LN_dnsName "dnsName" +#define NID_dnsName 1092 +#define OBJ_dnsName OBJ_X509,100L + +#define SN_X500algorithms "X500algorithms" +#define LN_X500algorithms "directory services - algorithms" +#define NID_X500algorithms 378 +#define OBJ_X500algorithms OBJ_X500,8L + +#define SN_rsa "RSA" +#define LN_rsa "rsa" +#define NID_rsa 19 +#define OBJ_rsa OBJ_X500algorithms,1L,1L + +#define SN_mdc2WithRSA "RSA-MDC2" +#define LN_mdc2WithRSA "mdc2WithRSA" +#define NID_mdc2WithRSA 96 +#define OBJ_mdc2WithRSA OBJ_X500algorithms,3L,100L + +#define SN_mdc2 "MDC2" +#define LN_mdc2 "mdc2" +#define NID_mdc2 95 +#define OBJ_mdc2 OBJ_X500algorithms,3L,101L + +#define SN_id_ce "id-ce" +#define NID_id_ce 81 +#define OBJ_id_ce OBJ_X500,29L + +#define SN_subject_directory_attributes "subjectDirectoryAttributes" +#define LN_subject_directory_attributes "X509v3 Subject Directory Attributes" +#define NID_subject_directory_attributes 769 +#define OBJ_subject_directory_attributes OBJ_id_ce,9L + +#define SN_subject_key_identifier "subjectKeyIdentifier" +#define LN_subject_key_identifier "X509v3 Subject Key Identifier" +#define NID_subject_key_identifier 82 +#define OBJ_subject_key_identifier OBJ_id_ce,14L + +#define SN_key_usage "keyUsage" +#define LN_key_usage "X509v3 Key Usage" +#define NID_key_usage 83 +#define OBJ_key_usage OBJ_id_ce,15L + +#define SN_private_key_usage_period "privateKeyUsagePeriod" +#define LN_private_key_usage_period "X509v3 Private Key Usage Period" +#define NID_private_key_usage_period 84 +#define OBJ_private_key_usage_period OBJ_id_ce,16L + +#define SN_subject_alt_name "subjectAltName" +#define LN_subject_alt_name "X509v3 Subject Alternative Name" +#define NID_subject_alt_name 85 +#define OBJ_subject_alt_name OBJ_id_ce,17L + +#define SN_issuer_alt_name "issuerAltName" +#define LN_issuer_alt_name "X509v3 Issuer Alternative Name" +#define NID_issuer_alt_name 86 +#define OBJ_issuer_alt_name OBJ_id_ce,18L + +#define SN_basic_constraints "basicConstraints" +#define LN_basic_constraints "X509v3 Basic Constraints" +#define NID_basic_constraints 87 +#define OBJ_basic_constraints OBJ_id_ce,19L + +#define SN_crl_number "crlNumber" +#define LN_crl_number "X509v3 CRL Number" +#define NID_crl_number 88 +#define OBJ_crl_number OBJ_id_ce,20L + +#define SN_crl_reason "CRLReason" +#define LN_crl_reason "X509v3 CRL Reason Code" +#define NID_crl_reason 141 +#define OBJ_crl_reason OBJ_id_ce,21L + +#define SN_invalidity_date "invalidityDate" +#define LN_invalidity_date "Invalidity Date" +#define NID_invalidity_date 142 +#define OBJ_invalidity_date OBJ_id_ce,24L + +#define SN_delta_crl "deltaCRL" +#define LN_delta_crl "X509v3 Delta CRL Indicator" +#define NID_delta_crl 140 +#define OBJ_delta_crl OBJ_id_ce,27L + +#define SN_issuing_distribution_point "issuingDistributionPoint" +#define LN_issuing_distribution_point "X509v3 Issuing Distribution Point" +#define NID_issuing_distribution_point 770 +#define OBJ_issuing_distribution_point OBJ_id_ce,28L + +#define SN_certificate_issuer "certificateIssuer" +#define LN_certificate_issuer "X509v3 Certificate Issuer" +#define NID_certificate_issuer 771 +#define OBJ_certificate_issuer OBJ_id_ce,29L + +#define SN_name_constraints "nameConstraints" +#define LN_name_constraints "X509v3 Name Constraints" +#define NID_name_constraints 666 +#define OBJ_name_constraints OBJ_id_ce,30L + +#define SN_crl_distribution_points "crlDistributionPoints" +#define LN_crl_distribution_points "X509v3 CRL Distribution Points" +#define NID_crl_distribution_points 103 +#define OBJ_crl_distribution_points OBJ_id_ce,31L + +#define SN_certificate_policies "certificatePolicies" +#define LN_certificate_policies "X509v3 Certificate Policies" +#define NID_certificate_policies 89 +#define OBJ_certificate_policies OBJ_id_ce,32L + +#define SN_any_policy "anyPolicy" +#define LN_any_policy "X509v3 Any Policy" +#define NID_any_policy 746 +#define OBJ_any_policy OBJ_certificate_policies,0L + +#define SN_policy_mappings "policyMappings" +#define LN_policy_mappings "X509v3 Policy Mappings" +#define NID_policy_mappings 747 +#define OBJ_policy_mappings OBJ_id_ce,33L + +#define SN_authority_key_identifier "authorityKeyIdentifier" +#define LN_authority_key_identifier "X509v3 Authority Key Identifier" +#define NID_authority_key_identifier 90 +#define OBJ_authority_key_identifier OBJ_id_ce,35L + +#define SN_policy_constraints "policyConstraints" +#define LN_policy_constraints "X509v3 Policy Constraints" +#define NID_policy_constraints 401 +#define OBJ_policy_constraints OBJ_id_ce,36L + +#define SN_ext_key_usage "extendedKeyUsage" +#define LN_ext_key_usage "X509v3 Extended Key Usage" +#define NID_ext_key_usage 126 +#define OBJ_ext_key_usage OBJ_id_ce,37L + +#define SN_authority_attribute_identifier "authorityAttributeIdentifier" +#define LN_authority_attribute_identifier "X509v3 Authority Attribute Identifier" +#define NID_authority_attribute_identifier 1295 +#define OBJ_authority_attribute_identifier OBJ_id_ce,38L + +#define SN_role_spec_cert_identifier "roleSpecCertIdentifier" +#define LN_role_spec_cert_identifier "X509v3 Role Specification Certificate Identifier" +#define NID_role_spec_cert_identifier 1296 +#define OBJ_role_spec_cert_identifier OBJ_id_ce,39L + +#define SN_basic_att_constraints "basicAttConstraints" +#define LN_basic_att_constraints "X509v3 Basic Attribute Certificate Constraints" +#define NID_basic_att_constraints 1297 +#define OBJ_basic_att_constraints OBJ_id_ce,41L + +#define SN_delegated_name_constraints "delegatedNameConstraints" +#define LN_delegated_name_constraints "X509v3 Delegated Name Constraints" +#define NID_delegated_name_constraints 1298 +#define OBJ_delegated_name_constraints OBJ_id_ce,42L + +#define SN_time_specification "timeSpecification" +#define LN_time_specification "X509v3 Time Specification" +#define NID_time_specification 1299 +#define OBJ_time_specification OBJ_id_ce,43L + +#define SN_freshest_crl "freshestCRL" +#define LN_freshest_crl "X509v3 Freshest CRL" +#define NID_freshest_crl 857 +#define OBJ_freshest_crl OBJ_id_ce,46L + +#define SN_attribute_descriptor "attributeDescriptor" +#define LN_attribute_descriptor "X509v3 Attribute Descriptor" +#define NID_attribute_descriptor 1300 +#define OBJ_attribute_descriptor OBJ_id_ce,48L + +#define SN_user_notice "userNotice" +#define LN_user_notice "X509v3 User Notice" +#define NID_user_notice 1301 +#define OBJ_user_notice OBJ_id_ce,49L + +#define SN_soa_identifier "sOAIdentifier" +#define LN_soa_identifier "X509v3 Source of Authority Identifier" +#define NID_soa_identifier 1302 +#define OBJ_soa_identifier OBJ_id_ce,50L + +#define SN_acceptable_cert_policies "acceptableCertPolicies" +#define LN_acceptable_cert_policies "X509v3 Acceptable Certification Policies" +#define NID_acceptable_cert_policies 1303 +#define OBJ_acceptable_cert_policies OBJ_id_ce,52L + +#define SN_inhibit_any_policy "inhibitAnyPolicy" +#define LN_inhibit_any_policy "X509v3 Inhibit Any Policy" +#define NID_inhibit_any_policy 748 +#define OBJ_inhibit_any_policy OBJ_id_ce,54L + +#define SN_target_information "targetInformation" +#define LN_target_information "X509v3 AC Targeting" +#define NID_target_information 402 +#define OBJ_target_information OBJ_id_ce,55L + +#define SN_no_rev_avail "noRevAvail" +#define LN_no_rev_avail "X509v3 No Revocation Available" +#define NID_no_rev_avail 403 +#define OBJ_no_rev_avail OBJ_id_ce,56L + +#define SN_acceptable_privilege_policies "acceptablePrivPolicies" +#define LN_acceptable_privilege_policies "X509v3 Acceptable Privilege Policies" +#define NID_acceptable_privilege_policies 1304 +#define OBJ_acceptable_privilege_policies OBJ_id_ce,57L + +#define SN_indirect_issuer "indirectIssuer" +#define LN_indirect_issuer "X509v3 Indirect Issuer" +#define NID_indirect_issuer 1305 +#define OBJ_indirect_issuer OBJ_id_ce,61L + +#define SN_no_assertion "noAssertion" +#define LN_no_assertion "X509v3 No Assertion" +#define NID_no_assertion 1306 +#define OBJ_no_assertion OBJ_id_ce,62L + +#define SN_id_aa_issuing_distribution_point "aAissuingDistributionPoint" +#define LN_id_aa_issuing_distribution_point "X509v3 Attribute Authority Issuing Distribution Point" +#define NID_id_aa_issuing_distribution_point 1307 +#define OBJ_id_aa_issuing_distribution_point OBJ_id_ce,63L + +#define SN_issued_on_behalf_of "issuedOnBehalfOf" +#define LN_issued_on_behalf_of "X509v3 Issued On Behalf Of" +#define NID_issued_on_behalf_of 1308 +#define OBJ_issued_on_behalf_of OBJ_id_ce,64L + +#define SN_single_use "singleUse" +#define LN_single_use "X509v3 Single Use" +#define NID_single_use 1309 +#define OBJ_single_use OBJ_id_ce,65L + +#define SN_group_ac "groupAC" +#define LN_group_ac "X509v3 Group Attribute Certificate" +#define NID_group_ac 1310 +#define OBJ_group_ac OBJ_id_ce,66L + +#define SN_allowed_attribute_assignments "allowedAttributeAssignments" +#define LN_allowed_attribute_assignments "X509v3 Allowed Attribute Assignments" +#define NID_allowed_attribute_assignments 1311 +#define OBJ_allowed_attribute_assignments OBJ_id_ce,67L + +#define SN_attribute_mappings "attributeMappings" +#define LN_attribute_mappings "X509v3 Attribute Mappings" +#define NID_attribute_mappings 1312 +#define OBJ_attribute_mappings OBJ_id_ce,68L + +#define SN_holder_name_constraints "holderNameConstraints" +#define LN_holder_name_constraints "X509v3 Holder Name Constraints" +#define NID_holder_name_constraints 1313 +#define OBJ_holder_name_constraints OBJ_id_ce,69L + +#define SN_authorization_validation "authorizationValidation" +#define LN_authorization_validation "X509v3 Authorization Validation" +#define NID_authorization_validation 1314 +#define OBJ_authorization_validation OBJ_id_ce,70L + +#define SN_prot_restrict "protRestrict" +#define LN_prot_restrict "X509v3 Protocol Restriction" +#define NID_prot_restrict 1315 +#define OBJ_prot_restrict OBJ_id_ce,71L + +#define SN_subject_alt_public_key_info "subjectAltPublicKeyInfo" +#define LN_subject_alt_public_key_info "X509v3 Subject Alternative Public Key Info" +#define NID_subject_alt_public_key_info 1316 +#define OBJ_subject_alt_public_key_info OBJ_id_ce,72L + +#define SN_alt_signature_algorithm "altSignatureAlgorithm" +#define LN_alt_signature_algorithm "X509v3 Alternative Signature Algorithm" +#define NID_alt_signature_algorithm 1317 +#define OBJ_alt_signature_algorithm OBJ_id_ce,73L + +#define SN_alt_signature_value "altSignatureValue" +#define LN_alt_signature_value "X509v3 Alternative Signature Value" +#define NID_alt_signature_value 1318 +#define OBJ_alt_signature_value OBJ_id_ce,74L + +#define SN_associated_information "associatedInformation" +#define LN_associated_information "X509v3 Associated Information" +#define NID_associated_information 1319 +#define OBJ_associated_information OBJ_id_ce,75L + +#define SN_anyExtendedKeyUsage "anyExtendedKeyUsage" +#define LN_anyExtendedKeyUsage "Any Extended Key Usage" +#define NID_anyExtendedKeyUsage 910 +#define OBJ_anyExtendedKeyUsage OBJ_ext_key_usage,0L + +#define SN_netscape "Netscape" +#define LN_netscape "Netscape Communications Corp." +#define NID_netscape 57 +#define OBJ_netscape 2L,16L,840L,1L,113730L + +#define SN_netscape_cert_extension "nsCertExt" +#define LN_netscape_cert_extension "Netscape Certificate Extension" +#define NID_netscape_cert_extension 58 +#define OBJ_netscape_cert_extension OBJ_netscape,1L + +#define SN_netscape_data_type "nsDataType" +#define LN_netscape_data_type "Netscape Data Type" +#define NID_netscape_data_type 59 +#define OBJ_netscape_data_type OBJ_netscape,2L + +#define SN_netscape_cert_type "nsCertType" +#define LN_netscape_cert_type "Netscape Cert Type" +#define NID_netscape_cert_type 71 +#define OBJ_netscape_cert_type OBJ_netscape_cert_extension,1L + +#define SN_netscape_base_url "nsBaseUrl" +#define LN_netscape_base_url "Netscape Base Url" +#define NID_netscape_base_url 72 +#define OBJ_netscape_base_url OBJ_netscape_cert_extension,2L + +#define SN_netscape_revocation_url "nsRevocationUrl" +#define LN_netscape_revocation_url "Netscape Revocation Url" +#define NID_netscape_revocation_url 73 +#define OBJ_netscape_revocation_url OBJ_netscape_cert_extension,3L + +#define SN_netscape_ca_revocation_url "nsCaRevocationUrl" +#define LN_netscape_ca_revocation_url "Netscape CA Revocation Url" +#define NID_netscape_ca_revocation_url 74 +#define OBJ_netscape_ca_revocation_url OBJ_netscape_cert_extension,4L + +#define SN_netscape_renewal_url "nsRenewalUrl" +#define LN_netscape_renewal_url "Netscape Renewal Url" +#define NID_netscape_renewal_url 75 +#define OBJ_netscape_renewal_url OBJ_netscape_cert_extension,7L + +#define SN_netscape_ca_policy_url "nsCaPolicyUrl" +#define LN_netscape_ca_policy_url "Netscape CA Policy Url" +#define NID_netscape_ca_policy_url 76 +#define OBJ_netscape_ca_policy_url OBJ_netscape_cert_extension,8L + +#define SN_netscape_ssl_server_name "nsSslServerName" +#define LN_netscape_ssl_server_name "Netscape SSL Server Name" +#define NID_netscape_ssl_server_name 77 +#define OBJ_netscape_ssl_server_name OBJ_netscape_cert_extension,12L + +#define SN_netscape_comment "nsComment" +#define LN_netscape_comment "Netscape Comment" +#define NID_netscape_comment 78 +#define OBJ_netscape_comment OBJ_netscape_cert_extension,13L + +#define SN_netscape_cert_sequence "nsCertSequence" +#define LN_netscape_cert_sequence "Netscape Certificate Sequence" +#define NID_netscape_cert_sequence 79 +#define OBJ_netscape_cert_sequence OBJ_netscape_data_type,5L + +#define SN_ns_sgc "nsSGC" +#define LN_ns_sgc "Netscape Server Gated Crypto" +#define NID_ns_sgc 139 +#define OBJ_ns_sgc OBJ_netscape,4L,1L + +#define SN_org "ORG" +#define LN_org "org" +#define NID_org 379 +#define OBJ_org OBJ_iso,3L + +#define SN_dod "DOD" +#define LN_dod "dod" +#define NID_dod 380 +#define OBJ_dod OBJ_org,6L + +#define SN_iana "IANA" +#define LN_iana "iana" +#define NID_iana 381 +#define OBJ_iana OBJ_dod,1L + +#define OBJ_internet OBJ_iana + +#define SN_Directory "directory" +#define LN_Directory "Directory" +#define NID_Directory 382 +#define OBJ_Directory OBJ_internet,1L + +#define SN_Management "mgmt" +#define LN_Management "Management" +#define NID_Management 383 +#define OBJ_Management OBJ_internet,2L + +#define SN_Experimental "experimental" +#define LN_Experimental "Experimental" +#define NID_Experimental 384 +#define OBJ_Experimental OBJ_internet,3L + +#define SN_Private "private" +#define LN_Private "Private" +#define NID_Private 385 +#define OBJ_Private OBJ_internet,4L + +#define SN_Security "security" +#define LN_Security "Security" +#define NID_Security 386 +#define OBJ_Security OBJ_internet,5L + +#define SN_SNMPv2 "snmpv2" +#define LN_SNMPv2 "SNMPv2" +#define NID_SNMPv2 387 +#define OBJ_SNMPv2 OBJ_internet,6L + +#define LN_Mail "Mail" +#define NID_Mail 388 +#define OBJ_Mail OBJ_internet,7L + +#define SN_Enterprises "enterprises" +#define LN_Enterprises "Enterprises" +#define NID_Enterprises 389 +#define OBJ_Enterprises OBJ_Private,1L + +#define SN_dcObject "dcobject" +#define LN_dcObject "dcObject" +#define NID_dcObject 390 +#define OBJ_dcObject OBJ_Enterprises,1466L,344L + +#define SN_id_kp_wisun_fan_device "id-kp-wisun-fan-device" +#define LN_id_kp_wisun_fan_device "Wi-SUN Alliance Field Area Network (FAN)" +#define NID_id_kp_wisun_fan_device 1322 +#define OBJ_id_kp_wisun_fan_device OBJ_Enterprises,45605L,1L + +#define SN_mime_mhs "mime-mhs" +#define LN_mime_mhs "MIME MHS" +#define NID_mime_mhs 504 +#define OBJ_mime_mhs OBJ_Mail,1L + +#define SN_mime_mhs_headings "mime-mhs-headings" +#define LN_mime_mhs_headings "mime-mhs-headings" +#define NID_mime_mhs_headings 505 +#define OBJ_mime_mhs_headings OBJ_mime_mhs,1L + +#define SN_mime_mhs_bodies "mime-mhs-bodies" +#define LN_mime_mhs_bodies "mime-mhs-bodies" +#define NID_mime_mhs_bodies 506 +#define OBJ_mime_mhs_bodies OBJ_mime_mhs,2L + +#define SN_id_hex_partial_message "id-hex-partial-message" +#define LN_id_hex_partial_message "id-hex-partial-message" +#define NID_id_hex_partial_message 507 +#define OBJ_id_hex_partial_message OBJ_mime_mhs_headings,1L + +#define SN_id_hex_multipart_message "id-hex-multipart-message" +#define LN_id_hex_multipart_message "id-hex-multipart-message" +#define NID_id_hex_multipart_message 508 +#define OBJ_id_hex_multipart_message OBJ_mime_mhs_headings,2L + +#define SN_zlib_compression "ZLIB" +#define LN_zlib_compression "zlib compression" +#define NID_zlib_compression 125 +#define OBJ_zlib_compression OBJ_id_smime_alg,8L + +#define OBJ_csor 2L,16L,840L,1L,101L,3L + +#define OBJ_nistAlgorithms OBJ_csor,4L + +#define OBJ_aes OBJ_nistAlgorithms,1L + +#define SN_aes_128_ecb "AES-128-ECB" +#define LN_aes_128_ecb "aes-128-ecb" +#define NID_aes_128_ecb 418 +#define OBJ_aes_128_ecb OBJ_aes,1L + +#define SN_aes_128_cbc "AES-128-CBC" +#define LN_aes_128_cbc "aes-128-cbc" +#define NID_aes_128_cbc 419 +#define OBJ_aes_128_cbc OBJ_aes,2L + +#define SN_aes_128_ofb128 "AES-128-OFB" +#define LN_aes_128_ofb128 "aes-128-ofb" +#define NID_aes_128_ofb128 420 +#define OBJ_aes_128_ofb128 OBJ_aes,3L + +#define SN_aes_128_cfb128 "AES-128-CFB" +#define LN_aes_128_cfb128 "aes-128-cfb" +#define NID_aes_128_cfb128 421 +#define OBJ_aes_128_cfb128 OBJ_aes,4L + +#define SN_id_aes128_wrap "id-aes128-wrap" +#define NID_id_aes128_wrap 788 +#define OBJ_id_aes128_wrap OBJ_aes,5L + +#define SN_aes_128_gcm "id-aes128-GCM" +#define LN_aes_128_gcm "aes-128-gcm" +#define NID_aes_128_gcm 895 +#define OBJ_aes_128_gcm OBJ_aes,6L + +#define SN_aes_128_ccm "id-aes128-CCM" +#define LN_aes_128_ccm "aes-128-ccm" +#define NID_aes_128_ccm 896 +#define OBJ_aes_128_ccm OBJ_aes,7L + +#define SN_id_aes128_wrap_pad "id-aes128-wrap-pad" +#define NID_id_aes128_wrap_pad 897 +#define OBJ_id_aes128_wrap_pad OBJ_aes,8L + +#define SN_aes_192_ecb "AES-192-ECB" +#define LN_aes_192_ecb "aes-192-ecb" +#define NID_aes_192_ecb 422 +#define OBJ_aes_192_ecb OBJ_aes,21L + +#define SN_aes_192_cbc "AES-192-CBC" +#define LN_aes_192_cbc "aes-192-cbc" +#define NID_aes_192_cbc 423 +#define OBJ_aes_192_cbc OBJ_aes,22L + +#define SN_aes_192_ofb128 "AES-192-OFB" +#define LN_aes_192_ofb128 "aes-192-ofb" +#define NID_aes_192_ofb128 424 +#define OBJ_aes_192_ofb128 OBJ_aes,23L + +#define SN_aes_192_cfb128 "AES-192-CFB" +#define LN_aes_192_cfb128 "aes-192-cfb" +#define NID_aes_192_cfb128 425 +#define OBJ_aes_192_cfb128 OBJ_aes,24L + +#define SN_id_aes192_wrap "id-aes192-wrap" +#define NID_id_aes192_wrap 789 +#define OBJ_id_aes192_wrap OBJ_aes,25L + +#define SN_aes_192_gcm "id-aes192-GCM" +#define LN_aes_192_gcm "aes-192-gcm" +#define NID_aes_192_gcm 898 +#define OBJ_aes_192_gcm OBJ_aes,26L + +#define SN_aes_192_ccm "id-aes192-CCM" +#define LN_aes_192_ccm "aes-192-ccm" +#define NID_aes_192_ccm 899 +#define OBJ_aes_192_ccm OBJ_aes,27L + +#define SN_id_aes192_wrap_pad "id-aes192-wrap-pad" +#define NID_id_aes192_wrap_pad 900 +#define OBJ_id_aes192_wrap_pad OBJ_aes,28L + +#define SN_aes_256_ecb "AES-256-ECB" +#define LN_aes_256_ecb "aes-256-ecb" +#define NID_aes_256_ecb 426 +#define OBJ_aes_256_ecb OBJ_aes,41L + +#define SN_aes_256_cbc "AES-256-CBC" +#define LN_aes_256_cbc "aes-256-cbc" +#define NID_aes_256_cbc 427 +#define OBJ_aes_256_cbc OBJ_aes,42L + +#define SN_aes_256_ofb128 "AES-256-OFB" +#define LN_aes_256_ofb128 "aes-256-ofb" +#define NID_aes_256_ofb128 428 +#define OBJ_aes_256_ofb128 OBJ_aes,43L + +#define SN_aes_256_cfb128 "AES-256-CFB" +#define LN_aes_256_cfb128 "aes-256-cfb" +#define NID_aes_256_cfb128 429 +#define OBJ_aes_256_cfb128 OBJ_aes,44L + +#define SN_id_aes256_wrap "id-aes256-wrap" +#define NID_id_aes256_wrap 790 +#define OBJ_id_aes256_wrap OBJ_aes,45L + +#define SN_aes_256_gcm "id-aes256-GCM" +#define LN_aes_256_gcm "aes-256-gcm" +#define NID_aes_256_gcm 901 +#define OBJ_aes_256_gcm OBJ_aes,46L + +#define SN_aes_256_ccm "id-aes256-CCM" +#define LN_aes_256_ccm "aes-256-ccm" +#define NID_aes_256_ccm 902 +#define OBJ_aes_256_ccm OBJ_aes,47L + +#define SN_id_aes256_wrap_pad "id-aes256-wrap-pad" +#define NID_id_aes256_wrap_pad 903 +#define OBJ_id_aes256_wrap_pad OBJ_aes,48L + +#define SN_aes_128_xts "AES-128-XTS" +#define LN_aes_128_xts "aes-128-xts" +#define NID_aes_128_xts 913 +#define OBJ_aes_128_xts OBJ_ieee_siswg,0L,1L,1L + +#define SN_aes_256_xts "AES-256-XTS" +#define LN_aes_256_xts "aes-256-xts" +#define NID_aes_256_xts 914 +#define OBJ_aes_256_xts OBJ_ieee_siswg,0L,1L,2L + +#define SN_aes_128_cfb1 "AES-128-CFB1" +#define LN_aes_128_cfb1 "aes-128-cfb1" +#define NID_aes_128_cfb1 650 + +#define SN_aes_192_cfb1 "AES-192-CFB1" +#define LN_aes_192_cfb1 "aes-192-cfb1" +#define NID_aes_192_cfb1 651 + +#define SN_aes_256_cfb1 "AES-256-CFB1" +#define LN_aes_256_cfb1 "aes-256-cfb1" +#define NID_aes_256_cfb1 652 + +#define SN_aes_128_cfb8 "AES-128-CFB8" +#define LN_aes_128_cfb8 "aes-128-cfb8" +#define NID_aes_128_cfb8 653 + +#define SN_aes_192_cfb8 "AES-192-CFB8" +#define LN_aes_192_cfb8 "aes-192-cfb8" +#define NID_aes_192_cfb8 654 + +#define SN_aes_256_cfb8 "AES-256-CFB8" +#define LN_aes_256_cfb8 "aes-256-cfb8" +#define NID_aes_256_cfb8 655 + +#define SN_aes_128_ctr "AES-128-CTR" +#define LN_aes_128_ctr "aes-128-ctr" +#define NID_aes_128_ctr 904 + +#define SN_aes_192_ctr "AES-192-CTR" +#define LN_aes_192_ctr "aes-192-ctr" +#define NID_aes_192_ctr 905 + +#define SN_aes_256_ctr "AES-256-CTR" +#define LN_aes_256_ctr "aes-256-ctr" +#define NID_aes_256_ctr 906 + +#define SN_aes_128_ocb "AES-128-OCB" +#define LN_aes_128_ocb "aes-128-ocb" +#define NID_aes_128_ocb 958 + +#define SN_aes_192_ocb "AES-192-OCB" +#define LN_aes_192_ocb "aes-192-ocb" +#define NID_aes_192_ocb 959 + +#define SN_aes_256_ocb "AES-256-OCB" +#define LN_aes_256_ocb "aes-256-ocb" +#define NID_aes_256_ocb 960 + +#define SN_des_cfb1 "DES-CFB1" +#define LN_des_cfb1 "des-cfb1" +#define NID_des_cfb1 656 + +#define SN_des_cfb8 "DES-CFB8" +#define LN_des_cfb8 "des-cfb8" +#define NID_des_cfb8 657 + +#define SN_des_ede3_cfb1 "DES-EDE3-CFB1" +#define LN_des_ede3_cfb1 "des-ede3-cfb1" +#define NID_des_ede3_cfb1 658 + +#define SN_des_ede3_cfb8 "DES-EDE3-CFB8" +#define LN_des_ede3_cfb8 "des-ede3-cfb8" +#define NID_des_ede3_cfb8 659 + +#define OBJ_nist_hashalgs OBJ_nistAlgorithms,2L + +#define SN_sha256 "SHA256" +#define LN_sha256 "sha256" +#define NID_sha256 672 +#define OBJ_sha256 OBJ_nist_hashalgs,1L + +#define SN_sha384 "SHA384" +#define LN_sha384 "sha384" +#define NID_sha384 673 +#define OBJ_sha384 OBJ_nist_hashalgs,2L + +#define SN_sha512 "SHA512" +#define LN_sha512 "sha512" +#define NID_sha512 674 +#define OBJ_sha512 OBJ_nist_hashalgs,3L + +#define SN_sha224 "SHA224" +#define LN_sha224 "sha224" +#define NID_sha224 675 +#define OBJ_sha224 OBJ_nist_hashalgs,4L + +#define SN_sha512_224 "SHA512-224" +#define LN_sha512_224 "sha512-224" +#define NID_sha512_224 1094 +#define OBJ_sha512_224 OBJ_nist_hashalgs,5L + +#define SN_sha512_256 "SHA512-256" +#define LN_sha512_256 "sha512-256" +#define NID_sha512_256 1095 +#define OBJ_sha512_256 OBJ_nist_hashalgs,6L + +#define SN_sha3_224 "SHA3-224" +#define LN_sha3_224 "sha3-224" +#define NID_sha3_224 1096 +#define OBJ_sha3_224 OBJ_nist_hashalgs,7L + +#define SN_sha3_256 "SHA3-256" +#define LN_sha3_256 "sha3-256" +#define NID_sha3_256 1097 +#define OBJ_sha3_256 OBJ_nist_hashalgs,8L + +#define SN_sha3_384 "SHA3-384" +#define LN_sha3_384 "sha3-384" +#define NID_sha3_384 1098 +#define OBJ_sha3_384 OBJ_nist_hashalgs,9L + +#define SN_sha3_512 "SHA3-512" +#define LN_sha3_512 "sha3-512" +#define NID_sha3_512 1099 +#define OBJ_sha3_512 OBJ_nist_hashalgs,10L + +#define SN_shake128 "SHAKE128" +#define LN_shake128 "shake128" +#define NID_shake128 1100 +#define OBJ_shake128 OBJ_nist_hashalgs,11L + +#define SN_shake256 "SHAKE256" +#define LN_shake256 "shake256" +#define NID_shake256 1101 +#define OBJ_shake256 OBJ_nist_hashalgs,12L + +#define SN_hmac_sha3_224 "id-hmacWithSHA3-224" +#define LN_hmac_sha3_224 "hmac-sha3-224" +#define NID_hmac_sha3_224 1102 +#define OBJ_hmac_sha3_224 OBJ_nist_hashalgs,13L + +#define SN_hmac_sha3_256 "id-hmacWithSHA3-256" +#define LN_hmac_sha3_256 "hmac-sha3-256" +#define NID_hmac_sha3_256 1103 +#define OBJ_hmac_sha3_256 OBJ_nist_hashalgs,14L + +#define SN_hmac_sha3_384 "id-hmacWithSHA3-384" +#define LN_hmac_sha3_384 "hmac-sha3-384" +#define NID_hmac_sha3_384 1104 +#define OBJ_hmac_sha3_384 OBJ_nist_hashalgs,15L + +#define SN_hmac_sha3_512 "id-hmacWithSHA3-512" +#define LN_hmac_sha3_512 "hmac-sha3-512" +#define NID_hmac_sha3_512 1105 +#define OBJ_hmac_sha3_512 OBJ_nist_hashalgs,16L + +#define SN_kmac128 "KMAC128" +#define LN_kmac128 "kmac128" +#define NID_kmac128 1196 +#define OBJ_kmac128 OBJ_nist_hashalgs,19L + +#define SN_kmac256 "KMAC256" +#define LN_kmac256 "kmac256" +#define NID_kmac256 1197 +#define OBJ_kmac256 OBJ_nist_hashalgs,20L + +#define OBJ_dsa_with_sha2 OBJ_nistAlgorithms,3L + +#define SN_dsa_with_SHA224 "dsa_with_SHA224" +#define NID_dsa_with_SHA224 802 +#define OBJ_dsa_with_SHA224 OBJ_dsa_with_sha2,1L + +#define SN_dsa_with_SHA256 "dsa_with_SHA256" +#define NID_dsa_with_SHA256 803 +#define OBJ_dsa_with_SHA256 OBJ_dsa_with_sha2,2L + +#define OBJ_sigAlgs OBJ_nistAlgorithms,3L + +#define SN_dsa_with_SHA384 "id-dsa-with-sha384" +#define LN_dsa_with_SHA384 "dsa_with_SHA384" +#define NID_dsa_with_SHA384 1106 +#define OBJ_dsa_with_SHA384 OBJ_sigAlgs,3L + +#define SN_dsa_with_SHA512 "id-dsa-with-sha512" +#define LN_dsa_with_SHA512 "dsa_with_SHA512" +#define NID_dsa_with_SHA512 1107 +#define OBJ_dsa_with_SHA512 OBJ_sigAlgs,4L + +#define SN_dsa_with_SHA3_224 "id-dsa-with-sha3-224" +#define LN_dsa_with_SHA3_224 "dsa_with_SHA3-224" +#define NID_dsa_with_SHA3_224 1108 +#define OBJ_dsa_with_SHA3_224 OBJ_sigAlgs,5L + +#define SN_dsa_with_SHA3_256 "id-dsa-with-sha3-256" +#define LN_dsa_with_SHA3_256 "dsa_with_SHA3-256" +#define NID_dsa_with_SHA3_256 1109 +#define OBJ_dsa_with_SHA3_256 OBJ_sigAlgs,6L + +#define SN_dsa_with_SHA3_384 "id-dsa-with-sha3-384" +#define LN_dsa_with_SHA3_384 "dsa_with_SHA3-384" +#define NID_dsa_with_SHA3_384 1110 +#define OBJ_dsa_with_SHA3_384 OBJ_sigAlgs,7L + +#define SN_dsa_with_SHA3_512 "id-dsa-with-sha3-512" +#define LN_dsa_with_SHA3_512 "dsa_with_SHA3-512" +#define NID_dsa_with_SHA3_512 1111 +#define OBJ_dsa_with_SHA3_512 OBJ_sigAlgs,8L + +#define SN_ecdsa_with_SHA3_224 "id-ecdsa-with-sha3-224" +#define LN_ecdsa_with_SHA3_224 "ecdsa_with_SHA3-224" +#define NID_ecdsa_with_SHA3_224 1112 +#define OBJ_ecdsa_with_SHA3_224 OBJ_sigAlgs,9L + +#define SN_ecdsa_with_SHA3_256 "id-ecdsa-with-sha3-256" +#define LN_ecdsa_with_SHA3_256 "ecdsa_with_SHA3-256" +#define NID_ecdsa_with_SHA3_256 1113 +#define OBJ_ecdsa_with_SHA3_256 OBJ_sigAlgs,10L + +#define SN_ecdsa_with_SHA3_384 "id-ecdsa-with-sha3-384" +#define LN_ecdsa_with_SHA3_384 "ecdsa_with_SHA3-384" +#define NID_ecdsa_with_SHA3_384 1114 +#define OBJ_ecdsa_with_SHA3_384 OBJ_sigAlgs,11L + +#define SN_ecdsa_with_SHA3_512 "id-ecdsa-with-sha3-512" +#define LN_ecdsa_with_SHA3_512 "ecdsa_with_SHA3-512" +#define NID_ecdsa_with_SHA3_512 1115 +#define OBJ_ecdsa_with_SHA3_512 OBJ_sigAlgs,12L + +#define SN_RSA_SHA3_224 "id-rsassa-pkcs1-v1_5-with-sha3-224" +#define LN_RSA_SHA3_224 "RSA-SHA3-224" +#define NID_RSA_SHA3_224 1116 +#define OBJ_RSA_SHA3_224 OBJ_sigAlgs,13L + +#define SN_RSA_SHA3_256 "id-rsassa-pkcs1-v1_5-with-sha3-256" +#define LN_RSA_SHA3_256 "RSA-SHA3-256" +#define NID_RSA_SHA3_256 1117 +#define OBJ_RSA_SHA3_256 OBJ_sigAlgs,14L + +#define SN_RSA_SHA3_384 "id-rsassa-pkcs1-v1_5-with-sha3-384" +#define LN_RSA_SHA3_384 "RSA-SHA3-384" +#define NID_RSA_SHA3_384 1118 +#define OBJ_RSA_SHA3_384 OBJ_sigAlgs,15L + +#define SN_RSA_SHA3_512 "id-rsassa-pkcs1-v1_5-with-sha3-512" +#define LN_RSA_SHA3_512 "RSA-SHA3-512" +#define NID_RSA_SHA3_512 1119 +#define OBJ_RSA_SHA3_512 OBJ_sigAlgs,16L + +#define SN_ML_DSA_44 "id-ml-dsa-44" +#define LN_ML_DSA_44 "ML-DSA-44" +#define NID_ML_DSA_44 1457 +#define OBJ_ML_DSA_44 OBJ_sigAlgs,17L + +#define SN_ML_DSA_65 "id-ml-dsa-65" +#define LN_ML_DSA_65 "ML-DSA-65" +#define NID_ML_DSA_65 1458 +#define OBJ_ML_DSA_65 OBJ_sigAlgs,18L + +#define SN_ML_DSA_87 "id-ml-dsa-87" +#define LN_ML_DSA_87 "ML-DSA-87" +#define NID_ML_DSA_87 1459 +#define OBJ_ML_DSA_87 OBJ_sigAlgs,19L + +#define SN_SLH_DSA_SHA2_128s "id-slh-dsa-sha2-128s" +#define LN_SLH_DSA_SHA2_128s "SLH-DSA-SHA2-128s" +#define NID_SLH_DSA_SHA2_128s 1460 +#define OBJ_SLH_DSA_SHA2_128s OBJ_sigAlgs,20L + +#define SN_SLH_DSA_SHA2_128f "id-slh-dsa-sha2-128f" +#define LN_SLH_DSA_SHA2_128f "SLH-DSA-SHA2-128f" +#define NID_SLH_DSA_SHA2_128f 1461 +#define OBJ_SLH_DSA_SHA2_128f OBJ_sigAlgs,21L + +#define SN_SLH_DSA_SHA2_192s "id-slh-dsa-sha2-192s" +#define LN_SLH_DSA_SHA2_192s "SLH-DSA-SHA2-192s" +#define NID_SLH_DSA_SHA2_192s 1462 +#define OBJ_SLH_DSA_SHA2_192s OBJ_sigAlgs,22L + +#define SN_SLH_DSA_SHA2_192f "id-slh-dsa-sha2-192f" +#define LN_SLH_DSA_SHA2_192f "SLH-DSA-SHA2-192f" +#define NID_SLH_DSA_SHA2_192f 1463 +#define OBJ_SLH_DSA_SHA2_192f OBJ_sigAlgs,23L + +#define SN_SLH_DSA_SHA2_256s "id-slh-dsa-sha2-256s" +#define LN_SLH_DSA_SHA2_256s "SLH-DSA-SHA2-256s" +#define NID_SLH_DSA_SHA2_256s 1464 +#define OBJ_SLH_DSA_SHA2_256s OBJ_sigAlgs,24L + +#define SN_SLH_DSA_SHA2_256f "id-slh-dsa-sha2-256f" +#define LN_SLH_DSA_SHA2_256f "SLH-DSA-SHA2-256f" +#define NID_SLH_DSA_SHA2_256f 1465 +#define OBJ_SLH_DSA_SHA2_256f OBJ_sigAlgs,25L + +#define SN_SLH_DSA_SHAKE_128s "id-slh-dsa-shake-128s" +#define LN_SLH_DSA_SHAKE_128s "SLH-DSA-SHAKE-128s" +#define NID_SLH_DSA_SHAKE_128s 1466 +#define OBJ_SLH_DSA_SHAKE_128s OBJ_sigAlgs,26L + +#define SN_SLH_DSA_SHAKE_128f "id-slh-dsa-shake-128f" +#define LN_SLH_DSA_SHAKE_128f "SLH-DSA-SHAKE-128f" +#define NID_SLH_DSA_SHAKE_128f 1467 +#define OBJ_SLH_DSA_SHAKE_128f OBJ_sigAlgs,27L + +#define SN_SLH_DSA_SHAKE_192s "id-slh-dsa-shake-192s" +#define LN_SLH_DSA_SHAKE_192s "SLH-DSA-SHAKE-192s" +#define NID_SLH_DSA_SHAKE_192s 1468 +#define OBJ_SLH_DSA_SHAKE_192s OBJ_sigAlgs,28L + +#define SN_SLH_DSA_SHAKE_192f "id-slh-dsa-shake-192f" +#define LN_SLH_DSA_SHAKE_192f "SLH-DSA-SHAKE-192f" +#define NID_SLH_DSA_SHAKE_192f 1469 +#define OBJ_SLH_DSA_SHAKE_192f OBJ_sigAlgs,29L + +#define SN_SLH_DSA_SHAKE_256s "id-slh-dsa-shake-256s" +#define LN_SLH_DSA_SHAKE_256s "SLH-DSA-SHAKE-256s" +#define NID_SLH_DSA_SHAKE_256s 1470 +#define OBJ_SLH_DSA_SHAKE_256s OBJ_sigAlgs,30L + +#define SN_SLH_DSA_SHAKE_256f "id-slh-dsa-shake-256f" +#define LN_SLH_DSA_SHAKE_256f "SLH-DSA-SHAKE-256f" +#define NID_SLH_DSA_SHAKE_256f 1471 +#define OBJ_SLH_DSA_SHAKE_256f OBJ_sigAlgs,31L + +#define SN_HASH_ML_DSA_44_WITH_SHA512 "id-hash-ml-dsa-44-with-sha512" +#define LN_HASH_ML_DSA_44_WITH_SHA512 "HASH-ML-DSA-44-WITH-SHA512" +#define NID_HASH_ML_DSA_44_WITH_SHA512 1472 +#define OBJ_HASH_ML_DSA_44_WITH_SHA512 OBJ_sigAlgs,32L + +#define SN_HASH_ML_DSA_65_WITH_SHA512 "id-hash-ml-dsa-65-with-sha512" +#define LN_HASH_ML_DSA_65_WITH_SHA512 "HASH-ML-DSA-65-WITH-SHA512" +#define NID_HASH_ML_DSA_65_WITH_SHA512 1473 +#define OBJ_HASH_ML_DSA_65_WITH_SHA512 OBJ_sigAlgs,33L + +#define SN_HASH_ML_DSA_87_WITH_SHA512 "id-hash-ml-dsa-87-with-sha512" +#define LN_HASH_ML_DSA_87_WITH_SHA512 "HASH-ML-DSA-87-WITH-SHA512" +#define NID_HASH_ML_DSA_87_WITH_SHA512 1474 +#define OBJ_HASH_ML_DSA_87_WITH_SHA512 OBJ_sigAlgs,34L + +#define SN_SLH_DSA_SHA2_128s_WITH_SHA256 "id-hash-slh-dsa-sha2-128s-with-sha256" +#define LN_SLH_DSA_SHA2_128s_WITH_SHA256 "SLH-DSA-SHA2-128s-WITH-SHA256" +#define NID_SLH_DSA_SHA2_128s_WITH_SHA256 1475 +#define OBJ_SLH_DSA_SHA2_128s_WITH_SHA256 OBJ_sigAlgs,35L + +#define SN_SLH_DSA_SHA2_128f_WITH_SHA256 "id-hash-slh-dsa-sha2-128f-with-sha256" +#define LN_SLH_DSA_SHA2_128f_WITH_SHA256 "SLH-DSA-SHA2-128f-WITH-SHA256" +#define NID_SLH_DSA_SHA2_128f_WITH_SHA256 1476 +#define OBJ_SLH_DSA_SHA2_128f_WITH_SHA256 OBJ_sigAlgs,36L + +#define SN_SLH_DSA_SHA2_192s_WITH_SHA512 "id-hash-slh-dsa-sha2-192s-with-sha512" +#define LN_SLH_DSA_SHA2_192s_WITH_SHA512 "SLH-DSA-SHA2-192s-WITH-SHA512" +#define NID_SLH_DSA_SHA2_192s_WITH_SHA512 1477 +#define OBJ_SLH_DSA_SHA2_192s_WITH_SHA512 OBJ_sigAlgs,37L + +#define SN_SLH_DSA_SHA2_192f_WITH_SHA512 "id-hash-slh-dsa-sha2-192f-with-sha512" +#define LN_SLH_DSA_SHA2_192f_WITH_SHA512 "SLH-DSA-SHA2-192f-WITH-SHA512" +#define NID_SLH_DSA_SHA2_192f_WITH_SHA512 1478 +#define OBJ_SLH_DSA_SHA2_192f_WITH_SHA512 OBJ_sigAlgs,38L + +#define SN_SLH_DSA_SHA2_256s_WITH_SHA512 "id-hash-slh-dsa-sha2-256s-with-sha512" +#define LN_SLH_DSA_SHA2_256s_WITH_SHA512 "SLH-DSA-SHA2-256s-WITH-SHA512" +#define NID_SLH_DSA_SHA2_256s_WITH_SHA512 1479 +#define OBJ_SLH_DSA_SHA2_256s_WITH_SHA512 OBJ_sigAlgs,39L + +#define SN_SLH_DSA_SHA2_256f_WITH_SHA512 "id-hash-slh-dsa-sha2-256f-with-sha512" +#define LN_SLH_DSA_SHA2_256f_WITH_SHA512 "SLH-DSA-SHA2-256f-WITH-SHA512" +#define NID_SLH_DSA_SHA2_256f_WITH_SHA512 1480 +#define OBJ_SLH_DSA_SHA2_256f_WITH_SHA512 OBJ_sigAlgs,40L + +#define SN_SLH_DSA_SHAKE_128s_WITH_SHAKE128 "id-hash-slh-dsa-shake-128s-with-shake128" +#define LN_SLH_DSA_SHAKE_128s_WITH_SHAKE128 "SLH-DSA-SHAKE-128s-WITH-SHAKE128" +#define NID_SLH_DSA_SHAKE_128s_WITH_SHAKE128 1481 +#define OBJ_SLH_DSA_SHAKE_128s_WITH_SHAKE128 OBJ_sigAlgs,41L + +#define SN_SLH_DSA_SHAKE_128f_WITH_SHAKE128 "id-hash-slh-dsa-shake-128f-with-shake128" +#define LN_SLH_DSA_SHAKE_128f_WITH_SHAKE128 "SLH-DSA-SHAKE-128f-WITH-SHAKE128" +#define NID_SLH_DSA_SHAKE_128f_WITH_SHAKE128 1482 +#define OBJ_SLH_DSA_SHAKE_128f_WITH_SHAKE128 OBJ_sigAlgs,42L + +#define SN_SLH_DSA_SHAKE_192s_WITH_SHAKE256 "id-hash-slh-dsa-shake-192s-with-shake256" +#define LN_SLH_DSA_SHAKE_192s_WITH_SHAKE256 "SLH-DSA-SHAKE-192s-WITH-SHAKE256" +#define NID_SLH_DSA_SHAKE_192s_WITH_SHAKE256 1483 +#define OBJ_SLH_DSA_SHAKE_192s_WITH_SHAKE256 OBJ_sigAlgs,43L + +#define SN_SLH_DSA_SHAKE_192f_WITH_SHAKE256 "id-hash-slh-dsa-shake-192f-with-shake256" +#define LN_SLH_DSA_SHAKE_192f_WITH_SHAKE256 "SLH-DSA-SHAKE-192f-WITH-SHAKE256" +#define NID_SLH_DSA_SHAKE_192f_WITH_SHAKE256 1484 +#define OBJ_SLH_DSA_SHAKE_192f_WITH_SHAKE256 OBJ_sigAlgs,44L + +#define SN_SLH_DSA_SHAKE_256s_WITH_SHAKE256 "id-hash-slh-dsa-shake-256s-with-shake256" +#define LN_SLH_DSA_SHAKE_256s_WITH_SHAKE256 "SLH-DSA-SHAKE-256s-WITH-SHAKE256" +#define NID_SLH_DSA_SHAKE_256s_WITH_SHAKE256 1485 +#define OBJ_SLH_DSA_SHAKE_256s_WITH_SHAKE256 OBJ_sigAlgs,45L + +#define SN_SLH_DSA_SHAKE_256f_WITH_SHAKE256 "id-hash-slh-dsa-shake-256f-with-shake256" +#define LN_SLH_DSA_SHAKE_256f_WITH_SHAKE256 "SLH-DSA-SHAKE-256f-WITH-SHAKE256" +#define NID_SLH_DSA_SHAKE_256f_WITH_SHAKE256 1486 +#define OBJ_SLH_DSA_SHAKE_256f_WITH_SHAKE256 OBJ_sigAlgs,46L + +#define SN_hold_instruction_code "holdInstructionCode" +#define LN_hold_instruction_code "Hold Instruction Code" +#define NID_hold_instruction_code 430 +#define OBJ_hold_instruction_code OBJ_id_ce,23L + +#define OBJ_holdInstruction OBJ_X9_57,2L + +#define SN_hold_instruction_none "holdInstructionNone" +#define LN_hold_instruction_none "Hold Instruction None" +#define NID_hold_instruction_none 431 +#define OBJ_hold_instruction_none OBJ_holdInstruction,1L + +#define SN_hold_instruction_call_issuer "holdInstructionCallIssuer" +#define LN_hold_instruction_call_issuer "Hold Instruction Call Issuer" +#define NID_hold_instruction_call_issuer 432 +#define OBJ_hold_instruction_call_issuer OBJ_holdInstruction,2L + +#define SN_hold_instruction_reject "holdInstructionReject" +#define LN_hold_instruction_reject "Hold Instruction Reject" +#define NID_hold_instruction_reject 433 +#define OBJ_hold_instruction_reject OBJ_holdInstruction,3L + +#define SN_itu_t_identified_organization "itu-t-identified-organization" +#define NID_itu_t_identified_organization 1264 +#define OBJ_itu_t_identified_organization OBJ_itu_t,4L + +#define SN_etsi "etsi" +#define NID_etsi 1265 +#define OBJ_etsi OBJ_itu_t_identified_organization,0L + +#define SN_electronic_signature_standard "electronic-signature-standard" +#define NID_electronic_signature_standard 1266 +#define OBJ_electronic_signature_standard OBJ_etsi,1733L + +#define SN_ess_attributes "ess-attributes" +#define NID_ess_attributes 1267 +#define OBJ_ess_attributes OBJ_electronic_signature_standard,2L + +#define SN_id_aa_ets_mimeType "id-aa-ets-mimeType" +#define NID_id_aa_ets_mimeType 1268 +#define OBJ_id_aa_ets_mimeType OBJ_ess_attributes,1L + +#define SN_id_aa_ets_longTermValidation "id-aa-ets-longTermValidation" +#define NID_id_aa_ets_longTermValidation 1269 +#define OBJ_id_aa_ets_longTermValidation OBJ_ess_attributes,2L + +#define SN_id_aa_ets_SignaturePolicyDocument "id-aa-ets-SignaturePolicyDocument" +#define NID_id_aa_ets_SignaturePolicyDocument 1270 +#define OBJ_id_aa_ets_SignaturePolicyDocument OBJ_ess_attributes,3L + +#define SN_id_aa_ets_archiveTimestampV3 "id-aa-ets-archiveTimestampV3" +#define NID_id_aa_ets_archiveTimestampV3 1271 +#define OBJ_id_aa_ets_archiveTimestampV3 OBJ_ess_attributes,4L + +#define SN_id_aa_ATSHashIndex "id-aa-ATSHashIndex" +#define NID_id_aa_ATSHashIndex 1272 +#define OBJ_id_aa_ATSHashIndex OBJ_ess_attributes,5L + +#define SN_cades "cades" +#define NID_cades 1273 +#define OBJ_cades OBJ_etsi,19122L + +#define SN_cades_attributes "cades-attributes" +#define NID_cades_attributes 1274 +#define OBJ_cades_attributes OBJ_cades,1L + +#define SN_id_aa_ets_signerAttrV2 "id-aa-ets-signerAttrV2" +#define NID_id_aa_ets_signerAttrV2 1275 +#define OBJ_id_aa_ets_signerAttrV2 OBJ_cades_attributes,1L + +#define SN_id_aa_ets_sigPolicyStore "id-aa-ets-sigPolicyStore" +#define NID_id_aa_ets_sigPolicyStore 1276 +#define OBJ_id_aa_ets_sigPolicyStore OBJ_cades_attributes,3L + +#define SN_id_aa_ATSHashIndex_v2 "id-aa-ATSHashIndex-v2" +#define NID_id_aa_ATSHashIndex_v2 1277 +#define OBJ_id_aa_ATSHashIndex_v2 OBJ_cades_attributes,4L + +#define SN_id_aa_ATSHashIndex_v3 "id-aa-ATSHashIndex-v3" +#define NID_id_aa_ATSHashIndex_v3 1278 +#define OBJ_id_aa_ATSHashIndex_v3 OBJ_cades_attributes,5L + +#define SN_signedAssertion "signedAssertion" +#define NID_signedAssertion 1279 +#define OBJ_signedAssertion OBJ_cades_attributes,6L + +#define SN_data "data" +#define NID_data 434 +#define OBJ_data OBJ_itu_t,9L + +#define SN_pss "pss" +#define NID_pss 435 +#define OBJ_pss OBJ_data,2342L + +#define SN_ucl "ucl" +#define NID_ucl 436 +#define OBJ_ucl OBJ_pss,19200300L + +#define SN_pilot "pilot" +#define NID_pilot 437 +#define OBJ_pilot OBJ_ucl,100L + +#define LN_pilotAttributeType "pilotAttributeType" +#define NID_pilotAttributeType 438 +#define OBJ_pilotAttributeType OBJ_pilot,1L + +#define LN_pilotAttributeSyntax "pilotAttributeSyntax" +#define NID_pilotAttributeSyntax 439 +#define OBJ_pilotAttributeSyntax OBJ_pilot,3L + +#define LN_pilotObjectClass "pilotObjectClass" +#define NID_pilotObjectClass 440 +#define OBJ_pilotObjectClass OBJ_pilot,4L + +#define LN_pilotGroups "pilotGroups" +#define NID_pilotGroups 441 +#define OBJ_pilotGroups OBJ_pilot,10L + +#define LN_iA5StringSyntax "iA5StringSyntax" +#define NID_iA5StringSyntax 442 +#define OBJ_iA5StringSyntax OBJ_pilotAttributeSyntax,4L + +#define LN_caseIgnoreIA5StringSyntax "caseIgnoreIA5StringSyntax" +#define NID_caseIgnoreIA5StringSyntax 443 +#define OBJ_caseIgnoreIA5StringSyntax OBJ_pilotAttributeSyntax,5L + +#define LN_pilotObject "pilotObject" +#define NID_pilotObject 444 +#define OBJ_pilotObject OBJ_pilotObjectClass,3L + +#define LN_pilotPerson "pilotPerson" +#define NID_pilotPerson 445 +#define OBJ_pilotPerson OBJ_pilotObjectClass,4L + +#define SN_account "account" +#define NID_account 446 +#define OBJ_account OBJ_pilotObjectClass,5L + +#define SN_document "document" +#define NID_document 447 +#define OBJ_document OBJ_pilotObjectClass,6L + +#define SN_room "room" +#define NID_room 448 +#define OBJ_room OBJ_pilotObjectClass,7L + +#define LN_documentSeries "documentSeries" +#define NID_documentSeries 449 +#define OBJ_documentSeries OBJ_pilotObjectClass,9L + +#define SN_Domain "domain" +#define LN_Domain "Domain" +#define NID_Domain 392 +#define OBJ_Domain OBJ_pilotObjectClass,13L + +#define LN_rFC822localPart "rFC822localPart" +#define NID_rFC822localPart 450 +#define OBJ_rFC822localPart OBJ_pilotObjectClass,14L + +#define LN_dNSDomain "dNSDomain" +#define NID_dNSDomain 451 +#define OBJ_dNSDomain OBJ_pilotObjectClass,15L + +#define LN_domainRelatedObject "domainRelatedObject" +#define NID_domainRelatedObject 452 +#define OBJ_domainRelatedObject OBJ_pilotObjectClass,17L + +#define LN_friendlyCountry "friendlyCountry" +#define NID_friendlyCountry 453 +#define OBJ_friendlyCountry OBJ_pilotObjectClass,18L + +#define LN_simpleSecurityObject "simpleSecurityObject" +#define NID_simpleSecurityObject 454 +#define OBJ_simpleSecurityObject OBJ_pilotObjectClass,19L + +#define LN_pilotOrganization "pilotOrganization" +#define NID_pilotOrganization 455 +#define OBJ_pilotOrganization OBJ_pilotObjectClass,20L + +#define LN_pilotDSA "pilotDSA" +#define NID_pilotDSA 456 +#define OBJ_pilotDSA OBJ_pilotObjectClass,21L + +#define LN_qualityLabelledData "qualityLabelledData" +#define NID_qualityLabelledData 457 +#define OBJ_qualityLabelledData OBJ_pilotObjectClass,22L + +#define SN_userId "UID" +#define LN_userId "userId" +#define NID_userId 458 +#define OBJ_userId OBJ_pilotAttributeType,1L + +#define LN_textEncodedORAddress "textEncodedORAddress" +#define NID_textEncodedORAddress 459 +#define OBJ_textEncodedORAddress OBJ_pilotAttributeType,2L + +#define SN_rfc822Mailbox "mail" +#define LN_rfc822Mailbox "rfc822Mailbox" +#define NID_rfc822Mailbox 460 +#define OBJ_rfc822Mailbox OBJ_pilotAttributeType,3L + +#define SN_info "info" +#define NID_info 461 +#define OBJ_info OBJ_pilotAttributeType,4L + +#define LN_favouriteDrink "favouriteDrink" +#define NID_favouriteDrink 462 +#define OBJ_favouriteDrink OBJ_pilotAttributeType,5L + +#define LN_roomNumber "roomNumber" +#define NID_roomNumber 463 +#define OBJ_roomNumber OBJ_pilotAttributeType,6L + +#define SN_photo "photo" +#define NID_photo 464 +#define OBJ_photo OBJ_pilotAttributeType,7L + +#define LN_userClass "userClass" +#define NID_userClass 465 +#define OBJ_userClass OBJ_pilotAttributeType,8L + +#define SN_host "host" +#define NID_host 466 +#define OBJ_host OBJ_pilotAttributeType,9L + +#define SN_manager "manager" +#define NID_manager 467 +#define OBJ_manager OBJ_pilotAttributeType,10L + +#define LN_documentIdentifier "documentIdentifier" +#define NID_documentIdentifier 468 +#define OBJ_documentIdentifier OBJ_pilotAttributeType,11L + +#define LN_documentTitle "documentTitle" +#define NID_documentTitle 469 +#define OBJ_documentTitle OBJ_pilotAttributeType,12L + +#define LN_documentVersion "documentVersion" +#define NID_documentVersion 470 +#define OBJ_documentVersion OBJ_pilotAttributeType,13L + +#define LN_documentAuthor "documentAuthor" +#define NID_documentAuthor 471 +#define OBJ_documentAuthor OBJ_pilotAttributeType,14L + +#define LN_documentLocation "documentLocation" +#define NID_documentLocation 472 +#define OBJ_documentLocation OBJ_pilotAttributeType,15L + +#define LN_homeTelephoneNumber "homeTelephoneNumber" +#define NID_homeTelephoneNumber 473 +#define OBJ_homeTelephoneNumber OBJ_pilotAttributeType,20L + +#define SN_secretary "secretary" +#define NID_secretary 474 +#define OBJ_secretary OBJ_pilotAttributeType,21L + +#define LN_otherMailbox "otherMailbox" +#define NID_otherMailbox 475 +#define OBJ_otherMailbox OBJ_pilotAttributeType,22L + +#define LN_lastModifiedTime "lastModifiedTime" +#define NID_lastModifiedTime 476 +#define OBJ_lastModifiedTime OBJ_pilotAttributeType,23L + +#define LN_lastModifiedBy "lastModifiedBy" +#define NID_lastModifiedBy 477 +#define OBJ_lastModifiedBy OBJ_pilotAttributeType,24L + +#define SN_domainComponent "DC" +#define LN_domainComponent "domainComponent" +#define NID_domainComponent 391 +#define OBJ_domainComponent OBJ_pilotAttributeType,25L + +#define LN_aRecord "aRecord" +#define NID_aRecord 478 +#define OBJ_aRecord OBJ_pilotAttributeType,26L + +#define LN_pilotAttributeType27 "pilotAttributeType27" +#define NID_pilotAttributeType27 479 +#define OBJ_pilotAttributeType27 OBJ_pilotAttributeType,27L + +#define LN_mXRecord "mXRecord" +#define NID_mXRecord 480 +#define OBJ_mXRecord OBJ_pilotAttributeType,28L + +#define LN_nSRecord "nSRecord" +#define NID_nSRecord 481 +#define OBJ_nSRecord OBJ_pilotAttributeType,29L + +#define LN_sOARecord "sOARecord" +#define NID_sOARecord 482 +#define OBJ_sOARecord OBJ_pilotAttributeType,30L + +#define LN_cNAMERecord "cNAMERecord" +#define NID_cNAMERecord 483 +#define OBJ_cNAMERecord OBJ_pilotAttributeType,31L + +#define LN_associatedDomain "associatedDomain" +#define NID_associatedDomain 484 +#define OBJ_associatedDomain OBJ_pilotAttributeType,37L + +#define LN_associatedName "associatedName" +#define NID_associatedName 485 +#define OBJ_associatedName OBJ_pilotAttributeType,38L + +#define LN_homePostalAddress "homePostalAddress" +#define NID_homePostalAddress 486 +#define OBJ_homePostalAddress OBJ_pilotAttributeType,39L + +#define LN_personalTitle "personalTitle" +#define NID_personalTitle 487 +#define OBJ_personalTitle OBJ_pilotAttributeType,40L + +#define LN_mobileTelephoneNumber "mobileTelephoneNumber" +#define NID_mobileTelephoneNumber 488 +#define OBJ_mobileTelephoneNumber OBJ_pilotAttributeType,41L + +#define LN_pagerTelephoneNumber "pagerTelephoneNumber" +#define NID_pagerTelephoneNumber 489 +#define OBJ_pagerTelephoneNumber OBJ_pilotAttributeType,42L + +#define LN_friendlyCountryName "friendlyCountryName" +#define NID_friendlyCountryName 490 +#define OBJ_friendlyCountryName OBJ_pilotAttributeType,43L + +#define SN_uniqueIdentifier "uid" +#define LN_uniqueIdentifier "uniqueIdentifier" +#define NID_uniqueIdentifier 102 +#define OBJ_uniqueIdentifier OBJ_pilotAttributeType,44L + +#define LN_organizationalStatus "organizationalStatus" +#define NID_organizationalStatus 491 +#define OBJ_organizationalStatus OBJ_pilotAttributeType,45L + +#define LN_janetMailbox "janetMailbox" +#define NID_janetMailbox 492 +#define OBJ_janetMailbox OBJ_pilotAttributeType,46L + +#define LN_mailPreferenceOption "mailPreferenceOption" +#define NID_mailPreferenceOption 493 +#define OBJ_mailPreferenceOption OBJ_pilotAttributeType,47L + +#define LN_buildingName "buildingName" +#define NID_buildingName 494 +#define OBJ_buildingName OBJ_pilotAttributeType,48L + +#define LN_dSAQuality "dSAQuality" +#define NID_dSAQuality 495 +#define OBJ_dSAQuality OBJ_pilotAttributeType,49L + +#define LN_singleLevelQuality "singleLevelQuality" +#define NID_singleLevelQuality 496 +#define OBJ_singleLevelQuality OBJ_pilotAttributeType,50L + +#define LN_subtreeMinimumQuality "subtreeMinimumQuality" +#define NID_subtreeMinimumQuality 497 +#define OBJ_subtreeMinimumQuality OBJ_pilotAttributeType,51L + +#define LN_subtreeMaximumQuality "subtreeMaximumQuality" +#define NID_subtreeMaximumQuality 498 +#define OBJ_subtreeMaximumQuality OBJ_pilotAttributeType,52L + +#define LN_personalSignature "personalSignature" +#define NID_personalSignature 499 +#define OBJ_personalSignature OBJ_pilotAttributeType,53L + +#define LN_dITRedirect "dITRedirect" +#define NID_dITRedirect 500 +#define OBJ_dITRedirect OBJ_pilotAttributeType,54L + +#define SN_audio "audio" +#define NID_audio 501 +#define OBJ_audio OBJ_pilotAttributeType,55L + +#define LN_documentPublisher "documentPublisher" +#define NID_documentPublisher 502 +#define OBJ_documentPublisher OBJ_pilotAttributeType,56L + +#define SN_id_set "id-set" +#define LN_id_set "Secure Electronic Transactions" +#define NID_id_set 512 +#define OBJ_id_set OBJ_international_organizations,42L + +#define SN_set_ctype "set-ctype" +#define LN_set_ctype "content types" +#define NID_set_ctype 513 +#define OBJ_set_ctype OBJ_id_set,0L + +#define SN_set_msgExt "set-msgExt" +#define LN_set_msgExt "message extensions" +#define NID_set_msgExt 514 +#define OBJ_set_msgExt OBJ_id_set,1L + +#define SN_set_attr "set-attr" +#define NID_set_attr 515 +#define OBJ_set_attr OBJ_id_set,3L + +#define SN_set_policy "set-policy" +#define NID_set_policy 516 +#define OBJ_set_policy OBJ_id_set,5L + +#define SN_set_certExt "set-certExt" +#define LN_set_certExt "certificate extensions" +#define NID_set_certExt 517 +#define OBJ_set_certExt OBJ_id_set,7L + +#define SN_set_brand "set-brand" +#define NID_set_brand 518 +#define OBJ_set_brand OBJ_id_set,8L + +#define SN_setct_PANData "setct-PANData" +#define NID_setct_PANData 519 +#define OBJ_setct_PANData OBJ_set_ctype,0L + +#define SN_setct_PANToken "setct-PANToken" +#define NID_setct_PANToken 520 +#define OBJ_setct_PANToken OBJ_set_ctype,1L + +#define SN_setct_PANOnly "setct-PANOnly" +#define NID_setct_PANOnly 521 +#define OBJ_setct_PANOnly OBJ_set_ctype,2L + +#define SN_setct_OIData "setct-OIData" +#define NID_setct_OIData 522 +#define OBJ_setct_OIData OBJ_set_ctype,3L + +#define SN_setct_PI "setct-PI" +#define NID_setct_PI 523 +#define OBJ_setct_PI OBJ_set_ctype,4L + +#define SN_setct_PIData "setct-PIData" +#define NID_setct_PIData 524 +#define OBJ_setct_PIData OBJ_set_ctype,5L + +#define SN_setct_PIDataUnsigned "setct-PIDataUnsigned" +#define NID_setct_PIDataUnsigned 525 +#define OBJ_setct_PIDataUnsigned OBJ_set_ctype,6L + +#define SN_setct_HODInput "setct-HODInput" +#define NID_setct_HODInput 526 +#define OBJ_setct_HODInput OBJ_set_ctype,7L + +#define SN_setct_AuthResBaggage "setct-AuthResBaggage" +#define NID_setct_AuthResBaggage 527 +#define OBJ_setct_AuthResBaggage OBJ_set_ctype,8L + +#define SN_setct_AuthRevReqBaggage "setct-AuthRevReqBaggage" +#define NID_setct_AuthRevReqBaggage 528 +#define OBJ_setct_AuthRevReqBaggage OBJ_set_ctype,9L + +#define SN_setct_AuthRevResBaggage "setct-AuthRevResBaggage" +#define NID_setct_AuthRevResBaggage 529 +#define OBJ_setct_AuthRevResBaggage OBJ_set_ctype,10L + +#define SN_setct_CapTokenSeq "setct-CapTokenSeq" +#define NID_setct_CapTokenSeq 530 +#define OBJ_setct_CapTokenSeq OBJ_set_ctype,11L + +#define SN_setct_PInitResData "setct-PInitResData" +#define NID_setct_PInitResData 531 +#define OBJ_setct_PInitResData OBJ_set_ctype,12L + +#define SN_setct_PI_TBS "setct-PI-TBS" +#define NID_setct_PI_TBS 532 +#define OBJ_setct_PI_TBS OBJ_set_ctype,13L + +#define SN_setct_PResData "setct-PResData" +#define NID_setct_PResData 533 +#define OBJ_setct_PResData OBJ_set_ctype,14L + +#define SN_setct_AuthReqTBS "setct-AuthReqTBS" +#define NID_setct_AuthReqTBS 534 +#define OBJ_setct_AuthReqTBS OBJ_set_ctype,16L + +#define SN_setct_AuthResTBS "setct-AuthResTBS" +#define NID_setct_AuthResTBS 535 +#define OBJ_setct_AuthResTBS OBJ_set_ctype,17L + +#define SN_setct_AuthResTBSX "setct-AuthResTBSX" +#define NID_setct_AuthResTBSX 536 +#define OBJ_setct_AuthResTBSX OBJ_set_ctype,18L + +#define SN_setct_AuthTokenTBS "setct-AuthTokenTBS" +#define NID_setct_AuthTokenTBS 537 +#define OBJ_setct_AuthTokenTBS OBJ_set_ctype,19L + +#define SN_setct_CapTokenData "setct-CapTokenData" +#define NID_setct_CapTokenData 538 +#define OBJ_setct_CapTokenData OBJ_set_ctype,20L + +#define SN_setct_CapTokenTBS "setct-CapTokenTBS" +#define NID_setct_CapTokenTBS 539 +#define OBJ_setct_CapTokenTBS OBJ_set_ctype,21L + +#define SN_setct_AcqCardCodeMsg "setct-AcqCardCodeMsg" +#define NID_setct_AcqCardCodeMsg 540 +#define OBJ_setct_AcqCardCodeMsg OBJ_set_ctype,22L + +#define SN_setct_AuthRevReqTBS "setct-AuthRevReqTBS" +#define NID_setct_AuthRevReqTBS 541 +#define OBJ_setct_AuthRevReqTBS OBJ_set_ctype,23L + +#define SN_setct_AuthRevResData "setct-AuthRevResData" +#define NID_setct_AuthRevResData 542 +#define OBJ_setct_AuthRevResData OBJ_set_ctype,24L + +#define SN_setct_AuthRevResTBS "setct-AuthRevResTBS" +#define NID_setct_AuthRevResTBS 543 +#define OBJ_setct_AuthRevResTBS OBJ_set_ctype,25L + +#define SN_setct_CapReqTBS "setct-CapReqTBS" +#define NID_setct_CapReqTBS 544 +#define OBJ_setct_CapReqTBS OBJ_set_ctype,26L + +#define SN_setct_CapReqTBSX "setct-CapReqTBSX" +#define NID_setct_CapReqTBSX 545 +#define OBJ_setct_CapReqTBSX OBJ_set_ctype,27L + +#define SN_setct_CapResData "setct-CapResData" +#define NID_setct_CapResData 546 +#define OBJ_setct_CapResData OBJ_set_ctype,28L + +#define SN_setct_CapRevReqTBS "setct-CapRevReqTBS" +#define NID_setct_CapRevReqTBS 547 +#define OBJ_setct_CapRevReqTBS OBJ_set_ctype,29L + +#define SN_setct_CapRevReqTBSX "setct-CapRevReqTBSX" +#define NID_setct_CapRevReqTBSX 548 +#define OBJ_setct_CapRevReqTBSX OBJ_set_ctype,30L + +#define SN_setct_CapRevResData "setct-CapRevResData" +#define NID_setct_CapRevResData 549 +#define OBJ_setct_CapRevResData OBJ_set_ctype,31L + +#define SN_setct_CredReqTBS "setct-CredReqTBS" +#define NID_setct_CredReqTBS 550 +#define OBJ_setct_CredReqTBS OBJ_set_ctype,32L + +#define SN_setct_CredReqTBSX "setct-CredReqTBSX" +#define NID_setct_CredReqTBSX 551 +#define OBJ_setct_CredReqTBSX OBJ_set_ctype,33L + +#define SN_setct_CredResData "setct-CredResData" +#define NID_setct_CredResData 552 +#define OBJ_setct_CredResData OBJ_set_ctype,34L + +#define SN_setct_CredRevReqTBS "setct-CredRevReqTBS" +#define NID_setct_CredRevReqTBS 553 +#define OBJ_setct_CredRevReqTBS OBJ_set_ctype,35L + +#define SN_setct_CredRevReqTBSX "setct-CredRevReqTBSX" +#define NID_setct_CredRevReqTBSX 554 +#define OBJ_setct_CredRevReqTBSX OBJ_set_ctype,36L + +#define SN_setct_CredRevResData "setct-CredRevResData" +#define NID_setct_CredRevResData 555 +#define OBJ_setct_CredRevResData OBJ_set_ctype,37L + +#define SN_setct_PCertReqData "setct-PCertReqData" +#define NID_setct_PCertReqData 556 +#define OBJ_setct_PCertReqData OBJ_set_ctype,38L + +#define SN_setct_PCertResTBS "setct-PCertResTBS" +#define NID_setct_PCertResTBS 557 +#define OBJ_setct_PCertResTBS OBJ_set_ctype,39L + +#define SN_setct_BatchAdminReqData "setct-BatchAdminReqData" +#define NID_setct_BatchAdminReqData 558 +#define OBJ_setct_BatchAdminReqData OBJ_set_ctype,40L + +#define SN_setct_BatchAdminResData "setct-BatchAdminResData" +#define NID_setct_BatchAdminResData 559 +#define OBJ_setct_BatchAdminResData OBJ_set_ctype,41L + +#define SN_setct_CardCInitResTBS "setct-CardCInitResTBS" +#define NID_setct_CardCInitResTBS 560 +#define OBJ_setct_CardCInitResTBS OBJ_set_ctype,42L + +#define SN_setct_MeAqCInitResTBS "setct-MeAqCInitResTBS" +#define NID_setct_MeAqCInitResTBS 561 +#define OBJ_setct_MeAqCInitResTBS OBJ_set_ctype,43L + +#define SN_setct_RegFormResTBS "setct-RegFormResTBS" +#define NID_setct_RegFormResTBS 562 +#define OBJ_setct_RegFormResTBS OBJ_set_ctype,44L + +#define SN_setct_CertReqData "setct-CertReqData" +#define NID_setct_CertReqData 563 +#define OBJ_setct_CertReqData OBJ_set_ctype,45L + +#define SN_setct_CertReqTBS "setct-CertReqTBS" +#define NID_setct_CertReqTBS 564 +#define OBJ_setct_CertReqTBS OBJ_set_ctype,46L + +#define SN_setct_CertResData "setct-CertResData" +#define NID_setct_CertResData 565 +#define OBJ_setct_CertResData OBJ_set_ctype,47L + +#define SN_setct_CertInqReqTBS "setct-CertInqReqTBS" +#define NID_setct_CertInqReqTBS 566 +#define OBJ_setct_CertInqReqTBS OBJ_set_ctype,48L + +#define SN_setct_ErrorTBS "setct-ErrorTBS" +#define NID_setct_ErrorTBS 567 +#define OBJ_setct_ErrorTBS OBJ_set_ctype,49L + +#define SN_setct_PIDualSignedTBE "setct-PIDualSignedTBE" +#define NID_setct_PIDualSignedTBE 568 +#define OBJ_setct_PIDualSignedTBE OBJ_set_ctype,50L + +#define SN_setct_PIUnsignedTBE "setct-PIUnsignedTBE" +#define NID_setct_PIUnsignedTBE 569 +#define OBJ_setct_PIUnsignedTBE OBJ_set_ctype,51L + +#define SN_setct_AuthReqTBE "setct-AuthReqTBE" +#define NID_setct_AuthReqTBE 570 +#define OBJ_setct_AuthReqTBE OBJ_set_ctype,52L + +#define SN_setct_AuthResTBE "setct-AuthResTBE" +#define NID_setct_AuthResTBE 571 +#define OBJ_setct_AuthResTBE OBJ_set_ctype,53L + +#define SN_setct_AuthResTBEX "setct-AuthResTBEX" +#define NID_setct_AuthResTBEX 572 +#define OBJ_setct_AuthResTBEX OBJ_set_ctype,54L + +#define SN_setct_AuthTokenTBE "setct-AuthTokenTBE" +#define NID_setct_AuthTokenTBE 573 +#define OBJ_setct_AuthTokenTBE OBJ_set_ctype,55L + +#define SN_setct_CapTokenTBE "setct-CapTokenTBE" +#define NID_setct_CapTokenTBE 574 +#define OBJ_setct_CapTokenTBE OBJ_set_ctype,56L + +#define SN_setct_CapTokenTBEX "setct-CapTokenTBEX" +#define NID_setct_CapTokenTBEX 575 +#define OBJ_setct_CapTokenTBEX OBJ_set_ctype,57L + +#define SN_setct_AcqCardCodeMsgTBE "setct-AcqCardCodeMsgTBE" +#define NID_setct_AcqCardCodeMsgTBE 576 +#define OBJ_setct_AcqCardCodeMsgTBE OBJ_set_ctype,58L + +#define SN_setct_AuthRevReqTBE "setct-AuthRevReqTBE" +#define NID_setct_AuthRevReqTBE 577 +#define OBJ_setct_AuthRevReqTBE OBJ_set_ctype,59L + +#define SN_setct_AuthRevResTBE "setct-AuthRevResTBE" +#define NID_setct_AuthRevResTBE 578 +#define OBJ_setct_AuthRevResTBE OBJ_set_ctype,60L + +#define SN_setct_AuthRevResTBEB "setct-AuthRevResTBEB" +#define NID_setct_AuthRevResTBEB 579 +#define OBJ_setct_AuthRevResTBEB OBJ_set_ctype,61L + +#define SN_setct_CapReqTBE "setct-CapReqTBE" +#define NID_setct_CapReqTBE 580 +#define OBJ_setct_CapReqTBE OBJ_set_ctype,62L + +#define SN_setct_CapReqTBEX "setct-CapReqTBEX" +#define NID_setct_CapReqTBEX 581 +#define OBJ_setct_CapReqTBEX OBJ_set_ctype,63L + +#define SN_setct_CapResTBE "setct-CapResTBE" +#define NID_setct_CapResTBE 582 +#define OBJ_setct_CapResTBE OBJ_set_ctype,64L + +#define SN_setct_CapRevReqTBE "setct-CapRevReqTBE" +#define NID_setct_CapRevReqTBE 583 +#define OBJ_setct_CapRevReqTBE OBJ_set_ctype,65L + +#define SN_setct_CapRevReqTBEX "setct-CapRevReqTBEX" +#define NID_setct_CapRevReqTBEX 584 +#define OBJ_setct_CapRevReqTBEX OBJ_set_ctype,66L + +#define SN_setct_CapRevResTBE "setct-CapRevResTBE" +#define NID_setct_CapRevResTBE 585 +#define OBJ_setct_CapRevResTBE OBJ_set_ctype,67L + +#define SN_setct_CredReqTBE "setct-CredReqTBE" +#define NID_setct_CredReqTBE 586 +#define OBJ_setct_CredReqTBE OBJ_set_ctype,68L + +#define SN_setct_CredReqTBEX "setct-CredReqTBEX" +#define NID_setct_CredReqTBEX 587 +#define OBJ_setct_CredReqTBEX OBJ_set_ctype,69L + +#define SN_setct_CredResTBE "setct-CredResTBE" +#define NID_setct_CredResTBE 588 +#define OBJ_setct_CredResTBE OBJ_set_ctype,70L + +#define SN_setct_CredRevReqTBE "setct-CredRevReqTBE" +#define NID_setct_CredRevReqTBE 589 +#define OBJ_setct_CredRevReqTBE OBJ_set_ctype,71L + +#define SN_setct_CredRevReqTBEX "setct-CredRevReqTBEX" +#define NID_setct_CredRevReqTBEX 590 +#define OBJ_setct_CredRevReqTBEX OBJ_set_ctype,72L + +#define SN_setct_CredRevResTBE "setct-CredRevResTBE" +#define NID_setct_CredRevResTBE 591 +#define OBJ_setct_CredRevResTBE OBJ_set_ctype,73L + +#define SN_setct_BatchAdminReqTBE "setct-BatchAdminReqTBE" +#define NID_setct_BatchAdminReqTBE 592 +#define OBJ_setct_BatchAdminReqTBE OBJ_set_ctype,74L + +#define SN_setct_BatchAdminResTBE "setct-BatchAdminResTBE" +#define NID_setct_BatchAdminResTBE 593 +#define OBJ_setct_BatchAdminResTBE OBJ_set_ctype,75L + +#define SN_setct_RegFormReqTBE "setct-RegFormReqTBE" +#define NID_setct_RegFormReqTBE 594 +#define OBJ_setct_RegFormReqTBE OBJ_set_ctype,76L + +#define SN_setct_CertReqTBE "setct-CertReqTBE" +#define NID_setct_CertReqTBE 595 +#define OBJ_setct_CertReqTBE OBJ_set_ctype,77L + +#define SN_setct_CertReqTBEX "setct-CertReqTBEX" +#define NID_setct_CertReqTBEX 596 +#define OBJ_setct_CertReqTBEX OBJ_set_ctype,78L + +#define SN_setct_CertResTBE "setct-CertResTBE" +#define NID_setct_CertResTBE 597 +#define OBJ_setct_CertResTBE OBJ_set_ctype,79L + +#define SN_setct_CRLNotificationTBS "setct-CRLNotificationTBS" +#define NID_setct_CRLNotificationTBS 598 +#define OBJ_setct_CRLNotificationTBS OBJ_set_ctype,80L + +#define SN_setct_CRLNotificationResTBS "setct-CRLNotificationResTBS" +#define NID_setct_CRLNotificationResTBS 599 +#define OBJ_setct_CRLNotificationResTBS OBJ_set_ctype,81L + +#define SN_setct_BCIDistributionTBS "setct-BCIDistributionTBS" +#define NID_setct_BCIDistributionTBS 600 +#define OBJ_setct_BCIDistributionTBS OBJ_set_ctype,82L + +#define SN_setext_genCrypt "setext-genCrypt" +#define LN_setext_genCrypt "generic cryptogram" +#define NID_setext_genCrypt 601 +#define OBJ_setext_genCrypt OBJ_set_msgExt,1L + +#define SN_setext_miAuth "setext-miAuth" +#define LN_setext_miAuth "merchant initiated auth" +#define NID_setext_miAuth 602 +#define OBJ_setext_miAuth OBJ_set_msgExt,3L + +#define SN_setext_pinSecure "setext-pinSecure" +#define NID_setext_pinSecure 603 +#define OBJ_setext_pinSecure OBJ_set_msgExt,4L + +#define SN_setext_pinAny "setext-pinAny" +#define NID_setext_pinAny 604 +#define OBJ_setext_pinAny OBJ_set_msgExt,5L + +#define SN_setext_track2 "setext-track2" +#define NID_setext_track2 605 +#define OBJ_setext_track2 OBJ_set_msgExt,7L + +#define SN_setext_cv "setext-cv" +#define LN_setext_cv "additional verification" +#define NID_setext_cv 606 +#define OBJ_setext_cv OBJ_set_msgExt,8L + +#define SN_set_policy_root "set-policy-root" +#define NID_set_policy_root 607 +#define OBJ_set_policy_root OBJ_set_policy,0L + +#define SN_setCext_hashedRoot "setCext-hashedRoot" +#define NID_setCext_hashedRoot 608 +#define OBJ_setCext_hashedRoot OBJ_set_certExt,0L + +#define SN_setCext_certType "setCext-certType" +#define NID_setCext_certType 609 +#define OBJ_setCext_certType OBJ_set_certExt,1L + +#define SN_setCext_merchData "setCext-merchData" +#define NID_setCext_merchData 610 +#define OBJ_setCext_merchData OBJ_set_certExt,2L + +#define SN_setCext_cCertRequired "setCext-cCertRequired" +#define NID_setCext_cCertRequired 611 +#define OBJ_setCext_cCertRequired OBJ_set_certExt,3L + +#define SN_setCext_tunneling "setCext-tunneling" +#define NID_setCext_tunneling 612 +#define OBJ_setCext_tunneling OBJ_set_certExt,4L + +#define SN_setCext_setExt "setCext-setExt" +#define NID_setCext_setExt 613 +#define OBJ_setCext_setExt OBJ_set_certExt,5L + +#define SN_setCext_setQualf "setCext-setQualf" +#define NID_setCext_setQualf 614 +#define OBJ_setCext_setQualf OBJ_set_certExt,6L + +#define SN_setCext_PGWYcapabilities "setCext-PGWYcapabilities" +#define NID_setCext_PGWYcapabilities 615 +#define OBJ_setCext_PGWYcapabilities OBJ_set_certExt,7L + +#define SN_setCext_TokenIdentifier "setCext-TokenIdentifier" +#define NID_setCext_TokenIdentifier 616 +#define OBJ_setCext_TokenIdentifier OBJ_set_certExt,8L + +#define SN_setCext_Track2Data "setCext-Track2Data" +#define NID_setCext_Track2Data 617 +#define OBJ_setCext_Track2Data OBJ_set_certExt,9L + +#define SN_setCext_TokenType "setCext-TokenType" +#define NID_setCext_TokenType 618 +#define OBJ_setCext_TokenType OBJ_set_certExt,10L + +#define SN_setCext_IssuerCapabilities "setCext-IssuerCapabilities" +#define NID_setCext_IssuerCapabilities 619 +#define OBJ_setCext_IssuerCapabilities OBJ_set_certExt,11L + +#define SN_setAttr_Cert "setAttr-Cert" +#define NID_setAttr_Cert 620 +#define OBJ_setAttr_Cert OBJ_set_attr,0L + +#define SN_setAttr_PGWYcap "setAttr-PGWYcap" +#define LN_setAttr_PGWYcap "payment gateway capabilities" +#define NID_setAttr_PGWYcap 621 +#define OBJ_setAttr_PGWYcap OBJ_set_attr,1L + +#define SN_setAttr_TokenType "setAttr-TokenType" +#define NID_setAttr_TokenType 622 +#define OBJ_setAttr_TokenType OBJ_set_attr,2L + +#define SN_setAttr_IssCap "setAttr-IssCap" +#define LN_setAttr_IssCap "issuer capabilities" +#define NID_setAttr_IssCap 623 +#define OBJ_setAttr_IssCap OBJ_set_attr,3L + +#define SN_set_rootKeyThumb "set-rootKeyThumb" +#define NID_set_rootKeyThumb 624 +#define OBJ_set_rootKeyThumb OBJ_setAttr_Cert,0L + +#define SN_set_addPolicy "set-addPolicy" +#define NID_set_addPolicy 625 +#define OBJ_set_addPolicy OBJ_setAttr_Cert,1L + +#define SN_setAttr_Token_EMV "setAttr-Token-EMV" +#define NID_setAttr_Token_EMV 626 +#define OBJ_setAttr_Token_EMV OBJ_setAttr_TokenType,1L + +#define SN_setAttr_Token_B0Prime "setAttr-Token-B0Prime" +#define NID_setAttr_Token_B0Prime 627 +#define OBJ_setAttr_Token_B0Prime OBJ_setAttr_TokenType,2L + +#define SN_setAttr_IssCap_CVM "setAttr-IssCap-CVM" +#define NID_setAttr_IssCap_CVM 628 +#define OBJ_setAttr_IssCap_CVM OBJ_setAttr_IssCap,3L + +#define SN_setAttr_IssCap_T2 "setAttr-IssCap-T2" +#define NID_setAttr_IssCap_T2 629 +#define OBJ_setAttr_IssCap_T2 OBJ_setAttr_IssCap,4L + +#define SN_setAttr_IssCap_Sig "setAttr-IssCap-Sig" +#define NID_setAttr_IssCap_Sig 630 +#define OBJ_setAttr_IssCap_Sig OBJ_setAttr_IssCap,5L + +#define SN_setAttr_GenCryptgrm "setAttr-GenCryptgrm" +#define LN_setAttr_GenCryptgrm "generate cryptogram" +#define NID_setAttr_GenCryptgrm 631 +#define OBJ_setAttr_GenCryptgrm OBJ_setAttr_IssCap_CVM,1L + +#define SN_setAttr_T2Enc "setAttr-T2Enc" +#define LN_setAttr_T2Enc "encrypted track 2" +#define NID_setAttr_T2Enc 632 +#define OBJ_setAttr_T2Enc OBJ_setAttr_IssCap_T2,1L + +#define SN_setAttr_T2cleartxt "setAttr-T2cleartxt" +#define LN_setAttr_T2cleartxt "cleartext track 2" +#define NID_setAttr_T2cleartxt 633 +#define OBJ_setAttr_T2cleartxt OBJ_setAttr_IssCap_T2,2L + +#define SN_setAttr_TokICCsig "setAttr-TokICCsig" +#define LN_setAttr_TokICCsig "ICC or token signature" +#define NID_setAttr_TokICCsig 634 +#define OBJ_setAttr_TokICCsig OBJ_setAttr_IssCap_Sig,1L + +#define SN_setAttr_SecDevSig "setAttr-SecDevSig" +#define LN_setAttr_SecDevSig "secure device signature" +#define NID_setAttr_SecDevSig 635 +#define OBJ_setAttr_SecDevSig OBJ_setAttr_IssCap_Sig,2L + +#define SN_set_brand_IATA_ATA "set-brand-IATA-ATA" +#define NID_set_brand_IATA_ATA 636 +#define OBJ_set_brand_IATA_ATA OBJ_set_brand,1L + +#define SN_set_brand_Diners "set-brand-Diners" +#define NID_set_brand_Diners 637 +#define OBJ_set_brand_Diners OBJ_set_brand,30L + +#define SN_set_brand_AmericanExpress "set-brand-AmericanExpress" +#define NID_set_brand_AmericanExpress 638 +#define OBJ_set_brand_AmericanExpress OBJ_set_brand,34L + +#define SN_set_brand_JCB "set-brand-JCB" +#define NID_set_brand_JCB 639 +#define OBJ_set_brand_JCB OBJ_set_brand,35L + +#define SN_set_brand_Visa "set-brand-Visa" +#define NID_set_brand_Visa 640 +#define OBJ_set_brand_Visa OBJ_set_brand,4L + +#define SN_set_brand_MasterCard "set-brand-MasterCard" +#define NID_set_brand_MasterCard 641 +#define OBJ_set_brand_MasterCard OBJ_set_brand,5L + +#define SN_set_brand_Novus "set-brand-Novus" +#define NID_set_brand_Novus 642 +#define OBJ_set_brand_Novus OBJ_set_brand,6011L + +#define SN_des_cdmf "DES-CDMF" +#define LN_des_cdmf "des-cdmf" +#define NID_des_cdmf 643 +#define OBJ_des_cdmf OBJ_rsadsi,3L,10L + +#define SN_rsaOAEPEncryptionSET "rsaOAEPEncryptionSET" +#define NID_rsaOAEPEncryptionSET 644 +#define OBJ_rsaOAEPEncryptionSET OBJ_rsadsi,1L,1L,6L + +#define SN_ipsec3 "Oakley-EC2N-3" +#define LN_ipsec3 "ipsec3" +#define NID_ipsec3 749 + +#define SN_ipsec4 "Oakley-EC2N-4" +#define LN_ipsec4 "ipsec4" +#define NID_ipsec4 750 + +#define SN_whirlpool "whirlpool" +#define NID_whirlpool 804 +#define OBJ_whirlpool OBJ_iso,0L,10118L,3L,0L,55L + +#define SN_cryptopro "cryptopro" +#define NID_cryptopro 805 +#define OBJ_cryptopro OBJ_member_body,643L,2L,2L + +#define SN_cryptocom "cryptocom" +#define NID_cryptocom 806 +#define OBJ_cryptocom OBJ_member_body,643L,2L,9L + +#define SN_id_tc26 "id-tc26" +#define NID_id_tc26 974 +#define OBJ_id_tc26 OBJ_member_body,643L,7L,1L + +#define SN_id_GostR3411_94_with_GostR3410_2001 "id-GostR3411-94-with-GostR3410-2001" +#define LN_id_GostR3411_94_with_GostR3410_2001 "GOST R 34.11-94 with GOST R 34.10-2001" +#define NID_id_GostR3411_94_with_GostR3410_2001 807 +#define OBJ_id_GostR3411_94_with_GostR3410_2001 OBJ_cryptopro,3L + +#define SN_id_GostR3411_94_with_GostR3410_94 "id-GostR3411-94-with-GostR3410-94" +#define LN_id_GostR3411_94_with_GostR3410_94 "GOST R 34.11-94 with GOST R 34.10-94" +#define NID_id_GostR3411_94_with_GostR3410_94 808 +#define OBJ_id_GostR3411_94_with_GostR3410_94 OBJ_cryptopro,4L + +#define SN_id_GostR3411_94 "md_gost94" +#define LN_id_GostR3411_94 "GOST R 34.11-94" +#define NID_id_GostR3411_94 809 +#define OBJ_id_GostR3411_94 OBJ_cryptopro,9L + +#define SN_id_HMACGostR3411_94 "id-HMACGostR3411-94" +#define LN_id_HMACGostR3411_94 "HMAC GOST 34.11-94" +#define NID_id_HMACGostR3411_94 810 +#define OBJ_id_HMACGostR3411_94 OBJ_cryptopro,10L + +#define SN_id_GostR3410_2001 "gost2001" +#define LN_id_GostR3410_2001 "GOST R 34.10-2001" +#define NID_id_GostR3410_2001 811 +#define OBJ_id_GostR3410_2001 OBJ_cryptopro,19L + +#define SN_id_GostR3410_94 "gost94" +#define LN_id_GostR3410_94 "GOST R 34.10-94" +#define NID_id_GostR3410_94 812 +#define OBJ_id_GostR3410_94 OBJ_cryptopro,20L + +#define SN_id_Gost28147_89 "gost89" +#define LN_id_Gost28147_89 "GOST 28147-89" +#define NID_id_Gost28147_89 813 +#define OBJ_id_Gost28147_89 OBJ_cryptopro,21L + +#define SN_gost89_cnt "gost89-cnt" +#define NID_gost89_cnt 814 + +#define SN_gost89_cnt_12 "gost89-cnt-12" +#define NID_gost89_cnt_12 975 + +#define SN_gost89_cbc "gost89-cbc" +#define NID_gost89_cbc 1009 + +#define SN_gost89_ecb "gost89-ecb" +#define NID_gost89_ecb 1010 + +#define SN_gost89_ctr "gost89-ctr" +#define NID_gost89_ctr 1011 + +#define SN_id_Gost28147_89_MAC "gost-mac" +#define LN_id_Gost28147_89_MAC "GOST 28147-89 MAC" +#define NID_id_Gost28147_89_MAC 815 +#define OBJ_id_Gost28147_89_MAC OBJ_cryptopro,22L + +#define SN_gost_mac_12 "gost-mac-12" +#define NID_gost_mac_12 976 + +#define SN_id_GostR3411_94_prf "prf-gostr3411-94" +#define LN_id_GostR3411_94_prf "GOST R 34.11-94 PRF" +#define NID_id_GostR3411_94_prf 816 +#define OBJ_id_GostR3411_94_prf OBJ_cryptopro,23L + +#define SN_id_GostR3410_2001DH "id-GostR3410-2001DH" +#define LN_id_GostR3410_2001DH "GOST R 34.10-2001 DH" +#define NID_id_GostR3410_2001DH 817 +#define OBJ_id_GostR3410_2001DH OBJ_cryptopro,98L + +#define SN_id_GostR3410_94DH "id-GostR3410-94DH" +#define LN_id_GostR3410_94DH "GOST R 34.10-94 DH" +#define NID_id_GostR3410_94DH 818 +#define OBJ_id_GostR3410_94DH OBJ_cryptopro,99L + +#define SN_id_Gost28147_89_CryptoPro_KeyMeshing "id-Gost28147-89-CryptoPro-KeyMeshing" +#define NID_id_Gost28147_89_CryptoPro_KeyMeshing 819 +#define OBJ_id_Gost28147_89_CryptoPro_KeyMeshing OBJ_cryptopro,14L,1L + +#define SN_id_Gost28147_89_None_KeyMeshing "id-Gost28147-89-None-KeyMeshing" +#define NID_id_Gost28147_89_None_KeyMeshing 820 +#define OBJ_id_Gost28147_89_None_KeyMeshing OBJ_cryptopro,14L,0L + +#define SN_id_GostR3411_94_TestParamSet "id-GostR3411-94-TestParamSet" +#define NID_id_GostR3411_94_TestParamSet 821 +#define OBJ_id_GostR3411_94_TestParamSet OBJ_cryptopro,30L,0L + +#define SN_id_GostR3411_94_CryptoProParamSet "id-GostR3411-94-CryptoProParamSet" +#define NID_id_GostR3411_94_CryptoProParamSet 822 +#define OBJ_id_GostR3411_94_CryptoProParamSet OBJ_cryptopro,30L,1L + +#define SN_id_Gost28147_89_TestParamSet "id-Gost28147-89-TestParamSet" +#define NID_id_Gost28147_89_TestParamSet 823 +#define OBJ_id_Gost28147_89_TestParamSet OBJ_cryptopro,31L,0L + +#define SN_id_Gost28147_89_CryptoPro_A_ParamSet "id-Gost28147-89-CryptoPro-A-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_A_ParamSet 824 +#define OBJ_id_Gost28147_89_CryptoPro_A_ParamSet OBJ_cryptopro,31L,1L + +#define SN_id_Gost28147_89_CryptoPro_B_ParamSet "id-Gost28147-89-CryptoPro-B-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_B_ParamSet 825 +#define OBJ_id_Gost28147_89_CryptoPro_B_ParamSet OBJ_cryptopro,31L,2L + +#define SN_id_Gost28147_89_CryptoPro_C_ParamSet "id-Gost28147-89-CryptoPro-C-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_C_ParamSet 826 +#define OBJ_id_Gost28147_89_CryptoPro_C_ParamSet OBJ_cryptopro,31L,3L + +#define SN_id_Gost28147_89_CryptoPro_D_ParamSet "id-Gost28147-89-CryptoPro-D-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_D_ParamSet 827 +#define OBJ_id_Gost28147_89_CryptoPro_D_ParamSet OBJ_cryptopro,31L,4L + +#define SN_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet "id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet 828 +#define OBJ_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet OBJ_cryptopro,31L,5L + +#define SN_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet "id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet 829 +#define OBJ_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet OBJ_cryptopro,31L,6L + +#define SN_id_Gost28147_89_CryptoPro_RIC_1_ParamSet "id-Gost28147-89-CryptoPro-RIC-1-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_RIC_1_ParamSet 830 +#define OBJ_id_Gost28147_89_CryptoPro_RIC_1_ParamSet OBJ_cryptopro,31L,7L + +#define SN_id_GostR3410_94_TestParamSet "id-GostR3410-94-TestParamSet" +#define NID_id_GostR3410_94_TestParamSet 831 +#define OBJ_id_GostR3410_94_TestParamSet OBJ_cryptopro,32L,0L + +#define SN_id_GostR3410_94_CryptoPro_A_ParamSet "id-GostR3410-94-CryptoPro-A-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_A_ParamSet 832 +#define OBJ_id_GostR3410_94_CryptoPro_A_ParamSet OBJ_cryptopro,32L,2L + +#define SN_id_GostR3410_94_CryptoPro_B_ParamSet "id-GostR3410-94-CryptoPro-B-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_B_ParamSet 833 +#define OBJ_id_GostR3410_94_CryptoPro_B_ParamSet OBJ_cryptopro,32L,3L + +#define SN_id_GostR3410_94_CryptoPro_C_ParamSet "id-GostR3410-94-CryptoPro-C-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_C_ParamSet 834 +#define OBJ_id_GostR3410_94_CryptoPro_C_ParamSet OBJ_cryptopro,32L,4L + +#define SN_id_GostR3410_94_CryptoPro_D_ParamSet "id-GostR3410-94-CryptoPro-D-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_D_ParamSet 835 +#define OBJ_id_GostR3410_94_CryptoPro_D_ParamSet OBJ_cryptopro,32L,5L + +#define SN_id_GostR3410_94_CryptoPro_XchA_ParamSet "id-GostR3410-94-CryptoPro-XchA-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_XchA_ParamSet 836 +#define OBJ_id_GostR3410_94_CryptoPro_XchA_ParamSet OBJ_cryptopro,33L,1L + +#define SN_id_GostR3410_94_CryptoPro_XchB_ParamSet "id-GostR3410-94-CryptoPro-XchB-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_XchB_ParamSet 837 +#define OBJ_id_GostR3410_94_CryptoPro_XchB_ParamSet OBJ_cryptopro,33L,2L + +#define SN_id_GostR3410_94_CryptoPro_XchC_ParamSet "id-GostR3410-94-CryptoPro-XchC-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_XchC_ParamSet 838 +#define OBJ_id_GostR3410_94_CryptoPro_XchC_ParamSet OBJ_cryptopro,33L,3L + +#define SN_id_GostR3410_2001_TestParamSet "id-GostR3410-2001-TestParamSet" +#define NID_id_GostR3410_2001_TestParamSet 839 +#define OBJ_id_GostR3410_2001_TestParamSet OBJ_cryptopro,35L,0L + +#define SN_id_GostR3410_2001_CryptoPro_A_ParamSet "id-GostR3410-2001-CryptoPro-A-ParamSet" +#define NID_id_GostR3410_2001_CryptoPro_A_ParamSet 840 +#define OBJ_id_GostR3410_2001_CryptoPro_A_ParamSet OBJ_cryptopro,35L,1L + +#define SN_id_GostR3410_2001_CryptoPro_B_ParamSet "id-GostR3410-2001-CryptoPro-B-ParamSet" +#define NID_id_GostR3410_2001_CryptoPro_B_ParamSet 841 +#define OBJ_id_GostR3410_2001_CryptoPro_B_ParamSet OBJ_cryptopro,35L,2L + +#define SN_id_GostR3410_2001_CryptoPro_C_ParamSet "id-GostR3410-2001-CryptoPro-C-ParamSet" +#define NID_id_GostR3410_2001_CryptoPro_C_ParamSet 842 +#define OBJ_id_GostR3410_2001_CryptoPro_C_ParamSet OBJ_cryptopro,35L,3L + +#define SN_id_GostR3410_2001_CryptoPro_XchA_ParamSet "id-GostR3410-2001-CryptoPro-XchA-ParamSet" +#define NID_id_GostR3410_2001_CryptoPro_XchA_ParamSet 843 +#define OBJ_id_GostR3410_2001_CryptoPro_XchA_ParamSet OBJ_cryptopro,36L,0L + +#define SN_id_GostR3410_2001_CryptoPro_XchB_ParamSet "id-GostR3410-2001-CryptoPro-XchB-ParamSet" +#define NID_id_GostR3410_2001_CryptoPro_XchB_ParamSet 844 +#define OBJ_id_GostR3410_2001_CryptoPro_XchB_ParamSet OBJ_cryptopro,36L,1L + +#define SN_id_GostR3410_94_a "id-GostR3410-94-a" +#define NID_id_GostR3410_94_a 845 +#define OBJ_id_GostR3410_94_a OBJ_id_GostR3410_94,1L + +#define SN_id_GostR3410_94_aBis "id-GostR3410-94-aBis" +#define NID_id_GostR3410_94_aBis 846 +#define OBJ_id_GostR3410_94_aBis OBJ_id_GostR3410_94,2L + +#define SN_id_GostR3410_94_b "id-GostR3410-94-b" +#define NID_id_GostR3410_94_b 847 +#define OBJ_id_GostR3410_94_b OBJ_id_GostR3410_94,3L + +#define SN_id_GostR3410_94_bBis "id-GostR3410-94-bBis" +#define NID_id_GostR3410_94_bBis 848 +#define OBJ_id_GostR3410_94_bBis OBJ_id_GostR3410_94,4L + +#define SN_id_Gost28147_89_cc "id-Gost28147-89-cc" +#define LN_id_Gost28147_89_cc "GOST 28147-89 Cryptocom ParamSet" +#define NID_id_Gost28147_89_cc 849 +#define OBJ_id_Gost28147_89_cc OBJ_cryptocom,1L,6L,1L + +#define SN_id_GostR3410_94_cc "gost94cc" +#define LN_id_GostR3410_94_cc "GOST 34.10-94 Cryptocom" +#define NID_id_GostR3410_94_cc 850 +#define OBJ_id_GostR3410_94_cc OBJ_cryptocom,1L,5L,3L + +#define SN_id_GostR3410_2001_cc "gost2001cc" +#define LN_id_GostR3410_2001_cc "GOST 34.10-2001 Cryptocom" +#define NID_id_GostR3410_2001_cc 851 +#define OBJ_id_GostR3410_2001_cc OBJ_cryptocom,1L,5L,4L + +#define SN_id_GostR3411_94_with_GostR3410_94_cc "id-GostR3411-94-with-GostR3410-94-cc" +#define LN_id_GostR3411_94_with_GostR3410_94_cc "GOST R 34.11-94 with GOST R 34.10-94 Cryptocom" +#define NID_id_GostR3411_94_with_GostR3410_94_cc 852 +#define OBJ_id_GostR3411_94_with_GostR3410_94_cc OBJ_cryptocom,1L,3L,3L + +#define SN_id_GostR3411_94_with_GostR3410_2001_cc "id-GostR3411-94-with-GostR3410-2001-cc" +#define LN_id_GostR3411_94_with_GostR3410_2001_cc "GOST R 34.11-94 with GOST R 34.10-2001 Cryptocom" +#define NID_id_GostR3411_94_with_GostR3410_2001_cc 853 +#define OBJ_id_GostR3411_94_with_GostR3410_2001_cc OBJ_cryptocom,1L,3L,4L + +#define SN_id_GostR3410_2001_ParamSet_cc "id-GostR3410-2001-ParamSet-cc" +#define LN_id_GostR3410_2001_ParamSet_cc "GOST R 3410-2001 Parameter Set Cryptocom" +#define NID_id_GostR3410_2001_ParamSet_cc 854 +#define OBJ_id_GostR3410_2001_ParamSet_cc OBJ_cryptocom,1L,8L,1L + +#define SN_id_tc26_algorithms "id-tc26-algorithms" +#define NID_id_tc26_algorithms 977 +#define OBJ_id_tc26_algorithms OBJ_id_tc26,1L + +#define SN_id_tc26_sign "id-tc26-sign" +#define NID_id_tc26_sign 978 +#define OBJ_id_tc26_sign OBJ_id_tc26_algorithms,1L + +#define SN_id_GostR3410_2012_256 "gost2012_256" +#define LN_id_GostR3410_2012_256 "GOST R 34.10-2012 with 256 bit modulus" +#define NID_id_GostR3410_2012_256 979 +#define OBJ_id_GostR3410_2012_256 OBJ_id_tc26_sign,1L + +#define SN_id_GostR3410_2012_512 "gost2012_512" +#define LN_id_GostR3410_2012_512 "GOST R 34.10-2012 with 512 bit modulus" +#define NID_id_GostR3410_2012_512 980 +#define OBJ_id_GostR3410_2012_512 OBJ_id_tc26_sign,2L + +#define SN_id_tc26_digest "id-tc26-digest" +#define NID_id_tc26_digest 981 +#define OBJ_id_tc26_digest OBJ_id_tc26_algorithms,2L + +#define SN_id_GostR3411_2012_256 "md_gost12_256" +#define LN_id_GostR3411_2012_256 "GOST R 34.11-2012 with 256 bit hash" +#define NID_id_GostR3411_2012_256 982 +#define OBJ_id_GostR3411_2012_256 OBJ_id_tc26_digest,2L + +#define SN_id_GostR3411_2012_512 "md_gost12_512" +#define LN_id_GostR3411_2012_512 "GOST R 34.11-2012 with 512 bit hash" +#define NID_id_GostR3411_2012_512 983 +#define OBJ_id_GostR3411_2012_512 OBJ_id_tc26_digest,3L + +#define SN_id_tc26_signwithdigest "id-tc26-signwithdigest" +#define NID_id_tc26_signwithdigest 984 +#define OBJ_id_tc26_signwithdigest OBJ_id_tc26_algorithms,3L + +#define SN_id_tc26_signwithdigest_gost3410_2012_256 "id-tc26-signwithdigest-gost3410-2012-256" +#define LN_id_tc26_signwithdigest_gost3410_2012_256 "GOST R 34.10-2012 with GOST R 34.11-2012 (256 bit)" +#define NID_id_tc26_signwithdigest_gost3410_2012_256 985 +#define OBJ_id_tc26_signwithdigest_gost3410_2012_256 OBJ_id_tc26_signwithdigest,2L + +#define SN_id_tc26_signwithdigest_gost3410_2012_512 "id-tc26-signwithdigest-gost3410-2012-512" +#define LN_id_tc26_signwithdigest_gost3410_2012_512 "GOST R 34.10-2012 with GOST R 34.11-2012 (512 bit)" +#define NID_id_tc26_signwithdigest_gost3410_2012_512 986 +#define OBJ_id_tc26_signwithdigest_gost3410_2012_512 OBJ_id_tc26_signwithdigest,3L + +#define SN_id_tc26_mac "id-tc26-mac" +#define NID_id_tc26_mac 987 +#define OBJ_id_tc26_mac OBJ_id_tc26_algorithms,4L + +#define SN_id_tc26_hmac_gost_3411_2012_256 "id-tc26-hmac-gost-3411-2012-256" +#define LN_id_tc26_hmac_gost_3411_2012_256 "HMAC GOST 34.11-2012 256 bit" +#define NID_id_tc26_hmac_gost_3411_2012_256 988 +#define OBJ_id_tc26_hmac_gost_3411_2012_256 OBJ_id_tc26_mac,1L + +#define SN_id_tc26_hmac_gost_3411_2012_512 "id-tc26-hmac-gost-3411-2012-512" +#define LN_id_tc26_hmac_gost_3411_2012_512 "HMAC GOST 34.11-2012 512 bit" +#define NID_id_tc26_hmac_gost_3411_2012_512 989 +#define OBJ_id_tc26_hmac_gost_3411_2012_512 OBJ_id_tc26_mac,2L + +#define SN_id_tc26_cipher "id-tc26-cipher" +#define NID_id_tc26_cipher 990 +#define OBJ_id_tc26_cipher OBJ_id_tc26_algorithms,5L + +#define SN_id_tc26_cipher_gostr3412_2015_magma "id-tc26-cipher-gostr3412-2015-magma" +#define NID_id_tc26_cipher_gostr3412_2015_magma 1173 +#define OBJ_id_tc26_cipher_gostr3412_2015_magma OBJ_id_tc26_cipher,1L + +#define SN_magma_ctr_acpkm "magma-ctr-acpkm" +#define NID_magma_ctr_acpkm 1174 +#define OBJ_magma_ctr_acpkm OBJ_id_tc26_cipher_gostr3412_2015_magma,1L + +#define SN_magma_ctr_acpkm_omac "magma-ctr-acpkm-omac" +#define NID_magma_ctr_acpkm_omac 1175 +#define OBJ_magma_ctr_acpkm_omac OBJ_id_tc26_cipher_gostr3412_2015_magma,2L + +#define SN_id_tc26_cipher_gostr3412_2015_kuznyechik "id-tc26-cipher-gostr3412-2015-kuznyechik" +#define NID_id_tc26_cipher_gostr3412_2015_kuznyechik 1176 +#define OBJ_id_tc26_cipher_gostr3412_2015_kuznyechik OBJ_id_tc26_cipher,2L + +#define SN_kuznyechik_ctr_acpkm "kuznyechik-ctr-acpkm" +#define NID_kuznyechik_ctr_acpkm 1177 +#define OBJ_kuznyechik_ctr_acpkm OBJ_id_tc26_cipher_gostr3412_2015_kuznyechik,1L + +#define SN_kuznyechik_ctr_acpkm_omac "kuznyechik-ctr-acpkm-omac" +#define NID_kuznyechik_ctr_acpkm_omac 1178 +#define OBJ_kuznyechik_ctr_acpkm_omac OBJ_id_tc26_cipher_gostr3412_2015_kuznyechik,2L + +#define SN_id_tc26_agreement "id-tc26-agreement" +#define NID_id_tc26_agreement 991 +#define OBJ_id_tc26_agreement OBJ_id_tc26_algorithms,6L + +#define SN_id_tc26_agreement_gost_3410_2012_256 "id-tc26-agreement-gost-3410-2012-256" +#define NID_id_tc26_agreement_gost_3410_2012_256 992 +#define OBJ_id_tc26_agreement_gost_3410_2012_256 OBJ_id_tc26_agreement,1L + +#define SN_id_tc26_agreement_gost_3410_2012_512 "id-tc26-agreement-gost-3410-2012-512" +#define NID_id_tc26_agreement_gost_3410_2012_512 993 +#define OBJ_id_tc26_agreement_gost_3410_2012_512 OBJ_id_tc26_agreement,2L + +#define SN_id_tc26_wrap "id-tc26-wrap" +#define NID_id_tc26_wrap 1179 +#define OBJ_id_tc26_wrap OBJ_id_tc26_algorithms,7L + +#define SN_id_tc26_wrap_gostr3412_2015_magma "id-tc26-wrap-gostr3412-2015-magma" +#define NID_id_tc26_wrap_gostr3412_2015_magma 1180 +#define OBJ_id_tc26_wrap_gostr3412_2015_magma OBJ_id_tc26_wrap,1L + +#define SN_magma_kexp15 "magma-kexp15" +#define NID_magma_kexp15 1181 +#define OBJ_magma_kexp15 OBJ_id_tc26_wrap_gostr3412_2015_magma,1L + +#define SN_id_tc26_wrap_gostr3412_2015_kuznyechik "id-tc26-wrap-gostr3412-2015-kuznyechik" +#define NID_id_tc26_wrap_gostr3412_2015_kuznyechik 1182 +#define OBJ_id_tc26_wrap_gostr3412_2015_kuznyechik OBJ_id_tc26_wrap,2L + +#define SN_kuznyechik_kexp15 "kuznyechik-kexp15" +#define NID_kuznyechik_kexp15 1183 +#define OBJ_kuznyechik_kexp15 OBJ_id_tc26_wrap_gostr3412_2015_kuznyechik,1L + +#define SN_id_tc26_constants "id-tc26-constants" +#define NID_id_tc26_constants 994 +#define OBJ_id_tc26_constants OBJ_id_tc26,2L + +#define SN_id_tc26_sign_constants "id-tc26-sign-constants" +#define NID_id_tc26_sign_constants 995 +#define OBJ_id_tc26_sign_constants OBJ_id_tc26_constants,1L + +#define SN_id_tc26_gost_3410_2012_256_constants "id-tc26-gost-3410-2012-256-constants" +#define NID_id_tc26_gost_3410_2012_256_constants 1147 +#define OBJ_id_tc26_gost_3410_2012_256_constants OBJ_id_tc26_sign_constants,1L + +#define SN_id_tc26_gost_3410_2012_256_paramSetA "id-tc26-gost-3410-2012-256-paramSetA" +#define LN_id_tc26_gost_3410_2012_256_paramSetA "GOST R 34.10-2012 (256 bit) ParamSet A" +#define NID_id_tc26_gost_3410_2012_256_paramSetA 1148 +#define OBJ_id_tc26_gost_3410_2012_256_paramSetA OBJ_id_tc26_gost_3410_2012_256_constants,1L + +#define SN_id_tc26_gost_3410_2012_256_paramSetB "id-tc26-gost-3410-2012-256-paramSetB" +#define LN_id_tc26_gost_3410_2012_256_paramSetB "GOST R 34.10-2012 (256 bit) ParamSet B" +#define NID_id_tc26_gost_3410_2012_256_paramSetB 1184 +#define OBJ_id_tc26_gost_3410_2012_256_paramSetB OBJ_id_tc26_gost_3410_2012_256_constants,2L + +#define SN_id_tc26_gost_3410_2012_256_paramSetC "id-tc26-gost-3410-2012-256-paramSetC" +#define LN_id_tc26_gost_3410_2012_256_paramSetC "GOST R 34.10-2012 (256 bit) ParamSet C" +#define NID_id_tc26_gost_3410_2012_256_paramSetC 1185 +#define OBJ_id_tc26_gost_3410_2012_256_paramSetC OBJ_id_tc26_gost_3410_2012_256_constants,3L + +#define SN_id_tc26_gost_3410_2012_256_paramSetD "id-tc26-gost-3410-2012-256-paramSetD" +#define LN_id_tc26_gost_3410_2012_256_paramSetD "GOST R 34.10-2012 (256 bit) ParamSet D" +#define NID_id_tc26_gost_3410_2012_256_paramSetD 1186 +#define OBJ_id_tc26_gost_3410_2012_256_paramSetD OBJ_id_tc26_gost_3410_2012_256_constants,4L + +#define SN_id_tc26_gost_3410_2012_512_constants "id-tc26-gost-3410-2012-512-constants" +#define NID_id_tc26_gost_3410_2012_512_constants 996 +#define OBJ_id_tc26_gost_3410_2012_512_constants OBJ_id_tc26_sign_constants,2L + +#define SN_id_tc26_gost_3410_2012_512_paramSetTest "id-tc26-gost-3410-2012-512-paramSetTest" +#define LN_id_tc26_gost_3410_2012_512_paramSetTest "GOST R 34.10-2012 (512 bit) testing parameter set" +#define NID_id_tc26_gost_3410_2012_512_paramSetTest 997 +#define OBJ_id_tc26_gost_3410_2012_512_paramSetTest OBJ_id_tc26_gost_3410_2012_512_constants,0L + +#define SN_id_tc26_gost_3410_2012_512_paramSetA "id-tc26-gost-3410-2012-512-paramSetA" +#define LN_id_tc26_gost_3410_2012_512_paramSetA "GOST R 34.10-2012 (512 bit) ParamSet A" +#define NID_id_tc26_gost_3410_2012_512_paramSetA 998 +#define OBJ_id_tc26_gost_3410_2012_512_paramSetA OBJ_id_tc26_gost_3410_2012_512_constants,1L + +#define SN_id_tc26_gost_3410_2012_512_paramSetB "id-tc26-gost-3410-2012-512-paramSetB" +#define LN_id_tc26_gost_3410_2012_512_paramSetB "GOST R 34.10-2012 (512 bit) ParamSet B" +#define NID_id_tc26_gost_3410_2012_512_paramSetB 999 +#define OBJ_id_tc26_gost_3410_2012_512_paramSetB OBJ_id_tc26_gost_3410_2012_512_constants,2L + +#define SN_id_tc26_gost_3410_2012_512_paramSetC "id-tc26-gost-3410-2012-512-paramSetC" +#define LN_id_tc26_gost_3410_2012_512_paramSetC "GOST R 34.10-2012 (512 bit) ParamSet C" +#define NID_id_tc26_gost_3410_2012_512_paramSetC 1149 +#define OBJ_id_tc26_gost_3410_2012_512_paramSetC OBJ_id_tc26_gost_3410_2012_512_constants,3L + +#define SN_id_tc26_digest_constants "id-tc26-digest-constants" +#define NID_id_tc26_digest_constants 1000 +#define OBJ_id_tc26_digest_constants OBJ_id_tc26_constants,2L + +#define SN_id_tc26_cipher_constants "id-tc26-cipher-constants" +#define NID_id_tc26_cipher_constants 1001 +#define OBJ_id_tc26_cipher_constants OBJ_id_tc26_constants,5L + +#define SN_id_tc26_gost_28147_constants "id-tc26-gost-28147-constants" +#define NID_id_tc26_gost_28147_constants 1002 +#define OBJ_id_tc26_gost_28147_constants OBJ_id_tc26_cipher_constants,1L + +#define SN_id_tc26_gost_28147_param_Z "id-tc26-gost-28147-param-Z" +#define LN_id_tc26_gost_28147_param_Z "GOST 28147-89 TC26 parameter set" +#define NID_id_tc26_gost_28147_param_Z 1003 +#define OBJ_id_tc26_gost_28147_param_Z OBJ_id_tc26_gost_28147_constants,1L + +#define SN_INN "INN" +#define LN_INN "INN" +#define NID_INN 1004 +#define OBJ_INN OBJ_member_body,643L,3L,131L,1L,1L + +#define SN_OGRN "OGRN" +#define LN_OGRN "OGRN" +#define NID_OGRN 1005 +#define OBJ_OGRN OBJ_member_body,643L,100L,1L + +#define SN_SNILS "SNILS" +#define LN_SNILS "SNILS" +#define NID_SNILS 1006 +#define OBJ_SNILS OBJ_member_body,643L,100L,3L + +#define SN_OGRNIP "OGRNIP" +#define LN_OGRNIP "OGRNIP" +#define NID_OGRNIP 1226 +#define OBJ_OGRNIP OBJ_member_body,643L,100L,5L + +#define SN_subjectSignTool "subjectSignTool" +#define LN_subjectSignTool "Signing Tool of Subject" +#define NID_subjectSignTool 1007 +#define OBJ_subjectSignTool OBJ_member_body,643L,100L,111L + +#define SN_issuerSignTool "issuerSignTool" +#define LN_issuerSignTool "Signing Tool of Issuer" +#define NID_issuerSignTool 1008 +#define OBJ_issuerSignTool OBJ_member_body,643L,100L,112L + +#define SN_classSignTool "classSignTool" +#define LN_classSignTool "Class of Signing Tool" +#define NID_classSignTool 1227 +#define OBJ_classSignTool OBJ_member_body,643L,100L,113L + +#define SN_classSignToolKC1 "classSignToolKC1" +#define LN_classSignToolKC1 "Class of Signing Tool KC1" +#define NID_classSignToolKC1 1228 +#define OBJ_classSignToolKC1 OBJ_member_body,643L,100L,113L,1L + +#define SN_classSignToolKC2 "classSignToolKC2" +#define LN_classSignToolKC2 "Class of Signing Tool KC2" +#define NID_classSignToolKC2 1229 +#define OBJ_classSignToolKC2 OBJ_member_body,643L,100L,113L,2L + +#define SN_classSignToolKC3 "classSignToolKC3" +#define LN_classSignToolKC3 "Class of Signing Tool KC3" +#define NID_classSignToolKC3 1230 +#define OBJ_classSignToolKC3 OBJ_member_body,643L,100L,113L,3L + +#define SN_classSignToolKB1 "classSignToolKB1" +#define LN_classSignToolKB1 "Class of Signing Tool KB1" +#define NID_classSignToolKB1 1231 +#define OBJ_classSignToolKB1 OBJ_member_body,643L,100L,113L,4L + +#define SN_classSignToolKB2 "classSignToolKB2" +#define LN_classSignToolKB2 "Class of Signing Tool KB2" +#define NID_classSignToolKB2 1232 +#define OBJ_classSignToolKB2 OBJ_member_body,643L,100L,113L,5L + +#define SN_classSignToolKA1 "classSignToolKA1" +#define LN_classSignToolKA1 "Class of Signing Tool KA1" +#define NID_classSignToolKA1 1233 +#define OBJ_classSignToolKA1 OBJ_member_body,643L,100L,113L,6L + +#define SN_kuznyechik_ecb "kuznyechik-ecb" +#define NID_kuznyechik_ecb 1012 + +#define SN_kuznyechik_ctr "kuznyechik-ctr" +#define NID_kuznyechik_ctr 1013 + +#define SN_kuznyechik_ofb "kuznyechik-ofb" +#define NID_kuznyechik_ofb 1014 + +#define SN_kuznyechik_cbc "kuznyechik-cbc" +#define NID_kuznyechik_cbc 1015 + +#define SN_kuznyechik_cfb "kuznyechik-cfb" +#define NID_kuznyechik_cfb 1016 + +#define SN_kuznyechik_mac "kuznyechik-mac" +#define NID_kuznyechik_mac 1017 + +#define SN_magma_ecb "magma-ecb" +#define NID_magma_ecb 1187 + +#define SN_magma_ctr "magma-ctr" +#define NID_magma_ctr 1188 + +#define SN_magma_ofb "magma-ofb" +#define NID_magma_ofb 1189 + +#define SN_magma_cbc "magma-cbc" +#define NID_magma_cbc 1190 + +#define SN_magma_cfb "magma-cfb" +#define NID_magma_cfb 1191 + +#define SN_magma_mac "magma-mac" +#define NID_magma_mac 1192 + +#define SN_camellia_128_cbc "CAMELLIA-128-CBC" +#define LN_camellia_128_cbc "camellia-128-cbc" +#define NID_camellia_128_cbc 751 +#define OBJ_camellia_128_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,2L + +#define SN_camellia_192_cbc "CAMELLIA-192-CBC" +#define LN_camellia_192_cbc "camellia-192-cbc" +#define NID_camellia_192_cbc 752 +#define OBJ_camellia_192_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,3L + +#define SN_camellia_256_cbc "CAMELLIA-256-CBC" +#define LN_camellia_256_cbc "camellia-256-cbc" +#define NID_camellia_256_cbc 753 +#define OBJ_camellia_256_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,4L + +#define SN_id_camellia128_wrap "id-camellia128-wrap" +#define NID_id_camellia128_wrap 907 +#define OBJ_id_camellia128_wrap 1L,2L,392L,200011L,61L,1L,1L,3L,2L + +#define SN_id_camellia192_wrap "id-camellia192-wrap" +#define NID_id_camellia192_wrap 908 +#define OBJ_id_camellia192_wrap 1L,2L,392L,200011L,61L,1L,1L,3L,3L + +#define SN_id_camellia256_wrap "id-camellia256-wrap" +#define NID_id_camellia256_wrap 909 +#define OBJ_id_camellia256_wrap 1L,2L,392L,200011L,61L,1L,1L,3L,4L + +#define OBJ_ntt_ds 0L,3L,4401L,5L + +#define OBJ_camellia OBJ_ntt_ds,3L,1L,9L + +#define SN_camellia_128_ecb "CAMELLIA-128-ECB" +#define LN_camellia_128_ecb "camellia-128-ecb" +#define NID_camellia_128_ecb 754 +#define OBJ_camellia_128_ecb OBJ_camellia,1L + +#define SN_camellia_128_ofb128 "CAMELLIA-128-OFB" +#define LN_camellia_128_ofb128 "camellia-128-ofb" +#define NID_camellia_128_ofb128 766 +#define OBJ_camellia_128_ofb128 OBJ_camellia,3L + +#define SN_camellia_128_cfb128 "CAMELLIA-128-CFB" +#define LN_camellia_128_cfb128 "camellia-128-cfb" +#define NID_camellia_128_cfb128 757 +#define OBJ_camellia_128_cfb128 OBJ_camellia,4L + +#define SN_camellia_128_gcm "CAMELLIA-128-GCM" +#define LN_camellia_128_gcm "camellia-128-gcm" +#define NID_camellia_128_gcm 961 +#define OBJ_camellia_128_gcm OBJ_camellia,6L + +#define SN_camellia_128_ccm "CAMELLIA-128-CCM" +#define LN_camellia_128_ccm "camellia-128-ccm" +#define NID_camellia_128_ccm 962 +#define OBJ_camellia_128_ccm OBJ_camellia,7L + +#define SN_camellia_128_ctr "CAMELLIA-128-CTR" +#define LN_camellia_128_ctr "camellia-128-ctr" +#define NID_camellia_128_ctr 963 +#define OBJ_camellia_128_ctr OBJ_camellia,9L + +#define SN_camellia_128_cmac "CAMELLIA-128-CMAC" +#define LN_camellia_128_cmac "camellia-128-cmac" +#define NID_camellia_128_cmac 964 +#define OBJ_camellia_128_cmac OBJ_camellia,10L + +#define SN_camellia_192_ecb "CAMELLIA-192-ECB" +#define LN_camellia_192_ecb "camellia-192-ecb" +#define NID_camellia_192_ecb 755 +#define OBJ_camellia_192_ecb OBJ_camellia,21L + +#define SN_camellia_192_ofb128 "CAMELLIA-192-OFB" +#define LN_camellia_192_ofb128 "camellia-192-ofb" +#define NID_camellia_192_ofb128 767 +#define OBJ_camellia_192_ofb128 OBJ_camellia,23L + +#define SN_camellia_192_cfb128 "CAMELLIA-192-CFB" +#define LN_camellia_192_cfb128 "camellia-192-cfb" +#define NID_camellia_192_cfb128 758 +#define OBJ_camellia_192_cfb128 OBJ_camellia,24L + +#define SN_camellia_192_gcm "CAMELLIA-192-GCM" +#define LN_camellia_192_gcm "camellia-192-gcm" +#define NID_camellia_192_gcm 965 +#define OBJ_camellia_192_gcm OBJ_camellia,26L + +#define SN_camellia_192_ccm "CAMELLIA-192-CCM" +#define LN_camellia_192_ccm "camellia-192-ccm" +#define NID_camellia_192_ccm 966 +#define OBJ_camellia_192_ccm OBJ_camellia,27L + +#define SN_camellia_192_ctr "CAMELLIA-192-CTR" +#define LN_camellia_192_ctr "camellia-192-ctr" +#define NID_camellia_192_ctr 967 +#define OBJ_camellia_192_ctr OBJ_camellia,29L + +#define SN_camellia_192_cmac "CAMELLIA-192-CMAC" +#define LN_camellia_192_cmac "camellia-192-cmac" +#define NID_camellia_192_cmac 968 +#define OBJ_camellia_192_cmac OBJ_camellia,30L + +#define SN_camellia_256_ecb "CAMELLIA-256-ECB" +#define LN_camellia_256_ecb "camellia-256-ecb" +#define NID_camellia_256_ecb 756 +#define OBJ_camellia_256_ecb OBJ_camellia,41L + +#define SN_camellia_256_ofb128 "CAMELLIA-256-OFB" +#define LN_camellia_256_ofb128 "camellia-256-ofb" +#define NID_camellia_256_ofb128 768 +#define OBJ_camellia_256_ofb128 OBJ_camellia,43L + +#define SN_camellia_256_cfb128 "CAMELLIA-256-CFB" +#define LN_camellia_256_cfb128 "camellia-256-cfb" +#define NID_camellia_256_cfb128 759 +#define OBJ_camellia_256_cfb128 OBJ_camellia,44L + +#define SN_camellia_256_gcm "CAMELLIA-256-GCM" +#define LN_camellia_256_gcm "camellia-256-gcm" +#define NID_camellia_256_gcm 969 +#define OBJ_camellia_256_gcm OBJ_camellia,46L + +#define SN_camellia_256_ccm "CAMELLIA-256-CCM" +#define LN_camellia_256_ccm "camellia-256-ccm" +#define NID_camellia_256_ccm 970 +#define OBJ_camellia_256_ccm OBJ_camellia,47L + +#define SN_camellia_256_ctr "CAMELLIA-256-CTR" +#define LN_camellia_256_ctr "camellia-256-ctr" +#define NID_camellia_256_ctr 971 +#define OBJ_camellia_256_ctr OBJ_camellia,49L + +#define SN_camellia_256_cmac "CAMELLIA-256-CMAC" +#define LN_camellia_256_cmac "camellia-256-cmac" +#define NID_camellia_256_cmac 972 +#define OBJ_camellia_256_cmac OBJ_camellia,50L + +#define SN_camellia_128_cfb1 "CAMELLIA-128-CFB1" +#define LN_camellia_128_cfb1 "camellia-128-cfb1" +#define NID_camellia_128_cfb1 760 + +#define SN_camellia_192_cfb1 "CAMELLIA-192-CFB1" +#define LN_camellia_192_cfb1 "camellia-192-cfb1" +#define NID_camellia_192_cfb1 761 + +#define SN_camellia_256_cfb1 "CAMELLIA-256-CFB1" +#define LN_camellia_256_cfb1 "camellia-256-cfb1" +#define NID_camellia_256_cfb1 762 + +#define SN_camellia_128_cfb8 "CAMELLIA-128-CFB8" +#define LN_camellia_128_cfb8 "camellia-128-cfb8" +#define NID_camellia_128_cfb8 763 + +#define SN_camellia_192_cfb8 "CAMELLIA-192-CFB8" +#define LN_camellia_192_cfb8 "camellia-192-cfb8" +#define NID_camellia_192_cfb8 764 + +#define SN_camellia_256_cfb8 "CAMELLIA-256-CFB8" +#define LN_camellia_256_cfb8 "camellia-256-cfb8" +#define NID_camellia_256_cfb8 765 + +#define OBJ_aria 1L,2L,410L,200046L,1L,1L + +#define SN_aria_128_ecb "ARIA-128-ECB" +#define LN_aria_128_ecb "aria-128-ecb" +#define NID_aria_128_ecb 1065 +#define OBJ_aria_128_ecb OBJ_aria,1L + +#define SN_aria_128_cbc "ARIA-128-CBC" +#define LN_aria_128_cbc "aria-128-cbc" +#define NID_aria_128_cbc 1066 +#define OBJ_aria_128_cbc OBJ_aria,2L + +#define SN_aria_128_cfb128 "ARIA-128-CFB" +#define LN_aria_128_cfb128 "aria-128-cfb" +#define NID_aria_128_cfb128 1067 +#define OBJ_aria_128_cfb128 OBJ_aria,3L + +#define SN_aria_128_ofb128 "ARIA-128-OFB" +#define LN_aria_128_ofb128 "aria-128-ofb" +#define NID_aria_128_ofb128 1068 +#define OBJ_aria_128_ofb128 OBJ_aria,4L + +#define SN_aria_128_ctr "ARIA-128-CTR" +#define LN_aria_128_ctr "aria-128-ctr" +#define NID_aria_128_ctr 1069 +#define OBJ_aria_128_ctr OBJ_aria,5L + +#define SN_aria_192_ecb "ARIA-192-ECB" +#define LN_aria_192_ecb "aria-192-ecb" +#define NID_aria_192_ecb 1070 +#define OBJ_aria_192_ecb OBJ_aria,6L + +#define SN_aria_192_cbc "ARIA-192-CBC" +#define LN_aria_192_cbc "aria-192-cbc" +#define NID_aria_192_cbc 1071 +#define OBJ_aria_192_cbc OBJ_aria,7L + +#define SN_aria_192_cfb128 "ARIA-192-CFB" +#define LN_aria_192_cfb128 "aria-192-cfb" +#define NID_aria_192_cfb128 1072 +#define OBJ_aria_192_cfb128 OBJ_aria,8L + +#define SN_aria_192_ofb128 "ARIA-192-OFB" +#define LN_aria_192_ofb128 "aria-192-ofb" +#define NID_aria_192_ofb128 1073 +#define OBJ_aria_192_ofb128 OBJ_aria,9L + +#define SN_aria_192_ctr "ARIA-192-CTR" +#define LN_aria_192_ctr "aria-192-ctr" +#define NID_aria_192_ctr 1074 +#define OBJ_aria_192_ctr OBJ_aria,10L + +#define SN_aria_256_ecb "ARIA-256-ECB" +#define LN_aria_256_ecb "aria-256-ecb" +#define NID_aria_256_ecb 1075 +#define OBJ_aria_256_ecb OBJ_aria,11L + +#define SN_aria_256_cbc "ARIA-256-CBC" +#define LN_aria_256_cbc "aria-256-cbc" +#define NID_aria_256_cbc 1076 +#define OBJ_aria_256_cbc OBJ_aria,12L + +#define SN_aria_256_cfb128 "ARIA-256-CFB" +#define LN_aria_256_cfb128 "aria-256-cfb" +#define NID_aria_256_cfb128 1077 +#define OBJ_aria_256_cfb128 OBJ_aria,13L + +#define SN_aria_256_ofb128 "ARIA-256-OFB" +#define LN_aria_256_ofb128 "aria-256-ofb" +#define NID_aria_256_ofb128 1078 +#define OBJ_aria_256_ofb128 OBJ_aria,14L + +#define SN_aria_256_ctr "ARIA-256-CTR" +#define LN_aria_256_ctr "aria-256-ctr" +#define NID_aria_256_ctr 1079 +#define OBJ_aria_256_ctr OBJ_aria,15L + +#define SN_aria_128_cfb1 "ARIA-128-CFB1" +#define LN_aria_128_cfb1 "aria-128-cfb1" +#define NID_aria_128_cfb1 1080 + +#define SN_aria_192_cfb1 "ARIA-192-CFB1" +#define LN_aria_192_cfb1 "aria-192-cfb1" +#define NID_aria_192_cfb1 1081 + +#define SN_aria_256_cfb1 "ARIA-256-CFB1" +#define LN_aria_256_cfb1 "aria-256-cfb1" +#define NID_aria_256_cfb1 1082 + +#define SN_aria_128_cfb8 "ARIA-128-CFB8" +#define LN_aria_128_cfb8 "aria-128-cfb8" +#define NID_aria_128_cfb8 1083 + +#define SN_aria_192_cfb8 "ARIA-192-CFB8" +#define LN_aria_192_cfb8 "aria-192-cfb8" +#define NID_aria_192_cfb8 1084 + +#define SN_aria_256_cfb8 "ARIA-256-CFB8" +#define LN_aria_256_cfb8 "aria-256-cfb8" +#define NID_aria_256_cfb8 1085 + +#define SN_aria_128_ccm "ARIA-128-CCM" +#define LN_aria_128_ccm "aria-128-ccm" +#define NID_aria_128_ccm 1120 +#define OBJ_aria_128_ccm OBJ_aria,37L + +#define SN_aria_192_ccm "ARIA-192-CCM" +#define LN_aria_192_ccm "aria-192-ccm" +#define NID_aria_192_ccm 1121 +#define OBJ_aria_192_ccm OBJ_aria,38L + +#define SN_aria_256_ccm "ARIA-256-CCM" +#define LN_aria_256_ccm "aria-256-ccm" +#define NID_aria_256_ccm 1122 +#define OBJ_aria_256_ccm OBJ_aria,39L + +#define SN_aria_128_gcm "ARIA-128-GCM" +#define LN_aria_128_gcm "aria-128-gcm" +#define NID_aria_128_gcm 1123 +#define OBJ_aria_128_gcm OBJ_aria,34L + +#define SN_aria_192_gcm "ARIA-192-GCM" +#define LN_aria_192_gcm "aria-192-gcm" +#define NID_aria_192_gcm 1124 +#define OBJ_aria_192_gcm OBJ_aria,35L + +#define SN_aria_256_gcm "ARIA-256-GCM" +#define LN_aria_256_gcm "aria-256-gcm" +#define NID_aria_256_gcm 1125 +#define OBJ_aria_256_gcm OBJ_aria,36L + +#define SN_kisa "KISA" +#define LN_kisa "kisa" +#define NID_kisa 773 +#define OBJ_kisa OBJ_member_body,410L,200004L + +#define SN_seed_ecb "SEED-ECB" +#define LN_seed_ecb "seed-ecb" +#define NID_seed_ecb 776 +#define OBJ_seed_ecb OBJ_kisa,1L,3L + +#define SN_seed_cbc "SEED-CBC" +#define LN_seed_cbc "seed-cbc" +#define NID_seed_cbc 777 +#define OBJ_seed_cbc OBJ_kisa,1L,4L + +#define SN_seed_cfb128 "SEED-CFB" +#define LN_seed_cfb128 "seed-cfb" +#define NID_seed_cfb128 779 +#define OBJ_seed_cfb128 OBJ_kisa,1L,5L + +#define SN_seed_ofb128 "SEED-OFB" +#define LN_seed_ofb128 "seed-ofb" +#define NID_seed_ofb128 778 +#define OBJ_seed_ofb128 OBJ_kisa,1L,6L + +#define SN_sm4_ecb "SM4-ECB" +#define LN_sm4_ecb "sm4-ecb" +#define NID_sm4_ecb 1133 +#define OBJ_sm4_ecb OBJ_sm_scheme,104L,1L + +#define SN_sm4_cbc "SM4-CBC" +#define LN_sm4_cbc "sm4-cbc" +#define NID_sm4_cbc 1134 +#define OBJ_sm4_cbc OBJ_sm_scheme,104L,2L + +#define SN_sm4_ofb128 "SM4-OFB" +#define LN_sm4_ofb128 "sm4-ofb" +#define NID_sm4_ofb128 1135 +#define OBJ_sm4_ofb128 OBJ_sm_scheme,104L,3L + +#define SN_sm4_cfb128 "SM4-CFB" +#define LN_sm4_cfb128 "sm4-cfb" +#define NID_sm4_cfb128 1137 +#define OBJ_sm4_cfb128 OBJ_sm_scheme,104L,4L + +#define SN_sm4_cfb1 "SM4-CFB1" +#define LN_sm4_cfb1 "sm4-cfb1" +#define NID_sm4_cfb1 1136 +#define OBJ_sm4_cfb1 OBJ_sm_scheme,104L,5L + +#define SN_sm4_cfb8 "SM4-CFB8" +#define LN_sm4_cfb8 "sm4-cfb8" +#define NID_sm4_cfb8 1138 +#define OBJ_sm4_cfb8 OBJ_sm_scheme,104L,6L + +#define SN_sm4_ctr "SM4-CTR" +#define LN_sm4_ctr "sm4-ctr" +#define NID_sm4_ctr 1139 +#define OBJ_sm4_ctr OBJ_sm_scheme,104L,7L + +#define SN_sm4_gcm "SM4-GCM" +#define LN_sm4_gcm "sm4-gcm" +#define NID_sm4_gcm 1248 +#define OBJ_sm4_gcm OBJ_sm_scheme,104L,8L + +#define SN_sm4_ccm "SM4-CCM" +#define LN_sm4_ccm "sm4-ccm" +#define NID_sm4_ccm 1249 +#define OBJ_sm4_ccm OBJ_sm_scheme,104L,9L + +#define SN_sm4_xts "SM4-XTS" +#define LN_sm4_xts "sm4-xts" +#define NID_sm4_xts 1290 +#define OBJ_sm4_xts OBJ_sm_scheme,104L,10L + +#define SN_hmac "HMAC" +#define LN_hmac "hmac" +#define NID_hmac 855 + +#define SN_cmac "CMAC" +#define LN_cmac "cmac" +#define NID_cmac 894 + +#define SN_rc4_hmac_md5 "RC4-HMAC-MD5" +#define LN_rc4_hmac_md5 "rc4-hmac-md5" +#define NID_rc4_hmac_md5 915 + +#define SN_aes_128_cbc_hmac_sha1 "AES-128-CBC-HMAC-SHA1" +#define LN_aes_128_cbc_hmac_sha1 "aes-128-cbc-hmac-sha1" +#define NID_aes_128_cbc_hmac_sha1 916 + +#define SN_aes_192_cbc_hmac_sha1 "AES-192-CBC-HMAC-SHA1" +#define LN_aes_192_cbc_hmac_sha1 "aes-192-cbc-hmac-sha1" +#define NID_aes_192_cbc_hmac_sha1 917 + +#define SN_aes_256_cbc_hmac_sha1 "AES-256-CBC-HMAC-SHA1" +#define LN_aes_256_cbc_hmac_sha1 "aes-256-cbc-hmac-sha1" +#define NID_aes_256_cbc_hmac_sha1 918 + +#define SN_aes_128_cbc_hmac_sha256 "AES-128-CBC-HMAC-SHA256" +#define LN_aes_128_cbc_hmac_sha256 "aes-128-cbc-hmac-sha256" +#define NID_aes_128_cbc_hmac_sha256 948 + +#define SN_aes_192_cbc_hmac_sha256 "AES-192-CBC-HMAC-SHA256" +#define LN_aes_192_cbc_hmac_sha256 "aes-192-cbc-hmac-sha256" +#define NID_aes_192_cbc_hmac_sha256 949 + +#define SN_aes_256_cbc_hmac_sha256 "AES-256-CBC-HMAC-SHA256" +#define LN_aes_256_cbc_hmac_sha256 "aes-256-cbc-hmac-sha256" +#define NID_aes_256_cbc_hmac_sha256 950 + +#define SN_chacha20_poly1305 "ChaCha20-Poly1305" +#define LN_chacha20_poly1305 "chacha20-poly1305" +#define NID_chacha20_poly1305 1018 + +#define SN_chacha20 "ChaCha20" +#define LN_chacha20 "chacha20" +#define NID_chacha20 1019 + +#define SN_aes_128_cbc_hmac_sha1_etm "AES-128-CBC-HMAC-SHA1-ETM" +#define LN_aes_128_cbc_hmac_sha1_etm "aes-128-cbc-hmac-sha1-etm" +#define NID_aes_128_cbc_hmac_sha1_etm 1487 + +#define SN_aes_192_cbc_hmac_sha1_etm "AES-192-CBC-HMAC-SHA1-ETM" +#define LN_aes_192_cbc_hmac_sha1_etm "aes-192-cbc-hmac-sha1-etm" +#define NID_aes_192_cbc_hmac_sha1_etm 1488 + +#define SN_aes_256_cbc_hmac_sha1_etm "AES-256-CBC-HMAC-SHA1-ETM" +#define LN_aes_256_cbc_hmac_sha1_etm "aes-256-cbc-hmac-sha1-etm" +#define NID_aes_256_cbc_hmac_sha1_etm 1489 + +#define SN_aes_128_cbc_hmac_sha256_etm "AES-128-CBC-HMAC-SHA256-ETM" +#define LN_aes_128_cbc_hmac_sha256_etm "aes-128-cbc-hmac-sha256-etm" +#define NID_aes_128_cbc_hmac_sha256_etm 1490 + +#define SN_aes_192_cbc_hmac_sha256_etm "AES-192-CBC-HMAC-SHA256-ETM" +#define LN_aes_192_cbc_hmac_sha256_etm "aes-192-cbc-hmac-sha256-etm" +#define NID_aes_192_cbc_hmac_sha256_etm 1491 + +#define SN_aes_256_cbc_hmac_sha256_etm "AES-256-CBC-HMAC-SHA256-ETM" +#define LN_aes_256_cbc_hmac_sha256_etm "aes-256-cbc-hmac-sha256-etm" +#define NID_aes_256_cbc_hmac_sha256_etm 1492 + +#define SN_aes_128_cbc_hmac_sha512_etm "AES-128-CBC-HMAC-SHA512-ETM" +#define LN_aes_128_cbc_hmac_sha512_etm "aes-128-cbc-hmac-sha512-etm" +#define NID_aes_128_cbc_hmac_sha512_etm 1493 + +#define SN_aes_192_cbc_hmac_sha512_etm "AES-192-CBC-HMAC-SHA512-ETM" +#define LN_aes_192_cbc_hmac_sha512_etm "aes-192-cbc-hmac-sha512-etm" +#define NID_aes_192_cbc_hmac_sha512_etm 1494 + +#define SN_aes_256_cbc_hmac_sha512_etm "AES-256-CBC-HMAC-SHA512-ETM" +#define LN_aes_256_cbc_hmac_sha512_etm "aes-256-cbc-hmac-sha512-etm" +#define NID_aes_256_cbc_hmac_sha512_etm 1495 + +#define SN_dhpublicnumber "dhpublicnumber" +#define LN_dhpublicnumber "X9.42 DH" +#define NID_dhpublicnumber 920 +#define OBJ_dhpublicnumber OBJ_ISO_US,10046L,2L,1L + +#define SN_brainpoolP160r1 "brainpoolP160r1" +#define NID_brainpoolP160r1 921 +#define OBJ_brainpoolP160r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,1L + +#define SN_brainpoolP160t1 "brainpoolP160t1" +#define NID_brainpoolP160t1 922 +#define OBJ_brainpoolP160t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,2L + +#define SN_brainpoolP192r1 "brainpoolP192r1" +#define NID_brainpoolP192r1 923 +#define OBJ_brainpoolP192r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,3L + +#define SN_brainpoolP192t1 "brainpoolP192t1" +#define NID_brainpoolP192t1 924 +#define OBJ_brainpoolP192t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,4L + +#define SN_brainpoolP224r1 "brainpoolP224r1" +#define NID_brainpoolP224r1 925 +#define OBJ_brainpoolP224r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,5L + +#define SN_brainpoolP224t1 "brainpoolP224t1" +#define NID_brainpoolP224t1 926 +#define OBJ_brainpoolP224t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,6L + +#define SN_brainpoolP256r1 "brainpoolP256r1" +#define NID_brainpoolP256r1 927 +#define OBJ_brainpoolP256r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,7L + +#define SN_brainpoolP256r1tls13 "brainpoolP256r1tls13" +#define NID_brainpoolP256r1tls13 1285 + +#define SN_brainpoolP256t1 "brainpoolP256t1" +#define NID_brainpoolP256t1 928 +#define OBJ_brainpoolP256t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,8L + +#define SN_brainpoolP320r1 "brainpoolP320r1" +#define NID_brainpoolP320r1 929 +#define OBJ_brainpoolP320r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,9L + +#define SN_brainpoolP320t1 "brainpoolP320t1" +#define NID_brainpoolP320t1 930 +#define OBJ_brainpoolP320t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,10L + +#define SN_brainpoolP384r1 "brainpoolP384r1" +#define NID_brainpoolP384r1 931 +#define OBJ_brainpoolP384r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,11L + +#define SN_brainpoolP384r1tls13 "brainpoolP384r1tls13" +#define NID_brainpoolP384r1tls13 1286 + +#define SN_brainpoolP384t1 "brainpoolP384t1" +#define NID_brainpoolP384t1 932 +#define OBJ_brainpoolP384t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,12L + +#define SN_brainpoolP512r1 "brainpoolP512r1" +#define NID_brainpoolP512r1 933 +#define OBJ_brainpoolP512r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,13L + +#define SN_brainpoolP512r1tls13 "brainpoolP512r1tls13" +#define NID_brainpoolP512r1tls13 1287 + +#define SN_brainpoolP512t1 "brainpoolP512t1" +#define NID_brainpoolP512t1 934 +#define OBJ_brainpoolP512t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,14L + +#define OBJ_x9_63_scheme 1L,3L,133L,16L,840L,63L,0L + +#define OBJ_secg_scheme OBJ_certicom_arc,1L + +#define SN_dhSinglePass_stdDH_sha1kdf_scheme "dhSinglePass-stdDH-sha1kdf-scheme" +#define NID_dhSinglePass_stdDH_sha1kdf_scheme 936 +#define OBJ_dhSinglePass_stdDH_sha1kdf_scheme OBJ_x9_63_scheme,2L + +#define SN_dhSinglePass_stdDH_sha224kdf_scheme "dhSinglePass-stdDH-sha224kdf-scheme" +#define NID_dhSinglePass_stdDH_sha224kdf_scheme 937 +#define OBJ_dhSinglePass_stdDH_sha224kdf_scheme OBJ_secg_scheme,11L,0L + +#define SN_dhSinglePass_stdDH_sha256kdf_scheme "dhSinglePass-stdDH-sha256kdf-scheme" +#define NID_dhSinglePass_stdDH_sha256kdf_scheme 938 +#define OBJ_dhSinglePass_stdDH_sha256kdf_scheme OBJ_secg_scheme,11L,1L + +#define SN_dhSinglePass_stdDH_sha384kdf_scheme "dhSinglePass-stdDH-sha384kdf-scheme" +#define NID_dhSinglePass_stdDH_sha384kdf_scheme 939 +#define OBJ_dhSinglePass_stdDH_sha384kdf_scheme OBJ_secg_scheme,11L,2L + +#define SN_dhSinglePass_stdDH_sha512kdf_scheme "dhSinglePass-stdDH-sha512kdf-scheme" +#define NID_dhSinglePass_stdDH_sha512kdf_scheme 940 +#define OBJ_dhSinglePass_stdDH_sha512kdf_scheme OBJ_secg_scheme,11L,3L + +#define SN_dhSinglePass_cofactorDH_sha1kdf_scheme "dhSinglePass-cofactorDH-sha1kdf-scheme" +#define NID_dhSinglePass_cofactorDH_sha1kdf_scheme 941 +#define OBJ_dhSinglePass_cofactorDH_sha1kdf_scheme OBJ_x9_63_scheme,3L + +#define SN_dhSinglePass_cofactorDH_sha224kdf_scheme "dhSinglePass-cofactorDH-sha224kdf-scheme" +#define NID_dhSinglePass_cofactorDH_sha224kdf_scheme 942 +#define OBJ_dhSinglePass_cofactorDH_sha224kdf_scheme OBJ_secg_scheme,14L,0L + +#define SN_dhSinglePass_cofactorDH_sha256kdf_scheme "dhSinglePass-cofactorDH-sha256kdf-scheme" +#define NID_dhSinglePass_cofactorDH_sha256kdf_scheme 943 +#define OBJ_dhSinglePass_cofactorDH_sha256kdf_scheme OBJ_secg_scheme,14L,1L + +#define SN_dhSinglePass_cofactorDH_sha384kdf_scheme "dhSinglePass-cofactorDH-sha384kdf-scheme" +#define NID_dhSinglePass_cofactorDH_sha384kdf_scheme 944 +#define OBJ_dhSinglePass_cofactorDH_sha384kdf_scheme OBJ_secg_scheme,14L,2L + +#define SN_dhSinglePass_cofactorDH_sha512kdf_scheme "dhSinglePass-cofactorDH-sha512kdf-scheme" +#define NID_dhSinglePass_cofactorDH_sha512kdf_scheme 945 +#define OBJ_dhSinglePass_cofactorDH_sha512kdf_scheme OBJ_secg_scheme,14L,3L + +#define SN_dh_std_kdf "dh-std-kdf" +#define NID_dh_std_kdf 946 + +#define SN_dh_cofactor_kdf "dh-cofactor-kdf" +#define NID_dh_cofactor_kdf 947 + +#define SN_ct_precert_scts "ct_precert_scts" +#define LN_ct_precert_scts "CT Precertificate SCTs" +#define NID_ct_precert_scts 951 +#define OBJ_ct_precert_scts 1L,3L,6L,1L,4L,1L,11129L,2L,4L,2L + +#define SN_ct_precert_poison "ct_precert_poison" +#define LN_ct_precert_poison "CT Precertificate Poison" +#define NID_ct_precert_poison 952 +#define OBJ_ct_precert_poison 1L,3L,6L,1L,4L,1L,11129L,2L,4L,3L + +#define SN_ct_precert_signer "ct_precert_signer" +#define LN_ct_precert_signer "CT Precertificate Signer" +#define NID_ct_precert_signer 953 +#define OBJ_ct_precert_signer 1L,3L,6L,1L,4L,1L,11129L,2L,4L,4L + +#define SN_ct_cert_scts "ct_cert_scts" +#define LN_ct_cert_scts "CT Certificate SCTs" +#define NID_ct_cert_scts 954 +#define OBJ_ct_cert_scts 1L,3L,6L,1L,4L,1L,11129L,2L,4L,5L + +#define SN_jurisdictionLocalityName "jurisdictionL" +#define LN_jurisdictionLocalityName "jurisdictionLocalityName" +#define NID_jurisdictionLocalityName 955 +#define OBJ_jurisdictionLocalityName OBJ_ms_corp,60L,2L,1L,1L + +#define SN_jurisdictionStateOrProvinceName "jurisdictionST" +#define LN_jurisdictionStateOrProvinceName "jurisdictionStateOrProvinceName" +#define NID_jurisdictionStateOrProvinceName 956 +#define OBJ_jurisdictionStateOrProvinceName OBJ_ms_corp,60L,2L,1L,2L + +#define SN_jurisdictionCountryName "jurisdictionC" +#define LN_jurisdictionCountryName "jurisdictionCountryName" +#define NID_jurisdictionCountryName 957 +#define OBJ_jurisdictionCountryName OBJ_ms_corp,60L,2L,1L,3L + +#define SN_id_scrypt "id-scrypt" +#define LN_id_scrypt "scrypt" +#define NID_id_scrypt 973 +#define OBJ_id_scrypt 1L,3L,6L,1L,4L,1L,11591L,4L,11L + +#define SN_tls1_prf "TLS1-PRF" +#define LN_tls1_prf "tls1-prf" +#define NID_tls1_prf 1021 + +#define SN_hkdf "HKDF" +#define LN_hkdf "hkdf" +#define NID_hkdf 1036 + +#define SN_sshkdf "SSHKDF" +#define LN_sshkdf "sshkdf" +#define NID_sshkdf 1203 + +#define SN_sskdf "SSKDF" +#define LN_sskdf "sskdf" +#define NID_sskdf 1205 + +#define SN_x942kdf "X942KDF" +#define LN_x942kdf "x942kdf" +#define NID_x942kdf 1207 + +#define SN_x963kdf "X963KDF" +#define LN_x963kdf "x963kdf" +#define NID_x963kdf 1206 + +#define SN_id_pkinit "id-pkinit" +#define NID_id_pkinit 1031 +#define OBJ_id_pkinit 1L,3L,6L,1L,5L,2L,3L + +#define SN_pkInitClientAuth "pkInitClientAuth" +#define LN_pkInitClientAuth "PKINIT Client Auth" +#define NID_pkInitClientAuth 1032 +#define OBJ_pkInitClientAuth OBJ_id_pkinit,4L + +#define SN_pkInitKDC "pkInitKDC" +#define LN_pkInitKDC "Signing KDC Response" +#define NID_pkInitKDC 1033 +#define OBJ_pkInitKDC OBJ_id_pkinit,5L + +#define SN_X25519 "X25519" +#define NID_X25519 1034 +#define OBJ_X25519 1L,3L,101L,110L + +#define SN_X448 "X448" +#define NID_X448 1035 +#define OBJ_X448 1L,3L,101L,111L + +#define SN_ED25519 "ED25519" +#define NID_ED25519 1087 +#define OBJ_ED25519 1L,3L,101L,112L + +#define SN_ED448 "ED448" +#define NID_ED448 1088 +#define OBJ_ED448 1L,3L,101L,113L + +#define SN_kx_rsa "KxRSA" +#define LN_kx_rsa "kx-rsa" +#define NID_kx_rsa 1037 + +#define SN_kx_ecdhe "KxECDHE" +#define LN_kx_ecdhe "kx-ecdhe" +#define NID_kx_ecdhe 1038 + +#define SN_kx_dhe "KxDHE" +#define LN_kx_dhe "kx-dhe" +#define NID_kx_dhe 1039 + +#define SN_kx_ecdhe_psk "KxECDHE-PSK" +#define LN_kx_ecdhe_psk "kx-ecdhe-psk" +#define NID_kx_ecdhe_psk 1040 + +#define SN_kx_dhe_psk "KxDHE-PSK" +#define LN_kx_dhe_psk "kx-dhe-psk" +#define NID_kx_dhe_psk 1041 + +#define SN_kx_rsa_psk "KxRSA_PSK" +#define LN_kx_rsa_psk "kx-rsa-psk" +#define NID_kx_rsa_psk 1042 + +#define SN_kx_psk "KxPSK" +#define LN_kx_psk "kx-psk" +#define NID_kx_psk 1043 + +#define SN_kx_srp "KxSRP" +#define LN_kx_srp "kx-srp" +#define NID_kx_srp 1044 + +#define SN_kx_gost "KxGOST" +#define LN_kx_gost "kx-gost" +#define NID_kx_gost 1045 + +#define SN_kx_gost18 "KxGOST18" +#define LN_kx_gost18 "kx-gost18" +#define NID_kx_gost18 1218 + +#define SN_kx_any "KxANY" +#define LN_kx_any "kx-any" +#define NID_kx_any 1063 + +#define SN_auth_rsa "AuthRSA" +#define LN_auth_rsa "auth-rsa" +#define NID_auth_rsa 1046 + +#define SN_auth_ecdsa "AuthECDSA" +#define LN_auth_ecdsa "auth-ecdsa" +#define NID_auth_ecdsa 1047 + +#define SN_auth_psk "AuthPSK" +#define LN_auth_psk "auth-psk" +#define NID_auth_psk 1048 + +#define SN_auth_dss "AuthDSS" +#define LN_auth_dss "auth-dss" +#define NID_auth_dss 1049 + +#define SN_auth_gost01 "AuthGOST01" +#define LN_auth_gost01 "auth-gost01" +#define NID_auth_gost01 1050 + +#define SN_auth_gost12 "AuthGOST12" +#define LN_auth_gost12 "auth-gost12" +#define NID_auth_gost12 1051 + +#define SN_auth_srp "AuthSRP" +#define LN_auth_srp "auth-srp" +#define NID_auth_srp 1052 + +#define SN_auth_null "AuthNULL" +#define LN_auth_null "auth-null" +#define NID_auth_null 1053 + +#define SN_auth_any "AuthANY" +#define LN_auth_any "auth-any" +#define NID_auth_any 1064 + +#define SN_poly1305 "Poly1305" +#define LN_poly1305 "poly1305" +#define NID_poly1305 1061 + +#define SN_siphash "SipHash" +#define LN_siphash "siphash" +#define NID_siphash 1062 + +#define SN_ffdhe2048 "ffdhe2048" +#define NID_ffdhe2048 1126 + +#define SN_ffdhe3072 "ffdhe3072" +#define NID_ffdhe3072 1127 + +#define SN_ffdhe4096 "ffdhe4096" +#define NID_ffdhe4096 1128 + +#define SN_ffdhe6144 "ffdhe6144" +#define NID_ffdhe6144 1129 + +#define SN_ffdhe8192 "ffdhe8192" +#define NID_ffdhe8192 1130 + +#define SN_modp_1536 "modp_1536" +#define NID_modp_1536 1212 + +#define SN_modp_2048 "modp_2048" +#define NID_modp_2048 1213 + +#define SN_modp_3072 "modp_3072" +#define NID_modp_3072 1214 + +#define SN_modp_4096 "modp_4096" +#define NID_modp_4096 1215 + +#define SN_modp_6144 "modp_6144" +#define NID_modp_6144 1216 + +#define SN_modp_8192 "modp_8192" +#define NID_modp_8192 1217 + +#define SN_ISO_UA "ISO-UA" +#define NID_ISO_UA 1150 +#define OBJ_ISO_UA OBJ_member_body,804L + +#define SN_ua_pki "ua-pki" +#define NID_ua_pki 1151 +#define OBJ_ua_pki OBJ_ISO_UA,2L,1L,1L,1L + +#define SN_dstu28147 "dstu28147" +#define LN_dstu28147 "DSTU Gost 28147-2009" +#define NID_dstu28147 1152 +#define OBJ_dstu28147 OBJ_ua_pki,1L,1L,1L + +#define SN_dstu28147_ofb "dstu28147-ofb" +#define LN_dstu28147_ofb "DSTU Gost 28147-2009 OFB mode" +#define NID_dstu28147_ofb 1153 +#define OBJ_dstu28147_ofb OBJ_dstu28147,2L + +#define SN_dstu28147_cfb "dstu28147-cfb" +#define LN_dstu28147_cfb "DSTU Gost 28147-2009 CFB mode" +#define NID_dstu28147_cfb 1154 +#define OBJ_dstu28147_cfb OBJ_dstu28147,3L + +#define SN_dstu28147_wrap "dstu28147-wrap" +#define LN_dstu28147_wrap "DSTU Gost 28147-2009 key wrap" +#define NID_dstu28147_wrap 1155 +#define OBJ_dstu28147_wrap OBJ_dstu28147,5L + +#define SN_hmacWithDstu34311 "hmacWithDstu34311" +#define LN_hmacWithDstu34311 "HMAC DSTU Gost 34311-95" +#define NID_hmacWithDstu34311 1156 +#define OBJ_hmacWithDstu34311 OBJ_ua_pki,1L,1L,2L + +#define SN_dstu34311 "dstu34311" +#define LN_dstu34311 "DSTU Gost 34311-95" +#define NID_dstu34311 1157 +#define OBJ_dstu34311 OBJ_ua_pki,1L,2L,1L + +#define SN_dstu4145le "dstu4145le" +#define LN_dstu4145le "DSTU 4145-2002 little endian" +#define NID_dstu4145le 1158 +#define OBJ_dstu4145le OBJ_ua_pki,1L,3L,1L,1L + +#define SN_dstu4145be "dstu4145be" +#define LN_dstu4145be "DSTU 4145-2002 big endian" +#define NID_dstu4145be 1159 +#define OBJ_dstu4145be OBJ_dstu4145le,1L,1L + +#define SN_uacurve0 "uacurve0" +#define LN_uacurve0 "DSTU curve 0" +#define NID_uacurve0 1160 +#define OBJ_uacurve0 OBJ_dstu4145le,2L,0L + +#define SN_uacurve1 "uacurve1" +#define LN_uacurve1 "DSTU curve 1" +#define NID_uacurve1 1161 +#define OBJ_uacurve1 OBJ_dstu4145le,2L,1L + +#define SN_uacurve2 "uacurve2" +#define LN_uacurve2 "DSTU curve 2" +#define NID_uacurve2 1162 +#define OBJ_uacurve2 OBJ_dstu4145le,2L,2L + +#define SN_uacurve3 "uacurve3" +#define LN_uacurve3 "DSTU curve 3" +#define NID_uacurve3 1163 +#define OBJ_uacurve3 OBJ_dstu4145le,2L,3L + +#define SN_uacurve4 "uacurve4" +#define LN_uacurve4 "DSTU curve 4" +#define NID_uacurve4 1164 +#define OBJ_uacurve4 OBJ_dstu4145le,2L,4L + +#define SN_uacurve5 "uacurve5" +#define LN_uacurve5 "DSTU curve 5" +#define NID_uacurve5 1165 +#define OBJ_uacurve5 OBJ_dstu4145le,2L,5L + +#define SN_uacurve6 "uacurve6" +#define LN_uacurve6 "DSTU curve 6" +#define NID_uacurve6 1166 +#define OBJ_uacurve6 OBJ_dstu4145le,2L,6L + +#define SN_uacurve7 "uacurve7" +#define LN_uacurve7 "DSTU curve 7" +#define NID_uacurve7 1167 +#define OBJ_uacurve7 OBJ_dstu4145le,2L,7L + +#define SN_uacurve8 "uacurve8" +#define LN_uacurve8 "DSTU curve 8" +#define NID_uacurve8 1168 +#define OBJ_uacurve8 OBJ_dstu4145le,2L,8L + +#define SN_uacurve9 "uacurve9" +#define LN_uacurve9 "DSTU curve 9" +#define NID_uacurve9 1169 +#define OBJ_uacurve9 OBJ_dstu4145le,2L,9L + +#define SN_aes_128_siv "AES-128-SIV" +#define LN_aes_128_siv "aes-128-siv" +#define NID_aes_128_siv 1198 + +#define SN_aes_192_siv "AES-192-SIV" +#define LN_aes_192_siv "aes-192-siv" +#define NID_aes_192_siv 1199 + +#define SN_aes_256_siv "AES-256-SIV" +#define LN_aes_256_siv "aes-256-siv" +#define NID_aes_256_siv 1200 + +#define SN_oracle "oracle-organization" +#define LN_oracle "Oracle organization" +#define NID_oracle 1282 +#define OBJ_oracle OBJ_joint_iso_itu_t,16L,840L,1L,113894L + +#define SN_oracle_jdk_trustedkeyusage "oracle-jdk-trustedkeyusage" +#define LN_oracle_jdk_trustedkeyusage "Trusted key usage (Oracle)" +#define NID_oracle_jdk_trustedkeyusage 1283 +#define OBJ_oracle_jdk_trustedkeyusage OBJ_oracle,746875L,1L,1L + +#define SN_brotli "brotli" +#define LN_brotli "Brotli compression" +#define NID_brotli 1288 + +#define SN_zstd "zstd" +#define LN_zstd "Zstandard compression" +#define NID_zstd 1289 + +#define SN_tcg "tcg" +#define LN_tcg "Trusted Computing Group" +#define NID_tcg 1324 +#define OBJ_tcg 2L,23L,133L + +#define SN_tcg_tcpaSpecVersion "tcg-tcpaSpecVersion" +#define NID_tcg_tcpaSpecVersion 1325 +#define OBJ_tcg_tcpaSpecVersion OBJ_tcg,1L + +#define SN_tcg_attribute "tcg-attribute" +#define LN_tcg_attribute "Trusted Computing Group Attributes" +#define NID_tcg_attribute 1326 +#define OBJ_tcg_attribute OBJ_tcg,2L + +#define SN_tcg_protocol "tcg-protocol" +#define LN_tcg_protocol "Trusted Computing Group Protocols" +#define NID_tcg_protocol 1327 +#define OBJ_tcg_protocol OBJ_tcg,3L + +#define SN_tcg_algorithm "tcg-algorithm" +#define LN_tcg_algorithm "Trusted Computing Group Algorithms" +#define NID_tcg_algorithm 1328 +#define OBJ_tcg_algorithm OBJ_tcg,4L + +#define SN_tcg_platformClass "tcg-platformClass" +#define LN_tcg_platformClass "Trusted Computing Group Platform Classes" +#define NID_tcg_platformClass 1329 +#define OBJ_tcg_platformClass OBJ_tcg,5L + +#define SN_tcg_ce "tcg-ce" +#define LN_tcg_ce "Trusted Computing Group Certificate Extensions" +#define NID_tcg_ce 1330 +#define OBJ_tcg_ce OBJ_tcg,6L + +#define SN_tcg_kp "tcg-kp" +#define LN_tcg_kp "Trusted Computing Group Key Purposes" +#define NID_tcg_kp 1331 +#define OBJ_tcg_kp OBJ_tcg,8L + +#define SN_tcg_ca "tcg-ca" +#define LN_tcg_ca "Trusted Computing Group Certificate Policies" +#define NID_tcg_ca 1332 +#define OBJ_tcg_ca OBJ_tcg,11L + +#define SN_tcg_address "tcg-address" +#define LN_tcg_address "Trusted Computing Group Address Formats" +#define NID_tcg_address 1333 +#define OBJ_tcg_address OBJ_tcg,17L + +#define SN_tcg_registry "tcg-registry" +#define LN_tcg_registry "Trusted Computing Group Registry" +#define NID_tcg_registry 1334 +#define OBJ_tcg_registry OBJ_tcg,18L + +#define SN_tcg_traits "tcg-traits" +#define LN_tcg_traits "Trusted Computing Group Traits" +#define NID_tcg_traits 1335 +#define OBJ_tcg_traits OBJ_tcg,19L + +#define SN_tcg_common "tcg-common" +#define LN_tcg_common "Trusted Computing Group Common" +#define NID_tcg_common 1336 +#define OBJ_tcg_common OBJ_tcg_platformClass,1L + +#define SN_tcg_at_platformManufacturerStr "tcg-at-platformManufacturerStr" +#define LN_tcg_at_platformManufacturerStr "TCG Platform Manufacturer String" +#define NID_tcg_at_platformManufacturerStr 1337 +#define OBJ_tcg_at_platformManufacturerStr OBJ_tcg_common,1L + +#define SN_tcg_at_platformManufacturerId "tcg-at-platformManufacturerId" +#define LN_tcg_at_platformManufacturerId "TCG Platform Manufacturer ID" +#define NID_tcg_at_platformManufacturerId 1338 +#define OBJ_tcg_at_platformManufacturerId OBJ_tcg_common,2L + +#define SN_tcg_at_platformConfigUri "tcg-at-platformConfigUri" +#define LN_tcg_at_platformConfigUri "TCG Platform Configuration URI" +#define NID_tcg_at_platformConfigUri 1339 +#define OBJ_tcg_at_platformConfigUri OBJ_tcg_common,3L + +#define SN_tcg_at_platformModel "tcg-at-platformModel" +#define LN_tcg_at_platformModel "TCG Platform Model" +#define NID_tcg_at_platformModel 1340 +#define OBJ_tcg_at_platformModel OBJ_tcg_common,4L + +#define SN_tcg_at_platformVersion "tcg-at-platformVersion" +#define LN_tcg_at_platformVersion "TCG Platform Version" +#define NID_tcg_at_platformVersion 1341 +#define OBJ_tcg_at_platformVersion OBJ_tcg_common,5L + +#define SN_tcg_at_platformSerial "tcg-at-platformSerial" +#define LN_tcg_at_platformSerial "TCG Platform Serial Number" +#define NID_tcg_at_platformSerial 1342 +#define OBJ_tcg_at_platformSerial OBJ_tcg_common,6L + +#define SN_tcg_at_platformConfiguration "tcg-at-platformConfiguration" +#define LN_tcg_at_platformConfiguration "TCG Platform Configuration" +#define NID_tcg_at_platformConfiguration 1343 +#define OBJ_tcg_at_platformConfiguration OBJ_tcg_common,7L + +#define SN_tcg_at_platformIdentifier "tcg-at-platformIdentifier" +#define LN_tcg_at_platformIdentifier "TCG Platform Identifier" +#define NID_tcg_at_platformIdentifier 1344 +#define OBJ_tcg_at_platformIdentifier OBJ_tcg_common,8L + +#define SN_tcg_at_tpmManufacturer "tcg-at-tpmManufacturer" +#define LN_tcg_at_tpmManufacturer "TPM Manufacturer" +#define NID_tcg_at_tpmManufacturer 1345 +#define OBJ_tcg_at_tpmManufacturer OBJ_tcg_attribute,1L + +#define SN_tcg_at_tpmModel "tcg-at-tpmModel" +#define LN_tcg_at_tpmModel "TPM Model" +#define NID_tcg_at_tpmModel 1346 +#define OBJ_tcg_at_tpmModel OBJ_tcg_attribute,2L + +#define SN_tcg_at_tpmVersion "tcg-at-tpmVersion" +#define LN_tcg_at_tpmVersion "TPM Version" +#define NID_tcg_at_tpmVersion 1347 +#define OBJ_tcg_at_tpmVersion OBJ_tcg_attribute,3L + +#define SN_tcg_at_securityQualities "tcg-at-securityQualities" +#define LN_tcg_at_securityQualities "Security Qualities" +#define NID_tcg_at_securityQualities 1348 +#define OBJ_tcg_at_securityQualities OBJ_tcg_attribute,10L + +#define SN_tcg_at_tpmProtectionProfile "tcg-at-tpmProtectionProfile" +#define LN_tcg_at_tpmProtectionProfile "TPM Protection Profile" +#define NID_tcg_at_tpmProtectionProfile 1349 +#define OBJ_tcg_at_tpmProtectionProfile OBJ_tcg_attribute,11L + +#define SN_tcg_at_tpmSecurityTarget "tcg-at-tpmSecurityTarget" +#define LN_tcg_at_tpmSecurityTarget "TPM Security Target" +#define NID_tcg_at_tpmSecurityTarget 1350 +#define OBJ_tcg_at_tpmSecurityTarget OBJ_tcg_attribute,12L + +#define SN_tcg_at_tbbProtectionProfile "tcg-at-tbbProtectionProfile" +#define LN_tcg_at_tbbProtectionProfile "TBB Protection Profile" +#define NID_tcg_at_tbbProtectionProfile 1351 +#define OBJ_tcg_at_tbbProtectionProfile OBJ_tcg_attribute,13L + +#define SN_tcg_at_tbbSecurityTarget "tcg-at-tbbSecurityTarget" +#define LN_tcg_at_tbbSecurityTarget "TBB Security Target" +#define NID_tcg_at_tbbSecurityTarget 1352 +#define OBJ_tcg_at_tbbSecurityTarget OBJ_tcg_attribute,14L + +#define SN_tcg_at_tpmIdLabel "tcg-at-tpmIdLabel" +#define LN_tcg_at_tpmIdLabel "TPM ID Label" +#define NID_tcg_at_tpmIdLabel 1353 +#define OBJ_tcg_at_tpmIdLabel OBJ_tcg_attribute,15L + +#define SN_tcg_at_tpmSpecification "tcg-at-tpmSpecification" +#define LN_tcg_at_tpmSpecification "TPM Specification" +#define NID_tcg_at_tpmSpecification 1354 +#define OBJ_tcg_at_tpmSpecification OBJ_tcg_attribute,16L + +#define SN_tcg_at_tcgPlatformSpecification "tcg-at-tcgPlatformSpecification" +#define LN_tcg_at_tcgPlatformSpecification "TPM Platform Specification" +#define NID_tcg_at_tcgPlatformSpecification 1355 +#define OBJ_tcg_at_tcgPlatformSpecification OBJ_tcg_attribute,17L + +#define SN_tcg_at_tpmSecurityAssertions "tcg-at-tpmSecurityAssertions" +#define LN_tcg_at_tpmSecurityAssertions "TPM Security Assertions" +#define NID_tcg_at_tpmSecurityAssertions 1356 +#define OBJ_tcg_at_tpmSecurityAssertions OBJ_tcg_attribute,18L + +#define SN_tcg_at_tbbSecurityAssertions "tcg-at-tbbSecurityAssertions" +#define LN_tcg_at_tbbSecurityAssertions "TBB Security Assertions" +#define NID_tcg_at_tbbSecurityAssertions 1357 +#define OBJ_tcg_at_tbbSecurityAssertions OBJ_tcg_attribute,19L + +#define SN_tcg_at_tcgCredentialSpecification "tcg-at-tcgCredentialSpecification" +#define LN_tcg_at_tcgCredentialSpecification "TCG Credential Specification" +#define NID_tcg_at_tcgCredentialSpecification 1358 +#define OBJ_tcg_at_tcgCredentialSpecification OBJ_tcg_attribute,23L + +#define SN_tcg_at_tcgCredentialType "tcg-at-tcgCredentialType" +#define LN_tcg_at_tcgCredentialType "TCG Credential Type" +#define NID_tcg_at_tcgCredentialType 1359 +#define OBJ_tcg_at_tcgCredentialType OBJ_tcg_attribute,25L + +#define SN_tcg_at_previousPlatformCertificates "tcg-at-previousPlatformCertificates" +#define LN_tcg_at_previousPlatformCertificates "TCG Previous Platform Certificates" +#define NID_tcg_at_previousPlatformCertificates 1360 +#define OBJ_tcg_at_previousPlatformCertificates OBJ_tcg_attribute,26L + +#define SN_tcg_at_tbbSecurityAssertions_v3 "tcg-at-tbbSecurityAssertions-v3" +#define LN_tcg_at_tbbSecurityAssertions_v3 "TCG TBB Security Assertions V3" +#define NID_tcg_at_tbbSecurityAssertions_v3 1361 +#define OBJ_tcg_at_tbbSecurityAssertions_v3 OBJ_tcg_attribute,27L + +#define SN_tcg_at_cryptographicAnchors "tcg-at-cryptographicAnchors" +#define LN_tcg_at_cryptographicAnchors "TCG Cryptographic Anchors" +#define NID_tcg_at_cryptographicAnchors 1362 +#define OBJ_tcg_at_cryptographicAnchors OBJ_tcg_attribute,28L + +#define SN_tcg_at_platformConfiguration_v1 "tcg-at-platformConfiguration-v1" +#define LN_tcg_at_platformConfiguration_v1 "Platform Configuration Version 1" +#define NID_tcg_at_platformConfiguration_v1 1363 +#define OBJ_tcg_at_platformConfiguration_v1 OBJ_tcg_at_platformConfiguration,1L + +#define SN_tcg_at_platformConfiguration_v2 "tcg-at-platformConfiguration-v2" +#define LN_tcg_at_platformConfiguration_v2 "Platform Configuration Version 2" +#define NID_tcg_at_platformConfiguration_v2 1364 +#define OBJ_tcg_at_platformConfiguration_v2 OBJ_tcg_at_platformConfiguration,2L + +#define SN_tcg_at_platformConfiguration_v3 "tcg-at-platformConfiguration-v3" +#define LN_tcg_at_platformConfiguration_v3 "Platform Configuration Version 3" +#define NID_tcg_at_platformConfiguration_v3 1365 +#define OBJ_tcg_at_platformConfiguration_v3 OBJ_tcg_at_platformConfiguration,3L + +#define SN_tcg_at_platformConfigUri_v3 "tcg-at-platformConfigUri-v3" +#define LN_tcg_at_platformConfigUri_v3 "Platform Configuration URI Version 3" +#define NID_tcg_at_platformConfigUri_v3 1366 +#define OBJ_tcg_at_platformConfigUri_v3 OBJ_tcg_at_platformConfiguration,4L + +#define SN_tcg_algorithm_null "tcg-algorithm-null" +#define LN_tcg_algorithm_null "TCG NULL Algorithm" +#define NID_tcg_algorithm_null 1367 +#define OBJ_tcg_algorithm_null OBJ_tcg_algorithm,1L + +#define SN_tcg_kp_EKCertificate "tcg-kp-EKCertificate" +#define LN_tcg_kp_EKCertificate "Endorsement Key Certificate" +#define NID_tcg_kp_EKCertificate 1368 +#define OBJ_tcg_kp_EKCertificate OBJ_tcg_kp,1L + +#define SN_tcg_kp_PlatformAttributeCertificate "tcg-kp-PlatformAttributeCertificate" +#define LN_tcg_kp_PlatformAttributeCertificate "Platform Attribute Certificate" +#define NID_tcg_kp_PlatformAttributeCertificate 1369 +#define OBJ_tcg_kp_PlatformAttributeCertificate OBJ_tcg_kp,2L + +#define SN_tcg_kp_AIKCertificate "tcg-kp-AIKCertificate" +#define LN_tcg_kp_AIKCertificate "Attestation Identity Key Certificate" +#define NID_tcg_kp_AIKCertificate 1370 +#define OBJ_tcg_kp_AIKCertificate OBJ_tcg_kp,3L + +#define SN_tcg_kp_PlatformKeyCertificate "tcg-kp-PlatformKeyCertificate" +#define LN_tcg_kp_PlatformKeyCertificate "Platform Key Certificate" +#define NID_tcg_kp_PlatformKeyCertificate 1371 +#define OBJ_tcg_kp_PlatformKeyCertificate OBJ_tcg_kp,4L + +#define SN_tcg_kp_DeltaPlatformAttributeCertificate "tcg-kp-DeltaPlatformAttributeCertificate" +#define LN_tcg_kp_DeltaPlatformAttributeCertificate "Delta Platform Attribute Certificate" +#define NID_tcg_kp_DeltaPlatformAttributeCertificate 1372 +#define OBJ_tcg_kp_DeltaPlatformAttributeCertificate OBJ_tcg_kp,5L + +#define SN_tcg_kp_DeltaPlatformKeyCertificate "tcg-kp-DeltaPlatformKeyCertificate" +#define LN_tcg_kp_DeltaPlatformKeyCertificate "Delta Platform Key Certificate" +#define NID_tcg_kp_DeltaPlatformKeyCertificate 1373 +#define OBJ_tcg_kp_DeltaPlatformKeyCertificate OBJ_tcg_kp,6L + +#define SN_tcg_kp_AdditionalPlatformAttributeCertificate "tcg-kp-AdditionalPlatformAttributeCertificate" +#define LN_tcg_kp_AdditionalPlatformAttributeCertificate "Additional Platform Attribute Certificate" +#define NID_tcg_kp_AdditionalPlatformAttributeCertificate 1374 +#define OBJ_tcg_kp_AdditionalPlatformAttributeCertificate OBJ_tcg_kp,7L + +#define SN_tcg_kp_AdditionalPlatformKeyCertificate "tcg-kp-AdditionalPlatformKeyCertificate" +#define LN_tcg_kp_AdditionalPlatformKeyCertificate "Additional Platform Key Certificate" +#define NID_tcg_kp_AdditionalPlatformKeyCertificate 1375 +#define OBJ_tcg_kp_AdditionalPlatformKeyCertificate OBJ_tcg_kp,8L + +#define SN_tcg_ce_relevantCredentials "tcg-ce-relevantCredentials" +#define LN_tcg_ce_relevantCredentials "Relevant Credentials" +#define NID_tcg_ce_relevantCredentials 1376 +#define OBJ_tcg_ce_relevantCredentials OBJ_tcg_ce,2L + +#define SN_tcg_ce_relevantManifests "tcg-ce-relevantManifests" +#define LN_tcg_ce_relevantManifests "Relevant Manifests" +#define NID_tcg_ce_relevantManifests 1377 +#define OBJ_tcg_ce_relevantManifests OBJ_tcg_ce,3L + +#define SN_tcg_ce_virtualPlatformAttestationService "tcg-ce-virtualPlatformAttestationService" +#define LN_tcg_ce_virtualPlatformAttestationService "Virtual Platform Attestation Service" +#define NID_tcg_ce_virtualPlatformAttestationService 1378 +#define OBJ_tcg_ce_virtualPlatformAttestationService OBJ_tcg_ce,4L + +#define SN_tcg_ce_migrationControllerAttestationService "tcg-ce-migrationControllerAttestationService" +#define LN_tcg_ce_migrationControllerAttestationService "Migration Controller Attestation Service" +#define NID_tcg_ce_migrationControllerAttestationService 1379 +#define OBJ_tcg_ce_migrationControllerAttestationService OBJ_tcg_ce,5L + +#define SN_tcg_ce_migrationControllerRegistrationService "tcg-ce-migrationControllerRegistrationService" +#define LN_tcg_ce_migrationControllerRegistrationService "Migration Controller Registration Service" +#define NID_tcg_ce_migrationControllerRegistrationService 1380 +#define OBJ_tcg_ce_migrationControllerRegistrationService OBJ_tcg_ce,6L + +#define SN_tcg_ce_virtualPlatformBackupService "tcg-ce-virtualPlatformBackupService" +#define LN_tcg_ce_virtualPlatformBackupService "Virtual Platform Backup Service" +#define NID_tcg_ce_virtualPlatformBackupService 1381 +#define OBJ_tcg_ce_virtualPlatformBackupService OBJ_tcg_ce,7L + +#define SN_tcg_prt_tpmIdProtocol "tcg-prt-tpmIdProtocol" +#define LN_tcg_prt_tpmIdProtocol "TCG TPM Protocol" +#define NID_tcg_prt_tpmIdProtocol 1382 +#define OBJ_tcg_prt_tpmIdProtocol OBJ_tcg_protocol,1L + +#define SN_tcg_address_ethernetmac "tcg-address-ethernetmac" +#define LN_tcg_address_ethernetmac "Ethernet MAC Address" +#define NID_tcg_address_ethernetmac 1383 +#define OBJ_tcg_address_ethernetmac OBJ_tcg_address,1L + +#define SN_tcg_address_wlanmac "tcg-address-wlanmac" +#define LN_tcg_address_wlanmac "WLAN MAC Address" +#define NID_tcg_address_wlanmac 1384 +#define OBJ_tcg_address_wlanmac OBJ_tcg_address,2L + +#define SN_tcg_address_bluetoothmac "tcg-address-bluetoothmac" +#define LN_tcg_address_bluetoothmac "Bluetooth MAC Address" +#define NID_tcg_address_bluetoothmac 1385 +#define OBJ_tcg_address_bluetoothmac OBJ_tcg_address,3L + +#define SN_tcg_registry_componentClass "tcg-registry-componentClass" +#define LN_tcg_registry_componentClass "TCG Component Class" +#define NID_tcg_registry_componentClass 1386 +#define OBJ_tcg_registry_componentClass OBJ_tcg_registry,3L + +#define SN_tcg_registry_componentClass_tcg "tcg-registry-componentClass-tcg" +#define LN_tcg_registry_componentClass_tcg "Trusted Computed Group Registry" +#define NID_tcg_registry_componentClass_tcg 1387 +#define OBJ_tcg_registry_componentClass_tcg OBJ_tcg_registry_componentClass,1L + +#define SN_tcg_registry_componentClass_ietf "tcg-registry-componentClass-ietf" +#define LN_tcg_registry_componentClass_ietf "Internet Engineering Task Force Registry" +#define NID_tcg_registry_componentClass_ietf 1388 +#define OBJ_tcg_registry_componentClass_ietf OBJ_tcg_registry_componentClass,2L + +#define SN_tcg_registry_componentClass_dmtf "tcg-registry-componentClass-dmtf" +#define LN_tcg_registry_componentClass_dmtf "Distributed Management Task Force Registry" +#define NID_tcg_registry_componentClass_dmtf 1389 +#define OBJ_tcg_registry_componentClass_dmtf OBJ_tcg_registry_componentClass,3L + +#define SN_tcg_registry_componentClass_pcie "tcg-registry-componentClass-pcie" +#define LN_tcg_registry_componentClass_pcie "PCIE Component Class" +#define NID_tcg_registry_componentClass_pcie 1390 +#define OBJ_tcg_registry_componentClass_pcie OBJ_tcg_registry_componentClass,4L + +#define SN_tcg_registry_componentClass_disk "tcg-registry-componentClass-disk" +#define LN_tcg_registry_componentClass_disk "Disk Component Class" +#define NID_tcg_registry_componentClass_disk 1391 +#define OBJ_tcg_registry_componentClass_disk OBJ_tcg_registry_componentClass,5L + +#define SN_tcg_cap_verifiedPlatformCertificate "tcg-cap-verifiedPlatformCertificate" +#define LN_tcg_cap_verifiedPlatformCertificate "TCG Verified Platform Certificate CA Policy" +#define NID_tcg_cap_verifiedPlatformCertificate 1392 +#define OBJ_tcg_cap_verifiedPlatformCertificate OBJ_tcg_ca,4L + +#define SN_tcg_tr_ID "tcg-tr-ID" +#define LN_tcg_tr_ID "TCG Trait Identifiers" +#define NID_tcg_tr_ID 1393 +#define OBJ_tcg_tr_ID OBJ_tcg_traits,1L + +#define SN_tcg_tr_category "tcg-tr-category" +#define LN_tcg_tr_category "TCG Trait Categories" +#define NID_tcg_tr_category 1394 +#define OBJ_tcg_tr_category OBJ_tcg_traits,2L + +#define SN_tcg_tr_registry "tcg-tr-registry" +#define LN_tcg_tr_registry "TCG Trait Registries" +#define NID_tcg_tr_registry 1395 +#define OBJ_tcg_tr_registry OBJ_tcg_traits,3L + +#define SN_tcg_tr_ID_Boolean "tcg-tr-ID-Boolean" +#define LN_tcg_tr_ID_Boolean "Boolean Trait" +#define NID_tcg_tr_ID_Boolean 1396 +#define OBJ_tcg_tr_ID_Boolean OBJ_tcg_tr_ID,1L + +#define SN_tcg_tr_ID_CertificateIdentifier "tcg-tr-ID-CertificateIdentifier" +#define LN_tcg_tr_ID_CertificateIdentifier "Certificate Identifier Trait" +#define NID_tcg_tr_ID_CertificateIdentifier 1397 +#define OBJ_tcg_tr_ID_CertificateIdentifier OBJ_tcg_tr_ID,2L + +#define SN_tcg_tr_ID_CommonCriteria "tcg-tr-ID-CommonCriteria" +#define LN_tcg_tr_ID_CommonCriteria "Common Criteria Trait" +#define NID_tcg_tr_ID_CommonCriteria 1398 +#define OBJ_tcg_tr_ID_CommonCriteria OBJ_tcg_tr_ID,3L + +#define SN_tcg_tr_ID_componentClass "tcg-tr-ID-componentClass" +#define LN_tcg_tr_ID_componentClass "Component Class Trait" +#define NID_tcg_tr_ID_componentClass 1399 +#define OBJ_tcg_tr_ID_componentClass OBJ_tcg_tr_ID,4L + +#define SN_tcg_tr_ID_componentIdentifierV11 "tcg-tr-ID-componentIdentifierV11" +#define LN_tcg_tr_ID_componentIdentifierV11 "Component Identifier V1.1 Trait" +#define NID_tcg_tr_ID_componentIdentifierV11 1400 +#define OBJ_tcg_tr_ID_componentIdentifierV11 OBJ_tcg_tr_ID,5L + +#define SN_tcg_tr_ID_FIPSLevel "tcg-tr-ID-FIPSLevel" +#define LN_tcg_tr_ID_FIPSLevel "FIPS Level Trait" +#define NID_tcg_tr_ID_FIPSLevel 1401 +#define OBJ_tcg_tr_ID_FIPSLevel OBJ_tcg_tr_ID,6L + +#define SN_tcg_tr_ID_ISO9000Level "tcg-tr-ID-ISO9000Level" +#define LN_tcg_tr_ID_ISO9000Level "ISO 9000 Level Trait" +#define NID_tcg_tr_ID_ISO9000Level 1402 +#define OBJ_tcg_tr_ID_ISO9000Level OBJ_tcg_tr_ID,7L + +#define SN_tcg_tr_ID_networkMAC "tcg-tr-ID-networkMAC" +#define LN_tcg_tr_ID_networkMAC "Network MAC Trait" +#define NID_tcg_tr_ID_networkMAC 1403 +#define OBJ_tcg_tr_ID_networkMAC OBJ_tcg_tr_ID,8L + +#define SN_tcg_tr_ID_OID "tcg-tr-ID-OID" +#define LN_tcg_tr_ID_OID "Object Identifier Trait" +#define NID_tcg_tr_ID_OID 1404 +#define OBJ_tcg_tr_ID_OID OBJ_tcg_tr_ID,9L + +#define SN_tcg_tr_ID_PEN "tcg-tr-ID-PEN" +#define LN_tcg_tr_ID_PEN "Private Enterprise Number Trait" +#define NID_tcg_tr_ID_PEN 1405 +#define OBJ_tcg_tr_ID_PEN OBJ_tcg_tr_ID,10L + +#define SN_tcg_tr_ID_platformFirmwareCapabilities "tcg-tr-ID-platformFirmwareCapabilities" +#define LN_tcg_tr_ID_platformFirmwareCapabilities "Platform Firmware Capabilities Trait" +#define NID_tcg_tr_ID_platformFirmwareCapabilities 1406 +#define OBJ_tcg_tr_ID_platformFirmwareCapabilities OBJ_tcg_tr_ID,11L + +#define SN_tcg_tr_ID_platformFirmwareSignatureVerification "tcg-tr-ID-platformFirmwareSignatureVerification" +#define LN_tcg_tr_ID_platformFirmwareSignatureVerification "Platform Firmware Signature Verification Trait" +#define NID_tcg_tr_ID_platformFirmwareSignatureVerification 1407 +#define OBJ_tcg_tr_ID_platformFirmwareSignatureVerification OBJ_tcg_tr_ID,12L + +#define SN_tcg_tr_ID_platformFirmwareUpdateCompliance "tcg-tr-ID-platformFirmwareUpdateCompliance" +#define LN_tcg_tr_ID_platformFirmwareUpdateCompliance "Platform Firmware Update Compliance Trait" +#define NID_tcg_tr_ID_platformFirmwareUpdateCompliance 1408 +#define OBJ_tcg_tr_ID_platformFirmwareUpdateCompliance OBJ_tcg_tr_ID,13L + +#define SN_tcg_tr_ID_platformHardwareCapabilities "tcg-tr-ID-platformHardwareCapabilities" +#define LN_tcg_tr_ID_platformHardwareCapabilities "Platform Hardware Capabilities Trait" +#define NID_tcg_tr_ID_platformHardwareCapabilities 1409 +#define OBJ_tcg_tr_ID_platformHardwareCapabilities OBJ_tcg_tr_ID,14L + +#define SN_tcg_tr_ID_RTM "tcg-tr-ID-RTM" +#define LN_tcg_tr_ID_RTM "Root of Trust for Measurement Trait" +#define NID_tcg_tr_ID_RTM 1410 +#define OBJ_tcg_tr_ID_RTM OBJ_tcg_tr_ID,15L + +#define SN_tcg_tr_ID_status "tcg-tr-ID-status" +#define LN_tcg_tr_ID_status "Attribute Status Trait" +#define NID_tcg_tr_ID_status 1411 +#define OBJ_tcg_tr_ID_status OBJ_tcg_tr_ID,16L + +#define SN_tcg_tr_ID_URI "tcg-tr-ID-URI" +#define LN_tcg_tr_ID_URI "Uniform Resource Identifier Trait" +#define NID_tcg_tr_ID_URI 1412 +#define OBJ_tcg_tr_ID_URI OBJ_tcg_tr_ID,17L + +#define SN_tcg_tr_ID_UTF8String "tcg-tr-ID-UTF8String" +#define LN_tcg_tr_ID_UTF8String "UTF8String Trait" +#define NID_tcg_tr_ID_UTF8String 1413 +#define OBJ_tcg_tr_ID_UTF8String OBJ_tcg_tr_ID,18L + +#define SN_tcg_tr_ID_IA5String "tcg-tr-ID-IA5String" +#define LN_tcg_tr_ID_IA5String "IA5String Trait" +#define NID_tcg_tr_ID_IA5String 1414 +#define OBJ_tcg_tr_ID_IA5String OBJ_tcg_tr_ID,19L + +#define SN_tcg_tr_ID_PEMCertString "tcg-tr-ID-PEMCertString" +#define LN_tcg_tr_ID_PEMCertString "PEM-Encoded Certificate String Trait" +#define NID_tcg_tr_ID_PEMCertString 1415 +#define OBJ_tcg_tr_ID_PEMCertString OBJ_tcg_tr_ID,20L + +#define SN_tcg_tr_ID_PublicKey "tcg-tr-ID-PublicKey" +#define LN_tcg_tr_ID_PublicKey "Public Key Trait" +#define NID_tcg_tr_ID_PublicKey 1416 +#define OBJ_tcg_tr_ID_PublicKey OBJ_tcg_tr_ID,21L + +#define SN_tcg_tr_cat_platformManufacturer "tcg-tr-cat-platformManufacturer" +#define LN_tcg_tr_cat_platformManufacturer "Platform Manufacturer Trait Category" +#define NID_tcg_tr_cat_platformManufacturer 1417 +#define OBJ_tcg_tr_cat_platformManufacturer OBJ_tcg_tr_category,1L + +#define SN_tcg_tr_cat_platformModel "tcg-tr-cat-platformModel" +#define LN_tcg_tr_cat_platformModel "Platform Model Trait Category" +#define NID_tcg_tr_cat_platformModel 1418 +#define OBJ_tcg_tr_cat_platformModel OBJ_tcg_tr_category,2L + +#define SN_tcg_tr_cat_platformVersion "tcg-tr-cat-platformVersion" +#define LN_tcg_tr_cat_platformVersion "Platform Version Trait Category" +#define NID_tcg_tr_cat_platformVersion 1419 +#define OBJ_tcg_tr_cat_platformVersion OBJ_tcg_tr_category,3L + +#define SN_tcg_tr_cat_platformSerial "tcg-tr-cat-platformSerial" +#define LN_tcg_tr_cat_platformSerial "Platform Serial Trait Category" +#define NID_tcg_tr_cat_platformSerial 1420 +#define OBJ_tcg_tr_cat_platformSerial OBJ_tcg_tr_category,4L + +#define SN_tcg_tr_cat_platformManufacturerIdentifier "tcg-tr-cat-platformManufacturerIdentifier" +#define LN_tcg_tr_cat_platformManufacturerIdentifier "Platform Manufacturer Identifier Trait Category" +#define NID_tcg_tr_cat_platformManufacturerIdentifier 1421 +#define OBJ_tcg_tr_cat_platformManufacturerIdentifier OBJ_tcg_tr_category,5L + +#define SN_tcg_tr_cat_platformOwnership "tcg-tr-cat-platformOwnership" +#define LN_tcg_tr_cat_platformOwnership "Platform Ownership Trait Category" +#define NID_tcg_tr_cat_platformOwnership 1422 +#define OBJ_tcg_tr_cat_platformOwnership OBJ_tcg_tr_category,6L + +#define SN_tcg_tr_cat_componentClass "tcg-tr-cat-componentClass" +#define LN_tcg_tr_cat_componentClass "Component Class Trait Category" +#define NID_tcg_tr_cat_componentClass 1423 +#define OBJ_tcg_tr_cat_componentClass OBJ_tcg_tr_category,7L + +#define SN_tcg_tr_cat_componentManufacturer "tcg-tr-cat-componentManufacturer" +#define LN_tcg_tr_cat_componentManufacturer "Component Manufacturer Trait Category" +#define NID_tcg_tr_cat_componentManufacturer 1424 +#define OBJ_tcg_tr_cat_componentManufacturer OBJ_tcg_tr_category,8L + +#define SN_tcg_tr_cat_componentModel "tcg-tr-cat-componentModel" +#define LN_tcg_tr_cat_componentModel "Component Model Trait Category" +#define NID_tcg_tr_cat_componentModel 1425 +#define OBJ_tcg_tr_cat_componentModel OBJ_tcg_tr_category,9L + +#define SN_tcg_tr_cat_componentSerial "tcg-tr-cat-componentSerial" +#define LN_tcg_tr_cat_componentSerial "Component Serial Trait Category" +#define NID_tcg_tr_cat_componentSerial 1426 +#define OBJ_tcg_tr_cat_componentSerial OBJ_tcg_tr_category,10L + +#define SN_tcg_tr_cat_componentStatus "tcg-tr-cat-componentStatus" +#define LN_tcg_tr_cat_componentStatus "Component Status Trait Category" +#define NID_tcg_tr_cat_componentStatus 1427 +#define OBJ_tcg_tr_cat_componentStatus OBJ_tcg_tr_category,11L + +#define SN_tcg_tr_cat_componentLocation "tcg-tr-cat-componentLocation" +#define LN_tcg_tr_cat_componentLocation "Component Location Trait Category" +#define NID_tcg_tr_cat_componentLocation 1428 +#define OBJ_tcg_tr_cat_componentLocation OBJ_tcg_tr_category,12L + +#define SN_tcg_tr_cat_componentRevision "tcg-tr-cat-componentRevision" +#define LN_tcg_tr_cat_componentRevision "Component Revision Trait Category" +#define NID_tcg_tr_cat_componentRevision 1429 +#define OBJ_tcg_tr_cat_componentRevision OBJ_tcg_tr_category,13L + +#define SN_tcg_tr_cat_componentFieldReplaceable "tcg-tr-cat-componentFieldReplaceable" +#define LN_tcg_tr_cat_componentFieldReplaceable "Component Field Replaceable Trait Category" +#define NID_tcg_tr_cat_componentFieldReplaceable 1430 +#define OBJ_tcg_tr_cat_componentFieldReplaceable OBJ_tcg_tr_category,14L + +#define SN_tcg_tr_cat_EKCertificate "tcg-tr-cat-EKCertificate" +#define LN_tcg_tr_cat_EKCertificate "EK Certificate Trait Category" +#define NID_tcg_tr_cat_EKCertificate 1431 +#define OBJ_tcg_tr_cat_EKCertificate OBJ_tcg_tr_category,15L + +#define SN_tcg_tr_cat_IAKCertificate "tcg-tr-cat-IAKCertificate" +#define LN_tcg_tr_cat_IAKCertificate "IAK Certificate Trait Category" +#define NID_tcg_tr_cat_IAKCertificate 1432 +#define OBJ_tcg_tr_cat_IAKCertificate OBJ_tcg_tr_category,16L + +#define SN_tcg_tr_cat_IDevIDCertificate "tcg-tr-cat-IDevIDCertificate" +#define LN_tcg_tr_cat_IDevIDCertificate "IDevID Certificate Trait Category" +#define NID_tcg_tr_cat_IDevIDCertificate 1433 +#define OBJ_tcg_tr_cat_IDevIDCertificate OBJ_tcg_tr_category,17L + +#define SN_tcg_tr_cat_DICECertificate "tcg-tr-cat-DICECertificate" +#define LN_tcg_tr_cat_DICECertificate "DICE Certificate Trait Category" +#define NID_tcg_tr_cat_DICECertificate 1434 +#define OBJ_tcg_tr_cat_DICECertificate OBJ_tcg_tr_category,18L + +#define SN_tcg_tr_cat_SPDMCertificate "tcg-tr-cat-SPDMCertificate" +#define LN_tcg_tr_cat_SPDMCertificate "SPDM Certificate Trait Category" +#define NID_tcg_tr_cat_SPDMCertificate 1435 +#define OBJ_tcg_tr_cat_SPDMCertificate OBJ_tcg_tr_category,19L + +#define SN_tcg_tr_cat_PEMCertificate "tcg-tr-cat-PEMCertificate" +#define LN_tcg_tr_cat_PEMCertificate "PEM Certificate Trait Category" +#define NID_tcg_tr_cat_PEMCertificate 1436 +#define OBJ_tcg_tr_cat_PEMCertificate OBJ_tcg_tr_category,20L + +#define SN_tcg_tr_cat_PlatformCertificate "tcg-tr-cat-PlatformCertificate" +#define LN_tcg_tr_cat_PlatformCertificate "Platform Certificate Trait Category" +#define NID_tcg_tr_cat_PlatformCertificate 1437 +#define OBJ_tcg_tr_cat_PlatformCertificate OBJ_tcg_tr_category,21L + +#define SN_tcg_tr_cat_DeltaPlatformCertificate "tcg-tr-cat-DeltaPlatformCertificate" +#define LN_tcg_tr_cat_DeltaPlatformCertificate "Delta Platform Certificate Trait Category" +#define NID_tcg_tr_cat_DeltaPlatformCertificate 1438 +#define OBJ_tcg_tr_cat_DeltaPlatformCertificate OBJ_tcg_tr_category,22L + +#define SN_tcg_tr_cat_RebasePlatformCertificate "tcg-tr-cat-RebasePlatformCertificate" +#define LN_tcg_tr_cat_RebasePlatformCertificate "Rebase Platform Certificate Trait Category" +#define NID_tcg_tr_cat_RebasePlatformCertificate 1439 +#define OBJ_tcg_tr_cat_RebasePlatformCertificate OBJ_tcg_tr_category,23L + +#define SN_tcg_tr_cat_genericCertificate "tcg-tr-cat-genericCertificate" +#define LN_tcg_tr_cat_genericCertificate "Generic Certificate Trait Category" +#define NID_tcg_tr_cat_genericCertificate 1440 +#define OBJ_tcg_tr_cat_genericCertificate OBJ_tcg_tr_category,24L + +#define SN_tcg_tr_cat_CommonCriteria "tcg-tr-cat-CommonCriteria" +#define LN_tcg_tr_cat_CommonCriteria "Common Criteria Trait Category" +#define NID_tcg_tr_cat_CommonCriteria 1441 +#define OBJ_tcg_tr_cat_CommonCriteria OBJ_tcg_tr_category,25L + +#define SN_tcg_tr_cat_componentIdentifierV11 "tcg-tr-cat-componentIdentifierV11" +#define LN_tcg_tr_cat_componentIdentifierV11 "Component Identifier V1.1 Trait Category" +#define NID_tcg_tr_cat_componentIdentifierV11 1442 +#define OBJ_tcg_tr_cat_componentIdentifierV11 OBJ_tcg_tr_category,26L + +#define SN_tcg_tr_cat_FIPSLevel "tcg-tr-cat-FIPSLevel" +#define LN_tcg_tr_cat_FIPSLevel "FIPS Level Trait Category" +#define NID_tcg_tr_cat_FIPSLevel 1443 +#define OBJ_tcg_tr_cat_FIPSLevel OBJ_tcg_tr_category,27L + +#define SN_tcg_tr_cat_ISO9000 "tcg-tr-cat-ISO9000" +#define LN_tcg_tr_cat_ISO9000 "ISO 9000 Trait Category" +#define NID_tcg_tr_cat_ISO9000 1444 +#define OBJ_tcg_tr_cat_ISO9000 OBJ_tcg_tr_category,28L + +#define SN_tcg_tr_cat_networkMAC "tcg-tr-cat-networkMAC" +#define LN_tcg_tr_cat_networkMAC "Network MAC Trait Category" +#define NID_tcg_tr_cat_networkMAC 1445 +#define OBJ_tcg_tr_cat_networkMAC OBJ_tcg_tr_category,29L + +#define SN_tcg_tr_cat_attestationProtocol "tcg-tr-cat-attestationProtocol" +#define LN_tcg_tr_cat_attestationProtocol "Attestation Protocol Trait Category" +#define NID_tcg_tr_cat_attestationProtocol 1446 +#define OBJ_tcg_tr_cat_attestationProtocol OBJ_tcg_tr_category,30L + +#define SN_tcg_tr_cat_PEN "tcg-tr-cat-PEN" +#define LN_tcg_tr_cat_PEN "Private Enterprise Number Trait Category" +#define NID_tcg_tr_cat_PEN 1447 +#define OBJ_tcg_tr_cat_PEN OBJ_tcg_tr_category,31L + +#define SN_tcg_tr_cat_platformFirmwareCapabilities "tcg-tr-cat-platformFirmwareCapabilities" +#define LN_tcg_tr_cat_platformFirmwareCapabilities "Platform Firmware Capabilities Trait Category" +#define NID_tcg_tr_cat_platformFirmwareCapabilities 1448 +#define OBJ_tcg_tr_cat_platformFirmwareCapabilities OBJ_tcg_tr_category,32L + +#define SN_tcg_tr_cat_platformHardwareCapabilities "tcg-tr-cat-platformHardwareCapabilities" +#define LN_tcg_tr_cat_platformHardwareCapabilities "Platform Hardware Capabilities Trait Category" +#define NID_tcg_tr_cat_platformHardwareCapabilities 1449 +#define OBJ_tcg_tr_cat_platformHardwareCapabilities OBJ_tcg_tr_category,33L + +#define SN_tcg_tr_cat_platformFirmwareSignatureVerification "tcg-tr-cat-platformFirmwareSignatureVerification" +#define LN_tcg_tr_cat_platformFirmwareSignatureVerification "Platform Firmware Signature Verification Trait Category" +#define NID_tcg_tr_cat_platformFirmwareSignatureVerification 1450 +#define OBJ_tcg_tr_cat_platformFirmwareSignatureVerification OBJ_tcg_tr_category,34L + +#define SN_tcg_tr_cat_platformFirmwareUpdateCompliance "tcg-tr-cat-platformFirmwareUpdateCompliance" +#define LN_tcg_tr_cat_platformFirmwareUpdateCompliance "Platform Firmware Update Compliance Trait Category" +#define NID_tcg_tr_cat_platformFirmwareUpdateCompliance 1451 +#define OBJ_tcg_tr_cat_platformFirmwareUpdateCompliance OBJ_tcg_tr_category,35L + +#define SN_tcg_tr_cat_RTM "tcg-tr-cat-RTM" +#define LN_tcg_tr_cat_RTM "Root of Trust of Measurement Trait Category" +#define NID_tcg_tr_cat_RTM 1452 +#define OBJ_tcg_tr_cat_RTM OBJ_tcg_tr_category,36L + +#define SN_tcg_tr_cat_PublicKey "tcg-tr-cat-PublicKey" +#define LN_tcg_tr_cat_PublicKey "Public Key Trait Category" +#define NID_tcg_tr_cat_PublicKey 1453 +#define OBJ_tcg_tr_cat_PublicKey OBJ_tcg_tr_category,37L + +#define OBJ_nistKems OBJ_nistAlgorithms,4L + +#define SN_ML_KEM_512 "id-alg-ml-kem-512" +#define LN_ML_KEM_512 "ML-KEM-512" +#define NID_ML_KEM_512 1454 +#define OBJ_ML_KEM_512 OBJ_nistKems,1L + +#define SN_ML_KEM_768 "id-alg-ml-kem-768" +#define LN_ML_KEM_768 "ML-KEM-768" +#define NID_ML_KEM_768 1455 +#define OBJ_ML_KEM_768 OBJ_nistKems,2L + +#define SN_ML_KEM_1024 "id-alg-ml-kem-1024" +#define LN_ML_KEM_1024 "ML-KEM-1024" +#define NID_ML_KEM_1024 1456 +#define OBJ_ML_KEM_1024 OBJ_nistKems,3L + +#endif /* OPENSSL_OBJ_MAC_H */ + +#ifndef OPENSSL_NO_DEPRECATED_3_0 + +#define SN_id_tc26_cipher_gostr3412_2015_magma_ctracpkm SN_magma_ctr_acpkm +#define NID_id_tc26_cipher_gostr3412_2015_magma_ctracpkm NID_magma_ctr_acpkm +#define OBJ_id_tc26_cipher_gostr3412_2015_magma_ctracpkm OBJ_magma_ctr_acpkm + +#define SN_id_tc26_cipher_gostr3412_2015_magma_ctracpkm_omac SN_magma_ctr_acpkm_omac +#define NID_id_tc26_cipher_gostr3412_2015_magma_ctracpkm_omac NID_magma_ctr_acpkm_omac +#define OBJ_id_tc26_cipher_gostr3412_2015_magma_ctracpkm_omac OBJ_magma_ctr_acpkm_omac + +#define SN_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm SN_kuznyechik_ctr_acpkm +#define NID_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm NID_kuznyechik_ctr_acpkm +#define OBJ_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm OBJ_kuznyechik_ctr_acpkm + +#define SN_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm_omac SN_kuznyechik_ctr_acpkm_omac +#define NID_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm_omac NID_kuznyechik_ctr_acpkm_omac +#define OBJ_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm_omac OBJ_kuznyechik_ctr_acpkm_omac + +#define SN_id_tc26_wrap_gostr3412_2015_magma_kexp15 SN_magma_kexp15 +#define NID_id_tc26_wrap_gostr3412_2015_magma_kexp15 NID_magma_kexp15 +#define OBJ_id_tc26_wrap_gostr3412_2015_magma_kexp15 OBJ_magma_kexp15 + +#define SN_id_tc26_wrap_gostr3412_2015_kuznyechik_kexp15 SN_kuznyechik_kexp15 +#define NID_id_tc26_wrap_gostr3412_2015_kuznyechik_kexp15 NID_kuznyechik_kexp15 +#define OBJ_id_tc26_wrap_gostr3412_2015_kuznyechik_kexp15 OBJ_kuznyechik_kexp15 + +#define SN_grasshopper_ecb SN_kuznyechik_ecb +#define NID_grasshopper_ecb NID_kuznyechik_ecb + +#define SN_grasshopper_ctr SN_kuznyechik_ctr +#define NID_grasshopper_ctr NID_kuznyechik_ctr + +#define SN_grasshopper_ofb SN_kuznyechik_ofb +#define NID_grasshopper_ofb NID_kuznyechik_ofb + +#define SN_grasshopper_cbc SN_kuznyechik_cbc +#define NID_grasshopper_cbc NID_kuznyechik_cbc + +#define SN_grasshopper_cfb SN_kuznyechik_cfb +#define NID_grasshopper_cfb NID_kuznyechik_cfb + +#define SN_grasshopper_mac SN_kuznyechik_mac +#define NID_grasshopper_mac NID_kuznyechik_mac + +#endif /* OPENSSL_NO_DEPRECATED_3_0 */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/objects.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/objects.h new file mode 100644 index 0000000000000000000000000000000000000000..de1f1db97d6d511625ecde69807a02823ed4edfd --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/objects.h @@ -0,0 +1,186 @@ +/* + * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_OBJECTS_H +#define OPENSSL_OBJECTS_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_OBJECTS_H +#endif + +#include +#include +#include +#include + +#define OBJ_NAME_TYPE_UNDEF 0x00 +#define OBJ_NAME_TYPE_MD_METH 0x01 +#define OBJ_NAME_TYPE_CIPHER_METH 0x02 +#define OBJ_NAME_TYPE_PKEY_METH 0x03 +#define OBJ_NAME_TYPE_COMP_METH 0x04 +#define OBJ_NAME_TYPE_MAC_METH 0x05 +#define OBJ_NAME_TYPE_KDF_METH 0x06 +#define OBJ_NAME_TYPE_NUM 0x07 + +#define OBJ_NAME_ALIAS 0x8000 + +#define OBJ_BSEARCH_VALUE_ON_NOMATCH 0x01 +#define OBJ_BSEARCH_FIRST_VALUE_ON_MATCH 0x02 + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct obj_name_st { + int type; + int alias; + const char *name; + const char *data; +} OBJ_NAME; + +#define OBJ_create_and_add_object(a, b, c) OBJ_create(a, b, c) + +int OBJ_NAME_init(void); +int OBJ_NAME_new_index(unsigned long (*hash_func)(const char *), + int (*cmp_func)(const char *, const char *), + void (*free_func)(const char *, int, const char *)); +const char *OBJ_NAME_get(const char *name, int type); +int OBJ_NAME_add(const char *name, int type, const char *data); +int OBJ_NAME_remove(const char *name, int type); +void OBJ_NAME_cleanup(int type); /* -1 for everything */ +void OBJ_NAME_do_all(int type, void (*fn)(const OBJ_NAME *, void *arg), + void *arg); +void OBJ_NAME_do_all_sorted(int type, + void (*fn)(const OBJ_NAME *, void *arg), + void *arg); + +DECLARE_ASN1_DUP_FUNCTION_name(ASN1_OBJECT, OBJ) +ASN1_OBJECT *OBJ_nid2obj(int n); +const char *OBJ_nid2ln(int n); +const char *OBJ_nid2sn(int n); +int OBJ_obj2nid(const ASN1_OBJECT *o); +ASN1_OBJECT *OBJ_txt2obj(const char *s, int no_name); +int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name); +int OBJ_txt2nid(const char *s); +int OBJ_ln2nid(const char *s); +int OBJ_sn2nid(const char *s); +int OBJ_cmp(const ASN1_OBJECT *a, const ASN1_OBJECT *b); +const void *OBJ_bsearch_(const void *key, const void *base, int num, int size, + int (*cmp)(const void *, const void *)); +const void *OBJ_bsearch_ex_(const void *key, const void *base, int num, + int size, + int (*cmp)(const void *, const void *), + int flags); + +#define _DECLARE_OBJ_BSEARCH_CMP_FN(scope, type1, type2, nm) \ + static int nm##_cmp_BSEARCH_CMP_FN(const void *, const void *); \ + static int nm##_cmp(type1 const *, type2 const *); \ + scope type2 *OBJ_bsearch_##nm(type1 *key, type2 const *base, int num) + +#define DECLARE_OBJ_BSEARCH_CMP_FN(type1, type2, cmp) \ + _DECLARE_OBJ_BSEARCH_CMP_FN(static, type1, type2, cmp) +#define DECLARE_OBJ_BSEARCH_GLOBAL_CMP_FN(type1, type2, nm) \ + type2 *OBJ_bsearch_##nm(type1 *key, type2 const *base, int num) + +/*- + * Unsolved problem: if a type is actually a pointer type, like + * nid_triple is, then its impossible to get a const where you need + * it. Consider: + * + * typedef int nid_triple[3]; + * const void *a_; + * const nid_triple const *a = a_; + * + * The assignment discards a const because what you really want is: + * + * const int const * const *a = a_; + * + * But if you do that, you lose the fact that a is an array of 3 ints, + * which breaks comparison functions. + * + * Thus we end up having to cast, sadly, or unpack the + * declarations. Or, as I finally did in this case, declare nid_triple + * to be a struct, which it should have been in the first place. + * + * Ben, August 2008. + * + * Also, strictly speaking not all types need be const, but handling + * the non-constness means a lot of complication, and in practice + * comparison routines do always not touch their arguments. + */ + +#define IMPLEMENT_OBJ_BSEARCH_CMP_FN(type1, type2, nm) \ + static int nm##_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_) \ + { \ + type1 const *a = a_; \ + type2 const *b = b_; \ + return nm##_cmp(a, b); \ + } \ + static type2 *OBJ_bsearch_##nm(type1 *key, type2 const *base, int num) \ + { \ + return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \ + nm##_cmp_BSEARCH_CMP_FN); \ + } \ + extern void dummy_prototype(void) + +#define IMPLEMENT_OBJ_BSEARCH_GLOBAL_CMP_FN(type1, type2, nm) \ + static int nm##_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_) \ + { \ + type1 const *a = a_; \ + type2 const *b = b_; \ + return nm##_cmp(a, b); \ + } \ + type2 *OBJ_bsearch_##nm(type1 *key, type2 const *base, int num) \ + { \ + return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \ + nm##_cmp_BSEARCH_CMP_FN); \ + } \ + extern void dummy_prototype(void) + +#define OBJ_bsearch(type1, key, type2, base, num, cmp) \ + ((type2 *)OBJ_bsearch_(CHECKED_PTR_OF(type1, key), CHECKED_PTR_OF(type2, base), \ + num, sizeof(type2), \ + ((void)CHECKED_PTR_OF(type1, cmp##_type_1), \ + (void)CHECKED_PTR_OF(type2, cmp##_type_2), \ + cmp##_BSEARCH_CMP_FN))) + +#define OBJ_bsearch_ex(type1, key, type2, base, num, cmp, flags) \ + ((type2 *)OBJ_bsearch_ex_(CHECKED_PTR_OF(type1, key), CHECKED_PTR_OF(type2, base), \ + num, sizeof(type2), \ + ((void)CHECKED_PTR_OF(type1, cmp##_type_1), \ + (void)type_2 = CHECKED_PTR_OF(type2, cmp##_type_2), \ + cmp##_BSEARCH_CMP_FN)), \ + flags) + +int OBJ_new_nid(int num); +int OBJ_add_object(const ASN1_OBJECT *obj); +int OBJ_create(const char *oid, const char *sn, const char *ln); +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define OBJ_cleanup() \ + while (0) \ + continue +#endif +int OBJ_create_objects(BIO *in); + +size_t OBJ_length(const ASN1_OBJECT *obj); +const unsigned char *OBJ_get0_data(const ASN1_OBJECT *obj); + +int OBJ_find_sigid_algs(int signid, int *pdig_nid, int *ppkey_nid); +int OBJ_find_sigid_by_algs(int *psignid, int dig_nid, int pkey_nid); +int OBJ_add_sigid(int signid, int dig_id, int pkey_id); +void OBJ_sigid_free(void); + +#define SN_ac_auditEntity SN_ac_auditIdentity + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/objectserr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/objectserr.h new file mode 100644 index 0000000000000000000000000000000000000000..2927561135f20a7067f2ae2df03047c255fa56f2 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/objectserr.h @@ -0,0 +1,26 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_OBJECTSERR_H +#define OPENSSL_OBJECTSERR_H +#pragma once + +#include +#include +#include + +/* + * OBJ reason codes. + */ +#define OBJ_R_OID_EXISTS 102 +#define OBJ_R_UNKNOWN_NID 101 +#define OBJ_R_UNKNOWN_OBJECT_NAME 103 + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ocsp.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ocsp.h new file mode 100644 index 0000000000000000000000000000000000000000..a868ede9d8e0c74de13f66d1cf99efce093f13ad --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ocsp.h @@ -0,0 +1,487 @@ +/* + * WARNING: do not edit! + * Generated by makefile from include\openssl\ocsp.h.in + * + * Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* clang-format off */ + +/* clang-format on */ + +#ifndef OPENSSL_OCSP_H +#define OPENSSL_OCSP_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_OCSP_H +#endif + +#include +#include +#include + +/* + * These definitions are outside the OPENSSL_NO_OCSP guard because although for + * historical reasons they have OCSP_* names, they can actually be used + * independently of OCSP. E.g. see RFC5280 + */ +/*- + * CRLReason ::= ENUMERATED { + * unspecified (0), + * keyCompromise (1), + * cACompromise (2), + * affiliationChanged (3), + * superseded (4), + * cessationOfOperation (5), + * certificateHold (6), + * -- value 7 is not used + * removeFromCRL (8), + * privilegeWithdrawn (9), + * aACompromise (10) } + */ +#define OCSP_REVOKED_STATUS_NOSTATUS -1 +#define OCSP_REVOKED_STATUS_UNSPECIFIED 0 +#define OCSP_REVOKED_STATUS_KEYCOMPROMISE 1 +#define OCSP_REVOKED_STATUS_CACOMPROMISE 2 +#define OCSP_REVOKED_STATUS_AFFILIATIONCHANGED 3 +#define OCSP_REVOKED_STATUS_SUPERSEDED 4 +#define OCSP_REVOKED_STATUS_CESSATIONOFOPERATION 5 +#define OCSP_REVOKED_STATUS_CERTIFICATEHOLD 6 +#define OCSP_REVOKED_STATUS_REMOVEFROMCRL 8 +#define OCSP_REVOKED_STATUS_PRIVILEGEWITHDRAWN 9 +#define OCSP_REVOKED_STATUS_AACOMPROMISE 10 + +#ifndef OPENSSL_NO_OCSP + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Various flags and values */ + +#define OCSP_DEFAULT_NONCE_LENGTH 16 + +#define OCSP_NOCERTS 0x1 +#define OCSP_NOINTERN 0x2 +#define OCSP_NOSIGS 0x4 +#define OCSP_NOCHAIN 0x8 +#define OCSP_NOVERIFY 0x10 +#define OCSP_NOEXPLICIT 0x20 +#define OCSP_NOCASIGN 0x40 +#define OCSP_NODELEGATED 0x80 +#define OCSP_NOCHECKS 0x100 +#define OCSP_TRUSTOTHER 0x200 +#define OCSP_RESPID_KEY 0x400 +#define OCSP_NOTIME 0x800 +#define OCSP_PARTIAL_CHAIN 0x1000 + +typedef struct ocsp_cert_id_st OCSP_CERTID; +typedef struct ocsp_one_request_st OCSP_ONEREQ; +typedef struct ocsp_req_info_st OCSP_REQINFO; +typedef struct ocsp_signature_st OCSP_SIGNATURE; +typedef struct ocsp_request_st OCSP_REQUEST; + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(OCSP_CERTID, OCSP_CERTID, OCSP_CERTID) +#define sk_OCSP_CERTID_num(sk) OPENSSL_sk_num(ossl_check_const_OCSP_CERTID_sk_type(sk)) +#define sk_OCSP_CERTID_value(sk, idx) ((OCSP_CERTID *)OPENSSL_sk_value(ossl_check_const_OCSP_CERTID_sk_type(sk), (idx))) +#define sk_OCSP_CERTID_new(cmp) ((STACK_OF(OCSP_CERTID) *)OPENSSL_sk_new(ossl_check_OCSP_CERTID_compfunc_type(cmp))) +#define sk_OCSP_CERTID_new_null() ((STACK_OF(OCSP_CERTID) *)OPENSSL_sk_new_null()) +#define sk_OCSP_CERTID_new_reserve(cmp, n) ((STACK_OF(OCSP_CERTID) *)OPENSSL_sk_new_reserve(ossl_check_OCSP_CERTID_compfunc_type(cmp), (n))) +#define sk_OCSP_CERTID_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OCSP_CERTID_sk_type(sk), (n)) +#define sk_OCSP_CERTID_free(sk) OPENSSL_sk_free(ossl_check_OCSP_CERTID_sk_type(sk)) +#define sk_OCSP_CERTID_zero(sk) OPENSSL_sk_zero(ossl_check_OCSP_CERTID_sk_type(sk)) +#define sk_OCSP_CERTID_delete(sk, i) ((OCSP_CERTID *)OPENSSL_sk_delete(ossl_check_OCSP_CERTID_sk_type(sk), (i))) +#define sk_OCSP_CERTID_delete_ptr(sk, ptr) ((OCSP_CERTID *)OPENSSL_sk_delete_ptr(ossl_check_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_type(ptr))) +#define sk_OCSP_CERTID_push(sk, ptr) OPENSSL_sk_push(ossl_check_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_type(ptr)) +#define sk_OCSP_CERTID_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_type(ptr)) +#define sk_OCSP_CERTID_pop(sk) ((OCSP_CERTID *)OPENSSL_sk_pop(ossl_check_OCSP_CERTID_sk_type(sk))) +#define sk_OCSP_CERTID_shift(sk) ((OCSP_CERTID *)OPENSSL_sk_shift(ossl_check_OCSP_CERTID_sk_type(sk))) +#define sk_OCSP_CERTID_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_freefunc_type(freefunc)) +#define sk_OCSP_CERTID_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_type(ptr), (idx)) +#define sk_OCSP_CERTID_set(sk, idx, ptr) ((OCSP_CERTID *)OPENSSL_sk_set(ossl_check_OCSP_CERTID_sk_type(sk), (idx), ossl_check_OCSP_CERTID_type(ptr))) +#define sk_OCSP_CERTID_find(sk, ptr) OPENSSL_sk_find(ossl_check_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_type(ptr)) +#define sk_OCSP_CERTID_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_type(ptr)) +#define sk_OCSP_CERTID_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_type(ptr), pnum) +#define sk_OCSP_CERTID_sort(sk) OPENSSL_sk_sort(ossl_check_OCSP_CERTID_sk_type(sk)) +#define sk_OCSP_CERTID_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OCSP_CERTID_sk_type(sk)) +#define sk_OCSP_CERTID_dup(sk) ((STACK_OF(OCSP_CERTID) *)OPENSSL_sk_dup(ossl_check_const_OCSP_CERTID_sk_type(sk))) +#define sk_OCSP_CERTID_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OCSP_CERTID) *)OPENSSL_sk_deep_copy(ossl_check_const_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_copyfunc_type(copyfunc), ossl_check_OCSP_CERTID_freefunc_type(freefunc))) +#define sk_OCSP_CERTID_set_cmp_func(sk, cmp) ((sk_OCSP_CERTID_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OCSP_CERTID_sk_type(sk), ossl_check_OCSP_CERTID_compfunc_type(cmp))) +SKM_DEFINE_STACK_OF_INTERNAL(OCSP_ONEREQ, OCSP_ONEREQ, OCSP_ONEREQ) +#define sk_OCSP_ONEREQ_num(sk) OPENSSL_sk_num(ossl_check_const_OCSP_ONEREQ_sk_type(sk)) +#define sk_OCSP_ONEREQ_value(sk, idx) ((OCSP_ONEREQ *)OPENSSL_sk_value(ossl_check_const_OCSP_ONEREQ_sk_type(sk), (idx))) +#define sk_OCSP_ONEREQ_new(cmp) ((STACK_OF(OCSP_ONEREQ) *)OPENSSL_sk_new(ossl_check_OCSP_ONEREQ_compfunc_type(cmp))) +#define sk_OCSP_ONEREQ_new_null() ((STACK_OF(OCSP_ONEREQ) *)OPENSSL_sk_new_null()) +#define sk_OCSP_ONEREQ_new_reserve(cmp, n) ((STACK_OF(OCSP_ONEREQ) *)OPENSSL_sk_new_reserve(ossl_check_OCSP_ONEREQ_compfunc_type(cmp), (n))) +#define sk_OCSP_ONEREQ_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OCSP_ONEREQ_sk_type(sk), (n)) +#define sk_OCSP_ONEREQ_free(sk) OPENSSL_sk_free(ossl_check_OCSP_ONEREQ_sk_type(sk)) +#define sk_OCSP_ONEREQ_zero(sk) OPENSSL_sk_zero(ossl_check_OCSP_ONEREQ_sk_type(sk)) +#define sk_OCSP_ONEREQ_delete(sk, i) ((OCSP_ONEREQ *)OPENSSL_sk_delete(ossl_check_OCSP_ONEREQ_sk_type(sk), (i))) +#define sk_OCSP_ONEREQ_delete_ptr(sk, ptr) ((OCSP_ONEREQ *)OPENSSL_sk_delete_ptr(ossl_check_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_type(ptr))) +#define sk_OCSP_ONEREQ_push(sk, ptr) OPENSSL_sk_push(ossl_check_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_type(ptr)) +#define sk_OCSP_ONEREQ_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_type(ptr)) +#define sk_OCSP_ONEREQ_pop(sk) ((OCSP_ONEREQ *)OPENSSL_sk_pop(ossl_check_OCSP_ONEREQ_sk_type(sk))) +#define sk_OCSP_ONEREQ_shift(sk) ((OCSP_ONEREQ *)OPENSSL_sk_shift(ossl_check_OCSP_ONEREQ_sk_type(sk))) +#define sk_OCSP_ONEREQ_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_freefunc_type(freefunc)) +#define sk_OCSP_ONEREQ_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_type(ptr), (idx)) +#define sk_OCSP_ONEREQ_set(sk, idx, ptr) ((OCSP_ONEREQ *)OPENSSL_sk_set(ossl_check_OCSP_ONEREQ_sk_type(sk), (idx), ossl_check_OCSP_ONEREQ_type(ptr))) +#define sk_OCSP_ONEREQ_find(sk, ptr) OPENSSL_sk_find(ossl_check_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_type(ptr)) +#define sk_OCSP_ONEREQ_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_type(ptr)) +#define sk_OCSP_ONEREQ_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_type(ptr), pnum) +#define sk_OCSP_ONEREQ_sort(sk) OPENSSL_sk_sort(ossl_check_OCSP_ONEREQ_sk_type(sk)) +#define sk_OCSP_ONEREQ_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OCSP_ONEREQ_sk_type(sk)) +#define sk_OCSP_ONEREQ_dup(sk) ((STACK_OF(OCSP_ONEREQ) *)OPENSSL_sk_dup(ossl_check_const_OCSP_ONEREQ_sk_type(sk))) +#define sk_OCSP_ONEREQ_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OCSP_ONEREQ) *)OPENSSL_sk_deep_copy(ossl_check_const_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_copyfunc_type(copyfunc), ossl_check_OCSP_ONEREQ_freefunc_type(freefunc))) +#define sk_OCSP_ONEREQ_set_cmp_func(sk, cmp) ((sk_OCSP_ONEREQ_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OCSP_ONEREQ_sk_type(sk), ossl_check_OCSP_ONEREQ_compfunc_type(cmp))) + +/* clang-format on */ + +#define OCSP_RESPONSE_STATUS_SUCCESSFUL 0 +#define OCSP_RESPONSE_STATUS_MALFORMEDREQUEST 1 +#define OCSP_RESPONSE_STATUS_INTERNALERROR 2 +#define OCSP_RESPONSE_STATUS_TRYLATER 3 +#define OCSP_RESPONSE_STATUS_SIGREQUIRED 5 +#define OCSP_RESPONSE_STATUS_UNAUTHORIZED 6 + +typedef struct ocsp_resp_bytes_st OCSP_RESPBYTES; + +#define V_OCSP_RESPID_NAME 0 +#define V_OCSP_RESPID_KEY 1 + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(OCSP_RESPID, OCSP_RESPID, OCSP_RESPID) +#define sk_OCSP_RESPID_num(sk) OPENSSL_sk_num(ossl_check_const_OCSP_RESPID_sk_type(sk)) +#define sk_OCSP_RESPID_value(sk, idx) ((OCSP_RESPID *)OPENSSL_sk_value(ossl_check_const_OCSP_RESPID_sk_type(sk), (idx))) +#define sk_OCSP_RESPID_new(cmp) ((STACK_OF(OCSP_RESPID) *)OPENSSL_sk_new(ossl_check_OCSP_RESPID_compfunc_type(cmp))) +#define sk_OCSP_RESPID_new_null() ((STACK_OF(OCSP_RESPID) *)OPENSSL_sk_new_null()) +#define sk_OCSP_RESPID_new_reserve(cmp, n) ((STACK_OF(OCSP_RESPID) *)OPENSSL_sk_new_reserve(ossl_check_OCSP_RESPID_compfunc_type(cmp), (n))) +#define sk_OCSP_RESPID_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OCSP_RESPID_sk_type(sk), (n)) +#define sk_OCSP_RESPID_free(sk) OPENSSL_sk_free(ossl_check_OCSP_RESPID_sk_type(sk)) +#define sk_OCSP_RESPID_zero(sk) OPENSSL_sk_zero(ossl_check_OCSP_RESPID_sk_type(sk)) +#define sk_OCSP_RESPID_delete(sk, i) ((OCSP_RESPID *)OPENSSL_sk_delete(ossl_check_OCSP_RESPID_sk_type(sk), (i))) +#define sk_OCSP_RESPID_delete_ptr(sk, ptr) ((OCSP_RESPID *)OPENSSL_sk_delete_ptr(ossl_check_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_type(ptr))) +#define sk_OCSP_RESPID_push(sk, ptr) OPENSSL_sk_push(ossl_check_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_type(ptr)) +#define sk_OCSP_RESPID_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_type(ptr)) +#define sk_OCSP_RESPID_pop(sk) ((OCSP_RESPID *)OPENSSL_sk_pop(ossl_check_OCSP_RESPID_sk_type(sk))) +#define sk_OCSP_RESPID_shift(sk) ((OCSP_RESPID *)OPENSSL_sk_shift(ossl_check_OCSP_RESPID_sk_type(sk))) +#define sk_OCSP_RESPID_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_freefunc_type(freefunc)) +#define sk_OCSP_RESPID_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_type(ptr), (idx)) +#define sk_OCSP_RESPID_set(sk, idx, ptr) ((OCSP_RESPID *)OPENSSL_sk_set(ossl_check_OCSP_RESPID_sk_type(sk), (idx), ossl_check_OCSP_RESPID_type(ptr))) +#define sk_OCSP_RESPID_find(sk, ptr) OPENSSL_sk_find(ossl_check_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_type(ptr)) +#define sk_OCSP_RESPID_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_type(ptr)) +#define sk_OCSP_RESPID_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_type(ptr), pnum) +#define sk_OCSP_RESPID_sort(sk) OPENSSL_sk_sort(ossl_check_OCSP_RESPID_sk_type(sk)) +#define sk_OCSP_RESPID_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OCSP_RESPID_sk_type(sk)) +#define sk_OCSP_RESPID_dup(sk) ((STACK_OF(OCSP_RESPID) *)OPENSSL_sk_dup(ossl_check_const_OCSP_RESPID_sk_type(sk))) +#define sk_OCSP_RESPID_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OCSP_RESPID) *)OPENSSL_sk_deep_copy(ossl_check_const_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_copyfunc_type(copyfunc), ossl_check_OCSP_RESPID_freefunc_type(freefunc))) +#define sk_OCSP_RESPID_set_cmp_func(sk, cmp) ((sk_OCSP_RESPID_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_compfunc_type(cmp))) + +/* clang-format on */ + +typedef struct ocsp_revoked_info_st OCSP_REVOKEDINFO; + +#define V_OCSP_CERTSTATUS_GOOD 0 +#define V_OCSP_CERTSTATUS_REVOKED 1 +#define V_OCSP_CERTSTATUS_UNKNOWN 2 + +typedef struct ocsp_cert_status_st OCSP_CERTSTATUS; +typedef struct ocsp_single_response_st OCSP_SINGLERESP; + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(OCSP_SINGLERESP, OCSP_SINGLERESP, OCSP_SINGLERESP) +#define sk_OCSP_SINGLERESP_num(sk) OPENSSL_sk_num(ossl_check_const_OCSP_SINGLERESP_sk_type(sk)) +#define sk_OCSP_SINGLERESP_value(sk, idx) ((OCSP_SINGLERESP *)OPENSSL_sk_value(ossl_check_const_OCSP_SINGLERESP_sk_type(sk), (idx))) +#define sk_OCSP_SINGLERESP_new(cmp) ((STACK_OF(OCSP_SINGLERESP) *)OPENSSL_sk_new(ossl_check_OCSP_SINGLERESP_compfunc_type(cmp))) +#define sk_OCSP_SINGLERESP_new_null() ((STACK_OF(OCSP_SINGLERESP) *)OPENSSL_sk_new_null()) +#define sk_OCSP_SINGLERESP_new_reserve(cmp, n) ((STACK_OF(OCSP_SINGLERESP) *)OPENSSL_sk_new_reserve(ossl_check_OCSP_SINGLERESP_compfunc_type(cmp), (n))) +#define sk_OCSP_SINGLERESP_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OCSP_SINGLERESP_sk_type(sk), (n)) +#define sk_OCSP_SINGLERESP_free(sk) OPENSSL_sk_free(ossl_check_OCSP_SINGLERESP_sk_type(sk)) +#define sk_OCSP_SINGLERESP_zero(sk) OPENSSL_sk_zero(ossl_check_OCSP_SINGLERESP_sk_type(sk)) +#define sk_OCSP_SINGLERESP_delete(sk, i) ((OCSP_SINGLERESP *)OPENSSL_sk_delete(ossl_check_OCSP_SINGLERESP_sk_type(sk), (i))) +#define sk_OCSP_SINGLERESP_delete_ptr(sk, ptr) ((OCSP_SINGLERESP *)OPENSSL_sk_delete_ptr(ossl_check_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_type(ptr))) +#define sk_OCSP_SINGLERESP_push(sk, ptr) OPENSSL_sk_push(ossl_check_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_type(ptr)) +#define sk_OCSP_SINGLERESP_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_type(ptr)) +#define sk_OCSP_SINGLERESP_pop(sk) ((OCSP_SINGLERESP *)OPENSSL_sk_pop(ossl_check_OCSP_SINGLERESP_sk_type(sk))) +#define sk_OCSP_SINGLERESP_shift(sk) ((OCSP_SINGLERESP *)OPENSSL_sk_shift(ossl_check_OCSP_SINGLERESP_sk_type(sk))) +#define sk_OCSP_SINGLERESP_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_freefunc_type(freefunc)) +#define sk_OCSP_SINGLERESP_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_type(ptr), (idx)) +#define sk_OCSP_SINGLERESP_set(sk, idx, ptr) ((OCSP_SINGLERESP *)OPENSSL_sk_set(ossl_check_OCSP_SINGLERESP_sk_type(sk), (idx), ossl_check_OCSP_SINGLERESP_type(ptr))) +#define sk_OCSP_SINGLERESP_find(sk, ptr) OPENSSL_sk_find(ossl_check_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_type(ptr)) +#define sk_OCSP_SINGLERESP_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_type(ptr)) +#define sk_OCSP_SINGLERESP_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_type(ptr), pnum) +#define sk_OCSP_SINGLERESP_sort(sk) OPENSSL_sk_sort(ossl_check_OCSP_SINGLERESP_sk_type(sk)) +#define sk_OCSP_SINGLERESP_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OCSP_SINGLERESP_sk_type(sk)) +#define sk_OCSP_SINGLERESP_dup(sk) ((STACK_OF(OCSP_SINGLERESP) *)OPENSSL_sk_dup(ossl_check_const_OCSP_SINGLERESP_sk_type(sk))) +#define sk_OCSP_SINGLERESP_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OCSP_SINGLERESP) *)OPENSSL_sk_deep_copy(ossl_check_const_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_copyfunc_type(copyfunc), ossl_check_OCSP_SINGLERESP_freefunc_type(freefunc))) +#define sk_OCSP_SINGLERESP_set_cmp_func(sk, cmp) ((sk_OCSP_SINGLERESP_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OCSP_SINGLERESP_sk_type(sk), ossl_check_OCSP_SINGLERESP_compfunc_type(cmp))) + +/* clang-format on */ + +typedef struct ocsp_response_data_st OCSP_RESPDATA; + +typedef struct ocsp_basic_response_st OCSP_BASICRESP; + +typedef struct ocsp_crl_id_st OCSP_CRLID; +typedef struct ocsp_service_locator_st OCSP_SERVICELOC; + +#define PEM_STRING_OCSP_REQUEST "OCSP REQUEST" +#define PEM_STRING_OCSP_RESPONSE "OCSP RESPONSE" + +#define d2i_OCSP_REQUEST_bio(bp, p) ASN1_d2i_bio_of(OCSP_REQUEST, OCSP_REQUEST_new, d2i_OCSP_REQUEST, bp, p) + +#define d2i_OCSP_RESPONSE_bio(bp, p) ASN1_d2i_bio_of(OCSP_RESPONSE, OCSP_RESPONSE_new, d2i_OCSP_RESPONSE, bp, p) + +#define PEM_read_bio_OCSP_REQUEST(bp, x, cb) (OCSP_REQUEST *)PEM_ASN1_read_bio( \ + (d2i_of_void *)d2i_OCSP_REQUEST, PEM_STRING_OCSP_REQUEST, \ + bp, (char **)(x), cb, NULL) + +#define PEM_read_bio_OCSP_RESPONSE(bp, x, cb) (OCSP_RESPONSE *)PEM_ASN1_read_bio( \ + (d2i_of_void *)d2i_OCSP_RESPONSE, PEM_STRING_OCSP_RESPONSE, \ + bp, (char **)(x), cb, NULL) + +#define PEM_write_bio_OCSP_REQUEST(bp, o) \ + PEM_ASN1_write_bio((i2d_of_void *)i2d_OCSP_REQUEST, PEM_STRING_OCSP_REQUEST, \ + bp, (char *)(o), NULL, NULL, 0, NULL, NULL) + +#define PEM_write_bio_OCSP_RESPONSE(bp, o) \ + PEM_ASN1_write_bio((i2d_of_void *)i2d_OCSP_RESPONSE, PEM_STRING_OCSP_RESPONSE, \ + bp, (char *)(o), NULL, NULL, 0, NULL, NULL) + +#define i2d_OCSP_RESPONSE_bio(bp, o) ASN1_i2d_bio_of(OCSP_RESPONSE, i2d_OCSP_RESPONSE, bp, o) + +#define i2d_OCSP_REQUEST_bio(bp, o) ASN1_i2d_bio_of(OCSP_REQUEST, i2d_OCSP_REQUEST, bp, o) + +#define ASN1_BIT_STRING_digest(data, type, md, len) \ + ASN1_item_digest(ASN1_ITEM_rptr(ASN1_BIT_STRING), type, data, md, len) + +#define OCSP_CERTSTATUS_dup(cs) \ + (OCSP_CERTSTATUS *)ASN1_dup((i2d_of_void *)i2d_OCSP_CERTSTATUS, \ + (d2i_of_void *)d2i_OCSP_CERTSTATUS, (char *)(cs)) + +DECLARE_ASN1_DUP_FUNCTION(OCSP_CERTID) + +OSSL_HTTP_REQ_CTX *OCSP_sendreq_new(BIO *io, const char *path, + const OCSP_REQUEST *req, int buf_size); +OCSP_RESPONSE *OCSP_sendreq_bio(BIO *b, const char *path, OCSP_REQUEST *req); + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +typedef OSSL_HTTP_REQ_CTX OCSP_REQ_CTX; +#define OCSP_REQ_CTX_new(io, buf_size) \ + OSSL_HTTP_REQ_CTX_new(io, io, buf_size) +#define OCSP_REQ_CTX_free OSSL_HTTP_REQ_CTX_free +#define OCSP_REQ_CTX_http(rctx, op, path) \ + (OSSL_HTTP_REQ_CTX_set_expected(rctx, NULL, 1 /* asn1 */, 0, 0) && OSSL_HTTP_REQ_CTX_set_request_line(rctx, strcmp(op, "POST") == 0, NULL, NULL, path)) +#define OCSP_REQ_CTX_add1_header OSSL_HTTP_REQ_CTX_add1_header +#define OCSP_REQ_CTX_i2d(r, it, req) \ + OSSL_HTTP_REQ_CTX_set1_req(r, "application/ocsp-request", it, req) +#define OCSP_REQ_CTX_set1_req(r, req) \ + OCSP_REQ_CTX_i2d(r, ASN1_ITEM_rptr(OCSP_REQUEST), (ASN1_VALUE *)(req)) +#define OCSP_REQ_CTX_nbio OSSL_HTTP_REQ_CTX_nbio +#define OCSP_REQ_CTX_nbio_d2i OSSL_HTTP_REQ_CTX_nbio_d2i +#define OCSP_sendreq_nbio(p, r) \ + OSSL_HTTP_REQ_CTX_nbio_d2i(r, (ASN1_VALUE **)(p), \ + ASN1_ITEM_rptr(OCSP_RESPONSE)) +#define OCSP_REQ_CTX_get0_mem_bio OSSL_HTTP_REQ_CTX_get0_mem_bio +#define OCSP_set_max_response_length OSSL_HTTP_REQ_CTX_set_max_response_length +#endif + +OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, const X509 *subject, + const X509 *issuer); + +OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst, + const X509_NAME *issuerName, + const ASN1_BIT_STRING *issuerKey, + const ASN1_INTEGER *serialNumber); + +OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid); + +int OCSP_request_add1_nonce(OCSP_REQUEST *req, unsigned char *val, int len); +int OCSP_basic_add1_nonce(OCSP_BASICRESP *resp, unsigned char *val, int len); +int OCSP_check_nonce(OCSP_REQUEST *req, OCSP_BASICRESP *bs); +int OCSP_copy_nonce(OCSP_BASICRESP *resp, OCSP_REQUEST *req); + +int OCSP_request_set1_name(OCSP_REQUEST *req, const X509_NAME *nm); +int OCSP_request_add1_cert(OCSP_REQUEST *req, X509 *cert); + +int OCSP_request_sign(OCSP_REQUEST *req, + X509 *signer, + EVP_PKEY *key, + const EVP_MD *dgst, + STACK_OF(X509) *certs, unsigned long flags); + +int OCSP_response_status(OCSP_RESPONSE *resp); +OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp); + +const ASN1_OCTET_STRING *OCSP_resp_get0_signature(const OCSP_BASICRESP *bs); +const X509_ALGOR *OCSP_resp_get0_tbs_sigalg(const OCSP_BASICRESP *bs); +const OCSP_RESPDATA *OCSP_resp_get0_respdata(const OCSP_BASICRESP *bs); +int OCSP_resp_get0_signer(OCSP_BASICRESP *bs, X509 **signer, + STACK_OF(X509) *extra_certs); + +int OCSP_resp_count(OCSP_BASICRESP *bs); +OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx); +const ASN1_GENERALIZEDTIME *OCSP_resp_get0_produced_at(const OCSP_BASICRESP *bs); +const STACK_OF(X509) *OCSP_resp_get0_certs(const OCSP_BASICRESP *bs); +int OCSP_resp_get0_id(const OCSP_BASICRESP *bs, + const ASN1_OCTET_STRING **pid, + const X509_NAME **pname); +int OCSP_resp_get1_id(const OCSP_BASICRESP *bs, + ASN1_OCTET_STRING **pid, + X509_NAME **pname); + +int OCSP_resp_find(OCSP_BASICRESP *bs, OCSP_CERTID *id, int last); +int OCSP_single_get0_status(OCSP_SINGLERESP *single, int *reason, + ASN1_GENERALIZEDTIME **revtime, + ASN1_GENERALIZEDTIME **thisupd, + ASN1_GENERALIZEDTIME **nextupd); +int OCSP_resp_find_status(OCSP_BASICRESP *bs, OCSP_CERTID *id, int *status, + int *reason, + ASN1_GENERALIZEDTIME **revtime, + ASN1_GENERALIZEDTIME **thisupd, + ASN1_GENERALIZEDTIME **nextupd); +int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd, + ASN1_GENERALIZEDTIME *nextupd, long sec, long maxsec); + +int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs, + X509_STORE *store, unsigned long flags); + +#define OCSP_parse_url(url, host, port, path, ssl) \ + OSSL_HTTP_parse_url(url, ssl, NULL, host, port, NULL, path, NULL, NULL) + +int OCSP_id_issuer_cmp(const OCSP_CERTID *a, const OCSP_CERTID *b); +int OCSP_id_cmp(const OCSP_CERTID *a, const OCSP_CERTID *b); + +int OCSP_request_onereq_count(OCSP_REQUEST *req); +OCSP_ONEREQ *OCSP_request_onereq_get0(OCSP_REQUEST *req, int i); +OCSP_CERTID *OCSP_onereq_get0_id(OCSP_ONEREQ *one); +int OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd, + ASN1_OCTET_STRING **pikeyHash, + ASN1_INTEGER **pserial, OCSP_CERTID *cid); +int OCSP_request_is_signed(OCSP_REQUEST *req); +OCSP_RESPONSE *OCSP_response_create(int status, OCSP_BASICRESP *bs); +OCSP_SINGLERESP *OCSP_basic_add1_status(OCSP_BASICRESP *rsp, + OCSP_CERTID *cid, + int status, int reason, + ASN1_TIME *revtime, + ASN1_TIME *thisupd, + ASN1_TIME *nextupd); +int OCSP_basic_add1_cert(OCSP_BASICRESP *resp, X509 *cert); +int OCSP_basic_sign(OCSP_BASICRESP *brsp, + X509 *signer, EVP_PKEY *key, const EVP_MD *dgst, + STACK_OF(X509) *certs, unsigned long flags); +int OCSP_basic_sign_ctx(OCSP_BASICRESP *brsp, + X509 *signer, EVP_MD_CTX *ctx, + STACK_OF(X509) *certs, unsigned long flags); +int OCSP_RESPID_set_by_name(OCSP_RESPID *respid, X509 *cert); +int OCSP_RESPID_set_by_key_ex(OCSP_RESPID *respid, X509 *cert, + OSSL_LIB_CTX *libctx, const char *propq); +int OCSP_RESPID_set_by_key(OCSP_RESPID *respid, X509 *cert); +int OCSP_RESPID_match_ex(OCSP_RESPID *respid, X509 *cert, OSSL_LIB_CTX *libctx, + const char *propq); +int OCSP_RESPID_match(OCSP_RESPID *respid, X509 *cert); + +X509_EXTENSION *OCSP_crlID_new(const char *url, long *n, char *tim); + +X509_EXTENSION *OCSP_accept_responses_new(char **oids); + +X509_EXTENSION *OCSP_archive_cutoff_new(char *tim); + +X509_EXTENSION *OCSP_url_svcloc_new(const X509_NAME *issuer, const char **urls); + +int OCSP_REQUEST_get_ext_count(OCSP_REQUEST *x); +int OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos); +int OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, const ASN1_OBJECT *obj, + int lastpos); +int OCSP_REQUEST_get_ext_by_critical(OCSP_REQUEST *x, int crit, int lastpos); +X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc); +X509_EXTENSION *OCSP_REQUEST_delete_ext(OCSP_REQUEST *x, int loc); +void *OCSP_REQUEST_get1_ext_d2i(OCSP_REQUEST *x, int nid, int *crit, + int *idx); +int OCSP_REQUEST_add1_ext_i2d(OCSP_REQUEST *x, int nid, void *value, int crit, + unsigned long flags); +int OCSP_REQUEST_add_ext(OCSP_REQUEST *x, X509_EXTENSION *ex, int loc); + +int OCSP_ONEREQ_get_ext_count(OCSP_ONEREQ *x); +int OCSP_ONEREQ_get_ext_by_NID(OCSP_ONEREQ *x, int nid, int lastpos); +int OCSP_ONEREQ_get_ext_by_OBJ(OCSP_ONEREQ *x, const ASN1_OBJECT *obj, int lastpos); +int OCSP_ONEREQ_get_ext_by_critical(OCSP_ONEREQ *x, int crit, int lastpos); +X509_EXTENSION *OCSP_ONEREQ_get_ext(OCSP_ONEREQ *x, int loc); +X509_EXTENSION *OCSP_ONEREQ_delete_ext(OCSP_ONEREQ *x, int loc); +void *OCSP_ONEREQ_get1_ext_d2i(OCSP_ONEREQ *x, int nid, int *crit, int *idx); +int OCSP_ONEREQ_add1_ext_i2d(OCSP_ONEREQ *x, int nid, void *value, int crit, + unsigned long flags); +int OCSP_ONEREQ_add_ext(OCSP_ONEREQ *x, X509_EXTENSION *ex, int loc); + +int OCSP_BASICRESP_get_ext_count(OCSP_BASICRESP *x); +int OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos); +int OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, const ASN1_OBJECT *obj, + int lastpos); +int OCSP_BASICRESP_get_ext_by_critical(OCSP_BASICRESP *x, int crit, + int lastpos); +X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc); +X509_EXTENSION *OCSP_BASICRESP_delete_ext(OCSP_BASICRESP *x, int loc); +void *OCSP_BASICRESP_get1_ext_d2i(OCSP_BASICRESP *x, int nid, int *crit, + int *idx); +int OCSP_BASICRESP_add1_ext_i2d(OCSP_BASICRESP *x, int nid, void *value, + int crit, unsigned long flags); +int OCSP_BASICRESP_add_ext(OCSP_BASICRESP *x, X509_EXTENSION *ex, int loc); + +int OCSP_SINGLERESP_get_ext_count(OCSP_SINGLERESP *x); +int OCSP_SINGLERESP_get_ext_by_NID(OCSP_SINGLERESP *x, int nid, int lastpos); +int OCSP_SINGLERESP_get_ext_by_OBJ(OCSP_SINGLERESP *x, const ASN1_OBJECT *obj, + int lastpos); +int OCSP_SINGLERESP_get_ext_by_critical(OCSP_SINGLERESP *x, int crit, + int lastpos); +X509_EXTENSION *OCSP_SINGLERESP_get_ext(OCSP_SINGLERESP *x, int loc); +X509_EXTENSION *OCSP_SINGLERESP_delete_ext(OCSP_SINGLERESP *x, int loc); +void *OCSP_SINGLERESP_get1_ext_d2i(OCSP_SINGLERESP *x, int nid, int *crit, + int *idx); +int OCSP_SINGLERESP_add1_ext_i2d(OCSP_SINGLERESP *x, int nid, void *value, + int crit, unsigned long flags); +int OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, X509_EXTENSION *ex, int loc); +const OCSP_CERTID *OCSP_SINGLERESP_get0_id(const OCSP_SINGLERESP *x); + +DECLARE_ASN1_FUNCTIONS(OCSP_SINGLERESP) +DECLARE_ASN1_FUNCTIONS(OCSP_CERTSTATUS) +DECLARE_ASN1_FUNCTIONS(OCSP_REVOKEDINFO) +DECLARE_ASN1_FUNCTIONS(OCSP_BASICRESP) +DECLARE_ASN1_FUNCTIONS(OCSP_RESPDATA) +DECLARE_ASN1_FUNCTIONS(OCSP_RESPID) +DECLARE_ASN1_FUNCTIONS(OCSP_RESPONSE) +DECLARE_ASN1_FUNCTIONS(OCSP_RESPBYTES) +DECLARE_ASN1_FUNCTIONS(OCSP_ONEREQ) +DECLARE_ASN1_FUNCTIONS(OCSP_CERTID) +DECLARE_ASN1_FUNCTIONS(OCSP_REQUEST) +DECLARE_ASN1_FUNCTIONS(OCSP_SIGNATURE) +DECLARE_ASN1_FUNCTIONS(OCSP_REQINFO) +DECLARE_ASN1_FUNCTIONS(OCSP_CRLID) +DECLARE_ASN1_FUNCTIONS(OCSP_SERVICELOC) + +const char *OCSP_response_status_str(long s); +const char *OCSP_cert_status_str(long s); +const char *OCSP_crl_reason_str(long s); + +int OCSP_REQUEST_print(BIO *bp, OCSP_REQUEST *a, unsigned long flags); +int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE *o, unsigned long flags); + +int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs, + X509_STORE *st, unsigned long flags); + +#ifdef __cplusplus +} +#endif +#endif /* !defined(OPENSSL_NO_OCSP) */ +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ocsperr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ocsperr.h new file mode 100644 index 0000000000000000000000000000000000000000..18e035e8a4e10d9196cbb562a0dddda55b55a615 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ocsperr.h @@ -0,0 +1,51 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_OCSPERR_H +#define OPENSSL_OCSPERR_H +#pragma once + +#include +#include +#include + +#ifndef OPENSSL_NO_OCSP + +/* + * OCSP reason codes. + */ +#define OCSP_R_CERTIFICATE_VERIFY_ERROR 101 +#define OCSP_R_DIGEST_ERR 102 +#define OCSP_R_DIGEST_NAME_ERR 106 +#define OCSP_R_DIGEST_SIZE_ERR 107 +#define OCSP_R_ERROR_IN_NEXTUPDATE_FIELD 122 +#define OCSP_R_ERROR_IN_THISUPDATE_FIELD 123 +#define OCSP_R_MISSING_OCSPSIGNING_USAGE 103 +#define OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE 124 +#define OCSP_R_NOT_BASIC_RESPONSE 104 +#define OCSP_R_NO_CERTIFICATES_IN_CHAIN 105 +#define OCSP_R_NO_RESPONSE_DATA 108 +#define OCSP_R_NO_REVOKED_TIME 109 +#define OCSP_R_NO_SIGNER_KEY 130 +#define OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 110 +#define OCSP_R_REQUEST_NOT_SIGNED 128 +#define OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA 111 +#define OCSP_R_ROOT_CA_NOT_TRUSTED 112 +#define OCSP_R_SIGNATURE_FAILURE 117 +#define OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND 118 +#define OCSP_R_STATUS_EXPIRED 125 +#define OCSP_R_STATUS_NOT_YET_VALID 126 +#define OCSP_R_STATUS_TOO_OLD 127 +#define OCSP_R_UNKNOWN_MESSAGE_DIGEST 119 +#define OCSP_R_UNKNOWN_NID 120 +#define OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE 129 + +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/opensslconf.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/opensslconf.h new file mode 100644 index 0000000000000000000000000000000000000000..4a8d78efff70ad27ea0251a3562ffa227d7ca993 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/opensslconf.h @@ -0,0 +1,17 @@ +/* + * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_OPENSSLCONF_H +#define OPENSSL_OPENSSLCONF_H +#pragma once + +#include +#include + +#endif /* OPENSSL_OPENSSLCONF_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/opensslv.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/opensslv.h new file mode 100644 index 0000000000000000000000000000000000000000..bb44b83ec7165f8be13e6948af1ea271d043e900 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/opensslv.h @@ -0,0 +1,131 @@ +/* + * WARNING: do not edit! + * Generated by makefile from include\openssl\opensslv.h.in + * + * Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_OPENSSLV_H +#define OPENSSL_OPENSSLV_H +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * SECTION 1: VERSION DATA. These will change for each release + */ + +/* + * Base version macros + * + * These macros express version number MAJOR.MINOR.PATCH exactly + */ +/* clang-format off */ +# define OPENSSL_VERSION_MAJOR 3 +/* clang-format on */ +/* clang-format off */ +# define OPENSSL_VERSION_MINOR 6 +/* clang-format on */ +/* clang-format off */ +# define OPENSSL_VERSION_PATCH 2 +/* clang-format on */ + +/* + * Additional version information + * + * These are also part of the new version scheme, but aren't part + * of the version number itself. + */ + +/* Could be: #define OPENSSL_VERSION_PRE_RELEASE "-alpha.1" */ +/* clang-format off */ +# define OPENSSL_VERSION_PRE_RELEASE "" +/* clang-format on */ +/* Could be: #define OPENSSL_VERSION_BUILD_METADATA "+fips" */ +/* Could be: #define OPENSSL_VERSION_BUILD_METADATA "+vendor.1" */ +/* clang-format off */ +# define OPENSSL_VERSION_BUILD_METADATA "" +/* clang-format on */ + +/* + * Note: The OpenSSL Project will never define OPENSSL_VERSION_BUILD_METADATA + * to be anything but the empty string. Its use is entirely reserved for + * others + */ + +/* + * Shared library version + * + * This is strictly to express ABI version, which may or may not + * be related to the API version expressed with the macros above. + * This is defined in free form. + */ +/* clang-format off */ +# define OPENSSL_SHLIB_VERSION 3 +/* clang-format on */ + +/* + * SECTION 2: USEFUL MACROS + */ + +/* For checking general API compatibility when preprocessing */ +#define OPENSSL_VERSION_PREREQ(maj, min) \ + ((OPENSSL_VERSION_MAJOR << 16) + OPENSSL_VERSION_MINOR >= ((maj) << 16) + (min)) + +/* + * Macros to get the version in easily digested string form, both the short + * "MAJOR.MINOR.PATCH" variant (where MAJOR, MINOR and PATCH are replaced + * with the values from the corresponding OPENSSL_VERSION_ macros) and the + * longer variant with OPENSSL_VERSION_PRE_RELEASE_STR and + * OPENSSL_VERSION_BUILD_METADATA_STR appended. + */ +/* clang-format off */ +# define OPENSSL_VERSION_STR "3.6.2" +/* clang-format on */ +/* clang-format off */ +# define OPENSSL_FULL_VERSION_STR "3.6.2" +/* clang-format on */ + +/* + * SECTION 3: ADDITIONAL METADATA + * + * These strings are defined separately to allow them to be parsable. + */ +/* clang-format off */ +# define OPENSSL_RELEASE_DATE "7 Apr 2026" +/* clang-format on */ + +/* + * SECTION 4: BACKWARD COMPATIBILITY + */ + +/* clang-format off */ +# define OPENSSL_VERSION_TEXT "OpenSSL 3.6.2 7 Apr 2026" +/* clang-format on */ + +/* clang-format off */ +/* Synthesize OPENSSL_VERSION_NUMBER with the layout 0xMNN00PP0L */ +# define OPENSSL_VERSION_NUMBER \ + ( (OPENSSL_VERSION_MAJOR<<28) \ + |(OPENSSL_VERSION_MINOR<<20) \ + |(OPENSSL_VERSION_PATCH<<4) \ + |0x0L ) +/* clang-format on */ + +#ifdef __cplusplus +} +#endif + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_OPENSSLV_H +#endif + +#endif /* OPENSSL_OPENSSLV_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ossl_typ.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ossl_typ.h new file mode 100644 index 0000000000000000000000000000000000000000..a562299b9f9ad0b26ca9496d53008388508923a0 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ossl_typ.h @@ -0,0 +1,16 @@ +/* + * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* + * The original was renamed to + * + * This header file only exists for compatibility reasons with older + * applications which #include . + */ +#include diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/param_build.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/param_build.h new file mode 100644 index 0000000000000000000000000000000000000000..be6a0252100ea76f2afac3bf41c48cc293a025b9 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/param_build.h @@ -0,0 +1,63 @@ +/* + * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved. + * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_PARAM_BUILD_H +#define OPENSSL_PARAM_BUILD_H +#pragma once + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +OSSL_PARAM_BLD *OSSL_PARAM_BLD_new(void); +OSSL_PARAM *OSSL_PARAM_BLD_to_param(OSSL_PARAM_BLD *bld); +void OSSL_PARAM_BLD_free(OSSL_PARAM_BLD *bld); + +int OSSL_PARAM_BLD_push_int(OSSL_PARAM_BLD *bld, const char *key, int val); +int OSSL_PARAM_BLD_push_uint(OSSL_PARAM_BLD *bld, const char *key, + unsigned int val); +int OSSL_PARAM_BLD_push_long(OSSL_PARAM_BLD *bld, const char *key, + long int val); +int OSSL_PARAM_BLD_push_ulong(OSSL_PARAM_BLD *bld, const char *key, + unsigned long int val); +int OSSL_PARAM_BLD_push_int32(OSSL_PARAM_BLD *bld, const char *key, + int32_t val); +int OSSL_PARAM_BLD_push_uint32(OSSL_PARAM_BLD *bld, const char *key, + uint32_t val); +int OSSL_PARAM_BLD_push_int64(OSSL_PARAM_BLD *bld, const char *key, + int64_t val); +int OSSL_PARAM_BLD_push_uint64(OSSL_PARAM_BLD *bld, const char *key, + uint64_t val); +int OSSL_PARAM_BLD_push_size_t(OSSL_PARAM_BLD *bld, const char *key, + size_t val); +int OSSL_PARAM_BLD_push_time_t(OSSL_PARAM_BLD *bld, const char *key, + time_t val); +int OSSL_PARAM_BLD_push_double(OSSL_PARAM_BLD *bld, const char *key, + double val); +int OSSL_PARAM_BLD_push_BN(OSSL_PARAM_BLD *bld, const char *key, + const BIGNUM *bn); +int OSSL_PARAM_BLD_push_BN_pad(OSSL_PARAM_BLD *bld, const char *key, + const BIGNUM *bn, size_t sz); +int OSSL_PARAM_BLD_push_utf8_string(OSSL_PARAM_BLD *bld, const char *key, + const char *buf, size_t bsize); +int OSSL_PARAM_BLD_push_utf8_ptr(OSSL_PARAM_BLD *bld, const char *key, + char *buf, size_t bsize); +int OSSL_PARAM_BLD_push_octet_string(OSSL_PARAM_BLD *bld, const char *key, + const void *buf, size_t bsize); +int OSSL_PARAM_BLD_push_octet_ptr(OSSL_PARAM_BLD *bld, const char *key, + void *buf, size_t bsize); + +#ifdef __cplusplus +} +#endif +#endif /* OPENSSL_PARAM_BUILD_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/params.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/params.h new file mode 100644 index 0000000000000000000000000000000000000000..6772c409cac8082341664f0e878903ba06a2f633 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/params.h @@ -0,0 +1,166 @@ +/* + * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved. + * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_PARAMS_H +#define OPENSSL_PARAMS_H +#pragma once + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define OSSL_PARAM_UNMODIFIED ((size_t)-1) + +#define OSSL_PARAM_END \ + { NULL, 0, NULL, 0, 0 } + +#define OSSL_PARAM_DEFN(key, type, addr, sz) \ + { (key), (type), (addr), (sz), OSSL_PARAM_UNMODIFIED } + +/* Basic parameter types without return sizes */ +#define OSSL_PARAM_int(key, addr) \ + OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(int)) +#define OSSL_PARAM_uint(key, addr) \ + OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \ + sizeof(unsigned int)) +#define OSSL_PARAM_long(key, addr) \ + OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(long int)) +#define OSSL_PARAM_ulong(key, addr) \ + OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \ + sizeof(unsigned long int)) +#define OSSL_PARAM_int32(key, addr) \ + OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(int32_t)) +#define OSSL_PARAM_uint32(key, addr) \ + OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \ + sizeof(uint32_t)) +#define OSSL_PARAM_int64(key, addr) \ + OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(int64_t)) +#define OSSL_PARAM_uint64(key, addr) \ + OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \ + sizeof(uint64_t)) +#define OSSL_PARAM_size_t(key, addr) \ + OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), sizeof(size_t)) +#define OSSL_PARAM_time_t(key, addr) \ + OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(time_t)) +#define OSSL_PARAM_double(key, addr) \ + OSSL_PARAM_DEFN((key), OSSL_PARAM_REAL, (addr), sizeof(double)) + +#define OSSL_PARAM_BN(key, bn, sz) \ + OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (bn), (sz)) +#define OSSL_PARAM_utf8_string(key, addr, sz) \ + OSSL_PARAM_DEFN((key), OSSL_PARAM_UTF8_STRING, (addr), sz) +#define OSSL_PARAM_octet_string(key, addr, sz) \ + OSSL_PARAM_DEFN((key), OSSL_PARAM_OCTET_STRING, (addr), sz) + +#define OSSL_PARAM_utf8_ptr(key, addr, sz) \ + OSSL_PARAM_DEFN((key), OSSL_PARAM_UTF8_PTR, (addr), sz) +#define OSSL_PARAM_octet_ptr(key, addr, sz) \ + OSSL_PARAM_DEFN((key), OSSL_PARAM_OCTET_PTR, (addr), sz) + +/* Search an OSSL_PARAM array for a matching name */ +OSSL_PARAM *OSSL_PARAM_locate(OSSL_PARAM *p, const char *key); +const OSSL_PARAM *OSSL_PARAM_locate_const(const OSSL_PARAM *p, const char *key); + +/* Basic parameter type run-time construction */ +OSSL_PARAM OSSL_PARAM_construct_int(const char *key, int *buf); +OSSL_PARAM OSSL_PARAM_construct_uint(const char *key, unsigned int *buf); +OSSL_PARAM OSSL_PARAM_construct_long(const char *key, long int *buf); +OSSL_PARAM OSSL_PARAM_construct_ulong(const char *key, unsigned long int *buf); +OSSL_PARAM OSSL_PARAM_construct_int32(const char *key, int32_t *buf); +OSSL_PARAM OSSL_PARAM_construct_uint32(const char *key, uint32_t *buf); +OSSL_PARAM OSSL_PARAM_construct_int64(const char *key, int64_t *buf); +OSSL_PARAM OSSL_PARAM_construct_uint64(const char *key, uint64_t *buf); +OSSL_PARAM OSSL_PARAM_construct_size_t(const char *key, size_t *buf); +OSSL_PARAM OSSL_PARAM_construct_time_t(const char *key, time_t *buf); +OSSL_PARAM OSSL_PARAM_construct_BN(const char *key, unsigned char *buf, + size_t bsize); +OSSL_PARAM OSSL_PARAM_construct_double(const char *key, double *buf); +OSSL_PARAM OSSL_PARAM_construct_utf8_string(const char *key, char *buf, + size_t bsize); +OSSL_PARAM OSSL_PARAM_construct_utf8_ptr(const char *key, char **buf, + size_t bsize); +OSSL_PARAM OSSL_PARAM_construct_octet_string(const char *key, void *buf, + size_t bsize); +OSSL_PARAM OSSL_PARAM_construct_octet_ptr(const char *key, void **buf, + size_t bsize); +OSSL_PARAM OSSL_PARAM_construct_end(void); + +int OSSL_PARAM_allocate_from_text(OSSL_PARAM *to, + const OSSL_PARAM *paramdefs, + const char *key, const char *value, + size_t value_n, int *found); + +int OSSL_PARAM_print_to_bio(const OSSL_PARAM *params, BIO *bio, + int print_values); + +int OSSL_PARAM_get_int(const OSSL_PARAM *p, int *val); +int OSSL_PARAM_get_uint(const OSSL_PARAM *p, unsigned int *val); +int OSSL_PARAM_get_long(const OSSL_PARAM *p, long int *val); +int OSSL_PARAM_get_ulong(const OSSL_PARAM *p, unsigned long int *val); +int OSSL_PARAM_get_int32(const OSSL_PARAM *p, int32_t *val); +int OSSL_PARAM_get_uint32(const OSSL_PARAM *p, uint32_t *val); +int OSSL_PARAM_get_int64(const OSSL_PARAM *p, int64_t *val); +int OSSL_PARAM_get_uint64(const OSSL_PARAM *p, uint64_t *val); +int OSSL_PARAM_get_size_t(const OSSL_PARAM *p, size_t *val); +int OSSL_PARAM_get_time_t(const OSSL_PARAM *p, time_t *val); + +int OSSL_PARAM_set_int(OSSL_PARAM *p, int val); +int OSSL_PARAM_set_uint(OSSL_PARAM *p, unsigned int val); +int OSSL_PARAM_set_long(OSSL_PARAM *p, long int val); +int OSSL_PARAM_set_ulong(OSSL_PARAM *p, unsigned long int val); +int OSSL_PARAM_set_int32(OSSL_PARAM *p, int32_t val); +int OSSL_PARAM_set_uint32(OSSL_PARAM *p, uint32_t val); +int OSSL_PARAM_set_int64(OSSL_PARAM *p, int64_t val); +int OSSL_PARAM_set_uint64(OSSL_PARAM *p, uint64_t val); +int OSSL_PARAM_set_size_t(OSSL_PARAM *p, size_t val); +int OSSL_PARAM_set_time_t(OSSL_PARAM *p, time_t val); + +int OSSL_PARAM_get_double(const OSSL_PARAM *p, double *val); +int OSSL_PARAM_set_double(OSSL_PARAM *p, double val); + +int OSSL_PARAM_get_BN(const OSSL_PARAM *p, BIGNUM **val); +int OSSL_PARAM_set_BN(OSSL_PARAM *p, const BIGNUM *val); + +int OSSL_PARAM_get_utf8_string(const OSSL_PARAM *p, char **val, size_t max_len); +int OSSL_PARAM_set_utf8_string(OSSL_PARAM *p, const char *val); + +int OSSL_PARAM_get_octet_string(const OSSL_PARAM *p, void **val, size_t max_len, + size_t *used_len); +int OSSL_PARAM_set_octet_string(OSSL_PARAM *p, const void *val, size_t len); + +int OSSL_PARAM_get_utf8_ptr(const OSSL_PARAM *p, const char **val); +int OSSL_PARAM_set_utf8_ptr(OSSL_PARAM *p, const char *val); + +int OSSL_PARAM_get_octet_ptr(const OSSL_PARAM *p, const void **val, + size_t *used_len); +int OSSL_PARAM_set_octet_ptr(OSSL_PARAM *p, const void *val, + size_t used_len); + +int OSSL_PARAM_get_utf8_string_ptr(const OSSL_PARAM *p, const char **val); +int OSSL_PARAM_get_octet_string_ptr(const OSSL_PARAM *p, const void **val, + size_t *used_len); + +int OSSL_PARAM_modified(const OSSL_PARAM *p); +void OSSL_PARAM_set_all_unmodified(OSSL_PARAM *p); + +OSSL_PARAM *OSSL_PARAM_dup(const OSSL_PARAM *p); +OSSL_PARAM *OSSL_PARAM_merge(const OSSL_PARAM *p1, const OSSL_PARAM *p2); +void OSSL_PARAM_free(OSSL_PARAM *p); + +int OSSL_PARAM_set_octet_string_or_ptr(OSSL_PARAM *p, const void *val, + size_t len); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/pem.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/pem.h new file mode 100644 index 0000000000000000000000000000000000000000..fa64aaf4ca27fa4a0c204dcf2590d7ba6dc55b3a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/pem.h @@ -0,0 +1,548 @@ +/* + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_PEM_H +#define OPENSSL_PEM_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_PEM_H +#endif + +#include +#include +#include +#include +#include +#include +#ifndef OPENSSL_NO_STDIO +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define PEM_BUFSIZE 1024 + +#define PEM_STRING_X509_OLD "X509 CERTIFICATE" +#define PEM_STRING_X509 "CERTIFICATE" +#define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE" +#define PEM_STRING_X509_REQ_OLD "NEW CERTIFICATE REQUEST" +#define PEM_STRING_X509_REQ "CERTIFICATE REQUEST" +#define PEM_STRING_X509_CRL "X509 CRL" +#define PEM_STRING_EVP_PKEY "ANY PRIVATE KEY" +#define PEM_STRING_PUBLIC "PUBLIC KEY" +#define PEM_STRING_RSA "RSA PRIVATE KEY" +#define PEM_STRING_RSA_PUBLIC "RSA PUBLIC KEY" +#define PEM_STRING_DSA "DSA PRIVATE KEY" +#define PEM_STRING_DSA_PUBLIC "DSA PUBLIC KEY" +#define PEM_STRING_PKCS7 "PKCS7" +#define PEM_STRING_PKCS7_SIGNED "PKCS #7 SIGNED DATA" +#define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY" +#define PEM_STRING_PKCS8INF "PRIVATE KEY" +#define PEM_STRING_DHPARAMS "DH PARAMETERS" +#define PEM_STRING_DHXPARAMS "X9.42 DH PARAMETERS" +#define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS" +#define PEM_STRING_DSAPARAMS "DSA PARAMETERS" +#define PEM_STRING_ECDSA_PUBLIC "ECDSA PUBLIC KEY" +#define PEM_STRING_ECPARAMETERS "EC PARAMETERS" +#define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY" +#define PEM_STRING_PARAMETERS "PARAMETERS" +#define PEM_STRING_CMS "CMS" +#define PEM_STRING_SM2PRIVATEKEY "SM2 PRIVATE KEY" +#define PEM_STRING_SM2PARAMETERS "SM2 PARAMETERS" +#define PEM_STRING_ACERT "ATTRIBUTE CERTIFICATE" + +#define PEM_TYPE_ENCRYPTED 10 +#define PEM_TYPE_MIC_ONLY 20 +#define PEM_TYPE_MIC_CLEAR 30 +#define PEM_TYPE_CLEAR 40 + +/* + * These macros make the PEM_read/PEM_write functions easier to maintain and + * write. Now they are all implemented with either: IMPLEMENT_PEM_rw(...) or + * IMPLEMENT_PEM_rw_cb(...) + */ + +#define PEM_read_cb_fnsig(name, type, INTYPE, readname) \ + type *PEM_##readname##_##name(INTYPE *out, type **x, \ + pem_password_cb *cb, void *u) +#define PEM_read_cb_ex_fnsig(name, type, INTYPE, readname) \ + type *PEM_##readname##_##name##_ex(INTYPE *out, type **x, \ + pem_password_cb *cb, void *u, \ + OSSL_LIB_CTX *libctx, \ + const char *propq) + +#define PEM_write_fnsig(name, type, OUTTYPE, writename) \ + int PEM_##writename##_##name(OUTTYPE *out, const type *x) +#define PEM_write_cb_fnsig(name, type, OUTTYPE, writename) \ + int PEM_##writename##_##name(OUTTYPE *out, const type *x, \ + const EVP_CIPHER *enc, \ + const unsigned char *kstr, int klen, \ + pem_password_cb *cb, void *u) +#define PEM_write_ex_fnsig(name, type, OUTTYPE, writename) \ + int PEM_##writename##_##name##_ex(OUTTYPE *out, const type *x, \ + OSSL_LIB_CTX *libctx, \ + const char *propq) +#define PEM_write_cb_ex_fnsig(name, type, OUTTYPE, writename) \ + int PEM_##writename##_##name##_ex(OUTTYPE *out, const type *x, \ + const EVP_CIPHER *enc, \ + const unsigned char *kstr, int klen, \ + pem_password_cb *cb, void *u, \ + OSSL_LIB_CTX *libctx, \ + const char *propq) + +#ifdef OPENSSL_NO_STDIO + +#define IMPLEMENT_PEM_read_fp(name, type, str, asn1) /**/ +#define IMPLEMENT_PEM_write_fp(name, type, str, asn1) /**/ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) /**/ +#endif +#define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) /**/ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) /**/ +#endif +#else + +#define IMPLEMENT_PEM_read_fp(name, type, str, asn1) \ + type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u) \ + { \ + return PEM_ASN1_read((d2i_of_void *)d2i_##asn1, str, fp, \ + (void **)x, cb, u); \ + } + +#define IMPLEMENT_PEM_write_fp(name, type, str, asn1) \ + PEM_write_fnsig(name, type, FILE, write) \ + { \ + return PEM_ASN1_write((i2d_of_void *)i2d_##asn1, str, out, \ + x, NULL, NULL, 0, NULL, NULL); \ + } + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_fp(name, type, str, asn1) +#endif + +#define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \ + PEM_write_cb_fnsig(name, type, FILE, write) \ + { \ + return PEM_ASN1_write((i2d_of_void *)i2d_##asn1, str, out, \ + x, enc, kstr, klen, cb, u); \ + } + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) +#endif +#endif + +#define IMPLEMENT_PEM_read_bio(name, type, str, asn1) \ + type *PEM_read_bio_##name(BIO *bp, type **x, \ + pem_password_cb *cb, void *u) \ + { \ + return PEM_ASN1_read_bio((d2i_of_void *)d2i_##asn1, str, bp, \ + (void **)x, cb, u); \ + } + +#define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \ + PEM_write_fnsig(name, type, BIO, write_bio) \ + { \ + return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1, str, out, \ + x, NULL, NULL, 0, NULL, NULL); \ + } + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_bio(name, type, str, asn1) +#endif + +#define IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \ + PEM_write_cb_fnsig(name, type, BIO, write_bio) \ + { \ + return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1, str, out, \ + x, enc, kstr, klen, cb, u); \ + } + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) +#endif + +#define IMPLEMENT_PEM_write(name, type, str, asn1) \ + IMPLEMENT_PEM_write_bio(name, type, str, asn1) \ + IMPLEMENT_PEM_write_fp(name, type, str, asn1) + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define IMPLEMENT_PEM_write_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) +#endif + +#define IMPLEMENT_PEM_write_cb(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define IMPLEMENT_PEM_write_cb_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) +#endif + +#define IMPLEMENT_PEM_read(name, type, str, asn1) \ + IMPLEMENT_PEM_read_bio(name, type, str, asn1) \ + IMPLEMENT_PEM_read_fp(name, type, str, asn1) + +#define IMPLEMENT_PEM_rw(name, type, str, asn1) \ + IMPLEMENT_PEM_read(name, type, str, asn1) \ + IMPLEMENT_PEM_write(name, type, str, asn1) + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define IMPLEMENT_PEM_rw_const(name, type, str, asn1) \ + IMPLEMENT_PEM_read(name, type, str, asn1) \ + IMPLEMENT_PEM_write_const(name, type, str, asn1) +#endif + +#define IMPLEMENT_PEM_rw_cb(name, type, str, asn1) \ + IMPLEMENT_PEM_read(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb(name, type, str, asn1) + +/* These are the same except they are for the declarations */ + +/* + * The mysterious 'extern' that's passed to some macros is innocuous, + * and is there to quiet pre-C99 compilers that may complain about empty + * arguments in macro calls. + */ +#if defined(OPENSSL_NO_STDIO) + +#define DECLARE_PEM_read_fp_attr(attr, name, type) /**/ +#define DECLARE_PEM_read_fp_ex_attr(attr, name, type) /**/ +#define DECLARE_PEM_write_fp_attr(attr, name, type) /**/ +#define DECLARE_PEM_write_fp_ex_attr(attr, name, type) /**/ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define DECLARE_PEM_write_fp_const_attr(attr, name, type) /**/ +#endif +#define DECLARE_PEM_write_cb_fp_attr(attr, name, type) /**/ +#define DECLARE_PEM_write_cb_fp_ex_attr(attr, name, type) /**/ + +#else + +#define DECLARE_PEM_read_fp_attr(attr, name, type) \ + attr PEM_read_cb_fnsig(name, type, FILE, read); +#define DECLARE_PEM_read_fp_ex_attr(attr, name, type) \ + attr PEM_read_cb_fnsig(name, type, FILE, read); \ + attr PEM_read_cb_ex_fnsig(name, type, FILE, read); + +#define DECLARE_PEM_write_fp_attr(attr, name, type) \ + attr PEM_write_fnsig(name, type, FILE, write); +#define DECLARE_PEM_write_fp_ex_attr(attr, name, type) \ + attr PEM_write_fnsig(name, type, FILE, write); \ + attr PEM_write_ex_fnsig(name, type, FILE, write); +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define DECLARE_PEM_write_fp_const_attr(attr, name, type) \ + attr PEM_write_fnsig(name, type, FILE, write); +#endif +#define DECLARE_PEM_write_cb_fp_attr(attr, name, type) \ + attr PEM_write_cb_fnsig(name, type, FILE, write); +#define DECLARE_PEM_write_cb_fp_ex_attr(attr, name, type) \ + attr PEM_write_cb_fnsig(name, type, FILE, write); \ + attr PEM_write_cb_ex_fnsig(name, type, FILE, write); + +#endif + +#define DECLARE_PEM_read_fp(name, type) \ + DECLARE_PEM_read_fp_attr(extern, name, type) +#define DECLARE_PEM_write_fp(name, type) \ + DECLARE_PEM_write_fp_attr(extern, name, type) +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define DECLARE_PEM_write_fp_const(name, type) \ + DECLARE_PEM_write_fp_const_attr(extern, name, type) +#endif +#define DECLARE_PEM_write_cb_fp(name, type) \ + DECLARE_PEM_write_cb_fp_attr(extern, name, type) + +#define DECLARE_PEM_read_bio_attr(attr, name, type) \ + attr PEM_read_cb_fnsig(name, type, BIO, read_bio); +#define DECLARE_PEM_read_bio_ex_attr(attr, name, type) \ + attr PEM_read_cb_fnsig(name, type, BIO, read_bio); \ + attr PEM_read_cb_ex_fnsig(name, type, BIO, read_bio); +#define DECLARE_PEM_read_bio(name, type) \ + DECLARE_PEM_read_bio_attr(extern, name, type) +#define DECLARE_PEM_read_bio_ex(name, type) \ + DECLARE_PEM_read_bio_ex_attr(extern, name, type) + +#define DECLARE_PEM_write_bio_attr(attr, name, type) \ + attr PEM_write_fnsig(name, type, BIO, write_bio); +#define DECLARE_PEM_write_bio_ex_attr(attr, name, type) \ + attr PEM_write_fnsig(name, type, BIO, write_bio); \ + attr PEM_write_ex_fnsig(name, type, BIO, write_bio); +#define DECLARE_PEM_write_bio(name, type) \ + DECLARE_PEM_write_bio_attr(extern, name, type) +#define DECLARE_PEM_write_bio_ex(name, type) \ + DECLARE_PEM_write_bio_ex_attr(extern, name, type) + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define DECLARE_PEM_write_bio_const_attr(attr, name, type) \ + attr PEM_write_fnsig(name, type, BIO, write_bio); +#define DECLARE_PEM_write_bio_const(name, type) \ + DECLARE_PEM_write_bio_const_attr(extern, name, type) +#endif + +#define DECLARE_PEM_write_cb_bio_attr(attr, name, type) \ + attr PEM_write_cb_fnsig(name, type, BIO, write_bio); +#define DECLARE_PEM_write_cb_bio_ex_attr(attr, name, type) \ + attr PEM_write_cb_fnsig(name, type, BIO, write_bio); \ + attr PEM_write_cb_ex_fnsig(name, type, BIO, write_bio); +#define DECLARE_PEM_write_cb_bio(name, type) \ + DECLARE_PEM_write_cb_bio_attr(extern, name, type) +#define DECLARE_PEM_write_cb_ex_bio(name, type) \ + DECLARE_PEM_write_cb_bio_ex_attr(extern, name, type) + +#define DECLARE_PEM_write_attr(attr, name, type) \ + DECLARE_PEM_write_bio_attr(attr, name, type) \ + DECLARE_PEM_write_fp_attr(attr, name, type) +#define DECLARE_PEM_write_ex_attr(attr, name, type) \ + DECLARE_PEM_write_bio_ex_attr(attr, name, type) \ + DECLARE_PEM_write_fp_ex_attr(attr, name, type) +#define DECLARE_PEM_write(name, type) \ + DECLARE_PEM_write_attr(extern, name, type) +#define DECLARE_PEM_write_ex(name, type) \ + DECLARE_PEM_write_ex_attr(extern, name, type) +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define DECLARE_PEM_write_const_attr(attr, name, type) \ + DECLARE_PEM_write_bio_const_attr(attr, name, type) \ + DECLARE_PEM_write_fp_const_attr(attr, name, type) +#define DECLARE_PEM_write_const(name, type) \ + DECLARE_PEM_write_const_attr(extern, name, type) +#endif +#define DECLARE_PEM_write_cb_attr(attr, name, type) \ + DECLARE_PEM_write_cb_bio_attr(attr, name, type) \ + DECLARE_PEM_write_cb_fp_attr(attr, name, type) +#define DECLARE_PEM_write_cb_ex_attr(attr, name, type) \ + DECLARE_PEM_write_cb_bio_ex_attr(attr, name, type) \ + DECLARE_PEM_write_cb_fp_ex_attr(attr, name, type) +#define DECLARE_PEM_write_cb(name, type) \ + DECLARE_PEM_write_cb_attr(extern, name, type) +#define DECLARE_PEM_write_cb_ex(name, type) \ + DECLARE_PEM_write_cb_ex_attr(extern, name, type) +#define DECLARE_PEM_read_attr(attr, name, type) \ + DECLARE_PEM_read_bio_attr(attr, name, type) \ + DECLARE_PEM_read_fp_attr(attr, name, type) +#define DECLARE_PEM_read_ex_attr(attr, name, type) \ + DECLARE_PEM_read_bio_ex_attr(attr, name, type) \ + DECLARE_PEM_read_fp_ex_attr(attr, name, type) +#define DECLARE_PEM_read(name, type) \ + DECLARE_PEM_read_attr(extern, name, type) +#define DECLARE_PEM_read_ex(name, type) \ + DECLARE_PEM_read_ex_attr(extern, name, type) +#define DECLARE_PEM_rw_attr(attr, name, type) \ + DECLARE_PEM_read_attr(attr, name, type) \ + DECLARE_PEM_write_attr(attr, name, type) +#define DECLARE_PEM_rw_ex_attr(attr, name, type) \ + DECLARE_PEM_read_ex_attr(attr, name, type) \ + DECLARE_PEM_write_ex_attr(attr, name, type) +#define DECLARE_PEM_rw(name, type) \ + DECLARE_PEM_rw_attr(extern, name, type) +#define DECLARE_PEM_rw_ex(name, type) \ + DECLARE_PEM_rw_ex_attr(extern, name, type) +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define DECLARE_PEM_rw_const_attr(attr, name, type) \ + DECLARE_PEM_read_attr(attr, name, type) \ + DECLARE_PEM_write_const_attr(attr, name, type) +#define DECLARE_PEM_rw_const(name, type) \ + DECLARE_PEM_rw_const_attr(extern, name, type) +#endif +#define DECLARE_PEM_rw_cb_attr(attr, name, type) \ + DECLARE_PEM_read_attr(attr, name, type) \ + DECLARE_PEM_write_cb_attr(attr, name, type) +#define DECLARE_PEM_rw_cb_ex_attr(attr, name, type) \ + DECLARE_PEM_read_ex_attr(attr, name, type) \ + DECLARE_PEM_write_cb_ex_attr(attr, name, type) +#define DECLARE_PEM_rw_cb(name, type) \ + DECLARE_PEM_rw_cb_attr(extern, name, type) +#define DECLARE_PEM_rw_cb_ex(name, type) \ + DECLARE_PEM_rw_cb_ex_attr(extern, name, type) + +int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher); +int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *len, + pem_password_cb *callback, void *u); + +int PEM_read_bio(BIO *bp, char **name, char **header, + unsigned char **data, long *len); +#define PEM_FLAG_SECURE 0x1 +#define PEM_FLAG_EAY_COMPATIBLE 0x2 +#define PEM_FLAG_ONLY_B64 0x4 +int PEM_read_bio_ex(BIO *bp, char **name, char **header, + unsigned char **data, long *len, unsigned int flags); +int PEM_bytes_read_bio_secmem(unsigned char **pdata, long *plen, char **pnm, + const char *name, BIO *bp, pem_password_cb *cb, + void *u); +int PEM_write_bio(BIO *bp, const char *name, const char *hdr, + const unsigned char *data, long len); +int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm, + const char *name, BIO *bp, pem_password_cb *cb, + void *u); +void *PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, void **x, + pem_password_cb *cb, void *u); +int PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp, + const void *x, const EVP_CIPHER *enc, + const unsigned char *kstr, int klen, + pem_password_cb *cb, void *u); +int PEM_ASN1_write_bio_ctx(OSSL_i2d_of_void_ctx *i2d, void *vctx, + const char *name, BIO *bp, const void *x, + const EVP_CIPHER *enc, const unsigned char *kstr, + int klen, pem_password_cb *cb, void *u); + +STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, + pem_password_cb *cb, void *u); +STACK_OF(X509_INFO) +*PEM_X509_INFO_read_bio_ex(BIO *bp, STACK_OF(X509_INFO) *sk, + pem_password_cb *cb, void *u, OSSL_LIB_CTX *libctx, + const char *propq); + +int PEM_X509_INFO_write_bio(BIO *bp, const X509_INFO *xi, EVP_CIPHER *enc, + const unsigned char *kstr, int klen, + pem_password_cb *cd, void *u); + +#ifndef OPENSSL_NO_STDIO +int PEM_read(FILE *fp, char **name, char **header, + unsigned char **data, long *len); +int PEM_write(FILE *fp, const char *name, const char *hdr, + const unsigned char *data, long len); +void *PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x, + pem_password_cb *cb, void *u); +int PEM_ASN1_write(i2d_of_void *i2d, const char *name, FILE *fp, + const void *x, const EVP_CIPHER *enc, + const unsigned char *kstr, int klen, + pem_password_cb *callback, void *u); +STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, + pem_password_cb *cb, void *u); +STACK_OF(X509_INFO) +*PEM_X509_INFO_read_ex(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, + void *u, OSSL_LIB_CTX *libctx, const char *propq); +#endif + +int PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type); +int PEM_SignUpdate(EVP_MD_CTX *ctx, const unsigned char *d, unsigned int cnt); +int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, + unsigned int *siglen, EVP_PKEY *pkey); + +/* The default pem_password_cb that's used internally */ +int PEM_def_callback(char *buf, int num, int rwflag, void *userdata); +void PEM_proc_type(char *buf, int type); +void PEM_dek_info(char *buf, const char *type, int len, const char *str); + +#include + +DECLARE_PEM_rw(X509, X509) +DECLARE_PEM_rw(X509_AUX, X509) +DECLARE_PEM_rw(X509_REQ, X509_REQ) +DECLARE_PEM_write(X509_REQ_NEW, X509_REQ) +DECLARE_PEM_rw(X509_CRL, X509_CRL) +DECLARE_PEM_rw(X509_PUBKEY, X509_PUBKEY) +DECLARE_PEM_rw(PKCS7, PKCS7) +DECLARE_PEM_rw(NETSCAPE_CERT_SEQUENCE, NETSCAPE_CERT_SEQUENCE) +DECLARE_PEM_rw(PKCS8, X509_SIG) +DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO) +#ifndef OPENSSL_NO_DEPRECATED_3_0 +DECLARE_PEM_rw_cb_attr(OSSL_DEPRECATEDIN_3_0, RSAPrivateKey, RSA) +DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, RSAPublicKey, RSA) +DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, RSA_PUBKEY, RSA) +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#ifndef OPENSSL_NO_DSA +DECLARE_PEM_rw_cb_attr(OSSL_DEPRECATEDIN_3_0, DSAPrivateKey, DSA) +DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, DSA_PUBKEY, DSA) +DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, DSAparams, DSA) +#endif +#endif + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#ifndef OPENSSL_NO_EC +DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, ECPKParameters, EC_GROUP) +DECLARE_PEM_rw_cb_attr(OSSL_DEPRECATEDIN_3_0, ECPrivateKey, EC_KEY) +DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, EC_PUBKEY, EC_KEY) +#endif +#endif + +#ifndef OPENSSL_NO_DH +#ifndef OPENSSL_NO_DEPRECATED_3_0 +DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, DHparams, DH) +DECLARE_PEM_write_attr(OSSL_DEPRECATEDIN_3_0, DHxparams, DH) +#endif +#endif +DECLARE_PEM_rw_cb_ex(PrivateKey, EVP_PKEY) +DECLARE_PEM_rw_ex(PUBKEY, EVP_PKEY) + +int PEM_write_bio_PrivateKey_traditional(BIO *bp, const EVP_PKEY *x, + const EVP_CIPHER *enc, + const unsigned char *kstr, int klen, + pem_password_cb *cb, void *u); + +/* Why do these take a signed char *kstr? */ +int PEM_write_bio_PKCS8PrivateKey_nid(BIO *bp, const EVP_PKEY *x, int nid, + const char *kstr, int klen, + pem_password_cb *cb, void *u); +int PEM_write_bio_PKCS8PrivateKey(BIO *, const EVP_PKEY *, const EVP_CIPHER *, + const char *kstr, int klen, + pem_password_cb *cb, void *u); +int i2d_PKCS8PrivateKey_bio(BIO *bp, const EVP_PKEY *x, const EVP_CIPHER *enc, + const char *kstr, int klen, + pem_password_cb *cb, void *u); +int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, const EVP_PKEY *x, int nid, + const char *kstr, int klen, + pem_password_cb *cb, void *u); +EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, + void *u); + +#ifndef OPENSSL_NO_STDIO +int i2d_PKCS8PrivateKey_fp(FILE *fp, const EVP_PKEY *x, const EVP_CIPHER *enc, + const char *kstr, int klen, + pem_password_cb *cb, void *u); +int i2d_PKCS8PrivateKey_nid_fp(FILE *fp, const EVP_PKEY *x, int nid, + const char *kstr, int klen, + pem_password_cb *cb, void *u); +int PEM_write_PKCS8PrivateKey_nid(FILE *fp, const EVP_PKEY *x, int nid, + const char *kstr, int klen, + pem_password_cb *cb, void *u); + +EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, + void *u); + +int PEM_write_PKCS8PrivateKey(FILE *fp, const EVP_PKEY *x, const EVP_CIPHER *enc, + const char *kstr, int klen, + pem_password_cb *cd, void *u); +#endif +EVP_PKEY *PEM_read_bio_Parameters_ex(BIO *bp, EVP_PKEY **x, + OSSL_LIB_CTX *libctx, const char *propq); +EVP_PKEY *PEM_read_bio_Parameters(BIO *bp, EVP_PKEY **x); +int PEM_write_bio_Parameters(BIO *bp, const EVP_PKEY *x); + +EVP_PKEY *b2i_PrivateKey(const unsigned char **in, long length); +EVP_PKEY *b2i_PublicKey(const unsigned char **in, long length); +EVP_PKEY *b2i_PrivateKey_bio(BIO *in); +EVP_PKEY *b2i_PublicKey_bio(BIO *in); +int i2b_PrivateKey_bio(BIO *out, const EVP_PKEY *pk); +int i2b_PublicKey_bio(BIO *out, const EVP_PKEY *pk); +EVP_PKEY *b2i_PVK_bio(BIO *in, pem_password_cb *cb, void *u); +EVP_PKEY *b2i_PVK_bio_ex(BIO *in, pem_password_cb *cb, void *u, + OSSL_LIB_CTX *libctx, const char *propq); +int i2b_PVK_bio(BIO *out, const EVP_PKEY *pk, int enclevel, + pem_password_cb *cb, void *u); +int i2b_PVK_bio_ex(BIO *out, const EVP_PKEY *pk, int enclevel, + pem_password_cb *cb, void *u, + OSSL_LIB_CTX *libctx, const char *propq); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/pem2.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/pem2.h new file mode 100644 index 0000000000000000000000000000000000000000..6d3ab2abf8893daea273df3dce2c0675c5469615 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/pem2.h @@ -0,0 +1,19 @@ +/* + * Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_PEM2_H +#define OPENSSL_PEM2_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_PEM2_H +#endif +#include +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/pemerr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/pemerr.h new file mode 100644 index 0000000000000000000000000000000000000000..eb3c9a1d94fa19ac594524e29771dfecbbfe6964 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/pemerr.h @@ -0,0 +1,57 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_PEMERR_H +#define OPENSSL_PEMERR_H +#pragma once + +#include +#include +#include + +/* + * PEM reason codes. + */ +#define PEM_R_BAD_BASE64_DECODE 100 +#define PEM_R_BAD_DECRYPT 101 +#define PEM_R_BAD_END_LINE 102 +#define PEM_R_BAD_IV_CHARS 103 +#define PEM_R_BAD_MAGIC_NUMBER 116 +#define PEM_R_BAD_PASSWORD_READ 104 +#define PEM_R_BAD_VERSION_NUMBER 117 +#define PEM_R_BIO_WRITE_FAILURE 118 +#define PEM_R_CIPHER_IS_NULL 127 +#define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 115 +#define PEM_R_EXPECTING_DSS_KEY_BLOB 131 +#define PEM_R_EXPECTING_PRIVATE_KEY_BLOB 119 +#define PEM_R_EXPECTING_PUBLIC_KEY_BLOB 120 +#define PEM_R_EXPECTING_RSA_KEY_BLOB 132 +#define PEM_R_HEADER_TOO_LONG 128 +#define PEM_R_INCONSISTENT_HEADER 121 +#define PEM_R_KEYBLOB_HEADER_PARSE_ERROR 122 +#define PEM_R_KEYBLOB_TOO_SHORT 123 +#define PEM_R_MISSING_DEK_IV 129 +#define PEM_R_NOT_DEK_INFO 105 +#define PEM_R_NOT_ENCRYPTED 106 +#define PEM_R_NOT_PROC_TYPE 107 +#define PEM_R_NO_START_LINE 108 +#define PEM_R_PROBLEMS_GETTING_PASSWORD 109 +#define PEM_R_PVK_DATA_TOO_SHORT 124 +#define PEM_R_PVK_TOO_SHORT 125 +#define PEM_R_READ_KEY 111 +#define PEM_R_SHORT_HEADER 112 +#define PEM_R_UNEXPECTED_DEK_IV 130 +#define PEM_R_UNSUPPORTED_CIPHER 113 +#define PEM_R_UNSUPPORTED_ENCRYPTION 114 +#define PEM_R_UNSUPPORTED_KEY_COMPONENTS 126 +#define PEM_R_UNSUPPORTED_PUBLIC_KEY_TYPE 110 +#define PEM_R_UNSUPPORTED_PVK_KEY_TYPE 133 + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/pkcs12.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/pkcs12.h new file mode 100644 index 0000000000000000000000000000000000000000..d26e73b9b57a82686b149b21a5aa6751214a7947 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/pkcs12.h @@ -0,0 +1,376 @@ +/* + * WARNING: do not edit! + * Generated by makefile from include\openssl\pkcs12.h.in + * + * Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* clang-format off */ + +/* clang-format on */ + +#ifndef OPENSSL_PKCS12_H +#define OPENSSL_PKCS12_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_PKCS12_H +#endif + +#include +#include +#include +#include +#ifndef OPENSSL_NO_STDIO +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define PKCS12_KEY_ID 1 +#define PKCS12_IV_ID 2 +#define PKCS12_MAC_ID 3 + +/* Default iteration count */ +#ifndef PKCS12_DEFAULT_ITER +#define PKCS12_DEFAULT_ITER PKCS5_DEFAULT_ITER +#endif + +#define PKCS12_MAC_KEY_LENGTH 20 + +/* + * The macro is expected to be used only internally. Kept for + * backwards compatibility. NIST requires 16, previous value was + * 8. Allow to override this at compile time. + */ +#ifndef PKCS12_SALT_LEN +#define PKCS12_SALT_LEN 16 +#endif + +/* It's not clear if these are actually needed... */ +#define PKCS12_key_gen PKCS12_key_gen_utf8 +#define PKCS12_add_friendlyname PKCS12_add_friendlyname_utf8 + +/* MS key usage constants */ + +#define KEY_EX 0x10 +#define KEY_SIG 0x80 + +typedef struct PKCS12_MAC_DATA_st PKCS12_MAC_DATA; + +typedef struct PKCS12_st PKCS12; + +typedef struct PKCS12_SAFEBAG_st PKCS12_SAFEBAG; + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(PKCS12_SAFEBAG, PKCS12_SAFEBAG, PKCS12_SAFEBAG) +#define sk_PKCS12_SAFEBAG_num(sk) OPENSSL_sk_num(ossl_check_const_PKCS12_SAFEBAG_sk_type(sk)) +#define sk_PKCS12_SAFEBAG_value(sk, idx) ((PKCS12_SAFEBAG *)OPENSSL_sk_value(ossl_check_const_PKCS12_SAFEBAG_sk_type(sk), (idx))) +#define sk_PKCS12_SAFEBAG_new(cmp) ((STACK_OF(PKCS12_SAFEBAG) *)OPENSSL_sk_new(ossl_check_PKCS12_SAFEBAG_compfunc_type(cmp))) +#define sk_PKCS12_SAFEBAG_new_null() ((STACK_OF(PKCS12_SAFEBAG) *)OPENSSL_sk_new_null()) +#define sk_PKCS12_SAFEBAG_new_reserve(cmp, n) ((STACK_OF(PKCS12_SAFEBAG) *)OPENSSL_sk_new_reserve(ossl_check_PKCS12_SAFEBAG_compfunc_type(cmp), (n))) +#define sk_PKCS12_SAFEBAG_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_PKCS12_SAFEBAG_sk_type(sk), (n)) +#define sk_PKCS12_SAFEBAG_free(sk) OPENSSL_sk_free(ossl_check_PKCS12_SAFEBAG_sk_type(sk)) +#define sk_PKCS12_SAFEBAG_zero(sk) OPENSSL_sk_zero(ossl_check_PKCS12_SAFEBAG_sk_type(sk)) +#define sk_PKCS12_SAFEBAG_delete(sk, i) ((PKCS12_SAFEBAG *)OPENSSL_sk_delete(ossl_check_PKCS12_SAFEBAG_sk_type(sk), (i))) +#define sk_PKCS12_SAFEBAG_delete_ptr(sk, ptr) ((PKCS12_SAFEBAG *)OPENSSL_sk_delete_ptr(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr))) +#define sk_PKCS12_SAFEBAG_push(sk, ptr) OPENSSL_sk_push(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr)) +#define sk_PKCS12_SAFEBAG_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr)) +#define sk_PKCS12_SAFEBAG_pop(sk) ((PKCS12_SAFEBAG *)OPENSSL_sk_pop(ossl_check_PKCS12_SAFEBAG_sk_type(sk))) +#define sk_PKCS12_SAFEBAG_shift(sk) ((PKCS12_SAFEBAG *)OPENSSL_sk_shift(ossl_check_PKCS12_SAFEBAG_sk_type(sk))) +#define sk_PKCS12_SAFEBAG_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_freefunc_type(freefunc)) +#define sk_PKCS12_SAFEBAG_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr), (idx)) +#define sk_PKCS12_SAFEBAG_set(sk, idx, ptr) ((PKCS12_SAFEBAG *)OPENSSL_sk_set(ossl_check_PKCS12_SAFEBAG_sk_type(sk), (idx), ossl_check_PKCS12_SAFEBAG_type(ptr))) +#define sk_PKCS12_SAFEBAG_find(sk, ptr) OPENSSL_sk_find(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr)) +#define sk_PKCS12_SAFEBAG_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr)) +#define sk_PKCS12_SAFEBAG_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_type(ptr), pnum) +#define sk_PKCS12_SAFEBAG_sort(sk) OPENSSL_sk_sort(ossl_check_PKCS12_SAFEBAG_sk_type(sk)) +#define sk_PKCS12_SAFEBAG_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_PKCS12_SAFEBAG_sk_type(sk)) +#define sk_PKCS12_SAFEBAG_dup(sk) ((STACK_OF(PKCS12_SAFEBAG) *)OPENSSL_sk_dup(ossl_check_const_PKCS12_SAFEBAG_sk_type(sk))) +#define sk_PKCS12_SAFEBAG_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(PKCS12_SAFEBAG) *)OPENSSL_sk_deep_copy(ossl_check_const_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_copyfunc_type(copyfunc), ossl_check_PKCS12_SAFEBAG_freefunc_type(freefunc))) +#define sk_PKCS12_SAFEBAG_set_cmp_func(sk, cmp) ((sk_PKCS12_SAFEBAG_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_PKCS12_SAFEBAG_sk_type(sk), ossl_check_PKCS12_SAFEBAG_compfunc_type(cmp))) + +/* clang-format on */ + +typedef struct pkcs12_bag_st PKCS12_BAGS; + +#define PKCS12_ERROR 0 +#define PKCS12_OK 1 + +/* Compatibility macros */ + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 + +#define M_PKCS12_bag_type PKCS12_bag_type +#define M_PKCS12_cert_bag_type PKCS12_cert_bag_type +#define M_PKCS12_crl_bag_type PKCS12_cert_bag_type + +#define PKCS12_certbag2x509 PKCS12_SAFEBAG_get1_cert +#define PKCS12_certbag2scrl PKCS12_SAFEBAG_get1_crl +#define PKCS12_bag_type PKCS12_SAFEBAG_get_nid +#define PKCS12_cert_bag_type PKCS12_SAFEBAG_get_bag_nid +#define PKCS12_x5092certbag PKCS12_SAFEBAG_create_cert +#define PKCS12_x509crl2certbag PKCS12_SAFEBAG_create_crl +#define PKCS12_MAKE_KEYBAG PKCS12_SAFEBAG_create0_p8inf +#define PKCS12_MAKE_SHKEYBAG PKCS12_SAFEBAG_create_pkcs8_encrypt + +#endif +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +OSSL_DEPRECATEDIN_1_1_0 ASN1_TYPE *PKCS12_get_attr(const PKCS12_SAFEBAG *bag, + int attr_nid); +#endif + +ASN1_TYPE *PKCS8_get_attr(PKCS8_PRIV_KEY_INFO *p8, int attr_nid); +int PKCS12_mac_present(const PKCS12 *p12); +void PKCS12_get0_mac(const ASN1_OCTET_STRING **pmac, + const X509_ALGOR **pmacalg, + const ASN1_OCTET_STRING **psalt, + const ASN1_INTEGER **piter, + const PKCS12 *p12); + +const ASN1_TYPE *PKCS12_SAFEBAG_get0_attr(const PKCS12_SAFEBAG *bag, + int attr_nid); +const ASN1_OBJECT *PKCS12_SAFEBAG_get0_type(const PKCS12_SAFEBAG *bag); +int PKCS12_SAFEBAG_get_nid(const PKCS12_SAFEBAG *bag); +int PKCS12_SAFEBAG_get_bag_nid(const PKCS12_SAFEBAG *bag); +const ASN1_TYPE *PKCS12_SAFEBAG_get0_bag_obj(const PKCS12_SAFEBAG *bag); +const ASN1_OBJECT *PKCS12_SAFEBAG_get0_bag_type(const PKCS12_SAFEBAG *bag); + +X509 *PKCS12_SAFEBAG_get1_cert_ex(const PKCS12_SAFEBAG *bag, OSSL_LIB_CTX *libctx, const char *propq); +X509 *PKCS12_SAFEBAG_get1_cert(const PKCS12_SAFEBAG *bag); +X509_CRL *PKCS12_SAFEBAG_get1_crl_ex(const PKCS12_SAFEBAG *bag, OSSL_LIB_CTX *libctx, const char *propq); +X509_CRL *PKCS12_SAFEBAG_get1_crl(const PKCS12_SAFEBAG *bag); +const STACK_OF(PKCS12_SAFEBAG) * +PKCS12_SAFEBAG_get0_safes(const PKCS12_SAFEBAG *bag); +const PKCS8_PRIV_KEY_INFO *PKCS12_SAFEBAG_get0_p8inf(const PKCS12_SAFEBAG *bag); +const X509_SIG *PKCS12_SAFEBAG_get0_pkcs8(const PKCS12_SAFEBAG *bag); + +PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_cert(X509 *x509); +PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_crl(X509_CRL *crl); +PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_secret(int type, int vtype, const unsigned char *value, int len); +PKCS12_SAFEBAG *PKCS12_SAFEBAG_create0_p8inf(PKCS8_PRIV_KEY_INFO *p8); +PKCS12_SAFEBAG *PKCS12_SAFEBAG_create0_pkcs8(X509_SIG *p8); +PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_pkcs8_encrypt(int pbe_nid, + const char *pass, + int passlen, + unsigned char *salt, + int saltlen, int iter, + PKCS8_PRIV_KEY_INFO *p8inf); +PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_pkcs8_encrypt_ex(int pbe_nid, + const char *pass, + int passlen, + unsigned char *salt, + int saltlen, int iter, + PKCS8_PRIV_KEY_INFO *p8inf, + OSSL_LIB_CTX *ctx, + const char *propq); + +PKCS12_SAFEBAG *PKCS12_item_pack_safebag(void *obj, const ASN1_ITEM *it, + int nid1, int nid2); +PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(const X509_SIG *p8, const char *pass, + int passlen); +PKCS8_PRIV_KEY_INFO *PKCS8_decrypt_ex(const X509_SIG *p8, const char *pass, + int passlen, OSSL_LIB_CTX *ctx, + const char *propq); +PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey(const PKCS12_SAFEBAG *bag, + const char *pass, int passlen); +PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey_ex(const PKCS12_SAFEBAG *bag, + const char *pass, int passlen, + OSSL_LIB_CTX *ctx, + const char *propq); +X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher, + const char *pass, int passlen, unsigned char *salt, + int saltlen, int iter, PKCS8_PRIV_KEY_INFO *p8); +X509_SIG *PKCS8_encrypt_ex(int pbe_nid, const EVP_CIPHER *cipher, + const char *pass, int passlen, unsigned char *salt, + int saltlen, int iter, PKCS8_PRIV_KEY_INFO *p8, + OSSL_LIB_CTX *ctx, const char *propq); +X509_SIG *PKCS8_set0_pbe(const char *pass, int passlen, + PKCS8_PRIV_KEY_INFO *p8inf, X509_ALGOR *pbe); +X509_SIG *PKCS8_set0_pbe_ex(const char *pass, int passlen, + PKCS8_PRIV_KEY_INFO *p8inf, X509_ALGOR *pbe, + OSSL_LIB_CTX *ctx, const char *propq); +PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk); +STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7data(PKCS7 *p7); +PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen, + unsigned char *salt, int saltlen, int iter, + STACK_OF(PKCS12_SAFEBAG) *bags); +PKCS7 *PKCS12_pack_p7encdata_ex(int pbe_nid, const char *pass, int passlen, + unsigned char *salt, int saltlen, int iter, + STACK_OF(PKCS12_SAFEBAG) *bags, + OSSL_LIB_CTX *ctx, const char *propq); + +STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass, + int passlen); + +int PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes); +STACK_OF(PKCS7) *PKCS12_unpack_authsafes(const PKCS12 *p12); + +int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name, + int namelen); +int PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name, + int namelen); +int PKCS12_add_friendlyname_utf8(PKCS12_SAFEBAG *bag, const char *name, + int namelen); +int PKCS12_add_CSPName_asc(PKCS12_SAFEBAG *bag, const char *name, + int namelen); +int PKCS12_add_friendlyname_uni(PKCS12_SAFEBAG *bag, + const unsigned char *name, int namelen); +int PKCS12_add1_attr_by_NID(PKCS12_SAFEBAG *bag, int nid, int type, + const unsigned char *bytes, int len); +int PKCS12_add1_attr_by_txt(PKCS12_SAFEBAG *bag, const char *attrname, int type, + const unsigned char *bytes, int len); +int PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage); +ASN1_TYPE *PKCS12_get_attr_gen(const STACK_OF(X509_ATTRIBUTE) *attrs, + int attr_nid); +char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag); +const STACK_OF(X509_ATTRIBUTE) * +PKCS12_SAFEBAG_get0_attrs(const PKCS12_SAFEBAG *bag); +void PKCS12_SAFEBAG_set0_attrs(PKCS12_SAFEBAG *bag, STACK_OF(X509_ATTRIBUTE) *attrs); +unsigned char *PKCS12_pbe_crypt(const X509_ALGOR *algor, + const char *pass, int passlen, + const unsigned char *in, int inlen, + unsigned char **data, int *datalen, + int en_de); +unsigned char *PKCS12_pbe_crypt_ex(const X509_ALGOR *algor, + const char *pass, int passlen, + const unsigned char *in, int inlen, + unsigned char **data, int *datalen, + int en_de, OSSL_LIB_CTX *libctx, + const char *propq); +void *PKCS12_item_decrypt_d2i(const X509_ALGOR *algor, const ASN1_ITEM *it, + const char *pass, int passlen, + const ASN1_OCTET_STRING *oct, int zbuf); +void *PKCS12_item_decrypt_d2i_ex(const X509_ALGOR *algor, const ASN1_ITEM *it, + const char *pass, int passlen, + const ASN1_OCTET_STRING *oct, int zbuf, + OSSL_LIB_CTX *libctx, + const char *propq); +ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor, + const ASN1_ITEM *it, + const char *pass, int passlen, + void *obj, int zbuf); +ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt_ex(X509_ALGOR *algor, + const ASN1_ITEM *it, + const char *pass, int passlen, + void *obj, int zbuf, + OSSL_LIB_CTX *ctx, + const char *propq); +PKCS12 *PKCS12_init(int mode); +PKCS12 *PKCS12_init_ex(int mode, OSSL_LIB_CTX *ctx, const char *propq); + +int PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt, + int saltlen, int id, int iter, int n, + unsigned char *out, const EVP_MD *md_type); +int PKCS12_key_gen_asc_ex(const char *pass, int passlen, unsigned char *salt, + int saltlen, int id, int iter, int n, + unsigned char *out, const EVP_MD *md_type, + OSSL_LIB_CTX *ctx, const char *propq); +int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, + int saltlen, int id, int iter, int n, + unsigned char *out, const EVP_MD *md_type); +int PKCS12_key_gen_uni_ex(unsigned char *pass, int passlen, unsigned char *salt, + int saltlen, int id, int iter, int n, + unsigned char *out, const EVP_MD *md_type, + OSSL_LIB_CTX *ctx, const char *propq); +int PKCS12_key_gen_utf8(const char *pass, int passlen, unsigned char *salt, + int saltlen, int id, int iter, int n, + unsigned char *out, const EVP_MD *md_type); +int PKCS12_key_gen_utf8_ex(const char *pass, int passlen, unsigned char *salt, + int saltlen, int id, int iter, int n, + unsigned char *out, const EVP_MD *md_type, + OSSL_LIB_CTX *ctx, const char *propq); + +int PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, + ASN1_TYPE *param, const EVP_CIPHER *cipher, + const EVP_MD *md_type, int en_de); +int PKCS12_PBE_keyivgen_ex(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, + ASN1_TYPE *param, const EVP_CIPHER *cipher, + const EVP_MD *md_type, int en_de, + OSSL_LIB_CTX *libctx, const char *propq); +int PKCS12_gen_mac(PKCS12 *p12, const char *pass, int passlen, + unsigned char *mac, unsigned int *maclen); +int PKCS12_verify_mac(PKCS12 *p12, const char *pass, int passlen); +int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen, + unsigned char *salt, int saltlen, int iter, + const EVP_MD *md_type); +int PKCS12_set_pbmac1_pbkdf2(PKCS12 *p12, const char *pass, int passlen, + unsigned char *salt, int saltlen, int iter, + const EVP_MD *md_type, const char *prf_md_name); +int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt, + int saltlen, const EVP_MD *md_type); +unsigned char *OPENSSL_asc2uni(const char *asc, int asclen, + unsigned char **uni, int *unilen); +char *OPENSSL_uni2asc(const unsigned char *uni, int unilen); +unsigned char *OPENSSL_utf82uni(const char *asc, int asclen, + unsigned char **uni, int *unilen); +char *OPENSSL_uni2utf8(const unsigned char *uni, int unilen); + +DECLARE_ASN1_FUNCTIONS(PKCS12) +DECLARE_ASN1_FUNCTIONS(PKCS12_MAC_DATA) +DECLARE_ASN1_FUNCTIONS(PKCS12_SAFEBAG) +DECLARE_ASN1_FUNCTIONS(PKCS12_BAGS) + +DECLARE_ASN1_ITEM(PKCS12_SAFEBAGS) +DECLARE_ASN1_ITEM(PKCS12_AUTHSAFES) + +void PKCS12_PBE_add(void); +int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, + STACK_OF(X509) **ca); +typedef int PKCS12_create_cb(PKCS12_SAFEBAG *bag, void *cbarg); +PKCS12 *PKCS12_create(const char *pass, const char *name, EVP_PKEY *pkey, + X509 *cert, STACK_OF(X509) *ca, int nid_key, int nid_cert, + int iter, int mac_iter, int keytype); +PKCS12 *PKCS12_create_ex(const char *pass, const char *name, EVP_PKEY *pkey, + X509 *cert, STACK_OF(X509) *ca, int nid_key, int nid_cert, + int iter, int mac_iter, int keytype, + OSSL_LIB_CTX *ctx, const char *propq); +PKCS12 *PKCS12_create_ex2(const char *pass, const char *name, EVP_PKEY *pkey, + X509 *cert, STACK_OF(X509) *ca, int nid_key, int nid_cert, + int iter, int mac_iter, int keytype, + OSSL_LIB_CTX *ctx, const char *propq, + PKCS12_create_cb *cb, void *cbarg); + +PKCS12_SAFEBAG *PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags, X509 *cert); +PKCS12_SAFEBAG *PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags, + EVP_PKEY *key, int key_usage, int iter, + int key_nid, const char *pass); +PKCS12_SAFEBAG *PKCS12_add_key_ex(STACK_OF(PKCS12_SAFEBAG) **pbags, + EVP_PKEY *key, int key_usage, int iter, + int key_nid, const char *pass, + OSSL_LIB_CTX *ctx, const char *propq); + +PKCS12_SAFEBAG *PKCS12_add_secret(STACK_OF(PKCS12_SAFEBAG) **pbags, + int nid_type, const unsigned char *value, int len); +int PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags, + int safe_nid, int iter, const char *pass); +int PKCS12_add_safe_ex(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags, + int safe_nid, int iter, const char *pass, + OSSL_LIB_CTX *ctx, const char *propq); + +PKCS12 *PKCS12_add_safes(STACK_OF(PKCS7) *safes, int p7_nid); +PKCS12 *PKCS12_add_safes_ex(STACK_OF(PKCS7) *safes, int p7_nid, + OSSL_LIB_CTX *ctx, const char *propq); + +int i2d_PKCS12_bio(BIO *bp, const PKCS12 *p12); +#ifndef OPENSSL_NO_STDIO +int i2d_PKCS12_fp(FILE *fp, const PKCS12 *p12); +#endif +PKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **p12); +#ifndef OPENSSL_NO_STDIO +PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12); +#endif +int PKCS12_newpass(PKCS12 *p12, const char *oldpass, const char *newpass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/pkcs12err.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/pkcs12err.h new file mode 100644 index 0000000000000000000000000000000000000000..2ad38f88ff5d5f59756412b6698f467d3b54c810 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/pkcs12err.h @@ -0,0 +1,44 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_PKCS12ERR_H +#define OPENSSL_PKCS12ERR_H +#pragma once + +#include +#include +#include + +/* + * PKCS12 reason codes. + */ +#define PKCS12_R_CALLBACK_FAILED 115 +#define PKCS12_R_CANT_PACK_STRUCTURE 100 +#define PKCS12_R_CONTENT_TYPE_NOT_DATA 121 +#define PKCS12_R_DECODE_ERROR 101 +#define PKCS12_R_ENCODE_ERROR 102 +#define PKCS12_R_ENCRYPT_ERROR 103 +#define PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE 120 +#define PKCS12_R_INVALID_NULL_ARGUMENT 104 +#define PKCS12_R_INVALID_NULL_PKCS12_POINTER 105 +#define PKCS12_R_INVALID_TYPE 112 +#define PKCS12_R_IV_GEN_ERROR 106 +#define PKCS12_R_KEY_GEN_ERROR 107 +#define PKCS12_R_MAC_ABSENT 108 +#define PKCS12_R_MAC_GENERATION_ERROR 109 +#define PKCS12_R_MAC_SETUP_ERROR 110 +#define PKCS12_R_MAC_STRING_SET_ERROR 111 +#define PKCS12_R_MAC_VERIFY_FAILURE 113 +#define PKCS12_R_PARSE_ERROR 114 +#define PKCS12_R_PKCS12_CIPHERFINAL_ERROR 116 +#define PKCS12_R_UNKNOWN_DIGEST_ALGORITHM 118 +#define PKCS12_R_UNSUPPORTED_PKCS12_MODE 119 + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/pkcs7.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/pkcs7.h new file mode 100644 index 0000000000000000000000000000000000000000..f4020510402e84692e7485af2510caec49e473ee --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/pkcs7.h @@ -0,0 +1,435 @@ +/* + * WARNING: do not edit! + * Generated by makefile from include\openssl\pkcs7.h.in + * + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* clang-format off */ + +/* clang-format on */ + +#ifndef OPENSSL_PKCS7_H +#define OPENSSL_PKCS7_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_PKCS7_H +#endif + +#include +#include +#include + +#include +#include +#include +#ifndef OPENSSL_NO_STDIO +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/*- +Encryption_ID DES-CBC +Digest_ID MD5 +Digest_Encryption_ID rsaEncryption +Key_Encryption_ID rsaEncryption +*/ + +typedef struct PKCS7_CTX_st { + OSSL_LIB_CTX *libctx; + char *propq; +} PKCS7_CTX; + +typedef struct pkcs7_issuer_and_serial_st { + X509_NAME *issuer; + ASN1_INTEGER *serial; +} PKCS7_ISSUER_AND_SERIAL; + +typedef struct pkcs7_signer_info_st { + ASN1_INTEGER *version; /* version 1 */ + PKCS7_ISSUER_AND_SERIAL *issuer_and_serial; + X509_ALGOR *digest_alg; + STACK_OF(X509_ATTRIBUTE) *auth_attr; /* [ 0 ] */ + X509_ALGOR *digest_enc_alg; /* confusing name, actually used for signing */ + ASN1_OCTET_STRING *enc_digest; /* confusing name, actually signature */ + STACK_OF(X509_ATTRIBUTE) *unauth_attr; /* [ 1 ] */ + /* The private key to sign with */ + EVP_PKEY *pkey; + const PKCS7_CTX *ctx; +} PKCS7_SIGNER_INFO; +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(PKCS7_SIGNER_INFO, PKCS7_SIGNER_INFO, PKCS7_SIGNER_INFO) +#define sk_PKCS7_SIGNER_INFO_num(sk) OPENSSL_sk_num(ossl_check_const_PKCS7_SIGNER_INFO_sk_type(sk)) +#define sk_PKCS7_SIGNER_INFO_value(sk, idx) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_value(ossl_check_const_PKCS7_SIGNER_INFO_sk_type(sk), (idx))) +#define sk_PKCS7_SIGNER_INFO_new(cmp) ((STACK_OF(PKCS7_SIGNER_INFO) *)OPENSSL_sk_new(ossl_check_PKCS7_SIGNER_INFO_compfunc_type(cmp))) +#define sk_PKCS7_SIGNER_INFO_new_null() ((STACK_OF(PKCS7_SIGNER_INFO) *)OPENSSL_sk_new_null()) +#define sk_PKCS7_SIGNER_INFO_new_reserve(cmp, n) ((STACK_OF(PKCS7_SIGNER_INFO) *)OPENSSL_sk_new_reserve(ossl_check_PKCS7_SIGNER_INFO_compfunc_type(cmp), (n))) +#define sk_PKCS7_SIGNER_INFO_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), (n)) +#define sk_PKCS7_SIGNER_INFO_free(sk) OPENSSL_sk_free(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk)) +#define sk_PKCS7_SIGNER_INFO_zero(sk) OPENSSL_sk_zero(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk)) +#define sk_PKCS7_SIGNER_INFO_delete(sk, i) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_delete(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), (i))) +#define sk_PKCS7_SIGNER_INFO_delete_ptr(sk, ptr) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_delete_ptr(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr))) +#define sk_PKCS7_SIGNER_INFO_push(sk, ptr) OPENSSL_sk_push(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr)) +#define sk_PKCS7_SIGNER_INFO_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr)) +#define sk_PKCS7_SIGNER_INFO_pop(sk) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_pop(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk))) +#define sk_PKCS7_SIGNER_INFO_shift(sk) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_shift(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk))) +#define sk_PKCS7_SIGNER_INFO_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_freefunc_type(freefunc)) +#define sk_PKCS7_SIGNER_INFO_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr), (idx)) +#define sk_PKCS7_SIGNER_INFO_set(sk, idx, ptr) ((PKCS7_SIGNER_INFO *)OPENSSL_sk_set(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), (idx), ossl_check_PKCS7_SIGNER_INFO_type(ptr))) +#define sk_PKCS7_SIGNER_INFO_find(sk, ptr) OPENSSL_sk_find(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr)) +#define sk_PKCS7_SIGNER_INFO_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr)) +#define sk_PKCS7_SIGNER_INFO_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_type(ptr), pnum) +#define sk_PKCS7_SIGNER_INFO_sort(sk) OPENSSL_sk_sort(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk)) +#define sk_PKCS7_SIGNER_INFO_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_PKCS7_SIGNER_INFO_sk_type(sk)) +#define sk_PKCS7_SIGNER_INFO_dup(sk) ((STACK_OF(PKCS7_SIGNER_INFO) *)OPENSSL_sk_dup(ossl_check_const_PKCS7_SIGNER_INFO_sk_type(sk))) +#define sk_PKCS7_SIGNER_INFO_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(PKCS7_SIGNER_INFO) *)OPENSSL_sk_deep_copy(ossl_check_const_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_copyfunc_type(copyfunc), ossl_check_PKCS7_SIGNER_INFO_freefunc_type(freefunc))) +#define sk_PKCS7_SIGNER_INFO_set_cmp_func(sk, cmp) ((sk_PKCS7_SIGNER_INFO_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_PKCS7_SIGNER_INFO_sk_type(sk), ossl_check_PKCS7_SIGNER_INFO_compfunc_type(cmp))) + +/* clang-format on */ + +typedef struct pkcs7_recip_info_st { + ASN1_INTEGER *version; /* version 0 */ + PKCS7_ISSUER_AND_SERIAL *issuer_and_serial; + X509_ALGOR *key_enc_algor; + ASN1_OCTET_STRING *enc_key; + X509 *cert; /* get the pub-key from this */ + const PKCS7_CTX *ctx; +} PKCS7_RECIP_INFO; +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(PKCS7_RECIP_INFO, PKCS7_RECIP_INFO, PKCS7_RECIP_INFO) +#define sk_PKCS7_RECIP_INFO_num(sk) OPENSSL_sk_num(ossl_check_const_PKCS7_RECIP_INFO_sk_type(sk)) +#define sk_PKCS7_RECIP_INFO_value(sk, idx) ((PKCS7_RECIP_INFO *)OPENSSL_sk_value(ossl_check_const_PKCS7_RECIP_INFO_sk_type(sk), (idx))) +#define sk_PKCS7_RECIP_INFO_new(cmp) ((STACK_OF(PKCS7_RECIP_INFO) *)OPENSSL_sk_new(ossl_check_PKCS7_RECIP_INFO_compfunc_type(cmp))) +#define sk_PKCS7_RECIP_INFO_new_null() ((STACK_OF(PKCS7_RECIP_INFO) *)OPENSSL_sk_new_null()) +#define sk_PKCS7_RECIP_INFO_new_reserve(cmp, n) ((STACK_OF(PKCS7_RECIP_INFO) *)OPENSSL_sk_new_reserve(ossl_check_PKCS7_RECIP_INFO_compfunc_type(cmp), (n))) +#define sk_PKCS7_RECIP_INFO_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), (n)) +#define sk_PKCS7_RECIP_INFO_free(sk) OPENSSL_sk_free(ossl_check_PKCS7_RECIP_INFO_sk_type(sk)) +#define sk_PKCS7_RECIP_INFO_zero(sk) OPENSSL_sk_zero(ossl_check_PKCS7_RECIP_INFO_sk_type(sk)) +#define sk_PKCS7_RECIP_INFO_delete(sk, i) ((PKCS7_RECIP_INFO *)OPENSSL_sk_delete(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), (i))) +#define sk_PKCS7_RECIP_INFO_delete_ptr(sk, ptr) ((PKCS7_RECIP_INFO *)OPENSSL_sk_delete_ptr(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr))) +#define sk_PKCS7_RECIP_INFO_push(sk, ptr) OPENSSL_sk_push(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr)) +#define sk_PKCS7_RECIP_INFO_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr)) +#define sk_PKCS7_RECIP_INFO_pop(sk) ((PKCS7_RECIP_INFO *)OPENSSL_sk_pop(ossl_check_PKCS7_RECIP_INFO_sk_type(sk))) +#define sk_PKCS7_RECIP_INFO_shift(sk) ((PKCS7_RECIP_INFO *)OPENSSL_sk_shift(ossl_check_PKCS7_RECIP_INFO_sk_type(sk))) +#define sk_PKCS7_RECIP_INFO_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_freefunc_type(freefunc)) +#define sk_PKCS7_RECIP_INFO_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr), (idx)) +#define sk_PKCS7_RECIP_INFO_set(sk, idx, ptr) ((PKCS7_RECIP_INFO *)OPENSSL_sk_set(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), (idx), ossl_check_PKCS7_RECIP_INFO_type(ptr))) +#define sk_PKCS7_RECIP_INFO_find(sk, ptr) OPENSSL_sk_find(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr)) +#define sk_PKCS7_RECIP_INFO_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr)) +#define sk_PKCS7_RECIP_INFO_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_type(ptr), pnum) +#define sk_PKCS7_RECIP_INFO_sort(sk) OPENSSL_sk_sort(ossl_check_PKCS7_RECIP_INFO_sk_type(sk)) +#define sk_PKCS7_RECIP_INFO_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_PKCS7_RECIP_INFO_sk_type(sk)) +#define sk_PKCS7_RECIP_INFO_dup(sk) ((STACK_OF(PKCS7_RECIP_INFO) *)OPENSSL_sk_dup(ossl_check_const_PKCS7_RECIP_INFO_sk_type(sk))) +#define sk_PKCS7_RECIP_INFO_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(PKCS7_RECIP_INFO) *)OPENSSL_sk_deep_copy(ossl_check_const_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_copyfunc_type(copyfunc), ossl_check_PKCS7_RECIP_INFO_freefunc_type(freefunc))) +#define sk_PKCS7_RECIP_INFO_set_cmp_func(sk, cmp) ((sk_PKCS7_RECIP_INFO_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_PKCS7_RECIP_INFO_sk_type(sk), ossl_check_PKCS7_RECIP_INFO_compfunc_type(cmp))) + +/* clang-format on */ + +typedef struct pkcs7_signed_st { + ASN1_INTEGER *version; /* version 1 */ + STACK_OF(X509_ALGOR) *md_algs; /* md used */ + STACK_OF(X509) *cert; /* [ 0 ] */ /* name should be 'certificates' */ + STACK_OF(X509_CRL) *crl; /* [ 1 ] */ /* name should be 'crls' */ + STACK_OF(PKCS7_SIGNER_INFO) *signer_info; + struct pkcs7_st *contents; +} PKCS7_SIGNED; +/* + * The above structure is very very similar to PKCS7_SIGN_ENVELOPE. How about + * merging the two + */ + +typedef struct pkcs7_enc_content_st { + ASN1_OBJECT *content_type; + X509_ALGOR *algorithm; + ASN1_OCTET_STRING *enc_data; /* [ 0 ] */ + const EVP_CIPHER *cipher; + const PKCS7_CTX *ctx; +} PKCS7_ENC_CONTENT; + +typedef struct pkcs7_enveloped_st { + ASN1_INTEGER *version; /* version 0 */ + STACK_OF(PKCS7_RECIP_INFO) *recipientinfo; + PKCS7_ENC_CONTENT *enc_data; +} PKCS7_ENVELOPE; + +typedef struct pkcs7_signedandenveloped_st { + ASN1_INTEGER *version; /* version 1 */ + STACK_OF(X509_ALGOR) *md_algs; /* md used */ + STACK_OF(X509) *cert; /* [ 0 ] */ /* name should be 'certificates' */ + STACK_OF(X509_CRL) *crl; /* [ 1 ] */ /* name should be 'crls' */ + STACK_OF(PKCS7_SIGNER_INFO) *signer_info; + PKCS7_ENC_CONTENT *enc_data; + STACK_OF(PKCS7_RECIP_INFO) *recipientinfo; +} PKCS7_SIGN_ENVELOPE; + +typedef struct pkcs7_digest_st { + ASN1_INTEGER *version; /* version 0 */ + X509_ALGOR *md; /* md used */ + struct pkcs7_st *contents; + ASN1_OCTET_STRING *digest; +} PKCS7_DIGEST; + +typedef struct pkcs7_encrypted_st { + ASN1_INTEGER *version; /* version 0 */ + PKCS7_ENC_CONTENT *enc_data; +} PKCS7_ENCRYPT; + +typedef struct pkcs7_st { + /* + * The following is non NULL if it contains ASN1 encoding of this + * structure + */ + unsigned char *asn1; + long length; +#define PKCS7_S_HEADER 0 +#define PKCS7_S_BODY 1 +#define PKCS7_S_TAIL 2 + int state; /* used during processing */ + int detached; + ASN1_OBJECT *type; + /* content as defined by the type */ + /* + * all encryption/message digests are applied to the 'contents', leaving + * out the 'type' field. + */ + union { + char *ptr; + /* NID_pkcs7_data */ + ASN1_OCTET_STRING *data; + /* NID_pkcs7_signed */ + PKCS7_SIGNED *sign; /* field name 'signed' would clash with C keyword */ + /* NID_pkcs7_enveloped */ + PKCS7_ENVELOPE *enveloped; + /* NID_pkcs7_signedAndEnveloped */ + PKCS7_SIGN_ENVELOPE *signed_and_enveloped; + /* NID_pkcs7_digest */ + PKCS7_DIGEST *digest; + /* NID_pkcs7_encrypted */ + PKCS7_ENCRYPT *encrypted; + /* Anything else */ + ASN1_TYPE *other; + } d; + PKCS7_CTX ctx; +} PKCS7; +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(PKCS7, PKCS7, PKCS7) +#define sk_PKCS7_num(sk) OPENSSL_sk_num(ossl_check_const_PKCS7_sk_type(sk)) +#define sk_PKCS7_value(sk, idx) ((PKCS7 *)OPENSSL_sk_value(ossl_check_const_PKCS7_sk_type(sk), (idx))) +#define sk_PKCS7_new(cmp) ((STACK_OF(PKCS7) *)OPENSSL_sk_new(ossl_check_PKCS7_compfunc_type(cmp))) +#define sk_PKCS7_new_null() ((STACK_OF(PKCS7) *)OPENSSL_sk_new_null()) +#define sk_PKCS7_new_reserve(cmp, n) ((STACK_OF(PKCS7) *)OPENSSL_sk_new_reserve(ossl_check_PKCS7_compfunc_type(cmp), (n))) +#define sk_PKCS7_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_PKCS7_sk_type(sk), (n)) +#define sk_PKCS7_free(sk) OPENSSL_sk_free(ossl_check_PKCS7_sk_type(sk)) +#define sk_PKCS7_zero(sk) OPENSSL_sk_zero(ossl_check_PKCS7_sk_type(sk)) +#define sk_PKCS7_delete(sk, i) ((PKCS7 *)OPENSSL_sk_delete(ossl_check_PKCS7_sk_type(sk), (i))) +#define sk_PKCS7_delete_ptr(sk, ptr) ((PKCS7 *)OPENSSL_sk_delete_ptr(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr))) +#define sk_PKCS7_push(sk, ptr) OPENSSL_sk_push(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr)) +#define sk_PKCS7_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr)) +#define sk_PKCS7_pop(sk) ((PKCS7 *)OPENSSL_sk_pop(ossl_check_PKCS7_sk_type(sk))) +#define sk_PKCS7_shift(sk) ((PKCS7 *)OPENSSL_sk_shift(ossl_check_PKCS7_sk_type(sk))) +#define sk_PKCS7_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_freefunc_type(freefunc)) +#define sk_PKCS7_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr), (idx)) +#define sk_PKCS7_set(sk, idx, ptr) ((PKCS7 *)OPENSSL_sk_set(ossl_check_PKCS7_sk_type(sk), (idx), ossl_check_PKCS7_type(ptr))) +#define sk_PKCS7_find(sk, ptr) OPENSSL_sk_find(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr)) +#define sk_PKCS7_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr)) +#define sk_PKCS7_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_type(ptr), pnum) +#define sk_PKCS7_sort(sk) OPENSSL_sk_sort(ossl_check_PKCS7_sk_type(sk)) +#define sk_PKCS7_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_PKCS7_sk_type(sk)) +#define sk_PKCS7_dup(sk) ((STACK_OF(PKCS7) *)OPENSSL_sk_dup(ossl_check_const_PKCS7_sk_type(sk))) +#define sk_PKCS7_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(PKCS7) *)OPENSSL_sk_deep_copy(ossl_check_const_PKCS7_sk_type(sk), ossl_check_PKCS7_copyfunc_type(copyfunc), ossl_check_PKCS7_freefunc_type(freefunc))) +#define sk_PKCS7_set_cmp_func(sk, cmp) ((sk_PKCS7_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_PKCS7_sk_type(sk), ossl_check_PKCS7_compfunc_type(cmp))) + +/* clang-format on */ + +#define PKCS7_OP_SET_DETACHED_SIGNATURE 1 +#define PKCS7_OP_GET_DETACHED_SIGNATURE 2 + +#define PKCS7_get_signed_attributes(si) ((si)->auth_attr) +#define PKCS7_get_attributes(si) ((si)->unauth_attr) + +#define PKCS7_type_is_signed(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_signed) +#define PKCS7_type_is_encrypted(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted) +#define PKCS7_type_is_enveloped(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_enveloped) +#define PKCS7_type_is_signedAndEnveloped(a) \ + (OBJ_obj2nid((a)->type) == NID_pkcs7_signedAndEnveloped) +#define PKCS7_type_is_data(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_data) +#define PKCS7_type_is_digest(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_digest) + +#define PKCS7_set_detached(p, v) \ + PKCS7_ctrl(p, PKCS7_OP_SET_DETACHED_SIGNATURE, v, NULL) +#define PKCS7_get_detached(p) \ + PKCS7_ctrl(p, PKCS7_OP_GET_DETACHED_SIGNATURE, 0, NULL) + +#define PKCS7_is_detached(p7) (PKCS7_type_is_signed(p7) && PKCS7_get_detached(p7)) + +/* S/MIME related flags */ + +#define PKCS7_TEXT 0x1 +#define PKCS7_NOCERTS 0x2 +#define PKCS7_NOSIGS 0x4 +#define PKCS7_NOCHAIN 0x8 +#define PKCS7_NOINTERN 0x10 +#define PKCS7_NOVERIFY 0x20 +#define PKCS7_DETACHED 0x40 +#define PKCS7_BINARY 0x80 +#define PKCS7_NOATTR 0x100 +#define PKCS7_NOSMIMECAP 0x200 +#define PKCS7_NOOLDMIMETYPE 0x400 +#define PKCS7_CRLFEOL 0x800 +#define PKCS7_STREAM 0x1000 +#define PKCS7_NOCRL 0x2000 +#define PKCS7_PARTIAL 0x4000 +#define PKCS7_REUSE_DIGEST 0x8000 +#define PKCS7_NO_DUAL_CONTENT 0x10000 + +/* Flags: for compatibility with older code */ + +#define SMIME_TEXT PKCS7_TEXT +#define SMIME_NOCERTS PKCS7_NOCERTS +#define SMIME_NOSIGS PKCS7_NOSIGS +#define SMIME_NOCHAIN PKCS7_NOCHAIN +#define SMIME_NOINTERN PKCS7_NOINTERN +#define SMIME_NOVERIFY PKCS7_NOVERIFY +#define SMIME_DETACHED PKCS7_DETACHED +#define SMIME_BINARY PKCS7_BINARY +#define SMIME_NOATTR PKCS7_NOATTR + +/* CRLF ASCII canonicalisation */ +#define SMIME_ASCIICRLF 0x80000 + +DECLARE_ASN1_FUNCTIONS(PKCS7_ISSUER_AND_SERIAL) + +int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data, + const EVP_MD *type, unsigned char *md, + unsigned int *len); +#ifndef OPENSSL_NO_STDIO +PKCS7 *d2i_PKCS7_fp(FILE *fp, PKCS7 **p7); +int i2d_PKCS7_fp(FILE *fp, const PKCS7 *p7); +#endif +DECLARE_ASN1_DUP_FUNCTION(PKCS7) +PKCS7 *d2i_PKCS7_bio(BIO *bp, PKCS7 **p7); +int i2d_PKCS7_bio(BIO *bp, const PKCS7 *p7); +int i2d_PKCS7_bio_stream(BIO *out, PKCS7 *p7, BIO *in, int flags); +int PEM_write_bio_PKCS7_stream(BIO *out, PKCS7 *p7, BIO *in, int flags); + +DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNER_INFO) +DECLARE_ASN1_FUNCTIONS(PKCS7_RECIP_INFO) +DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNED) +DECLARE_ASN1_FUNCTIONS(PKCS7_ENC_CONTENT) +DECLARE_ASN1_FUNCTIONS(PKCS7_ENVELOPE) +DECLARE_ASN1_FUNCTIONS(PKCS7_SIGN_ENVELOPE) +DECLARE_ASN1_FUNCTIONS(PKCS7_DIGEST) +DECLARE_ASN1_FUNCTIONS(PKCS7_ENCRYPT) +DECLARE_ASN1_FUNCTIONS(PKCS7) +PKCS7 *PKCS7_new_ex(OSSL_LIB_CTX *libctx, const char *propq); + +DECLARE_ASN1_ITEM(PKCS7_ATTR_SIGN) +DECLARE_ASN1_ITEM(PKCS7_ATTR_VERIFY) + +DECLARE_ASN1_NDEF_FUNCTION(PKCS7) +DECLARE_ASN1_PRINT_FUNCTION(PKCS7) + +long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg); + +int PKCS7_type_is_other(PKCS7 *p7); +int PKCS7_set_type(PKCS7 *p7, int type); +int PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other); +int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data); +int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey, + const EVP_MD *dgst); +int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si); +int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i); +int PKCS7_add_certificate(PKCS7 *p7, X509 *cert); +int PKCS7_add_crl(PKCS7 *p7, X509_CRL *crl); +int PKCS7_content_new(PKCS7 *p7, int nid); +int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx, + BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si); +int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si, + X509 *signer); + +BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio); +int PKCS7_dataFinal(PKCS7 *p7, BIO *bio); +BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert); + +PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509, + EVP_PKEY *pkey, const EVP_MD *dgst); +X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si); +int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md); +STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7); + +PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509); +void PKCS7_SIGNER_INFO_get0_algs(PKCS7_SIGNER_INFO *si, EVP_PKEY **pk, + X509_ALGOR **pdig, X509_ALGOR **psig); +void PKCS7_RECIP_INFO_get0_alg(PKCS7_RECIP_INFO *ri, X509_ALGOR **penc); +int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri); +int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509); +int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher); +int PKCS7_stream(unsigned char ***boundary, PKCS7 *p7); + +PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx); +ASN1_OCTET_STRING *PKCS7_get_octet_string(PKCS7 *p7); +ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk); +int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int type, + void *data); +int PKCS7_add_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int atrtype, + void *value); +ASN1_TYPE *PKCS7_get_attribute(const PKCS7_SIGNER_INFO *si, int nid); +ASN1_TYPE *PKCS7_get_signed_attribute(const PKCS7_SIGNER_INFO *si, int nid); +int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si, + STACK_OF(X509_ATTRIBUTE) *sk); +int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si, + STACK_OF(X509_ATTRIBUTE) *sk); + +PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, + BIO *data, int flags); +PKCS7 *PKCS7_sign_ex(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, + BIO *data, int flags, OSSL_LIB_CTX *libctx, + const char *propq); + +PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7, + X509 *signcert, EVP_PKEY *pkey, + const EVP_MD *md, int flags); + +int PKCS7_final(PKCS7 *p7, BIO *data, int flags); +int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, + BIO *indata, BIO *out, int flags); +STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, + int flags); +PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher, + int flags); +PKCS7 *PKCS7_encrypt_ex(STACK_OF(X509) *certs, BIO *in, + const EVP_CIPHER *cipher, int flags, + OSSL_LIB_CTX *libctx, const char *propq); +int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, + int flags); + +int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si, + STACK_OF(X509_ALGOR) *cap); +STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si); +int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg); + +int PKCS7_add_attrib_content_type(PKCS7_SIGNER_INFO *si, ASN1_OBJECT *coid); +int PKCS7_add0_attrib_signing_time(PKCS7_SIGNER_INFO *si, ASN1_TIME *t); +int PKCS7_add1_attrib_digest(PKCS7_SIGNER_INFO *si, + const unsigned char *md, int mdlen); + +int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags); +PKCS7 *SMIME_read_PKCS7_ex(BIO *bio, BIO **bcont, PKCS7 **p7); +PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont); + +BIO *BIO_new_PKCS7(BIO *out, PKCS7 *p7); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/pkcs7err.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/pkcs7err.h new file mode 100644 index 0000000000000000000000000000000000000000..358fe1018fb2dc679d85e4f2d86a256bd8a6a2a7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/pkcs7err.h @@ -0,0 +1,61 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_PKCS7ERR_H +#define OPENSSL_PKCS7ERR_H +#pragma once + +#include +#include +#include + +/* + * PKCS7 reason codes. + */ +#define PKCS7_R_CERTIFICATE_VERIFY_ERROR 117 +#define PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 144 +#define PKCS7_R_CIPHER_NOT_INITIALIZED 116 +#define PKCS7_R_CONTENT_AND_DATA_PRESENT 118 +#define PKCS7_R_CTRL_ERROR 152 +#define PKCS7_R_DECRYPT_ERROR 119 +#define PKCS7_R_DIGEST_FAILURE 101 +#define PKCS7_R_ENCRYPTION_CTRL_FAILURE 149 +#define PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 150 +#define PKCS7_R_ERROR_ADDING_RECIPIENT 120 +#define PKCS7_R_ERROR_SETTING_CIPHER 121 +#define PKCS7_R_INVALID_NULL_POINTER 143 +#define PKCS7_R_INVALID_SIGNED_DATA_TYPE 155 +#define PKCS7_R_NO_CONTENT 122 +#define PKCS7_R_NO_DEFAULT_DIGEST 151 +#define PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND 154 +#define PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE 115 +#define PKCS7_R_NO_SIGNATURES_ON_DATA 123 +#define PKCS7_R_NO_SIGNERS 142 +#define PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE 104 +#define PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR 124 +#define PKCS7_R_PKCS7_ADD_SIGNER_ERROR 153 +#define PKCS7_R_PKCS7_DATASIGN 145 +#define PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 127 +#define PKCS7_R_SIGNATURE_FAILURE 105 +#define PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND 128 +#define PKCS7_R_SIGNING_CTRL_FAILURE 147 +#define PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 148 +#define PKCS7_R_SMIME_TEXT_ERROR 129 +#define PKCS7_R_UNABLE_TO_FIND_CERTIFICATE 106 +#define PKCS7_R_UNABLE_TO_FIND_MEM_BIO 107 +#define PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST 108 +#define PKCS7_R_UNKNOWN_DIGEST_TYPE 109 +#define PKCS7_R_UNKNOWN_OPERATION 110 +#define PKCS7_R_UNSUPPORTED_CIPHER_TYPE 111 +#define PKCS7_R_UNSUPPORTED_CONTENT_TYPE 112 +#define PKCS7_R_WRONG_CONTENT_TYPE 113 +#define PKCS7_R_WRONG_PKCS7_TYPE 114 + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/prov_ssl.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/prov_ssl.h new file mode 100644 index 0000000000000000000000000000000000000000..269c3b805737871c152f614ccc42bd8999ac8854 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/prov_ssl.h @@ -0,0 +1,38 @@ +/* + * Copyright 2021-2023 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_PROV_SSL_H +#define OPENSSL_PROV_SSL_H +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +/* SSL/TLS related defines useful to providers */ + +#define SSL_MAX_MASTER_KEY_LENGTH 48 + +/* SSL/TLS uses a 2 byte unsigned version number */ +#define SSL3_VERSION 0x0300 +#define TLS1_VERSION 0x0301 +#define TLS1_1_VERSION 0x0302 +#define TLS1_2_VERSION 0x0303 +#define TLS1_3_VERSION 0x0304 +#define DTLS1_VERSION 0xFEFF +#define DTLS1_2_VERSION 0xFEFD +#define DTLS1_BAD_VER 0x0100 + +/* QUIC uses a 4 byte unsigned version number */ +#define OSSL_QUIC1_VERSION 0x0000001 + +#ifdef __cplusplus +} +#endif +#endif /* OPENSSL_PROV_SSL_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/proverr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/proverr.h new file mode 100644 index 0000000000000000000000000000000000000000..a82b8e42486ed1ed639415ad6a2bcb4a52a6b86b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/proverr.h @@ -0,0 +1,169 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_PROVERR_H +#define OPENSSL_PROVERR_H +#pragma once + +#include +#include +#include + +/* + * PROV reason codes. + */ +#define PROV_R_ADDITIONAL_INPUT_TOO_LONG 184 +#define PROV_R_ALGORITHM_MISMATCH 173 +#define PROV_R_ALREADY_INSTANTIATED 185 +#define PROV_R_BAD_DECRYPT 100 +#define PROV_R_BAD_ENCODING 141 +#define PROV_R_BAD_LENGTH 142 +#define PROV_R_BAD_TLS_CLIENT_VERSION 161 +#define PROV_R_BN_ERROR 160 +#define PROV_R_CIPHER_OPERATION_FAILED 102 +#define PROV_R_COFACTOR_REQUIRED 236 +#define PROV_R_DERIVATION_FUNCTION_INIT_FAILED 205 +#define PROV_R_DIGEST_NOT_ALLOWED 174 +#define PROV_R_EMS_NOT_ENABLED 233 +#define PROV_R_ENTROPY_SOURCE_FAILED_CONTINUOUS_TESTS 244 +#define PROV_R_ENTROPY_SOURCE_STRENGTH_TOO_WEAK 186 +#define PROV_R_ERROR_INSTANTIATING_DRBG 188 +#define PROV_R_ERROR_RETRIEVING_ENTROPY 189 +#define PROV_R_ERROR_RETRIEVING_NONCE 190 +#define PROV_R_FAILED_DURING_DERIVATION 164 +#define PROV_R_FAILED_TO_CREATE_LOCK 180 +#define PROV_R_FAILED_TO_DECRYPT 162 +#define PROV_R_FAILED_TO_GENERATE_KEY 121 +#define PROV_R_FAILED_TO_GET_PARAMETER 103 +#define PROV_R_FAILED_TO_SET_PARAMETER 104 +#define PROV_R_FAILED_TO_SIGN 175 +#define PROV_R_FINAL_CALL_OUT_OF_ORDER 237 +#define PROV_R_FIPS_MODULE_CONDITIONAL_ERROR 227 +#define PROV_R_FIPS_MODULE_ENTERING_ERROR_STATE 224 +#define PROV_R_FIPS_MODULE_IMPORT_PCT_ERROR 253 +#define PROV_R_FIPS_MODULE_IN_ERROR_STATE 225 +#define PROV_R_GENERATE_ERROR 191 +#define PROV_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE 165 +#define PROV_R_INDICATOR_INTEGRITY_FAILURE 210 +#define PROV_R_INIT_CALL_OUT_OF_ORDER 238 +#define PROV_R_INSUFFICIENT_DRBG_STRENGTH 181 +#define PROV_R_INVALID_AAD 108 +#define PROV_R_INVALID_AEAD 231 +#define PROV_R_INVALID_CONFIG_DATA 211 +#define PROV_R_INVALID_CONSTANT_LENGTH 157 +#define PROV_R_INVALID_CURVE 176 +#define PROV_R_INVALID_CUSTOM_LENGTH 111 +#define PROV_R_INVALID_DATA 115 +#define PROV_R_INVALID_DIGEST 122 +#define PROV_R_INVALID_DIGEST_LENGTH 166 +#define PROV_R_INVALID_DIGEST_SIZE 218 +#define PROV_R_INVALID_EDDSA_INSTANCE_FOR_ATTEMPTED_OPERATION 243 +#define PROV_R_INVALID_INPUT_LENGTH 230 +#define PROV_R_INVALID_ITERATION_COUNT 123 +#define PROV_R_INVALID_IV_LENGTH 109 +#define PROV_R_INVALID_KDF 232 +#define PROV_R_INVALID_KEY 158 +#define PROV_R_INVALID_KEY_LENGTH 105 +#define PROV_R_INVALID_MAC 151 +#define PROV_R_INVALID_MEMORY_SIZE 235 +#define PROV_R_INVALID_MGF1_MD 167 +#define PROV_R_INVALID_MODE 125 +#define PROV_R_INVALID_OUTPUT_LENGTH 217 +#define PROV_R_INVALID_PADDING_MODE 168 +#define PROV_R_INVALID_PREHASHED_DIGEST_LENGTH 241 +#define PROV_R_INVALID_PUBINFO 198 +#define PROV_R_INVALID_SALT_LENGTH 112 +#define PROV_R_INVALID_SEED_LENGTH 154 +#define PROV_R_INVALID_SIGNATURE_SIZE 179 +#define PROV_R_INVALID_STATE 212 +#define PROV_R_INVALID_TAG 110 +#define PROV_R_INVALID_TAG_LENGTH 118 +#define PROV_R_INVALID_THREAD_POOL_SIZE 234 +#define PROV_R_INVALID_UKM_LENGTH 200 +#define PROV_R_INVALID_X931_DIGEST 170 +#define PROV_R_IN_ERROR_STATE 192 +#define PROV_R_KEY_SETUP_FAILED 101 +#define PROV_R_KEY_SIZE_TOO_SMALL 171 +#define PROV_R_LENGTH_TOO_LARGE 202 +#define PROV_R_MISMATCHING_DOMAIN_PARAMETERS 203 +#define PROV_R_MISSING_CEK_ALG 144 +#define PROV_R_MISSING_CIPHER 155 +#define PROV_R_MISSING_CONFIG_DATA 213 +#define PROV_R_MISSING_CONSTANT 156 +#define PROV_R_MISSING_KEY 128 +#define PROV_R_MISSING_MAC 150 +#define PROV_R_MISSING_MESSAGE_DIGEST 129 +#define PROV_R_MISSING_OID 209 +#define PROV_R_MISSING_PASS 130 +#define PROV_R_MISSING_SALT 131 +#define PROV_R_MISSING_SECRET 132 +#define PROV_R_MISSING_SEED 140 +#define PROV_R_MISSING_SESSION_ID 133 +#define PROV_R_MISSING_TYPE 134 +#define PROV_R_MISSING_XCGHASH 135 +#define PROV_R_ML_DSA_NO_FORMAT 245 +#define PROV_R_ML_KEM_NO_FORMAT 246 +#define PROV_R_MODULE_INTEGRITY_FAILURE 214 +#define PROV_R_NOT_A_PRIVATE_KEY 221 +#define PROV_R_NOT_A_PUBLIC_KEY 220 +#define PROV_R_NOT_INSTANTIATED 193 +#define PROV_R_NOT_PARAMETERS 226 +#define PROV_R_NOT_SUPPORTED 136 +#define PROV_R_NOT_XOF_OR_INVALID_LENGTH 113 +#define PROV_R_NO_INSTANCE_ALLOWED 242 +#define PROV_R_NO_KEY_SET 114 +#define PROV_R_NO_PARAMETERS_SET 177 +#define PROV_R_NULL_LENGTH_POINTER 247 +#define PROV_R_NULL_OUTPUT_BUFFER 248 +#define PROV_R_ONESHOT_CALL_OUT_OF_ORDER 239 +#define PROV_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 178 +#define PROV_R_OUTPUT_BUFFER_TOO_SMALL 106 +#define PROV_R_PARENT_CANNOT_GENERATE_RANDOM_NUMBERS 228 +#define PROV_R_PARENT_CANNOT_SUPPLY_ENTROPY_SEED 187 +#define PROV_R_PARENT_LOCKING_NOT_ENABLED 182 +#define PROV_R_PARENT_STRENGTH_TOO_WEAK 194 +#define PROV_R_PATH_MUST_BE_ABSOLUTE 219 +#define PROV_R_PERSONALISATION_STRING_TOO_LONG 195 +#define PROV_R_PSS_SALTLEN_TOO_SMALL 172 +#define PROV_R_REPEATED_PARAMETER 252 +#define PROV_R_REQUEST_TOO_LARGE_FOR_DRBG 196 +#define PROV_R_REQUIRE_CTR_MODE_CIPHER 206 +#define PROV_R_RESEED_ERROR 197 +#define PROV_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES 222 +#define PROV_R_SEED_SOURCES_MUST_NOT_HAVE_A_PARENT 229 +#define PROV_R_SELF_TEST_KAT_FAILURE 215 +#define PROV_R_SELF_TEST_POST_FAILURE 216 +#define PROV_R_TAG_NOT_NEEDED 120 +#define PROV_R_TAG_NOT_SET 119 +#define PROV_R_TOO_MANY_RECORDS 126 +#define PROV_R_UNABLE_TO_FIND_CIPHERS 207 +#define PROV_R_UNABLE_TO_GET_PARENT_STRENGTH 199 +#define PROV_R_UNABLE_TO_GET_PASSPHRASE 159 +#define PROV_R_UNABLE_TO_INITIALISE_CIPHERS 208 +#define PROV_R_UNABLE_TO_LOAD_SHA256 147 +#define PROV_R_UNABLE_TO_LOCK_PARENT 201 +#define PROV_R_UNABLE_TO_RESEED 204 +#define PROV_R_UNEXPECTED_KEY_PARAMETERS 249 +#define PROV_R_UNSUPPORTED_CEK_ALG 145 +#define PROV_R_UNSUPPORTED_KEY_SIZE 153 +#define PROV_R_UNSUPPORTED_MAC_TYPE 137 +#define PROV_R_UNSUPPORTED_NUMBER_OF_ROUNDS 152 +#define PROV_R_UNSUPPORTED_SELECTION 250 +#define PROV_R_UPDATE_CALL_OUT_OF_ORDER 240 +#define PROV_R_URI_AUTHORITY_UNSUPPORTED 223 +#define PROV_R_VALUE_ERROR 138 +#define PROV_R_WRONG_CIPHERTEXT_SIZE 251 +#define PROV_R_WRONG_FINAL_BLOCK_LENGTH 107 +#define PROV_R_WRONG_OUTPUT_BUFFER_SIZE 139 +#define PROV_R_XOF_DIGESTS_NOT_ALLOWED 183 +#define PROV_R_XTS_DATA_UNIT_IS_TOO_LARGE 148 +#define PROV_R_XTS_DUPLICATED_KEYS 149 + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/provider.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/provider.h new file mode 100644 index 0000000000000000000000000000000000000000..c34beea201f2fa95b7d866d288db1d86c01f9a2b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/provider.h @@ -0,0 +1,94 @@ +/* + * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_PROVIDER_H +#define OPENSSL_PROVIDER_H +#pragma once + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Set and Get a library context search path */ +int OSSL_PROVIDER_set_default_search_path(OSSL_LIB_CTX *, const char *path); +const char *OSSL_PROVIDER_get0_default_search_path(OSSL_LIB_CTX *libctx); + +/* Load and unload a provider */ +OSSL_PROVIDER *OSSL_PROVIDER_load(OSSL_LIB_CTX *, const char *name); +OSSL_PROVIDER *OSSL_PROVIDER_load_ex(OSSL_LIB_CTX *, const char *name, + OSSL_PARAM *params); +OSSL_PROVIDER *OSSL_PROVIDER_try_load(OSSL_LIB_CTX *, const char *name, + int retain_fallbacks); +OSSL_PROVIDER *OSSL_PROVIDER_try_load_ex(OSSL_LIB_CTX *, const char *name, + OSSL_PARAM *params, + int retain_fallbacks); +int OSSL_PROVIDER_unload(OSSL_PROVIDER *prov); +int OSSL_PROVIDER_available(OSSL_LIB_CTX *, const char *name); +int OSSL_PROVIDER_do_all(OSSL_LIB_CTX *ctx, + int (*cb)(OSSL_PROVIDER *provider, void *cbdata), + void *cbdata); + +const OSSL_PARAM *OSSL_PROVIDER_gettable_params(const OSSL_PROVIDER *prov); +int OSSL_PROVIDER_get_params(const OSSL_PROVIDER *prov, OSSL_PARAM params[]); +int OSSL_PROVIDER_self_test(const OSSL_PROVIDER *prov); +int OSSL_PROVIDER_get_capabilities(const OSSL_PROVIDER *prov, + const char *capability, + OSSL_CALLBACK *cb, + void *arg); + +/*- + * Provider configuration parameters are normally set in the configuration file, + * but can also be set early in the main program before a provider is in use by + * multiple threads. + * + * Only UTF8-string values are supported. + */ +int OSSL_PROVIDER_add_conf_parameter(OSSL_PROVIDER *prov, const char *name, + const char *value); +/* + * Retrieves any of the requested configuration parameters for the given + * provider that were set in the configuration file or via the above + * OSSL_PROVIDER_add_parameter() function. + * + * The |params| array elements MUST have type OSSL_PARAM_UTF8_PTR, values are + * returned by reference, not as copies. + */ +int OSSL_PROVIDER_get_conf_parameters(const OSSL_PROVIDER *prov, + OSSL_PARAM params[]); +/* + * Parse a provider configuration parameter as a boolean value, + * or return a default value if unable to retrieve the parameter. + * Values like "1", "yes", "true", ... are true (nonzero). + * Values like "0", "no", "false", ... are false (zero). + */ +int OSSL_PROVIDER_conf_get_bool(const OSSL_PROVIDER *prov, + const char *name, int defval); + +const OSSL_ALGORITHM *OSSL_PROVIDER_query_operation(const OSSL_PROVIDER *prov, + int operation_id, + int *no_cache); +void OSSL_PROVIDER_unquery_operation(const OSSL_PROVIDER *prov, + int operation_id, const OSSL_ALGORITHM *algs); +void *OSSL_PROVIDER_get0_provider_ctx(const OSSL_PROVIDER *prov); +const OSSL_DISPATCH *OSSL_PROVIDER_get0_dispatch(const OSSL_PROVIDER *prov); + +/* Add a built in providers */ +int OSSL_PROVIDER_add_builtin(OSSL_LIB_CTX *, const char *name, + OSSL_provider_init_fn *init_fn); + +/* Information */ +const char *OSSL_PROVIDER_get0_name(const OSSL_PROVIDER *prov); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/quic.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/quic.h new file mode 100644 index 0000000000000000000000000000000000000000..657969bc8acb9c1eab91e5101ae149ab85a04ee4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/quic.h @@ -0,0 +1,75 @@ +/* + * Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_QUIC_H +#define OPENSSL_QUIC_H +#pragma once + +#include +#include + +#ifndef OPENSSL_NO_QUIC + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Method used for non-thread-assisted QUIC client operation. + */ +__owur const SSL_METHOD *OSSL_QUIC_client_method(void); + +/* + * Method used for thread-assisted QUIC client operation. + */ +__owur const SSL_METHOD *OSSL_QUIC_client_thread_method(void); + +/* + * QUIC transport error codes (RFC 9000 s. 20.1) + */ +#define OSSL_QUIC_ERR_NO_ERROR 0x00 +#define OSSL_QUIC_ERR_INTERNAL_ERROR 0x01 +#define OSSL_QUIC_ERR_CONNECTION_REFUSED 0x02 +#define OSSL_QUIC_ERR_FLOW_CONTROL_ERROR 0x03 +#define OSSL_QUIC_ERR_STREAM_LIMIT_ERROR 0x04 +#define OSSL_QUIC_ERR_STREAM_STATE_ERROR 0x05 +#define OSSL_QUIC_ERR_FINAL_SIZE_ERROR 0x06 +#define OSSL_QUIC_ERR_FRAME_ENCODING_ERROR 0x07 +#define OSSL_QUIC_ERR_TRANSPORT_PARAMETER_ERROR 0x08 +#define OSSL_QUIC_ERR_CONNECTION_ID_LIMIT_ERROR 0x09 +#define OSSL_QUIC_ERR_PROTOCOL_VIOLATION 0x0A +#define OSSL_QUIC_ERR_INVALID_TOKEN 0x0B +#define OSSL_QUIC_ERR_APPLICATION_ERROR 0x0C +#define OSSL_QUIC_ERR_CRYPTO_BUFFER_EXCEEDED 0x0D +#define OSSL_QUIC_ERR_KEY_UPDATE_ERROR 0x0E +#define OSSL_QUIC_ERR_AEAD_LIMIT_REACHED 0x0F +#define OSSL_QUIC_ERR_NO_VIABLE_PATH 0x10 + +/* Inclusive range for handshake-specific errors. */ +#define OSSL_QUIC_ERR_CRYPTO_ERR_BEGIN 0x0100 +#define OSSL_QUIC_ERR_CRYPTO_ERR_END 0x01FF + +#define OSSL_QUIC_ERR_CRYPTO_ERR(X) \ + (OSSL_QUIC_ERR_CRYPTO_ERR_BEGIN + (X)) + +/* Local errors. */ +#define OSSL_QUIC_LOCAL_ERR_IDLE_TIMEOUT \ + ((uint64_t)0xFFFFFFFFFFFFFFFFULL) + +/* + * Method used for QUIC server operation. + */ +__owur const SSL_METHOD *OSSL_QUIC_server_method(void); + +#ifdef __cplusplus +} +#endif + +#endif /* OPENSSL_NO_QUIC */ +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/rand.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/rand.h new file mode 100644 index 0000000000000000000000000000000000000000..7272309fba702a9691826b1c7c5d880fa3f90f7e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/rand.h @@ -0,0 +1,133 @@ +/* + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_RAND_H +#define OPENSSL_RAND_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_RAND_H +#endif + +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Default security strength (in the sense of [NIST SP 800-90Ar1]) + * + * NIST SP 800-90Ar1 supports the strength of the DRBG being smaller than that + * of the cipher by collecting less entropy. The current DRBG implementation + * does not take RAND_DRBG_STRENGTH into account and sets the strength of the + * DRBG to that of the cipher. + */ +#define RAND_DRBG_STRENGTH 256 + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +struct rand_meth_st { + int (*seed)(const void *buf, int num); + int (*bytes)(unsigned char *buf, int num); + void (*cleanup)(void); + int (*add)(const void *buf, int num, double randomness); + int (*pseudorand)(unsigned char *buf, int num); + int (*status)(void); +}; + +OSSL_DEPRECATEDIN_3_0 int RAND_set_rand_method(const RAND_METHOD *meth); +OSSL_DEPRECATEDIN_3_0 const RAND_METHOD *RAND_get_rand_method(void); +#ifndef OPENSSL_NO_ENGINE +OSSL_DEPRECATEDIN_3_0 int RAND_set_rand_engine(ENGINE *engine); +#endif + +OSSL_DEPRECATEDIN_3_0 RAND_METHOD *RAND_OpenSSL(void); +#endif /* OPENSSL_NO_DEPRECATED_3_0 */ + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define RAND_cleanup() \ + while (0) \ + continue +#endif +int RAND_bytes(unsigned char *buf, int num); +int RAND_priv_bytes(unsigned char *buf, int num); + +/* + * Equivalent of RAND_priv_bytes() but additionally taking an OSSL_LIB_CTX and + * a strength. + */ +int RAND_priv_bytes_ex(OSSL_LIB_CTX *ctx, unsigned char *buf, size_t num, + unsigned int strength); + +/* + * Equivalent of RAND_bytes() but additionally taking an OSSL_LIB_CTX and + * a strength. + */ +int RAND_bytes_ex(OSSL_LIB_CTX *ctx, unsigned char *buf, size_t num, + unsigned int strength); + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +OSSL_DEPRECATEDIN_1_1_0 int RAND_pseudo_bytes(unsigned char *buf, int num); +#endif + +EVP_RAND_CTX *RAND_get0_primary(OSSL_LIB_CTX *ctx); +EVP_RAND_CTX *RAND_get0_public(OSSL_LIB_CTX *ctx); +EVP_RAND_CTX *RAND_get0_private(OSSL_LIB_CTX *ctx); +int RAND_set0_public(OSSL_LIB_CTX *ctx, EVP_RAND_CTX *rand); +int RAND_set0_private(OSSL_LIB_CTX *ctx, EVP_RAND_CTX *rand); + +int RAND_set_DRBG_type(OSSL_LIB_CTX *ctx, const char *drbg, const char *propq, + const char *cipher, const char *digest); +int RAND_set_seed_source_type(OSSL_LIB_CTX *ctx, const char *seed, + const char *propq); + +void RAND_seed(const void *buf, int num); +void RAND_keep_random_devices_open(int keep); + +#if defined(__ANDROID__) && defined(__NDK_FPABI__) +__NDK_FPABI__ /* __attribute__((pcs("aapcs"))) on ARM */ +#endif + void RAND_add(const void *buf, int num, double randomness); +int RAND_load_file(const char *file, long max_bytes); +int RAND_write_file(const char *file); +const char *RAND_file_name(char *file, size_t num); +int RAND_status(void); + +#ifndef OPENSSL_NO_EGD +int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes); +int RAND_egd(const char *path); +int RAND_egd_bytes(const char *path, int bytes); +#endif + +int RAND_poll(void); + +#if defined(_WIN32) && (defined(BASETYPES) || defined(_WINDEF_H)) +/* application has to include in order to use these */ +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +OSSL_DEPRECATEDIN_1_1_0 void RAND_screen(void); +OSSL_DEPRECATEDIN_1_1_0 int RAND_event(UINT, WPARAM, LPARAM); +#endif +#endif + +int RAND_set1_random_provider(OSSL_LIB_CTX *ctx, OSSL_PROVIDER *p); + +/* Which parameter to provider_random call */ +#define OSSL_PROV_RANDOM_PUBLIC 0 +#define OSSL_PROV_RANDOM_PRIVATE 1 + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/randerr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/randerr.h new file mode 100644 index 0000000000000000000000000000000000000000..6107cdd48167dec0dc3fa45e2a573354043c62f7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/randerr.h @@ -0,0 +1,68 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_RANDERR_H +#define OPENSSL_RANDERR_H +#pragma once + +#include +#include +#include + +/* + * RAND reason codes. + */ +#define RAND_R_ADDITIONAL_INPUT_TOO_LONG 102 +#define RAND_R_ALREADY_INSTANTIATED 103 +#define RAND_R_ARGUMENT_OUT_OF_RANGE 105 +#define RAND_R_CANNOT_OPEN_FILE 121 +#define RAND_R_DRBG_ALREADY_INITIALIZED 129 +#define RAND_R_DRBG_NOT_INITIALISED 104 +#define RAND_R_ENTROPY_INPUT_TOO_LONG 106 +#define RAND_R_ENTROPY_OUT_OF_RANGE 124 +#define RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED 127 +#define RAND_R_ERROR_INITIALISING_DRBG 107 +#define RAND_R_ERROR_INSTANTIATING_DRBG 108 +#define RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT 109 +#define RAND_R_ERROR_RETRIEVING_ENTROPY 110 +#define RAND_R_ERROR_RETRIEVING_NONCE 111 +#define RAND_R_FAILED_TO_CREATE_LOCK 126 +#define RAND_R_FUNC_NOT_IMPLEMENTED 101 +#define RAND_R_FWRITE_ERROR 123 +#define RAND_R_GENERATE_ERROR 112 +#define RAND_R_INSUFFICIENT_DRBG_STRENGTH 139 +#define RAND_R_INTERNAL_ERROR 113 +#define RAND_R_INVALID_PROPERTY_QUERY 137 +#define RAND_R_IN_ERROR_STATE 114 +#define RAND_R_NOT_A_REGULAR_FILE 122 +#define RAND_R_NOT_INSTANTIATED 115 +#define RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED 128 +#define RAND_R_PARENT_LOCKING_NOT_ENABLED 130 +#define RAND_R_PARENT_STRENGTH_TOO_WEAK 131 +#define RAND_R_PERSONALISATION_STRING_TOO_LONG 116 +#define RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED 133 +#define RAND_R_PRNG_NOT_SEEDED 100 +#define RAND_R_RANDOM_POOL_IS_EMPTY 142 +#define RAND_R_RANDOM_POOL_OVERFLOW 125 +#define RAND_R_RANDOM_POOL_UNDERFLOW 134 +#define RAND_R_REQUEST_TOO_LARGE_FOR_DRBG 117 +#define RAND_R_RESEED_ERROR 118 +#define RAND_R_SELFTEST_FAILURE 119 +#define RAND_R_TOO_LITTLE_NONCE_REQUESTED 135 +#define RAND_R_TOO_MUCH_NONCE_REQUESTED 136 +#define RAND_R_UNABLE_TO_CREATE_DRBG 143 +#define RAND_R_UNABLE_TO_FETCH_DRBG 144 +#define RAND_R_UNABLE_TO_GET_PARENT_RESEED_PROP_COUNTER 141 +#define RAND_R_UNABLE_TO_GET_PARENT_STRENGTH 138 +#define RAND_R_UNABLE_TO_LOCK_PARENT 140 +#define RAND_R_UNSUPPORTED_DRBG_FLAGS 132 +#define RAND_R_UNSUPPORTED_DRBG_TYPE 120 + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/rc2.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/rc2.h new file mode 100644 index 0000000000000000000000000000000000000000..7da28f7c72c369da19f0c6bedc61c64089965b36 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/rc2.h @@ -0,0 +1,68 @@ +/* + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_RC2_H +#define OPENSSL_RC2_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_RC2_H +#endif + +#include + +#ifndef OPENSSL_NO_RC2 +#ifdef __cplusplus +extern "C" { +#endif + +#define RC2_BLOCK 8 +#define RC2_KEY_LENGTH 16 + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +typedef unsigned int RC2_INT; + +#define RC2_ENCRYPT 1 +#define RC2_DECRYPT 0 + +typedef struct rc2_key_st { + RC2_INT data[64]; +} RC2_KEY; +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 void RC2_set_key(RC2_KEY *key, int len, + const unsigned char *data, int bits); +OSSL_DEPRECATEDIN_3_0 void RC2_ecb_encrypt(const unsigned char *in, + unsigned char *out, RC2_KEY *key, + int enc); +OSSL_DEPRECATEDIN_3_0 void RC2_encrypt(unsigned long *data, RC2_KEY *key); +OSSL_DEPRECATEDIN_3_0 void RC2_decrypt(unsigned long *data, RC2_KEY *key); +OSSL_DEPRECATEDIN_3_0 void RC2_cbc_encrypt(const unsigned char *in, + unsigned char *out, long length, + RC2_KEY *ks, unsigned char *iv, + int enc); +OSSL_DEPRECATEDIN_3_0 void RC2_cfb64_encrypt(const unsigned char *in, + unsigned char *out, long length, + RC2_KEY *schedule, + unsigned char *ivec, + int *num, int enc); +OSSL_DEPRECATEDIN_3_0 void RC2_ofb64_encrypt(const unsigned char *in, + unsigned char *out, long length, + RC2_KEY *schedule, + unsigned char *ivec, + int *num); +#endif + +#ifdef __cplusplus +} +#endif +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/rc4.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/rc4.h new file mode 100644 index 0000000000000000000000000000000000000000..92dce0c40522471f160f6c68bb5fb0031a7e28f8 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/rc4.h @@ -0,0 +1,47 @@ +/* + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_RC4_H +#define OPENSSL_RC4_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_RC4_H +#endif + +#include + +#ifndef OPENSSL_NO_RC4 +#include +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +typedef struct rc4_key_st { + RC4_INT x, y; + RC4_INT data[256]; +} RC4_KEY; +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 const char *RC4_options(void); +OSSL_DEPRECATEDIN_3_0 void RC4_set_key(RC4_KEY *key, int len, + const unsigned char *data); +OSSL_DEPRECATEDIN_3_0 void RC4(RC4_KEY *key, size_t len, + const unsigned char *indata, + unsigned char *outdata); +#endif + +#ifdef __cplusplus +} +#endif +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/rc5.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/rc5.h new file mode 100644 index 0000000000000000000000000000000000000000..2e91e9854097705e5ca1575192772d7d41228901 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/rc5.h @@ -0,0 +1,79 @@ +/* + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_RC5_H +#define OPENSSL_RC5_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_RC5_H +#endif + +#include + +#ifndef OPENSSL_NO_RC5 +#ifdef __cplusplus +extern "C" { +#endif + +#define RC5_32_BLOCK 8 +#define RC5_32_KEY_LENGTH 16 /* This is a default, max is 255 */ + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define RC5_ENCRYPT 1 +#define RC5_DECRYPT 0 + +#define RC5_32_INT unsigned int + +/* + * This are the only values supported. Tweak the code if you want more The + * most supported modes will be RC5-32/12/16 RC5-32/16/8 + */ +#define RC5_8_ROUNDS 8 +#define RC5_12_ROUNDS 12 +#define RC5_16_ROUNDS 16 + +typedef struct rc5_key_st { + /* Number of rounds */ + int rounds; + RC5_32_INT data[2 * (RC5_16_ROUNDS + 1)]; +} RC5_32_KEY; +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int RC5_32_set_key(RC5_32_KEY *key, int len, + const unsigned char *data, + int rounds); +OSSL_DEPRECATEDIN_3_0 void RC5_32_ecb_encrypt(const unsigned char *in, + unsigned char *out, + RC5_32_KEY *key, + int enc); +OSSL_DEPRECATEDIN_3_0 void RC5_32_encrypt(unsigned long *data, RC5_32_KEY *key); +OSSL_DEPRECATEDIN_3_0 void RC5_32_decrypt(unsigned long *data, RC5_32_KEY *key); +OSSL_DEPRECATEDIN_3_0 void RC5_32_cbc_encrypt(const unsigned char *in, + unsigned char *out, long length, + RC5_32_KEY *ks, unsigned char *iv, + int enc); +OSSL_DEPRECATEDIN_3_0 void RC5_32_cfb64_encrypt(const unsigned char *in, + unsigned char *out, long length, + RC5_32_KEY *schedule, + unsigned char *ivec, int *num, + int enc); +OSSL_DEPRECATEDIN_3_0 void RC5_32_ofb64_encrypt(const unsigned char *in, + unsigned char *out, long length, + RC5_32_KEY *schedule, + unsigned char *ivec, int *num); +#endif + +#ifdef __cplusplus +} +#endif +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ripemd.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ripemd.h new file mode 100644 index 0000000000000000000000000000000000000000..a72d1dad0a176c93cf61db914c410f5d7114aac2 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ripemd.h @@ -0,0 +1,59 @@ +/* + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_RIPEMD_H +#define OPENSSL_RIPEMD_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_RIPEMD_H +#endif + +#include + +#ifndef OPENSSL_NO_RMD160 +#include +#include + +#define RIPEMD160_DIGEST_LENGTH 20 + +#ifdef __cplusplus +extern "C" { +#endif +#if !defined(OPENSSL_NO_DEPRECATED_3_0) + +#define RIPEMD160_LONG unsigned int + +#define RIPEMD160_CBLOCK 64 +#define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK / 4) + +typedef struct RIPEMD160state_st { + RIPEMD160_LONG A, B, C, D, E; + RIPEMD160_LONG Nl, Nh; + RIPEMD160_LONG data[RIPEMD160_LBLOCK]; + unsigned int num; +} RIPEMD160_CTX; +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int RIPEMD160_Init(RIPEMD160_CTX *c); +OSSL_DEPRECATEDIN_3_0 int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, + size_t len); +OSSL_DEPRECATEDIN_3_0 int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c); +OSSL_DEPRECATEDIN_3_0 unsigned char *RIPEMD160(const unsigned char *d, size_t n, + unsigned char *md); +OSSL_DEPRECATEDIN_3_0 void RIPEMD160_Transform(RIPEMD160_CTX *c, + const unsigned char *b); +#endif + +#ifdef __cplusplus +} +#endif +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/rsa.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/rsa.h new file mode 100644 index 0000000000000000000000000000000000000000..08335e0750b62e1dd77f6a9d25c24ae276b2f031 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/rsa.h @@ -0,0 +1,614 @@ +/* + * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_RSA_H +#define OPENSSL_RSA_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_RSA_H +#endif + +#include + +#include +#include +#include +#include +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#include +#endif +#include +#include +#ifndef OPENSSL_NO_STDIO +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef OPENSSL_RSA_MAX_MODULUS_BITS +#define OPENSSL_RSA_MAX_MODULUS_BITS 16384 +#endif + +#define RSA_3 0x3L +#define RSA_F4 0x10001L + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +/* The types RSA and RSA_METHOD are defined in ossl_typ.h */ + +#define OPENSSL_RSA_FIPS_MIN_MODULUS_BITS 2048 + +#ifndef OPENSSL_RSA_SMALL_MODULUS_BITS +#define OPENSSL_RSA_SMALL_MODULUS_BITS 3072 +#endif + +/* exponent limit enforced for "large" modulus only */ +#ifndef OPENSSL_RSA_MAX_PUBEXP_BITS +#define OPENSSL_RSA_MAX_PUBEXP_BITS 64 +#endif +/* based on RFC 8017 appendix A.1.2 */ +#define RSA_ASN1_VERSION_DEFAULT 0 +#define RSA_ASN1_VERSION_MULTI 1 + +#define RSA_DEFAULT_PRIME_NUM 2 + +#define RSA_METHOD_FLAG_NO_CHECK 0x0001 +#define RSA_FLAG_CACHE_PUBLIC 0x0002 +#define RSA_FLAG_CACHE_PRIVATE 0x0004 +#define RSA_FLAG_BLINDING 0x0008 +#define RSA_FLAG_THREAD_SAFE 0x0010 +/* + * This flag means the private key operations will be handled by rsa_mod_exp + * and that they do not depend on the private key components being present: + * for example a key stored in external hardware. Without this flag + * bn_mod_exp gets called when private key components are absent. + */ +#define RSA_FLAG_EXT_PKEY 0x0020 + +/* + * new with 0.9.6j and 0.9.7b; the built-in + * RSA implementation now uses blinding by + * default (ignoring RSA_FLAG_BLINDING), + * but other engines might not need it + */ +#define RSA_FLAG_NO_BLINDING 0x0080 +#endif /* OPENSSL_NO_DEPRECATED_3_0 */ +/* + * Does nothing. Previously this switched off constant time behaviour. + */ +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define RSA_FLAG_NO_CONSTTIME 0x0000 +#endif +/* deprecated name for the flag*/ +/* + * new with 0.9.7h; the built-in RSA + * implementation now uses constant time + * modular exponentiation for secret exponents + * by default. This flag causes the + * faster variable sliding window method to + * be used for all exponents. + */ +#ifndef OPENSSL_NO_DEPRECATED_0_9_8 +#define RSA_FLAG_NO_EXP_CONSTTIME RSA_FLAG_NO_CONSTTIME +#endif + +/*- + * New with 3.0: use part of the flags to denote exact type of RSA key, + * some of which are limited to specific signature and encryption schemes. + * These different types share the same RSA structure, but indicate the + * use of certain fields in that structure. + * Currently known are: + * RSA - this is the "normal" unlimited RSA structure (typenum 0) + * RSASSA-PSS - indicates that the PSS parameters are used. + * RSAES-OAEP - no specific field used for the moment, but OAEP padding + * is expected. (currently unused) + * + * 4 bits allow for 16 types + */ +#define RSA_FLAG_TYPE_MASK 0xF000 +#define RSA_FLAG_TYPE_RSA 0x0000 +#define RSA_FLAG_TYPE_RSASSAPSS 0x1000 +#define RSA_FLAG_TYPE_RSAESOAEP 0x2000 + +int EVP_PKEY_CTX_set_rsa_padding(EVP_PKEY_CTX *ctx, int pad_mode); +int EVP_PKEY_CTX_get_rsa_padding(EVP_PKEY_CTX *ctx, int *pad_mode); + +int EVP_PKEY_CTX_set_rsa_pss_saltlen(EVP_PKEY_CTX *ctx, int saltlen); +int EVP_PKEY_CTX_get_rsa_pss_saltlen(EVP_PKEY_CTX *ctx, int *saltlen); + +int EVP_PKEY_CTX_set_rsa_keygen_bits(EVP_PKEY_CTX *ctx, int bits); +int EVP_PKEY_CTX_set1_rsa_keygen_pubexp(EVP_PKEY_CTX *ctx, BIGNUM *pubexp); +int EVP_PKEY_CTX_set_rsa_keygen_primes(EVP_PKEY_CTX *ctx, int primes); +int EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen(EVP_PKEY_CTX *ctx, int saltlen); +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +int EVP_PKEY_CTX_set_rsa_keygen_pubexp(EVP_PKEY_CTX *ctx, BIGNUM *pubexp); +#endif + +/* Salt length matches digest */ +#define RSA_PSS_SALTLEN_DIGEST -1 +/* Verify only: auto detect salt length */ +#define RSA_PSS_SALTLEN_AUTO -2 +/* Set salt length to maximum possible */ +#define RSA_PSS_SALTLEN_MAX -3 +/* Auto-detect on verify, set salt length to min(maximum possible, digest + * length) on sign */ +#define RSA_PSS_SALTLEN_AUTO_DIGEST_MAX -4 +/* Old compatible max salt length for sign only */ +#define RSA_PSS_SALTLEN_MAX_SIGN -2 + +int EVP_PKEY_CTX_set_rsa_mgf1_md(EVP_PKEY_CTX *ctx, const EVP_MD *md); +int EVP_PKEY_CTX_set_rsa_mgf1_md_name(EVP_PKEY_CTX *ctx, const char *mdname, + const char *mdprops); +int EVP_PKEY_CTX_get_rsa_mgf1_md(EVP_PKEY_CTX *ctx, const EVP_MD **md); +int EVP_PKEY_CTX_get_rsa_mgf1_md_name(EVP_PKEY_CTX *ctx, char *name, + size_t namelen); +int EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md(EVP_PKEY_CTX *ctx, const EVP_MD *md); +int EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md_name(EVP_PKEY_CTX *ctx, + const char *mdname); + +int EVP_PKEY_CTX_set_rsa_pss_keygen_md(EVP_PKEY_CTX *ctx, const EVP_MD *md); +int EVP_PKEY_CTX_set_rsa_pss_keygen_md_name(EVP_PKEY_CTX *ctx, + const char *mdname, + const char *mdprops); + +int EVP_PKEY_CTX_set_rsa_oaep_md(EVP_PKEY_CTX *ctx, const EVP_MD *md); +int EVP_PKEY_CTX_set_rsa_oaep_md_name(EVP_PKEY_CTX *ctx, const char *mdname, + const char *mdprops); +int EVP_PKEY_CTX_get_rsa_oaep_md(EVP_PKEY_CTX *ctx, const EVP_MD **md); +int EVP_PKEY_CTX_get_rsa_oaep_md_name(EVP_PKEY_CTX *ctx, char *name, + size_t namelen); +int EVP_PKEY_CTX_set0_rsa_oaep_label(EVP_PKEY_CTX *ctx, void *label, int llen); +int EVP_PKEY_CTX_get0_rsa_oaep_label(EVP_PKEY_CTX *ctx, unsigned char **label); + +#define EVP_PKEY_CTRL_RSA_PADDING (EVP_PKEY_ALG_CTRL + 1) +#define EVP_PKEY_CTRL_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 2) + +#define EVP_PKEY_CTRL_RSA_KEYGEN_BITS (EVP_PKEY_ALG_CTRL + 3) +#define EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP (EVP_PKEY_ALG_CTRL + 4) +#define EVP_PKEY_CTRL_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 5) + +#define EVP_PKEY_CTRL_GET_RSA_PADDING (EVP_PKEY_ALG_CTRL + 6) +#define EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 7) +#define EVP_PKEY_CTRL_GET_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 8) + +#define EVP_PKEY_CTRL_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 9) +#define EVP_PKEY_CTRL_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 10) + +#define EVP_PKEY_CTRL_GET_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 11) +#define EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 12) + +#define EVP_PKEY_CTRL_RSA_KEYGEN_PRIMES (EVP_PKEY_ALG_CTRL + 13) + +#define EVP_PKEY_CTRL_RSA_IMPLICIT_REJECTION (EVP_PKEY_ALG_CTRL + 14) + +#define RSA_PKCS1_PADDING 1 +#define RSA_NO_PADDING 3 +#define RSA_PKCS1_OAEP_PADDING 4 +#define RSA_X931_PADDING 5 + +/* EVP_PKEY_ only */ +#define RSA_PKCS1_PSS_PADDING 6 +#define RSA_PKCS1_WITH_TLS_PADDING 7 + +/* internal RSA_ only */ +#define RSA_PKCS1_NO_IMPLICIT_REJECT_PADDING 8 + +#define RSA_PKCS1_PADDING_SIZE 11 + +#define RSA_set_app_data(s, arg) RSA_set_ex_data(s, 0, arg) +#define RSA_get_app_data(s) RSA_get_ex_data(s, 0) + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 RSA *RSA_new(void); +OSSL_DEPRECATEDIN_3_0 RSA *RSA_new_method(ENGINE *engine); +OSSL_DEPRECATEDIN_3_0 int RSA_bits(const RSA *rsa); +OSSL_DEPRECATEDIN_3_0 int RSA_size(const RSA *rsa); +OSSL_DEPRECATEDIN_3_0 int RSA_security_bits(const RSA *rsa); + +OSSL_DEPRECATEDIN_3_0 int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d); +OSSL_DEPRECATEDIN_3_0 int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q); +OSSL_DEPRECATEDIN_3_0 int RSA_set0_crt_params(RSA *r, + BIGNUM *dmp1, BIGNUM *dmq1, + BIGNUM *iqmp); +OSSL_DEPRECATEDIN_3_0 int RSA_set0_multi_prime_params(RSA *r, + BIGNUM *primes[], + BIGNUM *exps[], + BIGNUM *coeffs[], + int pnum); +OSSL_DEPRECATEDIN_3_0 void RSA_get0_key(const RSA *r, + const BIGNUM **n, const BIGNUM **e, + const BIGNUM **d); +OSSL_DEPRECATEDIN_3_0 void RSA_get0_factors(const RSA *r, + const BIGNUM **p, const BIGNUM **q); +OSSL_DEPRECATEDIN_3_0 int RSA_get_multi_prime_extra_count(const RSA *r); +OSSL_DEPRECATEDIN_3_0 int RSA_get0_multi_prime_factors(const RSA *r, + const BIGNUM *primes[]); +OSSL_DEPRECATEDIN_3_0 void RSA_get0_crt_params(const RSA *r, + const BIGNUM **dmp1, + const BIGNUM **dmq1, + const BIGNUM **iqmp); +OSSL_DEPRECATEDIN_3_0 +int RSA_get0_multi_prime_crt_params(const RSA *r, const BIGNUM *exps[], + const BIGNUM *coeffs[]); +OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_n(const RSA *d); +OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_e(const RSA *d); +OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_d(const RSA *d); +OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_p(const RSA *d); +OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_q(const RSA *d); +OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_dmp1(const RSA *r); +OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_dmq1(const RSA *r); +OSSL_DEPRECATEDIN_3_0 const BIGNUM *RSA_get0_iqmp(const RSA *r); +OSSL_DEPRECATEDIN_3_0 const RSA_PSS_PARAMS *RSA_get0_pss_params(const RSA *r); +OSSL_DEPRECATEDIN_3_0 void RSA_clear_flags(RSA *r, int flags); +OSSL_DEPRECATEDIN_3_0 int RSA_test_flags(const RSA *r, int flags); +OSSL_DEPRECATEDIN_3_0 void RSA_set_flags(RSA *r, int flags); +OSSL_DEPRECATEDIN_3_0 int RSA_get_version(RSA *r); +OSSL_DEPRECATEDIN_3_0 ENGINE *RSA_get0_engine(const RSA *r); +#endif /* !OPENSSL_NO_DEPRECATED_3_0 */ + +#define EVP_RSA_gen(bits) \ + EVP_PKEY_Q_keygen(NULL, NULL, "RSA", (size_t)(0 + (bits))) + +/* Deprecated version */ +#ifndef OPENSSL_NO_DEPRECATED_0_9_8 +OSSL_DEPRECATEDIN_0_9_8 RSA *RSA_generate_key(int bits, unsigned long e, void (*callback)(int, int, void *), + void *cb_arg); +#endif + +/* New version */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, + BN_GENCB *cb); +/* Multi-prime version */ +OSSL_DEPRECATEDIN_3_0 int RSA_generate_multi_prime_key(RSA *rsa, int bits, + int primes, BIGNUM *e, + BN_GENCB *cb); + +OSSL_DEPRECATEDIN_3_0 +int RSA_X931_derive_ex(RSA *rsa, BIGNUM *p1, BIGNUM *p2, + BIGNUM *q1, BIGNUM *q2, + const BIGNUM *Xp1, const BIGNUM *Xp2, + const BIGNUM *Xp, const BIGNUM *Xq1, + const BIGNUM *Xq2, const BIGNUM *Xq, + const BIGNUM *e, BN_GENCB *cb); +OSSL_DEPRECATEDIN_3_0 int RSA_X931_generate_key_ex(RSA *rsa, int bits, + const BIGNUM *e, + BN_GENCB *cb); + +OSSL_DEPRECATEDIN_3_0 int RSA_check_key(const RSA *); +OSSL_DEPRECATEDIN_3_0 int RSA_check_key_ex(const RSA *, BN_GENCB *cb); +/* next 4 return -1 on error */ +OSSL_DEPRECATEDIN_3_0 +int RSA_public_encrypt(int flen, const unsigned char *from, unsigned char *to, + RSA *rsa, int padding); +OSSL_DEPRECATEDIN_3_0 +int RSA_private_encrypt(int flen, const unsigned char *from, unsigned char *to, + RSA *rsa, int padding); +OSSL_DEPRECATEDIN_3_0 +int RSA_public_decrypt(int flen, const unsigned char *from, unsigned char *to, + RSA *rsa, int padding); +OSSL_DEPRECATEDIN_3_0 +int RSA_private_decrypt(int flen, const unsigned char *from, unsigned char *to, + RSA *rsa, int padding); +OSSL_DEPRECATEDIN_3_0 void RSA_free(RSA *r); +/* "up" the RSA object's reference count */ +OSSL_DEPRECATEDIN_3_0 int RSA_up_ref(RSA *r); +OSSL_DEPRECATEDIN_3_0 int RSA_flags(const RSA *r); + +OSSL_DEPRECATEDIN_3_0 void RSA_set_default_method(const RSA_METHOD *meth); +OSSL_DEPRECATEDIN_3_0 const RSA_METHOD *RSA_get_default_method(void); +OSSL_DEPRECATEDIN_3_0 const RSA_METHOD *RSA_null_method(void); +OSSL_DEPRECATEDIN_3_0 const RSA_METHOD *RSA_get_method(const RSA *rsa); +OSSL_DEPRECATEDIN_3_0 int RSA_set_method(RSA *rsa, const RSA_METHOD *meth); + +/* these are the actual RSA functions */ +OSSL_DEPRECATEDIN_3_0 const RSA_METHOD *RSA_PKCS1_OpenSSL(void); + +DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr(OSSL_DEPRECATEDIN_3_0, + RSA, RSAPublicKey) +DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr(OSSL_DEPRECATEDIN_3_0, + RSA, RSAPrivateKey) +#endif /* !OPENSSL_NO_DEPRECATED_3_0 */ + +int RSA_pkey_ctx_ctrl(EVP_PKEY_CTX *ctx, int optype, int cmd, int p1, void *p2); + +struct rsa_pss_params_st { + X509_ALGOR *hashAlgorithm; + X509_ALGOR *maskGenAlgorithm; + ASN1_INTEGER *saltLength; + ASN1_INTEGER *trailerField; + /* Decoded hash algorithm from maskGenAlgorithm */ + X509_ALGOR *maskHash; +}; + +DECLARE_ASN1_FUNCTIONS(RSA_PSS_PARAMS) +DECLARE_ASN1_DUP_FUNCTION(RSA_PSS_PARAMS) + +struct rsa_oaep_params_st { + X509_ALGOR *hashFunc; + X509_ALGOR *maskGenFunc; + X509_ALGOR *pSourceFunc; + /* Decoded hash algorithm from maskGenFunc */ + X509_ALGOR *maskHash; +}; + +DECLARE_ASN1_FUNCTIONS(RSA_OAEP_PARAMS) + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#ifndef OPENSSL_NO_STDIO +OSSL_DEPRECATEDIN_3_0 int RSA_print_fp(FILE *fp, const RSA *r, int offset); +#endif + +OSSL_DEPRECATEDIN_3_0 int RSA_print(BIO *bp, const RSA *r, int offset); + +/* + * The following 2 functions sign and verify a X509_SIG ASN1 object inside + * PKCS#1 padded RSA encryption + */ +OSSL_DEPRECATEDIN_3_0 int RSA_sign(int type, const unsigned char *m, + unsigned int m_length, unsigned char *sigret, + unsigned int *siglen, RSA *rsa); +OSSL_DEPRECATEDIN_3_0 int RSA_verify(int type, const unsigned char *m, + unsigned int m_length, + const unsigned char *sigbuf, + unsigned int siglen, RSA *rsa); + +/* + * The following 2 function sign and verify a ASN1_OCTET_STRING object inside + * PKCS#1 padded RSA encryption + */ +OSSL_DEPRECATEDIN_3_0 +int RSA_sign_ASN1_OCTET_STRING(int type, + const unsigned char *m, unsigned int m_length, + unsigned char *sigret, unsigned int *siglen, + RSA *rsa); +OSSL_DEPRECATEDIN_3_0 +int RSA_verify_ASN1_OCTET_STRING(int type, + const unsigned char *m, unsigned int m_length, + unsigned char *sigbuf, unsigned int siglen, + RSA *rsa); + +OSSL_DEPRECATEDIN_3_0 int RSA_blinding_on(RSA *rsa, BN_CTX *ctx); +OSSL_DEPRECATEDIN_3_0 void RSA_blinding_off(RSA *rsa); +OSSL_DEPRECATEDIN_3_0 BN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *ctx); + +OSSL_DEPRECATEDIN_3_0 +int RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen, + const unsigned char *f, int fl); +OSSL_DEPRECATEDIN_3_0 +int RSA_padding_check_PKCS1_type_1(unsigned char *to, int tlen, + const unsigned char *f, int fl, + int rsa_len); +OSSL_DEPRECATEDIN_3_0 +int RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen, + const unsigned char *f, int fl); +OSSL_DEPRECATEDIN_3_0 +int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen, + const unsigned char *f, int fl, + int rsa_len); +OSSL_DEPRECATEDIN_3_0 int PKCS1_MGF1(unsigned char *mask, long len, + const unsigned char *seed, long seedlen, + const EVP_MD *dgst); +OSSL_DEPRECATEDIN_3_0 +int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen, + const unsigned char *f, int fl, + const unsigned char *p, int pl); +OSSL_DEPRECATEDIN_3_0 +int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen, + const unsigned char *f, int fl, int rsa_len, + const unsigned char *p, int pl); +OSSL_DEPRECATEDIN_3_0 +int RSA_padding_add_PKCS1_OAEP_mgf1(unsigned char *to, int tlen, + const unsigned char *from, int flen, + const unsigned char *param, int plen, + const EVP_MD *md, const EVP_MD *mgf1md); +OSSL_DEPRECATEDIN_3_0 +int RSA_padding_check_PKCS1_OAEP_mgf1(unsigned char *to, int tlen, + const unsigned char *from, int flen, + int num, + const unsigned char *param, int plen, + const EVP_MD *md, const EVP_MD *mgf1md); +OSSL_DEPRECATEDIN_3_0 int RSA_padding_add_none(unsigned char *to, int tlen, + const unsigned char *f, int fl); +OSSL_DEPRECATEDIN_3_0 int RSA_padding_check_none(unsigned char *to, int tlen, + const unsigned char *f, int fl, + int rsa_len); +OSSL_DEPRECATEDIN_3_0 int RSA_padding_add_X931(unsigned char *to, int tlen, + const unsigned char *f, int fl); +OSSL_DEPRECATEDIN_3_0 int RSA_padding_check_X931(unsigned char *to, int tlen, + const unsigned char *f, int fl, + int rsa_len); +OSSL_DEPRECATEDIN_3_0 int RSA_X931_hash_id(int nid); + +OSSL_DEPRECATEDIN_3_0 +int RSA_verify_PKCS1_PSS(RSA *rsa, const unsigned char *mHash, + const EVP_MD *Hash, const unsigned char *EM, + int sLen); +OSSL_DEPRECATEDIN_3_0 +int RSA_padding_add_PKCS1_PSS(RSA *rsa, unsigned char *EM, + const unsigned char *mHash, const EVP_MD *Hash, + int sLen); + +OSSL_DEPRECATEDIN_3_0 +int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const unsigned char *mHash, + const EVP_MD *Hash, const EVP_MD *mgf1Hash, + const unsigned char *EM, int sLen); + +OSSL_DEPRECATEDIN_3_0 +int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM, + const unsigned char *mHash, + const EVP_MD *Hash, const EVP_MD *mgf1Hash, + int sLen); + +#define RSA_get_ex_new_index(l, p, newf, dupf, freef) \ + CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_RSA, l, p, newf, dupf, freef) +OSSL_DEPRECATEDIN_3_0 int RSA_set_ex_data(RSA *r, int idx, void *arg); +OSSL_DEPRECATEDIN_3_0 void *RSA_get_ex_data(const RSA *r, int idx); + +DECLARE_ASN1_DUP_FUNCTION_name_attr(OSSL_DEPRECATEDIN_3_0, RSA, RSAPublicKey) +DECLARE_ASN1_DUP_FUNCTION_name_attr(OSSL_DEPRECATEDIN_3_0, RSA, RSAPrivateKey) + +/* + * If this flag is set the RSA method is FIPS compliant and can be used in + * FIPS mode. This is set in the validated module method. If an application + * sets this flag in its own methods it is its responsibility to ensure the + * result is compliant. + */ + +#define RSA_FLAG_FIPS_METHOD 0x0400 + +/* + * If this flag is set the operations normally disabled in FIPS mode are + * permitted it is then the applications responsibility to ensure that the + * usage is compliant. + */ + +#define RSA_FLAG_NON_FIPS_ALLOW 0x0400 +/* + * Application has decided PRNG is good enough to generate a key: don't + * check. + */ +#define RSA_FLAG_CHECKED 0x0800 + +OSSL_DEPRECATEDIN_3_0 RSA_METHOD *RSA_meth_new(const char *name, int flags); +OSSL_DEPRECATEDIN_3_0 void RSA_meth_free(RSA_METHOD *meth); +OSSL_DEPRECATEDIN_3_0 RSA_METHOD *RSA_meth_dup(const RSA_METHOD *meth); +OSSL_DEPRECATEDIN_3_0 const char *RSA_meth_get0_name(const RSA_METHOD *meth); +OSSL_DEPRECATEDIN_3_0 int RSA_meth_set1_name(RSA_METHOD *meth, + const char *name); +OSSL_DEPRECATEDIN_3_0 int RSA_meth_get_flags(const RSA_METHOD *meth); +OSSL_DEPRECATEDIN_3_0 int RSA_meth_set_flags(RSA_METHOD *meth, int flags); +OSSL_DEPRECATEDIN_3_0 void *RSA_meth_get0_app_data(const RSA_METHOD *meth); +OSSL_DEPRECATEDIN_3_0 int RSA_meth_set0_app_data(RSA_METHOD *meth, + void *app_data); +OSSL_DEPRECATEDIN_3_0 +int (*RSA_meth_get_pub_enc(const RSA_METHOD *meth))(int flen, + const unsigned char *from, + unsigned char *to, + RSA *rsa, int padding); +OSSL_DEPRECATEDIN_3_0 +int RSA_meth_set_pub_enc(RSA_METHOD *rsa, + int (*pub_enc)(int flen, const unsigned char *from, + unsigned char *to, RSA *rsa, + int padding)); +OSSL_DEPRECATEDIN_3_0 +int (*RSA_meth_get_pub_dec(const RSA_METHOD *meth))(int flen, + const unsigned char *from, + unsigned char *to, + RSA *rsa, int padding); +OSSL_DEPRECATEDIN_3_0 +int RSA_meth_set_pub_dec(RSA_METHOD *rsa, + int (*pub_dec)(int flen, const unsigned char *from, + unsigned char *to, RSA *rsa, + int padding)); +OSSL_DEPRECATEDIN_3_0 +int (*RSA_meth_get_priv_enc(const RSA_METHOD *meth))(int flen, + const unsigned char *from, + unsigned char *to, + RSA *rsa, int padding); +OSSL_DEPRECATEDIN_3_0 +int RSA_meth_set_priv_enc(RSA_METHOD *rsa, + int (*priv_enc)(int flen, const unsigned char *from, + unsigned char *to, RSA *rsa, + int padding)); +OSSL_DEPRECATEDIN_3_0 +int (*RSA_meth_get_priv_dec(const RSA_METHOD *meth))(int flen, + const unsigned char *from, + unsigned char *to, + RSA *rsa, int padding); +OSSL_DEPRECATEDIN_3_0 +int RSA_meth_set_priv_dec(RSA_METHOD *rsa, + int (*priv_dec)(int flen, const unsigned char *from, + unsigned char *to, RSA *rsa, + int padding)); +OSSL_DEPRECATEDIN_3_0 +int (*RSA_meth_get_mod_exp(const RSA_METHOD *meth))(BIGNUM *r0, + const BIGNUM *i, + RSA *rsa, BN_CTX *ctx); +OSSL_DEPRECATEDIN_3_0 +int RSA_meth_set_mod_exp(RSA_METHOD *rsa, + int (*mod_exp)(BIGNUM *r0, const BIGNUM *i, RSA *rsa, + BN_CTX *ctx)); +OSSL_DEPRECATEDIN_3_0 +int (*RSA_meth_get_bn_mod_exp(const RSA_METHOD *meth))(BIGNUM *r, + const BIGNUM *a, + const BIGNUM *p, + const BIGNUM *m, + BN_CTX *ctx, + BN_MONT_CTX *m_ctx); +OSSL_DEPRECATEDIN_3_0 +int RSA_meth_set_bn_mod_exp(RSA_METHOD *rsa, + int (*bn_mod_exp)(BIGNUM *r, + const BIGNUM *a, + const BIGNUM *p, + const BIGNUM *m, + BN_CTX *ctx, + BN_MONT_CTX *m_ctx)); +OSSL_DEPRECATEDIN_3_0 +int (*RSA_meth_get_init(const RSA_METHOD *meth))(RSA *rsa); +OSSL_DEPRECATEDIN_3_0 +int RSA_meth_set_init(RSA_METHOD *rsa, int (*init)(RSA *rsa)); +OSSL_DEPRECATEDIN_3_0 +int (*RSA_meth_get_finish(const RSA_METHOD *meth))(RSA *rsa); +OSSL_DEPRECATEDIN_3_0 +int RSA_meth_set_finish(RSA_METHOD *rsa, int (*finish)(RSA *rsa)); +OSSL_DEPRECATEDIN_3_0 +int (*RSA_meth_get_sign(const RSA_METHOD *meth))(int type, + const unsigned char *m, + unsigned int m_length, + unsigned char *sigret, + unsigned int *siglen, + const RSA *rsa); +OSSL_DEPRECATEDIN_3_0 +int RSA_meth_set_sign(RSA_METHOD *rsa, + int (*sign)(int type, const unsigned char *m, + unsigned int m_length, + unsigned char *sigret, unsigned int *siglen, + const RSA *rsa)); +OSSL_DEPRECATEDIN_3_0 +int (*RSA_meth_get_verify(const RSA_METHOD *meth))(int dtype, + const unsigned char *m, + unsigned int m_length, + const unsigned char *sigbuf, + unsigned int siglen, + const RSA *rsa); +OSSL_DEPRECATEDIN_3_0 +int RSA_meth_set_verify(RSA_METHOD *rsa, + int (*verify)(int dtype, const unsigned char *m, + unsigned int m_length, + const unsigned char *sigbuf, + unsigned int siglen, const RSA *rsa)); +OSSL_DEPRECATEDIN_3_0 +int (*RSA_meth_get_keygen(const RSA_METHOD *meth))(RSA *rsa, int bits, + BIGNUM *e, BN_GENCB *cb); +OSSL_DEPRECATEDIN_3_0 +int RSA_meth_set_keygen(RSA_METHOD *rsa, + int (*keygen)(RSA *rsa, int bits, BIGNUM *e, + BN_GENCB *cb)); +OSSL_DEPRECATEDIN_3_0 +int (*RSA_meth_get_multi_prime_keygen(const RSA_METHOD *meth))(RSA *rsa, + int bits, + int primes, + BIGNUM *e, + BN_GENCB *cb); +OSSL_DEPRECATEDIN_3_0 +int RSA_meth_set_multi_prime_keygen(RSA_METHOD *meth, + int (*keygen)(RSA *rsa, int bits, + int primes, BIGNUM *e, + BN_GENCB *cb)); +#endif /* !OPENSSL_NO_DEPRECATED_3_0 */ + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/rsaerr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/rsaerr.h new file mode 100644 index 0000000000000000000000000000000000000000..8432f5f6552dd0eafdffa634c4a42c3eb60dbda7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/rsaerr.h @@ -0,0 +1,105 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_RSAERR_H +#define OPENSSL_RSAERR_H +#pragma once + +#include +#include +#include + +/* + * RSA reason codes. + */ +#define RSA_R_ALGORITHM_MISMATCH 100 +#define RSA_R_BAD_E_VALUE 101 +#define RSA_R_BAD_FIXED_HEADER_DECRYPT 102 +#define RSA_R_BAD_PAD_BYTE_COUNT 103 +#define RSA_R_BAD_SIGNATURE 104 +#define RSA_R_BLOCK_TYPE_IS_NOT_01 106 +#define RSA_R_BLOCK_TYPE_IS_NOT_02 107 +#define RSA_R_DATA_GREATER_THAN_MOD_LEN 108 +#define RSA_R_DATA_TOO_LARGE 109 +#define RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 110 +#define RSA_R_DATA_TOO_LARGE_FOR_MODULUS 132 +#define RSA_R_DATA_TOO_SMALL 111 +#define RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE 122 +#define RSA_R_DIGEST_DOES_NOT_MATCH 158 +#define RSA_R_DIGEST_NOT_ALLOWED 145 +#define RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY 112 +#define RSA_R_DMP1_NOT_CONGRUENT_TO_D 124 +#define RSA_R_DMQ1_NOT_CONGRUENT_TO_D 125 +#define RSA_R_D_E_NOT_CONGRUENT_TO_1 123 +#define RSA_R_FIRST_OCTET_INVALID 133 +#define RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE 144 +#define RSA_R_INVALID_DIGEST 157 +#define RSA_R_INVALID_DIGEST_LENGTH 143 +#define RSA_R_INVALID_HEADER 137 +#define RSA_R_INVALID_KEYPAIR 171 +#define RSA_R_INVALID_KEY_LENGTH 173 +#define RSA_R_INVALID_LABEL 160 +#define RSA_R_INVALID_LENGTH 181 +#define RSA_R_INVALID_MESSAGE_LENGTH 131 +#define RSA_R_INVALID_MGF1_MD 156 +#define RSA_R_INVALID_MODULUS 174 +#define RSA_R_INVALID_MULTI_PRIME_KEY 167 +#define RSA_R_INVALID_OAEP_PARAMETERS 161 +#define RSA_R_INVALID_PADDING 138 +#define RSA_R_INVALID_PADDING_MODE 141 +#define RSA_R_INVALID_PSS_PARAMETERS 149 +#define RSA_R_INVALID_PSS_SALTLEN 146 +#define RSA_R_INVALID_REQUEST 175 +#define RSA_R_INVALID_SALT_LENGTH 150 +#define RSA_R_INVALID_STRENGTH 176 +#define RSA_R_INVALID_TRAILER 139 +#define RSA_R_INVALID_X931_DIGEST 142 +#define RSA_R_IQMP_NOT_INVERSE_OF_Q 126 +#define RSA_R_KEY_PRIME_NUM_INVALID 165 +#define RSA_R_KEY_SIZE_TOO_SMALL 120 +#define RSA_R_LAST_OCTET_INVALID 134 +#define RSA_R_MGF1_DIGEST_NOT_ALLOWED 152 +#define RSA_R_MISSING_PRIVATE_KEY 179 +#define RSA_R_MODULUS_TOO_LARGE 105 +#define RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R 168 +#define RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D 169 +#define RSA_R_MP_R_NOT_PRIME 170 +#define RSA_R_NO_PUBLIC_EXPONENT 140 +#define RSA_R_NULL_BEFORE_BLOCK_MISSING 113 +#define RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES 172 +#define RSA_R_N_DOES_NOT_EQUAL_P_Q 127 +#define RSA_R_OAEP_DECODING_ERROR 121 +#define RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 148 +#define RSA_R_PADDING_CHECK_FAILED 114 +#define RSA_R_PAIRWISE_TEST_FAILURE 177 +#define RSA_R_PKCS_DECODING_ERROR 159 +#define RSA_R_PSS_SALTLEN_TOO_SMALL 164 +#define RSA_R_PUB_EXPONENT_OUT_OF_RANGE 178 +#define RSA_R_P_NOT_PRIME 128 +#define RSA_R_Q_NOT_PRIME 129 +#define RSA_R_RANDOMNESS_SOURCE_STRENGTH_INSUFFICIENT 180 +#define RSA_R_RSA_OPERATIONS_NOT_SUPPORTED 130 +#define RSA_R_SLEN_CHECK_FAILED 136 +#define RSA_R_SLEN_RECOVERY_FAILED 135 +#define RSA_R_SSLV3_ROLLBACK_ATTACK 115 +#define RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 116 +#define RSA_R_UNKNOWN_ALGORITHM_TYPE 117 +#define RSA_R_UNKNOWN_DIGEST 166 +#define RSA_R_UNKNOWN_MASK_DIGEST 151 +#define RSA_R_UNKNOWN_PADDING_TYPE 118 +#define RSA_R_UNSUPPORTED_ENCRYPTION_TYPE 162 +#define RSA_R_UNSUPPORTED_LABEL_SOURCE 163 +#define RSA_R_UNSUPPORTED_MASK_ALGORITHM 153 +#define RSA_R_UNSUPPORTED_MASK_PARAMETER 154 +#define RSA_R_UNSUPPORTED_SIGNATURE_TYPE 155 +#define RSA_R_VALUE_MISSING 147 +#define RSA_R_WRONG_SIGNATURE_LENGTH 119 + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/safestack.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/safestack.h new file mode 100644 index 0000000000000000000000000000000000000000..600b25c4bf4f85326963e6669a729ca34b5c9605 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/safestack.h @@ -0,0 +1,326 @@ +/* + * WARNING: do not edit! + * Generated by makefile from include\openssl\safestack.h.in + * + * Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* clang-format off */ + +/* clang-format on */ + +#ifndef OPENSSL_SAFESTACK_H +#define OPENSSL_SAFESTACK_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_SAFESTACK_H +#endif + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define STACK_OF(type) struct stack_st_##type + +/* Helper macro for internal use */ +#define SKM_DEFINE_STACK_OF_INTERNAL(t1, t2, t3) \ + STACK_OF(t1); \ + typedef int (*sk_##t1##_compfunc)(const t3 *const *a, const t3 *const *b); \ + typedef void (*sk_##t1##_freefunc)(t3 * a); \ + typedef t3 *(*sk_##t1##_copyfunc)(const t3 *a); \ + static ossl_inline void sk_##t1##_freefunc_thunk(OPENSSL_sk_freefunc freefunc_arg, void *ptr) \ + { \ + sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc)freefunc_arg; \ + freefunc((t3 *)ptr); \ + } \ + static ossl_unused ossl_inline t2 *ossl_check_##t1##_type(t2 *ptr) \ + { \ + return ptr; \ + } \ + static ossl_unused ossl_inline const OPENSSL_STACK *ossl_check_const_##t1##_sk_type(const STACK_OF(t1) *sk) \ + { \ + return (const OPENSSL_STACK *)sk; \ + } \ + static ossl_unused ossl_inline OPENSSL_STACK *ossl_check_##t1##_sk_type(STACK_OF(t1) *sk) \ + { \ + return (OPENSSL_STACK *)sk; \ + } \ + static ossl_unused ossl_inline OPENSSL_sk_compfunc ossl_check_##t1##_compfunc_type(sk_##t1##_compfunc cmp) \ + { \ + return (OPENSSL_sk_compfunc)cmp; \ + } \ + static ossl_unused ossl_inline OPENSSL_sk_copyfunc ossl_check_##t1##_copyfunc_type(sk_##t1##_copyfunc cpy) \ + { \ + return (OPENSSL_sk_copyfunc)cpy; \ + } \ + static ossl_unused ossl_inline OPENSSL_sk_freefunc ossl_check_##t1##_freefunc_type(sk_##t1##_freefunc fr) \ + { \ + return (OPENSSL_sk_freefunc)fr; \ + } + +#define SKM_DEFINE_STACK_OF(t1, t2, t3) \ + STACK_OF(t1); \ + typedef int (*sk_##t1##_compfunc)(const t3 *const *a, const t3 *const *b); \ + typedef void (*sk_##t1##_freefunc)(t3 * a); \ + typedef t3 *(*sk_##t1##_copyfunc)(const t3 *a); \ + static ossl_inline void sk_##t1##_freefunc_thunk(OPENSSL_sk_freefunc freefunc_arg, void *ptr) \ + { \ + sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc)freefunc_arg; \ + freefunc((t3 *)ptr); \ + } \ + static ossl_unused ossl_inline int sk_##t1##_num(const STACK_OF(t1) *sk) \ + { \ + return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \ + } \ + static ossl_unused ossl_inline t2 *sk_##t1##_value(const STACK_OF(t1) *sk, int idx) \ + { \ + return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \ + } \ + static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_new(sk_##t1##_compfunc compare) \ + { \ + OPENSSL_STACK *ret = OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); \ + OPENSSL_sk_freefunc_thunk f_thunk; \ + \ + f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \ + return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk); \ + } \ + static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_new_null(void) \ + { \ + return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \ + } \ + static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_new_reserve(sk_##t1##_compfunc compare, int n) \ + { \ + OPENSSL_STACK *ret = OPENSSL_sk_new_reserve((OPENSSL_sk_compfunc)compare, n); \ + OPENSSL_sk_freefunc_thunk f_thunk; \ + \ + f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \ + return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk); \ + } \ + static ossl_unused ossl_inline int sk_##t1##_reserve(STACK_OF(t1) *sk, int n) \ + { \ + return OPENSSL_sk_reserve((OPENSSL_STACK *)sk, n); \ + } \ + static ossl_unused ossl_inline void sk_##t1##_free(STACK_OF(t1) *sk) \ + { \ + OPENSSL_sk_free((OPENSSL_STACK *)sk); \ + } \ + static ossl_unused ossl_inline void sk_##t1##_zero(STACK_OF(t1) *sk) \ + { \ + OPENSSL_sk_zero((OPENSSL_STACK *)sk); \ + } \ + static ossl_unused ossl_inline t2 *sk_##t1##_delete(STACK_OF(t1) *sk, int i) \ + { \ + return (t2 *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i); \ + } \ + static ossl_unused ossl_inline t2 *sk_##t1##_delete_ptr(STACK_OF(t1) *sk, t2 *ptr) \ + { \ + return (t2 *)OPENSSL_sk_delete_ptr((OPENSSL_STACK *)sk, \ + (const void *)ptr); \ + } \ + static ossl_unused ossl_inline int sk_##t1##_push(STACK_OF(t1) *sk, t2 *ptr) \ + { \ + return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \ + } \ + static ossl_unused ossl_inline int sk_##t1##_unshift(STACK_OF(t1) *sk, t2 *ptr) \ + { \ + return OPENSSL_sk_unshift((OPENSSL_STACK *)sk, (const void *)ptr); \ + } \ + static ossl_unused ossl_inline t2 *sk_##t1##_pop(STACK_OF(t1) *sk) \ + { \ + return (t2 *)OPENSSL_sk_pop((OPENSSL_STACK *)sk); \ + } \ + static ossl_unused ossl_inline t2 *sk_##t1##_shift(STACK_OF(t1) *sk) \ + { \ + return (t2 *)OPENSSL_sk_shift((OPENSSL_STACK *)sk); \ + } \ + static ossl_unused ossl_inline void sk_##t1##_pop_free(STACK_OF(t1) *sk, sk_##t1##_freefunc freefunc) \ + { \ + OPENSSL_sk_freefunc_thunk f_thunk; \ + \ + f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \ + sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \ + \ + OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \ + } \ + static ossl_unused ossl_inline int sk_##t1##_insert(STACK_OF(t1) *sk, t2 *ptr, int idx) \ + { \ + return OPENSSL_sk_insert((OPENSSL_STACK *)sk, (const void *)ptr, idx); \ + } \ + static ossl_unused ossl_inline t2 *sk_##t1##_set(STACK_OF(t1) *sk, int idx, t2 *ptr) \ + { \ + return (t2 *)OPENSSL_sk_set((OPENSSL_STACK *)sk, idx, (const void *)ptr); \ + } \ + static ossl_unused ossl_inline int sk_##t1##_find(STACK_OF(t1) *sk, t2 *ptr) \ + { \ + return OPENSSL_sk_find((OPENSSL_STACK *)sk, (const void *)ptr); \ + } \ + static ossl_unused ossl_inline int sk_##t1##_find_ex(STACK_OF(t1) *sk, t2 *ptr) \ + { \ + return OPENSSL_sk_find_ex((OPENSSL_STACK *)sk, (const void *)ptr); \ + } \ + static ossl_unused ossl_inline int sk_##t1##_find_all(STACK_OF(t1) *sk, t2 *ptr, int *pnum) \ + { \ + return OPENSSL_sk_find_all((OPENSSL_STACK *)sk, (const void *)ptr, pnum); \ + } \ + static ossl_unused ossl_inline void sk_##t1##_sort(STACK_OF(t1) *sk) \ + { \ + OPENSSL_sk_sort((OPENSSL_STACK *)sk); \ + } \ + static ossl_unused ossl_inline int sk_##t1##_is_sorted(const STACK_OF(t1) *sk) \ + { \ + return OPENSSL_sk_is_sorted((const OPENSSL_STACK *)sk); \ + } \ + static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_dup(const STACK_OF(t1) *sk) \ + { \ + return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); \ + } \ + static ossl_unused ossl_inline STACK_OF(t1) *sk_##t1##_deep_copy(const STACK_OF(t1) *sk, \ + sk_##t1##_copyfunc copyfunc, \ + sk_##t1##_freefunc freefunc) \ + { \ + return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, \ + (OPENSSL_sk_copyfunc)copyfunc, \ + (OPENSSL_sk_freefunc)freefunc); \ + } \ + static ossl_unused ossl_inline sk_##t1##_compfunc sk_##t1##_set_cmp_func(STACK_OF(t1) *sk, sk_##t1##_compfunc compare) \ + { \ + return (sk_##t1##_compfunc)OPENSSL_sk_set_cmp_func((OPENSSL_STACK *)sk, (OPENSSL_sk_compfunc)compare); \ + } + +#define DEFINE_STACK_OF(t) SKM_DEFINE_STACK_OF(t, t, t) +#define DEFINE_STACK_OF_CONST(t) SKM_DEFINE_STACK_OF(t, const t, t) +#define DEFINE_SPECIAL_STACK_OF(t1, t2) SKM_DEFINE_STACK_OF(t1, t2, t2) +#define DEFINE_SPECIAL_STACK_OF_CONST(t1, t2) \ + SKM_DEFINE_STACK_OF(t1, const t2, t2) + +/*- + * Strings are special: normally an lhash entry will point to a single + * (somewhat) mutable object. In the case of strings: + * + * a) Instead of a single char, there is an array of chars, NUL-terminated. + * b) The string may have be immutable. + * + * So, they need their own declarations. Especially important for + * type-checking tools, such as Deputy. + * + * In practice, however, it appears to be hard to have a const + * string. For now, I'm settling for dealing with the fact it is a + * string at all. + */ +typedef char *OPENSSL_STRING; +typedef const char *OPENSSL_CSTRING; + +/*- + * Confusingly, LHASH_OF(STRING) deals with char ** throughout, but + * STACK_OF(STRING) is really more like STACK_OF(char), only, as mentioned + * above, instead of a single char each entry is a NUL-terminated array of + * chars. So, we have to implement STRING specially for STACK_OF. This is + * dealt with in the autogenerated macros below. + */ +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(OPENSSL_STRING, char, char) +#define sk_OPENSSL_STRING_num(sk) OPENSSL_sk_num(ossl_check_const_OPENSSL_STRING_sk_type(sk)) +#define sk_OPENSSL_STRING_value(sk, idx) ((char *)OPENSSL_sk_value(ossl_check_const_OPENSSL_STRING_sk_type(sk), (idx))) +#define sk_OPENSSL_STRING_new(cmp) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_new(ossl_check_OPENSSL_STRING_compfunc_type(cmp))) +#define sk_OPENSSL_STRING_new_null() ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_new_null()) +#define sk_OPENSSL_STRING_new_reserve(cmp, n) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_new_reserve(ossl_check_OPENSSL_STRING_compfunc_type(cmp), (n))) +#define sk_OPENSSL_STRING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OPENSSL_STRING_sk_type(sk), (n)) +#define sk_OPENSSL_STRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_STRING_sk_type(sk)) +#define sk_OPENSSL_STRING_zero(sk) OPENSSL_sk_zero(ossl_check_OPENSSL_STRING_sk_type(sk)) +#define sk_OPENSSL_STRING_delete(sk, i) ((char *)OPENSSL_sk_delete(ossl_check_OPENSSL_STRING_sk_type(sk), (i))) +#define sk_OPENSSL_STRING_delete_ptr(sk, ptr) ((char *)OPENSSL_sk_delete_ptr(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr))) +#define sk_OPENSSL_STRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr)) +#define sk_OPENSSL_STRING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr)) +#define sk_OPENSSL_STRING_pop(sk) ((char *)OPENSSL_sk_pop(ossl_check_OPENSSL_STRING_sk_type(sk))) +#define sk_OPENSSL_STRING_shift(sk) ((char *)OPENSSL_sk_shift(ossl_check_OPENSSL_STRING_sk_type(sk))) +#define sk_OPENSSL_STRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_freefunc_type(freefunc)) +#define sk_OPENSSL_STRING_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr), (idx)) +#define sk_OPENSSL_STRING_set(sk, idx, ptr) ((char *)OPENSSL_sk_set(ossl_check_OPENSSL_STRING_sk_type(sk), (idx), ossl_check_OPENSSL_STRING_type(ptr))) +#define sk_OPENSSL_STRING_find(sk, ptr) OPENSSL_sk_find(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr)) +#define sk_OPENSSL_STRING_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr)) +#define sk_OPENSSL_STRING_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr), pnum) +#define sk_OPENSSL_STRING_sort(sk) OPENSSL_sk_sort(ossl_check_OPENSSL_STRING_sk_type(sk)) +#define sk_OPENSSL_STRING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OPENSSL_STRING_sk_type(sk)) +#define sk_OPENSSL_STRING_dup(sk) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_dup(ossl_check_const_OPENSSL_STRING_sk_type(sk))) +#define sk_OPENSSL_STRING_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_deep_copy(ossl_check_const_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_copyfunc_type(copyfunc), ossl_check_OPENSSL_STRING_freefunc_type(freefunc))) +#define sk_OPENSSL_STRING_set_cmp_func(sk, cmp) ((sk_OPENSSL_STRING_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_compfunc_type(cmp))) +SKM_DEFINE_STACK_OF_INTERNAL(OPENSSL_CSTRING, const char, char) +#define sk_OPENSSL_CSTRING_num(sk) OPENSSL_sk_num(ossl_check_const_OPENSSL_CSTRING_sk_type(sk)) +#define sk_OPENSSL_CSTRING_value(sk, idx) ((const char *)OPENSSL_sk_value(ossl_check_const_OPENSSL_CSTRING_sk_type(sk), (idx))) +#define sk_OPENSSL_CSTRING_new(cmp) ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new(ossl_check_OPENSSL_CSTRING_compfunc_type(cmp))) +#define sk_OPENSSL_CSTRING_new_null() ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_null()) +#define sk_OPENSSL_CSTRING_new_reserve(cmp, n) ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_reserve(ossl_check_OPENSSL_CSTRING_compfunc_type(cmp), (n))) +#define sk_OPENSSL_CSTRING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OPENSSL_CSTRING_sk_type(sk), (n)) +#define sk_OPENSSL_CSTRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_CSTRING_sk_type(sk)) +#define sk_OPENSSL_CSTRING_zero(sk) OPENSSL_sk_zero(ossl_check_OPENSSL_CSTRING_sk_type(sk)) +#define sk_OPENSSL_CSTRING_delete(sk, i) ((const char *)OPENSSL_sk_delete(ossl_check_OPENSSL_CSTRING_sk_type(sk), (i))) +#define sk_OPENSSL_CSTRING_delete_ptr(sk, ptr) ((const char *)OPENSSL_sk_delete_ptr(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr))) +#define sk_OPENSSL_CSTRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr)) +#define sk_OPENSSL_CSTRING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr)) +#define sk_OPENSSL_CSTRING_pop(sk) ((const char *)OPENSSL_sk_pop(ossl_check_OPENSSL_CSTRING_sk_type(sk))) +#define sk_OPENSSL_CSTRING_shift(sk) ((const char *)OPENSSL_sk_shift(ossl_check_OPENSSL_CSTRING_sk_type(sk))) +#define sk_OPENSSL_CSTRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_freefunc_type(freefunc)) +#define sk_OPENSSL_CSTRING_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr), (idx)) +#define sk_OPENSSL_CSTRING_set(sk, idx, ptr) ((const char *)OPENSSL_sk_set(ossl_check_OPENSSL_CSTRING_sk_type(sk), (idx), ossl_check_OPENSSL_CSTRING_type(ptr))) +#define sk_OPENSSL_CSTRING_find(sk, ptr) OPENSSL_sk_find(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr)) +#define sk_OPENSSL_CSTRING_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr)) +#define sk_OPENSSL_CSTRING_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr), pnum) +#define sk_OPENSSL_CSTRING_sort(sk) OPENSSL_sk_sort(ossl_check_OPENSSL_CSTRING_sk_type(sk)) +#define sk_OPENSSL_CSTRING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OPENSSL_CSTRING_sk_type(sk)) +#define sk_OPENSSL_CSTRING_dup(sk) ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_dup(ossl_check_const_OPENSSL_CSTRING_sk_type(sk))) +#define sk_OPENSSL_CSTRING_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_deep_copy(ossl_check_const_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_copyfunc_type(copyfunc), ossl_check_OPENSSL_CSTRING_freefunc_type(freefunc))) +#define sk_OPENSSL_CSTRING_set_cmp_func(sk, cmp) ((sk_OPENSSL_CSTRING_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_compfunc_type(cmp))) + +/* clang-format on */ + +#if !defined(OPENSSL_NO_DEPRECATED_3_0) +/* + * This is not used by OpenSSL. A block of bytes, NOT nul-terminated. + * These should also be distinguished from "normal" stacks. + */ +typedef void *OPENSSL_BLOCK; +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(OPENSSL_BLOCK, void, void) +#define sk_OPENSSL_BLOCK_num(sk) OPENSSL_sk_num(ossl_check_const_OPENSSL_BLOCK_sk_type(sk)) +#define sk_OPENSSL_BLOCK_value(sk, idx) ((void *)OPENSSL_sk_value(ossl_check_const_OPENSSL_BLOCK_sk_type(sk), (idx))) +#define sk_OPENSSL_BLOCK_new(cmp) ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_new(ossl_check_OPENSSL_BLOCK_compfunc_type(cmp))) +#define sk_OPENSSL_BLOCK_new_null() ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_new_null()) +#define sk_OPENSSL_BLOCK_new_reserve(cmp, n) ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_new_reserve(ossl_check_OPENSSL_BLOCK_compfunc_type(cmp), (n))) +#define sk_OPENSSL_BLOCK_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OPENSSL_BLOCK_sk_type(sk), (n)) +#define sk_OPENSSL_BLOCK_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_BLOCK_sk_type(sk)) +#define sk_OPENSSL_BLOCK_zero(sk) OPENSSL_sk_zero(ossl_check_OPENSSL_BLOCK_sk_type(sk)) +#define sk_OPENSSL_BLOCK_delete(sk, i) ((void *)OPENSSL_sk_delete(ossl_check_OPENSSL_BLOCK_sk_type(sk), (i))) +#define sk_OPENSSL_BLOCK_delete_ptr(sk, ptr) ((void *)OPENSSL_sk_delete_ptr(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr))) +#define sk_OPENSSL_BLOCK_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr)) +#define sk_OPENSSL_BLOCK_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr)) +#define sk_OPENSSL_BLOCK_pop(sk) ((void *)OPENSSL_sk_pop(ossl_check_OPENSSL_BLOCK_sk_type(sk))) +#define sk_OPENSSL_BLOCK_shift(sk) ((void *)OPENSSL_sk_shift(ossl_check_OPENSSL_BLOCK_sk_type(sk))) +#define sk_OPENSSL_BLOCK_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_freefunc_type(freefunc)) +#define sk_OPENSSL_BLOCK_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr), (idx)) +#define sk_OPENSSL_BLOCK_set(sk, idx, ptr) ((void *)OPENSSL_sk_set(ossl_check_OPENSSL_BLOCK_sk_type(sk), (idx), ossl_check_OPENSSL_BLOCK_type(ptr))) +#define sk_OPENSSL_BLOCK_find(sk, ptr) OPENSSL_sk_find(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr)) +#define sk_OPENSSL_BLOCK_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr)) +#define sk_OPENSSL_BLOCK_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_type(ptr), pnum) +#define sk_OPENSSL_BLOCK_sort(sk) OPENSSL_sk_sort(ossl_check_OPENSSL_BLOCK_sk_type(sk)) +#define sk_OPENSSL_BLOCK_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OPENSSL_BLOCK_sk_type(sk)) +#define sk_OPENSSL_BLOCK_dup(sk) ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_dup(ossl_check_const_OPENSSL_BLOCK_sk_type(sk))) +#define sk_OPENSSL_BLOCK_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OPENSSL_BLOCK) *)OPENSSL_sk_deep_copy(ossl_check_const_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_copyfunc_type(copyfunc), ossl_check_OPENSSL_BLOCK_freefunc_type(freefunc))) +#define sk_OPENSSL_BLOCK_set_cmp_func(sk, cmp) ((sk_OPENSSL_BLOCK_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OPENSSL_BLOCK_sk_type(sk), ossl_check_OPENSSL_BLOCK_compfunc_type(cmp))) + +/* clang-format on */ +#endif + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/seed.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/seed.h new file mode 100644 index 0000000000000000000000000000000000000000..8c2b20a4d801d8745af5855fde5c324c6de6c5a1 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/seed.h @@ -0,0 +1,112 @@ +/* + * Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* + * Copyright (c) 2007 KISA(Korea Information Security Agency). 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. Neither the name of author 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 AUTHOR 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 AUTHOR 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. + */ + +#ifndef OPENSSL_SEED_H +#define OPENSSL_SEED_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_SEED_H +#endif + +#include + +#ifndef OPENSSL_NO_SEED +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define SEED_BLOCK_SIZE 16 +#define SEED_KEY_LENGTH 16 + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +/* look whether we need 'long' to get 32 bits */ +#ifdef AES_LONG +#ifndef SEED_LONG +#define SEED_LONG 1 +#endif +#endif + +typedef struct seed_key_st { +#ifdef SEED_LONG + unsigned long data[32]; +#else + unsigned int data[32]; +#endif +} SEED_KEY_SCHEDULE; +#endif /* OPENSSL_NO_DEPRECATED_3_0 */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +void SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH], + SEED_KEY_SCHEDULE *ks); +OSSL_DEPRECATEDIN_3_0 +void SEED_encrypt(const unsigned char s[SEED_BLOCK_SIZE], + unsigned char d[SEED_BLOCK_SIZE], + const SEED_KEY_SCHEDULE *ks); +OSSL_DEPRECATEDIN_3_0 +void SEED_decrypt(const unsigned char s[SEED_BLOCK_SIZE], + unsigned char d[SEED_BLOCK_SIZE], + const SEED_KEY_SCHEDULE *ks); +OSSL_DEPRECATEDIN_3_0 +void SEED_ecb_encrypt(const unsigned char *in, + unsigned char *out, + const SEED_KEY_SCHEDULE *ks, int enc); +OSSL_DEPRECATEDIN_3_0 +void SEED_cbc_encrypt(const unsigned char *in, unsigned char *out, size_t len, + const SEED_KEY_SCHEDULE *ks, + unsigned char ivec[SEED_BLOCK_SIZE], + int enc); +OSSL_DEPRECATEDIN_3_0 +void SEED_cfb128_encrypt(const unsigned char *in, unsigned char *out, + size_t len, const SEED_KEY_SCHEDULE *ks, + unsigned char ivec[SEED_BLOCK_SIZE], + int *num, int enc); +OSSL_DEPRECATEDIN_3_0 +void SEED_ofb128_encrypt(const unsigned char *in, unsigned char *out, + size_t len, const SEED_KEY_SCHEDULE *ks, + unsigned char ivec[SEED_BLOCK_SIZE], + int *num); +#endif + +#ifdef __cplusplus +} +#endif +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/self_test.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/self_test.h new file mode 100644 index 0000000000000000000000000000000000000000..6e671c1a9858106d13d3cd99fb25d968390eae57 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/self_test.h @@ -0,0 +1,116 @@ +/* + * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_SELF_TEST_H +#define OPENSSL_SELF_TEST_H +#pragma once + +#include /* OSSL_CALLBACK */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* The test event phases */ +#define OSSL_SELF_TEST_PHASE_NONE "None" +#define OSSL_SELF_TEST_PHASE_START "Start" +#define OSSL_SELF_TEST_PHASE_CORRUPT "Corrupt" +#define OSSL_SELF_TEST_PHASE_PASS "Pass" +#define OSSL_SELF_TEST_PHASE_FAIL "Fail" + +/* Test event categories */ +#define OSSL_SELF_TEST_TYPE_NONE "None" +#define OSSL_SELF_TEST_TYPE_MODULE_INTEGRITY "Module_Integrity" +#define OSSL_SELF_TEST_TYPE_INSTALL_INTEGRITY "Install_Integrity" +#define OSSL_SELF_TEST_TYPE_CRNG "Continuous_RNG_Test" +#define OSSL_SELF_TEST_TYPE_PCT "Conditional_PCT" +#define OSSL_SELF_TEST_TYPE_PCT_KAT "Conditional_KAT" +#define OSSL_SELF_TEST_TYPE_PCT_IMPORT "Import_PCT" +#define OSSL_SELF_TEST_TYPE_KAT_INTEGRITY "KAT_Integrity" +#define OSSL_SELF_TEST_TYPE_KAT_CIPHER "KAT_Cipher" +#define OSSL_SELF_TEST_TYPE_KAT_ASYM_CIPHER "KAT_AsymmetricCipher" +#define OSSL_SELF_TEST_TYPE_KAT_ASYM_KEYGEN "KAT_AsymmetricKeyGeneration" +#define OSSL_SELF_TEST_TYPE_KAT_KEM "KAT_KEM" +#define OSSL_SELF_TEST_TYPE_KAT_DIGEST "KAT_Digest" +#define OSSL_SELF_TEST_TYPE_KAT_SIGNATURE "KAT_Signature" +#define OSSL_SELF_TEST_TYPE_PCT_SIGNATURE "PCT_Signature" +#define OSSL_SELF_TEST_TYPE_KAT_KDF "KAT_KDF" +#define OSSL_SELF_TEST_TYPE_KAT_KA "KAT_KA" +#define OSSL_SELF_TEST_TYPE_DRBG "DRBG" + +/* Test event sub categories */ +#define OSSL_SELF_TEST_DESC_NONE "None" +#define OSSL_SELF_TEST_DESC_INTEGRITY_HMAC "HMAC" +#define OSSL_SELF_TEST_DESC_PCT_RSA "RSA" +#define OSSL_SELF_TEST_DESC_PCT_RSA_PKCS1 "RSA" +#define OSSL_SELF_TEST_DESC_PCT_ECDSA "ECDSA" +#define OSSL_SELF_TEST_DESC_PCT_EDDSA "EDDSA" +#define OSSL_SELF_TEST_DESC_PCT_DH "DH" +#define OSSL_SELF_TEST_DESC_PCT_DSA "DSA" +#define OSSL_SELF_TEST_DESC_PCT_ML_DSA "ML-DSA" +#define OSSL_SELF_TEST_DESC_PCT_ML_KEM "ML-KEM" +#define OSSL_SELF_TEST_DESC_PCT_SLH_DSA "SLH-DSA" +#define OSSL_SELF_TEST_DESC_CIPHER_AES_GCM "AES_GCM" +#define OSSL_SELF_TEST_DESC_CIPHER_AES_ECB "AES_ECB_Decrypt" +#define OSSL_SELF_TEST_DESC_CIPHER_TDES "TDES" +#define OSSL_SELF_TEST_DESC_ASYM_RSA_ENC "RSA_Encrypt" +#define OSSL_SELF_TEST_DESC_ASYM_RSA_DEC "RSA_Decrypt" +#define OSSL_SELF_TEST_DESC_MD_SHA1 "SHA1" +#define OSSL_SELF_TEST_DESC_MD_SHA2 "SHA2" +#define OSSL_SELF_TEST_DESC_MD_SHA3 "SHA3" +#define OSSL_SELF_TEST_DESC_SIGN_DSA "DSA" +#define OSSL_SELF_TEST_DESC_SIGN_RSA "RSA" +#define OSSL_SELF_TEST_DESC_SIGN_ECDSA "ECDSA" +#define OSSL_SELF_TEST_DESC_SIGN_DetECDSA "DetECDSA" +#define OSSL_SELF_TEST_DESC_SIGN_EDDSA "EDDSA" +#define OSSL_SELF_TEST_DESC_SIGN_LMS "LMS" +#define OSSL_SELF_TEST_DESC_SIGN_ML_DSA "ML-DSA" +#define OSSL_SELF_TEST_DESC_SIGN_SLH_DSA "SLH-DSA" +#define OSSL_SELF_TEST_DESC_KEM "KEM" +#define OSSL_SELF_TEST_DESC_DRBG_CTR "CTR" +#define OSSL_SELF_TEST_DESC_DRBG_HASH "HASH" +#define OSSL_SELF_TEST_DESC_DRBG_HMAC "HMAC" +#define OSSL_SELF_TEST_DESC_KA_DH "DH" +#define OSSL_SELF_TEST_DESC_KA_ECDH "ECDH" +#define OSSL_SELF_TEST_DESC_KDF_HKDF "HKDF" +#define OSSL_SELF_TEST_DESC_KDF_SSKDF "SSKDF" +#define OSSL_SELF_TEST_DESC_KDF_X963KDF "X963KDF" +#define OSSL_SELF_TEST_DESC_KDF_X942KDF "X942KDF" +#define OSSL_SELF_TEST_DESC_KDF_PBKDF2 "PBKDF2" +#define OSSL_SELF_TEST_DESC_KDF_SSHKDF "SSHKDF" +#define OSSL_SELF_TEST_DESC_KDF_TLS12_PRF "TLS12_PRF" +#define OSSL_SELF_TEST_DESC_KDF_KBKDF "KBKDF" +#define OSSL_SELF_TEST_DESC_KDF_KBKDF_KMAC "KBKDF_KMAC" +#define OSSL_SELF_TEST_DESC_KDF_TLS13_EXTRACT "TLS13_KDF_EXTRACT" +#define OSSL_SELF_TEST_DESC_KDF_TLS13_EXPAND "TLS13_KDF_EXPAND" +#define OSSL_SELF_TEST_DESC_RNG "RNG" +#define OSSL_SELF_TEST_DESC_KEYGEN_ML_DSA "ML-DSA" +#define OSSL_SELF_TEST_DESC_KEYGEN_ML_KEM "ML-KEM" +#define OSSL_SELF_TEST_DESC_KEYGEN_SLH_DSA "SLH-DSA" +#define OSSL_SELF_TEST_DESC_ENCAP_KEM "KEM_Encap" +#define OSSL_SELF_TEST_DESC_DECAP_KEM "KEM_Decap" +#define OSSL_SELF_TEST_DESC_DECAP_KEM_FAIL "KEM_Decap_Reject" + +void OSSL_SELF_TEST_set_callback(OSSL_LIB_CTX *libctx, OSSL_CALLBACK *cb, + void *cbarg); +void OSSL_SELF_TEST_get_callback(OSSL_LIB_CTX *libctx, OSSL_CALLBACK **cb, + void **cbarg); + +OSSL_SELF_TEST *OSSL_SELF_TEST_new(OSSL_CALLBACK *cb, void *cbarg); +void OSSL_SELF_TEST_free(OSSL_SELF_TEST *st); + +void OSSL_SELF_TEST_onbegin(OSSL_SELF_TEST *st, const char *type, + const char *desc); +int OSSL_SELF_TEST_oncorrupt_byte(OSSL_SELF_TEST *st, unsigned char *bytes); +void OSSL_SELF_TEST_onend(OSSL_SELF_TEST *st, int ret); + +#ifdef __cplusplus +} +#endif +#endif /* OPENSSL_SELF_TEST_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/sha.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/sha.h new file mode 100644 index 0000000000000000000000000000000000000000..52b02661f6244c72c209d769f91bff069f673b60 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/sha.h @@ -0,0 +1,139 @@ +/* + * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_SHA_H +#define OPENSSL_SHA_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_SHA_H +#endif + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define SHA_DIGEST_LENGTH 20 + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +/*- + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * ! SHA_LONG has to be at least 32 bits wide. ! + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + */ +#define SHA_LONG unsigned int + +#define SHA_LBLOCK 16 +#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a \ + * contiguous array of 32 bit wide \ + * big-endian values. */ +#define SHA_LAST_BLOCK (SHA_CBLOCK - 8) + +typedef struct SHAstate_st { + SHA_LONG h0, h1, h2, h3, h4; + SHA_LONG Nl, Nh; + SHA_LONG data[SHA_LBLOCK]; + unsigned int num; +} SHA_CTX; + +OSSL_DEPRECATEDIN_3_0 int SHA1_Init(SHA_CTX *c); +OSSL_DEPRECATEDIN_3_0 int SHA1_Update(SHA_CTX *c, const void *data, size_t len); +OSSL_DEPRECATEDIN_3_0 int SHA1_Final(unsigned char *md, SHA_CTX *c); +OSSL_DEPRECATEDIN_3_0 void SHA1_Transform(SHA_CTX *c, const unsigned char *data); +#endif + +unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md); + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define SHA256_CBLOCK (SHA_LBLOCK * 4) /* SHA-256 treats input data as a \ + * contiguous array of 32 bit wide \ + * big-endian values. */ + +typedef struct SHA256state_st { + SHA_LONG h[8]; + SHA_LONG Nl, Nh; + SHA_LONG data[SHA_LBLOCK]; + unsigned int num, md_len; +} SHA256_CTX; + +OSSL_DEPRECATEDIN_3_0 int SHA224_Init(SHA256_CTX *c); +OSSL_DEPRECATEDIN_3_0 int SHA224_Update(SHA256_CTX *c, + const void *data, size_t len); +OSSL_DEPRECATEDIN_3_0 int SHA224_Final(unsigned char *md, SHA256_CTX *c); +OSSL_DEPRECATEDIN_3_0 int SHA256_Init(SHA256_CTX *c); +OSSL_DEPRECATEDIN_3_0 int SHA256_Update(SHA256_CTX *c, + const void *data, size_t len); +OSSL_DEPRECATEDIN_3_0 int SHA256_Final(unsigned char *md, SHA256_CTX *c); +OSSL_DEPRECATEDIN_3_0 void SHA256_Transform(SHA256_CTX *c, + const unsigned char *data); +#endif + +unsigned char *SHA224(const unsigned char *d, size_t n, unsigned char *md); +unsigned char *SHA256(const unsigned char *d, size_t n, unsigned char *md); + +#define SHA256_192_DIGEST_LENGTH 24 +#define SHA224_DIGEST_LENGTH 28 +#define SHA256_DIGEST_LENGTH 32 +#define SHA384_DIGEST_LENGTH 48 +#define SHA512_DIGEST_LENGTH 64 + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +/* + * Unlike 32-bit digest algorithms, SHA-512 *relies* on SHA_LONG64 + * being exactly 64-bit wide. See Implementation Notes in sha512.c + * for further details. + */ +/* + * SHA-512 treats input data as a + * contiguous array of 64 bit + * wide big-endian values. + */ +#define SHA512_CBLOCK (SHA_LBLOCK * 8) +#if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__) +#define SHA_LONG64 unsigned __int64 +#elif defined(__arch64__) +#define SHA_LONG64 unsigned long +#else +#define SHA_LONG64 unsigned long long +#endif + +typedef struct SHA512state_st { + SHA_LONG64 h[8]; + SHA_LONG64 Nl, Nh; + union { + SHA_LONG64 d[SHA_LBLOCK]; + unsigned char p[SHA512_CBLOCK]; + } u; + unsigned int num, md_len; +} SHA512_CTX; + +OSSL_DEPRECATEDIN_3_0 int SHA384_Init(SHA512_CTX *c); +OSSL_DEPRECATEDIN_3_0 int SHA384_Update(SHA512_CTX *c, + const void *data, size_t len); +OSSL_DEPRECATEDIN_3_0 int SHA384_Final(unsigned char *md, SHA512_CTX *c); +OSSL_DEPRECATEDIN_3_0 int SHA512_Init(SHA512_CTX *c); +OSSL_DEPRECATEDIN_3_0 int SHA512_Update(SHA512_CTX *c, + const void *data, size_t len); +OSSL_DEPRECATEDIN_3_0 int SHA512_Final(unsigned char *md, SHA512_CTX *c); +OSSL_DEPRECATEDIN_3_0 void SHA512_Transform(SHA512_CTX *c, + const unsigned char *data); +#endif + +unsigned char *SHA384(const unsigned char *d, size_t n, unsigned char *md); +unsigned char *SHA512(const unsigned char *d, size_t n, unsigned char *md); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/srp.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/srp.h new file mode 100644 index 0000000000000000000000000000000000000000..5938a3c247491a5e57b84f412f58e5e7f226d1f4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/srp.h @@ -0,0 +1,291 @@ +/* + * WARNING: do not edit! + * Generated by makefile from include\openssl\srp.h.in + * + * Copyright 2004-2021 The OpenSSL Project Authors. All Rights Reserved. + * Copyright (c) 2004, EdelKey Project. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + * + * Originally written by Christophe Renou and Peter Sylvester, + * for the EdelKey project. + */ + +/* clang-format off */ + +/* clang-format on */ + +#ifndef OPENSSL_SRP_H +#define OPENSSL_SRP_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_SRP_H +#endif + +#include + +#ifndef OPENSSL_NO_SRP +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef OPENSSL_NO_DEPRECATED_3_0 + +typedef struct SRP_gN_cache_st { + char *b64_bn; + BIGNUM *bn; +} SRP_gN_cache; +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(SRP_gN_cache, SRP_gN_cache, SRP_gN_cache) +#define sk_SRP_gN_cache_num(sk) OPENSSL_sk_num(ossl_check_const_SRP_gN_cache_sk_type(sk)) +#define sk_SRP_gN_cache_value(sk, idx) ((SRP_gN_cache *)OPENSSL_sk_value(ossl_check_const_SRP_gN_cache_sk_type(sk), (idx))) +#define sk_SRP_gN_cache_new(cmp) ((STACK_OF(SRP_gN_cache) *)OPENSSL_sk_new(ossl_check_SRP_gN_cache_compfunc_type(cmp))) +#define sk_SRP_gN_cache_new_null() ((STACK_OF(SRP_gN_cache) *)OPENSSL_sk_new_null()) +#define sk_SRP_gN_cache_new_reserve(cmp, n) ((STACK_OF(SRP_gN_cache) *)OPENSSL_sk_new_reserve(ossl_check_SRP_gN_cache_compfunc_type(cmp), (n))) +#define sk_SRP_gN_cache_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_SRP_gN_cache_sk_type(sk), (n)) +#define sk_SRP_gN_cache_free(sk) OPENSSL_sk_free(ossl_check_SRP_gN_cache_sk_type(sk)) +#define sk_SRP_gN_cache_zero(sk) OPENSSL_sk_zero(ossl_check_SRP_gN_cache_sk_type(sk)) +#define sk_SRP_gN_cache_delete(sk, i) ((SRP_gN_cache *)OPENSSL_sk_delete(ossl_check_SRP_gN_cache_sk_type(sk), (i))) +#define sk_SRP_gN_cache_delete_ptr(sk, ptr) ((SRP_gN_cache *)OPENSSL_sk_delete_ptr(ossl_check_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_type(ptr))) +#define sk_SRP_gN_cache_push(sk, ptr) OPENSSL_sk_push(ossl_check_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_type(ptr)) +#define sk_SRP_gN_cache_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_type(ptr)) +#define sk_SRP_gN_cache_pop(sk) ((SRP_gN_cache *)OPENSSL_sk_pop(ossl_check_SRP_gN_cache_sk_type(sk))) +#define sk_SRP_gN_cache_shift(sk) ((SRP_gN_cache *)OPENSSL_sk_shift(ossl_check_SRP_gN_cache_sk_type(sk))) +#define sk_SRP_gN_cache_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_freefunc_type(freefunc)) +#define sk_SRP_gN_cache_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_type(ptr), (idx)) +#define sk_SRP_gN_cache_set(sk, idx, ptr) ((SRP_gN_cache *)OPENSSL_sk_set(ossl_check_SRP_gN_cache_sk_type(sk), (idx), ossl_check_SRP_gN_cache_type(ptr))) +#define sk_SRP_gN_cache_find(sk, ptr) OPENSSL_sk_find(ossl_check_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_type(ptr)) +#define sk_SRP_gN_cache_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_type(ptr)) +#define sk_SRP_gN_cache_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_type(ptr), pnum) +#define sk_SRP_gN_cache_sort(sk) OPENSSL_sk_sort(ossl_check_SRP_gN_cache_sk_type(sk)) +#define sk_SRP_gN_cache_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_SRP_gN_cache_sk_type(sk)) +#define sk_SRP_gN_cache_dup(sk) ((STACK_OF(SRP_gN_cache) *)OPENSSL_sk_dup(ossl_check_const_SRP_gN_cache_sk_type(sk))) +#define sk_SRP_gN_cache_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(SRP_gN_cache) *)OPENSSL_sk_deep_copy(ossl_check_const_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_copyfunc_type(copyfunc), ossl_check_SRP_gN_cache_freefunc_type(freefunc))) +#define sk_SRP_gN_cache_set_cmp_func(sk, cmp) ((sk_SRP_gN_cache_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_SRP_gN_cache_sk_type(sk), ossl_check_SRP_gN_cache_compfunc_type(cmp))) + +/* clang-format on */ + +typedef struct SRP_user_pwd_st { + /* Owned by us. */ + char *id; + BIGNUM *s; + BIGNUM *v; + /* Not owned by us. */ + const BIGNUM *g; + const BIGNUM *N; + /* Owned by us. */ + char *info; +} SRP_user_pwd; +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(SRP_user_pwd, SRP_user_pwd, SRP_user_pwd) +#define sk_SRP_user_pwd_num(sk) OPENSSL_sk_num(ossl_check_const_SRP_user_pwd_sk_type(sk)) +#define sk_SRP_user_pwd_value(sk, idx) ((SRP_user_pwd *)OPENSSL_sk_value(ossl_check_const_SRP_user_pwd_sk_type(sk), (idx))) +#define sk_SRP_user_pwd_new(cmp) ((STACK_OF(SRP_user_pwd) *)OPENSSL_sk_new(ossl_check_SRP_user_pwd_compfunc_type(cmp))) +#define sk_SRP_user_pwd_new_null() ((STACK_OF(SRP_user_pwd) *)OPENSSL_sk_new_null()) +#define sk_SRP_user_pwd_new_reserve(cmp, n) ((STACK_OF(SRP_user_pwd) *)OPENSSL_sk_new_reserve(ossl_check_SRP_user_pwd_compfunc_type(cmp), (n))) +#define sk_SRP_user_pwd_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_SRP_user_pwd_sk_type(sk), (n)) +#define sk_SRP_user_pwd_free(sk) OPENSSL_sk_free(ossl_check_SRP_user_pwd_sk_type(sk)) +#define sk_SRP_user_pwd_zero(sk) OPENSSL_sk_zero(ossl_check_SRP_user_pwd_sk_type(sk)) +#define sk_SRP_user_pwd_delete(sk, i) ((SRP_user_pwd *)OPENSSL_sk_delete(ossl_check_SRP_user_pwd_sk_type(sk), (i))) +#define sk_SRP_user_pwd_delete_ptr(sk, ptr) ((SRP_user_pwd *)OPENSSL_sk_delete_ptr(ossl_check_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_type(ptr))) +#define sk_SRP_user_pwd_push(sk, ptr) OPENSSL_sk_push(ossl_check_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_type(ptr)) +#define sk_SRP_user_pwd_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_type(ptr)) +#define sk_SRP_user_pwd_pop(sk) ((SRP_user_pwd *)OPENSSL_sk_pop(ossl_check_SRP_user_pwd_sk_type(sk))) +#define sk_SRP_user_pwd_shift(sk) ((SRP_user_pwd *)OPENSSL_sk_shift(ossl_check_SRP_user_pwd_sk_type(sk))) +#define sk_SRP_user_pwd_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_freefunc_type(freefunc)) +#define sk_SRP_user_pwd_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_type(ptr), (idx)) +#define sk_SRP_user_pwd_set(sk, idx, ptr) ((SRP_user_pwd *)OPENSSL_sk_set(ossl_check_SRP_user_pwd_sk_type(sk), (idx), ossl_check_SRP_user_pwd_type(ptr))) +#define sk_SRP_user_pwd_find(sk, ptr) OPENSSL_sk_find(ossl_check_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_type(ptr)) +#define sk_SRP_user_pwd_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_type(ptr)) +#define sk_SRP_user_pwd_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_type(ptr), pnum) +#define sk_SRP_user_pwd_sort(sk) OPENSSL_sk_sort(ossl_check_SRP_user_pwd_sk_type(sk)) +#define sk_SRP_user_pwd_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_SRP_user_pwd_sk_type(sk)) +#define sk_SRP_user_pwd_dup(sk) ((STACK_OF(SRP_user_pwd) *)OPENSSL_sk_dup(ossl_check_const_SRP_user_pwd_sk_type(sk))) +#define sk_SRP_user_pwd_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(SRP_user_pwd) *)OPENSSL_sk_deep_copy(ossl_check_const_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_copyfunc_type(copyfunc), ossl_check_SRP_user_pwd_freefunc_type(freefunc))) +#define sk_SRP_user_pwd_set_cmp_func(sk, cmp) ((sk_SRP_user_pwd_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_SRP_user_pwd_sk_type(sk), ossl_check_SRP_user_pwd_compfunc_type(cmp))) + +/* clang-format on */ + +OSSL_DEPRECATEDIN_3_0 +SRP_user_pwd *SRP_user_pwd_new(void); +OSSL_DEPRECATEDIN_3_0 +void SRP_user_pwd_free(SRP_user_pwd *user_pwd); + +OSSL_DEPRECATEDIN_3_0 +void SRP_user_pwd_set_gN(SRP_user_pwd *user_pwd, const BIGNUM *g, + const BIGNUM *N); +OSSL_DEPRECATEDIN_3_0 +int SRP_user_pwd_set1_ids(SRP_user_pwd *user_pwd, const char *id, + const char *info); +OSSL_DEPRECATEDIN_3_0 +int SRP_user_pwd_set0_sv(SRP_user_pwd *user_pwd, BIGNUM *s, BIGNUM *v); + +typedef struct SRP_VBASE_st { + STACK_OF(SRP_user_pwd) *users_pwd; + STACK_OF(SRP_gN_cache) *gN_cache; + /* to simulate a user */ + char *seed_key; + const BIGNUM *default_g; + const BIGNUM *default_N; +} SRP_VBASE; + +/* + * Internal structure storing N and g pair + */ +typedef struct SRP_gN_st { + char *id; + const BIGNUM *g; + const BIGNUM *N; +} SRP_gN; +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(SRP_gN, SRP_gN, SRP_gN) +#define sk_SRP_gN_num(sk) OPENSSL_sk_num(ossl_check_const_SRP_gN_sk_type(sk)) +#define sk_SRP_gN_value(sk, idx) ((SRP_gN *)OPENSSL_sk_value(ossl_check_const_SRP_gN_sk_type(sk), (idx))) +#define sk_SRP_gN_new(cmp) ((STACK_OF(SRP_gN) *)OPENSSL_sk_new(ossl_check_SRP_gN_compfunc_type(cmp))) +#define sk_SRP_gN_new_null() ((STACK_OF(SRP_gN) *)OPENSSL_sk_new_null()) +#define sk_SRP_gN_new_reserve(cmp, n) ((STACK_OF(SRP_gN) *)OPENSSL_sk_new_reserve(ossl_check_SRP_gN_compfunc_type(cmp), (n))) +#define sk_SRP_gN_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_SRP_gN_sk_type(sk), (n)) +#define sk_SRP_gN_free(sk) OPENSSL_sk_free(ossl_check_SRP_gN_sk_type(sk)) +#define sk_SRP_gN_zero(sk) OPENSSL_sk_zero(ossl_check_SRP_gN_sk_type(sk)) +#define sk_SRP_gN_delete(sk, i) ((SRP_gN *)OPENSSL_sk_delete(ossl_check_SRP_gN_sk_type(sk), (i))) +#define sk_SRP_gN_delete_ptr(sk, ptr) ((SRP_gN *)OPENSSL_sk_delete_ptr(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_type(ptr))) +#define sk_SRP_gN_push(sk, ptr) OPENSSL_sk_push(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_type(ptr)) +#define sk_SRP_gN_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_type(ptr)) +#define sk_SRP_gN_pop(sk) ((SRP_gN *)OPENSSL_sk_pop(ossl_check_SRP_gN_sk_type(sk))) +#define sk_SRP_gN_shift(sk) ((SRP_gN *)OPENSSL_sk_shift(ossl_check_SRP_gN_sk_type(sk))) +#define sk_SRP_gN_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_freefunc_type(freefunc)) +#define sk_SRP_gN_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_type(ptr), (idx)) +#define sk_SRP_gN_set(sk, idx, ptr) ((SRP_gN *)OPENSSL_sk_set(ossl_check_SRP_gN_sk_type(sk), (idx), ossl_check_SRP_gN_type(ptr))) +#define sk_SRP_gN_find(sk, ptr) OPENSSL_sk_find(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_type(ptr)) +#define sk_SRP_gN_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_type(ptr)) +#define sk_SRP_gN_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_type(ptr), pnum) +#define sk_SRP_gN_sort(sk) OPENSSL_sk_sort(ossl_check_SRP_gN_sk_type(sk)) +#define sk_SRP_gN_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_SRP_gN_sk_type(sk)) +#define sk_SRP_gN_dup(sk) ((STACK_OF(SRP_gN) *)OPENSSL_sk_dup(ossl_check_const_SRP_gN_sk_type(sk))) +#define sk_SRP_gN_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(SRP_gN) *)OPENSSL_sk_deep_copy(ossl_check_const_SRP_gN_sk_type(sk), ossl_check_SRP_gN_copyfunc_type(copyfunc), ossl_check_SRP_gN_freefunc_type(freefunc))) +#define sk_SRP_gN_set_cmp_func(sk, cmp) ((sk_SRP_gN_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_SRP_gN_sk_type(sk), ossl_check_SRP_gN_compfunc_type(cmp))) + +/* clang-format on */ + +OSSL_DEPRECATEDIN_3_0 +SRP_VBASE *SRP_VBASE_new(char *seed_key); +OSSL_DEPRECATEDIN_3_0 +void SRP_VBASE_free(SRP_VBASE *vb); +OSSL_DEPRECATEDIN_3_0 +int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file); + +OSSL_DEPRECATEDIN_3_0 +int SRP_VBASE_add0_user(SRP_VBASE *vb, SRP_user_pwd *user_pwd); + +/* NOTE: unlike in SRP_VBASE_get_by_user, caller owns the returned pointer.*/ +OSSL_DEPRECATEDIN_3_0 +SRP_user_pwd *SRP_VBASE_get1_by_user(SRP_VBASE *vb, char *username); + +OSSL_DEPRECATEDIN_3_0 +char *SRP_create_verifier_ex(const char *user, const char *pass, char **salt, + char **verifier, const char *N, const char *g, + OSSL_LIB_CTX *libctx, const char *propq); +OSSL_DEPRECATEDIN_3_0 +char *SRP_create_verifier(const char *user, const char *pass, char **salt, + char **verifier, const char *N, const char *g); +OSSL_DEPRECATEDIN_3_0 +int SRP_create_verifier_BN_ex(const char *user, const char *pass, BIGNUM **salt, + BIGNUM **verifier, const BIGNUM *N, + const BIGNUM *g, OSSL_LIB_CTX *libctx, + const char *propq); +OSSL_DEPRECATEDIN_3_0 +int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt, + BIGNUM **verifier, const BIGNUM *N, + const BIGNUM *g); + +#define SRP_NO_ERROR 0 +#define SRP_ERR_VBASE_INCOMPLETE_FILE 1 +#define SRP_ERR_VBASE_BN_LIB 2 +#define SRP_ERR_OPEN_FILE 3 +#define SRP_ERR_MEMORY 4 + +#define DB_srptype 0 +#define DB_srpverifier 1 +#define DB_srpsalt 2 +#define DB_srpid 3 +#define DB_srpgN 4 +#define DB_srpinfo 5 +#undef DB_NUMBER +#define DB_NUMBER 6 + +#define DB_SRP_INDEX 'I' +#define DB_SRP_VALID 'V' +#define DB_SRP_REVOKED 'R' +#define DB_SRP_MODIF 'v' + +/* see srp.c */ +OSSL_DEPRECATEDIN_3_0 +char *SRP_check_known_gN_param(const BIGNUM *g, const BIGNUM *N); +OSSL_DEPRECATEDIN_3_0 +SRP_gN *SRP_get_default_gN(const char *id); + +/* server side .... */ +OSSL_DEPRECATEDIN_3_0 +BIGNUM *SRP_Calc_server_key(const BIGNUM *A, const BIGNUM *v, const BIGNUM *u, + const BIGNUM *b, const BIGNUM *N); +OSSL_DEPRECATEDIN_3_0 +BIGNUM *SRP_Calc_B_ex(const BIGNUM *b, const BIGNUM *N, const BIGNUM *g, + const BIGNUM *v, OSSL_LIB_CTX *libctx, const char *propq); +OSSL_DEPRECATEDIN_3_0 +BIGNUM *SRP_Calc_B(const BIGNUM *b, const BIGNUM *N, const BIGNUM *g, + const BIGNUM *v); + +OSSL_DEPRECATEDIN_3_0 +int SRP_Verify_A_mod_N(const BIGNUM *A, const BIGNUM *N); +OSSL_DEPRECATEDIN_3_0 +BIGNUM *SRP_Calc_u_ex(const BIGNUM *A, const BIGNUM *B, const BIGNUM *N, + OSSL_LIB_CTX *libctx, const char *propq); +OSSL_DEPRECATEDIN_3_0 +BIGNUM *SRP_Calc_u(const BIGNUM *A, const BIGNUM *B, const BIGNUM *N); + +/* client side .... */ + +OSSL_DEPRECATEDIN_3_0 +BIGNUM *SRP_Calc_x_ex(const BIGNUM *s, const char *user, const char *pass, + OSSL_LIB_CTX *libctx, const char *propq); +OSSL_DEPRECATEDIN_3_0 +BIGNUM *SRP_Calc_x(const BIGNUM *s, const char *user, const char *pass); +OSSL_DEPRECATEDIN_3_0 +BIGNUM *SRP_Calc_A(const BIGNUM *a, const BIGNUM *N, const BIGNUM *g); +OSSL_DEPRECATEDIN_3_0 +BIGNUM *SRP_Calc_client_key_ex(const BIGNUM *N, const BIGNUM *B, const BIGNUM *g, + const BIGNUM *x, const BIGNUM *a, const BIGNUM *u, + OSSL_LIB_CTX *libctx, const char *propq); +OSSL_DEPRECATEDIN_3_0 +BIGNUM *SRP_Calc_client_key(const BIGNUM *N, const BIGNUM *B, const BIGNUM *g, + const BIGNUM *x, const BIGNUM *a, const BIGNUM *u); +OSSL_DEPRECATEDIN_3_0 +int SRP_Verify_B_mod_N(const BIGNUM *B, const BIGNUM *N); + +#define SRP_MINIMAL_N 1024 + +#endif /* OPENSSL_NO_DEPRECATED_3_0 */ + +/* This method ignores the configured seed and fails for an unknown user. */ +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +OSSL_DEPRECATEDIN_1_1_0 +SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username); +#endif + +#ifdef __cplusplus +} +#endif +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/srtp.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/srtp.h new file mode 100644 index 0000000000000000000000000000000000000000..3b716e124b38a5bf9e00809985690e196eac2f95 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/srtp.h @@ -0,0 +1,68 @@ +/* + * Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* + * DTLS code by Eric Rescorla + * + * Copyright (C) 2006, Network Resonance, Inc. Copyright (C) 2011, RTFM, Inc. + */ + +#ifndef OPENSSL_SRTP_H +#define OPENSSL_SRTP_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_D1_SRTP_H +#endif + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define SRTP_AES128_CM_SHA1_80 0x0001 +#define SRTP_AES128_CM_SHA1_32 0x0002 +#define SRTP_AES128_F8_SHA1_80 0x0003 +#define SRTP_AES128_F8_SHA1_32 0x0004 +#define SRTP_NULL_SHA1_80 0x0005 +#define SRTP_NULL_SHA1_32 0x0006 + +/* AEAD SRTP protection profiles from RFC 7714 */ +#define SRTP_AEAD_AES_128_GCM 0x0007 +#define SRTP_AEAD_AES_256_GCM 0x0008 + +/* DOUBLE AEAD SRTP protection profiles from RFC 8723 */ +#define SRTP_DOUBLE_AEAD_AES_128_GCM_AEAD_AES_128_GCM 0x0009 +#define SRTP_DOUBLE_AEAD_AES_256_GCM_AEAD_AES_256_GCM 0x000A + +/* ARIA SRTP protection profiles from RFC 8269 */ +#define SRTP_ARIA_128_CTR_HMAC_SHA1_80 0x000B +#define SRTP_ARIA_128_CTR_HMAC_SHA1_32 0x000C +#define SRTP_ARIA_256_CTR_HMAC_SHA1_80 0x000D +#define SRTP_ARIA_256_CTR_HMAC_SHA1_32 0x000E +#define SRTP_AEAD_ARIA_128_GCM 0x000F +#define SRTP_AEAD_ARIA_256_GCM 0x0010 + +#ifndef OPENSSL_NO_SRTP + +__owur int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles); +__owur int SSL_set_tlsext_use_srtp(SSL *ssl, const char *profiles); + +__owur STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *ssl); +__owur SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *s); + +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ssl.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ssl.h new file mode 100644 index 0000000000000000000000000000000000000000..56ec9dbe9569832692d9bdeea4816b784e65b98d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ssl.h @@ -0,0 +1,2947 @@ +/* + * WARNING: do not edit! + * Generated by makefile from include\openssl\ssl.h.in + * + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. + * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved + * Copyright 2005 Nokia. All rights reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* clang-format off */ + +/* clang-format on */ + +#ifndef OPENSSL_SSL_H +#define OPENSSL_SSL_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_SSL_H +#endif + +#include +#include +#include +#include +#include +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#include +#include +#include +#endif +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#ifndef OPENSSL_NO_STDIO +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* OpenSSL version number for ASN.1 encoding of the session information */ +/*- + * Version 0 - initial version + * Version 1 - added the optional peer certificate + */ +#define SSL_SESSION_ASN1_VERSION 0x0001 + +#define SSL_MAX_SSL_SESSION_ID_LENGTH 32 +#define SSL_MAX_SID_CTX_LENGTH 32 + +#define SSL_MIN_RSA_MODULUS_LENGTH_IN_BYTES (512 / 8) +#define SSL_MAX_KEY_ARG_LENGTH 8 +/* SSL_MAX_MASTER_KEY_LENGTH is defined in prov_ssl.h */ + +/* The maximum number of encrypt/decrypt pipelines we can support */ +#define SSL_MAX_PIPELINES 32 + +/* text strings for the ciphers */ + +/* These are used to specify which ciphers to use and not to use */ + +#define SSL_TXT_LOW "LOW" +#define SSL_TXT_MEDIUM "MEDIUM" +#define SSL_TXT_HIGH "HIGH" +#define SSL_TXT_FIPS "FIPS" + +#define SSL_TXT_aNULL "aNULL" +#define SSL_TXT_eNULL "eNULL" +#define SSL_TXT_NULL "NULL" + +#define SSL_TXT_kRSA "kRSA" +#define SSL_TXT_kDHr "kDHr" /* this cipher class has been removed */ +#define SSL_TXT_kDHd "kDHd" /* this cipher class has been removed */ +#define SSL_TXT_kDH "kDH" /* this cipher class has been removed */ +#define SSL_TXT_kEDH "kEDH" /* alias for kDHE */ +#define SSL_TXT_kDHE "kDHE" +#define SSL_TXT_kECDHr "kECDHr" /* this cipher class has been removed */ +#define SSL_TXT_kECDHe "kECDHe" /* this cipher class has been removed */ +#define SSL_TXT_kECDH "kECDH" /* this cipher class has been removed */ +#define SSL_TXT_kEECDH "kEECDH" /* alias for kECDHE */ +#define SSL_TXT_kECDHE "kECDHE" +#define SSL_TXT_kPSK "kPSK" +#define SSL_TXT_kRSAPSK "kRSAPSK" +#define SSL_TXT_kECDHEPSK "kECDHEPSK" +#define SSL_TXT_kDHEPSK "kDHEPSK" +#define SSL_TXT_kGOST "kGOST" +#define SSL_TXT_kGOST18 "kGOST18" +#define SSL_TXT_kSRP "kSRP" + +#define SSL_TXT_aRSA "aRSA" +#define SSL_TXT_aDSS "aDSS" +#define SSL_TXT_aDH "aDH" /* this cipher class has been removed */ +#define SSL_TXT_aECDH "aECDH" /* this cipher class has been removed */ +#define SSL_TXT_aECDSA "aECDSA" +#define SSL_TXT_aPSK "aPSK" +#define SSL_TXT_aGOST94 "aGOST94" +#define SSL_TXT_aGOST01 "aGOST01" +#define SSL_TXT_aGOST12 "aGOST12" +#define SSL_TXT_aGOST "aGOST" +#define SSL_TXT_aSRP "aSRP" + +#define SSL_TXT_DSS "DSS" +#define SSL_TXT_DH "DH" +#define SSL_TXT_DHE "DHE" /* same as "kDHE:-ADH" */ +#define SSL_TXT_EDH "EDH" /* alias for DHE */ +#define SSL_TXT_ADH "ADH" +#define SSL_TXT_RSA "RSA" +#define SSL_TXT_ECDH "ECDH" +#define SSL_TXT_EECDH "EECDH" /* alias for ECDHE" */ +#define SSL_TXT_ECDHE "ECDHE" /* same as "kECDHE:-AECDH" */ +#define SSL_TXT_AECDH "AECDH" +#define SSL_TXT_ECDSA "ECDSA" +#define SSL_TXT_PSK "PSK" +#define SSL_TXT_SRP "SRP" + +#define SSL_TXT_DES "DES" +#define SSL_TXT_3DES "3DES" +#define SSL_TXT_RC4 "RC4" +#define SSL_TXT_RC2 "RC2" +#define SSL_TXT_IDEA "IDEA" +#define SSL_TXT_SEED "SEED" +#define SSL_TXT_AES128 "AES128" +#define SSL_TXT_AES256 "AES256" +#define SSL_TXT_AES "AES" +#define SSL_TXT_AES_GCM "AESGCM" +#define SSL_TXT_AES_CCM "AESCCM" +#define SSL_TXT_AES_CCM_8 "AESCCM8" +#define SSL_TXT_CAMELLIA128 "CAMELLIA128" +#define SSL_TXT_CAMELLIA256 "CAMELLIA256" +#define SSL_TXT_CAMELLIA "CAMELLIA" +#define SSL_TXT_CHACHA20 "CHACHA20" +#define SSL_TXT_GOST "GOST89" +#define SSL_TXT_ARIA "ARIA" +#define SSL_TXT_ARIA_GCM "ARIAGCM" +#define SSL_TXT_ARIA128 "ARIA128" +#define SSL_TXT_ARIA256 "ARIA256" +#define SSL_TXT_GOST2012_GOST8912_GOST8912 "GOST2012-GOST8912-GOST8912" +#define SSL_TXT_CBC "CBC" + +#define SSL_TXT_MD5 "MD5" +#define SSL_TXT_SHA1 "SHA1" +#define SSL_TXT_SHA "SHA" /* same as "SHA1" */ +#define SSL_TXT_GOST94 "GOST94" +#define SSL_TXT_GOST89MAC "GOST89MAC" +#define SSL_TXT_GOST12 "GOST12" +#define SSL_TXT_GOST89MAC12 "GOST89MAC12" +#define SSL_TXT_SHA256 "SHA256" +#define SSL_TXT_SHA384 "SHA384" + +#define SSL_TXT_SSLV3 "SSLv3" +#define SSL_TXT_TLSV1 "TLSv1" +#define SSL_TXT_TLSV1_1 "TLSv1.1" +#define SSL_TXT_TLSV1_2 "TLSv1.2" + +#define SSL_TXT_ALL "ALL" + +/*- + * COMPLEMENTOF* definitions. These identifiers are used to (de-select) + * ciphers normally not being used. + * Example: "RC4" will activate all ciphers using RC4 including ciphers + * without authentication, which would normally disabled by DEFAULT (due + * the "!ADH" being part of default). Therefore "RC4:!COMPLEMENTOFDEFAULT" + * will make sure that it is also disabled in the specific selection. + * COMPLEMENTOF* identifiers are portable between version, as adjustments + * to the default cipher setup will also be included here. + * + * COMPLEMENTOFDEFAULT does not experience the same special treatment that + * DEFAULT gets, as only selection is being done and no sorting as needed + * for DEFAULT. + */ +#define SSL_TXT_CMPALL "COMPLEMENTOFALL" +#define SSL_TXT_CMPDEF "COMPLEMENTOFDEFAULT" + +/* + * The following cipher list is used by default. It also is substituted when + * an application-defined cipher list string starts with 'DEFAULT'. + * This applies to ciphersuites for TLSv1.2 and below. + * DEPRECATED IN 3.0.0, in favor of OSSL_default_cipher_list() + * Update both macro and function simultaneously + */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define SSL_DEFAULT_CIPHER_LIST "ALL:!COMPLEMENTOFDEFAULT:!eNULL" +/* + * This is the default set of TLSv1.3 ciphersuites + * DEPRECATED IN 3.0.0, in favor of OSSL_default_ciphersuites() + * Update both macro and function simultaneously + */ +#define TLS_DEFAULT_CIPHERSUITES "TLS_AES_256_GCM_SHA384:" \ + "TLS_CHACHA20_POLY1305_SHA256:" \ + "TLS_AES_128_GCM_SHA256" +#endif +/* + * As of OpenSSL 1.0.0, ssl_create_cipher_list() in ssl/ssl_ciph.c always + * starts with a reasonable order, and all we have to do for DEFAULT is + * throwing out anonymous and unencrypted ciphersuites! (The latter are not + * actually enabled by ALL, but "ALL:RSA" would enable some of them.) + */ + +/* Used in SSL_set_shutdown()/SSL_get_shutdown(); */ +#define SSL_SENT_SHUTDOWN 1 +#define SSL_RECEIVED_SHUTDOWN 2 + +#ifdef __cplusplus +} +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define SSL_FILETYPE_ASN1 X509_FILETYPE_ASN1 +#define SSL_FILETYPE_PEM X509_FILETYPE_PEM + +/* + * This is needed to stop compilers complaining about the 'struct ssl_st *' + * function parameters used to prototype callbacks in SSL_CTX. + */ +typedef struct ssl_st *ssl_crock_st; +typedef struct tls_session_ticket_ext_st TLS_SESSION_TICKET_EXT; +typedef struct ssl_method_st SSL_METHOD; +typedef struct ssl_cipher_st SSL_CIPHER; +typedef struct ssl_session_st SSL_SESSION; +typedef struct tls_sigalgs_st TLS_SIGALGS; +typedef struct ssl_conf_ctx_st SSL_CONF_CTX; + +STACK_OF(SSL_CIPHER); + +/* SRTP protection profiles for use with the use_srtp extension (RFC 5764)*/ +typedef struct srtp_protection_profile_st { + const char *name; + unsigned long id; +} SRTP_PROTECTION_PROFILE; +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(SRTP_PROTECTION_PROFILE, SRTP_PROTECTION_PROFILE, SRTP_PROTECTION_PROFILE) +#define sk_SRTP_PROTECTION_PROFILE_num(sk) OPENSSL_sk_num(ossl_check_const_SRTP_PROTECTION_PROFILE_sk_type(sk)) +#define sk_SRTP_PROTECTION_PROFILE_value(sk, idx) ((SRTP_PROTECTION_PROFILE *)OPENSSL_sk_value(ossl_check_const_SRTP_PROTECTION_PROFILE_sk_type(sk), (idx))) +#define sk_SRTP_PROTECTION_PROFILE_new(cmp) ((STACK_OF(SRTP_PROTECTION_PROFILE) *)OPENSSL_sk_new(ossl_check_SRTP_PROTECTION_PROFILE_compfunc_type(cmp))) +#define sk_SRTP_PROTECTION_PROFILE_new_null() ((STACK_OF(SRTP_PROTECTION_PROFILE) *)OPENSSL_sk_new_null()) +#define sk_SRTP_PROTECTION_PROFILE_new_reserve(cmp, n) ((STACK_OF(SRTP_PROTECTION_PROFILE) *)OPENSSL_sk_new_reserve(ossl_check_SRTP_PROTECTION_PROFILE_compfunc_type(cmp), (n))) +#define sk_SRTP_PROTECTION_PROFILE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_SRTP_PROTECTION_PROFILE_sk_type(sk), (n)) +#define sk_SRTP_PROTECTION_PROFILE_free(sk) OPENSSL_sk_free(ossl_check_SRTP_PROTECTION_PROFILE_sk_type(sk)) +#define sk_SRTP_PROTECTION_PROFILE_zero(sk) OPENSSL_sk_zero(ossl_check_SRTP_PROTECTION_PROFILE_sk_type(sk)) +#define sk_SRTP_PROTECTION_PROFILE_delete(sk, i) ((SRTP_PROTECTION_PROFILE *)OPENSSL_sk_delete(ossl_check_SRTP_PROTECTION_PROFILE_sk_type(sk), (i))) +#define sk_SRTP_PROTECTION_PROFILE_delete_ptr(sk, ptr) ((SRTP_PROTECTION_PROFILE *)OPENSSL_sk_delete_ptr(ossl_check_SRTP_PROTECTION_PROFILE_sk_type(sk), ossl_check_SRTP_PROTECTION_PROFILE_type(ptr))) +#define sk_SRTP_PROTECTION_PROFILE_push(sk, ptr) OPENSSL_sk_push(ossl_check_SRTP_PROTECTION_PROFILE_sk_type(sk), ossl_check_SRTP_PROTECTION_PROFILE_type(ptr)) +#define sk_SRTP_PROTECTION_PROFILE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_SRTP_PROTECTION_PROFILE_sk_type(sk), ossl_check_SRTP_PROTECTION_PROFILE_type(ptr)) +#define sk_SRTP_PROTECTION_PROFILE_pop(sk) ((SRTP_PROTECTION_PROFILE *)OPENSSL_sk_pop(ossl_check_SRTP_PROTECTION_PROFILE_sk_type(sk))) +#define sk_SRTP_PROTECTION_PROFILE_shift(sk) ((SRTP_PROTECTION_PROFILE *)OPENSSL_sk_shift(ossl_check_SRTP_PROTECTION_PROFILE_sk_type(sk))) +#define sk_SRTP_PROTECTION_PROFILE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SRTP_PROTECTION_PROFILE_sk_type(sk), ossl_check_SRTP_PROTECTION_PROFILE_freefunc_type(freefunc)) +#define sk_SRTP_PROTECTION_PROFILE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_SRTP_PROTECTION_PROFILE_sk_type(sk), ossl_check_SRTP_PROTECTION_PROFILE_type(ptr), (idx)) +#define sk_SRTP_PROTECTION_PROFILE_set(sk, idx, ptr) ((SRTP_PROTECTION_PROFILE *)OPENSSL_sk_set(ossl_check_SRTP_PROTECTION_PROFILE_sk_type(sk), (idx), ossl_check_SRTP_PROTECTION_PROFILE_type(ptr))) +#define sk_SRTP_PROTECTION_PROFILE_find(sk, ptr) OPENSSL_sk_find(ossl_check_SRTP_PROTECTION_PROFILE_sk_type(sk), ossl_check_SRTP_PROTECTION_PROFILE_type(ptr)) +#define sk_SRTP_PROTECTION_PROFILE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_SRTP_PROTECTION_PROFILE_sk_type(sk), ossl_check_SRTP_PROTECTION_PROFILE_type(ptr)) +#define sk_SRTP_PROTECTION_PROFILE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_SRTP_PROTECTION_PROFILE_sk_type(sk), ossl_check_SRTP_PROTECTION_PROFILE_type(ptr), pnum) +#define sk_SRTP_PROTECTION_PROFILE_sort(sk) OPENSSL_sk_sort(ossl_check_SRTP_PROTECTION_PROFILE_sk_type(sk)) +#define sk_SRTP_PROTECTION_PROFILE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_SRTP_PROTECTION_PROFILE_sk_type(sk)) +#define sk_SRTP_PROTECTION_PROFILE_dup(sk) ((STACK_OF(SRTP_PROTECTION_PROFILE) *)OPENSSL_sk_dup(ossl_check_const_SRTP_PROTECTION_PROFILE_sk_type(sk))) +#define sk_SRTP_PROTECTION_PROFILE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(SRTP_PROTECTION_PROFILE) *)OPENSSL_sk_deep_copy(ossl_check_const_SRTP_PROTECTION_PROFILE_sk_type(sk), ossl_check_SRTP_PROTECTION_PROFILE_copyfunc_type(copyfunc), ossl_check_SRTP_PROTECTION_PROFILE_freefunc_type(freefunc))) +#define sk_SRTP_PROTECTION_PROFILE_set_cmp_func(sk, cmp) ((sk_SRTP_PROTECTION_PROFILE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_SRTP_PROTECTION_PROFILE_sk_type(sk), ossl_check_SRTP_PROTECTION_PROFILE_compfunc_type(cmp))) + +/* clang-format on */ + +typedef int (*tls_session_ticket_ext_cb_fn)(SSL *s, const unsigned char *data, + int len, void *arg); +typedef int (*tls_session_secret_cb_fn)(SSL *s, void *secret, int *secret_len, + STACK_OF(SSL_CIPHER) *peer_ciphers, + const SSL_CIPHER **cipher, void *arg); + +/* Extension context codes */ +/* This extension is only allowed in TLS */ +#define SSL_EXT_TLS_ONLY 0x00001 +/* This extension is only allowed in DTLS */ +#define SSL_EXT_DTLS_ONLY 0x00002 +/* Some extensions may be allowed in DTLS but we don't implement them for it */ +#define SSL_EXT_TLS_IMPLEMENTATION_ONLY 0x00004 +/* Most extensions are not defined for SSLv3 but EXT_TYPE_renegotiate is */ +#define SSL_EXT_SSL3_ALLOWED 0x00008 +/* Extension is only defined for TLS1.2 and below */ +#define SSL_EXT_TLS1_2_AND_BELOW_ONLY 0x00010 +/* Extension is only defined for TLS1.3 and above */ +#define SSL_EXT_TLS1_3_ONLY 0x00020 +/* Ignore this extension during parsing if we are resuming */ +#define SSL_EXT_IGNORE_ON_RESUMPTION 0x00040 +#define SSL_EXT_CLIENT_HELLO 0x00080 +/* Really means TLS1.2 or below */ +#define SSL_EXT_TLS1_2_SERVER_HELLO 0x00100 +#define SSL_EXT_TLS1_3_SERVER_HELLO 0x00200 +#define SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS 0x00400 +#define SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST 0x00800 +#define SSL_EXT_TLS1_3_CERTIFICATE 0x01000 +#define SSL_EXT_TLS1_3_NEW_SESSION_TICKET 0x02000 +#define SSL_EXT_TLS1_3_CERTIFICATE_REQUEST 0x04000 +#define SSL_EXT_TLS1_3_CERTIFICATE_COMPRESSION 0x08000 +/* When sending a raw public key in a certificate message */ +#define SSL_EXT_TLS1_3_RAW_PUBLIC_KEY 0x10000 + +/* Typedefs for handling custom extensions */ + +typedef int (*custom_ext_add_cb)(SSL *s, unsigned int ext_type, + const unsigned char **out, size_t *outlen, + int *al, void *add_arg); + +typedef void (*custom_ext_free_cb)(SSL *s, unsigned int ext_type, + const unsigned char *out, void *add_arg); + +typedef int (*custom_ext_parse_cb)(SSL *s, unsigned int ext_type, + const unsigned char *in, size_t inlen, + int *al, void *parse_arg); + +typedef int (*SSL_custom_ext_add_cb_ex)(SSL *s, unsigned int ext_type, + unsigned int context, + const unsigned char **out, + size_t *outlen, X509 *x, + size_t chainidx, + int *al, void *add_arg); + +typedef void (*SSL_custom_ext_free_cb_ex)(SSL *s, unsigned int ext_type, + unsigned int context, + const unsigned char *out, + void *add_arg); + +typedef int (*SSL_custom_ext_parse_cb_ex)(SSL *s, unsigned int ext_type, + unsigned int context, + const unsigned char *in, + size_t inlen, X509 *x, + size_t chainidx, + int *al, void *parse_arg); + +/* Typedef for verification callback */ +typedef int (*SSL_verify_cb)(int preverify_ok, X509_STORE_CTX *x509_ctx); + +/* Typedef for SSL async callback */ +typedef int (*SSL_async_callback_fn)(SSL *s, void *arg); + +#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n) + +/* + * SSL/TLS connection options. + */ +/* Disable Extended master secret */ +#define SSL_OP_NO_EXTENDED_MASTER_SECRET SSL_OP_BIT(0) +/* Cleanse plaintext copies of data delivered to the application */ +#define SSL_OP_CLEANSE_PLAINTEXT SSL_OP_BIT(1) +/* Allow initial connection to servers that don't support RI */ +#define SSL_OP_LEGACY_SERVER_CONNECT SSL_OP_BIT(2) +/* Enable support for Kernel TLS */ +#define SSL_OP_ENABLE_KTLS SSL_OP_BIT(3) +#define SSL_OP_TLSEXT_PADDING SSL_OP_BIT(4) +#define SSL_OP_SAFARI_ECDHE_ECDSA_BUG SSL_OP_BIT(6) +#define SSL_OP_IGNORE_UNEXPECTED_EOF SSL_OP_BIT(7) +#define SSL_OP_ALLOW_CLIENT_RENEGOTIATION SSL_OP_BIT(8) +#define SSL_OP_DISABLE_TLSEXT_CA_NAMES SSL_OP_BIT(9) +/* In TLSv1.3 allow a non-(ec)dhe based kex_mode */ +#define SSL_OP_ALLOW_NO_DHE_KEX SSL_OP_BIT(10) +/* + * Disable SSL 3.0/TLS 1.0 CBC vulnerability workaround that was added + * in OpenSSL 0.9.6d. Usually (depending on the application protocol) + * the workaround is not needed. Unfortunately some broken SSL/TLS + * implementations cannot handle it at all, which is why we include it + * in SSL_OP_ALL. Added in 0.9.6e + */ +#define SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS SSL_OP_BIT(11) +/* DTLS options */ +#define SSL_OP_NO_QUERY_MTU SSL_OP_BIT(12) +/* Turn on Cookie Exchange (on relevant for servers) */ +#define SSL_OP_COOKIE_EXCHANGE SSL_OP_BIT(13) +/* Don't use RFC4507 ticket extension */ +#define SSL_OP_NO_TICKET SSL_OP_BIT(14) +#ifndef OPENSSL_NO_DTLS1_METHOD +/* + * Use Cisco's version identifier of DTLS_BAD_VER + * (only with deprecated DTLSv1_client_method()) + */ +#define SSL_OP_CISCO_ANYCONNECT SSL_OP_BIT(15) +#endif +/* As server, disallow session resumption on renegotiation */ +#define SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION SSL_OP_BIT(16) +/* Don't use compression even if supported */ +#define SSL_OP_NO_COMPRESSION SSL_OP_BIT(17) +/* Permit unsafe legacy renegotiation */ +#define SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION SSL_OP_BIT(18) +/* Disable encrypt-then-mac */ +#define SSL_OP_NO_ENCRYPT_THEN_MAC SSL_OP_BIT(19) +/* + * Enable TLSv1.3 Compatibility mode. This is on by default. A future + * version of OpenSSL may have this disabled by default. + */ +#define SSL_OP_ENABLE_MIDDLEBOX_COMPAT SSL_OP_BIT(20) +/* + * Prioritize Chacha20Poly1305 when client does. + * Modifies SSL_OP_SERVER_PREFERENCE + */ +#define SSL_OP_PRIORITIZE_CHACHA SSL_OP_BIT(21) +/* + * Set on servers to choose cipher, curve or group according to server's + * preferences. + */ +#define SSL_OP_SERVER_PREFERENCE SSL_OP_BIT(22) +/* Equivalent definition for backwards compatibility: */ +#define SSL_OP_CIPHER_SERVER_PREFERENCE SSL_OP_SERVER_PREFERENCE +/* + * If set, a server will allow a client to issue an SSLv3.0 version + * number as latest version supported in the premaster secret, even when + * TLSv1.0 (version 3.1) was announced in the client hello. Normally + * this is forbidden to prevent version rollback attacks. + */ +#define SSL_OP_TLS_ROLLBACK_BUG SSL_OP_BIT(23) +/* + * Switches off automatic TLSv1.3 anti-replay protection for early data. + * This is a server-side option only (no effect on the client). + */ +#define SSL_OP_NO_ANTI_REPLAY SSL_OP_BIT(24) +#define SSL_OP_NO_SSLv3 SSL_OP_BIT(25) +#define SSL_OP_NO_TLSv1 SSL_OP_BIT(26) +#define SSL_OP_NO_TLSv1_2 SSL_OP_BIT(27) +#define SSL_OP_NO_TLSv1_1 SSL_OP_BIT(28) +#define SSL_OP_NO_TLSv1_3 SSL_OP_BIT(29) +#define SSL_OP_NO_DTLSv1 SSL_OP_BIT(26) +#define SSL_OP_NO_DTLSv1_2 SSL_OP_BIT(27) +/* Disallow all renegotiation */ +#define SSL_OP_NO_RENEGOTIATION SSL_OP_BIT(30) +/* + * Make server add server-hello extension from early version of + * cryptopro draft, when GOST ciphersuite is negotiated. Required for + * interoperability with CryptoPro CSP 3.x + */ +#define SSL_OP_CRYPTOPRO_TLSEXT_BUG SSL_OP_BIT(31) +/* + * Disable RFC8879 certificate compression + * SSL_OP_NO_TX_CERTIFICATE_COMPRESSION: don't send compressed certificates, + * and ignore the extension when received. + * SSL_OP_NO_RX_CERTIFICATE_COMPRESSION: don't send the extension, and + * subsequently indicating that receiving is not supported + */ +#define SSL_OP_NO_TX_CERTIFICATE_COMPRESSION SSL_OP_BIT(32) +#define SSL_OP_NO_RX_CERTIFICATE_COMPRESSION SSL_OP_BIT(33) +/* Enable KTLS TX zerocopy on Linux */ +#define SSL_OP_ENABLE_KTLS_TX_ZEROCOPY_SENDFILE SSL_OP_BIT(34) +#define SSL_OP_PREFER_NO_DHE_KEX SSL_OP_BIT(35) +#define SSL_OP_LEGACY_EC_POINT_FORMATS SSL_OP_BIT(36) + +/* + * Option "collections." + */ +#define SSL_OP_NO_SSL_MASK \ + (SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 \ + | SSL_OP_NO_TLSv1_2 | SSL_OP_NO_TLSv1_3) +#define SSL_OP_NO_DTLS_MASK \ + (SSL_OP_NO_DTLSv1 | SSL_OP_NO_DTLSv1_2) + +/* Various bug workarounds that should be rather harmless. */ +#define SSL_OP_ALL \ + (SSL_OP_CRYPTOPRO_TLSEXT_BUG | SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS \ + | SSL_OP_TLSEXT_PADDING | SSL_OP_SAFARI_ECDHE_ECDSA_BUG) + +/* + * OBSOLETE OPTIONS retained for compatibility + */ + +#define SSL_OP_MICROSOFT_SESS_ID_BUG 0x0 +#define SSL_OP_NETSCAPE_CHALLENGE_BUG 0x0 +#define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG 0x0 +#define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG 0x0 +#define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER 0x0 +#define SSL_OP_MSIE_SSLV2_RSA_PADDING 0x0 +#define SSL_OP_SSLEAY_080_CLIENT_DH_BUG 0x0 +#define SSL_OP_TLS_D5_BUG 0x0 +#define SSL_OP_TLS_BLOCK_PADDING_BUG 0x0 +#define SSL_OP_SINGLE_ECDH_USE 0x0 +#define SSL_OP_SINGLE_DH_USE 0x0 +#define SSL_OP_EPHEMERAL_RSA 0x0 +#define SSL_OP_NO_SSLv2 0x0 +#define SSL_OP_PKCS1_CHECK_1 0x0 +#define SSL_OP_PKCS1_CHECK_2 0x0 +#define SSL_OP_NETSCAPE_CA_DN_BUG 0x0 +#define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x0 + +/* + * Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report success + * when just a single record has been written): + */ +#define SSL_MODE_ENABLE_PARTIAL_WRITE 0x00000001U +/* + * Make it possible to retry SSL_write() with changed buffer location (buffer + * contents must stay the same!); this is not the default to avoid the + * misconception that non-blocking SSL_write() behaves like non-blocking + * write(): + */ +#define SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER 0x00000002U +/* + * Never bother the application with retries if the transport is blocking: + */ +#define SSL_MODE_AUTO_RETRY 0x00000004U +/* Don't attempt to automatically build certificate chain */ +#define SSL_MODE_NO_AUTO_CHAIN 0x00000008U +/* + * Save RAM by releasing read and write buffers when they're empty. (SSL3 and + * TLS only.) Released buffers are freed. + */ +#define SSL_MODE_RELEASE_BUFFERS 0x00000010U +/* + * Send the current time in the Random fields of the ClientHello and + * ServerHello records for compatibility with hypothetical implementations + * that require it. + */ +#define SSL_MODE_SEND_CLIENTHELLO_TIME 0x00000020U +#define SSL_MODE_SEND_SERVERHELLO_TIME 0x00000040U +/* + * Send TLS_FALLBACK_SCSV in the ClientHello. To be set only by applications + * that reconnect with a downgraded protocol version; see + * draft-ietf-tls-downgrade-scsv-00 for details. DO NOT ENABLE THIS if your + * application attempts a normal handshake. Only use this in explicit + * fallback retries, following the guidance in + * draft-ietf-tls-downgrade-scsv-00. + */ +#define SSL_MODE_SEND_FALLBACK_SCSV 0x00000080U +/* + * Support Asynchronous operation + */ +#define SSL_MODE_ASYNC 0x00000100U + +/* + * When using DTLS/SCTP, include the terminating zero in the label + * used for computing the endpoint-pair shared secret. Required for + * interoperability with implementations having this bug like these + * older version of OpenSSL: + * - OpenSSL 1.0.0 series + * - OpenSSL 1.0.1 series + * - OpenSSL 1.0.2 series + * - OpenSSL 1.1.0 series + * - OpenSSL 1.1.1 and 1.1.1a + */ +#define SSL_MODE_DTLS_SCTP_LABEL_LENGTH_BUG 0x00000400U + +/* Cert related flags */ +/* + * Many implementations ignore some aspects of the TLS standards such as + * enforcing certificate chain algorithms. When this is set we enforce them. + */ +#define SSL_CERT_FLAG_TLS_STRICT 0x00000001U + +/* Suite B modes, takes same values as certificate verify flags */ +#define SSL_CERT_FLAG_SUITEB_128_LOS_ONLY 0x10000 +/* Suite B 192 bit only mode */ +#define SSL_CERT_FLAG_SUITEB_192_LOS 0x20000 +/* Suite B 128 bit mode allowing 192 bit algorithms */ +#define SSL_CERT_FLAG_SUITEB_128_LOS 0x30000 + +/* Perform all sorts of protocol violations for testing purposes */ +#define SSL_CERT_FLAG_BROKEN_PROTOCOL 0x10000000 + +/* Flags for building certificate chains */ +/* Treat any existing certificates as untrusted CAs */ +#define SSL_BUILD_CHAIN_FLAG_UNTRUSTED 0x1 +/* Don't include root CA in chain */ +#define SSL_BUILD_CHAIN_FLAG_NO_ROOT 0x2 +/* Just check certificates already there */ +#define SSL_BUILD_CHAIN_FLAG_CHECK 0x4 +/* Ignore verification errors */ +#define SSL_BUILD_CHAIN_FLAG_IGNORE_ERROR 0x8 +/* Clear verification errors from queue */ +#define SSL_BUILD_CHAIN_FLAG_CLEAR_ERROR 0x10 + +/* Flags returned by SSL_check_chain */ +/* Certificate can be used with this session */ +#define CERT_PKEY_VALID 0x1 +/* Certificate can also be used for signing */ +#define CERT_PKEY_SIGN 0x2 +/* EE certificate signing algorithm OK */ +#define CERT_PKEY_EE_SIGNATURE 0x10 +/* CA signature algorithms OK */ +#define CERT_PKEY_CA_SIGNATURE 0x20 +/* EE certificate parameters OK */ +#define CERT_PKEY_EE_PARAM 0x40 +/* CA certificate parameters OK */ +#define CERT_PKEY_CA_PARAM 0x80 +/* Signing explicitly allowed as opposed to SHA1 fallback */ +#define CERT_PKEY_EXPLICIT_SIGN 0x100 +/* Client CA issuer names match (always set for server cert) */ +#define CERT_PKEY_ISSUER_NAME 0x200 +/* Cert type matches client types (always set for server cert) */ +#define CERT_PKEY_CERT_TYPE 0x400 +/* Cert chain suitable to Suite B */ +#define CERT_PKEY_SUITEB 0x800 +/* Cert pkey valid for raw public key use */ +#define CERT_PKEY_RPK 0x1000 + +#define SSL_CONF_FLAG_CMDLINE 0x1 +#define SSL_CONF_FLAG_FILE 0x2 +#define SSL_CONF_FLAG_CLIENT 0x4 +#define SSL_CONF_FLAG_SERVER 0x8 +#define SSL_CONF_FLAG_SHOW_ERRORS 0x10 +#define SSL_CONF_FLAG_CERTIFICATE 0x20 +#define SSL_CONF_FLAG_REQUIRE_PRIVATE 0x40 +/* Configuration value types */ +#define SSL_CONF_TYPE_UNKNOWN 0x0 +#define SSL_CONF_TYPE_STRING 0x1 +#define SSL_CONF_TYPE_FILE 0x2 +#define SSL_CONF_TYPE_DIR 0x3 +#define SSL_CONF_TYPE_NONE 0x4 +#define SSL_CONF_TYPE_STORE 0x5 + +/* Maximum length of the application-controlled segment of a a TLSv1.3 cookie */ +#define SSL_COOKIE_LENGTH 4096 + +/* + * Note: SSL[_CTX]_set_{options,mode} use |= op on the previous value, they + * cannot be used to clear bits. + */ + +uint64_t SSL_CTX_get_options(const SSL_CTX *ctx); +uint64_t SSL_get_options(const SSL *s); +uint64_t SSL_CTX_clear_options(SSL_CTX *ctx, uint64_t op); +uint64_t SSL_clear_options(SSL *s, uint64_t op); +uint64_t SSL_CTX_set_options(SSL_CTX *ctx, uint64_t op); +uint64_t SSL_set_options(SSL *s, uint64_t op); + +#define SSL_CTX_set_mode(ctx, op) \ + SSL_CTX_ctrl((ctx), SSL_CTRL_MODE, (op), NULL) +#define SSL_CTX_clear_mode(ctx, op) \ + SSL_CTX_ctrl((ctx), SSL_CTRL_CLEAR_MODE, (op), NULL) +#define SSL_CTX_get_mode(ctx) \ + SSL_CTX_ctrl((ctx), SSL_CTRL_MODE, 0, NULL) +#define SSL_clear_mode(ssl, op) \ + SSL_ctrl((ssl), SSL_CTRL_CLEAR_MODE, (op), NULL) +#define SSL_set_mode(ssl, op) \ + SSL_ctrl((ssl), SSL_CTRL_MODE, (op), NULL) +#define SSL_get_mode(ssl) \ + SSL_ctrl((ssl), SSL_CTRL_MODE, 0, NULL) +#define SSL_set_mtu(ssl, mtu) \ + SSL_ctrl((ssl), SSL_CTRL_SET_MTU, (mtu), NULL) +#define DTLS_set_link_mtu(ssl, mtu) \ + SSL_ctrl((ssl), DTLS_CTRL_SET_LINK_MTU, (mtu), NULL) +#define DTLS_get_link_min_mtu(ssl) \ + SSL_ctrl((ssl), DTLS_CTRL_GET_LINK_MIN_MTU, 0, NULL) + +#define SSL_get_secure_renegotiation_support(ssl) \ + SSL_ctrl((ssl), SSL_CTRL_GET_RI_SUPPORT, 0, NULL) + +#define SSL_CTX_set_cert_flags(ctx, op) \ + SSL_CTX_ctrl((ctx), SSL_CTRL_CERT_FLAGS, (op), NULL) +#define SSL_set_cert_flags(s, op) \ + SSL_ctrl((s), SSL_CTRL_CERT_FLAGS, (op), NULL) +#define SSL_CTX_clear_cert_flags(ctx, op) \ + SSL_CTX_ctrl((ctx), SSL_CTRL_CLEAR_CERT_FLAGS, (op), NULL) +#define SSL_clear_cert_flags(s, op) \ + SSL_ctrl((s), SSL_CTRL_CLEAR_CERT_FLAGS, (op), NULL) + +void SSL_CTX_set_msg_callback(SSL_CTX *ctx, + void (*cb)(int write_p, int version, + int content_type, const void *buf, + size_t len, SSL *ssl, void *arg)); +void SSL_set_msg_callback(SSL *ssl, + void (*cb)(int write_p, int version, + int content_type, const void *buf, + size_t len, SSL *ssl, void *arg)); +#define SSL_CTX_set_msg_callback_arg(ctx, arg) SSL_CTX_ctrl((ctx), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg)) +#define SSL_set_msg_callback_arg(ssl, arg) SSL_ctrl((ssl), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg)) + +#define SSL_get_extms_support(s) \ + SSL_ctrl((s), SSL_CTRL_GET_EXTMS_SUPPORT, 0, NULL) + +#ifndef OPENSSL_NO_SRP +/* see tls_srp.c */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 __owur int SSL_SRP_CTX_init(SSL *s); +OSSL_DEPRECATEDIN_3_0 __owur int SSL_CTX_SRP_CTX_init(SSL_CTX *ctx); +OSSL_DEPRECATEDIN_3_0 int SSL_SRP_CTX_free(SSL *ctx); +OSSL_DEPRECATEDIN_3_0 int SSL_CTX_SRP_CTX_free(SSL_CTX *ctx); +OSSL_DEPRECATEDIN_3_0 __owur int SSL_srp_server_param_with_username(SSL *s, + int *ad); +OSSL_DEPRECATEDIN_3_0 __owur int SRP_Calc_A_param(SSL *s); +#endif +#endif + +/* 100k max cert list */ +#define SSL_MAX_CERT_LIST_DEFAULT (1024 * 100) + +#define SSL_SESSION_CACHE_MAX_SIZE_DEFAULT (1024 * 20) + +/* + * This callback type is used inside SSL_CTX, SSL, and in the functions that + * set them. It is used to override the generation of SSL/TLS session IDs in + * a server. Return value should be zero on an error, non-zero to proceed. + * Also, callbacks should themselves check if the id they generate is unique + * otherwise the SSL handshake will fail with an error - callbacks can do + * this using the 'ssl' value they're passed by; + * SSL_has_matching_session_id(ssl, id, *id_len) The length value passed in + * is set at the maximum size the session ID can be. In SSLv3/TLSv1 it is 32 + * bytes. The callback can alter this length to be less if desired. It is + * also an error for the callback to set the size to zero. + */ +typedef int (*GEN_SESSION_CB)(SSL *ssl, unsigned char *id, + unsigned int *id_len); + +#define SSL_SESS_CACHE_OFF 0x0000 +#define SSL_SESS_CACHE_CLIENT 0x0001 +#define SSL_SESS_CACHE_SERVER 0x0002 +#define SSL_SESS_CACHE_BOTH (SSL_SESS_CACHE_CLIENT | SSL_SESS_CACHE_SERVER) +#define SSL_SESS_CACHE_NO_AUTO_CLEAR 0x0080 +/* enough comments already ... see SSL_CTX_set_session_cache_mode(3) */ +#define SSL_SESS_CACHE_NO_INTERNAL_LOOKUP 0x0100 +#define SSL_SESS_CACHE_NO_INTERNAL_STORE 0x0200 +#define SSL_SESS_CACHE_NO_INTERNAL \ + (SSL_SESS_CACHE_NO_INTERNAL_LOOKUP | SSL_SESS_CACHE_NO_INTERNAL_STORE) +#define SSL_SESS_CACHE_UPDATE_TIME 0x0400 + +LHASH_OF(SSL_SESSION) *SSL_CTX_sessions(SSL_CTX *ctx); +#define SSL_CTX_sess_number(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_NUMBER, 0, NULL) +#define SSL_CTX_sess_connect(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_CONNECT, 0, NULL) +#define SSL_CTX_sess_connect_good(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_CONNECT_GOOD, 0, NULL) +#define SSL_CTX_sess_connect_renegotiate(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_CONNECT_RENEGOTIATE, 0, NULL) +#define SSL_CTX_sess_accept(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_ACCEPT, 0, NULL) +#define SSL_CTX_sess_accept_renegotiate(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_ACCEPT_RENEGOTIATE, 0, NULL) +#define SSL_CTX_sess_accept_good(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_ACCEPT_GOOD, 0, NULL) +#define SSL_CTX_sess_hits(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_HIT, 0, NULL) +#define SSL_CTX_sess_cb_hits(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_CB_HIT, 0, NULL) +#define SSL_CTX_sess_misses(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_MISSES, 0, NULL) +#define SSL_CTX_sess_timeouts(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_TIMEOUTS, 0, NULL) +#define SSL_CTX_sess_cache_full(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_CACHE_FULL, 0, NULL) + +void SSL_CTX_sess_set_new_cb(SSL_CTX *ctx, + int (*new_session_cb)(struct ssl_st *ssl, + SSL_SESSION *sess)); +int (*SSL_CTX_sess_get_new_cb(SSL_CTX *ctx))(struct ssl_st *ssl, + SSL_SESSION *sess); +void SSL_CTX_sess_set_remove_cb(SSL_CTX *ctx, + void (*remove_session_cb)(struct ssl_ctx_st + *ctx, + SSL_SESSION *sess)); +void (*SSL_CTX_sess_get_remove_cb(SSL_CTX *ctx))(struct ssl_ctx_st *ctx, + SSL_SESSION *sess); +void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx, + SSL_SESSION *(*get_session_cb)(struct ssl_st + *ssl, + const unsigned char + *data, + int len, + int *copy)); +SSL_SESSION *(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx))(struct ssl_st *ssl, + const unsigned char *data, + int len, int *copy); +void SSL_CTX_set_info_callback(SSL_CTX *ctx, + void (*cb)(const SSL *ssl, int type, int val)); +void (*SSL_CTX_get_info_callback(SSL_CTX *ctx))(const SSL *ssl, int type, + int val); +void SSL_CTX_set_client_cert_cb(SSL_CTX *ctx, + int (*client_cert_cb)(SSL *ssl, X509 **x509, + EVP_PKEY **pkey)); +int (*SSL_CTX_get_client_cert_cb(SSL_CTX *ctx))(SSL *ssl, X509 **x509, + EVP_PKEY **pkey); +#ifndef OPENSSL_NO_ENGINE +__owur int SSL_CTX_set_client_cert_engine(SSL_CTX *ctx, ENGINE *e); +#endif +void SSL_CTX_set_cookie_generate_cb(SSL_CTX *ctx, + int (*app_gen_cookie_cb)(SSL *ssl, + unsigned char + *cookie, + unsigned int + *cookie_len)); +void SSL_CTX_set_cookie_verify_cb(SSL_CTX *ctx, + int (*app_verify_cookie_cb)(SSL *ssl, + const unsigned char *cookie, + unsigned int + cookie_len)); + +void SSL_CTX_set_stateless_cookie_generate_cb( + SSL_CTX *ctx, + int (*gen_stateless_cookie_cb)(SSL *ssl, + unsigned char *cookie, + size_t *cookie_len)); +void SSL_CTX_set_stateless_cookie_verify_cb( + SSL_CTX *ctx, + int (*verify_stateless_cookie_cb)(SSL *ssl, + const unsigned char *cookie, + size_t cookie_len)); +#ifndef OPENSSL_NO_NEXTPROTONEG + +typedef int (*SSL_CTX_npn_advertised_cb_func)(SSL *ssl, + const unsigned char **out, + unsigned int *outlen, + void *arg); +void SSL_CTX_set_next_protos_advertised_cb(SSL_CTX *s, + SSL_CTX_npn_advertised_cb_func cb, + void *arg); +#define SSL_CTX_set_npn_advertised_cb SSL_CTX_set_next_protos_advertised_cb + +typedef int (*SSL_CTX_npn_select_cb_func)(SSL *s, + unsigned char **out, + unsigned char *outlen, + const unsigned char *in, + unsigned int inlen, + void *arg); +void SSL_CTX_set_next_proto_select_cb(SSL_CTX *s, + SSL_CTX_npn_select_cb_func cb, + void *arg); +#define SSL_CTX_set_npn_select_cb SSL_CTX_set_next_proto_select_cb + +void SSL_get0_next_proto_negotiated(const SSL *s, const unsigned char **data, + unsigned *len); +#define SSL_get0_npn_negotiated SSL_get0_next_proto_negotiated +#endif + +__owur int SSL_select_next_proto(unsigned char **out, unsigned char *outlen, + const unsigned char *server, unsigned int server_len, + const unsigned char *client, + unsigned int client_len); + +#define OPENSSL_NPN_UNSUPPORTED 0 +#define OPENSSL_NPN_NEGOTIATED 1 +#define OPENSSL_NPN_NO_OVERLAP 2 + +__owur int SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const unsigned char *protos, + unsigned int protos_len); +__owur int SSL_set_alpn_protos(SSL *ssl, const unsigned char *protos, + unsigned int protos_len); +typedef int (*SSL_CTX_alpn_select_cb_func)(SSL *ssl, + const unsigned char **out, + unsigned char *outlen, + const unsigned char *in, + unsigned int inlen, + void *arg); +void SSL_CTX_set_alpn_select_cb(SSL_CTX *ctx, + SSL_CTX_alpn_select_cb_func cb, + void *arg); +void SSL_get0_alpn_selected(const SSL *ssl, const unsigned char **data, + unsigned int *len); + +#ifndef OPENSSL_NO_PSK +/* + * the maximum length of the buffer given to callbacks containing the + * resulting identity/psk + */ +#define PSK_MAX_IDENTITY_LEN 256 +#define PSK_MAX_PSK_LEN 512 +typedef unsigned int (*SSL_psk_client_cb_func)(SSL *ssl, + const char *hint, + char *identity, + unsigned int max_identity_len, + unsigned char *psk, + unsigned int max_psk_len); +void SSL_CTX_set_psk_client_callback(SSL_CTX *ctx, SSL_psk_client_cb_func cb); +void SSL_set_psk_client_callback(SSL *ssl, SSL_psk_client_cb_func cb); + +typedef unsigned int (*SSL_psk_server_cb_func)(SSL *ssl, + const char *identity, + unsigned char *psk, + unsigned int max_psk_len); +void SSL_CTX_set_psk_server_callback(SSL_CTX *ctx, SSL_psk_server_cb_func cb); +void SSL_set_psk_server_callback(SSL *ssl, SSL_psk_server_cb_func cb); + +__owur int SSL_CTX_use_psk_identity_hint(SSL_CTX *ctx, const char *identity_hint); +__owur int SSL_use_psk_identity_hint(SSL *s, const char *identity_hint); +const char *SSL_get_psk_identity_hint(const SSL *s); +const char *SSL_get_psk_identity(const SSL *s); +#endif + +typedef int (*SSL_psk_find_session_cb_func)(SSL *ssl, + const unsigned char *identity, + size_t identity_len, + SSL_SESSION **sess); +typedef int (*SSL_psk_use_session_cb_func)(SSL *ssl, const EVP_MD *md, + const unsigned char **id, + size_t *idlen, + SSL_SESSION **sess); + +void SSL_set_psk_find_session_callback(SSL *s, SSL_psk_find_session_cb_func cb); +void SSL_CTX_set_psk_find_session_callback(SSL_CTX *ctx, + SSL_psk_find_session_cb_func cb); +void SSL_set_psk_use_session_callback(SSL *s, SSL_psk_use_session_cb_func cb); +void SSL_CTX_set_psk_use_session_callback(SSL_CTX *ctx, + SSL_psk_use_session_cb_func cb); + +/* Register callbacks to handle custom TLS Extensions for client or server. */ + +__owur int SSL_CTX_has_client_custom_ext(const SSL_CTX *ctx, + unsigned int ext_type); + +__owur int SSL_CTX_add_client_custom_ext(SSL_CTX *ctx, + unsigned int ext_type, + custom_ext_add_cb add_cb, + custom_ext_free_cb free_cb, + void *add_arg, + custom_ext_parse_cb parse_cb, + void *parse_arg); + +__owur int SSL_CTX_add_server_custom_ext(SSL_CTX *ctx, + unsigned int ext_type, + custom_ext_add_cb add_cb, + custom_ext_free_cb free_cb, + void *add_arg, + custom_ext_parse_cb parse_cb, + void *parse_arg); + +__owur int SSL_CTX_add_custom_ext(SSL_CTX *ctx, unsigned int ext_type, + unsigned int context, + SSL_custom_ext_add_cb_ex add_cb, + SSL_custom_ext_free_cb_ex free_cb, + void *add_arg, + SSL_custom_ext_parse_cb_ex parse_cb, + void *parse_arg); + +__owur int SSL_extension_supported(unsigned int ext_type); + +#define SSL_NOTHING 1 +#define SSL_WRITING 2 +#define SSL_READING 3 +#define SSL_X509_LOOKUP 4 +#define SSL_ASYNC_PAUSED 5 +#define SSL_ASYNC_NO_JOBS 6 +#define SSL_CLIENT_HELLO_CB 7 +#define SSL_RETRY_VERIFY 8 + +/* These will only be used when doing non-blocking IO */ +#define SSL_want_nothing(s) (SSL_want(s) == SSL_NOTHING) +#define SSL_want_read(s) (SSL_want(s) == SSL_READING) +#define SSL_want_write(s) (SSL_want(s) == SSL_WRITING) +#define SSL_want_x509_lookup(s) (SSL_want(s) == SSL_X509_LOOKUP) +#define SSL_want_retry_verify(s) (SSL_want(s) == SSL_RETRY_VERIFY) +#define SSL_want_async(s) (SSL_want(s) == SSL_ASYNC_PAUSED) +#define SSL_want_async_job(s) (SSL_want(s) == SSL_ASYNC_NO_JOBS) +#define SSL_want_client_hello_cb(s) (SSL_want(s) == SSL_CLIENT_HELLO_CB) + +#define SSL_MAC_FLAG_READ_MAC_STREAM 1 +#define SSL_MAC_FLAG_WRITE_MAC_STREAM 2 +#define SSL_MAC_FLAG_READ_MAC_TLSTREE 4 +#define SSL_MAC_FLAG_WRITE_MAC_TLSTREE 8 + +/* + * A callback for logging out TLS key material. This callback should log out + * |line| followed by a newline. + */ +typedef void (*SSL_CTX_keylog_cb_func)(const SSL *ssl, const char *line); + +/* + * SSL_CTX_set_keylog_callback configures a callback to log key material. This + * is intended for debugging use with tools like Wireshark. The cb function + * should log line followed by a newline. + */ +void SSL_CTX_set_keylog_callback(SSL_CTX *ctx, SSL_CTX_keylog_cb_func cb); + +/* + * SSL_CTX_get_keylog_callback returns the callback configured by + * SSL_CTX_set_keylog_callback. + */ +SSL_CTX_keylog_cb_func SSL_CTX_get_keylog_callback(const SSL_CTX *ctx); + +int SSL_CTX_set_max_early_data(SSL_CTX *ctx, uint32_t max_early_data); +uint32_t SSL_CTX_get_max_early_data(const SSL_CTX *ctx); +int SSL_set_max_early_data(SSL *s, uint32_t max_early_data); +uint32_t SSL_get_max_early_data(const SSL *s); +int SSL_CTX_set_recv_max_early_data(SSL_CTX *ctx, uint32_t recv_max_early_data); +uint32_t SSL_CTX_get_recv_max_early_data(const SSL_CTX *ctx); +int SSL_set_recv_max_early_data(SSL *s, uint32_t recv_max_early_data); +uint32_t SSL_get_recv_max_early_data(const SSL *s); + +#ifdef __cplusplus +} +#endif + +#include +#include +#include /* This is mostly sslv3 with a few tweaks */ +#include /* Datagram TLS */ +#include /* Support for the use_srtp extension */ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * These need to be after the above set of includes due to a compiler bug + * in VisualStudio 2015 + */ +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(SSL_CIPHER, const SSL_CIPHER, SSL_CIPHER) +#define sk_SSL_CIPHER_num(sk) OPENSSL_sk_num(ossl_check_const_SSL_CIPHER_sk_type(sk)) +#define sk_SSL_CIPHER_value(sk, idx) ((const SSL_CIPHER *)OPENSSL_sk_value(ossl_check_const_SSL_CIPHER_sk_type(sk), (idx))) +#define sk_SSL_CIPHER_new(cmp) ((STACK_OF(SSL_CIPHER) *)OPENSSL_sk_new(ossl_check_SSL_CIPHER_compfunc_type(cmp))) +#define sk_SSL_CIPHER_new_null() ((STACK_OF(SSL_CIPHER) *)OPENSSL_sk_new_null()) +#define sk_SSL_CIPHER_new_reserve(cmp, n) ((STACK_OF(SSL_CIPHER) *)OPENSSL_sk_new_reserve(ossl_check_SSL_CIPHER_compfunc_type(cmp), (n))) +#define sk_SSL_CIPHER_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_SSL_CIPHER_sk_type(sk), (n)) +#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk)) +#define sk_SSL_CIPHER_zero(sk) OPENSSL_sk_zero(ossl_check_SSL_CIPHER_sk_type(sk)) +#define sk_SSL_CIPHER_delete(sk, i) ((const SSL_CIPHER *)OPENSSL_sk_delete(ossl_check_SSL_CIPHER_sk_type(sk), (i))) +#define sk_SSL_CIPHER_delete_ptr(sk, ptr) ((const SSL_CIPHER *)OPENSSL_sk_delete_ptr(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_type(ptr))) +#define sk_SSL_CIPHER_push(sk, ptr) OPENSSL_sk_push(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_type(ptr)) +#define sk_SSL_CIPHER_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_type(ptr)) +#define sk_SSL_CIPHER_pop(sk) ((const SSL_CIPHER *)OPENSSL_sk_pop(ossl_check_SSL_CIPHER_sk_type(sk))) +#define sk_SSL_CIPHER_shift(sk) ((const SSL_CIPHER *)OPENSSL_sk_shift(ossl_check_SSL_CIPHER_sk_type(sk))) +#define sk_SSL_CIPHER_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_freefunc_type(freefunc)) +#define sk_SSL_CIPHER_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_type(ptr), (idx)) +#define sk_SSL_CIPHER_set(sk, idx, ptr) ((const SSL_CIPHER *)OPENSSL_sk_set(ossl_check_SSL_CIPHER_sk_type(sk), (idx), ossl_check_SSL_CIPHER_type(ptr))) +#define sk_SSL_CIPHER_find(sk, ptr) OPENSSL_sk_find(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_type(ptr)) +#define sk_SSL_CIPHER_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_type(ptr)) +#define sk_SSL_CIPHER_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_type(ptr), pnum) +#define sk_SSL_CIPHER_sort(sk) OPENSSL_sk_sort(ossl_check_SSL_CIPHER_sk_type(sk)) +#define sk_SSL_CIPHER_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_SSL_CIPHER_sk_type(sk)) +#define sk_SSL_CIPHER_dup(sk) ((STACK_OF(SSL_CIPHER) *)OPENSSL_sk_dup(ossl_check_const_SSL_CIPHER_sk_type(sk))) +#define sk_SSL_CIPHER_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(SSL_CIPHER) *)OPENSSL_sk_deep_copy(ossl_check_const_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_copyfunc_type(copyfunc), ossl_check_SSL_CIPHER_freefunc_type(freefunc))) +#define sk_SSL_CIPHER_set_cmp_func(sk, cmp) ((sk_SSL_CIPHER_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_compfunc_type(cmp))) + +/* clang-format on */ + +/* compatibility */ +#define SSL_set_app_data(s, arg) (SSL_set_ex_data(s, 0, (char *)(arg))) +#define SSL_get_app_data(s) (SSL_get_ex_data(s, 0)) +#define SSL_SESSION_set_app_data(s, a) (SSL_SESSION_set_ex_data(s, 0, \ + (char *)(a))) +#define SSL_SESSION_get_app_data(s) (SSL_SESSION_get_ex_data(s, 0)) +#define SSL_CTX_get_app_data(ctx) (SSL_CTX_get_ex_data(ctx, 0)) +#define SSL_CTX_set_app_data(ctx, arg) (SSL_CTX_set_ex_data(ctx, 0, \ + (char *)(arg))) +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +OSSL_DEPRECATEDIN_1_1_0 void SSL_set_debug(SSL *s, int debug); +#endif + +/* TLSv1.3 KeyUpdate message types */ +/* -1 used so that this is an invalid value for the on-the-wire protocol */ +#define SSL_KEY_UPDATE_NONE -1 +/* Values as defined for the on-the-wire protocol */ +#define SSL_KEY_UPDATE_NOT_REQUESTED 0 +#define SSL_KEY_UPDATE_REQUESTED 1 + +/* + * The valid handshake states (one for each type message sent and one for each + * type of message received). There are also two "special" states: + * TLS = TLS or DTLS state + * DTLS = DTLS specific state + * CR/SR = Client Read/Server Read + * CW/SW = Client Write/Server Write + * + * The "special" states are: + * TLS_ST_BEFORE = No handshake has been initiated yet + * TLS_ST_OK = A handshake has been successfully completed + */ +typedef enum { + TLS_ST_BEFORE, + TLS_ST_OK, + DTLS_ST_CR_HELLO_VERIFY_REQUEST, + TLS_ST_CR_SRVR_HELLO, + TLS_ST_CR_CERT, + TLS_ST_CR_COMP_CERT, + TLS_ST_CR_CERT_STATUS, + TLS_ST_CR_KEY_EXCH, + TLS_ST_CR_CERT_REQ, + TLS_ST_CR_SRVR_DONE, + TLS_ST_CR_SESSION_TICKET, + TLS_ST_CR_CHANGE, + TLS_ST_CR_FINISHED, + TLS_ST_CW_CLNT_HELLO, + TLS_ST_CW_CERT, + TLS_ST_CW_COMP_CERT, + TLS_ST_CW_KEY_EXCH, + TLS_ST_CW_CERT_VRFY, + TLS_ST_CW_CHANGE, + TLS_ST_CW_NEXT_PROTO, + TLS_ST_CW_FINISHED, + TLS_ST_SW_HELLO_REQ, + TLS_ST_SR_CLNT_HELLO, + DTLS_ST_SW_HELLO_VERIFY_REQUEST, + TLS_ST_SW_SRVR_HELLO, + TLS_ST_SW_CERT, + TLS_ST_SW_COMP_CERT, + TLS_ST_SW_KEY_EXCH, + TLS_ST_SW_CERT_REQ, + TLS_ST_SW_SRVR_DONE, + TLS_ST_SR_CERT, + TLS_ST_SR_COMP_CERT, + TLS_ST_SR_KEY_EXCH, + TLS_ST_SR_CERT_VRFY, + TLS_ST_SR_NEXT_PROTO, + TLS_ST_SR_CHANGE, + TLS_ST_SR_FINISHED, + TLS_ST_SW_SESSION_TICKET, + TLS_ST_SW_CERT_STATUS, + TLS_ST_SW_CHANGE, + TLS_ST_SW_FINISHED, + TLS_ST_SW_ENCRYPTED_EXTENSIONS, + TLS_ST_CR_ENCRYPTED_EXTENSIONS, + TLS_ST_CR_CERT_VRFY, + TLS_ST_SW_CERT_VRFY, + TLS_ST_CR_HELLO_REQ, + TLS_ST_SW_KEY_UPDATE, + TLS_ST_CW_KEY_UPDATE, + TLS_ST_SR_KEY_UPDATE, + TLS_ST_CR_KEY_UPDATE, + TLS_ST_EARLY_DATA, + TLS_ST_PENDING_EARLY_DATA_END, + TLS_ST_CW_END_OF_EARLY_DATA, + TLS_ST_SR_END_OF_EARLY_DATA +} OSSL_HANDSHAKE_STATE; + +/* + * Most of the following state values are no longer used and are defined to be + * the closest equivalent value in the current state machine code. Not all + * defines have an equivalent and are set to a dummy value (-1). SSL_ST_CONNECT + * and SSL_ST_ACCEPT are still in use in the definition of SSL_CB_ACCEPT_LOOP, + * SSL_CB_ACCEPT_EXIT, SSL_CB_CONNECT_LOOP and SSL_CB_CONNECT_EXIT. + */ + +#define SSL_ST_CONNECT 0x1000 +#define SSL_ST_ACCEPT 0x2000 + +#define SSL_ST_MASK 0x0FFF + +#define SSL_CB_LOOP 0x01 +#define SSL_CB_EXIT 0x02 +#define SSL_CB_READ 0x04 +#define SSL_CB_WRITE 0x08 +#define SSL_CB_ALERT 0x4000 /* used in callback */ +#define SSL_CB_READ_ALERT (SSL_CB_ALERT | SSL_CB_READ) +#define SSL_CB_WRITE_ALERT (SSL_CB_ALERT | SSL_CB_WRITE) +#define SSL_CB_ACCEPT_LOOP (SSL_ST_ACCEPT | SSL_CB_LOOP) +#define SSL_CB_ACCEPT_EXIT (SSL_ST_ACCEPT | SSL_CB_EXIT) +#define SSL_CB_CONNECT_LOOP (SSL_ST_CONNECT | SSL_CB_LOOP) +#define SSL_CB_CONNECT_EXIT (SSL_ST_CONNECT | SSL_CB_EXIT) +#define SSL_CB_HANDSHAKE_START 0x10 +#define SSL_CB_HANDSHAKE_DONE 0x20 + +/* Is the SSL_connection established? */ +#define SSL_in_connect_init(a) (SSL_in_init(a) && !SSL_is_server(a)) +#define SSL_in_accept_init(a) (SSL_in_init(a) && SSL_is_server(a)) +int SSL_in_init(const SSL *s); +int SSL_in_before(const SSL *s); +int SSL_is_init_finished(const SSL *s); + +/* + * The following 3 states are kept in ssl->rlayer.rstate when reads fail, you + * should not need these + */ +#define SSL_ST_READ_HEADER 0xF0 +#define SSL_ST_READ_BODY 0xF1 +#define SSL_ST_READ_DONE 0xF2 + +/*- + * Obtain latest Finished message + * -- that we sent (SSL_get_finished) + * -- that we expected from peer (SSL_get_peer_finished). + * Returns length (0 == no Finished so far), copies up to 'count' bytes. + */ +size_t SSL_get_finished(const SSL *s, void *buf, size_t count); +size_t SSL_get_peer_finished(const SSL *s, void *buf, size_t count); + +/* + * use either SSL_VERIFY_NONE or SSL_VERIFY_PEER, the last 3 options are + * 'ored' with SSL_VERIFY_PEER if they are desired + */ +#define SSL_VERIFY_NONE 0x00 +#define SSL_VERIFY_PEER 0x01 +#define SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x02 +#define SSL_VERIFY_CLIENT_ONCE 0x04 +#define SSL_VERIFY_POST_HANDSHAKE 0x08 + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define OpenSSL_add_ssl_algorithms() SSL_library_init() +#define SSLeay_add_ssl_algorithms() SSL_library_init() +#endif + +/* More backward compatibility */ +#define SSL_get_cipher(s) \ + SSL_CIPHER_get_name(SSL_get_current_cipher(s)) +#define SSL_get_cipher_bits(s, np) \ + SSL_CIPHER_get_bits(SSL_get_current_cipher(s), np) +#define SSL_get_cipher_version(s) \ + SSL_CIPHER_get_version(SSL_get_current_cipher(s)) +#define SSL_get_cipher_name(s) \ + SSL_CIPHER_get_name(SSL_get_current_cipher(s)) +#define SSL_get_time(a) SSL_SESSION_get_time(a) +#define SSL_set_time(a, b) SSL_SESSION_set_time((a), (b)) +#define SSL_get_timeout(a) SSL_SESSION_get_timeout(a) +#define SSL_set_timeout(a, b) SSL_SESSION_set_timeout((a), (b)) + +#define d2i_SSL_SESSION_bio(bp, s_id) ASN1_d2i_bio_of(SSL_SESSION, SSL_SESSION_new, d2i_SSL_SESSION, bp, s_id) +#define i2d_SSL_SESSION_bio(bp, s_id) ASN1_i2d_bio_of(SSL_SESSION, i2d_SSL_SESSION, bp, s_id) + +DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) +#define SSL_AD_REASON_OFFSET 1000 /* offset to get SSL_R_... value \ + * from SSL_AD_... */ +/* These alert types are for SSLv3 and TLSv1 */ +#define SSL_AD_CLOSE_NOTIFY SSL3_AD_CLOSE_NOTIFY +/* fatal */ +#define SSL_AD_UNEXPECTED_MESSAGE SSL3_AD_UNEXPECTED_MESSAGE +/* fatal */ +#define SSL_AD_BAD_RECORD_MAC SSL3_AD_BAD_RECORD_MAC +#define SSL_AD_DECRYPTION_FAILED TLS1_AD_DECRYPTION_FAILED +#define SSL_AD_RECORD_OVERFLOW TLS1_AD_RECORD_OVERFLOW +/* fatal */ +#define SSL_AD_DECOMPRESSION_FAILURE SSL3_AD_DECOMPRESSION_FAILURE +/* fatal */ +#define SSL_AD_HANDSHAKE_FAILURE SSL3_AD_HANDSHAKE_FAILURE +/* Not for TLS */ +#define SSL_AD_NO_CERTIFICATE SSL3_AD_NO_CERTIFICATE +#define SSL_AD_BAD_CERTIFICATE SSL3_AD_BAD_CERTIFICATE +#define SSL_AD_UNSUPPORTED_CERTIFICATE SSL3_AD_UNSUPPORTED_CERTIFICATE +#define SSL_AD_CERTIFICATE_REVOKED SSL3_AD_CERTIFICATE_REVOKED +#define SSL_AD_CERTIFICATE_EXPIRED SSL3_AD_CERTIFICATE_EXPIRED +#define SSL_AD_CERTIFICATE_UNKNOWN SSL3_AD_CERTIFICATE_UNKNOWN +/* fatal */ +#define SSL_AD_ILLEGAL_PARAMETER SSL3_AD_ILLEGAL_PARAMETER +/* fatal */ +#define SSL_AD_UNKNOWN_CA TLS1_AD_UNKNOWN_CA +/* fatal */ +#define SSL_AD_ACCESS_DENIED TLS1_AD_ACCESS_DENIED +/* fatal */ +#define SSL_AD_DECODE_ERROR TLS1_AD_DECODE_ERROR +#define SSL_AD_DECRYPT_ERROR TLS1_AD_DECRYPT_ERROR +/* fatal */ +#define SSL_AD_EXPORT_RESTRICTION TLS1_AD_EXPORT_RESTRICTION +/* fatal */ +#define SSL_AD_PROTOCOL_VERSION TLS1_AD_PROTOCOL_VERSION +/* fatal */ +#define SSL_AD_INSUFFICIENT_SECURITY TLS1_AD_INSUFFICIENT_SECURITY +/* fatal */ +#define SSL_AD_INTERNAL_ERROR TLS1_AD_INTERNAL_ERROR +#define SSL_AD_USER_CANCELLED TLS1_AD_USER_CANCELLED +#define SSL_AD_NO_RENEGOTIATION TLS1_AD_NO_RENEGOTIATION +#define SSL_AD_MISSING_EXTENSION TLS13_AD_MISSING_EXTENSION +#define SSL_AD_CERTIFICATE_REQUIRED TLS13_AD_CERTIFICATE_REQUIRED +#define SSL_AD_UNSUPPORTED_EXTENSION TLS1_AD_UNSUPPORTED_EXTENSION +#define SSL_AD_CERTIFICATE_UNOBTAINABLE TLS1_AD_CERTIFICATE_UNOBTAINABLE +#define SSL_AD_UNRECOGNIZED_NAME TLS1_AD_UNRECOGNIZED_NAME +#define SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE +#define SSL_AD_BAD_CERTIFICATE_HASH_VALUE TLS1_AD_BAD_CERTIFICATE_HASH_VALUE +/* fatal */ +#define SSL_AD_UNKNOWN_PSK_IDENTITY TLS1_AD_UNKNOWN_PSK_IDENTITY +/* fatal */ +#define SSL_AD_INAPPROPRIATE_FALLBACK TLS1_AD_INAPPROPRIATE_FALLBACK +#define SSL_AD_NO_APPLICATION_PROTOCOL TLS1_AD_NO_APPLICATION_PROTOCOL +#define SSL_ERROR_NONE 0 +#define SSL_ERROR_SSL 1 +#define SSL_ERROR_WANT_READ 2 +#define SSL_ERROR_WANT_WRITE 3 +#define SSL_ERROR_WANT_X509_LOOKUP 4 +#define SSL_ERROR_SYSCALL 5 /* look at error stack/return \ + * value/errno */ +#define SSL_ERROR_ZERO_RETURN 6 +#define SSL_ERROR_WANT_CONNECT 7 +#define SSL_ERROR_WANT_ACCEPT 8 +#define SSL_ERROR_WANT_ASYNC 9 +#define SSL_ERROR_WANT_ASYNC_JOB 10 +#define SSL_ERROR_WANT_CLIENT_HELLO_CB 11 +#define SSL_ERROR_WANT_RETRY_VERIFY 12 + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define SSL_CTRL_SET_TMP_DH 3 +#define SSL_CTRL_SET_TMP_ECDH 4 +#define SSL_CTRL_SET_TMP_DH_CB 6 +#endif + +#define SSL_CTRL_GET_CLIENT_CERT_REQUEST 9 +#define SSL_CTRL_GET_NUM_RENEGOTIATIONS 10 +#define SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS 11 +#define SSL_CTRL_GET_TOTAL_RENEGOTIATIONS 12 +#define SSL_CTRL_GET_FLAGS 13 +#define SSL_CTRL_EXTRA_CHAIN_CERT 14 +#define SSL_CTRL_SET_MSG_CALLBACK 15 +#define SSL_CTRL_SET_MSG_CALLBACK_ARG 16 +/* only applies to datagram connections */ +#define SSL_CTRL_SET_MTU 17 +/* Stats */ +#define SSL_CTRL_SESS_NUMBER 20 +#define SSL_CTRL_SESS_CONNECT 21 +#define SSL_CTRL_SESS_CONNECT_GOOD 22 +#define SSL_CTRL_SESS_CONNECT_RENEGOTIATE 23 +#define SSL_CTRL_SESS_ACCEPT 24 +#define SSL_CTRL_SESS_ACCEPT_GOOD 25 +#define SSL_CTRL_SESS_ACCEPT_RENEGOTIATE 26 +#define SSL_CTRL_SESS_HIT 27 +#define SSL_CTRL_SESS_CB_HIT 28 +#define SSL_CTRL_SESS_MISSES 29 +#define SSL_CTRL_SESS_TIMEOUTS 30 +#define SSL_CTRL_SESS_CACHE_FULL 31 +#define SSL_CTRL_MODE 33 +#define SSL_CTRL_GET_READ_AHEAD 40 +#define SSL_CTRL_SET_READ_AHEAD 41 +#define SSL_CTRL_SET_SESS_CACHE_SIZE 42 +#define SSL_CTRL_GET_SESS_CACHE_SIZE 43 +#define SSL_CTRL_SET_SESS_CACHE_MODE 44 +#define SSL_CTRL_GET_SESS_CACHE_MODE 45 +#define SSL_CTRL_GET_MAX_CERT_LIST 50 +#define SSL_CTRL_SET_MAX_CERT_LIST 51 +#define SSL_CTRL_SET_MAX_SEND_FRAGMENT 52 +/* see tls1.h for macros based on these */ +#define SSL_CTRL_SET_TLSEXT_SERVERNAME_CB 53 +#define SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG 54 +#define SSL_CTRL_SET_TLSEXT_HOSTNAME 55 +#define SSL_CTRL_SET_TLSEXT_DEBUG_CB 56 +#define SSL_CTRL_SET_TLSEXT_DEBUG_ARG 57 +#define SSL_CTRL_GET_TLSEXT_TICKET_KEYS 58 +#define SSL_CTRL_SET_TLSEXT_TICKET_KEYS 59 +/*# define SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT 60 */ +/*# define SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB 61 */ +/*# define SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB_ARG 62 */ +#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB 63 +#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG 64 +#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE 65 +#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS 66 +#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS 67 +#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS 68 +#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS 69 +#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP 70 +#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP 71 +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB 72 +#endif +#define SSL_CTRL_SET_TLS_EXT_SRP_USERNAME_CB 75 +#define SSL_CTRL_SET_SRP_VERIFY_PARAM_CB 76 +#define SSL_CTRL_SET_SRP_GIVE_CLIENT_PWD_CB 77 +#define SSL_CTRL_SET_SRP_ARG 78 +#define SSL_CTRL_SET_TLS_EXT_SRP_USERNAME 79 +#define SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH 80 +#define SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD 81 +#define DTLS_CTRL_GET_TIMEOUT 73 +#define DTLS_CTRL_HANDLE_TIMEOUT 74 +#define SSL_CTRL_GET_RI_SUPPORT 76 +#define SSL_CTRL_CLEAR_MODE 78 +#define SSL_CTRL_SET_NOT_RESUMABLE_SESS_CB 79 +#define SSL_CTRL_GET_EXTRA_CHAIN_CERTS 82 +#define SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS 83 +#define SSL_CTRL_CHAIN 88 +#define SSL_CTRL_CHAIN_CERT 89 +#define SSL_CTRL_GET_GROUPS 90 +#define SSL_CTRL_SET_GROUPS 91 +#define SSL_CTRL_SET_GROUPS_LIST 92 +#define SSL_CTRL_GET_SHARED_GROUP 93 +#define SSL_CTRL_SET_SIGALGS 97 +#define SSL_CTRL_SET_SIGALGS_LIST 98 +#define SSL_CTRL_CERT_FLAGS 99 +#define SSL_CTRL_CLEAR_CERT_FLAGS 100 +#define SSL_CTRL_SET_CLIENT_SIGALGS 101 +#define SSL_CTRL_SET_CLIENT_SIGALGS_LIST 102 +#define SSL_CTRL_GET_CLIENT_CERT_TYPES 103 +#define SSL_CTRL_SET_CLIENT_CERT_TYPES 104 +#define SSL_CTRL_BUILD_CERT_CHAIN 105 +#define SSL_CTRL_SET_VERIFY_CERT_STORE 106 +#define SSL_CTRL_SET_CHAIN_CERT_STORE 107 +#define SSL_CTRL_GET_PEER_SIGNATURE_NID 108 +#define SSL_CTRL_GET_PEER_TMP_KEY 109 +#define SSL_CTRL_GET_RAW_CIPHERLIST 110 +#define SSL_CTRL_GET_EC_POINT_FORMATS 111 +#define SSL_CTRL_GET_CHAIN_CERTS 115 +#define SSL_CTRL_SELECT_CURRENT_CERT 116 +#define SSL_CTRL_SET_CURRENT_CERT 117 +#define SSL_CTRL_SET_DH_AUTO 118 +#define DTLS_CTRL_SET_LINK_MTU 120 +#define DTLS_CTRL_GET_LINK_MIN_MTU 121 +#define SSL_CTRL_GET_EXTMS_SUPPORT 122 +#define SSL_CTRL_SET_MIN_PROTO_VERSION 123 +#define SSL_CTRL_SET_MAX_PROTO_VERSION 124 +#define SSL_CTRL_SET_SPLIT_SEND_FRAGMENT 125 +#define SSL_CTRL_SET_MAX_PIPELINES 126 +#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE 127 +#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB 128 +#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG 129 +#define SSL_CTRL_GET_MIN_PROTO_VERSION 130 +#define SSL_CTRL_GET_MAX_PROTO_VERSION 131 +#define SSL_CTRL_GET_SIGNATURE_NID 132 +#define SSL_CTRL_GET_TMP_KEY 133 +#define SSL_CTRL_GET_NEGOTIATED_GROUP 134 +#define SSL_CTRL_GET_IANA_GROUPS 135 +#define SSL_CTRL_SET_RETRY_VERIFY 136 +#define SSL_CTRL_GET_VERIFY_CERT_STORE 137 +#define SSL_CTRL_GET_CHAIN_CERT_STORE 138 +#define SSL_CTRL_GET0_IMPLEMENTED_GROUPS 139 +#define SSL_CTRL_GET_SIGNATURE_NAME 140 +#define SSL_CTRL_GET_PEER_SIGNATURE_NAME 141 +#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP_EX 142 +#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP_EX 143 +#define SSL_CERT_SET_FIRST 1 +#define SSL_CERT_SET_NEXT 2 +#define SSL_CERT_SET_SERVER 3 +#define DTLSv1_get_timeout(ssl, arg) \ + SSL_ctrl(ssl, DTLS_CTRL_GET_TIMEOUT, 0, (void *)(arg)) +#define DTLSv1_handle_timeout(ssl) \ + SSL_ctrl(ssl, DTLS_CTRL_HANDLE_TIMEOUT, 0, NULL) +#define SSL_num_renegotiations(ssl) \ + SSL_ctrl((ssl), SSL_CTRL_GET_NUM_RENEGOTIATIONS, 0, NULL) +#define SSL_clear_num_renegotiations(ssl) \ + SSL_ctrl((ssl), SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS, 0, NULL) +#define SSL_total_renegotiations(ssl) \ + SSL_ctrl((ssl), SSL_CTRL_GET_TOTAL_RENEGOTIATIONS, 0, NULL) +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define SSL_CTX_set_tmp_dh(ctx, dh) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SET_TMP_DH, 0, (char *)(dh)) +#endif +#define SSL_CTX_set_dh_auto(ctx, onoff) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SET_DH_AUTO, onoff, NULL) +#define SSL_set_dh_auto(s, onoff) \ + SSL_ctrl(s, SSL_CTRL_SET_DH_AUTO, onoff, NULL) +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define SSL_set_tmp_dh(ssl, dh) \ + SSL_ctrl(ssl, SSL_CTRL_SET_TMP_DH, 0, (char *)(dh)) +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define SSL_CTX_set_tmp_ecdh(ctx, ecdh) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SET_TMP_ECDH, 0, (char *)(ecdh)) +#define SSL_set_tmp_ecdh(ssl, ecdh) \ + SSL_ctrl(ssl, SSL_CTRL_SET_TMP_ECDH, 0, (char *)(ecdh)) +#endif +#define SSL_CTX_add_extra_chain_cert(ctx, x509) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_EXTRA_CHAIN_CERT, 0, (char *)(x509)) +#define SSL_CTX_get_extra_chain_certs(ctx, px509) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_GET_EXTRA_CHAIN_CERTS, 0, px509) +#define SSL_CTX_get_extra_chain_certs_only(ctx, px509) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_GET_EXTRA_CHAIN_CERTS, 1, px509) +#define SSL_CTX_clear_extra_chain_certs(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS, 0, NULL) +#define SSL_CTX_set0_chain(ctx, sk) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_CHAIN, 0, (char *)(sk)) +#define SSL_CTX_set1_chain(ctx, sk) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_CHAIN, 1, (char *)(sk)) +#define SSL_CTX_add0_chain_cert(ctx, x509) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_CHAIN_CERT, 0, (char *)(x509)) +#define SSL_CTX_add1_chain_cert(ctx, x509) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_CHAIN_CERT, 1, (char *)(x509)) +#define SSL_CTX_get0_chain_certs(ctx, px509) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_GET_CHAIN_CERTS, 0, px509) +#define SSL_CTX_clear_chain_certs(ctx) \ + SSL_CTX_set0_chain(ctx, NULL) +#define SSL_CTX_build_cert_chain(ctx, flags) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_BUILD_CERT_CHAIN, flags, NULL) +#define SSL_CTX_select_current_cert(ctx, x509) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SELECT_CURRENT_CERT, 0, (char *)(x509)) +#define SSL_CTX_set_current_cert(ctx, op) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SET_CURRENT_CERT, op, NULL) +#define SSL_CTX_set0_verify_cert_store(ctx, st) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SET_VERIFY_CERT_STORE, 0, (char *)(st)) +#define SSL_CTX_set1_verify_cert_store(ctx, st) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SET_VERIFY_CERT_STORE, 1, (char *)(st)) +#define SSL_CTX_get0_verify_cert_store(ctx, st) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_GET_VERIFY_CERT_STORE, 0, (char *)(st)) +#define SSL_CTX_set0_chain_cert_store(ctx, st) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SET_CHAIN_CERT_STORE, 0, (char *)(st)) +#define SSL_CTX_set1_chain_cert_store(ctx, st) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SET_CHAIN_CERT_STORE, 1, (char *)(st)) +#define SSL_CTX_get0_chain_cert_store(ctx, st) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_GET_CHAIN_CERT_STORE, 0, (char *)(st)) +#define SSL_set0_chain(s, sk) \ + SSL_ctrl(s, SSL_CTRL_CHAIN, 0, (char *)(sk)) +#define SSL_set1_chain(s, sk) \ + SSL_ctrl(s, SSL_CTRL_CHAIN, 1, (char *)(sk)) +#define SSL_add0_chain_cert(s, x509) \ + SSL_ctrl(s, SSL_CTRL_CHAIN_CERT, 0, (char *)(x509)) +#define SSL_add1_chain_cert(s, x509) \ + SSL_ctrl(s, SSL_CTRL_CHAIN_CERT, 1, (char *)(x509)) +#define SSL_get0_chain_certs(s, px509) \ + SSL_ctrl(s, SSL_CTRL_GET_CHAIN_CERTS, 0, px509) +#define SSL_clear_chain_certs(s) \ + SSL_set0_chain(s, NULL) +#define SSL_build_cert_chain(s, flags) \ + SSL_ctrl(s, SSL_CTRL_BUILD_CERT_CHAIN, flags, NULL) +#define SSL_select_current_cert(s, x509) \ + SSL_ctrl(s, SSL_CTRL_SELECT_CURRENT_CERT, 0, (char *)(x509)) +#define SSL_set_current_cert(s, op) \ + SSL_ctrl(s, SSL_CTRL_SET_CURRENT_CERT, op, NULL) +#define SSL_set0_verify_cert_store(s, st) \ + SSL_ctrl(s, SSL_CTRL_SET_VERIFY_CERT_STORE, 0, (char *)(st)) +#define SSL_set1_verify_cert_store(s, st) \ + SSL_ctrl(s, SSL_CTRL_SET_VERIFY_CERT_STORE, 1, (char *)(st)) +#define SSL_get0_verify_cert_store(s, st) \ + SSL_ctrl(s, SSL_CTRL_GET_VERIFY_CERT_STORE, 0, (char *)(st)) +#define SSL_set0_chain_cert_store(s, st) \ + SSL_ctrl(s, SSL_CTRL_SET_CHAIN_CERT_STORE, 0, (char *)(st)) +#define SSL_set1_chain_cert_store(s, st) \ + SSL_ctrl(s, SSL_CTRL_SET_CHAIN_CERT_STORE, 1, (char *)(st)) +#define SSL_get0_chain_cert_store(s, st) \ + SSL_ctrl(s, SSL_CTRL_GET_CHAIN_CERT_STORE, 0, (char *)(st)) + +#define SSL_get1_groups(s, glist) \ + SSL_ctrl(s, SSL_CTRL_GET_GROUPS, 0, (int *)(glist)) +#define SSL_get0_iana_groups(s, plst) \ + SSL_ctrl(s, SSL_CTRL_GET_IANA_GROUPS, 0, (uint16_t **)(plst)) +#define SSL_CTX_set1_groups(ctx, glist, glistlen) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SET_GROUPS, glistlen, (int *)(glist)) +#define SSL_CTX_set1_groups_list(ctx, s) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SET_GROUPS_LIST, 0, (char *)(s)) +#define SSL_CTX_get0_implemented_groups(ctx, all, out) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_GET0_IMPLEMENTED_GROUPS, all, \ + (STACK_OF(OPENSSL_CSTRING) *)(out)) +#define SSL_set1_groups(s, glist, glistlen) \ + SSL_ctrl(s, SSL_CTRL_SET_GROUPS, glistlen, (char *)(glist)) +#define SSL_set1_groups_list(s, str) \ + SSL_ctrl(s, SSL_CTRL_SET_GROUPS_LIST, 0, (char *)(str)) +#define SSL_get_shared_group(s, n) \ + SSL_ctrl(s, SSL_CTRL_GET_SHARED_GROUP, n, NULL) +#define SSL_get_negotiated_group(s) \ + SSL_ctrl(s, SSL_CTRL_GET_NEGOTIATED_GROUP, 0, NULL) +#define SSL_CTX_set1_sigalgs(ctx, slist, slistlen) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SET_SIGALGS, slistlen, (int *)(slist)) +#define SSL_CTX_set1_sigalgs_list(ctx, s) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SET_SIGALGS_LIST, 0, (char *)(s)) +#define SSL_set1_sigalgs(s, slist, slistlen) \ + SSL_ctrl(s, SSL_CTRL_SET_SIGALGS, slistlen, (int *)(slist)) +#define SSL_set1_sigalgs_list(s, str) \ + SSL_ctrl(s, SSL_CTRL_SET_SIGALGS_LIST, 0, (char *)(str)) +#define SSL_CTX_set1_client_sigalgs(ctx, slist, slistlen) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SET_CLIENT_SIGALGS, slistlen, (int *)(slist)) +#define SSL_CTX_set1_client_sigalgs_list(ctx, s) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SET_CLIENT_SIGALGS_LIST, 0, (char *)(s)) +#define SSL_set1_client_sigalgs(s, slist, slistlen) \ + SSL_ctrl(s, SSL_CTRL_SET_CLIENT_SIGALGS, slistlen, (int *)(slist)) +#define SSL_set1_client_sigalgs_list(s, str) \ + SSL_ctrl(s, SSL_CTRL_SET_CLIENT_SIGALGS_LIST, 0, (char *)(str)) +#define SSL_get0_certificate_types(s, clist) \ + SSL_ctrl(s, SSL_CTRL_GET_CLIENT_CERT_TYPES, 0, (char *)(clist)) +#define SSL_CTX_set1_client_certificate_types(ctx, clist, clistlen) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SET_CLIENT_CERT_TYPES, clistlen, \ + (char *)(clist)) +#define SSL_set1_client_certificate_types(s, clist, clistlen) \ + SSL_ctrl(s, SSL_CTRL_SET_CLIENT_CERT_TYPES, clistlen, (char *)(clist)) +#define SSL_get0_signature_name(s, str) \ + SSL_ctrl(s, SSL_CTRL_GET_SIGNATURE_NAME, 0, (1 ? (str) : (const char **)NULL)) +#define SSL_get_signature_nid(s, pn) \ + SSL_ctrl(s, SSL_CTRL_GET_SIGNATURE_NID, 0, pn) +#define SSL_get0_peer_signature_name(s, str) \ + SSL_ctrl(s, SSL_CTRL_GET_PEER_SIGNATURE_NAME, 0, (1 ? (str) : (const char **)NULL)) +#define SSL_get_peer_signature_nid(s, pn) \ + SSL_ctrl(s, SSL_CTRL_GET_PEER_SIGNATURE_NID, 0, pn) +#define SSL_get_peer_tmp_key(s, pk) \ + SSL_ctrl(s, SSL_CTRL_GET_PEER_TMP_KEY, 0, pk) +#define SSL_get_tmp_key(s, pk) \ + SSL_ctrl(s, SSL_CTRL_GET_TMP_KEY, 0, pk) +#define SSL_get0_raw_cipherlist(s, plst) \ + SSL_ctrl(s, SSL_CTRL_GET_RAW_CIPHERLIST, 0, plst) +#define SSL_get0_ec_point_formats(s, plst) \ + SSL_ctrl(s, SSL_CTRL_GET_EC_POINT_FORMATS, 0, plst) +#define SSL_CTX_set_min_proto_version(ctx, version) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MIN_PROTO_VERSION, version, NULL) +#define SSL_CTX_set_max_proto_version(ctx, version) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MAX_PROTO_VERSION, version, NULL) +#define SSL_CTX_get_min_proto_version(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_GET_MIN_PROTO_VERSION, 0, NULL) +#define SSL_CTX_get_max_proto_version(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_GET_MAX_PROTO_VERSION, 0, NULL) +#define SSL_set_min_proto_version(s, version) \ + SSL_ctrl(s, SSL_CTRL_SET_MIN_PROTO_VERSION, version, NULL) +#define SSL_set_max_proto_version(s, version) \ + SSL_ctrl(s, SSL_CTRL_SET_MAX_PROTO_VERSION, version, NULL) +#define SSL_get_min_proto_version(s) \ + SSL_ctrl(s, SSL_CTRL_GET_MIN_PROTO_VERSION, 0, NULL) +#define SSL_get_max_proto_version(s) \ + SSL_ctrl(s, SSL_CTRL_GET_MAX_PROTO_VERSION, 0, NULL) + +const char *SSL_get0_group_name(SSL *s); +const char *SSL_group_to_name(SSL *s, int id); + +/* Backwards compatibility, original 1.1.0 names */ +#define SSL_CTRL_GET_SERVER_TMP_KEY \ + SSL_CTRL_GET_PEER_TMP_KEY +#define SSL_get_server_tmp_key(s, pk) \ + SSL_get_peer_tmp_key(s, pk) + +int SSL_set0_tmp_dh_pkey(SSL *s, EVP_PKEY *dhpkey); +int SSL_CTX_set0_tmp_dh_pkey(SSL_CTX *ctx, EVP_PKEY *dhpkey); + +/* + * The following symbol names are old and obsolete. They are kept + * for compatibility reasons only and should not be used anymore. + */ +#define SSL_CTRL_GET_CURVES SSL_CTRL_GET_GROUPS +#define SSL_CTRL_SET_CURVES SSL_CTRL_SET_GROUPS +#define SSL_CTRL_SET_CURVES_LIST SSL_CTRL_SET_GROUPS_LIST +#define SSL_CTRL_GET_SHARED_CURVE SSL_CTRL_GET_SHARED_GROUP + +#define SSL_get1_curves SSL_get1_groups +#define SSL_CTX_set1_curves SSL_CTX_set1_groups +#define SSL_CTX_set1_curves_list SSL_CTX_set1_groups_list +#define SSL_set1_curves SSL_set1_groups +#define SSL_set1_curves_list SSL_set1_groups_list +#define SSL_get_shared_curve SSL_get_shared_group + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +/* Provide some compatibility macros for removed functionality. */ +#define SSL_CTX_need_tmp_RSA(ctx) 0 +#define SSL_CTX_set_tmp_rsa(ctx, rsa) 1 +#define SSL_need_tmp_RSA(ssl) 0 +#define SSL_set_tmp_rsa(ssl, rsa) 1 +#define SSL_CTX_set_ecdh_auto(dummy, onoff) ((onoff) != 0) +#define SSL_set_ecdh_auto(dummy, onoff) ((onoff) != 0) +/* + * We "pretend" to call the callback to avoid warnings about unused static + * functions. + */ +#define SSL_CTX_set_tmp_rsa_callback(ctx, cb) \ + while (0) \ + (cb)(NULL, 0, 0) +#define SSL_set_tmp_rsa_callback(ssl, cb) \ + while (0) \ + (cb)(NULL, 0, 0) +#endif +__owur const BIO_METHOD *BIO_f_ssl(void); +__owur BIO *BIO_new_ssl(SSL_CTX *ctx, int client); +__owur BIO *BIO_new_ssl_connect(SSL_CTX *ctx); +__owur BIO *BIO_new_buffer_ssl_connect(SSL_CTX *ctx); +__owur int BIO_ssl_copy_session_id(BIO *to, BIO *from); +void BIO_ssl_shutdown(BIO *ssl_bio); + +__owur int SSL_CTX_set_cipher_list(SSL_CTX *, const char *str); +__owur SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth); +__owur SSL_CTX *SSL_CTX_new_ex(OSSL_LIB_CTX *libctx, const char *propq, + const SSL_METHOD *meth); +int SSL_CTX_up_ref(SSL_CTX *ctx); +void SSL_CTX_free(SSL_CTX *); +__owur long SSL_CTX_set_timeout(SSL_CTX *ctx, long t); +__owur long SSL_CTX_get_timeout(const SSL_CTX *ctx); +__owur X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *); +void SSL_CTX_set_cert_store(SSL_CTX *, X509_STORE *); +void SSL_CTX_set1_cert_store(SSL_CTX *, X509_STORE *); +__owur int SSL_want(const SSL *s); +__owur int SSL_clear(SSL *s); + +#ifndef OPENSSL_NO_DEPRECATED_3_4 +OSSL_DEPRECATEDIN_3_4_FOR("not Y2038-safe, replace with SSL_CTX_flush_sessions_ex()") +void SSL_CTX_flush_sessions(SSL_CTX *ctx, long tm); +#endif +void SSL_CTX_flush_sessions_ex(SSL_CTX *ctx, time_t tm); + +__owur const SSL_CIPHER *SSL_get_current_cipher(const SSL *s); +__owur const SSL_CIPHER *SSL_get_pending_cipher(const SSL *s); +__owur int SSL_CIPHER_get_bits(const SSL_CIPHER *c, int *alg_bits); +__owur const char *SSL_CIPHER_get_version(const SSL_CIPHER *c); +__owur const char *SSL_CIPHER_get_name(const SSL_CIPHER *c); +__owur const char *SSL_CIPHER_standard_name(const SSL_CIPHER *c); +__owur const char *OPENSSL_cipher_name(const char *rfc_name); +__owur uint32_t SSL_CIPHER_get_id(const SSL_CIPHER *c); +__owur uint16_t SSL_CIPHER_get_protocol_id(const SSL_CIPHER *c); +__owur int SSL_CIPHER_get_kx_nid(const SSL_CIPHER *c); +__owur int SSL_CIPHER_get_auth_nid(const SSL_CIPHER *c); +__owur const EVP_MD *SSL_CIPHER_get_handshake_digest(const SSL_CIPHER *c); +__owur int SSL_CIPHER_is_aead(const SSL_CIPHER *c); + +__owur int SSL_get_fd(const SSL *s); +__owur int SSL_get_rfd(const SSL *s); +__owur int SSL_get_wfd(const SSL *s); +__owur const char *SSL_get_cipher_list(const SSL *s, int n); +__owur char *SSL_get_shared_ciphers(const SSL *s, char *buf, int size); +__owur int SSL_get_read_ahead(const SSL *s); +__owur int SSL_pending(const SSL *s); +__owur int SSL_has_pending(const SSL *s); +#ifndef OPENSSL_NO_SOCK +__owur int SSL_set_fd(SSL *s, int fd); +__owur int SSL_set_rfd(SSL *s, int fd); +__owur int SSL_set_wfd(SSL *s, int fd); +#endif +void SSL_set0_rbio(SSL *s, BIO *rbio); +void SSL_set0_wbio(SSL *s, BIO *wbio); +void SSL_set_bio(SSL *s, BIO *rbio, BIO *wbio); +__owur BIO *SSL_get_rbio(const SSL *s); +__owur BIO *SSL_get_wbio(const SSL *s); +__owur int SSL_set_cipher_list(SSL *s, const char *str); +__owur int SSL_CTX_set_ciphersuites(SSL_CTX *ctx, const char *str); +__owur int SSL_set_ciphersuites(SSL *s, const char *str); +void SSL_set_read_ahead(SSL *s, int yes); +__owur int SSL_get_verify_mode(const SSL *s); +__owur int SSL_get_verify_depth(const SSL *s); +__owur SSL_verify_cb SSL_get_verify_callback(const SSL *s); +void SSL_set_verify(SSL *s, int mode, SSL_verify_cb callback); +void SSL_set_verify_depth(SSL *s, int depth); +void SSL_set_cert_cb(SSL *s, int (*cb)(SSL *ssl, void *arg), void *arg); +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 __owur int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa); +OSSL_DEPRECATEDIN_3_0 +__owur int SSL_use_RSAPrivateKey_ASN1(SSL *ssl, + const unsigned char *d, long len); +#endif +__owur int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey); +__owur int SSL_use_PrivateKey_ASN1(int pk, SSL *ssl, const unsigned char *d, + long len); +__owur int SSL_use_certificate(SSL *ssl, X509 *x); +__owur int SSL_use_certificate_ASN1(SSL *ssl, const unsigned char *d, int len); +__owur int SSL_use_cert_and_key(SSL *ssl, X509 *x509, EVP_PKEY *privatekey, + STACK_OF(X509) *chain, int override); + +/* serverinfo file format versions */ +#define SSL_SERVERINFOV1 1 +#define SSL_SERVERINFOV2 2 + +/* Set serverinfo data for the current active cert. */ +__owur int SSL_CTX_use_serverinfo(SSL_CTX *ctx, const unsigned char *serverinfo, + size_t serverinfo_length); +__owur int SSL_CTX_use_serverinfo_ex(SSL_CTX *ctx, unsigned int version, + const unsigned char *serverinfo, + size_t serverinfo_length); +__owur int SSL_CTX_use_serverinfo_file(SSL_CTX *ctx, const char *file); + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +__owur int SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type); +#endif + +__owur int SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type); +__owur int SSL_use_certificate_file(SSL *ssl, const char *file, int type); + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +__owur int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, const char *file, + int type); +#endif +__owur int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, + int type); +__owur int SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, + int type); +/* PEM type */ +__owur int SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *file); +__owur int SSL_use_certificate_chain_file(SSL *ssl, const char *file); +__owur STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file); +__owur STACK_OF(X509_NAME) *SSL_load_client_CA_file_ex(const char *file, OSSL_LIB_CTX *libctx, + const char *propq); +__owur int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs, + const char *file); +int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs, + const char *dir); +int SSL_add_store_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs, + const char *uri); + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define SSL_load_error_strings() \ + OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS \ + | OPENSSL_INIT_LOAD_CRYPTO_STRINGS, \ + NULL) +#endif + +__owur const char *SSL_state_string(const SSL *s); +__owur const char *SSL_rstate_string(const SSL *s); +__owur const char *SSL_state_string_long(const SSL *s); +__owur const char *SSL_rstate_string_long(const SSL *s); + +#ifndef OPENSSL_NO_DEPRECATED_3_4 +OSSL_DEPRECATEDIN_3_4_FOR("not Y2038-safe, replace with SSL_SESSION_get_time_ex()") +__owur long SSL_SESSION_get_time(const SSL_SESSION *s); +OSSL_DEPRECATEDIN_3_4_FOR("not Y2038-safe, replace with SSL_SESSION_set_time_ex()") +__owur long SSL_SESSION_set_time(SSL_SESSION *s, long t); +#endif +__owur long SSL_SESSION_get_timeout(const SSL_SESSION *s); +__owur long SSL_SESSION_set_timeout(SSL_SESSION *s, long t); +__owur int SSL_SESSION_get_protocol_version(const SSL_SESSION *s); +__owur int SSL_SESSION_set_protocol_version(SSL_SESSION *s, int version); + +__owur time_t SSL_SESSION_get_time_ex(const SSL_SESSION *s); +__owur time_t SSL_SESSION_set_time_ex(SSL_SESSION *s, time_t t); + +__owur const char *SSL_SESSION_get0_hostname(const SSL_SESSION *s); +__owur int SSL_SESSION_set1_hostname(SSL_SESSION *s, const char *hostname); +void SSL_SESSION_get0_alpn_selected(const SSL_SESSION *s, + const unsigned char **alpn, + size_t *len); +__owur int SSL_SESSION_set1_alpn_selected(SSL_SESSION *s, + const unsigned char *alpn, + size_t len); +__owur const SSL_CIPHER *SSL_SESSION_get0_cipher(const SSL_SESSION *s); +__owur int SSL_SESSION_set_cipher(SSL_SESSION *s, const SSL_CIPHER *cipher); +__owur int SSL_SESSION_has_ticket(const SSL_SESSION *s); +__owur unsigned long SSL_SESSION_get_ticket_lifetime_hint(const SSL_SESSION *s); +void SSL_SESSION_get0_ticket(const SSL_SESSION *s, const unsigned char **tick, + size_t *len); +__owur uint32_t SSL_SESSION_get_max_early_data(const SSL_SESSION *s); +__owur int SSL_SESSION_set_max_early_data(SSL_SESSION *s, + uint32_t max_early_data); +__owur int SSL_copy_session_id(SSL *to, const SSL *from); +__owur X509 *SSL_SESSION_get0_peer(SSL_SESSION *s); +__owur int SSL_SESSION_set1_id_context(SSL_SESSION *s, + const unsigned char *sid_ctx, + unsigned int sid_ctx_len); +__owur int SSL_SESSION_set1_id(SSL_SESSION *s, const unsigned char *sid, + unsigned int sid_len); +__owur int SSL_SESSION_is_resumable(const SSL_SESSION *s); + +__owur SSL_SESSION *SSL_SESSION_new(void); +__owur SSL_SESSION *SSL_SESSION_dup(const SSL_SESSION *src); +const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s, + unsigned int *len); +const unsigned char *SSL_SESSION_get0_id_context(const SSL_SESSION *s, + unsigned int *len); +__owur unsigned int SSL_SESSION_get_compress_id(const SSL_SESSION *s); +#ifndef OPENSSL_NO_STDIO +int SSL_SESSION_print_fp(FILE *fp, const SSL_SESSION *ses); +#endif +int SSL_SESSION_print(BIO *fp, const SSL_SESSION *ses); +int SSL_SESSION_print_keylog(BIO *bp, const SSL_SESSION *x); +int SSL_SESSION_up_ref(SSL_SESSION *ses); +void SSL_SESSION_free(SSL_SESSION *ses); +__owur int i2d_SSL_SESSION(const SSL_SESSION *in, unsigned char **pp); +__owur int SSL_set_session(SSL *to, SSL_SESSION *session); +int SSL_CTX_add_session(SSL_CTX *ctx, SSL_SESSION *session); +int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *session); +__owur int SSL_CTX_set_generate_session_id(SSL_CTX *ctx, GEN_SESSION_CB cb); +__owur int SSL_set_generate_session_id(SSL *s, GEN_SESSION_CB cb); +__owur int SSL_has_matching_session_id(const SSL *s, + const unsigned char *id, + unsigned int id_len); +SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, + long length); +SSL_SESSION *d2i_SSL_SESSION_ex(SSL_SESSION **a, const unsigned char **pp, + long length, OSSL_LIB_CTX *libctx, + const char *propq); + +#ifdef OPENSSL_X509_H +__owur X509 *SSL_get0_peer_certificate(const SSL *s); +__owur X509 *SSL_get1_peer_certificate(const SSL *s); +/* Deprecated in 3.0.0 */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define SSL_get_peer_certificate SSL_get1_peer_certificate +#endif +#endif + +__owur STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *s); + +__owur int SSL_CTX_get_verify_mode(const SSL_CTX *ctx); +__owur int SSL_CTX_get_verify_depth(const SSL_CTX *ctx); +__owur SSL_verify_cb SSL_CTX_get_verify_callback(const SSL_CTX *ctx); +void SSL_CTX_set_verify(SSL_CTX *ctx, int mode, SSL_verify_cb callback); +void SSL_CTX_set_verify_depth(SSL_CTX *ctx, int depth); +void SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx, + int (*cb)(X509_STORE_CTX *, void *), + void *arg); +void SSL_CTX_set_cert_cb(SSL_CTX *c, int (*cb)(SSL *ssl, void *arg), + void *arg); +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +__owur int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa); +OSSL_DEPRECATEDIN_3_0 +__owur int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, const unsigned char *d, + long len); +#endif +__owur int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey); +__owur int SSL_CTX_use_PrivateKey_ASN1(int pk, SSL_CTX *ctx, + const unsigned char *d, long len); +__owur int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x); +__owur int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, int len, + const unsigned char *d); +__owur int SSL_CTX_use_cert_and_key(SSL_CTX *ctx, X509 *x509, EVP_PKEY *privatekey, + STACK_OF(X509) *chain, int override); + +void SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, pem_password_cb *cb); +void SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX *ctx, void *u); +pem_password_cb *SSL_CTX_get_default_passwd_cb(SSL_CTX *ctx); +void *SSL_CTX_get_default_passwd_cb_userdata(SSL_CTX *ctx); +void SSL_set_default_passwd_cb(SSL *s, pem_password_cb *cb); +void SSL_set_default_passwd_cb_userdata(SSL *s, void *u); +pem_password_cb *SSL_get_default_passwd_cb(SSL *s); +void *SSL_get_default_passwd_cb_userdata(SSL *s); + +__owur int SSL_CTX_check_private_key(const SSL_CTX *ctx); +__owur int SSL_check_private_key(const SSL *ctx); + +__owur int SSL_CTX_set_session_id_context(SSL_CTX *ctx, + const unsigned char *sid_ctx, + unsigned int sid_ctx_len); + +SSL *SSL_new(SSL_CTX *ctx); +int SSL_up_ref(SSL *s); +int SSL_is_dtls(const SSL *s); +int SSL_is_tls(const SSL *s); +int SSL_is_quic(const SSL *s); +__owur int SSL_set_session_id_context(SSL *ssl, const unsigned char *sid_ctx, + unsigned int sid_ctx_len); + +__owur int SSL_CTX_set_purpose(SSL_CTX *ctx, int purpose); +__owur int SSL_set_purpose(SSL *ssl, int purpose); +__owur int SSL_CTX_set_trust(SSL_CTX *ctx, int trust); +__owur int SSL_set_trust(SSL *ssl, int trust); + +__owur int SSL_set1_host(SSL *s, const char *host); +__owur int SSL_add1_host(SSL *s, const char *host); +__owur const char *SSL_get0_peername(SSL *s); +void SSL_set_hostflags(SSL *s, unsigned int flags); + +__owur int SSL_CTX_dane_enable(SSL_CTX *ctx); +__owur int SSL_CTX_dane_mtype_set(SSL_CTX *ctx, const EVP_MD *md, + uint8_t mtype, uint8_t ord); +__owur int SSL_dane_enable(SSL *s, const char *basedomain); +__owur int SSL_dane_tlsa_add(SSL *s, uint8_t usage, uint8_t selector, + uint8_t mtype, const unsigned char *data, size_t dlen); +__owur int SSL_get0_dane_authority(SSL *s, X509 **mcert, EVP_PKEY **mspki); +__owur int SSL_get0_dane_tlsa(SSL *s, uint8_t *usage, uint8_t *selector, + uint8_t *mtype, const unsigned char **data, + size_t *dlen); +/* + * Bridge opacity barrier between libcrypt and libssl, also needed to support + * offline testing in test/danetest.c + */ +SSL_DANE *SSL_get0_dane(SSL *ssl); +/* + * DANE flags + */ +unsigned long SSL_CTX_dane_set_flags(SSL_CTX *ctx, unsigned long flags); +unsigned long SSL_CTX_dane_clear_flags(SSL_CTX *ctx, unsigned long flags); +unsigned long SSL_dane_set_flags(SSL *ssl, unsigned long flags); +unsigned long SSL_dane_clear_flags(SSL *ssl, unsigned long flags); + +__owur int SSL_CTX_set1_param(SSL_CTX *ctx, X509_VERIFY_PARAM *vpm); +__owur int SSL_set1_param(SSL *ssl, X509_VERIFY_PARAM *vpm); + +__owur X509_VERIFY_PARAM *SSL_CTX_get0_param(SSL_CTX *ctx); +__owur X509_VERIFY_PARAM *SSL_get0_param(SSL *ssl); + +#ifndef OPENSSL_NO_SRP +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int SSL_CTX_set_srp_username(SSL_CTX *ctx, char *name); +OSSL_DEPRECATEDIN_3_0 int SSL_CTX_set_srp_password(SSL_CTX *ctx, char *password); +OSSL_DEPRECATEDIN_3_0 int SSL_CTX_set_srp_strength(SSL_CTX *ctx, int strength); +OSSL_DEPRECATEDIN_3_0 +int SSL_CTX_set_srp_client_pwd_callback(SSL_CTX *ctx, + char *(*cb)(SSL *, void *)); +OSSL_DEPRECATEDIN_3_0 +int SSL_CTX_set_srp_verify_param_callback(SSL_CTX *ctx, + int (*cb)(SSL *, void *)); +OSSL_DEPRECATEDIN_3_0 +int SSL_CTX_set_srp_username_callback(SSL_CTX *ctx, + int (*cb)(SSL *, int *, void *)); +OSSL_DEPRECATEDIN_3_0 int SSL_CTX_set_srp_cb_arg(SSL_CTX *ctx, void *arg); + +OSSL_DEPRECATEDIN_3_0 +int SSL_set_srp_server_param(SSL *s, const BIGNUM *N, const BIGNUM *g, + BIGNUM *sa, BIGNUM *v, char *info); +OSSL_DEPRECATEDIN_3_0 +int SSL_set_srp_server_param_pw(SSL *s, const char *user, const char *pass, + const char *grp); + +OSSL_DEPRECATEDIN_3_0 __owur BIGNUM *SSL_get_srp_g(SSL *s); +OSSL_DEPRECATEDIN_3_0 __owur BIGNUM *SSL_get_srp_N(SSL *s); + +OSSL_DEPRECATEDIN_3_0 __owur char *SSL_get_srp_username(SSL *s); +OSSL_DEPRECATEDIN_3_0 __owur char *SSL_get_srp_userinfo(SSL *s); +#endif +#endif + +/* + * ClientHello callback and helpers. + */ + +#define SSL_CLIENT_HELLO_SUCCESS 1 +#define SSL_CLIENT_HELLO_ERROR 0 +#define SSL_CLIENT_HELLO_RETRY (-1) + +typedef int (*SSL_client_hello_cb_fn)(SSL *s, int *al, void *arg); +void SSL_CTX_set_client_hello_cb(SSL_CTX *c, SSL_client_hello_cb_fn cb, + void *arg); +typedef int (*SSL_new_pending_conn_cb_fn)(SSL_CTX *ctx, SSL *new_ssl, + void *arg); +void SSL_CTX_set_new_pending_conn_cb(SSL_CTX *c, SSL_new_pending_conn_cb_fn cb, + void *arg); + +int SSL_client_hello_isv2(SSL *s); +unsigned int SSL_client_hello_get0_legacy_version(SSL *s); +size_t SSL_client_hello_get0_random(SSL *s, const unsigned char **out); +size_t SSL_client_hello_get0_session_id(SSL *s, const unsigned char **out); +size_t SSL_client_hello_get0_ciphers(SSL *s, const unsigned char **out); +size_t SSL_client_hello_get0_compression_methods(SSL *s, + const unsigned char **out); +int SSL_client_hello_get1_extensions_present(SSL *s, int **out, size_t *outlen); +int SSL_client_hello_get_extension_order(SSL *s, uint16_t *exts, + size_t *num_exts); +int SSL_client_hello_get0_ext(SSL *s, unsigned int type, + const unsigned char **out, size_t *outlen); + +void SSL_certs_clear(SSL *s); +void SSL_free(SSL *ssl); +#ifdef OSSL_ASYNC_FD +/* + * Windows application developer has to include windows.h to use these. + */ +__owur int SSL_waiting_for_async(SSL *s); +__owur int SSL_get_all_async_fds(SSL *s, OSSL_ASYNC_FD *fds, size_t *numfds); +__owur int SSL_get_changed_async_fds(SSL *s, OSSL_ASYNC_FD *addfd, + size_t *numaddfds, OSSL_ASYNC_FD *delfd, + size_t *numdelfds); +__owur int SSL_CTX_set_async_callback(SSL_CTX *ctx, SSL_async_callback_fn callback); +__owur int SSL_CTX_set_async_callback_arg(SSL_CTX *ctx, void *arg); +__owur int SSL_set_async_callback(SSL *s, SSL_async_callback_fn callback); +__owur int SSL_set_async_callback_arg(SSL *s, void *arg); +__owur int SSL_get_async_status(SSL *s, int *status); + +#endif +__owur int SSL_accept(SSL *ssl); +__owur int SSL_stateless(SSL *s); +__owur int SSL_connect(SSL *ssl); +__owur int SSL_read(SSL *ssl, void *buf, int num); +__owur int SSL_read_ex(SSL *ssl, void *buf, size_t num, size_t *readbytes); + +#define SSL_READ_EARLY_DATA_ERROR 0 +#define SSL_READ_EARLY_DATA_SUCCESS 1 +#define SSL_READ_EARLY_DATA_FINISH 2 + +__owur int SSL_read_early_data(SSL *s, void *buf, size_t num, + size_t *readbytes); +__owur int SSL_peek(SSL *ssl, void *buf, int num); +__owur int SSL_peek_ex(SSL *ssl, void *buf, size_t num, size_t *readbytes); +__owur ossl_ssize_t SSL_sendfile(SSL *s, int fd, off_t offset, size_t size, + int flags); +__owur int SSL_write(SSL *ssl, const void *buf, int num); +__owur int SSL_write_ex(SSL *s, const void *buf, size_t num, size_t *written); +__owur int SSL_write_early_data(SSL *s, const void *buf, size_t num, + size_t *written); +long SSL_ctrl(SSL *ssl, int cmd, long larg, void *parg); +long SSL_callback_ctrl(SSL *, int, void (*)(void)); +long SSL_CTX_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg); +long SSL_CTX_callback_ctrl(SSL_CTX *, int, void (*)(void)); + +#define SSL_WRITE_FLAG_CONCLUDE (1U << 0) + +__owur int SSL_write_ex2(SSL *s, const void *buf, size_t num, + uint64_t flags, + size_t *written); + +#define SSL_EARLY_DATA_NOT_SENT 0 +#define SSL_EARLY_DATA_REJECTED 1 +#define SSL_EARLY_DATA_ACCEPTED 2 + +__owur int SSL_get_early_data_status(const SSL *s); + +__owur int SSL_get_error(const SSL *s, int ret_code); +__owur const char *SSL_get_version(const SSL *s); +__owur int SSL_get_handshake_rtt(const SSL *s, uint64_t *rtt); + +/* This sets the 'default' SSL version that SSL_new() will create */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +__owur int SSL_CTX_set_ssl_version(SSL_CTX *ctx, const SSL_METHOD *meth); +#endif + +#ifndef OPENSSL_NO_SSL3_METHOD +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *SSLv3_method(void); /* SSLv3 */ +OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *SSLv3_server_method(void); +OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *SSLv3_client_method(void); +#endif +#endif + +#define SSLv23_method TLS_method +#define SSLv23_server_method TLS_server_method +#define SSLv23_client_method TLS_client_method + +/* Negotiate highest available SSL/TLS version */ +__owur const SSL_METHOD *TLS_method(void); +__owur const SSL_METHOD *TLS_server_method(void); +__owur const SSL_METHOD *TLS_client_method(void); + +#ifndef OPENSSL_NO_TLS1_METHOD +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *TLSv1_method(void); /* TLSv1.0 */ +OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *TLSv1_server_method(void); +OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *TLSv1_client_method(void); +#endif +#endif + +#ifndef OPENSSL_NO_TLS1_1_METHOD +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *TLSv1_1_method(void); /* TLSv1.1 */ +OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *TLSv1_1_server_method(void); +OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *TLSv1_1_client_method(void); +#endif +#endif + +#ifndef OPENSSL_NO_TLS1_2_METHOD +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *TLSv1_2_method(void); /* TLSv1.2 */ +OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *TLSv1_2_server_method(void); +OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *TLSv1_2_client_method(void); +#endif +#endif + +#ifndef OPENSSL_NO_DTLS1_METHOD +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *DTLSv1_method(void); /* DTLSv1.0 */ +OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *DTLSv1_server_method(void); +OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *DTLSv1_client_method(void); +#endif +#endif + +#ifndef OPENSSL_NO_DTLS1_2_METHOD +/* DTLSv1.2 */ +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *DTLSv1_2_method(void); +OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *DTLSv1_2_server_method(void); +OSSL_DEPRECATEDIN_1_1_0 __owur const SSL_METHOD *DTLSv1_2_client_method(void); +#endif +#endif + +__owur const SSL_METHOD *DTLS_method(void); /* DTLS 1.0 and 1.2 */ +__owur const SSL_METHOD *DTLS_server_method(void); /* DTLS 1.0 and 1.2 */ +__owur const SSL_METHOD *DTLS_client_method(void); /* DTLS 1.0 and 1.2 */ + +__owur size_t DTLS_get_data_mtu(const SSL *s); + +__owur STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL *s); +__owur STACK_OF(SSL_CIPHER) *SSL_CTX_get_ciphers(const SSL_CTX *ctx); +__owur STACK_OF(SSL_CIPHER) *SSL_get_client_ciphers(const SSL *s); +__owur STACK_OF(SSL_CIPHER) *SSL_get1_supported_ciphers(SSL *s); + +__owur int SSL_do_handshake(SSL *s); +int SSL_key_update(SSL *s, int updatetype); +int SSL_get_key_update_type(const SSL *s); +int SSL_renegotiate(SSL *s); +int SSL_renegotiate_abbreviated(SSL *s); +__owur int SSL_renegotiate_pending(const SSL *s); +int SSL_new_session_ticket(SSL *s); +int SSL_shutdown(SSL *s); +__owur int SSL_verify_client_post_handshake(SSL *s); +void SSL_CTX_set_post_handshake_auth(SSL_CTX *ctx, int val); +void SSL_set_post_handshake_auth(SSL *s, int val); + +__owur const SSL_METHOD *SSL_CTX_get_ssl_method(const SSL_CTX *ctx); +__owur const SSL_METHOD *SSL_get_ssl_method(const SSL *s); +__owur int SSL_set_ssl_method(SSL *s, const SSL_METHOD *method); +__owur const char *SSL_alert_type_string_long(int value); +__owur const char *SSL_alert_type_string(int value); +__owur const char *SSL_alert_desc_string_long(int value); +__owur const char *SSL_alert_desc_string(int value); + +void SSL_set0_CA_list(SSL *s, STACK_OF(X509_NAME) *name_list); +void SSL_CTX_set0_CA_list(SSL_CTX *ctx, STACK_OF(X509_NAME) *name_list); +__owur const STACK_OF(X509_NAME) *SSL_get0_CA_list(const SSL *s); +__owur const STACK_OF(X509_NAME) *SSL_CTX_get0_CA_list(const SSL_CTX *ctx); +__owur int SSL_add1_to_CA_list(SSL *ssl, const X509 *x); +__owur int SSL_CTX_add1_to_CA_list(SSL_CTX *ctx, const X509 *x); +__owur const STACK_OF(X509_NAME) *SSL_get0_peer_CA_list(const SSL *s); + +void SSL_set_client_CA_list(SSL *s, STACK_OF(X509_NAME) *name_list); +void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, STACK_OF(X509_NAME) *name_list); +__owur STACK_OF(X509_NAME) *SSL_get_client_CA_list(const SSL *s); +__owur STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(const SSL_CTX *s); +__owur int SSL_add_client_CA(SSL *ssl, X509 *x); +__owur int SSL_CTX_add_client_CA(SSL_CTX *ctx, X509 *x); + +void SSL_set_connect_state(SSL *s); +void SSL_set_accept_state(SSL *s); + +__owur long SSL_get_default_timeout(const SSL *s); + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define SSL_library_init() OPENSSL_init_ssl(0, NULL) +#endif + +__owur char *SSL_CIPHER_description(const SSL_CIPHER *, char *buf, int size); +__owur STACK_OF(X509_NAME) *SSL_dup_CA_list(const STACK_OF(X509_NAME) *sk); + +__owur SSL *SSL_dup(SSL *ssl); + +__owur X509 *SSL_get_certificate(const SSL *ssl); +/* + * EVP_PKEY + */ +struct evp_pkey_st *SSL_get_privatekey(const SSL *ssl); + +__owur X509 *SSL_CTX_get0_certificate(const SSL_CTX *ctx); +__owur EVP_PKEY *SSL_CTX_get0_privatekey(const SSL_CTX *ctx); + +void SSL_CTX_set_quiet_shutdown(SSL_CTX *ctx, int mode); +__owur int SSL_CTX_get_quiet_shutdown(const SSL_CTX *ctx); +void SSL_set_quiet_shutdown(SSL *ssl, int mode); +__owur int SSL_get_quiet_shutdown(const SSL *ssl); +void SSL_set_shutdown(SSL *ssl, int mode); +__owur int SSL_get_shutdown(const SSL *ssl); +__owur int SSL_version(const SSL *ssl); +__owur int SSL_client_version(const SSL *s); +__owur int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx); +__owur int SSL_CTX_set_default_verify_dir(SSL_CTX *ctx); +__owur int SSL_CTX_set_default_verify_file(SSL_CTX *ctx); +__owur int SSL_CTX_set_default_verify_store(SSL_CTX *ctx); +__owur int SSL_CTX_load_verify_file(SSL_CTX *ctx, const char *CAfile); +__owur int SSL_CTX_load_verify_dir(SSL_CTX *ctx, const char *CApath); +__owur int SSL_CTX_load_verify_store(SSL_CTX *ctx, const char *CAstore); +__owur int SSL_CTX_load_verify_locations(SSL_CTX *ctx, + const char *CAfile, + const char *CApath); +#define SSL_get0_session SSL_get_session /* just peek at pointer */ +__owur SSL_SESSION *SSL_get_session(const SSL *ssl); +__owur SSL_SESSION *SSL_get1_session(SSL *ssl); /* obtain a reference count */ +__owur SSL_CTX *SSL_get_SSL_CTX(const SSL *ssl); +SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX *ctx); +void SSL_set_info_callback(SSL *ssl, + void (*cb)(const SSL *ssl, int type, int val)); +void (*SSL_get_info_callback(const SSL *ssl))(const SSL *ssl, int type, + int val); +__owur OSSL_HANDSHAKE_STATE SSL_get_state(const SSL *ssl); + +void SSL_set_verify_result(SSL *ssl, long v); +__owur long SSL_get_verify_result(const SSL *ssl); +__owur STACK_OF(X509) *SSL_get0_verified_chain(const SSL *s); + +__owur size_t SSL_get_client_random(const SSL *ssl, unsigned char *out, + size_t outlen); +__owur size_t SSL_get_server_random(const SSL *ssl, unsigned char *out, + size_t outlen); +__owur size_t SSL_SESSION_get_master_key(const SSL_SESSION *sess, + unsigned char *out, size_t outlen); +__owur int SSL_SESSION_set1_master_key(SSL_SESSION *sess, + const unsigned char *in, size_t len); +uint8_t SSL_SESSION_get_max_fragment_length(const SSL_SESSION *sess); + +#define SSL_get_ex_new_index(l, p, newf, dupf, freef) \ + CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_SSL, l, p, newf, dupf, freef) +__owur int SSL_set_ex_data(SSL *ssl, int idx, void *data); +void *SSL_get_ex_data(const SSL *ssl, int idx); +#define SSL_SESSION_get_ex_new_index(l, p, newf, dupf, freef) \ + CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_SSL_SESSION, l, p, newf, dupf, freef) +__owur int SSL_SESSION_set_ex_data(SSL_SESSION *ss, int idx, void *data); +void *SSL_SESSION_get_ex_data(const SSL_SESSION *ss, int idx); +#define SSL_CTX_get_ex_new_index(l, p, newf, dupf, freef) \ + CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_SSL_CTX, l, p, newf, dupf, freef) +__owur int SSL_CTX_set_ex_data(SSL_CTX *ssl, int idx, void *data); +void *SSL_CTX_get_ex_data(const SSL_CTX *ssl, int idx); + +__owur int SSL_get_ex_data_X509_STORE_CTX_idx(void); + +#define SSL_CTX_sess_set_cache_size(ctx, t) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SET_SESS_CACHE_SIZE, t, NULL) +#define SSL_CTX_sess_get_cache_size(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_GET_SESS_CACHE_SIZE, 0, NULL) +#define SSL_CTX_set_session_cache_mode(ctx, m) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SET_SESS_CACHE_MODE, m, NULL) +#define SSL_CTX_get_session_cache_mode(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_GET_SESS_CACHE_MODE, 0, NULL) + +#define SSL_CTX_get_default_read_ahead(ctx) SSL_CTX_get_read_ahead(ctx) +#define SSL_CTX_set_default_read_ahead(ctx, m) SSL_CTX_set_read_ahead(ctx, m) +#define SSL_CTX_get_read_ahead(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_GET_READ_AHEAD, 0, NULL) +#define SSL_CTX_set_read_ahead(ctx, m) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SET_READ_AHEAD, m, NULL) +#define SSL_CTX_get_max_cert_list(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_GET_MAX_CERT_LIST, 0, NULL) +#define SSL_CTX_set_max_cert_list(ctx, m) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MAX_CERT_LIST, m, NULL) +#define SSL_get_max_cert_list(ssl) \ + SSL_ctrl(ssl, SSL_CTRL_GET_MAX_CERT_LIST, 0, NULL) +#define SSL_set_max_cert_list(ssl, m) \ + SSL_ctrl(ssl, SSL_CTRL_SET_MAX_CERT_LIST, m, NULL) + +#define SSL_CTX_set_max_send_fragment(ctx, m) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MAX_SEND_FRAGMENT, m, NULL) +#define SSL_set_max_send_fragment(ssl, m) \ + SSL_ctrl(ssl, SSL_CTRL_SET_MAX_SEND_FRAGMENT, m, NULL) +#define SSL_CTX_set_split_send_fragment(ctx, m) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SET_SPLIT_SEND_FRAGMENT, m, NULL) +#define SSL_set_split_send_fragment(ssl, m) \ + SSL_ctrl(ssl, SSL_CTRL_SET_SPLIT_SEND_FRAGMENT, m, NULL) +#define SSL_CTX_set_max_pipelines(ctx, m) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MAX_PIPELINES, m, NULL) +#define SSL_set_max_pipelines(ssl, m) \ + SSL_ctrl(ssl, SSL_CTRL_SET_MAX_PIPELINES, m, NULL) +#define SSL_set_retry_verify(ssl) \ + (SSL_ctrl(ssl, SSL_CTRL_SET_RETRY_VERIFY, 0, NULL) > 0) + +void SSL_CTX_set_default_read_buffer_len(SSL_CTX *ctx, size_t len); +void SSL_set_default_read_buffer_len(SSL *s, size_t len); + +#ifndef OPENSSL_NO_DH +#ifndef OPENSSL_NO_DEPRECATED_3_0 +/* NB: the |keylength| is only applicable when is_export is true */ +OSSL_DEPRECATEDIN_3_0 +void SSL_CTX_set_tmp_dh_callback(SSL_CTX *ctx, + DH *(*dh)(SSL *ssl, int is_export, + int keylength)); +OSSL_DEPRECATEDIN_3_0 +void SSL_set_tmp_dh_callback(SSL *ssl, + DH *(*dh)(SSL *ssl, int is_export, + int keylength)); +#endif +#endif + +__owur const COMP_METHOD *SSL_get_current_compression(const SSL *s); +__owur const COMP_METHOD *SSL_get_current_expansion(const SSL *s); +__owur const char *SSL_COMP_get_name(const COMP_METHOD *comp); +__owur const char *SSL_COMP_get0_name(const SSL_COMP *comp); +__owur int SSL_COMP_get_id(const SSL_COMP *comp); +STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void); +__owur STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP) + *meths); +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define SSL_COMP_free_compression_methods() \ + while (0) \ + continue +#endif +__owur int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm); + +const SSL_CIPHER *SSL_CIPHER_find(SSL *ssl, const unsigned char *ptr); +int SSL_CIPHER_get_cipher_nid(const SSL_CIPHER *c); +int SSL_CIPHER_get_digest_nid(const SSL_CIPHER *c); +int SSL_bytes_to_cipher_list(SSL *s, const unsigned char *bytes, size_t len, + int isv2format, STACK_OF(SSL_CIPHER) **sk, + STACK_OF(SSL_CIPHER) **scsvs); + +/* TLS extensions functions */ +__owur int SSL_set_session_ticket_ext(SSL *s, void *ext_data, int ext_len); + +__owur int SSL_set_session_ticket_ext_cb(SSL *s, + tls_session_ticket_ext_cb_fn cb, + void *arg); + +/* Pre-shared secret session resumption functions */ +__owur int SSL_set_session_secret_cb(SSL *s, + tls_session_secret_cb_fn session_secret_cb, + void *arg); + +void SSL_CTX_set_not_resumable_session_callback(SSL_CTX *ctx, + int (*cb)(SSL *ssl, + int + is_forward_secure)); + +void SSL_set_not_resumable_session_callback(SSL *ssl, + int (*cb)(SSL *ssl, + int is_forward_secure)); + +void SSL_CTX_set_record_padding_callback(SSL_CTX *ctx, + size_t (*cb)(SSL *ssl, int type, + size_t len, void *arg)); +void SSL_CTX_set_record_padding_callback_arg(SSL_CTX *ctx, void *arg); +void *SSL_CTX_get_record_padding_callback_arg(const SSL_CTX *ctx); +int SSL_CTX_set_block_padding(SSL_CTX *ctx, size_t block_size); +int SSL_CTX_set_block_padding_ex(SSL_CTX *ctx, size_t app_block_size, + size_t hs_block_size); + +int SSL_set_record_padding_callback(SSL *ssl, + size_t (*cb)(SSL *ssl, int type, + size_t len, void *arg)); +void SSL_set_record_padding_callback_arg(SSL *ssl, void *arg); +void *SSL_get_record_padding_callback_arg(const SSL *ssl); +int SSL_set_block_padding(SSL *ssl, size_t block_size); +int SSL_set_block_padding_ex(SSL *ssl, size_t app_block_size, + size_t hs_block_size); +int SSL_set_num_tickets(SSL *s, size_t num_tickets); +size_t SSL_get_num_tickets(const SSL *s); +int SSL_CTX_set_num_tickets(SSL_CTX *ctx, size_t num_tickets); +size_t SSL_CTX_get_num_tickets(const SSL_CTX *ctx); + +/* QUIC support */ +int SSL_handle_events(SSL *s); +__owur int SSL_get_event_timeout(SSL *s, struct timeval *tv, int *is_infinite); +__owur int SSL_get_rpoll_descriptor(SSL *s, BIO_POLL_DESCRIPTOR *desc); +__owur int SSL_get_wpoll_descriptor(SSL *s, BIO_POLL_DESCRIPTOR *desc); +__owur int SSL_net_read_desired(SSL *s); +__owur int SSL_net_write_desired(SSL *s); +__owur int SSL_set_blocking_mode(SSL *s, int blocking); +__owur int SSL_get_blocking_mode(SSL *s); +__owur int SSL_set1_initial_peer_addr(SSL *s, const BIO_ADDR *peer_addr); +__owur SSL *SSL_get0_connection(SSL *s); +__owur int SSL_is_connection(SSL *s); + +__owur int SSL_is_listener(SSL *ssl); +__owur SSL *SSL_get0_listener(SSL *s); +#define SSL_LISTENER_FLAG_NO_VALIDATE (1UL << 1) +__owur SSL *SSL_new_listener(SSL_CTX *ctx, uint64_t flags); +__owur SSL *SSL_new_listener_from(SSL *ssl, uint64_t flags); +__owur SSL *SSL_new_from_listener(SSL *ssl, uint64_t flags); +#define SSL_ACCEPT_CONNECTION_NO_BLOCK (1UL << 0) +__owur SSL *SSL_accept_connection(SSL *ssl, uint64_t flags); +__owur size_t SSL_get_accept_connection_queue_len(SSL *ssl); +__owur int SSL_listen(SSL *ssl); + +__owur int SSL_is_domain(SSL *s); +__owur SSL *SSL_get0_domain(SSL *s); +__owur SSL *SSL_new_domain(SSL_CTX *ctx, uint64_t flags); + +#define SSL_DOMAIN_FLAG_SINGLE_THREAD (1U << 0) +#define SSL_DOMAIN_FLAG_MULTI_THREAD (1U << 1) +#define SSL_DOMAIN_FLAG_THREAD_ASSISTED (1U << 2) +#define SSL_DOMAIN_FLAG_BLOCKING (1U << 3) +#define SSL_DOMAIN_FLAG_LEGACY_BLOCKING (1U << 4) + +__owur int SSL_CTX_set_domain_flags(SSL_CTX *ctx, uint64_t domain_flags); +__owur int SSL_CTX_get_domain_flags(const SSL_CTX *ctx, uint64_t *domain_flags); +__owur int SSL_get_domain_flags(const SSL *ssl, uint64_t *domain_flags); + +#define SSL_STREAM_TYPE_NONE 0 +#define SSL_STREAM_TYPE_READ (1U << 0) +#define SSL_STREAM_TYPE_WRITE (1U << 1) +#define SSL_STREAM_TYPE_BIDI (SSL_STREAM_TYPE_READ | SSL_STREAM_TYPE_WRITE) +__owur int SSL_get_stream_type(SSL *s); + +__owur uint64_t SSL_get_stream_id(SSL *s); +__owur int SSL_is_stream_local(SSL *s); + +#define SSL_DEFAULT_STREAM_MODE_NONE 0 +#define SSL_DEFAULT_STREAM_MODE_AUTO_BIDI 1 +#define SSL_DEFAULT_STREAM_MODE_AUTO_UNI 2 +__owur int SSL_set_default_stream_mode(SSL *s, uint32_t mode); + +#define SSL_STREAM_FLAG_UNI (1U << 0) +#define SSL_STREAM_FLAG_NO_BLOCK (1U << 1) +#define SSL_STREAM_FLAG_ADVANCE (1U << 2) +__owur SSL *SSL_new_stream(SSL *s, uint64_t flags); + +#define SSL_INCOMING_STREAM_POLICY_AUTO 0 +#define SSL_INCOMING_STREAM_POLICY_ACCEPT 1 +#define SSL_INCOMING_STREAM_POLICY_REJECT 2 +__owur int SSL_set_incoming_stream_policy(SSL *s, int policy, uint64_t aec); + +#define SSL_ACCEPT_STREAM_NO_BLOCK (1U << 0) +#define SSL_ACCEPT_STREAM_UNI (1U << 1) +#define SSL_ACCEPT_STREAM_BIDI (1U << 2) +__owur SSL *SSL_accept_stream(SSL *s, uint64_t flags); +__owur size_t SSL_get_accept_stream_queue_len(SSL *s); + +#ifndef OPENSSL_NO_QUIC +__owur int SSL_inject_net_dgram(SSL *s, const unsigned char *buf, + size_t buf_len, + const BIO_ADDR *peer, + const BIO_ADDR *local); +#endif + +typedef struct ssl_shutdown_ex_args_st { + uint64_t quic_error_code; + const char *quic_reason; +} SSL_SHUTDOWN_EX_ARGS; + +#define SSL_SHUTDOWN_FLAG_RAPID (1U << 0) +#define SSL_SHUTDOWN_FLAG_NO_STREAM_FLUSH (1U << 1) +#define SSL_SHUTDOWN_FLAG_NO_BLOCK (1U << 2) +#define SSL_SHUTDOWN_FLAG_WAIT_PEER (1U << 3) + +__owur int SSL_shutdown_ex(SSL *ssl, uint64_t flags, + const SSL_SHUTDOWN_EX_ARGS *args, + size_t args_len); + +__owur int SSL_stream_conclude(SSL *ssl, uint64_t flags); + +typedef struct ssl_stream_reset_args_st { + uint64_t quic_error_code; +} SSL_STREAM_RESET_ARGS; + +__owur int SSL_stream_reset(SSL *ssl, + const SSL_STREAM_RESET_ARGS *args, + size_t args_len); + +#define SSL_STREAM_STATE_NONE 0 +#define SSL_STREAM_STATE_OK 1 +#define SSL_STREAM_STATE_WRONG_DIR 2 +#define SSL_STREAM_STATE_FINISHED 3 +#define SSL_STREAM_STATE_RESET_LOCAL 4 +#define SSL_STREAM_STATE_RESET_REMOTE 5 +#define SSL_STREAM_STATE_CONN_CLOSED 6 +__owur int SSL_get_stream_read_state(SSL *ssl); +__owur int SSL_get_stream_write_state(SSL *ssl); + +__owur int SSL_get_stream_read_error_code(SSL *ssl, uint64_t *app_error_code); +__owur int SSL_get_stream_write_error_code(SSL *ssl, uint64_t *app_error_code); + +#define SSL_CONN_CLOSE_FLAG_LOCAL (1U << 0) +#define SSL_CONN_CLOSE_FLAG_TRANSPORT (1U << 1) + +typedef struct ssl_conn_close_info_st { + uint64_t error_code, frame_type; + const char *reason; + size_t reason_len; + uint32_t flags; +} SSL_CONN_CLOSE_INFO; + +__owur int SSL_get_conn_close_info(SSL *ssl, + SSL_CONN_CLOSE_INFO *info, + size_t info_len); + +#define SSL_VALUE_CLASS_GENERIC 0 +#define SSL_VALUE_CLASS_FEATURE_REQUEST 1 +#define SSL_VALUE_CLASS_FEATURE_PEER_REQUEST 2 +#define SSL_VALUE_CLASS_FEATURE_NEGOTIATED 3 + +#define SSL_VALUE_NONE 0 +#define SSL_VALUE_QUIC_STREAM_BIDI_LOCAL_AVAIL 1 +#define SSL_VALUE_QUIC_STREAM_BIDI_REMOTE_AVAIL 2 +#define SSL_VALUE_QUIC_STREAM_UNI_LOCAL_AVAIL 3 +#define SSL_VALUE_QUIC_STREAM_UNI_REMOTE_AVAIL 4 +#define SSL_VALUE_QUIC_IDLE_TIMEOUT 5 +#define SSL_VALUE_EVENT_HANDLING_MODE 6 +#define SSL_VALUE_STREAM_WRITE_BUF_SIZE 7 +#define SSL_VALUE_STREAM_WRITE_BUF_USED 8 +#define SSL_VALUE_STREAM_WRITE_BUF_AVAIL 9 + +#define SSL_VALUE_EVENT_HANDLING_MODE_INHERIT 0 +#define SSL_VALUE_EVENT_HANDLING_MODE_IMPLICIT 1 +#define SSL_VALUE_EVENT_HANDLING_MODE_EXPLICIT 2 + +int SSL_get_value_uint(SSL *s, uint32_t class_, uint32_t id, uint64_t *v); +int SSL_set_value_uint(SSL *s, uint32_t class_, uint32_t id, uint64_t v); + +#define SSL_get_generic_value_uint(ssl, id, v) \ + SSL_get_value_uint((ssl), SSL_VALUE_CLASS_GENERIC, (id), (v)) +#define SSL_set_generic_value_uint(ssl, id, v) \ + SSL_set_value_uint((ssl), SSL_VALUE_CLASS_GENERIC, (id), (v)) +#define SSL_get_feature_request_uint(ssl, id, v) \ + SSL_get_value_uint((ssl), SSL_VALUE_CLASS_FEATURE_REQUEST, (id), (v)) +#define SSL_set_feature_request_uint(ssl, id, v) \ + SSL_set_value_uint((ssl), SSL_VALUE_CLASS_FEATURE_REQUEST, (id), (v)) +#define SSL_get_feature_peer_request_uint(ssl, id, v) \ + SSL_get_value_uint((ssl), SSL_VALUE_CLASS_FEATURE_PEER_REQUEST, (id), (v)) +#define SSL_get_feature_negotiated_uint(ssl, id, v) \ + SSL_get_value_uint((ssl), SSL_VALUE_CLASS_FEATURE_NEGOTIATED, (id), (v)) + +#define SSL_get_quic_stream_bidi_local_avail(ssl, value) \ + SSL_get_generic_value_uint((ssl), SSL_VALUE_QUIC_STREAM_BIDI_LOCAL_AVAIL, \ + (value)) +#define SSL_get_quic_stream_bidi_remote_avail(ssl, value) \ + SSL_get_generic_value_uint((ssl), SSL_VALUE_QUIC_STREAM_BIDI_REMOTE_AVAIL, \ + (value)) +#define SSL_get_quic_stream_uni_local_avail(ssl, value) \ + SSL_get_generic_value_uint((ssl), SSL_VALUE_QUIC_STREAM_UNI_LOCAL_AVAIL, \ + (value)) +#define SSL_get_quic_stream_uni_remote_avail(ssl, value) \ + SSL_get_generic_value_uint((ssl), SSL_VALUE_QUIC_STREAM_UNI_REMOTE_AVAIL, \ + (value)) + +#define SSL_get_event_handling_mode(ssl, value) \ + SSL_get_generic_value_uint((ssl), SSL_VALUE_EVENT_HANDLING_MODE, \ + (value)) +#define SSL_set_event_handling_mode(ssl, value) \ + SSL_set_generic_value_uint((ssl), SSL_VALUE_EVENT_HANDLING_MODE, \ + (value)) + +#define SSL_get_stream_write_buf_size(ssl, value) \ + SSL_get_generic_value_uint((ssl), SSL_VALUE_STREAM_WRITE_BUF_SIZE, \ + (value)) +#define SSL_get_stream_write_buf_used(ssl, value) \ + SSL_get_generic_value_uint((ssl), SSL_VALUE_STREAM_WRITE_BUF_USED, \ + (value)) +#define SSL_get_stream_write_buf_avail(ssl, value) \ + SSL_get_generic_value_uint((ssl), SSL_VALUE_STREAM_WRITE_BUF_AVAIL, \ + (value)) + +#define SSL_POLL_EVENT_NONE 0 + +#define SSL_POLL_EVENT_F (1U << 0) /* F (Failure) */ +#define SSL_POLL_EVENT_EL (1U << 1) /* EL (Exception on Listener) */ +#define SSL_POLL_EVENT_EC (1U << 2) /* EC (Exception on Conn) */ +#define SSL_POLL_EVENT_ECD (1U << 3) /* ECD (Exception on Conn Drained) */ +#define SSL_POLL_EVENT_ER (1U << 4) /* ER (Exception on Read) */ +#define SSL_POLL_EVENT_EW (1U << 5) /* EW (Exception on Write) */ +#define SSL_POLL_EVENT_R (1U << 6) /* R (Readable) */ +#define SSL_POLL_EVENT_W (1U << 7) /* W (Writable) */ +#define SSL_POLL_EVENT_IC (1U << 8) /* IC (Incoming Connection) */ +#define SSL_POLL_EVENT_ISB (1U << 9) /* ISB (Incoming Stream: Bidi) */ +#define SSL_POLL_EVENT_ISU (1U << 10) /* ISU (Incoming Stream: Uni) */ +#define SSL_POLL_EVENT_OSB (1U << 11) /* OSB (Outgoing Stream: Bidi) */ +#define SSL_POLL_EVENT_OSU (1U << 12) /* OSU (Outgoing Stream: Uni) */ + +#define SSL_POLL_EVENT_RW (SSL_POLL_EVENT_R | SSL_POLL_EVENT_W) +#define SSL_POLL_EVENT_RE (SSL_POLL_EVENT_R | SSL_POLL_EVENT_ER) +#define SSL_POLL_EVENT_WE (SSL_POLL_EVENT_W | SSL_POLL_EVENT_EW) +#define SSL_POLL_EVENT_RWE (SSL_POLL_EVENT_RE | SSL_POLL_EVENT_WE) +#define SSL_POLL_EVENT_E (SSL_POLL_EVENT_EL | SSL_POLL_EVENT_EC \ + | SSL_POLL_EVENT_ER | SSL_POLL_EVENT_EW) +#define SSL_POLL_EVENT_IS (SSL_POLL_EVENT_ISB | SSL_POLL_EVENT_ISU) +#define SSL_POLL_EVENT_ISE (SSL_POLL_EVENT_IS | SSL_POLL_EVENT_EC) +#define SSL_POLL_EVENT_I (SSL_POLL_EVENT_IS | SSL_POLL_EVENT_IC) +#define SSL_POLL_EVENT_OS (SSL_POLL_EVENT_OSB | SSL_POLL_EVENT_OSU) +#define SSL_POLL_EVENT_OSE (SSL_POLL_EVENT_OS | SSL_POLL_EVENT_EC) + +typedef struct ssl_poll_item_st { + BIO_POLL_DESCRIPTOR desc; + uint64_t events, revents; +} SSL_POLL_ITEM; + +#define SSL_POLL_FLAG_NO_HANDLE_EVENTS (1U << 0) + +__owur int SSL_poll(SSL_POLL_ITEM *items, + size_t num_items, + size_t stride, + const struct timeval *timeout, + uint64_t flags, + size_t *result_count); + +static ossl_inline ossl_unused BIO_POLL_DESCRIPTOR +SSL_as_poll_descriptor(SSL *s) +{ + BIO_POLL_DESCRIPTOR d; + + d.type = BIO_POLL_DESCRIPTOR_TYPE_SSL; + d.value.ssl = s; + return d; +} + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define SSL_cache_hit(s) SSL_session_reused(s) +#endif + +__owur int SSL_session_reused(const SSL *s); +__owur int SSL_is_server(const SSL *s); + +__owur __owur SSL_CONF_CTX *SSL_CONF_CTX_new(void); +int SSL_CONF_CTX_finish(SSL_CONF_CTX *cctx); +void SSL_CONF_CTX_free(SSL_CONF_CTX *cctx); +unsigned int SSL_CONF_CTX_set_flags(SSL_CONF_CTX *cctx, unsigned int flags); +__owur unsigned int SSL_CONF_CTX_clear_flags(SSL_CONF_CTX *cctx, + unsigned int flags); +__owur int SSL_CONF_CTX_set1_prefix(SSL_CONF_CTX *cctx, const char *pre); + +void SSL_CONF_CTX_set_ssl(SSL_CONF_CTX *cctx, SSL *ssl); +void SSL_CONF_CTX_set_ssl_ctx(SSL_CONF_CTX *cctx, SSL_CTX *ctx); + +__owur int SSL_CONF_cmd(SSL_CONF_CTX *cctx, const char *cmd, const char *value); +__owur int SSL_CONF_cmd_argv(SSL_CONF_CTX *cctx, int *pargc, char ***pargv); +__owur int SSL_CONF_cmd_value_type(SSL_CONF_CTX *cctx, const char *cmd); + +void SSL_add_ssl_module(void); +int SSL_config(SSL *s, const char *name); +int SSL_CTX_config(SSL_CTX *ctx, const char *name); + +#ifndef OPENSSL_NO_SSL_TRACE +void SSL_trace(int write_p, int version, int content_type, + const void *buf, size_t len, SSL *ssl, void *arg); +#endif + +#ifndef OPENSSL_NO_SOCK +int DTLSv1_listen(SSL *s, BIO_ADDR *client); +#endif + +#ifndef OPENSSL_NO_CT + +/* + * A callback for verifying that the received SCTs are sufficient. + * Expected to return 1 if they are sufficient, otherwise 0. + * May return a negative integer if an error occurs. + * A connection should be aborted if the SCTs are deemed insufficient. + */ +typedef int (*ssl_ct_validation_cb)(const CT_POLICY_EVAL_CTX *ctx, + const STACK_OF(SCT) *scts, void *arg); + +/* + * Sets a |callback| that is invoked upon receipt of ServerHelloDone to validate + * the received SCTs. + * If the callback returns a non-positive result, the connection is terminated. + * Call this function before beginning a handshake. + * If a NULL |callback| is provided, SCT validation is disabled. + * |arg| is arbitrary userdata that will be passed to the callback whenever it + * is invoked. Ownership of |arg| remains with the caller. + * + * NOTE: A side-effect of setting a CT callback is that an OCSP stapled response + * will be requested. + */ +int SSL_set_ct_validation_callback(SSL *s, ssl_ct_validation_cb callback, + void *arg); +int SSL_CTX_set_ct_validation_callback(SSL_CTX *ctx, + ssl_ct_validation_cb callback, + void *arg); +#define SSL_disable_ct(s) \ + ((void)SSL_set_validation_callback((s), NULL, NULL)) +#define SSL_CTX_disable_ct(ctx) \ + ((void)SSL_CTX_set_validation_callback((ctx), NULL, NULL)) + +/* + * The validation type enumerates the available behaviours of the built-in SSL + * CT validation callback selected via SSL_enable_ct() and SSL_CTX_enable_ct(). + * The underlying callback is a static function in libssl. + */ +enum { + SSL_CT_VALIDATION_PERMISSIVE = 0, + SSL_CT_VALIDATION_STRICT +}; + +/* + * Enable CT by setting up a callback that implements one of the built-in + * validation variants. The SSL_CT_VALIDATION_PERMISSIVE variant always + * continues the handshake, the application can make appropriate decisions at + * handshake completion. The SSL_CT_VALIDATION_STRICT variant requires at + * least one valid SCT, or else handshake termination will be requested. The + * handshake may continue anyway if SSL_VERIFY_NONE is in effect. + */ +int SSL_enable_ct(SSL *s, int validation_mode); +int SSL_CTX_enable_ct(SSL_CTX *ctx, int validation_mode); + +/* + * Report whether a non-NULL callback is enabled. + */ +int SSL_ct_is_enabled(const SSL *s); +int SSL_CTX_ct_is_enabled(const SSL_CTX *ctx); + +/* Gets the SCTs received from a connection */ +const STACK_OF(SCT) *SSL_get0_peer_scts(SSL *s); + +/* + * Loads the CT log list from the default location. + * If a CTLOG_STORE has previously been set using SSL_CTX_set_ctlog_store, + * the log information loaded from this file will be appended to the + * CTLOG_STORE. + * Returns 1 on success, 0 otherwise. + */ +int SSL_CTX_set_default_ctlog_list_file(SSL_CTX *ctx); + +/* + * Loads the CT log list from the specified file path. + * If a CTLOG_STORE has previously been set using SSL_CTX_set_ctlog_store, + * the log information loaded from this file will be appended to the + * CTLOG_STORE. + * Returns 1 on success, 0 otherwise. + */ +int SSL_CTX_set_ctlog_list_file(SSL_CTX *ctx, const char *path); + +/* + * Sets the CT log list used by all SSL connections created from this SSL_CTX. + * Ownership of the CTLOG_STORE is transferred to the SSL_CTX. + */ +void SSL_CTX_set0_ctlog_store(SSL_CTX *ctx, CTLOG_STORE *logs); + +/* + * Gets the CT log list used by all SSL connections created from this SSL_CTX. + * This will be NULL unless one of the following functions has been called: + * - SSL_CTX_set_default_ctlog_list_file + * - SSL_CTX_set_ctlog_list_file + * - SSL_CTX_set_ctlog_store + */ +const CTLOG_STORE *SSL_CTX_get0_ctlog_store(const SSL_CTX *ctx); + +#endif /* OPENSSL_NO_CT */ + +/* What the "other" parameter contains in security callback */ +/* Mask for type */ +#define SSL_SECOP_OTHER_TYPE 0xffff0000 +#define SSL_SECOP_OTHER_NONE 0 +#define SSL_SECOP_OTHER_CIPHER (1 << 16) +#define SSL_SECOP_OTHER_CURVE (2 << 16) +#define SSL_SECOP_OTHER_DH (3 << 16) +#define SSL_SECOP_OTHER_PKEY (4 << 16) +#define SSL_SECOP_OTHER_SIGALG (5 << 16) +#define SSL_SECOP_OTHER_CERT (6 << 16) + +/* Indicated operation refers to peer key or certificate */ +#define SSL_SECOP_PEER 0x1000 + +/* Values for "op" parameter in security callback */ + +/* Called to filter ciphers */ +/* Ciphers client supports */ +#define SSL_SECOP_CIPHER_SUPPORTED (1 | SSL_SECOP_OTHER_CIPHER) +/* Cipher shared by client/server */ +#define SSL_SECOP_CIPHER_SHARED (2 | SSL_SECOP_OTHER_CIPHER) +/* Sanity check of cipher server selects */ +#define SSL_SECOP_CIPHER_CHECK (3 | SSL_SECOP_OTHER_CIPHER) +/* Curves supported by client */ +#define SSL_SECOP_CURVE_SUPPORTED (4 | SSL_SECOP_OTHER_CURVE) +/* Curves shared by client/server */ +#define SSL_SECOP_CURVE_SHARED (5 | SSL_SECOP_OTHER_CURVE) +/* Sanity check of curve server selects */ +#define SSL_SECOP_CURVE_CHECK (6 | SSL_SECOP_OTHER_CURVE) +/* Temporary DH key */ +#define SSL_SECOP_TMP_DH (7 | SSL_SECOP_OTHER_PKEY) +/* SSL/TLS version */ +#define SSL_SECOP_VERSION (9 | SSL_SECOP_OTHER_NONE) +/* Session tickets */ +#define SSL_SECOP_TICKET (10 | SSL_SECOP_OTHER_NONE) +/* Supported signature algorithms sent to peer */ +#define SSL_SECOP_SIGALG_SUPPORTED (11 | SSL_SECOP_OTHER_SIGALG) +/* Shared signature algorithm */ +#define SSL_SECOP_SIGALG_SHARED (12 | SSL_SECOP_OTHER_SIGALG) +/* Sanity check signature algorithm allowed */ +#define SSL_SECOP_SIGALG_CHECK (13 | SSL_SECOP_OTHER_SIGALG) +/* Used to get mask of supported public key signature algorithms */ +#define SSL_SECOP_SIGALG_MASK (14 | SSL_SECOP_OTHER_SIGALG) +/* Use to see if compression is allowed */ +#define SSL_SECOP_COMPRESSION (15 | SSL_SECOP_OTHER_NONE) +/* EE key in certificate */ +#define SSL_SECOP_EE_KEY (16 | SSL_SECOP_OTHER_CERT) +/* CA key in certificate */ +#define SSL_SECOP_CA_KEY (17 | SSL_SECOP_OTHER_CERT) +/* CA digest algorithm in certificate */ +#define SSL_SECOP_CA_MD (18 | SSL_SECOP_OTHER_CERT) +/* Peer EE key in certificate */ +#define SSL_SECOP_PEER_EE_KEY (SSL_SECOP_EE_KEY | SSL_SECOP_PEER) +/* Peer CA key in certificate */ +#define SSL_SECOP_PEER_CA_KEY (SSL_SECOP_CA_KEY | SSL_SECOP_PEER) +/* Peer CA digest algorithm in certificate */ +#define SSL_SECOP_PEER_CA_MD (SSL_SECOP_CA_MD | SSL_SECOP_PEER) + +void SSL_set_security_level(SSL *s, int level); +__owur int SSL_get_security_level(const SSL *s); +void SSL_set_security_callback(SSL *s, + int (*cb)(const SSL *s, const SSL_CTX *ctx, + int op, int bits, int nid, + void *other, void *ex)); +int (*SSL_get_security_callback(const SSL *s))(const SSL *s, + const SSL_CTX *ctx, int op, + int bits, int nid, void *other, + void *ex); +void SSL_set0_security_ex_data(SSL *s, void *ex); +__owur void *SSL_get0_security_ex_data(const SSL *s); + +void SSL_CTX_set_security_level(SSL_CTX *ctx, int level); +__owur int SSL_CTX_get_security_level(const SSL_CTX *ctx); +void SSL_CTX_set_security_callback(SSL_CTX *ctx, + int (*cb)(const SSL *s, const SSL_CTX *ctx, + int op, int bits, int nid, + void *other, void *ex)); +int (*SSL_CTX_get_security_callback(const SSL_CTX *ctx))(const SSL *s, + const SSL_CTX *ctx, + int op, int bits, + int nid, + void *other, + void *ex); +void SSL_CTX_set0_security_ex_data(SSL_CTX *ctx, void *ex); +__owur void *SSL_CTX_get0_security_ex_data(const SSL_CTX *ctx); + +/* OPENSSL_INIT flag 0x010000 reserved for internal use */ +#define OPENSSL_INIT_NO_LOAD_SSL_STRINGS 0x00100000L +#define OPENSSL_INIT_LOAD_SSL_STRINGS 0x00200000L + +#define OPENSSL_INIT_SSL_DEFAULT \ + (OPENSSL_INIT_LOAD_SSL_STRINGS | OPENSSL_INIT_LOAD_CRYPTO_STRINGS) + +int OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings); + +#ifndef OPENSSL_NO_UNIT_TEST +__owur const struct openssl_ssl_test_functions *SSL_test_functions(void); +#endif + +__owur int SSL_free_buffers(SSL *ssl); +__owur int SSL_alloc_buffers(SSL *ssl); + +/* Status codes passed to the decrypt session ticket callback. Some of these + * are for internal use only and are never passed to the callback. */ +typedef int SSL_TICKET_STATUS; + +/* Support for ticket appdata */ +/* fatal error, malloc failure */ +#define SSL_TICKET_FATAL_ERR_MALLOC 0 +/* fatal error, either from parsing or decrypting the ticket */ +#define SSL_TICKET_FATAL_ERR_OTHER 1 +/* No ticket present */ +#define SSL_TICKET_NONE 2 +/* Empty ticket present */ +#define SSL_TICKET_EMPTY 3 +/* the ticket couldn't be decrypted */ +#define SSL_TICKET_NO_DECRYPT 4 +/* a ticket was successfully decrypted */ +#define SSL_TICKET_SUCCESS 5 +/* same as above but the ticket needs to be renewed */ +#define SSL_TICKET_SUCCESS_RENEW 6 + +/* Return codes for the decrypt session ticket callback */ +typedef int SSL_TICKET_RETURN; + +/* An error occurred */ +#define SSL_TICKET_RETURN_ABORT 0 +/* Do not use the ticket, do not send a renewed ticket to the client */ +#define SSL_TICKET_RETURN_IGNORE 1 +/* Do not use the ticket, send a renewed ticket to the client */ +#define SSL_TICKET_RETURN_IGNORE_RENEW 2 +/* Use the ticket, do not send a renewed ticket to the client */ +#define SSL_TICKET_RETURN_USE 3 +/* Use the ticket, send a renewed ticket to the client */ +#define SSL_TICKET_RETURN_USE_RENEW 4 + +typedef int (*SSL_CTX_generate_session_ticket_fn)(SSL *s, void *arg); +typedef SSL_TICKET_RETURN (*SSL_CTX_decrypt_session_ticket_fn)(SSL *s, SSL_SESSION *ss, + const unsigned char *keyname, + size_t keyname_length, + SSL_TICKET_STATUS status, + void *arg); +int SSL_CTX_set_session_ticket_cb(SSL_CTX *ctx, + SSL_CTX_generate_session_ticket_fn gen_cb, + SSL_CTX_decrypt_session_ticket_fn dec_cb, + void *arg); +int SSL_SESSION_set1_ticket_appdata(SSL_SESSION *ss, const void *data, size_t len); +int SSL_SESSION_get0_ticket_appdata(SSL_SESSION *ss, void **data, size_t *len); + +typedef unsigned int (*DTLS_timer_cb)(SSL *s, unsigned int timer_us); + +void DTLS_set_timer_cb(SSL *s, DTLS_timer_cb cb); + +typedef int (*SSL_allow_early_data_cb_fn)(SSL *s, void *arg); +void SSL_CTX_set_allow_early_data_cb(SSL_CTX *ctx, + SSL_allow_early_data_cb_fn cb, + void *arg); +void SSL_set_allow_early_data_cb(SSL *s, + SSL_allow_early_data_cb_fn cb, + void *arg); + +/* store the default cipher strings inside the library */ +const char *OSSL_default_cipher_list(void); +const char *OSSL_default_ciphersuites(void); + +/* RFC8879 Certificate compression APIs */ + +int SSL_CTX_compress_certs(SSL_CTX *ctx, int alg); +int SSL_compress_certs(SSL *ssl, int alg); + +int SSL_CTX_set1_cert_comp_preference(SSL_CTX *ctx, int *algs, size_t len); +int SSL_set1_cert_comp_preference(SSL *ssl, int *algs, size_t len); + +int SSL_CTX_set1_compressed_cert(SSL_CTX *ctx, int algorithm, unsigned char *comp_data, + size_t comp_length, size_t orig_length); +int SSL_set1_compressed_cert(SSL *ssl, int algorithm, unsigned char *comp_data, + size_t comp_length, size_t orig_length); +size_t SSL_CTX_get1_compressed_cert(SSL_CTX *ctx, int alg, unsigned char **data, size_t *orig_len); +size_t SSL_get1_compressed_cert(SSL *ssl, int alg, unsigned char **data, size_t *orig_len); + +__owur int SSL_add_expected_rpk(SSL *s, EVP_PKEY *rpk); +__owur EVP_PKEY *SSL_get0_peer_rpk(const SSL *s); +__owur EVP_PKEY *SSL_SESSION_get0_peer_rpk(SSL_SESSION *s); +__owur int SSL_get_negotiated_client_cert_type(const SSL *s); +__owur int SSL_get_negotiated_server_cert_type(const SSL *s); + +__owur int SSL_set1_client_cert_type(SSL *s, const unsigned char *val, size_t len); +__owur int SSL_set1_server_cert_type(SSL *s, const unsigned char *val, size_t len); +__owur int SSL_CTX_set1_client_cert_type(SSL_CTX *ctx, const unsigned char *val, size_t len); +__owur int SSL_CTX_set1_server_cert_type(SSL_CTX *ctx, const unsigned char *val, size_t len); +__owur int SSL_get0_client_cert_type(const SSL *s, unsigned char **t, size_t *len); +__owur int SSL_get0_server_cert_type(const SSL *s, unsigned char **t, size_t *len); +__owur int SSL_CTX_get0_client_cert_type(const SSL_CTX *ctx, unsigned char **t, size_t *len); +__owur int SSL_CTX_get0_server_cert_type(const SSL_CTX *s, unsigned char **t, size_t *len); + +/* + * Protection level. For <= TLSv1.2 only "NONE" and "APPLICATION" are used. + */ +#define OSSL_RECORD_PROTECTION_LEVEL_NONE 0 +#define OSSL_RECORD_PROTECTION_LEVEL_EARLY 1 +#define OSSL_RECORD_PROTECTION_LEVEL_HANDSHAKE 2 +#define OSSL_RECORD_PROTECTION_LEVEL_APPLICATION 3 + +int SSL_set_quic_tls_cbs(SSL *s, const OSSL_DISPATCH *qtdis, void *arg); +int SSL_set_quic_tls_transport_params(SSL *s, + const unsigned char *params, + size_t params_len); + +int SSL_set_quic_tls_early_data_enabled(SSL *s, int enabled); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ssl2.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ssl2.h new file mode 100644 index 0000000000000000000000000000000000000000..67d1d0291a160d2689c9f8122eff1c0050743cbe --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ssl2.h @@ -0,0 +1,30 @@ +/* + * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_SSL2_H +#define OPENSSL_SSL2_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_SSL2_H +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define SSL2_VERSION 0x0002 + +#define SSL2_MT_CLIENT_HELLO 1 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ssl3.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ssl3.h new file mode 100644 index 0000000000000000000000000000000000000000..f35b6eadb0f7bd5b323dee4aadb726cbcdd9b8cc --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ssl3.h @@ -0,0 +1,357 @@ +/* + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. + * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_SSL3_H +#define OPENSSL_SSL3_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_SSL3_H +#endif + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Signalling cipher suite value from RFC 5746 + * (TLS_EMPTY_RENEGOTIATION_INFO_SCSV) + */ +#define SSL3_CK_SCSV 0x030000FF + +/* + * Signalling cipher suite value from draft-ietf-tls-downgrade-scsv-00 + * (TLS_FALLBACK_SCSV) + */ +#define SSL3_CK_FALLBACK_SCSV 0x03005600 + +#define SSL3_CK_RSA_NULL_MD5 0x03000001 +#define SSL3_CK_RSA_NULL_SHA 0x03000002 +#define SSL3_CK_RSA_RC4_40_MD5 0x03000003 +#define SSL3_CK_RSA_RC4_128_MD5 0x03000004 +#define SSL3_CK_RSA_RC4_128_SHA 0x03000005 +#define SSL3_CK_RSA_RC2_40_MD5 0x03000006 +#define SSL3_CK_RSA_IDEA_128_SHA 0x03000007 +#define SSL3_CK_RSA_DES_40_CBC_SHA 0x03000008 +#define SSL3_CK_RSA_DES_64_CBC_SHA 0x03000009 +#define SSL3_CK_RSA_DES_192_CBC3_SHA 0x0300000A + +#define SSL3_CK_DH_DSS_DES_40_CBC_SHA 0x0300000B +#define SSL3_CK_DH_DSS_DES_64_CBC_SHA 0x0300000C +#define SSL3_CK_DH_DSS_DES_192_CBC3_SHA 0x0300000D +#define SSL3_CK_DH_RSA_DES_40_CBC_SHA 0x0300000E +#define SSL3_CK_DH_RSA_DES_64_CBC_SHA 0x0300000F +#define SSL3_CK_DH_RSA_DES_192_CBC3_SHA 0x03000010 + +#define SSL3_CK_DHE_DSS_DES_40_CBC_SHA 0x03000011 +#define SSL3_CK_EDH_DSS_DES_40_CBC_SHA SSL3_CK_DHE_DSS_DES_40_CBC_SHA +#define SSL3_CK_DHE_DSS_DES_64_CBC_SHA 0x03000012 +#define SSL3_CK_EDH_DSS_DES_64_CBC_SHA SSL3_CK_DHE_DSS_DES_64_CBC_SHA +#define SSL3_CK_DHE_DSS_DES_192_CBC3_SHA 0x03000013 +#define SSL3_CK_EDH_DSS_DES_192_CBC3_SHA SSL3_CK_DHE_DSS_DES_192_CBC3_SHA +#define SSL3_CK_DHE_RSA_DES_40_CBC_SHA 0x03000014 +#define SSL3_CK_EDH_RSA_DES_40_CBC_SHA SSL3_CK_DHE_RSA_DES_40_CBC_SHA +#define SSL3_CK_DHE_RSA_DES_64_CBC_SHA 0x03000015 +#define SSL3_CK_EDH_RSA_DES_64_CBC_SHA SSL3_CK_DHE_RSA_DES_64_CBC_SHA +#define SSL3_CK_DHE_RSA_DES_192_CBC3_SHA 0x03000016 +#define SSL3_CK_EDH_RSA_DES_192_CBC3_SHA SSL3_CK_DHE_RSA_DES_192_CBC3_SHA + +#define SSL3_CK_ADH_RC4_40_MD5 0x03000017 +#define SSL3_CK_ADH_RC4_128_MD5 0x03000018 +#define SSL3_CK_ADH_DES_40_CBC_SHA 0x03000019 +#define SSL3_CK_ADH_DES_64_CBC_SHA 0x0300001A +#define SSL3_CK_ADH_DES_192_CBC_SHA 0x0300001B + +/* a bundle of RFC standard cipher names, generated from ssl3_ciphers[] */ +#define SSL3_RFC_RSA_NULL_MD5 "TLS_RSA_WITH_NULL_MD5" +#define SSL3_RFC_RSA_NULL_SHA "TLS_RSA_WITH_NULL_SHA" +#define SSL3_RFC_RSA_DES_192_CBC3_SHA "TLS_RSA_WITH_3DES_EDE_CBC_SHA" +#define SSL3_RFC_DHE_DSS_DES_192_CBC3_SHA "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" +#define SSL3_RFC_DHE_RSA_DES_192_CBC3_SHA "TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA" +#define SSL3_RFC_ADH_DES_192_CBC_SHA "TLS_DH_anon_WITH_3DES_EDE_CBC_SHA" +#define SSL3_RFC_RSA_IDEA_128_SHA "TLS_RSA_WITH_IDEA_CBC_SHA" +#define SSL3_RFC_RSA_RC4_128_MD5 "TLS_RSA_WITH_RC4_128_MD5" +#define SSL3_RFC_RSA_RC4_128_SHA "TLS_RSA_WITH_RC4_128_SHA" +#define SSL3_RFC_ADH_RC4_128_MD5 "TLS_DH_anon_WITH_RC4_128_MD5" + +#define SSL3_TXT_RSA_NULL_MD5 "NULL-MD5" +#define SSL3_TXT_RSA_NULL_SHA "NULL-SHA" +#define SSL3_TXT_RSA_RC4_40_MD5 "EXP-RC4-MD5" +#define SSL3_TXT_RSA_RC4_128_MD5 "RC4-MD5" +#define SSL3_TXT_RSA_RC4_128_SHA "RC4-SHA" +#define SSL3_TXT_RSA_RC2_40_MD5 "EXP-RC2-CBC-MD5" +#define SSL3_TXT_RSA_IDEA_128_SHA "IDEA-CBC-SHA" +#define SSL3_TXT_RSA_DES_40_CBC_SHA "EXP-DES-CBC-SHA" +#define SSL3_TXT_RSA_DES_64_CBC_SHA "DES-CBC-SHA" +#define SSL3_TXT_RSA_DES_192_CBC3_SHA "DES-CBC3-SHA" + +#define SSL3_TXT_DH_DSS_DES_40_CBC_SHA "EXP-DH-DSS-DES-CBC-SHA" +#define SSL3_TXT_DH_DSS_DES_64_CBC_SHA "DH-DSS-DES-CBC-SHA" +#define SSL3_TXT_DH_DSS_DES_192_CBC3_SHA "DH-DSS-DES-CBC3-SHA" +#define SSL3_TXT_DH_RSA_DES_40_CBC_SHA "EXP-DH-RSA-DES-CBC-SHA" +#define SSL3_TXT_DH_RSA_DES_64_CBC_SHA "DH-RSA-DES-CBC-SHA" +#define SSL3_TXT_DH_RSA_DES_192_CBC3_SHA "DH-RSA-DES-CBC3-SHA" + +#define SSL3_TXT_DHE_DSS_DES_40_CBC_SHA "EXP-DHE-DSS-DES-CBC-SHA" +#define SSL3_TXT_DHE_DSS_DES_64_CBC_SHA "DHE-DSS-DES-CBC-SHA" +#define SSL3_TXT_DHE_DSS_DES_192_CBC3_SHA "DHE-DSS-DES-CBC3-SHA" +#define SSL3_TXT_DHE_RSA_DES_40_CBC_SHA "EXP-DHE-RSA-DES-CBC-SHA" +#define SSL3_TXT_DHE_RSA_DES_64_CBC_SHA "DHE-RSA-DES-CBC-SHA" +#define SSL3_TXT_DHE_RSA_DES_192_CBC3_SHA "DHE-RSA-DES-CBC3-SHA" + +/* + * This next block of six "EDH" labels is for backward compatibility with + * older versions of OpenSSL. New code should use the six "DHE" labels above + * instead: + */ +#define SSL3_TXT_EDH_DSS_DES_40_CBC_SHA "EXP-EDH-DSS-DES-CBC-SHA" +#define SSL3_TXT_EDH_DSS_DES_64_CBC_SHA "EDH-DSS-DES-CBC-SHA" +#define SSL3_TXT_EDH_DSS_DES_192_CBC3_SHA "EDH-DSS-DES-CBC3-SHA" +#define SSL3_TXT_EDH_RSA_DES_40_CBC_SHA "EXP-EDH-RSA-DES-CBC-SHA" +#define SSL3_TXT_EDH_RSA_DES_64_CBC_SHA "EDH-RSA-DES-CBC-SHA" +#define SSL3_TXT_EDH_RSA_DES_192_CBC3_SHA "EDH-RSA-DES-CBC3-SHA" + +#define SSL3_TXT_ADH_RC4_40_MD5 "EXP-ADH-RC4-MD5" +#define SSL3_TXT_ADH_RC4_128_MD5 "ADH-RC4-MD5" +#define SSL3_TXT_ADH_DES_40_CBC_SHA "EXP-ADH-DES-CBC-SHA" +#define SSL3_TXT_ADH_DES_64_CBC_SHA "ADH-DES-CBC-SHA" +#define SSL3_TXT_ADH_DES_192_CBC_SHA "ADH-DES-CBC3-SHA" + +#define SSL3_SSL_SESSION_ID_LENGTH 32 +#define SSL3_MAX_SSL_SESSION_ID_LENGTH 32 + +#define SSL3_MASTER_SECRET_SIZE 48 +#define SSL3_RANDOM_SIZE 32 +#define SSL3_SESSION_ID_SIZE 32 +#define SSL3_RT_HEADER_LENGTH 5 + +#define SSL3_HM_HEADER_LENGTH 4 + +#ifndef SSL3_ALIGN_PAYLOAD +/* + * Some will argue that this increases memory footprint, but it's not + * actually true. Point is that malloc has to return at least 64-bit aligned + * pointers, meaning that allocating 5 bytes wastes 3 bytes in either case. + * Suggested pre-gaping simply moves these wasted bytes from the end of + * allocated region to its front, but makes data payload aligned, which + * improves performance:-) + */ +#define SSL3_ALIGN_PAYLOAD 8 +#else +#if (SSL3_ALIGN_PAYLOAD & (SSL3_ALIGN_PAYLOAD - 1)) != 0 +#error "insane SSL3_ALIGN_PAYLOAD" +#undef SSL3_ALIGN_PAYLOAD +#endif +#endif + +/* + * This is the maximum MAC (digest) size used by the SSL library. Currently + * maximum of 20 is used by SHA1, but we reserve for future extension for + * 512-bit hashes. + */ + +#define SSL3_RT_MAX_MD_SIZE 64 + +/* + * Maximum block size used in all ciphersuites. Currently 16 for AES. + */ + +#define SSL_RT_MAX_CIPHER_BLOCK_SIZE 16 + +#define SSL3_RT_MAX_EXTRA (16384) + +/* Maximum plaintext length: defined by SSL/TLS standards */ +#define SSL3_RT_MAX_PLAIN_LENGTH 16384 +/* Maximum compression overhead: defined by SSL/TLS standards */ +#define SSL3_RT_MAX_COMPRESSED_OVERHEAD 1024 + +/* + * The standards give a maximum encryption overhead of 1024 bytes. In + * practice the value is lower than this. The overhead is the maximum number + * of padding bytes (256) plus the mac size. + */ +#define SSL3_RT_MAX_ENCRYPTED_OVERHEAD (256 + SSL3_RT_MAX_MD_SIZE) +#define SSL3_RT_MAX_TLS13_ENCRYPTED_OVERHEAD 256 + +/* + * OpenSSL currently only uses a padding length of at most one block so the + * send overhead is smaller. + */ + +#define SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD \ + (SSL_RT_MAX_CIPHER_BLOCK_SIZE + SSL3_RT_MAX_MD_SIZE) + +/* If compression isn't used don't include the compression overhead */ + +#ifdef OPENSSL_NO_COMP +#define SSL3_RT_MAX_COMPRESSED_LENGTH SSL3_RT_MAX_PLAIN_LENGTH +#else +#define SSL3_RT_MAX_COMPRESSED_LENGTH \ + (SSL3_RT_MAX_PLAIN_LENGTH + SSL3_RT_MAX_COMPRESSED_OVERHEAD) +#endif +#define SSL3_RT_MAX_ENCRYPTED_LENGTH \ + (SSL3_RT_MAX_ENCRYPTED_OVERHEAD + SSL3_RT_MAX_COMPRESSED_LENGTH) +#define SSL3_RT_MAX_TLS13_ENCRYPTED_LENGTH \ + (SSL3_RT_MAX_PLAIN_LENGTH + SSL3_RT_MAX_TLS13_ENCRYPTED_OVERHEAD) +#define SSL3_RT_MAX_PACKET_SIZE \ + (SSL3_RT_MAX_ENCRYPTED_LENGTH + SSL3_RT_HEADER_LENGTH) + +#define SSL3_MD_CLIENT_FINISHED_CONST "\x43\x4C\x4E\x54" +#define SSL3_MD_SERVER_FINISHED_CONST "\x53\x52\x56\x52" + +/* SSL3_VERSION is defined in prov_ssl.h */ +#define SSL3_VERSION_MAJOR 0x03 +#define SSL3_VERSION_MINOR 0x00 + +#define SSL3_RT_CHANGE_CIPHER_SPEC 20 +#define SSL3_RT_ALERT 21 +#define SSL3_RT_HANDSHAKE 22 +#define SSL3_RT_APPLICATION_DATA 23 + +/* Pseudo content types to indicate additional parameters */ +#define TLS1_RT_CRYPTO 0x1000 +#define TLS1_RT_CRYPTO_PREMASTER (TLS1_RT_CRYPTO | 0x1) +#define TLS1_RT_CRYPTO_CLIENT_RANDOM (TLS1_RT_CRYPTO | 0x2) +#define TLS1_RT_CRYPTO_SERVER_RANDOM (TLS1_RT_CRYPTO | 0x3) +#define TLS1_RT_CRYPTO_MASTER (TLS1_RT_CRYPTO | 0x4) + +#define TLS1_RT_CRYPTO_READ 0x0000 +#define TLS1_RT_CRYPTO_WRITE 0x0100 +#define TLS1_RT_CRYPTO_MAC (TLS1_RT_CRYPTO | 0x5) +#define TLS1_RT_CRYPTO_KEY (TLS1_RT_CRYPTO | 0x6) +#define TLS1_RT_CRYPTO_IV (TLS1_RT_CRYPTO | 0x7) +#define TLS1_RT_CRYPTO_FIXED_IV (TLS1_RT_CRYPTO | 0x8) + +/* Pseudo content types for SSL/TLS header info */ +#define SSL3_RT_HEADER 0x100 +#define SSL3_RT_INNER_CONTENT_TYPE 0x101 + +/* Pseudo content types for QUIC */ +#define SSL3_RT_QUIC_DATAGRAM 0x200 +#define SSL3_RT_QUIC_PACKET 0x201 +#define SSL3_RT_QUIC_FRAME_FULL 0x202 +#define SSL3_RT_QUIC_FRAME_HEADER 0x203 +#define SSL3_RT_QUIC_FRAME_PADDING 0x204 + +#define SSL3_AL_WARNING 1 +#define SSL3_AL_FATAL 2 + +#define SSL3_AD_CLOSE_NOTIFY 0 +#define SSL3_AD_UNEXPECTED_MESSAGE 10 /* fatal */ +#define SSL3_AD_BAD_RECORD_MAC 20 /* fatal */ +#define SSL3_AD_DECOMPRESSION_FAILURE 30 /* fatal */ +#define SSL3_AD_HANDSHAKE_FAILURE 40 /* fatal */ +#define SSL3_AD_NO_CERTIFICATE 41 +#define SSL3_AD_BAD_CERTIFICATE 42 +#define SSL3_AD_UNSUPPORTED_CERTIFICATE 43 +#define SSL3_AD_CERTIFICATE_REVOKED 44 +#define SSL3_AD_CERTIFICATE_EXPIRED 45 +#define SSL3_AD_CERTIFICATE_UNKNOWN 46 +#define SSL3_AD_ILLEGAL_PARAMETER 47 /* fatal */ + +#define TLS1_HB_REQUEST 1 +#define TLS1_HB_RESPONSE 2 + +#define SSL3_CT_RSA_SIGN 1 +#define SSL3_CT_DSS_SIGN 2 +#define SSL3_CT_RSA_FIXED_DH 3 +#define SSL3_CT_DSS_FIXED_DH 4 +#define SSL3_CT_RSA_EPHEMERAL_DH 5 +#define SSL3_CT_DSS_EPHEMERAL_DH 6 +#define SSL3_CT_FORTEZZA_DMS 20 +/* + * SSL3_CT_NUMBER is used to size arrays and it must be large enough to + * contain all of the cert types defined for *either* SSLv3 and TLSv1. + */ +#define SSL3_CT_NUMBER 12 + +#if defined(TLS_CT_NUMBER) +#if TLS_CT_NUMBER != SSL3_CT_NUMBER +#error "SSL/TLS CT_NUMBER values do not match" +#endif +#endif + +/* No longer used as of OpenSSL 1.1.1 */ +#define SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS 0x0001 + +/* Removed from OpenSSL 1.1.0 */ +#define TLS1_FLAGS_TLS_PADDING_BUG 0x0 + +#define TLS1_FLAGS_SKIP_CERT_VERIFY 0x0010 + +/* Set if we encrypt then mac instead of usual mac then encrypt */ +#define TLS1_FLAGS_ENCRYPT_THEN_MAC_READ 0x0100 +#define TLS1_FLAGS_ENCRYPT_THEN_MAC TLS1_FLAGS_ENCRYPT_THEN_MAC_READ + +/* Set if extended master secret extension received from peer */ +#define TLS1_FLAGS_RECEIVED_EXTMS 0x0200 + +#define TLS1_FLAGS_ENCRYPT_THEN_MAC_WRITE 0x0400 + +#define TLS1_FLAGS_STATELESS 0x0800 + +/* Set if extended master secret extension required on renegotiation */ +#define TLS1_FLAGS_REQUIRED_EXTMS 0x1000 + +/* 0x2000 is reserved for TLS1_FLAGS_QUIC (internal) */ +/* 0x4000 is reserved for TLS1_FLAGS_QUIC_INTERNAL (internal) */ + +#define SSL3_MT_HELLO_REQUEST 0 +#define SSL3_MT_CLIENT_HELLO 1 +#define SSL3_MT_SERVER_HELLO 2 +#define SSL3_MT_NEWSESSION_TICKET 4 +#define SSL3_MT_END_OF_EARLY_DATA 5 +#define SSL3_MT_ENCRYPTED_EXTENSIONS 8 +#define SSL3_MT_CERTIFICATE 11 +#define SSL3_MT_SERVER_KEY_EXCHANGE 12 +#define SSL3_MT_CERTIFICATE_REQUEST 13 +#define SSL3_MT_SERVER_DONE 14 +#define SSL3_MT_CERTIFICATE_VERIFY 15 +#define SSL3_MT_CLIENT_KEY_EXCHANGE 16 +#define SSL3_MT_FINISHED 20 +#define SSL3_MT_CERTIFICATE_URL 21 +#define SSL3_MT_CERTIFICATE_STATUS 22 +#define SSL3_MT_SUPPLEMENTAL_DATA 23 +#define SSL3_MT_KEY_UPDATE 24 +#define SSL3_MT_COMPRESSED_CERTIFICATE 25 +#ifndef OPENSSL_NO_NEXTPROTONEG +#define SSL3_MT_NEXT_PROTO 67 +#endif +#define SSL3_MT_MESSAGE_HASH 254 +#define DTLS1_MT_HELLO_VERIFY_REQUEST 3 + +/* Dummy message type for handling CCS like a normal handshake message */ +#define SSL3_MT_CHANGE_CIPHER_SPEC 0x0101 + +#define SSL3_MT_CCS 1 + +/* These are used when changing over to a new cipher */ +#define SSL3_CC_READ 0x001 +#define SSL3_CC_WRITE 0x002 +#define SSL3_CC_CLIENT 0x010 +#define SSL3_CC_SERVER 0x020 +#define SSL3_CC_EARLY 0x040 +#define SSL3_CC_HANDSHAKE 0x080 +#define SSL3_CC_APPLICATION 0x100 +#define SSL3_CHANGE_CIPHER_CLIENT_WRITE (SSL3_CC_CLIENT | SSL3_CC_WRITE) +#define SSL3_CHANGE_CIPHER_SERVER_READ (SSL3_CC_SERVER | SSL3_CC_READ) +#define SSL3_CHANGE_CIPHER_CLIENT_READ (SSL3_CC_CLIENT | SSL3_CC_READ) +#define SSL3_CHANGE_CIPHER_SERVER_WRITE (SSL3_CC_SERVER | SSL3_CC_WRITE) + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/sslerr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/sslerr.h new file mode 100644 index 0000000000000000000000000000000000000000..6993255b199f141ef8675943ec59eb31b12107bc --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/sslerr.h @@ -0,0 +1,380 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_SSLERR_H +#define OPENSSL_SSLERR_H +#pragma once + +#include +#include +#include + +/* + * SSL reason codes. + */ +#define SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY 291 +#define SSL_R_APP_DATA_IN_HANDSHAKE 100 +#define SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT 272 +#define SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE 158 +#define SSL_R_BAD_CERTIFICATE 348 +#define SSL_R_BAD_CHANGE_CIPHER_SPEC 103 +#define SSL_R_BAD_CIPHER 186 +#define SSL_R_BAD_COMPRESSION_ALGORITHM 326 +#define SSL_R_BAD_DATA 390 +#define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK 106 +#define SSL_R_BAD_DECOMPRESSION 107 +#define SSL_R_BAD_DH_VALUE 102 +#define SSL_R_BAD_DIGEST_LENGTH 111 +#define SSL_R_BAD_EARLY_DATA 233 +#define SSL_R_BAD_ECC_CERT 304 +#define SSL_R_BAD_ECPOINT 306 +#define SSL_R_BAD_EXTENSION 110 +#define SSL_R_BAD_HANDSHAKE_LENGTH 332 +#define SSL_R_BAD_HANDSHAKE_STATE 236 +#define SSL_R_BAD_HELLO_REQUEST 105 +#define SSL_R_BAD_HRR_VERSION 263 +#define SSL_R_BAD_KEY_SHARE 108 +#define SSL_R_BAD_KEY_UPDATE 122 +#define SSL_R_BAD_LEGACY_VERSION 292 +#define SSL_R_BAD_LENGTH 271 +#define SSL_R_BAD_PACKET 240 +#define SSL_R_BAD_PACKET_LENGTH 115 +#define SSL_R_BAD_PROTOCOL_VERSION_NUMBER 116 +#define SSL_R_BAD_PSK 219 +#define SSL_R_BAD_PSK_IDENTITY 114 +#define SSL_R_BAD_RECORD_TYPE 443 +#define SSL_R_BAD_RSA_ENCRYPT 119 +#define SSL_R_BAD_SIGNATURE 123 +#define SSL_R_BAD_SRP_A_LENGTH 347 +#define SSL_R_BAD_SRP_PARAMETERS 371 +#define SSL_R_BAD_SRTP_MKI_VALUE 352 +#define SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST 353 +#define SSL_R_BAD_SSL_FILETYPE 124 +#define SSL_R_BAD_VALUE 384 +#define SSL_R_BAD_WRITE_RETRY 127 +#define SSL_R_BINDER_DOES_NOT_VERIFY 253 +#define SSL_R_BIO_NOT_SET 128 +#define SSL_R_BLOCK_CIPHER_PAD_IS_WRONG 129 +#define SSL_R_BN_LIB 130 +#define SSL_R_CALLBACK_FAILED 234 +#define SSL_R_CANNOT_CHANGE_CIPHER 109 +#define SSL_R_CANNOT_GET_GROUP_NAME 299 +#define SSL_R_CA_DN_LENGTH_MISMATCH 131 +#define SSL_R_CA_KEY_TOO_SMALL 397 +#define SSL_R_CA_MD_TOO_WEAK 398 +#define SSL_R_CCS_RECEIVED_EARLY 133 +#define SSL_R_CERTIFICATE_VERIFY_FAILED 134 +#define SSL_R_CERT_CB_ERROR 377 +#define SSL_R_CERT_LENGTH_MISMATCH 135 +#define SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED 218 +#define SSL_R_CIPHER_CODE_WRONG_LENGTH 137 +#define SSL_R_CLIENTHELLO_TLSEXT 226 +#define SSL_R_COMPRESSED_LENGTH_TOO_LONG 140 +#define SSL_R_COMPRESSION_DISABLED 343 +#define SSL_R_COMPRESSION_FAILURE 141 +#define SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE 307 +#define SSL_R_COMPRESSION_LIBRARY_ERROR 142 +#define SSL_R_CONNECTION_TYPE_NOT_SET 144 +#define SSL_R_CONN_USE_ONLY 356 +#define SSL_R_CONTEXT_NOT_DANE_ENABLED 167 +#define SSL_R_COOKIE_GEN_CALLBACK_FAILURE 400 +#define SSL_R_COOKIE_MISMATCH 308 +#define SSL_R_COPY_PARAMETERS_FAILED 296 +#define SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED 206 +#define SSL_R_DANE_ALREADY_ENABLED 172 +#define SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL 173 +#define SSL_R_DANE_NOT_ENABLED 175 +#define SSL_R_DANE_TLSA_BAD_CERTIFICATE 180 +#define SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE 184 +#define SSL_R_DANE_TLSA_BAD_DATA_LENGTH 189 +#define SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH 192 +#define SSL_R_DANE_TLSA_BAD_MATCHING_TYPE 200 +#define SSL_R_DANE_TLSA_BAD_PUBLIC_KEY 201 +#define SSL_R_DANE_TLSA_BAD_SELECTOR 202 +#define SSL_R_DANE_TLSA_NULL_DATA 203 +#define SSL_R_DATA_BETWEEN_CCS_AND_FINISHED 145 +#define SSL_R_DATA_LENGTH_TOO_LONG 146 +#define SSL_R_DECRYPTION_FAILED 147 +#define SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC 281 +#define SSL_R_DH_KEY_TOO_SMALL 394 +#define SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG 148 +#define SSL_R_DIGEST_CHECK_FAILED 149 +#define SSL_R_DOMAIN_USE_ONLY 422 +#define SSL_R_DTLS_MESSAGE_TOO_BIG 334 +#define SSL_R_DUPLICATE_COMPRESSION_ID 309 +#define SSL_R_ECC_CERT_NOT_FOR_SIGNING 318 +#define SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE 374 +#define SSL_R_EE_KEY_TOO_SMALL 399 +#define SSL_R_EMPTY_RAW_PUBLIC_KEY 349 +#define SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST 354 +#define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 150 +#define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 151 +#define SSL_R_ERROR_IN_SYSTEM_DEFAULT_CONFIG 419 +#define SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN 204 +#define SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE 194 +#define SSL_R_EXCESSIVE_MESSAGE_SIZE 152 +#define SSL_R_EXTENSION_NOT_RECEIVED 279 +#define SSL_R_EXTRA_DATA_IN_MESSAGE 153 +#define SSL_R_EXT_LENGTH_MISMATCH 163 +#define SSL_R_FAILED_TO_GET_PARAMETER 316 +#define SSL_R_FAILED_TO_INIT_ASYNC 405 +#define SSL_R_FEATURE_NEGOTIATION_NOT_COMPLETE 417 +#define SSL_R_FEATURE_NOT_RENEGOTIABLE 413 +#define SSL_R_FRAGMENTED_CLIENT_HELLO 401 +#define SSL_R_GOT_A_FIN_BEFORE_A_CCS 154 +#define SSL_R_HTTPS_PROXY_REQUEST 155 +#define SSL_R_HTTP_REQUEST 156 +#define SSL_R_ILLEGAL_POINT_COMPRESSION 162 +#define SSL_R_ILLEGAL_SUITEB_DIGEST 380 +#define SSL_R_INAPPROPRIATE_FALLBACK 373 +#define SSL_R_INCONSISTENT_COMPRESSION 340 +#define SSL_R_INCONSISTENT_EARLY_DATA_ALPN 222 +#define SSL_R_INCONSISTENT_EARLY_DATA_SNI 231 +#define SSL_R_INCONSISTENT_EXTMS 104 +#define SSL_R_INSUFFICIENT_SECURITY 241 +#define SSL_R_INVALID_ALERT 205 +#define SSL_R_INVALID_CCS_MESSAGE 260 +#define SSL_R_INVALID_CERTIFICATE_OR_ALG 238 +#define SSL_R_INVALID_COMMAND 280 +#define SSL_R_INVALID_COMPRESSION_ALGORITHM 341 +#define SSL_R_INVALID_CONFIG 283 +#define SSL_R_INVALID_CONFIGURATION_NAME 113 +#define SSL_R_INVALID_CONTEXT 282 +#define SSL_R_INVALID_CT_VALIDATION_TYPE 212 +#define SSL_R_INVALID_KEY_UPDATE_TYPE 120 +#define SSL_R_INVALID_MAX_EARLY_DATA 174 +#define SSL_R_INVALID_NULL_CMD_NAME 385 +#define SSL_R_INVALID_RAW_PUBLIC_KEY 350 +#define SSL_R_INVALID_RECORD 317 +#define SSL_R_INVALID_SEQUENCE_NUMBER 402 +#define SSL_R_INVALID_SERVERINFO_DATA 388 +#define SSL_R_INVALID_SESSION_ID 999 +#define SSL_R_INVALID_SRP_USERNAME 357 +#define SSL_R_INVALID_STATUS_RESPONSE 328 +#define SSL_R_INVALID_TICKET_KEYS_LENGTH 325 +#define SSL_R_LEGACY_SIGALG_DISALLOWED_OR_UNSUPPORTED 333 +#define SSL_R_LENGTH_MISMATCH 159 +#define SSL_R_LENGTH_TOO_LONG 404 +#define SSL_R_LENGTH_TOO_SHORT 160 +#define SSL_R_LIBRARY_BUG 274 +#define SSL_R_LIBRARY_HAS_NO_CIPHERS 161 +#define SSL_R_LISTENER_USE_ONLY 421 +#define SSL_R_MAXIMUM_ENCRYPTED_PKTS_REACHED 395 +#define SSL_R_MISSING_DSA_SIGNING_CERT 165 +#define SSL_R_MISSING_ECDSA_SIGNING_CERT 381 +#define SSL_R_MISSING_FATAL 256 +#define SSL_R_MISSING_PARAMETERS 290 +#define SSL_R_MISSING_PSK_KEX_MODES_EXTENSION 310 +#define SSL_R_MISSING_QUIC_TLS_FUNCTIONS 423 +#define SSL_R_MISSING_RSA_CERTIFICATE 168 +#define SSL_R_MISSING_RSA_ENCRYPTING_CERT 169 +#define SSL_R_MISSING_RSA_SIGNING_CERT 170 +#define SSL_R_MISSING_SIGALGS_EXTENSION 112 +#define SSL_R_MISSING_SIGNING_CERT 221 +#define SSL_R_MISSING_SRP_PARAM 358 +#define SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION 209 +#define SSL_R_MISSING_SUPPORTED_VERSIONS_EXTENSION 420 +#define SSL_R_MISSING_TMP_DH_KEY 171 +#define SSL_R_MISSING_TMP_ECDH_KEY 311 +#define SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA 293 +#define SSL_R_NOT_ON_RECORD_BOUNDARY 182 +#define SSL_R_NOT_REPLACING_CERTIFICATE 289 +#define SSL_R_NOT_SERVER 284 +#define SSL_R_NO_APPLICATION_PROTOCOL 235 +#define SSL_R_NO_CERTIFICATES_RETURNED 176 +#define SSL_R_NO_CERTIFICATE_ASSIGNED 177 +#define SSL_R_NO_CERTIFICATE_SET 179 +#define SSL_R_NO_CHANGE_FOLLOWING_HRR 214 +#define SSL_R_NO_CIPHERS_AVAILABLE 181 +#define SSL_R_NO_CIPHERS_SPECIFIED 183 +#define SSL_R_NO_CIPHER_MATCH 185 +#define SSL_R_NO_CLIENT_CERT_METHOD 331 +#define SSL_R_NO_COMPRESSION_SPECIFIED 187 +#define SSL_R_NO_COOKIE_CALLBACK_SET 287 +#define SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER 330 +#define SSL_R_NO_METHOD_SPECIFIED 188 +#define SSL_R_NO_PEM_EXTENSIONS 389 +#define SSL_R_NO_PRIVATE_KEY_ASSIGNED 190 +#define SSL_R_NO_PROTOCOLS_AVAILABLE 191 +#define SSL_R_NO_RENEGOTIATION 339 +#define SSL_R_NO_REQUIRED_DIGEST 324 +#define SSL_R_NO_SHARED_CIPHER 193 +#define SSL_R_NO_SHARED_GROUPS 410 +#define SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS 376 +#define SSL_R_NO_SRTP_PROFILES 359 +#define SSL_R_NO_STREAM 355 +#define SSL_R_NO_SUITABLE_DIGEST_ALGORITHM 297 +#define SSL_R_NO_SUITABLE_GROUPS 295 +#define SSL_R_NO_SUITABLE_KEY_SHARE 101 +#define SSL_R_NO_SUITABLE_RECORD_LAYER 322 +#define SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM 118 +#define SSL_R_NO_VALID_SCTS 216 +#define SSL_R_NO_VERIFY_COOKIE_CALLBACK 403 +#define SSL_R_NULL_SSL_CTX 195 +#define SSL_R_NULL_SSL_METHOD_PASSED 196 +#define SSL_R_OCSP_CALLBACK_FAILURE 305 +#define SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED 197 +#define SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED 344 +#define SSL_R_OVERFLOW_ERROR 237 +#define SSL_R_PACKET_LENGTH_TOO_LONG 198 +#define SSL_R_PARSE_TLSEXT 227 +#define SSL_R_PATH_TOO_LONG 270 +#define SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE 199 +#define SSL_R_PEM_NAME_BAD_PREFIX 391 +#define SSL_R_PEM_NAME_TOO_SHORT 392 +#define SSL_R_PIPELINE_FAILURE 406 +#define SSL_R_POLL_REQUEST_NOT_SUPPORTED 418 +#define SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR 278 +#define SSL_R_PRIVATE_KEY_MISMATCH 288 +#define SSL_R_PROTOCOL_IS_SHUTDOWN 207 +#define SSL_R_PSK_IDENTITY_NOT_FOUND 223 +#define SSL_R_PSK_NO_CLIENT_CB 224 +#define SSL_R_PSK_NO_SERVER_CB 225 +#define SSL_R_QUIC_HANDSHAKE_LAYER_ERROR 393 +#define SSL_R_QUIC_NETWORK_ERROR 387 +#define SSL_R_QUIC_PROTOCOL_ERROR 382 +#define SSL_R_READ_BIO_NOT_SET 211 +#define SSL_R_READ_TIMEOUT_EXPIRED 312 +#define SSL_R_RECORDS_NOT_RELEASED 321 +#define SSL_R_RECORD_LAYER_FAILURE 313 +#define SSL_R_RECORD_LENGTH_MISMATCH 213 +#define SSL_R_RECORD_TOO_SMALL 298 +#define SSL_R_REMOTE_PEER_ADDRESS_NOT_SET 346 +#define SSL_R_RENEGOTIATE_EXT_TOO_LONG 335 +#define SSL_R_RENEGOTIATION_ENCODING_ERR 336 +#define SSL_R_RENEGOTIATION_MISMATCH 337 +#define SSL_R_REQUEST_PENDING 285 +#define SSL_R_REQUEST_SENT 286 +#define SSL_R_REQUIRED_CIPHER_MISSING 215 +#define SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING 342 +#define SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING 345 +#define SSL_R_SCT_VERIFICATION_FAILED 208 +#define SSL_R_SEQUENCE_CTR_WRAPPED 327 +#define SSL_R_SERVERHELLO_TLSEXT 275 +#define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 277 +#define SSL_R_SHUTDOWN_WHILE_IN_INIT 407 +#define SSL_R_SIGNATURE_ALGORITHMS_ERROR 360 +#define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE 220 +#define SSL_R_SRP_A_CALC 361 +#define SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES 362 +#define SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG 363 +#define SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE 364 +#define SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH 232 +#define SSL_R_SSL3_EXT_INVALID_SERVERNAME 319 +#define SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE 320 +#define SSL_R_SSL3_SESSION_ID_TOO_LONG 300 +#define SSL_R_SSLV3_ALERT_BAD_CERTIFICATE 1042 +#define SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020 +#define SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED 1045 +#define SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED 1044 +#define SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN 1046 +#define SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE 1030 +#define SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE 1040 +#define SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER 1047 +#define SSL_R_SSLV3_ALERT_NO_CERTIFICATE 1041 +#define SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010 +#define SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE 1043 +#define SSL_R_SSL_COMMAND_SECTION_EMPTY 117 +#define SSL_R_SSL_COMMAND_SECTION_NOT_FOUND 125 +#define SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION 228 +#define SSL_R_SSL_HANDSHAKE_FAILURE 229 +#define SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS 230 +#define SSL_R_SSL_NEGATIVE_LENGTH 372 +#define SSL_R_SSL_SECTION_EMPTY 126 +#define SSL_R_SSL_SECTION_NOT_FOUND 136 +#define SSL_R_SSL_SESSION_ID_CALLBACK_FAILED 301 +#define SSL_R_SSL_SESSION_ID_CONFLICT 302 +#define SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG 273 +#define SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH 303 +#define SSL_R_SSL_SESSION_ID_TOO_LONG 408 +#define SSL_R_SSL_SESSION_VERSION_MISMATCH 210 +#define SSL_R_STILL_IN_INIT 121 +#define SSL_R_STREAM_COUNT_LIMITED 411 +#define SSL_R_STREAM_FINISHED 365 +#define SSL_R_STREAM_RECV_ONLY 366 +#define SSL_R_STREAM_RESET 375 +#define SSL_R_STREAM_SEND_ONLY 379 +#define SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED 1116 +#define SSL_R_TLSV13_ALERT_MISSING_EXTENSION 1109 +#define SSL_R_TLSV1_ALERT_ACCESS_DENIED 1049 +#define SSL_R_TLSV1_ALERT_DECODE_ERROR 1050 +#define SSL_R_TLSV1_ALERT_DECRYPTION_FAILED 1021 +#define SSL_R_TLSV1_ALERT_DECRYPT_ERROR 1051 +#define SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION 1060 +#define SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK 1086 +#define SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY 1071 +#define SSL_R_TLSV1_ALERT_INTERNAL_ERROR 1080 +#define SSL_R_TLSV1_ALERT_NO_APPLICATION_PROTOCOL 1120 +#define SSL_R_TLSV1_ALERT_NO_RENEGOTIATION 1100 +#define SSL_R_TLSV1_ALERT_PROTOCOL_VERSION 1070 +#define SSL_R_TLSV1_ALERT_RECORD_OVERFLOW 1022 +#define SSL_R_TLSV1_ALERT_UNKNOWN_CA 1048 +#define SSL_R_TLSV1_ALERT_UNKNOWN_PSK_IDENTITY 1115 +#define SSL_R_TLSV1_ALERT_USER_CANCELLED 1090 +#define SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE 1114 +#define SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE 1113 +#define SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE 1111 +#define SSL_R_TLSV1_UNRECOGNIZED_NAME 1112 +#define SSL_R_TLSV1_UNSUPPORTED_EXTENSION 1110 +#define SSL_R_TLS_ILLEGAL_EXPORTER_LABEL 367 +#define SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST 157 +#define SSL_R_TOO_MANY_KEY_UPDATES 132 +#define SSL_R_TOO_MANY_WARN_ALERTS 409 +#define SSL_R_TOO_MUCH_EARLY_DATA 164 +#define SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS 314 +#define SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS 239 +#define SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES 242 +#define SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES 243 +#define SSL_R_UNEXPECTED_CCS_MESSAGE 262 +#define SSL_R_UNEXPECTED_END_OF_EARLY_DATA 178 +#define SSL_R_UNEXPECTED_EOF_WHILE_READING 294 +#define SSL_R_UNEXPECTED_MESSAGE 244 +#define SSL_R_UNEXPECTED_RECORD 245 +#define SSL_R_UNINITIALIZED 276 +#define SSL_R_UNKNOWN_ALERT_TYPE 246 +#define SSL_R_UNKNOWN_CERTIFICATE_TYPE 247 +#define SSL_R_UNKNOWN_CIPHER_RETURNED 248 +#define SSL_R_UNKNOWN_CIPHER_TYPE 249 +#define SSL_R_UNKNOWN_CMD_NAME 386 +#define SSL_R_UNKNOWN_COMMAND 139 +#define SSL_R_UNKNOWN_DIGEST 368 +#define SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE 250 +#define SSL_R_UNKNOWN_MANDATORY_PARAMETER 323 +#define SSL_R_UNKNOWN_PKEY_TYPE 251 +#define SSL_R_UNKNOWN_PROTOCOL 252 +#define SSL_R_UNKNOWN_SSL_VERSION 254 +#define SSL_R_UNKNOWN_STATE 255 +#define SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED 338 +#define SSL_R_UNSOLICITED_EXTENSION 217 +#define SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM 257 +#define SSL_R_UNSUPPORTED_CONFIG_VALUE 414 +#define SSL_R_UNSUPPORTED_CONFIG_VALUE_CLASS 415 +#define SSL_R_UNSUPPORTED_CONFIG_VALUE_OP 416 +#define SSL_R_UNSUPPORTED_ELLIPTIC_CURVE 315 +#define SSL_R_UNSUPPORTED_PROTOCOL 258 +#define SSL_R_UNSUPPORTED_SSL_VERSION 259 +#define SSL_R_UNSUPPORTED_STATUS_TYPE 329 +#define SSL_R_UNSUPPORTED_WRITE_FLAG 412 +#define SSL_R_USE_SRTP_NOT_NEGOTIATED 369 +#define SSL_R_VERSION_TOO_HIGH 166 +#define SSL_R_VERSION_TOO_LOW 396 +#define SSL_R_WRONG_CERTIFICATE_TYPE 383 +#define SSL_R_WRONG_CIPHER_RETURNED 261 +#define SSL_R_WRONG_CURVE 378 +#define SSL_R_WRONG_RPK_TYPE 351 +#define SSL_R_WRONG_SIGNATURE_LENGTH 264 +#define SSL_R_WRONG_SIGNATURE_SIZE 265 +#define SSL_R_WRONG_SIGNATURE_TYPE 370 +#define SSL_R_WRONG_SSL_VERSION 266 +#define SSL_R_WRONG_VERSION_NUMBER 267 +#define SSL_R_X509_LIB 268 +#define SSL_R_X509_VERIFICATION_SETUP_PROBLEMS 269 + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/sslerr_legacy.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/sslerr_legacy.h new file mode 100644 index 0000000000000000000000000000000000000000..8cf1ebd7b026ffd651021f51bf4de6e7213b198d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/sslerr_legacy.h @@ -0,0 +1,467 @@ +/* + * Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* + * This header file preserves symbols from pre-3.0 OpenSSL. + * It should never be included directly, as it's already included + * by the public sslerr.h headers, and since it will go away some + * time in the future. + */ + +#ifndef OPENSSL_SSLERR_LEGACY_H +#define OPENSSL_SSLERR_LEGACY_H +#pragma once + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int ERR_load_SSL_strings(void); + +/* Collected _F_ macros from OpenSSL 1.1.1 */ + +/* + * SSL function codes. + */ +#define SSL_F_ADD_CLIENT_KEY_SHARE_EXT 0 +#define SSL_F_ADD_KEY_SHARE 0 +#define SSL_F_BYTES_TO_CIPHER_LIST 0 +#define SSL_F_CHECK_SUITEB_CIPHER_LIST 0 +#define SSL_F_CIPHERSUITE_CB 0 +#define SSL_F_CONSTRUCT_CA_NAMES 0 +#define SSL_F_CONSTRUCT_KEY_EXCHANGE_TBS 0 +#define SSL_F_CONSTRUCT_STATEFUL_TICKET 0 +#define SSL_F_CONSTRUCT_STATELESS_TICKET 0 +#define SSL_F_CREATE_SYNTHETIC_MESSAGE_HASH 0 +#define SSL_F_CREATE_TICKET_PREQUEL 0 +#define SSL_F_CT_MOVE_SCTS 0 +#define SSL_F_CT_STRICT 0 +#define SSL_F_CUSTOM_EXT_ADD 0 +#define SSL_F_CUSTOM_EXT_PARSE 0 +#define SSL_F_D2I_SSL_SESSION 0 +#define SSL_F_DANE_CTX_ENABLE 0 +#define SSL_F_DANE_MTYPE_SET 0 +#define SSL_F_DANE_TLSA_ADD 0 +#define SSL_F_DERIVE_SECRET_KEY_AND_IV 0 +#define SSL_F_DO_DTLS1_WRITE 0 +#define SSL_F_DO_SSL3_WRITE 0 +#define SSL_F_DTLS1_BUFFER_RECORD 0 +#define SSL_F_DTLS1_CHECK_TIMEOUT_NUM 0 +#define SSL_F_DTLS1_HEARTBEAT 0 +#define SSL_F_DTLS1_HM_FRAGMENT_NEW 0 +#define SSL_F_DTLS1_PREPROCESS_FRAGMENT 0 +#define SSL_F_DTLS1_PROCESS_BUFFERED_RECORDS 0 +#define SSL_F_DTLS1_PROCESS_RECORD 0 +#define SSL_F_DTLS1_READ_BYTES 0 +#define SSL_F_DTLS1_READ_FAILED 0 +#define SSL_F_DTLS1_RETRANSMIT_MESSAGE 0 +#define SSL_F_DTLS1_WRITE_APP_DATA_BYTES 0 +#define SSL_F_DTLS1_WRITE_BYTES 0 +#define SSL_F_DTLSV1_LISTEN 0 +#define SSL_F_DTLS_CONSTRUCT_CHANGE_CIPHER_SPEC 0 +#define SSL_F_DTLS_CONSTRUCT_HELLO_VERIFY_REQUEST 0 +#define SSL_F_DTLS_GET_REASSEMBLED_MESSAGE 0 +#define SSL_F_DTLS_PROCESS_HELLO_VERIFY 0 +#define SSL_F_DTLS_RECORD_LAYER_NEW 0 +#define SSL_F_DTLS_WAIT_FOR_DRY 0 +#define SSL_F_EARLY_DATA_COUNT_OK 0 +#define SSL_F_FINAL_EARLY_DATA 0 +#define SSL_F_FINAL_EC_PT_FORMATS 0 +#define SSL_F_FINAL_EMS 0 +#define SSL_F_FINAL_KEY_SHARE 0 +#define SSL_F_FINAL_MAXFRAGMENTLEN 0 +#define SSL_F_FINAL_RENEGOTIATE 0 +#define SSL_F_FINAL_SERVER_NAME 0 +#define SSL_F_FINAL_SIG_ALGS 0 +#define SSL_F_GET_CERT_VERIFY_TBS_DATA 0 +#define SSL_F_NSS_KEYLOG_INT 0 +#define SSL_F_OPENSSL_INIT_SSL 0 +#define SSL_F_OSSL_STATEM_CLIENT13_READ_TRANSITION 0 +#define SSL_F_OSSL_STATEM_CLIENT13_WRITE_TRANSITION 0 +#define SSL_F_OSSL_STATEM_CLIENT_CONSTRUCT_MESSAGE 0 +#define SSL_F_OSSL_STATEM_CLIENT_POST_PROCESS_MESSAGE 0 +#define SSL_F_OSSL_STATEM_CLIENT_PROCESS_MESSAGE 0 +#define SSL_F_OSSL_STATEM_CLIENT_READ_TRANSITION 0 +#define SSL_F_OSSL_STATEM_CLIENT_WRITE_TRANSITION 0 +#define SSL_F_OSSL_STATEM_SERVER13_READ_TRANSITION 0 +#define SSL_F_OSSL_STATEM_SERVER13_WRITE_TRANSITION 0 +#define SSL_F_OSSL_STATEM_SERVER_CONSTRUCT_MESSAGE 0 +#define SSL_F_OSSL_STATEM_SERVER_POST_PROCESS_MESSAGE 0 +#define SSL_F_OSSL_STATEM_SERVER_POST_WORK 0 +#define SSL_F_OSSL_STATEM_SERVER_PRE_WORK 0 +#define SSL_F_OSSL_STATEM_SERVER_PROCESS_MESSAGE 0 +#define SSL_F_OSSL_STATEM_SERVER_READ_TRANSITION 0 +#define SSL_F_OSSL_STATEM_SERVER_WRITE_TRANSITION 0 +#define SSL_F_PARSE_CA_NAMES 0 +#define SSL_F_PITEM_NEW 0 +#define SSL_F_PQUEUE_NEW 0 +#define SSL_F_PROCESS_KEY_SHARE_EXT 0 +#define SSL_F_READ_STATE_MACHINE 0 +#define SSL_F_SET_CLIENT_CIPHERSUITE 0 +#define SSL_F_SRP_GENERATE_CLIENT_MASTER_SECRET 0 +#define SSL_F_SRP_GENERATE_SERVER_MASTER_SECRET 0 +#define SSL_F_SRP_VERIFY_SERVER_PARAM 0 +#define SSL_F_SSL3_CHANGE_CIPHER_STATE 0 +#define SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM 0 +#define SSL_F_SSL3_CTRL 0 +#define SSL_F_SSL3_CTX_CTRL 0 +#define SSL_F_SSL3_DIGEST_CACHED_RECORDS 0 +#define SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC 0 +#define SSL_F_SSL3_ENC 0 +#define SSL_F_SSL3_FINAL_FINISH_MAC 0 +#define SSL_F_SSL3_FINISH_MAC 0 +#define SSL_F_SSL3_GENERATE_KEY_BLOCK 0 +#define SSL_F_SSL3_GENERATE_MASTER_SECRET 0 +#define SSL_F_SSL3_GET_RECORD 0 +#define SSL_F_SSL3_INIT_FINISHED_MAC 0 +#define SSL_F_SSL3_OUTPUT_CERT_CHAIN 0 +#define SSL_F_SSL3_READ_BYTES 0 +#define SSL_F_SSL3_READ_N 0 +#define SSL_F_SSL3_SETUP_KEY_BLOCK 0 +#define SSL_F_SSL3_SETUP_READ_BUFFER 0 +#define SSL_F_SSL3_SETUP_WRITE_BUFFER 0 +#define SSL_F_SSL3_WRITE_BYTES 0 +#define SSL_F_SSL3_WRITE_PENDING 0 +#define SSL_F_SSL_ADD_CERT_CHAIN 0 +#define SSL_F_SSL_ADD_CERT_TO_BUF 0 +#define SSL_F_SSL_ADD_CERT_TO_WPACKET 0 +#define SSL_F_SSL_ADD_CLIENTHELLO_RENEGOTIATE_EXT 0 +#define SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT 0 +#define SSL_F_SSL_ADD_CLIENTHELLO_USE_SRTP_EXT 0 +#define SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK 0 +#define SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK 0 +#define SSL_F_SSL_ADD_SERVERHELLO_RENEGOTIATE_EXT 0 +#define SSL_F_SSL_ADD_SERVERHELLO_TLSEXT 0 +#define SSL_F_SSL_ADD_SERVERHELLO_USE_SRTP_EXT 0 +#define SSL_F_SSL_BUILD_CERT_CHAIN 0 +#define SSL_F_SSL_BYTES_TO_CIPHER_LIST 0 +#define SSL_F_SSL_CACHE_CIPHERLIST 0 +#define SSL_F_SSL_CERT_ADD0_CHAIN_CERT 0 +#define SSL_F_SSL_CERT_DUP 0 +#define SSL_F_SSL_CERT_NEW 0 +#define SSL_F_SSL_CERT_SET0_CHAIN 0 +#define SSL_F_SSL_CHECK_PRIVATE_KEY 0 +#define SSL_F_SSL_CHECK_SERVERHELLO_TLSEXT 0 +#define SSL_F_SSL_CHECK_SRP_EXT_CLIENTHELLO 0 +#define SSL_F_SSL_CHECK_SRVR_ECC_CERT_AND_ALG 0 +#define SSL_F_SSL_CHOOSE_CLIENT_VERSION 0 +#define SSL_F_SSL_CIPHER_DESCRIPTION 0 +#define SSL_F_SSL_CIPHER_LIST_TO_BYTES 0 +#define SSL_F_SSL_CIPHER_PROCESS_RULESTR 0 +#define SSL_F_SSL_CIPHER_STRENGTH_SORT 0 +#define SSL_F_SSL_CLEAR 0 +#define SSL_F_SSL_CLIENT_HELLO_GET1_EXTENSIONS_PRESENT 0 +#define SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD 0 +#define SSL_F_SSL_CONF_CMD 0 +#define SSL_F_SSL_CREATE_CIPHER_LIST 0 +#define SSL_F_SSL_CTRL 0 +#define SSL_F_SSL_CTX_CHECK_PRIVATE_KEY 0 +#define SSL_F_SSL_CTX_ENABLE_CT 0 +#define SSL_F_SSL_CTX_MAKE_PROFILES 0 +#define SSL_F_SSL_CTX_NEW 0 +#define SSL_F_SSL_CTX_SET_ALPN_PROTOS 0 +#define SSL_F_SSL_CTX_SET_CIPHER_LIST 0 +#define SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE 0 +#define SSL_F_SSL_CTX_SET_CT_VALIDATION_CALLBACK 0 +#define SSL_F_SSL_CTX_SET_SESSION_ID_CONTEXT 0 +#define SSL_F_SSL_CTX_SET_SSL_VERSION 0 +#define SSL_F_SSL_CTX_SET_TLSEXT_MAX_FRAGMENT_LENGTH 0 +#define SSL_F_SSL_CTX_USE_CERTIFICATE 0 +#define SSL_F_SSL_CTX_USE_CERTIFICATE_ASN1 0 +#define SSL_F_SSL_CTX_USE_CERTIFICATE_FILE 0 +#define SSL_F_SSL_CTX_USE_PRIVATEKEY 0 +#define SSL_F_SSL_CTX_USE_PRIVATEKEY_ASN1 0 +#define SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE 0 +#define SSL_F_SSL_CTX_USE_PSK_IDENTITY_HINT 0 +#define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY 0 +#define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_ASN1 0 +#define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_FILE 0 +#define SSL_F_SSL_CTX_USE_SERVERINFO 0 +#define SSL_F_SSL_CTX_USE_SERVERINFO_EX 0 +#define SSL_F_SSL_CTX_USE_SERVERINFO_FILE 0 +#define SSL_F_SSL_DANE_DUP 0 +#define SSL_F_SSL_DANE_ENABLE 0 +#define SSL_F_SSL_DERIVE 0 +#define SSL_F_SSL_DO_CONFIG 0 +#define SSL_F_SSL_DO_HANDSHAKE 0 +#define SSL_F_SSL_DUP_CA_LIST 0 +#define SSL_F_SSL_ENABLE_CT 0 +#define SSL_F_SSL_GENERATE_PKEY_GROUP 0 +#define SSL_F_SSL_GENERATE_SESSION_ID 0 +#define SSL_F_SSL_GET_NEW_SESSION 0 +#define SSL_F_SSL_GET_PREV_SESSION 0 +#define SSL_F_SSL_GET_SERVER_CERT_INDEX 0 +#define SSL_F_SSL_GET_SIGN_PKEY 0 +#define SSL_F_SSL_HANDSHAKE_HASH 0 +#define SSL_F_SSL_INIT_WBIO_BUFFER 0 +#define SSL_F_SSL_KEY_UPDATE 0 +#define SSL_F_SSL_LOAD_CLIENT_CA_FILE 0 +#define SSL_F_SSL_LOG_MASTER_SECRET 0 +#define SSL_F_SSL_LOG_RSA_CLIENT_KEY_EXCHANGE 0 +#define SSL_F_SSL_MODULE_INIT 0 +#define SSL_F_SSL_NEW 0 +#define SSL_F_SSL_NEXT_PROTO_VALIDATE 0 +#define SSL_F_SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT 0 +#define SSL_F_SSL_PARSE_CLIENTHELLO_TLSEXT 0 +#define SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT 0 +#define SSL_F_SSL_PARSE_SERVERHELLO_RENEGOTIATE_EXT 0 +#define SSL_F_SSL_PARSE_SERVERHELLO_TLSEXT 0 +#define SSL_F_SSL_PARSE_SERVERHELLO_USE_SRTP_EXT 0 +#define SSL_F_SSL_PEEK 0 +#define SSL_F_SSL_PEEK_EX 0 +#define SSL_F_SSL_PEEK_INTERNAL 0 +#define SSL_F_SSL_READ 0 +#define SSL_F_SSL_READ_EARLY_DATA 0 +#define SSL_F_SSL_READ_EX 0 +#define SSL_F_SSL_READ_INTERNAL 0 +#define SSL_F_SSL_RENEGOTIATE 0 +#define SSL_F_SSL_RENEGOTIATE_ABBREVIATED 0 +#define SSL_F_SSL_SCAN_CLIENTHELLO_TLSEXT 0 +#define SSL_F_SSL_SCAN_SERVERHELLO_TLSEXT 0 +#define SSL_F_SSL_SESSION_DUP 0 +#define SSL_F_SSL_SESSION_NEW 0 +#define SSL_F_SSL_SESSION_PRINT_FP 0 +#define SSL_F_SSL_SESSION_SET1_ID 0 +#define SSL_F_SSL_SESSION_SET1_ID_CONTEXT 0 +#define SSL_F_SSL_SET_ALPN_PROTOS 0 +#define SSL_F_SSL_SET_CERT 0 +#define SSL_F_SSL_SET_CERT_AND_KEY 0 +#define SSL_F_SSL_SET_CIPHER_LIST 0 +#define SSL_F_SSL_SET_CT_VALIDATION_CALLBACK 0 +#define SSL_F_SSL_SET_FD 0 +#define SSL_F_SSL_SET_PKEY 0 +#define SSL_F_SSL_SET_RFD 0 +#define SSL_F_SSL_SET_SESSION 0 +#define SSL_F_SSL_SET_SESSION_ID_CONTEXT 0 +#define SSL_F_SSL_SET_SESSION_TICKET_EXT 0 +#define SSL_F_SSL_SET_TLSEXT_MAX_FRAGMENT_LENGTH 0 +#define SSL_F_SSL_SET_WFD 0 +#define SSL_F_SSL_SHUTDOWN 0 +#define SSL_F_SSL_SRP_CTX_INIT 0 +#define SSL_F_SSL_START_ASYNC_JOB 0 +#define SSL_F_SSL_UNDEFINED_FUNCTION 0 +#define SSL_F_SSL_UNDEFINED_VOID_FUNCTION 0 +#define SSL_F_SSL_USE_CERTIFICATE 0 +#define SSL_F_SSL_USE_CERTIFICATE_ASN1 0 +#define SSL_F_SSL_USE_CERTIFICATE_FILE 0 +#define SSL_F_SSL_USE_PRIVATEKEY 0 +#define SSL_F_SSL_USE_PRIVATEKEY_ASN1 0 +#define SSL_F_SSL_USE_PRIVATEKEY_FILE 0 +#define SSL_F_SSL_USE_PSK_IDENTITY_HINT 0 +#define SSL_F_SSL_USE_RSAPRIVATEKEY 0 +#define SSL_F_SSL_USE_RSAPRIVATEKEY_ASN1 0 +#define SSL_F_SSL_USE_RSAPRIVATEKEY_FILE 0 +#define SSL_F_SSL_VALIDATE_CT 0 +#define SSL_F_SSL_VERIFY_CERT_CHAIN 0 +#define SSL_F_SSL_VERIFY_CLIENT_POST_HANDSHAKE 0 +#define SSL_F_SSL_WRITE 0 +#define SSL_F_SSL_WRITE_EARLY_DATA 0 +#define SSL_F_SSL_WRITE_EARLY_FINISH 0 +#define SSL_F_SSL_WRITE_EX 0 +#define SSL_F_SSL_WRITE_INTERNAL 0 +#define SSL_F_STATE_MACHINE 0 +#define SSL_F_TLS12_CHECK_PEER_SIGALG 0 +#define SSL_F_TLS12_COPY_SIGALGS 0 +#define SSL_F_TLS13_CHANGE_CIPHER_STATE 0 +#define SSL_F_TLS13_ENC 0 +#define SSL_F_TLS13_FINAL_FINISH_MAC 0 +#define SSL_F_TLS13_GENERATE_SECRET 0 +#define SSL_F_TLS13_HKDF_EXPAND 0 +#define SSL_F_TLS13_RESTORE_HANDSHAKE_DIGEST_FOR_PHA 0 +#define SSL_F_TLS13_SAVE_HANDSHAKE_DIGEST_FOR_PHA 0 +#define SSL_F_TLS13_SETUP_KEY_BLOCK 0 +#define SSL_F_TLS1_CHANGE_CIPHER_STATE 0 +#define SSL_F_TLS1_CHECK_DUPLICATE_EXTENSIONS 0 +#define SSL_F_TLS1_ENC 0 +#define SSL_F_TLS1_EXPORT_KEYING_MATERIAL 0 +#define SSL_F_TLS1_GET_CURVELIST 0 +#define SSL_F_TLS1_PRF 0 +#define SSL_F_TLS1_SAVE_U16 0 +#define SSL_F_TLS1_SETUP_KEY_BLOCK 0 +#define SSL_F_TLS1_SET_GROUPS 0 +#define SSL_F_TLS1_SET_RAW_SIGALGS 0 +#define SSL_F_TLS1_SET_SERVER_SIGALGS 0 +#define SSL_F_TLS1_SET_SHARED_SIGALGS 0 +#define SSL_F_TLS1_SET_SIGALGS 0 +#define SSL_F_TLS_CHOOSE_SIGALG 0 +#define SSL_F_TLS_CLIENT_KEY_EXCHANGE_POST_WORK 0 +#define SSL_F_TLS_COLLECT_EXTENSIONS 0 +#define SSL_F_TLS_CONSTRUCT_CERTIFICATE_AUTHORITIES 0 +#define SSL_F_TLS_CONSTRUCT_CERTIFICATE_REQUEST 0 +#define SSL_F_TLS_CONSTRUCT_CERT_STATUS 0 +#define SSL_F_TLS_CONSTRUCT_CERT_STATUS_BODY 0 +#define SSL_F_TLS_CONSTRUCT_CERT_VERIFY 0 +#define SSL_F_TLS_CONSTRUCT_CHANGE_CIPHER_SPEC 0 +#define SSL_F_TLS_CONSTRUCT_CKE_DHE 0 +#define SSL_F_TLS_CONSTRUCT_CKE_ECDHE 0 +#define SSL_F_TLS_CONSTRUCT_CKE_GOST 0 +#define SSL_F_TLS_CONSTRUCT_CKE_PSK_PREAMBLE 0 +#define SSL_F_TLS_CONSTRUCT_CKE_RSA 0 +#define SSL_F_TLS_CONSTRUCT_CKE_SRP 0 +#define SSL_F_TLS_CONSTRUCT_CLIENT_CERTIFICATE 0 +#define SSL_F_TLS_CONSTRUCT_CLIENT_HELLO 0 +#define SSL_F_TLS_CONSTRUCT_CLIENT_KEY_EXCHANGE 0 +#define SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY 0 +#define SSL_F_TLS_CONSTRUCT_CTOS_ALPN 0 +#define SSL_F_TLS_CONSTRUCT_CTOS_CERTIFICATE 0 +#define SSL_F_TLS_CONSTRUCT_CTOS_COOKIE 0 +#define SSL_F_TLS_CONSTRUCT_CTOS_EARLY_DATA 0 +#define SSL_F_TLS_CONSTRUCT_CTOS_EC_PT_FORMATS 0 +#define SSL_F_TLS_CONSTRUCT_CTOS_EMS 0 +#define SSL_F_TLS_CONSTRUCT_CTOS_ETM 0 +#define SSL_F_TLS_CONSTRUCT_CTOS_HELLO 0 +#define SSL_F_TLS_CONSTRUCT_CTOS_KEY_EXCHANGE 0 +#define SSL_F_TLS_CONSTRUCT_CTOS_KEY_SHARE 0 +#define SSL_F_TLS_CONSTRUCT_CTOS_MAXFRAGMENTLEN 0 +#define SSL_F_TLS_CONSTRUCT_CTOS_NPN 0 +#define SSL_F_TLS_CONSTRUCT_CTOS_PADDING 0 +#define SSL_F_TLS_CONSTRUCT_CTOS_POST_HANDSHAKE_AUTH 0 +#define SSL_F_TLS_CONSTRUCT_CTOS_PSK 0 +#define SSL_F_TLS_CONSTRUCT_CTOS_PSK_KEX_MODES 0 +#define SSL_F_TLS_CONSTRUCT_CTOS_RENEGOTIATE 0 +#define SSL_F_TLS_CONSTRUCT_CTOS_SCT 0 +#define SSL_F_TLS_CONSTRUCT_CTOS_SERVER_NAME 0 +#define SSL_F_TLS_CONSTRUCT_CTOS_SESSION_TICKET 0 +#define SSL_F_TLS_CONSTRUCT_CTOS_SIG_ALGS 0 +#define SSL_F_TLS_CONSTRUCT_CTOS_SRP 0 +#define SSL_F_TLS_CONSTRUCT_CTOS_STATUS_REQUEST 0 +#define SSL_F_TLS_CONSTRUCT_CTOS_SUPPORTED_GROUPS 0 +#define SSL_F_TLS_CONSTRUCT_CTOS_SUPPORTED_VERSIONS 0 +#define SSL_F_TLS_CONSTRUCT_CTOS_USE_SRTP 0 +#define SSL_F_TLS_CONSTRUCT_CTOS_VERIFY 0 +#define SSL_F_TLS_CONSTRUCT_ENCRYPTED_EXTENSIONS 0 +#define SSL_F_TLS_CONSTRUCT_END_OF_EARLY_DATA 0 +#define SSL_F_TLS_CONSTRUCT_EXTENSIONS 0 +#define SSL_F_TLS_CONSTRUCT_FINISHED 0 +#define SSL_F_TLS_CONSTRUCT_HELLO_REQUEST 0 +#define SSL_F_TLS_CONSTRUCT_HELLO_RETRY_REQUEST 0 +#define SSL_F_TLS_CONSTRUCT_KEY_UPDATE 0 +#define SSL_F_TLS_CONSTRUCT_NEW_SESSION_TICKET 0 +#define SSL_F_TLS_CONSTRUCT_NEXT_PROTO 0 +#define SSL_F_TLS_CONSTRUCT_SERVER_CERTIFICATE 0 +#define SSL_F_TLS_CONSTRUCT_SERVER_HELLO 0 +#define SSL_F_TLS_CONSTRUCT_SERVER_KEY_EXCHANGE 0 +#define SSL_F_TLS_CONSTRUCT_STOC_ALPN 0 +#define SSL_F_TLS_CONSTRUCT_STOC_CERTIFICATE 0 +#define SSL_F_TLS_CONSTRUCT_STOC_COOKIE 0 +#define SSL_F_TLS_CONSTRUCT_STOC_CRYPTOPRO_BUG 0 +#define SSL_F_TLS_CONSTRUCT_STOC_DONE 0 +#define SSL_F_TLS_CONSTRUCT_STOC_EARLY_DATA 0 +#define SSL_F_TLS_CONSTRUCT_STOC_EARLY_DATA_INFO 0 +#define SSL_F_TLS_CONSTRUCT_STOC_EC_PT_FORMATS 0 +#define SSL_F_TLS_CONSTRUCT_STOC_EMS 0 +#define SSL_F_TLS_CONSTRUCT_STOC_ETM 0 +#define SSL_F_TLS_CONSTRUCT_STOC_HELLO 0 +#define SSL_F_TLS_CONSTRUCT_STOC_KEY_EXCHANGE 0 +#define SSL_F_TLS_CONSTRUCT_STOC_KEY_SHARE 0 +#define SSL_F_TLS_CONSTRUCT_STOC_MAXFRAGMENTLEN 0 +#define SSL_F_TLS_CONSTRUCT_STOC_NEXT_PROTO_NEG 0 +#define SSL_F_TLS_CONSTRUCT_STOC_PSK 0 +#define SSL_F_TLS_CONSTRUCT_STOC_RENEGOTIATE 0 +#define SSL_F_TLS_CONSTRUCT_STOC_SERVER_NAME 0 +#define SSL_F_TLS_CONSTRUCT_STOC_SESSION_TICKET 0 +#define SSL_F_TLS_CONSTRUCT_STOC_STATUS_REQUEST 0 +#define SSL_F_TLS_CONSTRUCT_STOC_SUPPORTED_GROUPS 0 +#define SSL_F_TLS_CONSTRUCT_STOC_SUPPORTED_VERSIONS 0 +#define SSL_F_TLS_CONSTRUCT_STOC_USE_SRTP 0 +#define SSL_F_TLS_EARLY_POST_PROCESS_CLIENT_HELLO 0 +#define SSL_F_TLS_FINISH_HANDSHAKE 0 +#define SSL_F_TLS_GET_MESSAGE_BODY 0 +#define SSL_F_TLS_GET_MESSAGE_HEADER 0 +#define SSL_F_TLS_HANDLE_ALPN 0 +#define SSL_F_TLS_HANDLE_STATUS_REQUEST 0 +#define SSL_F_TLS_PARSE_CERTIFICATE_AUTHORITIES 0 +#define SSL_F_TLS_PARSE_CLIENTHELLO_TLSEXT 0 +#define SSL_F_TLS_PARSE_CTOS_ALPN 0 +#define SSL_F_TLS_PARSE_CTOS_COOKIE 0 +#define SSL_F_TLS_PARSE_CTOS_EARLY_DATA 0 +#define SSL_F_TLS_PARSE_CTOS_EC_PT_FORMATS 0 +#define SSL_F_TLS_PARSE_CTOS_EMS 0 +#define SSL_F_TLS_PARSE_CTOS_KEY_SHARE 0 +#define SSL_F_TLS_PARSE_CTOS_MAXFRAGMENTLEN 0 +#define SSL_F_TLS_PARSE_CTOS_POST_HANDSHAKE_AUTH 0 +#define SSL_F_TLS_PARSE_CTOS_PSK 0 +#define SSL_F_TLS_PARSE_CTOS_PSK_KEX_MODES 0 +#define SSL_F_TLS_PARSE_CTOS_RENEGOTIATE 0 +#define SSL_F_TLS_PARSE_CTOS_SERVER_NAME 0 +#define SSL_F_TLS_PARSE_CTOS_SESSION_TICKET 0 +#define SSL_F_TLS_PARSE_CTOS_SIG_ALGS 0 +#define SSL_F_TLS_PARSE_CTOS_SIG_ALGS_CERT 0 +#define SSL_F_TLS_PARSE_CTOS_SRP 0 +#define SSL_F_TLS_PARSE_CTOS_STATUS_REQUEST 0 +#define SSL_F_TLS_PARSE_CTOS_SUPPORTED_GROUPS 0 +#define SSL_F_TLS_PARSE_CTOS_USE_SRTP 0 +#define SSL_F_TLS_PARSE_STOC_ALPN 0 +#define SSL_F_TLS_PARSE_STOC_COOKIE 0 +#define SSL_F_TLS_PARSE_STOC_EARLY_DATA 0 +#define SSL_F_TLS_PARSE_STOC_EARLY_DATA_INFO 0 +#define SSL_F_TLS_PARSE_STOC_EC_PT_FORMATS 0 +#define SSL_F_TLS_PARSE_STOC_KEY_SHARE 0 +#define SSL_F_TLS_PARSE_STOC_MAXFRAGMENTLEN 0 +#define SSL_F_TLS_PARSE_STOC_NPN 0 +#define SSL_F_TLS_PARSE_STOC_PSK 0 +#define SSL_F_TLS_PARSE_STOC_RENEGOTIATE 0 +#define SSL_F_TLS_PARSE_STOC_SCT 0 +#define SSL_F_TLS_PARSE_STOC_SERVER_NAME 0 +#define SSL_F_TLS_PARSE_STOC_SESSION_TICKET 0 +#define SSL_F_TLS_PARSE_STOC_STATUS_REQUEST 0 +#define SSL_F_TLS_PARSE_STOC_SUPPORTED_VERSIONS 0 +#define SSL_F_TLS_PARSE_STOC_USE_SRTP 0 +#define SSL_F_TLS_POST_PROCESS_CLIENT_HELLO 0 +#define SSL_F_TLS_POST_PROCESS_CLIENT_KEY_EXCHANGE 0 +#define SSL_F_TLS_PREPARE_CLIENT_CERTIFICATE 0 +#define SSL_F_TLS_PROCESS_AS_HELLO_RETRY_REQUEST 0 +#define SSL_F_TLS_PROCESS_CERTIFICATE_REQUEST 0 +#define SSL_F_TLS_PROCESS_CERT_STATUS 0 +#define SSL_F_TLS_PROCESS_CERT_STATUS_BODY 0 +#define SSL_F_TLS_PROCESS_CERT_VERIFY 0 +#define SSL_F_TLS_PROCESS_CHANGE_CIPHER_SPEC 0 +#define SSL_F_TLS_PROCESS_CKE_DHE 0 +#define SSL_F_TLS_PROCESS_CKE_ECDHE 0 +#define SSL_F_TLS_PROCESS_CKE_GOST 0 +#define SSL_F_TLS_PROCESS_CKE_PSK_PREAMBLE 0 +#define SSL_F_TLS_PROCESS_CKE_RSA 0 +#define SSL_F_TLS_PROCESS_CKE_SRP 0 +#define SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE 0 +#define SSL_F_TLS_PROCESS_CLIENT_HELLO 0 +#define SSL_F_TLS_PROCESS_CLIENT_KEY_EXCHANGE 0 +#define SSL_F_TLS_PROCESS_ENCRYPTED_EXTENSIONS 0 +#define SSL_F_TLS_PROCESS_END_OF_EARLY_DATA 0 +#define SSL_F_TLS_PROCESS_FINISHED 0 +#define SSL_F_TLS_PROCESS_HELLO_REQ 0 +#define SSL_F_TLS_PROCESS_HELLO_RETRY_REQUEST 0 +#define SSL_F_TLS_PROCESS_INITIAL_SERVER_FLIGHT 0 +#define SSL_F_TLS_PROCESS_KEY_EXCHANGE 0 +#define SSL_F_TLS_PROCESS_KEY_UPDATE 0 +#define SSL_F_TLS_PROCESS_NEW_SESSION_TICKET 0 +#define SSL_F_TLS_PROCESS_NEXT_PROTO 0 +#define SSL_F_TLS_PROCESS_SERVER_CERTIFICATE 0 +#define SSL_F_TLS_PROCESS_SERVER_DONE 0 +#define SSL_F_TLS_PROCESS_SERVER_HELLO 0 +#define SSL_F_TLS_PROCESS_SKE_DHE 0 +#define SSL_F_TLS_PROCESS_SKE_ECDHE 0 +#define SSL_F_TLS_PROCESS_SKE_PSK_PREAMBLE 0 +#define SSL_F_TLS_PROCESS_SKE_SRP 0 +#define SSL_F_TLS_PSK_DO_BINDER 0 +#define SSL_F_TLS_SCAN_CLIENTHELLO_TLSEXT 0 +#define SSL_F_TLS_SETUP_HANDSHAKE 0 +#define SSL_F_USE_CERTIFICATE_CHAIN_FILE 0 +#define SSL_F_WPACKET_INTERN_INIT_LEN 0 +#define SSL_F_WPACKET_START_SUB_PACKET_LEN__ 0 +#define SSL_F_WRITE_STATE_MACHINE 0 +#endif + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/stack.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/stack.h new file mode 100644 index 0000000000000000000000000000000000000000..542de76f712fc6ed96d9fa89c870af7ca9b30d8a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/stack.h @@ -0,0 +1,92 @@ +/* + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_STACK_H +#define OPENSSL_STACK_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_STACK_H +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct stack_st OPENSSL_STACK; /* Use STACK_OF(...) instead */ + +typedef int (*OPENSSL_sk_compfunc)(const void *, const void *); +typedef void (*OPENSSL_sk_freefunc)(void *); +typedef void (*OPENSSL_sk_freefunc_thunk)(OPENSSL_sk_freefunc, void *); +typedef void *(*OPENSSL_sk_copyfunc)(const void *); + +int OPENSSL_sk_num(const OPENSSL_STACK *); +void *OPENSSL_sk_value(const OPENSSL_STACK *, int); + +void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, const void *data); + +OPENSSL_STACK *OPENSSL_sk_new(OPENSSL_sk_compfunc cmp); +OPENSSL_STACK *OPENSSL_sk_new_null(void); +OPENSSL_STACK *OPENSSL_sk_new_reserve(OPENSSL_sk_compfunc c, int n); +OPENSSL_STACK *OPENSSL_sk_set_thunks(OPENSSL_STACK *st, OPENSSL_sk_freefunc_thunk f_thunk); +int OPENSSL_sk_reserve(OPENSSL_STACK *st, int n); +void OPENSSL_sk_free(OPENSSL_STACK *); +void OPENSSL_sk_pop_free(OPENSSL_STACK *st, OPENSSL_sk_freefunc func); +OPENSSL_STACK *OPENSSL_sk_deep_copy(const OPENSSL_STACK *, + OPENSSL_sk_copyfunc c, + OPENSSL_sk_freefunc f); +int OPENSSL_sk_insert(OPENSSL_STACK *sk, const void *data, int where); +void *OPENSSL_sk_delete(OPENSSL_STACK *st, int loc); +void *OPENSSL_sk_delete_ptr(OPENSSL_STACK *st, const void *p); +int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data); +int OPENSSL_sk_find_ex(OPENSSL_STACK *st, const void *data); +int OPENSSL_sk_find_all(OPENSSL_STACK *st, const void *data, int *pnum); +int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data); +int OPENSSL_sk_unshift(OPENSSL_STACK *st, const void *data); +void *OPENSSL_sk_shift(OPENSSL_STACK *st); +void *OPENSSL_sk_pop(OPENSSL_STACK *st); +void OPENSSL_sk_zero(OPENSSL_STACK *st); +OPENSSL_sk_compfunc OPENSSL_sk_set_cmp_func(OPENSSL_STACK *sk, + OPENSSL_sk_compfunc cmp); +OPENSSL_STACK *OPENSSL_sk_dup(const OPENSSL_STACK *st); +void OPENSSL_sk_sort(OPENSSL_STACK *st); +int OPENSSL_sk_is_sorted(const OPENSSL_STACK *st); + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define _STACK OPENSSL_STACK +#define sk_num OPENSSL_sk_num +#define sk_value OPENSSL_sk_value +#define sk_set OPENSSL_sk_set +#define sk_new OPENSSL_sk_new +#define sk_new_null OPENSSL_sk_new_null +#define sk_free OPENSSL_sk_free +#define sk_pop_free OPENSSL_sk_pop_free +#define sk_deep_copy OPENSSL_sk_deep_copy +#define sk_insert OPENSSL_sk_insert +#define sk_delete OPENSSL_sk_delete +#define sk_delete_ptr OPENSSL_sk_delete_ptr +#define sk_find OPENSSL_sk_find +#define sk_find_ex OPENSSL_sk_find_ex +#define sk_push OPENSSL_sk_push +#define sk_unshift OPENSSL_sk_unshift +#define sk_shift OPENSSL_sk_shift +#define sk_pop OPENSSL_sk_pop +#define sk_zero OPENSSL_sk_zero +#define sk_set_cmp_func OPENSSL_sk_set_cmp_func +#define sk_dup OPENSSL_sk_dup +#define sk_sort OPENSSL_sk_sort +#define sk_is_sorted OPENSSL_sk_is_sorted +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/store.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/store.h new file mode 100644 index 0000000000000000000000000000000000000000..2f1470494db6ebab8ec6906a0c8a0c03c1955e7b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/store.h @@ -0,0 +1,372 @@ +/* + * Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_STORE_H +#define OPENSSL_STORE_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_OSSL_STORE_H +#endif + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/*- + * The main OSSL_STORE functions. + * ------------------------------ + * + * These allow applications to open a channel to a resource with supported + * data (keys, certs, crls, ...), read the data a piece at a time and decide + * what to do with it, and finally close. + */ + +typedef struct ossl_store_ctx_st OSSL_STORE_CTX; + +/* + * Typedef for the OSSL_STORE_INFO post processing callback. This can be used + * to massage the given OSSL_STORE_INFO, or to drop it entirely (by returning + * NULL). + */ +typedef OSSL_STORE_INFO *(*OSSL_STORE_post_process_info_fn)(OSSL_STORE_INFO *, + void *); + +/* + * Open a channel given a URI. The given UI method will be used any time the + * loader needs extra input, for example when a password or pin is needed, and + * will be passed the same user data every time it's needed in this context. + * + * Returns a context reference which represents the channel to communicate + * through. + */ +OSSL_STORE_CTX * +OSSL_STORE_open(const char *uri, const UI_METHOD *ui_method, void *ui_data, + OSSL_STORE_post_process_info_fn post_process, + void *post_process_data); +OSSL_STORE_CTX * +OSSL_STORE_open_ex(const char *uri, OSSL_LIB_CTX *libctx, const char *propq, + const UI_METHOD *ui_method, void *ui_data, + const OSSL_PARAM params[], + OSSL_STORE_post_process_info_fn post_process, + void *post_process_data); + +/* + * Control / fine tune the OSSL_STORE channel. |cmd| determines what is to be + * done, and depends on the underlying loader (use OSSL_STORE_get0_scheme to + * determine which loader is used), except for common commands (see below). + * Each command takes different arguments. + */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int OSSL_STORE_ctrl(OSSL_STORE_CTX *ctx, int cmd, + ... /* args */); +OSSL_DEPRECATEDIN_3_0 int OSSL_STORE_vctrl(OSSL_STORE_CTX *ctx, int cmd, + va_list args); +#endif + +#ifndef OPENSSL_NO_DEPRECATED_3_0 + +/* + * Common ctrl commands that different loaders may choose to support. + */ +/* int on = 0 or 1; STORE_ctrl(ctx, STORE_C_USE_SECMEM, &on); */ +#define OSSL_STORE_C_USE_SECMEM 1 +/* Where custom commands start */ +#define OSSL_STORE_C_CUSTOM_START 100 + +#endif + +/* + * Read one data item (a key, a cert, a CRL) that is supported by the OSSL_STORE + * functionality, given a context. + * Returns a OSSL_STORE_INFO pointer, from which OpenSSL typed data can be + * extracted with OSSL_STORE_INFO_get0_PKEY(), OSSL_STORE_INFO_get0_CERT(), ... + * NULL is returned on error, which may include that the data found at the URI + * can't be figured out for certain or is ambiguous. + */ +OSSL_STORE_INFO *OSSL_STORE_load(OSSL_STORE_CTX *ctx); + +/* + * Deletes the object in the store by URI. + * Returns 1 on success, 0 otherwise. + */ +int OSSL_STORE_delete(const char *uri, OSSL_LIB_CTX *libctx, const char *propq, + const UI_METHOD *ui_method, void *ui_data, + const OSSL_PARAM params[]); + +/* + * Check if end of data (end of file) is reached + * Returns 1 on end, 0 otherwise. + */ +int OSSL_STORE_eof(OSSL_STORE_CTX *ctx); + +/* + * Check if an error occurred + * Returns 1 if it did, 0 otherwise. + */ +int OSSL_STORE_error(OSSL_STORE_CTX *ctx); + +/* + * Close the channel + * Returns 1 on success, 0 on error. + */ +int OSSL_STORE_close(OSSL_STORE_CTX *ctx); + +/* + * Attach to a BIO. This works like OSSL_STORE_open() except it takes a + * BIO instead of a uri, along with a scheme to use when reading. + * The given UI method will be used any time the loader needs extra input, + * for example when a password or pin is needed, and will be passed the + * same user data every time it's needed in this context. + * + * Returns a context reference which represents the channel to communicate + * through. + * + * Note that this function is considered unsafe, all depending on what the + * BIO actually reads. + */ +OSSL_STORE_CTX *OSSL_STORE_attach(BIO *bio, const char *scheme, + OSSL_LIB_CTX *libctx, const char *propq, + const UI_METHOD *ui_method, void *ui_data, + const OSSL_PARAM params[], + OSSL_STORE_post_process_info_fn post_process, + void *post_process_data); + +/*- + * Extracting OpenSSL types from and creating new OSSL_STORE_INFOs + * --------------------------------------------------------------- + */ + +/* + * Types of data that can be ossl_stored in a OSSL_STORE_INFO. + * OSSL_STORE_INFO_NAME is typically found when getting a listing of + * available "files" / "tokens" / what have you. + */ +#define OSSL_STORE_INFO_NAME 1 /* char * */ +#define OSSL_STORE_INFO_PARAMS 2 /* EVP_PKEY * */ +#define OSSL_STORE_INFO_PUBKEY 3 /* EVP_PKEY * */ +#define OSSL_STORE_INFO_PKEY 4 /* EVP_PKEY * */ +#define OSSL_STORE_INFO_CERT 5 /* X509 * */ +#define OSSL_STORE_INFO_CRL 6 /* X509_CRL * */ + +/* + * Functions to generate OSSL_STORE_INFOs, one function for each type we + * support having in them, as well as a generic constructor. + * + * In all cases, ownership of the object is transferred to the OSSL_STORE_INFO + * and will therefore be freed when the OSSL_STORE_INFO is freed. + */ +OSSL_STORE_INFO *OSSL_STORE_INFO_new(int type, void *data); +OSSL_STORE_INFO *OSSL_STORE_INFO_new_NAME(char *name); +int OSSL_STORE_INFO_set0_NAME_description(OSSL_STORE_INFO *info, char *desc); +OSSL_STORE_INFO *OSSL_STORE_INFO_new_PARAMS(EVP_PKEY *params); +OSSL_STORE_INFO *OSSL_STORE_INFO_new_PUBKEY(EVP_PKEY *pubkey); +OSSL_STORE_INFO *OSSL_STORE_INFO_new_PKEY(EVP_PKEY *pkey); +OSSL_STORE_INFO *OSSL_STORE_INFO_new_CERT(X509 *x509); +OSSL_STORE_INFO *OSSL_STORE_INFO_new_CRL(X509_CRL *crl); + +/* + * Functions to try to extract data from a OSSL_STORE_INFO. + */ +int OSSL_STORE_INFO_get_type(const OSSL_STORE_INFO *info); +void *OSSL_STORE_INFO_get0_data(int type, const OSSL_STORE_INFO *info); +const char *OSSL_STORE_INFO_get0_NAME(const OSSL_STORE_INFO *info); +char *OSSL_STORE_INFO_get1_NAME(const OSSL_STORE_INFO *info); +const char *OSSL_STORE_INFO_get0_NAME_description(const OSSL_STORE_INFO *info); +char *OSSL_STORE_INFO_get1_NAME_description(const OSSL_STORE_INFO *info); +EVP_PKEY *OSSL_STORE_INFO_get0_PARAMS(const OSSL_STORE_INFO *info); +EVP_PKEY *OSSL_STORE_INFO_get1_PARAMS(const OSSL_STORE_INFO *info); +EVP_PKEY *OSSL_STORE_INFO_get0_PUBKEY(const OSSL_STORE_INFO *info); +EVP_PKEY *OSSL_STORE_INFO_get1_PUBKEY(const OSSL_STORE_INFO *info); +EVP_PKEY *OSSL_STORE_INFO_get0_PKEY(const OSSL_STORE_INFO *info); +EVP_PKEY *OSSL_STORE_INFO_get1_PKEY(const OSSL_STORE_INFO *info); +X509 *OSSL_STORE_INFO_get0_CERT(const OSSL_STORE_INFO *info); +X509 *OSSL_STORE_INFO_get1_CERT(const OSSL_STORE_INFO *info); +X509_CRL *OSSL_STORE_INFO_get0_CRL(const OSSL_STORE_INFO *info); +X509_CRL *OSSL_STORE_INFO_get1_CRL(const OSSL_STORE_INFO *info); + +const char *OSSL_STORE_INFO_type_string(int type); + +/* + * Free the OSSL_STORE_INFO + */ +void OSSL_STORE_INFO_free(OSSL_STORE_INFO *info); + +/*- + * Functions to construct a search URI from a base URI and search criteria + * ----------------------------------------------------------------------- + */ + +/* OSSL_STORE search types */ +#define OSSL_STORE_SEARCH_BY_NAME 1 /* subject in certs, issuer in CRLs */ +#define OSSL_STORE_SEARCH_BY_ISSUER_SERIAL 2 +#define OSSL_STORE_SEARCH_BY_KEY_FINGERPRINT 3 +#define OSSL_STORE_SEARCH_BY_ALIAS 4 + +/* To check what search types the scheme handler supports */ +int OSSL_STORE_supports_search(OSSL_STORE_CTX *ctx, int search_type); + +/* Search term constructors */ +/* + * The input is considered to be owned by the caller, and must therefore + * remain present throughout the lifetime of the returned OSSL_STORE_SEARCH + */ +OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_name(X509_NAME *name); +OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_issuer_serial(X509_NAME *name, + const ASN1_INTEGER + *serial); +OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_key_fingerprint(const EVP_MD *digest, + const unsigned char + *bytes, + size_t len); +OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_alias(const char *alias); + +/* Search term destructor */ +void OSSL_STORE_SEARCH_free(OSSL_STORE_SEARCH *search); + +/* Search term accessors */ +int OSSL_STORE_SEARCH_get_type(const OSSL_STORE_SEARCH *criterion); +X509_NAME *OSSL_STORE_SEARCH_get0_name(const OSSL_STORE_SEARCH *criterion); +const ASN1_INTEGER *OSSL_STORE_SEARCH_get0_serial(const OSSL_STORE_SEARCH + *criterion); +const unsigned char *OSSL_STORE_SEARCH_get0_bytes(const OSSL_STORE_SEARCH + *criterion, + size_t *length); +const char *OSSL_STORE_SEARCH_get0_string(const OSSL_STORE_SEARCH *criterion); +const EVP_MD *OSSL_STORE_SEARCH_get0_digest(const OSSL_STORE_SEARCH *criterion); + +/* + * Add search criterion and expected return type (which can be unspecified) + * to the loading channel. This MUST happen before the first OSSL_STORE_load(). + */ +int OSSL_STORE_expect(OSSL_STORE_CTX *ctx, int expected_type); +int OSSL_STORE_find(OSSL_STORE_CTX *ctx, const OSSL_STORE_SEARCH *search); + +/*- + * Function to fetch a loader and extract data from it + * --------------------------------------------------- + */ + +typedef struct ossl_store_loader_st OSSL_STORE_LOADER; + +OSSL_STORE_LOADER *OSSL_STORE_LOADER_fetch(OSSL_LIB_CTX *libctx, + const char *scheme, + const char *properties); +int OSSL_STORE_LOADER_up_ref(OSSL_STORE_LOADER *loader); +void OSSL_STORE_LOADER_free(OSSL_STORE_LOADER *loader); +const OSSL_PROVIDER *OSSL_STORE_LOADER_get0_provider(const OSSL_STORE_LOADER * + loader); +const char *OSSL_STORE_LOADER_get0_properties(const OSSL_STORE_LOADER *loader); +const char *OSSL_STORE_LOADER_get0_description(const OSSL_STORE_LOADER *loader); +int OSSL_STORE_LOADER_is_a(const OSSL_STORE_LOADER *loader, + const char *scheme); +void OSSL_STORE_LOADER_do_all_provided(OSSL_LIB_CTX *libctx, + void (*fn)(OSSL_STORE_LOADER *loader, + void *arg), + void *arg); +int OSSL_STORE_LOADER_names_do_all(const OSSL_STORE_LOADER *loader, + void (*fn)(const char *name, void *data), + void *data); +const OSSL_PARAM * +OSSL_STORE_LOADER_settable_ctx_params(const OSSL_STORE_LOADER *loader); + +/*- + * Function to register a loader for the given URI scheme. + * ------------------------------------------------------- + * + * The loader receives all the main components of an URI except for the + * scheme. + */ + +#ifndef OPENSSL_NO_DEPRECATED_3_0 + +/* struct ossl_store_loader_ctx_st is defined differently by each loader */ +typedef struct ossl_store_loader_ctx_st OSSL_STORE_LOADER_CTX; +typedef OSSL_STORE_LOADER_CTX *(*OSSL_STORE_open_fn)(const OSSL_STORE_LOADER *loader, const char *uri, + const UI_METHOD *ui_method, void *ui_data); +typedef OSSL_STORE_LOADER_CTX *(*OSSL_STORE_open_ex_fn)(const OSSL_STORE_LOADER *loader, + const char *uri, OSSL_LIB_CTX *libctx, const char *propq, + const UI_METHOD *ui_method, void *ui_data); + +typedef OSSL_STORE_LOADER_CTX *(*OSSL_STORE_attach_fn)(const OSSL_STORE_LOADER *loader, BIO *bio, + OSSL_LIB_CTX *libctx, const char *propq, + const UI_METHOD *ui_method, void *ui_data); +typedef int (*OSSL_STORE_ctrl_fn)(OSSL_STORE_LOADER_CTX *ctx, int cmd, va_list args); +typedef int (*OSSL_STORE_expect_fn)(OSSL_STORE_LOADER_CTX *ctx, int expected); +typedef int (*OSSL_STORE_find_fn)(OSSL_STORE_LOADER_CTX *ctx, const OSSL_STORE_SEARCH *criteria); +typedef OSSL_STORE_INFO *(*OSSL_STORE_load_fn)(OSSL_STORE_LOADER_CTX *ctx, const UI_METHOD *ui_method, void *ui_data); +typedef int (*OSSL_STORE_eof_fn)(OSSL_STORE_LOADER_CTX *ctx); +typedef int (*OSSL_STORE_error_fn)(OSSL_STORE_LOADER_CTX *ctx); +typedef int (*OSSL_STORE_close_fn)(OSSL_STORE_LOADER_CTX *ctx); + +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +OSSL_STORE_LOADER *OSSL_STORE_LOADER_new(ENGINE *e, const char *scheme); +OSSL_DEPRECATEDIN_3_0 +int OSSL_STORE_LOADER_set_open(OSSL_STORE_LOADER *loader, + OSSL_STORE_open_fn open_function); +OSSL_DEPRECATEDIN_3_0 +int OSSL_STORE_LOADER_set_open_ex(OSSL_STORE_LOADER *loader, + OSSL_STORE_open_ex_fn open_ex_function); +OSSL_DEPRECATEDIN_3_0 +int OSSL_STORE_LOADER_set_attach(OSSL_STORE_LOADER *loader, + OSSL_STORE_attach_fn attach_function); +OSSL_DEPRECATEDIN_3_0 +int OSSL_STORE_LOADER_set_ctrl(OSSL_STORE_LOADER *loader, + OSSL_STORE_ctrl_fn ctrl_function); +OSSL_DEPRECATEDIN_3_0 +int OSSL_STORE_LOADER_set_expect(OSSL_STORE_LOADER *loader, + OSSL_STORE_expect_fn expect_function); +OSSL_DEPRECATEDIN_3_0 +int OSSL_STORE_LOADER_set_find(OSSL_STORE_LOADER *loader, + OSSL_STORE_find_fn find_function); +OSSL_DEPRECATEDIN_3_0 +int OSSL_STORE_LOADER_set_load(OSSL_STORE_LOADER *loader, + OSSL_STORE_load_fn load_function); +OSSL_DEPRECATEDIN_3_0 +int OSSL_STORE_LOADER_set_eof(OSSL_STORE_LOADER *loader, + OSSL_STORE_eof_fn eof_function); +OSSL_DEPRECATEDIN_3_0 +int OSSL_STORE_LOADER_set_error(OSSL_STORE_LOADER *loader, + OSSL_STORE_error_fn error_function); +OSSL_DEPRECATEDIN_3_0 +int OSSL_STORE_LOADER_set_close(OSSL_STORE_LOADER *loader, + OSSL_STORE_close_fn close_function); +OSSL_DEPRECATEDIN_3_0 +const ENGINE *OSSL_STORE_LOADER_get0_engine(const OSSL_STORE_LOADER *loader); +OSSL_DEPRECATEDIN_3_0 +const char *OSSL_STORE_LOADER_get0_scheme(const OSSL_STORE_LOADER *loader); +OSSL_DEPRECATEDIN_3_0 +int OSSL_STORE_register_loader(OSSL_STORE_LOADER *loader); +OSSL_DEPRECATEDIN_3_0 +OSSL_STORE_LOADER *OSSL_STORE_unregister_loader(const char *scheme); +#endif + +/*- + * Functions to list STORE loaders + * ------------------------------- + */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +int OSSL_STORE_do_all_loaders(void (*do_function)(const OSSL_STORE_LOADER *loader, + void *do_arg), + void *do_arg); +#endif + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/storeerr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/storeerr.h new file mode 100644 index 0000000000000000000000000000000000000000..a61bee11125f972ca7925a859202b99c22261dee --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/storeerr.h @@ -0,0 +1,47 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_STOREERR_H +#define OPENSSL_STOREERR_H +#pragma once + +#include +#include +#include + +/* + * OSSL_STORE reason codes. + */ +#define OSSL_STORE_R_AMBIGUOUS_CONTENT_TYPE 107 +#define OSSL_STORE_R_BAD_PASSWORD_READ 115 +#define OSSL_STORE_R_ERROR_VERIFYING_PKCS12_MAC 113 +#define OSSL_STORE_R_FINGERPRINT_SIZE_DOES_NOT_MATCH_DIGEST 121 +#define OSSL_STORE_R_INVALID_SCHEME 106 +#define OSSL_STORE_R_IS_NOT_A 112 +#define OSSL_STORE_R_LOADER_INCOMPLETE 116 +#define OSSL_STORE_R_LOADING_STARTED 117 +#define OSSL_STORE_R_NOT_A_CERTIFICATE 100 +#define OSSL_STORE_R_NOT_A_CRL 101 +#define OSSL_STORE_R_NOT_A_NAME 103 +#define OSSL_STORE_R_NOT_A_PRIVATE_KEY 102 +#define OSSL_STORE_R_NOT_A_PUBLIC_KEY 122 +#define OSSL_STORE_R_NOT_PARAMETERS 104 +#define OSSL_STORE_R_NO_LOADERS_FOUND 123 +#define OSSL_STORE_R_PASSPHRASE_CALLBACK_ERROR 114 +#define OSSL_STORE_R_PATH_MUST_BE_ABSOLUTE 108 +#define OSSL_STORE_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES 119 +#define OSSL_STORE_R_UI_PROCESS_INTERRUPTED_OR_CANCELLED 109 +#define OSSL_STORE_R_UNREGISTERED_SCHEME 105 +#define OSSL_STORE_R_UNSUPPORTED_CONTENT_TYPE 110 +#define OSSL_STORE_R_UNSUPPORTED_OPERATION 118 +#define OSSL_STORE_R_UNSUPPORTED_SEARCH_TYPE 120 +#define OSSL_STORE_R_URI_AUTHORITY_UNSUPPORTED 111 + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/symhacks.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/symhacks.h new file mode 100644 index 0000000000000000000000000000000000000000..d04139545385cfad1632d2d12355014a2442dbcc --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/symhacks.h @@ -0,0 +1,39 @@ +/* + * Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_SYMHACKS_H +#define OPENSSL_SYMHACKS_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_SYMHACKS_H +#endif + +#include + +/* Case insensitive linking causes problems.... */ +#if defined(OPENSSL_SYS_VMS) +#undef ERR_load_CRYPTO_strings +#define ERR_load_CRYPTO_strings ERR_load_CRYPTOlib_strings +#undef OCSP_crlID_new +#define OCSP_crlID_new OCSP_crlID2_new + +#undef d2i_ECPARAMETERS +#define d2i_ECPARAMETERS d2i_UC_ECPARAMETERS +#undef i2d_ECPARAMETERS +#define i2d_ECPARAMETERS i2d_UC_ECPARAMETERS +#undef d2i_ECPKPARAMETERS +#define d2i_ECPKPARAMETERS d2i_UC_ECPKPARAMETERS +#undef i2d_ECPKPARAMETERS +#define i2d_ECPKPARAMETERS i2d_UC_ECPKPARAMETERS + +#endif + +#endif /* ! defined HEADER_VMS_IDHACKS_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/thread.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/thread.h new file mode 100644 index 0000000000000000000000000000000000000000..6d86e0e355186402b363d2b308845ee277c24f95 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/thread.h @@ -0,0 +1,31 @@ +/* + * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved. + * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_THREAD_H +#define OPENSSL_THREAD_H + +#define OSSL_THREAD_SUPPORT_FLAG_THREAD_POOL (1U << 0) +#define OSSL_THREAD_SUPPORT_FLAG_DEFAULT_SPAWN (1U << 1) + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +uint32_t OSSL_get_thread_support_flags(void); +int OSSL_set_max_threads(OSSL_LIB_CTX *ctx, uint64_t max_threads); +uint64_t OSSL_get_max_threads(OSSL_LIB_CTX *ctx); + +#ifdef __cplusplus +} +#endif + +#endif /* OPENSSL_THREAD_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/tls1.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/tls1.h new file mode 100644 index 0000000000000000000000000000000000000000..34d376863a42ae87fb095c29dcd03298d9e18696 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/tls1.h @@ -0,0 +1,1222 @@ +/* + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. + * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved + * Copyright 2005 Nokia. All rights reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_TLS1_H +#define OPENSSL_TLS1_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_TLS1_H +#endif + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Default security level if not overridden at config time */ +#ifndef OPENSSL_TLS_SECURITY_LEVEL +#define OPENSSL_TLS_SECURITY_LEVEL 2 +#endif + +/* TLS*_VERSION constants are defined in prov_ssl.h */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define TLS_MAX_VERSION TLS1_3_VERSION +#endif + +/* Special value for method supporting multiple versions */ +#define TLS_ANY_VERSION 0x10000 + +#define TLS1_VERSION_MAJOR 0x03 +#define TLS1_VERSION_MINOR 0x01 + +#define TLS1_1_VERSION_MAJOR 0x03 +#define TLS1_1_VERSION_MINOR 0x02 + +#define TLS1_2_VERSION_MAJOR 0x03 +#define TLS1_2_VERSION_MINOR 0x03 + +#define TLS1_get_version(s) \ + ((SSL_version(s) >> 8) == TLS1_VERSION_MAJOR ? SSL_version(s) : 0) + +#define TLS1_get_client_version(s) \ + ((SSL_client_version(s) >> 8) == TLS1_VERSION_MAJOR ? SSL_client_version(s) : 0) + +#define TLS1_AD_DECRYPTION_FAILED 21 +#define TLS1_AD_RECORD_OVERFLOW 22 +#define TLS1_AD_UNKNOWN_CA 48 /* fatal */ +#define TLS1_AD_ACCESS_DENIED 49 /* fatal */ +#define TLS1_AD_DECODE_ERROR 50 /* fatal */ +#define TLS1_AD_DECRYPT_ERROR 51 +#define TLS1_AD_EXPORT_RESTRICTION 60 /* fatal */ +#define TLS1_AD_PROTOCOL_VERSION 70 /* fatal */ +#define TLS1_AD_INSUFFICIENT_SECURITY 71 /* fatal */ +#define TLS1_AD_INTERNAL_ERROR 80 /* fatal */ +#define TLS1_AD_INAPPROPRIATE_FALLBACK 86 /* fatal */ +#define TLS1_AD_USER_CANCELLED 90 +#define TLS1_AD_NO_RENEGOTIATION 100 +/* TLSv1.3 alerts */ +#define TLS13_AD_MISSING_EXTENSION 109 /* fatal */ +#define TLS13_AD_CERTIFICATE_REQUIRED 116 /* fatal */ +/* codes 110-114 are from RFC3546 */ +#define TLS1_AD_UNSUPPORTED_EXTENSION 110 +#define TLS1_AD_CERTIFICATE_UNOBTAINABLE 111 +#define TLS1_AD_UNRECOGNIZED_NAME 112 +#define TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE 113 +#define TLS1_AD_BAD_CERTIFICATE_HASH_VALUE 114 +#define TLS1_AD_UNKNOWN_PSK_IDENTITY 115 /* fatal */ +#define TLS1_AD_NO_APPLICATION_PROTOCOL 120 /* fatal */ + +/* ExtensionType values from RFC3546 / RFC4366 / RFC6066 */ +#define TLSEXT_TYPE_server_name 0 +#define TLSEXT_TYPE_max_fragment_length 1 +#define TLSEXT_TYPE_client_certificate_url 2 +#define TLSEXT_TYPE_trusted_ca_keys 3 +#define TLSEXT_TYPE_truncated_hmac 4 +#define TLSEXT_TYPE_status_request 5 +/* ExtensionType values from RFC4681 */ +#define TLSEXT_TYPE_user_mapping 6 +/* ExtensionType values from RFC5878 */ +#define TLSEXT_TYPE_client_authz 7 +#define TLSEXT_TYPE_server_authz 8 +/* ExtensionType values from RFC6091 */ +#define TLSEXT_TYPE_cert_type 9 + +/* ExtensionType values from RFC4492 */ +/* + * Prior to TLSv1.3 the supported_groups extension was known as + * elliptic_curves + */ +#define TLSEXT_TYPE_supported_groups 10 +#define TLSEXT_TYPE_elliptic_curves TLSEXT_TYPE_supported_groups +#define TLSEXT_TYPE_ec_point_formats 11 + +/* ExtensionType value from RFC5054 */ +#define TLSEXT_TYPE_srp 12 + +/* ExtensionType values from RFC5246 */ +#define TLSEXT_TYPE_signature_algorithms 13 + +/* ExtensionType value from RFC5764 */ +#define TLSEXT_TYPE_use_srtp 14 + +/* ExtensionType value from RFC7301 */ +#define TLSEXT_TYPE_application_layer_protocol_negotiation 16 + +/* + * Extension type for Certificate Transparency + * https://tools.ietf.org/html/rfc6962#section-3.3.1 + */ +#define TLSEXT_TYPE_signed_certificate_timestamp 18 + +/* + * Extension type for Raw Public Keys + * https://tools.ietf.org/html/rfc7250 + * https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml + */ +#define TLSEXT_TYPE_client_cert_type 19 +#define TLSEXT_TYPE_server_cert_type 20 + +/* + * ExtensionType value for TLS padding extension. + * http://tools.ietf.org/html/draft-agl-tls-padding + */ +#define TLSEXT_TYPE_padding 21 + +/* ExtensionType value from RFC7366 */ +#define TLSEXT_TYPE_encrypt_then_mac 22 + +/* ExtensionType value from RFC7627 */ +#define TLSEXT_TYPE_extended_master_secret 23 + +/* ExtensionType value from RFC8879 */ +#define TLSEXT_TYPE_compress_certificate 27 + +/* ExtensionType value from RFC4507 */ +#define TLSEXT_TYPE_session_ticket 35 + +/* As defined for TLS1.3 */ +#define TLSEXT_TYPE_psk 41 +#define TLSEXT_TYPE_early_data 42 +#define TLSEXT_TYPE_supported_versions 43 +#define TLSEXT_TYPE_cookie 44 +#define TLSEXT_TYPE_psk_kex_modes 45 +#define TLSEXT_TYPE_certificate_authorities 47 +#define TLSEXT_TYPE_post_handshake_auth 49 +#define TLSEXT_TYPE_signature_algorithms_cert 50 +#define TLSEXT_TYPE_key_share 51 +#define TLSEXT_TYPE_quic_transport_parameters 57 + +/* Temporary extension type */ +#define TLSEXT_TYPE_renegotiate 0xff01 + +#ifndef OPENSSL_NO_NEXTPROTONEG +/* This is not an IANA defined extension number */ +#define TLSEXT_TYPE_next_proto_neg 13172 +#endif + +/* NameType value from RFC3546 */ +#define TLSEXT_NAMETYPE_host_name 0 +/* status request value from RFC3546 */ +#define TLSEXT_STATUSTYPE_ocsp 1 + +/* ECPointFormat values from RFC4492 */ +#define TLSEXT_ECPOINTFORMAT_first 0 +#define TLSEXT_ECPOINTFORMAT_uncompressed 0 +#define TLSEXT_ECPOINTFORMAT_ansiX962_compressed_prime 1 +#define TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2 2 +#define TLSEXT_ECPOINTFORMAT_last 2 + +/* Signature and hash algorithms from RFC5246 */ +#define TLSEXT_signature_anonymous 0 +#define TLSEXT_signature_rsa 1 +#define TLSEXT_signature_dsa 2 +#define TLSEXT_signature_ecdsa 3 +#define TLSEXT_signature_gostr34102001 237 +#define TLSEXT_signature_gostr34102012_256 238 +#define TLSEXT_signature_gostr34102012_512 239 + +/* Total number of different signature algorithms */ +#define TLSEXT_signature_num 7 + +#define TLSEXT_hash_none 0 +#define TLSEXT_hash_md5 1 +#define TLSEXT_hash_sha1 2 +#define TLSEXT_hash_sha224 3 +#define TLSEXT_hash_sha256 4 +#define TLSEXT_hash_sha384 5 +#define TLSEXT_hash_sha512 6 +#define TLSEXT_hash_gostr3411 237 +#define TLSEXT_hash_gostr34112012_256 238 +#define TLSEXT_hash_gostr34112012_512 239 + +/* Total number of different digest algorithms */ + +#define TLSEXT_hash_num 10 + +/* Possible compression values from RFC8879 */ +/* Not defined in RFC8879, but used internally for no-compression */ +#define TLSEXT_comp_cert_none 0 +#define TLSEXT_comp_cert_zlib 1 +#define TLSEXT_comp_cert_brotli 2 +#define TLSEXT_comp_cert_zstd 3 +/* one more than the number of defined values - used as size of 0-terminated array */ +#define TLSEXT_comp_cert_limit 4 + +/* Flag set for unrecognised algorithms */ +#define TLSEXT_nid_unknown 0x1000000 + +/* ECC curves */ + +#define TLSEXT_curve_P_256 23 +#define TLSEXT_curve_P_384 24 + +/* OpenSSL value to disable maximum fragment length extension */ +#define TLSEXT_max_fragment_length_DISABLED 0 +/* Allowed values for max fragment length extension */ +#define TLSEXT_max_fragment_length_512 1 +#define TLSEXT_max_fragment_length_1024 2 +#define TLSEXT_max_fragment_length_2048 3 +#define TLSEXT_max_fragment_length_4096 4 +/* OpenSSL value for unset maximum fragment length extension */ +#define TLSEXT_max_fragment_length_UNSPECIFIED 255 + +/* + * TLS Certificate Type (for RFC7250) + * https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#tls-extensiontype-values-3 + */ +#define TLSEXT_cert_type_x509 0 +#define TLSEXT_cert_type_pgp 1 /* recognized, but not supported */ +#define TLSEXT_cert_type_rpk 2 +#define TLSEXT_cert_type_1609dot2 3 /* recognized, but not supported */ + +int SSL_CTX_set_tlsext_max_fragment_length(SSL_CTX *ctx, uint8_t mode); +int SSL_set_tlsext_max_fragment_length(SSL *ssl, uint8_t mode); + +#define TLSEXT_MAXLEN_host_name 255 + +__owur const char *SSL_get_servername(const SSL *s, const int type); +__owur int SSL_get_servername_type(const SSL *s); +/* + * SSL_export_keying_material exports a value derived from the master secret, + * as specified in RFC 5705. It writes |olen| bytes to |out| given a label and + * optional context. (Since a zero length context is allowed, the |use_context| + * flag controls whether a context is included.) It returns 1 on success and + * 0 or -1 otherwise. + */ +__owur int SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen, + const char *label, size_t llen, + const unsigned char *context, + size_t contextlen, int use_context); + +/* + * SSL_export_keying_material_early exports a value derived from the + * early exporter master secret, as specified in + * https://tools.ietf.org/html/draft-ietf-tls-tls13-23. It writes + * |olen| bytes to |out| given a label and optional context. It + * returns 1 on success and 0 otherwise. + */ +__owur int SSL_export_keying_material_early(SSL *s, unsigned char *out, + size_t olen, const char *label, + size_t llen, + const unsigned char *context, + size_t contextlen); + +int SSL_get_peer_signature_type_nid(const SSL *s, int *pnid); +int SSL_get_signature_type_nid(const SSL *s, int *pnid); + +int SSL_get_sigalgs(SSL *s, int idx, + int *psign, int *phash, int *psignandhash, + unsigned char *rsig, unsigned char *rhash); + +char *SSL_get1_builtin_sigalgs(OSSL_LIB_CTX *libctx); + +int SSL_get_shared_sigalgs(SSL *s, int idx, + int *psign, int *phash, int *psignandhash, + unsigned char *rsig, unsigned char *rhash); + +__owur int SSL_check_chain(SSL *s, X509 *x, EVP_PKEY *pk, STACK_OF(X509) *chain); + +#define SSL_set_tlsext_host_name(s, name) \ + SSL_ctrl(s, SSL_CTRL_SET_TLSEXT_HOSTNAME, TLSEXT_NAMETYPE_host_name, \ + (void *)name) + +#define SSL_set_tlsext_debug_callback(ssl, cb) \ + SSL_callback_ctrl(ssl, SSL_CTRL_SET_TLSEXT_DEBUG_CB, \ + (void (*)(void))cb) + +#define SSL_set_tlsext_debug_arg(ssl, arg) \ + SSL_ctrl(ssl, SSL_CTRL_SET_TLSEXT_DEBUG_ARG, 0, arg) + +#define SSL_get_tlsext_status_type(ssl) \ + SSL_ctrl(ssl, SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE, 0, NULL) + +#define SSL_set_tlsext_status_type(ssl, type) \ + SSL_ctrl(ssl, SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE, type, NULL) + +#define SSL_get_tlsext_status_exts(ssl, arg) \ + SSL_ctrl(ssl, SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS, 0, arg) + +#define SSL_set_tlsext_status_exts(ssl, arg) \ + SSL_ctrl(ssl, SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS, 0, arg) + +#define SSL_get_tlsext_status_ids(ssl, arg) \ + SSL_ctrl(ssl, SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS, 0, arg) + +#define SSL_set_tlsext_status_ids(ssl, arg) \ + SSL_ctrl(ssl, SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS, 0, arg) + +#define SSL_get_tlsext_status_ocsp_resp(ssl, arg) \ + SSL_ctrl(ssl, SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP, 0, arg) + +#define SSL_set_tlsext_status_ocsp_resp(ssl, arg, arglen) \ + SSL_ctrl(ssl, SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP, arglen, arg) + +#define SSL_get0_tlsext_status_ocsp_resp_ex(ssl, arg) \ + SSL_ctrl(ssl, SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP_EX, 0, arg) + +#define SSL_set0_tlsext_status_ocsp_resp_ex(ssl, arg) \ + SSL_ctrl(ssl, SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP_EX, 0, arg) + +#define SSL_CTX_set_tlsext_servername_callback(ctx, cb) \ + SSL_CTX_callback_ctrl(ctx, SSL_CTRL_SET_TLSEXT_SERVERNAME_CB, \ + (void (*)(void))cb) + +#define SSL_TLSEXT_ERR_OK 0 +#define SSL_TLSEXT_ERR_ALERT_WARNING 1 +#define SSL_TLSEXT_ERR_ALERT_FATAL 2 +#define SSL_TLSEXT_ERR_NOACK 3 + +#define SSL_CTX_set_tlsext_servername_arg(ctx, arg) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG, 0, arg) + +#define SSL_CTX_get_tlsext_ticket_keys(ctx, keys, keylen) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_GET_TLSEXT_TICKET_KEYS, keylen, keys) +#define SSL_CTX_set_tlsext_ticket_keys(ctx, keys, keylen) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_SET_TLSEXT_TICKET_KEYS, keylen, keys) + +#define SSL_CTX_get_tlsext_status_cb(ssl, cb) \ + SSL_CTX_ctrl(ssl, SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB, 0, (void *)cb) +#define SSL_CTX_set_tlsext_status_cb(ssl, cb) \ + SSL_CTX_callback_ctrl(ssl, SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB, \ + (void (*)(void))cb) + +#define SSL_CTX_get_tlsext_status_arg(ssl, arg) \ + SSL_CTX_ctrl(ssl, SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG, 0, arg) +#define SSL_CTX_set_tlsext_status_arg(ssl, arg) \ + SSL_CTX_ctrl(ssl, SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG, 0, arg) + +#define SSL_CTX_set_tlsext_status_type(ssl, type) \ + SSL_CTX_ctrl(ssl, SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE, type, NULL) + +#define SSL_CTX_get_tlsext_status_type(ssl) \ + SSL_CTX_ctrl(ssl, SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE, 0, NULL) + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define SSL_CTX_set_tlsext_ticket_key_cb(ssl, cb) \ + SSL_CTX_callback_ctrl(ssl, SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB, \ + (void (*)(void))cb) +#endif +int SSL_CTX_set_tlsext_ticket_key_evp_cb(SSL_CTX *ctx, int (*fp)(SSL *, unsigned char *, unsigned char *, EVP_CIPHER_CTX *, EVP_MAC_CTX *, int)); + +/* PSK ciphersuites from 4279 */ +#define TLS1_CK_PSK_WITH_RC4_128_SHA 0x0300008A +#define TLS1_CK_PSK_WITH_3DES_EDE_CBC_SHA 0x0300008B +#define TLS1_CK_PSK_WITH_AES_128_CBC_SHA 0x0300008C +#define TLS1_CK_PSK_WITH_AES_256_CBC_SHA 0x0300008D +#define TLS1_CK_DHE_PSK_WITH_RC4_128_SHA 0x0300008E +#define TLS1_CK_DHE_PSK_WITH_3DES_EDE_CBC_SHA 0x0300008F +#define TLS1_CK_DHE_PSK_WITH_AES_128_CBC_SHA 0x03000090 +#define TLS1_CK_DHE_PSK_WITH_AES_256_CBC_SHA 0x03000091 +#define TLS1_CK_RSA_PSK_WITH_RC4_128_SHA 0x03000092 +#define TLS1_CK_RSA_PSK_WITH_3DES_EDE_CBC_SHA 0x03000093 +#define TLS1_CK_RSA_PSK_WITH_AES_128_CBC_SHA 0x03000094 +#define TLS1_CK_RSA_PSK_WITH_AES_256_CBC_SHA 0x03000095 + +/* PSK ciphersuites from 5487 */ +#define TLS1_CK_PSK_WITH_AES_128_GCM_SHA256 0x030000A8 +#define TLS1_CK_PSK_WITH_AES_256_GCM_SHA384 0x030000A9 +#define TLS1_CK_DHE_PSK_WITH_AES_128_GCM_SHA256 0x030000AA +#define TLS1_CK_DHE_PSK_WITH_AES_256_GCM_SHA384 0x030000AB +#define TLS1_CK_RSA_PSK_WITH_AES_128_GCM_SHA256 0x030000AC +#define TLS1_CK_RSA_PSK_WITH_AES_256_GCM_SHA384 0x030000AD +#define TLS1_CK_PSK_WITH_AES_128_CBC_SHA256 0x030000AE +#define TLS1_CK_PSK_WITH_AES_256_CBC_SHA384 0x030000AF +#define TLS1_CK_PSK_WITH_NULL_SHA256 0x030000B0 +#define TLS1_CK_PSK_WITH_NULL_SHA384 0x030000B1 +#define TLS1_CK_DHE_PSK_WITH_AES_128_CBC_SHA256 0x030000B2 +#define TLS1_CK_DHE_PSK_WITH_AES_256_CBC_SHA384 0x030000B3 +#define TLS1_CK_DHE_PSK_WITH_NULL_SHA256 0x030000B4 +#define TLS1_CK_DHE_PSK_WITH_NULL_SHA384 0x030000B5 +#define TLS1_CK_RSA_PSK_WITH_AES_128_CBC_SHA256 0x030000B6 +#define TLS1_CK_RSA_PSK_WITH_AES_256_CBC_SHA384 0x030000B7 +#define TLS1_CK_RSA_PSK_WITH_NULL_SHA256 0x030000B8 +#define TLS1_CK_RSA_PSK_WITH_NULL_SHA384 0x030000B9 + +/* NULL PSK ciphersuites from RFC4785 */ +#define TLS1_CK_PSK_WITH_NULL_SHA 0x0300002C +#define TLS1_CK_DHE_PSK_WITH_NULL_SHA 0x0300002D +#define TLS1_CK_RSA_PSK_WITH_NULL_SHA 0x0300002E + +/* AES ciphersuites from RFC3268 */ +#define TLS1_CK_RSA_WITH_AES_128_SHA 0x0300002F +#define TLS1_CK_DH_DSS_WITH_AES_128_SHA 0x03000030 +#define TLS1_CK_DH_RSA_WITH_AES_128_SHA 0x03000031 +#define TLS1_CK_DHE_DSS_WITH_AES_128_SHA 0x03000032 +#define TLS1_CK_DHE_RSA_WITH_AES_128_SHA 0x03000033 +#define TLS1_CK_ADH_WITH_AES_128_SHA 0x03000034 +#define TLS1_CK_RSA_WITH_AES_256_SHA 0x03000035 +#define TLS1_CK_DH_DSS_WITH_AES_256_SHA 0x03000036 +#define TLS1_CK_DH_RSA_WITH_AES_256_SHA 0x03000037 +#define TLS1_CK_DHE_DSS_WITH_AES_256_SHA 0x03000038 +#define TLS1_CK_DHE_RSA_WITH_AES_256_SHA 0x03000039 +#define TLS1_CK_ADH_WITH_AES_256_SHA 0x0300003A + +/* TLS v1.2 ciphersuites */ +#define TLS1_CK_RSA_WITH_NULL_SHA256 0x0300003B +#define TLS1_CK_RSA_WITH_AES_128_SHA256 0x0300003C +#define TLS1_CK_RSA_WITH_AES_256_SHA256 0x0300003D +#define TLS1_CK_DH_DSS_WITH_AES_128_SHA256 0x0300003E +#define TLS1_CK_DH_RSA_WITH_AES_128_SHA256 0x0300003F +#define TLS1_CK_DHE_DSS_WITH_AES_128_SHA256 0x03000040 + +/* Camellia ciphersuites from RFC4132 */ +#define TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000041 +#define TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA 0x03000042 +#define TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000043 +#define TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA 0x03000044 +#define TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000045 +#define TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA 0x03000046 + +/* TLS v1.2 ciphersuites */ +#define TLS1_CK_DHE_RSA_WITH_AES_128_SHA256 0x03000067 +#define TLS1_CK_DH_DSS_WITH_AES_256_SHA256 0x03000068 +#define TLS1_CK_DH_RSA_WITH_AES_256_SHA256 0x03000069 +#define TLS1_CK_DHE_DSS_WITH_AES_256_SHA256 0x0300006A +#define TLS1_CK_DHE_RSA_WITH_AES_256_SHA256 0x0300006B +#define TLS1_CK_ADH_WITH_AES_128_SHA256 0x0300006C +#define TLS1_CK_ADH_WITH_AES_256_SHA256 0x0300006D + +/* Camellia ciphersuites from RFC4132 */ +#define TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000084 +#define TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA 0x03000085 +#define TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000086 +#define TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA 0x03000087 +#define TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000088 +#define TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA 0x03000089 + +/* SEED ciphersuites from RFC4162 */ +#define TLS1_CK_RSA_WITH_SEED_SHA 0x03000096 +#define TLS1_CK_DH_DSS_WITH_SEED_SHA 0x03000097 +#define TLS1_CK_DH_RSA_WITH_SEED_SHA 0x03000098 +#define TLS1_CK_DHE_DSS_WITH_SEED_SHA 0x03000099 +#define TLS1_CK_DHE_RSA_WITH_SEED_SHA 0x0300009A +#define TLS1_CK_ADH_WITH_SEED_SHA 0x0300009B + +/* TLS v1.2 GCM ciphersuites from RFC5288 */ +#define TLS1_CK_RSA_WITH_AES_128_GCM_SHA256 0x0300009C +#define TLS1_CK_RSA_WITH_AES_256_GCM_SHA384 0x0300009D +#define TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256 0x0300009E +#define TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384 0x0300009F +#define TLS1_CK_DH_RSA_WITH_AES_128_GCM_SHA256 0x030000A0 +#define TLS1_CK_DH_RSA_WITH_AES_256_GCM_SHA384 0x030000A1 +#define TLS1_CK_DHE_DSS_WITH_AES_128_GCM_SHA256 0x030000A2 +#define TLS1_CK_DHE_DSS_WITH_AES_256_GCM_SHA384 0x030000A3 +#define TLS1_CK_DH_DSS_WITH_AES_128_GCM_SHA256 0x030000A4 +#define TLS1_CK_DH_DSS_WITH_AES_256_GCM_SHA384 0x030000A5 +#define TLS1_CK_ADH_WITH_AES_128_GCM_SHA256 0x030000A6 +#define TLS1_CK_ADH_WITH_AES_256_GCM_SHA384 0x030000A7 + +/* CCM ciphersuites from RFC6655 */ +#define TLS1_CK_RSA_WITH_AES_128_CCM 0x0300C09C +#define TLS1_CK_RSA_WITH_AES_256_CCM 0x0300C09D +#define TLS1_CK_DHE_RSA_WITH_AES_128_CCM 0x0300C09E +#define TLS1_CK_DHE_RSA_WITH_AES_256_CCM 0x0300C09F +#define TLS1_CK_RSA_WITH_AES_128_CCM_8 0x0300C0A0 +#define TLS1_CK_RSA_WITH_AES_256_CCM_8 0x0300C0A1 +#define TLS1_CK_DHE_RSA_WITH_AES_128_CCM_8 0x0300C0A2 +#define TLS1_CK_DHE_RSA_WITH_AES_256_CCM_8 0x0300C0A3 +#define TLS1_CK_PSK_WITH_AES_128_CCM 0x0300C0A4 +#define TLS1_CK_PSK_WITH_AES_256_CCM 0x0300C0A5 +#define TLS1_CK_DHE_PSK_WITH_AES_128_CCM 0x0300C0A6 +#define TLS1_CK_DHE_PSK_WITH_AES_256_CCM 0x0300C0A7 +#define TLS1_CK_PSK_WITH_AES_128_CCM_8 0x0300C0A8 +#define TLS1_CK_PSK_WITH_AES_256_CCM_8 0x0300C0A9 +#define TLS1_CK_DHE_PSK_WITH_AES_128_CCM_8 0x0300C0AA +#define TLS1_CK_DHE_PSK_WITH_AES_256_CCM_8 0x0300C0AB + +/* CCM ciphersuites from RFC7251 */ +#define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CCM 0x0300C0AC +#define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CCM 0x0300C0AD +#define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CCM_8 0x0300C0AE +#define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CCM_8 0x0300C0AF + +/* TLS 1.2 Camellia SHA-256 ciphersuites from RFC5932 */ +#define TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA256 0x030000BA +#define TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256 0x030000BB +#define TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256 0x030000BC +#define TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256 0x030000BD +#define TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 0x030000BE +#define TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA256 0x030000BF + +#define TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA256 0x030000C0 +#define TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256 0x030000C1 +#define TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256 0x030000C2 +#define TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256 0x030000C3 +#define TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 0x030000C4 +#define TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA256 0x030000C5 + +/* ECC ciphersuites from RFC4492 */ +#define TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA 0x0300C001 +#define TLS1_CK_ECDH_ECDSA_WITH_RC4_128_SHA 0x0300C002 +#define TLS1_CK_ECDH_ECDSA_WITH_DES_192_CBC3_SHA 0x0300C003 +#define TLS1_CK_ECDH_ECDSA_WITH_AES_128_CBC_SHA 0x0300C004 +#define TLS1_CK_ECDH_ECDSA_WITH_AES_256_CBC_SHA 0x0300C005 + +#define TLS1_CK_ECDHE_ECDSA_WITH_NULL_SHA 0x0300C006 +#define TLS1_CK_ECDHE_ECDSA_WITH_RC4_128_SHA 0x0300C007 +#define TLS1_CK_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA 0x0300C008 +#define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA 0x0300C009 +#define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA 0x0300C00A + +#define TLS1_CK_ECDH_RSA_WITH_NULL_SHA 0x0300C00B +#define TLS1_CK_ECDH_RSA_WITH_RC4_128_SHA 0x0300C00C +#define TLS1_CK_ECDH_RSA_WITH_DES_192_CBC3_SHA 0x0300C00D +#define TLS1_CK_ECDH_RSA_WITH_AES_128_CBC_SHA 0x0300C00E +#define TLS1_CK_ECDH_RSA_WITH_AES_256_CBC_SHA 0x0300C00F + +#define TLS1_CK_ECDHE_RSA_WITH_NULL_SHA 0x0300C010 +#define TLS1_CK_ECDHE_RSA_WITH_RC4_128_SHA 0x0300C011 +#define TLS1_CK_ECDHE_RSA_WITH_DES_192_CBC3_SHA 0x0300C012 +#define TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA 0x0300C013 +#define TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA 0x0300C014 + +#define TLS1_CK_ECDH_anon_WITH_NULL_SHA 0x0300C015 +#define TLS1_CK_ECDH_anon_WITH_RC4_128_SHA 0x0300C016 +#define TLS1_CK_ECDH_anon_WITH_DES_192_CBC3_SHA 0x0300C017 +#define TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA 0x0300C018 +#define TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA 0x0300C019 + +/* SRP ciphersuites from RFC 5054 */ +#define TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA 0x0300C01A +#define TLS1_CK_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA 0x0300C01B +#define TLS1_CK_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA 0x0300C01C +#define TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA 0x0300C01D +#define TLS1_CK_SRP_SHA_RSA_WITH_AES_128_CBC_SHA 0x0300C01E +#define TLS1_CK_SRP_SHA_DSS_WITH_AES_128_CBC_SHA 0x0300C01F +#define TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA 0x0300C020 +#define TLS1_CK_SRP_SHA_RSA_WITH_AES_256_CBC_SHA 0x0300C021 +#define TLS1_CK_SRP_SHA_DSS_WITH_AES_256_CBC_SHA 0x0300C022 + +/* ECDH HMAC based ciphersuites from RFC5289 */ +#define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256 0x0300C023 +#define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384 0x0300C024 +#define TLS1_CK_ECDH_ECDSA_WITH_AES_128_SHA256 0x0300C025 +#define TLS1_CK_ECDH_ECDSA_WITH_AES_256_SHA384 0x0300C026 +#define TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256 0x0300C027 +#define TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384 0x0300C028 +#define TLS1_CK_ECDH_RSA_WITH_AES_128_SHA256 0x0300C029 +#define TLS1_CK_ECDH_RSA_WITH_AES_256_SHA384 0x0300C02A + +/* ECDH GCM based ciphersuites from RFC5289 */ +#define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 0x0300C02B +#define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 0x0300C02C +#define TLS1_CK_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 0x0300C02D +#define TLS1_CK_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 0x0300C02E +#define TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256 0x0300C02F +#define TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384 0x0300C030 +#define TLS1_CK_ECDH_RSA_WITH_AES_128_GCM_SHA256 0x0300C031 +#define TLS1_CK_ECDH_RSA_WITH_AES_256_GCM_SHA384 0x0300C032 + +/* ECDHE PSK ciphersuites from RFC5489 */ +#define TLS1_CK_ECDHE_PSK_WITH_RC4_128_SHA 0x0300C033 +#define TLS1_CK_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA 0x0300C034 +#define TLS1_CK_ECDHE_PSK_WITH_AES_128_CBC_SHA 0x0300C035 +#define TLS1_CK_ECDHE_PSK_WITH_AES_256_CBC_SHA 0x0300C036 + +#define TLS1_CK_ECDHE_PSK_WITH_AES_128_CBC_SHA256 0x0300C037 +#define TLS1_CK_ECDHE_PSK_WITH_AES_256_CBC_SHA384 0x0300C038 + +/* NULL PSK ciphersuites from RFC4785 */ +#define TLS1_CK_ECDHE_PSK_WITH_NULL_SHA 0x0300C039 +#define TLS1_CK_ECDHE_PSK_WITH_NULL_SHA256 0x0300C03A +#define TLS1_CK_ECDHE_PSK_WITH_NULL_SHA384 0x0300C03B + +/* Camellia-CBC ciphersuites from RFC6367 */ +#define TLS1_CK_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 0x0300C072 +#define TLS1_CK_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 0x0300C073 +#define TLS1_CK_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 0x0300C074 +#define TLS1_CK_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 0x0300C075 +#define TLS1_CK_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 0x0300C076 +#define TLS1_CK_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 0x0300C077 +#define TLS1_CK_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 0x0300C078 +#define TLS1_CK_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 0x0300C079 + +#define TLS1_CK_PSK_WITH_CAMELLIA_128_CBC_SHA256 0x0300C094 +#define TLS1_CK_PSK_WITH_CAMELLIA_256_CBC_SHA384 0x0300C095 +#define TLS1_CK_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 0x0300C096 +#define TLS1_CK_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 0x0300C097 +#define TLS1_CK_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 0x0300C098 +#define TLS1_CK_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 0x0300C099 +#define TLS1_CK_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 0x0300C09A +#define TLS1_CK_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 0x0300C09B + +/* draft-ietf-tls-chacha20-poly1305-03 */ +#define TLS1_CK_ECDHE_RSA_WITH_CHACHA20_POLY1305 0x0300CCA8 +#define TLS1_CK_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 0x0300CCA9 +#define TLS1_CK_DHE_RSA_WITH_CHACHA20_POLY1305 0x0300CCAA +#define TLS1_CK_PSK_WITH_CHACHA20_POLY1305 0x0300CCAB +#define TLS1_CK_ECDHE_PSK_WITH_CHACHA20_POLY1305 0x0300CCAC +#define TLS1_CK_DHE_PSK_WITH_CHACHA20_POLY1305 0x0300CCAD +#define TLS1_CK_RSA_PSK_WITH_CHACHA20_POLY1305 0x0300CCAE + +/* TLS v1.3 ciphersuites */ +#define TLS1_3_CK_AES_128_GCM_SHA256 0x03001301 +#define TLS1_3_CK_AES_256_GCM_SHA384 0x03001302 +#define TLS1_3_CK_CHACHA20_POLY1305_SHA256 0x03001303 +#define TLS1_3_CK_AES_128_CCM_SHA256 0x03001304 +#define TLS1_3_CK_AES_128_CCM_8_SHA256 0x03001305 + +/* Integrity-only ciphersuites from RFC 9150 */ +#define TLS1_3_CK_SHA256_SHA256 0x0300C0B4 +#define TLS1_3_CK_SHA384_SHA384 0x0300C0B5 + +/* Aria ciphersuites from RFC6209 */ +#define TLS1_CK_RSA_WITH_ARIA_128_GCM_SHA256 0x0300C050 +#define TLS1_CK_RSA_WITH_ARIA_256_GCM_SHA384 0x0300C051 +#define TLS1_CK_DHE_RSA_WITH_ARIA_128_GCM_SHA256 0x0300C052 +#define TLS1_CK_DHE_RSA_WITH_ARIA_256_GCM_SHA384 0x0300C053 +#define TLS1_CK_DH_RSA_WITH_ARIA_128_GCM_SHA256 0x0300C054 +#define TLS1_CK_DH_RSA_WITH_ARIA_256_GCM_SHA384 0x0300C055 +#define TLS1_CK_DHE_DSS_WITH_ARIA_128_GCM_SHA256 0x0300C056 +#define TLS1_CK_DHE_DSS_WITH_ARIA_256_GCM_SHA384 0x0300C057 +#define TLS1_CK_DH_DSS_WITH_ARIA_128_GCM_SHA256 0x0300C058 +#define TLS1_CK_DH_DSS_WITH_ARIA_256_GCM_SHA384 0x0300C059 +#define TLS1_CK_DH_anon_WITH_ARIA_128_GCM_SHA256 0x0300C05A +#define TLS1_CK_DH_anon_WITH_ARIA_256_GCM_SHA384 0x0300C05B +#define TLS1_CK_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 0x0300C05C +#define TLS1_CK_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 0x0300C05D +#define TLS1_CK_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256 0x0300C05E +#define TLS1_CK_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384 0x0300C05F +#define TLS1_CK_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256 0x0300C060 +#define TLS1_CK_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384 0x0300C061 +#define TLS1_CK_ECDH_RSA_WITH_ARIA_128_GCM_SHA256 0x0300C062 +#define TLS1_CK_ECDH_RSA_WITH_ARIA_256_GCM_SHA384 0x0300C063 +#define TLS1_CK_PSK_WITH_ARIA_128_GCM_SHA256 0x0300C06A +#define TLS1_CK_PSK_WITH_ARIA_256_GCM_SHA384 0x0300C06B +#define TLS1_CK_DHE_PSK_WITH_ARIA_128_GCM_SHA256 0x0300C06C +#define TLS1_CK_DHE_PSK_WITH_ARIA_256_GCM_SHA384 0x0300C06D +#define TLS1_CK_RSA_PSK_WITH_ARIA_128_GCM_SHA256 0x0300C06E +#define TLS1_CK_RSA_PSK_WITH_ARIA_256_GCM_SHA384 0x0300C06F + +/* a bundle of RFC standard cipher names, generated from ssl3_ciphers[] */ +#define TLS1_RFC_RSA_WITH_AES_128_SHA "TLS_RSA_WITH_AES_128_CBC_SHA" +#define TLS1_RFC_DHE_DSS_WITH_AES_128_SHA "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" +#define TLS1_RFC_DHE_RSA_WITH_AES_128_SHA "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" +#define TLS1_RFC_ADH_WITH_AES_128_SHA "TLS_DH_anon_WITH_AES_128_CBC_SHA" +#define TLS1_RFC_RSA_WITH_AES_256_SHA "TLS_RSA_WITH_AES_256_CBC_SHA" +#define TLS1_RFC_DHE_DSS_WITH_AES_256_SHA "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" +#define TLS1_RFC_DHE_RSA_WITH_AES_256_SHA "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" +#define TLS1_RFC_ADH_WITH_AES_256_SHA "TLS_DH_anon_WITH_AES_256_CBC_SHA" +#define TLS1_RFC_RSA_WITH_NULL_SHA256 "TLS_RSA_WITH_NULL_SHA256" +#define TLS1_RFC_RSA_WITH_AES_128_SHA256 "TLS_RSA_WITH_AES_128_CBC_SHA256" +#define TLS1_RFC_RSA_WITH_AES_256_SHA256 "TLS_RSA_WITH_AES_256_CBC_SHA256" +#define TLS1_RFC_DHE_DSS_WITH_AES_128_SHA256 "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" +#define TLS1_RFC_DHE_RSA_WITH_AES_128_SHA256 "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256" +#define TLS1_RFC_DHE_DSS_WITH_AES_256_SHA256 "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" +#define TLS1_RFC_DHE_RSA_WITH_AES_256_SHA256 "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256" +#define TLS1_RFC_ADH_WITH_AES_128_SHA256 "TLS_DH_anon_WITH_AES_128_CBC_SHA256" +#define TLS1_RFC_ADH_WITH_AES_256_SHA256 "TLS_DH_anon_WITH_AES_256_CBC_SHA256" +#define TLS1_RFC_RSA_WITH_AES_128_GCM_SHA256 "TLS_RSA_WITH_AES_128_GCM_SHA256" +#define TLS1_RFC_RSA_WITH_AES_256_GCM_SHA384 "TLS_RSA_WITH_AES_256_GCM_SHA384" +#define TLS1_RFC_DHE_RSA_WITH_AES_128_GCM_SHA256 "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" +#define TLS1_RFC_DHE_RSA_WITH_AES_256_GCM_SHA384 "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" +#define TLS1_RFC_DHE_DSS_WITH_AES_128_GCM_SHA256 "TLS_DHE_DSS_WITH_AES_128_GCM_SHA256" +#define TLS1_RFC_DHE_DSS_WITH_AES_256_GCM_SHA384 "TLS_DHE_DSS_WITH_AES_256_GCM_SHA384" +#define TLS1_RFC_ADH_WITH_AES_128_GCM_SHA256 "TLS_DH_anon_WITH_AES_128_GCM_SHA256" +#define TLS1_RFC_ADH_WITH_AES_256_GCM_SHA384 "TLS_DH_anon_WITH_AES_256_GCM_SHA384" +#define TLS1_RFC_RSA_WITH_AES_128_CCM "TLS_RSA_WITH_AES_128_CCM" +#define TLS1_RFC_RSA_WITH_AES_256_CCM "TLS_RSA_WITH_AES_256_CCM" +#define TLS1_RFC_DHE_RSA_WITH_AES_128_CCM "TLS_DHE_RSA_WITH_AES_128_CCM" +#define TLS1_RFC_DHE_RSA_WITH_AES_256_CCM "TLS_DHE_RSA_WITH_AES_256_CCM" +#define TLS1_RFC_RSA_WITH_AES_128_CCM_8 "TLS_RSA_WITH_AES_128_CCM_8" +#define TLS1_RFC_RSA_WITH_AES_256_CCM_8 "TLS_RSA_WITH_AES_256_CCM_8" +#define TLS1_RFC_DHE_RSA_WITH_AES_128_CCM_8 "TLS_DHE_RSA_WITH_AES_128_CCM_8" +#define TLS1_RFC_DHE_RSA_WITH_AES_256_CCM_8 "TLS_DHE_RSA_WITH_AES_256_CCM_8" +#define TLS1_RFC_PSK_WITH_AES_128_CCM "TLS_PSK_WITH_AES_128_CCM" +#define TLS1_RFC_PSK_WITH_AES_256_CCM "TLS_PSK_WITH_AES_256_CCM" +#define TLS1_RFC_DHE_PSK_WITH_AES_128_CCM "TLS_DHE_PSK_WITH_AES_128_CCM" +#define TLS1_RFC_DHE_PSK_WITH_AES_256_CCM "TLS_DHE_PSK_WITH_AES_256_CCM" +#define TLS1_RFC_PSK_WITH_AES_128_CCM_8 "TLS_PSK_WITH_AES_128_CCM_8" +#define TLS1_RFC_PSK_WITH_AES_256_CCM_8 "TLS_PSK_WITH_AES_256_CCM_8" +#define TLS1_RFC_DHE_PSK_WITH_AES_128_CCM_8 "TLS_PSK_DHE_WITH_AES_128_CCM_8" +#define TLS1_RFC_DHE_PSK_WITH_AES_256_CCM_8 "TLS_PSK_DHE_WITH_AES_256_CCM_8" +#define TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_CCM "TLS_ECDHE_ECDSA_WITH_AES_128_CCM" +#define TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_CCM "TLS_ECDHE_ECDSA_WITH_AES_256_CCM" +#define TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_CCM_8 "TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8" +#define TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_CCM_8 "TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8" +#define TLS1_3_RFC_AES_128_GCM_SHA256 "TLS_AES_128_GCM_SHA256" +#define TLS1_3_RFC_AES_256_GCM_SHA384 "TLS_AES_256_GCM_SHA384" +#define TLS1_3_RFC_CHACHA20_POLY1305_SHA256 "TLS_CHACHA20_POLY1305_SHA256" +#define TLS1_3_RFC_SHA256_SHA256 "TLS_SHA256_SHA256" +#define TLS1_3_RFC_SHA384_SHA384 "TLS_SHA384_SHA384" +#define TLS1_3_RFC_AES_128_CCM_SHA256 "TLS_AES_128_CCM_SHA256" +#define TLS1_3_RFC_AES_128_CCM_8_SHA256 "TLS_AES_128_CCM_8_SHA256" +#define TLS1_RFC_ECDHE_ECDSA_WITH_NULL_SHA "TLS_ECDHE_ECDSA_WITH_NULL_SHA" +#define TLS1_RFC_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA" +#define TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_CBC_SHA "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" +#define TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_CBC_SHA "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" +#define TLS1_RFC_ECDHE_RSA_WITH_NULL_SHA "TLS_ECDHE_RSA_WITH_NULL_SHA" +#define TLS1_RFC_ECDHE_RSA_WITH_DES_192_CBC3_SHA "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA" +#define TLS1_RFC_ECDHE_RSA_WITH_AES_128_CBC_SHA "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" +#define TLS1_RFC_ECDHE_RSA_WITH_AES_256_CBC_SHA "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" +#define TLS1_RFC_ECDH_anon_WITH_NULL_SHA "TLS_ECDH_anon_WITH_NULL_SHA" +#define TLS1_RFC_ECDH_anon_WITH_DES_192_CBC3_SHA "TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA" +#define TLS1_RFC_ECDH_anon_WITH_AES_128_CBC_SHA "TLS_ECDH_anon_WITH_AES_128_CBC_SHA" +#define TLS1_RFC_ECDH_anon_WITH_AES_256_CBC_SHA "TLS_ECDH_anon_WITH_AES_256_CBC_SHA" +#define TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_SHA256 "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" +#define TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_SHA384 "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" +#define TLS1_RFC_ECDHE_RSA_WITH_AES_128_SHA256 "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" +#define TLS1_RFC_ECDHE_RSA_WITH_AES_256_SHA384 "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" +#define TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" +#define TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" +#define TLS1_RFC_ECDHE_RSA_WITH_AES_128_GCM_SHA256 "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" +#define TLS1_RFC_ECDHE_RSA_WITH_AES_256_GCM_SHA384 "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" +#define TLS1_RFC_PSK_WITH_NULL_SHA "TLS_PSK_WITH_NULL_SHA" +#define TLS1_RFC_DHE_PSK_WITH_NULL_SHA "TLS_DHE_PSK_WITH_NULL_SHA" +#define TLS1_RFC_RSA_PSK_WITH_NULL_SHA "TLS_RSA_PSK_WITH_NULL_SHA" +#define TLS1_RFC_PSK_WITH_3DES_EDE_CBC_SHA "TLS_PSK_WITH_3DES_EDE_CBC_SHA" +#define TLS1_RFC_PSK_WITH_AES_128_CBC_SHA "TLS_PSK_WITH_AES_128_CBC_SHA" +#define TLS1_RFC_PSK_WITH_AES_256_CBC_SHA "TLS_PSK_WITH_AES_256_CBC_SHA" +#define TLS1_RFC_DHE_PSK_WITH_3DES_EDE_CBC_SHA "TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA" +#define TLS1_RFC_DHE_PSK_WITH_AES_128_CBC_SHA "TLS_DHE_PSK_WITH_AES_128_CBC_SHA" +#define TLS1_RFC_DHE_PSK_WITH_AES_256_CBC_SHA "TLS_DHE_PSK_WITH_AES_256_CBC_SHA" +#define TLS1_RFC_RSA_PSK_WITH_3DES_EDE_CBC_SHA "TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA" +#define TLS1_RFC_RSA_PSK_WITH_AES_128_CBC_SHA "TLS_RSA_PSK_WITH_AES_128_CBC_SHA" +#define TLS1_RFC_RSA_PSK_WITH_AES_256_CBC_SHA "TLS_RSA_PSK_WITH_AES_256_CBC_SHA" +#define TLS1_RFC_PSK_WITH_AES_128_GCM_SHA256 "TLS_PSK_WITH_AES_128_GCM_SHA256" +#define TLS1_RFC_PSK_WITH_AES_256_GCM_SHA384 "TLS_PSK_WITH_AES_256_GCM_SHA384" +#define TLS1_RFC_DHE_PSK_WITH_AES_128_GCM_SHA256 "TLS_DHE_PSK_WITH_AES_128_GCM_SHA256" +#define TLS1_RFC_DHE_PSK_WITH_AES_256_GCM_SHA384 "TLS_DHE_PSK_WITH_AES_256_GCM_SHA384" +#define TLS1_RFC_RSA_PSK_WITH_AES_128_GCM_SHA256 "TLS_RSA_PSK_WITH_AES_128_GCM_SHA256" +#define TLS1_RFC_RSA_PSK_WITH_AES_256_GCM_SHA384 "TLS_RSA_PSK_WITH_AES_256_GCM_SHA384" +#define TLS1_RFC_PSK_WITH_AES_128_CBC_SHA256 "TLS_PSK_WITH_AES_128_CBC_SHA256" +#define TLS1_RFC_PSK_WITH_AES_256_CBC_SHA384 "TLS_PSK_WITH_AES_256_CBC_SHA384" +#define TLS1_RFC_PSK_WITH_NULL_SHA256 "TLS_PSK_WITH_NULL_SHA256" +#define TLS1_RFC_PSK_WITH_NULL_SHA384 "TLS_PSK_WITH_NULL_SHA384" +#define TLS1_RFC_DHE_PSK_WITH_AES_128_CBC_SHA256 "TLS_DHE_PSK_WITH_AES_128_CBC_SHA256" +#define TLS1_RFC_DHE_PSK_WITH_AES_256_CBC_SHA384 "TLS_DHE_PSK_WITH_AES_256_CBC_SHA384" +#define TLS1_RFC_DHE_PSK_WITH_NULL_SHA256 "TLS_DHE_PSK_WITH_NULL_SHA256" +#define TLS1_RFC_DHE_PSK_WITH_NULL_SHA384 "TLS_DHE_PSK_WITH_NULL_SHA384" +#define TLS1_RFC_RSA_PSK_WITH_AES_128_CBC_SHA256 "TLS_RSA_PSK_WITH_AES_128_CBC_SHA256" +#define TLS1_RFC_RSA_PSK_WITH_AES_256_CBC_SHA384 "TLS_RSA_PSK_WITH_AES_256_CBC_SHA384" +#define TLS1_RFC_RSA_PSK_WITH_NULL_SHA256 "TLS_RSA_PSK_WITH_NULL_SHA256" +#define TLS1_RFC_RSA_PSK_WITH_NULL_SHA384 "TLS_RSA_PSK_WITH_NULL_SHA384" +#define TLS1_RFC_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA "TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA" +#define TLS1_RFC_ECDHE_PSK_WITH_AES_128_CBC_SHA "TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA" +#define TLS1_RFC_ECDHE_PSK_WITH_AES_256_CBC_SHA "TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA" +#define TLS1_RFC_ECDHE_PSK_WITH_AES_128_CBC_SHA256 "TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256" +#define TLS1_RFC_ECDHE_PSK_WITH_AES_256_CBC_SHA384 "TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384" +#define TLS1_RFC_ECDHE_PSK_WITH_NULL_SHA "TLS_ECDHE_PSK_WITH_NULL_SHA" +#define TLS1_RFC_ECDHE_PSK_WITH_NULL_SHA256 "TLS_ECDHE_PSK_WITH_NULL_SHA256" +#define TLS1_RFC_ECDHE_PSK_WITH_NULL_SHA384 "TLS_ECDHE_PSK_WITH_NULL_SHA384" +#define TLS1_RFC_SRP_SHA_WITH_3DES_EDE_CBC_SHA "TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA" +#define TLS1_RFC_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA "TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA" +#define TLS1_RFC_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA "TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA" +#define TLS1_RFC_SRP_SHA_WITH_AES_128_CBC_SHA "TLS_SRP_SHA_WITH_AES_128_CBC_SHA" +#define TLS1_RFC_SRP_SHA_RSA_WITH_AES_128_CBC_SHA "TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA" +#define TLS1_RFC_SRP_SHA_DSS_WITH_AES_128_CBC_SHA "TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA" +#define TLS1_RFC_SRP_SHA_WITH_AES_256_CBC_SHA "TLS_SRP_SHA_WITH_AES_256_CBC_SHA" +#define TLS1_RFC_SRP_SHA_RSA_WITH_AES_256_CBC_SHA "TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA" +#define TLS1_RFC_SRP_SHA_DSS_WITH_AES_256_CBC_SHA "TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA" +#define TLS1_RFC_DHE_RSA_WITH_CHACHA20_POLY1305 "TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256" +#define TLS1_RFC_ECDHE_RSA_WITH_CHACHA20_POLY1305 "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256" +#define TLS1_RFC_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256" +#define TLS1_RFC_PSK_WITH_CHACHA20_POLY1305 "TLS_PSK_WITH_CHACHA20_POLY1305_SHA256" +#define TLS1_RFC_ECDHE_PSK_WITH_CHACHA20_POLY1305 "TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256" +#define TLS1_RFC_DHE_PSK_WITH_CHACHA20_POLY1305 "TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256" +#define TLS1_RFC_RSA_PSK_WITH_CHACHA20_POLY1305 "TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256" +#define TLS1_RFC_RSA_WITH_CAMELLIA_128_CBC_SHA256 "TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256" +#define TLS1_RFC_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256 "TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256" +#define TLS1_RFC_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 "TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256" +#define TLS1_RFC_ADH_WITH_CAMELLIA_128_CBC_SHA256 "TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256" +#define TLS1_RFC_RSA_WITH_CAMELLIA_256_CBC_SHA256 "TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256" +#define TLS1_RFC_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256 "TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256" +#define TLS1_RFC_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 "TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256" +#define TLS1_RFC_ADH_WITH_CAMELLIA_256_CBC_SHA256 "TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256" +#define TLS1_RFC_RSA_WITH_CAMELLIA_256_CBC_SHA "TLS_RSA_WITH_CAMELLIA_256_CBC_SHA" +#define TLS1_RFC_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA "TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA" +#define TLS1_RFC_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA "TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA" +#define TLS1_RFC_ADH_WITH_CAMELLIA_256_CBC_SHA "TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA" +#define TLS1_RFC_RSA_WITH_CAMELLIA_128_CBC_SHA "TLS_RSA_WITH_CAMELLIA_128_CBC_SHA" +#define TLS1_RFC_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA "TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA" +#define TLS1_RFC_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA "TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA" +#define TLS1_RFC_ADH_WITH_CAMELLIA_128_CBC_SHA "TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA" +#define TLS1_RFC_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 "TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256" +#define TLS1_RFC_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 "TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384" +#define TLS1_RFC_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 "TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256" +#define TLS1_RFC_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 "TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384" +#define TLS1_RFC_PSK_WITH_CAMELLIA_128_CBC_SHA256 "TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256" +#define TLS1_RFC_PSK_WITH_CAMELLIA_256_CBC_SHA384 "TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384" +#define TLS1_RFC_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 "TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256" +#define TLS1_RFC_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 "TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384" +#define TLS1_RFC_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 "TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256" +#define TLS1_RFC_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 "TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384" +#define TLS1_RFC_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 "TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256" +#define TLS1_RFC_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 "TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384" +#define TLS1_RFC_RSA_WITH_SEED_SHA "TLS_RSA_WITH_SEED_CBC_SHA" +#define TLS1_RFC_DHE_DSS_WITH_SEED_SHA "TLS_DHE_DSS_WITH_SEED_CBC_SHA" +#define TLS1_RFC_DHE_RSA_WITH_SEED_SHA "TLS_DHE_RSA_WITH_SEED_CBC_SHA" +#define TLS1_RFC_ADH_WITH_SEED_SHA "TLS_DH_anon_WITH_SEED_CBC_SHA" +#define TLS1_RFC_ECDHE_PSK_WITH_RC4_128_SHA "TLS_ECDHE_PSK_WITH_RC4_128_SHA" +#define TLS1_RFC_ECDH_anon_WITH_RC4_128_SHA "TLS_ECDH_anon_WITH_RC4_128_SHA" +#define TLS1_RFC_ECDHE_ECDSA_WITH_RC4_128_SHA "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA" +#define TLS1_RFC_ECDHE_RSA_WITH_RC4_128_SHA "TLS_ECDHE_RSA_WITH_RC4_128_SHA" +#define TLS1_RFC_PSK_WITH_RC4_128_SHA "TLS_PSK_WITH_RC4_128_SHA" +#define TLS1_RFC_RSA_PSK_WITH_RC4_128_SHA "TLS_RSA_PSK_WITH_RC4_128_SHA" +#define TLS1_RFC_DHE_PSK_WITH_RC4_128_SHA "TLS_DHE_PSK_WITH_RC4_128_SHA" +#define TLS1_RFC_RSA_WITH_ARIA_128_GCM_SHA256 "TLS_RSA_WITH_ARIA_128_GCM_SHA256" +#define TLS1_RFC_RSA_WITH_ARIA_256_GCM_SHA384 "TLS_RSA_WITH_ARIA_256_GCM_SHA384" +#define TLS1_RFC_DHE_RSA_WITH_ARIA_128_GCM_SHA256 "TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256" +#define TLS1_RFC_DHE_RSA_WITH_ARIA_256_GCM_SHA384 "TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384" +#define TLS1_RFC_DH_RSA_WITH_ARIA_128_GCM_SHA256 "TLS_DH_RSA_WITH_ARIA_128_GCM_SHA256" +#define TLS1_RFC_DH_RSA_WITH_ARIA_256_GCM_SHA384 "TLS_DH_RSA_WITH_ARIA_256_GCM_SHA384" +#define TLS1_RFC_DHE_DSS_WITH_ARIA_128_GCM_SHA256 "TLS_DHE_DSS_WITH_ARIA_128_GCM_SHA256" +#define TLS1_RFC_DHE_DSS_WITH_ARIA_256_GCM_SHA384 "TLS_DHE_DSS_WITH_ARIA_256_GCM_SHA384" +#define TLS1_RFC_DH_DSS_WITH_ARIA_128_GCM_SHA256 "TLS_DH_DSS_WITH_ARIA_128_GCM_SHA256" +#define TLS1_RFC_DH_DSS_WITH_ARIA_256_GCM_SHA384 "TLS_DH_DSS_WITH_ARIA_256_GCM_SHA384" +#define TLS1_RFC_DH_anon_WITH_ARIA_128_GCM_SHA256 "TLS_DH_anon_WITH_ARIA_128_GCM_SHA256" +#define TLS1_RFC_DH_anon_WITH_ARIA_256_GCM_SHA384 "TLS_DH_anon_WITH_ARIA_256_GCM_SHA384" +#define TLS1_RFC_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 "TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256" +#define TLS1_RFC_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 "TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384" +#define TLS1_RFC_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256 "TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256" +#define TLS1_RFC_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384 "TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384" +#define TLS1_RFC_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256 "TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256" +#define TLS1_RFC_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384 "TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384" +#define TLS1_RFC_ECDH_RSA_WITH_ARIA_128_GCM_SHA256 "TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256" +#define TLS1_RFC_ECDH_RSA_WITH_ARIA_256_GCM_SHA384 "TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384" +#define TLS1_RFC_PSK_WITH_ARIA_128_GCM_SHA256 "TLS_PSK_WITH_ARIA_128_GCM_SHA256" +#define TLS1_RFC_PSK_WITH_ARIA_256_GCM_SHA384 "TLS_PSK_WITH_ARIA_256_GCM_SHA384" +#define TLS1_RFC_DHE_PSK_WITH_ARIA_128_GCM_SHA256 "TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256" +#define TLS1_RFC_DHE_PSK_WITH_ARIA_256_GCM_SHA384 "TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384" +#define TLS1_RFC_RSA_PSK_WITH_ARIA_128_GCM_SHA256 "TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256" +#define TLS1_RFC_RSA_PSK_WITH_ARIA_256_GCM_SHA384 "TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384" + +/* + * XXX Backward compatibility alert: Older versions of OpenSSL gave some DHE + * ciphers names with "EDH" instead of "DHE". Going forward, we should be + * using DHE everywhere, though we may indefinitely maintain aliases for + * users or configurations that used "EDH" + */ +#define TLS1_TXT_DHE_DSS_WITH_RC4_128_SHA "DHE-DSS-RC4-SHA" + +#define TLS1_TXT_PSK_WITH_NULL_SHA "PSK-NULL-SHA" +#define TLS1_TXT_DHE_PSK_WITH_NULL_SHA "DHE-PSK-NULL-SHA" +#define TLS1_TXT_RSA_PSK_WITH_NULL_SHA "RSA-PSK-NULL-SHA" + +/* AES ciphersuites from RFC3268 */ +#define TLS1_TXT_RSA_WITH_AES_128_SHA "AES128-SHA" +#define TLS1_TXT_DH_DSS_WITH_AES_128_SHA "DH-DSS-AES128-SHA" +#define TLS1_TXT_DH_RSA_WITH_AES_128_SHA "DH-RSA-AES128-SHA" +#define TLS1_TXT_DHE_DSS_WITH_AES_128_SHA "DHE-DSS-AES128-SHA" +#define TLS1_TXT_DHE_RSA_WITH_AES_128_SHA "DHE-RSA-AES128-SHA" +#define TLS1_TXT_ADH_WITH_AES_128_SHA "ADH-AES128-SHA" + +#define TLS1_TXT_RSA_WITH_AES_256_SHA "AES256-SHA" +#define TLS1_TXT_DH_DSS_WITH_AES_256_SHA "DH-DSS-AES256-SHA" +#define TLS1_TXT_DH_RSA_WITH_AES_256_SHA "DH-RSA-AES256-SHA" +#define TLS1_TXT_DHE_DSS_WITH_AES_256_SHA "DHE-DSS-AES256-SHA" +#define TLS1_TXT_DHE_RSA_WITH_AES_256_SHA "DHE-RSA-AES256-SHA" +#define TLS1_TXT_ADH_WITH_AES_256_SHA "ADH-AES256-SHA" + +/* ECC ciphersuites from RFC4492 */ +#define TLS1_TXT_ECDH_ECDSA_WITH_NULL_SHA "ECDH-ECDSA-NULL-SHA" +#define TLS1_TXT_ECDH_ECDSA_WITH_RC4_128_SHA "ECDH-ECDSA-RC4-SHA" +#define TLS1_TXT_ECDH_ECDSA_WITH_DES_192_CBC3_SHA "ECDH-ECDSA-DES-CBC3-SHA" +#define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_CBC_SHA "ECDH-ECDSA-AES128-SHA" +#define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_CBC_SHA "ECDH-ECDSA-AES256-SHA" + +#define TLS1_TXT_ECDHE_ECDSA_WITH_NULL_SHA "ECDHE-ECDSA-NULL-SHA" +#define TLS1_TXT_ECDHE_ECDSA_WITH_RC4_128_SHA "ECDHE-ECDSA-RC4-SHA" +#define TLS1_TXT_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA "ECDHE-ECDSA-DES-CBC3-SHA" +#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CBC_SHA "ECDHE-ECDSA-AES128-SHA" +#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CBC_SHA "ECDHE-ECDSA-AES256-SHA" + +#define TLS1_TXT_ECDH_RSA_WITH_NULL_SHA "ECDH-RSA-NULL-SHA" +#define TLS1_TXT_ECDH_RSA_WITH_RC4_128_SHA "ECDH-RSA-RC4-SHA" +#define TLS1_TXT_ECDH_RSA_WITH_DES_192_CBC3_SHA "ECDH-RSA-DES-CBC3-SHA" +#define TLS1_TXT_ECDH_RSA_WITH_AES_128_CBC_SHA "ECDH-RSA-AES128-SHA" +#define TLS1_TXT_ECDH_RSA_WITH_AES_256_CBC_SHA "ECDH-RSA-AES256-SHA" + +#define TLS1_TXT_ECDHE_RSA_WITH_NULL_SHA "ECDHE-RSA-NULL-SHA" +#define TLS1_TXT_ECDHE_RSA_WITH_RC4_128_SHA "ECDHE-RSA-RC4-SHA" +#define TLS1_TXT_ECDHE_RSA_WITH_DES_192_CBC3_SHA "ECDHE-RSA-DES-CBC3-SHA" +#define TLS1_TXT_ECDHE_RSA_WITH_AES_128_CBC_SHA "ECDHE-RSA-AES128-SHA" +#define TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA "ECDHE-RSA-AES256-SHA" + +#define TLS1_TXT_ECDH_anon_WITH_NULL_SHA "AECDH-NULL-SHA" +#define TLS1_TXT_ECDH_anon_WITH_RC4_128_SHA "AECDH-RC4-SHA" +#define TLS1_TXT_ECDH_anon_WITH_DES_192_CBC3_SHA "AECDH-DES-CBC3-SHA" +#define TLS1_TXT_ECDH_anon_WITH_AES_128_CBC_SHA "AECDH-AES128-SHA" +#define TLS1_TXT_ECDH_anon_WITH_AES_256_CBC_SHA "AECDH-AES256-SHA" + +/* PSK ciphersuites from RFC 4279 */ +#define TLS1_TXT_PSK_WITH_RC4_128_SHA "PSK-RC4-SHA" +#define TLS1_TXT_PSK_WITH_3DES_EDE_CBC_SHA "PSK-3DES-EDE-CBC-SHA" +#define TLS1_TXT_PSK_WITH_AES_128_CBC_SHA "PSK-AES128-CBC-SHA" +#define TLS1_TXT_PSK_WITH_AES_256_CBC_SHA "PSK-AES256-CBC-SHA" + +#define TLS1_TXT_DHE_PSK_WITH_RC4_128_SHA "DHE-PSK-RC4-SHA" +#define TLS1_TXT_DHE_PSK_WITH_3DES_EDE_CBC_SHA "DHE-PSK-3DES-EDE-CBC-SHA" +#define TLS1_TXT_DHE_PSK_WITH_AES_128_CBC_SHA "DHE-PSK-AES128-CBC-SHA" +#define TLS1_TXT_DHE_PSK_WITH_AES_256_CBC_SHA "DHE-PSK-AES256-CBC-SHA" +#define TLS1_TXT_RSA_PSK_WITH_RC4_128_SHA "RSA-PSK-RC4-SHA" +#define TLS1_TXT_RSA_PSK_WITH_3DES_EDE_CBC_SHA "RSA-PSK-3DES-EDE-CBC-SHA" +#define TLS1_TXT_RSA_PSK_WITH_AES_128_CBC_SHA "RSA-PSK-AES128-CBC-SHA" +#define TLS1_TXT_RSA_PSK_WITH_AES_256_CBC_SHA "RSA-PSK-AES256-CBC-SHA" + +/* PSK ciphersuites from RFC 5487 */ +#define TLS1_TXT_PSK_WITH_AES_128_GCM_SHA256 "PSK-AES128-GCM-SHA256" +#define TLS1_TXT_PSK_WITH_AES_256_GCM_SHA384 "PSK-AES256-GCM-SHA384" +#define TLS1_TXT_DHE_PSK_WITH_AES_128_GCM_SHA256 "DHE-PSK-AES128-GCM-SHA256" +#define TLS1_TXT_DHE_PSK_WITH_AES_256_GCM_SHA384 "DHE-PSK-AES256-GCM-SHA384" +#define TLS1_TXT_RSA_PSK_WITH_AES_128_GCM_SHA256 "RSA-PSK-AES128-GCM-SHA256" +#define TLS1_TXT_RSA_PSK_WITH_AES_256_GCM_SHA384 "RSA-PSK-AES256-GCM-SHA384" + +#define TLS1_TXT_PSK_WITH_AES_128_CBC_SHA256 "PSK-AES128-CBC-SHA256" +#define TLS1_TXT_PSK_WITH_AES_256_CBC_SHA384 "PSK-AES256-CBC-SHA384" +#define TLS1_TXT_PSK_WITH_NULL_SHA256 "PSK-NULL-SHA256" +#define TLS1_TXT_PSK_WITH_NULL_SHA384 "PSK-NULL-SHA384" + +#define TLS1_TXT_DHE_PSK_WITH_AES_128_CBC_SHA256 "DHE-PSK-AES128-CBC-SHA256" +#define TLS1_TXT_DHE_PSK_WITH_AES_256_CBC_SHA384 "DHE-PSK-AES256-CBC-SHA384" +#define TLS1_TXT_DHE_PSK_WITH_NULL_SHA256 "DHE-PSK-NULL-SHA256" +#define TLS1_TXT_DHE_PSK_WITH_NULL_SHA384 "DHE-PSK-NULL-SHA384" + +#define TLS1_TXT_RSA_PSK_WITH_AES_128_CBC_SHA256 "RSA-PSK-AES128-CBC-SHA256" +#define TLS1_TXT_RSA_PSK_WITH_AES_256_CBC_SHA384 "RSA-PSK-AES256-CBC-SHA384" +#define TLS1_TXT_RSA_PSK_WITH_NULL_SHA256 "RSA-PSK-NULL-SHA256" +#define TLS1_TXT_RSA_PSK_WITH_NULL_SHA384 "RSA-PSK-NULL-SHA384" + +/* SRP ciphersuite from RFC 5054 */ +#define TLS1_TXT_SRP_SHA_WITH_3DES_EDE_CBC_SHA "SRP-3DES-EDE-CBC-SHA" +#define TLS1_TXT_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA "SRP-RSA-3DES-EDE-CBC-SHA" +#define TLS1_TXT_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA "SRP-DSS-3DES-EDE-CBC-SHA" +#define TLS1_TXT_SRP_SHA_WITH_AES_128_CBC_SHA "SRP-AES-128-CBC-SHA" +#define TLS1_TXT_SRP_SHA_RSA_WITH_AES_128_CBC_SHA "SRP-RSA-AES-128-CBC-SHA" +#define TLS1_TXT_SRP_SHA_DSS_WITH_AES_128_CBC_SHA "SRP-DSS-AES-128-CBC-SHA" +#define TLS1_TXT_SRP_SHA_WITH_AES_256_CBC_SHA "SRP-AES-256-CBC-SHA" +#define TLS1_TXT_SRP_SHA_RSA_WITH_AES_256_CBC_SHA "SRP-RSA-AES-256-CBC-SHA" +#define TLS1_TXT_SRP_SHA_DSS_WITH_AES_256_CBC_SHA "SRP-DSS-AES-256-CBC-SHA" + +/* Camellia ciphersuites from RFC4132 */ +#define TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA "CAMELLIA128-SHA" +#define TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA "DH-DSS-CAMELLIA128-SHA" +#define TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA "DH-RSA-CAMELLIA128-SHA" +#define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA "DHE-DSS-CAMELLIA128-SHA" +#define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA "DHE-RSA-CAMELLIA128-SHA" +#define TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA "ADH-CAMELLIA128-SHA" + +#define TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA "CAMELLIA256-SHA" +#define TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA "DH-DSS-CAMELLIA256-SHA" +#define TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA "DH-RSA-CAMELLIA256-SHA" +#define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA "DHE-DSS-CAMELLIA256-SHA" +#define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA "DHE-RSA-CAMELLIA256-SHA" +#define TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA "ADH-CAMELLIA256-SHA" + +/* TLS 1.2 Camellia SHA-256 ciphersuites from RFC5932 */ +#define TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA256 "CAMELLIA128-SHA256" +#define TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256 "DH-DSS-CAMELLIA128-SHA256" +#define TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256 "DH-RSA-CAMELLIA128-SHA256" +#define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256 "DHE-DSS-CAMELLIA128-SHA256" +#define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 "DHE-RSA-CAMELLIA128-SHA256" +#define TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA256 "ADH-CAMELLIA128-SHA256" + +#define TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA256 "CAMELLIA256-SHA256" +#define TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256 "DH-DSS-CAMELLIA256-SHA256" +#define TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256 "DH-RSA-CAMELLIA256-SHA256" +#define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256 "DHE-DSS-CAMELLIA256-SHA256" +#define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 "DHE-RSA-CAMELLIA256-SHA256" +#define TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA256 "ADH-CAMELLIA256-SHA256" + +#define TLS1_TXT_PSK_WITH_CAMELLIA_128_CBC_SHA256 "PSK-CAMELLIA128-SHA256" +#define TLS1_TXT_PSK_WITH_CAMELLIA_256_CBC_SHA384 "PSK-CAMELLIA256-SHA384" +#define TLS1_TXT_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 "DHE-PSK-CAMELLIA128-SHA256" +#define TLS1_TXT_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 "DHE-PSK-CAMELLIA256-SHA384" +#define TLS1_TXT_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 "RSA-PSK-CAMELLIA128-SHA256" +#define TLS1_TXT_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 "RSA-PSK-CAMELLIA256-SHA384" +#define TLS1_TXT_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 "ECDHE-PSK-CAMELLIA128-SHA256" +#define TLS1_TXT_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 "ECDHE-PSK-CAMELLIA256-SHA384" + +/* SEED ciphersuites from RFC4162 */ +#define TLS1_TXT_RSA_WITH_SEED_SHA "SEED-SHA" +#define TLS1_TXT_DH_DSS_WITH_SEED_SHA "DH-DSS-SEED-SHA" +#define TLS1_TXT_DH_RSA_WITH_SEED_SHA "DH-RSA-SEED-SHA" +#define TLS1_TXT_DHE_DSS_WITH_SEED_SHA "DHE-DSS-SEED-SHA" +#define TLS1_TXT_DHE_RSA_WITH_SEED_SHA "DHE-RSA-SEED-SHA" +#define TLS1_TXT_ADH_WITH_SEED_SHA "ADH-SEED-SHA" + +/* TLS v1.2 ciphersuites */ +#define TLS1_TXT_RSA_WITH_NULL_SHA256 "NULL-SHA256" +#define TLS1_TXT_RSA_WITH_AES_128_SHA256 "AES128-SHA256" +#define TLS1_TXT_RSA_WITH_AES_256_SHA256 "AES256-SHA256" +#define TLS1_TXT_DH_DSS_WITH_AES_128_SHA256 "DH-DSS-AES128-SHA256" +#define TLS1_TXT_DH_RSA_WITH_AES_128_SHA256 "DH-RSA-AES128-SHA256" +#define TLS1_TXT_DHE_DSS_WITH_AES_128_SHA256 "DHE-DSS-AES128-SHA256" +#define TLS1_TXT_DHE_RSA_WITH_AES_128_SHA256 "DHE-RSA-AES128-SHA256" +#define TLS1_TXT_DH_DSS_WITH_AES_256_SHA256 "DH-DSS-AES256-SHA256" +#define TLS1_TXT_DH_RSA_WITH_AES_256_SHA256 "DH-RSA-AES256-SHA256" +#define TLS1_TXT_DHE_DSS_WITH_AES_256_SHA256 "DHE-DSS-AES256-SHA256" +#define TLS1_TXT_DHE_RSA_WITH_AES_256_SHA256 "DHE-RSA-AES256-SHA256" +#define TLS1_TXT_ADH_WITH_AES_128_SHA256 "ADH-AES128-SHA256" +#define TLS1_TXT_ADH_WITH_AES_256_SHA256 "ADH-AES256-SHA256" + +/* TLS v1.2 GCM ciphersuites from RFC5288 */ +#define TLS1_TXT_RSA_WITH_AES_128_GCM_SHA256 "AES128-GCM-SHA256" +#define TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384 "AES256-GCM-SHA384" +#define TLS1_TXT_DHE_RSA_WITH_AES_128_GCM_SHA256 "DHE-RSA-AES128-GCM-SHA256" +#define TLS1_TXT_DHE_RSA_WITH_AES_256_GCM_SHA384 "DHE-RSA-AES256-GCM-SHA384" +#define TLS1_TXT_DH_RSA_WITH_AES_128_GCM_SHA256 "DH-RSA-AES128-GCM-SHA256" +#define TLS1_TXT_DH_RSA_WITH_AES_256_GCM_SHA384 "DH-RSA-AES256-GCM-SHA384" +#define TLS1_TXT_DHE_DSS_WITH_AES_128_GCM_SHA256 "DHE-DSS-AES128-GCM-SHA256" +#define TLS1_TXT_DHE_DSS_WITH_AES_256_GCM_SHA384 "DHE-DSS-AES256-GCM-SHA384" +#define TLS1_TXT_DH_DSS_WITH_AES_128_GCM_SHA256 "DH-DSS-AES128-GCM-SHA256" +#define TLS1_TXT_DH_DSS_WITH_AES_256_GCM_SHA384 "DH-DSS-AES256-GCM-SHA384" +#define TLS1_TXT_ADH_WITH_AES_128_GCM_SHA256 "ADH-AES128-GCM-SHA256" +#define TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384 "ADH-AES256-GCM-SHA384" + +/* CCM ciphersuites from RFC6655 */ +#define TLS1_TXT_RSA_WITH_AES_128_CCM "AES128-CCM" +#define TLS1_TXT_RSA_WITH_AES_256_CCM "AES256-CCM" +#define TLS1_TXT_DHE_RSA_WITH_AES_128_CCM "DHE-RSA-AES128-CCM" +#define TLS1_TXT_DHE_RSA_WITH_AES_256_CCM "DHE-RSA-AES256-CCM" + +#define TLS1_TXT_RSA_WITH_AES_128_CCM_8 "AES128-CCM8" +#define TLS1_TXT_RSA_WITH_AES_256_CCM_8 "AES256-CCM8" +#define TLS1_TXT_DHE_RSA_WITH_AES_128_CCM_8 "DHE-RSA-AES128-CCM8" +#define TLS1_TXT_DHE_RSA_WITH_AES_256_CCM_8 "DHE-RSA-AES256-CCM8" + +#define TLS1_TXT_PSK_WITH_AES_128_CCM "PSK-AES128-CCM" +#define TLS1_TXT_PSK_WITH_AES_256_CCM "PSK-AES256-CCM" +#define TLS1_TXT_DHE_PSK_WITH_AES_128_CCM "DHE-PSK-AES128-CCM" +#define TLS1_TXT_DHE_PSK_WITH_AES_256_CCM "DHE-PSK-AES256-CCM" + +#define TLS1_TXT_PSK_WITH_AES_128_CCM_8 "PSK-AES128-CCM8" +#define TLS1_TXT_PSK_WITH_AES_256_CCM_8 "PSK-AES256-CCM8" +#define TLS1_TXT_DHE_PSK_WITH_AES_128_CCM_8 "DHE-PSK-AES128-CCM8" +#define TLS1_TXT_DHE_PSK_WITH_AES_256_CCM_8 "DHE-PSK-AES256-CCM8" + +/* CCM ciphersuites from RFC7251 */ +#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CCM "ECDHE-ECDSA-AES128-CCM" +#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CCM "ECDHE-ECDSA-AES256-CCM" +#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CCM_8 "ECDHE-ECDSA-AES128-CCM8" +#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CCM_8 "ECDHE-ECDSA-AES256-CCM8" + +/* ECDH HMAC based ciphersuites from RFC5289 */ +#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256 "ECDHE-ECDSA-AES128-SHA256" +#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384 "ECDHE-ECDSA-AES256-SHA384" +#define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_SHA256 "ECDH-ECDSA-AES128-SHA256" +#define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_SHA384 "ECDH-ECDSA-AES256-SHA384" +#define TLS1_TXT_ECDHE_RSA_WITH_AES_128_SHA256 "ECDHE-RSA-AES128-SHA256" +#define TLS1_TXT_ECDHE_RSA_WITH_AES_256_SHA384 "ECDHE-RSA-AES256-SHA384" +#define TLS1_TXT_ECDH_RSA_WITH_AES_128_SHA256 "ECDH-RSA-AES128-SHA256" +#define TLS1_TXT_ECDH_RSA_WITH_AES_256_SHA384 "ECDH-RSA-AES256-SHA384" + +/* ECDH GCM based ciphersuites from RFC5289 */ +#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 "ECDHE-ECDSA-AES128-GCM-SHA256" +#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 "ECDHE-ECDSA-AES256-GCM-SHA384" +#define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 "ECDH-ECDSA-AES128-GCM-SHA256" +#define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 "ECDH-ECDSA-AES256-GCM-SHA384" +#define TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256 "ECDHE-RSA-AES128-GCM-SHA256" +#define TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384 "ECDHE-RSA-AES256-GCM-SHA384" +#define TLS1_TXT_ECDH_RSA_WITH_AES_128_GCM_SHA256 "ECDH-RSA-AES128-GCM-SHA256" +#define TLS1_TXT_ECDH_RSA_WITH_AES_256_GCM_SHA384 "ECDH-RSA-AES256-GCM-SHA384" + +/* TLS v1.2 PSK GCM ciphersuites from RFC5487 */ +#define TLS1_TXT_PSK_WITH_AES_128_GCM_SHA256 "PSK-AES128-GCM-SHA256" +#define TLS1_TXT_PSK_WITH_AES_256_GCM_SHA384 "PSK-AES256-GCM-SHA384" + +/* ECDHE PSK ciphersuites from RFC 5489 */ +#define TLS1_TXT_ECDHE_PSK_WITH_RC4_128_SHA "ECDHE-PSK-RC4-SHA" +#define TLS1_TXT_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA "ECDHE-PSK-3DES-EDE-CBC-SHA" +#define TLS1_TXT_ECDHE_PSK_WITH_AES_128_CBC_SHA "ECDHE-PSK-AES128-CBC-SHA" +#define TLS1_TXT_ECDHE_PSK_WITH_AES_256_CBC_SHA "ECDHE-PSK-AES256-CBC-SHA" + +#define TLS1_TXT_ECDHE_PSK_WITH_AES_128_CBC_SHA256 "ECDHE-PSK-AES128-CBC-SHA256" +#define TLS1_TXT_ECDHE_PSK_WITH_AES_256_CBC_SHA384 "ECDHE-PSK-AES256-CBC-SHA384" + +#define TLS1_TXT_ECDHE_PSK_WITH_NULL_SHA "ECDHE-PSK-NULL-SHA" +#define TLS1_TXT_ECDHE_PSK_WITH_NULL_SHA256 "ECDHE-PSK-NULL-SHA256" +#define TLS1_TXT_ECDHE_PSK_WITH_NULL_SHA384 "ECDHE-PSK-NULL-SHA384" + +/* Camellia-CBC ciphersuites from RFC6367 */ +#define TLS1_TXT_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 "ECDHE-ECDSA-CAMELLIA128-SHA256" +#define TLS1_TXT_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 "ECDHE-ECDSA-CAMELLIA256-SHA384" +#define TLS1_TXT_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 "ECDH-ECDSA-CAMELLIA128-SHA256" +#define TLS1_TXT_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 "ECDH-ECDSA-CAMELLIA256-SHA384" +#define TLS1_TXT_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 "ECDHE-RSA-CAMELLIA128-SHA256" +#define TLS1_TXT_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 "ECDHE-RSA-CAMELLIA256-SHA384" +#define TLS1_TXT_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 "ECDH-RSA-CAMELLIA128-SHA256" +#define TLS1_TXT_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 "ECDH-RSA-CAMELLIA256-SHA384" + +/* draft-ietf-tls-chacha20-poly1305-03 */ +#define TLS1_TXT_ECDHE_RSA_WITH_CHACHA20_POLY1305 "ECDHE-RSA-CHACHA20-POLY1305" +#define TLS1_TXT_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 "ECDHE-ECDSA-CHACHA20-POLY1305" +#define TLS1_TXT_DHE_RSA_WITH_CHACHA20_POLY1305 "DHE-RSA-CHACHA20-POLY1305" +#define TLS1_TXT_PSK_WITH_CHACHA20_POLY1305 "PSK-CHACHA20-POLY1305" +#define TLS1_TXT_ECDHE_PSK_WITH_CHACHA20_POLY1305 "ECDHE-PSK-CHACHA20-POLY1305" +#define TLS1_TXT_DHE_PSK_WITH_CHACHA20_POLY1305 "DHE-PSK-CHACHA20-POLY1305" +#define TLS1_TXT_RSA_PSK_WITH_CHACHA20_POLY1305 "RSA-PSK-CHACHA20-POLY1305" + +/* Aria ciphersuites from RFC6209 */ +#define TLS1_TXT_RSA_WITH_ARIA_128_GCM_SHA256 "ARIA128-GCM-SHA256" +#define TLS1_TXT_RSA_WITH_ARIA_256_GCM_SHA384 "ARIA256-GCM-SHA384" +#define TLS1_TXT_DHE_RSA_WITH_ARIA_128_GCM_SHA256 "DHE-RSA-ARIA128-GCM-SHA256" +#define TLS1_TXT_DHE_RSA_WITH_ARIA_256_GCM_SHA384 "DHE-RSA-ARIA256-GCM-SHA384" +#define TLS1_TXT_DH_RSA_WITH_ARIA_128_GCM_SHA256 "DH-RSA-ARIA128-GCM-SHA256" +#define TLS1_TXT_DH_RSA_WITH_ARIA_256_GCM_SHA384 "DH-RSA-ARIA256-GCM-SHA384" +#define TLS1_TXT_DHE_DSS_WITH_ARIA_128_GCM_SHA256 "DHE-DSS-ARIA128-GCM-SHA256" +#define TLS1_TXT_DHE_DSS_WITH_ARIA_256_GCM_SHA384 "DHE-DSS-ARIA256-GCM-SHA384" +#define TLS1_TXT_DH_DSS_WITH_ARIA_128_GCM_SHA256 "DH-DSS-ARIA128-GCM-SHA256" +#define TLS1_TXT_DH_DSS_WITH_ARIA_256_GCM_SHA384 "DH-DSS-ARIA256-GCM-SHA384" +#define TLS1_TXT_DH_anon_WITH_ARIA_128_GCM_SHA256 "ADH-ARIA128-GCM-SHA256" +#define TLS1_TXT_DH_anon_WITH_ARIA_256_GCM_SHA384 "ADH-ARIA256-GCM-SHA384" +#define TLS1_TXT_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 "ECDHE-ECDSA-ARIA128-GCM-SHA256" +#define TLS1_TXT_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 "ECDHE-ECDSA-ARIA256-GCM-SHA384" +#define TLS1_TXT_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256 "ECDH-ECDSA-ARIA128-GCM-SHA256" +#define TLS1_TXT_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384 "ECDH-ECDSA-ARIA256-GCM-SHA384" +#define TLS1_TXT_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256 "ECDHE-ARIA128-GCM-SHA256" +#define TLS1_TXT_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384 "ECDHE-ARIA256-GCM-SHA384" +#define TLS1_TXT_ECDH_RSA_WITH_ARIA_128_GCM_SHA256 "ECDH-ARIA128-GCM-SHA256" +#define TLS1_TXT_ECDH_RSA_WITH_ARIA_256_GCM_SHA384 "ECDH-ARIA256-GCM-SHA384" +#define TLS1_TXT_PSK_WITH_ARIA_128_GCM_SHA256 "PSK-ARIA128-GCM-SHA256" +#define TLS1_TXT_PSK_WITH_ARIA_256_GCM_SHA384 "PSK-ARIA256-GCM-SHA384" +#define TLS1_TXT_DHE_PSK_WITH_ARIA_128_GCM_SHA256 "DHE-PSK-ARIA128-GCM-SHA256" +#define TLS1_TXT_DHE_PSK_WITH_ARIA_256_GCM_SHA384 "DHE-PSK-ARIA256-GCM-SHA384" +#define TLS1_TXT_RSA_PSK_WITH_ARIA_128_GCM_SHA256 "RSA-PSK-ARIA128-GCM-SHA256" +#define TLS1_TXT_RSA_PSK_WITH_ARIA_256_GCM_SHA384 "RSA-PSK-ARIA256-GCM-SHA384" + +#define TLS_CT_RSA_SIGN 1 +#define TLS_CT_DSS_SIGN 2 +#define TLS_CT_RSA_FIXED_DH 3 +#define TLS_CT_DSS_FIXED_DH 4 +#define TLS_CT_ECDSA_SIGN 64 +#define TLS_CT_RSA_FIXED_ECDH 65 +#define TLS_CT_ECDSA_FIXED_ECDH 66 +#define TLS_CT_GOST01_SIGN 22 +#define TLS_CT_GOST12_IANA_SIGN 67 +#define TLS_CT_GOST12_IANA_512_SIGN 68 +#define TLS_CT_GOST12_LEGACY_SIGN 238 +#define TLS_CT_GOST12_LEGACY_512_SIGN 239 + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define TLS_CT_GOST12_SIGN TLS_CT_GOST12_LEGACY_SIGN +#define TLS_CT_GOST12_512_SIGN TLS_CT_GOST12_LEGACY_512_SIGN +#endif + +/* + * when correcting this number, correct also SSL3_CT_NUMBER in ssl3.h (see + * comment there) + */ +#define TLS_CT_NUMBER 12 + +#if defined(SSL3_CT_NUMBER) +#if TLS_CT_NUMBER != SSL3_CT_NUMBER +#error "SSL/TLS CT_NUMBER values do not match" +#endif +#endif + +#define TLS1_FINISH_MAC_LENGTH 12 + +#define TLS_MD_MAX_CONST_SIZE 22 + +/* ASCII: "client finished", in hex for EBCDIC compatibility */ +#define TLS_MD_CLIENT_FINISH_CONST "\x63\x6c\x69\x65\x6e\x74\x20\x66\x69\x6e\x69\x73\x68\x65\x64" +#define TLS_MD_CLIENT_FINISH_CONST_SIZE 15 +/* ASCII: "server finished", in hex for EBCDIC compatibility */ +#define TLS_MD_SERVER_FINISH_CONST "\x73\x65\x72\x76\x65\x72\x20\x66\x69\x6e\x69\x73\x68\x65\x64" +#define TLS_MD_SERVER_FINISH_CONST_SIZE 15 +/* ASCII: "server write key", in hex for EBCDIC compatibility */ +#define TLS_MD_SERVER_WRITE_KEY_CONST "\x73\x65\x72\x76\x65\x72\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79" +#define TLS_MD_SERVER_WRITE_KEY_CONST_SIZE 16 +/* ASCII: "key expansion", in hex for EBCDIC compatibility */ +#define TLS_MD_KEY_EXPANSION_CONST "\x6b\x65\x79\x20\x65\x78\x70\x61\x6e\x73\x69\x6f\x6e" +#define TLS_MD_KEY_EXPANSION_CONST_SIZE 13 +/* ASCII: "client write key", in hex for EBCDIC compatibility */ +#define TLS_MD_CLIENT_WRITE_KEY_CONST "\x63\x6c\x69\x65\x6e\x74\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79" +#define TLS_MD_CLIENT_WRITE_KEY_CONST_SIZE 16 +/* ASCII: "server write key", in hex for EBCDIC compatibility */ +#define TLS_MD_SERVER_WRITE_KEY_CONST "\x73\x65\x72\x76\x65\x72\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79" +#define TLS_MD_SERVER_WRITE_KEY_CONST_SIZE 16 +/* ASCII: "IV block", in hex for EBCDIC compatibility */ +#define TLS_MD_IV_BLOCK_CONST "\x49\x56\x20\x62\x6c\x6f\x63\x6b" +#define TLS_MD_IV_BLOCK_CONST_SIZE 8 +/* ASCII: "master secret", in hex for EBCDIC compatibility */ +#define TLS_MD_MASTER_SECRET_CONST "\x6d\x61\x73\x74\x65\x72\x20\x73\x65\x63\x72\x65\x74" +#define TLS_MD_MASTER_SECRET_CONST_SIZE 13 +/* ASCII: "extended master secret", in hex for EBCDIC compatibility */ +#define TLS_MD_EXTENDED_MASTER_SECRET_CONST "\x65\x78\x74\x65\x6e\x64\x65\x64\x20\x6d\x61\x73\x74\x65\x72\x20\x73\x65\x63\x72\x65\x74" +#define TLS_MD_EXTENDED_MASTER_SECRET_CONST_SIZE 22 + +/* TLS Session Ticket extension struct */ +struct tls_session_ticket_ext_st { + unsigned short length; + void *data; +}; + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/trace.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/trace.h new file mode 100644 index 0000000000000000000000000000000000000000..ff0fba729589785aab988584ee6d76a15f9005ab --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/trace.h @@ -0,0 +1,325 @@ +/* + * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_TRACE_H +#define OPENSSL_TRACE_H +#pragma once + +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * TRACE CATEGORIES + */ + +/* + * The trace messages of the OpenSSL libraries are organized into different + * categories. For every trace category, the application can register a separate + * tracer callback. When a callback is registered, a so called trace channel is + * created for this category. This channel consists essentially of an internal + * BIO which sends all trace output it receives to the registered application + * callback. + * + * The ALL category can be used as a fallback category to register a single + * channel which receives the output from all categories. However, if the + * application intends to print the trace channel name in the line prefix, + * it is better to register channels for all categories separately. + * (This is how the openssl application does it.) + */ +#define OSSL_TRACE_CATEGORY_ALL 0 /* The fallback */ +#define OSSL_TRACE_CATEGORY_TRACE 1 +#define OSSL_TRACE_CATEGORY_INIT 2 +#define OSSL_TRACE_CATEGORY_TLS 3 +#define OSSL_TRACE_CATEGORY_TLS_CIPHER 4 +#define OSSL_TRACE_CATEGORY_CONF 5 +#define OSSL_TRACE_CATEGORY_ENGINE_TABLE 6 +#define OSSL_TRACE_CATEGORY_ENGINE_REF_COUNT 7 +#define OSSL_TRACE_CATEGORY_PKCS5V2 8 +#define OSSL_TRACE_CATEGORY_PKCS12_KEYGEN 9 +#define OSSL_TRACE_CATEGORY_PKCS12_DECRYPT 10 +#define OSSL_TRACE_CATEGORY_X509V3_POLICY 11 +#define OSSL_TRACE_CATEGORY_BN_CTX 12 +#define OSSL_TRACE_CATEGORY_CMP 13 +#define OSSL_TRACE_CATEGORY_STORE 14 +#define OSSL_TRACE_CATEGORY_DECODER 15 +#define OSSL_TRACE_CATEGORY_ENCODER 16 +#define OSSL_TRACE_CATEGORY_REF_COUNT 17 +#define OSSL_TRACE_CATEGORY_HTTP 18 +#define OSSL_TRACE_CATEGORY_PROVIDER 19 +#define OSSL_TRACE_CATEGORY_QUERY 20 +#define OSSL_TRACE_CATEGORY_NUM 21 +/* KEEP THIS LIST IN SYNC with trace_categories[] in crypto/trace.c */ + +/* Returns the trace category number for the given |name| */ +int OSSL_trace_get_category_num(const char *name); + +/* Returns the trace category name for the given |num| */ +const char *OSSL_trace_get_category_name(int num); + +/* + * TRACE CONSUMERS + */ + +/* + * Enables tracing for the given |category| by providing a BIO sink + * as |channel|. If a null pointer is passed as |channel|, an existing + * trace channel is removed and tracing for the category is disabled. + * + * Returns 1 on success and 0 on failure + */ +int OSSL_trace_set_channel(int category, BIO *channel); + +/* + * Attach a prefix and a suffix to the given |category|, to be printed at the + * beginning and at the end of each trace output group, i.e. when + * OSSL_trace_begin() and OSSL_trace_end() are called. + * If a null pointer is passed as argument, the existing prefix or suffix is + * removed. + * + * They return 1 on success and 0 on failure + */ +int OSSL_trace_set_prefix(int category, const char *prefix); +int OSSL_trace_set_suffix(int category, const char *suffix); + +/* + * OSSL_trace_cb is the type tracing callback provided by the application. + * It MUST return the number of bytes written, or 0 on error (in other words, + * it can never write zero bytes). + * + * The |buffer| will always contain text, which may consist of several lines. + * The |data| argument points to whatever data was provided by the application + * when registering the tracer function. + * + * The |category| number is given, as well as a |cmd| number, described below. + */ +typedef size_t (*OSSL_trace_cb)(const char *buffer, size_t count, + int category, int cmd, void *data); +/* + * Possible |cmd| numbers. + */ +#define OSSL_TRACE_CTRL_BEGIN 0 +#define OSSL_TRACE_CTRL_WRITE 1 +#define OSSL_TRACE_CTRL_END 2 + +/* + * Enables tracing for the given |category| by creating an internal + * trace channel which sends the output to the given |callback|. + * If a null pointer is passed as callback, an existing trace channel + * is removed and tracing for the category is disabled. + * + * NOTE: OSSL_trace_set_channel() and OSSL_trace_set_callback() are mutually + * exclusive. + * + * Returns 1 on success and 0 on failure + */ +int OSSL_trace_set_callback(int category, OSSL_trace_cb callback, void *data); + +/* + * TRACE PRODUCERS + */ + +/* + * Returns 1 if tracing for the specified category is enabled, otherwise 0 + */ +int OSSL_trace_enabled(int category); + +/* + * Wrap a group of tracing output calls. OSSL_trace_begin() locks tracing and + * returns the trace channel associated with the given category, or NULL if no + * channel is associated with the category. OSSL_trace_end() unlocks tracing. + * + * Usage: + * + * BIO *out; + * if ((out = OSSL_trace_begin(category)) != NULL) { + * ... + * BIO_fprintf(out, ...); + * ... + * OSSL_trace_end(category, out); + * } + * + * See also the convenience macros OSSL_TRACE_BEGIN and OSSL_TRACE_END below. + */ +BIO *OSSL_trace_begin(int category); +void OSSL_trace_end(int category, BIO *channel); + +/* + * OSSL_TRACE* Convenience Macros + */ + +/* + * When the tracing feature is disabled, these macros are defined to + * produce dead code, which a good compiler should eliminate. + */ + +/* + * OSSL_TRACE_BEGIN, OSSL_TRACE_END - Define a Trace Group + * + * These two macros can be used to create a block which is executed only + * if the corresponding trace category is enabled. Inside this block, a + * local variable named |trc_out| is defined, which points to the channel + * associated with the given trace category. + * + * Usage: (using 'TLS' as an example category) + * + * OSSL_TRACE_BEGIN(TLS) { + * + * BIO_fprintf(trc_out, ... ); + * + * } OSSL_TRACE_END(TLS); + * + * + * This expands to the following code + * + * do { + * BIO *trc_out = OSSL_trace_begin(OSSL_TRACE_CATEGORY_TLS); + * if (trc_out != NULL) { + * ... + * BIO_fprintf(trc_out, ...); + * } + * OSSL_trace_end(OSSL_TRACE_CATEGORY_TLS, trc_out); + * } while (0); + * + * The use of the inner '{...}' group and the trailing ';' is enforced + * by the definition of the macros in order to make the code look as much + * like C code as possible. + * + * Before returning from inside the trace block, it is necessary to + * call OSSL_TRACE_CANCEL(category). + */ + +#if !defined OPENSSL_NO_TRACE && !defined FIPS_MODULE + +#define OSSL_TRACE_BEGIN(category) \ + do { \ + BIO *trc_out = OSSL_trace_begin(OSSL_TRACE_CATEGORY_##category); \ + \ + if (trc_out != NULL) + +#define OSSL_TRACE_END(category) \ + OSSL_trace_end(OSSL_TRACE_CATEGORY_##category, trc_out); \ + } \ + while (0) + +#define OSSL_TRACE_CANCEL(category) \ + OSSL_trace_end(OSSL_TRACE_CATEGORY_##category, trc_out) + +#else + +#define OSSL_TRACE_BEGIN(category) \ + do { \ + BIO *trc_out = NULL; \ + if (0) + +#define OSSL_TRACE_END(category) \ + } \ + while (0) + +#define OSSL_TRACE_CANCEL(category) \ + ((void)0) + +#endif + +/* + * OSSL_TRACE_ENABLED() - Check whether tracing is enabled for |category| + * + * Usage: + * + * if (OSSL_TRACE_ENABLED(TLS)) { + * ... + * } + */ +#if !defined OPENSSL_NO_TRACE && !defined FIPS_MODULE + +#define OSSL_TRACE_ENABLED(category) \ + OSSL_trace_enabled(OSSL_TRACE_CATEGORY_##category) + +#else + +#define OSSL_TRACE_ENABLED(category) (0) + +#endif + +/* + * OSSL_TRACE*() - OneShot Trace Macros + * + * These macros are intended to produce a simple printf-style trace output. + * Unfortunately, C90 macros don't support variable arguments, so the + * "vararg" OSSL_TRACEV() macro has a rather weird usage pattern: + * + * OSSL_TRACEV(category, (trc_out, "format string", ...args...)); + * + * Where 'channel' is the literal symbol of this name, not a variable. + * For that reason, it is currently not intended to be used directly, + * but only as helper macro for the other oneshot trace macros + * OSSL_TRACE(), OSSL_TRACE1(), OSSL_TRACE2(), ... + * + * Usage: + * + * OSSL_TRACE(INIT, "Hello world!\n"); + * OSSL_TRACE1(TLS, "The answer is %d\n", 42); + * OSSL_TRACE2(TLS, "The ultimate question to answer %d is '%s'\n", + * 42, "What do you get when you multiply six by nine?"); + */ + +#if !defined OPENSSL_NO_TRACE && !defined FIPS_MODULE + +#define OSSL_TRACEV(category, args) \ + OSSL_TRACE_BEGIN(category) \ + BIO_printf args; \ + OSSL_TRACE_END(category) + +#else + +#define OSSL_TRACEV(category, args) ((void)0) + +#endif + +#define OSSL_TRACE(category, text) \ + OSSL_TRACEV(category, (trc_out, "%s", text)) + +#define OSSL_TRACE1(category, format, arg1) \ + OSSL_TRACEV(category, (trc_out, format, arg1)) +#define OSSL_TRACE2(category, format, arg1, arg2) \ + OSSL_TRACEV(category, (trc_out, format, arg1, arg2)) +#define OSSL_TRACE3(category, format, arg1, arg2, arg3) \ + OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3)) +#define OSSL_TRACE4(category, format, arg1, arg2, arg3, arg4) \ + OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4)) +#define OSSL_TRACE5(category, format, arg1, arg2, arg3, arg4, arg5) \ + OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4, arg5)) +#define OSSL_TRACE6(category, format, arg1, arg2, arg3, arg4, arg5, arg6) \ + OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4, arg5, arg6)) +#define OSSL_TRACE7(category, format, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \ + OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4, arg5, arg6, arg7)) +#define OSSL_TRACE8(category, format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \ + OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)) +#define OSSL_TRACE9(category, format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) \ + OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)) + +#define OSSL_TRACE_STRING_MAX 80 +int OSSL_trace_string(BIO *out, int text, int full, + const unsigned char *data, size_t size); +#define OSSL_TRACE_STRING(category, text, full, data, len) \ + OSSL_TRACE_BEGIN(category) \ + { \ + OSSL_trace_string(trc_out, text, full, data, len); \ + } \ + OSSL_TRACE_END(category) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ts.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ts.h new file mode 100644 index 0000000000000000000000000000000000000000..edb6ca17bd7aee87282c97514b482b766e1b60e0 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ts.h @@ -0,0 +1,521 @@ +/* + * Copyright 2006-2024 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_TS_H +#define OPENSSL_TS_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_TS_H +#endif + +#include + +#ifndef OPENSSL_NO_TS +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef OPENSSL_NO_STDIO +#include +#endif +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct TS_msg_imprint_st TS_MSG_IMPRINT; +typedef struct TS_req_st TS_REQ; +typedef struct TS_accuracy_st TS_ACCURACY; +typedef struct TS_tst_info_st TS_TST_INFO; + +/* Possible values for status. */ +#define TS_STATUS_GRANTED 0 +#define TS_STATUS_GRANTED_WITH_MODS 1 +#define TS_STATUS_REJECTION 2 +#define TS_STATUS_WAITING 3 +#define TS_STATUS_REVOCATION_WARNING 4 +#define TS_STATUS_REVOCATION_NOTIFICATION 5 + +/* Possible values for failure_info. */ +#define TS_INFO_BAD_ALG 0 +#define TS_INFO_BAD_REQUEST 2 +#define TS_INFO_BAD_DATA_FORMAT 5 +#define TS_INFO_TIME_NOT_AVAILABLE 14 +#define TS_INFO_UNACCEPTED_POLICY 15 +#define TS_INFO_UNACCEPTED_EXTENSION 16 +#define TS_INFO_ADD_INFO_NOT_AVAILABLE 17 +#define TS_INFO_SYSTEM_FAILURE 25 + +typedef struct TS_status_info_st TS_STATUS_INFO; + +typedef struct TS_resp_st TS_RESP; + +DECLARE_ASN1_ALLOC_FUNCTIONS(TS_REQ) +DECLARE_ASN1_ENCODE_FUNCTIONS_only(TS_REQ, TS_REQ) +DECLARE_ASN1_DUP_FUNCTION(TS_REQ) + +#ifndef OPENSSL_NO_STDIO +TS_REQ *d2i_TS_REQ_fp(FILE *fp, TS_REQ **a); +int i2d_TS_REQ_fp(FILE *fp, const TS_REQ *a); +#endif +TS_REQ *d2i_TS_REQ_bio(BIO *fp, TS_REQ **a); +int i2d_TS_REQ_bio(BIO *fp, const TS_REQ *a); + +DECLARE_ASN1_ALLOC_FUNCTIONS(TS_MSG_IMPRINT) +DECLARE_ASN1_ENCODE_FUNCTIONS_only(TS_MSG_IMPRINT, TS_MSG_IMPRINT) +DECLARE_ASN1_DUP_FUNCTION(TS_MSG_IMPRINT) + +#ifndef OPENSSL_NO_STDIO +TS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT_fp(FILE *fp, TS_MSG_IMPRINT **a); +int i2d_TS_MSG_IMPRINT_fp(FILE *fp, const TS_MSG_IMPRINT *a); +#endif +TS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT_bio(BIO *bio, TS_MSG_IMPRINT **a); +int i2d_TS_MSG_IMPRINT_bio(BIO *bio, const TS_MSG_IMPRINT *a); + +DECLARE_ASN1_ALLOC_FUNCTIONS(TS_RESP) +DECLARE_ASN1_ENCODE_FUNCTIONS_only(TS_RESP, TS_RESP) +DECLARE_ASN1_DUP_FUNCTION(TS_RESP) + +#ifndef OPENSSL_NO_STDIO +TS_RESP *d2i_TS_RESP_fp(FILE *fp, TS_RESP **a); +int i2d_TS_RESP_fp(FILE *fp, const TS_RESP *a); +#endif +TS_RESP *d2i_TS_RESP_bio(BIO *bio, TS_RESP **a); +int i2d_TS_RESP_bio(BIO *bio, const TS_RESP *a); + +DECLARE_ASN1_ALLOC_FUNCTIONS(TS_STATUS_INFO) +DECLARE_ASN1_ENCODE_FUNCTIONS_only(TS_STATUS_INFO, TS_STATUS_INFO) +DECLARE_ASN1_DUP_FUNCTION(TS_STATUS_INFO) + +DECLARE_ASN1_ALLOC_FUNCTIONS(TS_TST_INFO) +DECLARE_ASN1_ENCODE_FUNCTIONS_only(TS_TST_INFO, TS_TST_INFO) +DECLARE_ASN1_DUP_FUNCTION(TS_TST_INFO) +TS_TST_INFO *PKCS7_to_TS_TST_INFO(PKCS7 *token); + +#ifndef OPENSSL_NO_STDIO +TS_TST_INFO *d2i_TS_TST_INFO_fp(FILE *fp, TS_TST_INFO **a); +int i2d_TS_TST_INFO_fp(FILE *fp, const TS_TST_INFO *a); +#endif +TS_TST_INFO *d2i_TS_TST_INFO_bio(BIO *bio, TS_TST_INFO **a); +int i2d_TS_TST_INFO_bio(BIO *bio, const TS_TST_INFO *a); + +DECLARE_ASN1_ALLOC_FUNCTIONS(TS_ACCURACY) +DECLARE_ASN1_ENCODE_FUNCTIONS_only(TS_ACCURACY, TS_ACCURACY) +DECLARE_ASN1_DUP_FUNCTION(TS_ACCURACY) + +int TS_REQ_set_version(TS_REQ *a, long version); +long TS_REQ_get_version(const TS_REQ *a); + +int TS_STATUS_INFO_set_status(TS_STATUS_INFO *a, int i); +const ASN1_INTEGER *TS_STATUS_INFO_get0_status(const TS_STATUS_INFO *a); + +const STACK_OF(ASN1_UTF8STRING) * +TS_STATUS_INFO_get0_text(const TS_STATUS_INFO *a); + +const ASN1_BIT_STRING * +TS_STATUS_INFO_get0_failure_info(const TS_STATUS_INFO *a); + +int TS_REQ_set_msg_imprint(TS_REQ *a, TS_MSG_IMPRINT *msg_imprint); +TS_MSG_IMPRINT *TS_REQ_get_msg_imprint(TS_REQ *a); + +int TS_MSG_IMPRINT_set_algo(TS_MSG_IMPRINT *a, X509_ALGOR *alg); +X509_ALGOR *TS_MSG_IMPRINT_get_algo(TS_MSG_IMPRINT *a); + +int TS_MSG_IMPRINT_set_msg(TS_MSG_IMPRINT *a, unsigned char *d, int len); +ASN1_OCTET_STRING *TS_MSG_IMPRINT_get_msg(TS_MSG_IMPRINT *a); + +int TS_REQ_set_policy_id(TS_REQ *a, const ASN1_OBJECT *policy); +ASN1_OBJECT *TS_REQ_get_policy_id(TS_REQ *a); + +int TS_REQ_set_nonce(TS_REQ *a, const ASN1_INTEGER *nonce); +const ASN1_INTEGER *TS_REQ_get_nonce(const TS_REQ *a); + +int TS_REQ_set_cert_req(TS_REQ *a, int cert_req); +int TS_REQ_get_cert_req(const TS_REQ *a); + +STACK_OF(X509_EXTENSION) *TS_REQ_get_exts(TS_REQ *a); +void TS_REQ_ext_free(TS_REQ *a); +int TS_REQ_get_ext_count(TS_REQ *a); +int TS_REQ_get_ext_by_NID(TS_REQ *a, int nid, int lastpos); +int TS_REQ_get_ext_by_OBJ(TS_REQ *a, const ASN1_OBJECT *obj, int lastpos); +int TS_REQ_get_ext_by_critical(TS_REQ *a, int crit, int lastpos); +X509_EXTENSION *TS_REQ_get_ext(TS_REQ *a, int loc); +X509_EXTENSION *TS_REQ_delete_ext(TS_REQ *a, int loc); +int TS_REQ_add_ext(TS_REQ *a, X509_EXTENSION *ex, int loc); +void *TS_REQ_get_ext_d2i(TS_REQ *a, int nid, int *crit, int *idx); + +/* Function declarations for TS_REQ defined in ts/ts_req_print.c */ + +int TS_REQ_print_bio(BIO *bio, TS_REQ *a); + +/* Function declarations for TS_RESP defined in ts/ts_resp_utils.c */ + +int TS_RESP_set_status_info(TS_RESP *a, TS_STATUS_INFO *info); +TS_STATUS_INFO *TS_RESP_get_status_info(TS_RESP *a); + +/* Caller loses ownership of PKCS7 and TS_TST_INFO objects. */ +void TS_RESP_set_tst_info(TS_RESP *a, PKCS7 *p7, TS_TST_INFO *tst_info); +PKCS7 *TS_RESP_get_token(TS_RESP *a); +TS_TST_INFO *TS_RESP_get_tst_info(TS_RESP *a); + +int TS_TST_INFO_set_version(TS_TST_INFO *a, long version); +long TS_TST_INFO_get_version(const TS_TST_INFO *a); + +int TS_TST_INFO_set_policy_id(TS_TST_INFO *a, ASN1_OBJECT *policy_id); +ASN1_OBJECT *TS_TST_INFO_get_policy_id(TS_TST_INFO *a); + +int TS_TST_INFO_set_msg_imprint(TS_TST_INFO *a, TS_MSG_IMPRINT *msg_imprint); +TS_MSG_IMPRINT *TS_TST_INFO_get_msg_imprint(TS_TST_INFO *a); + +int TS_TST_INFO_set_serial(TS_TST_INFO *a, const ASN1_INTEGER *serial); +const ASN1_INTEGER *TS_TST_INFO_get_serial(const TS_TST_INFO *a); + +int TS_TST_INFO_set_time(TS_TST_INFO *a, const ASN1_GENERALIZEDTIME *gtime); +const ASN1_GENERALIZEDTIME *TS_TST_INFO_get_time(const TS_TST_INFO *a); + +int TS_TST_INFO_set_accuracy(TS_TST_INFO *a, TS_ACCURACY *accuracy); +TS_ACCURACY *TS_TST_INFO_get_accuracy(TS_TST_INFO *a); + +int TS_ACCURACY_set_seconds(TS_ACCURACY *a, const ASN1_INTEGER *seconds); +const ASN1_INTEGER *TS_ACCURACY_get_seconds(const TS_ACCURACY *a); + +int TS_ACCURACY_set_millis(TS_ACCURACY *a, const ASN1_INTEGER *millis); +const ASN1_INTEGER *TS_ACCURACY_get_millis(const TS_ACCURACY *a); + +int TS_ACCURACY_set_micros(TS_ACCURACY *a, const ASN1_INTEGER *micros); +const ASN1_INTEGER *TS_ACCURACY_get_micros(const TS_ACCURACY *a); + +int TS_TST_INFO_set_ordering(TS_TST_INFO *a, int ordering); +int TS_TST_INFO_get_ordering(const TS_TST_INFO *a); + +int TS_TST_INFO_set_nonce(TS_TST_INFO *a, const ASN1_INTEGER *nonce); +const ASN1_INTEGER *TS_TST_INFO_get_nonce(const TS_TST_INFO *a); + +int TS_TST_INFO_set_tsa(TS_TST_INFO *a, GENERAL_NAME *tsa); +GENERAL_NAME *TS_TST_INFO_get_tsa(TS_TST_INFO *a); + +STACK_OF(X509_EXTENSION) *TS_TST_INFO_get_exts(TS_TST_INFO *a); +void TS_TST_INFO_ext_free(TS_TST_INFO *a); +int TS_TST_INFO_get_ext_count(TS_TST_INFO *a); +int TS_TST_INFO_get_ext_by_NID(TS_TST_INFO *a, int nid, int lastpos); +int TS_TST_INFO_get_ext_by_OBJ(TS_TST_INFO *a, const ASN1_OBJECT *obj, + int lastpos); +int TS_TST_INFO_get_ext_by_critical(TS_TST_INFO *a, int crit, int lastpos); +X509_EXTENSION *TS_TST_INFO_get_ext(TS_TST_INFO *a, int loc); +X509_EXTENSION *TS_TST_INFO_delete_ext(TS_TST_INFO *a, int loc); +int TS_TST_INFO_add_ext(TS_TST_INFO *a, X509_EXTENSION *ex, int loc); +void *TS_TST_INFO_get_ext_d2i(TS_TST_INFO *a, int nid, int *crit, int *idx); + +/* + * Declarations related to response generation, defined in ts/ts_resp_sign.c. + */ + +/* Optional flags for response generation. */ + +/* Don't include the TSA name in response. */ +#define TS_TSA_NAME 0x01 + +/* Set ordering to true in response. */ +#define TS_ORDERING 0x02 + +/* + * Include the signer certificate and the other specified certificates in + * the ESS signing certificate attribute beside the PKCS7 signed data. + * Only the signer certificates is included by default. + */ +#define TS_ESS_CERT_ID_CHAIN 0x04 + +/* Forward declaration. */ +struct TS_resp_ctx; + +/* This must return a unique number less than 160 bits long. */ +typedef ASN1_INTEGER *(*TS_serial_cb)(struct TS_resp_ctx *, void *); + +/* + * This must return the seconds and microseconds since Jan 1, 1970 in the sec + * and usec variables allocated by the caller. Return non-zero for success + * and zero for failure. + */ +typedef int (*TS_time_cb)(struct TS_resp_ctx *, void *, long *sec, + long *usec); + +/* + * This must process the given extension. It can modify the TS_TST_INFO + * object of the context. Return values: !0 (processed), 0 (error, it must + * set the status info/failure info of the response). + */ +typedef int (*TS_extension_cb)(struct TS_resp_ctx *, X509_EXTENSION *, + void *); + +typedef struct TS_resp_ctx TS_RESP_CTX; + +/* Creates a response context that can be used for generating responses. */ +TS_RESP_CTX *TS_RESP_CTX_new(void); +TS_RESP_CTX *TS_RESP_CTX_new_ex(OSSL_LIB_CTX *libctx, const char *propq); +void TS_RESP_CTX_free(TS_RESP_CTX *ctx); + +/* This parameter must be set. */ +int TS_RESP_CTX_set_signer_cert(TS_RESP_CTX *ctx, X509 *signer); + +/* This parameter must be set. */ +int TS_RESP_CTX_set_signer_key(TS_RESP_CTX *ctx, EVP_PKEY *key); + +int TS_RESP_CTX_set_signer_digest(TS_RESP_CTX *ctx, + const EVP_MD *signer_digest); +int TS_RESP_CTX_set_ess_cert_id_digest(TS_RESP_CTX *ctx, const EVP_MD *md); + +/* This parameter must be set. */ +int TS_RESP_CTX_set_def_policy(TS_RESP_CTX *ctx, const ASN1_OBJECT *def_policy); + +/* No additional certs are included in the response by default. */ +int TS_RESP_CTX_set_certs(TS_RESP_CTX *ctx, STACK_OF(X509) *certs); + +/* + * Adds a new acceptable policy, only the default policy is accepted by + * default. + */ +int TS_RESP_CTX_add_policy(TS_RESP_CTX *ctx, const ASN1_OBJECT *policy); + +/* + * Adds a new acceptable message digest. Note that no message digests are + * accepted by default. The md argument is shared with the caller. + */ +int TS_RESP_CTX_add_md(TS_RESP_CTX *ctx, const EVP_MD *md); + +/* Accuracy is not included by default. */ +int TS_RESP_CTX_set_accuracy(TS_RESP_CTX *ctx, + int secs, int millis, int micros); + +/* + * Clock precision digits, i.e. the number of decimal digits: '0' means sec, + * '3' msec, '6' usec, and so on. Default is 0. + */ +int TS_RESP_CTX_set_clock_precision_digits(TS_RESP_CTX *ctx, + unsigned clock_precision_digits); +/* At most we accept usec precision. */ +#define TS_MAX_CLOCK_PRECISION_DIGITS 6 + +/* Maximum status message length */ +#define TS_MAX_STATUS_LENGTH (1024 * 1024) + +/* No flags are set by default. */ +void TS_RESP_CTX_add_flags(TS_RESP_CTX *ctx, int flags); + +/* Default callback always returns a constant. */ +void TS_RESP_CTX_set_serial_cb(TS_RESP_CTX *ctx, TS_serial_cb cb, void *data); + +/* Default callback uses the gettimeofday() and gmtime() system calls. */ +void TS_RESP_CTX_set_time_cb(TS_RESP_CTX *ctx, TS_time_cb cb, void *data); + +/* + * Default callback rejects all extensions. The extension callback is called + * when the TS_TST_INFO object is already set up and not signed yet. + */ +/* FIXME: extension handling is not tested yet. */ +void TS_RESP_CTX_set_extension_cb(TS_RESP_CTX *ctx, + TS_extension_cb cb, void *data); + +/* The following methods can be used in the callbacks. */ +int TS_RESP_CTX_set_status_info(TS_RESP_CTX *ctx, + int status, const char *text); + +/* Sets the status info only if it is still TS_STATUS_GRANTED. */ +int TS_RESP_CTX_set_status_info_cond(TS_RESP_CTX *ctx, + int status, const char *text); + +int TS_RESP_CTX_add_failure_info(TS_RESP_CTX *ctx, int failure); + +/* The get methods below can be used in the extension callback. */ +TS_REQ *TS_RESP_CTX_get_request(TS_RESP_CTX *ctx); + +TS_TST_INFO *TS_RESP_CTX_get_tst_info(TS_RESP_CTX *ctx); + +/* + * Creates the signed TS_TST_INFO and puts it in TS_RESP. + * In case of errors it sets the status info properly. + * Returns NULL only in case of memory allocation/fatal error. + */ +TS_RESP *TS_RESP_create_response(TS_RESP_CTX *ctx, BIO *req_bio); + +/* + * Declarations related to response verification, + * they are defined in ts/ts_resp_verify.c. + */ + +int TS_RESP_verify_signature(PKCS7 *token, STACK_OF(X509) *certs, + X509_STORE *store, X509 **signer_out); + +/* Context structure for the generic verify method. */ + +/* Verify the signer's certificate and the signature of the response. */ +#define TS_VFY_SIGNATURE (1u << 0) +/* Verify the version number of the response. */ +#define TS_VFY_VERSION (1u << 1) +/* Verify if the policy supplied by the user matches the policy of the TSA. */ +#define TS_VFY_POLICY (1u << 2) +/* + * Verify the message imprint provided by the user. This flag should not be + * specified with TS_VFY_DATA. + */ +#define TS_VFY_IMPRINT (1u << 3) +/* + * Verify the message imprint computed by the verify method from the user + * provided data and the MD algorithm of the response. This flag should not + * be specified with TS_VFY_IMPRINT. + */ +#define TS_VFY_DATA (1u << 4) +/* Verify the nonce value. */ +#define TS_VFY_NONCE (1u << 5) +/* Verify if the TSA name field matches the signer certificate. */ +#define TS_VFY_SIGNER (1u << 6) +/* Verify if the TSA name field equals to the user provided name. */ +#define TS_VFY_TSA_NAME (1u << 7) + +/* You can use the following convenience constants. */ +#define TS_VFY_ALL_IMPRINT (TS_VFY_SIGNATURE \ + | TS_VFY_VERSION \ + | TS_VFY_POLICY \ + | TS_VFY_IMPRINT \ + | TS_VFY_NONCE \ + | TS_VFY_SIGNER \ + | TS_VFY_TSA_NAME) +#define TS_VFY_ALL_DATA (TS_VFY_SIGNATURE \ + | TS_VFY_VERSION \ + | TS_VFY_POLICY \ + | TS_VFY_DATA \ + | TS_VFY_NONCE \ + | TS_VFY_SIGNER \ + | TS_VFY_TSA_NAME) + +typedef struct TS_verify_ctx TS_VERIFY_CTX; + +int TS_RESP_verify_response(TS_VERIFY_CTX *ctx, TS_RESP *response); +int TS_RESP_verify_token(TS_VERIFY_CTX *ctx, PKCS7 *token); + +/* + * Declarations related to response verification context, + */ +TS_VERIFY_CTX *TS_VERIFY_CTX_new(void); +void TS_VERIFY_CTX_init(TS_VERIFY_CTX *ctx); +void TS_VERIFY_CTX_free(TS_VERIFY_CTX *ctx); +void TS_VERIFY_CTX_cleanup(TS_VERIFY_CTX *ctx); +int TS_VERIFY_CTX_set_flags(TS_VERIFY_CTX *ctx, int f); +int TS_VERIFY_CTX_add_flags(TS_VERIFY_CTX *ctx, int f); +#ifndef OPENSSL_NO_DEPRECATED_3_4 +OSSL_DEPRECATEDIN_3_4_FOR("Unclear semantics, replace with TS_VERIFY_CTX_set0_data().") +BIO *TS_VERIFY_CTX_set_data(TS_VERIFY_CTX *ctx, BIO *b); +#endif +int TS_VERIFY_CTX_set0_data(TS_VERIFY_CTX *ctx, BIO *b); +#ifndef OPENSSL_NO_DEPRECATED_3_4 +OSSL_DEPRECATEDIN_3_4_FOR("Unclear semantics, replace with TS_VERIFY_CTX_set0_imprint().") +unsigned char *TS_VERIFY_CTX_set_imprint(TS_VERIFY_CTX *ctx, + unsigned char *hexstr, long len); +#endif +int TS_VERIFY_CTX_set0_imprint(TS_VERIFY_CTX *ctx, + unsigned char *hexstr, long len); +#ifndef OPENSSL_NO_DEPRECATED_3_4 +OSSL_DEPRECATEDIN_3_4_FOR("Unclear semantics, replace with TS_VERIFY_CTX_set0_store().") +X509_STORE *TS_VERIFY_CTX_set_store(TS_VERIFY_CTX *ctx, X509_STORE *s); +#endif +int TS_VERIFY_CTX_set0_store(TS_VERIFY_CTX *ctx, X509_STORE *s); +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define TS_VERIFY_CTS_set_certs(ctx, cert) TS_VERIFY_CTX_set_certs(ctx, cert) +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_4 +OSSL_DEPRECATEDIN_3_4_FOR("Unclear semantics, replace with TS_VERIFY_CTX_set0_certs().") +STACK_OF(X509) *TS_VERIFY_CTX_set_certs(TS_VERIFY_CTX *ctx, STACK_OF(X509) *certs); +#endif +int TS_VERIFY_CTX_set0_certs(TS_VERIFY_CTX *ctx, STACK_OF(X509) *certs); + +/*- + * If ctx is NULL, it allocates and returns a new object, otherwise + * it returns ctx. It initialises all the members as follows: + * flags = TS_VFY_ALL_IMPRINT & ~(TS_VFY_TSA_NAME | TS_VFY_SIGNATURE) + * certs = NULL + * store = NULL + * policy = policy from the request or NULL if absent (in this case + * TS_VFY_POLICY is cleared from flags as well) + * md_alg = MD algorithm from request + * imprint, imprint_len = imprint from request + * data = NULL + * nonce, nonce_len = nonce from the request or NULL if absent (in this case + * TS_VFY_NONCE is cleared from flags as well) + * tsa_name = NULL + * Important: after calling this method TS_VFY_SIGNATURE should be added! + */ +TS_VERIFY_CTX *TS_REQ_to_TS_VERIFY_CTX(TS_REQ *req, TS_VERIFY_CTX *ctx); + +/* Function declarations for TS_RESP defined in ts/ts_resp_print.c */ + +int TS_RESP_print_bio(BIO *bio, TS_RESP *a); +int TS_STATUS_INFO_print_bio(BIO *bio, TS_STATUS_INFO *a); +int TS_TST_INFO_print_bio(BIO *bio, TS_TST_INFO *a); + +/* Common utility functions defined in ts/ts_lib.c */ + +int TS_ASN1_INTEGER_print_bio(BIO *bio, const ASN1_INTEGER *num); +int TS_OBJ_print_bio(BIO *bio, const ASN1_OBJECT *obj); +int TS_ext_print_bio(BIO *bio, const STACK_OF(X509_EXTENSION) *extensions); +int TS_X509_ALGOR_print_bio(BIO *bio, const X509_ALGOR *alg); +int TS_MSG_IMPRINT_print_bio(BIO *bio, TS_MSG_IMPRINT *msg); + +/* + * Function declarations for handling configuration options, defined in + * ts/ts_conf.c + */ + +X509 *TS_CONF_load_cert(const char *file); +STACK_OF(X509) *TS_CONF_load_certs(const char *file); +EVP_PKEY *TS_CONF_load_key(const char *file, const char *pass); +const char *TS_CONF_get_tsa_section(CONF *conf, const char *section); +int TS_CONF_set_serial(CONF *conf, const char *section, TS_serial_cb cb, + TS_RESP_CTX *ctx); +#ifndef OPENSSL_NO_ENGINE +int TS_CONF_set_crypto_device(CONF *conf, const char *section, + const char *device); +int TS_CONF_set_default_engine(const char *name); +#endif +int TS_CONF_set_signer_cert(CONF *conf, const char *section, + const char *cert, TS_RESP_CTX *ctx); +int TS_CONF_set_certs(CONF *conf, const char *section, const char *certs, + TS_RESP_CTX *ctx); +int TS_CONF_set_signer_key(CONF *conf, const char *section, + const char *key, const char *pass, + TS_RESP_CTX *ctx); +int TS_CONF_set_signer_digest(CONF *conf, const char *section, + const char *md, TS_RESP_CTX *ctx); +int TS_CONF_set_def_policy(CONF *conf, const char *section, + const char *policy, TS_RESP_CTX *ctx); +int TS_CONF_set_policies(CONF *conf, const char *section, TS_RESP_CTX *ctx); +int TS_CONF_set_digests(CONF *conf, const char *section, TS_RESP_CTX *ctx); +int TS_CONF_set_accuracy(CONF *conf, const char *section, TS_RESP_CTX *ctx); +int TS_CONF_set_clock_precision_digits(const CONF *conf, const char *section, + TS_RESP_CTX *ctx); +int TS_CONF_set_ordering(CONF *conf, const char *section, TS_RESP_CTX *ctx); +int TS_CONF_set_tsa_name(CONF *conf, const char *section, TS_RESP_CTX *ctx); +int TS_CONF_set_ess_cert_id_chain(CONF *conf, const char *section, + TS_RESP_CTX *ctx); +int TS_CONF_set_ess_cert_id_digest(CONF *conf, const char *section, + TS_RESP_CTX *ctx); + +#ifdef __cplusplus +} +#endif +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/tserr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/tserr.h new file mode 100644 index 0000000000000000000000000000000000000000..0bec94a37cd3672cdd5e6f4056f78f8410813312 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/tserr.h @@ -0,0 +1,65 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_TSERR_H +#define OPENSSL_TSERR_H +#pragma once + +#include +#include +#include + +#ifndef OPENSSL_NO_TS + +/* + * TS reason codes. + */ +#define TS_R_BAD_PKCS7_TYPE 132 +#define TS_R_BAD_TYPE 133 +#define TS_R_CANNOT_LOAD_CERT 137 +#define TS_R_CANNOT_LOAD_KEY 138 +#define TS_R_CERTIFICATE_VERIFY_ERROR 100 +#define TS_R_COULD_NOT_SET_ENGINE 127 +#define TS_R_COULD_NOT_SET_TIME 115 +#define TS_R_DETACHED_CONTENT 134 +#define TS_R_ESS_ADD_SIGNING_CERT_ERROR 116 +#define TS_R_ESS_ADD_SIGNING_CERT_V2_ERROR 139 +#define TS_R_ESS_SIGNING_CERTIFICATE_ERROR 101 +#define TS_R_INVALID_NULL_POINTER 102 +#define TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE 117 +#define TS_R_MESSAGE_IMPRINT_MISMATCH 103 +#define TS_R_NONCE_MISMATCH 104 +#define TS_R_NONCE_NOT_RETURNED 105 +#define TS_R_NO_CONTENT 106 +#define TS_R_NO_TIME_STAMP_TOKEN 107 +#define TS_R_PKCS7_ADD_SIGNATURE_ERROR 118 +#define TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR 119 +#define TS_R_PKCS7_TO_TS_TST_INFO_FAILED 129 +#define TS_R_POLICY_MISMATCH 108 +#define TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 120 +#define TS_R_RESPONSE_SETUP_ERROR 121 +#define TS_R_SIGNATURE_FAILURE 109 +#define TS_R_THERE_MUST_BE_ONE_SIGNER 110 +#define TS_R_TIME_SYSCALL_ERROR 122 +#define TS_R_TOKEN_NOT_PRESENT 130 +#define TS_R_TOKEN_PRESENT 131 +#define TS_R_TSA_NAME_MISMATCH 111 +#define TS_R_TSA_UNTRUSTED 112 +#define TS_R_TST_INFO_SETUP_ERROR 123 +#define TS_R_TS_DATASIGN 124 +#define TS_R_UNACCEPTABLE_POLICY 125 +#define TS_R_UNSUPPORTED_MD_ALGORITHM 126 +#define TS_R_UNSUPPORTED_VERSION 113 +#define TS_R_VAR_BAD_VALUE 135 +#define TS_R_VAR_LOOKUP_FAILURE 136 +#define TS_R_WRONG_CONTENT_TYPE 114 + +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/txt_db.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/txt_db.h new file mode 100644 index 0000000000000000000000000000000000000000..64e9d4c04e7646ca931206adee5e2385abb712bc --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/txt_db.h @@ -0,0 +1,63 @@ +/* + * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_TXT_DB_H +#define OPENSSL_TXT_DB_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_TXT_DB_H +#endif + +#include +#include +#include +#include + +#define DB_ERROR_OK 0 +#define DB_ERROR_MALLOC 1 +#define DB_ERROR_INDEX_CLASH 2 +#define DB_ERROR_INDEX_OUT_OF_RANGE 3 +#define DB_ERROR_NO_INDEX 4 +#define DB_ERROR_INSERT_INDEX_CLASH 5 +#define DB_ERROR_WRONG_NUM_FIELDS 6 + +#ifdef __cplusplus +extern "C" { +#endif + +typedef OPENSSL_STRING *OPENSSL_PSTRING; +DEFINE_SPECIAL_STACK_OF(OPENSSL_PSTRING, OPENSSL_STRING) + +typedef struct txt_db_st { + int num_fields; + STACK_OF(OPENSSL_PSTRING) *data; + LHASH_OF(OPENSSL_STRING) **index; + int (**qual)(OPENSSL_STRING *); + long error; + long arg1; + long arg2; + OPENSSL_STRING *arg_row; +} TXT_DB; + +TXT_DB *TXT_DB_read(BIO *in, int num); +long TXT_DB_write(BIO *out, TXT_DB *db); +int TXT_DB_create_index(TXT_DB *db, int field, int (*qual)(OPENSSL_STRING *), + OPENSSL_LH_HASHFUNC hash, OPENSSL_LH_COMPFUNC cmp); +void TXT_DB_free(TXT_DB *db); +OPENSSL_STRING *TXT_DB_get_by_index(TXT_DB *db, int idx, + OPENSSL_STRING *value); +int TXT_DB_insert(TXT_DB *db, OPENSSL_STRING *value); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/types.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/types.h new file mode 100644 index 0000000000000000000000000000000000000000..f9c4373567695819aa3832380b1f032b156bb07d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/types.h @@ -0,0 +1,250 @@ +/* + * Copyright 2001-2026 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* + * Unfortunate workaround to avoid symbol conflict with wincrypt.h + * See https://github.com/openssl/openssl/issues/9981 + */ +#ifdef _WIN32 +#define WINCRYPT_USE_SYMBOL_PREFIX +#undef X509_NAME +#undef X509_EXTENSIONS +#undef PKCS7_SIGNER_INFO +#undef OCSP_REQUEST +#undef OCSP_RESPONSE +#endif + +#ifndef OPENSSL_TYPES_H +#define OPENSSL_TYPES_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +#if OPENSSL_VERSION_MAJOR >= 4 +#define OSSL_FUTURE_CONST const +#else +#define OSSL_FUTURE_CONST +#endif + +typedef struct ossl_provider_st OSSL_PROVIDER; /* Provider Object */ + +#ifdef NO_ASN1_TYPEDEFS +#define ASN1_INTEGER ASN1_STRING +#define ASN1_ENUMERATED ASN1_STRING +#define ASN1_BIT_STRING ASN1_STRING +#define ASN1_OCTET_STRING ASN1_STRING +#define ASN1_PRINTABLESTRING ASN1_STRING +#define ASN1_T61STRING ASN1_STRING +#define ASN1_IA5STRING ASN1_STRING +#define ASN1_UTCTIME ASN1_STRING +#define ASN1_GENERALIZEDTIME ASN1_STRING +#define ASN1_TIME ASN1_STRING +#define ASN1_GENERALSTRING ASN1_STRING +#define ASN1_UNIVERSALSTRING ASN1_STRING +#define ASN1_BMPSTRING ASN1_STRING +#define ASN1_VISIBLESTRING ASN1_STRING +#define ASN1_UTF8STRING ASN1_STRING +#define ASN1_BOOLEAN int +#define ASN1_NULL int +#else +typedef struct asn1_string_st ASN1_INTEGER; +typedef struct asn1_string_st ASN1_ENUMERATED; +typedef struct asn1_string_st ASN1_BIT_STRING; +typedef struct asn1_string_st ASN1_OCTET_STRING; +typedef struct asn1_string_st ASN1_PRINTABLESTRING; +typedef struct asn1_string_st ASN1_T61STRING; +typedef struct asn1_string_st ASN1_IA5STRING; +typedef struct asn1_string_st ASN1_GENERALSTRING; +typedef struct asn1_string_st ASN1_UNIVERSALSTRING; +typedef struct asn1_string_st ASN1_BMPSTRING; +typedef struct asn1_string_st ASN1_UTCTIME; +typedef struct asn1_string_st ASN1_TIME; +typedef struct asn1_string_st ASN1_GENERALIZEDTIME; +typedef struct asn1_string_st ASN1_VISIBLESTRING; +typedef struct asn1_string_st ASN1_UTF8STRING; +typedef struct asn1_string_st ASN1_STRING; +typedef int ASN1_BOOLEAN; +typedef int ASN1_NULL; +#endif + +typedef struct asn1_type_st ASN1_TYPE; +typedef struct asn1_object_st ASN1_OBJECT; +typedef struct asn1_string_table_st ASN1_STRING_TABLE; + +typedef struct ASN1_ITEM_st ASN1_ITEM; +typedef struct asn1_pctx_st ASN1_PCTX; +typedef struct asn1_sctx_st ASN1_SCTX; + +#ifdef BIGNUM +#undef BIGNUM +#endif + +typedef struct bio_st BIO; +typedef struct bignum_st BIGNUM; +typedef struct bignum_ctx BN_CTX; +typedef struct bn_blinding_st BN_BLINDING; +typedef struct bn_mont_ctx_st BN_MONT_CTX; +typedef struct bn_recp_ctx_st BN_RECP_CTX; +typedef struct bn_gencb_st BN_GENCB; + +typedef struct buf_mem_st BUF_MEM; + +STACK_OF(BIGNUM); +STACK_OF(BIGNUM_const); + +typedef struct err_state_st ERR_STATE; + +typedef struct evp_cipher_st EVP_CIPHER; +typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX; +typedef struct evp_md_st EVP_MD; +typedef struct evp_md_ctx_st EVP_MD_CTX; +typedef struct evp_mac_st EVP_MAC; +typedef struct evp_mac_ctx_st EVP_MAC_CTX; +typedef struct evp_pkey_st EVP_PKEY; +typedef struct evp_skey_st EVP_SKEY; + +typedef struct evp_pkey_asn1_method_st EVP_PKEY_ASN1_METHOD; + +typedef struct evp_pkey_method_st EVP_PKEY_METHOD; +typedef struct evp_pkey_ctx_st EVP_PKEY_CTX; + +typedef struct evp_keymgmt_st EVP_KEYMGMT; + +typedef struct evp_kdf_st EVP_KDF; +typedef struct evp_kdf_ctx_st EVP_KDF_CTX; + +typedef struct evp_rand_st EVP_RAND; +typedef struct evp_rand_ctx_st EVP_RAND_CTX; + +typedef struct evp_keyexch_st EVP_KEYEXCH; + +typedef struct evp_signature_st EVP_SIGNATURE; + +typedef struct evp_skeymgmt_st EVP_SKEYMGMT; + +typedef struct evp_asym_cipher_st EVP_ASYM_CIPHER; + +typedef struct evp_kem_st EVP_KEM; + +typedef struct evp_Encode_Ctx_st EVP_ENCODE_CTX; + +typedef struct hmac_ctx_st HMAC_CTX; + +typedef struct dh_st DH; +typedef struct dh_method DH_METHOD; + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +typedef struct dsa_st DSA; +typedef struct dsa_method DSA_METHOD; +#endif + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +typedef struct rsa_st RSA; +typedef struct rsa_meth_st RSA_METHOD; +#endif + +typedef struct rsa_pss_params_st RSA_PSS_PARAMS; +typedef struct rsa_oaep_params_st RSA_OAEP_PARAMS; + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +typedef struct ec_key_st EC_KEY; +typedef struct ec_key_method_st EC_KEY_METHOD; +#endif + +typedef struct rand_meth_st RAND_METHOD; +typedef struct rand_drbg_st RAND_DRBG; + +typedef struct ssl_dane_st SSL_DANE; +typedef struct x509_st X509; +typedef struct X509_algor_st X509_ALGOR; +typedef struct X509_crl_st X509_CRL; +typedef struct x509_crl_method_st X509_CRL_METHOD; +typedef struct x509_revoked_st X509_REVOKED; +typedef struct X509_name_st X509_NAME; +typedef struct X509_pubkey_st X509_PUBKEY; +typedef struct x509_store_st X509_STORE; +typedef struct x509_store_ctx_st X509_STORE_CTX; + +typedef struct x509_object_st X509_OBJECT; +typedef struct x509_lookup_st X509_LOOKUP; +typedef struct x509_lookup_method_st X509_LOOKUP_METHOD; +typedef struct X509_VERIFY_PARAM_st X509_VERIFY_PARAM; + +typedef struct x509_sig_info_st X509_SIG_INFO; + +typedef struct pkcs8_priv_key_info_st PKCS8_PRIV_KEY_INFO; + +typedef struct v3_ext_ctx X509V3_CTX; +typedef struct conf_st CONF; +typedef struct ossl_init_settings_st OPENSSL_INIT_SETTINGS; + +typedef struct ui_st UI; +typedef struct ui_method_st UI_METHOD; + +typedef struct engine_st ENGINE; +typedef struct ssl_st SSL; +typedef struct ssl_ctx_st SSL_CTX; + +typedef struct comp_ctx_st COMP_CTX; +typedef struct comp_method_st COMP_METHOD; + +typedef struct X509_POLICY_NODE_st X509_POLICY_NODE; +typedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL; +typedef struct X509_POLICY_TREE_st X509_POLICY_TREE; +typedef struct X509_POLICY_CACHE_st X509_POLICY_CACHE; + +typedef struct AUTHORITY_KEYID_st AUTHORITY_KEYID; +typedef struct DIST_POINT_st DIST_POINT; +typedef struct ISSUING_DIST_POINT_st ISSUING_DIST_POINT; +typedef struct NAME_CONSTRAINTS_st NAME_CONSTRAINTS; + +typedef struct crypto_ex_data_st CRYPTO_EX_DATA; + +typedef struct ossl_http_req_ctx_st OSSL_HTTP_REQ_CTX; +typedef struct ocsp_response_st OCSP_RESPONSE; +typedef struct ocsp_responder_id_st OCSP_RESPID; + +typedef struct sct_st SCT; +typedef struct sct_ctx_st SCT_CTX; +typedef struct ctlog_st CTLOG; +typedef struct ctlog_store_st CTLOG_STORE; +typedef struct ct_policy_eval_ctx_st CT_POLICY_EVAL_CTX; + +typedef struct ossl_store_info_st OSSL_STORE_INFO; +typedef struct ossl_store_search_st OSSL_STORE_SEARCH; + +typedef struct ossl_lib_ctx_st OSSL_LIB_CTX; + +typedef struct ossl_dispatch_st OSSL_DISPATCH; +typedef struct ossl_item_st OSSL_ITEM; +typedef struct ossl_algorithm_st OSSL_ALGORITHM; +typedef struct ossl_param_st OSSL_PARAM; +typedef struct ossl_param_bld_st OSSL_PARAM_BLD; + +typedef int pem_password_cb(char *buf, int size, int rwflag, void *userdata); + +typedef struct ossl_encoder_st OSSL_ENCODER; +typedef struct ossl_encoder_ctx_st OSSL_ENCODER_CTX; +typedef struct ossl_decoder_st OSSL_DECODER; +typedef struct ossl_decoder_ctx_st OSSL_DECODER_CTX; + +typedef struct ossl_self_test_st OSSL_SELF_TEST; + +#ifdef __cplusplus +} +#endif + +#endif /* OPENSSL_TYPES_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ui.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ui.h new file mode 100644 index 0000000000000000000000000000000000000000..20bc7e91817210c78fefc031fde8183dcd891282 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/ui.h @@ -0,0 +1,409 @@ +/* + * WARNING: do not edit! + * Generated by makefile from include\openssl\ui.h.in + * + * Copyright 2001-2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* clang-format off */ + +/* clang-format on */ + +#ifndef OPENSSL_UI_H +#define OPENSSL_UI_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_UI_H +#endif + +#include + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#include +#endif +#include +#include +#include +#include + +/* For compatibility reasons, the macro OPENSSL_NO_UI is currently retained */ +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#ifdef OPENSSL_NO_UI_CONSOLE +#define OPENSSL_NO_UI +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * All the following functions return -1 or NULL on error and in some cases + * (UI_process()) -2 if interrupted or in some other way cancelled. When + * everything is fine, they return 0, a positive value or a non-NULL pointer, + * all depending on their purpose. + */ + +/* Creators and destructor. */ +UI *UI_new(void); +UI *UI_new_method(const UI_METHOD *method); +void UI_free(UI *ui); + +/*- + The following functions are used to add strings to be printed and prompt + strings to prompt for data. The names are UI_{add,dup}__string + and UI_{add,dup}_input_boolean. + + UI_{add,dup}__string have the following meanings: + add add a text or prompt string. The pointers given to these + functions are used verbatim, no copying is done. + dup make a copy of the text or prompt string, then add the copy + to the collection of strings in the user interface. + + The function is a name for the functionality that the given + string shall be used for. It can be one of: + input use the string as data prompt. + verify use the string as verification prompt. This + is used to verify a previous input. + info use the string for informational output. + error use the string for error output. + Honestly, there's currently no difference between info and error for the + moment. + + UI_{add,dup}_input_boolean have the same semantics for "add" and "dup", + and are typically used when one wants to prompt for a yes/no response. + + All of the functions in this group take a UI and a prompt string. + The string input and verify addition functions also take a flag argument, + a buffer for the result to end up with, a minimum input size and a maximum + input size (the result buffer MUST be large enough to be able to contain + the maximum number of characters). Additionally, the verify addition + functions takes another buffer to compare the result against. + The boolean input functions take an action description string (which should + be safe to ignore if the expected user action is obvious, for example with + a dialog box with an OK button and a Cancel button), a string of acceptable + characters to mean OK and to mean Cancel. The two last strings are checked + to make sure they don't have common characters. Additionally, the same + flag argument as for the string input is taken, as well as a result buffer. + The result buffer is required to be at least one byte long. Depending on + the answer, the first character from the OK or the Cancel character strings + will be stored in the first byte of the result buffer. No NUL will be + added, so the result is *not* a string. + + On success, the all return an index of the added information. That index + is useful when retrieving results with UI_get0_result(). */ +int UI_add_input_string(UI *ui, const char *prompt, int flags, + char *result_buf, int minsize, int maxsize); +int UI_dup_input_string(UI *ui, const char *prompt, int flags, + char *result_buf, int minsize, int maxsize); +int UI_add_verify_string(UI *ui, const char *prompt, int flags, + char *result_buf, int minsize, int maxsize, + const char *test_buf); +int UI_dup_verify_string(UI *ui, const char *prompt, int flags, + char *result_buf, int minsize, int maxsize, + const char *test_buf); +int UI_add_input_boolean(UI *ui, const char *prompt, const char *action_desc, + const char *ok_chars, const char *cancel_chars, + int flags, char *result_buf); +int UI_dup_input_boolean(UI *ui, const char *prompt, const char *action_desc, + const char *ok_chars, const char *cancel_chars, + int flags, char *result_buf); +int UI_add_info_string(UI *ui, const char *text); +int UI_dup_info_string(UI *ui, const char *text); +int UI_add_error_string(UI *ui, const char *text); +int UI_dup_error_string(UI *ui, const char *text); + +/* These are the possible flags. They can be or'ed together. */ +/* Use to have echoing of input */ +#define UI_INPUT_FLAG_ECHO 0x01 +/* + * Use a default password. Where that password is found is completely up to + * the application, it might for example be in the user data set with + * UI_add_user_data(). It is not recommended to have more than one input in + * each UI being marked with this flag, or the application might get + * confused. + */ +#define UI_INPUT_FLAG_DEFAULT_PWD 0x02 + +/*- + * The user of these routines may want to define flags of their own. The core + * UI won't look at those, but will pass them on to the method routines. They + * must use higher bits so they don't get confused with the UI bits above. + * UI_INPUT_FLAG_USER_BASE tells which is the lowest bit to use. A good + * example of use is this: + * + * #define MY_UI_FLAG1 (0x01 << UI_INPUT_FLAG_USER_BASE) + * + */ +#define UI_INPUT_FLAG_USER_BASE 16 + +/*- + * The following function helps construct a prompt. + * phrase_desc is a textual short description of the phrase to enter, + * for example "pass phrase", and + * object_name is the name of the object + * (which might be a card name or a file name) or NULL. + * The returned string shall always be allocated on the heap with + * OPENSSL_malloc(), and need to be free'd with OPENSSL_free(). + * + * If the ui_method doesn't contain a pointer to a user-defined prompt + * constructor, a default string is built, looking like this: + * + * "Enter {phrase_desc} for {object_name}:" + * + * So, if phrase_desc has the value "pass phrase" and object_name has + * the value "foo.key", the resulting string is: + * + * "Enter pass phrase for foo.key:" + */ +char *UI_construct_prompt(UI *ui_method, + const char *phrase_desc, const char *object_name); + +/* + * The following function is used to store a pointer to user-specific data. + * Any previous such pointer will be returned and replaced. + * + * For callback purposes, this function makes a lot more sense than using + * ex_data, since the latter requires that different parts of OpenSSL or + * applications share the same ex_data index. + * + * Note that the UI_OpenSSL() method completely ignores the user data. Other + * methods may not, however. + */ +void *UI_add_user_data(UI *ui, void *user_data); +/* + * Alternatively, this function is used to duplicate the user data. + * This uses the duplicator method function. The destroy function will + * be used to free the user data in this case. + */ +int UI_dup_user_data(UI *ui, void *user_data); +/* We need a user data retrieving function as well. */ +void *UI_get0_user_data(UI *ui); + +/* Return the result associated with a prompt given with the index i. */ +const char *UI_get0_result(UI *ui, int i); +int UI_get_result_length(UI *ui, int i); + +/* When all strings have been added, process the whole thing. */ +int UI_process(UI *ui); + +/* + * Give a user interface parameterised control commands. This can be used to + * send down an integer, a data pointer or a function pointer, as well as be + * used to get information from a UI. + */ +int UI_ctrl(UI *ui, int cmd, long i, void *p, void (*f)(void)); + +/* The commands */ +/* + * Use UI_CONTROL_PRINT_ERRORS with the value 1 to have UI_process print the + * OpenSSL error stack before printing any info or added error messages and + * before any prompting. + */ +#define UI_CTRL_PRINT_ERRORS 1 +/* + * Check if a UI_process() is possible to do again with the same instance of + * a user interface. This makes UI_ctrl() return 1 if it is redoable, and 0 + * if not. + */ +#define UI_CTRL_IS_REDOABLE 2 + +/* Some methods may use extra data */ +#define UI_set_app_data(s, arg) UI_set_ex_data(s, 0, arg) +#define UI_get_app_data(s) UI_get_ex_data(s, 0) + +#define UI_get_ex_new_index(l, p, newf, dupf, freef) \ + CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_UI, l, p, newf, dupf, freef) +int UI_set_ex_data(UI *r, int idx, void *arg); +void *UI_get_ex_data(const UI *r, int idx); + +/* Use specific methods instead of the built-in one */ +void UI_set_default_method(const UI_METHOD *meth); +const UI_METHOD *UI_get_default_method(void); +const UI_METHOD *UI_get_method(UI *ui); +const UI_METHOD *UI_set_method(UI *ui, const UI_METHOD *meth); + +#ifndef OPENSSL_NO_UI_CONSOLE + +/* The method with all the built-in thingies */ +UI_METHOD *UI_OpenSSL(void); + +#endif + +/* + * NULL method. Literally does nothing, but may serve as a placeholder + * to avoid internal default. + */ +const UI_METHOD *UI_null(void); + +/* ---------- For method writers ---------- */ +/*- + A method contains a number of functions that implement the low level + of the User Interface. The functions are: + + an opener This function starts a session, maybe by opening + a channel to a tty, or by opening a window. + a writer This function is called to write a given string, + maybe to the tty, maybe as a field label in a + window. + a flusher This function is called to flush everything that + has been output so far. It can be used to actually + display a dialog box after it has been built. + a reader This function is called to read a given prompt, + maybe from the tty, maybe from a field in a + window. Note that it's called with all string + structures, not only the prompt ones, so it must + check such things itself. + a closer This function closes the session, maybe by closing + the channel to the tty, or closing the window. + + All these functions are expected to return: + + 0 on error. + 1 on success. + -1 on out-of-band events, for example if some prompting has + been canceled (by pressing Ctrl-C, for example). This is + only checked when returned by the flusher or the reader. + + The way this is used, the opener is first called, then the writer for all + strings, then the flusher, then the reader for all strings and finally the + closer. Note that if you want to prompt from a terminal or other command + line interface, the best is to have the reader also write the prompts + instead of having the writer do it. If you want to prompt from a dialog + box, the writer can be used to build up the contents of the box, and the + flusher to actually display the box and run the event loop until all data + has been given, after which the reader only grabs the given data and puts + them back into the UI strings. + + All method functions take a UI as argument. Additionally, the writer and + the reader take a UI_STRING. +*/ + +/* + * The UI_STRING type is the data structure that contains all the needed info + * about a string or a prompt, including test data for a verification prompt. + */ +typedef struct ui_string_st UI_STRING; + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(UI_STRING, UI_STRING, UI_STRING) +#define sk_UI_STRING_num(sk) OPENSSL_sk_num(ossl_check_const_UI_STRING_sk_type(sk)) +#define sk_UI_STRING_value(sk, idx) ((UI_STRING *)OPENSSL_sk_value(ossl_check_const_UI_STRING_sk_type(sk), (idx))) +#define sk_UI_STRING_new(cmp) ((STACK_OF(UI_STRING) *)OPENSSL_sk_new(ossl_check_UI_STRING_compfunc_type(cmp))) +#define sk_UI_STRING_new_null() ((STACK_OF(UI_STRING) *)OPENSSL_sk_new_null()) +#define sk_UI_STRING_new_reserve(cmp, n) ((STACK_OF(UI_STRING) *)OPENSSL_sk_new_reserve(ossl_check_UI_STRING_compfunc_type(cmp), (n))) +#define sk_UI_STRING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_UI_STRING_sk_type(sk), (n)) +#define sk_UI_STRING_free(sk) OPENSSL_sk_free(ossl_check_UI_STRING_sk_type(sk)) +#define sk_UI_STRING_zero(sk) OPENSSL_sk_zero(ossl_check_UI_STRING_sk_type(sk)) +#define sk_UI_STRING_delete(sk, i) ((UI_STRING *)OPENSSL_sk_delete(ossl_check_UI_STRING_sk_type(sk), (i))) +#define sk_UI_STRING_delete_ptr(sk, ptr) ((UI_STRING *)OPENSSL_sk_delete_ptr(ossl_check_UI_STRING_sk_type(sk), ossl_check_UI_STRING_type(ptr))) +#define sk_UI_STRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_UI_STRING_sk_type(sk), ossl_check_UI_STRING_type(ptr)) +#define sk_UI_STRING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_UI_STRING_sk_type(sk), ossl_check_UI_STRING_type(ptr)) +#define sk_UI_STRING_pop(sk) ((UI_STRING *)OPENSSL_sk_pop(ossl_check_UI_STRING_sk_type(sk))) +#define sk_UI_STRING_shift(sk) ((UI_STRING *)OPENSSL_sk_shift(ossl_check_UI_STRING_sk_type(sk))) +#define sk_UI_STRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_UI_STRING_sk_type(sk), ossl_check_UI_STRING_freefunc_type(freefunc)) +#define sk_UI_STRING_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_UI_STRING_sk_type(sk), ossl_check_UI_STRING_type(ptr), (idx)) +#define sk_UI_STRING_set(sk, idx, ptr) ((UI_STRING *)OPENSSL_sk_set(ossl_check_UI_STRING_sk_type(sk), (idx), ossl_check_UI_STRING_type(ptr))) +#define sk_UI_STRING_find(sk, ptr) OPENSSL_sk_find(ossl_check_UI_STRING_sk_type(sk), ossl_check_UI_STRING_type(ptr)) +#define sk_UI_STRING_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_UI_STRING_sk_type(sk), ossl_check_UI_STRING_type(ptr)) +#define sk_UI_STRING_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_UI_STRING_sk_type(sk), ossl_check_UI_STRING_type(ptr), pnum) +#define sk_UI_STRING_sort(sk) OPENSSL_sk_sort(ossl_check_UI_STRING_sk_type(sk)) +#define sk_UI_STRING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_UI_STRING_sk_type(sk)) +#define sk_UI_STRING_dup(sk) ((STACK_OF(UI_STRING) *)OPENSSL_sk_dup(ossl_check_const_UI_STRING_sk_type(sk))) +#define sk_UI_STRING_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(UI_STRING) *)OPENSSL_sk_deep_copy(ossl_check_const_UI_STRING_sk_type(sk), ossl_check_UI_STRING_copyfunc_type(copyfunc), ossl_check_UI_STRING_freefunc_type(freefunc))) +#define sk_UI_STRING_set_cmp_func(sk, cmp) ((sk_UI_STRING_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_UI_STRING_sk_type(sk), ossl_check_UI_STRING_compfunc_type(cmp))) + +/* clang-format on */ + +/* + * The different types of strings that are currently supported. This is only + * needed by method authors. + */ +enum UI_string_types { + UIT_NONE = 0, + UIT_PROMPT, /* Prompt for a string */ + UIT_VERIFY, /* Prompt for a string and verify */ + UIT_BOOLEAN, /* Prompt for a yes/no response */ + UIT_INFO, /* Send info to the user */ + UIT_ERROR /* Send an error message to the user */ +}; + +/* Create and manipulate methods */ +UI_METHOD *UI_create_method(const char *name); +void UI_destroy_method(UI_METHOD *ui_method); +int UI_method_set_opener(UI_METHOD *method, int (*opener)(UI *ui)); +int UI_method_set_writer(UI_METHOD *method, + int (*writer)(UI *ui, UI_STRING *uis)); +int UI_method_set_flusher(UI_METHOD *method, int (*flusher)(UI *ui)); +int UI_method_set_reader(UI_METHOD *method, + int (*reader)(UI *ui, UI_STRING *uis)); +int UI_method_set_closer(UI_METHOD *method, int (*closer)(UI *ui)); +int UI_method_set_data_duplicator(UI_METHOD *method, + void *(*duplicator)(UI *ui, void *ui_data), + void (*destructor)(UI *ui, void *ui_data)); +int UI_method_set_prompt_constructor(UI_METHOD *method, + char *(*prompt_constructor)(UI *ui, + const char + *phrase_desc, + const char + *object_name)); +int UI_method_set_ex_data(UI_METHOD *method, int idx, void *data); +int (*UI_method_get_opener(const UI_METHOD *method))(UI *); +int (*UI_method_get_writer(const UI_METHOD *method))(UI *, UI_STRING *); +int (*UI_method_get_flusher(const UI_METHOD *method))(UI *); +int (*UI_method_get_reader(const UI_METHOD *method))(UI *, UI_STRING *); +int (*UI_method_get_closer(const UI_METHOD *method))(UI *); +char *(*UI_method_get_prompt_constructor(const UI_METHOD *method))(UI *, const char *, const char *); +void *(*UI_method_get_data_duplicator(const UI_METHOD *method))(UI *, void *); +void (*UI_method_get_data_destructor(const UI_METHOD *method))(UI *, void *); +const void *UI_method_get_ex_data(const UI_METHOD *method, int idx); + +/* + * The following functions are helpers for method writers to access relevant + * data from a UI_STRING. + */ + +/* Return type of the UI_STRING */ +enum UI_string_types UI_get_string_type(UI_STRING *uis); +/* Return input flags of the UI_STRING */ +int UI_get_input_flags(UI_STRING *uis); +/* Return the actual string to output (the prompt, info or error) */ +const char *UI_get0_output_string(UI_STRING *uis); +/* + * Return the optional action string to output (the boolean prompt + * instruction) + */ +const char *UI_get0_action_string(UI_STRING *uis); +/* Return the result of a prompt */ +const char *UI_get0_result_string(UI_STRING *uis); +int UI_get_result_string_length(UI_STRING *uis); +/* + * Return the string to test the result against. Only useful with verifies. + */ +const char *UI_get0_test_string(UI_STRING *uis); +/* Return the required minimum size of the result */ +int UI_get_result_minsize(UI_STRING *uis); +/* Return the required maximum size of the result */ +int UI_get_result_maxsize(UI_STRING *uis); +/* Set the result of a UI_STRING. */ +int UI_set_result(UI *ui, UI_STRING *uis, const char *result); +int UI_set_result_ex(UI *ui, UI_STRING *uis, const char *result, int len); + +/* A couple of popular utility functions */ +int UI_UTIL_read_pw_string(char *buf, int length, const char *prompt, + int verify); +int UI_UTIL_read_pw(char *buf, char *buff, int size, const char *prompt, + int verify); +UI_METHOD *UI_UTIL_wrap_read_pem_callback(pem_password_cb *cb, int rwflag); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/uierr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/uierr.h new file mode 100644 index 0000000000000000000000000000000000000000..5201b0311df6f473205ac8f37a330b5c5be2583d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/uierr.h @@ -0,0 +1,36 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_UIERR_H +#define OPENSSL_UIERR_H +#pragma once + +#include +#include +#include + +/* + * UI reason codes. + */ +#define UI_R_COMMON_OK_AND_CANCEL_CHARACTERS 104 +#define UI_R_INDEX_TOO_LARGE 102 +#define UI_R_INDEX_TOO_SMALL 103 +#define UI_R_NO_RESULT_BUFFER 105 +#define UI_R_PROCESSING_ERROR 107 +#define UI_R_RESULT_TOO_LARGE 100 +#define UI_R_RESULT_TOO_SMALL 101 +#define UI_R_SYSASSIGN_ERROR 109 +#define UI_R_SYSDASSGN_ERROR 110 +#define UI_R_SYSQIOW_ERROR 111 +#define UI_R_UNKNOWN_CONTROL_COMMAND 106 +#define UI_R_UNKNOWN_TTYGET_ERRNO_VALUE 108 +#define UI_R_USER_DATA_DUPLICATION_UNSUPPORTED 112 + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/whrlpool.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/whrlpool.h new file mode 100644 index 0000000000000000000000000000000000000000..cff913453fdd49f5f9fb52643dd04186cd295e31 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/whrlpool.h @@ -0,0 +1,62 @@ +/* + * Copyright 2005-2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_WHRLPOOL_H +#define OPENSSL_WHRLPOOL_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_WHRLPOOL_H +#endif + +#include + +#ifndef OPENSSL_NO_WHIRLPOOL +#include +#include +#ifdef __cplusplus +extern "C" { +#endif + +#define WHIRLPOOL_DIGEST_LENGTH (512 / 8) + +#if !defined(OPENSSL_NO_DEPRECATED_3_0) + +#define WHIRLPOOL_BBLOCK 512 +#define WHIRLPOOL_COUNTER (256 / 8) + +typedef struct { + union { + unsigned char c[WHIRLPOOL_DIGEST_LENGTH]; + /* double q is here to ensure 64-bit alignment */ + double q[WHIRLPOOL_DIGEST_LENGTH / sizeof(double)]; + } H; + unsigned char data[WHIRLPOOL_BBLOCK / 8]; + unsigned int bitoff; + size_t bitlen[WHIRLPOOL_COUNTER / sizeof(size_t)]; +} WHIRLPOOL_CTX; +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int WHIRLPOOL_Init(WHIRLPOOL_CTX *c); +OSSL_DEPRECATEDIN_3_0 int WHIRLPOOL_Update(WHIRLPOOL_CTX *c, + const void *inp, size_t bytes); +OSSL_DEPRECATEDIN_3_0 void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c, + const void *inp, size_t bits); +OSSL_DEPRECATEDIN_3_0 int WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c); +OSSL_DEPRECATEDIN_3_0 unsigned char *WHIRLPOOL(const void *inp, size_t bytes, + unsigned char *md); +#endif + +#ifdef __cplusplus +} +#endif +#endif + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/x509.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/x509.h new file mode 100644 index 0000000000000000000000000000000000000000..1b2da14e3da7be5e7d80d9961b8c132175217a4b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/x509.h @@ -0,0 +1,1302 @@ +/* + * WARNING: do not edit! + * Generated by makefile from include\openssl\x509.h.in + * + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. + * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* clang-format off */ + +/* clang-format on */ + +#ifndef OPENSSL_X509_H +#define OPENSSL_X509_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_X509_H +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#include +#include +#include +#endif + +#include +#include +#ifndef OPENSSL_NO_STDIO +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Needed stacks for types defined in other headers */ +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(X509_NAME, X509_NAME, X509_NAME) +#define sk_X509_NAME_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_sk_type(sk)) +#define sk_X509_NAME_value(sk, idx) ((X509_NAME *)OPENSSL_sk_value(ossl_check_const_X509_NAME_sk_type(sk), (idx))) +#define sk_X509_NAME_new(cmp) ((STACK_OF(X509_NAME) *)OPENSSL_sk_new(ossl_check_X509_NAME_compfunc_type(cmp))) +#define sk_X509_NAME_new_null() ((STACK_OF(X509_NAME) *)OPENSSL_sk_new_null()) +#define sk_X509_NAME_new_reserve(cmp, n) ((STACK_OF(X509_NAME) *)OPENSSL_sk_new_reserve(ossl_check_X509_NAME_compfunc_type(cmp), (n))) +#define sk_X509_NAME_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_NAME_sk_type(sk), (n)) +#define sk_X509_NAME_free(sk) OPENSSL_sk_free(ossl_check_X509_NAME_sk_type(sk)) +#define sk_X509_NAME_zero(sk) OPENSSL_sk_zero(ossl_check_X509_NAME_sk_type(sk)) +#define sk_X509_NAME_delete(sk, i) ((X509_NAME *)OPENSSL_sk_delete(ossl_check_X509_NAME_sk_type(sk), (i))) +#define sk_X509_NAME_delete_ptr(sk, ptr) ((X509_NAME *)OPENSSL_sk_delete_ptr(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr))) +#define sk_X509_NAME_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr)) +#define sk_X509_NAME_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr)) +#define sk_X509_NAME_pop(sk) ((X509_NAME *)OPENSSL_sk_pop(ossl_check_X509_NAME_sk_type(sk))) +#define sk_X509_NAME_shift(sk) ((X509_NAME *)OPENSSL_sk_shift(ossl_check_X509_NAME_sk_type(sk))) +#define sk_X509_NAME_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_freefunc_type(freefunc)) +#define sk_X509_NAME_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr), (idx)) +#define sk_X509_NAME_set(sk, idx, ptr) ((X509_NAME *)OPENSSL_sk_set(ossl_check_X509_NAME_sk_type(sk), (idx), ossl_check_X509_NAME_type(ptr))) +#define sk_X509_NAME_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr)) +#define sk_X509_NAME_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr)) +#define sk_X509_NAME_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr), pnum) +#define sk_X509_NAME_sort(sk) OPENSSL_sk_sort(ossl_check_X509_NAME_sk_type(sk)) +#define sk_X509_NAME_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_NAME_sk_type(sk)) +#define sk_X509_NAME_dup(sk) ((STACK_OF(X509_NAME) *)OPENSSL_sk_dup(ossl_check_const_X509_NAME_sk_type(sk))) +#define sk_X509_NAME_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_NAME) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_NAME_sk_type(sk), ossl_check_X509_NAME_copyfunc_type(copyfunc), ossl_check_X509_NAME_freefunc_type(freefunc))) +#define sk_X509_NAME_set_cmp_func(sk, cmp) ((sk_X509_NAME_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_compfunc_type(cmp))) +SKM_DEFINE_STACK_OF_INTERNAL(X509, X509, X509) +#define sk_X509_num(sk) OPENSSL_sk_num(ossl_check_const_X509_sk_type(sk)) +#define sk_X509_value(sk, idx) ((X509 *)OPENSSL_sk_value(ossl_check_const_X509_sk_type(sk), (idx))) +#define sk_X509_new(cmp) ((STACK_OF(X509) *)OPENSSL_sk_new(ossl_check_X509_compfunc_type(cmp))) +#define sk_X509_new_null() ((STACK_OF(X509) *)OPENSSL_sk_new_null()) +#define sk_X509_new_reserve(cmp, n) ((STACK_OF(X509) *)OPENSSL_sk_new_reserve(ossl_check_X509_compfunc_type(cmp), (n))) +#define sk_X509_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_sk_type(sk), (n)) +#define sk_X509_free(sk) OPENSSL_sk_free(ossl_check_X509_sk_type(sk)) +#define sk_X509_zero(sk) OPENSSL_sk_zero(ossl_check_X509_sk_type(sk)) +#define sk_X509_delete(sk, i) ((X509 *)OPENSSL_sk_delete(ossl_check_X509_sk_type(sk), (i))) +#define sk_X509_delete_ptr(sk, ptr) ((X509 *)OPENSSL_sk_delete_ptr(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr))) +#define sk_X509_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr)) +#define sk_X509_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr)) +#define sk_X509_pop(sk) ((X509 *)OPENSSL_sk_pop(ossl_check_X509_sk_type(sk))) +#define sk_X509_shift(sk) ((X509 *)OPENSSL_sk_shift(ossl_check_X509_sk_type(sk))) +#define sk_X509_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_sk_type(sk), ossl_check_X509_freefunc_type(freefunc)) +#define sk_X509_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr), (idx)) +#define sk_X509_set(sk, idx, ptr) ((X509 *)OPENSSL_sk_set(ossl_check_X509_sk_type(sk), (idx), ossl_check_X509_type(ptr))) +#define sk_X509_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr)) +#define sk_X509_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr)) +#define sk_X509_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr), pnum) +#define sk_X509_sort(sk) OPENSSL_sk_sort(ossl_check_X509_sk_type(sk)) +#define sk_X509_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_sk_type(sk)) +#define sk_X509_dup(sk) ((STACK_OF(X509) *)OPENSSL_sk_dup(ossl_check_const_X509_sk_type(sk))) +#define sk_X509_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_sk_type(sk), ossl_check_X509_copyfunc_type(copyfunc), ossl_check_X509_freefunc_type(freefunc))) +#define sk_X509_set_cmp_func(sk, cmp) ((sk_X509_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_sk_type(sk), ossl_check_X509_compfunc_type(cmp))) +SKM_DEFINE_STACK_OF_INTERNAL(X509_REVOKED, X509_REVOKED, X509_REVOKED) +#define sk_X509_REVOKED_num(sk) OPENSSL_sk_num(ossl_check_const_X509_REVOKED_sk_type(sk)) +#define sk_X509_REVOKED_value(sk, idx) ((X509_REVOKED *)OPENSSL_sk_value(ossl_check_const_X509_REVOKED_sk_type(sk), (idx))) +#define sk_X509_REVOKED_new(cmp) ((STACK_OF(X509_REVOKED) *)OPENSSL_sk_new(ossl_check_X509_REVOKED_compfunc_type(cmp))) +#define sk_X509_REVOKED_new_null() ((STACK_OF(X509_REVOKED) *)OPENSSL_sk_new_null()) +#define sk_X509_REVOKED_new_reserve(cmp, n) ((STACK_OF(X509_REVOKED) *)OPENSSL_sk_new_reserve(ossl_check_X509_REVOKED_compfunc_type(cmp), (n))) +#define sk_X509_REVOKED_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_REVOKED_sk_type(sk), (n)) +#define sk_X509_REVOKED_free(sk) OPENSSL_sk_free(ossl_check_X509_REVOKED_sk_type(sk)) +#define sk_X509_REVOKED_zero(sk) OPENSSL_sk_zero(ossl_check_X509_REVOKED_sk_type(sk)) +#define sk_X509_REVOKED_delete(sk, i) ((X509_REVOKED *)OPENSSL_sk_delete(ossl_check_X509_REVOKED_sk_type(sk), (i))) +#define sk_X509_REVOKED_delete_ptr(sk, ptr) ((X509_REVOKED *)OPENSSL_sk_delete_ptr(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr))) +#define sk_X509_REVOKED_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr)) +#define sk_X509_REVOKED_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr)) +#define sk_X509_REVOKED_pop(sk) ((X509_REVOKED *)OPENSSL_sk_pop(ossl_check_X509_REVOKED_sk_type(sk))) +#define sk_X509_REVOKED_shift(sk) ((X509_REVOKED *)OPENSSL_sk_shift(ossl_check_X509_REVOKED_sk_type(sk))) +#define sk_X509_REVOKED_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_freefunc_type(freefunc)) +#define sk_X509_REVOKED_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr), (idx)) +#define sk_X509_REVOKED_set(sk, idx, ptr) ((X509_REVOKED *)OPENSSL_sk_set(ossl_check_X509_REVOKED_sk_type(sk), (idx), ossl_check_X509_REVOKED_type(ptr))) +#define sk_X509_REVOKED_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr)) +#define sk_X509_REVOKED_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr)) +#define sk_X509_REVOKED_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr), pnum) +#define sk_X509_REVOKED_sort(sk) OPENSSL_sk_sort(ossl_check_X509_REVOKED_sk_type(sk)) +#define sk_X509_REVOKED_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_REVOKED_sk_type(sk)) +#define sk_X509_REVOKED_dup(sk) ((STACK_OF(X509_REVOKED) *)OPENSSL_sk_dup(ossl_check_const_X509_REVOKED_sk_type(sk))) +#define sk_X509_REVOKED_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_REVOKED) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_copyfunc_type(copyfunc), ossl_check_X509_REVOKED_freefunc_type(freefunc))) +#define sk_X509_REVOKED_set_cmp_func(sk, cmp) ((sk_X509_REVOKED_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_compfunc_type(cmp))) +SKM_DEFINE_STACK_OF_INTERNAL(X509_CRL, X509_CRL, X509_CRL) +#define sk_X509_CRL_num(sk) OPENSSL_sk_num(ossl_check_const_X509_CRL_sk_type(sk)) +#define sk_X509_CRL_value(sk, idx) ((X509_CRL *)OPENSSL_sk_value(ossl_check_const_X509_CRL_sk_type(sk), (idx))) +#define sk_X509_CRL_new(cmp) ((STACK_OF(X509_CRL) *)OPENSSL_sk_new(ossl_check_X509_CRL_compfunc_type(cmp))) +#define sk_X509_CRL_new_null() ((STACK_OF(X509_CRL) *)OPENSSL_sk_new_null()) +#define sk_X509_CRL_new_reserve(cmp, n) ((STACK_OF(X509_CRL) *)OPENSSL_sk_new_reserve(ossl_check_X509_CRL_compfunc_type(cmp), (n))) +#define sk_X509_CRL_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_CRL_sk_type(sk), (n)) +#define sk_X509_CRL_free(sk) OPENSSL_sk_free(ossl_check_X509_CRL_sk_type(sk)) +#define sk_X509_CRL_zero(sk) OPENSSL_sk_zero(ossl_check_X509_CRL_sk_type(sk)) +#define sk_X509_CRL_delete(sk, i) ((X509_CRL *)OPENSSL_sk_delete(ossl_check_X509_CRL_sk_type(sk), (i))) +#define sk_X509_CRL_delete_ptr(sk, ptr) ((X509_CRL *)OPENSSL_sk_delete_ptr(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr))) +#define sk_X509_CRL_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr)) +#define sk_X509_CRL_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr)) +#define sk_X509_CRL_pop(sk) ((X509_CRL *)OPENSSL_sk_pop(ossl_check_X509_CRL_sk_type(sk))) +#define sk_X509_CRL_shift(sk) ((X509_CRL *)OPENSSL_sk_shift(ossl_check_X509_CRL_sk_type(sk))) +#define sk_X509_CRL_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_freefunc_type(freefunc)) +#define sk_X509_CRL_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr), (idx)) +#define sk_X509_CRL_set(sk, idx, ptr) ((X509_CRL *)OPENSSL_sk_set(ossl_check_X509_CRL_sk_type(sk), (idx), ossl_check_X509_CRL_type(ptr))) +#define sk_X509_CRL_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr)) +#define sk_X509_CRL_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr)) +#define sk_X509_CRL_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr), pnum) +#define sk_X509_CRL_sort(sk) OPENSSL_sk_sort(ossl_check_X509_CRL_sk_type(sk)) +#define sk_X509_CRL_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_CRL_sk_type(sk)) +#define sk_X509_CRL_dup(sk) ((STACK_OF(X509_CRL) *)OPENSSL_sk_dup(ossl_check_const_X509_CRL_sk_type(sk))) +#define sk_X509_CRL_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_CRL) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_CRL_sk_type(sk), ossl_check_X509_CRL_copyfunc_type(copyfunc), ossl_check_X509_CRL_freefunc_type(freefunc))) +#define sk_X509_CRL_set_cmp_func(sk, cmp) ((sk_X509_CRL_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_compfunc_type(cmp))) + +/* clang-format on */ + +/* Flags for X509_get_signature_info() */ +/* Signature info is valid */ +#define X509_SIG_INFO_VALID 0x1 +/* Signature is suitable for TLS use */ +#define X509_SIG_INFO_TLS 0x2 + +#define X509_FILETYPE_PEM 1 +#define X509_FILETYPE_ASN1 2 +#define X509_FILETYPE_DEFAULT 3 + +/*- + * : + * The KeyUsage BITSTRING is treated as a little-endian integer, hence bit `0` + * is 0x80, while bit `7` is 0x01 (the LSB of the integer value), bit `8` is + * then the MSB of the second octet, or 0x8000. + */ +#define X509v3_KU_DIGITAL_SIGNATURE 0x0080 /* (0) */ +#define X509v3_KU_NON_REPUDIATION 0x0040 /* (1) */ +#define X509v3_KU_KEY_ENCIPHERMENT 0x0020 /* (2) */ +#define X509v3_KU_DATA_ENCIPHERMENT 0x0010 /* (3) */ +#define X509v3_KU_KEY_AGREEMENT 0x0008 /* (4) */ +#define X509v3_KU_KEY_CERT_SIGN 0x0004 /* (5) */ +#define X509v3_KU_CRL_SIGN 0x0002 /* (6) */ +#define X509v3_KU_ENCIPHER_ONLY 0x0001 /* (7) */ +#define X509v3_KU_DECIPHER_ONLY 0x8000 /* (8) */ +#ifndef OPENSSL_NO_DEPRECATED_3_4 +#define X509v3_KU_UNDEF 0xffff /* vestigial, not used */ +#endif + +struct X509_algor_st { + ASN1_OBJECT *algorithm; + ASN1_TYPE *parameter; +} /* X509_ALGOR */; + +typedef STACK_OF(X509_ALGOR) X509_ALGORS; + +typedef struct X509_val_st { + ASN1_TIME *notBefore; + ASN1_TIME *notAfter; +} X509_VAL; + +typedef struct X509_sig_st X509_SIG; + +typedef struct X509_name_entry_st X509_NAME_ENTRY; + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(X509_NAME_ENTRY, X509_NAME_ENTRY, X509_NAME_ENTRY) +#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk)) +#define sk_X509_NAME_ENTRY_value(sk, idx) ((X509_NAME_ENTRY *)OPENSSL_sk_value(ossl_check_const_X509_NAME_ENTRY_sk_type(sk), (idx))) +#define sk_X509_NAME_ENTRY_new(cmp) ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new(ossl_check_X509_NAME_ENTRY_compfunc_type(cmp))) +#define sk_X509_NAME_ENTRY_new_null() ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new_null()) +#define sk_X509_NAME_ENTRY_new_reserve(cmp, n) ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new_reserve(ossl_check_X509_NAME_ENTRY_compfunc_type(cmp), (n))) +#define sk_X509_NAME_ENTRY_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_NAME_ENTRY_sk_type(sk), (n)) +#define sk_X509_NAME_ENTRY_free(sk) OPENSSL_sk_free(ossl_check_X509_NAME_ENTRY_sk_type(sk)) +#define sk_X509_NAME_ENTRY_zero(sk) OPENSSL_sk_zero(ossl_check_X509_NAME_ENTRY_sk_type(sk)) +#define sk_X509_NAME_ENTRY_delete(sk, i) ((X509_NAME_ENTRY *)OPENSSL_sk_delete(ossl_check_X509_NAME_ENTRY_sk_type(sk), (i))) +#define sk_X509_NAME_ENTRY_delete_ptr(sk, ptr) ((X509_NAME_ENTRY *)OPENSSL_sk_delete_ptr(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr))) +#define sk_X509_NAME_ENTRY_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr)) +#define sk_X509_NAME_ENTRY_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr)) +#define sk_X509_NAME_ENTRY_pop(sk) ((X509_NAME_ENTRY *)OPENSSL_sk_pop(ossl_check_X509_NAME_ENTRY_sk_type(sk))) +#define sk_X509_NAME_ENTRY_shift(sk) ((X509_NAME_ENTRY *)OPENSSL_sk_shift(ossl_check_X509_NAME_ENTRY_sk_type(sk))) +#define sk_X509_NAME_ENTRY_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_freefunc_type(freefunc)) +#define sk_X509_NAME_ENTRY_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr), (idx)) +#define sk_X509_NAME_ENTRY_set(sk, idx, ptr) ((X509_NAME_ENTRY *)OPENSSL_sk_set(ossl_check_X509_NAME_ENTRY_sk_type(sk), (idx), ossl_check_X509_NAME_ENTRY_type(ptr))) +#define sk_X509_NAME_ENTRY_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr)) +#define sk_X509_NAME_ENTRY_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr)) +#define sk_X509_NAME_ENTRY_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr), pnum) +#define sk_X509_NAME_ENTRY_sort(sk) OPENSSL_sk_sort(ossl_check_X509_NAME_ENTRY_sk_type(sk)) +#define sk_X509_NAME_ENTRY_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_NAME_ENTRY_sk_type(sk)) +#define sk_X509_NAME_ENTRY_dup(sk) ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_dup(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))) +#define sk_X509_NAME_ENTRY_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_copyfunc_type(copyfunc), ossl_check_X509_NAME_ENTRY_freefunc_type(freefunc))) +#define sk_X509_NAME_ENTRY_set_cmp_func(sk, cmp) ((sk_X509_NAME_ENTRY_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_compfunc_type(cmp))) + +/* clang-format on */ + +#define X509_EX_V_NETSCAPE_HACK 0x8000 +#define X509_EX_V_INIT 0x0001 +typedef struct X509_extension_st X509_EXTENSION; +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(X509_EXTENSION, X509_EXTENSION, X509_EXTENSION) +#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk)) +#define sk_X509_EXTENSION_value(sk, idx) ((X509_EXTENSION *)OPENSSL_sk_value(ossl_check_const_X509_EXTENSION_sk_type(sk), (idx))) +#define sk_X509_EXTENSION_new(cmp) ((STACK_OF(X509_EXTENSION) *)OPENSSL_sk_new(ossl_check_X509_EXTENSION_compfunc_type(cmp))) +#define sk_X509_EXTENSION_new_null() ((STACK_OF(X509_EXTENSION) *)OPENSSL_sk_new_null()) +#define sk_X509_EXTENSION_new_reserve(cmp, n) ((STACK_OF(X509_EXTENSION) *)OPENSSL_sk_new_reserve(ossl_check_X509_EXTENSION_compfunc_type(cmp), (n))) +#define sk_X509_EXTENSION_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_EXTENSION_sk_type(sk), (n)) +#define sk_X509_EXTENSION_free(sk) OPENSSL_sk_free(ossl_check_X509_EXTENSION_sk_type(sk)) +#define sk_X509_EXTENSION_zero(sk) OPENSSL_sk_zero(ossl_check_X509_EXTENSION_sk_type(sk)) +#define sk_X509_EXTENSION_delete(sk, i) ((X509_EXTENSION *)OPENSSL_sk_delete(ossl_check_X509_EXTENSION_sk_type(sk), (i))) +#define sk_X509_EXTENSION_delete_ptr(sk, ptr) ((X509_EXTENSION *)OPENSSL_sk_delete_ptr(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr))) +#define sk_X509_EXTENSION_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr)) +#define sk_X509_EXTENSION_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr)) +#define sk_X509_EXTENSION_pop(sk) ((X509_EXTENSION *)OPENSSL_sk_pop(ossl_check_X509_EXTENSION_sk_type(sk))) +#define sk_X509_EXTENSION_shift(sk) ((X509_EXTENSION *)OPENSSL_sk_shift(ossl_check_X509_EXTENSION_sk_type(sk))) +#define sk_X509_EXTENSION_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_freefunc_type(freefunc)) +#define sk_X509_EXTENSION_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr), (idx)) +#define sk_X509_EXTENSION_set(sk, idx, ptr) ((X509_EXTENSION *)OPENSSL_sk_set(ossl_check_X509_EXTENSION_sk_type(sk), (idx), ossl_check_X509_EXTENSION_type(ptr))) +#define sk_X509_EXTENSION_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr)) +#define sk_X509_EXTENSION_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr)) +#define sk_X509_EXTENSION_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr), pnum) +#define sk_X509_EXTENSION_sort(sk) OPENSSL_sk_sort(ossl_check_X509_EXTENSION_sk_type(sk)) +#define sk_X509_EXTENSION_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_EXTENSION_sk_type(sk)) +#define sk_X509_EXTENSION_dup(sk) ((STACK_OF(X509_EXTENSION) *)OPENSSL_sk_dup(ossl_check_const_X509_EXTENSION_sk_type(sk))) +#define sk_X509_EXTENSION_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_EXTENSION) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_copyfunc_type(copyfunc), ossl_check_X509_EXTENSION_freefunc_type(freefunc))) +#define sk_X509_EXTENSION_set_cmp_func(sk, cmp) ((sk_X509_EXTENSION_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_compfunc_type(cmp))) + +/* clang-format on */ +typedef STACK_OF(X509_EXTENSION) X509_EXTENSIONS; +typedef struct x509_attributes_st X509_ATTRIBUTE; +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(X509_ATTRIBUTE, X509_ATTRIBUTE, X509_ATTRIBUTE) +#define sk_X509_ATTRIBUTE_num(sk) OPENSSL_sk_num(ossl_check_const_X509_ATTRIBUTE_sk_type(sk)) +#define sk_X509_ATTRIBUTE_value(sk, idx) ((X509_ATTRIBUTE *)OPENSSL_sk_value(ossl_check_const_X509_ATTRIBUTE_sk_type(sk), (idx))) +#define sk_X509_ATTRIBUTE_new(cmp) ((STACK_OF(X509_ATTRIBUTE) *)OPENSSL_sk_new(ossl_check_X509_ATTRIBUTE_compfunc_type(cmp))) +#define sk_X509_ATTRIBUTE_new_null() ((STACK_OF(X509_ATTRIBUTE) *)OPENSSL_sk_new_null()) +#define sk_X509_ATTRIBUTE_new_reserve(cmp, n) ((STACK_OF(X509_ATTRIBUTE) *)OPENSSL_sk_new_reserve(ossl_check_X509_ATTRIBUTE_compfunc_type(cmp), (n))) +#define sk_X509_ATTRIBUTE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_ATTRIBUTE_sk_type(sk), (n)) +#define sk_X509_ATTRIBUTE_free(sk) OPENSSL_sk_free(ossl_check_X509_ATTRIBUTE_sk_type(sk)) +#define sk_X509_ATTRIBUTE_zero(sk) OPENSSL_sk_zero(ossl_check_X509_ATTRIBUTE_sk_type(sk)) +#define sk_X509_ATTRIBUTE_delete(sk, i) ((X509_ATTRIBUTE *)OPENSSL_sk_delete(ossl_check_X509_ATTRIBUTE_sk_type(sk), (i))) +#define sk_X509_ATTRIBUTE_delete_ptr(sk, ptr) ((X509_ATTRIBUTE *)OPENSSL_sk_delete_ptr(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr))) +#define sk_X509_ATTRIBUTE_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr)) +#define sk_X509_ATTRIBUTE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr)) +#define sk_X509_ATTRIBUTE_pop(sk) ((X509_ATTRIBUTE *)OPENSSL_sk_pop(ossl_check_X509_ATTRIBUTE_sk_type(sk))) +#define sk_X509_ATTRIBUTE_shift(sk) ((X509_ATTRIBUTE *)OPENSSL_sk_shift(ossl_check_X509_ATTRIBUTE_sk_type(sk))) +#define sk_X509_ATTRIBUTE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_freefunc_type(freefunc)) +#define sk_X509_ATTRIBUTE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr), (idx)) +#define sk_X509_ATTRIBUTE_set(sk, idx, ptr) ((X509_ATTRIBUTE *)OPENSSL_sk_set(ossl_check_X509_ATTRIBUTE_sk_type(sk), (idx), ossl_check_X509_ATTRIBUTE_type(ptr))) +#define sk_X509_ATTRIBUTE_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr)) +#define sk_X509_ATTRIBUTE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr)) +#define sk_X509_ATTRIBUTE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr), pnum) +#define sk_X509_ATTRIBUTE_sort(sk) OPENSSL_sk_sort(ossl_check_X509_ATTRIBUTE_sk_type(sk)) +#define sk_X509_ATTRIBUTE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_ATTRIBUTE_sk_type(sk)) +#define sk_X509_ATTRIBUTE_dup(sk) ((STACK_OF(X509_ATTRIBUTE) *)OPENSSL_sk_dup(ossl_check_const_X509_ATTRIBUTE_sk_type(sk))) +#define sk_X509_ATTRIBUTE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_ATTRIBUTE) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_copyfunc_type(copyfunc), ossl_check_X509_ATTRIBUTE_freefunc_type(freefunc))) +#define sk_X509_ATTRIBUTE_set_cmp_func(sk, cmp) ((sk_X509_ATTRIBUTE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_compfunc_type(cmp))) + +/* clang-format on */ +typedef struct X509_req_info_st X509_REQ_INFO; +typedef struct X509_req_st X509_REQ; +typedef struct x509_cert_aux_st X509_CERT_AUX; +typedef struct x509_cinf_st X509_CINF; + +/* Flags for X509_print_ex() */ + +#define X509_FLAG_COMPAT 0 +#define X509_FLAG_NO_HEADER 1L +#define X509_FLAG_NO_VERSION (1L << 1) +#define X509_FLAG_NO_SERIAL (1L << 2) +#define X509_FLAG_NO_SIGNAME (1L << 3) +#define X509_FLAG_NO_ISSUER (1L << 4) +#define X509_FLAG_NO_VALIDITY (1L << 5) +#define X509_FLAG_NO_SUBJECT (1L << 6) +#define X509_FLAG_NO_PUBKEY (1L << 7) +#define X509_FLAG_NO_EXTENSIONS (1L << 8) +#define X509_FLAG_NO_SIGDUMP (1L << 9) +#define X509_FLAG_NO_AUX (1L << 10) +#define X509_FLAG_NO_ATTRIBUTES (1L << 11) +#define X509_FLAG_NO_IDS (1L << 12) +#define X509_FLAG_EXTENSIONS_ONLY_KID (1L << 13) + +/* Flags specific to X509_NAME_print_ex() */ + +/* The field separator information */ + +#define XN_FLAG_SEP_MASK (0xf << 16) + +#define XN_FLAG_COMPAT 0 /* Traditional; use old X509_NAME_print */ +#define XN_FLAG_SEP_COMMA_PLUS (1 << 16) /* RFC2253 ,+ */ +#define XN_FLAG_SEP_CPLUS_SPC (2 << 16) /* ,+ spaced: more readable */ +#define XN_FLAG_SEP_SPLUS_SPC (3 << 16) /* ;+ spaced */ +#define XN_FLAG_SEP_MULTILINE (4 << 16) /* One line per field */ + +#define XN_FLAG_DN_REV (1 << 20) /* Reverse DN order */ + +/* How the field name is shown */ + +#define XN_FLAG_FN_MASK (0x3 << 21) + +#define XN_FLAG_FN_SN 0 /* Object short name */ +#define XN_FLAG_FN_LN (1 << 21) /* Object long name */ +#define XN_FLAG_FN_OID (2 << 21) /* Always use OIDs */ +#define XN_FLAG_FN_NONE (3 << 21) /* No field names */ + +#define XN_FLAG_SPC_EQ (1 << 23) /* Put spaces round '=' */ + +/* + * This determines if we dump fields we don't recognise: RFC2253 requires + * this. + */ + +#define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 << 24) + +#define XN_FLAG_FN_ALIGN (1 << 25) /* Align field names to 20 \ + * characters */ + +/* Complete set of RFC2253 flags */ + +#define XN_FLAG_RFC2253 (ASN1_STRFLGS_RFC2253 | XN_FLAG_SEP_COMMA_PLUS | XN_FLAG_DN_REV | XN_FLAG_FN_SN | XN_FLAG_DUMP_UNKNOWN_FIELDS) + +/* readable oneline form */ + +#define XN_FLAG_ONELINE (ASN1_STRFLGS_RFC2253 | ASN1_STRFLGS_ESC_QUOTE | XN_FLAG_SEP_CPLUS_SPC | XN_FLAG_SPC_EQ | XN_FLAG_FN_SN) + +/* readable multiline form */ + +#define XN_FLAG_MULTILINE (ASN1_STRFLGS_ESC_CTRL | ASN1_STRFLGS_ESC_MSB | XN_FLAG_SEP_MULTILINE | XN_FLAG_SPC_EQ | XN_FLAG_FN_LN | XN_FLAG_FN_ALIGN) + +typedef struct X509_crl_info_st X509_CRL_INFO; + +typedef struct private_key_st { + int version; + /* The PKCS#8 data types */ + X509_ALGOR *enc_algor; + ASN1_OCTET_STRING *enc_pkey; /* encrypted pub key */ + /* When decrypted, the following will not be NULL */ + EVP_PKEY *dec_pkey; + /* used to encrypt and decrypt */ + int key_length; + char *key_data; + int key_free; /* true if we should auto free key_data */ + /* expanded version of 'enc_algor' */ + EVP_CIPHER_INFO cipher; +} X509_PKEY; + +typedef struct X509_info_st { + X509 *x509; + X509_CRL *crl; + X509_PKEY *x_pkey; + EVP_CIPHER_INFO enc_cipher; + int enc_len; + char *enc_data; +} X509_INFO; +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(X509_INFO, X509_INFO, X509_INFO) +#define sk_X509_INFO_num(sk) OPENSSL_sk_num(ossl_check_const_X509_INFO_sk_type(sk)) +#define sk_X509_INFO_value(sk, idx) ((X509_INFO *)OPENSSL_sk_value(ossl_check_const_X509_INFO_sk_type(sk), (idx))) +#define sk_X509_INFO_new(cmp) ((STACK_OF(X509_INFO) *)OPENSSL_sk_new(ossl_check_X509_INFO_compfunc_type(cmp))) +#define sk_X509_INFO_new_null() ((STACK_OF(X509_INFO) *)OPENSSL_sk_new_null()) +#define sk_X509_INFO_new_reserve(cmp, n) ((STACK_OF(X509_INFO) *)OPENSSL_sk_new_reserve(ossl_check_X509_INFO_compfunc_type(cmp), (n))) +#define sk_X509_INFO_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_INFO_sk_type(sk), (n)) +#define sk_X509_INFO_free(sk) OPENSSL_sk_free(ossl_check_X509_INFO_sk_type(sk)) +#define sk_X509_INFO_zero(sk) OPENSSL_sk_zero(ossl_check_X509_INFO_sk_type(sk)) +#define sk_X509_INFO_delete(sk, i) ((X509_INFO *)OPENSSL_sk_delete(ossl_check_X509_INFO_sk_type(sk), (i))) +#define sk_X509_INFO_delete_ptr(sk, ptr) ((X509_INFO *)OPENSSL_sk_delete_ptr(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr))) +#define sk_X509_INFO_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr)) +#define sk_X509_INFO_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr)) +#define sk_X509_INFO_pop(sk) ((X509_INFO *)OPENSSL_sk_pop(ossl_check_X509_INFO_sk_type(sk))) +#define sk_X509_INFO_shift(sk) ((X509_INFO *)OPENSSL_sk_shift(ossl_check_X509_INFO_sk_type(sk))) +#define sk_X509_INFO_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_freefunc_type(freefunc)) +#define sk_X509_INFO_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr), (idx)) +#define sk_X509_INFO_set(sk, idx, ptr) ((X509_INFO *)OPENSSL_sk_set(ossl_check_X509_INFO_sk_type(sk), (idx), ossl_check_X509_INFO_type(ptr))) +#define sk_X509_INFO_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr)) +#define sk_X509_INFO_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr)) +#define sk_X509_INFO_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr), pnum) +#define sk_X509_INFO_sort(sk) OPENSSL_sk_sort(ossl_check_X509_INFO_sk_type(sk)) +#define sk_X509_INFO_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_INFO_sk_type(sk)) +#define sk_X509_INFO_dup(sk) ((STACK_OF(X509_INFO) *)OPENSSL_sk_dup(ossl_check_const_X509_INFO_sk_type(sk))) +#define sk_X509_INFO_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_INFO) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_INFO_sk_type(sk), ossl_check_X509_INFO_copyfunc_type(copyfunc), ossl_check_X509_INFO_freefunc_type(freefunc))) +#define sk_X509_INFO_set_cmp_func(sk, cmp) ((sk_X509_INFO_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_compfunc_type(cmp))) + +/* clang-format on */ + +/* + * The next 2 structures and their 8 routines are used to manipulate Netscape's + * spki structures - useful if you are writing a CA web page + */ +typedef struct Netscape_spkac_st { + X509_PUBKEY *pubkey; + ASN1_IA5STRING *challenge; /* challenge sent in atlas >= PR2 */ +} NETSCAPE_SPKAC; + +typedef struct Netscape_spki_st { + NETSCAPE_SPKAC *spkac; /* signed public key and challenge */ + X509_ALGOR sig_algor; + ASN1_BIT_STRING *signature; +} NETSCAPE_SPKI; + +/* Netscape certificate sequence structure */ +typedef struct Netscape_certificate_sequence { + ASN1_OBJECT *type; + STACK_OF(X509) *certs; +} NETSCAPE_CERT_SEQUENCE; + +/*- Unused (and iv length is wrong) +typedef struct CBCParameter_st + { + unsigned char iv[8]; + } CBC_PARAM; +*/ + +/* Password based encryption structure */ + +typedef struct PBEPARAM_st { + ASN1_OCTET_STRING *salt; + ASN1_INTEGER *iter; +} PBEPARAM; + +/* Password based encryption V2 structures */ + +typedef struct PBE2PARAM_st { + X509_ALGOR *keyfunc; + X509_ALGOR *encryption; +} PBE2PARAM; + +typedef struct PBKDF2PARAM_st { + /* Usually OCTET STRING but could be anything */ + ASN1_TYPE *salt; + ASN1_INTEGER *iter; + ASN1_INTEGER *keylength; + X509_ALGOR *prf; +} PBKDF2PARAM; + +typedef struct { + X509_ALGOR *keyDerivationFunc; + X509_ALGOR *messageAuthScheme; +} PBMAC1PARAM; + +#ifndef OPENSSL_NO_SCRYPT +typedef struct SCRYPT_PARAMS_st { + ASN1_OCTET_STRING *salt; + ASN1_INTEGER *costParameter; + ASN1_INTEGER *blockSize; + ASN1_INTEGER *parallelizationParameter; + ASN1_INTEGER *keyLength; +} SCRYPT_PARAMS; +#endif + +#ifdef __cplusplus +} +#endif + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define X509_EXT_PACK_UNKNOWN 1 +#define X509_EXT_PACK_STRING 2 + +#define X509_extract_key(x) X509_get_pubkey(x) /*****/ +#define X509_REQ_extract_key(a) X509_REQ_get_pubkey(a) +#define X509_name_cmp(a, b) X509_NAME_cmp((a), (b)) + +void X509_CRL_set_default_method(const X509_CRL_METHOD *meth); +X509_CRL_METHOD *X509_CRL_METHOD_new(int (*crl_init)(X509_CRL *crl), + int (*crl_free)(X509_CRL *crl), + int (*crl_lookup)(X509_CRL *crl, + X509_REVOKED **ret, + const ASN1_INTEGER *serial, + const X509_NAME *issuer), + int (*crl_verify)(X509_CRL *crl, + EVP_PKEY *pk)); +void X509_CRL_METHOD_free(X509_CRL_METHOD *m); + +void X509_CRL_set_meth_data(X509_CRL *crl, void *dat); +void *X509_CRL_get_meth_data(X509_CRL *crl); + +const char *X509_verify_cert_error_string(long n); + +int X509_verify(X509 *a, EVP_PKEY *r); +int X509_self_signed(X509 *cert, int verify_signature); + +int X509_REQ_verify_ex(X509_REQ *a, EVP_PKEY *r, OSSL_LIB_CTX *libctx, + const char *propq); +int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r); +int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r); +int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r); + +NETSCAPE_SPKI *NETSCAPE_SPKI_b64_decode(const char *str, int len); +char *NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *x); +EVP_PKEY *NETSCAPE_SPKI_get_pubkey(NETSCAPE_SPKI *x); +int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey); + +int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki); + +int X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent); +int X509_signature_print(BIO *bp, const X509_ALGOR *alg, + const ASN1_STRING *sig); + +int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); +int X509_sign_ctx(X509 *x, EVP_MD_CTX *ctx); +int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md); +int X509_REQ_sign_ctx(X509_REQ *x, EVP_MD_CTX *ctx); +int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md); +int X509_CRL_sign_ctx(X509_CRL *x, EVP_MD_CTX *ctx); +int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md); + +int X509_pubkey_digest(const X509 *data, const EVP_MD *type, + unsigned char *md, unsigned int *len); +int X509_digest(const X509 *data, const EVP_MD *type, + unsigned char *md, unsigned int *len); +ASN1_OCTET_STRING *X509_digest_sig(const X509 *cert, + EVP_MD **md_used, int *md_is_fallback); +int X509_CRL_digest(const X509_CRL *data, const EVP_MD *type, + unsigned char *md, unsigned int *len); +int X509_REQ_digest(const X509_REQ *data, const EVP_MD *type, + unsigned char *md, unsigned int *len); +int X509_NAME_digest(const X509_NAME *data, const EVP_MD *type, + unsigned char *md, unsigned int *len); + +X509 *X509_load_http(const char *url, BIO *bio, BIO *rbio, int timeout); +X509_CRL *X509_CRL_load_http(const char *url, BIO *bio, BIO *rbio, int timeout); +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#include /* OSSL_HTTP_REQ_CTX_nbio_d2i */ +#define X509_http_nbio(rctx, pcert) \ + OSSL_HTTP_REQ_CTX_nbio_d2i(rctx, pcert, ASN1_ITEM_rptr(X509)) +#define X509_CRL_http_nbio(rctx, pcrl) \ + OSSL_HTTP_REQ_CTX_nbio_d2i(rctx, pcrl, ASN1_ITEM_rptr(X509_CRL)) +#endif + +#ifndef OPENSSL_NO_STDIO +X509 *d2i_X509_fp(FILE *fp, X509 **x509); +int i2d_X509_fp(FILE *fp, const X509 *x509); +X509_CRL *d2i_X509_CRL_fp(FILE *fp, X509_CRL **crl); +int i2d_X509_CRL_fp(FILE *fp, const X509_CRL *crl); +X509_REQ *d2i_X509_REQ_fp(FILE *fp, X509_REQ **req); +int i2d_X509_REQ_fp(FILE *fp, const X509_REQ *req); +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSAPrivateKey_fp(FILE *fp, RSA **rsa); +OSSL_DEPRECATEDIN_3_0 int i2d_RSAPrivateKey_fp(FILE *fp, const RSA *rsa); +OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSAPublicKey_fp(FILE *fp, RSA **rsa); +OSSL_DEPRECATEDIN_3_0 int i2d_RSAPublicKey_fp(FILE *fp, const RSA *rsa); +OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSA_PUBKEY_fp(FILE *fp, RSA **rsa); +OSSL_DEPRECATEDIN_3_0 int i2d_RSA_PUBKEY_fp(FILE *fp, const RSA *rsa); +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#ifndef OPENSSL_NO_DSA +OSSL_DEPRECATEDIN_3_0 DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa); +OSSL_DEPRECATEDIN_3_0 int i2d_DSA_PUBKEY_fp(FILE *fp, const DSA *dsa); +OSSL_DEPRECATEDIN_3_0 DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa); +OSSL_DEPRECATEDIN_3_0 int i2d_DSAPrivateKey_fp(FILE *fp, const DSA *dsa); +#endif +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#ifndef OPENSSL_NO_EC +OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_EC_PUBKEY_fp(FILE *fp, EC_KEY **eckey); +OSSL_DEPRECATEDIN_3_0 int i2d_EC_PUBKEY_fp(FILE *fp, const EC_KEY *eckey); +OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_ECPrivateKey_fp(FILE *fp, EC_KEY **eckey); +OSSL_DEPRECATEDIN_3_0 int i2d_ECPrivateKey_fp(FILE *fp, const EC_KEY *eckey); +#endif /* OPENSSL_NO_EC */ +#endif /* OPENSSL_NO_DEPRECATED_3_0 */ +X509_SIG *d2i_PKCS8_fp(FILE *fp, X509_SIG **p8); +int i2d_PKCS8_fp(FILE *fp, const X509_SIG *p8); +X509_PUBKEY *d2i_X509_PUBKEY_fp(FILE *fp, X509_PUBKEY **xpk); +int i2d_X509_PUBKEY_fp(FILE *fp, const X509_PUBKEY *xpk); +PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, + PKCS8_PRIV_KEY_INFO **p8inf); +int i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, const PKCS8_PRIV_KEY_INFO *p8inf); +int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, const EVP_PKEY *key); +int i2d_PrivateKey_fp(FILE *fp, const EVP_PKEY *pkey); +EVP_PKEY *d2i_PrivateKey_ex_fp(FILE *fp, EVP_PKEY **a, OSSL_LIB_CTX *libctx, + const char *propq); +EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a); +int i2d_PUBKEY_fp(FILE *fp, const EVP_PKEY *pkey); +EVP_PKEY *d2i_PUBKEY_ex_fp(FILE *fp, EVP_PKEY **a, OSSL_LIB_CTX *libctx, + const char *propq); +EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a); +#endif + +X509 *d2i_X509_bio(BIO *bp, X509 **x509); +int i2d_X509_bio(BIO *bp, const X509 *x509); +X509_CRL *d2i_X509_CRL_bio(BIO *bp, X509_CRL **crl); +int i2d_X509_CRL_bio(BIO *bp, const X509_CRL *crl); +X509_REQ *d2i_X509_REQ_bio(BIO *bp, X509_REQ **req); +int i2d_X509_REQ_bio(BIO *bp, const X509_REQ *req); +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSAPrivateKey_bio(BIO *bp, RSA **rsa); +OSSL_DEPRECATEDIN_3_0 int i2d_RSAPrivateKey_bio(BIO *bp, const RSA *rsa); +OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSAPublicKey_bio(BIO *bp, RSA **rsa); +OSSL_DEPRECATEDIN_3_0 int i2d_RSAPublicKey_bio(BIO *bp, const RSA *rsa); +OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSA_PUBKEY_bio(BIO *bp, RSA **rsa); +OSSL_DEPRECATEDIN_3_0 int i2d_RSA_PUBKEY_bio(BIO *bp, const RSA *rsa); +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#ifndef OPENSSL_NO_DSA +OSSL_DEPRECATEDIN_3_0 DSA *d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa); +OSSL_DEPRECATEDIN_3_0 int i2d_DSA_PUBKEY_bio(BIO *bp, const DSA *dsa); +OSSL_DEPRECATEDIN_3_0 DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa); +OSSL_DEPRECATEDIN_3_0 int i2d_DSAPrivateKey_bio(BIO *bp, const DSA *dsa); +#endif +#endif + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#ifndef OPENSSL_NO_EC +OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_EC_PUBKEY_bio(BIO *bp, EC_KEY **eckey); +OSSL_DEPRECATEDIN_3_0 int i2d_EC_PUBKEY_bio(BIO *bp, const EC_KEY *eckey); +OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_ECPrivateKey_bio(BIO *bp, EC_KEY **eckey); +OSSL_DEPRECATEDIN_3_0 int i2d_ECPrivateKey_bio(BIO *bp, const EC_KEY *eckey); +#endif /* OPENSSL_NO_EC */ +#endif /* OPENSSL_NO_DEPRECATED_3_0 */ + +X509_SIG *d2i_PKCS8_bio(BIO *bp, X509_SIG **p8); +int i2d_PKCS8_bio(BIO *bp, const X509_SIG *p8); +X509_PUBKEY *d2i_X509_PUBKEY_bio(BIO *bp, X509_PUBKEY **xpk); +int i2d_X509_PUBKEY_bio(BIO *bp, const X509_PUBKEY *xpk); +PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_bio(BIO *bp, + PKCS8_PRIV_KEY_INFO **p8inf); +int i2d_PKCS8_PRIV_KEY_INFO_bio(BIO *bp, const PKCS8_PRIV_KEY_INFO *p8inf); +int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, const EVP_PKEY *key); +int i2d_PrivateKey_bio(BIO *bp, const EVP_PKEY *pkey); +EVP_PKEY *d2i_PrivateKey_ex_bio(BIO *bp, EVP_PKEY **a, OSSL_LIB_CTX *libctx, + const char *propq); +EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a); +int i2d_PUBKEY_bio(BIO *bp, const EVP_PKEY *pkey); +EVP_PKEY *d2i_PUBKEY_ex_bio(BIO *bp, EVP_PKEY **a, OSSL_LIB_CTX *libctx, + const char *propq); +EVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a); + +DECLARE_ASN1_DUP_FUNCTION(X509) +DECLARE_ASN1_DUP_FUNCTION(X509_ALGOR) +DECLARE_ASN1_DUP_FUNCTION(X509_ATTRIBUTE) +DECLARE_ASN1_DUP_FUNCTION(X509_CRL) +DECLARE_ASN1_DUP_FUNCTION(X509_EXTENSION) +DECLARE_ASN1_DUP_FUNCTION(X509_PUBKEY) +DECLARE_ASN1_DUP_FUNCTION(X509_REQ) +DECLARE_ASN1_DUP_FUNCTION(X509_REVOKED) +int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, + void *pval); +void X509_ALGOR_get0(const ASN1_OBJECT **paobj, int *pptype, + const void **ppval, const X509_ALGOR *algor); +void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md); +int X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b); +int X509_ALGOR_copy(X509_ALGOR *dest, const X509_ALGOR *src); + +DECLARE_ASN1_DUP_FUNCTION(X509_NAME) +DECLARE_ASN1_DUP_FUNCTION(X509_NAME_ENTRY) + +int X509_cmp_time(const ASN1_TIME *s, time_t *t); +int X509_cmp_current_time(const ASN1_TIME *s); +int X509_cmp_timeframe(const X509_VERIFY_PARAM *vpm, + const ASN1_TIME *start, const ASN1_TIME *end); +ASN1_TIME *X509_time_adj(ASN1_TIME *s, long adj, time_t *t); +ASN1_TIME *X509_time_adj_ex(ASN1_TIME *s, + int offset_day, long offset_sec, time_t *t); +ASN1_TIME *X509_gmtime_adj(ASN1_TIME *s, long adj); + +const char *X509_get_default_cert_area(void); +const char *X509_get_default_cert_dir(void); +const char *X509_get_default_cert_file(void); +const char *X509_get_default_cert_dir_env(void); +const char *X509_get_default_cert_file_env(void); +const char *X509_get_default_private_dir(void); + +X509_REQ *X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); +X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey); + +DECLARE_ASN1_FUNCTIONS(X509_ALGOR) +DECLARE_ASN1_ENCODE_FUNCTIONS(X509_ALGORS, X509_ALGORS, X509_ALGORS) +DECLARE_ASN1_FUNCTIONS(X509_VAL) + +DECLARE_ASN1_FUNCTIONS(X509_PUBKEY) + +X509_PUBKEY *X509_PUBKEY_new_ex(OSSL_LIB_CTX *libctx, const char *propq); +int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey); +EVP_PKEY *X509_PUBKEY_get0(const X509_PUBKEY *key); +EVP_PKEY *X509_PUBKEY_get(const X509_PUBKEY *key); +int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain); +long X509_get_pathlen(X509 *x); +DECLARE_ASN1_ENCODE_FUNCTIONS_only(EVP_PKEY, PUBKEY) +EVP_PKEY *d2i_PUBKEY_ex(EVP_PKEY **a, const unsigned char **pp, long length, + OSSL_LIB_CTX *libctx, const char *propq); +#ifndef OPENSSL_NO_DEPRECATED_3_0 +DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0, RSA, RSA_PUBKEY) +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#ifndef OPENSSL_NO_DSA +DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0, DSA, DSA_PUBKEY) +#endif +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#ifndef OPENSSL_NO_EC +DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0, EC_KEY, EC_PUBKEY) +#endif +#endif + +DECLARE_ASN1_FUNCTIONS(X509_SIG) +void X509_SIG_get0(const X509_SIG *sig, const X509_ALGOR **palg, + const ASN1_OCTET_STRING **pdigest); +void X509_SIG_getm(X509_SIG *sig, X509_ALGOR **palg, + ASN1_OCTET_STRING **pdigest); + +DECLARE_ASN1_FUNCTIONS(X509_REQ_INFO) +DECLARE_ASN1_FUNCTIONS(X509_REQ) +X509_REQ *X509_REQ_new_ex(OSSL_LIB_CTX *libctx, const char *propq); + +DECLARE_ASN1_FUNCTIONS(X509_ATTRIBUTE) +X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value); + +DECLARE_ASN1_FUNCTIONS(X509_EXTENSION) +DECLARE_ASN1_ENCODE_FUNCTIONS(X509_EXTENSIONS, X509_EXTENSIONS, X509_EXTENSIONS) + +DECLARE_ASN1_FUNCTIONS(X509_NAME_ENTRY) + +DECLARE_ASN1_FUNCTIONS(X509_NAME) + +int X509_NAME_set(X509_NAME **xn, const X509_NAME *name); + +DECLARE_ASN1_FUNCTIONS(X509_CINF) +DECLARE_ASN1_FUNCTIONS(X509) +X509 *X509_new_ex(OSSL_LIB_CTX *libctx, const char *propq); +DECLARE_ASN1_FUNCTIONS(X509_CERT_AUX) + +#define X509_get_ex_new_index(l, p, newf, dupf, freef) \ + CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509, l, p, newf, dupf, freef) +int X509_set_ex_data(X509 *r, int idx, void *arg); +void *X509_get_ex_data(const X509 *r, int idx); +DECLARE_ASN1_ENCODE_FUNCTIONS_only(X509, X509_AUX) + +int i2d_re_X509_tbs(X509 *x, unsigned char **pp); + +int X509_SIG_INFO_get(const X509_SIG_INFO *siginf, int *mdnid, int *pknid, + int *secbits, uint32_t *flags); +void X509_SIG_INFO_set(X509_SIG_INFO *siginf, int mdnid, int pknid, + int secbits, uint32_t flags); + +int X509_get_signature_info(X509 *x, int *mdnid, int *pknid, int *secbits, + uint32_t *flags); + +void X509_get0_signature(const ASN1_BIT_STRING **psig, + const X509_ALGOR **palg, const X509 *x); +int X509_get_signature_nid(const X509 *x); + +void X509_set0_distinguishing_id(X509 *x, ASN1_OCTET_STRING *d_id); +ASN1_OCTET_STRING *X509_get0_distinguishing_id(X509 *x); +void X509_REQ_set0_distinguishing_id(X509_REQ *x, ASN1_OCTET_STRING *d_id); +ASN1_OCTET_STRING *X509_REQ_get0_distinguishing_id(X509_REQ *x); + +int X509_alias_set1(X509 *x, const unsigned char *name, int len); +int X509_keyid_set1(X509 *x, const unsigned char *id, int len); +unsigned char *X509_alias_get0(X509 *x, int *len); +unsigned char *X509_keyid_get0(X509 *x, int *len); + +DECLARE_ASN1_FUNCTIONS(X509_REVOKED) +DECLARE_ASN1_FUNCTIONS(X509_CRL_INFO) +DECLARE_ASN1_FUNCTIONS(X509_CRL) +X509_CRL *X509_CRL_new_ex(OSSL_LIB_CTX *libctx, const char *propq); + +int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev); +int X509_CRL_get0_by_serial(X509_CRL *crl, + X509_REVOKED **ret, const ASN1_INTEGER *serial); +int X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x); + +X509_PKEY *X509_PKEY_new(void); +void X509_PKEY_free(X509_PKEY *a); + +DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI) +DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC) +DECLARE_ASN1_FUNCTIONS(NETSCAPE_CERT_SEQUENCE) + +X509_INFO *X509_INFO_new(void); +void X509_INFO_free(X509_INFO *a); +char *X509_NAME_oneline(const X509_NAME *a, char *buf, int size); + +#ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 +int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *algor1, + ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey); +OSSL_DEPRECATEDIN_3_0 +int ASN1_digest(i2d_of_void *i2d, const EVP_MD *type, char *data, + unsigned char *md, unsigned int *len); +OSSL_DEPRECATEDIN_3_0 +int ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1, X509_ALGOR *algor2, + ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey, + const EVP_MD *type); +#endif +int ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *data, + unsigned char *md, unsigned int *len); +int ASN1_item_verify(const ASN1_ITEM *it, const X509_ALGOR *alg, + const ASN1_BIT_STRING *signature, const void *data, + EVP_PKEY *pkey); +int ASN1_item_verify_ctx(const ASN1_ITEM *it, const X509_ALGOR *alg, + const ASN1_BIT_STRING *signature, const void *data, + EVP_MD_CTX *ctx); +int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2, + ASN1_BIT_STRING *signature, const void *data, + EVP_PKEY *pkey, const EVP_MD *md); +int ASN1_item_sign_ctx(const ASN1_ITEM *it, X509_ALGOR *algor1, + X509_ALGOR *algor2, ASN1_BIT_STRING *signature, + const void *data, EVP_MD_CTX *ctx); + +#define X509_VERSION_1 0 +#define X509_VERSION_2 1 +#define X509_VERSION_3 2 + +long X509_get_version(const X509 *x); +int X509_set_version(X509 *x, long version); +int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial); +ASN1_INTEGER *X509_get_serialNumber(X509 *x); +const ASN1_INTEGER *X509_get0_serialNumber(const X509 *x); +int X509_set_issuer_name(X509 *x, const X509_NAME *name); +X509_NAME *X509_get_issuer_name(const X509 *a); +int X509_set_subject_name(X509 *x, const X509_NAME *name); +X509_NAME *X509_get_subject_name(const X509 *a); +const ASN1_TIME *X509_get0_notBefore(const X509 *x); +ASN1_TIME *X509_getm_notBefore(const X509 *x); +int X509_set1_notBefore(X509 *x, const ASN1_TIME *tm); +const ASN1_TIME *X509_get0_notAfter(const X509 *x); +ASN1_TIME *X509_getm_notAfter(const X509 *x); +int X509_set1_notAfter(X509 *x, const ASN1_TIME *tm); +int X509_set_pubkey(X509 *x, EVP_PKEY *pkey); +int X509_up_ref(X509 *x); +int X509_get_signature_type(const X509 *x); + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define X509_get_notBefore X509_getm_notBefore +#define X509_get_notAfter X509_getm_notAfter +#define X509_set_notBefore X509_set1_notBefore +#define X509_set_notAfter X509_set1_notAfter +#endif + +/* + * This one is only used so that a binary form can output, as in + * i2d_X509_PUBKEY(X509_get_X509_PUBKEY(x), &buf) + */ +X509_PUBKEY *X509_get_X509_PUBKEY(const X509 *x); +const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x); +void X509_get0_uids(const X509 *x, const ASN1_BIT_STRING **piuid, + const ASN1_BIT_STRING **psuid); +const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *x); + +EVP_PKEY *X509_get0_pubkey(const X509 *x); +EVP_PKEY *X509_get_pubkey(X509 *x); +ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x); + +#define X509_REQ_VERSION_1 0 + +long X509_REQ_get_version(const X509_REQ *req); +int X509_REQ_set_version(X509_REQ *x, long version); +X509_NAME *X509_REQ_get_subject_name(const X509_REQ *req); +int X509_REQ_set_subject_name(X509_REQ *req, const X509_NAME *name); +void X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig, + const X509_ALGOR **palg); +void X509_REQ_set0_signature(X509_REQ *req, ASN1_BIT_STRING *psig); +int X509_REQ_set1_signature_algo(X509_REQ *req, X509_ALGOR *palg); +int X509_REQ_get_signature_nid(const X509_REQ *req); +int i2d_re_X509_REQ_tbs(X509_REQ *req, unsigned char **pp); +int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey); +EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req); +EVP_PKEY *X509_REQ_get0_pubkey(const X509_REQ *req); +X509_PUBKEY *X509_REQ_get_X509_PUBKEY(X509_REQ *req); +int X509_REQ_extension_nid(int nid); +int *X509_REQ_get_extension_nids(void); +void X509_REQ_set_extension_nids(int *nids); +STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(OSSL_FUTURE_CONST X509_REQ *req); +int X509_REQ_add_extensions_nid(X509_REQ *req, + const STACK_OF(X509_EXTENSION) *exts, int nid); +int X509_REQ_add_extensions(X509_REQ *req, const STACK_OF(X509_EXTENSION) *ext); +int X509_REQ_get_attr_count(const X509_REQ *req); +int X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, int lastpos); +int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, const ASN1_OBJECT *obj, + int lastpos); +X509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc); +X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc); +int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr); +int X509_REQ_add1_attr_by_OBJ(X509_REQ *req, + const ASN1_OBJECT *obj, int type, + const unsigned char *bytes, int len); +int X509_REQ_add1_attr_by_NID(X509_REQ *req, + int nid, int type, + const unsigned char *bytes, int len); +int X509_REQ_add1_attr_by_txt(X509_REQ *req, + const char *attrname, int type, + const unsigned char *bytes, int len); + +#define X509_CRL_VERSION_1 0 +#define X509_CRL_VERSION_2 1 + +int X509_CRL_set_version(X509_CRL *x, long version); +int X509_CRL_set_issuer_name(X509_CRL *x, const X509_NAME *name); +int X509_CRL_set1_lastUpdate(X509_CRL *x, const ASN1_TIME *tm); +int X509_CRL_set1_nextUpdate(X509_CRL *x, const ASN1_TIME *tm); +int X509_CRL_sort(X509_CRL *crl); +int X509_CRL_up_ref(X509_CRL *crl); + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define X509_CRL_set_lastUpdate X509_CRL_set1_lastUpdate +#define X509_CRL_set_nextUpdate X509_CRL_set1_nextUpdate +#endif + +long X509_CRL_get_version(const X509_CRL *crl); +const ASN1_TIME *X509_CRL_get0_lastUpdate(const X509_CRL *crl); +const ASN1_TIME *X509_CRL_get0_nextUpdate(const X509_CRL *crl); +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +OSSL_DEPRECATEDIN_1_1_0 ASN1_TIME *X509_CRL_get_lastUpdate(X509_CRL *crl); +OSSL_DEPRECATEDIN_1_1_0 ASN1_TIME *X509_CRL_get_nextUpdate(X509_CRL *crl); +#endif +X509_NAME *X509_CRL_get_issuer(const X509_CRL *crl); +const STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(const X509_CRL *crl); +STACK_OF(X509_REVOKED) *X509_CRL_get_REVOKED(X509_CRL *crl); +const X509_ALGOR *X509_CRL_get0_tbs_sigalg(const X509_CRL *crl); +void X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig, + const X509_ALGOR **palg); +int X509_CRL_get_signature_nid(const X509_CRL *crl); +int i2d_re_X509_CRL_tbs(X509_CRL *req, unsigned char **pp); + +const ASN1_INTEGER *X509_REVOKED_get0_serialNumber(const X509_REVOKED *x); +int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial); +const ASN1_TIME *X509_REVOKED_get0_revocationDate(const X509_REVOKED *x); +int X509_REVOKED_set_revocationDate(X509_REVOKED *r, ASN1_TIME *tm); +const STACK_OF(X509_EXTENSION) * +X509_REVOKED_get0_extensions(const X509_REVOKED *r); + +X509_CRL *X509_CRL_diff(X509_CRL *base, X509_CRL *newer, + EVP_PKEY *skey, const EVP_MD *md, unsigned int flags); + +int X509_REQ_check_private_key(const X509_REQ *req, EVP_PKEY *pkey); + +int X509_check_private_key(const X509 *cert, const EVP_PKEY *pkey); +int X509_chain_check_suiteb(int *perror_depth, + X509 *x, STACK_OF(X509) *chain, + unsigned long flags); +int X509_CRL_check_suiteb(X509_CRL *crl, EVP_PKEY *pk, unsigned long flags); +void OSSL_STACK_OF_X509_free(STACK_OF(X509) *certs); +STACK_OF(X509) *X509_chain_up_ref(STACK_OF(X509) *chain); + +int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b); +unsigned long X509_issuer_and_serial_hash(X509 *a); + +int X509_issuer_name_cmp(const X509 *a, const X509 *b); +unsigned long X509_issuer_name_hash(X509 *a); + +int X509_subject_name_cmp(const X509 *a, const X509 *b); +unsigned long X509_subject_name_hash(X509 *x); + +#ifndef OPENSSL_NO_MD5 +unsigned long X509_issuer_name_hash_old(X509 *a); +unsigned long X509_subject_name_hash_old(X509 *x); +#endif + +#define X509_ADD_FLAG_DEFAULT 0 +#define X509_ADD_FLAG_UP_REF 0x1 +#define X509_ADD_FLAG_PREPEND 0x2 +#define X509_ADD_FLAG_NO_DUP 0x4 +#define X509_ADD_FLAG_NO_SS 0x8 +int X509_add_cert(STACK_OF(X509) *sk, X509 *cert, int flags); +int X509_add_certs(STACK_OF(X509) *sk, STACK_OF(X509) *certs, int flags); + +int X509_cmp(const X509 *a, const X509 *b); +int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b); +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define X509_NAME_hash(x) X509_NAME_hash_ex(x, NULL, NULL, NULL) +OSSL_DEPRECATEDIN_3_0 int X509_certificate_type(const X509 *x, + const EVP_PKEY *pubkey); +#endif +unsigned long X509_NAME_hash_ex(const X509_NAME *x, OSSL_LIB_CTX *libctx, + const char *propq, int *ok); +unsigned long X509_NAME_hash_old(const X509_NAME *x); + +int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b); +int X509_CRL_match(const X509_CRL *a, const X509_CRL *b); +int X509_aux_print(BIO *out, X509 *x, int indent); +#ifndef OPENSSL_NO_STDIO +int X509_print_ex_fp(FILE *bp, X509 *x, unsigned long nmflag, + unsigned long cflag); +int X509_print_fp(FILE *bp, X509 *x); +int X509_CRL_print_fp(FILE *bp, X509_CRL *x); +int X509_REQ_print_fp(FILE *bp, X509_REQ *req); +int X509_NAME_print_ex_fp(FILE *fp, const X509_NAME *nm, int indent, + unsigned long flags); +#endif + +int X509_NAME_print(BIO *bp, const X509_NAME *name, int obase); +int X509_NAME_print_ex(BIO *out, const X509_NAME *nm, int indent, + unsigned long flags); +int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflag, + unsigned long cflag); +int X509_print(BIO *bp, X509 *x); +int X509_ocspid_print(BIO *bp, X509 *x); +int X509_CRL_print_ex(BIO *out, X509_CRL *x, unsigned long nmflag); +int X509_CRL_print(BIO *bp, X509_CRL *x); +int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflag, + unsigned long cflag); +int X509_REQ_print(BIO *bp, X509_REQ *req); + +int X509_NAME_entry_count(const X509_NAME *name); +int X509_NAME_get_text_by_NID(const X509_NAME *name, int nid, + char *buf, int len); +int X509_NAME_get_text_by_OBJ(const X509_NAME *name, const ASN1_OBJECT *obj, + char *buf, int len); + +/* + * NOTE: you should be passing -1, not 0 as lastpos. The functions that use + * lastpos, search after that position on. + */ +int X509_NAME_get_index_by_NID(const X509_NAME *name, int nid, int lastpos); +int X509_NAME_get_index_by_OBJ(const X509_NAME *name, const ASN1_OBJECT *obj, + int lastpos); +X509_NAME_ENTRY *X509_NAME_get_entry(const X509_NAME *name, int loc); +X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc); +int X509_NAME_add_entry(X509_NAME *name, const X509_NAME_ENTRY *ne, + int loc, int set); +int X509_NAME_add_entry_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj, int type, + const unsigned char *bytes, int len, int loc, + int set); +int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type, + const unsigned char *bytes, int len, int loc, + int set); +X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne, + const char *field, int type, + const unsigned char *bytes, + int len); +X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid, + int type, + const unsigned char *bytes, + int len); +int X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type, + const unsigned char *bytes, int len, int loc, + int set); +X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne, + const ASN1_OBJECT *obj, int type, + const unsigned char *bytes, + int len); +int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, const ASN1_OBJECT *obj); +int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type, + const unsigned char *bytes, int len); +ASN1_OBJECT *X509_NAME_ENTRY_get_object(const X509_NAME_ENTRY *ne); +ASN1_STRING *X509_NAME_ENTRY_get_data(const X509_NAME_ENTRY *ne); +int X509_NAME_ENTRY_set(const X509_NAME_ENTRY *ne); + +int X509_NAME_get0_der(const X509_NAME *nm, const unsigned char **pder, + size_t *pderlen); + +int X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x); +int X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x, + int nid, int lastpos); +int X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *x, + const ASN1_OBJECT *obj, int lastpos); +int X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x, + int crit, int lastpos); +X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc); +X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc); +STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, + X509_EXTENSION *ex, int loc); +STACK_OF(X509_EXTENSION) *X509v3_add_extensions(STACK_OF(X509_EXTENSION) **target, + const STACK_OF(X509_EXTENSION) *exts); + +int X509_get_ext_count(const X509 *x); +int X509_get_ext_by_NID(const X509 *x, int nid, int lastpos); +int X509_get_ext_by_OBJ(const X509 *x, const ASN1_OBJECT *obj, int lastpos); +int X509_get_ext_by_critical(const X509 *x, int crit, int lastpos); +X509_EXTENSION *X509_get_ext(const X509 *x, int loc); +X509_EXTENSION *X509_delete_ext(X509 *x, int loc); +int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc); +void *X509_get_ext_d2i(const X509 *x, int nid, int *crit, int *idx); +int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit, + unsigned long flags); + +int X509_CRL_get_ext_count(const X509_CRL *x); +int X509_CRL_get_ext_by_NID(const X509_CRL *x, int nid, int lastpos); +int X509_CRL_get_ext_by_OBJ(const X509_CRL *x, const ASN1_OBJECT *obj, + int lastpos); +int X509_CRL_get_ext_by_critical(const X509_CRL *x, int crit, int lastpos); +X509_EXTENSION *X509_CRL_get_ext(const X509_CRL *x, int loc); +X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc); +int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc); +void *X509_CRL_get_ext_d2i(const X509_CRL *x, int nid, int *crit, int *idx); +int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit, + unsigned long flags); + +int X509_REVOKED_get_ext_count(const X509_REVOKED *x); +int X509_REVOKED_get_ext_by_NID(const X509_REVOKED *x, int nid, int lastpos); +int X509_REVOKED_get_ext_by_OBJ(const X509_REVOKED *x, const ASN1_OBJECT *obj, + int lastpos); +int X509_REVOKED_get_ext_by_critical(const X509_REVOKED *x, int crit, + int lastpos); +X509_EXTENSION *X509_REVOKED_get_ext(const X509_REVOKED *x, int loc); +X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc); +int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc); +void *X509_REVOKED_get_ext_d2i(const X509_REVOKED *x, int nid, int *crit, + int *idx); +int X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit, + unsigned long flags); + +X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, + int nid, int crit, + ASN1_OCTET_STRING *data); +X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex, + const ASN1_OBJECT *obj, int crit, + ASN1_OCTET_STRING *data); +int X509_EXTENSION_set_object(X509_EXTENSION *ex, const ASN1_OBJECT *obj); +int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit); +int X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data); +ASN1_OBJECT *X509_EXTENSION_get_object(X509_EXTENSION *ex); +ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne); +int X509_EXTENSION_get_critical(const X509_EXTENSION *ex); + +int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x); +int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid, + int lastpos); +int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, + const ASN1_OBJECT *obj, int lastpos); +X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc); +X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc); +STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, + X509_ATTRIBUTE *attr); +STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) + **x, + const ASN1_OBJECT *obj, + int type, + const unsigned char *bytes, + int len); +STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) + **x, + int nid, int type, + const unsigned char *bytes, + int len); +STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) + **x, + const char *attrname, + int type, + const unsigned char *bytes, + int len); +void *X509at_get0_data_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *x, + const ASN1_OBJECT *obj, int lastpos, int type); +X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, + int atrtype, const void *data, + int len); +X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr, + const ASN1_OBJECT *obj, + int atrtype, const void *data, + int len); +X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr, + const char *atrname, int type, + const unsigned char *bytes, + int len); +int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj); +int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, + const void *data, int len); +void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, int atrtype, + void *data); +int X509_ATTRIBUTE_count(const X509_ATTRIBUTE *attr); +ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr); +ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx); + +int EVP_PKEY_get_attr_count(const EVP_PKEY *key); +int EVP_PKEY_get_attr_by_NID(const EVP_PKEY *key, int nid, int lastpos); +int EVP_PKEY_get_attr_by_OBJ(const EVP_PKEY *key, const ASN1_OBJECT *obj, + int lastpos); +X509_ATTRIBUTE *EVP_PKEY_get_attr(const EVP_PKEY *key, int loc); +X509_ATTRIBUTE *EVP_PKEY_delete_attr(EVP_PKEY *key, int loc); +int EVP_PKEY_add1_attr(EVP_PKEY *key, X509_ATTRIBUTE *attr); +int EVP_PKEY_add1_attr_by_OBJ(EVP_PKEY *key, + const ASN1_OBJECT *obj, int type, + const unsigned char *bytes, int len); +int EVP_PKEY_add1_attr_by_NID(EVP_PKEY *key, + int nid, int type, + const unsigned char *bytes, int len); +int EVP_PKEY_add1_attr_by_txt(EVP_PKEY *key, + const char *attrname, int type, + const unsigned char *bytes, int len); + +/* lookup a cert from a X509 STACK */ +X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk, const X509_NAME *name, + const ASN1_INTEGER *serial); +X509 *X509_find_by_subject(STACK_OF(X509) *sk, const X509_NAME *name); + +DECLARE_ASN1_FUNCTIONS(PBEPARAM) +DECLARE_ASN1_FUNCTIONS(PBE2PARAM) +DECLARE_ASN1_FUNCTIONS(PBKDF2PARAM) +DECLARE_ASN1_FUNCTIONS(PBMAC1PARAM) +#ifndef OPENSSL_NO_SCRYPT +DECLARE_ASN1_FUNCTIONS(SCRYPT_PARAMS) +#endif + +int PKCS5_pbe_set0_algor(X509_ALGOR *algor, int alg, int iter, + const unsigned char *salt, int saltlen); +int PKCS5_pbe_set0_algor_ex(X509_ALGOR *algor, int alg, int iter, + const unsigned char *salt, int saltlen, + OSSL_LIB_CTX *libctx); + +X509_ALGOR *PKCS5_pbe_set(int alg, int iter, + const unsigned char *salt, int saltlen); +X509_ALGOR *PKCS5_pbe_set_ex(int alg, int iter, + const unsigned char *salt, int saltlen, + OSSL_LIB_CTX *libctx); + +X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter, + unsigned char *salt, int saltlen); +X509_ALGOR *PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter, + unsigned char *salt, int saltlen, + unsigned char *aiv, int prf_nid); +X509_ALGOR *PKCS5_pbe2_set_iv_ex(const EVP_CIPHER *cipher, int iter, + unsigned char *salt, int saltlen, + unsigned char *aiv, int prf_nid, + OSSL_LIB_CTX *libctx); + +#ifndef OPENSSL_NO_SCRYPT +X509_ALGOR *PKCS5_pbe2_set_scrypt(const EVP_CIPHER *cipher, + const unsigned char *salt, int saltlen, + unsigned char *aiv, uint64_t N, uint64_t r, + uint64_t p); +#endif + +X509_ALGOR *PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen, + int prf_nid, int keylen); +X509_ALGOR *PKCS5_pbkdf2_set_ex(int iter, unsigned char *salt, int saltlen, + int prf_nid, int keylen, + OSSL_LIB_CTX *libctx); + +PBKDF2PARAM *PBMAC1_get1_pbkdf2_param(const X509_ALGOR *macalg); +/* PKCS#8 utilities */ + +DECLARE_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO) + +EVP_PKEY *EVP_PKCS82PKEY(const PKCS8_PRIV_KEY_INFO *p8); +EVP_PKEY *EVP_PKCS82PKEY_ex(const PKCS8_PRIV_KEY_INFO *p8, OSSL_LIB_CTX *libctx, + const char *propq); +PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(const EVP_PKEY *pkey); + +int PKCS8_pkey_set0(PKCS8_PRIV_KEY_INFO *priv, ASN1_OBJECT *aobj, + int version, int ptype, void *pval, + unsigned char *penc, int penclen); +int PKCS8_pkey_get0(const ASN1_OBJECT **ppkalg, + const unsigned char **pk, int *ppklen, + const X509_ALGOR **pa, const PKCS8_PRIV_KEY_INFO *p8); + +const STACK_OF(X509_ATTRIBUTE) * +PKCS8_pkey_get0_attrs(const PKCS8_PRIV_KEY_INFO *p8); +int PKCS8_pkey_add1_attr(PKCS8_PRIV_KEY_INFO *p8, X509_ATTRIBUTE *attr); +int PKCS8_pkey_add1_attr_by_NID(PKCS8_PRIV_KEY_INFO *p8, int nid, int type, + const unsigned char *bytes, int len); +int PKCS8_pkey_add1_attr_by_OBJ(PKCS8_PRIV_KEY_INFO *p8, const ASN1_OBJECT *obj, + int type, const unsigned char *bytes, int len); + +void X509_PUBKEY_set0_public_key(X509_PUBKEY *pub, + unsigned char *penc, int penclen); +int X509_PUBKEY_set0_param(X509_PUBKEY *pub, ASN1_OBJECT *aobj, + int ptype, void *pval, + unsigned char *penc, int penclen); +int X509_PUBKEY_get0_param(ASN1_OBJECT **ppkalg, + const unsigned char **pk, int *ppklen, + X509_ALGOR **pa, const X509_PUBKEY *pub); +int X509_PUBKEY_eq(const X509_PUBKEY *a, const X509_PUBKEY *b); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/x509_acert.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/x509_acert.h new file mode 100644 index 0000000000000000000000000000000000000000..0fae06d7f3c0e51ff95f5f17de6000eb75f8f48c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/x509_acert.h @@ -0,0 +1,304 @@ +/* + * WARNING: do not edit! + * Generated by makefile from include\openssl\x509_acert.h.in + * + * Copyright 2022-2024 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* clang-format off */ + +/* clang-format on */ + +#ifndef OPENSSL_X509_ACERT_H +#define OPENSSL_X509_ACERT_H +#pragma once + +#include +#include +#include + +typedef struct X509_acert_st X509_ACERT; +typedef struct X509_acert_info_st X509_ACERT_INFO; +typedef struct ossl_object_digest_info_st OSSL_OBJECT_DIGEST_INFO; +typedef struct ossl_issuer_serial_st OSSL_ISSUER_SERIAL; +typedef struct X509_acert_issuer_v2form_st X509_ACERT_ISSUER_V2FORM; + +DECLARE_ASN1_FUNCTIONS(X509_ACERT) +DECLARE_ASN1_DUP_FUNCTION(X509_ACERT) +DECLARE_ASN1_ITEM(X509_ACERT_INFO) +DECLARE_ASN1_ALLOC_FUNCTIONS(X509_ACERT_INFO) +DECLARE_ASN1_ALLOC_FUNCTIONS(OSSL_OBJECT_DIGEST_INFO) +DECLARE_ASN1_ALLOC_FUNCTIONS(OSSL_ISSUER_SERIAL) +DECLARE_ASN1_ALLOC_FUNCTIONS(X509_ACERT_ISSUER_V2FORM) + +#ifndef OPENSSL_NO_STDIO +X509_ACERT *d2i_X509_ACERT_fp(FILE *fp, X509_ACERT **acert); +int i2d_X509_ACERT_fp(FILE *fp, const X509_ACERT *acert); +#endif + +DECLARE_PEM_rw(X509_ACERT, X509_ACERT) + +X509_ACERT *d2i_X509_ACERT_bio(BIO *bp, X509_ACERT **acert); +int i2d_X509_ACERT_bio(BIO *bp, const X509_ACERT *acert); + +int X509_ACERT_sign(X509_ACERT *x, EVP_PKEY *pkey, const EVP_MD *md); +int X509_ACERT_sign_ctx(X509_ACERT *x, EVP_MD_CTX *ctx); +int X509_ACERT_verify(X509_ACERT *a, EVP_PKEY *r); + +#define X509_ACERT_VERSION_2 1 + +const GENERAL_NAMES *X509_ACERT_get0_holder_entityName(const X509_ACERT *x); +const OSSL_ISSUER_SERIAL *X509_ACERT_get0_holder_baseCertId(const X509_ACERT *x); +const OSSL_OBJECT_DIGEST_INFO *X509_ACERT_get0_holder_digest(const X509_ACERT *x); +const X509_NAME *X509_ACERT_get0_issuerName(const X509_ACERT *x); +long X509_ACERT_get_version(const X509_ACERT *x); +void X509_ACERT_get0_signature(const X509_ACERT *x, + const ASN1_BIT_STRING **psig, + const X509_ALGOR **palg); +int X509_ACERT_get_signature_nid(const X509_ACERT *x); +const X509_ALGOR *X509_ACERT_get0_info_sigalg(const X509_ACERT *x); +const ASN1_INTEGER *X509_ACERT_get0_serialNumber(const X509_ACERT *x); +const ASN1_TIME *X509_ACERT_get0_notBefore(const X509_ACERT *x); +const ASN1_TIME *X509_ACERT_get0_notAfter(const X509_ACERT *x); +const ASN1_BIT_STRING *X509_ACERT_get0_issuerUID(const X509_ACERT *x); + +int X509_ACERT_print(BIO *bp, X509_ACERT *x); +int X509_ACERT_print_ex(BIO *bp, X509_ACERT *x, unsigned long nmflags, + unsigned long cflag); + +int X509_ACERT_get_attr_count(const X509_ACERT *x); +int X509_ACERT_get_attr_by_NID(const X509_ACERT *x, int nid, int lastpos); +int X509_ACERT_get_attr_by_OBJ(const X509_ACERT *x, const ASN1_OBJECT *obj, + int lastpos); +X509_ATTRIBUTE *X509_ACERT_get_attr(const X509_ACERT *x, int loc); +X509_ATTRIBUTE *X509_ACERT_delete_attr(X509_ACERT *x, int loc); + +void *X509_ACERT_get_ext_d2i(const X509_ACERT *x, int nid, int *crit, int *idx); +int X509_ACERT_add1_ext_i2d(X509_ACERT *x, int nid, void *value, int crit, + unsigned long flags); +const STACK_OF(X509_EXTENSION) *X509_ACERT_get0_extensions(const X509_ACERT *x); + +#define OSSL_OBJECT_DIGEST_INFO_PUBLIC_KEY 0 +#define OSSL_OBJECT_DIGEST_INFO_PUBLIC_KEY_CERT 1 +#define OSSL_OBJECT_DIGEST_INFO_OTHER 2 /* must not be used in RFC 5755 profile */ +int X509_ACERT_set_version(X509_ACERT *x, long version); +void X509_ACERT_set0_holder_entityName(X509_ACERT *x, GENERAL_NAMES *name); +void X509_ACERT_set0_holder_baseCertId(X509_ACERT *x, OSSL_ISSUER_SERIAL *isss); +void X509_ACERT_set0_holder_digest(X509_ACERT *x, + OSSL_OBJECT_DIGEST_INFO *dinfo); + +int X509_ACERT_add1_attr(X509_ACERT *x, X509_ATTRIBUTE *attr); +int X509_ACERT_add1_attr_by_OBJ(X509_ACERT *x, const ASN1_OBJECT *obj, + int type, const void *bytes, int len); +int X509_ACERT_add1_attr_by_NID(X509_ACERT *x, int nid, int type, + const void *bytes, int len); +int X509_ACERT_add1_attr_by_txt(X509_ACERT *x, const char *attrname, int type, + const unsigned char *bytes, int len); +int X509_ACERT_add_attr_nconf(CONF *conf, const char *section, + X509_ACERT *acert); + +int X509_ACERT_set1_issuerName(X509_ACERT *x, const X509_NAME *name); +int X509_ACERT_set1_serialNumber(X509_ACERT *x, const ASN1_INTEGER *serial); +int X509_ACERT_set1_notBefore(X509_ACERT *x, const ASN1_GENERALIZEDTIME *time); +int X509_ACERT_set1_notAfter(X509_ACERT *x, const ASN1_GENERALIZEDTIME *time); + +void OSSL_OBJECT_DIGEST_INFO_get0_digest(const OSSL_OBJECT_DIGEST_INFO *o, + int *digestedObjectType, + const X509_ALGOR **digestAlgorithm, + const ASN1_BIT_STRING **digest); + +int OSSL_OBJECT_DIGEST_INFO_set1_digest(OSSL_OBJECT_DIGEST_INFO *o, + int digestedObjectType, + X509_ALGOR *digestAlgorithm, + ASN1_BIT_STRING *digest); + +const X509_NAME *OSSL_ISSUER_SERIAL_get0_issuer(const OSSL_ISSUER_SERIAL *isss); +const ASN1_INTEGER *OSSL_ISSUER_SERIAL_get0_serial(const OSSL_ISSUER_SERIAL *isss); +const ASN1_BIT_STRING *OSSL_ISSUER_SERIAL_get0_issuerUID(const OSSL_ISSUER_SERIAL *isss); + +int OSSL_ISSUER_SERIAL_set1_issuer(OSSL_ISSUER_SERIAL *isss, + const X509_NAME *issuer); +int OSSL_ISSUER_SERIAL_set1_serial(OSSL_ISSUER_SERIAL *isss, + const ASN1_INTEGER *serial); +int OSSL_ISSUER_SERIAL_set1_issuerUID(OSSL_ISSUER_SERIAL *isss, + const ASN1_BIT_STRING *uid); + +#define OSSL_IETFAS_OCTETS 0 +#define OSSL_IETFAS_OID 1 +#define OSSL_IETFAS_STRING 2 + +typedef struct OSSL_IETF_ATTR_SYNTAX_VALUE_st OSSL_IETF_ATTR_SYNTAX_VALUE; +typedef struct OSSL_IETF_ATTR_SYNTAX_st OSSL_IETF_ATTR_SYNTAX; +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(OSSL_IETF_ATTR_SYNTAX_VALUE, OSSL_IETF_ATTR_SYNTAX_VALUE, OSSL_IETF_ATTR_SYNTAX_VALUE) +#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk)) +#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_value(sk, idx) ((OSSL_IETF_ATTR_SYNTAX_VALUE *)OPENSSL_sk_value(ossl_check_const_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk), (idx))) +#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_new(cmp) ((STACK_OF(OSSL_IETF_ATTR_SYNTAX_VALUE) *)OPENSSL_sk_new(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_compfunc_type(cmp))) +#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_new_null() ((STACK_OF(OSSL_IETF_ATTR_SYNTAX_VALUE) *)OPENSSL_sk_new_null()) +#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_new_reserve(cmp, n) ((STACK_OF(OSSL_IETF_ATTR_SYNTAX_VALUE) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_compfunc_type(cmp), (n))) +#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk), (n)) +#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_free(sk) OPENSSL_sk_free(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk)) +#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk)) +#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_delete(sk, i) ((OSSL_IETF_ATTR_SYNTAX_VALUE *)OPENSSL_sk_delete(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk), (i))) +#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_delete_ptr(sk, ptr) ((OSSL_IETF_ATTR_SYNTAX_VALUE *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk), ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_type(ptr))) +#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk), ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_type(ptr)) +#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk), ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_type(ptr)) +#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_pop(sk) ((OSSL_IETF_ATTR_SYNTAX_VALUE *)OPENSSL_sk_pop(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk))) +#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_shift(sk) ((OSSL_IETF_ATTR_SYNTAX_VALUE *)OPENSSL_sk_shift(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk))) +#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk), ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_freefunc_type(freefunc)) +#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk), ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_type(ptr), (idx)) +#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_set(sk, idx, ptr) ((OSSL_IETF_ATTR_SYNTAX_VALUE *)OPENSSL_sk_set(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk), (idx), ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_type(ptr))) +#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk), ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_type(ptr)) +#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk), ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_type(ptr)) +#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk), ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_type(ptr), pnum) +#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk)) +#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk)) +#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_dup(sk) ((STACK_OF(OSSL_IETF_ATTR_SYNTAX_VALUE) *)OPENSSL_sk_dup(ossl_check_const_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk))) +#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_IETF_ATTR_SYNTAX_VALUE) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk), ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_copyfunc_type(copyfunc), ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_freefunc_type(freefunc))) +#define sk_OSSL_IETF_ATTR_SYNTAX_VALUE_set_cmp_func(sk, cmp) ((sk_OSSL_IETF_ATTR_SYNTAX_VALUE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_sk_type(sk), ossl_check_OSSL_IETF_ATTR_SYNTAX_VALUE_compfunc_type(cmp))) + +/* clang-format on */ + +DECLARE_ASN1_ITEM(OSSL_IETF_ATTR_SYNTAX_VALUE) +DECLARE_ASN1_ALLOC_FUNCTIONS(OSSL_IETF_ATTR_SYNTAX_VALUE) +DECLARE_ASN1_FUNCTIONS(OSSL_IETF_ATTR_SYNTAX) + +const GENERAL_NAMES * +OSSL_IETF_ATTR_SYNTAX_get0_policyAuthority(const OSSL_IETF_ATTR_SYNTAX *a); +void OSSL_IETF_ATTR_SYNTAX_set0_policyAuthority(OSSL_IETF_ATTR_SYNTAX *a, + GENERAL_NAMES *names); + +int OSSL_IETF_ATTR_SYNTAX_get_value_num(const OSSL_IETF_ATTR_SYNTAX *a); +void *OSSL_IETF_ATTR_SYNTAX_get0_value(const OSSL_IETF_ATTR_SYNTAX *a, + int ind, int *type); +int OSSL_IETF_ATTR_SYNTAX_add1_value(OSSL_IETF_ATTR_SYNTAX *a, int type, + void *data); +int OSSL_IETF_ATTR_SYNTAX_print(BIO *bp, OSSL_IETF_ATTR_SYNTAX *a, int indent); + +struct TARGET_CERT_st { + OSSL_ISSUER_SERIAL *targetCertificate; + GENERAL_NAME *targetName; + OSSL_OBJECT_DIGEST_INFO *certDigestInfo; +}; + +typedef struct TARGET_CERT_st OSSL_TARGET_CERT; + +#define OSSL_TGT_TARGET_NAME 0 +#define OSSL_TGT_TARGET_GROUP 1 +#define OSSL_TGT_TARGET_CERT 2 + +typedef struct TARGET_st { + int type; + union { + GENERAL_NAME *targetName; + GENERAL_NAME *targetGroup; + OSSL_TARGET_CERT *targetCert; + } choice; +} OSSL_TARGET; + +typedef STACK_OF(OSSL_TARGET) OSSL_TARGETS; +typedef STACK_OF(OSSL_TARGETS) OSSL_TARGETING_INFORMATION; + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(OSSL_TARGET, OSSL_TARGET, OSSL_TARGET) +#define sk_OSSL_TARGET_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_TARGET_sk_type(sk)) +#define sk_OSSL_TARGET_value(sk, idx) ((OSSL_TARGET *)OPENSSL_sk_value(ossl_check_const_OSSL_TARGET_sk_type(sk), (idx))) +#define sk_OSSL_TARGET_new(cmp) ((STACK_OF(OSSL_TARGET) *)OPENSSL_sk_new(ossl_check_OSSL_TARGET_compfunc_type(cmp))) +#define sk_OSSL_TARGET_new_null() ((STACK_OF(OSSL_TARGET) *)OPENSSL_sk_new_null()) +#define sk_OSSL_TARGET_new_reserve(cmp, n) ((STACK_OF(OSSL_TARGET) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_TARGET_compfunc_type(cmp), (n))) +#define sk_OSSL_TARGET_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_TARGET_sk_type(sk), (n)) +#define sk_OSSL_TARGET_free(sk) OPENSSL_sk_free(ossl_check_OSSL_TARGET_sk_type(sk)) +#define sk_OSSL_TARGET_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_TARGET_sk_type(sk)) +#define sk_OSSL_TARGET_delete(sk, i) ((OSSL_TARGET *)OPENSSL_sk_delete(ossl_check_OSSL_TARGET_sk_type(sk), (i))) +#define sk_OSSL_TARGET_delete_ptr(sk, ptr) ((OSSL_TARGET *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_TARGET_sk_type(sk), ossl_check_OSSL_TARGET_type(ptr))) +#define sk_OSSL_TARGET_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_TARGET_sk_type(sk), ossl_check_OSSL_TARGET_type(ptr)) +#define sk_OSSL_TARGET_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_TARGET_sk_type(sk), ossl_check_OSSL_TARGET_type(ptr)) +#define sk_OSSL_TARGET_pop(sk) ((OSSL_TARGET *)OPENSSL_sk_pop(ossl_check_OSSL_TARGET_sk_type(sk))) +#define sk_OSSL_TARGET_shift(sk) ((OSSL_TARGET *)OPENSSL_sk_shift(ossl_check_OSSL_TARGET_sk_type(sk))) +#define sk_OSSL_TARGET_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_TARGET_sk_type(sk), ossl_check_OSSL_TARGET_freefunc_type(freefunc)) +#define sk_OSSL_TARGET_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_TARGET_sk_type(sk), ossl_check_OSSL_TARGET_type(ptr), (idx)) +#define sk_OSSL_TARGET_set(sk, idx, ptr) ((OSSL_TARGET *)OPENSSL_sk_set(ossl_check_OSSL_TARGET_sk_type(sk), (idx), ossl_check_OSSL_TARGET_type(ptr))) +#define sk_OSSL_TARGET_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_TARGET_sk_type(sk), ossl_check_OSSL_TARGET_type(ptr)) +#define sk_OSSL_TARGET_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_TARGET_sk_type(sk), ossl_check_OSSL_TARGET_type(ptr)) +#define sk_OSSL_TARGET_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_TARGET_sk_type(sk), ossl_check_OSSL_TARGET_type(ptr), pnum) +#define sk_OSSL_TARGET_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_TARGET_sk_type(sk)) +#define sk_OSSL_TARGET_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_TARGET_sk_type(sk)) +#define sk_OSSL_TARGET_dup(sk) ((STACK_OF(OSSL_TARGET) *)OPENSSL_sk_dup(ossl_check_const_OSSL_TARGET_sk_type(sk))) +#define sk_OSSL_TARGET_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_TARGET) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_TARGET_sk_type(sk), ossl_check_OSSL_TARGET_copyfunc_type(copyfunc), ossl_check_OSSL_TARGET_freefunc_type(freefunc))) +#define sk_OSSL_TARGET_set_cmp_func(sk, cmp) ((sk_OSSL_TARGET_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_TARGET_sk_type(sk), ossl_check_OSSL_TARGET_compfunc_type(cmp))) + +/* clang-format on */ + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(OSSL_TARGETS, OSSL_TARGETS, OSSL_TARGETS) +#define sk_OSSL_TARGETS_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_TARGETS_sk_type(sk)) +#define sk_OSSL_TARGETS_value(sk, idx) ((OSSL_TARGETS *)OPENSSL_sk_value(ossl_check_const_OSSL_TARGETS_sk_type(sk), (idx))) +#define sk_OSSL_TARGETS_new(cmp) ((STACK_OF(OSSL_TARGETS) *)OPENSSL_sk_new(ossl_check_OSSL_TARGETS_compfunc_type(cmp))) +#define sk_OSSL_TARGETS_new_null() ((STACK_OF(OSSL_TARGETS) *)OPENSSL_sk_new_null()) +#define sk_OSSL_TARGETS_new_reserve(cmp, n) ((STACK_OF(OSSL_TARGETS) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_TARGETS_compfunc_type(cmp), (n))) +#define sk_OSSL_TARGETS_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_TARGETS_sk_type(sk), (n)) +#define sk_OSSL_TARGETS_free(sk) OPENSSL_sk_free(ossl_check_OSSL_TARGETS_sk_type(sk)) +#define sk_OSSL_TARGETS_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_TARGETS_sk_type(sk)) +#define sk_OSSL_TARGETS_delete(sk, i) ((OSSL_TARGETS *)OPENSSL_sk_delete(ossl_check_OSSL_TARGETS_sk_type(sk), (i))) +#define sk_OSSL_TARGETS_delete_ptr(sk, ptr) ((OSSL_TARGETS *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_TARGETS_sk_type(sk), ossl_check_OSSL_TARGETS_type(ptr))) +#define sk_OSSL_TARGETS_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_TARGETS_sk_type(sk), ossl_check_OSSL_TARGETS_type(ptr)) +#define sk_OSSL_TARGETS_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_TARGETS_sk_type(sk), ossl_check_OSSL_TARGETS_type(ptr)) +#define sk_OSSL_TARGETS_pop(sk) ((OSSL_TARGETS *)OPENSSL_sk_pop(ossl_check_OSSL_TARGETS_sk_type(sk))) +#define sk_OSSL_TARGETS_shift(sk) ((OSSL_TARGETS *)OPENSSL_sk_shift(ossl_check_OSSL_TARGETS_sk_type(sk))) +#define sk_OSSL_TARGETS_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_TARGETS_sk_type(sk), ossl_check_OSSL_TARGETS_freefunc_type(freefunc)) +#define sk_OSSL_TARGETS_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_TARGETS_sk_type(sk), ossl_check_OSSL_TARGETS_type(ptr), (idx)) +#define sk_OSSL_TARGETS_set(sk, idx, ptr) ((OSSL_TARGETS *)OPENSSL_sk_set(ossl_check_OSSL_TARGETS_sk_type(sk), (idx), ossl_check_OSSL_TARGETS_type(ptr))) +#define sk_OSSL_TARGETS_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_TARGETS_sk_type(sk), ossl_check_OSSL_TARGETS_type(ptr)) +#define sk_OSSL_TARGETS_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_TARGETS_sk_type(sk), ossl_check_OSSL_TARGETS_type(ptr)) +#define sk_OSSL_TARGETS_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_TARGETS_sk_type(sk), ossl_check_OSSL_TARGETS_type(ptr), pnum) +#define sk_OSSL_TARGETS_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_TARGETS_sk_type(sk)) +#define sk_OSSL_TARGETS_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_TARGETS_sk_type(sk)) +#define sk_OSSL_TARGETS_dup(sk) ((STACK_OF(OSSL_TARGETS) *)OPENSSL_sk_dup(ossl_check_const_OSSL_TARGETS_sk_type(sk))) +#define sk_OSSL_TARGETS_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_TARGETS) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_TARGETS_sk_type(sk), ossl_check_OSSL_TARGETS_copyfunc_type(copyfunc), ossl_check_OSSL_TARGETS_freefunc_type(freefunc))) +#define sk_OSSL_TARGETS_set_cmp_func(sk, cmp) ((sk_OSSL_TARGETS_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_TARGETS_sk_type(sk), ossl_check_OSSL_TARGETS_compfunc_type(cmp))) + +/* clang-format on */ + +DECLARE_ASN1_FUNCTIONS(OSSL_TARGET) +DECLARE_ASN1_FUNCTIONS(OSSL_TARGETS) +DECLARE_ASN1_FUNCTIONS(OSSL_TARGETING_INFORMATION) + +typedef STACK_OF(OSSL_ISSUER_SERIAL) OSSL_AUTHORITY_ATTRIBUTE_ID_SYNTAX; +DECLARE_ASN1_FUNCTIONS(OSSL_AUTHORITY_ATTRIBUTE_ID_SYNTAX) + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(OSSL_ISSUER_SERIAL, OSSL_ISSUER_SERIAL, OSSL_ISSUER_SERIAL) +#define sk_OSSL_ISSUER_SERIAL_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_ISSUER_SERIAL_sk_type(sk)) +#define sk_OSSL_ISSUER_SERIAL_value(sk, idx) ((OSSL_ISSUER_SERIAL *)OPENSSL_sk_value(ossl_check_const_OSSL_ISSUER_SERIAL_sk_type(sk), (idx))) +#define sk_OSSL_ISSUER_SERIAL_new(cmp) ((STACK_OF(OSSL_ISSUER_SERIAL) *)OPENSSL_sk_new(ossl_check_OSSL_ISSUER_SERIAL_compfunc_type(cmp))) +#define sk_OSSL_ISSUER_SERIAL_new_null() ((STACK_OF(OSSL_ISSUER_SERIAL) *)OPENSSL_sk_new_null()) +#define sk_OSSL_ISSUER_SERIAL_new_reserve(cmp, n) ((STACK_OF(OSSL_ISSUER_SERIAL) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_ISSUER_SERIAL_compfunc_type(cmp), (n))) +#define sk_OSSL_ISSUER_SERIAL_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk), (n)) +#define sk_OSSL_ISSUER_SERIAL_free(sk) OPENSSL_sk_free(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk)) +#define sk_OSSL_ISSUER_SERIAL_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk)) +#define sk_OSSL_ISSUER_SERIAL_delete(sk, i) ((OSSL_ISSUER_SERIAL *)OPENSSL_sk_delete(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk), (i))) +#define sk_OSSL_ISSUER_SERIAL_delete_ptr(sk, ptr) ((OSSL_ISSUER_SERIAL *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk), ossl_check_OSSL_ISSUER_SERIAL_type(ptr))) +#define sk_OSSL_ISSUER_SERIAL_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk), ossl_check_OSSL_ISSUER_SERIAL_type(ptr)) +#define sk_OSSL_ISSUER_SERIAL_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk), ossl_check_OSSL_ISSUER_SERIAL_type(ptr)) +#define sk_OSSL_ISSUER_SERIAL_pop(sk) ((OSSL_ISSUER_SERIAL *)OPENSSL_sk_pop(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk))) +#define sk_OSSL_ISSUER_SERIAL_shift(sk) ((OSSL_ISSUER_SERIAL *)OPENSSL_sk_shift(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk))) +#define sk_OSSL_ISSUER_SERIAL_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk), ossl_check_OSSL_ISSUER_SERIAL_freefunc_type(freefunc)) +#define sk_OSSL_ISSUER_SERIAL_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk), ossl_check_OSSL_ISSUER_SERIAL_type(ptr), (idx)) +#define sk_OSSL_ISSUER_SERIAL_set(sk, idx, ptr) ((OSSL_ISSUER_SERIAL *)OPENSSL_sk_set(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk), (idx), ossl_check_OSSL_ISSUER_SERIAL_type(ptr))) +#define sk_OSSL_ISSUER_SERIAL_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk), ossl_check_OSSL_ISSUER_SERIAL_type(ptr)) +#define sk_OSSL_ISSUER_SERIAL_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk), ossl_check_OSSL_ISSUER_SERIAL_type(ptr)) +#define sk_OSSL_ISSUER_SERIAL_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk), ossl_check_OSSL_ISSUER_SERIAL_type(ptr), pnum) +#define sk_OSSL_ISSUER_SERIAL_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk)) +#define sk_OSSL_ISSUER_SERIAL_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_ISSUER_SERIAL_sk_type(sk)) +#define sk_OSSL_ISSUER_SERIAL_dup(sk) ((STACK_OF(OSSL_ISSUER_SERIAL) *)OPENSSL_sk_dup(ossl_check_const_OSSL_ISSUER_SERIAL_sk_type(sk))) +#define sk_OSSL_ISSUER_SERIAL_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_ISSUER_SERIAL) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_ISSUER_SERIAL_sk_type(sk), ossl_check_OSSL_ISSUER_SERIAL_copyfunc_type(copyfunc), ossl_check_OSSL_ISSUER_SERIAL_freefunc_type(freefunc))) +#define sk_OSSL_ISSUER_SERIAL_set_cmp_func(sk, cmp) ((sk_OSSL_ISSUER_SERIAL_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_ISSUER_SERIAL_sk_type(sk), ossl_check_OSSL_ISSUER_SERIAL_compfunc_type(cmp))) + +/* clang-format on */ + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/x509_vfy.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/x509_vfy.h new file mode 100644 index 0000000000000000000000000000000000000000..5753ab91fdc3f6f7e57d1a7e4db6fcd7ec808561 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/x509_vfy.h @@ -0,0 +1,922 @@ +/* + * WARNING: do not edit! + * Generated by makefile from include\openssl\x509_vfy.h.in + * + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* clang-format off */ + +/* clang-format on */ + +#ifndef OPENSSL_X509_VFY_H +#define OPENSSL_X509_VFY_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_X509_VFY_H +#endif + +/* + * Protect against recursion, x509.h and x509_vfy.h each include the other. + */ +#ifndef OPENSSL_X509_H +#include +#endif + +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +DEFINE_STACK_OF(OCSP_RESPONSE) + +/*- +SSL_CTX -> X509_STORE + -> X509_LOOKUP + ->X509_LOOKUP_METHOD + -> X509_LOOKUP + ->X509_LOOKUP_METHOD + +SSL -> X509_STORE_CTX + ->X509_STORE + +The X509_STORE holds the tables etc for verification stuff. +A X509_STORE_CTX is used while validating a single certificate. +The X509_STORE has X509_LOOKUPs for looking up certs. +The X509_STORE then calls a function to actually verify the +certificate chain. +*/ + +typedef enum { + X509_LU_NONE = 0, + X509_LU_X509, + X509_LU_CRL +} X509_LOOKUP_TYPE; + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define X509_LU_RETRY -1 +#define X509_LU_FAIL 0 +#endif + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(X509_LOOKUP, X509_LOOKUP, X509_LOOKUP) +#define sk_X509_LOOKUP_num(sk) OPENSSL_sk_num(ossl_check_const_X509_LOOKUP_sk_type(sk)) +#define sk_X509_LOOKUP_value(sk, idx) ((X509_LOOKUP *)OPENSSL_sk_value(ossl_check_const_X509_LOOKUP_sk_type(sk), (idx))) +#define sk_X509_LOOKUP_new(cmp) ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_new(ossl_check_X509_LOOKUP_compfunc_type(cmp))) +#define sk_X509_LOOKUP_new_null() ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_new_null()) +#define sk_X509_LOOKUP_new_reserve(cmp, n) ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_new_reserve(ossl_check_X509_LOOKUP_compfunc_type(cmp), (n))) +#define sk_X509_LOOKUP_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_LOOKUP_sk_type(sk), (n)) +#define sk_X509_LOOKUP_free(sk) OPENSSL_sk_free(ossl_check_X509_LOOKUP_sk_type(sk)) +#define sk_X509_LOOKUP_zero(sk) OPENSSL_sk_zero(ossl_check_X509_LOOKUP_sk_type(sk)) +#define sk_X509_LOOKUP_delete(sk, i) ((X509_LOOKUP *)OPENSSL_sk_delete(ossl_check_X509_LOOKUP_sk_type(sk), (i))) +#define sk_X509_LOOKUP_delete_ptr(sk, ptr) ((X509_LOOKUP *)OPENSSL_sk_delete_ptr(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr))) +#define sk_X509_LOOKUP_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr)) +#define sk_X509_LOOKUP_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr)) +#define sk_X509_LOOKUP_pop(sk) ((X509_LOOKUP *)OPENSSL_sk_pop(ossl_check_X509_LOOKUP_sk_type(sk))) +#define sk_X509_LOOKUP_shift(sk) ((X509_LOOKUP *)OPENSSL_sk_shift(ossl_check_X509_LOOKUP_sk_type(sk))) +#define sk_X509_LOOKUP_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_freefunc_type(freefunc)) +#define sk_X509_LOOKUP_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr), (idx)) +#define sk_X509_LOOKUP_set(sk, idx, ptr) ((X509_LOOKUP *)OPENSSL_sk_set(ossl_check_X509_LOOKUP_sk_type(sk), (idx), ossl_check_X509_LOOKUP_type(ptr))) +#define sk_X509_LOOKUP_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr)) +#define sk_X509_LOOKUP_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr)) +#define sk_X509_LOOKUP_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr), pnum) +#define sk_X509_LOOKUP_sort(sk) OPENSSL_sk_sort(ossl_check_X509_LOOKUP_sk_type(sk)) +#define sk_X509_LOOKUP_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_LOOKUP_sk_type(sk)) +#define sk_X509_LOOKUP_dup(sk) ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_dup(ossl_check_const_X509_LOOKUP_sk_type(sk))) +#define sk_X509_LOOKUP_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_copyfunc_type(copyfunc), ossl_check_X509_LOOKUP_freefunc_type(freefunc))) +#define sk_X509_LOOKUP_set_cmp_func(sk, cmp) ((sk_X509_LOOKUP_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_compfunc_type(cmp))) +SKM_DEFINE_STACK_OF_INTERNAL(X509_OBJECT, X509_OBJECT, X509_OBJECT) +#define sk_X509_OBJECT_num(sk) OPENSSL_sk_num(ossl_check_const_X509_OBJECT_sk_type(sk)) +#define sk_X509_OBJECT_value(sk, idx) ((X509_OBJECT *)OPENSSL_sk_value(ossl_check_const_X509_OBJECT_sk_type(sk), (idx))) +#define sk_X509_OBJECT_new(cmp) ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_new(ossl_check_X509_OBJECT_compfunc_type(cmp))) +#define sk_X509_OBJECT_new_null() ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_new_null()) +#define sk_X509_OBJECT_new_reserve(cmp, n) ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_new_reserve(ossl_check_X509_OBJECT_compfunc_type(cmp), (n))) +#define sk_X509_OBJECT_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_OBJECT_sk_type(sk), (n)) +#define sk_X509_OBJECT_free(sk) OPENSSL_sk_free(ossl_check_X509_OBJECT_sk_type(sk)) +#define sk_X509_OBJECT_zero(sk) OPENSSL_sk_zero(ossl_check_X509_OBJECT_sk_type(sk)) +#define sk_X509_OBJECT_delete(sk, i) ((X509_OBJECT *)OPENSSL_sk_delete(ossl_check_X509_OBJECT_sk_type(sk), (i))) +#define sk_X509_OBJECT_delete_ptr(sk, ptr) ((X509_OBJECT *)OPENSSL_sk_delete_ptr(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr))) +#define sk_X509_OBJECT_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr)) +#define sk_X509_OBJECT_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr)) +#define sk_X509_OBJECT_pop(sk) ((X509_OBJECT *)OPENSSL_sk_pop(ossl_check_X509_OBJECT_sk_type(sk))) +#define sk_X509_OBJECT_shift(sk) ((X509_OBJECT *)OPENSSL_sk_shift(ossl_check_X509_OBJECT_sk_type(sk))) +#define sk_X509_OBJECT_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_freefunc_type(freefunc)) +#define sk_X509_OBJECT_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr), (idx)) +#define sk_X509_OBJECT_set(sk, idx, ptr) ((X509_OBJECT *)OPENSSL_sk_set(ossl_check_X509_OBJECT_sk_type(sk), (idx), ossl_check_X509_OBJECT_type(ptr))) +#define sk_X509_OBJECT_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr)) +#define sk_X509_OBJECT_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr)) +#define sk_X509_OBJECT_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr), pnum) +#define sk_X509_OBJECT_sort(sk) OPENSSL_sk_sort(ossl_check_X509_OBJECT_sk_type(sk)) +#define sk_X509_OBJECT_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_OBJECT_sk_type(sk)) +#define sk_X509_OBJECT_dup(sk) ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_dup(ossl_check_const_X509_OBJECT_sk_type(sk))) +#define sk_X509_OBJECT_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_copyfunc_type(copyfunc), ossl_check_X509_OBJECT_freefunc_type(freefunc))) +#define sk_X509_OBJECT_set_cmp_func(sk, cmp) ((sk_X509_OBJECT_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_compfunc_type(cmp))) +SKM_DEFINE_STACK_OF_INTERNAL(X509_VERIFY_PARAM, X509_VERIFY_PARAM, X509_VERIFY_PARAM) +#define sk_X509_VERIFY_PARAM_num(sk) OPENSSL_sk_num(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk)) +#define sk_X509_VERIFY_PARAM_value(sk, idx) ((X509_VERIFY_PARAM *)OPENSSL_sk_value(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk), (idx))) +#define sk_X509_VERIFY_PARAM_new(cmp) ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_new(ossl_check_X509_VERIFY_PARAM_compfunc_type(cmp))) +#define sk_X509_VERIFY_PARAM_new_null() ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_new_null()) +#define sk_X509_VERIFY_PARAM_new_reserve(cmp, n) ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_new_reserve(ossl_check_X509_VERIFY_PARAM_compfunc_type(cmp), (n))) +#define sk_X509_VERIFY_PARAM_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_VERIFY_PARAM_sk_type(sk), (n)) +#define sk_X509_VERIFY_PARAM_free(sk) OPENSSL_sk_free(ossl_check_X509_VERIFY_PARAM_sk_type(sk)) +#define sk_X509_VERIFY_PARAM_zero(sk) OPENSSL_sk_zero(ossl_check_X509_VERIFY_PARAM_sk_type(sk)) +#define sk_X509_VERIFY_PARAM_delete(sk, i) ((X509_VERIFY_PARAM *)OPENSSL_sk_delete(ossl_check_X509_VERIFY_PARAM_sk_type(sk), (i))) +#define sk_X509_VERIFY_PARAM_delete_ptr(sk, ptr) ((X509_VERIFY_PARAM *)OPENSSL_sk_delete_ptr(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr))) +#define sk_X509_VERIFY_PARAM_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr)) +#define sk_X509_VERIFY_PARAM_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr)) +#define sk_X509_VERIFY_PARAM_pop(sk) ((X509_VERIFY_PARAM *)OPENSSL_sk_pop(ossl_check_X509_VERIFY_PARAM_sk_type(sk))) +#define sk_X509_VERIFY_PARAM_shift(sk) ((X509_VERIFY_PARAM *)OPENSSL_sk_shift(ossl_check_X509_VERIFY_PARAM_sk_type(sk))) +#define sk_X509_VERIFY_PARAM_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_freefunc_type(freefunc)) +#define sk_X509_VERIFY_PARAM_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr), (idx)) +#define sk_X509_VERIFY_PARAM_set(sk, idx, ptr) ((X509_VERIFY_PARAM *)OPENSSL_sk_set(ossl_check_X509_VERIFY_PARAM_sk_type(sk), (idx), ossl_check_X509_VERIFY_PARAM_type(ptr))) +#define sk_X509_VERIFY_PARAM_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr)) +#define sk_X509_VERIFY_PARAM_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr)) +#define sk_X509_VERIFY_PARAM_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr), pnum) +#define sk_X509_VERIFY_PARAM_sort(sk) OPENSSL_sk_sort(ossl_check_X509_VERIFY_PARAM_sk_type(sk)) +#define sk_X509_VERIFY_PARAM_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk)) +#define sk_X509_VERIFY_PARAM_dup(sk) ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_dup(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk))) +#define sk_X509_VERIFY_PARAM_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_copyfunc_type(copyfunc), ossl_check_X509_VERIFY_PARAM_freefunc_type(freefunc))) +#define sk_X509_VERIFY_PARAM_set_cmp_func(sk, cmp) ((sk_X509_VERIFY_PARAM_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_compfunc_type(cmp))) + +/* clang-format on */ + +/* This is used for a table of trust checking functions */ +typedef struct x509_trust_st { + int trust; + int flags; + int (*check_trust)(struct x509_trust_st *, X509 *, int); + char *name; + int arg1; + void *arg2; +} X509_TRUST; +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(X509_TRUST, X509_TRUST, X509_TRUST) +#define sk_X509_TRUST_num(sk) OPENSSL_sk_num(ossl_check_const_X509_TRUST_sk_type(sk)) +#define sk_X509_TRUST_value(sk, idx) ((X509_TRUST *)OPENSSL_sk_value(ossl_check_const_X509_TRUST_sk_type(sk), (idx))) +#define sk_X509_TRUST_new(cmp) ((STACK_OF(X509_TRUST) *)OPENSSL_sk_new(ossl_check_X509_TRUST_compfunc_type(cmp))) +#define sk_X509_TRUST_new_null() ((STACK_OF(X509_TRUST) *)OPENSSL_sk_new_null()) +#define sk_X509_TRUST_new_reserve(cmp, n) ((STACK_OF(X509_TRUST) *)OPENSSL_sk_new_reserve(ossl_check_X509_TRUST_compfunc_type(cmp), (n))) +#define sk_X509_TRUST_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_TRUST_sk_type(sk), (n)) +#define sk_X509_TRUST_free(sk) OPENSSL_sk_free(ossl_check_X509_TRUST_sk_type(sk)) +#define sk_X509_TRUST_zero(sk) OPENSSL_sk_zero(ossl_check_X509_TRUST_sk_type(sk)) +#define sk_X509_TRUST_delete(sk, i) ((X509_TRUST *)OPENSSL_sk_delete(ossl_check_X509_TRUST_sk_type(sk), (i))) +#define sk_X509_TRUST_delete_ptr(sk, ptr) ((X509_TRUST *)OPENSSL_sk_delete_ptr(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr))) +#define sk_X509_TRUST_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr)) +#define sk_X509_TRUST_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr)) +#define sk_X509_TRUST_pop(sk) ((X509_TRUST *)OPENSSL_sk_pop(ossl_check_X509_TRUST_sk_type(sk))) +#define sk_X509_TRUST_shift(sk) ((X509_TRUST *)OPENSSL_sk_shift(ossl_check_X509_TRUST_sk_type(sk))) +#define sk_X509_TRUST_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_freefunc_type(freefunc)) +#define sk_X509_TRUST_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr), (idx)) +#define sk_X509_TRUST_set(sk, idx, ptr) ((X509_TRUST *)OPENSSL_sk_set(ossl_check_X509_TRUST_sk_type(sk), (idx), ossl_check_X509_TRUST_type(ptr))) +#define sk_X509_TRUST_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr)) +#define sk_X509_TRUST_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr)) +#define sk_X509_TRUST_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr), pnum) +#define sk_X509_TRUST_sort(sk) OPENSSL_sk_sort(ossl_check_X509_TRUST_sk_type(sk)) +#define sk_X509_TRUST_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_TRUST_sk_type(sk)) +#define sk_X509_TRUST_dup(sk) ((STACK_OF(X509_TRUST) *)OPENSSL_sk_dup(ossl_check_const_X509_TRUST_sk_type(sk))) +#define sk_X509_TRUST_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_TRUST) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_copyfunc_type(copyfunc), ossl_check_X509_TRUST_freefunc_type(freefunc))) +#define sk_X509_TRUST_set_cmp_func(sk, cmp) ((sk_X509_TRUST_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_compfunc_type(cmp))) + +/* clang-format on */ + +/* standard trust ids */ +#define X509_TRUST_DEFAULT 0 /* Only valid in purpose settings */ +#define X509_TRUST_COMPAT 1 +#define X509_TRUST_SSL_CLIENT 2 +#define X509_TRUST_SSL_SERVER 3 +#define X509_TRUST_EMAIL 4 +#define X509_TRUST_OBJECT_SIGN 5 +#define X509_TRUST_OCSP_SIGN 6 +#define X509_TRUST_OCSP_REQUEST 7 +#define X509_TRUST_TSA 8 +/* Keep these up to date! */ +#define X509_TRUST_MIN 1 +#define X509_TRUST_MAX 8 + +/* trust_flags values */ +#define X509_TRUST_DYNAMIC (1U << 0) +#define X509_TRUST_DYNAMIC_NAME (1U << 1) +/* No compat trust if self-signed, preempts "DO_SS" */ +#define X509_TRUST_NO_SS_COMPAT (1U << 2) +/* Compat trust if no explicit accepted trust EKUs */ +#define X509_TRUST_DO_SS_COMPAT (1U << 3) +/* Accept "anyEKU" as a wildcard rejection OID and as a wildcard trust OID */ +#define X509_TRUST_OK_ANY_EKU (1U << 4) + +/* check_trust return codes */ +#define X509_TRUST_TRUSTED 1 +#define X509_TRUST_REJECTED 2 +#define X509_TRUST_UNTRUSTED 3 + +int X509_TRUST_set(int *t, int trust); +int X509_TRUST_get_count(void); +X509_TRUST *X509_TRUST_get0(int idx); +int X509_TRUST_get_by_id(int id); +int X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int), + const char *name, int arg1, void *arg2); +void X509_TRUST_cleanup(void); +int X509_TRUST_get_flags(const X509_TRUST *xp); +char *X509_TRUST_get0_name(const X509_TRUST *xp); +int X509_TRUST_get_trust(const X509_TRUST *xp); + +int X509_trusted(const X509 *x); +int X509_add1_trust_object(X509 *x, const ASN1_OBJECT *obj); +int X509_add1_reject_object(X509 *x, const ASN1_OBJECT *obj); +void X509_trust_clear(X509 *x); +void X509_reject_clear(X509 *x); +STACK_OF(ASN1_OBJECT) *X509_get0_trust_objects(X509 *x); +STACK_OF(ASN1_OBJECT) *X509_get0_reject_objects(X509 *x); + +int (*X509_TRUST_set_default(int (*trust)(int, X509 *, int)))(int, X509 *, + int); +int X509_check_trust(X509 *x, int id, int flags); + +int X509_verify_cert(X509_STORE_CTX *ctx); +int X509_STORE_CTX_verify(X509_STORE_CTX *ctx); +STACK_OF(X509) *X509_build_chain(X509 *target, STACK_OF(X509) *certs, + X509_STORE *store, int with_self_signed, + OSSL_LIB_CTX *libctx, const char *propq); + +int X509_STORE_set_depth(X509_STORE *store, int depth); + +typedef int (*X509_STORE_CTX_verify_cb)(int, X509_STORE_CTX *); +int X509_STORE_CTX_print_verify_cb(int ok, X509_STORE_CTX *ctx); +typedef int (*X509_STORE_CTX_verify_fn)(X509_STORE_CTX *); +typedef int (*X509_STORE_CTX_get_issuer_fn)(X509 **issuer, + X509_STORE_CTX *ctx, X509 *x); +typedef int (*X509_STORE_CTX_check_issued_fn)(X509_STORE_CTX *ctx, + X509 *x, X509 *issuer); +typedef int (*X509_STORE_CTX_check_revocation_fn)(X509_STORE_CTX *ctx); +typedef int (*X509_STORE_CTX_get_crl_fn)(X509_STORE_CTX *ctx, + X509_CRL **crl, X509 *x); +typedef int (*X509_STORE_CTX_check_crl_fn)(X509_STORE_CTX *ctx, X509_CRL *crl); +typedef int (*X509_STORE_CTX_cert_crl_fn)(X509_STORE_CTX *ctx, + X509_CRL *crl, X509 *x); +typedef int (*X509_STORE_CTX_check_policy_fn)(X509_STORE_CTX *ctx); +typedef STACK_OF(X509) + *(*X509_STORE_CTX_lookup_certs_fn)(X509_STORE_CTX *ctx, + const X509_NAME *nm); +typedef STACK_OF(X509_CRL) + *(*X509_STORE_CTX_lookup_crls_fn)(const X509_STORE_CTX *ctx, + const X509_NAME *nm); +typedef int (*X509_STORE_CTX_cleanup_fn)(X509_STORE_CTX *ctx); + +void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth); + +#define X509_STORE_CTX_set_app_data(ctx, data) \ + X509_STORE_CTX_set_ex_data(ctx, 0, data) +#define X509_STORE_CTX_get_app_data(ctx) \ + X509_STORE_CTX_get_ex_data(ctx, 0) + +#define X509_L_FILE_LOAD 1 +#define X509_L_ADD_DIR 2 +#define X509_L_ADD_STORE 3 +#define X509_L_LOAD_STORE 4 + +#define X509_LOOKUP_load_file(x, name, type) \ + X509_LOOKUP_ctrl((x), X509_L_FILE_LOAD, (name), (long)(type), NULL) + +#define X509_LOOKUP_add_dir(x, name, type) \ + X509_LOOKUP_ctrl((x), X509_L_ADD_DIR, (name), (long)(type), NULL) + +#define X509_LOOKUP_add_store(x, name) \ + X509_LOOKUP_ctrl((x), X509_L_ADD_STORE, (name), 0, NULL) + +#define X509_LOOKUP_load_store(x, name) \ + X509_LOOKUP_ctrl((x), X509_L_LOAD_STORE, (name), 0, NULL) + +#define X509_LOOKUP_load_file_ex(x, name, type, libctx, propq) \ + X509_LOOKUP_ctrl_ex((x), X509_L_FILE_LOAD, (name), (long)(type), NULL, \ + (libctx), (propq)) + +#define X509_LOOKUP_load_store_ex(x, name, libctx, propq) \ + X509_LOOKUP_ctrl_ex((x), X509_L_LOAD_STORE, (name), 0, NULL, \ + (libctx), (propq)) + +#define X509_LOOKUP_add_store_ex(x, name, libctx, propq) \ + X509_LOOKUP_ctrl_ex((x), X509_L_ADD_STORE, (name), 0, NULL, \ + (libctx), (propq)) + +#define X509_V_OK 0 +#define X509_V_ERR_UNSPECIFIED 1 +#define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT 2 +#define X509_V_ERR_UNABLE_TO_GET_CRL 3 +#define X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE 4 +#define X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE 5 +#define X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY 6 +#define X509_V_ERR_CERT_SIGNATURE_FAILURE 7 +#define X509_V_ERR_CRL_SIGNATURE_FAILURE 8 +#define X509_V_ERR_CERT_NOT_YET_VALID 9 +#define X509_V_ERR_CERT_HAS_EXPIRED 10 +#define X509_V_ERR_CRL_NOT_YET_VALID 11 +#define X509_V_ERR_CRL_HAS_EXPIRED 12 +#define X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD 13 +#define X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD 14 +#define X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD 15 +#define X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD 16 +#define X509_V_ERR_OUT_OF_MEM 17 +#define X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT 18 +#define X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN 19 +#define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY 20 +#define X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE 21 +#define X509_V_ERR_CERT_CHAIN_TOO_LONG 22 +#define X509_V_ERR_CERT_REVOKED 23 +#define X509_V_ERR_NO_ISSUER_PUBLIC_KEY 24 +#define X509_V_ERR_PATH_LENGTH_EXCEEDED 25 +#define X509_V_ERR_INVALID_PURPOSE 26 +#define X509_V_ERR_CERT_UNTRUSTED 27 +#define X509_V_ERR_CERT_REJECTED 28 + +/* These are 'informational' when looking for issuer cert */ +#define X509_V_ERR_SUBJECT_ISSUER_MISMATCH 29 +#define X509_V_ERR_AKID_SKID_MISMATCH 30 +#define X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH 31 +#define X509_V_ERR_KEYUSAGE_NO_CERTSIGN 32 +#define X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER 33 +#define X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION 34 +#define X509_V_ERR_KEYUSAGE_NO_CRL_SIGN 35 +#define X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION 36 +#define X509_V_ERR_INVALID_NON_CA 37 +#define X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED 38 +#define X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE 39 +#define X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED 40 +#define X509_V_ERR_INVALID_EXTENSION 41 +#define X509_V_ERR_INVALID_POLICY_EXTENSION 42 +#define X509_V_ERR_NO_EXPLICIT_POLICY 43 +#define X509_V_ERR_DIFFERENT_CRL_SCOPE 44 +#define X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE 45 +#define X509_V_ERR_UNNESTED_RESOURCE 46 +#define X509_V_ERR_PERMITTED_VIOLATION 47 +#define X509_V_ERR_EXCLUDED_VIOLATION 48 +#define X509_V_ERR_SUBTREE_MINMAX 49 +/* The application is not happy */ +#define X509_V_ERR_APPLICATION_VERIFICATION 50 +#define X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE 51 +#define X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX 52 +#define X509_V_ERR_UNSUPPORTED_NAME_SYNTAX 53 +#define X509_V_ERR_CRL_PATH_VALIDATION_ERROR 54 +/* Another issuer check debug option */ +#define X509_V_ERR_PATH_LOOP 55 +/* Suite B mode algorithm violation */ +#define X509_V_ERR_SUITE_B_INVALID_VERSION 56 +#define X509_V_ERR_SUITE_B_INVALID_ALGORITHM 57 +#define X509_V_ERR_SUITE_B_INVALID_CURVE 58 +#define X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM 59 +#define X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED 60 +#define X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256 61 +/* Host, email and IP check errors */ +#define X509_V_ERR_HOSTNAME_MISMATCH 62 +#define X509_V_ERR_EMAIL_MISMATCH 63 +#define X509_V_ERR_IP_ADDRESS_MISMATCH 64 +/* DANE TLSA errors */ +#define X509_V_ERR_DANE_NO_MATCH 65 +/* security level errors */ +#define X509_V_ERR_EE_KEY_TOO_SMALL 66 +#define X509_V_ERR_CA_KEY_TOO_SMALL 67 +#define X509_V_ERR_CA_MD_TOO_WEAK 68 +/* Caller error */ +#define X509_V_ERR_INVALID_CALL 69 +/* Issuer lookup error */ +#define X509_V_ERR_STORE_LOOKUP 70 +/* Certificate transparency */ +#define X509_V_ERR_NO_VALID_SCTS 71 + +#define X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION 72 +/* OCSP status errors */ +#define X509_V_ERR_OCSP_VERIFY_NEEDED 73 /* Need OCSP verification */ +#define X509_V_ERR_OCSP_VERIFY_FAILED 74 /* Couldn't verify cert through OCSP */ +#define X509_V_ERR_OCSP_CERT_UNKNOWN 75 /* Certificate wasn't recognized by the OCSP responder */ + +#define X509_V_ERR_UNSUPPORTED_SIGNATURE_ALGORITHM 76 +#define X509_V_ERR_SIGNATURE_ALGORITHM_MISMATCH 77 + +/* Errors in case a check in X509_V_FLAG_X509_STRICT mode fails */ +#define X509_V_ERR_SIGNATURE_ALGORITHM_INCONSISTENCY 78 +#define X509_V_ERR_INVALID_CA 79 +#define X509_V_ERR_PATHLEN_INVALID_FOR_NON_CA 80 +#define X509_V_ERR_PATHLEN_WITHOUT_KU_KEY_CERT_SIGN 81 +#define X509_V_ERR_KU_KEY_CERT_SIGN_INVALID_FOR_NON_CA 82 +#define X509_V_ERR_ISSUER_NAME_EMPTY 83 +#define X509_V_ERR_SUBJECT_NAME_EMPTY 84 +#define X509_V_ERR_MISSING_AUTHORITY_KEY_IDENTIFIER 85 +#define X509_V_ERR_MISSING_SUBJECT_KEY_IDENTIFIER 86 +#define X509_V_ERR_EMPTY_SUBJECT_ALT_NAME 87 +#define X509_V_ERR_EMPTY_SUBJECT_SAN_NOT_CRITICAL 88 +#define X509_V_ERR_CA_BCONS_NOT_CRITICAL 89 +#define X509_V_ERR_AUTHORITY_KEY_IDENTIFIER_CRITICAL 90 +#define X509_V_ERR_SUBJECT_KEY_IDENTIFIER_CRITICAL 91 +#define X509_V_ERR_CA_CERT_MISSING_KEY_USAGE 92 +#define X509_V_ERR_EXTENSIONS_REQUIRE_VERSION_3 93 +#define X509_V_ERR_EC_KEY_EXPLICIT_PARAMS 94 +#define X509_V_ERR_RPK_UNTRUSTED 95 + +/* additional OCSP status errors */ +#define X509_V_ERR_OCSP_RESP_INVALID 96 +#define X509_V_ERR_OCSP_SIGNATURE_FAILURE 97 +#define X509_V_ERR_OCSP_NOT_YET_VALID 98 +#define X509_V_ERR_OCSP_HAS_EXPIRED 99 +#define X509_V_ERR_OCSP_NO_RESPONSE 100 +#define X509_V_ERR_CRL_VERIFY_FAILED 101 + +/* Certificate verify flags */ +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define X509_V_FLAG_CB_ISSUER_CHECK 0x0 /* Deprecated */ +#endif +/* Use check time instead of current time */ +#define X509_V_FLAG_USE_CHECK_TIME 0x2 +/* Lookup CRLs */ +#define X509_V_FLAG_CRL_CHECK 0x4 +/* Lookup CRLs for whole chain */ +#define X509_V_FLAG_CRL_CHECK_ALL 0x8 +/* Ignore unhandled critical extensions */ +#define X509_V_FLAG_IGNORE_CRITICAL 0x10 +/* Disable workarounds for broken certificates */ +#define X509_V_FLAG_X509_STRICT 0x20 +/* Enable proxy certificate validation */ +#define X509_V_FLAG_ALLOW_PROXY_CERTS 0x40 +/* Enable policy checking */ +#define X509_V_FLAG_POLICY_CHECK 0x80 +/* Policy variable require-explicit-policy */ +#define X509_V_FLAG_EXPLICIT_POLICY 0x100 +/* Policy variable inhibit-any-policy */ +#define X509_V_FLAG_INHIBIT_ANY 0x200 +/* Policy variable inhibit-policy-mapping */ +#define X509_V_FLAG_INHIBIT_MAP 0x400 +/* Notify callback that policy is OK */ +#define X509_V_FLAG_NOTIFY_POLICY 0x800 +/* Extended CRL features such as indirect CRLs, alternate CRL signing keys */ +#define X509_V_FLAG_EXTENDED_CRL_SUPPORT 0x1000 +/* Delta CRL support */ +#define X509_V_FLAG_USE_DELTAS 0x2000 +/* Check self-signed CA signature */ +#define X509_V_FLAG_CHECK_SS_SIGNATURE 0x4000 +/* Use trusted store first */ +#define X509_V_FLAG_TRUSTED_FIRST 0x8000 +/* Suite B 128 bit only mode: not normally used */ +#define X509_V_FLAG_SUITEB_128_LOS_ONLY 0x10000 +/* Suite B 192 bit only mode */ +#define X509_V_FLAG_SUITEB_192_LOS 0x20000 +/* Suite B 128 bit mode allowing 192 bit algorithms */ +#define X509_V_FLAG_SUITEB_128_LOS 0x30000 +/* Allow partial chains if at least one certificate is in trusted store */ +#define X509_V_FLAG_PARTIAL_CHAIN 0x80000 +/* + * If the initial chain is not trusted, do not attempt to build an alternative + * chain. Alternate chain checking was introduced in 1.1.0. Setting this flag + * will force the behaviour to match that of previous versions. + */ +#define X509_V_FLAG_NO_ALT_CHAINS 0x100000 +/* Do not check certificate/CRL validity against current time */ +#define X509_V_FLAG_NO_CHECK_TIME 0x200000 + +/* Verify OCSP stapling response for server certificate */ +#define X509_V_FLAG_OCSP_RESP_CHECK 0x400000 +/* Verify OCSP stapling responses for whole chain */ +#define X509_V_FLAG_OCSP_RESP_CHECK_ALL 0x800000 + +#define X509_VP_FLAG_DEFAULT 0x1 +#define X509_VP_FLAG_OVERWRITE 0x2 +#define X509_VP_FLAG_RESET_FLAGS 0x4 +#define X509_VP_FLAG_LOCKED 0x8 +#define X509_VP_FLAG_ONCE 0x10 + +/* Internal use: mask of policy related options */ +#define X509_V_FLAG_POLICY_MASK (X509_V_FLAG_POLICY_CHECK \ + | X509_V_FLAG_EXPLICIT_POLICY \ + | X509_V_FLAG_INHIBIT_ANY \ + | X509_V_FLAG_INHIBIT_MAP) + +int X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, X509_LOOKUP_TYPE type, + const X509_NAME *name); +X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h, + X509_LOOKUP_TYPE type, + const X509_NAME *name); +X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, + X509_OBJECT *x); +int X509_OBJECT_up_ref_count(X509_OBJECT *a); +X509_OBJECT *X509_OBJECT_new(void); +void X509_OBJECT_free(X509_OBJECT *a); +X509_LOOKUP_TYPE X509_OBJECT_get_type(const X509_OBJECT *a); +X509 *X509_OBJECT_get0_X509(const X509_OBJECT *a); +int X509_OBJECT_set1_X509(X509_OBJECT *a, X509 *obj); +X509_CRL *X509_OBJECT_get0_X509_CRL(const X509_OBJECT *a); +int X509_OBJECT_set1_X509_CRL(X509_OBJECT *a, X509_CRL *obj); +X509_STORE *X509_STORE_new(void); +void X509_STORE_free(X509_STORE *xs); +int X509_STORE_lock(X509_STORE *xs); +int X509_STORE_unlock(X509_STORE *xs); +int X509_STORE_up_ref(X509_STORE *xs); +STACK_OF(X509_OBJECT) *X509_STORE_get0_objects(const X509_STORE *xs); +STACK_OF(X509_OBJECT) *X509_STORE_get1_objects(X509_STORE *xs); +STACK_OF(X509) *X509_STORE_get1_all_certs(X509_STORE *xs); +STACK_OF(X509) *X509_STORE_CTX_get1_certs(X509_STORE_CTX *xs, + const X509_NAME *nm); +STACK_OF(X509_CRL) *X509_STORE_CTX_get1_crls(const X509_STORE_CTX *st, + const X509_NAME *nm); +int X509_STORE_set_flags(X509_STORE *xs, unsigned long flags); +int X509_STORE_set_purpose(X509_STORE *xs, int purpose); +int X509_STORE_set_trust(X509_STORE *xs, int trust); +int X509_STORE_set1_param(X509_STORE *xs, const X509_VERIFY_PARAM *pm); +X509_VERIFY_PARAM *X509_STORE_get0_param(const X509_STORE *xs); + +void X509_STORE_set_verify(X509_STORE *xs, X509_STORE_CTX_verify_fn verify); +#define X509_STORE_set_verify_func(ctx, func) \ + X509_STORE_set_verify((ctx), (func)) +void X509_STORE_CTX_set_verify(X509_STORE_CTX *ctx, + X509_STORE_CTX_verify_fn verify); +X509_STORE_CTX_verify_fn X509_STORE_get_verify(const X509_STORE *xs); +void X509_STORE_set_verify_cb(X509_STORE *xs, + X509_STORE_CTX_verify_cb verify_cb); +#define X509_STORE_set_verify_cb_func(ctx, func) \ + X509_STORE_set_verify_cb((ctx), (func)) +X509_STORE_CTX_verify_cb X509_STORE_get_verify_cb(const X509_STORE *xs); +void X509_STORE_set_get_issuer(X509_STORE *xs, + X509_STORE_CTX_get_issuer_fn get_issuer); +X509_STORE_CTX_get_issuer_fn X509_STORE_get_get_issuer(const X509_STORE *xs); +void X509_STORE_set_check_issued(X509_STORE *xs, + X509_STORE_CTX_check_issued_fn check_issued); +X509_STORE_CTX_check_issued_fn X509_STORE_get_check_issued(const X509_STORE *s); +void X509_STORE_set_check_revocation(X509_STORE *xs, + X509_STORE_CTX_check_revocation_fn check_revocation); +X509_STORE_CTX_check_revocation_fn +X509_STORE_get_check_revocation(const X509_STORE *xs); +void X509_STORE_set_get_crl(X509_STORE *xs, + X509_STORE_CTX_get_crl_fn get_crl); +X509_STORE_CTX_get_crl_fn X509_STORE_get_get_crl(const X509_STORE *xs); +void X509_STORE_set_check_crl(X509_STORE *xs, + X509_STORE_CTX_check_crl_fn check_crl); +X509_STORE_CTX_check_crl_fn X509_STORE_get_check_crl(const X509_STORE *xs); +void X509_STORE_set_cert_crl(X509_STORE *xs, + X509_STORE_CTX_cert_crl_fn cert_crl); +X509_STORE_CTX_cert_crl_fn X509_STORE_get_cert_crl(const X509_STORE *xs); +void X509_STORE_set_check_policy(X509_STORE *xs, + X509_STORE_CTX_check_policy_fn check_policy); +X509_STORE_CTX_check_policy_fn X509_STORE_get_check_policy(const X509_STORE *s); +void X509_STORE_set_lookup_certs(X509_STORE *xs, + X509_STORE_CTX_lookup_certs_fn lookup_certs); +X509_STORE_CTX_lookup_certs_fn X509_STORE_get_lookup_certs(const X509_STORE *s); +void X509_STORE_set_lookup_crls(X509_STORE *xs, + X509_STORE_CTX_lookup_crls_fn lookup_crls); +#define X509_STORE_set_lookup_crls_cb(ctx, func) \ + X509_STORE_set_lookup_crls((ctx), (func)) +X509_STORE_CTX_lookup_crls_fn X509_STORE_get_lookup_crls(const X509_STORE *xs); +void X509_STORE_set_cleanup(X509_STORE *xs, + X509_STORE_CTX_cleanup_fn cleanup); +X509_STORE_CTX_cleanup_fn X509_STORE_get_cleanup(const X509_STORE *xs); + +#define X509_STORE_get_ex_new_index(l, p, newf, dupf, freef) \ + CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE, l, p, newf, dupf, freef) +int X509_STORE_set_ex_data(X509_STORE *xs, int idx, void *data); +void *X509_STORE_get_ex_data(const X509_STORE *xs, int idx); + +X509_STORE_CTX *X509_STORE_CTX_new_ex(OSSL_LIB_CTX *libctx, const char *propq); +X509_STORE_CTX *X509_STORE_CTX_new(void); + +int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); + +void X509_STORE_CTX_free(X509_STORE_CTX *ctx); +int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *trust_store, + X509 *target, STACK_OF(X509) *untrusted); +int X509_STORE_CTX_init_rpk(X509_STORE_CTX *ctx, X509_STORE *trust_store, + EVP_PKEY *rpk); +void X509_STORE_CTX_set0_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); +void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx); + +X509_STORE *X509_STORE_CTX_get0_store(const X509_STORE_CTX *ctx); +X509 *X509_STORE_CTX_get0_cert(const X509_STORE_CTX *ctx); +EVP_PKEY *X509_STORE_CTX_get0_rpk(const X509_STORE_CTX *ctx); +STACK_OF(X509) *X509_STORE_CTX_get0_untrusted(const X509_STORE_CTX *ctx); +void X509_STORE_CTX_set0_untrusted(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); +void X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx, + X509_STORE_CTX_verify_cb verify); +X509_STORE_CTX_verify_cb X509_STORE_CTX_get_verify_cb(const X509_STORE_CTX *ctx); +X509_STORE_CTX_verify_fn X509_STORE_CTX_get_verify(const X509_STORE_CTX *ctx); +X509_STORE_CTX_get_issuer_fn X509_STORE_CTX_get_get_issuer(const X509_STORE_CTX *ctx); +X509_STORE_CTX_check_issued_fn X509_STORE_CTX_get_check_issued(const X509_STORE_CTX *ctx); +X509_STORE_CTX_check_revocation_fn X509_STORE_CTX_get_check_revocation(const X509_STORE_CTX *ctx); +void X509_STORE_CTX_set_get_crl(X509_STORE_CTX *ctx, + X509_STORE_CTX_get_crl_fn get_crl); +X509_STORE_CTX_get_crl_fn X509_STORE_CTX_get_get_crl(const X509_STORE_CTX *ctx); +X509_STORE_CTX_check_crl_fn X509_STORE_CTX_get_check_crl(const X509_STORE_CTX *ctx); +X509_STORE_CTX_cert_crl_fn X509_STORE_CTX_get_cert_crl(const X509_STORE_CTX *ctx); +X509_STORE_CTX_check_policy_fn X509_STORE_CTX_get_check_policy(const X509_STORE_CTX *ctx); +X509_STORE_CTX_lookup_certs_fn X509_STORE_CTX_get_lookup_certs(const X509_STORE_CTX *ctx); +X509_STORE_CTX_lookup_crls_fn X509_STORE_CTX_get_lookup_crls(const X509_STORE_CTX *ctx); +X509_STORE_CTX_cleanup_fn X509_STORE_CTX_get_cleanup(const X509_STORE_CTX *ctx); + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +#define X509_STORE_CTX_get_chain X509_STORE_CTX_get0_chain +#define X509_STORE_CTX_set_chain X509_STORE_CTX_set0_untrusted +#define X509_STORE_CTX_trusted_stack X509_STORE_CTX_set0_trusted_stack +#define X509_STORE_get_by_subject X509_STORE_CTX_get_by_subject +#define X509_STORE_get1_certs X509_STORE_CTX_get1_certs +#define X509_STORE_get1_crls X509_STORE_CTX_get1_crls +/* the following macro is misspelled; use X509_STORE_get1_certs instead */ +#define X509_STORE_get1_cert X509_STORE_CTX_get1_certs +/* the following macro is misspelled; use X509_STORE_get1_crls instead */ +#define X509_STORE_get1_crl X509_STORE_CTX_get1_crls +#endif + +X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *xs, X509_LOOKUP_METHOD *m); +X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void); +X509_LOOKUP_METHOD *X509_LOOKUP_file(void); +X509_LOOKUP_METHOD *X509_LOOKUP_store(void); + +typedef int (*X509_LOOKUP_ctrl_fn)(X509_LOOKUP *ctx, int cmd, const char *argc, + long argl, char **ret); +typedef int (*X509_LOOKUP_ctrl_ex_fn)( + X509_LOOKUP *ctx, int cmd, const char *argc, long argl, char **ret, + OSSL_LIB_CTX *libctx, const char *propq); + +typedef int (*X509_LOOKUP_get_by_subject_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + const X509_NAME *name, + X509_OBJECT *ret); +typedef int (*X509_LOOKUP_get_by_subject_ex_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + const X509_NAME *name, + X509_OBJECT *ret, + OSSL_LIB_CTX *libctx, + const char *propq); +typedef int (*X509_LOOKUP_get_by_issuer_serial_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + const X509_NAME *name, + const ASN1_INTEGER *serial, + X509_OBJECT *ret); +typedef int (*X509_LOOKUP_get_by_fingerprint_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + const unsigned char *bytes, + int len, + X509_OBJECT *ret); +typedef int (*X509_LOOKUP_get_by_alias_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + const char *str, + int len, + X509_OBJECT *ret); + +X509_LOOKUP_METHOD *X509_LOOKUP_meth_new(const char *name); +void X509_LOOKUP_meth_free(X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_new_item(X509_LOOKUP_METHOD *method, + int (*new_item)(X509_LOOKUP *ctx)); +int (*X509_LOOKUP_meth_get_new_item(const X509_LOOKUP_METHOD *method))(X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_free(X509_LOOKUP_METHOD *method, + void (*free_fn)(X509_LOOKUP *ctx)); +void (*X509_LOOKUP_meth_get_free(const X509_LOOKUP_METHOD *method))(X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_init(X509_LOOKUP_METHOD *method, + int (*init)(X509_LOOKUP *ctx)); +int (*X509_LOOKUP_meth_get_init(const X509_LOOKUP_METHOD *method))(X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_shutdown(X509_LOOKUP_METHOD *method, + int (*shutdown)(X509_LOOKUP *ctx)); +int (*X509_LOOKUP_meth_get_shutdown(const X509_LOOKUP_METHOD *method))(X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_ctrl(X509_LOOKUP_METHOD *method, + X509_LOOKUP_ctrl_fn ctrl_fn); +X509_LOOKUP_ctrl_fn X509_LOOKUP_meth_get_ctrl(const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_subject(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_subject_fn fn); +X509_LOOKUP_get_by_subject_fn X509_LOOKUP_meth_get_get_by_subject( + const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_issuer_serial(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_issuer_serial_fn fn); +X509_LOOKUP_get_by_issuer_serial_fn X509_LOOKUP_meth_get_get_by_issuer_serial( + const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_fingerprint(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_fingerprint_fn fn); +X509_LOOKUP_get_by_fingerprint_fn X509_LOOKUP_meth_get_get_by_fingerprint( + const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_alias(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_alias_fn fn); +X509_LOOKUP_get_by_alias_fn X509_LOOKUP_meth_get_get_by_alias( + const X509_LOOKUP_METHOD *method); + +int X509_STORE_add_cert(X509_STORE *xs, X509 *x); +int X509_STORE_add_crl(X509_STORE *xs, X509_CRL *x); + +int X509_STORE_CTX_get_by_subject(const X509_STORE_CTX *vs, + X509_LOOKUP_TYPE type, + const X509_NAME *name, X509_OBJECT *ret); +X509_OBJECT *X509_STORE_CTX_get_obj_by_subject(X509_STORE_CTX *vs, + X509_LOOKUP_TYPE type, + const X509_NAME *name); + +int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, + long argl, char **ret); +int X509_LOOKUP_ctrl_ex(X509_LOOKUP *ctx, int cmd, const char *argc, long argl, + char **ret, OSSL_LIB_CTX *libctx, const char *propq); + +int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type); +int X509_load_cert_file_ex(X509_LOOKUP *ctx, const char *file, int type, + OSSL_LIB_CTX *libctx, const char *propq); +int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type); +int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type); +int X509_load_cert_crl_file_ex(X509_LOOKUP *ctx, const char *file, int type, + OSSL_LIB_CTX *libctx, const char *propq); + +X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method); +void X509_LOOKUP_free(X509_LOOKUP *ctx); +int X509_LOOKUP_init(X509_LOOKUP *ctx); +int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, + const X509_NAME *name, X509_OBJECT *ret); +int X509_LOOKUP_by_subject_ex(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, + const X509_NAME *name, X509_OBJECT *ret, + OSSL_LIB_CTX *libctx, const char *propq); +int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, + const X509_NAME *name, + const ASN1_INTEGER *serial, + X509_OBJECT *ret); +int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, + const unsigned char *bytes, int len, + X509_OBJECT *ret); +int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, + const char *str, int len, X509_OBJECT *ret); +int X509_LOOKUP_set_method_data(X509_LOOKUP *ctx, void *data); +void *X509_LOOKUP_get_method_data(const X509_LOOKUP *ctx); +X509_STORE *X509_LOOKUP_get_store(const X509_LOOKUP *ctx); +int X509_LOOKUP_shutdown(X509_LOOKUP *ctx); + +int X509_STORE_load_file(X509_STORE *xs, const char *file); +int X509_STORE_load_path(X509_STORE *xs, const char *path); +int X509_STORE_load_store(X509_STORE *xs, const char *store); +int X509_STORE_load_locations(X509_STORE *s, const char *file, const char *dir); +int X509_STORE_set_default_paths(X509_STORE *xs); + +int X509_STORE_load_file_ex(X509_STORE *xs, const char *file, + OSSL_LIB_CTX *libctx, const char *propq); +int X509_STORE_load_store_ex(X509_STORE *xs, const char *store, + OSSL_LIB_CTX *libctx, const char *propq); +int X509_STORE_load_locations_ex(X509_STORE *xs, + const char *file, const char *dir, + OSSL_LIB_CTX *libctx, const char *propq); +int X509_STORE_set_default_paths_ex(X509_STORE *xs, + OSSL_LIB_CTX *libctx, const char *propq); + +#define X509_STORE_CTX_get_ex_new_index(l, p, newf, dupf, freef) \ + CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE_CTX, l, p, newf, dupf, freef) +int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *ctx, int idx, void *data); +void *X509_STORE_CTX_get_ex_data(const X509_STORE_CTX *ctx, int idx); +int X509_STORE_CTX_get_error(const X509_STORE_CTX *ctx); +void X509_STORE_CTX_set_error(X509_STORE_CTX *ctx, int s); +int X509_STORE_CTX_get_error_depth(const X509_STORE_CTX *ctx); +void X509_STORE_CTX_set_error_depth(X509_STORE_CTX *ctx, int depth); +X509 *X509_STORE_CTX_get_current_cert(const X509_STORE_CTX *ctx); +void X509_STORE_CTX_set_current_cert(X509_STORE_CTX *ctx, X509 *x); +X509 *X509_STORE_CTX_get0_current_issuer(const X509_STORE_CTX *ctx); +X509_CRL *X509_STORE_CTX_get0_current_crl(const X509_STORE_CTX *ctx); +X509_STORE_CTX *X509_STORE_CTX_get0_parent_ctx(const X509_STORE_CTX *ctx); +STACK_OF(X509) *X509_STORE_CTX_get0_chain(const X509_STORE_CTX *ctx); +STACK_OF(X509) *X509_STORE_CTX_get1_chain(const X509_STORE_CTX *ctx); +void X509_STORE_CTX_set_cert(X509_STORE_CTX *ctx, X509 *target); +void X509_STORE_CTX_set0_rpk(X509_STORE_CTX *ctx, EVP_PKEY *target); +void X509_STORE_CTX_set0_verified_chain(X509_STORE_CTX *c, STACK_OF(X509) *sk); +void X509_STORE_CTX_set0_crls(X509_STORE_CTX *ctx, STACK_OF(X509_CRL) *sk); +#ifndef OPENSSL_NO_OCSP +void X509_STORE_CTX_set_ocsp_resp(X509_STORE_CTX *ctx, STACK_OF(OCSP_RESPONSE) *sk); +#endif +int X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose); +int X509_STORE_CTX_set_trust(X509_STORE_CTX *ctx, int trust); +int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose, + int purpose, int trust); +void X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, unsigned long flags); +void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, unsigned long flags, + time_t t); +void X509_STORE_CTX_set_current_reasons(X509_STORE_CTX *ctx, + unsigned int current_reasons); + +X509_POLICY_TREE *X509_STORE_CTX_get0_policy_tree(const X509_STORE_CTX *ctx); +int X509_STORE_CTX_get_explicit_policy(const X509_STORE_CTX *ctx); +int X509_STORE_CTX_get_num_untrusted(const X509_STORE_CTX *ctx); + +X509_VERIFY_PARAM *X509_STORE_CTX_get0_param(const X509_STORE_CTX *ctx); +void X509_STORE_CTX_set0_param(X509_STORE_CTX *ctx, X509_VERIFY_PARAM *param); +int X509_STORE_CTX_set_default(X509_STORE_CTX *ctx, const char *name); + +/* + * Bridge opacity barrier between libcrypt and libssl, also needed to support + * offline testing in test/danetest.c + */ +void X509_STORE_CTX_set0_dane(X509_STORE_CTX *ctx, SSL_DANE *dane); +#define DANE_FLAG_NO_DANE_EE_NAMECHECKS (1L << 0) + +/* X509_VERIFY_PARAM functions */ + +X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void); +void X509_VERIFY_PARAM_free(X509_VERIFY_PARAM *param); +int X509_VERIFY_PARAM_inherit(X509_VERIFY_PARAM *to, + const X509_VERIFY_PARAM *from); +int X509_VERIFY_PARAM_set1(X509_VERIFY_PARAM *to, + const X509_VERIFY_PARAM *from); +int X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name); +int X509_VERIFY_PARAM_set_flags(X509_VERIFY_PARAM *param, + unsigned long flags); +int X509_VERIFY_PARAM_clear_flags(X509_VERIFY_PARAM *param, + unsigned long flags); +unsigned long X509_VERIFY_PARAM_get_flags(const X509_VERIFY_PARAM *param); +int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose); +int X509_VERIFY_PARAM_get_purpose(const X509_VERIFY_PARAM *param); +int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust); +void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth); +void X509_VERIFY_PARAM_set_auth_level(X509_VERIFY_PARAM *param, int auth_level); +time_t X509_VERIFY_PARAM_get_time(const X509_VERIFY_PARAM *param); +void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t); +int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param, + ASN1_OBJECT *policy); +int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param, + STACK_OF(ASN1_OBJECT) *policies); + +int X509_VERIFY_PARAM_set_inh_flags(X509_VERIFY_PARAM *param, + uint32_t flags); +uint32_t X509_VERIFY_PARAM_get_inh_flags(const X509_VERIFY_PARAM *param); + +char *X509_VERIFY_PARAM_get0_host(X509_VERIFY_PARAM *param, int idx); +int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param, + const char *name, size_t namelen); +int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param, + const char *name, size_t namelen); +void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param, + unsigned int flags); +unsigned int X509_VERIFY_PARAM_get_hostflags(const X509_VERIFY_PARAM *param); +char *X509_VERIFY_PARAM_get0_peername(const X509_VERIFY_PARAM *param); +void X509_VERIFY_PARAM_move_peername(X509_VERIFY_PARAM *, X509_VERIFY_PARAM *); +char *X509_VERIFY_PARAM_get0_email(X509_VERIFY_PARAM *param); +int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param, + const char *email, size_t emaillen); +char *X509_VERIFY_PARAM_get1_ip_asc(X509_VERIFY_PARAM *param); +int X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param, + const unsigned char *ip, size_t iplen); +int X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param, + const char *ipasc); + +int X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param); +int X509_VERIFY_PARAM_get_auth_level(const X509_VERIFY_PARAM *param); +const char *X509_VERIFY_PARAM_get0_name(const X509_VERIFY_PARAM *param); + +int X509_VERIFY_PARAM_add0_table(X509_VERIFY_PARAM *param); +int X509_VERIFY_PARAM_get_count(void); +const X509_VERIFY_PARAM *X509_VERIFY_PARAM_get0(int id); +const X509_VERIFY_PARAM *X509_VERIFY_PARAM_lookup(const char *name); +void X509_VERIFY_PARAM_table_cleanup(void); + +/* Non positive return values are errors */ +#define X509_PCY_TREE_FAILURE -2 /* Failure to satisfy explicit policy */ +#define X509_PCY_TREE_INVALID -1 /* Inconsistent or invalid extensions */ +#define X509_PCY_TREE_INTERNAL 0 /* Internal error, most likely malloc */ + +/* + * Positive return values form a bit mask, all but the first are internal to + * the library and don't appear in results from X509_policy_check(). + */ +#define X509_PCY_TREE_VALID 1 /* The policy tree is valid */ +#define X509_PCY_TREE_EMPTY 2 /* The policy tree is empty */ +#define X509_PCY_TREE_EXPLICIT 4 /* Explicit policy required */ + +int X509_policy_check(X509_POLICY_TREE **ptree, int *pexplicit_policy, + STACK_OF(X509) *certs, + STACK_OF(ASN1_OBJECT) *policy_oids, unsigned int flags); + +void X509_policy_tree_free(X509_POLICY_TREE *tree); + +int X509_policy_tree_level_count(const X509_POLICY_TREE *tree); +X509_POLICY_LEVEL *X509_policy_tree_get0_level(const X509_POLICY_TREE *tree, + int i); + +STACK_OF(X509_POLICY_NODE) +*X509_policy_tree_get0_policies(const X509_POLICY_TREE *tree); + +STACK_OF(X509_POLICY_NODE) +*X509_policy_tree_get0_user_policies(const X509_POLICY_TREE *tree); + +int X509_policy_level_node_count(X509_POLICY_LEVEL *level); + +X509_POLICY_NODE *X509_policy_level_get0_node(const X509_POLICY_LEVEL *level, + int i); + +const ASN1_OBJECT *X509_policy_node_get0_policy(const X509_POLICY_NODE *node); + +STACK_OF(POLICYQUALINFO) +*X509_policy_node_get0_qualifiers(const X509_POLICY_NODE *node); +const X509_POLICY_NODE *X509_policy_node_get0_parent(const X509_POLICY_NODE *node); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/x509err.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/x509err.h new file mode 100644 index 0000000000000000000000000000000000000000..7123a725e8254dc7aa7e03866dbb47a5d0736770 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/x509err.h @@ -0,0 +1,68 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_X509ERR_H +#define OPENSSL_X509ERR_H +#pragma once + +#include +#include +#include + +/* + * X509 reason codes. + */ +#define X509_R_AKID_MISMATCH 110 +#define X509_R_BAD_SELECTOR 133 +#define X509_R_BAD_X509_FILETYPE 100 +#define X509_R_BASE64_DECODE_ERROR 118 +#define X509_R_CANT_CHECK_DH_KEY 114 +#define X509_R_CERTIFICATE_VERIFICATION_FAILED 139 +#define X509_R_CERT_ALREADY_IN_HASH_TABLE 101 +#define X509_R_CRL_ALREADY_DELTA 127 +#define X509_R_CRL_VERIFY_FAILURE 131 +#define X509_R_DUPLICATE_ATTRIBUTE 140 +#define X509_R_ERROR_GETTING_MD_BY_NID 141 +#define X509_R_ERROR_USING_SIGINF_SET 142 +#define X509_R_IDP_MISMATCH 128 +#define X509_R_INVALID_ATTRIBUTES 138 +#define X509_R_INVALID_DIRECTORY 113 +#define X509_R_INVALID_DISTPOINT 143 +#define X509_R_INVALID_FIELD_NAME 119 +#define X509_R_INVALID_TRUST 123 +#define X509_R_ISSUER_MISMATCH 129 +#define X509_R_KEY_TYPE_MISMATCH 115 +#define X509_R_KEY_VALUES_MISMATCH 116 +#define X509_R_LOADING_CERT_DIR 103 +#define X509_R_LOADING_DEFAULTS 104 +#define X509_R_METHOD_NOT_SUPPORTED 124 +#define X509_R_NAME_TOO_LONG 134 +#define X509_R_NEWER_CRL_NOT_NEWER 132 +#define X509_R_NO_CERTIFICATE_FOUND 135 +#define X509_R_NO_CERTIFICATE_OR_CRL_FOUND 136 +#define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY 105 +#define X509_R_NO_CRL_FOUND 137 +#define X509_R_NO_CRL_NUMBER 130 +#define X509_R_PUBLIC_KEY_DECODE_ERROR 125 +#define X509_R_PUBLIC_KEY_ENCODE_ERROR 126 +#define X509_R_SHOULD_RETRY 106 +#define X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN 107 +#define X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY 108 +#define X509_R_UNKNOWN_KEY_TYPE 117 +#define X509_R_UNKNOWN_NID 109 +#define X509_R_UNKNOWN_PURPOSE_ID 121 +#define X509_R_UNKNOWN_SIGID_ALGS 144 +#define X509_R_UNKNOWN_TRUST_ID 120 +#define X509_R_UNSUPPORTED_ALGORITHM 111 +#define X509_R_UNSUPPORTED_VERSION 145 +#define X509_R_WRONG_LOOKUP_TYPE 112 +#define X509_R_WRONG_TYPE 122 + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/x509v3.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/x509v3.h new file mode 100644 index 0000000000000000000000000000000000000000..bbdd1de6df8c907db26ec828d065bb23bb7d910a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/x509v3.h @@ -0,0 +1,2013 @@ +/* + * WARNING: do not edit! + * Generated by makefile from include\openssl\x509v3.h.in + * + * Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* clang-format off */ + +/* clang-format on */ + +#ifndef OPENSSL_X509V3_H +#define OPENSSL_X509V3_H +#pragma once + +#include +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define HEADER_X509V3_H +#endif + +#include +#include +#include +#include +#ifndef OPENSSL_NO_STDIO +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Forward reference */ +struct v3_ext_method; +struct v3_ext_ctx; + +/* Useful typedefs */ + +typedef void *(*X509V3_EXT_NEW)(void); +typedef void (*X509V3_EXT_FREE)(void *); +typedef void *(*X509V3_EXT_D2I)(void *, const unsigned char **, long); +typedef int (*X509V3_EXT_I2D)(const void *, unsigned char **); +typedef STACK_OF(CONF_VALUE) *(*X509V3_EXT_I2V)(const struct v3_ext_method *method, void *ext, + STACK_OF(CONF_VALUE) *extlist); +typedef void *(*X509V3_EXT_V2I)(const struct v3_ext_method *method, + struct v3_ext_ctx *ctx, + STACK_OF(CONF_VALUE) *values); +typedef char *(*X509V3_EXT_I2S)(const struct v3_ext_method *method, + void *ext); +typedef void *(*X509V3_EXT_S2I)(const struct v3_ext_method *method, + struct v3_ext_ctx *ctx, const char *str); +typedef int (*X509V3_EXT_I2R)(const struct v3_ext_method *method, void *ext, + BIO *out, int indent); +typedef void *(*X509V3_EXT_R2I)(const struct v3_ext_method *method, + struct v3_ext_ctx *ctx, const char *str); + +/* V3 extension structure */ + +struct v3_ext_method { + int ext_nid; + int ext_flags; + /* If this is set the following four fields are ignored */ + ASN1_ITEM_EXP *it; + /* Old style ASN1 calls */ + X509V3_EXT_NEW ext_new; + X509V3_EXT_FREE ext_free; + X509V3_EXT_D2I d2i; + X509V3_EXT_I2D i2d; + /* The following pair is used for string extensions */ + X509V3_EXT_I2S i2s; + X509V3_EXT_S2I s2i; + /* The following pair is used for multi-valued extensions */ + X509V3_EXT_I2V i2v; + X509V3_EXT_V2I v2i; + /* The following are used for raw extensions */ + X509V3_EXT_I2R i2r; + X509V3_EXT_R2I r2i; + void *usr_data; /* Any extension specific data */ +}; + +typedef struct X509V3_CONF_METHOD_st { + char *(*get_string)(void *db, const char *section, const char *value); + STACK_OF(CONF_VALUE) *(*get_section)(void *db, const char *section); + void (*free_string)(void *db, char *string); + void (*free_section)(void *db, STACK_OF(CONF_VALUE) *section); +} X509V3_CONF_METHOD; + +/* Context specific info for producing X509 v3 extensions*/ +struct v3_ext_ctx { +#define X509V3_CTX_TEST 0x1 +#ifndef OPENSSL_NO_DEPRECATED_3_0 +#define CTX_TEST X509V3_CTX_TEST +#endif +#define X509V3_CTX_REPLACE 0x2 + int flags; + X509 *issuer_cert; + X509 *subject_cert; + X509_REQ *subject_req; + X509_CRL *crl; + X509V3_CONF_METHOD *db_meth; + void *db; + EVP_PKEY *issuer_pkey; + /* Maybe more here */ +}; + +typedef struct v3_ext_method X509V3_EXT_METHOD; + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(X509V3_EXT_METHOD, X509V3_EXT_METHOD, X509V3_EXT_METHOD) +#define sk_X509V3_EXT_METHOD_num(sk) OPENSSL_sk_num(ossl_check_const_X509V3_EXT_METHOD_sk_type(sk)) +#define sk_X509V3_EXT_METHOD_value(sk, idx) ((X509V3_EXT_METHOD *)OPENSSL_sk_value(ossl_check_const_X509V3_EXT_METHOD_sk_type(sk), (idx))) +#define sk_X509V3_EXT_METHOD_new(cmp) ((STACK_OF(X509V3_EXT_METHOD) *)OPENSSL_sk_new(ossl_check_X509V3_EXT_METHOD_compfunc_type(cmp))) +#define sk_X509V3_EXT_METHOD_new_null() ((STACK_OF(X509V3_EXT_METHOD) *)OPENSSL_sk_new_null()) +#define sk_X509V3_EXT_METHOD_new_reserve(cmp, n) ((STACK_OF(X509V3_EXT_METHOD) *)OPENSSL_sk_new_reserve(ossl_check_X509V3_EXT_METHOD_compfunc_type(cmp), (n))) +#define sk_X509V3_EXT_METHOD_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509V3_EXT_METHOD_sk_type(sk), (n)) +#define sk_X509V3_EXT_METHOD_free(sk) OPENSSL_sk_free(ossl_check_X509V3_EXT_METHOD_sk_type(sk)) +#define sk_X509V3_EXT_METHOD_zero(sk) OPENSSL_sk_zero(ossl_check_X509V3_EXT_METHOD_sk_type(sk)) +#define sk_X509V3_EXT_METHOD_delete(sk, i) ((X509V3_EXT_METHOD *)OPENSSL_sk_delete(ossl_check_X509V3_EXT_METHOD_sk_type(sk), (i))) +#define sk_X509V3_EXT_METHOD_delete_ptr(sk, ptr) ((X509V3_EXT_METHOD *)OPENSSL_sk_delete_ptr(ossl_check_X509V3_EXT_METHOD_sk_type(sk), ossl_check_X509V3_EXT_METHOD_type(ptr))) +#define sk_X509V3_EXT_METHOD_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509V3_EXT_METHOD_sk_type(sk), ossl_check_X509V3_EXT_METHOD_type(ptr)) +#define sk_X509V3_EXT_METHOD_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509V3_EXT_METHOD_sk_type(sk), ossl_check_X509V3_EXT_METHOD_type(ptr)) +#define sk_X509V3_EXT_METHOD_pop(sk) ((X509V3_EXT_METHOD *)OPENSSL_sk_pop(ossl_check_X509V3_EXT_METHOD_sk_type(sk))) +#define sk_X509V3_EXT_METHOD_shift(sk) ((X509V3_EXT_METHOD *)OPENSSL_sk_shift(ossl_check_X509V3_EXT_METHOD_sk_type(sk))) +#define sk_X509V3_EXT_METHOD_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509V3_EXT_METHOD_sk_type(sk), ossl_check_X509V3_EXT_METHOD_freefunc_type(freefunc)) +#define sk_X509V3_EXT_METHOD_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509V3_EXT_METHOD_sk_type(sk), ossl_check_X509V3_EXT_METHOD_type(ptr), (idx)) +#define sk_X509V3_EXT_METHOD_set(sk, idx, ptr) ((X509V3_EXT_METHOD *)OPENSSL_sk_set(ossl_check_X509V3_EXT_METHOD_sk_type(sk), (idx), ossl_check_X509V3_EXT_METHOD_type(ptr))) +#define sk_X509V3_EXT_METHOD_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509V3_EXT_METHOD_sk_type(sk), ossl_check_X509V3_EXT_METHOD_type(ptr)) +#define sk_X509V3_EXT_METHOD_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509V3_EXT_METHOD_sk_type(sk), ossl_check_X509V3_EXT_METHOD_type(ptr)) +#define sk_X509V3_EXT_METHOD_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509V3_EXT_METHOD_sk_type(sk), ossl_check_X509V3_EXT_METHOD_type(ptr), pnum) +#define sk_X509V3_EXT_METHOD_sort(sk) OPENSSL_sk_sort(ossl_check_X509V3_EXT_METHOD_sk_type(sk)) +#define sk_X509V3_EXT_METHOD_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509V3_EXT_METHOD_sk_type(sk)) +#define sk_X509V3_EXT_METHOD_dup(sk) ((STACK_OF(X509V3_EXT_METHOD) *)OPENSSL_sk_dup(ossl_check_const_X509V3_EXT_METHOD_sk_type(sk))) +#define sk_X509V3_EXT_METHOD_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509V3_EXT_METHOD) *)OPENSSL_sk_deep_copy(ossl_check_const_X509V3_EXT_METHOD_sk_type(sk), ossl_check_X509V3_EXT_METHOD_copyfunc_type(copyfunc), ossl_check_X509V3_EXT_METHOD_freefunc_type(freefunc))) +#define sk_X509V3_EXT_METHOD_set_cmp_func(sk, cmp) ((sk_X509V3_EXT_METHOD_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509V3_EXT_METHOD_sk_type(sk), ossl_check_X509V3_EXT_METHOD_compfunc_type(cmp))) + +/* clang-format on */ + +/* ext_flags values */ +#define X509V3_EXT_DYNAMIC 0x1 +#define X509V3_EXT_CTX_DEP 0x2 +#define X509V3_EXT_MULTILINE 0x4 + +typedef BIT_STRING_BITNAME ENUMERATED_NAMES; + +typedef struct BASIC_CONSTRAINTS_st { + int ca; + ASN1_INTEGER *pathlen; +} BASIC_CONSTRAINTS; + +typedef struct OSSL_BASIC_ATTR_CONSTRAINTS_st { + int authority; + ASN1_INTEGER *pathlen; +} OSSL_BASIC_ATTR_CONSTRAINTS; + +typedef struct PKEY_USAGE_PERIOD_st { + ASN1_GENERALIZEDTIME *notBefore; + ASN1_GENERALIZEDTIME *notAfter; +} PKEY_USAGE_PERIOD; + +typedef struct otherName_st { + ASN1_OBJECT *type_id; + ASN1_TYPE *value; +} OTHERNAME; + +typedef struct EDIPartyName_st { + ASN1_STRING *nameAssigner; + ASN1_STRING *partyName; +} EDIPARTYNAME; + +typedef struct GENERAL_NAME_st { +#define GEN_OTHERNAME 0 +#define GEN_EMAIL 1 +#define GEN_DNS 2 +#define GEN_X400 3 +#define GEN_DIRNAME 4 +#define GEN_EDIPARTY 5 +#define GEN_URI 6 +#define GEN_IPADD 7 +#define GEN_RID 8 + int type; + union { + char *ptr; + OTHERNAME *otherName; /* otherName */ + ASN1_IA5STRING *rfc822Name; + ASN1_IA5STRING *dNSName; + ASN1_STRING *x400Address; + X509_NAME *directoryName; + EDIPARTYNAME *ediPartyName; + ASN1_IA5STRING *uniformResourceIdentifier; + ASN1_OCTET_STRING *iPAddress; + ASN1_OBJECT *registeredID; + /* Old names */ + ASN1_OCTET_STRING *ip; /* iPAddress */ + X509_NAME *dirn; /* dirn */ + ASN1_IA5STRING *ia5; /* rfc822Name, dNSName, + * uniformResourceIdentifier */ + ASN1_OBJECT *rid; /* registeredID */ + ASN1_TYPE *other; /* x400Address */ + } d; +} GENERAL_NAME; + +typedef struct ACCESS_DESCRIPTION_st { + ASN1_OBJECT *method; + GENERAL_NAME *location; +} ACCESS_DESCRIPTION; + +int GENERAL_NAME_set1_X509_NAME(GENERAL_NAME **tgt, const X509_NAME *src); + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(ACCESS_DESCRIPTION, ACCESS_DESCRIPTION, ACCESS_DESCRIPTION) +#define sk_ACCESS_DESCRIPTION_num(sk) OPENSSL_sk_num(ossl_check_const_ACCESS_DESCRIPTION_sk_type(sk)) +#define sk_ACCESS_DESCRIPTION_value(sk, idx) ((ACCESS_DESCRIPTION *)OPENSSL_sk_value(ossl_check_const_ACCESS_DESCRIPTION_sk_type(sk), (idx))) +#define sk_ACCESS_DESCRIPTION_new(cmp) ((STACK_OF(ACCESS_DESCRIPTION) *)OPENSSL_sk_new(ossl_check_ACCESS_DESCRIPTION_compfunc_type(cmp))) +#define sk_ACCESS_DESCRIPTION_new_null() ((STACK_OF(ACCESS_DESCRIPTION) *)OPENSSL_sk_new_null()) +#define sk_ACCESS_DESCRIPTION_new_reserve(cmp, n) ((STACK_OF(ACCESS_DESCRIPTION) *)OPENSSL_sk_new_reserve(ossl_check_ACCESS_DESCRIPTION_compfunc_type(cmp), (n))) +#define sk_ACCESS_DESCRIPTION_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ACCESS_DESCRIPTION_sk_type(sk), (n)) +#define sk_ACCESS_DESCRIPTION_free(sk) OPENSSL_sk_free(ossl_check_ACCESS_DESCRIPTION_sk_type(sk)) +#define sk_ACCESS_DESCRIPTION_zero(sk) OPENSSL_sk_zero(ossl_check_ACCESS_DESCRIPTION_sk_type(sk)) +#define sk_ACCESS_DESCRIPTION_delete(sk, i) ((ACCESS_DESCRIPTION *)OPENSSL_sk_delete(ossl_check_ACCESS_DESCRIPTION_sk_type(sk), (i))) +#define sk_ACCESS_DESCRIPTION_delete_ptr(sk, ptr) ((ACCESS_DESCRIPTION *)OPENSSL_sk_delete_ptr(ossl_check_ACCESS_DESCRIPTION_sk_type(sk), ossl_check_ACCESS_DESCRIPTION_type(ptr))) +#define sk_ACCESS_DESCRIPTION_push(sk, ptr) OPENSSL_sk_push(ossl_check_ACCESS_DESCRIPTION_sk_type(sk), ossl_check_ACCESS_DESCRIPTION_type(ptr)) +#define sk_ACCESS_DESCRIPTION_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ACCESS_DESCRIPTION_sk_type(sk), ossl_check_ACCESS_DESCRIPTION_type(ptr)) +#define sk_ACCESS_DESCRIPTION_pop(sk) ((ACCESS_DESCRIPTION *)OPENSSL_sk_pop(ossl_check_ACCESS_DESCRIPTION_sk_type(sk))) +#define sk_ACCESS_DESCRIPTION_shift(sk) ((ACCESS_DESCRIPTION *)OPENSSL_sk_shift(ossl_check_ACCESS_DESCRIPTION_sk_type(sk))) +#define sk_ACCESS_DESCRIPTION_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ACCESS_DESCRIPTION_sk_type(sk), ossl_check_ACCESS_DESCRIPTION_freefunc_type(freefunc)) +#define sk_ACCESS_DESCRIPTION_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ACCESS_DESCRIPTION_sk_type(sk), ossl_check_ACCESS_DESCRIPTION_type(ptr), (idx)) +#define sk_ACCESS_DESCRIPTION_set(sk, idx, ptr) ((ACCESS_DESCRIPTION *)OPENSSL_sk_set(ossl_check_ACCESS_DESCRIPTION_sk_type(sk), (idx), ossl_check_ACCESS_DESCRIPTION_type(ptr))) +#define sk_ACCESS_DESCRIPTION_find(sk, ptr) OPENSSL_sk_find(ossl_check_ACCESS_DESCRIPTION_sk_type(sk), ossl_check_ACCESS_DESCRIPTION_type(ptr)) +#define sk_ACCESS_DESCRIPTION_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ACCESS_DESCRIPTION_sk_type(sk), ossl_check_ACCESS_DESCRIPTION_type(ptr)) +#define sk_ACCESS_DESCRIPTION_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ACCESS_DESCRIPTION_sk_type(sk), ossl_check_ACCESS_DESCRIPTION_type(ptr), pnum) +#define sk_ACCESS_DESCRIPTION_sort(sk) OPENSSL_sk_sort(ossl_check_ACCESS_DESCRIPTION_sk_type(sk)) +#define sk_ACCESS_DESCRIPTION_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ACCESS_DESCRIPTION_sk_type(sk)) +#define sk_ACCESS_DESCRIPTION_dup(sk) ((STACK_OF(ACCESS_DESCRIPTION) *)OPENSSL_sk_dup(ossl_check_const_ACCESS_DESCRIPTION_sk_type(sk))) +#define sk_ACCESS_DESCRIPTION_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ACCESS_DESCRIPTION) *)OPENSSL_sk_deep_copy(ossl_check_const_ACCESS_DESCRIPTION_sk_type(sk), ossl_check_ACCESS_DESCRIPTION_copyfunc_type(copyfunc), ossl_check_ACCESS_DESCRIPTION_freefunc_type(freefunc))) +#define sk_ACCESS_DESCRIPTION_set_cmp_func(sk, cmp) ((sk_ACCESS_DESCRIPTION_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ACCESS_DESCRIPTION_sk_type(sk), ossl_check_ACCESS_DESCRIPTION_compfunc_type(cmp))) +SKM_DEFINE_STACK_OF_INTERNAL(GENERAL_NAME, GENERAL_NAME, GENERAL_NAME) +#define sk_GENERAL_NAME_num(sk) OPENSSL_sk_num(ossl_check_const_GENERAL_NAME_sk_type(sk)) +#define sk_GENERAL_NAME_value(sk, idx) ((GENERAL_NAME *)OPENSSL_sk_value(ossl_check_const_GENERAL_NAME_sk_type(sk), (idx))) +#define sk_GENERAL_NAME_new(cmp) ((STACK_OF(GENERAL_NAME) *)OPENSSL_sk_new(ossl_check_GENERAL_NAME_compfunc_type(cmp))) +#define sk_GENERAL_NAME_new_null() ((STACK_OF(GENERAL_NAME) *)OPENSSL_sk_new_null()) +#define sk_GENERAL_NAME_new_reserve(cmp, n) ((STACK_OF(GENERAL_NAME) *)OPENSSL_sk_new_reserve(ossl_check_GENERAL_NAME_compfunc_type(cmp), (n))) +#define sk_GENERAL_NAME_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_GENERAL_NAME_sk_type(sk), (n)) +#define sk_GENERAL_NAME_free(sk) OPENSSL_sk_free(ossl_check_GENERAL_NAME_sk_type(sk)) +#define sk_GENERAL_NAME_zero(sk) OPENSSL_sk_zero(ossl_check_GENERAL_NAME_sk_type(sk)) +#define sk_GENERAL_NAME_delete(sk, i) ((GENERAL_NAME *)OPENSSL_sk_delete(ossl_check_GENERAL_NAME_sk_type(sk), (i))) +#define sk_GENERAL_NAME_delete_ptr(sk, ptr) ((GENERAL_NAME *)OPENSSL_sk_delete_ptr(ossl_check_GENERAL_NAME_sk_type(sk), ossl_check_GENERAL_NAME_type(ptr))) +#define sk_GENERAL_NAME_push(sk, ptr) OPENSSL_sk_push(ossl_check_GENERAL_NAME_sk_type(sk), ossl_check_GENERAL_NAME_type(ptr)) +#define sk_GENERAL_NAME_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_GENERAL_NAME_sk_type(sk), ossl_check_GENERAL_NAME_type(ptr)) +#define sk_GENERAL_NAME_pop(sk) ((GENERAL_NAME *)OPENSSL_sk_pop(ossl_check_GENERAL_NAME_sk_type(sk))) +#define sk_GENERAL_NAME_shift(sk) ((GENERAL_NAME *)OPENSSL_sk_shift(ossl_check_GENERAL_NAME_sk_type(sk))) +#define sk_GENERAL_NAME_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_GENERAL_NAME_sk_type(sk), ossl_check_GENERAL_NAME_freefunc_type(freefunc)) +#define sk_GENERAL_NAME_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_GENERAL_NAME_sk_type(sk), ossl_check_GENERAL_NAME_type(ptr), (idx)) +#define sk_GENERAL_NAME_set(sk, idx, ptr) ((GENERAL_NAME *)OPENSSL_sk_set(ossl_check_GENERAL_NAME_sk_type(sk), (idx), ossl_check_GENERAL_NAME_type(ptr))) +#define sk_GENERAL_NAME_find(sk, ptr) OPENSSL_sk_find(ossl_check_GENERAL_NAME_sk_type(sk), ossl_check_GENERAL_NAME_type(ptr)) +#define sk_GENERAL_NAME_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_GENERAL_NAME_sk_type(sk), ossl_check_GENERAL_NAME_type(ptr)) +#define sk_GENERAL_NAME_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_GENERAL_NAME_sk_type(sk), ossl_check_GENERAL_NAME_type(ptr), pnum) +#define sk_GENERAL_NAME_sort(sk) OPENSSL_sk_sort(ossl_check_GENERAL_NAME_sk_type(sk)) +#define sk_GENERAL_NAME_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_GENERAL_NAME_sk_type(sk)) +#define sk_GENERAL_NAME_dup(sk) ((STACK_OF(GENERAL_NAME) *)OPENSSL_sk_dup(ossl_check_const_GENERAL_NAME_sk_type(sk))) +#define sk_GENERAL_NAME_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(GENERAL_NAME) *)OPENSSL_sk_deep_copy(ossl_check_const_GENERAL_NAME_sk_type(sk), ossl_check_GENERAL_NAME_copyfunc_type(copyfunc), ossl_check_GENERAL_NAME_freefunc_type(freefunc))) +#define sk_GENERAL_NAME_set_cmp_func(sk, cmp) ((sk_GENERAL_NAME_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_GENERAL_NAME_sk_type(sk), ossl_check_GENERAL_NAME_compfunc_type(cmp))) + +/* clang-format on */ + +typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS; +typedef STACK_OF(ASN1_OBJECT) EXTENDED_KEY_USAGE; +typedef STACK_OF(ASN1_INTEGER) TLS_FEATURE; +typedef STACK_OF(GENERAL_NAME) GENERAL_NAMES; + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(GENERAL_NAMES, GENERAL_NAMES, GENERAL_NAMES) +#define sk_GENERAL_NAMES_num(sk) OPENSSL_sk_num(ossl_check_const_GENERAL_NAMES_sk_type(sk)) +#define sk_GENERAL_NAMES_value(sk, idx) ((GENERAL_NAMES *)OPENSSL_sk_value(ossl_check_const_GENERAL_NAMES_sk_type(sk), (idx))) +#define sk_GENERAL_NAMES_new(cmp) ((STACK_OF(GENERAL_NAMES) *)OPENSSL_sk_new(ossl_check_GENERAL_NAMES_compfunc_type(cmp))) +#define sk_GENERAL_NAMES_new_null() ((STACK_OF(GENERAL_NAMES) *)OPENSSL_sk_new_null()) +#define sk_GENERAL_NAMES_new_reserve(cmp, n) ((STACK_OF(GENERAL_NAMES) *)OPENSSL_sk_new_reserve(ossl_check_GENERAL_NAMES_compfunc_type(cmp), (n))) +#define sk_GENERAL_NAMES_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_GENERAL_NAMES_sk_type(sk), (n)) +#define sk_GENERAL_NAMES_free(sk) OPENSSL_sk_free(ossl_check_GENERAL_NAMES_sk_type(sk)) +#define sk_GENERAL_NAMES_zero(sk) OPENSSL_sk_zero(ossl_check_GENERAL_NAMES_sk_type(sk)) +#define sk_GENERAL_NAMES_delete(sk, i) ((GENERAL_NAMES *)OPENSSL_sk_delete(ossl_check_GENERAL_NAMES_sk_type(sk), (i))) +#define sk_GENERAL_NAMES_delete_ptr(sk, ptr) ((GENERAL_NAMES *)OPENSSL_sk_delete_ptr(ossl_check_GENERAL_NAMES_sk_type(sk), ossl_check_GENERAL_NAMES_type(ptr))) +#define sk_GENERAL_NAMES_push(sk, ptr) OPENSSL_sk_push(ossl_check_GENERAL_NAMES_sk_type(sk), ossl_check_GENERAL_NAMES_type(ptr)) +#define sk_GENERAL_NAMES_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_GENERAL_NAMES_sk_type(sk), ossl_check_GENERAL_NAMES_type(ptr)) +#define sk_GENERAL_NAMES_pop(sk) ((GENERAL_NAMES *)OPENSSL_sk_pop(ossl_check_GENERAL_NAMES_sk_type(sk))) +#define sk_GENERAL_NAMES_shift(sk) ((GENERAL_NAMES *)OPENSSL_sk_shift(ossl_check_GENERAL_NAMES_sk_type(sk))) +#define sk_GENERAL_NAMES_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_GENERAL_NAMES_sk_type(sk), ossl_check_GENERAL_NAMES_freefunc_type(freefunc)) +#define sk_GENERAL_NAMES_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_GENERAL_NAMES_sk_type(sk), ossl_check_GENERAL_NAMES_type(ptr), (idx)) +#define sk_GENERAL_NAMES_set(sk, idx, ptr) ((GENERAL_NAMES *)OPENSSL_sk_set(ossl_check_GENERAL_NAMES_sk_type(sk), (idx), ossl_check_GENERAL_NAMES_type(ptr))) +#define sk_GENERAL_NAMES_find(sk, ptr) OPENSSL_sk_find(ossl_check_GENERAL_NAMES_sk_type(sk), ossl_check_GENERAL_NAMES_type(ptr)) +#define sk_GENERAL_NAMES_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_GENERAL_NAMES_sk_type(sk), ossl_check_GENERAL_NAMES_type(ptr)) +#define sk_GENERAL_NAMES_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_GENERAL_NAMES_sk_type(sk), ossl_check_GENERAL_NAMES_type(ptr), pnum) +#define sk_GENERAL_NAMES_sort(sk) OPENSSL_sk_sort(ossl_check_GENERAL_NAMES_sk_type(sk)) +#define sk_GENERAL_NAMES_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_GENERAL_NAMES_sk_type(sk)) +#define sk_GENERAL_NAMES_dup(sk) ((STACK_OF(GENERAL_NAMES) *)OPENSSL_sk_dup(ossl_check_const_GENERAL_NAMES_sk_type(sk))) +#define sk_GENERAL_NAMES_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(GENERAL_NAMES) *)OPENSSL_sk_deep_copy(ossl_check_const_GENERAL_NAMES_sk_type(sk), ossl_check_GENERAL_NAMES_copyfunc_type(copyfunc), ossl_check_GENERAL_NAMES_freefunc_type(freefunc))) +#define sk_GENERAL_NAMES_set_cmp_func(sk, cmp) ((sk_GENERAL_NAMES_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_GENERAL_NAMES_sk_type(sk), ossl_check_GENERAL_NAMES_compfunc_type(cmp))) + +/* clang-format on */ + +typedef struct DIST_POINT_NAME_st { + int type; + union { + GENERAL_NAMES *fullname; + STACK_OF(X509_NAME_ENTRY) *relativename; + } name; + /* If relativename then this contains the full distribution point name */ + X509_NAME *dpname; +} DIST_POINT_NAME; +DECLARE_ASN1_DUP_FUNCTION(DIST_POINT_NAME) +/* All existing reasons */ +#define CRLDP_ALL_REASONS 0x807f + +#define CRL_REASON_NONE -1 +#define CRL_REASON_UNSPECIFIED 0 +#define CRL_REASON_KEY_COMPROMISE 1 +#define CRL_REASON_CA_COMPROMISE 2 +#define CRL_REASON_AFFILIATION_CHANGED 3 +#define CRL_REASON_SUPERSEDED 4 +#define CRL_REASON_CESSATION_OF_OPERATION 5 +#define CRL_REASON_CERTIFICATE_HOLD 6 +#define CRL_REASON_REMOVE_FROM_CRL 8 +#define CRL_REASON_PRIVILEGE_WITHDRAWN 9 +#define CRL_REASON_AA_COMPROMISE 10 + +struct DIST_POINT_st { + DIST_POINT_NAME *distpoint; + ASN1_BIT_STRING *reasons; + GENERAL_NAMES *CRLissuer; + int dp_reasons; +}; + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(DIST_POINT, DIST_POINT, DIST_POINT) +#define sk_DIST_POINT_num(sk) OPENSSL_sk_num(ossl_check_const_DIST_POINT_sk_type(sk)) +#define sk_DIST_POINT_value(sk, idx) ((DIST_POINT *)OPENSSL_sk_value(ossl_check_const_DIST_POINT_sk_type(sk), (idx))) +#define sk_DIST_POINT_new(cmp) ((STACK_OF(DIST_POINT) *)OPENSSL_sk_new(ossl_check_DIST_POINT_compfunc_type(cmp))) +#define sk_DIST_POINT_new_null() ((STACK_OF(DIST_POINT) *)OPENSSL_sk_new_null()) +#define sk_DIST_POINT_new_reserve(cmp, n) ((STACK_OF(DIST_POINT) *)OPENSSL_sk_new_reserve(ossl_check_DIST_POINT_compfunc_type(cmp), (n))) +#define sk_DIST_POINT_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_DIST_POINT_sk_type(sk), (n)) +#define sk_DIST_POINT_free(sk) OPENSSL_sk_free(ossl_check_DIST_POINT_sk_type(sk)) +#define sk_DIST_POINT_zero(sk) OPENSSL_sk_zero(ossl_check_DIST_POINT_sk_type(sk)) +#define sk_DIST_POINT_delete(sk, i) ((DIST_POINT *)OPENSSL_sk_delete(ossl_check_DIST_POINT_sk_type(sk), (i))) +#define sk_DIST_POINT_delete_ptr(sk, ptr) ((DIST_POINT *)OPENSSL_sk_delete_ptr(ossl_check_DIST_POINT_sk_type(sk), ossl_check_DIST_POINT_type(ptr))) +#define sk_DIST_POINT_push(sk, ptr) OPENSSL_sk_push(ossl_check_DIST_POINT_sk_type(sk), ossl_check_DIST_POINT_type(ptr)) +#define sk_DIST_POINT_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_DIST_POINT_sk_type(sk), ossl_check_DIST_POINT_type(ptr)) +#define sk_DIST_POINT_pop(sk) ((DIST_POINT *)OPENSSL_sk_pop(ossl_check_DIST_POINT_sk_type(sk))) +#define sk_DIST_POINT_shift(sk) ((DIST_POINT *)OPENSSL_sk_shift(ossl_check_DIST_POINT_sk_type(sk))) +#define sk_DIST_POINT_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_DIST_POINT_sk_type(sk), ossl_check_DIST_POINT_freefunc_type(freefunc)) +#define sk_DIST_POINT_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_DIST_POINT_sk_type(sk), ossl_check_DIST_POINT_type(ptr), (idx)) +#define sk_DIST_POINT_set(sk, idx, ptr) ((DIST_POINT *)OPENSSL_sk_set(ossl_check_DIST_POINT_sk_type(sk), (idx), ossl_check_DIST_POINT_type(ptr))) +#define sk_DIST_POINT_find(sk, ptr) OPENSSL_sk_find(ossl_check_DIST_POINT_sk_type(sk), ossl_check_DIST_POINT_type(ptr)) +#define sk_DIST_POINT_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_DIST_POINT_sk_type(sk), ossl_check_DIST_POINT_type(ptr)) +#define sk_DIST_POINT_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_DIST_POINT_sk_type(sk), ossl_check_DIST_POINT_type(ptr), pnum) +#define sk_DIST_POINT_sort(sk) OPENSSL_sk_sort(ossl_check_DIST_POINT_sk_type(sk)) +#define sk_DIST_POINT_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_DIST_POINT_sk_type(sk)) +#define sk_DIST_POINT_dup(sk) ((STACK_OF(DIST_POINT) *)OPENSSL_sk_dup(ossl_check_const_DIST_POINT_sk_type(sk))) +#define sk_DIST_POINT_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(DIST_POINT) *)OPENSSL_sk_deep_copy(ossl_check_const_DIST_POINT_sk_type(sk), ossl_check_DIST_POINT_copyfunc_type(copyfunc), ossl_check_DIST_POINT_freefunc_type(freefunc))) +#define sk_DIST_POINT_set_cmp_func(sk, cmp) ((sk_DIST_POINT_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_DIST_POINT_sk_type(sk), ossl_check_DIST_POINT_compfunc_type(cmp))) + +/* clang-format on */ + +typedef STACK_OF(DIST_POINT) CRL_DIST_POINTS; + +struct AUTHORITY_KEYID_st { + ASN1_OCTET_STRING *keyid; + GENERAL_NAMES *issuer; + ASN1_INTEGER *serial; +}; + +/* Strong extranet structures */ + +typedef struct SXNET_ID_st { + ASN1_INTEGER *zone; + ASN1_OCTET_STRING *user; +} SXNETID; + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(SXNETID, SXNETID, SXNETID) +#define sk_SXNETID_num(sk) OPENSSL_sk_num(ossl_check_const_SXNETID_sk_type(sk)) +#define sk_SXNETID_value(sk, idx) ((SXNETID *)OPENSSL_sk_value(ossl_check_const_SXNETID_sk_type(sk), (idx))) +#define sk_SXNETID_new(cmp) ((STACK_OF(SXNETID) *)OPENSSL_sk_new(ossl_check_SXNETID_compfunc_type(cmp))) +#define sk_SXNETID_new_null() ((STACK_OF(SXNETID) *)OPENSSL_sk_new_null()) +#define sk_SXNETID_new_reserve(cmp, n) ((STACK_OF(SXNETID) *)OPENSSL_sk_new_reserve(ossl_check_SXNETID_compfunc_type(cmp), (n))) +#define sk_SXNETID_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_SXNETID_sk_type(sk), (n)) +#define sk_SXNETID_free(sk) OPENSSL_sk_free(ossl_check_SXNETID_sk_type(sk)) +#define sk_SXNETID_zero(sk) OPENSSL_sk_zero(ossl_check_SXNETID_sk_type(sk)) +#define sk_SXNETID_delete(sk, i) ((SXNETID *)OPENSSL_sk_delete(ossl_check_SXNETID_sk_type(sk), (i))) +#define sk_SXNETID_delete_ptr(sk, ptr) ((SXNETID *)OPENSSL_sk_delete_ptr(ossl_check_SXNETID_sk_type(sk), ossl_check_SXNETID_type(ptr))) +#define sk_SXNETID_push(sk, ptr) OPENSSL_sk_push(ossl_check_SXNETID_sk_type(sk), ossl_check_SXNETID_type(ptr)) +#define sk_SXNETID_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_SXNETID_sk_type(sk), ossl_check_SXNETID_type(ptr)) +#define sk_SXNETID_pop(sk) ((SXNETID *)OPENSSL_sk_pop(ossl_check_SXNETID_sk_type(sk))) +#define sk_SXNETID_shift(sk) ((SXNETID *)OPENSSL_sk_shift(ossl_check_SXNETID_sk_type(sk))) +#define sk_SXNETID_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SXNETID_sk_type(sk), ossl_check_SXNETID_freefunc_type(freefunc)) +#define sk_SXNETID_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_SXNETID_sk_type(sk), ossl_check_SXNETID_type(ptr), (idx)) +#define sk_SXNETID_set(sk, idx, ptr) ((SXNETID *)OPENSSL_sk_set(ossl_check_SXNETID_sk_type(sk), (idx), ossl_check_SXNETID_type(ptr))) +#define sk_SXNETID_find(sk, ptr) OPENSSL_sk_find(ossl_check_SXNETID_sk_type(sk), ossl_check_SXNETID_type(ptr)) +#define sk_SXNETID_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_SXNETID_sk_type(sk), ossl_check_SXNETID_type(ptr)) +#define sk_SXNETID_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_SXNETID_sk_type(sk), ossl_check_SXNETID_type(ptr), pnum) +#define sk_SXNETID_sort(sk) OPENSSL_sk_sort(ossl_check_SXNETID_sk_type(sk)) +#define sk_SXNETID_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_SXNETID_sk_type(sk)) +#define sk_SXNETID_dup(sk) ((STACK_OF(SXNETID) *)OPENSSL_sk_dup(ossl_check_const_SXNETID_sk_type(sk))) +#define sk_SXNETID_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(SXNETID) *)OPENSSL_sk_deep_copy(ossl_check_const_SXNETID_sk_type(sk), ossl_check_SXNETID_copyfunc_type(copyfunc), ossl_check_SXNETID_freefunc_type(freefunc))) +#define sk_SXNETID_set_cmp_func(sk, cmp) ((sk_SXNETID_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_SXNETID_sk_type(sk), ossl_check_SXNETID_compfunc_type(cmp))) + +/* clang-format on */ + +typedef struct SXNET_st { + ASN1_INTEGER *version; + STACK_OF(SXNETID) *ids; +} SXNET; + +typedef struct ISSUER_SIGN_TOOL_st { + ASN1_UTF8STRING *signTool; + ASN1_UTF8STRING *cATool; + ASN1_UTF8STRING *signToolCert; + ASN1_UTF8STRING *cAToolCert; +} ISSUER_SIGN_TOOL; + +typedef struct NOTICEREF_st { + ASN1_STRING *organization; + STACK_OF(ASN1_INTEGER) *noticenos; +} NOTICEREF; + +typedef struct USERNOTICE_st { + NOTICEREF *noticeref; + ASN1_STRING *exptext; +} USERNOTICE; + +typedef struct POLICYQUALINFO_st { + ASN1_OBJECT *pqualid; + union { + ASN1_IA5STRING *cpsuri; + USERNOTICE *usernotice; + ASN1_TYPE *other; + } d; +} POLICYQUALINFO; + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(POLICYQUALINFO, POLICYQUALINFO, POLICYQUALINFO) +#define sk_POLICYQUALINFO_num(sk) OPENSSL_sk_num(ossl_check_const_POLICYQUALINFO_sk_type(sk)) +#define sk_POLICYQUALINFO_value(sk, idx) ((POLICYQUALINFO *)OPENSSL_sk_value(ossl_check_const_POLICYQUALINFO_sk_type(sk), (idx))) +#define sk_POLICYQUALINFO_new(cmp) ((STACK_OF(POLICYQUALINFO) *)OPENSSL_sk_new(ossl_check_POLICYQUALINFO_compfunc_type(cmp))) +#define sk_POLICYQUALINFO_new_null() ((STACK_OF(POLICYQUALINFO) *)OPENSSL_sk_new_null()) +#define sk_POLICYQUALINFO_new_reserve(cmp, n) ((STACK_OF(POLICYQUALINFO) *)OPENSSL_sk_new_reserve(ossl_check_POLICYQUALINFO_compfunc_type(cmp), (n))) +#define sk_POLICYQUALINFO_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_POLICYQUALINFO_sk_type(sk), (n)) +#define sk_POLICYQUALINFO_free(sk) OPENSSL_sk_free(ossl_check_POLICYQUALINFO_sk_type(sk)) +#define sk_POLICYQUALINFO_zero(sk) OPENSSL_sk_zero(ossl_check_POLICYQUALINFO_sk_type(sk)) +#define sk_POLICYQUALINFO_delete(sk, i) ((POLICYQUALINFO *)OPENSSL_sk_delete(ossl_check_POLICYQUALINFO_sk_type(sk), (i))) +#define sk_POLICYQUALINFO_delete_ptr(sk, ptr) ((POLICYQUALINFO *)OPENSSL_sk_delete_ptr(ossl_check_POLICYQUALINFO_sk_type(sk), ossl_check_POLICYQUALINFO_type(ptr))) +#define sk_POLICYQUALINFO_push(sk, ptr) OPENSSL_sk_push(ossl_check_POLICYQUALINFO_sk_type(sk), ossl_check_POLICYQUALINFO_type(ptr)) +#define sk_POLICYQUALINFO_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_POLICYQUALINFO_sk_type(sk), ossl_check_POLICYQUALINFO_type(ptr)) +#define sk_POLICYQUALINFO_pop(sk) ((POLICYQUALINFO *)OPENSSL_sk_pop(ossl_check_POLICYQUALINFO_sk_type(sk))) +#define sk_POLICYQUALINFO_shift(sk) ((POLICYQUALINFO *)OPENSSL_sk_shift(ossl_check_POLICYQUALINFO_sk_type(sk))) +#define sk_POLICYQUALINFO_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_POLICYQUALINFO_sk_type(sk), ossl_check_POLICYQUALINFO_freefunc_type(freefunc)) +#define sk_POLICYQUALINFO_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_POLICYQUALINFO_sk_type(sk), ossl_check_POLICYQUALINFO_type(ptr), (idx)) +#define sk_POLICYQUALINFO_set(sk, idx, ptr) ((POLICYQUALINFO *)OPENSSL_sk_set(ossl_check_POLICYQUALINFO_sk_type(sk), (idx), ossl_check_POLICYQUALINFO_type(ptr))) +#define sk_POLICYQUALINFO_find(sk, ptr) OPENSSL_sk_find(ossl_check_POLICYQUALINFO_sk_type(sk), ossl_check_POLICYQUALINFO_type(ptr)) +#define sk_POLICYQUALINFO_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_POLICYQUALINFO_sk_type(sk), ossl_check_POLICYQUALINFO_type(ptr)) +#define sk_POLICYQUALINFO_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_POLICYQUALINFO_sk_type(sk), ossl_check_POLICYQUALINFO_type(ptr), pnum) +#define sk_POLICYQUALINFO_sort(sk) OPENSSL_sk_sort(ossl_check_POLICYQUALINFO_sk_type(sk)) +#define sk_POLICYQUALINFO_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_POLICYQUALINFO_sk_type(sk)) +#define sk_POLICYQUALINFO_dup(sk) ((STACK_OF(POLICYQUALINFO) *)OPENSSL_sk_dup(ossl_check_const_POLICYQUALINFO_sk_type(sk))) +#define sk_POLICYQUALINFO_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(POLICYQUALINFO) *)OPENSSL_sk_deep_copy(ossl_check_const_POLICYQUALINFO_sk_type(sk), ossl_check_POLICYQUALINFO_copyfunc_type(copyfunc), ossl_check_POLICYQUALINFO_freefunc_type(freefunc))) +#define sk_POLICYQUALINFO_set_cmp_func(sk, cmp) ((sk_POLICYQUALINFO_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_POLICYQUALINFO_sk_type(sk), ossl_check_POLICYQUALINFO_compfunc_type(cmp))) + +/* clang-format on */ + +typedef struct POLICYINFO_st { + ASN1_OBJECT *policyid; + STACK_OF(POLICYQUALINFO) *qualifiers; +} POLICYINFO; + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(POLICYINFO, POLICYINFO, POLICYINFO) +#define sk_POLICYINFO_num(sk) OPENSSL_sk_num(ossl_check_const_POLICYINFO_sk_type(sk)) +#define sk_POLICYINFO_value(sk, idx) ((POLICYINFO *)OPENSSL_sk_value(ossl_check_const_POLICYINFO_sk_type(sk), (idx))) +#define sk_POLICYINFO_new(cmp) ((STACK_OF(POLICYINFO) *)OPENSSL_sk_new(ossl_check_POLICYINFO_compfunc_type(cmp))) +#define sk_POLICYINFO_new_null() ((STACK_OF(POLICYINFO) *)OPENSSL_sk_new_null()) +#define sk_POLICYINFO_new_reserve(cmp, n) ((STACK_OF(POLICYINFO) *)OPENSSL_sk_new_reserve(ossl_check_POLICYINFO_compfunc_type(cmp), (n))) +#define sk_POLICYINFO_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_POLICYINFO_sk_type(sk), (n)) +#define sk_POLICYINFO_free(sk) OPENSSL_sk_free(ossl_check_POLICYINFO_sk_type(sk)) +#define sk_POLICYINFO_zero(sk) OPENSSL_sk_zero(ossl_check_POLICYINFO_sk_type(sk)) +#define sk_POLICYINFO_delete(sk, i) ((POLICYINFO *)OPENSSL_sk_delete(ossl_check_POLICYINFO_sk_type(sk), (i))) +#define sk_POLICYINFO_delete_ptr(sk, ptr) ((POLICYINFO *)OPENSSL_sk_delete_ptr(ossl_check_POLICYINFO_sk_type(sk), ossl_check_POLICYINFO_type(ptr))) +#define sk_POLICYINFO_push(sk, ptr) OPENSSL_sk_push(ossl_check_POLICYINFO_sk_type(sk), ossl_check_POLICYINFO_type(ptr)) +#define sk_POLICYINFO_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_POLICYINFO_sk_type(sk), ossl_check_POLICYINFO_type(ptr)) +#define sk_POLICYINFO_pop(sk) ((POLICYINFO *)OPENSSL_sk_pop(ossl_check_POLICYINFO_sk_type(sk))) +#define sk_POLICYINFO_shift(sk) ((POLICYINFO *)OPENSSL_sk_shift(ossl_check_POLICYINFO_sk_type(sk))) +#define sk_POLICYINFO_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_POLICYINFO_sk_type(sk), ossl_check_POLICYINFO_freefunc_type(freefunc)) +#define sk_POLICYINFO_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_POLICYINFO_sk_type(sk), ossl_check_POLICYINFO_type(ptr), (idx)) +#define sk_POLICYINFO_set(sk, idx, ptr) ((POLICYINFO *)OPENSSL_sk_set(ossl_check_POLICYINFO_sk_type(sk), (idx), ossl_check_POLICYINFO_type(ptr))) +#define sk_POLICYINFO_find(sk, ptr) OPENSSL_sk_find(ossl_check_POLICYINFO_sk_type(sk), ossl_check_POLICYINFO_type(ptr)) +#define sk_POLICYINFO_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_POLICYINFO_sk_type(sk), ossl_check_POLICYINFO_type(ptr)) +#define sk_POLICYINFO_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_POLICYINFO_sk_type(sk), ossl_check_POLICYINFO_type(ptr), pnum) +#define sk_POLICYINFO_sort(sk) OPENSSL_sk_sort(ossl_check_POLICYINFO_sk_type(sk)) +#define sk_POLICYINFO_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_POLICYINFO_sk_type(sk)) +#define sk_POLICYINFO_dup(sk) ((STACK_OF(POLICYINFO) *)OPENSSL_sk_dup(ossl_check_const_POLICYINFO_sk_type(sk))) +#define sk_POLICYINFO_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(POLICYINFO) *)OPENSSL_sk_deep_copy(ossl_check_const_POLICYINFO_sk_type(sk), ossl_check_POLICYINFO_copyfunc_type(copyfunc), ossl_check_POLICYINFO_freefunc_type(freefunc))) +#define sk_POLICYINFO_set_cmp_func(sk, cmp) ((sk_POLICYINFO_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_POLICYINFO_sk_type(sk), ossl_check_POLICYINFO_compfunc_type(cmp))) + +/* clang-format on */ + +typedef STACK_OF(POLICYINFO) CERTIFICATEPOLICIES; + +typedef struct POLICY_MAPPING_st { + ASN1_OBJECT *issuerDomainPolicy; + ASN1_OBJECT *subjectDomainPolicy; +} POLICY_MAPPING; + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(POLICY_MAPPING, POLICY_MAPPING, POLICY_MAPPING) +#define sk_POLICY_MAPPING_num(sk) OPENSSL_sk_num(ossl_check_const_POLICY_MAPPING_sk_type(sk)) +#define sk_POLICY_MAPPING_value(sk, idx) ((POLICY_MAPPING *)OPENSSL_sk_value(ossl_check_const_POLICY_MAPPING_sk_type(sk), (idx))) +#define sk_POLICY_MAPPING_new(cmp) ((STACK_OF(POLICY_MAPPING) *)OPENSSL_sk_new(ossl_check_POLICY_MAPPING_compfunc_type(cmp))) +#define sk_POLICY_MAPPING_new_null() ((STACK_OF(POLICY_MAPPING) *)OPENSSL_sk_new_null()) +#define sk_POLICY_MAPPING_new_reserve(cmp, n) ((STACK_OF(POLICY_MAPPING) *)OPENSSL_sk_new_reserve(ossl_check_POLICY_MAPPING_compfunc_type(cmp), (n))) +#define sk_POLICY_MAPPING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_POLICY_MAPPING_sk_type(sk), (n)) +#define sk_POLICY_MAPPING_free(sk) OPENSSL_sk_free(ossl_check_POLICY_MAPPING_sk_type(sk)) +#define sk_POLICY_MAPPING_zero(sk) OPENSSL_sk_zero(ossl_check_POLICY_MAPPING_sk_type(sk)) +#define sk_POLICY_MAPPING_delete(sk, i) ((POLICY_MAPPING *)OPENSSL_sk_delete(ossl_check_POLICY_MAPPING_sk_type(sk), (i))) +#define sk_POLICY_MAPPING_delete_ptr(sk, ptr) ((POLICY_MAPPING *)OPENSSL_sk_delete_ptr(ossl_check_POLICY_MAPPING_sk_type(sk), ossl_check_POLICY_MAPPING_type(ptr))) +#define sk_POLICY_MAPPING_push(sk, ptr) OPENSSL_sk_push(ossl_check_POLICY_MAPPING_sk_type(sk), ossl_check_POLICY_MAPPING_type(ptr)) +#define sk_POLICY_MAPPING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_POLICY_MAPPING_sk_type(sk), ossl_check_POLICY_MAPPING_type(ptr)) +#define sk_POLICY_MAPPING_pop(sk) ((POLICY_MAPPING *)OPENSSL_sk_pop(ossl_check_POLICY_MAPPING_sk_type(sk))) +#define sk_POLICY_MAPPING_shift(sk) ((POLICY_MAPPING *)OPENSSL_sk_shift(ossl_check_POLICY_MAPPING_sk_type(sk))) +#define sk_POLICY_MAPPING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_POLICY_MAPPING_sk_type(sk), ossl_check_POLICY_MAPPING_freefunc_type(freefunc)) +#define sk_POLICY_MAPPING_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_POLICY_MAPPING_sk_type(sk), ossl_check_POLICY_MAPPING_type(ptr), (idx)) +#define sk_POLICY_MAPPING_set(sk, idx, ptr) ((POLICY_MAPPING *)OPENSSL_sk_set(ossl_check_POLICY_MAPPING_sk_type(sk), (idx), ossl_check_POLICY_MAPPING_type(ptr))) +#define sk_POLICY_MAPPING_find(sk, ptr) OPENSSL_sk_find(ossl_check_POLICY_MAPPING_sk_type(sk), ossl_check_POLICY_MAPPING_type(ptr)) +#define sk_POLICY_MAPPING_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_POLICY_MAPPING_sk_type(sk), ossl_check_POLICY_MAPPING_type(ptr)) +#define sk_POLICY_MAPPING_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_POLICY_MAPPING_sk_type(sk), ossl_check_POLICY_MAPPING_type(ptr), pnum) +#define sk_POLICY_MAPPING_sort(sk) OPENSSL_sk_sort(ossl_check_POLICY_MAPPING_sk_type(sk)) +#define sk_POLICY_MAPPING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_POLICY_MAPPING_sk_type(sk)) +#define sk_POLICY_MAPPING_dup(sk) ((STACK_OF(POLICY_MAPPING) *)OPENSSL_sk_dup(ossl_check_const_POLICY_MAPPING_sk_type(sk))) +#define sk_POLICY_MAPPING_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(POLICY_MAPPING) *)OPENSSL_sk_deep_copy(ossl_check_const_POLICY_MAPPING_sk_type(sk), ossl_check_POLICY_MAPPING_copyfunc_type(copyfunc), ossl_check_POLICY_MAPPING_freefunc_type(freefunc))) +#define sk_POLICY_MAPPING_set_cmp_func(sk, cmp) ((sk_POLICY_MAPPING_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_POLICY_MAPPING_sk_type(sk), ossl_check_POLICY_MAPPING_compfunc_type(cmp))) + +/* clang-format on */ + +typedef STACK_OF(POLICY_MAPPING) POLICY_MAPPINGS; + +typedef struct GENERAL_SUBTREE_st { + GENERAL_NAME *base; + ASN1_INTEGER *minimum; + ASN1_INTEGER *maximum; +} GENERAL_SUBTREE; + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(GENERAL_SUBTREE, GENERAL_SUBTREE, GENERAL_SUBTREE) +#define sk_GENERAL_SUBTREE_num(sk) OPENSSL_sk_num(ossl_check_const_GENERAL_SUBTREE_sk_type(sk)) +#define sk_GENERAL_SUBTREE_value(sk, idx) ((GENERAL_SUBTREE *)OPENSSL_sk_value(ossl_check_const_GENERAL_SUBTREE_sk_type(sk), (idx))) +#define sk_GENERAL_SUBTREE_new(cmp) ((STACK_OF(GENERAL_SUBTREE) *)OPENSSL_sk_new(ossl_check_GENERAL_SUBTREE_compfunc_type(cmp))) +#define sk_GENERAL_SUBTREE_new_null() ((STACK_OF(GENERAL_SUBTREE) *)OPENSSL_sk_new_null()) +#define sk_GENERAL_SUBTREE_new_reserve(cmp, n) ((STACK_OF(GENERAL_SUBTREE) *)OPENSSL_sk_new_reserve(ossl_check_GENERAL_SUBTREE_compfunc_type(cmp), (n))) +#define sk_GENERAL_SUBTREE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_GENERAL_SUBTREE_sk_type(sk), (n)) +#define sk_GENERAL_SUBTREE_free(sk) OPENSSL_sk_free(ossl_check_GENERAL_SUBTREE_sk_type(sk)) +#define sk_GENERAL_SUBTREE_zero(sk) OPENSSL_sk_zero(ossl_check_GENERAL_SUBTREE_sk_type(sk)) +#define sk_GENERAL_SUBTREE_delete(sk, i) ((GENERAL_SUBTREE *)OPENSSL_sk_delete(ossl_check_GENERAL_SUBTREE_sk_type(sk), (i))) +#define sk_GENERAL_SUBTREE_delete_ptr(sk, ptr) ((GENERAL_SUBTREE *)OPENSSL_sk_delete_ptr(ossl_check_GENERAL_SUBTREE_sk_type(sk), ossl_check_GENERAL_SUBTREE_type(ptr))) +#define sk_GENERAL_SUBTREE_push(sk, ptr) OPENSSL_sk_push(ossl_check_GENERAL_SUBTREE_sk_type(sk), ossl_check_GENERAL_SUBTREE_type(ptr)) +#define sk_GENERAL_SUBTREE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_GENERAL_SUBTREE_sk_type(sk), ossl_check_GENERAL_SUBTREE_type(ptr)) +#define sk_GENERAL_SUBTREE_pop(sk) ((GENERAL_SUBTREE *)OPENSSL_sk_pop(ossl_check_GENERAL_SUBTREE_sk_type(sk))) +#define sk_GENERAL_SUBTREE_shift(sk) ((GENERAL_SUBTREE *)OPENSSL_sk_shift(ossl_check_GENERAL_SUBTREE_sk_type(sk))) +#define sk_GENERAL_SUBTREE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_GENERAL_SUBTREE_sk_type(sk), ossl_check_GENERAL_SUBTREE_freefunc_type(freefunc)) +#define sk_GENERAL_SUBTREE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_GENERAL_SUBTREE_sk_type(sk), ossl_check_GENERAL_SUBTREE_type(ptr), (idx)) +#define sk_GENERAL_SUBTREE_set(sk, idx, ptr) ((GENERAL_SUBTREE *)OPENSSL_sk_set(ossl_check_GENERAL_SUBTREE_sk_type(sk), (idx), ossl_check_GENERAL_SUBTREE_type(ptr))) +#define sk_GENERAL_SUBTREE_find(sk, ptr) OPENSSL_sk_find(ossl_check_GENERAL_SUBTREE_sk_type(sk), ossl_check_GENERAL_SUBTREE_type(ptr)) +#define sk_GENERAL_SUBTREE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_GENERAL_SUBTREE_sk_type(sk), ossl_check_GENERAL_SUBTREE_type(ptr)) +#define sk_GENERAL_SUBTREE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_GENERAL_SUBTREE_sk_type(sk), ossl_check_GENERAL_SUBTREE_type(ptr), pnum) +#define sk_GENERAL_SUBTREE_sort(sk) OPENSSL_sk_sort(ossl_check_GENERAL_SUBTREE_sk_type(sk)) +#define sk_GENERAL_SUBTREE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_GENERAL_SUBTREE_sk_type(sk)) +#define sk_GENERAL_SUBTREE_dup(sk) ((STACK_OF(GENERAL_SUBTREE) *)OPENSSL_sk_dup(ossl_check_const_GENERAL_SUBTREE_sk_type(sk))) +#define sk_GENERAL_SUBTREE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(GENERAL_SUBTREE) *)OPENSSL_sk_deep_copy(ossl_check_const_GENERAL_SUBTREE_sk_type(sk), ossl_check_GENERAL_SUBTREE_copyfunc_type(copyfunc), ossl_check_GENERAL_SUBTREE_freefunc_type(freefunc))) +#define sk_GENERAL_SUBTREE_set_cmp_func(sk, cmp) ((sk_GENERAL_SUBTREE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_GENERAL_SUBTREE_sk_type(sk), ossl_check_GENERAL_SUBTREE_compfunc_type(cmp))) + +/* clang-format on */ + +struct NAME_CONSTRAINTS_st { + STACK_OF(GENERAL_SUBTREE) *permittedSubtrees; + STACK_OF(GENERAL_SUBTREE) *excludedSubtrees; +}; + +typedef struct POLICY_CONSTRAINTS_st { + ASN1_INTEGER *requireExplicitPolicy; + ASN1_INTEGER *inhibitPolicyMapping; +} POLICY_CONSTRAINTS; + +/* Proxy certificate structures, see RFC 3820 */ +typedef struct PROXY_POLICY_st { + ASN1_OBJECT *policyLanguage; + ASN1_OCTET_STRING *policy; +} PROXY_POLICY; + +typedef struct PROXY_CERT_INFO_EXTENSION_st { + ASN1_INTEGER *pcPathLengthConstraint; + PROXY_POLICY *proxyPolicy; +} PROXY_CERT_INFO_EXTENSION; + +DECLARE_ASN1_FUNCTIONS(PROXY_POLICY) +DECLARE_ASN1_FUNCTIONS(PROXY_CERT_INFO_EXTENSION) + +struct ISSUING_DIST_POINT_st { + DIST_POINT_NAME *distpoint; + int onlyuser; + int onlyCA; + ASN1_BIT_STRING *onlysomereasons; + int indirectCRL; + int onlyattr; +}; + +/* Values in idp_flags field */ +/* IDP present */ +#define IDP_PRESENT 0x1 +/* IDP values inconsistent */ +#define IDP_INVALID 0x2 +/* onlyuser true */ +#define IDP_ONLYUSER 0x4 +/* onlyCA true */ +#define IDP_ONLYCA 0x8 +/* onlyattr true */ +#define IDP_ONLYATTR 0x10 +/* indirectCRL true */ +#define IDP_INDIRECT 0x20 +/* onlysomereasons present */ +#define IDP_REASONS 0x40 + +#define X509V3_conf_err(val) ERR_add_error_data(6, \ + "section:", (val)->section, \ + ",name:", (val)->name, ",value:", (val)->value) + +#define X509V3_set_ctx_test(ctx) \ + X509V3_set_ctx(ctx, NULL, NULL, NULL, NULL, X509V3_CTX_TEST) +#define X509V3_set_ctx_nodb(ctx) (ctx)->db = NULL; + +#define EXT_BITSTRING(nid, table) { nid, 0, ASN1_ITEM_ref(ASN1_BIT_STRING), \ + 0, 0, 0, 0, \ + 0, 0, \ + (X509V3_EXT_I2V)i2v_ASN1_BIT_STRING, \ + (X509V3_EXT_V2I)v2i_ASN1_BIT_STRING, \ + NULL, NULL, \ + table } + +#define EXT_IA5STRING(nid) { nid, 0, ASN1_ITEM_ref(ASN1_IA5STRING), \ + 0, 0, 0, 0, \ + (X509V3_EXT_I2S)i2s_ASN1_IA5STRING, \ + (X509V3_EXT_S2I)s2i_ASN1_IA5STRING, \ + 0, 0, 0, 0, \ + NULL } + +#define EXT_UTF8STRING(nid) { nid, 0, ASN1_ITEM_ref(ASN1_UTF8STRING), \ + 0, 0, 0, 0, \ + (X509V3_EXT_I2S)i2s_ASN1_UTF8STRING, \ + (X509V3_EXT_S2I)s2i_ASN1_UTF8STRING, \ + 0, 0, 0, 0, \ + NULL } + +/* clang-format off */ +# define EXT_END { -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} +/* clang-format on */ + +/* X509_PURPOSE stuff */ + +#define EXFLAG_BCONS 0x1 +#define EXFLAG_KUSAGE 0x2 +#define EXFLAG_XKUSAGE 0x4 +#define EXFLAG_NSCERT 0x8 + +#define EXFLAG_CA 0x10 +#define EXFLAG_SI 0x20 /* self-issued, maybe not self-signed */ +#define EXFLAG_V1 0x40 +#define EXFLAG_INVALID 0x80 +/* EXFLAG_SET is set to indicate that some values have been precomputed */ +#define EXFLAG_SET 0x100 +#define EXFLAG_CRITICAL 0x200 +#define EXFLAG_PROXY 0x400 + +#define EXFLAG_INVALID_POLICY 0x800 +#define EXFLAG_FRESHEST 0x1000 +#define EXFLAG_SS 0x2000 /* cert is apparently self-signed */ + +#define EXFLAG_BCONS_CRITICAL 0x10000 +#define EXFLAG_AKID_CRITICAL 0x20000 +#define EXFLAG_SKID_CRITICAL 0x40000 +#define EXFLAG_SAN_CRITICAL 0x80000 +#define EXFLAG_NO_FINGERPRINT 0x100000 + +/* https://datatracker.ietf.org/doc/html/rfc5280#section-4.2.1.3 */ +#define KU_DIGITAL_SIGNATURE X509v3_KU_DIGITAL_SIGNATURE +#define KU_NON_REPUDIATION X509v3_KU_NON_REPUDIATION +#define KU_KEY_ENCIPHERMENT X509v3_KU_KEY_ENCIPHERMENT +#define KU_DATA_ENCIPHERMENT X509v3_KU_DATA_ENCIPHERMENT +#define KU_KEY_AGREEMENT X509v3_KU_KEY_AGREEMENT +#define KU_KEY_CERT_SIGN X509v3_KU_KEY_CERT_SIGN +#define KU_CRL_SIGN X509v3_KU_CRL_SIGN +#define KU_ENCIPHER_ONLY X509v3_KU_ENCIPHER_ONLY +#define KU_DECIPHER_ONLY X509v3_KU_DECIPHER_ONLY + +#define NS_SSL_CLIENT 0x80 +#define NS_SSL_SERVER 0x40 +#define NS_SMIME 0x20 +#define NS_OBJSIGN 0x10 +#define NS_SSL_CA 0x04 +#define NS_SMIME_CA 0x02 +#define NS_OBJSIGN_CA 0x01 +#define NS_ANY_CA (NS_SSL_CA | NS_SMIME_CA | NS_OBJSIGN_CA) + +#define XKU_SSL_SERVER 0x1 +#define XKU_SSL_CLIENT 0x2 +#define XKU_SMIME 0x4 +#define XKU_CODE_SIGN 0x8 +#define XKU_SGC 0x10 /* Netscape or MS Server-Gated Crypto */ +#define XKU_OCSP_SIGN 0x20 +#define XKU_TIMESTAMP 0x40 +#define XKU_DVCS 0x80 +#define XKU_ANYEKU 0x100 + +#define X509_PURPOSE_DYNAMIC 0x1 +#define X509_PURPOSE_DYNAMIC_NAME 0x2 + +typedef struct x509_purpose_st { + int purpose; + int trust; /* Default trust ID */ + int flags; + int (*check_purpose)(const struct x509_purpose_st *, const X509 *, int); + char *name; + char *sname; + void *usr_data; +} X509_PURPOSE; + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(X509_PURPOSE, X509_PURPOSE, X509_PURPOSE) +#define sk_X509_PURPOSE_num(sk) OPENSSL_sk_num(ossl_check_const_X509_PURPOSE_sk_type(sk)) +#define sk_X509_PURPOSE_value(sk, idx) ((X509_PURPOSE *)OPENSSL_sk_value(ossl_check_const_X509_PURPOSE_sk_type(sk), (idx))) +#define sk_X509_PURPOSE_new(cmp) ((STACK_OF(X509_PURPOSE) *)OPENSSL_sk_new(ossl_check_X509_PURPOSE_compfunc_type(cmp))) +#define sk_X509_PURPOSE_new_null() ((STACK_OF(X509_PURPOSE) *)OPENSSL_sk_new_null()) +#define sk_X509_PURPOSE_new_reserve(cmp, n) ((STACK_OF(X509_PURPOSE) *)OPENSSL_sk_new_reserve(ossl_check_X509_PURPOSE_compfunc_type(cmp), (n))) +#define sk_X509_PURPOSE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_PURPOSE_sk_type(sk), (n)) +#define sk_X509_PURPOSE_free(sk) OPENSSL_sk_free(ossl_check_X509_PURPOSE_sk_type(sk)) +#define sk_X509_PURPOSE_zero(sk) OPENSSL_sk_zero(ossl_check_X509_PURPOSE_sk_type(sk)) +#define sk_X509_PURPOSE_delete(sk, i) ((X509_PURPOSE *)OPENSSL_sk_delete(ossl_check_X509_PURPOSE_sk_type(sk), (i))) +#define sk_X509_PURPOSE_delete_ptr(sk, ptr) ((X509_PURPOSE *)OPENSSL_sk_delete_ptr(ossl_check_X509_PURPOSE_sk_type(sk), ossl_check_X509_PURPOSE_type(ptr))) +#define sk_X509_PURPOSE_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_PURPOSE_sk_type(sk), ossl_check_X509_PURPOSE_type(ptr)) +#define sk_X509_PURPOSE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_PURPOSE_sk_type(sk), ossl_check_X509_PURPOSE_type(ptr)) +#define sk_X509_PURPOSE_pop(sk) ((X509_PURPOSE *)OPENSSL_sk_pop(ossl_check_X509_PURPOSE_sk_type(sk))) +#define sk_X509_PURPOSE_shift(sk) ((X509_PURPOSE *)OPENSSL_sk_shift(ossl_check_X509_PURPOSE_sk_type(sk))) +#define sk_X509_PURPOSE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_PURPOSE_sk_type(sk), ossl_check_X509_PURPOSE_freefunc_type(freefunc)) +#define sk_X509_PURPOSE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_PURPOSE_sk_type(sk), ossl_check_X509_PURPOSE_type(ptr), (idx)) +#define sk_X509_PURPOSE_set(sk, idx, ptr) ((X509_PURPOSE *)OPENSSL_sk_set(ossl_check_X509_PURPOSE_sk_type(sk), (idx), ossl_check_X509_PURPOSE_type(ptr))) +#define sk_X509_PURPOSE_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_PURPOSE_sk_type(sk), ossl_check_X509_PURPOSE_type(ptr)) +#define sk_X509_PURPOSE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_PURPOSE_sk_type(sk), ossl_check_X509_PURPOSE_type(ptr)) +#define sk_X509_PURPOSE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_PURPOSE_sk_type(sk), ossl_check_X509_PURPOSE_type(ptr), pnum) +#define sk_X509_PURPOSE_sort(sk) OPENSSL_sk_sort(ossl_check_X509_PURPOSE_sk_type(sk)) +#define sk_X509_PURPOSE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_PURPOSE_sk_type(sk)) +#define sk_X509_PURPOSE_dup(sk) ((STACK_OF(X509_PURPOSE) *)OPENSSL_sk_dup(ossl_check_const_X509_PURPOSE_sk_type(sk))) +#define sk_X509_PURPOSE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_PURPOSE) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_PURPOSE_sk_type(sk), ossl_check_X509_PURPOSE_copyfunc_type(copyfunc), ossl_check_X509_PURPOSE_freefunc_type(freefunc))) +#define sk_X509_PURPOSE_set_cmp_func(sk, cmp) ((sk_X509_PURPOSE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_PURPOSE_sk_type(sk), ossl_check_X509_PURPOSE_compfunc_type(cmp))) + +/* clang-format on */ + +#define X509_PURPOSE_DEFAULT_ANY 0 +#define X509_PURPOSE_SSL_CLIENT 1 +#define X509_PURPOSE_SSL_SERVER 2 +#define X509_PURPOSE_NS_SSL_SERVER 3 +#define X509_PURPOSE_SMIME_SIGN 4 +#define X509_PURPOSE_SMIME_ENCRYPT 5 +#define X509_PURPOSE_CRL_SIGN 6 +#define X509_PURPOSE_ANY 7 +#define X509_PURPOSE_OCSP_HELPER 8 +#define X509_PURPOSE_TIMESTAMP_SIGN 9 +#define X509_PURPOSE_CODE_SIGN 10 + +#define X509_PURPOSE_MIN 1 +#define X509_PURPOSE_MAX 10 + +/* Flags for X509V3_EXT_print() */ + +#define X509V3_EXT_UNKNOWN_MASK (0xfL << 16) +/* Return error for unknown extensions */ +#define X509V3_EXT_DEFAULT 0 +/* Print error for unknown extensions */ +#define X509V3_EXT_ERROR_UNKNOWN (1L << 16) +/* ASN1 parse unknown extensions */ +#define X509V3_EXT_PARSE_UNKNOWN (2L << 16) +/* BIO_dump unknown extensions */ +#define X509V3_EXT_DUMP_UNKNOWN (3L << 16) + +/* Flags for X509V3_add1_i2d */ + +#define X509V3_ADD_OP_MASK 0xfL +#define X509V3_ADD_DEFAULT 0L +#define X509V3_ADD_APPEND 1L +#define X509V3_ADD_REPLACE 2L +#define X509V3_ADD_REPLACE_EXISTING 3L +#define X509V3_ADD_KEEP_EXISTING 4L +#define X509V3_ADD_DELETE 5L +#define X509V3_ADD_SILENT 0x10 + +DECLARE_ASN1_FUNCTIONS(BASIC_CONSTRAINTS) +DECLARE_ASN1_FUNCTIONS(OSSL_BASIC_ATTR_CONSTRAINTS) + +DECLARE_ASN1_FUNCTIONS(SXNET) +DECLARE_ASN1_FUNCTIONS(SXNETID) + +DECLARE_ASN1_FUNCTIONS(ISSUER_SIGN_TOOL) + +int SXNET_add_id_asc(SXNET **psx, const char *zone, const char *user, int userlen); +int SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, const char *user, + int userlen); +int SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *izone, const char *user, + int userlen); + +ASN1_OCTET_STRING *SXNET_get_id_asc(SXNET *sx, const char *zone); +ASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone); +ASN1_OCTET_STRING *SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone); + +DECLARE_ASN1_FUNCTIONS(AUTHORITY_KEYID) + +DECLARE_ASN1_FUNCTIONS(PKEY_USAGE_PERIOD) + +DECLARE_ASN1_FUNCTIONS(GENERAL_NAME) +DECLARE_ASN1_DUP_FUNCTION(GENERAL_NAME) +int GENERAL_NAME_cmp(GENERAL_NAME *a, GENERAL_NAME *b); + +ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, + STACK_OF(CONF_VALUE) *nval); +STACK_OF(CONF_VALUE) *i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, + ASN1_BIT_STRING *bits, + STACK_OF(CONF_VALUE) *extlist); +char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method, ASN1_IA5STRING *ia5); +ASN1_IA5STRING *s2i_ASN1_IA5STRING(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, const char *str); +char *i2s_ASN1_UTF8STRING(X509V3_EXT_METHOD *method, ASN1_UTF8STRING *utf8); +ASN1_UTF8STRING *s2i_ASN1_UTF8STRING(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, const char *str); + +STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method, + GENERAL_NAME *gen, + STACK_OF(CONF_VALUE) *ret); +int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen); + +DECLARE_ASN1_FUNCTIONS(GENERAL_NAMES) + +STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method, + GENERAL_NAMES *gen, + STACK_OF(CONF_VALUE) *extlist); +GENERAL_NAMES *v2i_GENERAL_NAMES(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); + +DECLARE_ASN1_FUNCTIONS(OTHERNAME) +DECLARE_ASN1_FUNCTIONS(EDIPARTYNAME) +int OTHERNAME_cmp(OTHERNAME *a, OTHERNAME *b); +void GENERAL_NAME_set0_value(GENERAL_NAME *a, int type, void *value); +void *GENERAL_NAME_get0_value(const GENERAL_NAME *a, int *ptype); +int GENERAL_NAME_set0_othername(GENERAL_NAME *gen, + ASN1_OBJECT *oid, ASN1_TYPE *value); +int GENERAL_NAME_get0_otherName(const GENERAL_NAME *gen, + ASN1_OBJECT **poid, ASN1_TYPE **pvalue); + +char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, + const ASN1_OCTET_STRING *ia5); +ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, const char *str); + +DECLARE_ASN1_FUNCTIONS(EXTENDED_KEY_USAGE) +int i2a_ACCESS_DESCRIPTION(BIO *bp, const ACCESS_DESCRIPTION *a); + +DECLARE_ASN1_ALLOC_FUNCTIONS(TLS_FEATURE) + +DECLARE_ASN1_FUNCTIONS(CERTIFICATEPOLICIES) +DECLARE_ASN1_FUNCTIONS(POLICYINFO) +DECLARE_ASN1_FUNCTIONS(POLICYQUALINFO) +DECLARE_ASN1_FUNCTIONS(USERNOTICE) +DECLARE_ASN1_FUNCTIONS(NOTICEREF) + +DECLARE_ASN1_FUNCTIONS(CRL_DIST_POINTS) +DECLARE_ASN1_FUNCTIONS(DIST_POINT) +DECLARE_ASN1_FUNCTIONS(DIST_POINT_NAME) +DECLARE_ASN1_FUNCTIONS(ISSUING_DIST_POINT) + +int DIST_POINT_set_dpname(DIST_POINT_NAME *dpn, const X509_NAME *iname); + +int NAME_CONSTRAINTS_check(X509 *x, NAME_CONSTRAINTS *nc); +int NAME_CONSTRAINTS_check_CN(X509 *x, NAME_CONSTRAINTS *nc); + +DECLARE_ASN1_FUNCTIONS(ACCESS_DESCRIPTION) +DECLARE_ASN1_FUNCTIONS(AUTHORITY_INFO_ACCESS) + +DECLARE_ASN1_ITEM(POLICY_MAPPING) +DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_MAPPING) +DECLARE_ASN1_ITEM(POLICY_MAPPINGS) + +DECLARE_ASN1_ITEM(GENERAL_SUBTREE) +DECLARE_ASN1_ALLOC_FUNCTIONS(GENERAL_SUBTREE) + +DECLARE_ASN1_ITEM(NAME_CONSTRAINTS) +DECLARE_ASN1_ALLOC_FUNCTIONS(NAME_CONSTRAINTS) + +DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_CONSTRAINTS) +DECLARE_ASN1_ITEM(POLICY_CONSTRAINTS) + +GENERAL_NAME *a2i_GENERAL_NAME(GENERAL_NAME *out, + const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, int gen_type, + const char *value, int is_nc); + +#ifdef OPENSSL_CONF_H +GENERAL_NAME *v2i_GENERAL_NAME(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, CONF_VALUE *cnf); +GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out, + const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, CONF_VALUE *cnf, + int is_nc); + +void X509V3_conf_free(CONF_VALUE *val); + +X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid, + const char *value); +X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, const char *name, + const char *value); +int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, const char *section, + STACK_OF(X509_EXTENSION) **sk); +int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, const char *section, + X509 *cert); +int X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, const char *section, + X509_REQ *req); +int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, const char *section, + X509_CRL *crl); + +X509_EXTENSION *X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf, + X509V3_CTX *ctx, int ext_nid, + const char *value); +X509_EXTENSION *X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, + const char *name, const char *value); +int X509V3_EXT_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, + const char *section, X509 *cert); +int X509V3_EXT_REQ_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, + const char *section, X509_REQ *req); +int X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, + const char *section, X509_CRL *crl); + +int X509V3_add_value_bool_nf(const char *name, int asn1_bool, + STACK_OF(CONF_VALUE) **extlist); +int X509V3_get_value_bool(const CONF_VALUE *value, int *asn1_bool); +int X509V3_get_value_int(const CONF_VALUE *value, ASN1_INTEGER **aint); +void X509V3_set_nconf(X509V3_CTX *ctx, CONF *conf); +void X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH_OF(CONF_VALUE) *lhash); +#endif + +char *X509V3_get_string(X509V3_CTX *ctx, const char *name, const char *section); +STACK_OF(CONF_VALUE) *X509V3_get_section(X509V3_CTX *ctx, const char *section); +void X509V3_string_free(X509V3_CTX *ctx, char *str); +void X509V3_section_free(X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *section); +void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subject, + X509_REQ *req, X509_CRL *crl, int flags); +/* For API backward compatibility, this is separate from X509V3_set_ctx(): */ +int X509V3_set_issuer_pkey(X509V3_CTX *ctx, EVP_PKEY *pkey); + +int X509V3_add_value(const char *name, const char *value, + STACK_OF(CONF_VALUE) **extlist); +int X509V3_add_value_uchar(const char *name, const unsigned char *value, + STACK_OF(CONF_VALUE) **extlist); +int X509V3_add_value_bool(const char *name, int asn1_bool, + STACK_OF(CONF_VALUE) **extlist); +int X509V3_add_value_int(const char *name, const ASN1_INTEGER *aint, + STACK_OF(CONF_VALUE) **extlist); +char *i2s_ASN1_INTEGER(X509V3_EXT_METHOD *meth, const ASN1_INTEGER *aint); +ASN1_INTEGER *s2i_ASN1_INTEGER(X509V3_EXT_METHOD *meth, const char *value); +char *i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *meth, const ASN1_ENUMERATED *aint); +char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *meth, + const ASN1_ENUMERATED *aint); +int X509V3_EXT_add(X509V3_EXT_METHOD *ext); +int X509V3_EXT_add_list(X509V3_EXT_METHOD *extlist); +int X509V3_EXT_add_alias(int nid_to, int nid_from); +void X509V3_EXT_cleanup(void); + +const X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext); +const X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid); +int X509V3_add_standard_extensions(void); +STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line); +void *X509V3_EXT_d2i(X509_EXTENSION *ext); +void *X509V3_get_d2i(const STACK_OF(X509_EXTENSION) *x, int nid, int *crit, + int *idx); + +X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc); +int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value, + int crit, unsigned long flags); + +#ifndef OPENSSL_NO_DEPRECATED_1_1_0 +/* The new declarations are in crypto.h, but the old ones were here. */ +#define hex_to_string OPENSSL_buf2hexstr +#define string_to_hex OPENSSL_hexstr2buf +#endif + +void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent, + int ml); +int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, + int indent); +#ifndef OPENSSL_NO_STDIO +int X509V3_EXT_print_fp(FILE *out, X509_EXTENSION *ext, int flag, int indent); +#endif +int X509V3_extensions_print(BIO *out, const char *title, + const STACK_OF(X509_EXTENSION) *exts, + unsigned long flag, int indent); + +int X509_check_ca(X509 *x); +int X509_check_purpose(X509 *x, int id, int ca); +int X509_supported_extension(X509_EXTENSION *ex); +int X509_check_issued(X509 *issuer, X509 *subject); +int X509_check_akid(const X509 *issuer, const AUTHORITY_KEYID *akid); +void X509_set_proxy_flag(X509 *x); +void X509_set_proxy_pathlen(X509 *x, long l); +long X509_get_proxy_pathlen(X509 *x); + +uint32_t X509_get_extension_flags(X509 *x); +uint32_t X509_get_key_usage(X509 *x); +uint32_t X509_get_extended_key_usage(X509 *x); +const ASN1_OCTET_STRING *X509_get0_subject_key_id(X509 *x); +const ASN1_OCTET_STRING *X509_get0_authority_key_id(X509 *x); +const GENERAL_NAMES *X509_get0_authority_issuer(X509 *x); +const ASN1_INTEGER *X509_get0_authority_serial(X509 *x); + +int X509_PURPOSE_get_count(void); +int X509_PURPOSE_get_unused_id(OSSL_LIB_CTX *libctx); +int X509_PURPOSE_get_by_sname(const char *sname); +int X509_PURPOSE_get_by_id(int id); +int X509_PURPOSE_add(int id, int trust, int flags, + int (*ck)(const X509_PURPOSE *, const X509 *, int), + const char *name, const char *sname, void *arg); +void X509_PURPOSE_cleanup(void); + +X509_PURPOSE *X509_PURPOSE_get0(int idx); +int X509_PURPOSE_get_id(const X509_PURPOSE *); +char *X509_PURPOSE_get0_name(const X509_PURPOSE *xp); +char *X509_PURPOSE_get0_sname(const X509_PURPOSE *xp); +int X509_PURPOSE_get_trust(const X509_PURPOSE *xp); +int X509_PURPOSE_set(int *p, int purpose); + +STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x); +STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x); +void X509_email_free(STACK_OF(OPENSSL_STRING) *sk); +STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x); + +/* Flags for X509_check_* functions */ + +/* + * Always check subject name for host match even if subject alt names present + */ +#define X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT 0x1 +/* Disable wildcard matching for dnsName fields and common name. */ +#define X509_CHECK_FLAG_NO_WILDCARDS 0x2 +/* Wildcards must not match a partial label. */ +#define X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS 0x4 +/* Allow (non-partial) wildcards to match multiple labels. */ +#define X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS 0x8 +/* Constraint verifier subdomain patterns to match a single labels. */ +#define X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS 0x10 +/* Never check the subject CN */ +#define X509_CHECK_FLAG_NEVER_CHECK_SUBJECT 0x20 +/* + * Match reference identifiers starting with "." to any sub-domain. + * This is a non-public flag, turned on implicitly when the subject + * reference identity is a DNS name. + */ +#define _X509_CHECK_FLAG_DOT_SUBDOMAINS 0x8000 + +int X509_check_host(X509 *x, const char *chk, size_t chklen, + unsigned int flags, char **peername); +int X509_check_email(X509 *x, const char *chk, size_t chklen, + unsigned int flags); +int X509_check_ip(X509 *x, const unsigned char *chk, size_t chklen, + unsigned int flags); +int X509_check_ip_asc(X509 *x, const char *ipasc, unsigned int flags); + +ASN1_OCTET_STRING *a2i_IPADDRESS(const char *ipasc); +ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc); +int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF(CONF_VALUE) *dn_sk, + unsigned long chtype); + +void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent); +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(X509_POLICY_NODE, X509_POLICY_NODE, X509_POLICY_NODE) +#define sk_X509_POLICY_NODE_num(sk) OPENSSL_sk_num(ossl_check_const_X509_POLICY_NODE_sk_type(sk)) +#define sk_X509_POLICY_NODE_value(sk, idx) ((X509_POLICY_NODE *)OPENSSL_sk_value(ossl_check_const_X509_POLICY_NODE_sk_type(sk), (idx))) +#define sk_X509_POLICY_NODE_new(cmp) ((STACK_OF(X509_POLICY_NODE) *)OPENSSL_sk_new(ossl_check_X509_POLICY_NODE_compfunc_type(cmp))) +#define sk_X509_POLICY_NODE_new_null() ((STACK_OF(X509_POLICY_NODE) *)OPENSSL_sk_new_null()) +#define sk_X509_POLICY_NODE_new_reserve(cmp, n) ((STACK_OF(X509_POLICY_NODE) *)OPENSSL_sk_new_reserve(ossl_check_X509_POLICY_NODE_compfunc_type(cmp), (n))) +#define sk_X509_POLICY_NODE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_POLICY_NODE_sk_type(sk), (n)) +#define sk_X509_POLICY_NODE_free(sk) OPENSSL_sk_free(ossl_check_X509_POLICY_NODE_sk_type(sk)) +#define sk_X509_POLICY_NODE_zero(sk) OPENSSL_sk_zero(ossl_check_X509_POLICY_NODE_sk_type(sk)) +#define sk_X509_POLICY_NODE_delete(sk, i) ((X509_POLICY_NODE *)OPENSSL_sk_delete(ossl_check_X509_POLICY_NODE_sk_type(sk), (i))) +#define sk_X509_POLICY_NODE_delete_ptr(sk, ptr) ((X509_POLICY_NODE *)OPENSSL_sk_delete_ptr(ossl_check_X509_POLICY_NODE_sk_type(sk), ossl_check_X509_POLICY_NODE_type(ptr))) +#define sk_X509_POLICY_NODE_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_POLICY_NODE_sk_type(sk), ossl_check_X509_POLICY_NODE_type(ptr)) +#define sk_X509_POLICY_NODE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_POLICY_NODE_sk_type(sk), ossl_check_X509_POLICY_NODE_type(ptr)) +#define sk_X509_POLICY_NODE_pop(sk) ((X509_POLICY_NODE *)OPENSSL_sk_pop(ossl_check_X509_POLICY_NODE_sk_type(sk))) +#define sk_X509_POLICY_NODE_shift(sk) ((X509_POLICY_NODE *)OPENSSL_sk_shift(ossl_check_X509_POLICY_NODE_sk_type(sk))) +#define sk_X509_POLICY_NODE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_POLICY_NODE_sk_type(sk), ossl_check_X509_POLICY_NODE_freefunc_type(freefunc)) +#define sk_X509_POLICY_NODE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_POLICY_NODE_sk_type(sk), ossl_check_X509_POLICY_NODE_type(ptr), (idx)) +#define sk_X509_POLICY_NODE_set(sk, idx, ptr) ((X509_POLICY_NODE *)OPENSSL_sk_set(ossl_check_X509_POLICY_NODE_sk_type(sk), (idx), ossl_check_X509_POLICY_NODE_type(ptr))) +#define sk_X509_POLICY_NODE_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_POLICY_NODE_sk_type(sk), ossl_check_X509_POLICY_NODE_type(ptr)) +#define sk_X509_POLICY_NODE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_POLICY_NODE_sk_type(sk), ossl_check_X509_POLICY_NODE_type(ptr)) +#define sk_X509_POLICY_NODE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_POLICY_NODE_sk_type(sk), ossl_check_X509_POLICY_NODE_type(ptr), pnum) +#define sk_X509_POLICY_NODE_sort(sk) OPENSSL_sk_sort(ossl_check_X509_POLICY_NODE_sk_type(sk)) +#define sk_X509_POLICY_NODE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_POLICY_NODE_sk_type(sk)) +#define sk_X509_POLICY_NODE_dup(sk) ((STACK_OF(X509_POLICY_NODE) *)OPENSSL_sk_dup(ossl_check_const_X509_POLICY_NODE_sk_type(sk))) +#define sk_X509_POLICY_NODE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_POLICY_NODE) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_POLICY_NODE_sk_type(sk), ossl_check_X509_POLICY_NODE_copyfunc_type(copyfunc), ossl_check_X509_POLICY_NODE_freefunc_type(freefunc))) +#define sk_X509_POLICY_NODE_set_cmp_func(sk, cmp) ((sk_X509_POLICY_NODE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_POLICY_NODE_sk_type(sk), ossl_check_X509_POLICY_NODE_compfunc_type(cmp))) + +/* clang-format on */ + +#ifndef OPENSSL_NO_RFC3779 +typedef struct ASRange_st { + ASN1_INTEGER *min, *max; +} ASRange; + +#define ASIdOrRange_id 0 +#define ASIdOrRange_range 1 + +typedef struct ASIdOrRange_st { + int type; + union { + ASN1_INTEGER *id; + ASRange *range; + } u; +} ASIdOrRange; + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(ASIdOrRange, ASIdOrRange, ASIdOrRange) +#define sk_ASIdOrRange_num(sk) OPENSSL_sk_num(ossl_check_const_ASIdOrRange_sk_type(sk)) +#define sk_ASIdOrRange_value(sk, idx) ((ASIdOrRange *)OPENSSL_sk_value(ossl_check_const_ASIdOrRange_sk_type(sk), (idx))) +#define sk_ASIdOrRange_new(cmp) ((STACK_OF(ASIdOrRange) *)OPENSSL_sk_new(ossl_check_ASIdOrRange_compfunc_type(cmp))) +#define sk_ASIdOrRange_new_null() ((STACK_OF(ASIdOrRange) *)OPENSSL_sk_new_null()) +#define sk_ASIdOrRange_new_reserve(cmp, n) ((STACK_OF(ASIdOrRange) *)OPENSSL_sk_new_reserve(ossl_check_ASIdOrRange_compfunc_type(cmp), (n))) +#define sk_ASIdOrRange_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASIdOrRange_sk_type(sk), (n)) +#define sk_ASIdOrRange_free(sk) OPENSSL_sk_free(ossl_check_ASIdOrRange_sk_type(sk)) +#define sk_ASIdOrRange_zero(sk) OPENSSL_sk_zero(ossl_check_ASIdOrRange_sk_type(sk)) +#define sk_ASIdOrRange_delete(sk, i) ((ASIdOrRange *)OPENSSL_sk_delete(ossl_check_ASIdOrRange_sk_type(sk), (i))) +#define sk_ASIdOrRange_delete_ptr(sk, ptr) ((ASIdOrRange *)OPENSSL_sk_delete_ptr(ossl_check_ASIdOrRange_sk_type(sk), ossl_check_ASIdOrRange_type(ptr))) +#define sk_ASIdOrRange_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASIdOrRange_sk_type(sk), ossl_check_ASIdOrRange_type(ptr)) +#define sk_ASIdOrRange_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASIdOrRange_sk_type(sk), ossl_check_ASIdOrRange_type(ptr)) +#define sk_ASIdOrRange_pop(sk) ((ASIdOrRange *)OPENSSL_sk_pop(ossl_check_ASIdOrRange_sk_type(sk))) +#define sk_ASIdOrRange_shift(sk) ((ASIdOrRange *)OPENSSL_sk_shift(ossl_check_ASIdOrRange_sk_type(sk))) +#define sk_ASIdOrRange_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASIdOrRange_sk_type(sk), ossl_check_ASIdOrRange_freefunc_type(freefunc)) +#define sk_ASIdOrRange_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASIdOrRange_sk_type(sk), ossl_check_ASIdOrRange_type(ptr), (idx)) +#define sk_ASIdOrRange_set(sk, idx, ptr) ((ASIdOrRange *)OPENSSL_sk_set(ossl_check_ASIdOrRange_sk_type(sk), (idx), ossl_check_ASIdOrRange_type(ptr))) +#define sk_ASIdOrRange_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASIdOrRange_sk_type(sk), ossl_check_ASIdOrRange_type(ptr)) +#define sk_ASIdOrRange_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASIdOrRange_sk_type(sk), ossl_check_ASIdOrRange_type(ptr)) +#define sk_ASIdOrRange_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASIdOrRange_sk_type(sk), ossl_check_ASIdOrRange_type(ptr), pnum) +#define sk_ASIdOrRange_sort(sk) OPENSSL_sk_sort(ossl_check_ASIdOrRange_sk_type(sk)) +#define sk_ASIdOrRange_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASIdOrRange_sk_type(sk)) +#define sk_ASIdOrRange_dup(sk) ((STACK_OF(ASIdOrRange) *)OPENSSL_sk_dup(ossl_check_const_ASIdOrRange_sk_type(sk))) +#define sk_ASIdOrRange_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASIdOrRange) *)OPENSSL_sk_deep_copy(ossl_check_const_ASIdOrRange_sk_type(sk), ossl_check_ASIdOrRange_copyfunc_type(copyfunc), ossl_check_ASIdOrRange_freefunc_type(freefunc))) +#define sk_ASIdOrRange_set_cmp_func(sk, cmp) ((sk_ASIdOrRange_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASIdOrRange_sk_type(sk), ossl_check_ASIdOrRange_compfunc_type(cmp))) + +/* clang-format on */ + +typedef STACK_OF(ASIdOrRange) ASIdOrRanges; + +#define ASIdentifierChoice_inherit 0 +#define ASIdentifierChoice_asIdsOrRanges 1 + +typedef struct ASIdentifierChoice_st { + int type; + union { + ASN1_NULL *inherit; + ASIdOrRanges *asIdsOrRanges; + } u; +} ASIdentifierChoice; + +typedef struct ASIdentifiers_st { + ASIdentifierChoice *asnum, *rdi; +} ASIdentifiers; + +DECLARE_ASN1_FUNCTIONS(ASRange) +DECLARE_ASN1_FUNCTIONS(ASIdOrRange) +DECLARE_ASN1_FUNCTIONS(ASIdentifierChoice) +DECLARE_ASN1_FUNCTIONS(ASIdentifiers) + +typedef struct IPAddressRange_st { + ASN1_BIT_STRING *min, *max; +} IPAddressRange; + +#define IPAddressOrRange_addressPrefix 0 +#define IPAddressOrRange_addressRange 1 + +typedef struct IPAddressOrRange_st { + int type; + union { + ASN1_BIT_STRING *addressPrefix; + IPAddressRange *addressRange; + } u; +} IPAddressOrRange; + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(IPAddressOrRange, IPAddressOrRange, IPAddressOrRange) +#define sk_IPAddressOrRange_num(sk) OPENSSL_sk_num(ossl_check_const_IPAddressOrRange_sk_type(sk)) +#define sk_IPAddressOrRange_value(sk, idx) ((IPAddressOrRange *)OPENSSL_sk_value(ossl_check_const_IPAddressOrRange_sk_type(sk), (idx))) +#define sk_IPAddressOrRange_new(cmp) ((STACK_OF(IPAddressOrRange) *)OPENSSL_sk_new(ossl_check_IPAddressOrRange_compfunc_type(cmp))) +#define sk_IPAddressOrRange_new_null() ((STACK_OF(IPAddressOrRange) *)OPENSSL_sk_new_null()) +#define sk_IPAddressOrRange_new_reserve(cmp, n) ((STACK_OF(IPAddressOrRange) *)OPENSSL_sk_new_reserve(ossl_check_IPAddressOrRange_compfunc_type(cmp), (n))) +#define sk_IPAddressOrRange_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_IPAddressOrRange_sk_type(sk), (n)) +#define sk_IPAddressOrRange_free(sk) OPENSSL_sk_free(ossl_check_IPAddressOrRange_sk_type(sk)) +#define sk_IPAddressOrRange_zero(sk) OPENSSL_sk_zero(ossl_check_IPAddressOrRange_sk_type(sk)) +#define sk_IPAddressOrRange_delete(sk, i) ((IPAddressOrRange *)OPENSSL_sk_delete(ossl_check_IPAddressOrRange_sk_type(sk), (i))) +#define sk_IPAddressOrRange_delete_ptr(sk, ptr) ((IPAddressOrRange *)OPENSSL_sk_delete_ptr(ossl_check_IPAddressOrRange_sk_type(sk), ossl_check_IPAddressOrRange_type(ptr))) +#define sk_IPAddressOrRange_push(sk, ptr) OPENSSL_sk_push(ossl_check_IPAddressOrRange_sk_type(sk), ossl_check_IPAddressOrRange_type(ptr)) +#define sk_IPAddressOrRange_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_IPAddressOrRange_sk_type(sk), ossl_check_IPAddressOrRange_type(ptr)) +#define sk_IPAddressOrRange_pop(sk) ((IPAddressOrRange *)OPENSSL_sk_pop(ossl_check_IPAddressOrRange_sk_type(sk))) +#define sk_IPAddressOrRange_shift(sk) ((IPAddressOrRange *)OPENSSL_sk_shift(ossl_check_IPAddressOrRange_sk_type(sk))) +#define sk_IPAddressOrRange_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_IPAddressOrRange_sk_type(sk), ossl_check_IPAddressOrRange_freefunc_type(freefunc)) +#define sk_IPAddressOrRange_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_IPAddressOrRange_sk_type(sk), ossl_check_IPAddressOrRange_type(ptr), (idx)) +#define sk_IPAddressOrRange_set(sk, idx, ptr) ((IPAddressOrRange *)OPENSSL_sk_set(ossl_check_IPAddressOrRange_sk_type(sk), (idx), ossl_check_IPAddressOrRange_type(ptr))) +#define sk_IPAddressOrRange_find(sk, ptr) OPENSSL_sk_find(ossl_check_IPAddressOrRange_sk_type(sk), ossl_check_IPAddressOrRange_type(ptr)) +#define sk_IPAddressOrRange_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_IPAddressOrRange_sk_type(sk), ossl_check_IPAddressOrRange_type(ptr)) +#define sk_IPAddressOrRange_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_IPAddressOrRange_sk_type(sk), ossl_check_IPAddressOrRange_type(ptr), pnum) +#define sk_IPAddressOrRange_sort(sk) OPENSSL_sk_sort(ossl_check_IPAddressOrRange_sk_type(sk)) +#define sk_IPAddressOrRange_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_IPAddressOrRange_sk_type(sk)) +#define sk_IPAddressOrRange_dup(sk) ((STACK_OF(IPAddressOrRange) *)OPENSSL_sk_dup(ossl_check_const_IPAddressOrRange_sk_type(sk))) +#define sk_IPAddressOrRange_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(IPAddressOrRange) *)OPENSSL_sk_deep_copy(ossl_check_const_IPAddressOrRange_sk_type(sk), ossl_check_IPAddressOrRange_copyfunc_type(copyfunc), ossl_check_IPAddressOrRange_freefunc_type(freefunc))) +#define sk_IPAddressOrRange_set_cmp_func(sk, cmp) ((sk_IPAddressOrRange_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_IPAddressOrRange_sk_type(sk), ossl_check_IPAddressOrRange_compfunc_type(cmp))) + +/* clang-format on */ + +typedef STACK_OF(IPAddressOrRange) IPAddressOrRanges; + +#define IPAddressChoice_inherit 0 +#define IPAddressChoice_addressesOrRanges 1 + +typedef struct IPAddressChoice_st { + int type; + union { + ASN1_NULL *inherit; + IPAddressOrRanges *addressesOrRanges; + } u; +} IPAddressChoice; + +typedef struct IPAddressFamily_st { + ASN1_OCTET_STRING *addressFamily; + IPAddressChoice *ipAddressChoice; +} IPAddressFamily; + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(IPAddressFamily, IPAddressFamily, IPAddressFamily) +#define sk_IPAddressFamily_num(sk) OPENSSL_sk_num(ossl_check_const_IPAddressFamily_sk_type(sk)) +#define sk_IPAddressFamily_value(sk, idx) ((IPAddressFamily *)OPENSSL_sk_value(ossl_check_const_IPAddressFamily_sk_type(sk), (idx))) +#define sk_IPAddressFamily_new(cmp) ((STACK_OF(IPAddressFamily) *)OPENSSL_sk_new(ossl_check_IPAddressFamily_compfunc_type(cmp))) +#define sk_IPAddressFamily_new_null() ((STACK_OF(IPAddressFamily) *)OPENSSL_sk_new_null()) +#define sk_IPAddressFamily_new_reserve(cmp, n) ((STACK_OF(IPAddressFamily) *)OPENSSL_sk_new_reserve(ossl_check_IPAddressFamily_compfunc_type(cmp), (n))) +#define sk_IPAddressFamily_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_IPAddressFamily_sk_type(sk), (n)) +#define sk_IPAddressFamily_free(sk) OPENSSL_sk_free(ossl_check_IPAddressFamily_sk_type(sk)) +#define sk_IPAddressFamily_zero(sk) OPENSSL_sk_zero(ossl_check_IPAddressFamily_sk_type(sk)) +#define sk_IPAddressFamily_delete(sk, i) ((IPAddressFamily *)OPENSSL_sk_delete(ossl_check_IPAddressFamily_sk_type(sk), (i))) +#define sk_IPAddressFamily_delete_ptr(sk, ptr) ((IPAddressFamily *)OPENSSL_sk_delete_ptr(ossl_check_IPAddressFamily_sk_type(sk), ossl_check_IPAddressFamily_type(ptr))) +#define sk_IPAddressFamily_push(sk, ptr) OPENSSL_sk_push(ossl_check_IPAddressFamily_sk_type(sk), ossl_check_IPAddressFamily_type(ptr)) +#define sk_IPAddressFamily_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_IPAddressFamily_sk_type(sk), ossl_check_IPAddressFamily_type(ptr)) +#define sk_IPAddressFamily_pop(sk) ((IPAddressFamily *)OPENSSL_sk_pop(ossl_check_IPAddressFamily_sk_type(sk))) +#define sk_IPAddressFamily_shift(sk) ((IPAddressFamily *)OPENSSL_sk_shift(ossl_check_IPAddressFamily_sk_type(sk))) +#define sk_IPAddressFamily_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_IPAddressFamily_sk_type(sk), ossl_check_IPAddressFamily_freefunc_type(freefunc)) +#define sk_IPAddressFamily_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_IPAddressFamily_sk_type(sk), ossl_check_IPAddressFamily_type(ptr), (idx)) +#define sk_IPAddressFamily_set(sk, idx, ptr) ((IPAddressFamily *)OPENSSL_sk_set(ossl_check_IPAddressFamily_sk_type(sk), (idx), ossl_check_IPAddressFamily_type(ptr))) +#define sk_IPAddressFamily_find(sk, ptr) OPENSSL_sk_find(ossl_check_IPAddressFamily_sk_type(sk), ossl_check_IPAddressFamily_type(ptr)) +#define sk_IPAddressFamily_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_IPAddressFamily_sk_type(sk), ossl_check_IPAddressFamily_type(ptr)) +#define sk_IPAddressFamily_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_IPAddressFamily_sk_type(sk), ossl_check_IPAddressFamily_type(ptr), pnum) +#define sk_IPAddressFamily_sort(sk) OPENSSL_sk_sort(ossl_check_IPAddressFamily_sk_type(sk)) +#define sk_IPAddressFamily_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_IPAddressFamily_sk_type(sk)) +#define sk_IPAddressFamily_dup(sk) ((STACK_OF(IPAddressFamily) *)OPENSSL_sk_dup(ossl_check_const_IPAddressFamily_sk_type(sk))) +#define sk_IPAddressFamily_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(IPAddressFamily) *)OPENSSL_sk_deep_copy(ossl_check_const_IPAddressFamily_sk_type(sk), ossl_check_IPAddressFamily_copyfunc_type(copyfunc), ossl_check_IPAddressFamily_freefunc_type(freefunc))) +#define sk_IPAddressFamily_set_cmp_func(sk, cmp) ((sk_IPAddressFamily_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_IPAddressFamily_sk_type(sk), ossl_check_IPAddressFamily_compfunc_type(cmp))) + +/* clang-format on */ + +typedef STACK_OF(IPAddressFamily) IPAddrBlocks; + +DECLARE_ASN1_FUNCTIONS(IPAddressRange) +DECLARE_ASN1_FUNCTIONS(IPAddressOrRange) +DECLARE_ASN1_FUNCTIONS(IPAddressChoice) +DECLARE_ASN1_FUNCTIONS(IPAddressFamily) + +/* + * API tag for elements of the ASIdentifer SEQUENCE. + */ +#define V3_ASID_ASNUM 0 +#define V3_ASID_RDI 1 + +/* + * AFI values, assigned by IANA. It'd be nice to make the AFI + * handling code totally generic, but there are too many little things + * that would need to be defined for other address families for it to + * be worth the trouble. + */ +#define IANA_AFI_IPV4 1 +#define IANA_AFI_IPV6 2 + +/* + * Utilities to construct and extract values from RFC3779 extensions, + * since some of the encodings (particularly for IP address prefixes + * and ranges) are a bit tedious to work with directly. + */ +int X509v3_asid_add_inherit(ASIdentifiers *asid, int which); +int X509v3_asid_add_id_or_range(ASIdentifiers *asid, int which, + ASN1_INTEGER *min, ASN1_INTEGER *max); +int X509v3_addr_add_inherit(IPAddrBlocks *addr, + const unsigned afi, const unsigned *safi); +int X509v3_addr_add_prefix(IPAddrBlocks *addr, + const unsigned afi, const unsigned *safi, + unsigned char *a, const int prefixlen); +int X509v3_addr_add_range(IPAddrBlocks *addr, + const unsigned afi, const unsigned *safi, + unsigned char *min, unsigned char *max); +unsigned X509v3_addr_get_afi(const IPAddressFamily *f); +int X509v3_addr_get_range(IPAddressOrRange *aor, const unsigned afi, + unsigned char *min, unsigned char *max, + const int length); + +/* + * Canonical forms. + */ +int X509v3_asid_is_canonical(ASIdentifiers *asid); +int X509v3_addr_is_canonical(IPAddrBlocks *addr); +int X509v3_asid_canonize(ASIdentifiers *asid); +int X509v3_addr_canonize(IPAddrBlocks *addr); + +/* + * Tests for inheritance and containment. + */ +int X509v3_asid_inherits(ASIdentifiers *asid); +int X509v3_addr_inherits(IPAddrBlocks *addr); +int X509v3_asid_subset(ASIdentifiers *a, ASIdentifiers *b); +int X509v3_addr_subset(IPAddrBlocks *a, IPAddrBlocks *b); + +/* + * Check whether RFC 3779 extensions nest properly in chains. + */ +int X509v3_asid_validate_path(X509_STORE_CTX *); +int X509v3_addr_validate_path(X509_STORE_CTX *); +int X509v3_asid_validate_resource_set(STACK_OF(X509) *chain, + ASIdentifiers *ext, + int allow_inheritance); +int X509v3_addr_validate_resource_set(STACK_OF(X509) *chain, + IPAddrBlocks *ext, int allow_inheritance); + +#endif /* OPENSSL_NO_RFC3779 */ + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(ASN1_STRING, ASN1_STRING, ASN1_STRING) +#define sk_ASN1_STRING_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_STRING_sk_type(sk)) +#define sk_ASN1_STRING_value(sk, idx) ((ASN1_STRING *)OPENSSL_sk_value(ossl_check_const_ASN1_STRING_sk_type(sk), (idx))) +#define sk_ASN1_STRING_new(cmp) ((STACK_OF(ASN1_STRING) *)OPENSSL_sk_new(ossl_check_ASN1_STRING_compfunc_type(cmp))) +#define sk_ASN1_STRING_new_null() ((STACK_OF(ASN1_STRING) *)OPENSSL_sk_new_null()) +#define sk_ASN1_STRING_new_reserve(cmp, n) ((STACK_OF(ASN1_STRING) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_STRING_compfunc_type(cmp), (n))) +#define sk_ASN1_STRING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_STRING_sk_type(sk), (n)) +#define sk_ASN1_STRING_free(sk) OPENSSL_sk_free(ossl_check_ASN1_STRING_sk_type(sk)) +#define sk_ASN1_STRING_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_STRING_sk_type(sk)) +#define sk_ASN1_STRING_delete(sk, i) ((ASN1_STRING *)OPENSSL_sk_delete(ossl_check_ASN1_STRING_sk_type(sk), (i))) +#define sk_ASN1_STRING_delete_ptr(sk, ptr) ((ASN1_STRING *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_STRING_sk_type(sk), ossl_check_ASN1_STRING_type(ptr))) +#define sk_ASN1_STRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_STRING_sk_type(sk), ossl_check_ASN1_STRING_type(ptr)) +#define sk_ASN1_STRING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_STRING_sk_type(sk), ossl_check_ASN1_STRING_type(ptr)) +#define sk_ASN1_STRING_pop(sk) ((ASN1_STRING *)OPENSSL_sk_pop(ossl_check_ASN1_STRING_sk_type(sk))) +#define sk_ASN1_STRING_shift(sk) ((ASN1_STRING *)OPENSSL_sk_shift(ossl_check_ASN1_STRING_sk_type(sk))) +#define sk_ASN1_STRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_STRING_sk_type(sk), ossl_check_ASN1_STRING_freefunc_type(freefunc)) +#define sk_ASN1_STRING_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_STRING_sk_type(sk), ossl_check_ASN1_STRING_type(ptr), (idx)) +#define sk_ASN1_STRING_set(sk, idx, ptr) ((ASN1_STRING *)OPENSSL_sk_set(ossl_check_ASN1_STRING_sk_type(sk), (idx), ossl_check_ASN1_STRING_type(ptr))) +#define sk_ASN1_STRING_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_STRING_sk_type(sk), ossl_check_ASN1_STRING_type(ptr)) +#define sk_ASN1_STRING_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_STRING_sk_type(sk), ossl_check_ASN1_STRING_type(ptr)) +#define sk_ASN1_STRING_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_STRING_sk_type(sk), ossl_check_ASN1_STRING_type(ptr), pnum) +#define sk_ASN1_STRING_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_STRING_sk_type(sk)) +#define sk_ASN1_STRING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_STRING_sk_type(sk)) +#define sk_ASN1_STRING_dup(sk) ((STACK_OF(ASN1_STRING) *)OPENSSL_sk_dup(ossl_check_const_ASN1_STRING_sk_type(sk))) +#define sk_ASN1_STRING_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_STRING) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_STRING_sk_type(sk), ossl_check_ASN1_STRING_copyfunc_type(copyfunc), ossl_check_ASN1_STRING_freefunc_type(freefunc))) +#define sk_ASN1_STRING_set_cmp_func(sk, cmp) ((sk_ASN1_STRING_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_STRING_sk_type(sk), ossl_check_ASN1_STRING_compfunc_type(cmp))) + +/* clang-format on */ + +/* + * Admission Syntax + */ +typedef struct NamingAuthority_st NAMING_AUTHORITY; +typedef struct ProfessionInfo_st PROFESSION_INFO; +typedef struct Admissions_st ADMISSIONS; +typedef struct AdmissionSyntax_st ADMISSION_SYNTAX; +DECLARE_ASN1_FUNCTIONS(NAMING_AUTHORITY) +DECLARE_ASN1_FUNCTIONS(PROFESSION_INFO) +DECLARE_ASN1_FUNCTIONS(ADMISSIONS) +DECLARE_ASN1_FUNCTIONS(ADMISSION_SYNTAX) +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(PROFESSION_INFO, PROFESSION_INFO, PROFESSION_INFO) +#define sk_PROFESSION_INFO_num(sk) OPENSSL_sk_num(ossl_check_const_PROFESSION_INFO_sk_type(sk)) +#define sk_PROFESSION_INFO_value(sk, idx) ((PROFESSION_INFO *)OPENSSL_sk_value(ossl_check_const_PROFESSION_INFO_sk_type(sk), (idx))) +#define sk_PROFESSION_INFO_new(cmp) ((STACK_OF(PROFESSION_INFO) *)OPENSSL_sk_new(ossl_check_PROFESSION_INFO_compfunc_type(cmp))) +#define sk_PROFESSION_INFO_new_null() ((STACK_OF(PROFESSION_INFO) *)OPENSSL_sk_new_null()) +#define sk_PROFESSION_INFO_new_reserve(cmp, n) ((STACK_OF(PROFESSION_INFO) *)OPENSSL_sk_new_reserve(ossl_check_PROFESSION_INFO_compfunc_type(cmp), (n))) +#define sk_PROFESSION_INFO_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_PROFESSION_INFO_sk_type(sk), (n)) +#define sk_PROFESSION_INFO_free(sk) OPENSSL_sk_free(ossl_check_PROFESSION_INFO_sk_type(sk)) +#define sk_PROFESSION_INFO_zero(sk) OPENSSL_sk_zero(ossl_check_PROFESSION_INFO_sk_type(sk)) +#define sk_PROFESSION_INFO_delete(sk, i) ((PROFESSION_INFO *)OPENSSL_sk_delete(ossl_check_PROFESSION_INFO_sk_type(sk), (i))) +#define sk_PROFESSION_INFO_delete_ptr(sk, ptr) ((PROFESSION_INFO *)OPENSSL_sk_delete_ptr(ossl_check_PROFESSION_INFO_sk_type(sk), ossl_check_PROFESSION_INFO_type(ptr))) +#define sk_PROFESSION_INFO_push(sk, ptr) OPENSSL_sk_push(ossl_check_PROFESSION_INFO_sk_type(sk), ossl_check_PROFESSION_INFO_type(ptr)) +#define sk_PROFESSION_INFO_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_PROFESSION_INFO_sk_type(sk), ossl_check_PROFESSION_INFO_type(ptr)) +#define sk_PROFESSION_INFO_pop(sk) ((PROFESSION_INFO *)OPENSSL_sk_pop(ossl_check_PROFESSION_INFO_sk_type(sk))) +#define sk_PROFESSION_INFO_shift(sk) ((PROFESSION_INFO *)OPENSSL_sk_shift(ossl_check_PROFESSION_INFO_sk_type(sk))) +#define sk_PROFESSION_INFO_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_PROFESSION_INFO_sk_type(sk), ossl_check_PROFESSION_INFO_freefunc_type(freefunc)) +#define sk_PROFESSION_INFO_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_PROFESSION_INFO_sk_type(sk), ossl_check_PROFESSION_INFO_type(ptr), (idx)) +#define sk_PROFESSION_INFO_set(sk, idx, ptr) ((PROFESSION_INFO *)OPENSSL_sk_set(ossl_check_PROFESSION_INFO_sk_type(sk), (idx), ossl_check_PROFESSION_INFO_type(ptr))) +#define sk_PROFESSION_INFO_find(sk, ptr) OPENSSL_sk_find(ossl_check_PROFESSION_INFO_sk_type(sk), ossl_check_PROFESSION_INFO_type(ptr)) +#define sk_PROFESSION_INFO_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_PROFESSION_INFO_sk_type(sk), ossl_check_PROFESSION_INFO_type(ptr)) +#define sk_PROFESSION_INFO_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_PROFESSION_INFO_sk_type(sk), ossl_check_PROFESSION_INFO_type(ptr), pnum) +#define sk_PROFESSION_INFO_sort(sk) OPENSSL_sk_sort(ossl_check_PROFESSION_INFO_sk_type(sk)) +#define sk_PROFESSION_INFO_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_PROFESSION_INFO_sk_type(sk)) +#define sk_PROFESSION_INFO_dup(sk) ((STACK_OF(PROFESSION_INFO) *)OPENSSL_sk_dup(ossl_check_const_PROFESSION_INFO_sk_type(sk))) +#define sk_PROFESSION_INFO_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(PROFESSION_INFO) *)OPENSSL_sk_deep_copy(ossl_check_const_PROFESSION_INFO_sk_type(sk), ossl_check_PROFESSION_INFO_copyfunc_type(copyfunc), ossl_check_PROFESSION_INFO_freefunc_type(freefunc))) +#define sk_PROFESSION_INFO_set_cmp_func(sk, cmp) ((sk_PROFESSION_INFO_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_PROFESSION_INFO_sk_type(sk), ossl_check_PROFESSION_INFO_compfunc_type(cmp))) +SKM_DEFINE_STACK_OF_INTERNAL(ADMISSIONS, ADMISSIONS, ADMISSIONS) +#define sk_ADMISSIONS_num(sk) OPENSSL_sk_num(ossl_check_const_ADMISSIONS_sk_type(sk)) +#define sk_ADMISSIONS_value(sk, idx) ((ADMISSIONS *)OPENSSL_sk_value(ossl_check_const_ADMISSIONS_sk_type(sk), (idx))) +#define sk_ADMISSIONS_new(cmp) ((STACK_OF(ADMISSIONS) *)OPENSSL_sk_new(ossl_check_ADMISSIONS_compfunc_type(cmp))) +#define sk_ADMISSIONS_new_null() ((STACK_OF(ADMISSIONS) *)OPENSSL_sk_new_null()) +#define sk_ADMISSIONS_new_reserve(cmp, n) ((STACK_OF(ADMISSIONS) *)OPENSSL_sk_new_reserve(ossl_check_ADMISSIONS_compfunc_type(cmp), (n))) +#define sk_ADMISSIONS_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ADMISSIONS_sk_type(sk), (n)) +#define sk_ADMISSIONS_free(sk) OPENSSL_sk_free(ossl_check_ADMISSIONS_sk_type(sk)) +#define sk_ADMISSIONS_zero(sk) OPENSSL_sk_zero(ossl_check_ADMISSIONS_sk_type(sk)) +#define sk_ADMISSIONS_delete(sk, i) ((ADMISSIONS *)OPENSSL_sk_delete(ossl_check_ADMISSIONS_sk_type(sk), (i))) +#define sk_ADMISSIONS_delete_ptr(sk, ptr) ((ADMISSIONS *)OPENSSL_sk_delete_ptr(ossl_check_ADMISSIONS_sk_type(sk), ossl_check_ADMISSIONS_type(ptr))) +#define sk_ADMISSIONS_push(sk, ptr) OPENSSL_sk_push(ossl_check_ADMISSIONS_sk_type(sk), ossl_check_ADMISSIONS_type(ptr)) +#define sk_ADMISSIONS_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ADMISSIONS_sk_type(sk), ossl_check_ADMISSIONS_type(ptr)) +#define sk_ADMISSIONS_pop(sk) ((ADMISSIONS *)OPENSSL_sk_pop(ossl_check_ADMISSIONS_sk_type(sk))) +#define sk_ADMISSIONS_shift(sk) ((ADMISSIONS *)OPENSSL_sk_shift(ossl_check_ADMISSIONS_sk_type(sk))) +#define sk_ADMISSIONS_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ADMISSIONS_sk_type(sk), ossl_check_ADMISSIONS_freefunc_type(freefunc)) +#define sk_ADMISSIONS_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ADMISSIONS_sk_type(sk), ossl_check_ADMISSIONS_type(ptr), (idx)) +#define sk_ADMISSIONS_set(sk, idx, ptr) ((ADMISSIONS *)OPENSSL_sk_set(ossl_check_ADMISSIONS_sk_type(sk), (idx), ossl_check_ADMISSIONS_type(ptr))) +#define sk_ADMISSIONS_find(sk, ptr) OPENSSL_sk_find(ossl_check_ADMISSIONS_sk_type(sk), ossl_check_ADMISSIONS_type(ptr)) +#define sk_ADMISSIONS_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ADMISSIONS_sk_type(sk), ossl_check_ADMISSIONS_type(ptr)) +#define sk_ADMISSIONS_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ADMISSIONS_sk_type(sk), ossl_check_ADMISSIONS_type(ptr), pnum) +#define sk_ADMISSIONS_sort(sk) OPENSSL_sk_sort(ossl_check_ADMISSIONS_sk_type(sk)) +#define sk_ADMISSIONS_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ADMISSIONS_sk_type(sk)) +#define sk_ADMISSIONS_dup(sk) ((STACK_OF(ADMISSIONS) *)OPENSSL_sk_dup(ossl_check_const_ADMISSIONS_sk_type(sk))) +#define sk_ADMISSIONS_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ADMISSIONS) *)OPENSSL_sk_deep_copy(ossl_check_const_ADMISSIONS_sk_type(sk), ossl_check_ADMISSIONS_copyfunc_type(copyfunc), ossl_check_ADMISSIONS_freefunc_type(freefunc))) +#define sk_ADMISSIONS_set_cmp_func(sk, cmp) ((sk_ADMISSIONS_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ADMISSIONS_sk_type(sk), ossl_check_ADMISSIONS_compfunc_type(cmp))) + +/* clang-format on */ +typedef STACK_OF(PROFESSION_INFO) PROFESSION_INFOS; + +const ASN1_OBJECT *NAMING_AUTHORITY_get0_authorityId( + const NAMING_AUTHORITY *n); +const ASN1_IA5STRING *NAMING_AUTHORITY_get0_authorityURL( + const NAMING_AUTHORITY *n); +const ASN1_STRING *NAMING_AUTHORITY_get0_authorityText( + const NAMING_AUTHORITY *n); +void NAMING_AUTHORITY_set0_authorityId(NAMING_AUTHORITY *n, + ASN1_OBJECT *namingAuthorityId); +void NAMING_AUTHORITY_set0_authorityURL(NAMING_AUTHORITY *n, + ASN1_IA5STRING *namingAuthorityUrl); +void NAMING_AUTHORITY_set0_authorityText(NAMING_AUTHORITY *n, + ASN1_STRING *namingAuthorityText); + +const GENERAL_NAME *ADMISSION_SYNTAX_get0_admissionAuthority( + const ADMISSION_SYNTAX *as); +void ADMISSION_SYNTAX_set0_admissionAuthority( + ADMISSION_SYNTAX *as, GENERAL_NAME *aa); +const STACK_OF(ADMISSIONS) *ADMISSION_SYNTAX_get0_contentsOfAdmissions( + const ADMISSION_SYNTAX *as); +void ADMISSION_SYNTAX_set0_contentsOfAdmissions( + ADMISSION_SYNTAX *as, STACK_OF(ADMISSIONS) *a); +const GENERAL_NAME *ADMISSIONS_get0_admissionAuthority(const ADMISSIONS *a); +void ADMISSIONS_set0_admissionAuthority(ADMISSIONS *a, GENERAL_NAME *aa); +const NAMING_AUTHORITY *ADMISSIONS_get0_namingAuthority(const ADMISSIONS *a); +void ADMISSIONS_set0_namingAuthority(ADMISSIONS *a, NAMING_AUTHORITY *na); +const PROFESSION_INFOS *ADMISSIONS_get0_professionInfos(const ADMISSIONS *a); +void ADMISSIONS_set0_professionInfos(ADMISSIONS *a, PROFESSION_INFOS *pi); +const ASN1_OCTET_STRING *PROFESSION_INFO_get0_addProfessionInfo( + const PROFESSION_INFO *pi); +void PROFESSION_INFO_set0_addProfessionInfo( + PROFESSION_INFO *pi, ASN1_OCTET_STRING *aos); +const NAMING_AUTHORITY *PROFESSION_INFO_get0_namingAuthority( + const PROFESSION_INFO *pi); +void PROFESSION_INFO_set0_namingAuthority( + PROFESSION_INFO *pi, NAMING_AUTHORITY *na); +const STACK_OF(ASN1_STRING) *PROFESSION_INFO_get0_professionItems( + const PROFESSION_INFO *pi); +void PROFESSION_INFO_set0_professionItems( + PROFESSION_INFO *pi, STACK_OF(ASN1_STRING) *as); +const STACK_OF(ASN1_OBJECT) *PROFESSION_INFO_get0_professionOIDs( + const PROFESSION_INFO *pi); +void PROFESSION_INFO_set0_professionOIDs( + PROFESSION_INFO *pi, STACK_OF(ASN1_OBJECT) *po); +const ASN1_PRINTABLESTRING *PROFESSION_INFO_get0_registrationNumber( + const PROFESSION_INFO *pi); +void PROFESSION_INFO_set0_registrationNumber( + PROFESSION_INFO *pi, ASN1_PRINTABLESTRING *rn); + +int OSSL_GENERAL_NAMES_print(BIO *out, GENERAL_NAMES *gens, int indent); + +typedef STACK_OF(X509_ATTRIBUTE) OSSL_ATTRIBUTES_SYNTAX; +DECLARE_ASN1_FUNCTIONS(OSSL_ATTRIBUTES_SYNTAX) + +typedef STACK_OF(USERNOTICE) OSSL_USER_NOTICE_SYNTAX; +DECLARE_ASN1_FUNCTIONS(OSSL_USER_NOTICE_SYNTAX) + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(USERNOTICE, USERNOTICE, USERNOTICE) +#define sk_USERNOTICE_num(sk) OPENSSL_sk_num(ossl_check_const_USERNOTICE_sk_type(sk)) +#define sk_USERNOTICE_value(sk, idx) ((USERNOTICE *)OPENSSL_sk_value(ossl_check_const_USERNOTICE_sk_type(sk), (idx))) +#define sk_USERNOTICE_new(cmp) ((STACK_OF(USERNOTICE) *)OPENSSL_sk_new(ossl_check_USERNOTICE_compfunc_type(cmp))) +#define sk_USERNOTICE_new_null() ((STACK_OF(USERNOTICE) *)OPENSSL_sk_new_null()) +#define sk_USERNOTICE_new_reserve(cmp, n) ((STACK_OF(USERNOTICE) *)OPENSSL_sk_new_reserve(ossl_check_USERNOTICE_compfunc_type(cmp), (n))) +#define sk_USERNOTICE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_USERNOTICE_sk_type(sk), (n)) +#define sk_USERNOTICE_free(sk) OPENSSL_sk_free(ossl_check_USERNOTICE_sk_type(sk)) +#define sk_USERNOTICE_zero(sk) OPENSSL_sk_zero(ossl_check_USERNOTICE_sk_type(sk)) +#define sk_USERNOTICE_delete(sk, i) ((USERNOTICE *)OPENSSL_sk_delete(ossl_check_USERNOTICE_sk_type(sk), (i))) +#define sk_USERNOTICE_delete_ptr(sk, ptr) ((USERNOTICE *)OPENSSL_sk_delete_ptr(ossl_check_USERNOTICE_sk_type(sk), ossl_check_USERNOTICE_type(ptr))) +#define sk_USERNOTICE_push(sk, ptr) OPENSSL_sk_push(ossl_check_USERNOTICE_sk_type(sk), ossl_check_USERNOTICE_type(ptr)) +#define sk_USERNOTICE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_USERNOTICE_sk_type(sk), ossl_check_USERNOTICE_type(ptr)) +#define sk_USERNOTICE_pop(sk) ((USERNOTICE *)OPENSSL_sk_pop(ossl_check_USERNOTICE_sk_type(sk))) +#define sk_USERNOTICE_shift(sk) ((USERNOTICE *)OPENSSL_sk_shift(ossl_check_USERNOTICE_sk_type(sk))) +#define sk_USERNOTICE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_USERNOTICE_sk_type(sk), ossl_check_USERNOTICE_freefunc_type(freefunc)) +#define sk_USERNOTICE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_USERNOTICE_sk_type(sk), ossl_check_USERNOTICE_type(ptr), (idx)) +#define sk_USERNOTICE_set(sk, idx, ptr) ((USERNOTICE *)OPENSSL_sk_set(ossl_check_USERNOTICE_sk_type(sk), (idx), ossl_check_USERNOTICE_type(ptr))) +#define sk_USERNOTICE_find(sk, ptr) OPENSSL_sk_find(ossl_check_USERNOTICE_sk_type(sk), ossl_check_USERNOTICE_type(ptr)) +#define sk_USERNOTICE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_USERNOTICE_sk_type(sk), ossl_check_USERNOTICE_type(ptr)) +#define sk_USERNOTICE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_USERNOTICE_sk_type(sk), ossl_check_USERNOTICE_type(ptr), pnum) +#define sk_USERNOTICE_sort(sk) OPENSSL_sk_sort(ossl_check_USERNOTICE_sk_type(sk)) +#define sk_USERNOTICE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_USERNOTICE_sk_type(sk)) +#define sk_USERNOTICE_dup(sk) ((STACK_OF(USERNOTICE) *)OPENSSL_sk_dup(ossl_check_const_USERNOTICE_sk_type(sk))) +#define sk_USERNOTICE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(USERNOTICE) *)OPENSSL_sk_deep_copy(ossl_check_const_USERNOTICE_sk_type(sk), ossl_check_USERNOTICE_copyfunc_type(copyfunc), ossl_check_USERNOTICE_freefunc_type(freefunc))) +#define sk_USERNOTICE_set_cmp_func(sk, cmp) ((sk_USERNOTICE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_USERNOTICE_sk_type(sk), ossl_check_USERNOTICE_compfunc_type(cmp))) + +/* clang-format on */ + +typedef struct OSSL_ROLE_SPEC_CERT_ID_st { + GENERAL_NAME *roleName; + GENERAL_NAME *roleCertIssuer; + ASN1_INTEGER *roleCertSerialNumber; + GENERAL_NAMES *roleCertLocator; +} OSSL_ROLE_SPEC_CERT_ID; + +DECLARE_ASN1_FUNCTIONS(OSSL_ROLE_SPEC_CERT_ID) + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(OSSL_ROLE_SPEC_CERT_ID, OSSL_ROLE_SPEC_CERT_ID, OSSL_ROLE_SPEC_CERT_ID) +#define sk_OSSL_ROLE_SPEC_CERT_ID_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_ROLE_SPEC_CERT_ID_sk_type(sk)) +#define sk_OSSL_ROLE_SPEC_CERT_ID_value(sk, idx) ((OSSL_ROLE_SPEC_CERT_ID *)OPENSSL_sk_value(ossl_check_const_OSSL_ROLE_SPEC_CERT_ID_sk_type(sk), (idx))) +#define sk_OSSL_ROLE_SPEC_CERT_ID_new(cmp) ((STACK_OF(OSSL_ROLE_SPEC_CERT_ID) *)OPENSSL_sk_new(ossl_check_OSSL_ROLE_SPEC_CERT_ID_compfunc_type(cmp))) +#define sk_OSSL_ROLE_SPEC_CERT_ID_new_null() ((STACK_OF(OSSL_ROLE_SPEC_CERT_ID) *)OPENSSL_sk_new_null()) +#define sk_OSSL_ROLE_SPEC_CERT_ID_new_reserve(cmp, n) ((STACK_OF(OSSL_ROLE_SPEC_CERT_ID) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_ROLE_SPEC_CERT_ID_compfunc_type(cmp), (n))) +#define sk_OSSL_ROLE_SPEC_CERT_ID_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_ROLE_SPEC_CERT_ID_sk_type(sk), (n)) +#define sk_OSSL_ROLE_SPEC_CERT_ID_free(sk) OPENSSL_sk_free(ossl_check_OSSL_ROLE_SPEC_CERT_ID_sk_type(sk)) +#define sk_OSSL_ROLE_SPEC_CERT_ID_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_ROLE_SPEC_CERT_ID_sk_type(sk)) +#define sk_OSSL_ROLE_SPEC_CERT_ID_delete(sk, i) ((OSSL_ROLE_SPEC_CERT_ID *)OPENSSL_sk_delete(ossl_check_OSSL_ROLE_SPEC_CERT_ID_sk_type(sk), (i))) +#define sk_OSSL_ROLE_SPEC_CERT_ID_delete_ptr(sk, ptr) ((OSSL_ROLE_SPEC_CERT_ID *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_ROLE_SPEC_CERT_ID_sk_type(sk), ossl_check_OSSL_ROLE_SPEC_CERT_ID_type(ptr))) +#define sk_OSSL_ROLE_SPEC_CERT_ID_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_ROLE_SPEC_CERT_ID_sk_type(sk), ossl_check_OSSL_ROLE_SPEC_CERT_ID_type(ptr)) +#define sk_OSSL_ROLE_SPEC_CERT_ID_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_ROLE_SPEC_CERT_ID_sk_type(sk), ossl_check_OSSL_ROLE_SPEC_CERT_ID_type(ptr)) +#define sk_OSSL_ROLE_SPEC_CERT_ID_pop(sk) ((OSSL_ROLE_SPEC_CERT_ID *)OPENSSL_sk_pop(ossl_check_OSSL_ROLE_SPEC_CERT_ID_sk_type(sk))) +#define sk_OSSL_ROLE_SPEC_CERT_ID_shift(sk) ((OSSL_ROLE_SPEC_CERT_ID *)OPENSSL_sk_shift(ossl_check_OSSL_ROLE_SPEC_CERT_ID_sk_type(sk))) +#define sk_OSSL_ROLE_SPEC_CERT_ID_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_ROLE_SPEC_CERT_ID_sk_type(sk), ossl_check_OSSL_ROLE_SPEC_CERT_ID_freefunc_type(freefunc)) +#define sk_OSSL_ROLE_SPEC_CERT_ID_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_ROLE_SPEC_CERT_ID_sk_type(sk), ossl_check_OSSL_ROLE_SPEC_CERT_ID_type(ptr), (idx)) +#define sk_OSSL_ROLE_SPEC_CERT_ID_set(sk, idx, ptr) ((OSSL_ROLE_SPEC_CERT_ID *)OPENSSL_sk_set(ossl_check_OSSL_ROLE_SPEC_CERT_ID_sk_type(sk), (idx), ossl_check_OSSL_ROLE_SPEC_CERT_ID_type(ptr))) +#define sk_OSSL_ROLE_SPEC_CERT_ID_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_ROLE_SPEC_CERT_ID_sk_type(sk), ossl_check_OSSL_ROLE_SPEC_CERT_ID_type(ptr)) +#define sk_OSSL_ROLE_SPEC_CERT_ID_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_ROLE_SPEC_CERT_ID_sk_type(sk), ossl_check_OSSL_ROLE_SPEC_CERT_ID_type(ptr)) +#define sk_OSSL_ROLE_SPEC_CERT_ID_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_ROLE_SPEC_CERT_ID_sk_type(sk), ossl_check_OSSL_ROLE_SPEC_CERT_ID_type(ptr), pnum) +#define sk_OSSL_ROLE_SPEC_CERT_ID_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_ROLE_SPEC_CERT_ID_sk_type(sk)) +#define sk_OSSL_ROLE_SPEC_CERT_ID_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_ROLE_SPEC_CERT_ID_sk_type(sk)) +#define sk_OSSL_ROLE_SPEC_CERT_ID_dup(sk) ((STACK_OF(OSSL_ROLE_SPEC_CERT_ID) *)OPENSSL_sk_dup(ossl_check_const_OSSL_ROLE_SPEC_CERT_ID_sk_type(sk))) +#define sk_OSSL_ROLE_SPEC_CERT_ID_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_ROLE_SPEC_CERT_ID) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_ROLE_SPEC_CERT_ID_sk_type(sk), ossl_check_OSSL_ROLE_SPEC_CERT_ID_copyfunc_type(copyfunc), ossl_check_OSSL_ROLE_SPEC_CERT_ID_freefunc_type(freefunc))) +#define sk_OSSL_ROLE_SPEC_CERT_ID_set_cmp_func(sk, cmp) ((sk_OSSL_ROLE_SPEC_CERT_ID_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_ROLE_SPEC_CERT_ID_sk_type(sk), ossl_check_OSSL_ROLE_SPEC_CERT_ID_compfunc_type(cmp))) + +/* clang-format on */ + +typedef STACK_OF(OSSL_ROLE_SPEC_CERT_ID) OSSL_ROLE_SPEC_CERT_ID_SYNTAX; + +DECLARE_ASN1_FUNCTIONS(OSSL_ROLE_SPEC_CERT_ID_SYNTAX) +typedef struct OSSL_HASH_st { + X509_ALGOR *algorithmIdentifier; + ASN1_BIT_STRING *hashValue; +} OSSL_HASH; + +typedef struct OSSL_INFO_SYNTAX_POINTER_st { + GENERAL_NAMES *name; + OSSL_HASH *hash; +} OSSL_INFO_SYNTAX_POINTER; + +#define OSSL_INFO_SYNTAX_TYPE_CONTENT 0 +#define OSSL_INFO_SYNTAX_TYPE_POINTER 1 + +typedef struct OSSL_INFO_SYNTAX_st { + int type; + union { + ASN1_STRING *content; + OSSL_INFO_SYNTAX_POINTER *pointer; + } choice; +} OSSL_INFO_SYNTAX; + +typedef struct OSSL_PRIVILEGE_POLICY_ID_st { + ASN1_OBJECT *privilegePolicy; + OSSL_INFO_SYNTAX *privPolSyntax; +} OSSL_PRIVILEGE_POLICY_ID; + +typedef struct OSSL_ATTRIBUTE_DESCRIPTOR_st { + ASN1_OBJECT *identifier; + ASN1_STRING *attributeSyntax; + ASN1_UTF8STRING *name; + ASN1_UTF8STRING *description; + OSSL_PRIVILEGE_POLICY_ID *dominationRule; +} OSSL_ATTRIBUTE_DESCRIPTOR; + +DECLARE_ASN1_FUNCTIONS(OSSL_HASH) +DECLARE_ASN1_FUNCTIONS(OSSL_INFO_SYNTAX) +DECLARE_ASN1_FUNCTIONS(OSSL_INFO_SYNTAX_POINTER) +DECLARE_ASN1_FUNCTIONS(OSSL_PRIVILEGE_POLICY_ID) +DECLARE_ASN1_FUNCTIONS(OSSL_ATTRIBUTE_DESCRIPTOR) + +typedef struct OSSL_TIME_SPEC_ABSOLUTE_st { + ASN1_GENERALIZEDTIME *startTime; + ASN1_GENERALIZEDTIME *endTime; +} OSSL_TIME_SPEC_ABSOLUTE; + +typedef struct OSSL_DAY_TIME_st { + ASN1_INTEGER *hour; + ASN1_INTEGER *minute; + ASN1_INTEGER *second; +} OSSL_DAY_TIME; + +typedef struct OSSL_DAY_TIME_BAND_st { + OSSL_DAY_TIME *startDayTime; + OSSL_DAY_TIME *endDayTime; +} OSSL_DAY_TIME_BAND; + +#define OSSL_NAMED_DAY_TYPE_INT 0 +#define OSSL_NAMED_DAY_TYPE_BIT 1 +#define OSSL_NAMED_DAY_INT_SUN 1 +#define OSSL_NAMED_DAY_INT_MON 2 +#define OSSL_NAMED_DAY_INT_TUE 3 +#define OSSL_NAMED_DAY_INT_WED 4 +#define OSSL_NAMED_DAY_INT_THU 5 +#define OSSL_NAMED_DAY_INT_FRI 6 +#define OSSL_NAMED_DAY_INT_SAT 7 +#define OSSL_NAMED_DAY_BIT_SUN 0 +#define OSSL_NAMED_DAY_BIT_MON 1 +#define OSSL_NAMED_DAY_BIT_TUE 2 +#define OSSL_NAMED_DAY_BIT_WED 3 +#define OSSL_NAMED_DAY_BIT_THU 4 +#define OSSL_NAMED_DAY_BIT_FRI 5 +#define OSSL_NAMED_DAY_BIT_SAT 6 + +typedef struct OSSL_NAMED_DAY_st { + int type; + union { + ASN1_INTEGER *intNamedDays; + ASN1_BIT_STRING *bitNamedDays; + } choice; +} OSSL_NAMED_DAY; + +#define OSSL_TIME_SPEC_X_DAY_OF_FIRST 0 +#define OSSL_TIME_SPEC_X_DAY_OF_SECOND 1 +#define OSSL_TIME_SPEC_X_DAY_OF_THIRD 2 +#define OSSL_TIME_SPEC_X_DAY_OF_FOURTH 3 +#define OSSL_TIME_SPEC_X_DAY_OF_FIFTH 4 + +typedef struct OSSL_TIME_SPEC_X_DAY_OF_st { + int type; + union { + OSSL_NAMED_DAY *first; + OSSL_NAMED_DAY *second; + OSSL_NAMED_DAY *third; + OSSL_NAMED_DAY *fourth; + OSSL_NAMED_DAY *fifth; + } choice; +} OSSL_TIME_SPEC_X_DAY_OF; + +#define OSSL_TIME_SPEC_DAY_TYPE_INT 0 +#define OSSL_TIME_SPEC_DAY_TYPE_BIT 1 +#define OSSL_TIME_SPEC_DAY_TYPE_DAY_OF 2 +#define OSSL_TIME_SPEC_DAY_BIT_SUN 0 +#define OSSL_TIME_SPEC_DAY_BIT_MON 1 +#define OSSL_TIME_SPEC_DAY_BIT_TUE 2 +#define OSSL_TIME_SPEC_DAY_BIT_WED 3 +#define OSSL_TIME_SPEC_DAY_BIT_THU 4 +#define OSSL_TIME_SPEC_DAY_BIT_FRI 5 +#define OSSL_TIME_SPEC_DAY_BIT_SAT 6 +#define OSSL_TIME_SPEC_DAY_INT_SUN 1 +#define OSSL_TIME_SPEC_DAY_INT_MON 2 +#define OSSL_TIME_SPEC_DAY_INT_TUE 3 +#define OSSL_TIME_SPEC_DAY_INT_WED 4 +#define OSSL_TIME_SPEC_DAY_INT_THU 5 +#define OSSL_TIME_SPEC_DAY_INT_FRI 6 +#define OSSL_TIME_SPEC_DAY_INT_SAT 7 + +typedef struct OSSL_TIME_SPEC_DAY_st { + int type; + union { + STACK_OF(ASN1_INTEGER) *intDay; + ASN1_BIT_STRING *bitDay; + OSSL_TIME_SPEC_X_DAY_OF *dayOf; + } choice; +} OSSL_TIME_SPEC_DAY; + +#define OSSL_TIME_SPEC_WEEKS_TYPE_ALL 0 +#define OSSL_TIME_SPEC_WEEKS_TYPE_INT 1 +#define OSSL_TIME_SPEC_WEEKS_TYPE_BIT 2 +#define OSSL_TIME_SPEC_BIT_WEEKS_1 0 +#define OSSL_TIME_SPEC_BIT_WEEKS_2 1 +#define OSSL_TIME_SPEC_BIT_WEEKS_3 2 +#define OSSL_TIME_SPEC_BIT_WEEKS_4 3 +#define OSSL_TIME_SPEC_BIT_WEEKS_5 4 + +typedef struct OSSL_TIME_SPEC_WEEKS_st { + int type; + union { + ASN1_NULL *allWeeks; + STACK_OF(ASN1_INTEGER) *intWeek; + ASN1_BIT_STRING *bitWeek; + } choice; +} OSSL_TIME_SPEC_WEEKS; + +#define OSSL_TIME_SPEC_MONTH_TYPE_ALL 0 +#define OSSL_TIME_SPEC_MONTH_TYPE_INT 1 +#define OSSL_TIME_SPEC_MONTH_TYPE_BIT 2 +#define OSSL_TIME_SPEC_INT_MONTH_JAN 1 +#define OSSL_TIME_SPEC_INT_MONTH_FEB 2 +#define OSSL_TIME_SPEC_INT_MONTH_MAR 3 +#define OSSL_TIME_SPEC_INT_MONTH_APR 4 +#define OSSL_TIME_SPEC_INT_MONTH_MAY 5 +#define OSSL_TIME_SPEC_INT_MONTH_JUN 6 +#define OSSL_TIME_SPEC_INT_MONTH_JUL 7 +#define OSSL_TIME_SPEC_INT_MONTH_AUG 8 +#define OSSL_TIME_SPEC_INT_MONTH_SEP 9 +#define OSSL_TIME_SPEC_INT_MONTH_OCT 10 +#define OSSL_TIME_SPEC_INT_MONTH_NOV 11 +#define OSSL_TIME_SPEC_INT_MONTH_DEC 12 +#define OSSL_TIME_SPEC_BIT_MONTH_JAN 0 +#define OSSL_TIME_SPEC_BIT_MONTH_FEB 1 +#define OSSL_TIME_SPEC_BIT_MONTH_MAR 2 +#define OSSL_TIME_SPEC_BIT_MONTH_APR 3 +#define OSSL_TIME_SPEC_BIT_MONTH_MAY 4 +#define OSSL_TIME_SPEC_BIT_MONTH_JUN 5 +#define OSSL_TIME_SPEC_BIT_MONTH_JUL 6 +#define OSSL_TIME_SPEC_BIT_MONTH_AUG 7 +#define OSSL_TIME_SPEC_BIT_MONTH_SEP 8 +#define OSSL_TIME_SPEC_BIT_MONTH_OCT 9 +#define OSSL_TIME_SPEC_BIT_MONTH_NOV 10 +#define OSSL_TIME_SPEC_BIT_MONTH_DEC 11 + +typedef struct OSSL_TIME_SPEC_MONTH_st { + int type; + union { + ASN1_NULL *allMonths; + STACK_OF(ASN1_INTEGER) *intMonth; + ASN1_BIT_STRING *bitMonth; + } choice; +} OSSL_TIME_SPEC_MONTH; + +typedef struct OSSL_TIME_PERIOD_st { + STACK_OF(OSSL_DAY_TIME_BAND) *timesOfDay; + OSSL_TIME_SPEC_DAY *days; + OSSL_TIME_SPEC_WEEKS *weeks; + OSSL_TIME_SPEC_MONTH *months; + STACK_OF(ASN1_INTEGER) *years; +} OSSL_TIME_PERIOD; + +#define OSSL_TIME_SPEC_TIME_TYPE_ABSOLUTE 0 +#define OSSL_TIME_SPEC_TIME_TYPE_PERIODIC 1 + +typedef struct OSSL_TIME_SPEC_TIME_st { + int type; + union { + OSSL_TIME_SPEC_ABSOLUTE *absolute; + STACK_OF(OSSL_TIME_PERIOD) *periodic; + } choice; +} OSSL_TIME_SPEC_TIME; + +typedef struct OSSL_TIME_SPEC_st { + OSSL_TIME_SPEC_TIME *time; + ASN1_BOOLEAN notThisTime; + ASN1_INTEGER *timeZone; +} OSSL_TIME_SPEC; + +DECLARE_ASN1_FUNCTIONS(OSSL_DAY_TIME) +DECLARE_ASN1_FUNCTIONS(OSSL_DAY_TIME_BAND) +DECLARE_ASN1_FUNCTIONS(OSSL_TIME_SPEC_DAY) +DECLARE_ASN1_FUNCTIONS(OSSL_TIME_SPEC_WEEKS) +DECLARE_ASN1_FUNCTIONS(OSSL_TIME_SPEC_MONTH) +DECLARE_ASN1_FUNCTIONS(OSSL_NAMED_DAY) +DECLARE_ASN1_FUNCTIONS(OSSL_TIME_SPEC_X_DAY_OF) +DECLARE_ASN1_FUNCTIONS(OSSL_TIME_SPEC_ABSOLUTE) +DECLARE_ASN1_FUNCTIONS(OSSL_TIME_SPEC_TIME) +DECLARE_ASN1_FUNCTIONS(OSSL_TIME_SPEC) +DECLARE_ASN1_FUNCTIONS(OSSL_TIME_PERIOD) + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(OSSL_TIME_PERIOD, OSSL_TIME_PERIOD, OSSL_TIME_PERIOD) +#define sk_OSSL_TIME_PERIOD_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_TIME_PERIOD_sk_type(sk)) +#define sk_OSSL_TIME_PERIOD_value(sk, idx) ((OSSL_TIME_PERIOD *)OPENSSL_sk_value(ossl_check_const_OSSL_TIME_PERIOD_sk_type(sk), (idx))) +#define sk_OSSL_TIME_PERIOD_new(cmp) ((STACK_OF(OSSL_TIME_PERIOD) *)OPENSSL_sk_new(ossl_check_OSSL_TIME_PERIOD_compfunc_type(cmp))) +#define sk_OSSL_TIME_PERIOD_new_null() ((STACK_OF(OSSL_TIME_PERIOD) *)OPENSSL_sk_new_null()) +#define sk_OSSL_TIME_PERIOD_new_reserve(cmp, n) ((STACK_OF(OSSL_TIME_PERIOD) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_TIME_PERIOD_compfunc_type(cmp), (n))) +#define sk_OSSL_TIME_PERIOD_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_TIME_PERIOD_sk_type(sk), (n)) +#define sk_OSSL_TIME_PERIOD_free(sk) OPENSSL_sk_free(ossl_check_OSSL_TIME_PERIOD_sk_type(sk)) +#define sk_OSSL_TIME_PERIOD_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_TIME_PERIOD_sk_type(sk)) +#define sk_OSSL_TIME_PERIOD_delete(sk, i) ((OSSL_TIME_PERIOD *)OPENSSL_sk_delete(ossl_check_OSSL_TIME_PERIOD_sk_type(sk), (i))) +#define sk_OSSL_TIME_PERIOD_delete_ptr(sk, ptr) ((OSSL_TIME_PERIOD *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_TIME_PERIOD_sk_type(sk), ossl_check_OSSL_TIME_PERIOD_type(ptr))) +#define sk_OSSL_TIME_PERIOD_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_TIME_PERIOD_sk_type(sk), ossl_check_OSSL_TIME_PERIOD_type(ptr)) +#define sk_OSSL_TIME_PERIOD_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_TIME_PERIOD_sk_type(sk), ossl_check_OSSL_TIME_PERIOD_type(ptr)) +#define sk_OSSL_TIME_PERIOD_pop(sk) ((OSSL_TIME_PERIOD *)OPENSSL_sk_pop(ossl_check_OSSL_TIME_PERIOD_sk_type(sk))) +#define sk_OSSL_TIME_PERIOD_shift(sk) ((OSSL_TIME_PERIOD *)OPENSSL_sk_shift(ossl_check_OSSL_TIME_PERIOD_sk_type(sk))) +#define sk_OSSL_TIME_PERIOD_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_TIME_PERIOD_sk_type(sk), ossl_check_OSSL_TIME_PERIOD_freefunc_type(freefunc)) +#define sk_OSSL_TIME_PERIOD_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_TIME_PERIOD_sk_type(sk), ossl_check_OSSL_TIME_PERIOD_type(ptr), (idx)) +#define sk_OSSL_TIME_PERIOD_set(sk, idx, ptr) ((OSSL_TIME_PERIOD *)OPENSSL_sk_set(ossl_check_OSSL_TIME_PERIOD_sk_type(sk), (idx), ossl_check_OSSL_TIME_PERIOD_type(ptr))) +#define sk_OSSL_TIME_PERIOD_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_TIME_PERIOD_sk_type(sk), ossl_check_OSSL_TIME_PERIOD_type(ptr)) +#define sk_OSSL_TIME_PERIOD_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_TIME_PERIOD_sk_type(sk), ossl_check_OSSL_TIME_PERIOD_type(ptr)) +#define sk_OSSL_TIME_PERIOD_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_TIME_PERIOD_sk_type(sk), ossl_check_OSSL_TIME_PERIOD_type(ptr), pnum) +#define sk_OSSL_TIME_PERIOD_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_TIME_PERIOD_sk_type(sk)) +#define sk_OSSL_TIME_PERIOD_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_TIME_PERIOD_sk_type(sk)) +#define sk_OSSL_TIME_PERIOD_dup(sk) ((STACK_OF(OSSL_TIME_PERIOD) *)OPENSSL_sk_dup(ossl_check_const_OSSL_TIME_PERIOD_sk_type(sk))) +#define sk_OSSL_TIME_PERIOD_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_TIME_PERIOD) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_TIME_PERIOD_sk_type(sk), ossl_check_OSSL_TIME_PERIOD_copyfunc_type(copyfunc), ossl_check_OSSL_TIME_PERIOD_freefunc_type(freefunc))) +#define sk_OSSL_TIME_PERIOD_set_cmp_func(sk, cmp) ((sk_OSSL_TIME_PERIOD_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_TIME_PERIOD_sk_type(sk), ossl_check_OSSL_TIME_PERIOD_compfunc_type(cmp))) + +/* clang-format on */ + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(OSSL_DAY_TIME_BAND, OSSL_DAY_TIME_BAND, OSSL_DAY_TIME_BAND) +#define sk_OSSL_DAY_TIME_BAND_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_DAY_TIME_BAND_sk_type(sk)) +#define sk_OSSL_DAY_TIME_BAND_value(sk, idx) ((OSSL_DAY_TIME_BAND *)OPENSSL_sk_value(ossl_check_const_OSSL_DAY_TIME_BAND_sk_type(sk), (idx))) +#define sk_OSSL_DAY_TIME_BAND_new(cmp) ((STACK_OF(OSSL_DAY_TIME_BAND) *)OPENSSL_sk_new(ossl_check_OSSL_DAY_TIME_BAND_compfunc_type(cmp))) +#define sk_OSSL_DAY_TIME_BAND_new_null() ((STACK_OF(OSSL_DAY_TIME_BAND) *)OPENSSL_sk_new_null()) +#define sk_OSSL_DAY_TIME_BAND_new_reserve(cmp, n) ((STACK_OF(OSSL_DAY_TIME_BAND) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_DAY_TIME_BAND_compfunc_type(cmp), (n))) +#define sk_OSSL_DAY_TIME_BAND_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_DAY_TIME_BAND_sk_type(sk), (n)) +#define sk_OSSL_DAY_TIME_BAND_free(sk) OPENSSL_sk_free(ossl_check_OSSL_DAY_TIME_BAND_sk_type(sk)) +#define sk_OSSL_DAY_TIME_BAND_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_DAY_TIME_BAND_sk_type(sk)) +#define sk_OSSL_DAY_TIME_BAND_delete(sk, i) ((OSSL_DAY_TIME_BAND *)OPENSSL_sk_delete(ossl_check_OSSL_DAY_TIME_BAND_sk_type(sk), (i))) +#define sk_OSSL_DAY_TIME_BAND_delete_ptr(sk, ptr) ((OSSL_DAY_TIME_BAND *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_DAY_TIME_BAND_sk_type(sk), ossl_check_OSSL_DAY_TIME_BAND_type(ptr))) +#define sk_OSSL_DAY_TIME_BAND_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_DAY_TIME_BAND_sk_type(sk), ossl_check_OSSL_DAY_TIME_BAND_type(ptr)) +#define sk_OSSL_DAY_TIME_BAND_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_DAY_TIME_BAND_sk_type(sk), ossl_check_OSSL_DAY_TIME_BAND_type(ptr)) +#define sk_OSSL_DAY_TIME_BAND_pop(sk) ((OSSL_DAY_TIME_BAND *)OPENSSL_sk_pop(ossl_check_OSSL_DAY_TIME_BAND_sk_type(sk))) +#define sk_OSSL_DAY_TIME_BAND_shift(sk) ((OSSL_DAY_TIME_BAND *)OPENSSL_sk_shift(ossl_check_OSSL_DAY_TIME_BAND_sk_type(sk))) +#define sk_OSSL_DAY_TIME_BAND_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_DAY_TIME_BAND_sk_type(sk), ossl_check_OSSL_DAY_TIME_BAND_freefunc_type(freefunc)) +#define sk_OSSL_DAY_TIME_BAND_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_DAY_TIME_BAND_sk_type(sk), ossl_check_OSSL_DAY_TIME_BAND_type(ptr), (idx)) +#define sk_OSSL_DAY_TIME_BAND_set(sk, idx, ptr) ((OSSL_DAY_TIME_BAND *)OPENSSL_sk_set(ossl_check_OSSL_DAY_TIME_BAND_sk_type(sk), (idx), ossl_check_OSSL_DAY_TIME_BAND_type(ptr))) +#define sk_OSSL_DAY_TIME_BAND_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_DAY_TIME_BAND_sk_type(sk), ossl_check_OSSL_DAY_TIME_BAND_type(ptr)) +#define sk_OSSL_DAY_TIME_BAND_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_DAY_TIME_BAND_sk_type(sk), ossl_check_OSSL_DAY_TIME_BAND_type(ptr)) +#define sk_OSSL_DAY_TIME_BAND_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_DAY_TIME_BAND_sk_type(sk), ossl_check_OSSL_DAY_TIME_BAND_type(ptr), pnum) +#define sk_OSSL_DAY_TIME_BAND_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_DAY_TIME_BAND_sk_type(sk)) +#define sk_OSSL_DAY_TIME_BAND_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_DAY_TIME_BAND_sk_type(sk)) +#define sk_OSSL_DAY_TIME_BAND_dup(sk) ((STACK_OF(OSSL_DAY_TIME_BAND) *)OPENSSL_sk_dup(ossl_check_const_OSSL_DAY_TIME_BAND_sk_type(sk))) +#define sk_OSSL_DAY_TIME_BAND_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_DAY_TIME_BAND) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_DAY_TIME_BAND_sk_type(sk), ossl_check_OSSL_DAY_TIME_BAND_copyfunc_type(copyfunc), ossl_check_OSSL_DAY_TIME_BAND_freefunc_type(freefunc))) +#define sk_OSSL_DAY_TIME_BAND_set_cmp_func(sk, cmp) ((sk_OSSL_DAY_TIME_BAND_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_DAY_TIME_BAND_sk_type(sk), ossl_check_OSSL_DAY_TIME_BAND_compfunc_type(cmp))) + +/* clang-format on */ + +/* Attribute Type and Value */ +typedef struct atav_st { + ASN1_OBJECT *type; + ASN1_TYPE *value; +} OSSL_ATAV; + +typedef struct ATTRIBUTE_TYPE_MAPPING_st { + ASN1_OBJECT *local; + ASN1_OBJECT *remote; +} OSSL_ATTRIBUTE_TYPE_MAPPING; + +typedef struct ATTRIBUTE_VALUE_MAPPING_st { + OSSL_ATAV *local; + OSSL_ATAV *remote; +} OSSL_ATTRIBUTE_VALUE_MAPPING; + +#define OSSL_ATTR_MAP_TYPE 0 +#define OSSL_ATTR_MAP_VALUE 1 + +typedef struct ATTRIBUTE_MAPPING_st { + int type; + union { + OSSL_ATTRIBUTE_TYPE_MAPPING *typeMappings; + OSSL_ATTRIBUTE_VALUE_MAPPING *typeValueMappings; + } choice; +} OSSL_ATTRIBUTE_MAPPING; + +typedef STACK_OF(OSSL_ATTRIBUTE_MAPPING) OSSL_ATTRIBUTE_MAPPINGS; +DECLARE_ASN1_FUNCTIONS(OSSL_ATAV) +DECLARE_ASN1_FUNCTIONS(OSSL_ATTRIBUTE_TYPE_MAPPING) +DECLARE_ASN1_FUNCTIONS(OSSL_ATTRIBUTE_VALUE_MAPPING) +DECLARE_ASN1_FUNCTIONS(OSSL_ATTRIBUTE_MAPPING) +DECLARE_ASN1_FUNCTIONS(OSSL_ATTRIBUTE_MAPPINGS) + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(OSSL_ATTRIBUTE_MAPPING, OSSL_ATTRIBUTE_MAPPING, OSSL_ATTRIBUTE_MAPPING) +#define sk_OSSL_ATTRIBUTE_MAPPING_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_ATTRIBUTE_MAPPING_sk_type(sk)) +#define sk_OSSL_ATTRIBUTE_MAPPING_value(sk, idx) ((OSSL_ATTRIBUTE_MAPPING *)OPENSSL_sk_value(ossl_check_const_OSSL_ATTRIBUTE_MAPPING_sk_type(sk), (idx))) +#define sk_OSSL_ATTRIBUTE_MAPPING_new(cmp) ((STACK_OF(OSSL_ATTRIBUTE_MAPPING) *)OPENSSL_sk_new(ossl_check_OSSL_ATTRIBUTE_MAPPING_compfunc_type(cmp))) +#define sk_OSSL_ATTRIBUTE_MAPPING_new_null() ((STACK_OF(OSSL_ATTRIBUTE_MAPPING) *)OPENSSL_sk_new_null()) +#define sk_OSSL_ATTRIBUTE_MAPPING_new_reserve(cmp, n) ((STACK_OF(OSSL_ATTRIBUTE_MAPPING) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_ATTRIBUTE_MAPPING_compfunc_type(cmp), (n))) +#define sk_OSSL_ATTRIBUTE_MAPPING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_ATTRIBUTE_MAPPING_sk_type(sk), (n)) +#define sk_OSSL_ATTRIBUTE_MAPPING_free(sk) OPENSSL_sk_free(ossl_check_OSSL_ATTRIBUTE_MAPPING_sk_type(sk)) +#define sk_OSSL_ATTRIBUTE_MAPPING_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_ATTRIBUTE_MAPPING_sk_type(sk)) +#define sk_OSSL_ATTRIBUTE_MAPPING_delete(sk, i) ((OSSL_ATTRIBUTE_MAPPING *)OPENSSL_sk_delete(ossl_check_OSSL_ATTRIBUTE_MAPPING_sk_type(sk), (i))) +#define sk_OSSL_ATTRIBUTE_MAPPING_delete_ptr(sk, ptr) ((OSSL_ATTRIBUTE_MAPPING *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_ATTRIBUTE_MAPPING_sk_type(sk), ossl_check_OSSL_ATTRIBUTE_MAPPING_type(ptr))) +#define sk_OSSL_ATTRIBUTE_MAPPING_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_ATTRIBUTE_MAPPING_sk_type(sk), ossl_check_OSSL_ATTRIBUTE_MAPPING_type(ptr)) +#define sk_OSSL_ATTRIBUTE_MAPPING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_ATTRIBUTE_MAPPING_sk_type(sk), ossl_check_OSSL_ATTRIBUTE_MAPPING_type(ptr)) +#define sk_OSSL_ATTRIBUTE_MAPPING_pop(sk) ((OSSL_ATTRIBUTE_MAPPING *)OPENSSL_sk_pop(ossl_check_OSSL_ATTRIBUTE_MAPPING_sk_type(sk))) +#define sk_OSSL_ATTRIBUTE_MAPPING_shift(sk) ((OSSL_ATTRIBUTE_MAPPING *)OPENSSL_sk_shift(ossl_check_OSSL_ATTRIBUTE_MAPPING_sk_type(sk))) +#define sk_OSSL_ATTRIBUTE_MAPPING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_ATTRIBUTE_MAPPING_sk_type(sk), ossl_check_OSSL_ATTRIBUTE_MAPPING_freefunc_type(freefunc)) +#define sk_OSSL_ATTRIBUTE_MAPPING_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_ATTRIBUTE_MAPPING_sk_type(sk), ossl_check_OSSL_ATTRIBUTE_MAPPING_type(ptr), (idx)) +#define sk_OSSL_ATTRIBUTE_MAPPING_set(sk, idx, ptr) ((OSSL_ATTRIBUTE_MAPPING *)OPENSSL_sk_set(ossl_check_OSSL_ATTRIBUTE_MAPPING_sk_type(sk), (idx), ossl_check_OSSL_ATTRIBUTE_MAPPING_type(ptr))) +#define sk_OSSL_ATTRIBUTE_MAPPING_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_ATTRIBUTE_MAPPING_sk_type(sk), ossl_check_OSSL_ATTRIBUTE_MAPPING_type(ptr)) +#define sk_OSSL_ATTRIBUTE_MAPPING_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_ATTRIBUTE_MAPPING_sk_type(sk), ossl_check_OSSL_ATTRIBUTE_MAPPING_type(ptr)) +#define sk_OSSL_ATTRIBUTE_MAPPING_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_ATTRIBUTE_MAPPING_sk_type(sk), ossl_check_OSSL_ATTRIBUTE_MAPPING_type(ptr), pnum) +#define sk_OSSL_ATTRIBUTE_MAPPING_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_ATTRIBUTE_MAPPING_sk_type(sk)) +#define sk_OSSL_ATTRIBUTE_MAPPING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_ATTRIBUTE_MAPPING_sk_type(sk)) +#define sk_OSSL_ATTRIBUTE_MAPPING_dup(sk) ((STACK_OF(OSSL_ATTRIBUTE_MAPPING) *)OPENSSL_sk_dup(ossl_check_const_OSSL_ATTRIBUTE_MAPPING_sk_type(sk))) +#define sk_OSSL_ATTRIBUTE_MAPPING_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_ATTRIBUTE_MAPPING) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_ATTRIBUTE_MAPPING_sk_type(sk), ossl_check_OSSL_ATTRIBUTE_MAPPING_copyfunc_type(copyfunc), ossl_check_OSSL_ATTRIBUTE_MAPPING_freefunc_type(freefunc))) +#define sk_OSSL_ATTRIBUTE_MAPPING_set_cmp_func(sk, cmp) ((sk_OSSL_ATTRIBUTE_MAPPING_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_ATTRIBUTE_MAPPING_sk_type(sk), ossl_check_OSSL_ATTRIBUTE_MAPPING_compfunc_type(cmp))) + +/* clang-format on */ + +#define OSSL_AAA_ATTRIBUTE_TYPE 0 +#define OSSL_AAA_ATTRIBUTE_VALUES 1 + +typedef struct ALLOWED_ATTRIBUTES_CHOICE_st { + int type; + union { + ASN1_OBJECT *attributeType; + X509_ATTRIBUTE *attributeTypeandValues; + } choice; +} OSSL_ALLOWED_ATTRIBUTES_CHOICE; + +typedef struct ALLOWED_ATTRIBUTES_ITEM_st { + STACK_OF(OSSL_ALLOWED_ATTRIBUTES_CHOICE) *attributes; + GENERAL_NAME *holderDomain; +} OSSL_ALLOWED_ATTRIBUTES_ITEM; + +typedef STACK_OF(OSSL_ALLOWED_ATTRIBUTES_ITEM) OSSL_ALLOWED_ATTRIBUTES_SYNTAX; + +DECLARE_ASN1_FUNCTIONS(OSSL_ALLOWED_ATTRIBUTES_CHOICE) +DECLARE_ASN1_FUNCTIONS(OSSL_ALLOWED_ATTRIBUTES_ITEM) +DECLARE_ASN1_FUNCTIONS(OSSL_ALLOWED_ATTRIBUTES_SYNTAX) + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(OSSL_ALLOWED_ATTRIBUTES_CHOICE, OSSL_ALLOWED_ATTRIBUTES_CHOICE, OSSL_ALLOWED_ATTRIBUTES_CHOICE) +#define sk_OSSL_ALLOWED_ATTRIBUTES_CHOICE_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_ALLOWED_ATTRIBUTES_CHOICE_sk_type(sk)) +#define sk_OSSL_ALLOWED_ATTRIBUTES_CHOICE_value(sk, idx) ((OSSL_ALLOWED_ATTRIBUTES_CHOICE *)OPENSSL_sk_value(ossl_check_const_OSSL_ALLOWED_ATTRIBUTES_CHOICE_sk_type(sk), (idx))) +#define sk_OSSL_ALLOWED_ATTRIBUTES_CHOICE_new(cmp) ((STACK_OF(OSSL_ALLOWED_ATTRIBUTES_CHOICE) *)OPENSSL_sk_new(ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_compfunc_type(cmp))) +#define sk_OSSL_ALLOWED_ATTRIBUTES_CHOICE_new_null() ((STACK_OF(OSSL_ALLOWED_ATTRIBUTES_CHOICE) *)OPENSSL_sk_new_null()) +#define sk_OSSL_ALLOWED_ATTRIBUTES_CHOICE_new_reserve(cmp, n) ((STACK_OF(OSSL_ALLOWED_ATTRIBUTES_CHOICE) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_compfunc_type(cmp), (n))) +#define sk_OSSL_ALLOWED_ATTRIBUTES_CHOICE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_sk_type(sk), (n)) +#define sk_OSSL_ALLOWED_ATTRIBUTES_CHOICE_free(sk) OPENSSL_sk_free(ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_sk_type(sk)) +#define sk_OSSL_ALLOWED_ATTRIBUTES_CHOICE_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_sk_type(sk)) +#define sk_OSSL_ALLOWED_ATTRIBUTES_CHOICE_delete(sk, i) ((OSSL_ALLOWED_ATTRIBUTES_CHOICE *)OPENSSL_sk_delete(ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_sk_type(sk), (i))) +#define sk_OSSL_ALLOWED_ATTRIBUTES_CHOICE_delete_ptr(sk, ptr) ((OSSL_ALLOWED_ATTRIBUTES_CHOICE *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_sk_type(sk), ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_type(ptr))) +#define sk_OSSL_ALLOWED_ATTRIBUTES_CHOICE_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_sk_type(sk), ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_type(ptr)) +#define sk_OSSL_ALLOWED_ATTRIBUTES_CHOICE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_sk_type(sk), ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_type(ptr)) +#define sk_OSSL_ALLOWED_ATTRIBUTES_CHOICE_pop(sk) ((OSSL_ALLOWED_ATTRIBUTES_CHOICE *)OPENSSL_sk_pop(ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_sk_type(sk))) +#define sk_OSSL_ALLOWED_ATTRIBUTES_CHOICE_shift(sk) ((OSSL_ALLOWED_ATTRIBUTES_CHOICE *)OPENSSL_sk_shift(ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_sk_type(sk))) +#define sk_OSSL_ALLOWED_ATTRIBUTES_CHOICE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_sk_type(sk), ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_freefunc_type(freefunc)) +#define sk_OSSL_ALLOWED_ATTRIBUTES_CHOICE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_sk_type(sk), ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_type(ptr), (idx)) +#define sk_OSSL_ALLOWED_ATTRIBUTES_CHOICE_set(sk, idx, ptr) ((OSSL_ALLOWED_ATTRIBUTES_CHOICE *)OPENSSL_sk_set(ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_sk_type(sk), (idx), ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_type(ptr))) +#define sk_OSSL_ALLOWED_ATTRIBUTES_CHOICE_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_sk_type(sk), ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_type(ptr)) +#define sk_OSSL_ALLOWED_ATTRIBUTES_CHOICE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_sk_type(sk), ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_type(ptr)) +#define sk_OSSL_ALLOWED_ATTRIBUTES_CHOICE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_sk_type(sk), ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_type(ptr), pnum) +#define sk_OSSL_ALLOWED_ATTRIBUTES_CHOICE_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_sk_type(sk)) +#define sk_OSSL_ALLOWED_ATTRIBUTES_CHOICE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_ALLOWED_ATTRIBUTES_CHOICE_sk_type(sk)) +#define sk_OSSL_ALLOWED_ATTRIBUTES_CHOICE_dup(sk) ((STACK_OF(OSSL_ALLOWED_ATTRIBUTES_CHOICE) *)OPENSSL_sk_dup(ossl_check_const_OSSL_ALLOWED_ATTRIBUTES_CHOICE_sk_type(sk))) +#define sk_OSSL_ALLOWED_ATTRIBUTES_CHOICE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_ALLOWED_ATTRIBUTES_CHOICE) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_ALLOWED_ATTRIBUTES_CHOICE_sk_type(sk), ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_copyfunc_type(copyfunc), ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_freefunc_type(freefunc))) +#define sk_OSSL_ALLOWED_ATTRIBUTES_CHOICE_set_cmp_func(sk, cmp) ((sk_OSSL_ALLOWED_ATTRIBUTES_CHOICE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_sk_type(sk), ossl_check_OSSL_ALLOWED_ATTRIBUTES_CHOICE_compfunc_type(cmp))) + +/* clang-format on */ + +/* clang-format off */ +SKM_DEFINE_STACK_OF_INTERNAL(OSSL_ALLOWED_ATTRIBUTES_ITEM, OSSL_ALLOWED_ATTRIBUTES_ITEM, OSSL_ALLOWED_ATTRIBUTES_ITEM) +#define sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_ALLOWED_ATTRIBUTES_ITEM_sk_type(sk)) +#define sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_value(sk, idx) ((OSSL_ALLOWED_ATTRIBUTES_ITEM *)OPENSSL_sk_value(ossl_check_const_OSSL_ALLOWED_ATTRIBUTES_ITEM_sk_type(sk), (idx))) +#define sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_new(cmp) ((STACK_OF(OSSL_ALLOWED_ATTRIBUTES_ITEM) *)OPENSSL_sk_new(ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_compfunc_type(cmp))) +#define sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_new_null() ((STACK_OF(OSSL_ALLOWED_ATTRIBUTES_ITEM) *)OPENSSL_sk_new_null()) +#define sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_new_reserve(cmp, n) ((STACK_OF(OSSL_ALLOWED_ATTRIBUTES_ITEM) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_compfunc_type(cmp), (n))) +#define sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_sk_type(sk), (n)) +#define sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_free(sk) OPENSSL_sk_free(ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_sk_type(sk)) +#define sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_sk_type(sk)) +#define sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_delete(sk, i) ((OSSL_ALLOWED_ATTRIBUTES_ITEM *)OPENSSL_sk_delete(ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_sk_type(sk), (i))) +#define sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_delete_ptr(sk, ptr) ((OSSL_ALLOWED_ATTRIBUTES_ITEM *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_sk_type(sk), ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_type(ptr))) +#define sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_sk_type(sk), ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_type(ptr)) +#define sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_sk_type(sk), ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_type(ptr)) +#define sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_pop(sk) ((OSSL_ALLOWED_ATTRIBUTES_ITEM *)OPENSSL_sk_pop(ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_sk_type(sk))) +#define sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_shift(sk) ((OSSL_ALLOWED_ATTRIBUTES_ITEM *)OPENSSL_sk_shift(ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_sk_type(sk))) +#define sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_sk_type(sk), ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_freefunc_type(freefunc)) +#define sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_sk_type(sk), ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_type(ptr), (idx)) +#define sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_set(sk, idx, ptr) ((OSSL_ALLOWED_ATTRIBUTES_ITEM *)OPENSSL_sk_set(ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_sk_type(sk), (idx), ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_type(ptr))) +#define sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_sk_type(sk), ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_type(ptr)) +#define sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_sk_type(sk), ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_type(ptr)) +#define sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_sk_type(sk), ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_type(ptr), pnum) +#define sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_sk_type(sk)) +#define sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_ALLOWED_ATTRIBUTES_ITEM_sk_type(sk)) +#define sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_dup(sk) ((STACK_OF(OSSL_ALLOWED_ATTRIBUTES_ITEM) *)OPENSSL_sk_dup(ossl_check_const_OSSL_ALLOWED_ATTRIBUTES_ITEM_sk_type(sk))) +#define sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_ALLOWED_ATTRIBUTES_ITEM) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_ALLOWED_ATTRIBUTES_ITEM_sk_type(sk), ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_copyfunc_type(copyfunc), ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_freefunc_type(freefunc))) +#define sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_set_cmp_func(sk, cmp) ((sk_OSSL_ALLOWED_ATTRIBUTES_ITEM_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_sk_type(sk), ossl_check_OSSL_ALLOWED_ATTRIBUTES_ITEM_compfunc_type(cmp))) + +/* clang-format on */ + +typedef struct AA_DIST_POINT_st { + DIST_POINT_NAME *distpoint; + ASN1_BIT_STRING *reasons; + int dp_reasons; + ASN1_BOOLEAN indirectCRL; + ASN1_BOOLEAN containsUserAttributeCerts; + ASN1_BOOLEAN containsAACerts; + ASN1_BOOLEAN containsSOAPublicKeyCerts; +} OSSL_AA_DIST_POINT; + +DECLARE_ASN1_FUNCTIONS(OSSL_AA_DIST_POINT) + +#ifdef __cplusplus +} +#endif +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/x509v3err.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/x509v3err.h new file mode 100644 index 0000000000000000000000000000000000000000..19f938626bd8470a581292fdf5a246fdf43cd00c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/include/openssl/x509v3err.h @@ -0,0 +1,95 @@ +/* + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_X509V3ERR_H +#define OPENSSL_X509V3ERR_H +#pragma once + +#include +#include +#include + +/* + * X509V3 reason codes. + */ +#define X509V3_R_BAD_IP_ADDRESS 118 +#define X509V3_R_BAD_OBJECT 119 +#define X509V3_R_BAD_OPTION 170 +#define X509V3_R_BAD_VALUE 171 +#define X509V3_R_BN_DEC2BN_ERROR 100 +#define X509V3_R_BN_TO_ASN1_INTEGER_ERROR 101 +#define X509V3_R_DIRNAME_ERROR 149 +#define X509V3_R_DISTPOINT_ALREADY_SET 160 +#define X509V3_R_DUPLICATE_ZONE_ID 133 +#define X509V3_R_EMPTY_KEY_USAGE 169 +#define X509V3_R_ERROR_CONVERTING_ZONE 131 +#define X509V3_R_ERROR_CREATING_EXTENSION 144 +#define X509V3_R_ERROR_IN_EXTENSION 128 +#define X509V3_R_EXPECTED_A_SECTION_NAME 137 +#define X509V3_R_EXTENSION_EXISTS 145 +#define X509V3_R_EXTENSION_NAME_ERROR 115 +#define X509V3_R_EXTENSION_NOT_FOUND 102 +#define X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED 103 +#define X509V3_R_EXTENSION_VALUE_ERROR 116 +#define X509V3_R_ILLEGAL_EMPTY_EXTENSION 151 +#define X509V3_R_INCORRECT_POLICY_SYNTAX_TAG 152 +#define X509V3_R_INVALID_ASNUMBER 162 +#define X509V3_R_INVALID_ASRANGE 163 +#define X509V3_R_INVALID_BOOLEAN_STRING 104 +#define X509V3_R_INVALID_CERTIFICATE 158 +#define X509V3_R_INVALID_EMPTY_NAME 108 +#define X509V3_R_INVALID_EXTENSION_STRING 105 +#define X509V3_R_INVALID_INHERITANCE 165 +#define X509V3_R_INVALID_IPADDRESS 166 +#define X509V3_R_INVALID_MULTIPLE_RDNS 161 +#define X509V3_R_INVALID_NAME 106 +#define X509V3_R_INVALID_NULL_ARGUMENT 107 +#define X509V3_R_INVALID_NULL_VALUE 109 +#define X509V3_R_INVALID_NUMBER 140 +#define X509V3_R_INVALID_NUMBERS 141 +#define X509V3_R_INVALID_OBJECT_IDENTIFIER 110 +#define X509V3_R_INVALID_OPTION 138 +#define X509V3_R_INVALID_POLICY_IDENTIFIER 134 +#define X509V3_R_INVALID_PROXY_POLICY_SETTING 153 +#define X509V3_R_INVALID_PURPOSE 146 +#define X509V3_R_INVALID_SAFI 164 +#define X509V3_R_INVALID_SECTION 135 +#define X509V3_R_INVALID_SYNTAX 143 +#define X509V3_R_ISSUER_DECODE_ERROR 126 +#define X509V3_R_MISSING_VALUE 124 +#define X509V3_R_NEED_ORGANIZATION_AND_NUMBERS 142 +#define X509V3_R_NEGATIVE_PATHLEN 168 +#define X509V3_R_NO_CONFIG_DATABASE 136 +#define X509V3_R_NO_ISSUER_CERTIFICATE 121 +#define X509V3_R_NO_ISSUER_DETAILS 127 +#define X509V3_R_NO_POLICY_IDENTIFIER 139 +#define X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED 154 +#define X509V3_R_NO_PUBLIC_KEY 114 +#define X509V3_R_NO_SUBJECT_DETAILS 125 +#define X509V3_R_OPERATION_NOT_DEFINED 148 +#define X509V3_R_OTHERNAME_ERROR 147 +#define X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED 155 +#define X509V3_R_POLICY_PATH_LENGTH 156 +#define X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED 157 +#define X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY 159 +#define X509V3_R_PURPOSE_NOT_UNIQUE 173 +#define X509V3_R_SECTION_NOT_FOUND 150 +#define X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS 122 +#define X509V3_R_UNABLE_TO_GET_ISSUER_KEYID 123 +#define X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT 111 +#define X509V3_R_UNKNOWN_EXTENSION 129 +#define X509V3_R_UNKNOWN_EXTENSION_NAME 130 +#define X509V3_R_UNKNOWN_OPTION 120 +#define X509V3_R_UNKNOWN_VALUE 172 +#define X509V3_R_UNSUPPORTED_OPTION 117 +#define X509V3_R_UNSUPPORTED_TYPE 167 +#define X509V3_R_USER_TOO_LONG 132 + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/lib/cmake/OpenSSL/OpenSSLConfig.cmake b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/lib/cmake/OpenSSL/OpenSSLConfig.cmake new file mode 100644 index 0000000000000000000000000000000000000000..ed0ab5e3ddf0a4baa5953bfa8de936537e8ffd72 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/lib/cmake/OpenSSL/OpenSSLConfig.cmake @@ -0,0 +1,162 @@ +# Generated by OpenSSL +# + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Avoid duplicate find_package() +set(_ossl_expected_targets OpenSSL::Crypto OpenSSL::SSL + OpenSSL::applink) +set(_ossl_defined_targets) +set(_ossl_undefined_targets) +foreach(t IN LISTS _ossl_expected_targets) + if(TARGET "${t}") + LIST(APPEND _ossl_defined_targets "${t}") + else() + LIST(APPEND _ossl_undefined_targets "${t}") + endif() +endforeach() +message(DEBUG "_ossl_expected_targets = ${_ossl_expected_targets}") +message(DEBUG "_ossl_defined_targets = ${_ossl_defined_targets}") +message(DEBUG "_ossl_undefined_targets = ${_ossl_undefined_targets}") +if(NOT _ossl_undefined_targets) + # All targets are defined, we're good, just undo everything and return + unset(_ossl_expected_targets) + unset(_ossl_defined_targets) + unset(_ossl_undefined_targets) + unset(CMAKE_IMPORT_FILE_VERSION) + return() +endif() +if(_ossl_defined_targets) + # We have a mix of defined and undefined targets. This is hard to reconcile, + # and probably the result of another config, or FindOpenSSL.cmake having been + # called, or whatever. Therefore, the best course of action is to quit with a + # hard error. + message(FATAL_ERROR "Some targets defined, others not:\nNot defined: ${_ossl_undefined_targets}\nDefined: ${_ossl_defined_targets}") +endif() +unset(_ossl_expected_targets) +unset(_ossl_defined_targets) +unset(_ossl_undefined_targets) + + +# Set up the import path, so all other import paths are made relative this file +get_filename_component(_ossl_prefix "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_ossl_prefix "${_ossl_prefix}" PATH) +get_filename_component(_ossl_prefix "${_ossl_prefix}" PATH) +get_filename_component(_ossl_prefix "${_ossl_prefix}" PATH) + +if(_ossl_prefix STREQUAL "/") + set(_ossl_prefix "") +endif() + + +if(OPENSSL_USE_STATIC_LIBS) + set(_ossl_use_static_libs True) +elseif(DEFINED OPENSSL_USE_STATIC_LIBS) + # We know OPENSSL_USE_STATIC_LIBS is defined and False + if(_ossl_use_static_libs) + # OPENSSL_USE_STATIC_LIBS is explicitly false, indicating that shared libraries are + # required. However, _ossl_use_static_libs indicates that no shared libraries are + # available. The best course of action is to simply return and leave it to CMake to + # use another OpenSSL config. + unset(_ossl_use_static_libs) + unset(CMAKE_IMPORT_FILE_VERSION) + return() + endif() +endif() + +# Version, copied from what find_package() gives, for compatibility with FindOpenSSL.cmake +set(OPENSSL_VERSION "${OpenSSL_VERSION}") +set(OPENSSL_VERSION_MAJOR "${OpenSSL_VERSION_MAJOR}") +set(OPENSSL_VERSION_MINOR "${OpenSSL_VERSION_MINOR}") +set(OPENSSL_VERSION_FIX "${OpenSSL_VERSION_PATCH}") +set(OPENSSL_FOUND YES) + +# Directories and names +set(OPENSSL_LIBRARY_DIR "${_ossl_prefix}/lib") +set(OPENSSL_INCLUDE_DIR "${_ossl_prefix}/include") +set(OPENSSL_ENGINES_DIR "${_ossl_prefix}/lib/engines-3") +set(OPENSSL_MODULES_DIR "${_ossl_prefix}/lib/ossl-modules") +set(OPENSSL_RUNTIME_DIR "${_ossl_prefix}/bin") + +set(OPENSSL_APPLINK_SOURCE "${_ossl_prefix}/include/openssl/applink.c") + +set(OPENSSL_PROGRAM "${OPENSSL_RUNTIME_DIR}/openssl.exe") + +# Set up the imported targets +if(_ossl_use_static_libs) + + add_library(OpenSSL::Crypto STATIC IMPORTED) + add_library(OpenSSL::SSL STATIC IMPORTED) + + set(OPENSSL_LIBCRYPTO_STATIC "${OPENSSL_LIBRARY_DIR}/libcrypto_static.lib") + set(OPENSSL_LIBCRYPTO_DEPENDENCIES ws2_32.lib gdi32.lib advapi32.lib crypt32.lib user32.lib) + set_target_properties(OpenSSL::Crypto PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + IMPORTED_LOCATION ${OPENSSL_LIBCRYPTO_STATIC}) + set_property(TARGET OpenSSL::Crypto + PROPERTY INTERFACE_LINK_LIBRARIES ${OPENSSL_LIBCRYPTO_DEPENDENCIES}) + + set(OPENSSL_LIBSSL_STATIC "${OPENSSL_LIBRARY_DIR}/libssl_static.lib") + set(OPENSSL_LIBSSL_DEPENDENCIES OpenSSL::Crypto) + set_target_properties(OpenSSL::SSL PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + IMPORTED_LOCATION ${OPENSSL_LIBSSL_STATIC}) + set_property(TARGET OpenSSL::SSL + PROPERTY INTERFACE_LINK_LIBRARIES ${OPENSSL_LIBSSL_DEPENDENCIES}) + + # Directories and names compatible with CMake's FindOpenSSL.cmake + set(OPENSSL_CRYPTO_LIBRARY ${OPENSSL_LIBCRYPTO_STATIC}) + set(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY} ${OPENSSL_LIBCRYPTO_DEPENDENCIES}) + set(OPENSSL_SSL_LIBRARY ${OPENSSL_LIBSSL_STATIC}) + set(OPENSSL_SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_LIBSSL_DEPENDENCIES}) + set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_LIBSSL_DEPENDENCIES} ${OPENSSL_LIBCRYPTO_DEPENDENCIES}) + +else() + + add_library(OpenSSL::Crypto SHARED IMPORTED) + add_library(OpenSSL::SSL SHARED IMPORTED) + + set(OPENSSL_LIBCRYPTO_SHARED "${OPENSSL_RUNTIME_DIR}/libcrypto-3-x64.dll") + set(OPENSSL_LIBCRYPTO_IMPORT "${OPENSSL_LIBRARY_DIR}/libcrypto.lib") + set(OPENSSL_LIBCRYPTO_DEPENDENCIES ) + set_target_properties(OpenSSL::Crypto PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + IMPORTED_IMPLIB ${OPENSSL_LIBCRYPTO_IMPORT} + IMPORTED_LOCATION ${OPENSSL_LIBCRYPTO_SHARED}) + set_property(TARGET OpenSSL::Crypto + PROPERTY INTERFACE_LINK_LIBRARIES ${OPENSSL_LIBCRYPTO_DEPENDENCIES}) + + set(OPENSSL_LIBSSL_SHARED "${OPENSSL_RUNTIME_DIR}/libssl-3-x64.dll") + set(OPENSSL_LIBSSL_IMPORT "${OPENSSL_LIBRARY_DIR}/libssl.lib") + set(OPENSSL_LIBSSL_DEPENDENCIES OpenSSL::Crypto ) + set_target_properties(OpenSSL::SSL PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + IMPORTED_IMPLIB ${OPENSSL_LIBSSL_IMPORT} + IMPORTED_LOCATION ${OPENSSL_LIBSSL_SHARED}) + set_property(TARGET OpenSSL::SSL + PROPERTY INTERFACE_LINK_LIBRARIES ${OPENSSL_LIBSSL_DEPENDENCIES}) + + # Directories and names compatible with CMake's FindOpenSSL.cmake + set(OPENSSL_CRYPTO_LIBRARY ${OPENSSL_LIBCRYPTO_IMPORT}) + set(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY} ${OPENSSL_LIBCRYPTO_DEPENDENCIES}) + set(OPENSSL_SSL_LIBRARY ${OPENSSL_LIBSSL_IMPORT}) + set(OPENSSL_SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_LIBSSL_DEPENDENCIES}) + set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_LIBSSL_DEPENDENCIES} ${OPENSSL_LIBCRYPTO_DEPENDENCIES}) + + +endif() + +set_target_properties(OpenSSL::Crypto PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${OPENSSL_INCLUDE_DIR}") +set_target_properties(OpenSSL::SSL PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${OPENSSL_INCLUDE_DIR}") + + +add_library(OpenSSL::applink INTERFACE IMPORTED) +set_property(TARGET OpenSSL::applink PROPERTY + INTERFACE_SOURCES "${OPENSSL_APPLINK_SOURCE}") + + +unset(_ossl_prefix) +unset(_ossl_use_static_libs) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/lib/cmake/OpenSSL/OpenSSLConfigVersion.cmake b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/lib/cmake/OpenSSL/OpenSSLConfigVersion.cmake new file mode 100644 index 0000000000000000000000000000000000000000..af1c5ecbeb498ea3c19967e1b3185ab74487a4f4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/lib/cmake/OpenSSL/OpenSSLConfigVersion.cmake @@ -0,0 +1,18 @@ +# Generated by OpenSSL +# + +set(PACKAGE_VERSION 3.6.2) + +if(NOT PACKAGE_FIND_VERSION) + # find_package() was called without any version information. This is assumed to + # mean that the caller accepts whatever they get. + set(PACKAGE_VERSION_COMPATIBLE 1) +elseif(PACKAGE_FIND_VERSION_MAJOR LESS 3 + OR PACKAGE_FIND_VERSION VERSION_GREATER 3.6.2) + set(PACKAGE_VERSION_UNSUITABLE 1) +else() + set(PACKAGE_VERSION_COMPATIBLE 1) + if(PACKAGE_FIND_VERSION VERSION_EQUAL 3.6.2) + set(PACKAGE_VERSION_EXACT 1) + endif() +endif() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/lib/pkgconfig/libcrypto.pc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/lib/pkgconfig/libcrypto.pc new file mode 100644 index 0000000000000000000000000000000000000000..972c730ff3f5eb4054f87a4be601331c5c1b2333 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/lib/pkgconfig/libcrypto.pc @@ -0,0 +1,11 @@ +prefix=D:/bld/openssl_split_1775587024900/_h_env/Library +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: OpenSSL-libcrypto +Description: OpenSSL cryptography library +Libs: -L"${libdir}" -llibcrypto +Libs.private: -lcrypt32 -lws2_32 +Cflags: -I"${includedir}" +Version: 3.6.2 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/lib/pkgconfig/libssl.pc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/lib/pkgconfig/libssl.pc new file mode 100644 index 0000000000000000000000000000000000000000..357730b4a52d11443ea3e88ef6dcd01b6be90e8e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/lib/pkgconfig/libssl.pc @@ -0,0 +1,11 @@ +prefix=D:/bld/openssl_split_1775587024900/_h_env/Library +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: OpenSSL-libssl +Description: Secure Sockets Layer and cryptography libraries +Libs: -L"${libdir}" -llibssl +Requires: libcrypto +Cflags: -I"${includedir}" +Version: 3.6.2 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/lib/pkgconfig/openssl.pc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/lib/pkgconfig/openssl.pc new file mode 100644 index 0000000000000000000000000000000000000000..e08df3853386587601ebe54baa05607c9f16cf70 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/lib/pkgconfig/openssl.pc @@ -0,0 +1,9 @@ +prefix=D:/bld/openssl_split_1775587024900/_h_env/Library +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: OpenSSL +Description: Secure Sockets Layer and cryptography libraries and tools +Requires: libssl libcrypto +Version: 3.6.2 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/ssl/certs/.keep b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/ssl/certs/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/etc/conda/activate.d/openssl_activate-win.bat b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/etc/conda/activate.d/openssl_activate-win.bat new file mode 100644 index 0000000000000000000000000000000000000000..076fd037ce65cdc225ea540c26da93750e24e0cc --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/etc/conda/activate.d/openssl_activate-win.bat @@ -0,0 +1,9 @@ +@echo off +if "%SSL_CERT_FILE%"=="" ( + set "SSL_CERT_FILE=%CONDA_PREFIX%\Library\ssl\cacert.pem" + set "__CONDA_OPENSSL_CERT_FILE_SET=1" +) +if "%SSL_CERT_DIR%"=="" ( + set "SSL_CERT_DIR=%CONDA_PREFIX%\Library\ssl\certs" + set "__CONDA_OPENSSL_CERT_DIR_SET=1" +) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/etc/conda/activate.d/openssl_activate-win.ps1 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/etc/conda/activate.d/openssl_activate-win.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..35f9da56ba0c1a6fd886b0f84d22b6df03621b50 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/etc/conda/activate.d/openssl_activate-win.ps1 @@ -0,0 +1,8 @@ +if (-not $Env:SSL_CERT_FILE) { + $Env:SSL_CERT_FILE = "$Env:CONDA_PREFIX\Library\ssl\cacert.pem" + $Env:__CONDA_OPENSSL_CERT_FILE_SET = "1" +} +if (-not $Env:SSL_CERT_DIR) { + $Env:SSL_CERT_DIR = "$Env:CONDA_PREFIX\Library\ssl\certs" + $Env:__CONDA_OPENSSL_CERT_DIR_SET = "1" +} diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/etc/conda/activate.d/openssl_activate-win.sh b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/etc/conda/activate.d/openssl_activate-win.sh new file mode 100644 index 0000000000000000000000000000000000000000..221a46be1c56525e097d42ab5a05fc1fd83380d9 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/etc/conda/activate.d/openssl_activate-win.sh @@ -0,0 +1,8 @@ +if [[ "${SSL_CERT_FILE:-}" == "" ]]; then + export SSL_CERT_FILE="${CONDA_PREFIX}\\Library\\ssl\\cacert.pem" + export __CONDA_OPENSSL_CERT_FILE_SET="1" +fi +if [[ "${SSL_CERT_DIR:-}" == "" ]]; then + export SSL_CERT_DIR="${CONDA_PREFIX}\\Library\\ssl\\certs" + export __CONDA_OPENSSL_CERT_DIR_SET="1" +fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/etc/conda/deactivate.d/openssl_deactivate-win.bat b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/etc/conda/deactivate.d/openssl_deactivate-win.bat new file mode 100644 index 0000000000000000000000000000000000000000..8ed388a78d9f9846e59d40f8778e531807390983 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/etc/conda/deactivate.d/openssl_deactivate-win.bat @@ -0,0 +1,9 @@ +@echo off +if "%__CONDA_OPENSSL_CERT_FILE_SET%" == "1" ( + set SSL_CERT_FILE= + set __CONDA_OPENSSL_CERT_FILE_SET= +) +if "%__CONDA_OPENSSL_CERT_DIR_SET%" == "1" ( + set SSL_CERT_DIR= + set __CONDA_OPENSSL_CERT_DIR_SET= +) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/etc/conda/deactivate.d/openssl_deactivate-win.ps1 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/etc/conda/deactivate.d/openssl_deactivate-win.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..4553936867dfe9d4bc7793f4e54410edaf63f096 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/etc/conda/deactivate.d/openssl_deactivate-win.ps1 @@ -0,0 +1,8 @@ +if ($Env:__CONDA_OPENSSL_CERT_FILE_SET -eq "1") { + Remove-Item -Path Env:\SSL_CERT_FILE + Remove-Item -Path Env:\__CONDA_OPENSSL_CERT_FILE_SET +} +if ($Env:__CONDA_OPENSSL_CERT_DIR_SET -eq "1") { + Remove-Item -Path Env:\SSL_CERT_DIR + Remove-Item -Path Env:\__CONDA_OPENSSL_CERT_DIR_SET +} diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/etc/conda/deactivate.d/openssl_deactivate-win.sh b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/etc/conda/deactivate.d/openssl_deactivate-win.sh new file mode 100644 index 0000000000000000000000000000000000000000..0a75e534ef22919c5129b62bc213b5a148663de4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/etc/conda/deactivate.d/openssl_deactivate-win.sh @@ -0,0 +1,8 @@ +if [[ "${__CONDA_OPENSSL_CERT_FILE_SET:-}" == "1" ]]; then + unset SSL_CERT_FILE + unset __CONDA_OPENSSL_CERT_FILE_SET +fi +if [[ "${__CONDA_OPENSSL_CERT_DIR_SET:-}" == "1" ]]; then + unset SSL_CERT_DIR + unset __CONDA_OPENSSL_CERT_DIR_SET +fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/about.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/about.json new file mode 100644 index 0000000000000000000000000000000000000000..d7b699e7efb364930c170a483a9280c101ab397e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/about.json @@ -0,0 +1,312 @@ +{ + "channels": [ + "https://conda.anaconda.org/conda-forge" + ], + "conda_build_version": "26.3.0", + "conda_version": "26.3.1", + "dev_url": "https://github.com/openssl/openssl", + "doc_url": "https://docs.openssl.org/master/", + "env_vars": { + "CIO_TEST": "" + }, + "extra": { + "copy_test_source_files": true, + "feedstock-name": "openssl", + "final": true, + "flow_run_id": "azure_20260407.2.1", + "parent_recipe": { + "name": "openssl_split", + "path": "D:\\a\\1\\s\\recipe", + "version": "3.6.2" + }, + "recipe-maintainers": [ + "jakirkham", + "msarahan", + "ocefpaf", + "pelson", + "h-vetinari" + ], + "remote_url": "https://github.com/conda-forge/openssl-feedstock", + "sha": "6d80792e2b8b538ce06710ed9a9316620e2fcf78" + }, + "home": "https://www.openssl.org/", + "identifiers": [], + "keywords": [], + "license": "Apache-2.0", + "license_family": "Apache", + "license_file": "LICENSE.txt", + "root_pkgs": [ + "anaconda-auth 0.14.0 pyhd8ed1ab_0", + "anaconda-cli-base 0.8.2 pyhc364b38_0", + "anaconda-client 1.14.1 pyhcf101f3_0", + "annotated-doc 0.0.4 pyhcf101f3_0", + "annotated-types 0.7.0 pyhd8ed1ab_1", + "anyio 4.13.0 pyhcf101f3_0", + "archspec 0.2.5 pyhd8ed1ab_0", + "attrs 26.1.0 pyhcf101f3_0", + "backports 1.0 pyhd8ed1ab_5", + "backports.tarfile 1.2.0 pyhcf101f3_2", + "backports.zstd 1.3.0 py312h06d0912_0", + "beautifulsoup4 4.14.3 pyha770c72_0", + "boltons 25.0.0 pyhd8ed1ab_0", + "brotli-python 1.2.0 py312hc6d9e41_1", + "bzip2 1.0.8 h0ad9c76_9", + "ca-certificates 2026.2.25 h4c7d964_0", + "certifi 2026.2.25 pyhd8ed1ab_0", + "cffi 2.0.0 py312he06e257_1", + "chardet 5.2.0 pyhd8ed1ab_3", + "charset-normalizer 3.4.7 pyhd8ed1ab_0", + "click 8.3.2 pyh6dadd2b_0", + "colorama 0.4.6 pyhd8ed1ab_1", + "conda 26.3.1 py312h2e8e312_0", + "conda-build 26.3.0 pyhe63316d_0", + "conda-env 2.6.0 1", + "conda-forge-ci-setup 4.24.2 py312h3368cd0_101", + "conda-forge-metadata 0.13.0 pyhcf101f3_0", + "conda-index 0.10.0 pyhd8ed1ab_0", + "conda-libmamba-solver 26.3.0 pyhd8ed1ab_0", + "conda-oci-mirror 0.2.3 pyhd8ed1ab_0", + "conda-package-handling 2.4.0 pyh7900ff3_2", + "conda-package-streaming 0.12.0 pyhd8ed1ab_0", + "cpp-expected 1.3.1 h477610d_0", + "cryptography 46.0.5 py312h232196e_0", + "defusedxml 0.7.1 pyhd8ed1ab_0", + "deprecated 1.3.1 pyhd8ed1ab_1", + "distro 1.9.0 pyhd8ed1ab_1", + "evalidate 2.0.5 pyhe01879c_0", + "exceptiongroup 1.3.1 pyhd8ed1ab_0", + "filelock 3.25.2 pyhd8ed1ab_0", + "fmt 12.1.0 h7f4e812_0", + "frozendict 2.4.7 py312he06e257_0", + "h11 0.16.0 pyhcf101f3_1", + "h2 4.3.0 pyhcf101f3_0", + "hpack 4.1.0 pyhd8ed1ab_0", + "httpcore 1.0.9 pyh29332c3_0", + "httpx 0.28.1 pyhd8ed1ab_0", + "hyperframe 6.1.0 pyhd8ed1ab_0", + "idna 3.11 pyhd8ed1ab_0", + "importlib-metadata 8.8.0 pyhcf101f3_0", + "importlib_resources 6.5.2 pyhd8ed1ab_0", + "jaraco.classes 3.4.0 pyhcf101f3_3", + "jaraco.context 6.1.1 pyhcf101f3_0", + "jaraco.functools 4.4.0 pyhcf101f3_1", + "jinja2 3.1.6 pyhcf101f3_1", + "joblib 1.5.3 pyhd8ed1ab_0", + "jsonpatch 1.33 pyhd8ed1ab_1", + "jsonpointer 3.1.1 pyhcf101f3_0", + "jsonschema 4.26.0 pyhcf101f3_0", + "jsonschema-specifications 2025.9.1 pyhcf101f3_0", + "jupyter_core 5.9.1 pyh6dadd2b_0", + "keyring 25.7.0 pyh7428d3b_0", + "krb5 1.22.2 h0ea6238_0", + "lcms2 2.18 hf2c6c5f_0", + "lerc 4.1.0 hd936e49_0", + "libarchive 3.8.6 gpl_he24518a_100", + "libcurl 8.19.0 h8206538_0", + "libdeflate 1.25 h51727cc_0", + "libexpat 2.7.5 hac47afa_0", + "libffi 3.5.2 h3d046cb_0", + "libfreetype 2.14.3 h57928b3_0", + "libfreetype6 2.14.3 hdbac1cb_0", + "libgcc 15.2.0 h8ee18e1_18", + "libgomp 15.2.0 h8ee18e1_18", + "libiconv 1.18 hc1393d2_2", + "libjpeg-turbo 3.1.2 hfd05255_0", + "liblief 0.17.6 hac47afa_0", + "liblzma 5.8.2 hfd05255_0", + "libmamba 2.5.0 h06825f5_0", + "libmamba-spdlog 2.5.0 h9ae1bf1_0", + "libmambapy 2.5.0 py312h26e665a_0", + "libpng 1.6.56 h7351971_0", + "libsolv 0.7.36 h8883371_0", + "libsqlite 3.52.0 hf5d6505_0", + "libssh2 1.11.1 h9aa295b_0", + "libtiff 4.7.1 h8f73337_1", + "libwebp-base 1.6.0 h4d5522a_0", + "libwinpthread 12.0.0.r4.gg4f2fc60ca h57928b3_10", + "libxcb 1.17.0 h0e4246c_0", + "libxml2-16 2.15.2 h692994f_0", + "libxml2 2.15.2 h5d26750_0", + "libzlib 1.3.2 hfd05255_2", + "lz4-c 1.10.0 h2466b09_1", + "lzo 2.10 h6a83c73_1002", + "m2-bash 5.2.037.2 hc364b38_6", + "m2-brotli 1.1.0.2 hc364b38_6", + "m2-ca-certificates 20241223.1 hc364b38_6", + "m2-conda-epoch 20250515 0_x86_64", + "m2-coreutils 8.32.5 hc364b38_6", + "m2-curl 8.9.1.1 hc364b38_6", + "m2-db 6.2.32.5 hc364b38_6", + "m2-file 5.46.2 hc364b38_6", + "m2-filesystem 2025.02.23.1 hc364b38_10", + "m2-findutils 4.9.0.3 hc364b38_6", + "m2-gcc-libs 13.3.0.1 hc364b38_6", + "m2-gdbm 1.25.1 hc364b38_6", + "m2-git 2.49.0.1 hc364b38_6", + "m2-gmp 6.3.0.1 hc364b38_6", + "m2-gzip 1.14.1 hc364b38_6", + "m2-heimdal 7.8.0.5 hc364b38_6", + "m2-heimdal-libs 7.8.0.5 hc364b38_6", + "m2-info 7.2.1 hc364b38_6", + "m2-less 668.1 hc364b38_6", + "m2-libbz2 1.0.8.4 hc364b38_6", + "m2-libcbor 0.12.0.1 hc364b38_6", + "m2-libcurl 8.9.1.1 hc364b38_6", + "m2-libdb 6.2.32.5 hc364b38_6", + "m2-libedit 20240808_3.1.1 hc364b38_6", + "m2-libexpat 2.7.1.1 hc364b38_6", + "m2-libffi 3.4.8.1 hc364b38_6", + "m2-libfido2 1.16.0.1 hc364b38_6", + "m2-libgdbm 1.25.1 hc364b38_6", + "m2-libiconv 1.18.1 hc364b38_6", + "m2-libidn2 2.3.8.1 hc364b38_6", + "m2-libintl 0.22.5.1 hc364b38_6", + "m2-liblzma 5.8.1.1 hc364b38_6", + "m2-libnghttp2 1.65.0.1 hc364b38_6", + "m2-libopenssl 3.5.0.1 hc364b38_6", + "m2-libp11-kit 0.25.5.2 hc364b38_6", + "m2-libpcre2_8 10.45.1 hc364b38_6", + "m2-libpsl 0.21.5.2 hc364b38_6", + "m2-libreadline 8.2.013.1 hc364b38_6", + "m2-libsqlite 3.49.1.2 hc364b38_6", + "m2-libssh2 1.11.1.1 hc364b38_6", + "m2-libtasn1 4.20.0.1 hc364b38_6", + "m2-libunistring 1.3.1 hc364b38_6", + "m2-libxcrypt 4.4.38.1 hc364b38_6", + "m2-libzstd 1.5.7.1 hc364b38_6", + "m2-msys2-runtime 3.6.1.4 hc364b38_6", + "m2-nano 8.4.1 hc364b38_6", + "m2-ncurses 6.5.20240831.2 hc364b38_6", + "m2-openssh 9.9p2.1 hc364b38_6", + "m2-openssl 3.5.0.1 hc364b38_6", + "m2-p11-kit 0.25.5.2 hc364b38_6", + "m2-patch 2.7.6.3 hc364b38_6", + "m2-perl 5.38.4.2 hc364b38_6", + "m2-perl-authen-sasl 2.1800.1 hc364b38_6", + "m2-perl-clone 0.47.1 hc364b38_6", + "m2-perl-convert-binhex 1.125.2 hc364b38_6", + "m2-perl-encode-locale 1.05.2 hc364b38_6", + "m2-perl-error 0.17030.1 hc364b38_6", + "m2-perl-file-listing 6.16.1 hc364b38_6", + "m2-perl-html-parser 3.83.1 hc364b38_6", + "m2-perl-html-tagset 3.24.1 hc364b38_6", + "m2-perl-http-cookiejar 0.014.1 hc364b38_6", + "m2-perl-http-cookies 6.11.1 hc364b38_6", + "m2-perl-http-daemon 6.16.1 hc364b38_6", + "m2-perl-http-date 6.06.1 hc364b38_6", + "m2-perl-http-message 7.00.1 hc364b38_6", + "m2-perl-http-negotiate 6.01.3 hc364b38_6", + "m2-perl-io-html 1.004.2 hc364b38_6", + "m2-perl-io-socket-ip 0.41.2 hc364b38_6", + "m2-perl-io-socket-ssl 2.089.1 hc364b38_6", + "m2-perl-io-stringy 2.113.2 hc364b38_6", + "m2-perl-libwww 6.78.1 hc364b38_6", + "m2-perl-lwp-mediatypes 6.04.2 hc364b38_6", + "m2-perl-mailtools 2.22.1 hc364b38_6", + "m2-perl-mime-tools 5.515.1 hc364b38_6", + "m2-perl-net-http 6.23.1 hc364b38_6", + "m2-perl-net-smtp-ssl 1.04.2 hc364b38_6", + "m2-perl-net-ssleay 1.94.2 hc364b38_6", + "m2-perl-termreadkey 2.38.6 hc364b38_6", + "m2-perl-timedate 2.33.2 hc364b38_6", + "m2-perl-try-tiny 0.32.1 hc364b38_6", + "m2-perl-uri 5.31.1 hc364b38_6", + "m2-perl-www-robotrules 6.02.3 hc364b38_6", + "m2-sed 4.9.1 hc364b38_6", + "m2-zlib 1.3.1.1 hc364b38_6", + "mamba 2.5.0 hf588a56_0", + "markdown-it-py 4.0.0 pyhd8ed1ab_0", + "markupsafe 3.0.3 py312h05f76fc_1", + "mbedtls 3.6.3.1 he0c23c2_0", + "mdurl 0.1.2 pyhd8ed1ab_1", + "menuinst 2.4.2 py312hbb81ca0_0", + "more-itertools 11.0.1 pyhcf101f3_0", + "msgpack-python 1.1.2 py312hf90b1b7_1", + "nbformat 5.10.4 pyhd8ed1ab_1", + "nlohmann_json-abi 3.12.0 h0f90c79_1", + "openjpeg 2.5.4 h0e57b4f_0", + "openssl 3.6.1 hf411b9b_1", + "oras-py 0.1.14 pyhd8ed1ab_0", + "packaging 26.0 pyhcf101f3_0", + "pillow 12.2.0 py312h31f0997_0", + "pip 26.0.1 pyh8b19718_0", + "pkce 1.0.3 pyhd8ed1ab_1", + "pkginfo 1.12.1.2 pyhd8ed1ab_0", + "platformdirs 4.9.4 pyhcf101f3_0", + "pluggy 1.6.0 pyhf9edf01_1", + "psutil 7.2.2 py312he5662c2_0", + "pthread-stubs 0.4 h0e40799_1002", + "py-lief 0.17.6 py312hbb81ca0_0", + "pybind11-abi 11 hc364b38_1", + "pycosat 0.6.6 py312he06e257_3", + "pycparser 2.22 pyh29332c3_1", + "pydantic 2.12.5 pyhcf101f3_1", + "pydantic-core 2.41.5 py312hdabe01f_1", + "pydantic-settings 2.13.1 pyhd8ed1ab_0", + "pygments 2.20.0 pyhd8ed1ab_0", + "pyjwt 2.12.1 pyhcf101f3_0", + "pysocks 1.7.1 pyh09c184e_7", + "python 3.12.13 h0159041_0_cpython", + "python-dateutil 2.9.0.post0 pyhe01879c_2", + "python-dotenv 1.2.2 pyhcf101f3_0", + "python-fastjsonschema 2.21.2 pyhe01879c_0", + "python-libarchive-c 5.3 pyhe01879c_1", + "python_abi 3.12 8_cp312", + "pytz 2026.1.post1 pyhcf101f3_0", + "pywin32 311 py312h829343e_1", + "pywin32-ctypes 0.2.3 py312h2e8e312_3", + "pyyaml 6.0.3 py312h05f76fc_1", + "rattler-build 0.61.4 he94b42d_0", + "rattler-build-conda-compat 1.4.11 pyhd8ed1ab_0", + "readchar 4.2.2 pyhcf101f3_0", + "referencing 0.37.0 pyhcf101f3_0", + "reproc 14.2.5.post0 h2466b09_0", + "reproc-cpp 14.2.5.post0 he0c23c2_0", + "requests 2.33.1 pyhcf101f3_0", + "requests-toolbelt 1.0.0 pyhd8ed1ab_1", + "rich 14.3.3 pyhcf101f3_0", + "ripgrep 15.1.0 h77a83cd_0", + "rpds-py 0.30.0 py312hdabe01f_0", + "ruamel.yaml 0.18.17 py312he5662c2_2", + "ruamel.yaml.clib 0.2.15 py312he5662c2_1", + "semver 3.0.4 pyhcf101f3_1", + "setuptools 82.0.1 pyh332efcf_0", + "shellingham 1.5.4 pyhd8ed1ab_2", + "shyaml 0.6.2 pyhd3deb0d_0", + "simdjson 4.2.4 h49e36cd_0", + "six 1.17.0 pyhe01879c_1", + "sniffio 1.3.1 pyhd8ed1ab_2", + "soupsieve 2.8.3 pyhd8ed1ab_0", + "spdlog 1.17.0 h9f585f1_1", + "tk 8.6.13 h6ed50ae_3", + "tomli 2.4.1 pyhcf101f3_0", + "tomlkit 0.14.0 pyha770c72_0", + "tqdm 4.67.3 pyha7b4d00_0", + "traitlets 5.14.3 pyhd8ed1ab_1", + "truststore 0.10.4 pyhcf101f3_0", + "typer 0.24.1 pyhcf101f3_0", + "typing-extensions 4.15.0 h396c80c_0", + "typing-inspection 0.4.2 pyhd8ed1ab_1", + "typing_extensions 4.15.0 pyhcf101f3_0", + "tzdata 2025c hc9c84f9_1", + "ucrt 10.0.26100.0 h57928b3_0", + "urllib3 2.6.3 pyhd8ed1ab_0", + "vc 14.3 h41ae7f8_34", + "vc14_runtime 14.44.35208 h818238b_34", + "vcomp14 14.44.35208 h818238b_34", + "wheel 0.46.3 pyhd8ed1ab_0", + "win_inet_pton 1.1.0 pyh7428d3b_8", + "wrapt 2.1.2 py312he06e257_0", + "xorg-libxau 1.0.12 hba3369d_1", + "xorg-libxdmcp 1.1.5 hba3369d_1", + "yaml 0.2.5 h6a83c73_3", + "yaml-cpp 0.8.0 he0c23c2_0", + "zipp 3.23.0 pyhcf101f3_1", + "zlib-ng 2.3.3 h0261ad2_1", + "zstandard 0.25.0 py312he5662c2_1", + "zstd 1.5.7 h534d264_6", + "_openmp_mutex 4.5 20_gnu" + ], + "summary": "OpenSSL is an open-source implementation of the SSL and TLS protocols", + "tags": [] +} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/files b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/files new file mode 100644 index 0000000000000000000000000000000000000000..9dbffe887bc891dc6f8b8c516fc09109c18eecfb --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/files @@ -0,0 +1,166 @@ +Library/bin/c_rehash.pl +Library/bin/libcrypto-3-x64.dll +Library/bin/libcrypto-3-x64.pdb +Library/bin/libssl-3-x64.dll +Library/bin/libssl-3-x64.pdb +Library/bin/openssl.exe +Library/bin/openssl.pdb +Library/include/openssl/__DECC_INCLUDE_EPILOGUE.H +Library/include/openssl/__DECC_INCLUDE_PROLOGUE.H +Library/include/openssl/aes.h +Library/include/openssl/applink.c +Library/include/openssl/asn1.h +Library/include/openssl/asn1err.h +Library/include/openssl/asn1t.h +Library/include/openssl/async.h +Library/include/openssl/asyncerr.h +Library/include/openssl/bio.h +Library/include/openssl/bioerr.h +Library/include/openssl/blowfish.h +Library/include/openssl/bn.h +Library/include/openssl/bnerr.h +Library/include/openssl/buffer.h +Library/include/openssl/buffererr.h +Library/include/openssl/byteorder.h +Library/include/openssl/camellia.h +Library/include/openssl/cast.h +Library/include/openssl/cmac.h +Library/include/openssl/cmp.h +Library/include/openssl/cmp_util.h +Library/include/openssl/cmperr.h +Library/include/openssl/cms.h +Library/include/openssl/cmserr.h +Library/include/openssl/comp.h +Library/include/openssl/comperr.h +Library/include/openssl/conf.h +Library/include/openssl/conf_api.h +Library/include/openssl/conferr.h +Library/include/openssl/configuration.h +Library/include/openssl/conftypes.h +Library/include/openssl/core.h +Library/include/openssl/core_dispatch.h +Library/include/openssl/core_names.h +Library/include/openssl/core_object.h +Library/include/openssl/crmf.h +Library/include/openssl/crmferr.h +Library/include/openssl/crypto.h +Library/include/openssl/cryptoerr.h +Library/include/openssl/cryptoerr_legacy.h +Library/include/openssl/ct.h +Library/include/openssl/cterr.h +Library/include/openssl/decoder.h +Library/include/openssl/decodererr.h +Library/include/openssl/des.h +Library/include/openssl/dh.h +Library/include/openssl/dherr.h +Library/include/openssl/dsa.h +Library/include/openssl/dsaerr.h +Library/include/openssl/dtls1.h +Library/include/openssl/e_os2.h +Library/include/openssl/e_ostime.h +Library/include/openssl/ebcdic.h +Library/include/openssl/ec.h +Library/include/openssl/ecdh.h +Library/include/openssl/ecdsa.h +Library/include/openssl/ecerr.h +Library/include/openssl/encoder.h +Library/include/openssl/encodererr.h +Library/include/openssl/engine.h +Library/include/openssl/engineerr.h +Library/include/openssl/err.h +Library/include/openssl/ess.h +Library/include/openssl/esserr.h +Library/include/openssl/evp.h +Library/include/openssl/evperr.h +Library/include/openssl/fips_names.h +Library/include/openssl/fipskey.h +Library/include/openssl/hmac.h +Library/include/openssl/hpke.h +Library/include/openssl/http.h +Library/include/openssl/httperr.h +Library/include/openssl/idea.h +Library/include/openssl/indicator.h +Library/include/openssl/kdf.h +Library/include/openssl/kdferr.h +Library/include/openssl/lhash.h +Library/include/openssl/macros.h +Library/include/openssl/md2.h +Library/include/openssl/md4.h +Library/include/openssl/md5.h +Library/include/openssl/mdc2.h +Library/include/openssl/ml_kem.h +Library/include/openssl/modes.h +Library/include/openssl/obj_mac.h +Library/include/openssl/objects.h +Library/include/openssl/objectserr.h +Library/include/openssl/ocsp.h +Library/include/openssl/ocsperr.h +Library/include/openssl/opensslconf.h +Library/include/openssl/opensslv.h +Library/include/openssl/ossl_typ.h +Library/include/openssl/param_build.h +Library/include/openssl/params.h +Library/include/openssl/pem.h +Library/include/openssl/pem2.h +Library/include/openssl/pemerr.h +Library/include/openssl/pkcs12.h +Library/include/openssl/pkcs12err.h +Library/include/openssl/pkcs7.h +Library/include/openssl/pkcs7err.h +Library/include/openssl/prov_ssl.h +Library/include/openssl/proverr.h +Library/include/openssl/provider.h +Library/include/openssl/quic.h +Library/include/openssl/rand.h +Library/include/openssl/randerr.h +Library/include/openssl/rc2.h +Library/include/openssl/rc4.h +Library/include/openssl/rc5.h +Library/include/openssl/ripemd.h +Library/include/openssl/rsa.h +Library/include/openssl/rsaerr.h +Library/include/openssl/safestack.h +Library/include/openssl/seed.h +Library/include/openssl/self_test.h +Library/include/openssl/sha.h +Library/include/openssl/srp.h +Library/include/openssl/srtp.h +Library/include/openssl/ssl.h +Library/include/openssl/ssl2.h +Library/include/openssl/ssl3.h +Library/include/openssl/sslerr.h +Library/include/openssl/sslerr_legacy.h +Library/include/openssl/stack.h +Library/include/openssl/store.h +Library/include/openssl/storeerr.h +Library/include/openssl/symhacks.h +Library/include/openssl/thread.h +Library/include/openssl/tls1.h +Library/include/openssl/trace.h +Library/include/openssl/ts.h +Library/include/openssl/tserr.h +Library/include/openssl/txt_db.h +Library/include/openssl/types.h +Library/include/openssl/ui.h +Library/include/openssl/uierr.h +Library/include/openssl/whrlpool.h +Library/include/openssl/x509.h +Library/include/openssl/x509_acert.h +Library/include/openssl/x509_vfy.h +Library/include/openssl/x509err.h +Library/include/openssl/x509v3.h +Library/include/openssl/x509v3err.h +Library/lib/cmake/OpenSSL/OpenSSLConfig.cmake +Library/lib/cmake/OpenSSL/OpenSSLConfigVersion.cmake +Library/lib/libcrypto.lib +Library/lib/libssl.lib +Library/lib/pkgconfig/libcrypto.pc +Library/lib/pkgconfig/libssl.pc +Library/lib/pkgconfig/openssl.pc +Library/ssl/certs/.keep +etc/conda/activate.d/openssl_activate-win.bat +etc/conda/activate.d/openssl_activate-win.ps1 +etc/conda/activate.d/openssl_activate-win.sh +etc/conda/deactivate.d/openssl_deactivate-win.bat +etc/conda/deactivate.d/openssl_deactivate-win.ps1 +etc/conda/deactivate.d/openssl_deactivate-win.sh diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/git b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/git new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/has_prefix b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/has_prefix new file mode 100644 index 0000000000000000000000000000000000000000..e3ba413125a552ad94f6c46cc19fcd23f80dd2dd --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/has_prefix @@ -0,0 +1,4 @@ +"D:/bld/openssl_split_1775587024900/_h_env" text "Library/lib/pkgconfig/libcrypto.pc" +"D:/bld/openssl_split_1775587024900/_h_env" text "Library/lib/pkgconfig/libssl.pc" +"D:/bld/openssl_split_1775587024900/_h_env" text "Library/lib/pkgconfig/openssl.pc" +"D:\\bld\\openssl_split_1775587024900\\_h_env" text "Library/bin/c_rehash.pl" diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/hash_input.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/hash_input.json new file mode 100644 index 0000000000000000000000000000000000000000..4a2868c236152524b26287095dc8246b5feadd88 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/hash_input.json @@ -0,0 +1,7 @@ +{ + "c_compiler": "vs2022", + "target_platform": "win-64", + "c_stdlib": "vs", + "openssl": "3.5", + "channel_targets": "conda-forge main" +} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/index.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/index.json new file mode 100644 index 0000000000000000000000000000000000000000..cdd93de14496ba5b6c55206b020d5dbfa167a506 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/index.json @@ -0,0 +1,18 @@ +{ + "arch": "x86_64", + "build": "hf411b9b_0", + "build_number": 0, + "depends": [ + "ca-certificates", + "ucrt >=10.0.20348.0", + "vc >=14.3,<15", + "vc14_runtime >=14.44.35208" + ], + "license": "Apache-2.0", + "license_family": "Apache", + "name": "openssl", + "platform": "win", + "subdir": "win-64", + "timestamp": 1775589779763, + "version": "3.6.2" +} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/licenses/LICENSE.txt b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/licenses/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..49cc83d2ee29d13453188217f0e4edd70c7f842f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/licenses/LICENSE.txt @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/paths.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/paths.json new file mode 100644 index 0000000000000000000000000000000000000000..0b5800d5bd8831f0ffe1774b24e21368b1ab5466 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/paths.json @@ -0,0 +1,1009 @@ +{ + "paths": [ + { + "_path": "Library/bin/c_rehash.pl", + "file_mode": "text", + "path_type": "hardlink", + "prefix_placeholder": "D:\\\\bld\\\\openssl_split_1775587024900\\\\_h_env", + "sha256": "a546d4641c707d6b997fc19eded963403c2010c2495446c45023a72c3a59c5e8", + "size_in_bytes": 7274 + }, + { + "_path": "Library/bin/libcrypto-3-x64.dll", + "path_type": "hardlink", + "sha256": "23263b220487605daaa64aba45253603f837e5f90a31dde2409d0bb8f22e8582", + "size_in_bytes": 7425536 + }, + { + "_path": "Library/bin/libcrypto-3-x64.pdb", + "path_type": "hardlink", + "sha256": "a3ab508286b129851fa75a401020fff85b531c1bb426916a3de10e405d8cf7b3", + "size_in_bytes": 25759744 + }, + { + "_path": "Library/bin/libssl-3-x64.dll", + "path_type": "hardlink", + "sha256": "9b9bbb55566202928ad79cf3e2a4e95d49c74dd351edfafe3625bb2b2b284c69", + "size_in_bytes": 1319936 + }, + { + "_path": "Library/bin/libssl-3-x64.pdb", + "path_type": "hardlink", + "sha256": "bfe365d23248babcc6330956b0e8c231cfbfa6e43796d1b7b420bd43dc71a01b", + "size_in_bytes": 5951488 + }, + { + "_path": "Library/bin/openssl.exe", + "path_type": "hardlink", + "sha256": "317fb242f6c21d0a92bf0d41d7ddda8e3bb5b5a570021f5df9d3474698d3d491", + "size_in_bytes": 817152 + }, + { + "_path": "Library/bin/openssl.pdb", + "path_type": "hardlink", + "sha256": "2b46661a80e22ea145943deedb04317889792ae7960b3baed5055bf2d31ed61b", + "size_in_bytes": 4018176 + }, + { + "_path": "Library/include/openssl/__DECC_INCLUDE_EPILOGUE.H", + "path_type": "hardlink", + "sha256": "3d837d015f23ad248d7e0c74b5b8ca102d81525f166a0a4b7c19900eea982644", + "size_in_bytes": 729 + }, + { + "_path": "Library/include/openssl/__DECC_INCLUDE_PROLOGUE.H", + "path_type": "hardlink", + "sha256": "e66be3418a7b707f09fa011c85b0b3fdfcfa1740c46da11385abf23fe9983529", + "size_in_bytes": 801 + }, + { + "_path": "Library/include/openssl/aes.h", + "path_type": "hardlink", + "sha256": "130e304c466bda5db6de2fdbca3a970905070ab935d702e61c8371334851ea27", + "size_in_bytes": 3311 + }, + { + "_path": "Library/include/openssl/applink.c", + "path_type": "hardlink", + "sha256": "f8d9a9eb3ca7e81b717257d9521a3a949a2bbf480e142aef50d7bb0717b28549", + "size_in_bytes": 3929 + }, + { + "_path": "Library/include/openssl/asn1.h", + "path_type": "hardlink", + "sha256": "5be93d0bbe9cb292929a8adb5a90f63bfb2fa619033f5732497c01f45e616023", + "size_in_bytes": 58869 + }, + { + "_path": "Library/include/openssl/asn1err.h", + "path_type": "hardlink", + "sha256": "9d60638b3d0c52170d390fe566c0b96a6381590590cc3dd71339eb85140fe1d6", + "size_in_bytes": 5169 + }, + { + "_path": "Library/include/openssl/asn1t.h", + "path_type": "hardlink", + "sha256": "93c0efe91d1eb493e12689b0f07718668e33ce156d74d90b26a2deb7bca665b4", + "size_in_bytes": 39537 + }, + { + "_path": "Library/include/openssl/async.h", + "path_type": "hardlink", + "sha256": "708d52ecd7bb5ca83d243ddecb132db0693b0809f65c093eabda549156934030", + "size_in_bytes": 3019 + }, + { + "_path": "Library/include/openssl/asyncerr.h", + "path_type": "hardlink", + "sha256": "eb6ea0f0389aa7846ea5b8f5b7b8d2a82a7b52e7dbfa105bc137e52be1399a69", + "size_in_bytes": 739 + }, + { + "_path": "Library/include/openssl/bio.h", + "path_type": "hardlink", + "sha256": "730aa167f8f1c300df00d2eed021db0e16e3cc7266400bf4e5787491ea3b8f40", + "size_in_bytes": 42433 + }, + { + "_path": "Library/include/openssl/bioerr.h", + "path_type": "hardlink", + "sha256": "fe1bf57251e4eaab30d2a6aa2048ee93deb1f0f15ef6634f61093b4d405586c6", + "size_in_bytes": 2355 + }, + { + "_path": "Library/include/openssl/blowfish.h", + "path_type": "hardlink", + "sha256": "97064924914f71425e48f5d53893abca0f07f329dde7a8b93b581dc9ee2e837a", + "size_in_bytes": 2136 + }, + { + "_path": "Library/include/openssl/bn.h", + "path_type": "hardlink", + "sha256": "113a732a94b0221fdcda3e0b0f24b7d389072b2920291c23c0849c7bc5030b3f", + "size_in_bytes": 22309 + }, + { + "_path": "Library/include/openssl/bnerr.h", + "path_type": "hardlink", + "sha256": "beeb78746fbcc2c09e1f833f4c2ea72e845e757390aad7dc8699f7787b580204", + "size_in_bytes": 1329 + }, + { + "_path": "Library/include/openssl/buffer.h", + "path_type": "hardlink", + "sha256": "c7b9803f89bb492176a1e2738999dad86195ab8048a26e8ec9ef6948b8882e8a", + "size_in_bytes": 1591 + }, + { + "_path": "Library/include/openssl/buffererr.h", + "path_type": "hardlink", + "sha256": "4dea6e8ec7f09bfbdaa85fa3e75572b95d2ea62a813e7420a04f5f56ee7ccdfd", + "size_in_bytes": 587 + }, + { + "_path": "Library/include/openssl/byteorder.h", + "path_type": "hardlink", + "sha256": "f062018f5fbe9f8459967dffaaa8e27f34596fb0da21fc011d0d556384a0305c", + "size_in_bytes": 8444 + }, + { + "_path": "Library/include/openssl/camellia.h", + "path_type": "hardlink", + "sha256": "e03acf0f3406032e5322e4f3368e8e48e5b73e8846955c3bcb3a4f1cb54d2ebc", + "size_in_bytes": 3266 + }, + { + "_path": "Library/include/openssl/cast.h", + "path_type": "hardlink", + "sha256": "4fafc375a53d88fe4c709d8ee5fb74dc0fcaf91915837c3c6b4df0d916b07f0a", + "size_in_bytes": 1880 + }, + { + "_path": "Library/include/openssl/cmac.h", + "path_type": "hardlink", + "sha256": "048677b08aab6fd862d2b8b15556db8355d2142b93a9431ffba1d75a25912847", + "size_in_bytes": 1449 + }, + { + "_path": "Library/include/openssl/cmp.h", + "path_type": "hardlink", + "sha256": "c0250ad1f33590a5b8c107d50aff2668c16e0be63c4a1d9b84bc6f40b27770b2", + "size_in_bytes": 48882 + }, + { + "_path": "Library/include/openssl/cmp_util.h", + "path_type": "hardlink", + "sha256": "16c51c48c83c930b018ff711553e107f1870f1cedd32d94c06f15709b080c321", + "size_in_bytes": 1627 + }, + { + "_path": "Library/include/openssl/cmperr.h", + "path_type": "hardlink", + "sha256": "220d1a903b66e25fa1de92f3ee8b3f5ef27de6dface0a4ea68e683a19e3549a7", + "size_in_bytes": 4821 + }, + { + "_path": "Library/include/openssl/cms.h", + "path_type": "hardlink", + "sha256": "bbf1b8449418ea4a0eaf102e65e94fb761e548aabdbdfa3d86d24b2dfa2f4704", + "size_in_bytes": 32064 + }, + { + "_path": "Library/include/openssl/cmserr.h", + "path_type": "hardlink", + "sha256": "9faf0de7e75f3f14ef712186ee81770fe95631fc1000b2e96d2f1da289252db1", + "size_in_bytes": 4657 + }, + { + "_path": "Library/include/openssl/comp.h", + "path_type": "hardlink", + "sha256": "9ea34c5f1b7368038b2c2b7fa3334e74d09eba355ba7347a9b862368883fc173", + "size_in_bytes": 4798 + }, + { + "_path": "Library/include/openssl/comperr.h", + "path_type": "hardlink", + "sha256": "03faa7ac9cf7ec99350a55758a685056dae8f75992887e0411c23b0d8c5d83b0", + "size_in_bytes": 1002 + }, + { + "_path": "Library/include/openssl/conf.h", + "path_type": "hardlink", + "sha256": "2f92f8ada73781e31d45fffd17389d49dc7c2ff11c07c1ee0d383af5f1d5f72b", + "size_in_bytes": 10607 + }, + { + "_path": "Library/include/openssl/conf_api.h", + "path_type": "hardlink", + "sha256": "38dce9e9e0a438fcaf1d173c26e61c821bfd3756e221e3be76cf010580ac52f7", + "size_in_bytes": 1328 + }, + { + "_path": "Library/include/openssl/conferr.h", + "path_type": "hardlink", + "sha256": "ea9346e399d5dd1fbcca4f34078e1acb5039333602ecaf72faa04e32cdd55484", + "size_in_bytes": 1697 + }, + { + "_path": "Library/include/openssl/configuration.h", + "path_type": "hardlink", + "sha256": "82c5444330a596aff609b4987379dcd430ec57ce4632ea8088869d398e10c4f1", + "size_in_bytes": 5021 + }, + { + "_path": "Library/include/openssl/conftypes.h", + "path_type": "hardlink", + "sha256": "496997cc0f4c32b840677eeefd3ecb488453254be6e228b8cd34d4a4061a9e28", + "size_in_bytes": 1176 + }, + { + "_path": "Library/include/openssl/core.h", + "path_type": "hardlink", + "sha256": "4d4e63e2e01d06530515adbbe3c93601c5f0f5e1a96754d34d3470bccfcbdbc3", + "size_in_bytes": 7820 + }, + { + "_path": "Library/include/openssl/core_dispatch.h", + "path_type": "hardlink", + "sha256": "e1e5f63565543509d1377e50f64034ae29b2091caae3f1b8635bce5af0b29032", + "size_in_bytes": 47494 + }, + { + "_path": "Library/include/openssl/core_names.h", + "path_type": "hardlink", + "sha256": "18772ccc11e5793585e3d213654d37457eba8ae64a168951185ce2cd616d1671", + "size_in_bytes": 30513 + }, + { + "_path": "Library/include/openssl/core_object.h", + "path_type": "hardlink", + "sha256": "e8fa8c62ad1367bd325d59d721214d1a7afd5423205134152f60cc39a8590c8a", + "size_in_bytes": 1047 + }, + { + "_path": "Library/include/openssl/crmf.h", + "path_type": "hardlink", + "sha256": "44208a323f234f3194ae66490e8f2cfeef7000b20982db10e4ed55f0799f1287", + "size_in_bytes": 19926 + }, + { + "_path": "Library/include/openssl/crmferr.h", + "path_type": "hardlink", + "sha256": "9f2ff7a468b5048d543fef0324b39abdea63fa07bc915f62ff42a1937d7258c2", + "size_in_bytes": 1858 + }, + { + "_path": "Library/include/openssl/crypto.h", + "path_type": "hardlink", + "sha256": "e24ebdd9abc0267e35d9fa692233fd3ca462f5a03ccb9832286b65a606e29396", + "size_in_bytes": 25389 + }, + { + "_path": "Library/include/openssl/cryptoerr.h", + "path_type": "hardlink", + "sha256": "c457c0591449551657a69ff9727784a79cc1afd899ac733c682c1a41fefdaa19", + "size_in_bytes": 1986 + }, + { + "_path": "Library/include/openssl/cryptoerr_legacy.h", + "path_type": "hardlink", + "sha256": "985664cb71a62441b2822028340bb4ad5e3f98d6c74ba4c1bc7c997e188b97d3", + "size_in_bytes": 48019 + }, + { + "_path": "Library/include/openssl/ct.h", + "path_type": "hardlink", + "sha256": "2d1e1b6238c0315ca737d00a23b52dea0614ea1400ca70d5f3f7092cb9d742a8", + "size_in_bytes": 22814 + }, + { + "_path": "Library/include/openssl/cterr.h", + "path_type": "hardlink", + "sha256": "26d971ab2166ba4473864506dcd933290fa6c321956ef46220eb61fb33a04c89", + "size_in_bytes": 1241 + }, + { + "_path": "Library/include/openssl/decoder.h", + "path_type": "hardlink", + "sha256": "72dbf52e4dc4efbfaddbf31ab6f2bec3e9a5c22eed865d057b960a014a4b9ec8", + "size_in_bytes": 4907 + }, + { + "_path": "Library/include/openssl/decodererr.h", + "path_type": "hardlink", + "sha256": "c6818c667bdf8c37c5423580e0551359c69efc884198d28675db23e9fc70946e", + "size_in_bytes": 740 + }, + { + "_path": "Library/include/openssl/des.h", + "path_type": "hardlink", + "sha256": "420afefcf27f28046912c5f156bc9e93d71a2c8a47bf0f605695a13f391cd5f9", + "size_in_bytes": 7764 + }, + { + "_path": "Library/include/openssl/dh.h", + "path_type": "hardlink", + "sha256": "25080c32c48d5a88053c4b83c326e8f024b68249a0ef65d3c45af4f9aab6e0c6", + "size_in_bytes": 13025 + }, + { + "_path": "Library/include/openssl/dherr.h", + "path_type": "hardlink", + "sha256": "70f9e260865a9aae4c5f9a72d42d878e4dc216c906709245a8da2cceb79c3a14", + "size_in_bytes": 1702 + }, + { + "_path": "Library/include/openssl/dsa.h", + "path_type": "hardlink", + "sha256": "dac47d9779f83eb4e5a4f57c234e6eb25277cea68001384360e16c8859c38338", + "size_in_bytes": 10982 + }, + { + "_path": "Library/include/openssl/dsaerr.h", + "path_type": "hardlink", + "sha256": "b8fb8dae664d18298ae4b0c5444378e3f5c5d095256acb50764230159b1a15d6", + "size_in_bytes": 1164 + }, + { + "_path": "Library/include/openssl/dtls1.h", + "path_type": "hardlink", + "sha256": "3477022a712ecbb2bfb61b297c57026f1c354d52c638dfb22292183bd68d2e8f", + "size_in_bytes": 1239 + }, + { + "_path": "Library/include/openssl/e_os2.h", + "path_type": "hardlink", + "sha256": "d7300e16ec04f764e8fd45ae5288c37ab5af09dd1ea204d17c54c0155c69921c", + "size_in_bytes": 8445 + }, + { + "_path": "Library/include/openssl/e_ostime.h", + "path_type": "hardlink", + "sha256": "0528cffa1548778b3ad52d4abb527e5f31590fb1bab4b0f55aad391efd79fd68", + "size_in_bytes": 1147 + }, + { + "_path": "Library/include/openssl/ebcdic.h", + "path_type": "hardlink", + "sha256": "f50d3c91cb24772cf3155fe6464d811219b8f7c65ea3d4f974f58c03c3f27ab5", + "size_in_bytes": 1025 + }, + { + "_path": "Library/include/openssl/ec.h", + "path_type": "hardlink", + "sha256": "2cc0edb6a18c4c1199bfce6799ca56362a6c27d41dfdfee62177a3d53a8c9a65", + "size_in_bytes": 62313 + }, + { + "_path": "Library/include/openssl/ecdh.h", + "path_type": "hardlink", + "sha256": "5b99fdd1dfea38640ed8a506fb9b66db381cc26a1254448a81cc6b161e41850f", + "size_in_bytes": 361 + }, + { + "_path": "Library/include/openssl/ecdsa.h", + "path_type": "hardlink", + "sha256": "5b99fdd1dfea38640ed8a506fb9b66db381cc26a1254448a81cc6b161e41850f", + "size_in_bytes": 361 + }, + { + "_path": "Library/include/openssl/ecerr.h", + "path_type": "hardlink", + "sha256": "c072432649cd1e4bd1eb8c1f636bc2b57045d6f620d69d61c85f589d1c6b63e3", + "size_in_bytes": 3359 + }, + { + "_path": "Library/include/openssl/encoder.h", + "path_type": "hardlink", + "sha256": "73459b25f863cf9bbb3de66f04ffe7ddaf9450f3c26afb1d5827325fa0a89fd9", + "size_in_bytes": 4570 + }, + { + "_path": "Library/include/openssl/encodererr.h", + "path_type": "hardlink", + "sha256": "d010ca78b1df89c7fe3410d2aa5674179bf6750a445382ab8a0314c20a5b9799", + "size_in_bytes": 741 + }, + { + "_path": "Library/include/openssl/engine.h", + "path_type": "hardlink", + "sha256": "185311cc9702aa00fcafefad6f83ca1f597659d5075b66100c61053e1be5f47d", + "size_in_bytes": 37536 + }, + { + "_path": "Library/include/openssl/engineerr.h", + "path_type": "hardlink", + "sha256": "2732c698916f320ba12ba690a80c1ef0651112015c5eac6141b1c3c315d1f5fc", + "size_in_bytes": 2034 + }, + { + "_path": "Library/include/openssl/err.h", + "path_type": "hardlink", + "sha256": "34175abed1967175849366372adb3301a42a526391effd2ce38542b9a5006104", + "size_in_bytes": 20953 + }, + { + "_path": "Library/include/openssl/ess.h", + "path_type": "hardlink", + "sha256": "d60b95e020211b406e8a6f5b703d170576c9d4f31d8c8dfa53089b2ce13d8018", + "size_in_bytes": 8837 + }, + { + "_path": "Library/include/openssl/esserr.h", + "path_type": "hardlink", + "sha256": "9ab984787cce1224e1426be57987e7726d8c5d38651dd96802a7d433c5288ae4", + "size_in_bytes": 982 + }, + { + "_path": "Library/include/openssl/evp.h", + "path_type": "hardlink", + "sha256": "0c2e950834c4cd0ac8a887f039400932e7cb1d6aaf2f80da73698a8ed5c3b318", + "size_in_bytes": 96306 + }, + { + "_path": "Library/include/openssl/evperr.h", + "path_type": "hardlink", + "sha256": "ee0a462f1985667434a2b8a91d5df67ce2ee74e4ad9246f660dece5fafcf4474", + "size_in_bytes": 5528 + }, + { + "_path": "Library/include/openssl/fips_names.h", + "path_type": "hardlink", + "sha256": "95f0ddd1271d1bb609acbe42924e903a2dda8e224cced9eb56f5680a6ae75a8e", + "size_in_bytes": 1638 + }, + { + "_path": "Library/include/openssl/fipskey.h", + "path_type": "hardlink", + "sha256": "d48dd581cd2e11e537f9a6dab7e80e2e37991dff14462e1efe5fe9f15153dd61", + "size_in_bytes": 1297 + }, + { + "_path": "Library/include/openssl/hmac.h", + "path_type": "hardlink", + "sha256": "9caf0b993c6ae2b3c75b9b585c8539dd358ca5f4edc42447295f87fc504eb1b9", + "size_in_bytes": 1892 + }, + { + "_path": "Library/include/openssl/hpke.h", + "path_type": "hardlink", + "sha256": "58f81dab37eddc03b86db9dd640980fca872ddf19f4477482826a64f20454cb9", + "size_in_bytes": 6081 + }, + { + "_path": "Library/include/openssl/http.h", + "path_type": "hardlink", + "sha256": "1f8d65d9633d54a74e8477396f2e3d34f5cdafc753fa8d56a5ee31753f5b734f", + "size_in_bytes": 4717 + }, + { + "_path": "Library/include/openssl/httperr.h", + "path_type": "hardlink", + "sha256": "56b740a25198f30d19c8ed57b36679bbb32f8f2d97291155d4b3091c347ae423", + "size_in_bytes": 1892 + }, + { + "_path": "Library/include/openssl/idea.h", + "path_type": "hardlink", + "sha256": "d114cb69e2e820008c508b7ad9002586806d82e3006e88162bd4a7c2dcd1e801", + "size_in_bytes": 2285 + }, + { + "_path": "Library/include/openssl/indicator.h", + "path_type": "hardlink", + "sha256": "4be987d4fe4a4b39feac27c2ee85000e1b6ca7188d8ca9f75689a8205c2b4563", + "size_in_bytes": 818 + }, + { + "_path": "Library/include/openssl/kdf.h", + "path_type": "hardlink", + "sha256": "c704d177a651fed1c617ddf3bed2eb8c9e35f453ac7b1187dc6f02c88b76fe3b", + "size_in_bytes": 5184 + }, + { + "_path": "Library/include/openssl/kdferr.h", + "path_type": "hardlink", + "sha256": "cbf4bd667f0a53459163f546920c2c98ce6d10b0db99176c779d8bf32f04e8b7", + "size_in_bytes": 480 + }, + { + "_path": "Library/include/openssl/lhash.h", + "path_type": "hardlink", + "sha256": "5bde69bca9c55cc9e24942a025a69602874b40fdec585f28a12624327f59aa89", + "size_in_bytes": 33792 + }, + { + "_path": "Library/include/openssl/macros.h", + "path_type": "hardlink", + "sha256": "756bc73d844bb73b62f3e5b5e6141ec5c912a230f58310e1fea6b44f3a7244d7", + "size_in_bytes": 11094 + }, + { + "_path": "Library/include/openssl/md2.h", + "path_type": "hardlink", + "sha256": "a8eb0a1cdd0ced053d0f5dc5d1f63fe67f96a83c1cc37b6bf7adde85a567a631", + "size_in_bytes": 1336 + }, + { + "_path": "Library/include/openssl/md4.h", + "path_type": "hardlink", + "sha256": "75d0ff7b22daa2ab31a0cd03ce9ca10cef64f431d32c49def33d0f0164e36f0d", + "size_in_bytes": 1610 + }, + { + "_path": "Library/include/openssl/md5.h", + "path_type": "hardlink", + "sha256": "e22e567d09253eebf2c17f620783808f407bc7b969aa90bf3b44ac9001f6d329", + "size_in_bytes": 1608 + }, + { + "_path": "Library/include/openssl/mdc2.h", + "path_type": "hardlink", + "sha256": "740c2361d9b0ab5330ae0054e368f573416c401cb3855b72323967b29232421f", + "size_in_bytes": 1312 + }, + { + "_path": "Library/include/openssl/ml_kem.h", + "path_type": "hardlink", + "sha256": "58ecec9d4d95ab5172290a4c5725b7b6940149ecdbff5a33b93cc67ede1b25f7", + "size_in_bytes": 959 + }, + { + "_path": "Library/include/openssl/modes.h", + "path_type": "hardlink", + "sha256": "8ea97ace0601cdce6a12d0e1e92aefec062c299d0fcb5ff6477e3d752a9b9763", + "size_in_bytes": 8135 + }, + { + "_path": "Library/include/openssl/obj_mac.h", + "path_type": "hardlink", + "sha256": "cc17d91b8603c09df02b5cb060557484f56e2a04e7d5a2756282e7bf08f059f0", + "size_in_bytes": 292300 + }, + { + "_path": "Library/include/openssl/objects.h", + "path_type": "hardlink", + "sha256": "b6227db488aa39ed20a29e67d48fe8fefb2f649a1afcc3149cba22ac26510057", + "size_in_bytes": 7567 + }, + { + "_path": "Library/include/openssl/objectserr.h", + "path_type": "hardlink", + "sha256": "fc14e6c9e71fb550363394f912cb72e6078dd11e300bdddfdd17ec118c88dc4b", + "size_in_bytes": 686 + }, + { + "_path": "Library/include/openssl/ocsp.h", + "path_type": "hardlink", + "sha256": "0d9548e60074a0a27061191b1bdb7ec7810850b08d8de45c8b3e1dca45151fd4", + "size_in_bytes": 28347 + }, + { + "_path": "Library/include/openssl/ocsperr.h", + "path_type": "hardlink", + "sha256": "51b319980fb406b70ff0aee9c145c260553f4ff6516305b9c2864643096cc30c", + "size_in_bytes": 1636 + }, + { + "_path": "Library/include/openssl/opensslconf.h", + "path_type": "hardlink", + "sha256": "7f4b522c049d0bd0d651e6f6ebe71d6df0c37231a94e32524da3f4642ebda3be", + "size_in_bytes": 510 + }, + { + "_path": "Library/include/openssl/opensslv.h", + "path_type": "hardlink", + "sha256": "3fde0187f84a1afd5d38f7a396a1c07920dd1a0381c12b85db23adcecd0a0def", + "size_in_bytes": 3578 + }, + { + "_path": "Library/include/openssl/ossl_typ.h", + "path_type": "hardlink", + "sha256": "8d430751bbcd1d9695f3dd85b16958fd6255dfbf55775207923f67cba1754548", + "size_in_bytes": 561 + }, + { + "_path": "Library/include/openssl/param_build.h", + "path_type": "hardlink", + "sha256": "f078c5549e172b49da9993ef68c7b7fedafd66b05255c9bf8a37154f0a40bdb7", + "size_in_bytes": 2363 + }, + { + "_path": "Library/include/openssl/params.h", + "path_type": "hardlink", + "sha256": "881a034dbf0d1077df0e0505faa75591625dd60940f3e0dd3c3210b3baa4f5ef", + "size_in_bytes": 7149 + }, + { + "_path": "Library/include/openssl/pem.h", + "path_type": "hardlink", + "sha256": "9098124ff7a21c8f1db5ddead59b1cf092f88c9f44bf88dacd3c8de9c67ade76", + "size_in_bytes": 22667 + }, + { + "_path": "Library/include/openssl/pem2.h", + "path_type": "hardlink", + "sha256": "5bd104c872bbfee2d16f5af88c01b0aeee9f177ecc88c0dd237c9c9948eeedc6", + "size_in_bytes": 523 + }, + { + "_path": "Library/include/openssl/pemerr.h", + "path_type": "hardlink", + "sha256": "18c1dbdde2452416b1d49c7512b7c4b8bf26ac7b83f5c0ee5e27e9bec454d2fb", + "size_in_bytes": 1836 + }, + { + "_path": "Library/include/openssl/pkcs12.h", + "path_type": "hardlink", + "sha256": "3e24609a44fb8725dddf515ecbb7cb8ac89eba6dad46ea1d803cd2fec8963493", + "size_in_bytes": 17503 + }, + { + "_path": "Library/include/openssl/pkcs12err.h", + "path_type": "hardlink", + "sha256": "fbf4142e0ee58b6c6841890d873f07ba0362e21ad74702d70552122e01c096e9", + "size_in_bytes": 1427 + }, + { + "_path": "Library/include/openssl/pkcs7.h", + "path_type": "hardlink", + "sha256": "f6429c7db771d0ccb5539043651c15186ffcb5bed3dc8c4910e7598d1872684f", + "size_in_bytes": 22309 + }, + { + "_path": "Library/include/openssl/pkcs7err.h", + "path_type": "hardlink", + "sha256": "717e017e7d0981928b33820660e19d5c264a06a5e824b94194036a8be92be07c", + "size_in_bytes": 2242 + }, + { + "_path": "Library/include/openssl/prov_ssl.h", + "path_type": "hardlink", + "sha256": "23b96759ae94e17c7c0e7ee32a531676be2a276a6d9802828e80268e20f224fd", + "size_in_bytes": 969 + }, + { + "_path": "Library/include/openssl/proverr.h", + "path_type": "hardlink", + "sha256": "e95d9c1c8ed617e092a6e099ee144dc521538b92fadd65a27a7ac2532948769f", + "size_in_bytes": 6452 + }, + { + "_path": "Library/include/openssl/provider.h", + "path_type": "hardlink", + "sha256": "dac4bfad226a8e5513cecf472e41e0b7ed93c95374a0ec3fd56f7b046e0aeff1", + "size_in_bytes": 3383 + }, + { + "_path": "Library/include/openssl/quic.h", + "path_type": "hardlink", + "sha256": "a80af6c42394132eaad8de7177c6b0b3f747711730e8dd687acdc34284b3c2f8", + "size_in_bytes": 2101 + }, + { + "_path": "Library/include/openssl/rand.h", + "path_type": "hardlink", + "sha256": "cb240ffedfd9516ec7a8cd0796951d46a4707c0460f940371620c83f7bafd037", + "size_in_bytes": 4058 + }, + { + "_path": "Library/include/openssl/randerr.h", + "path_type": "hardlink", + "sha256": "a6acbb47da2f26fe5e572f232eb9d9ebcd65bb7c01d5984ab26229e5bf0bd45e", + "size_in_bytes": 2486 + }, + { + "_path": "Library/include/openssl/rc2.h", + "path_type": "hardlink", + "sha256": "b86a429de0c73aca6e0504b8833c1dcd9e8c7cdf65c2b31b38d0d0c7b19cc5e9", + "size_in_bytes": 1771 + }, + { + "_path": "Library/include/openssl/rc4.h", + "path_type": "hardlink", + "sha256": "1bb4fa9d14861cdcf0a721d8d1026be80ce019da459ffdd8b5c1d12365110e78", + "size_in_bytes": 1075 + }, + { + "_path": "Library/include/openssl/rc5.h", + "path_type": "hardlink", + "sha256": "dd71ab468383a2a8ca4ff34f9273b481c1ed518c380da6d1ab82e9ca6b7edbd9", + "size_in_bytes": 2146 + }, + { + "_path": "Library/include/openssl/ripemd.h", + "path_type": "hardlink", + "sha256": "4457b36942bc0e298c993b48468ef8f3f00331a9d67bd0b894dd5bc5f58ab35d", + "size_in_bytes": 1537 + }, + { + "_path": "Library/include/openssl/rsa.h", + "path_type": "hardlink", + "sha256": "2c9780f9b4b35c3f14271962938e16b8505e9f5d38566c104bce9a82be23a0e1", + "size_in_bytes": 22275 + }, + { + "_path": "Library/include/openssl/rsaerr.h", + "path_type": "hardlink", + "sha256": "b4f87b5dddc672b81de0dfd7f3c4e6409887bd08b286c99ded8f1255e5836804", + "size_in_bytes": 3861 + }, + { + "_path": "Library/include/openssl/safestack.h", + "path_type": "hardlink", + "sha256": "0dbef67df924d95b934b0601f12f6140108577c6cb0c3b5e522b19c01a836234", + "size_in_bytes": 32303 + }, + { + "_path": "Library/include/openssl/seed.h", + "path_type": "hardlink", + "sha256": "75a00b017f40beba051fdaad04876e18d3c80d1b1f1c21d78fafc69ae8e3b034", + "size_in_bytes": 3611 + }, + { + "_path": "Library/include/openssl/self_test.h", + "path_type": "hardlink", + "sha256": "e4d46353b1be292b162984c2a388fef89db037c39770c62f91e53c19883174e4", + "size_in_bytes": 4816 + }, + { + "_path": "Library/include/openssl/sha.h", + "path_type": "hardlink", + "sha256": "7e006accd6565cc97dee672c097acc5e38482be7cd4fa1e0c316bf466425b895", + "size_in_bytes": 4404 + }, + { + "_path": "Library/include/openssl/srp.h", + "path_type": "hardlink", + "sha256": "0dfe6acadd7ca1c80332a19af017653acde7d2bdc73de55219447374325cda14", + "size_in_bytes": 15453 + }, + { + "_path": "Library/include/openssl/srtp.h", + "path_type": "hardlink", + "sha256": "6efa8edb1f040ba35cb05a671efc74c1494b9d4badc32d47cd5bb99e1a9cda38", + "size_in_bytes": 1888 + }, + { + "_path": "Library/include/openssl/ssl.h", + "path_type": "hardlink", + "sha256": "289c9b4413c15ba3ceaf071016d164585bad09f8b649d5726579b4767e8abe12", + "size_in_bytes": 125320 + }, + { + "_path": "Library/include/openssl/ssl2.h", + "path_type": "hardlink", + "sha256": "d33dc2afbcdee20f20ffcdd5cda6777c5e49a7cc37d513e4618b71a99129af20", + "size_in_bytes": 625 + }, + { + "_path": "Library/include/openssl/ssl3.h", + "path_type": "hardlink", + "sha256": "f98e0eb1702bf99614e92e2d09f1af5b59309e156441e40ab711df7d661536aa", + "size_in_bytes": 12748 + }, + { + "_path": "Library/include/openssl/sslerr.h", + "path_type": "hardlink", + "sha256": "7a9dab7a198ea5c17fe5cf8e1905a54ae88c0044a86c1accf1e7cc9e7de374e2", + "size_in_bytes": 15413 + }, + { + "_path": "Library/include/openssl/sslerr_legacy.h", + "path_type": "hardlink", + "sha256": "988c235994713d83d73ee904804f7edb4f6e321b4ab94c5aa5a9a0c7134fb499", + "size_in_bytes": 18269 + }, + { + "_path": "Library/include/openssl/stack.h", + "path_type": "hardlink", + "sha256": "68e5e154c9af4d0c70f1101a4c5d94a45c42f371acac2538a1fec925a1a21d8a", + "size_in_bytes": 3290 + }, + { + "_path": "Library/include/openssl/store.h", + "path_type": "hardlink", + "sha256": "8b02d55b78c95f3b49ea00ff4abf9b33f794c63c4ddfecaf9101ad1b2a5c7f8b", + "size_in_bytes": 14099 + }, + { + "_path": "Library/include/openssl/storeerr.h", + "path_type": "hardlink", + "sha256": "e13ecdf3c46b4dde5d857f8a7a3e2c0a444e309aa05d789bf99d73ecefab87aa", + "size_in_bytes": 1702 + }, + { + "_path": "Library/include/openssl/symhacks.h", + "path_type": "hardlink", + "sha256": "2b54552189bfbf4204c28c6a421b21702a3cd3dba37570dbcdadb7ee648f155b", + "size_in_bytes": 1102 + }, + { + "_path": "Library/include/openssl/thread.h", + "path_type": "hardlink", + "sha256": "583716b74d6aa0596c1d1b06cb16f657d4d9fb9c13cf30505ec0327046af6baf", + "size_in_bytes": 865 + }, + { + "_path": "Library/include/openssl/tls1.h", + "path_type": "hardlink", + "sha256": "d34b3d17f1aedf83a072240cb81c6ae0927826f0200bc9e56926897e9b943d48", + "size_in_bytes": 63577 + }, + { + "_path": "Library/include/openssl/trace.h", + "path_type": "hardlink", + "sha256": "5b7f86a453e6b404ff019e23e84de856c2a25b8243d4bfb92c92471a3735e332", + "size_in_bytes": 10823 + }, + { + "_path": "Library/include/openssl/ts.h", + "path_type": "hardlink", + "sha256": "3de4eecd9a731d9a05a1b7baab18cb1c62f59f8a9f9e5ed049525a8ada9207b8", + "size_in_bytes": 19419 + }, + { + "_path": "Library/include/openssl/tserr.h", + "path_type": "hardlink", + "sha256": "27e66bf494926dea06d8c3800823f2485cf1a7f8f41f5628ff4a443f9bcceb87", + "size_in_bytes": 2077 + }, + { + "_path": "Library/include/openssl/txt_db.h", + "path_type": "hardlink", + "sha256": "cbd03be764d6d12e12895703756fbe5f2b7611d4cd55d343837d48e8e6e60523", + "size_in_bytes": 1635 + }, + { + "_path": "Library/include/openssl/types.h", + "path_type": "hardlink", + "sha256": "de5422d2e621df11c17ab18473ea4f2368ecc64b1e45311c4890cc62b31f81c5", + "size_in_bytes": 7354 + }, + { + "_path": "Library/include/openssl/ui.h", + "path_type": "hardlink", + "sha256": "3a90e172144a35db792d0298cc8545d12a9109f184129b0114e3ece5f85d4f68", + "size_in_bytes": 18922 + }, + { + "_path": "Library/include/openssl/uierr.h", + "path_type": "hardlink", + "sha256": "a21be118ee97343a03dc28256370839e5751c82a2a7bcb4c60fcbd97a9e2bef5", + "size_in_bytes": 1062 + }, + { + "_path": "Library/include/openssl/whrlpool.h", + "path_type": "hardlink", + "sha256": "d38ef40783400956d571e442d4f459e9c611239d719eb128e19bc64982d01922", + "size_in_bytes": 1681 + }, + { + "_path": "Library/include/openssl/x509.h", + "path_type": "hardlink", + "sha256": "8b3e9b5b2d2299d315253f77cf2518c477a7da56c3957253e054763aadc3256c", + "size_in_bytes": 68864 + }, + { + "_path": "Library/include/openssl/x509_acert.h", + "path_type": "hardlink", + "sha256": "24601f52a835266e355edc9b29a88bcfb6bd25808c4488d620c9988dc551c579", + "size_in_bytes": 22227 + }, + { + "_path": "Library/include/openssl/x509_vfy.h", + "path_type": "hardlink", + "sha256": "8b6f550a8f84d13af9047ce45b8dd6bac883506003172ff300d4b763a2226b9f", + "size_in_bytes": 48740 + }, + { + "_path": "Library/include/openssl/x509err.h", + "path_type": "hardlink", + "sha256": "2250a50091ffbc35c6cc45fc2a32b68ea38cf2ba510b197cc7d58c957179bd1e", + "size_in_bytes": 2316 + }, + { + "_path": "Library/include/openssl/x509v3.h", + "path_type": "hardlink", + "sha256": "5869b14510c87baa606ea83b8e83e9a5fd4f8bfc45a8103ac6ceaf3b0890566d", + "size_in_bytes": 131385 + }, + { + "_path": "Library/include/openssl/x509v3err.h", + "path_type": "hardlink", + "sha256": "b9be8b0429bfaefb973531e81d598e40779b3788e129c4cc9e33651d2308b990", + "size_in_bytes": 3578 + }, + { + "_path": "Library/lib/cmake/OpenSSL/OpenSSLConfig.cmake", + "path_type": "hardlink", + "sha256": "02f9e9cdbad5aa0b813446d299f39cd3db1801c26a48751c0487c72ea319efef", + "size_in_bytes": 6687 + }, + { + "_path": "Library/lib/cmake/OpenSSL/OpenSSLConfigVersion.cmake", + "path_type": "hardlink", + "sha256": "c4aa406c5faf5f9966c0b32bbc35c23a05d411ebb0be2b7b560d451b33361dd5", + "size_in_bytes": 541 + }, + { + "_path": "Library/lib/libcrypto.lib", + "path_type": "hardlink", + "sha256": "d7af4746fec5fea77897db2ba793898e76e203f328af1c0855d58d9417473c55", + "size_in_bytes": 1383240 + }, + { + "_path": "Library/lib/libssl.lib", + "path_type": "hardlink", + "sha256": "2c6b82144f3b0ad25dc88318b4b94cf412ea9ff80e525f92e299e516846e371d", + "size_in_bytes": 147386 + }, + { + "_path": "Library/lib/pkgconfig/libcrypto.pc", + "file_mode": "text", + "path_type": "hardlink", + "prefix_placeholder": "D:/bld/openssl_split_1775587024900/_h_env", + "sha256": "803542b8f1f4c3450757e3f06ae9a09c9b0d0f2e5fa3ab3955f7ce9e70156fbc", + "size_in_bytes": 320 + }, + { + "_path": "Library/lib/pkgconfig/libssl.pc", + "file_mode": "text", + "path_type": "hardlink", + "prefix_placeholder": "D:/bld/openssl_split_1775587024900/_h_env", + "sha256": "6b070f63934a59707448a2d95e735e9629a00ab984625ed0563be94770ca95aa", + "size_in_bytes": 320 + }, + { + "_path": "Library/lib/pkgconfig/openssl.pc", + "file_mode": "text", + "path_type": "hardlink", + "prefix_placeholder": "D:/bld/openssl_split_1775587024900/_h_env", + "sha256": "741d81fd56e49e5e9a5db3be56171dbb5afde9e32ee662ac2fe3e90f177cb2c5", + "size_in_bytes": 273 + }, + { + "_path": "Library/ssl/certs/.keep", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "etc/conda/activate.d/openssl_activate-win.bat", + "path_type": "hardlink", + "sha256": "4d8a81a3adaa5530d3887b8564b7dbb417abc6806027c35a1314972f287ac39f", + "size_in_bytes": 277 + }, + { + "_path": "etc/conda/activate.d/openssl_activate-win.ps1", + "path_type": "hardlink", + "sha256": "3949fb8c03c1455d40dad37617f10c8d9f9992ce5b59aa8847a6fb51a1c9a7f5", + "size_in_bytes": 292 + }, + { + "_path": "etc/conda/activate.d/openssl_activate-win.sh", + "path_type": "hardlink", + "sha256": "5ec78b73cfd2233288a35c464470b62e4a2b08c0dcf8ec3c48969deae24b0e06", + "size_in_bytes": 310 + }, + { + "_path": "etc/conda/deactivate.d/openssl_deactivate-win.bat", + "path_type": "hardlink", + "sha256": "c8d3299f7c2495c4591726336d94de91d9b8d25a4d85186b43c6b9bbe3e5b3ee", + "size_in_bytes": 236 + }, + { + "_path": "etc/conda/deactivate.d/openssl_deactivate-win.ps1", + "path_type": "hardlink", + "sha256": "0c7b217451fade4d5faf97e6ff2e7fe38aa7e173c54d24b4b89933e22211b972", + "size_in_bytes": 305 + }, + { + "_path": "etc/conda/deactivate.d/openssl_deactivate-win.sh", + "path_type": "hardlink", + "sha256": "ee47af6120be7738e01e715096555d3453134517f67443597c02c2a25d7a2c5a", + "size_in_bytes": 249 + } + ], + "paths_version": 1 +} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/conda_build_config.yaml b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..48c49a354ff01e8ecbe8d394a02e881b0d18769f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/conda_build_config.yaml @@ -0,0 +1,33 @@ +CI: azure +CONDA_BUILD_SKIP_TESTS: '0' +c_compiler: vs2022 +c_stdlib: vs +channel_sources: conda-forge +channel_targets: conda-forge main +cpu_optimization_target: nocona +cran_mirror: https://cran.r-project.org +cxx_compiler: vs2017 +extend_keys: +- ignore_build_only_deps +- ignore_version +- pin_run_as_build +- extend_keys +fortran_compiler: gfortran +ignore_build_only_deps: +- python +- numpy +lua: '5' +numpy: '1.26' +openssl: '3.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 +python: '3.12' +r_base: '3.4' +target_platform: win-64 +vc: '14' diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/install_openssl.bat b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/install_openssl.bat new file mode 100644 index 0000000000000000000000000000000000000000..25d590094203af00b1db3610de707f5042c145dd --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/install_openssl.bat @@ -0,0 +1,32 @@ +@echo on +setlocal enabledelayedexpansion + +nmake install +if %ERRORLEVEL% neq 0 exit 1 + +:: don't include html docs that get installed +rd /s /q %LIBRARY_PREFIX%\html + +:: install pkgconfig metadata (useful for downstream packages); +:: adapted from inspecting the conda-forge .pc files for unix, as well as +:: https://github.com/microsoft/vcpkg/blob/master/ports/openssl/install-pc-files.cmake +mkdir %LIBRARY_PREFIX%\lib\pkgconfig +for %%F in (openssl libssl libcrypto) DO ( + echo prefix=%LIBRARY_PREFIX:\=/% > %%F.pc + type %RECIPE_DIR%\win_pkgconfig\%%F.pc.in >> %%F.pc + echo Version: %PKG_VERSION% >> %%F.pc + copy %%F.pc %LIBRARY_PREFIX%\lib\pkgconfig\%%F.pc +) + +mkdir %LIBRARY_PREFIX%\ssl\certs +type NUL > %LIBRARY_PREFIX%\ssl\certs\.keep + +:: Copy the [de]activate scripts to %PREFIX%\etc\conda\[de]activate.d. +:: This will allow them to be run on environment activation. +for %%F in (activate deactivate) DO ( + if not exist %PREFIX%\etc\conda\%%F.d mkdir %PREFIX%\etc\conda\%%F.d + copy "%RECIPE_DIR%\%%F-win.bat" "%PREFIX%\etc\conda\%%F.d\%PKG_NAME%_%%F-win.bat" + copy "%RECIPE_DIR%\%%F-win.ps1" "%PREFIX%\etc\conda\%%F.d\%PKG_NAME%_%%F-win.ps1" + :: Copy unix shell activation scripts, needed by Windows Bash users + copy "%RECIPE_DIR%\%%F-win.sh" "%PREFIX%\etc\conda\%%F.d\%PKG_NAME%_%%F-win.sh" +) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/meta.yaml b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..317b27be94fbcac815930bcc420e4744f0b80f68 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/meta.yaml @@ -0,0 +1,71 @@ +# This file created by conda-build 26.3.0 +# ------------------------------------------------ + +package: + name: openssl + version: 3.6.2 +source: + url: https://github.com/openssl/openssl/releases/download/openssl-3.6.2/openssl-3.6.2.tar.gz + sha256: aaf51a1fe064384f811daeaeb4ec4dce7340ec8bd893027eee676af31e83a04f +build: + run_exports: + - openssl >=3.6.2,<4.0a0 + number: 0 + string: hf411b9b_0 +requirements: + build: + - _openmp_mutex 4.5 20_gnu + - libgcc 15.2.0 h8ee18e1_18 + - libgomp 15.2.0 h8ee18e1_18 + - libwinpthread 12.0.0.r4.gg4f2fc60ca h57928b3_10 + - make 4.4.1 h0e40799_2 + - perl 5.32.1.1 7_h57928b3_strawberry + - ucrt 10.0.26100.0 h57928b3_0 + - vs2022_win-64 19.44.35207 ha74f236_34 + - vs_win-64 2022.14 ha74f236_34 + - vswhere 3.1.7 h40126e0_1 + run: + - ca-certificates + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + host: + - ucrt 10.0.26100.0 h57928b3_0 + - vc 14.3 h41ae7f8_34 + - vc14_runtime 14.44.35208 h818238b_34 + - vcomp14 14.44.35208 h818238b_34 +test: + requires: + - pkg-config + - ripgrep + commands: + - copy NUL checksum.txt + - '%LIBRARY_BIN%\openssl sha256 checksum.txt' + - if not exist "%SSL_CERT_FILE%" exit 1 + - if not exist "%LIBRARY_INC%"\\openssl\\applink.c exit 1 + - pkg-config --print-errors --exact-version "3.6.2" openssl + - type %CONDA_PREFIX%\etc\conda\activate.d\openssl_activate-win.sh | rg \r & if + ERRORLEVEL ==1 (exit 0) else (exit 1) + - type %CONDA_PREFIX%\etc\conda\deactivate.d\openssl_deactivate-win.sh | rg \r + & if ERRORLEVEL ==1 (exit 0) else (exit 1) +about: + home: https://www.openssl.org/ + license_file: LICENSE.txt + license: Apache-2.0 + license_family: Apache + summary: OpenSSL is an open-source implementation of the SSL and TLS protocols + dev_url: https://github.com/openssl/openssl + doc_url: https://docs.openssl.org/master/ +extra: + recipe-maintainers: + - h-vetinari + - jakirkham + - msarahan + - ocefpaf + - pelson + feedstock-name: openssl + final: true + copy_test_source_files: true + flow_run_id: azure_20260407.2.1 + remote_url: https://github.com/conda-forge/openssl-feedstock + sha: 6d80792e2b8b538ce06710ed9a9316620e2fcf78 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/.gitattributes b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..8ea11c6d9a2f75b2c9eb0fb1967fed5a494521b7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/.gitattributes @@ -0,0 +1,3 @@ +# explicitly set LF line endings for these files even on windows +# because we need to support (de)activation from bash +*-win.sh text eol=lf diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/activate-win.bat b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/activate-win.bat new file mode 100644 index 0000000000000000000000000000000000000000..076fd037ce65cdc225ea540c26da93750e24e0cc --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/activate-win.bat @@ -0,0 +1,9 @@ +@echo off +if "%SSL_CERT_FILE%"=="" ( + set "SSL_CERT_FILE=%CONDA_PREFIX%\Library\ssl\cacert.pem" + set "__CONDA_OPENSSL_CERT_FILE_SET=1" +) +if "%SSL_CERT_DIR%"=="" ( + set "SSL_CERT_DIR=%CONDA_PREFIX%\Library\ssl\certs" + set "__CONDA_OPENSSL_CERT_DIR_SET=1" +) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/activate-win.ps1 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/activate-win.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..35f9da56ba0c1a6fd886b0f84d22b6df03621b50 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/activate-win.ps1 @@ -0,0 +1,8 @@ +if (-not $Env:SSL_CERT_FILE) { + $Env:SSL_CERT_FILE = "$Env:CONDA_PREFIX\Library\ssl\cacert.pem" + $Env:__CONDA_OPENSSL_CERT_FILE_SET = "1" +} +if (-not $Env:SSL_CERT_DIR) { + $Env:SSL_CERT_DIR = "$Env:CONDA_PREFIX\Library\ssl\certs" + $Env:__CONDA_OPENSSL_CERT_DIR_SET = "1" +} diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/activate-win.sh b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/activate-win.sh new file mode 100644 index 0000000000000000000000000000000000000000..221a46be1c56525e097d42ab5a05fc1fd83380d9 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/activate-win.sh @@ -0,0 +1,8 @@ +if [[ "${SSL_CERT_FILE:-}" == "" ]]; then + export SSL_CERT_FILE="${CONDA_PREFIX}\\Library\\ssl\\cacert.pem" + export __CONDA_OPENSSL_CERT_FILE_SET="1" +fi +if [[ "${SSL_CERT_DIR:-}" == "" ]]; then + export SSL_CERT_DIR="${CONDA_PREFIX}\\Library\\ssl\\certs" + export __CONDA_OPENSSL_CERT_DIR_SET="1" +fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/bld.bat b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/bld.bat new file mode 100644 index 0000000000000000000000000000000000000000..9a8c826eaf7899db781be99e932b8ca054936a58 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/bld.bat @@ -0,0 +1,49 @@ +@echo on + +REM use VC-WIN64-CLANGASM-ARM on arm64 to use clang-cl +REM from Visual Studio to enable assembly instructions +REM and uplink support. See NOTES-WINDOWS.md in source. +if "%target_platform%"=="win-arm64" ( + set OSSL_CONFIGURE=VC-WIN64-CLANGASM-ARM +) else if "%ARCH%"=="32" ( + set OSSL_CONFIGURE=VC-WIN32 +) else ( + set OSSL_CONFIGURE=VC-WIN64A +) + +REM Configure step +REM +REM Conda currently does not perform prefix replacement on Windows, so +REM OPENSSLDIR cannot (reliably) be used to provide functionality such as a +REM default configuration and standard CA certificates on a per-environment +REM basis. Given that, we set OPENSSLDIR to a location with extremely limited +REM write permissions to limit the risk of non-privileged users exploiting +REM OpenSSL's engines feature to perform arbitrary code execution attacks +REM against applications that load the OpenSSL DLLs. +REM +REM On top of that, we also set the SSL_CERT_FILE environment variable +REM via an activation script to point to the ca-certificates provided CA root file. +REM +REM Copied from AnacondaRecipes/openssl-feedstock +perl configure %OSSL_CONFIGURE% ^ + --prefix=%LIBRARY_PREFIX% ^ + --openssldir="%CommonProgramFiles%\ssl" ^ + enable-legacy ^ + no-fips ^ + no-module ^ + no-zlib ^ + shared +if %ERRORLEVEL% neq 0 exit 1 + +REM specify in metadata where the packaging is coming from +set "OPENSSL_VERSION_BUILD_METADATA=+conda_forge" + +REM Build step +nmake +if %ERRORLEVEL% neq 0 exit 1 + +REM Testing step +if NOT "%CONDA_BUILD_CROSS_COMPILATION%" == "1" ( + nmake test + if %ERRORLEVEL% neq 0 exit 1 +) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/build.sh b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..7b36d203cc93cd9ab74e361f6bd6b80fc8c093de --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/build.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +PERL=${PREFIX}/bin/perl +declare -a _CONFIG_OPTS +_CONFIG_OPTS+=(--libdir=lib) +_CONFIG_OPTS+=(--prefix=${PREFIX}) +_CONFIG_OPTS+=(enable-legacy) +_CONFIG_OPTS+=(no-fips) +_CONFIG_OPTS+=(no-module) +_CONFIG_OPTS+=(no-zlib) +_CONFIG_OPTS+=(shared) +_CONFIG_OPTS+=(threads) + +if [[ "$target_platform" = "linux-"* ]]; then + _CONFIG_OPTS+=(enable-ktls) +fi + +# We are cross-compiling or using a specific compiler. +# do not allow config to make any guesses based on uname. +_CONFIGURATOR="perl ./Configure" +case "$target_platform" in + linux-64) + _CONFIG_OPTS+=(linux-x86_64) + CFLAGS="${CFLAGS} -Wa,--noexecstack" + ;; + linux-aarch64) + _CONFIG_OPTS+=(linux-aarch64) + CFLAGS="${CFLAGS} -Wa,--noexecstack" + ;; + linux-ppc64le) + _CONFIG_OPTS+=(linux-ppc64le) + CFLAGS="${CFLAGS} -Wa,--noexecstack" + ;; + osx-64) + _CONFIG_OPTS+=(darwin64-x86_64-cc) + ;; + osx-arm64) + _CONFIG_OPTS+=(darwin64-arm64-cc) + ;; +esac + +CC=${CC}" ${CPPFLAGS} ${CFLAGS}" \ + ${_CONFIGURATOR} ${_CONFIG_OPTS[@]} ${LDFLAGS} + +# specify in metadata where the packaging is coming from +export OPENSSL_VERSION_BUILD_METADATA="+conda_forge" + +make -j${CPU_COUNT} + +if [[ "${CONDA_BUILD_CROSS_COMPILATION}" != "1" ]] || [[ "$(uname -s)" = "Linux" && "$target_platform" = "linux-"* ]]; then + if [[ "${CONDA_BUILD_CROSS_COMPILATION}" = "1" ]]; then + # This test fails when cross-compiling and using emulation for the tests + # > In a cross compiled situation, there are chances that our + # > application is linked against different C libraries than + # > perl, and may thereby get different error messages for the + # > same error. + # See: https://github.com/openssl/openssl/blob/openssl-3.0.0/test/recipes/02-test_errstr.t#L20-L26 + rm ./test/recipes/02-test_errstr.t + fi + if [[ "$target_platform" == "linux-aarch64" ]]; then + # https://github.com/openssl/openssl/issues/17900 + rm ./test/recipes/30-test_afalg.t + fi + echo "Running tests" + make test +fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/conda_build_config.yaml b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1d96a51106c54dba8c75a496b0d0433128cf59cc --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/conda_build_config.yaml @@ -0,0 +1,3 @@ +# Break circular dependency openssl -> clang -> ld64 -> sigtool -> openssl +c_compiler: # [osx] + - clang_bootstrap # [osx] diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/deactivate-win.bat b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/deactivate-win.bat new file mode 100644 index 0000000000000000000000000000000000000000..8ed388a78d9f9846e59d40f8778e531807390983 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/deactivate-win.bat @@ -0,0 +1,9 @@ +@echo off +if "%__CONDA_OPENSSL_CERT_FILE_SET%" == "1" ( + set SSL_CERT_FILE= + set __CONDA_OPENSSL_CERT_FILE_SET= +) +if "%__CONDA_OPENSSL_CERT_DIR_SET%" == "1" ( + set SSL_CERT_DIR= + set __CONDA_OPENSSL_CERT_DIR_SET= +) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/deactivate-win.ps1 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/deactivate-win.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..4553936867dfe9d4bc7793f4e54410edaf63f096 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/deactivate-win.ps1 @@ -0,0 +1,8 @@ +if ($Env:__CONDA_OPENSSL_CERT_FILE_SET -eq "1") { + Remove-Item -Path Env:\SSL_CERT_FILE + Remove-Item -Path Env:\__CONDA_OPENSSL_CERT_FILE_SET +} +if ($Env:__CONDA_OPENSSL_CERT_DIR_SET -eq "1") { + Remove-Item -Path Env:\SSL_CERT_DIR + Remove-Item -Path Env:\__CONDA_OPENSSL_CERT_DIR_SET +} diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/deactivate-win.sh b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/deactivate-win.sh new file mode 100644 index 0000000000000000000000000000000000000000..0a75e534ef22919c5129b62bc213b5a148663de4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/deactivate-win.sh @@ -0,0 +1,8 @@ +if [[ "${__CONDA_OPENSSL_CERT_FILE_SET:-}" == "1" ]]; then + unset SSL_CERT_FILE + unset __CONDA_OPENSSL_CERT_FILE_SET +fi +if [[ "${__CONDA_OPENSSL_CERT_DIR_SET:-}" == "1" ]]; then + unset SSL_CERT_DIR + unset __CONDA_OPENSSL_CERT_DIR_SET +fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/install_libopenssl-static.bat b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/install_libopenssl-static.bat new file mode 100644 index 0000000000000000000000000000000000000000..e825da14addd4bae6b2d0dcd4d1b0e38f90c2297 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/install_libopenssl-static.bat @@ -0,0 +1,3 @@ +if not exist "%LIBRARY_LIB%" mkdir %LIBRARY_LIB% +copy libcrypto_static.lib %LIBRARY_LIB%\libcrypto_static.lib +copy libssl_static.lib %LIBRARY_LIB%\libssl_static.lib diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/install_libopenssl-static.sh b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/install_libopenssl-static.sh new file mode 100644 index 0000000000000000000000000000000000000000..f86290fd3d57af4a0f8f99bae13a93df607c9958 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/install_libopenssl-static.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +mkdir -p ${PREFIX}/lib +cp libcrypto.a ${PREFIX}/lib/ +cp libssl.a ${PREFIX}/lib/ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/install_openssl.bat b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/install_openssl.bat new file mode 100644 index 0000000000000000000000000000000000000000..25d590094203af00b1db3610de707f5042c145dd --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/install_openssl.bat @@ -0,0 +1,32 @@ +@echo on +setlocal enabledelayedexpansion + +nmake install +if %ERRORLEVEL% neq 0 exit 1 + +:: don't include html docs that get installed +rd /s /q %LIBRARY_PREFIX%\html + +:: install pkgconfig metadata (useful for downstream packages); +:: adapted from inspecting the conda-forge .pc files for unix, as well as +:: https://github.com/microsoft/vcpkg/blob/master/ports/openssl/install-pc-files.cmake +mkdir %LIBRARY_PREFIX%\lib\pkgconfig +for %%F in (openssl libssl libcrypto) DO ( + echo prefix=%LIBRARY_PREFIX:\=/% > %%F.pc + type %RECIPE_DIR%\win_pkgconfig\%%F.pc.in >> %%F.pc + echo Version: %PKG_VERSION% >> %%F.pc + copy %%F.pc %LIBRARY_PREFIX%\lib\pkgconfig\%%F.pc +) + +mkdir %LIBRARY_PREFIX%\ssl\certs +type NUL > %LIBRARY_PREFIX%\ssl\certs\.keep + +:: Copy the [de]activate scripts to %PREFIX%\etc\conda\[de]activate.d. +:: This will allow them to be run on environment activation. +for %%F in (activate deactivate) DO ( + if not exist %PREFIX%\etc\conda\%%F.d mkdir %PREFIX%\etc\conda\%%F.d + copy "%RECIPE_DIR%\%%F-win.bat" "%PREFIX%\etc\conda\%%F.d\%PKG_NAME%_%%F-win.bat" + copy "%RECIPE_DIR%\%%F-win.ps1" "%PREFIX%\etc\conda\%%F.d\%PKG_NAME%_%%F-win.ps1" + :: Copy unix shell activation scripts, needed by Windows Bash users + copy "%RECIPE_DIR%\%%F-win.sh" "%PREFIX%\etc\conda\%%F.d\%PKG_NAME%_%%F-win.sh" +) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/install_openssl.sh b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/install_openssl.sh new file mode 100644 index 0000000000000000000000000000000000000000..e12c78956d70c2317a87dcb547b049699f09db53 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/install_openssl.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +PERL=${PREFIX}/bin/perl +make install_sw install_ssldirs + +# https://github.com/ContinuumIO/anaconda-issues/issues/6424 +if [[ ${HOST} =~ .*linux.* ]]; then + if execstack -q "${PREFIX}"/lib/libcrypto.so.3.0 | grep -e '^X '; then + echo "Error, executable stack found in libcrypto.so.3.0" + exit 1 + fi +fi + +# Make sure ${PREFIX}/ssl/certs directory exists +# Otherwise SSL_ERROR_SYSCALL is returned instead of SSL_ERROR_SLL +mkdir -p "${PREFIX}/ssl/certs" +touch "${PREFIX}/ssl/certs/.keep" + +# remove the static libraries +rm ${PREFIX}/lib/libcrypto.a +rm ${PREFIX}/lib/libssl.a + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/meta.yaml b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2f55e55e7166498717f7c703cd642cc57fd083ab --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/meta.yaml @@ -0,0 +1,105 @@ +{% set version = "3.6.2" %} + +package: + name: openssl_split + version: {{ version }} + +source: + url: https://github.com/openssl/openssl/releases/download/openssl-{{ version }}/openssl-{{ version }}.tar.gz + sha256: aaf51a1fe064384f811daeaeb4ec4dce7340ec8bd893027eee676af31e83a04f + +build: + number: 0 + +requirements: + build: + - {{ compiler('c') }} + - {{ stdlib('c') }} + - nasm # [win] + - make # [unix] + - perl * + # Empty host section to ensure that this is identified as cb3 + host: + +outputs: + - name: openssl + script: install_openssl.sh # [unix] + script: install_openssl.bat # [win] + build: + run_exports: + # openssl's versioning used to be X.Y.Z(rev), but is MAJOR.MINOR.PATCH since 3.0.0; + # see https://www.openssl.org/policies/releasestrat.html + - {{ pin_subpackage('openssl', max_pin='x') }} + requirements: + build: + - {{ compiler('c') }} + - {{ stdlib('c') }} + - make + - perl * + # Empty host section to ensure that this is identified as cb3 + # FIXME: this doesn't seem to be enough. We need a compiler in build + # with `compiler` jinja used to not use legacy cb2 build==host + host: + run: + - ca-certificates + test: + requires: + - pkg-config + - ripgrep + commands: + - copy NUL checksum.txt # [win] + - touch checksum.txt # [unix] + - $PREFIX/bin/openssl sha256 checksum.txt # [unix] + - '%LIBRARY_BIN%\openssl sha256 checksum.txt' # [win] + - if not exist "%SSL_CERT_FILE%" exit 1 # [win] + - if not exist "%LIBRARY_INC%"\\openssl\\applink.c exit 1 # [win] + + # test pkgconfig metadata + - pkg-config --print-errors --exact-version "{{ version }}" openssl + # test prefix is set as well (see #155) + - if [[ "$(pkg-config --variable=prefix openssl)" == "" ]]; then exit 1; fi # [unix] + + # ensure (de)activation scripts for bash-on-win do not contain crlf line endings; + # ripgrep will return exit code 1 if no match is found, which is what we want after + # filtering to the carriage-return character that shouldn't be there. + {% for task in ["activate", "deactivate"] %} + - type %CONDA_PREFIX%\etc\conda\{{ task }}.d\openssl_{{ task }}-win.sh | rg \r & if ERRORLEVEL ==1 (exit 0) else (exit 1) # [win] + # do not use %ERRORLEVEL% or !ERRORLEVEL!, but ERRORLEVEL, c.f. + # https://devblogs.microsoft.com/oldnewthing/20080926-00/?p=20743; + # while `if ... NEQ 1 exit 1` would be nicer, NEQ is incompatible with + # using bare ERRORLEVEL, see https://stackoverflow.com/a/74148543 + {% endfor %} + + - name: libopenssl-static + script: install_libopenssl-static.sh # [unix] + script: install_libopenssl-static.bat # [win] + requirements: + build: + - {{ compiler('c') }} + - {{ stdlib('c') }} + run: + - {{ pin_subpackage('openssl', exact=True) }} + test: + commands: + - test -f ${PREFIX}/lib/libcrypto.a # [unix] + - test -f ${PREFIX}/lib/libssl.a # [unix] + - if not exist %LIBRARY_LIB%\libcrypto_static.lib exit 1 # [win] + - if not exist %LIBRARY_LIB%\libssl_static.lib exit 1 # [win] + +about: + home: https://www.openssl.org/ + license_file: LICENSE.txt + license: Apache-2.0 + license_family: Apache + summary: OpenSSL is an open-source implementation of the SSL and TLS protocols + dev_url: https://github.com/openssl/openssl + doc_url: https://docs.openssl.org/master/ + +extra: + recipe-maintainers: + - jakirkham + - msarahan + - ocefpaf + - pelson + - h-vetinari + feedstock-name: openssl diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/recipe-scripts-license.txt b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/recipe-scripts-license.txt new file mode 100644 index 0000000000000000000000000000000000000000..37f86184003c2b95ccdf45542a54b3629fb46a3f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/recipe-scripts-license.txt @@ -0,0 +1,26 @@ +BSD-3-Clause license +Copyright (c) 2015-2026, conda-forge contributors + +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 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. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/win_pkgconfig/libcrypto.pc.in b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/win_pkgconfig/libcrypto.pc.in new file mode 100644 index 0000000000000000000000000000000000000000..356fbf7cd6c5f746987b772443d3d673420cfaa9 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/win_pkgconfig/libcrypto.pc.in @@ -0,0 +1,9 @@ +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: OpenSSL-libcrypto +Description: OpenSSL cryptography library +Libs: -L"${libdir}" -llibcrypto +Libs.private: -lcrypt32 -lws2_32 +Cflags: -I"${includedir}" diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/win_pkgconfig/libssl.pc.in b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/win_pkgconfig/libssl.pc.in new file mode 100644 index 0000000000000000000000000000000000000000..4280e9c0a8793b11c86420ade390a16c346563ef --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/win_pkgconfig/libssl.pc.in @@ -0,0 +1,9 @@ +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: OpenSSL-libssl +Description: Secure Sockets Layer and cryptography libraries +Libs: -L"${libdir}" -llibssl +Requires: libcrypto +Cflags: -I"${includedir}" diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/win_pkgconfig/openssl.pc.in b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/win_pkgconfig/openssl.pc.in new file mode 100644 index 0000000000000000000000000000000000000000..c59de02b3af0127d1fd8bb60b09f940cd6939819 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/recipe/parent/win_pkgconfig/openssl.pc.in @@ -0,0 +1,7 @@ +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: OpenSSL +Description: Secure Sockets Layer and cryptography libraries and tools +Requires: libssl libcrypto diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/repodata_record.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/repodata_record.json new file mode 100644 index 0000000000000000000000000000000000000000..34a4d94656c1903d661875a6184ad9c3161d79e3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/repodata_record.json @@ -0,0 +1,26 @@ +{ + "arch": "x86_64", + "build": "hf411b9b_0", + "build_number": 0, + "build_string": "hf411b9b_0", + "channel": "conda-forge", + "constrains": [], + "depends": [ + "ca-certificates", + "ucrt >=10.0.20348.0", + "vc >=14.3,<15", + "vc14_runtime >=14.44.35208" + ], + "fn": "openssl-3.6.2-hf411b9b_0.conda", + "license": "Apache-2.0", + "license_family": "Apache", + "md5": "05c7d624cff49dbd8db1ad5ba537a8a3", + "name": "openssl", + "platform": "win", + "sha256": "feb5815125c60f2be4a411e532db1ed1cd2d7261a6a43c54cb6ae90724e2e154", + "size": 9410183, + "subdir": "win-64", + "timestamp": 1775589779, + "url": "https://conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0.conda", + "version": "3.6.2" +} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/run_exports.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/run_exports.json new file mode 100644 index 0000000000000000000000000000000000000000..6b49bf6d898d5240cb4b583eda5051d9fa3da3ed --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/run_exports.json @@ -0,0 +1 @@ +{"weak": ["openssl >=3.6.2,<4.0a0"]} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/test/run_test.bat b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/test/run_test.bat new file mode 100644 index 0000000000000000000000000000000000000000..33de364dc8e10754e4860af0e09de51b3364c98b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/test/run_test.bat @@ -0,0 +1,19 @@ + + +@echo on + +copy NUL checksum.txt +IF %ERRORLEVEL% NEQ 0 exit /B 1 +%LIBRARY_BIN%\openssl sha256 checksum.txt +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if not exist "%SSL_CERT_FILE%" exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if not exist "%LIBRARY_INC%"\\openssl\\applink.c exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +pkg-config --print-errors --exact-version "3.6.2" openssl +IF %ERRORLEVEL% NEQ 0 exit /B 1 +type %CONDA_PREFIX%\etc\conda\activate.d\openssl_activate-win.sh | rg \r & if ERRORLEVEL ==1 (exit 0) else (exit 1) +IF %ERRORLEVEL% NEQ 0 exit /B 1 +type %CONDA_PREFIX%\etc\conda\deactivate.d\openssl_deactivate-win.sh | rg \r & if ERRORLEVEL ==1 (exit 0) else (exit 1) +IF %ERRORLEVEL% NEQ 0 exit /B 1 +exit /B 0 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/test/test_time_dependencies.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/test/test_time_dependencies.json new file mode 100644 index 0000000000000000000000000000000000000000..2c1c0989a56e6de7e591cf268edfc42e2f0b00d3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/info/test/test_time_dependencies.json @@ -0,0 +1 @@ +["ripgrep", "pkg-config"] \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/bin/pcre-config b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/bin/pcre-config new file mode 100644 index 0000000000000000000000000000000000000000..35ad39dd4d0e8ff103433f19508828b442b1de5e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/bin/pcre-config @@ -0,0 +1,133 @@ +#!/bin/sh + +prefix=D:/bld/pcre_1623788775763/_h_env/Library +exec_prefix=${prefix} +exec_prefix_set=no + +cflags="[--cflags]" + +if test yes = yes ; then + libs="[--libs-cpp]" +else + libs= +fi + +if test no = yes ; then + libs="[--libs16] $libs" +fi + +if test no = yes ; then + libs="[--libs32] $libs" +fi + +if test yes = yes ; then + libs="[--libs] [--libs-posix] $libs" + cflags="$cflags [--cflags-posix]" +fi + +usage="Usage: pcre-config [--prefix] [--exec-prefix] [--version] $libs $cflags" + +if test $# -eq 0; then + echo "${usage}" 1>&2 + exit 1 +fi + +libR= +case `uname -s` in + *SunOS*) + libR=" -R${exec_prefix}/lib" + ;; + *BSD*) + libR=" -Wl,-R${exec_prefix}/lib" + ;; +esac + +libS= +if test ${exec_prefix}/lib != /usr/lib ; then + libS=-L${exec_prefix}/lib +fi + +while test $# -gt 0; do + case "$1" in + -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + case $1 in + --prefix=*) + prefix=$optarg + if test $exec_prefix_set = no ; then + exec_prefix=$optarg + fi + ;; + --prefix) + echo $prefix + ;; + --exec-prefix=*) + exec_prefix=$optarg + exec_prefix_set=yes + ;; + --exec-prefix) + echo $exec_prefix + ;; + --version) + echo 8.45 + ;; + --cflags) + if test ${prefix}/include != /usr/include ; then + includes=-I${prefix}/include + fi + echo $includes + ;; + --cflags-posix) + if test yes = yes ; then + if test ${prefix}/include != /usr/include ; then + includes=-I${prefix}/include + fi + echo $includes + else + echo "${usage}" 1>&2 + fi + ;; + --libs-posix) + if test yes = yes ; then + echo $libS$libR -lpcreposix -lpcre + else + echo "${usage}" 1>&2 + fi + ;; + --libs) + if test yes = yes ; then + echo $libS$libR -lpcre + else + echo "${usage}" 1>&2 + fi + ;; + --libs16) + if test no = yes ; then + echo $libS$libR -lpcre16 + else + echo "${usage}" 1>&2 + fi + ;; + --libs32) + if test no = yes ; then + echo $libS$libR -lpcre32 + else + echo "${usage}" 1>&2 + fi + ;; + --libs-cpp) + if test yes = yes ; then + echo $libS$libR -lpcrecpp -lpcre + else + echo "${usage}" 1>&2 + fi + ;; + *) + echo "${usage}" 1>&2 + exit 1 + ;; + esac + shift +done diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/bin/pcre_scanner_unittest.exe b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/bin/pcre_scanner_unittest.exe new file mode 100644 index 0000000000000000000000000000000000000000..5507568e9f16b7456ffa4558c5e7d9fc67738f9e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/bin/pcre_scanner_unittest.exe differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/bin/pcre_stringpiece_unittest.exe b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/bin/pcre_stringpiece_unittest.exe new file mode 100644 index 0000000000000000000000000000000000000000..13aa5704924521fab3b0b5bbae1a9d8176c9fbc8 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/bin/pcre_stringpiece_unittest.exe differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/bin/pcrecpp.dll b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/bin/pcrecpp.dll new file mode 100644 index 0000000000000000000000000000000000000000..1aa567a661bd295ebf05721c1e99f1b8107b569c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/bin/pcrecpp.dll differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/bin/pcregrep.exe b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/bin/pcregrep.exe new file mode 100644 index 0000000000000000000000000000000000000000..b43d157795010e3478bd37619debcef6def2ef77 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/bin/pcregrep.exe differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/bin/pcreposix.dll b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/bin/pcreposix.dll new file mode 100644 index 0000000000000000000000000000000000000000..e3904690e9441d5d2e5c1f23b86bdd7132ea5fe2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/bin/pcreposix.dll differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/bin/pcretest.exe b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/bin/pcretest.exe new file mode 100644 index 0000000000000000000000000000000000000000..370d8cfe9de30e41139feef414d3460168d77a0a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/bin/pcretest.exe differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/include/pcre.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/include/pcre.h new file mode 100644 index 0000000000000000000000000000000000000000..1baec5ebd23f8afaf269d083f1671f6218b76969 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/include/pcre.h @@ -0,0 +1,677 @@ +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +/* This is the public header file for the PCRE library, to be #included by +applications that call the PCRE functions. + + Copyright (c) 1997-2014 University of Cambridge + +----------------------------------------------------------------------------- +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 University of Cambridge 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. +----------------------------------------------------------------------------- +*/ + +#ifndef _PCRE_H +#define _PCRE_H + +/* The current PCRE version information. */ + +#define PCRE_MAJOR 8 +#define PCRE_MINOR 45 +#define PCRE_PRERELEASE +#define PCRE_DATE 2021-06-15 + +/* When an application links to a PCRE DLL in Windows, the symbols that are +imported have to be identified as such. When building PCRE, the appropriate +export setting is defined in pcre_internal.h, which includes this file. So we +don't change existing definitions of PCRE_EXP_DECL and PCRECPP_EXP_DECL. */ + +#if defined(_WIN32) && !defined(PCRE_STATIC) +# ifndef PCRE_EXP_DECL +# define PCRE_EXP_DECL extern __declspec(dllimport) +# endif +# ifdef __cplusplus +# ifndef PCRECPP_EXP_DECL +# define PCRECPP_EXP_DECL extern __declspec(dllimport) +# endif +# ifndef PCRECPP_EXP_DEFN +# define PCRECPP_EXP_DEFN __declspec(dllimport) +# endif +# endif +#endif + +/* By default, we use the standard "extern" declarations. */ + +#ifndef PCRE_EXP_DECL +# ifdef __cplusplus +# define PCRE_EXP_DECL extern "C" +# else +# define PCRE_EXP_DECL extern +# endif +#endif + +#ifdef __cplusplus +# ifndef PCRECPP_EXP_DECL +# define PCRECPP_EXP_DECL extern +# endif +# ifndef PCRECPP_EXP_DEFN +# define PCRECPP_EXP_DEFN +# endif +#endif + +/* Have to include stdlib.h in order to ensure that size_t is defined; +it is needed here for malloc. */ + +#include + +/* Allow for C++ users */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Public options. Some are compile-time only, some are run-time only, and some +are both. Most of the compile-time options are saved with the compiled regex so +that they can be inspected during studying (and therefore JIT compiling). Note +that pcre_study() has its own set of options. Originally, all the options +defined here used distinct bits. However, almost all the bits in a 32-bit word +are now used, so in order to conserve them, option bits that were previously +only recognized at matching time (i.e. by pcre_exec() or pcre_dfa_exec()) may +also be used for compile-time options that affect only compiling and are not +relevant for studying or JIT compiling. + +Some options for pcre_compile() change its behaviour but do not affect the +behaviour of the execution functions. Other options are passed through to the +execution functions and affect their behaviour, with or without affecting the +behaviour of pcre_compile(). + +Options that can be passed to pcre_compile() are tagged Cx below, with these +variants: + +C1 Affects compile only +C2 Does not affect compile; affects exec, dfa_exec +C3 Affects compile, exec, dfa_exec +C4 Affects compile, exec, dfa_exec, study +C5 Affects compile, exec, study + +Options that can be set for pcre_exec() and/or pcre_dfa_exec() are flagged with +E and D, respectively. They take precedence over C3, C4, and C5 settings passed +from pcre_compile(). Those that are compatible with JIT execution are flagged +with J. */ + +#define PCRE_CASELESS 0x00000001 /* C1 */ +#define PCRE_MULTILINE 0x00000002 /* C1 */ +#define PCRE_DOTALL 0x00000004 /* C1 */ +#define PCRE_EXTENDED 0x00000008 /* C1 */ +#define PCRE_ANCHORED 0x00000010 /* C4 E D */ +#define PCRE_DOLLAR_ENDONLY 0x00000020 /* C2 */ +#define PCRE_EXTRA 0x00000040 /* C1 */ +#define PCRE_NOTBOL 0x00000080 /* E D J */ +#define PCRE_NOTEOL 0x00000100 /* E D J */ +#define PCRE_UNGREEDY 0x00000200 /* C1 */ +#define PCRE_NOTEMPTY 0x00000400 /* E D J */ +#define PCRE_UTF8 0x00000800 /* C4 ) */ +#define PCRE_UTF16 0x00000800 /* C4 ) Synonyms */ +#define PCRE_UTF32 0x00000800 /* C4 ) */ +#define PCRE_NO_AUTO_CAPTURE 0x00001000 /* C1 */ +#define PCRE_NO_UTF8_CHECK 0x00002000 /* C1 E D J ) */ +#define PCRE_NO_UTF16_CHECK 0x00002000 /* C1 E D J ) Synonyms */ +#define PCRE_NO_UTF32_CHECK 0x00002000 /* C1 E D J ) */ +#define PCRE_AUTO_CALLOUT 0x00004000 /* C1 */ +#define PCRE_PARTIAL_SOFT 0x00008000 /* E D J ) Synonyms */ +#define PCRE_PARTIAL 0x00008000 /* E D J ) */ + +/* This pair use the same bit. */ +#define PCRE_NEVER_UTF 0x00010000 /* C1 ) Overlaid */ +#define PCRE_DFA_SHORTEST 0x00010000 /* D ) Overlaid */ + +/* This pair use the same bit. */ +#define PCRE_NO_AUTO_POSSESS 0x00020000 /* C1 ) Overlaid */ +#define PCRE_DFA_RESTART 0x00020000 /* D ) Overlaid */ + +#define PCRE_FIRSTLINE 0x00040000 /* C3 */ +#define PCRE_DUPNAMES 0x00080000 /* C1 */ +#define PCRE_NEWLINE_CR 0x00100000 /* C3 E D */ +#define PCRE_NEWLINE_LF 0x00200000 /* C3 E D */ +#define PCRE_NEWLINE_CRLF 0x00300000 /* C3 E D */ +#define PCRE_NEWLINE_ANY 0x00400000 /* C3 E D */ +#define PCRE_NEWLINE_ANYCRLF 0x00500000 /* C3 E D */ +#define PCRE_BSR_ANYCRLF 0x00800000 /* C3 E D */ +#define PCRE_BSR_UNICODE 0x01000000 /* C3 E D */ +#define PCRE_JAVASCRIPT_COMPAT 0x02000000 /* C5 */ +#define PCRE_NO_START_OPTIMIZE 0x04000000 /* C2 E D ) Synonyms */ +#define PCRE_NO_START_OPTIMISE 0x04000000 /* C2 E D ) */ +#define PCRE_PARTIAL_HARD 0x08000000 /* E D J */ +#define PCRE_NOTEMPTY_ATSTART 0x10000000 /* E D J */ +#define PCRE_UCP 0x20000000 /* C3 */ + +/* Exec-time and get/set-time error codes */ + +#define PCRE_ERROR_NOMATCH (-1) +#define PCRE_ERROR_NULL (-2) +#define PCRE_ERROR_BADOPTION (-3) +#define PCRE_ERROR_BADMAGIC (-4) +#define PCRE_ERROR_UNKNOWN_OPCODE (-5) +#define PCRE_ERROR_UNKNOWN_NODE (-5) /* For backward compatibility */ +#define PCRE_ERROR_NOMEMORY (-6) +#define PCRE_ERROR_NOSUBSTRING (-7) +#define PCRE_ERROR_MATCHLIMIT (-8) +#define PCRE_ERROR_CALLOUT (-9) /* Never used by PCRE itself */ +#define PCRE_ERROR_BADUTF8 (-10) /* Same for 8/16/32 */ +#define PCRE_ERROR_BADUTF16 (-10) /* Same for 8/16/32 */ +#define PCRE_ERROR_BADUTF32 (-10) /* Same for 8/16/32 */ +#define PCRE_ERROR_BADUTF8_OFFSET (-11) /* Same for 8/16 */ +#define PCRE_ERROR_BADUTF16_OFFSET (-11) /* Same for 8/16 */ +#define PCRE_ERROR_PARTIAL (-12) +#define PCRE_ERROR_BADPARTIAL (-13) +#define PCRE_ERROR_INTERNAL (-14) +#define PCRE_ERROR_BADCOUNT (-15) +#define PCRE_ERROR_DFA_UITEM (-16) +#define PCRE_ERROR_DFA_UCOND (-17) +#define PCRE_ERROR_DFA_UMLIMIT (-18) +#define PCRE_ERROR_DFA_WSSIZE (-19) +#define PCRE_ERROR_DFA_RECURSE (-20) +#define PCRE_ERROR_RECURSIONLIMIT (-21) +#define PCRE_ERROR_NULLWSLIMIT (-22) /* No longer actually used */ +#define PCRE_ERROR_BADNEWLINE (-23) +#define PCRE_ERROR_BADOFFSET (-24) +#define PCRE_ERROR_SHORTUTF8 (-25) +#define PCRE_ERROR_SHORTUTF16 (-25) /* Same for 8/16 */ +#define PCRE_ERROR_RECURSELOOP (-26) +#define PCRE_ERROR_JIT_STACKLIMIT (-27) +#define PCRE_ERROR_BADMODE (-28) +#define PCRE_ERROR_BADENDIANNESS (-29) +#define PCRE_ERROR_DFA_BADRESTART (-30) +#define PCRE_ERROR_JIT_BADOPTION (-31) +#define PCRE_ERROR_BADLENGTH (-32) +#define PCRE_ERROR_UNSET (-33) + +/* Specific error codes for UTF-8 validity checks */ + +#define PCRE_UTF8_ERR0 0 +#define PCRE_UTF8_ERR1 1 +#define PCRE_UTF8_ERR2 2 +#define PCRE_UTF8_ERR3 3 +#define PCRE_UTF8_ERR4 4 +#define PCRE_UTF8_ERR5 5 +#define PCRE_UTF8_ERR6 6 +#define PCRE_UTF8_ERR7 7 +#define PCRE_UTF8_ERR8 8 +#define PCRE_UTF8_ERR9 9 +#define PCRE_UTF8_ERR10 10 +#define PCRE_UTF8_ERR11 11 +#define PCRE_UTF8_ERR12 12 +#define PCRE_UTF8_ERR13 13 +#define PCRE_UTF8_ERR14 14 +#define PCRE_UTF8_ERR15 15 +#define PCRE_UTF8_ERR16 16 +#define PCRE_UTF8_ERR17 17 +#define PCRE_UTF8_ERR18 18 +#define PCRE_UTF8_ERR19 19 +#define PCRE_UTF8_ERR20 20 +#define PCRE_UTF8_ERR21 21 +#define PCRE_UTF8_ERR22 22 /* Unused (was non-character) */ + +/* Specific error codes for UTF-16 validity checks */ + +#define PCRE_UTF16_ERR0 0 +#define PCRE_UTF16_ERR1 1 +#define PCRE_UTF16_ERR2 2 +#define PCRE_UTF16_ERR3 3 +#define PCRE_UTF16_ERR4 4 /* Unused (was non-character) */ + +/* Specific error codes for UTF-32 validity checks */ + +#define PCRE_UTF32_ERR0 0 +#define PCRE_UTF32_ERR1 1 +#define PCRE_UTF32_ERR2 2 /* Unused (was non-character) */ +#define PCRE_UTF32_ERR3 3 + +/* Request types for pcre_fullinfo() */ + +#define PCRE_INFO_OPTIONS 0 +#define PCRE_INFO_SIZE 1 +#define PCRE_INFO_CAPTURECOUNT 2 +#define PCRE_INFO_BACKREFMAX 3 +#define PCRE_INFO_FIRSTBYTE 4 +#define PCRE_INFO_FIRSTCHAR 4 /* For backwards compatibility */ +#define PCRE_INFO_FIRSTTABLE 5 +#define PCRE_INFO_LASTLITERAL 6 +#define PCRE_INFO_NAMEENTRYSIZE 7 +#define PCRE_INFO_NAMECOUNT 8 +#define PCRE_INFO_NAMETABLE 9 +#define PCRE_INFO_STUDYSIZE 10 +#define PCRE_INFO_DEFAULT_TABLES 11 +#define PCRE_INFO_OKPARTIAL 12 +#define PCRE_INFO_JCHANGED 13 +#define PCRE_INFO_HASCRORLF 14 +#define PCRE_INFO_MINLENGTH 15 +#define PCRE_INFO_JIT 16 +#define PCRE_INFO_JITSIZE 17 +#define PCRE_INFO_MAXLOOKBEHIND 18 +#define PCRE_INFO_FIRSTCHARACTER 19 +#define PCRE_INFO_FIRSTCHARACTERFLAGS 20 +#define PCRE_INFO_REQUIREDCHAR 21 +#define PCRE_INFO_REQUIREDCHARFLAGS 22 +#define PCRE_INFO_MATCHLIMIT 23 +#define PCRE_INFO_RECURSIONLIMIT 24 +#define PCRE_INFO_MATCH_EMPTY 25 + +/* Request types for pcre_config(). Do not re-arrange, in order to remain +compatible. */ + +#define PCRE_CONFIG_UTF8 0 +#define PCRE_CONFIG_NEWLINE 1 +#define PCRE_CONFIG_LINK_SIZE 2 +#define PCRE_CONFIG_POSIX_MALLOC_THRESHOLD 3 +#define PCRE_CONFIG_MATCH_LIMIT 4 +#define PCRE_CONFIG_STACKRECURSE 5 +#define PCRE_CONFIG_UNICODE_PROPERTIES 6 +#define PCRE_CONFIG_MATCH_LIMIT_RECURSION 7 +#define PCRE_CONFIG_BSR 8 +#define PCRE_CONFIG_JIT 9 +#define PCRE_CONFIG_UTF16 10 +#define PCRE_CONFIG_JITTARGET 11 +#define PCRE_CONFIG_UTF32 12 +#define PCRE_CONFIG_PARENS_LIMIT 13 + +/* Request types for pcre_study(). Do not re-arrange, in order to remain +compatible. */ + +#define PCRE_STUDY_JIT_COMPILE 0x0001 +#define PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE 0x0002 +#define PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE 0x0004 +#define PCRE_STUDY_EXTRA_NEEDED 0x0008 + +/* Bit flags for the pcre[16|32]_extra structure. Do not re-arrange or redefine +these bits, just add new ones on the end, in order to remain compatible. */ + +#define PCRE_EXTRA_STUDY_DATA 0x0001 +#define PCRE_EXTRA_MATCH_LIMIT 0x0002 +#define PCRE_EXTRA_CALLOUT_DATA 0x0004 +#define PCRE_EXTRA_TABLES 0x0008 +#define PCRE_EXTRA_MATCH_LIMIT_RECURSION 0x0010 +#define PCRE_EXTRA_MARK 0x0020 +#define PCRE_EXTRA_EXECUTABLE_JIT 0x0040 + +/* Types */ + +struct real_pcre8_or_16; /* declaration; the definition is private */ +typedef struct real_pcre8_or_16 pcre; + +struct real_pcre8_or_16; /* declaration; the definition is private */ +typedef struct real_pcre8_or_16 pcre16; + +struct real_pcre32; /* declaration; the definition is private */ +typedef struct real_pcre32 pcre32; + +struct real_pcre_jit_stack; /* declaration; the definition is private */ +typedef struct real_pcre_jit_stack pcre_jit_stack; + +struct real_pcre16_jit_stack; /* declaration; the definition is private */ +typedef struct real_pcre16_jit_stack pcre16_jit_stack; + +struct real_pcre32_jit_stack; /* declaration; the definition is private */ +typedef struct real_pcre32_jit_stack pcre32_jit_stack; + +/* If PCRE is compiled with 16 bit character support, PCRE_UCHAR16 must contain +a 16 bit wide signed data type. Otherwise it can be a dummy data type since +pcre16 functions are not implemented. There is a check for this in pcre_internal.h. */ +#ifndef PCRE_UCHAR16 +#define PCRE_UCHAR16 unsigned short +#endif + +#ifndef PCRE_SPTR16 +#define PCRE_SPTR16 const PCRE_UCHAR16 * +#endif + +/* If PCRE is compiled with 32 bit character support, PCRE_UCHAR32 must contain +a 32 bit wide signed data type. Otherwise it can be a dummy data type since +pcre32 functions are not implemented. There is a check for this in pcre_internal.h. */ +#ifndef PCRE_UCHAR32 +#define PCRE_UCHAR32 unsigned int +#endif + +#ifndef PCRE_SPTR32 +#define PCRE_SPTR32 const PCRE_UCHAR32 * +#endif + +/* When PCRE is compiled as a C++ library, the subject pointer type can be +replaced with a custom type. For conventional use, the public interface is a +const char *. */ + +#ifndef PCRE_SPTR +#define PCRE_SPTR const char * +#endif + +/* The structure for passing additional data to pcre_exec(). This is defined in +such as way as to be extensible. Always add new fields at the end, in order to +remain compatible. */ + +typedef struct pcre_extra { + unsigned long int flags; /* Bits for which fields are set */ + void *study_data; /* Opaque data from pcre_study() */ + unsigned long int match_limit; /* Maximum number of calls to match() */ + void *callout_data; /* Data passed back in callouts */ + const unsigned char *tables; /* Pointer to character tables */ + unsigned long int match_limit_recursion; /* Max recursive calls to match() */ + unsigned char **mark; /* For passing back a mark pointer */ + void *executable_jit; /* Contains a pointer to a compiled jit code */ +} pcre_extra; + +/* Same structure as above, but with 16 bit char pointers. */ + +typedef struct pcre16_extra { + unsigned long int flags; /* Bits for which fields are set */ + void *study_data; /* Opaque data from pcre_study() */ + unsigned long int match_limit; /* Maximum number of calls to match() */ + void *callout_data; /* Data passed back in callouts */ + const unsigned char *tables; /* Pointer to character tables */ + unsigned long int match_limit_recursion; /* Max recursive calls to match() */ + PCRE_UCHAR16 **mark; /* For passing back a mark pointer */ + void *executable_jit; /* Contains a pointer to a compiled jit code */ +} pcre16_extra; + +/* Same structure as above, but with 32 bit char pointers. */ + +typedef struct pcre32_extra { + unsigned long int flags; /* Bits for which fields are set */ + void *study_data; /* Opaque data from pcre_study() */ + unsigned long int match_limit; /* Maximum number of calls to match() */ + void *callout_data; /* Data passed back in callouts */ + const unsigned char *tables; /* Pointer to character tables */ + unsigned long int match_limit_recursion; /* Max recursive calls to match() */ + PCRE_UCHAR32 **mark; /* For passing back a mark pointer */ + void *executable_jit; /* Contains a pointer to a compiled jit code */ +} pcre32_extra; + +/* The structure for passing out data via the pcre_callout_function. We use a +structure so that new fields can be added on the end in future versions, +without changing the API of the function, thereby allowing old clients to work +without modification. */ + +typedef struct pcre_callout_block { + int version; /* Identifies version of block */ + /* ------------------------ Version 0 ------------------------------- */ + int callout_number; /* Number compiled into pattern */ + int *offset_vector; /* The offset vector */ + PCRE_SPTR subject; /* The subject being matched */ + int subject_length; /* The length of the subject */ + int start_match; /* Offset to start of this match attempt */ + int current_position; /* Where we currently are in the subject */ + int capture_top; /* Max current capture */ + int capture_last; /* Most recently closed capture */ + void *callout_data; /* Data passed in with the call */ + /* ------------------- Added for Version 1 -------------------------- */ + int pattern_position; /* Offset to next item in the pattern */ + int next_item_length; /* Length of next item in the pattern */ + /* ------------------- Added for Version 2 -------------------------- */ + const unsigned char *mark; /* Pointer to current mark or NULL */ + /* ------------------------------------------------------------------ */ +} pcre_callout_block; + +/* Same structure as above, but with 16 bit char pointers. */ + +typedef struct pcre16_callout_block { + int version; /* Identifies version of block */ + /* ------------------------ Version 0 ------------------------------- */ + int callout_number; /* Number compiled into pattern */ + int *offset_vector; /* The offset vector */ + PCRE_SPTR16 subject; /* The subject being matched */ + int subject_length; /* The length of the subject */ + int start_match; /* Offset to start of this match attempt */ + int current_position; /* Where we currently are in the subject */ + int capture_top; /* Max current capture */ + int capture_last; /* Most recently closed capture */ + void *callout_data; /* Data passed in with the call */ + /* ------------------- Added for Version 1 -------------------------- */ + int pattern_position; /* Offset to next item in the pattern */ + int next_item_length; /* Length of next item in the pattern */ + /* ------------------- Added for Version 2 -------------------------- */ + const PCRE_UCHAR16 *mark; /* Pointer to current mark or NULL */ + /* ------------------------------------------------------------------ */ +} pcre16_callout_block; + +/* Same structure as above, but with 32 bit char pointers. */ + +typedef struct pcre32_callout_block { + int version; /* Identifies version of block */ + /* ------------------------ Version 0 ------------------------------- */ + int callout_number; /* Number compiled into pattern */ + int *offset_vector; /* The offset vector */ + PCRE_SPTR32 subject; /* The subject being matched */ + int subject_length; /* The length of the subject */ + int start_match; /* Offset to start of this match attempt */ + int current_position; /* Where we currently are in the subject */ + int capture_top; /* Max current capture */ + int capture_last; /* Most recently closed capture */ + void *callout_data; /* Data passed in with the call */ + /* ------------------- Added for Version 1 -------------------------- */ + int pattern_position; /* Offset to next item in the pattern */ + int next_item_length; /* Length of next item in the pattern */ + /* ------------------- Added for Version 2 -------------------------- */ + const PCRE_UCHAR32 *mark; /* Pointer to current mark or NULL */ + /* ------------------------------------------------------------------ */ +} pcre32_callout_block; + +/* Indirection for store get and free functions. These can be set to +alternative malloc/free functions if required. Special ones are used in the +non-recursive case for "frames". There is also an optional callout function +that is triggered by the (?) regex item. For Virtual Pascal, these definitions +have to take another form. */ + +#ifndef VPCOMPAT +PCRE_EXP_DECL void *(*pcre_malloc)(size_t); +PCRE_EXP_DECL void (*pcre_free)(void *); +PCRE_EXP_DECL void *(*pcre_stack_malloc)(size_t); +PCRE_EXP_DECL void (*pcre_stack_free)(void *); +PCRE_EXP_DECL int (*pcre_callout)(pcre_callout_block *); +PCRE_EXP_DECL int (*pcre_stack_guard)(void); + +PCRE_EXP_DECL void *(*pcre16_malloc)(size_t); +PCRE_EXP_DECL void (*pcre16_free)(void *); +PCRE_EXP_DECL void *(*pcre16_stack_malloc)(size_t); +PCRE_EXP_DECL void (*pcre16_stack_free)(void *); +PCRE_EXP_DECL int (*pcre16_callout)(pcre16_callout_block *); +PCRE_EXP_DECL int (*pcre16_stack_guard)(void); + +PCRE_EXP_DECL void *(*pcre32_malloc)(size_t); +PCRE_EXP_DECL void (*pcre32_free)(void *); +PCRE_EXP_DECL void *(*pcre32_stack_malloc)(size_t); +PCRE_EXP_DECL void (*pcre32_stack_free)(void *); +PCRE_EXP_DECL int (*pcre32_callout)(pcre32_callout_block *); +PCRE_EXP_DECL int (*pcre32_stack_guard)(void); +#else /* VPCOMPAT */ +PCRE_EXP_DECL void *pcre_malloc(size_t); +PCRE_EXP_DECL void pcre_free(void *); +PCRE_EXP_DECL void *pcre_stack_malloc(size_t); +PCRE_EXP_DECL void pcre_stack_free(void *); +PCRE_EXP_DECL int pcre_callout(pcre_callout_block *); +PCRE_EXP_DECL int pcre_stack_guard(void); + +PCRE_EXP_DECL void *pcre16_malloc(size_t); +PCRE_EXP_DECL void pcre16_free(void *); +PCRE_EXP_DECL void *pcre16_stack_malloc(size_t); +PCRE_EXP_DECL void pcre16_stack_free(void *); +PCRE_EXP_DECL int pcre16_callout(pcre16_callout_block *); +PCRE_EXP_DECL int pcre16_stack_guard(void); + +PCRE_EXP_DECL void *pcre32_malloc(size_t); +PCRE_EXP_DECL void pcre32_free(void *); +PCRE_EXP_DECL void *pcre32_stack_malloc(size_t); +PCRE_EXP_DECL void pcre32_stack_free(void *); +PCRE_EXP_DECL int pcre32_callout(pcre32_callout_block *); +PCRE_EXP_DECL int pcre32_stack_guard(void); +#endif /* VPCOMPAT */ + +/* User defined callback which provides a stack just before the match starts. */ + +typedef pcre_jit_stack *(*pcre_jit_callback)(void *); +typedef pcre16_jit_stack *(*pcre16_jit_callback)(void *); +typedef pcre32_jit_stack *(*pcre32_jit_callback)(void *); + +/* Exported PCRE functions */ + +PCRE_EXP_DECL pcre *pcre_compile(const char *, int, const char **, int *, + const unsigned char *); +PCRE_EXP_DECL pcre16 *pcre16_compile(PCRE_SPTR16, int, const char **, int *, + const unsigned char *); +PCRE_EXP_DECL pcre32 *pcre32_compile(PCRE_SPTR32, int, const char **, int *, + const unsigned char *); +PCRE_EXP_DECL pcre *pcre_compile2(const char *, int, int *, const char **, + int *, const unsigned char *); +PCRE_EXP_DECL pcre16 *pcre16_compile2(PCRE_SPTR16, int, int *, const char **, + int *, const unsigned char *); +PCRE_EXP_DECL pcre32 *pcre32_compile2(PCRE_SPTR32, int, int *, const char **, + int *, const unsigned char *); +PCRE_EXP_DECL int pcre_config(int, void *); +PCRE_EXP_DECL int pcre16_config(int, void *); +PCRE_EXP_DECL int pcre32_config(int, void *); +PCRE_EXP_DECL int pcre_copy_named_substring(const pcre *, const char *, + int *, int, const char *, char *, int); +PCRE_EXP_DECL int pcre16_copy_named_substring(const pcre16 *, PCRE_SPTR16, + int *, int, PCRE_SPTR16, PCRE_UCHAR16 *, int); +PCRE_EXP_DECL int pcre32_copy_named_substring(const pcre32 *, PCRE_SPTR32, + int *, int, PCRE_SPTR32, PCRE_UCHAR32 *, int); +PCRE_EXP_DECL int pcre_copy_substring(const char *, int *, int, int, + char *, int); +PCRE_EXP_DECL int pcre16_copy_substring(PCRE_SPTR16, int *, int, int, + PCRE_UCHAR16 *, int); +PCRE_EXP_DECL int pcre32_copy_substring(PCRE_SPTR32, int *, int, int, + PCRE_UCHAR32 *, int); +PCRE_EXP_DECL int pcre_dfa_exec(const pcre *, const pcre_extra *, + const char *, int, int, int, int *, int , int *, int); +PCRE_EXP_DECL int pcre16_dfa_exec(const pcre16 *, const pcre16_extra *, + PCRE_SPTR16, int, int, int, int *, int , int *, int); +PCRE_EXP_DECL int pcre32_dfa_exec(const pcre32 *, const pcre32_extra *, + PCRE_SPTR32, int, int, int, int *, int , int *, int); +PCRE_EXP_DECL int pcre_exec(const pcre *, const pcre_extra *, PCRE_SPTR, + int, int, int, int *, int); +PCRE_EXP_DECL int pcre16_exec(const pcre16 *, const pcre16_extra *, + PCRE_SPTR16, int, int, int, int *, int); +PCRE_EXP_DECL int pcre32_exec(const pcre32 *, const pcre32_extra *, + PCRE_SPTR32, int, int, int, int *, int); +PCRE_EXP_DECL int pcre_jit_exec(const pcre *, const pcre_extra *, + PCRE_SPTR, int, int, int, int *, int, + pcre_jit_stack *); +PCRE_EXP_DECL int pcre16_jit_exec(const pcre16 *, const pcre16_extra *, + PCRE_SPTR16, int, int, int, int *, int, + pcre16_jit_stack *); +PCRE_EXP_DECL int pcre32_jit_exec(const pcre32 *, const pcre32_extra *, + PCRE_SPTR32, int, int, int, int *, int, + pcre32_jit_stack *); +PCRE_EXP_DECL void pcre_free_substring(const char *); +PCRE_EXP_DECL void pcre16_free_substring(PCRE_SPTR16); +PCRE_EXP_DECL void pcre32_free_substring(PCRE_SPTR32); +PCRE_EXP_DECL void pcre_free_substring_list(const char **); +PCRE_EXP_DECL void pcre16_free_substring_list(PCRE_SPTR16 *); +PCRE_EXP_DECL void pcre32_free_substring_list(PCRE_SPTR32 *); +PCRE_EXP_DECL int pcre_fullinfo(const pcre *, const pcre_extra *, int, + void *); +PCRE_EXP_DECL int pcre16_fullinfo(const pcre16 *, const pcre16_extra *, int, + void *); +PCRE_EXP_DECL int pcre32_fullinfo(const pcre32 *, const pcre32_extra *, int, + void *); +PCRE_EXP_DECL int pcre_get_named_substring(const pcre *, const char *, + int *, int, const char *, const char **); +PCRE_EXP_DECL int pcre16_get_named_substring(const pcre16 *, PCRE_SPTR16, + int *, int, PCRE_SPTR16, PCRE_SPTR16 *); +PCRE_EXP_DECL int pcre32_get_named_substring(const pcre32 *, PCRE_SPTR32, + int *, int, PCRE_SPTR32, PCRE_SPTR32 *); +PCRE_EXP_DECL int pcre_get_stringnumber(const pcre *, const char *); +PCRE_EXP_DECL int pcre16_get_stringnumber(const pcre16 *, PCRE_SPTR16); +PCRE_EXP_DECL int pcre32_get_stringnumber(const pcre32 *, PCRE_SPTR32); +PCRE_EXP_DECL int pcre_get_stringtable_entries(const pcre *, const char *, + char **, char **); +PCRE_EXP_DECL int pcre16_get_stringtable_entries(const pcre16 *, PCRE_SPTR16, + PCRE_UCHAR16 **, PCRE_UCHAR16 **); +PCRE_EXP_DECL int pcre32_get_stringtable_entries(const pcre32 *, PCRE_SPTR32, + PCRE_UCHAR32 **, PCRE_UCHAR32 **); +PCRE_EXP_DECL int pcre_get_substring(const char *, int *, int, int, + const char **); +PCRE_EXP_DECL int pcre16_get_substring(PCRE_SPTR16, int *, int, int, + PCRE_SPTR16 *); +PCRE_EXP_DECL int pcre32_get_substring(PCRE_SPTR32, int *, int, int, + PCRE_SPTR32 *); +PCRE_EXP_DECL int pcre_get_substring_list(const char *, int *, int, + const char ***); +PCRE_EXP_DECL int pcre16_get_substring_list(PCRE_SPTR16, int *, int, + PCRE_SPTR16 **); +PCRE_EXP_DECL int pcre32_get_substring_list(PCRE_SPTR32, int *, int, + PCRE_SPTR32 **); +PCRE_EXP_DECL const unsigned char *pcre_maketables(void); +PCRE_EXP_DECL const unsigned char *pcre16_maketables(void); +PCRE_EXP_DECL const unsigned char *pcre32_maketables(void); +PCRE_EXP_DECL int pcre_refcount(pcre *, int); +PCRE_EXP_DECL int pcre16_refcount(pcre16 *, int); +PCRE_EXP_DECL int pcre32_refcount(pcre32 *, int); +PCRE_EXP_DECL pcre_extra *pcre_study(const pcre *, int, const char **); +PCRE_EXP_DECL pcre16_extra *pcre16_study(const pcre16 *, int, const char **); +PCRE_EXP_DECL pcre32_extra *pcre32_study(const pcre32 *, int, const char **); +PCRE_EXP_DECL void pcre_free_study(pcre_extra *); +PCRE_EXP_DECL void pcre16_free_study(pcre16_extra *); +PCRE_EXP_DECL void pcre32_free_study(pcre32_extra *); +PCRE_EXP_DECL const char *pcre_version(void); +PCRE_EXP_DECL const char *pcre16_version(void); +PCRE_EXP_DECL const char *pcre32_version(void); + +/* Utility functions for byte order swaps. */ +PCRE_EXP_DECL int pcre_pattern_to_host_byte_order(pcre *, pcre_extra *, + const unsigned char *); +PCRE_EXP_DECL int pcre16_pattern_to_host_byte_order(pcre16 *, pcre16_extra *, + const unsigned char *); +PCRE_EXP_DECL int pcre32_pattern_to_host_byte_order(pcre32 *, pcre32_extra *, + const unsigned char *); +PCRE_EXP_DECL int pcre16_utf16_to_host_byte_order(PCRE_UCHAR16 *, + PCRE_SPTR16, int, int *, int); +PCRE_EXP_DECL int pcre32_utf32_to_host_byte_order(PCRE_UCHAR32 *, + PCRE_SPTR32, int, int *, int); + +/* JIT compiler related functions. */ + +PCRE_EXP_DECL pcre_jit_stack *pcre_jit_stack_alloc(int, int); +PCRE_EXP_DECL pcre16_jit_stack *pcre16_jit_stack_alloc(int, int); +PCRE_EXP_DECL pcre32_jit_stack *pcre32_jit_stack_alloc(int, int); +PCRE_EXP_DECL void pcre_jit_stack_free(pcre_jit_stack *); +PCRE_EXP_DECL void pcre16_jit_stack_free(pcre16_jit_stack *); +PCRE_EXP_DECL void pcre32_jit_stack_free(pcre32_jit_stack *); +PCRE_EXP_DECL void pcre_assign_jit_stack(pcre_extra *, + pcre_jit_callback, void *); +PCRE_EXP_DECL void pcre16_assign_jit_stack(pcre16_extra *, + pcre16_jit_callback, void *); +PCRE_EXP_DECL void pcre32_assign_jit_stack(pcre32_extra *, + pcre32_jit_callback, void *); +PCRE_EXP_DECL void pcre_jit_free_unused_memory(void); +PCRE_EXP_DECL void pcre16_jit_free_unused_memory(void); +PCRE_EXP_DECL void pcre32_jit_free_unused_memory(void); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* End of pcre.h */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/include/pcre_scanner.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/include/pcre_scanner.h new file mode 100644 index 0000000000000000000000000000000000000000..5617e4515cb9620ab1803ab968c1b0feb6a740be --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/include/pcre_scanner.h @@ -0,0 +1,172 @@ +// Copyright (c) 2005, Google 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 Google 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. +// +// Author: Sanjay Ghemawat +// +// Regular-expression based scanner for parsing an input stream. +// +// Example 1: parse a sequence of "var = number" entries from input: +// +// Scanner scanner(input); +// string var; +// int number; +// scanner.SetSkipExpression("\\s+"); // Skip any white space we encounter +// while (scanner.Consume("(\\w+) = (\\d+)", &var, &number)) { +// ...; +// } + +#ifndef _PCRE_SCANNER_H +#define _PCRE_SCANNER_H + +#include +#include +#include + +#include +#include + +namespace pcrecpp { + +class PCRECPP_EXP_DEFN Scanner { + public: + Scanner(); + explicit Scanner(const std::string& input); + ~Scanner(); + + // Return current line number. The returned line-number is + // one-based. I.e. it returns 1 + the number of consumed newlines. + // + // Note: this method may be slow. It may take time proportional to + // the size of the input. + int LineNumber() const; + + // Return the byte-offset that the scanner is looking in the + // input data; + int Offset() const; + + // Return true iff the start of the remaining input matches "re" + bool LookingAt(const RE& re) const; + + // Return true iff all of the following are true + // a. the start of the remaining input matches "re", + // b. if any arguments are supplied, matched sub-patterns can be + // parsed and stored into the arguments. + // If it returns true, it skips over the matched input and any + // following input that matches the "skip" regular expression. + bool Consume(const RE& re, + const Arg& arg0 = RE::no_arg, + const Arg& arg1 = RE::no_arg, + const Arg& arg2 = RE::no_arg + // TODO: Allow more arguments? + ); + + // Set the "skip" regular expression. If after consuming some data, + // a prefix of the input matches this RE, it is automatically + // skipped. For example, a programming language scanner would use + // a skip RE that matches white space and comments. + // + // scanner.SetSkipExpression("\\s+|//.*|/[*](.|\n)*?[*]/"); + // + // Skipping repeats as long as it succeeds. We used to let people do + // this by writing "(...)*" in the regular expression, but that added + // up to lots of recursive calls within the pcre library, so now we + // control repetition explicitly via the function call API. + // + // You can pass NULL for "re" if you do not want any data to be skipped. + void Skip(const char* re); // DEPRECATED; does *not* repeat + void SetSkipExpression(const char* re); + + // Temporarily pause "skip"ing. This + // Skip("Foo"); code ; DisableSkip(); code; EnableSkip() + // is similar to + // Skip("Foo"); code ; Skip(NULL); code ; Skip("Foo"); + // but avoids creating/deleting new RE objects. + void DisableSkip(); + + // Reenable previously paused skipping. Any prefix of the input + // that matches the skip pattern is immediately dropped. + void EnableSkip(); + + /***** Special wrappers around SetSkip() for some common idioms *****/ + + // Arranges to skip whitespace, C comments, C++ comments. + // The overall RE is a disjunction of the following REs: + // \\s whitespace + // //.*\n C++ comment + // /[*](.|\n)*?[*]/ C comment (x*? means minimal repetitions of x) + // We get repetition via the semantics of SetSkipExpression, not by using * + void SkipCXXComments() { + SetSkipExpression("\\s|//.*\n|/[*](?:\n|.)*?[*]/"); + } + + void set_save_comments(bool comments) { + save_comments_ = comments; + } + + bool save_comments() { + return save_comments_; + } + + // Append to vector ranges the comments found in the + // byte range [start,end] (inclusive) of the input data. + // Only comments that were extracted entirely within that + // range are returned: no range splitting of atomically-extracted + // comments is performed. + void GetComments(int start, int end, std::vector *ranges); + + // Append to vector ranges the comments added + // since the last time this was called. This + // functionality is provided for efficiency when + // interleaving scanning with parsing. + void GetNextComments(std::vector *ranges); + + private: + std::string data_; // All the input data + StringPiece input_; // Unprocessed input + RE* skip_; // If non-NULL, RE for skipping input + bool should_skip_; // If true, use skip_ + bool skip_repeat_; // If true, repeat skip_ as long as it works + bool save_comments_; // If true, aggregate the skip expression + + // the skipped comments + // TODO: later consider requiring that the StringPieces be added + // in order by their start position + std::vector *comments_; + + // the offset into comments_ that has been returned by GetNextComments + int comments_offset_; + + // helper function to consume *skip_ and honour + // save_comments_ + void ConsumeSkip(); +}; + +} // namespace pcrecpp + +#endif /* _PCRE_SCANNER_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/include/pcre_stringpiece.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/include/pcre_stringpiece.h new file mode 100644 index 0000000000000000000000000000000000000000..b649ff78c55beacb96da6d172e6b039b1ed55a25 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/include/pcre_stringpiece.h @@ -0,0 +1,180 @@ +// Copyright (c) 2005, Google 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 Google 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. +// +// Author: Sanjay Ghemawat +// +// A string like object that points into another piece of memory. +// Useful for providing an interface that allows clients to easily +// pass in either a "const char*" or a "string". +// +// Arghh! I wish C++ literals were automatically of type "string". + +#ifndef _PCRE_STRINGPIECE_H +#define _PCRE_STRINGPIECE_H + +#include +#include +#include // for ostream forward-declaration + +#if 0 +#define HAVE_TYPE_TRAITS +#include +#elif 0 +#define HAVE_TYPE_TRAITS +#include +#endif + +#include + +namespace pcrecpp { + +using std::memcmp; +using std::strlen; +using std::string; + +class PCRECPP_EXP_DEFN StringPiece { + private: + const char* ptr_; + int length_; + + public: + // We provide non-explicit singleton constructors so users can pass + // in a "const char*" or a "string" wherever a "StringPiece" is + // expected. + StringPiece() + : ptr_(NULL), length_(0) { } + StringPiece(const char* str) + : ptr_(str), length_(static_cast(strlen(ptr_))) { } + StringPiece(const unsigned char* str) + : ptr_(reinterpret_cast(str)), + length_(static_cast(strlen(ptr_))) { } + StringPiece(const string& str) + : ptr_(str.data()), length_(static_cast(str.size())) { } + StringPiece(const char* offset, int len) + : ptr_(offset), length_(len) { } + + // data() may return a pointer to a buffer with embedded NULs, and the + // returned buffer may or may not be null terminated. Therefore it is + // typically a mistake to pass data() to a routine that expects a NUL + // terminated string. Use "as_string().c_str()" if you really need to do + // this. Or better yet, change your routine so it does not rely on NUL + // termination. + const char* data() const { return ptr_; } + int size() const { return length_; } + bool empty() const { return length_ == 0; } + + void clear() { ptr_ = NULL; length_ = 0; } + void set(const char* buffer, int len) { ptr_ = buffer; length_ = len; } + void set(const char* str) { + ptr_ = str; + length_ = static_cast(strlen(str)); + } + void set(const void* buffer, int len) { + ptr_ = reinterpret_cast(buffer); + length_ = len; + } + + char operator[](int i) const { return ptr_[i]; } + + void remove_prefix(int n) { + ptr_ += n; + length_ -= n; + } + + void remove_suffix(int n) { + length_ -= n; + } + + bool operator==(const StringPiece& x) const { + return ((length_ == x.length_) && + (memcmp(ptr_, x.ptr_, length_) == 0)); + } + bool operator!=(const StringPiece& x) const { + return !(*this == x); + } + +#define STRINGPIECE_BINARY_PREDICATE(cmp,auxcmp) \ + bool operator cmp (const StringPiece& x) const { \ + int r = memcmp(ptr_, x.ptr_, length_ < x.length_ ? length_ : x.length_); \ + return ((r auxcmp 0) || ((r == 0) && (length_ cmp x.length_))); \ + } + STRINGPIECE_BINARY_PREDICATE(<, <); + STRINGPIECE_BINARY_PREDICATE(<=, <); + STRINGPIECE_BINARY_PREDICATE(>=, >); + STRINGPIECE_BINARY_PREDICATE(>, >); +#undef STRINGPIECE_BINARY_PREDICATE + + int compare(const StringPiece& x) const { + int r = memcmp(ptr_, x.ptr_, length_ < x.length_ ? length_ : x.length_); + if (r == 0) { + if (length_ < x.length_) r = -1; + else if (length_ > x.length_) r = +1; + } + return r; + } + + string as_string() const { + return string(data(), size()); + } + + void CopyToString(string* target) const { + target->assign(ptr_, length_); + } + + // Does "this" start with "x" + bool starts_with(const StringPiece& x) const { + return ((length_ >= x.length_) && (memcmp(ptr_, x.ptr_, x.length_) == 0)); + } +}; + +} // namespace pcrecpp + +// ------------------------------------------------------------------ +// Functions used to create STL containers that use StringPiece +// Remember that a StringPiece's lifetime had better be less than +// that of the underlying string or char*. If it is not, then you +// cannot safely store a StringPiece into an STL container +// ------------------------------------------------------------------ + +#ifdef HAVE_TYPE_TRAITS +// This makes vector really fast for some STL implementations +template<> struct __type_traits { + typedef __true_type has_trivial_default_constructor; + typedef __true_type has_trivial_copy_constructor; + typedef __true_type has_trivial_assignment_operator; + typedef __true_type has_trivial_destructor; + typedef __true_type is_POD_type; +}; +#endif + +// allow StringPiece to be logged +PCRECPP_EXP_DECL std::ostream& operator<<(std::ostream& o, + const pcrecpp::StringPiece& piece); + +#endif /* _PCRE_STRINGPIECE_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/include/pcrecpp.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/include/pcrecpp.h new file mode 100644 index 0000000000000000000000000000000000000000..3e594b0d43934e88e0b4f3b505fe01bc73b08ba5 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/include/pcrecpp.h @@ -0,0 +1,710 @@ +// Copyright (c) 2005, Google 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 Google 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. +// +// Author: Sanjay Ghemawat +// Support for PCRE_XXX modifiers added by Giuseppe Maxia, July 2005 + +#ifndef _PCRECPP_H +#define _PCRECPP_H + +// C++ interface to the pcre regular-expression library. RE supports +// Perl-style regular expressions (with extensions like \d, \w, \s, +// ...). +// +// ----------------------------------------------------------------------- +// REGEXP SYNTAX: +// +// This module is part of the pcre library and hence supports its syntax +// for regular expressions. +// +// The syntax is pretty similar to Perl's. For those not familiar +// with Perl's regular expressions, here are some examples of the most +// commonly used extensions: +// +// "hello (\\w+) world" -- \w matches a "word" character +// "version (\\d+)" -- \d matches a digit +// "hello\\s+world" -- \s matches any whitespace character +// "\\b(\\w+)\\b" -- \b matches empty string at a word boundary +// "(?i)hello" -- (?i) turns on case-insensitive matching +// "/\\*(.*?)\\*/" -- .*? matches . minimum no. of times possible +// +// ----------------------------------------------------------------------- +// MATCHING INTERFACE: +// +// The "FullMatch" operation checks that supplied text matches a +// supplied pattern exactly. +// +// Example: successful match +// pcrecpp::RE re("h.*o"); +// re.FullMatch("hello"); +// +// Example: unsuccessful match (requires full match): +// pcrecpp::RE re("e"); +// !re.FullMatch("hello"); +// +// Example: creating a temporary RE object: +// pcrecpp::RE("h.*o").FullMatch("hello"); +// +// You can pass in a "const char*" or a "string" for "text". The +// examples below tend to use a const char*. +// +// You can, as in the different examples above, store the RE object +// explicitly in a variable or use a temporary RE object. The +// examples below use one mode or the other arbitrarily. Either +// could correctly be used for any of these examples. +// +// ----------------------------------------------------------------------- +// MATCHING WITH SUB-STRING EXTRACTION: +// +// You can supply extra pointer arguments to extract matched subpieces. +// +// Example: extracts "ruby" into "s" and 1234 into "i" +// int i; +// string s; +// pcrecpp::RE re("(\\w+):(\\d+)"); +// re.FullMatch("ruby:1234", &s, &i); +// +// Example: does not try to extract any extra sub-patterns +// re.FullMatch("ruby:1234", &s); +// +// Example: does not try to extract into NULL +// re.FullMatch("ruby:1234", NULL, &i); +// +// Example: integer overflow causes failure +// !re.FullMatch("ruby:1234567891234", NULL, &i); +// +// Example: fails because there aren't enough sub-patterns: +// !pcrecpp::RE("\\w+:\\d+").FullMatch("ruby:1234", &s); +// +// Example: fails because string cannot be stored in integer +// !pcrecpp::RE("(.*)").FullMatch("ruby", &i); +// +// The provided pointer arguments can be pointers to any scalar numeric +// type, or one of +// string (matched piece is copied to string) +// StringPiece (StringPiece is mutated to point to matched piece) +// T (where "bool T::ParseFrom(const char*, int)" exists) +// NULL (the corresponding matched sub-pattern is not copied) +// +// CAVEAT: An optional sub-pattern that does not exist in the matched +// string is assigned the empty string. Therefore, the following will +// return false (because the empty string is not a valid number): +// int number; +// pcrecpp::RE::FullMatch("abc", "[a-z]+(\\d+)?", &number); +// +// ----------------------------------------------------------------------- +// DO_MATCH +// +// The matching interface supports at most 16 arguments per call. +// If you need more, consider using the more general interface +// pcrecpp::RE::DoMatch(). See pcrecpp.h for the signature for DoMatch. +// +// ----------------------------------------------------------------------- +// PARTIAL MATCHES +// +// You can use the "PartialMatch" operation when you want the pattern +// to match any substring of the text. +// +// Example: simple search for a string: +// pcrecpp::RE("ell").PartialMatch("hello"); +// +// Example: find first number in a string: +// int number; +// pcrecpp::RE re("(\\d+)"); +// re.PartialMatch("x*100 + 20", &number); +// assert(number == 100); +// +// ----------------------------------------------------------------------- +// UTF-8 AND THE MATCHING INTERFACE: +// +// By default, pattern and text are plain text, one byte per character. +// The UTF8 flag, passed to the constructor, causes both pattern +// and string to be treated as UTF-8 text, still a byte stream but +// potentially multiple bytes per character. In practice, the text +// is likelier to be UTF-8 than the pattern, but the match returned +// may depend on the UTF8 flag, so always use it when matching +// UTF8 text. E.g., "." will match one byte normally but with UTF8 +// set may match up to three bytes of a multi-byte character. +// +// Example: +// pcrecpp::RE_Options options; +// options.set_utf8(); +// pcrecpp::RE re(utf8_pattern, options); +// re.FullMatch(utf8_string); +// +// Example: using the convenience function UTF8(): +// pcrecpp::RE re(utf8_pattern, pcrecpp::UTF8()); +// re.FullMatch(utf8_string); +// +// NOTE: The UTF8 option is ignored if pcre was not configured with the +// --enable-utf8 flag. +// +// ----------------------------------------------------------------------- +// PASSING MODIFIERS TO THE REGULAR EXPRESSION ENGINE +// +// PCRE defines some modifiers to change the behavior of the regular +// expression engine. +// The C++ wrapper defines an auxiliary class, RE_Options, as a vehicle +// to pass such modifiers to a RE class. +// +// Currently, the following modifiers are supported +// +// modifier description Perl corresponding +// +// PCRE_CASELESS case insensitive match /i +// PCRE_MULTILINE multiple lines match /m +// PCRE_DOTALL dot matches newlines /s +// PCRE_DOLLAR_ENDONLY $ matches only at end N/A +// PCRE_EXTRA strict escape parsing N/A +// PCRE_EXTENDED ignore whitespaces /x +// PCRE_UTF8 handles UTF8 chars built-in +// PCRE_UNGREEDY reverses * and *? N/A +// PCRE_NO_AUTO_CAPTURE disables matching parens N/A (*) +// +// (For a full account on how each modifier works, please check the +// PCRE API reference manual). +// +// (*) Both Perl and PCRE allow non matching parentheses by means of the +// "?:" modifier within the pattern itself. e.g. (?:ab|cd) does not +// capture, while (ab|cd) does. +// +// For each modifier, there are two member functions whose name is made +// out of the modifier in lowercase, without the "PCRE_" prefix. For +// instance, PCRE_CASELESS is handled by +// bool caseless(), +// which returns true if the modifier is set, and +// RE_Options & set_caseless(bool), +// which sets or unsets the modifier. +// +// Moreover, PCRE_EXTRA_MATCH_LIMIT can be accessed through the +// set_match_limit() and match_limit() member functions. +// Setting match_limit to a non-zero value will limit the executation of +// pcre to keep it from doing bad things like blowing the stack or taking +// an eternity to return a result. A value of 5000 is good enough to stop +// stack blowup in a 2MB thread stack. Setting match_limit to zero will +// disable match limiting. Alternately, you can set match_limit_recursion() +// which uses PCRE_EXTRA_MATCH_LIMIT_RECURSION to limit how much pcre +// recurses. match_limit() caps the number of matches pcre does; +// match_limit_recrusion() caps the depth of recursion. +// +// Normally, to pass one or more modifiers to a RE class, you declare +// a RE_Options object, set the appropriate options, and pass this +// object to a RE constructor. Example: +// +// RE_options opt; +// opt.set_caseless(true); +// +// if (RE("HELLO", opt).PartialMatch("hello world")) ... +// +// RE_options has two constructors. The default constructor takes no +// arguments and creates a set of flags that are off by default. +// +// The optional parameter 'option_flags' is to facilitate transfer +// of legacy code from C programs. This lets you do +// RE(pattern, RE_Options(PCRE_CASELESS|PCRE_MULTILINE)).PartialMatch(str); +// +// But new code is better off doing +// RE(pattern, +// RE_Options().set_caseless(true).set_multiline(true)).PartialMatch(str); +// (See below) +// +// If you are going to pass one of the most used modifiers, there are some +// convenience functions that return a RE_Options class with the +// appropriate modifier already set: +// CASELESS(), UTF8(), MULTILINE(), DOTALL(), EXTENDED() +// +// If you need to set several options at once, and you don't want to go +// through the pains of declaring a RE_Options object and setting several +// options, there is a parallel method that give you such ability on the +// fly. You can concatenate several set_xxxxx member functions, since each +// of them returns a reference to its class object. e.g.: to pass +// PCRE_CASELESS, PCRE_EXTENDED, and PCRE_MULTILINE to a RE with one +// statement, you may write +// +// RE(" ^ xyz \\s+ .* blah$", RE_Options() +// .set_caseless(true) +// .set_extended(true) +// .set_multiline(true)).PartialMatch(sometext); +// +// ----------------------------------------------------------------------- +// SCANNING TEXT INCREMENTALLY +// +// The "Consume" operation may be useful if you want to repeatedly +// match regular expressions at the front of a string and skip over +// them as they match. This requires use of the "StringPiece" type, +// which represents a sub-range of a real string. Like RE, StringPiece +// is defined in the pcrecpp namespace. +// +// Example: read lines of the form "var = value" from a string. +// string contents = ...; // Fill string somehow +// pcrecpp::StringPiece input(contents); // Wrap in a StringPiece +// +// string var; +// int value; +// pcrecpp::RE re("(\\w+) = (\\d+)\n"); +// while (re.Consume(&input, &var, &value)) { +// ...; +// } +// +// Each successful call to "Consume" will set "var/value", and also +// advance "input" so it points past the matched text. +// +// The "FindAndConsume" operation is similar to "Consume" but does not +// anchor your match at the beginning of the string. For example, you +// could extract all words from a string by repeatedly calling +// pcrecpp::RE("(\\w+)").FindAndConsume(&input, &word) +// +// ----------------------------------------------------------------------- +// PARSING HEX/OCTAL/C-RADIX NUMBERS +// +// By default, if you pass a pointer to a numeric value, the +// corresponding text is interpreted as a base-10 number. You can +// instead wrap the pointer with a call to one of the operators Hex(), +// Octal(), or CRadix() to interpret the text in another base. The +// CRadix operator interprets C-style "0" (base-8) and "0x" (base-16) +// prefixes, but defaults to base-10. +// +// Example: +// int a, b, c, d; +// pcrecpp::RE re("(.*) (.*) (.*) (.*)"); +// re.FullMatch("100 40 0100 0x40", +// pcrecpp::Octal(&a), pcrecpp::Hex(&b), +// pcrecpp::CRadix(&c), pcrecpp::CRadix(&d)); +// will leave 64 in a, b, c, and d. +// +// ----------------------------------------------------------------------- +// REPLACING PARTS OF STRINGS +// +// You can replace the first match of "pattern" in "str" with +// "rewrite". Within "rewrite", backslash-escaped digits (\1 to \9) +// can be used to insert text matching corresponding parenthesized +// group from the pattern. \0 in "rewrite" refers to the entire +// matching text. E.g., +// +// string s = "yabba dabba doo"; +// pcrecpp::RE("b+").Replace("d", &s); +// +// will leave "s" containing "yada dabba doo". The result is true if +// the pattern matches and a replacement occurs, or false otherwise. +// +// GlobalReplace() is like Replace(), except that it replaces all +// occurrences of the pattern in the string with the rewrite. +// Replacements are not subject to re-matching. E.g., +// +// string s = "yabba dabba doo"; +// pcrecpp::RE("b+").GlobalReplace("d", &s); +// +// will leave "s" containing "yada dada doo". It returns the number +// of replacements made. +// +// Extract() is like Replace(), except that if the pattern matches, +// "rewrite" is copied into "out" (an additional argument) with +// substitutions. The non-matching portions of "text" are ignored. +// Returns true iff a match occurred and the extraction happened +// successfully. If no match occurs, the string is left unaffected. + + +#include +#include +#include // defines the Arg class +// This isn't technically needed here, but we include it +// anyway so folks who include pcrecpp.h don't have to. +#include + +namespace pcrecpp { + +#define PCRE_SET_OR_CLEAR(b, o) \ + if (b) all_options_ |= (o); else all_options_ &= ~(o); \ + return *this + +#define PCRE_IS_SET(o) \ + (all_options_ & o) == o + +/***** Compiling regular expressions: the RE class *****/ + +// RE_Options allow you to set options to be passed along to pcre, +// along with other options we put on top of pcre. +// Only 9 modifiers, plus match_limit and match_limit_recursion, +// are supported now. +class PCRECPP_EXP_DEFN RE_Options { + public: + // constructor + RE_Options() : match_limit_(0), match_limit_recursion_(0), all_options_(0) {} + + // alternative constructor. + // To facilitate transfer of legacy code from C programs + // + // This lets you do + // RE(pattern, RE_Options(PCRE_CASELESS|PCRE_MULTILINE)).PartialMatch(str); + // But new code is better off doing + // RE(pattern, + // RE_Options().set_caseless(true).set_multiline(true)).PartialMatch(str); + RE_Options(int option_flags) : match_limit_(0), match_limit_recursion_(0), + all_options_(option_flags) {} + // we're fine with the default destructor, copy constructor, etc. + + // accessors and mutators + int match_limit() const { return match_limit_; }; + RE_Options &set_match_limit(int limit) { + match_limit_ = limit; + return *this; + } + + int match_limit_recursion() const { return match_limit_recursion_; }; + RE_Options &set_match_limit_recursion(int limit) { + match_limit_recursion_ = limit; + return *this; + } + + bool caseless() const { + return PCRE_IS_SET(PCRE_CASELESS); + } + RE_Options &set_caseless(bool x) { + PCRE_SET_OR_CLEAR(x, PCRE_CASELESS); + } + + bool multiline() const { + return PCRE_IS_SET(PCRE_MULTILINE); + } + RE_Options &set_multiline(bool x) { + PCRE_SET_OR_CLEAR(x, PCRE_MULTILINE); + } + + bool dotall() const { + return PCRE_IS_SET(PCRE_DOTALL); + } + RE_Options &set_dotall(bool x) { + PCRE_SET_OR_CLEAR(x, PCRE_DOTALL); + } + + bool extended() const { + return PCRE_IS_SET(PCRE_EXTENDED); + } + RE_Options &set_extended(bool x) { + PCRE_SET_OR_CLEAR(x, PCRE_EXTENDED); + } + + bool dollar_endonly() const { + return PCRE_IS_SET(PCRE_DOLLAR_ENDONLY); + } + RE_Options &set_dollar_endonly(bool x) { + PCRE_SET_OR_CLEAR(x, PCRE_DOLLAR_ENDONLY); + } + + bool extra() const { + return PCRE_IS_SET(PCRE_EXTRA); + } + RE_Options &set_extra(bool x) { + PCRE_SET_OR_CLEAR(x, PCRE_EXTRA); + } + + bool ungreedy() const { + return PCRE_IS_SET(PCRE_UNGREEDY); + } + RE_Options &set_ungreedy(bool x) { + PCRE_SET_OR_CLEAR(x, PCRE_UNGREEDY); + } + + bool utf8() const { + return PCRE_IS_SET(PCRE_UTF8); + } + RE_Options &set_utf8(bool x) { + PCRE_SET_OR_CLEAR(x, PCRE_UTF8); + } + + bool no_auto_capture() const { + return PCRE_IS_SET(PCRE_NO_AUTO_CAPTURE); + } + RE_Options &set_no_auto_capture(bool x) { + PCRE_SET_OR_CLEAR(x, PCRE_NO_AUTO_CAPTURE); + } + + RE_Options &set_all_options(int opt) { + all_options_ = opt; + return *this; + } + int all_options() const { + return all_options_ ; + } + + // TODO: add other pcre flags + + private: + int match_limit_; + int match_limit_recursion_; + int all_options_; +}; + +// These functions return some common RE_Options +static inline RE_Options UTF8() { + return RE_Options().set_utf8(true); +} + +static inline RE_Options CASELESS() { + return RE_Options().set_caseless(true); +} +static inline RE_Options MULTILINE() { + return RE_Options().set_multiline(true); +} + +static inline RE_Options DOTALL() { + return RE_Options().set_dotall(true); +} + +static inline RE_Options EXTENDED() { + return RE_Options().set_extended(true); +} + +// Interface for regular expression matching. Also corresponds to a +// pre-compiled regular expression. An "RE" object is safe for +// concurrent use by multiple threads. +class PCRECPP_EXP_DEFN RE { + public: + // We provide implicit conversions from strings so that users can + // pass in a string or a "const char*" wherever an "RE" is expected. + RE(const string& pat) { Init(pat, NULL); } + RE(const string& pat, const RE_Options& option) { Init(pat, &option); } + RE(const char* pat) { Init(pat, NULL); } + RE(const char* pat, const RE_Options& option) { Init(pat, &option); } + RE(const unsigned char* pat) { + Init(reinterpret_cast(pat), NULL); + } + RE(const unsigned char* pat, const RE_Options& option) { + Init(reinterpret_cast(pat), &option); + } + + // Copy constructor & assignment - note that these are expensive + // because they recompile the expression. + RE(const RE& re) { Init(re.pattern_, &re.options_); } + const RE& operator=(const RE& re) { + if (this != &re) { + Cleanup(); + + // This is the code that originally came from Google + // Init(re.pattern_.c_str(), &re.options_); + + // This is the replacement from Ari Pollak + Init(re.pattern_, &re.options_); + } + return *this; + } + + + ~RE(); + + // The string specification for this RE. E.g. + // RE re("ab*c?d+"); + // re.pattern(); // "ab*c?d+" + const string& pattern() const { return pattern_; } + + // If RE could not be created properly, returns an error string. + // Else returns the empty string. + const string& error() const { return *error_; } + + /***** The useful part: the matching interface *****/ + + // This is provided so one can do pattern.ReplaceAll() just as + // easily as ReplaceAll(pattern-text, ....) + + bool FullMatch(const StringPiece& text, + const Arg& ptr1 = no_arg, + const Arg& ptr2 = no_arg, + const Arg& ptr3 = no_arg, + const Arg& ptr4 = no_arg, + const Arg& ptr5 = no_arg, + const Arg& ptr6 = no_arg, + const Arg& ptr7 = no_arg, + const Arg& ptr8 = no_arg, + const Arg& ptr9 = no_arg, + const Arg& ptr10 = no_arg, + const Arg& ptr11 = no_arg, + const Arg& ptr12 = no_arg, + const Arg& ptr13 = no_arg, + const Arg& ptr14 = no_arg, + const Arg& ptr15 = no_arg, + const Arg& ptr16 = no_arg) const; + + bool PartialMatch(const StringPiece& text, + const Arg& ptr1 = no_arg, + const Arg& ptr2 = no_arg, + const Arg& ptr3 = no_arg, + const Arg& ptr4 = no_arg, + const Arg& ptr5 = no_arg, + const Arg& ptr6 = no_arg, + const Arg& ptr7 = no_arg, + const Arg& ptr8 = no_arg, + const Arg& ptr9 = no_arg, + const Arg& ptr10 = no_arg, + const Arg& ptr11 = no_arg, + const Arg& ptr12 = no_arg, + const Arg& ptr13 = no_arg, + const Arg& ptr14 = no_arg, + const Arg& ptr15 = no_arg, + const Arg& ptr16 = no_arg) const; + + bool Consume(StringPiece* input, + const Arg& ptr1 = no_arg, + const Arg& ptr2 = no_arg, + const Arg& ptr3 = no_arg, + const Arg& ptr4 = no_arg, + const Arg& ptr5 = no_arg, + const Arg& ptr6 = no_arg, + const Arg& ptr7 = no_arg, + const Arg& ptr8 = no_arg, + const Arg& ptr9 = no_arg, + const Arg& ptr10 = no_arg, + const Arg& ptr11 = no_arg, + const Arg& ptr12 = no_arg, + const Arg& ptr13 = no_arg, + const Arg& ptr14 = no_arg, + const Arg& ptr15 = no_arg, + const Arg& ptr16 = no_arg) const; + + bool FindAndConsume(StringPiece* input, + const Arg& ptr1 = no_arg, + const Arg& ptr2 = no_arg, + const Arg& ptr3 = no_arg, + const Arg& ptr4 = no_arg, + const Arg& ptr5 = no_arg, + const Arg& ptr6 = no_arg, + const Arg& ptr7 = no_arg, + const Arg& ptr8 = no_arg, + const Arg& ptr9 = no_arg, + const Arg& ptr10 = no_arg, + const Arg& ptr11 = no_arg, + const Arg& ptr12 = no_arg, + const Arg& ptr13 = no_arg, + const Arg& ptr14 = no_arg, + const Arg& ptr15 = no_arg, + const Arg& ptr16 = no_arg) const; + + bool Replace(const StringPiece& rewrite, + string *str) const; + + int GlobalReplace(const StringPiece& rewrite, + string *str) const; + + bool Extract(const StringPiece &rewrite, + const StringPiece &text, + string *out) const; + + // Escapes all potentially meaningful regexp characters in + // 'unquoted'. The returned string, used as a regular expression, + // will exactly match the original string. For example, + // 1.5-2.0? + // may become: + // 1\.5\-2\.0\? + // Note QuoteMeta behaves the same as perl's QuoteMeta function, + // *except* that it escapes the NUL character (\0) as backslash + 0, + // rather than backslash + NUL. + static string QuoteMeta(const StringPiece& unquoted); + + + /***** Generic matching interface *****/ + + // Type of match (TODO: Should be restructured as part of RE_Options) + enum Anchor { + UNANCHORED, // No anchoring + ANCHOR_START, // Anchor at start only + ANCHOR_BOTH // Anchor at start and end + }; + + // General matching routine. Stores the length of the match in + // "*consumed" if successful. + bool DoMatch(const StringPiece& text, + Anchor anchor, + int* consumed, + const Arg* const* args, int n) const; + + // Return the number of capturing subpatterns, or -1 if the + // regexp wasn't valid on construction. + int NumberOfCapturingGroups() const; + + // The default value for an argument, to indicate the end of the argument + // list. This must be used only in optional argument defaults. It should NOT + // be passed explicitly. Some people have tried to use it like this: + // + // FullMatch(x, y, &z, no_arg, &w); + // + // This is a mistake, and will not work. + static Arg no_arg; + + private: + + void Init(const string& pattern, const RE_Options* options); + void Cleanup(); + + // Match against "text", filling in "vec" (up to "vecsize" * 2/3) with + // pairs of integers for the beginning and end positions of matched + // text. The first pair corresponds to the entire matched text; + // subsequent pairs correspond, in order, to parentheses-captured + // matches. Returns the number of pairs (one more than the number of + // the last subpattern with a match) if matching was successful + // and zero if the match failed. + // I.e. for RE("(foo)|(bar)|(baz)") it will return 2, 3, and 4 when matching + // against "foo", "bar", and "baz" respectively. + // When matching RE("(foo)|hello") against "hello", it will return 1. + // But the values for all subpattern are filled in into "vec". + int TryMatch(const StringPiece& text, + int startpos, + Anchor anchor, + bool empty_ok, + int *vec, + int vecsize) const; + + // Append the "rewrite" string, with backslash subsitutions from "text" + // and "vec", to string "out". + bool Rewrite(string *out, + const StringPiece& rewrite, + const StringPiece& text, + int *vec, + int veclen) const; + + // internal implementation for DoMatch + bool DoMatchImpl(const StringPiece& text, + Anchor anchor, + int* consumed, + const Arg* const args[], + int n, + int* vec, + int vecsize) const; + + // Compile the regexp for the specified anchoring mode + pcre* Compile(Anchor anchor); + + string pattern_; + RE_Options options_; + pcre* re_full_; // For full matches + pcre* re_partial_; // For partial matches + const string* error_; // Error indicator (or points to empty string) +}; + +} // namespace pcrecpp + +#endif /* _PCRECPP_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/include/pcrecpparg.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/include/pcrecpparg.h new file mode 100644 index 0000000000000000000000000000000000000000..dc1f7006ae16fee03fa775bc29d119b5b490f3f8 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/include/pcrecpparg.h @@ -0,0 +1,174 @@ +// Copyright (c) 2005, Google 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 Google 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. +// +// Author: Sanjay Ghemawat + +#ifndef _PCRECPPARG_H +#define _PCRECPPARG_H + +#include // for NULL +#include + +#include + +namespace pcrecpp { + +class StringPiece; + +// Hex/Octal/Binary? + +// Special class for parsing into objects that define a ParseFrom() method +template +class _RE_MatchObject { + public: + static inline bool Parse(const char* str, int n, void* dest) { + if (dest == NULL) return true; + T* object = reinterpret_cast(dest); + return object->ParseFrom(str, n); + } +}; + +class PCRECPP_EXP_DEFN Arg { + public: + // Empty constructor so we can declare arrays of Arg + Arg(); + + // Constructor specially designed for NULL arguments + Arg(void*); + + typedef bool (*Parser)(const char* str, int n, void* dest); + +// Type-specific parsers +#define PCRE_MAKE_PARSER(type,name) \ + Arg(type* p) : arg_(p), parser_(name) { } \ + Arg(type* p, Parser parser) : arg_(p), parser_(parser) { } + + + PCRE_MAKE_PARSER(char, parse_char); + PCRE_MAKE_PARSER(unsigned char, parse_uchar); + PCRE_MAKE_PARSER(short, parse_short); + PCRE_MAKE_PARSER(unsigned short, parse_ushort); + PCRE_MAKE_PARSER(int, parse_int); + PCRE_MAKE_PARSER(unsigned int, parse_uint); + PCRE_MAKE_PARSER(long, parse_long); + PCRE_MAKE_PARSER(unsigned long, parse_ulong); +#if 1 + PCRE_MAKE_PARSER(long long, parse_longlong); +#endif +#if 1 + PCRE_MAKE_PARSER(unsigned long long, parse_ulonglong); +#endif + PCRE_MAKE_PARSER(float, parse_float); + PCRE_MAKE_PARSER(double, parse_double); + PCRE_MAKE_PARSER(std::string, parse_string); + PCRE_MAKE_PARSER(StringPiece, parse_stringpiece); + +#undef PCRE_MAKE_PARSER + + // Generic constructor + template Arg(T*, Parser parser); + // Generic constructor template + template Arg(T* p) + : arg_(p), parser_(_RE_MatchObject::Parse) { + } + + // Parse the data + bool Parse(const char* str, int n) const; + + private: + void* arg_; + Parser parser_; + + static bool parse_null (const char* str, int n, void* dest); + static bool parse_char (const char* str, int n, void* dest); + static bool parse_uchar (const char* str, int n, void* dest); + static bool parse_float (const char* str, int n, void* dest); + static bool parse_double (const char* str, int n, void* dest); + static bool parse_string (const char* str, int n, void* dest); + static bool parse_stringpiece (const char* str, int n, void* dest); + +#define PCRE_DECLARE_INTEGER_PARSER(name) \ + private: \ + static bool parse_ ## name(const char* str, int n, void* dest); \ + static bool parse_ ## name ## _radix( \ + const char* str, int n, void* dest, int radix); \ + public: \ + static bool parse_ ## name ## _hex(const char* str, int n, void* dest); \ + static bool parse_ ## name ## _octal(const char* str, int n, void* dest); \ + static bool parse_ ## name ## _cradix(const char* str, int n, void* dest) + + PCRE_DECLARE_INTEGER_PARSER(short); + PCRE_DECLARE_INTEGER_PARSER(ushort); + PCRE_DECLARE_INTEGER_PARSER(int); + PCRE_DECLARE_INTEGER_PARSER(uint); + PCRE_DECLARE_INTEGER_PARSER(long); + PCRE_DECLARE_INTEGER_PARSER(ulong); + PCRE_DECLARE_INTEGER_PARSER(longlong); + PCRE_DECLARE_INTEGER_PARSER(ulonglong); + +#undef PCRE_DECLARE_INTEGER_PARSER +}; + +inline Arg::Arg() : arg_(NULL), parser_(parse_null) { } +inline Arg::Arg(void* p) : arg_(p), parser_(parse_null) { } + +inline bool Arg::Parse(const char* str, int n) const { + return (*parser_)(str, n, arg_); +} + +// This part of the parser, appropriate only for ints, deals with bases +#define MAKE_INTEGER_PARSER(type, name) \ + inline Arg Hex(type* ptr) { \ + return Arg(ptr, Arg::parse_ ## name ## _hex); } \ + inline Arg Octal(type* ptr) { \ + return Arg(ptr, Arg::parse_ ## name ## _octal); } \ + inline Arg CRadix(type* ptr) { \ + return Arg(ptr, Arg::parse_ ## name ## _cradix); } + +MAKE_INTEGER_PARSER(short, short) /* */ +MAKE_INTEGER_PARSER(unsigned short, ushort) /* */ +MAKE_INTEGER_PARSER(int, int) /* Don't use semicolons */ +MAKE_INTEGER_PARSER(unsigned int, uint) /* after these statement */ +MAKE_INTEGER_PARSER(long, long) /* because they can cause */ +MAKE_INTEGER_PARSER(unsigned long, ulong) /* compiler warnings if */ +#if 1 /* the checking level is */ +MAKE_INTEGER_PARSER(long long, longlong) /* turned up high enough. */ +#endif /* */ +#if 1 /* */ +MAKE_INTEGER_PARSER(unsigned long long, ulonglong) /* */ +#endif + +#undef PCRE_IS_SET +#undef PCRE_SET_OR_CLEAR +#undef MAKE_INTEGER_PARSER + +} // namespace pcrecpp + + +#endif /* _PCRECPPARG_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/include/pcreposix.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/include/pcreposix.h new file mode 100644 index 0000000000000000000000000000000000000000..c77c0b0523c4ea94d3ea5b6f26fa12423ea07a43 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/include/pcreposix.h @@ -0,0 +1,146 @@ +/************************************************* +* Perl-Compatible Regular Expressions * +*************************************************/ + +#ifndef _PCREPOSIX_H +#define _PCREPOSIX_H + +/* This is the header for the POSIX wrapper interface to the PCRE Perl- +Compatible Regular Expression library. It defines the things POSIX says should +be there. I hope. + + Copyright (c) 1997-2012 University of Cambridge + +----------------------------------------------------------------------------- +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 University of Cambridge 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. +----------------------------------------------------------------------------- +*/ + +/* Have to include stdlib.h in order to ensure that size_t is defined. */ + +#include + +/* Allow for C++ users */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Options, mostly defined by POSIX, but with some extras. */ + +#define REG_ICASE 0x0001 /* Maps to PCRE_CASELESS */ +#define REG_NEWLINE 0x0002 /* Maps to PCRE_MULTILINE */ +#define REG_NOTBOL 0x0004 /* Maps to PCRE_NOTBOL */ +#define REG_NOTEOL 0x0008 /* Maps to PCRE_NOTEOL */ +#define REG_DOTALL 0x0010 /* NOT defined by POSIX; maps to PCRE_DOTALL */ +#define REG_NOSUB 0x0020 /* Maps to PCRE_NO_AUTO_CAPTURE */ +#define REG_UTF8 0x0040 /* NOT defined by POSIX; maps to PCRE_UTF8 */ +#define REG_STARTEND 0x0080 /* BSD feature: pass subject string by so,eo */ +#define REG_NOTEMPTY 0x0100 /* NOT defined by POSIX; maps to PCRE_NOTEMPTY */ +#define REG_UNGREEDY 0x0200 /* NOT defined by POSIX; maps to PCRE_UNGREEDY */ +#define REG_UCP 0x0400 /* NOT defined by POSIX; maps to PCRE_UCP */ + +/* This is not used by PCRE, but by defining it we make it easier +to slot PCRE into existing programs that make POSIX calls. */ + +#define REG_EXTENDED 0 + +/* Error values. Not all these are relevant or used by the wrapper. */ + +enum { + REG_ASSERT = 1, /* internal error ? */ + REG_BADBR, /* invalid repeat counts in {} */ + REG_BADPAT, /* pattern error */ + REG_BADRPT, /* ? * + invalid */ + REG_EBRACE, /* unbalanced {} */ + REG_EBRACK, /* unbalanced [] */ + REG_ECOLLATE, /* collation error - not relevant */ + REG_ECTYPE, /* bad class */ + REG_EESCAPE, /* bad escape sequence */ + REG_EMPTY, /* empty expression */ + REG_EPAREN, /* unbalanced () */ + REG_ERANGE, /* bad range inside [] */ + REG_ESIZE, /* expression too big */ + REG_ESPACE, /* failed to get memory */ + REG_ESUBREG, /* bad back reference */ + REG_INVARG, /* bad argument */ + REG_NOMATCH /* match failed */ +}; + + +/* The structure representing a compiled regular expression. */ + +typedef struct { + void *re_pcre; + size_t re_nsub; + size_t re_erroffset; +} regex_t; + +/* The structure in which a captured offset is returned. */ + +typedef int regoff_t; + +typedef struct { + regoff_t rm_so; + regoff_t rm_eo; +} regmatch_t; + +/* When an application links to a PCRE DLL in Windows, the symbols that are +imported have to be identified as such. When building PCRE, the appropriate +export settings are needed, and are set in pcreposix.c before including this +file. */ + +#if defined(_WIN32) && !defined(PCRE_STATIC) && !defined(PCREPOSIX_EXP_DECL) +# define PCREPOSIX_EXP_DECL extern __declspec(dllimport) +# define PCREPOSIX_EXP_DEFN __declspec(dllimport) +#endif + +/* By default, we use the standard "extern" declarations. */ + +#ifndef PCREPOSIX_EXP_DECL +# ifdef __cplusplus +# define PCREPOSIX_EXP_DECL extern "C" +# define PCREPOSIX_EXP_DEFN extern "C" +# else +# define PCREPOSIX_EXP_DECL extern +# define PCREPOSIX_EXP_DEFN extern +# endif +#endif + +/* The functions */ + +PCREPOSIX_EXP_DECL int regcomp(regex_t *, const char *, int); +PCREPOSIX_EXP_DECL int regexec(const regex_t *, const char *, size_t, + regmatch_t *, int); +PCREPOSIX_EXP_DECL size_t regerror(int, const regex_t *, char *, size_t); +PCREPOSIX_EXP_DECL void regfree(regex_t *); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* End of pcreposix.h */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/lib/pcre.lib b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/lib/pcre.lib new file mode 100644 index 0000000000000000000000000000000000000000..f3c15b783d095fd2ce796577e6e49306d5b730bf Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/lib/pcre.lib differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/lib/pcrecpp.lib b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/lib/pcrecpp.lib new file mode 100644 index 0000000000000000000000000000000000000000..4b9049ace1f9b71eab5cd0441db27f37ebcfa91d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/lib/pcrecpp.lib differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/lib/pcreposix.lib b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/lib/pcreposix.lib new file mode 100644 index 0000000000000000000000000000000000000000..36d6442c2487db1c78afe9faf00d35ee44f26d6b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/lib/pcreposix.lib differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/lib/pkgconfig/libpcre.pc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/lib/pkgconfig/libpcre.pc new file mode 100644 index 0000000000000000000000000000000000000000..091f070b0b6b25d10ab843692e90d9012ea39efe --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/lib/pkgconfig/libpcre.pc @@ -0,0 +1,13 @@ +# Package Information for pkg-config + +prefix=D:/bld/pcre_1623788775763/_h_env/Library +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: libpcre +Description: PCRE - Perl compatible regular expressions C library with 8 bit character support +Version: 8.45 +Libs: -L${libdir} -lpcre +Libs.private: +Cflags: -I${includedir} diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/lib/pkgconfig/libpcrecpp.pc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/lib/pkgconfig/libpcrecpp.pc new file mode 100644 index 0000000000000000000000000000000000000000..ca72929672ec834f740014c4f7375011792e476d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/lib/pkgconfig/libpcrecpp.pc @@ -0,0 +1,12 @@ +# Package Information for pkg-config + +prefix=D:/bld/pcre_1623788775763/_h_env/Library +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: libpcrecpp +Description: PCRECPP - C++ wrapper for PCRE +Version: 8.45 +Libs: -L${libdir} -lpcre -lpcrecpp +Cflags: -I${includedir} diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/lib/pkgconfig/libpcreposix.pc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/lib/pkgconfig/libpcreposix.pc new file mode 100644 index 0000000000000000000000000000000000000000..d3678da79dd991282f0b5e0fc1a39e58f7fe3f44 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/lib/pkgconfig/libpcreposix.pc @@ -0,0 +1,13 @@ +# Package Information for pkg-config + +prefix=D:/bld/pcre_1623788775763/_h_env/Library +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: libpcreposix +Description: PCREPosix - Posix compatible interface to libpcre +Version: 8.45 +Libs: -L${libdir} -lpcreposix +Cflags: -I${includedir} +Requires.private: libpcre diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man1/pcre-config.1 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man1/pcre-config.1 new file mode 100644 index 0000000000000000000000000000000000000000..52eb4fb22647405375967a082cd467678ca44c48 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man1/pcre-config.1 @@ -0,0 +1,92 @@ +.TH PCRE-CONFIG 1 "01 January 2012" "PCRE 8.30" +.SH NAME +pcre-config - program to return PCRE configuration +.SH SYNOPSIS +.rs +.sp +.nf +.B pcre-config [--prefix] [--exec-prefix] [--version] [--libs] +.B " [--libs16] [--libs32] [--libs-cpp] [--libs-posix]" +.B " [--cflags] [--cflags-posix]" +.fi +. +. +.SH DESCRIPTION +.rs +.sp +\fBpcre-config\fP returns the configuration of the installed PCRE +libraries and the options required to compile a program to use them. Some of +the options apply only to the 8-bit, or 16-bit, or 32-bit libraries, +respectively, and are +not available if only one of those libraries has been built. If an unavailable +option is encountered, the "usage" information is output. +. +. +.SH OPTIONS +.rs +.TP 10 +\fB--prefix\fP +Writes the directory prefix used in the PCRE installation for architecture +independent files (\fI/usr\fP on many systems, \fI/usr/local\fP on some +systems) to the standard output. +.TP 10 +\fB--exec-prefix\fP +Writes the directory prefix used in the PCRE installation for architecture +dependent files (normally the same as \fB--prefix\fP) to the standard output. +.TP 10 +\fB--version\fP +Writes the version number of the installed PCRE libraries to the standard +output. +.TP 10 +\fB--libs\fP +Writes to the standard output the command line options required to link +with the 8-bit PCRE library (\fB-lpcre\fP on many systems). +.TP 10 +\fB--libs16\fP +Writes to the standard output the command line options required to link +with the 16-bit PCRE library (\fB-lpcre16\fP on many systems). +.TP 10 +\fB--libs32\fP +Writes to the standard output the command line options required to link +with the 32-bit PCRE library (\fB-lpcre32\fP on many systems). +.TP 10 +\fB--libs-cpp\fP +Writes to the standard output the command line options required to link with +PCRE's C++ wrapper library (\fB-lpcrecpp\fP \fB-lpcre\fP on many +systems). +.TP 10 +\fB--libs-posix\fP +Writes to the standard output the command line options required to link with +PCRE's POSIX API wrapper library (\fB-lpcreposix\fP \fB-lpcre\fP on many +systems). +.TP 10 +\fB--cflags\fP +Writes to the standard output the command line options required to compile +files that use PCRE (this may include some \fB-I\fP options, but is blank on +many systems). +.TP 10 +\fB--cflags-posix\fP +Writes to the standard output the command line options required to compile +files that use PCRE's POSIX API wrapper library (this may include some \fB-I\fP +options, but is blank on many systems). +. +. +.SH "SEE ALSO" +.rs +.sp +\fBpcre(3)\fP +. +. +.SH AUTHOR +.rs +.sp +This manual page was originally written by Mark Baker for the Debian GNU/Linux +system. It has been subsequently revised as a generic PCRE man page. +. +. +.SH REVISION +.rs +.sp +.nf +Last updated: 24 June 2012 +.fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man1/pcregrep.1 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man1/pcregrep.1 new file mode 100644 index 0000000000000000000000000000000000000000..988667542f24cae86948c46bed70e623d98a8e71 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man1/pcregrep.1 @@ -0,0 +1,683 @@ +.TH PCREGREP 1 "03 April 2014" "PCRE 8.35" +.SH NAME +pcregrep - a grep with Perl-compatible regular expressions. +.SH SYNOPSIS +.B pcregrep [options] [long options] [pattern] [path1 path2 ...] +. +.SH DESCRIPTION +.rs +.sp +\fBpcregrep\fP searches files for character patterns, in the same way as other +grep commands do, but it uses the PCRE regular expression library to support +patterns that are compatible with the regular expressions of Perl 5. See +.\" HREF +\fBpcresyntax\fP(3) +.\" +for a quick-reference summary of pattern syntax, or +.\" HREF +\fBpcrepattern\fP(3) +.\" +for a full description of the syntax and semantics of the regular expressions +that PCRE supports. +.P +Patterns, whether supplied on the command line or in a separate file, are given +without delimiters. For example: +.sp + pcregrep Thursday /etc/motd +.sp +If you attempt to use delimiters (for example, by surrounding a pattern with +slashes, as is common in Perl scripts), they are interpreted as part of the +pattern. Quotes can of course be used to delimit patterns on the command line +because they are interpreted by the shell, and indeed quotes are required if a +pattern contains white space or shell metacharacters. +.P +The first argument that follows any option settings is treated as the single +pattern to be matched when neither \fB-e\fP nor \fB-f\fP is present. +Conversely, when one or both of these options are used to specify patterns, all +arguments are treated as path names. At least one of \fB-e\fP, \fB-f\fP, or an +argument pattern must be provided. +.P +If no files are specified, \fBpcregrep\fP reads the standard input. The +standard input can also be referenced by a name consisting of a single hyphen. +For example: +.sp + pcregrep some-pattern /file1 - /file3 +.sp +By default, each line that matches a pattern is copied to the standard +output, and if there is more than one file, the file name is output at the +start of each line, followed by a colon. However, there are options that can +change how \fBpcregrep\fP behaves. In particular, the \fB-M\fP option makes it +possible to search for patterns that span line boundaries. What defines a line +boundary is controlled by the \fB-N\fP (\fB--newline\fP) option. +.P +The amount of memory used for buffering files that are being scanned is +controlled by a parameter that can be set by the \fB--buffer-size\fP option. +The default value for this parameter is specified when \fBpcregrep\fP is built, +with the default default being 20K. A block of memory three times this size is +used (to allow for buffering "before" and "after" lines). An error occurs if a +line overflows the buffer. +.P +Patterns can be no longer than 8K or BUFSIZ bytes, whichever is the greater. +BUFSIZ is defined in \fB\fP. When there is more than one pattern +(specified by the use of \fB-e\fP and/or \fB-f\fP), each pattern is applied to +each line in the order in which they are defined, except that all the \fB-e\fP +patterns are tried before the \fB-f\fP patterns. +.P +By default, as soon as one pattern matches a line, no further patterns are +considered. However, if \fB--colour\fP (or \fB--color\fP) is used to colour the +matching substrings, or if \fB--only-matching\fP, \fB--file-offsets\fP, or +\fB--line-offsets\fP is used to output only the part of the line that matched +(either shown literally, or as an offset), scanning resumes immediately +following the match, so that further matches on the same line can be found. If +there are multiple patterns, they are all tried on the remainder of the line, +but patterns that follow the one that matched are not tried on the earlier part +of the line. +.P +This behaviour means that the order in which multiple patterns are specified +can affect the output when one of the above options is used. This is no longer +the same behaviour as GNU grep, which now manages to display earlier matches +for later patterns (as long as there is no overlap). +.P +Patterns that can match an empty string are accepted, but empty string +matches are never recognized. An example is the pattern "(super)?(man)?", in +which all components are optional. This pattern finds all occurrences of both +"super" and "man"; the output differs from matching with "super|man" when only +the matching substrings are being shown. +.P +If the \fBLC_ALL\fP or \fBLC_CTYPE\fP environment variable is set, +\fBpcregrep\fP uses the value to set a locale when calling the PCRE library. +The \fB--locale\fP option can be used to override this. +. +. +.SH "SUPPORT FOR COMPRESSED FILES" +.rs +.sp +It is possible to compile \fBpcregrep\fP so that it uses \fBlibz\fP or +\fBlibbz2\fP to read files whose names end in \fB.gz\fP or \fB.bz2\fP, +respectively. You can find out whether your binary has support for one or both +of these file types by running it with the \fB--help\fP option. If the +appropriate support is not present, files are treated as plain text. The +standard input is always so treated. +. +. +.SH "BINARY FILES" +.rs +.sp +By default, a file that contains a binary zero byte within the first 1024 bytes +is identified as a binary file, and is processed specially. (GNU grep also +identifies binary files in this manner.) See the \fB--binary-files\fP option +for a means of changing the way binary files are handled. +. +. +.SH OPTIONS +.rs +.sp +The order in which some of the options appear can affect the output. For +example, both the \fB-h\fP and \fB-l\fP options affect the printing of file +names. Whichever comes later in the command line will be the one that takes +effect. Similarly, except where noted below, if an option is given twice, the +later setting is used. Numerical values for options may be followed by K or M, +to signify multiplication by 1024 or 1024*1024 respectively. +.TP 10 +\fB--\fP +This terminates the list of options. It is useful if the next item on the +command line starts with a hyphen but is not an option. This allows for the +processing of patterns and filenames that start with hyphens. +.TP +\fB-A\fP \fInumber\fP, \fB--after-context=\fP\fInumber\fP +Output \fInumber\fP lines of context after each matching line. If filenames +and/or line numbers are being output, a hyphen separator is used instead of a +colon for the context lines. A line containing "--" is output between each +group of lines, unless they are in fact contiguous in the input file. The value +of \fInumber\fP is expected to be relatively small. However, \fBpcregrep\fP +guarantees to have up to 8K of following text available for context output. +.TP +\fB-a\fP, \fB--text\fP +Treat binary files as text. This is equivalent to +\fB--binary-files\fP=\fItext\fP. +.TP +\fB-B\fP \fInumber\fP, \fB--before-context=\fP\fInumber\fP +Output \fInumber\fP lines of context before each matching line. If filenames +and/or line numbers are being output, a hyphen separator is used instead of a +colon for the context lines. A line containing "--" is output between each +group of lines, unless they are in fact contiguous in the input file. The value +of \fInumber\fP is expected to be relatively small. However, \fBpcregrep\fP +guarantees to have up to 8K of preceding text available for context output. +.TP +\fB--binary-files=\fP\fIword\fP +Specify how binary files are to be processed. If the word is "binary" (the +default), pattern matching is performed on binary files, but the only output is +"Binary file matches" when a match succeeds. If the word is "text", +which is equivalent to the \fB-a\fP or \fB--text\fP option, binary files are +processed in the same way as any other file. In this case, when a match +succeeds, the output may be binary garbage, which can have nasty effects if +sent to a terminal. If the word is "without-match", which is equivalent to the +\fB-I\fP option, binary files are not processed at all; they are assumed not to +be of interest. +.TP +\fB--buffer-size=\fP\fInumber\fP +Set the parameter that controls how much memory is used for buffering files +that are being scanned. +.TP +\fB-C\fP \fInumber\fP, \fB--context=\fP\fInumber\fP +Output \fInumber\fP lines of context both before and after each matching line. +This is equivalent to setting both \fB-A\fP and \fB-B\fP to the same value. +.TP +\fB-c\fP, \fB--count\fP +Do not output individual lines from the files that are being scanned; instead +output the number of lines that would otherwise have been shown. If no lines +are selected, the number zero is output. If several files are are being +scanned, a count is output for each of them. However, if the +\fB--files-with-matches\fP option is also used, only those files whose counts +are greater than zero are listed. When \fB-c\fP is used, the \fB-A\fP, +\fB-B\fP, and \fB-C\fP options are ignored. +.TP +\fB--colour\fP, \fB--color\fP +If this option is given without any data, it is equivalent to "--colour=auto". +If data is required, it must be given in the same shell item, separated by an +equals sign. +.TP +\fB--colour=\fP\fIvalue\fP, \fB--color=\fP\fIvalue\fP +This option specifies under what circumstances the parts of a line that matched +a pattern should be coloured in the output. By default, the output is not +coloured. The value (which is optional, see above) may be "never", "always", or +"auto". In the latter case, colouring happens only if the standard output is +connected to a terminal. More resources are used when colouring is enabled, +because \fBpcregrep\fP has to search for all possible matches in a line, not +just one, in order to colour them all. +.sp +The colour that is used can be specified by setting the environment variable +PCREGREP_COLOUR or PCREGREP_COLOR. The value of this variable should be a +string of two numbers, separated by a semicolon. They are copied directly into +the control string for setting colour on a terminal, so it is your +responsibility to ensure that they make sense. If neither of the environment +variables is set, the default is "1;31", which gives red. +.TP +\fB-D\fP \fIaction\fP, \fB--devices=\fP\fIaction\fP +If an input path is not a regular file or a directory, "action" specifies how +it is to be processed. Valid values are "read" (the default) or "skip" +(silently skip the path). +.TP +\fB-d\fP \fIaction\fP, \fB--directories=\fP\fIaction\fP +If an input path is a directory, "action" specifies how it is to be processed. +Valid values are "read" (the default in non-Windows environments, for +compatibility with GNU grep), "recurse" (equivalent to the \fB-r\fP option), or +"skip" (silently skip the path, the default in Windows environments). In the +"read" case, directories are read as if they were ordinary files. In some +operating systems the effect of reading a directory like this is an immediate +end-of-file; in others it may provoke an error. +.TP +\fB-e\fP \fIpattern\fP, \fB--regex=\fP\fIpattern\fP, \fB--regexp=\fP\fIpattern\fP +Specify a pattern to be matched. This option can be used multiple times in +order to specify several patterns. It can also be used as a way of specifying a +single pattern that starts with a hyphen. When \fB-e\fP is used, no argument +pattern is taken from the command line; all arguments are treated as file +names. There is no limit to the number of patterns. They are applied to each +line in the order in which they are defined until one matches. +.sp +If \fB-f\fP is used with \fB-e\fP, the command line patterns are matched first, +followed by the patterns from the file(s), independent of the order in which +these options are specified. Note that multiple use of \fB-e\fP is not the same +as a single pattern with alternatives. For example, X|Y finds the first +character in a line that is X or Y, whereas if the two patterns are given +separately, with X first, \fBpcregrep\fP finds X if it is present, even if it +follows Y in the line. It finds Y only if there is no X in the line. This +matters only if you are using \fB-o\fP or \fB--colo(u)r\fP to show the part(s) +of the line that matched. +.TP +\fB--exclude\fP=\fIpattern\fP +Files (but not directories) whose names match the pattern are skipped without +being processed. This applies to all files, whether listed on the command line, +obtained from \fB--file-list\fP, or by scanning a directory. The pattern is a +PCRE regular expression, and is matched against the final component of the file +name, not the entire path. The \fB-F\fP, \fB-w\fP, and \fB-x\fP options do not +apply to this pattern. The option may be given any number of times in order to +specify multiple patterns. If a file name matches both an \fB--include\fP +and an \fB--exclude\fP pattern, it is excluded. There is no short form for this +option. +.TP +\fB--exclude-from=\fP\fIfilename\fP +Treat each non-empty line of the file as the data for an \fB--exclude\fP +option. What constitutes a newline when reading the file is the operating +system's default. The \fB--newline\fP option has no effect on this option. This +option may be given more than once in order to specify a number of files to +read. +.TP +\fB--exclude-dir\fP=\fIpattern\fP +Directories whose names match the pattern are skipped without being processed, +whatever the setting of the \fB--recursive\fP option. This applies to all +directories, whether listed on the command line, obtained from +\fB--file-list\fP, or by scanning a parent directory. The pattern is a PCRE +regular expression, and is matched against the final component of the directory +name, not the entire path. The \fB-F\fP, \fB-w\fP, and \fB-x\fP options do not +apply to this pattern. The option may be given any number of times in order to +specify more than one pattern. If a directory matches both \fB--include-dir\fP +and \fB--exclude-dir\fP, it is excluded. There is no short form for this +option. +.TP +\fB-F\fP, \fB--fixed-strings\fP +Interpret each data-matching pattern as a list of fixed strings, separated by +newlines, instead of as a regular expression. What constitutes a newline for +this purpose is controlled by the \fB--newline\fP option. The \fB-w\fP (match +as a word) and \fB-x\fP (match whole line) options can be used with \fB-F\fP. +They apply to each of the fixed strings. A line is selected if any of the fixed +strings are found in it (subject to \fB-w\fP or \fB-x\fP, if present). This +option applies only to the patterns that are matched against the contents of +files; it does not apply to patterns specified by any of the \fB--include\fP or +\fB--exclude\fP options. +.TP +\fB-f\fP \fIfilename\fP, \fB--file=\fP\fIfilename\fP +Read patterns from the file, one per line, and match them against +each line of input. What constitutes a newline when reading the file is the +operating system's default. The \fB--newline\fP option has no effect on this +option. Trailing white space is removed from each line, and blank lines are +ignored. An empty file contains no patterns and therefore matches nothing. See +also the comments about multiple patterns versus a single pattern with +alternatives in the description of \fB-e\fP above. +.sp +If this option is given more than once, all the specified files are +read. A data line is output if any of the patterns match it. A filename can +be given as "-" to refer to the standard input. When \fB-f\fP is used, patterns +specified on the command line using \fB-e\fP may also be present; they are +tested before the file's patterns. However, no other pattern is taken from the +command line; all arguments are treated as the names of paths to be searched. +.TP +\fB--file-list\fP=\fIfilename\fP +Read a list of files and/or directories that are to be scanned from the given +file, one per line. Trailing white space is removed from each line, and blank +lines are ignored. These paths are processed before any that are listed on the +command line. The filename can be given as "-" to refer to the standard input. +If \fB--file\fP and \fB--file-list\fP are both specified as "-", patterns are +read first. This is useful only when the standard input is a terminal, from +which further lines (the list of files) can be read after an end-of-file +indication. If this option is given more than once, all the specified files are +read. +.TP +\fB--file-offsets\fP +Instead of showing lines or parts of lines that match, show each match as an +offset from the start of the file and a length, separated by a comma. In this +mode, no context is shown. That is, the \fB-A\fP, \fB-B\fP, and \fB-C\fP +options are ignored. If there is more than one match in a line, each of them is +shown separately. This option is mutually exclusive with \fB--line-offsets\fP +and \fB--only-matching\fP. +.TP +\fB-H\fP, \fB--with-filename\fP +Force the inclusion of the filename at the start of output lines when searching +a single file. By default, the filename is not shown in this case. For matching +lines, the filename is followed by a colon; for context lines, a hyphen +separator is used. If a line number is also being output, it follows the file +name. +.TP +\fB-h\fP, \fB--no-filename\fP +Suppress the output filenames when searching multiple files. By default, +filenames are shown when multiple files are searched. For matching lines, the +filename is followed by a colon; for context lines, a hyphen separator is used. +If a line number is also being output, it follows the file name. +.TP +\fB--help\fP +Output a help message, giving brief details of the command options and file +type support, and then exit. Anything else on the command line is +ignored. +.TP +\fB-I\fP +Treat binary files as never matching. This is equivalent to +\fB--binary-files\fP=\fIwithout-match\fP. +.TP +\fB-i\fP, \fB--ignore-case\fP +Ignore upper/lower case distinctions during comparisons. +.TP +\fB--include\fP=\fIpattern\fP +If any \fB--include\fP patterns are specified, the only files that are +processed are those that match one of the patterns (and do not match an +\fB--exclude\fP pattern). This option does not affect directories, but it +applies to all files, whether listed on the command line, obtained from +\fB--file-list\fP, or by scanning a directory. The pattern is a PCRE regular +expression, and is matched against the final component of the file name, not +the entire path. The \fB-F\fP, \fB-w\fP, and \fB-x\fP options do not apply to +this pattern. The option may be given any number of times. If a file name +matches both an \fB--include\fP and an \fB--exclude\fP pattern, it is excluded. +There is no short form for this option. +.TP +\fB--include-from=\fP\fIfilename\fP +Treat each non-empty line of the file as the data for an \fB--include\fP +option. What constitutes a newline for this purpose is the operating system's +default. The \fB--newline\fP option has no effect on this option. This option +may be given any number of times; all the files are read. +.TP +\fB--include-dir\fP=\fIpattern\fP +If any \fB--include-dir\fP patterns are specified, the only directories that +are processed are those that match one of the patterns (and do not match an +\fB--exclude-dir\fP pattern). This applies to all directories, whether listed +on the command line, obtained from \fB--file-list\fP, or by scanning a parent +directory. The pattern is a PCRE regular expression, and is matched against the +final component of the directory name, not the entire path. The \fB-F\fP, +\fB-w\fP, and \fB-x\fP options do not apply to this pattern. The option may be +given any number of times. If a directory matches both \fB--include-dir\fP and +\fB--exclude-dir\fP, it is excluded. There is no short form for this option. +.TP +\fB-L\fP, \fB--files-without-match\fP +Instead of outputting lines from the files, just output the names of the files +that do not contain any lines that would have been output. Each file name is +output once, on a separate line. +.TP +\fB-l\fP, \fB--files-with-matches\fP +Instead of outputting lines from the files, just output the names of the files +containing lines that would have been output. Each file name is output +once, on a separate line. Searching normally stops as soon as a matching line +is found in a file. However, if the \fB-c\fP (count) option is also used, +matching continues in order to obtain the correct count, and those files that +have at least one match are listed along with their counts. Using this option +with \fB-c\fP is a way of suppressing the listing of files with no matches. +.TP +\fB--label\fP=\fIname\fP +This option supplies a name to be used for the standard input when file names +are being output. If not supplied, "(standard input)" is used. There is no +short form for this option. +.TP +\fB--line-buffered\fP +When this option is given, input is read and processed line by line, and the +output is flushed after each write. By default, input is read in large chunks, +unless \fBpcregrep\fP can determine that it is reading from a terminal (which +is currently possible only in Unix-like environments). Output to terminal is +normally automatically flushed by the operating system. This option can be +useful when the input or output is attached to a pipe and you do not want +\fBpcregrep\fP to buffer up large amounts of data. However, its use will affect +performance, and the \fB-M\fP (multiline) option ceases to work. +.TP +\fB--line-offsets\fP +Instead of showing lines or parts of lines that match, show each match as a +line number, the offset from the start of the line, and a length. The line +number is terminated by a colon (as usual; see the \fB-n\fP option), and the +offset and length are separated by a comma. In this mode, no context is shown. +That is, the \fB-A\fP, \fB-B\fP, and \fB-C\fP options are ignored. If there is +more than one match in a line, each of them is shown separately. This option is +mutually exclusive with \fB--file-offsets\fP and \fB--only-matching\fP. +.TP +\fB--locale\fP=\fIlocale-name\fP +This option specifies a locale to be used for pattern matching. It overrides +the value in the \fBLC_ALL\fP or \fBLC_CTYPE\fP environment variables. If no +locale is specified, the PCRE library's default (usually the "C" locale) is +used. There is no short form for this option. +.TP +\fB--match-limit\fP=\fInumber\fP +Processing some regular expression patterns can require a very large amount of +memory, leading in some cases to a program crash if not enough is available. +Other patterns may take a very long time to search for all possible matching +strings. The \fBpcre_exec()\fP function that is called by \fBpcregrep\fP to do +the matching has two parameters that can limit the resources that it uses. +.sp +The \fB--match-limit\fP option provides a means of limiting resource usage +when processing patterns that are not going to match, but which have a very +large number of possibilities in their search trees. The classic example is a +pattern that uses nested unlimited repeats. Internally, PCRE uses a function +called \fBmatch()\fP which it calls repeatedly (sometimes recursively). The +limit set by \fB--match-limit\fP is imposed on the number of times this +function is called during a match, which has the effect of limiting the amount +of backtracking that can take place. +.sp +The \fB--recursion-limit\fP option is similar to \fB--match-limit\fP, but +instead of limiting the total number of times that \fBmatch()\fP is called, it +limits the depth of recursive calls, which in turn limits the amount of memory +that can be used. The recursion depth is a smaller number than the total number +of calls, because not all calls to \fBmatch()\fP are recursive. This limit is +of use only if it is set smaller than \fB--match-limit\fP. +.sp +There are no short forms for these options. The default settings are specified +when the PCRE library is compiled, with the default default being 10 million. +.TP +\fB-M\fP, \fB--multiline\fP +Allow patterns to match more than one line. When this option is given, patterns +may usefully contain literal newline characters and internal occurrences of ^ +and $ characters. The output for a successful match may consist of more than +one line, the last of which is the one in which the match ended. If the matched +string ends with a newline sequence the output ends at the end of that line. +.sp +When this option is set, the PCRE library is called in "multiline" mode. +There is a limit to the number of lines that can be matched, imposed by the way +that \fBpcregrep\fP buffers the input file as it scans it. However, +\fBpcregrep\fP ensures that at least 8K characters or the rest of the document +(whichever is the shorter) are available for forward matching, and similarly +the previous 8K characters (or all the previous characters, if fewer than 8K) +are guaranteed to be available for lookbehind assertions. This option does not +work when input is read line by line (see \fP--line-buffered\fP.) +.TP +\fB-N\fP \fInewline-type\fP, \fB--newline\fP=\fInewline-type\fP +The PCRE library supports five different conventions for indicating +the ends of lines. They are the single-character sequences CR (carriage return) +and LF (linefeed), the two-character sequence CRLF, an "anycrlf" convention, +which recognizes any of the preceding three types, and an "any" convention, in +which any Unicode line ending sequence is assumed to end a line. The Unicode +sequences are the three just mentioned, plus VT (vertical tab, U+000B), FF +(form feed, U+000C), NEL (next line, U+0085), LS (line separator, U+2028), and +PS (paragraph separator, U+2029). +.sp +When the PCRE library is built, a default line-ending sequence is specified. +This is normally the standard sequence for the operating system. Unless +otherwise specified by this option, \fBpcregrep\fP uses the library's default. +The possible values for this option are CR, LF, CRLF, ANYCRLF, or ANY. This +makes it possible to use \fBpcregrep\fP to scan files that have come from other +environments without having to modify their line endings. If the data that is +being scanned does not agree with the convention set by this option, +\fBpcregrep\fP may behave in strange ways. Note that this option does not +apply to files specified by the \fB-f\fP, \fB--exclude-from\fP, or +\fB--include-from\fP options, which are expected to use the operating system's +standard newline sequence. +.TP +\fB-n\fP, \fB--line-number\fP +Precede each output line by its line number in the file, followed by a colon +for matching lines or a hyphen for context lines. If the filename is also being +output, it precedes the line number. This option is forced if +\fB--line-offsets\fP is used. +.TP +\fB--no-jit\fP +If the PCRE library is built with support for just-in-time compiling (which +speeds up matching), \fBpcregrep\fP automatically makes use of this, unless it +was explicitly disabled at build time. This option can be used to disable the +use of JIT at run time. It is provided for testing and working round problems. +It should never be needed in normal use. +.TP +\fB-o\fP, \fB--only-matching\fP +Show only the part of the line that matched a pattern instead of the whole +line. In this mode, no context is shown. That is, the \fB-A\fP, \fB-B\fP, and +\fB-C\fP options are ignored. If there is more than one match in a line, each +of them is shown separately. If \fB-o\fP is combined with \fB-v\fP (invert the +sense of the match to find non-matching lines), no output is generated, but the +return code is set appropriately. If the matched portion of the line is empty, +nothing is output unless the file name or line number are being printed, in +which case they are shown on an otherwise empty line. This option is mutually +exclusive with \fB--file-offsets\fP and \fB--line-offsets\fP. +.TP +\fB-o\fP\fInumber\fP, \fB--only-matching\fP=\fInumber\fP +Show only the part of the line that matched the capturing parentheses of the +given number. Up to 32 capturing parentheses are supported, and -o0 is +equivalent to \fB-o\fP without a number. Because these options can be given +without an argument (see above), if an argument is present, it must be given in +the same shell item, for example, -o3 or --only-matching=2. The comments given +for the non-argument case above also apply to this case. If the specified +capturing parentheses do not exist in the pattern, or were not set in the +match, nothing is output unless the file name or line number are being printed. +.sp +If this option is given multiple times, multiple substrings are output, in the +order the options are given. For example, -o3 -o1 -o3 causes the substrings +matched by capturing parentheses 3 and 1 and then 3 again to be output. By +default, there is no separator (but see the next option). +.TP +\fB--om-separator\fP=\fItext\fP +Specify a separating string for multiple occurrences of \fB-o\fP. The default +is an empty string. Separating strings are never coloured. +.TP +\fB-q\fP, \fB--quiet\fP +Work quietly, that is, display nothing except error messages. The exit +status indicates whether or not any matches were found. +.TP +\fB-r\fP, \fB--recursive\fP +If any given path is a directory, recursively scan the files it contains, +taking note of any \fB--include\fP and \fB--exclude\fP settings. By default, a +directory is read as a normal file; in some operating systems this gives an +immediate end-of-file. This option is a shorthand for setting the \fB-d\fP +option to "recurse". +.TP +\fB--recursion-limit\fP=\fInumber\fP +See \fB--match-limit\fP above. +.TP +\fB-s\fP, \fB--no-messages\fP +Suppress error messages about non-existent or unreadable files. Such files are +quietly skipped. However, the return code is still 2, even if matches were +found in other files. +.TP +\fB-u\fP, \fB--utf-8\fP +Operate in UTF-8 mode. This option is available only if PCRE has been compiled +with UTF-8 support. All patterns (including those for any \fB--exclude\fP and +\fB--include\fP options) and all subject lines that are scanned must be valid +strings of UTF-8 characters. +.TP +\fB-V\fP, \fB--version\fP +Write the version numbers of \fBpcregrep\fP and the PCRE library to the +standard output and then exit. Anything else on the command line is +ignored. +.TP +\fB-v\fP, \fB--invert-match\fP +Invert the sense of the match, so that lines which do \fInot\fP match any of +the patterns are the ones that are found. +.TP +\fB-w\fP, \fB--word-regex\fP, \fB--word-regexp\fP +Force the patterns to match only whole words. This is equivalent to having \eb +at the start and end of the pattern. This option applies only to the patterns +that are matched against the contents of files; it does not apply to patterns +specified by any of the \fB--include\fP or \fB--exclude\fP options. +.TP +\fB-x\fP, \fB--line-regex\fP, \fB--line-regexp\fP +Force the patterns to be anchored (each must start matching at the beginning of +a line) and in addition, require them to match entire lines. This is equivalent +to having ^ and $ characters at the start and end of each alternative branch in +every pattern. This option applies only to the patterns that are matched +against the contents of files; it does not apply to patterns specified by any +of the \fB--include\fP or \fB--exclude\fP options. +. +. +.SH "ENVIRONMENT VARIABLES" +.rs +.sp +The environment variables \fBLC_ALL\fP and \fBLC_CTYPE\fP are examined, in that +order, for a locale. The first one that is set is used. This can be overridden +by the \fB--locale\fP option. If no locale is set, the PCRE library's default +(usually the "C" locale) is used. +. +. +.SH "NEWLINES" +.rs +.sp +The \fB-N\fP (\fB--newline\fP) option allows \fBpcregrep\fP to scan files with +different newline conventions from the default. Any parts of the input files +that are written to the standard output are copied identically, with whatever +newline sequences they have in the input. However, the setting of this option +does not affect the interpretation of files specified by the \fB-f\fP, +\fB--exclude-from\fP, or \fB--include-from\fP options, which are assumed to use +the operating system's standard newline sequence, nor does it affect the way in +which \fBpcregrep\fP writes informational messages to the standard error and +output streams. For these it uses the string "\en" to indicate newlines, +relying on the C I/O library to convert this to an appropriate sequence. +. +. +.SH "OPTIONS COMPATIBILITY" +.rs +.sp +Many of the short and long forms of \fBpcregrep\fP's options are the same +as in the GNU \fBgrep\fP program. Any long option of the form +\fB--xxx-regexp\fP (GNU terminology) is also available as \fB--xxx-regex\fP +(PCRE terminology). However, the \fB--file-list\fP, \fB--file-offsets\fP, +\fB--include-dir\fP, \fB--line-offsets\fP, \fB--locale\fP, \fB--match-limit\fP, +\fB-M\fP, \fB--multiline\fP, \fB-N\fP, \fB--newline\fP, \fB--om-separator\fP, +\fB--recursion-limit\fP, \fB-u\fP, and \fB--utf-8\fP options are specific to +\fBpcregrep\fP, as is the use of the \fB--only-matching\fP option with a +capturing parentheses number. +.P +Although most of the common options work the same way, a few are different in +\fBpcregrep\fP. For example, the \fB--include\fP option's argument is a glob +for GNU \fBgrep\fP, but a regular expression for \fBpcregrep\fP. If both the +\fB-c\fP and \fB-l\fP options are given, GNU grep lists only file names, +without counts, but \fBpcregrep\fP gives the counts. +. +. +.SH "OPTIONS WITH DATA" +.rs +.sp +There are four different ways in which an option with data can be specified. +If a short form option is used, the data may follow immediately, or (with one +exception) in the next command line item. For example: +.sp + -f/some/file + -f /some/file +.sp +The exception is the \fB-o\fP option, which may appear with or without data. +Because of this, if data is present, it must follow immediately in the same +item, for example -o3. +.P +If a long form option is used, the data may appear in the same command line +item, separated by an equals character, or (with two exceptions) it may appear +in the next command line item. For example: +.sp + --file=/some/file + --file /some/file +.sp +Note, however, that if you want to supply a file name beginning with ~ as data +in a shell command, and have the shell expand ~ to a home directory, you must +separate the file name from the option, because the shell does not treat ~ +specially unless it is at the start of an item. +.P +The exceptions to the above are the \fB--colour\fP (or \fB--color\fP) and +\fB--only-matching\fP options, for which the data is optional. If one of these +options does have data, it must be given in the first form, using an equals +character. Otherwise \fBpcregrep\fP will assume that it has no data. +. +. +.SH "MATCHING ERRORS" +.rs +.sp +It is possible to supply a regular expression that takes a very long time to +fail to match certain lines. Such patterns normally involve nested indefinite +repeats, for example: (a+)*\ed when matched against a line of a's with no final +digit. The PCRE matching function has a resource limit that causes it to abort +in these circumstances. If this happens, \fBpcregrep\fP outputs an error +message and the line that caused the problem to the standard error stream. If +there are more than 20 such errors, \fBpcregrep\fP gives up. +.P +The \fB--match-limit\fP option of \fBpcregrep\fP can be used to set the overall +resource limit; there is a second option called \fB--recursion-limit\fP that +sets a limit on the amount of memory (usually stack) that is used (see the +discussion of these options above). +. +. +.SH DIAGNOSTICS +.rs +.sp +Exit status is 0 if any matches were found, 1 if no matches were found, and 2 +for syntax errors, overlong lines, non-existent or inaccessible files (even if +matches were found in other files) or too many matching errors. Using the +\fB-s\fP option to suppress error messages about inaccessible files does not +affect the return code. +. +. +.SH "SEE ALSO" +.rs +.sp +\fBpcrepattern\fP(3), \fBpcresyntax\fP(3), \fBpcretest\fP(1). +. +. +.SH AUTHOR +.rs +.sp +.nf +Philip Hazel +University Computing Service +Cambridge CB2 3QH, England. +.fi +. +. +.SH REVISION +.rs +.sp +.nf +Last updated: 03 April 2014 +Copyright (c) 1997-2014 University of Cambridge. +.fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man1/pcretest.1 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man1/pcretest.1 new file mode 100644 index 0000000000000000000000000000000000000000..fec964d782a64b5d3b2d4d60590ad56647e4875e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man1/pcretest.1 @@ -0,0 +1,1158 @@ +.TH PCRETEST 1 "10 February 2020" "PCRE 8.44" +.SH NAME +pcretest - a program for testing Perl-compatible regular expressions. +.SH SYNOPSIS +.rs +.sp +.B pcretest "[options] [input file [output file]]" +.sp +\fBpcretest\fP was written as a test program for the PCRE regular expression +library itself, but it can also be used for experimenting with regular +expressions. This document describes the features of the test program; for +details of the regular expressions themselves, see the +.\" HREF +\fBpcrepattern\fP +.\" +documentation. For details of the PCRE library function calls and their +options, see the +.\" HREF +\fBpcreapi\fP +.\" +, +.\" HREF +\fBpcre16\fP +and +.\" HREF +\fBpcre32\fP +.\" +documentation. +.P +The input for \fBpcretest\fP is a sequence of regular expression patterns and +strings to be matched, as described below. The output shows the result of each +match. Options on the command line and the patterns control PCRE options and +exactly what is output. +.P +As PCRE has evolved, it has acquired many different features, and as a result, +\fBpcretest\fP now has rather a lot of obscure options for testing every +possible feature. Some of these options are specifically designed for use in +conjunction with the test script and data files that are distributed as part of +PCRE, and are unlikely to be of use otherwise. They are all documented here, +but without much justification. +. +. +.SH "INPUT DATA FORMAT" +.rs +.sp +Input to \fBpcretest\fP is processed line by line, either by calling the C +library's \fBfgets()\fP function, or via the \fBlibreadline\fP library (see +below). In Unix-like environments, \fBfgets()\fP treats any bytes other than +newline as data characters. However, in some Windows environments character 26 +(hex 1A) causes an immediate end of file, and no further data is read. For +maximum portability, therefore, it is safest to use only ASCII characters in +\fBpcretest\fP input files. +.P +The input is processed using using C's string functions, so must not +contain binary zeroes, even though in Unix-like environments, \fBfgets()\fP +treats any bytes other than newline as data characters. +. +. +.SH "PCRE's 8-BIT, 16-BIT AND 32-BIT LIBRARIES" +.rs +.sp +From release 8.30, two separate PCRE libraries can be built. The original one +supports 8-bit character strings, whereas the newer 16-bit library supports +character strings encoded in 16-bit units. From release 8.32, a third library +can be built, supporting character strings encoded in 32-bit units. The +\fBpcretest\fP program can be used to test all three libraries. However, it is +itself still an 8-bit program, reading 8-bit input and writing 8-bit output. +When testing the 16-bit or 32-bit library, the patterns and data strings are +converted to 16- or 32-bit format before being passed to the PCRE library +functions. Results are converted to 8-bit for output. +.P +References to functions and structures of the form \fBpcre[16|32]_xx\fP below +mean "\fBpcre_xx\fP when using the 8-bit library, \fBpcre16_xx\fP when using +the 16-bit library, or \fBpcre32_xx\fP when using the 32-bit library". +. +. +.SH "COMMAND LINE OPTIONS" +.rs +.TP 10 +\fB-8\fP +If the 8-bit library has been built, this option causes it to be used (this is +the default). If the 8-bit library has not been built, this option causes an +error. +.TP 10 +\fB-16\fP +If the 16-bit library has been built, this option causes it to be used. If only +the 16-bit library has been built, this is the default. If the 16-bit library +has not been built, this option causes an error. +.TP 10 +\fB-32\fP +If the 32-bit library has been built, this option causes it to be used. If only +the 32-bit library has been built, this is the default. If the 32-bit library +has not been built, this option causes an error. +.TP 10 +\fB-b\fP +Behave as if each pattern has the \fB/B\fP (show byte code) modifier; the +internal form is output after compilation. +.TP 10 +\fB-C\fP +Output the version number of the PCRE library, and all available information +about the optional features that are included, and then exit with zero exit +code. All other options are ignored. +.TP 10 +\fB-C\fP \fIoption\fP +Output information about a specific build-time option, then exit. This +functionality is intended for use in scripts such as \fBRunTest\fP. The +following options output the value and set the exit code as indicated: +.sp + ebcdic-nl the code for LF (= NL) in an EBCDIC environment: + 0x15 or 0x25 + 0 if used in an ASCII environment + exit code is always 0 + linksize the configured internal link size (2, 3, or 4) + exit code is set to the link size + newline the default newline setting: + CR, LF, CRLF, ANYCRLF, or ANY + exit code is always 0 + bsr the default setting for what \eR matches: + ANYCRLF or ANY + exit code is always 0 +.sp +The following options output 1 for true or 0 for false, and set the exit code +to the same value: +.sp + ebcdic compiled for an EBCDIC environment + jit just-in-time support is available + pcre16 the 16-bit library was built + pcre32 the 32-bit library was built + pcre8 the 8-bit library was built + ucp Unicode property support is available + utf UTF-8 and/or UTF-16 and/or UTF-32 support + is available +.sp +If an unknown option is given, an error message is output; the exit code is 0. +.TP 10 +\fB-d\fP +Behave as if each pattern has the \fB/D\fP (debug) modifier; the internal +form and information about the compiled pattern is output after compilation; +\fB-d\fP is equivalent to \fB-b -i\fP. +.TP 10 +\fB-dfa\fP +Behave as if each data line contains the \eD escape sequence; this causes the +alternative matching function, \fBpcre[16|32]_dfa_exec()\fP, to be used instead +of the standard \fBpcre[16|32]_exec()\fP function (more detail is given below). +.TP 10 +\fB-help\fP +Output a brief summary these options and then exit. +.TP 10 +\fB-i\fP +Behave as if each pattern has the \fB/I\fP modifier; information about the +compiled pattern is given after compilation. +.TP 10 +\fB-M\fP +Behave as if each data line contains the \eM escape sequence; this causes +PCRE to discover the minimum MATCH_LIMIT and MATCH_LIMIT_RECURSION settings by +calling \fBpcre[16|32]_exec()\fP repeatedly with different limits. +.TP 10 +\fB-m\fP +Output the size of each compiled pattern after it has been compiled. This is +equivalent to adding \fB/M\fP to each regular expression. The size is given in +bytes for both libraries. +.TP 10 +\fB-O\fP +Behave as if each pattern has the \fB/O\fP modifier, that is disable +auto-possessification for all patterns. +.TP 10 +\fB-o\fP \fIosize\fP +Set the number of elements in the output vector that is used when calling +\fBpcre[16|32]_exec()\fP or \fBpcre[16|32]_dfa_exec()\fP to be \fIosize\fP. The +default value is 45, which is enough for 14 capturing subexpressions for +\fBpcre[16|32]_exec()\fP or 22 different matches for +\fBpcre[16|32]_dfa_exec()\fP. +The vector size can be changed for individual matching calls by including \eO +in the data line (see below). +.TP 10 +\fB-p\fP +Behave as if each pattern has the \fB/P\fP modifier; the POSIX wrapper API is +used to call PCRE. None of the other options has any effect when \fB-p\fP is +set. This option can be used only with the 8-bit library. +.TP 10 +\fB-q\fP +Do not output the version number of \fBpcretest\fP at the start of execution. +.TP 10 +\fB-S\fP \fIsize\fP +On Unix-like systems, set the size of the run-time stack to \fIsize\fP +megabytes. +.TP 10 +\fB-s\fP or \fB-s+\fP +Behave as if each pattern has the \fB/S\fP modifier; in other words, force each +pattern to be studied. If \fB-s+\fP is used, all the JIT compile options are +passed to \fBpcre[16|32]_study()\fP, causing just-in-time optimization to be set +up if it is available, for both full and partial matching. Specific JIT compile +options can be selected by following \fB-s+\fP with a digit in the range 1 to +7, which selects the JIT compile modes as follows: +.sp + 1 normal match only + 2 soft partial match only + 3 normal match and soft partial match + 4 hard partial match only + 6 soft and hard partial match + 7 all three modes (default) +.sp +If \fB-s++\fP is used instead of \fB-s+\fP (with or without a following digit), +the text "(JIT)" is added to the first output line after a match or no match +when JIT-compiled code was actually used. +.sp +Note that there are pattern options that can override \fB-s\fP, either +specifying no studying at all, or suppressing JIT compilation. +.sp +If the \fB/I\fP or \fB/D\fP option is present on a pattern (requesting output +about the compiled pattern), information about the result of studying is not +included when studying is caused only by \fB-s\fP and neither \fB-i\fP nor +\fB-d\fP is present on the command line. This behaviour means that the output +from tests that are run with and without \fB-s\fP should be identical, except +when options that output information about the actual running of a match are +set. +.sp +The \fB-M\fP, \fB-t\fP, and \fB-tm\fP options, which give information about +resources used, are likely to produce different output with and without +\fB-s\fP. Output may also differ if the \fB/C\fP option is present on an +individual pattern. This uses callouts to trace the the matching process, and +this may be different between studied and non-studied patterns. If the pattern +contains (*MARK) items there may also be differences, for the same reason. The +\fB-s\fP command line option can be overridden for specific patterns that +should never be studied (see the \fB/S\fP pattern modifier below). +.TP 10 +\fB-t\fP +Run each compile, study, and match many times with a timer, and output the +resulting times per compile, study, or match (in milliseconds). Do not set +\fB-m\fP with \fB-t\fP, because you will then get the size output a zillion +times, and the timing will be distorted. You can control the number of +iterations that are used for timing by following \fB-t\fP with a number (as a +separate item on the command line). For example, "-t 1000" iterates 1000 times. +The default is to iterate 500000 times. +.TP 10 +\fB-tm\fP +This is like \fB-t\fP except that it times only the matching phase, not the +compile or study phases. +.TP 10 +\fB-T\fP \fB-TM\fP +These behave like \fB-t\fP and \fB-tm\fP, but in addition, at the end of a run, +the total times for all compiles, studies, and matches are output. +. +. +.SH DESCRIPTION +.rs +.sp +If \fBpcretest\fP is given two filename arguments, it reads from the first and +writes to the second. If it is given only one filename argument, it reads from +that file and writes to stdout. Otherwise, it reads from stdin and writes to +stdout, and prompts for each line of input, using "re>" to prompt for regular +expressions, and "data>" to prompt for data lines. +.P +When \fBpcretest\fP is built, a configuration option can specify that it should +be linked with the \fBlibreadline\fP library. When this is done, if the input +is from a terminal, it is read using the \fBreadline()\fP function. This +provides line-editing and history facilities. The output from the \fB-help\fP +option states whether or not \fBreadline()\fP will be used. +.P +The program handles any number of sets of input on a single input file. Each +set starts with a regular expression, and continues with any number of data +lines to be matched against that pattern. +.P +Each data line is matched separately and independently. If you want to do +multi-line matches, you have to use the \en escape sequence (or \er or \er\en, +etc., depending on the newline setting) in a single line of input to encode the +newline sequences. There is no limit on the length of data lines; the input +buffer is automatically extended if it is too small. +.P +An empty line signals the end of the data lines, at which point a new regular +expression is read. The regular expressions are given enclosed in any +non-alphanumeric delimiters other than backslash, for example: +.sp + /(a|bc)x+yz/ +.sp +White space before the initial delimiter is ignored. A regular expression may +be continued over several input lines, in which case the newline characters are +included within it. It is possible to include the delimiter within the pattern +by escaping it, for example +.sp + /abc\e/def/ +.sp +If you do so, the escape and the delimiter form part of the pattern, but since +delimiters are always non-alphanumeric, this does not affect its interpretation. +If the terminating delimiter is immediately followed by a backslash, for +example, +.sp + /abc/\e +.sp +then a backslash is added to the end of the pattern. This is done to provide a +way of testing the error condition that arises if a pattern finishes with a +backslash, because +.sp + /abc\e/ +.sp +is interpreted as the first line of a pattern that starts with "abc/", causing +pcretest to read the next line as a continuation of the regular expression. +. +. +.SH "PATTERN MODIFIERS" +.rs +.sp +A pattern may be followed by any number of modifiers, which are mostly single +characters, though some of these can be qualified by further characters. +Following Perl usage, these are referred to below as, for example, "the +\fB/i\fP modifier", even though the delimiter of the pattern need not always be +a slash, and no slash is used when writing modifiers. White space may appear +between the final pattern delimiter and the first modifier, and between the +modifiers themselves. For reference, here is a complete list of modifiers. They +fall into several groups that are described in detail in the following +sections. +.sp + \fB/8\fP set UTF mode + \fB/9\fP set PCRE_NEVER_UTF (locks out UTF mode) + \fB/?\fP disable UTF validity check + \fB/+\fP show remainder of subject after match + \fB/=\fP show all captures (not just those that are set) +.sp + \fB/A\fP set PCRE_ANCHORED + \fB/B\fP show compiled code + \fB/C\fP set PCRE_AUTO_CALLOUT + \fB/D\fP same as \fB/B\fP plus \fB/I\fP + \fB/E\fP set PCRE_DOLLAR_ENDONLY + \fB/F\fP flip byte order in compiled pattern + \fB/f\fP set PCRE_FIRSTLINE + \fB/G\fP find all matches (shorten string) + \fB/g\fP find all matches (use startoffset) + \fB/I\fP show information about pattern + \fB/i\fP set PCRE_CASELESS + \fB/J\fP set PCRE_DUPNAMES + \fB/K\fP show backtracking control names + \fB/L\fP set locale + \fB/M\fP show compiled memory size + \fB/m\fP set PCRE_MULTILINE + \fB/N\fP set PCRE_NO_AUTO_CAPTURE + \fB/O\fP set PCRE_NO_AUTO_POSSESS + \fB/P\fP use the POSIX wrapper + \fB/Q\fP test external stack check function + \fB/S\fP study the pattern after compilation + \fB/s\fP set PCRE_DOTALL + \fB/T\fP select character tables + \fB/U\fP set PCRE_UNGREEDY + \fB/W\fP set PCRE_UCP + \fB/X\fP set PCRE_EXTRA + \fB/x\fP set PCRE_EXTENDED + \fB/Y\fP set PCRE_NO_START_OPTIMIZE + \fB/Z\fP don't show lengths in \fB/B\fP output +.sp + \fB/\fP set PCRE_NEWLINE_ANY + \fB/\fP set PCRE_NEWLINE_ANYCRLF + \fB/\fP set PCRE_NEWLINE_CR + \fB/\fP set PCRE_NEWLINE_CRLF + \fB/\fP set PCRE_NEWLINE_LF + \fB/\fP set PCRE_BSR_ANYCRLF + \fB/\fP set PCRE_BSR_UNICODE + \fB/\fP set PCRE_JAVASCRIPT_COMPAT +.sp +. +. +.SS "Perl-compatible modifiers" +.rs +.sp +The \fB/i\fP, \fB/m\fP, \fB/s\fP, and \fB/x\fP modifiers set the PCRE_CASELESS, +PCRE_MULTILINE, PCRE_DOTALL, or PCRE_EXTENDED options, respectively, when +\fBpcre[16|32]_compile()\fP is called. These four modifier letters have the same +effect as they do in Perl. For example: +.sp + /caseless/i +.sp +. +. +.SS "Modifiers for other PCRE options" +.rs +.sp +The following table shows additional modifiers for setting PCRE compile-time +options that do not correspond to anything in Perl: +.sp + \fB/8\fP PCRE_UTF8 ) when using the 8-bit + \fB/?\fP PCRE_NO_UTF8_CHECK ) library +.sp + \fB/8\fP PCRE_UTF16 ) when using the 16-bit + \fB/?\fP PCRE_NO_UTF16_CHECK ) library +.sp + \fB/8\fP PCRE_UTF32 ) when using the 32-bit + \fB/?\fP PCRE_NO_UTF32_CHECK ) library +.sp + \fB/9\fP PCRE_NEVER_UTF + \fB/A\fP PCRE_ANCHORED + \fB/C\fP PCRE_AUTO_CALLOUT + \fB/E\fP PCRE_DOLLAR_ENDONLY + \fB/f\fP PCRE_FIRSTLINE + \fB/J\fP PCRE_DUPNAMES + \fB/N\fP PCRE_NO_AUTO_CAPTURE + \fB/O\fP PCRE_NO_AUTO_POSSESS + \fB/U\fP PCRE_UNGREEDY + \fB/W\fP PCRE_UCP + \fB/X\fP PCRE_EXTRA + \fB/Y\fP PCRE_NO_START_OPTIMIZE + \fB/\fP PCRE_NEWLINE_ANY + \fB/\fP PCRE_NEWLINE_ANYCRLF + \fB/\fP PCRE_NEWLINE_CR + \fB/\fP PCRE_NEWLINE_CRLF + \fB/\fP PCRE_NEWLINE_LF + \fB/\fP PCRE_BSR_ANYCRLF + \fB/\fP PCRE_BSR_UNICODE + \fB/\fP PCRE_JAVASCRIPT_COMPAT +.sp +The modifiers that are enclosed in angle brackets are literal strings as shown, +including the angle brackets, but the letters within can be in either case. +This example sets multiline matching with CRLF as the line ending sequence: +.sp + /^abc/m +.sp +As well as turning on the PCRE_UTF8/16/32 option, the \fB/8\fP modifier causes +all non-printing characters in output strings to be printed using the +\ex{hh...} notation. Otherwise, those less than 0x100 are output in hex without +the curly brackets. +.P +Full details of the PCRE options are given in the +.\" HREF +\fBpcreapi\fP +.\" +documentation. +. +. +.SS "Finding all matches in a string" +.rs +.sp +Searching for all possible matches within each subject string can be requested +by the \fB/g\fP or \fB/G\fP modifier. After finding a match, PCRE is called +again to search the remainder of the subject string. The difference between +\fB/g\fP and \fB/G\fP is that the former uses the \fIstartoffset\fP argument to +\fBpcre[16|32]_exec()\fP to start searching at a new point within the entire +string (which is in effect what Perl does), whereas the latter passes over a +shortened substring. This makes a difference to the matching process if the +pattern begins with a lookbehind assertion (including \eb or \eB). +.P +If any call to \fBpcre[16|32]_exec()\fP in a \fB/g\fP or \fB/G\fP sequence matches +an empty string, the next call is done with the PCRE_NOTEMPTY_ATSTART and +PCRE_ANCHORED flags set in order to search for another, non-empty, match at the +same point. If this second match fails, the start offset is advanced, and the +normal match is retried. This imitates the way Perl handles such cases when +using the \fB/g\fP modifier or the \fBsplit()\fP function. Normally, the start +offset is advanced by one character, but if the newline convention recognizes +CRLF as a newline, and the current character is CR followed by LF, an advance +of two is used. +. +. +.SS "Other modifiers" +.rs +.sp +There are yet more modifiers for controlling the way \fBpcretest\fP +operates. +.P +The \fB/+\fP modifier requests that as well as outputting the substring that +matched the entire pattern, \fBpcretest\fP should in addition output the +remainder of the subject string. This is useful for tests where the subject +contains multiple copies of the same substring. If the \fB+\fP modifier appears +twice, the same action is taken for captured substrings. In each case the +remainder is output on the following line with a plus character following the +capture number. Note that this modifier must not immediately follow the /S +modifier because /S+ and /S++ have other meanings. +.P +The \fB/=\fP modifier requests that the values of all potential captured +parentheses be output after a match. By default, only those up to the highest +one actually used in the match are output (corresponding to the return code +from \fBpcre[16|32]_exec()\fP). Values in the offsets vector corresponding to +higher numbers should be set to -1, and these are output as "". This +modifier gives a way of checking that this is happening. +.P +The \fB/B\fP modifier is a debugging feature. It requests that \fBpcretest\fP +output a representation of the compiled code after compilation. Normally this +information contains length and offset values; however, if \fB/Z\fP is also +present, this data is replaced by spaces. This is a special feature for use in +the automatic test scripts; it ensures that the same output is generated for +different internal link sizes. +.P +The \fB/D\fP modifier is a PCRE debugging feature, and is equivalent to +\fB/BI\fP, that is, both the \fB/B\fP and the \fB/I\fP modifiers. +.P +The \fB/F\fP modifier causes \fBpcretest\fP to flip the byte order of the +2-byte and 4-byte fields in the compiled pattern. This facility is for testing +the feature in PCRE that allows it to execute patterns that were compiled on a +host with a different endianness. This feature is not available when the POSIX +interface to PCRE is being used, that is, when the \fB/P\fP pattern modifier is +specified. See also the section about saving and reloading compiled patterns +below. +.P +The \fB/I\fP modifier requests that \fBpcretest\fP output information about the +compiled pattern (whether it is anchored, has a fixed first character, and +so on). It does this by calling \fBpcre[16|32]_fullinfo()\fP after compiling a +pattern. If the pattern is studied, the results of that are also output. In +this output, the word "char" means a non-UTF character, that is, the value of a +single data item (8-bit, 16-bit, or 32-bit, depending on the library that is +being tested). +.P +The \fB/K\fP modifier requests \fBpcretest\fP to show names from backtracking +control verbs that are returned from calls to \fBpcre[16|32]_exec()\fP. It causes +\fBpcretest\fP to create a \fBpcre[16|32]_extra\fP block if one has not already +been created by a call to \fBpcre[16|32]_study()\fP, and to set the +PCRE_EXTRA_MARK flag and the \fBmark\fP field within it, every time that +\fBpcre[16|32]_exec()\fP is called. If the variable that the \fBmark\fP field +points to is non-NULL for a match, non-match, or partial match, \fBpcretest\fP +prints the string to which it points. For a match, this is shown on a line by +itself, tagged with "MK:". For a non-match it is added to the message. +.P +The \fB/L\fP modifier must be followed directly by the name of a locale, for +example, +.sp + /pattern/Lfr_FR +.sp +For this reason, it must be the last modifier. The given locale is set, +\fBpcre[16|32]_maketables()\fP is called to build a set of character tables for +the locale, and this is then passed to \fBpcre[16|32]_compile()\fP when compiling +the regular expression. Without an \fB/L\fP (or \fB/T\fP) modifier, NULL is +passed as the tables pointer; that is, \fB/L\fP applies only to the expression +on which it appears. +.P +The \fB/M\fP modifier causes the size in bytes of the memory block used to hold +the compiled pattern to be output. This does not include the size of the +\fBpcre[16|32]\fP block; it is just the actual compiled data. If the pattern is +successfully studied with the PCRE_STUDY_JIT_COMPILE option, the size of the +JIT compiled code is also output. +.P +The \fB/Q\fP modifier is used to test the use of \fBpcre_stack_guard\fP. It +must be followed by '0' or '1', specifying the return code to be given from an +external function that is passed to PCRE and used for stack checking during +compilation (see the +.\" HREF +\fBpcreapi\fP +.\" +documentation for details). +.P +The \fB/S\fP modifier causes \fBpcre[16|32]_study()\fP to be called after the +expression has been compiled, and the results used when the expression is +matched. There are a number of qualifying characters that may follow \fB/S\fP. +They may appear in any order. +.P +If \fB/S\fP is followed by an exclamation mark, \fBpcre[16|32]_study()\fP is +called with the PCRE_STUDY_EXTRA_NEEDED option, causing it always to return a +\fBpcre_extra\fP block, even when studying discovers no useful information. +.P +If \fB/S\fP is followed by a second S character, it suppresses studying, even +if it was requested externally by the \fB-s\fP command line option. This makes +it possible to specify that certain patterns are always studied, and others are +never studied, independently of \fB-s\fP. This feature is used in the test +files in a few cases where the output is different when the pattern is studied. +.P +If the \fB/S\fP modifier is followed by a + character, the call to +\fBpcre[16|32]_study()\fP is made with all the JIT study options, requesting +just-in-time optimization support if it is available, for both normal and +partial matching. If you want to restrict the JIT compiling modes, you can +follow \fB/S+\fP with a digit in the range 1 to 7: +.sp + 1 normal match only + 2 soft partial match only + 3 normal match and soft partial match + 4 hard partial match only + 6 soft and hard partial match + 7 all three modes (default) +.sp +If \fB/S++\fP is used instead of \fB/S+\fP (with or without a following digit), +the text "(JIT)" is added to the first output line after a match or no match +when JIT-compiled code was actually used. +.P +Note that there is also an independent \fB/+\fP modifier; it must not be given +immediately after \fB/S\fP or \fB/S+\fP because this will be misinterpreted. +.P +If JIT studying is successful, the compiled JIT code will automatically be used +when \fBpcre[16|32]_exec()\fP is run, except when incompatible run-time options +are specified. For more details, see the +.\" HREF +\fBpcrejit\fP +.\" +documentation. See also the \fB\eJ\fP escape sequence below for a way of +setting the size of the JIT stack. +.P +Finally, if \fB/S\fP is followed by a minus character, JIT compilation is +suppressed, even if it was requested externally by the \fB-s\fP command line +option. This makes it possible to specify that JIT is never to be used for +certain patterns. +.P +The \fB/T\fP modifier must be followed by a single digit. It causes a specific +set of built-in character tables to be passed to \fBpcre[16|32]_compile()\fP. It +is used in the standard PCRE tests to check behaviour with different character +tables. The digit specifies the tables as follows: +.sp + 0 the default ASCII tables, as distributed in + pcre_chartables.c.dist + 1 a set of tables defining ISO 8859 characters +.sp +In table 1, some characters whose codes are greater than 128 are identified as +letters, digits, spaces, etc. +. +. +.SS "Using the POSIX wrapper API" +.rs +.sp +The \fB/P\fP modifier causes \fBpcretest\fP to call PCRE via the POSIX wrapper +API rather than its native API. This supports only the 8-bit library. When +\fB/P\fP is set, the following modifiers set options for the \fBregcomp()\fP +function: +.sp + /i REG_ICASE + /m REG_NEWLINE + /N REG_NOSUB + /s REG_DOTALL ) + /U REG_UNGREEDY ) These options are not part of + /W REG_UCP ) the POSIX standard + /8 REG_UTF8 ) +.sp +The \fB/+\fP modifier works as described above. All other modifiers are +ignored. +. +. +.SS "Locking out certain modifiers" +.rs +.sp +PCRE can be compiled with or without support for certain features such as +UTF-8/16/32 or Unicode properties. Accordingly, the standard tests are split up +into a number of different files that are selected for running depending on +which features are available. When updating the tests, it is all too easy to +put a new test into the wrong file by mistake; for example, to put a test that +requires UTF support into a file that is used when it is not available. To help +detect such mistakes as early as possible, there is a facility for locking out +specific modifiers. If an input line for \fBpcretest\fP starts with the string +"< forbid " the following sequence of characters is taken as a list of +forbidden modifiers. For example, in the test files that must not use UTF or +Unicode property support, this line appears: +.sp + < forbid 8W +.sp +This locks out the /8 and /W modifiers. An immediate error is given if they are +subsequently encountered. If the character string contains < but not >, all the +multi-character modifiers that begin with < are locked out. Otherwise, such +modifiers must be explicitly listed, for example: +.sp + < forbid +.sp +There must be a single space between < and "forbid" for this feature to be +recognised. If there is not, the line is interpreted either as a request to +re-load a pre-compiled pattern (see "SAVING AND RELOADING COMPILED PATTERNS" +below) or, if there is a another < character, as a pattern that uses < as its +delimiter. +. +. +.SH "DATA LINES" +.rs +.sp +Before each data line is passed to \fBpcre[16|32]_exec()\fP, leading and trailing +white space is removed, and it is then scanned for \e escapes. Some of these +are pretty esoteric features, intended for checking out some of the more +complicated features of PCRE. If you are just testing "ordinary" regular +expressions, you probably don't need any of these. The following escapes are +recognized: +.sp + \ea alarm (BEL, \ex07) + \eb backspace (\ex08) + \ee escape (\ex27) + \ef form feed (\ex0c) + \en newline (\ex0a) +.\" JOIN + \eqdd set the PCRE_MATCH_LIMIT limit to dd + (any number of digits) + \er carriage return (\ex0d) + \et tab (\ex09) + \ev vertical tab (\ex0b) + \ennn octal character (up to 3 octal digits); always + a byte unless > 255 in UTF-8 or 16-bit or 32-bit mode + \eo{dd...} octal character (any number of octal digits} + \exhh hexadecimal byte (up to 2 hex digits) + \ex{hh...} hexadecimal character (any number of hex digits) +.\" JOIN + \eA pass the PCRE_ANCHORED option to \fBpcre[16|32]_exec()\fP + or \fBpcre[16|32]_dfa_exec()\fP +.\" JOIN + \eB pass the PCRE_NOTBOL option to \fBpcre[16|32]_exec()\fP + or \fBpcre[16|32]_dfa_exec()\fP +.\" JOIN + \eCdd call pcre[16|32]_copy_substring() for substring dd + after a successful match (number less than 32) +.\" JOIN + \eCname call pcre[16|32]_copy_named_substring() for substring + "name" after a successful match (name termin- + ated by next non alphanumeric character) +.\" JOIN + \eC+ show the current captured substrings at callout + time + \eC- do not supply a callout function +.\" JOIN + \eC!n return 1 instead of 0 when callout number n is + reached +.\" JOIN + \eC!n!m return 1 instead of 0 when callout number n is + reached for the nth time +.\" JOIN + \eC*n pass the number n (may be negative) as callout + data; this is used as the callout return value + \eD use the \fBpcre[16|32]_dfa_exec()\fP match function + \eF only shortest match for \fBpcre[16|32]_dfa_exec()\fP +.\" JOIN + \eGdd call pcre[16|32]_get_substring() for substring dd + after a successful match (number less than 32) +.\" JOIN + \eGname call pcre[16|32]_get_named_substring() for substring + "name" after a successful match (name termin- + ated by next non-alphanumeric character) +.\" JOIN + \eJdd set up a JIT stack of dd kilobytes maximum (any + number of digits) +.\" JOIN + \eL call pcre[16|32]_get_substringlist() after a + successful match +.\" JOIN + \eM discover the minimum MATCH_LIMIT and + MATCH_LIMIT_RECURSION settings +.\" JOIN + \eN pass the PCRE_NOTEMPTY option to \fBpcre[16|32]_exec()\fP + or \fBpcre[16|32]_dfa_exec()\fP; if used twice, pass the + PCRE_NOTEMPTY_ATSTART option +.\" JOIN + \eOdd set the size of the output vector passed to + \fBpcre[16|32]_exec()\fP to dd (any number of digits) +.\" JOIN + \eP pass the PCRE_PARTIAL_SOFT option to \fBpcre[16|32]_exec()\fP + or \fBpcre[16|32]_dfa_exec()\fP; if used twice, pass the + PCRE_PARTIAL_HARD option +.\" JOIN + \eQdd set the PCRE_MATCH_LIMIT_RECURSION limit to dd + (any number of digits) + \eR pass the PCRE_DFA_RESTART option to \fBpcre[16|32]_dfa_exec()\fP + \eS output details of memory get/free calls during matching +.\" JOIN + \eY pass the PCRE_NO_START_OPTIMIZE option to \fBpcre[16|32]_exec()\fP + or \fBpcre[16|32]_dfa_exec()\fP +.\" JOIN + \eZ pass the PCRE_NOTEOL option to \fBpcre[16|32]_exec()\fP + or \fBpcre[16|32]_dfa_exec()\fP +.\" JOIN + \e? pass the PCRE_NO_UTF[8|16|32]_CHECK option to + \fBpcre[16|32]_exec()\fP or \fBpcre[16|32]_dfa_exec()\fP +.\" JOIN + \e>dd start the match at offset dd (optional "-"; then + any number of digits); this sets the \fIstartoffset\fP + argument for \fBpcre[16|32]_exec()\fP or \fBpcre[16|32]_dfa_exec()\fP +.\" JOIN + \e pass the PCRE_NEWLINE_CR option to \fBpcre[16|32]_exec()\fP + or \fBpcre[16|32]_dfa_exec()\fP +.\" JOIN + \e pass the PCRE_NEWLINE_LF option to \fBpcre[16|32]_exec()\fP + or \fBpcre[16|32]_dfa_exec()\fP +.\" JOIN + \e pass the PCRE_NEWLINE_CRLF option to \fBpcre[16|32]_exec()\fP + or \fBpcre[16|32]_dfa_exec()\fP +.\" JOIN + \e pass the PCRE_NEWLINE_ANYCRLF option to \fBpcre[16|32]_exec()\fP + or \fBpcre[16|32]_dfa_exec()\fP +.\" JOIN + \e pass the PCRE_NEWLINE_ANY option to \fBpcre[16|32]_exec()\fP + or \fBpcre[16|32]_dfa_exec()\fP +.sp +The use of \ex{hh...} is not dependent on the use of the \fB/8\fP modifier on +the pattern. It is recognized always. There may be any number of hexadecimal +digits inside the braces; invalid values provoke error messages. +.P +Note that \exhh specifies one byte rather than one character in UTF-8 mode; +this makes it possible to construct invalid UTF-8 sequences for testing +purposes. On the other hand, \ex{hh} is interpreted as a UTF-8 character in +UTF-8 mode, generating more than one byte if the value is greater than 127. +When testing the 8-bit library not in UTF-8 mode, \ex{hh} generates one byte +for values less than 256, and causes an error for greater values. +.P +In UTF-16 mode, all 4-digit \ex{hhhh} values are accepted. This makes it +possible to construct invalid UTF-16 sequences for testing purposes. +.P +In UTF-32 mode, all 4- to 8-digit \ex{...} values are accepted. This makes it +possible to construct invalid UTF-32 sequences for testing purposes. +.P +The escapes that specify line ending sequences are literal strings, exactly as +shown. No more than one newline setting should be present in any data line. +.P +A backslash followed by anything else just escapes the anything else. If +the very last character is a backslash, it is ignored. This gives a way of +passing an empty line as data, since a real empty line terminates the data +input. +.P +The \fB\eJ\fP escape provides a way of setting the maximum stack size that is +used by the just-in-time optimization code. It is ignored if JIT optimization +is not being used. Providing a stack that is larger than the default 32K is +necessary only for very complicated patterns. +.P +If \eM is present, \fBpcretest\fP calls \fBpcre[16|32]_exec()\fP several times, +with different values in the \fImatch_limit\fP and \fImatch_limit_recursion\fP +fields of the \fBpcre[16|32]_extra\fP data structure, until it finds the minimum +numbers for each parameter that allow \fBpcre[16|32]_exec()\fP to complete without +error. Because this is testing a specific feature of the normal interpretive +\fBpcre[16|32]_exec()\fP execution, the use of any JIT optimization that might +have been set up by the \fB/S+\fP qualifier of \fB-s+\fP option is disabled. +.P +The \fImatch_limit\fP number is a measure of the amount of backtracking +that takes place, and checking it out can be instructive. For most simple +matches, the number is quite small, but for patterns with very large numbers of +matching possibilities, it can become large very quickly with increasing length +of subject string. The \fImatch_limit_recursion\fP number is a measure of how +much stack (or, if PCRE is compiled with NO_RECURSE, how much heap) memory is +needed to complete the match attempt. +.P +When \eO is used, the value specified may be higher or lower than the size set +by the \fB-O\fP command line option (or defaulted to 45); \eO applies only to +the call of \fBpcre[16|32]_exec()\fP for the line in which it appears. +.P +If the \fB/P\fP modifier was present on the pattern, causing the POSIX wrapper +API to be used, the only option-setting sequences that have any effect are \eB, +\eN, and \eZ, causing REG_NOTBOL, REG_NOTEMPTY, and REG_NOTEOL, respectively, +to be passed to \fBregexec()\fP. +. +. +.SH "THE ALTERNATIVE MATCHING FUNCTION" +.rs +.sp +By default, \fBpcretest\fP uses the standard PCRE matching function, +\fBpcre[16|32]_exec()\fP to match each data line. PCRE also supports an +alternative matching function, \fBpcre[16|32]_dfa_test()\fP, which operates in a +different way, and has some restrictions. The differences between the two +functions are described in the +.\" HREF +\fBpcrematching\fP +.\" +documentation. +.P +If a data line contains the \eD escape sequence, or if the command line +contains the \fB-dfa\fP option, the alternative matching function is used. +This function finds all possible matches at a given point. If, however, the \eF +escape sequence is present in the data line, it stops after the first match is +found. This is always the shortest possible match. +. +. +.SH "DEFAULT OUTPUT FROM PCRETEST" +.rs +.sp +This section describes the output when the normal matching function, +\fBpcre[16|32]_exec()\fP, is being used. +.P +When a match succeeds, \fBpcretest\fP outputs the list of captured substrings +that \fBpcre[16|32]_exec()\fP returns, starting with number 0 for the string that +matched the whole pattern. Otherwise, it outputs "No match" when the return is +PCRE_ERROR_NOMATCH, and "Partial match:" followed by the partially matching +substring when \fBpcre[16|32]_exec()\fP returns PCRE_ERROR_PARTIAL. (Note that +this is the entire substring that was inspected during the partial match; it +may include characters before the actual match start if a lookbehind assertion, +\eK, \eb, or \eB was involved.) For any other return, \fBpcretest\fP outputs +the PCRE negative error number and a short descriptive phrase. If the error is +a failed UTF string check, the offset of the start of the failing character and +the reason code are also output, provided that the size of the output vector is +at least two. Here is an example of an interactive \fBpcretest\fP run. +.sp + $ pcretest + PCRE version 8.13 2011-04-30 +.sp + re> /^abc(\ed+)/ + data> abc123 + 0: abc123 + 1: 123 + data> xyz + No match +.sp +Unset capturing substrings that are not followed by one that is set are not +returned by \fBpcre[16|32]_exec()\fP, and are not shown by \fBpcretest\fP. In the +following example, there are two capturing substrings, but when the first data +line is matched, the second, unset substring is not shown. An "internal" unset +substring is shown as "", as for the second data line. +.sp + re> /(a)|(b)/ + data> a + 0: a + 1: a + data> b + 0: b + 1: + 2: b +.sp +If the strings contain any non-printing characters, they are output as \exhh +escapes if the value is less than 256 and UTF mode is not set. Otherwise they +are output as \ex{hh...} escapes. See below for the definition of non-printing +characters. If the pattern has the \fB/+\fP modifier, the output for substring +0 is followed by the the rest of the subject string, identified by "0+" like +this: +.sp + re> /cat/+ + data> cataract + 0: cat + 0+ aract +.sp +If the pattern has the \fB/g\fP or \fB/G\fP modifier, the results of successive +matching attempts are output in sequence, like this: +.sp + re> /\eBi(\ew\ew)/g + data> Mississippi + 0: iss + 1: ss + 0: iss + 1: ss + 0: ipp + 1: pp +.sp +"No match" is output only if the first match attempt fails. Here is an example +of a failure message (the offset 4 that is specified by \e>4 is past the end of +the subject string): +.sp + re> /xyz/ + data> xyz\e>4 + Error -24 (bad offset value) +.P +If any of the sequences \fB\eC\fP, \fB\eG\fP, or \fB\eL\fP are present in a +data line that is successfully matched, the substrings extracted by the +convenience functions are output with C, G, or L after the string number +instead of a colon. This is in addition to the normal full list. The string +length (that is, the return from the extraction function) is given in +parentheses after each string for \fB\eC\fP and \fB\eG\fP. +.P +Note that whereas patterns can be continued over several lines (a plain ">" +prompt is used for continuations), data lines may not. However newlines can be +included in data by means of the \en escape (or \er, \er\en, etc., depending on +the newline sequence setting). +. +. +. +.SH "OUTPUT FROM THE ALTERNATIVE MATCHING FUNCTION" +.rs +.sp +When the alternative matching function, \fBpcre[16|32]_dfa_exec()\fP, is used (by +means of the \eD escape sequence or the \fB-dfa\fP command line option), the +output consists of a list of all the matches that start at the first point in +the subject where there is at least one match. For example: +.sp + re> /(tang|tangerine|tan)/ + data> yellow tangerine\eD + 0: tangerine + 1: tang + 2: tan +.sp +(Using the normal matching function on this data finds only "tang".) The +longest matching string is always given first (and numbered zero). After a +PCRE_ERROR_PARTIAL return, the output is "Partial match:", followed by the +partially matching substring. (Note that this is the entire substring that was +inspected during the partial match; it may include characters before the actual +match start if a lookbehind assertion, \eK, \eb, or \eB was involved.) +.P +If \fB/g\fP is present on the pattern, the search for further matches resumes +at the end of the longest match. For example: +.sp + re> /(tang|tangerine|tan)/g + data> yellow tangerine and tangy sultana\eD + 0: tangerine + 1: tang + 2: tan + 0: tang + 1: tan + 0: tan +.sp +Since the matching function does not support substring capture, the escape +sequences that are concerned with captured substrings are not relevant. +. +. +.SH "RESTARTING AFTER A PARTIAL MATCH" +.rs +.sp +When the alternative matching function has given the PCRE_ERROR_PARTIAL return, +indicating that the subject partially matched the pattern, you can restart the +match with additional subject data by means of the \eR escape sequence. For +example: +.sp + re> /^\ed?\ed(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\ed\ed$/ + data> 23ja\eP\eD + Partial match: 23ja + data> n05\eR\eD + 0: n05 +.sp +For further information about partial matching, see the +.\" HREF +\fBpcrepartial\fP +.\" +documentation. +. +. +.SH CALLOUTS +.rs +.sp +If the pattern contains any callout requests, \fBpcretest\fP's callout function +is called during matching. This works with both matching functions. By default, +the called function displays the callout number, the start and current +positions in the text at the callout time, and the next pattern item to be +tested. For example: +.sp + --->pqrabcdef + 0 ^ ^ \ed +.sp +This output indicates that callout number 0 occurred for a match attempt +starting at the fourth character of the subject string, when the pointer was at +the seventh character of the data, and when the next pattern item was \ed. Just +one circumflex is output if the start and current positions are the same. +.P +Callouts numbered 255 are assumed to be automatic callouts, inserted as a +result of the \fB/C\fP pattern modifier. In this case, instead of showing the +callout number, the offset in the pattern, preceded by a plus, is output. For +example: +.sp + re> /\ed?[A-E]\e*/C + data> E* + --->E* + +0 ^ \ed? + +3 ^ [A-E] + +8 ^^ \e* + +10 ^ ^ + 0: E* +.sp +If a pattern contains (*MARK) items, an additional line is output whenever +a change of latest mark is passed to the callout function. For example: +.sp + re> /a(*MARK:X)bc/C + data> abc + --->abc + +0 ^ a + +1 ^^ (*MARK:X) + +10 ^^ b + Latest Mark: X + +11 ^ ^ c + +12 ^ ^ + 0: abc +.sp +The mark changes between matching "a" and "b", but stays the same for the rest +of the match, so nothing more is output. If, as a result of backtracking, the +mark reverts to being unset, the text "" is output. +.P +The callout function in \fBpcretest\fP returns zero (carry on matching) by +default, but you can use a \eC item in a data line (as described above) to +change this and other parameters of the callout. +.P +Inserting callouts can be helpful when using \fBpcretest\fP to check +complicated regular expressions. For further information about callouts, see +the +.\" HREF +\fBpcrecallout\fP +.\" +documentation. +. +. +. +.SH "NON-PRINTING CHARACTERS" +.rs +.sp +When \fBpcretest\fP is outputting text in the compiled version of a pattern, +bytes other than 32-126 are always treated as non-printing characters are are +therefore shown as hex escapes. +.P +When \fBpcretest\fP is outputting text that is a matched part of a subject +string, it behaves in the same way, unless a different locale has been set for +the pattern (using the \fB/L\fP modifier). In this case, the \fBisprint()\fP +function to distinguish printing and non-printing characters. +. +. +. +.SH "SAVING AND RELOADING COMPILED PATTERNS" +.rs +.sp +The facilities described in this section are not available when the POSIX +interface to PCRE is being used, that is, when the \fB/P\fP pattern modifier is +specified. +.P +When the POSIX interface is not in use, you can cause \fBpcretest\fP to write a +compiled pattern to a file, by following the modifiers with > and a file name. +For example: +.sp + /pattern/im >/some/file +.sp +See the +.\" HREF +\fBpcreprecompile\fP +.\" +documentation for a discussion about saving and re-using compiled patterns. +Note that if the pattern was successfully studied with JIT optimization, the +JIT data cannot be saved. +.P +The data that is written is binary. The first eight bytes are the length of the +compiled pattern data followed by the length of the optional study data, each +written as four bytes in big-endian order (most significant byte first). If +there is no study data (either the pattern was not studied, or studying did not +return any data), the second length is zero. The lengths are followed by an +exact copy of the compiled pattern. If there is additional study data, this +(excluding any JIT data) follows immediately after the compiled pattern. After +writing the file, \fBpcretest\fP expects to read a new pattern. +.P +A saved pattern can be reloaded into \fBpcretest\fP by specifying < and a file +name instead of a pattern. There must be no space between < and the file name, +which must not contain a < character, as otherwise \fBpcretest\fP will +interpret the line as a pattern delimited by < characters. For example: +.sp + re> +.\" +ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre +.\" +.P +Details of exactly which Perl regular expression features are and are not +supported by PCRE are given in separate documents. See the +.\" HREF +\fBpcrepattern\fP +.\" +and +.\" HREF +\fBpcrecompat\fP +.\" +pages. There is a syntax summary in the +.\" HREF +\fBpcresyntax\fP +.\" +page. +.P +Some features of PCRE can be included, excluded, or changed when the library is +built. The +.\" HREF +\fBpcre_config()\fP +.\" +function makes it possible for a client to discover which features are +available. The features themselves are described in the +.\" HREF +\fBpcrebuild\fP +.\" +page. Documentation about building PCRE for various operating systems can be +found in the +.\" HTML +.\" +\fBREADME\fP +.\" +and +.\" HTML +.\" +\fBNON-AUTOTOOLS_BUILD\fP +.\" +files in the source distribution. +.P +The libraries contains a number of undocumented internal functions and data +tables that are used by more than one of the exported external functions, but +which are not intended for use by external callers. Their names all begin with +"_pcre_" or "_pcre16_" or "_pcre32_", which hopefully will not provoke any name +clashes. In some environments, it is possible to control which external symbols +are exported when a shared library is built, and in these cases the +undocumented symbols are not exported. +. +. +.SH "SECURITY CONSIDERATIONS" +.rs +.sp +If you are using PCRE in a non-UTF application that permits users to supply +arbitrary patterns for compilation, you should be aware of a feature that +allows users to turn on UTF support from within a pattern, provided that PCRE +was built with UTF support. For example, an 8-bit pattern that begins with +"(*UTF8)" or "(*UTF)" turns on UTF-8 mode, which interprets patterns and +subjects as strings of UTF-8 characters instead of individual 8-bit characters. +This causes both the pattern and any data against which it is matched to be +checked for UTF-8 validity. If the data string is very long, such a check might +use sufficiently many resources as to cause your application to lose +performance. +.P +One way of guarding against this possibility is to use the +\fBpcre_fullinfo()\fP function to check the compiled pattern's options for UTF. +Alternatively, from release 8.33, you can set the PCRE_NEVER_UTF option at +compile time. This causes a compile time error if a pattern contains a +UTF-setting sequence. +.P +If your application is one that supports UTF, be aware that validity checking +can take time. If the same data string is to be matched many times, you can use +the PCRE_NO_UTF[8|16|32]_CHECK option for the second and subsequent matches to +save redundant checks. +.P +Another way that performance can be hit is by running a pattern that has a very +large search tree against a string that will never match. Nested unlimited +repeats in a pattern are a common example. PCRE provides some protection +against this: see the PCRE_EXTRA_MATCH_LIMIT feature in the +.\" HREF +\fBpcreapi\fP +.\" +page. +. +. +.SH "USER DOCUMENTATION" +.rs +.sp +The user documentation for PCRE comprises a number of different sections. In +the "man" format, each of these is a separate "man page". In the HTML format, +each is a separate page, linked from the index page. In the plain text format, +the descriptions of the \fBpcregrep\fP and \fBpcretest\fP programs are in files +called \fBpcregrep.txt\fP and \fBpcretest.txt\fP, respectively. The remaining +sections, except for the \fBpcredemo\fP section (which is a program listing), +are concatenated in \fBpcre.txt\fP, for ease of searching. The sections are as +follows: +.sp + pcre this document + pcre-config show PCRE installation configuration information + pcre16 details of the 16-bit library + pcre32 details of the 32-bit library + pcreapi details of PCRE's native C API + pcrebuild building PCRE + pcrecallout details of the callout feature + pcrecompat discussion of Perl compatibility + pcrecpp details of the C++ wrapper for the 8-bit library + pcredemo a demonstration C program that uses PCRE + pcregrep description of the \fBpcregrep\fP command (8-bit only) + pcrejit discussion of the just-in-time optimization support + pcrelimits details of size and other limits + pcrematching discussion of the two matching algorithms + pcrepartial details of the partial matching facility +.\" JOIN + pcrepattern syntax and semantics of supported + regular expressions + pcreperform discussion of performance issues + pcreposix the POSIX-compatible C API for the 8-bit library + pcreprecompile details of saving and re-using precompiled patterns + pcresample discussion of the pcredemo program + pcrestack discussion of stack usage + pcresyntax quick syntax reference + pcretest description of the \fBpcretest\fP testing command + pcreunicode discussion of Unicode and UTF-8/16/32 support +.sp +In the "man" and HTML formats, there is also a short page for each C library +function, listing its arguments and results. +. +. +.SH AUTHOR +.rs +.sp +.nf +Philip Hazel +University Computing Service +Cambridge CB2 3QH, England. +.fi +.P +Putting an actual email address here seems to have been a spam magnet, so I've +taken it away. If you want to email me, use my two initials, followed by the +two digits 10, at the domain cam.ac.uk. +. +. +.SH REVISION +.rs +.sp +.nf +Last updated: 14 June 2021 +Copyright (c) 1997-2021 University of Cambridge. +.fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre16.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre16.3 new file mode 100644 index 0000000000000000000000000000000000000000..85126a679230e33aa58e22bbff312efc86a9295e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre16.3 @@ -0,0 +1,371 @@ +.TH PCRE 3 "12 May 2013" "PCRE 8.33" +.SH NAME +PCRE - Perl-compatible regular expressions +.sp +.B #include +. +. +.SH "PCRE 16-BIT API BASIC FUNCTIONS" +.rs +.sp +.nf +.B pcre16 *pcre16_compile(PCRE_SPTR16 \fIpattern\fP, int \fIoptions\fP, +.B " const char **\fIerrptr\fP, int *\fIerroffset\fP," +.B " const unsigned char *\fItableptr\fP);" +.sp +.B pcre16 *pcre16_compile2(PCRE_SPTR16 \fIpattern\fP, int \fIoptions\fP, +.B " int *\fIerrorcodeptr\fP," +.B " const char **\fIerrptr\fP, int *\fIerroffset\fP," +.B " const unsigned char *\fItableptr\fP);" +.sp +.B pcre16_extra *pcre16_study(const pcre16 *\fIcode\fP, int \fIoptions\fP, +.B " const char **\fIerrptr\fP);" +.sp +.B void pcre16_free_study(pcre16_extra *\fIextra\fP); +.sp +.B int pcre16_exec(const pcre16 *\fIcode\fP, "const pcre16_extra *\fIextra\fP," +.B " PCRE_SPTR16 \fIsubject\fP, int \fIlength\fP, int \fIstartoffset\fP," +.B " int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP);" +.sp +.B int pcre16_dfa_exec(const pcre16 *\fIcode\fP, "const pcre16_extra *\fIextra\fP," +.B " PCRE_SPTR16 \fIsubject\fP, int \fIlength\fP, int \fIstartoffset\fP," +.B " int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP," +.B " int *\fIworkspace\fP, int \fIwscount\fP);" +.fi +. +. +.SH "PCRE 16-BIT API STRING EXTRACTION FUNCTIONS" +.rs +.sp +.nf +.B int pcre16_copy_named_substring(const pcre16 *\fIcode\fP, +.B " PCRE_SPTR16 \fIsubject\fP, int *\fIovector\fP," +.B " int \fIstringcount\fP, PCRE_SPTR16 \fIstringname\fP," +.B " PCRE_UCHAR16 *\fIbuffer\fP, int \fIbuffersize\fP);" +.sp +.B int pcre16_copy_substring(PCRE_SPTR16 \fIsubject\fP, int *\fIovector\fP, +.B " int \fIstringcount\fP, int \fIstringnumber\fP, PCRE_UCHAR16 *\fIbuffer\fP," +.B " int \fIbuffersize\fP);" +.sp +.B int pcre16_get_named_substring(const pcre16 *\fIcode\fP, +.B " PCRE_SPTR16 \fIsubject\fP, int *\fIovector\fP," +.B " int \fIstringcount\fP, PCRE_SPTR16 \fIstringname\fP," +.B " PCRE_SPTR16 *\fIstringptr\fP);" +.sp +.B int pcre16_get_stringnumber(const pcre16 *\fIcode\fP, +.B " PCRE_SPTR16 \fIname\fP); +.sp +.B int pcre16_get_stringtable_entries(const pcre16 *\fIcode\fP, +.B " PCRE_SPTR16 \fIname\fP, PCRE_UCHAR16 **\fIfirst\fP, PCRE_UCHAR16 **\fIlast\fP);" +.sp +.B int pcre16_get_substring(PCRE_SPTR16 \fIsubject\fP, int *\fIovector\fP, +.B " int \fIstringcount\fP, int \fIstringnumber\fP," +.B " PCRE_SPTR16 *\fIstringptr\fP);" +.sp +.B int pcre16_get_substring_list(PCRE_SPTR16 \fIsubject\fP, +.B " int *\fIovector\fP, int \fIstringcount\fP, PCRE_SPTR16 **\fIlistptr\fP);" +.sp +.B void pcre16_free_substring(PCRE_SPTR16 \fIstringptr\fP); +.sp +.B void pcre16_free_substring_list(PCRE_SPTR16 *\fIstringptr\fP); +.fi +. +. +.SH "PCRE 16-BIT API AUXILIARY FUNCTIONS" +.rs +.sp +.nf +.B pcre16_jit_stack *pcre16_jit_stack_alloc(int \fIstartsize\fP, int \fImaxsize\fP); +.sp +.B void pcre16_jit_stack_free(pcre16_jit_stack *\fIstack\fP); +.sp +.B void pcre16_assign_jit_stack(pcre16_extra *\fIextra\fP, +.B " pcre16_jit_callback \fIcallback\fP, void *\fIdata\fP);" +.sp +.B const unsigned char *pcre16_maketables(void); +.sp +.B int pcre16_fullinfo(const pcre16 *\fIcode\fP, "const pcre16_extra *\fIextra\fP," +.B " int \fIwhat\fP, void *\fIwhere\fP);" +.sp +.B int pcre16_refcount(pcre16 *\fIcode\fP, int \fIadjust\fP); +.sp +.B int pcre16_config(int \fIwhat\fP, void *\fIwhere\fP); +.sp +.B const char *pcre16_version(void); +.sp +.B int pcre16_pattern_to_host_byte_order(pcre16 *\fIcode\fP, +.B " pcre16_extra *\fIextra\fP, const unsigned char *\fItables\fP);" +.fi +. +. +.SH "PCRE 16-BIT API INDIRECTED FUNCTIONS" +.rs +.sp +.nf +.B void *(*pcre16_malloc)(size_t); +.sp +.B void (*pcre16_free)(void *); +.sp +.B void *(*pcre16_stack_malloc)(size_t); +.sp +.B void (*pcre16_stack_free)(void *); +.sp +.B int (*pcre16_callout)(pcre16_callout_block *); +.fi +. +. +.SH "PCRE 16-BIT API 16-BIT-ONLY FUNCTION" +.rs +.sp +.nf +.B int pcre16_utf16_to_host_byte_order(PCRE_UCHAR16 *\fIoutput\fP, +.B " PCRE_SPTR16 \fIinput\fP, int \fIlength\fP, int *\fIbyte_order\fP," +.B " int \fIkeep_boms\fP);" +.fi +. +. +.SH "THE PCRE 16-BIT LIBRARY" +.rs +.sp +Starting with release 8.30, it is possible to compile a PCRE library that +supports 16-bit character strings, including UTF-16 strings, as well as or +instead of the original 8-bit library. The majority of the work to make this +possible was done by Zoltan Herczeg. The two libraries contain identical sets +of functions, used in exactly the same way. Only the names of the functions and +the data types of their arguments and results are different. To avoid +over-complication and reduce the documentation maintenance load, most of the +PCRE documentation describes the 8-bit library, with only occasional references +to the 16-bit library. This page describes what is different when you use the +16-bit library. +.P +WARNING: A single application can be linked with both libraries, but you must +take care when processing any particular pattern to use functions from just one +library. For example, if you want to study a pattern that was compiled with +\fBpcre16_compile()\fP, you must do so with \fBpcre16_study()\fP, not +\fBpcre_study()\fP, and you must free the study data with +\fBpcre16_free_study()\fP. +. +. +.SH "THE HEADER FILE" +.rs +.sp +There is only one header file, \fBpcre.h\fP. It contains prototypes for all the +functions in all libraries, as well as definitions of flags, structures, error +codes, etc. +. +. +.SH "THE LIBRARY NAME" +.rs +.sp +In Unix-like systems, the 16-bit library is called \fBlibpcre16\fP, and can +normally be accesss by adding \fB-lpcre16\fP to the command for linking an +application that uses PCRE. +. +. +.SH "STRING TYPES" +.rs +.sp +In the 8-bit library, strings are passed to PCRE library functions as vectors +of bytes with the C type "char *". In the 16-bit library, strings are passed as +vectors of unsigned 16-bit quantities. The macro PCRE_UCHAR16 specifies an +appropriate data type, and PCRE_SPTR16 is defined as "const PCRE_UCHAR16 *". In +very many environments, "short int" is a 16-bit data type. When PCRE is built, +it defines PCRE_UCHAR16 as "unsigned short int", but checks that it really is a +16-bit data type. If it is not, the build fails with an error message telling +the maintainer to modify the definition appropriately. +. +. +.SH "STRUCTURE TYPES" +.rs +.sp +The types of the opaque structures that are used for compiled 16-bit patterns +and JIT stacks are \fBpcre16\fP and \fBpcre16_jit_stack\fP respectively. The +type of the user-accessible structure that is returned by \fBpcre16_study()\fP +is \fBpcre16_extra\fP, and the type of the structure that is used for passing +data to a callout function is \fBpcre16_callout_block\fP. These structures +contain the same fields, with the same names, as their 8-bit counterparts. The +only difference is that pointers to character strings are 16-bit instead of +8-bit types. +. +. +.SH "16-BIT FUNCTIONS" +.rs +.sp +For every function in the 8-bit library there is a corresponding function in +the 16-bit library with a name that starts with \fBpcre16_\fP instead of +\fBpcre_\fP. The prototypes are listed above. In addition, there is one extra +function, \fBpcre16_utf16_to_host_byte_order()\fP. This is a utility function +that converts a UTF-16 character string to host byte order if necessary. The +other 16-bit functions expect the strings they are passed to be in host byte +order. +.P +The \fIinput\fP and \fIoutput\fP arguments of +\fBpcre16_utf16_to_host_byte_order()\fP may point to the same address, that is, +conversion in place is supported. The output buffer must be at least as long as +the input. +.P +The \fIlength\fP argument specifies the number of 16-bit data units in the +input string; a negative value specifies a zero-terminated string. +.P +If \fIbyte_order\fP is NULL, it is assumed that the string starts off in host +byte order. This may be changed by byte-order marks (BOMs) anywhere in the +string (commonly as the first character). +.P +If \fIbyte_order\fP is not NULL, a non-zero value of the integer to which it +points means that the input starts off in host byte order, otherwise the +opposite order is assumed. Again, BOMs in the string can change this. The final +byte order is passed back at the end of processing. +.P +If \fIkeep_boms\fP is not zero, byte-order mark characters (0xfeff) are copied +into the output string. Otherwise they are discarded. +.P +The result of the function is the number of 16-bit units placed into the output +buffer, including the zero terminator if the string was zero-terminated. +. +. +.SH "SUBJECT STRING OFFSETS" +.rs +.sp +The lengths and starting offsets of subject strings must be specified in 16-bit +data units, and the offsets within subject strings that are returned by the +matching functions are in also 16-bit units rather than bytes. +. +. +.SH "NAMED SUBPATTERNS" +.rs +.sp +The name-to-number translation table that is maintained for named subpatterns +uses 16-bit characters. The \fBpcre16_get_stringtable_entries()\fP function +returns the length of each entry in the table as the number of 16-bit data +units. +. +. +.SH "OPTION NAMES" +.rs +.sp +There are two new general option names, PCRE_UTF16 and PCRE_NO_UTF16_CHECK, +which correspond to PCRE_UTF8 and PCRE_NO_UTF8_CHECK in the 8-bit library. In +fact, these new options define the same bits in the options word. There is a +discussion about the +.\" HTML +.\" +validity of UTF-16 strings +.\" +in the +.\" HREF +\fBpcreunicode\fP +.\" +page. +.P +For the \fBpcre16_config()\fP function there is an option PCRE_CONFIG_UTF16 +that returns 1 if UTF-16 support is configured, otherwise 0. If this option is +given to \fBpcre_config()\fP or \fBpcre32_config()\fP, or if the +PCRE_CONFIG_UTF8 or PCRE_CONFIG_UTF32 option is given to \fBpcre16_config()\fP, +the result is the PCRE_ERROR_BADOPTION error. +. +. +.SH "CHARACTER CODES" +.rs +.sp +In 16-bit mode, when PCRE_UTF16 is not set, character values are treated in the +same way as in 8-bit, non UTF-8 mode, except, of course, that they can range +from 0 to 0xffff instead of 0 to 0xff. Character types for characters less than +0xff can therefore be influenced by the locale in the same way as before. +Characters greater than 0xff have only one case, and no "type" (such as letter +or digit). +.P +In UTF-16 mode, the character code is Unicode, in the range 0 to 0x10ffff, with +the exception of values in the range 0xd800 to 0xdfff because those are +"surrogate" values that are used in pairs to encode values greater than 0xffff. +.P +A UTF-16 string can indicate its endianness by special code knows as a +byte-order mark (BOM). The PCRE functions do not handle this, expecting strings +to be in host byte order. A utility function called +\fBpcre16_utf16_to_host_byte_order()\fP is provided to help with this (see +above). +. +. +.SH "ERROR NAMES" +.rs +.sp +The errors PCRE_ERROR_BADUTF16_OFFSET and PCRE_ERROR_SHORTUTF16 correspond to +their 8-bit counterparts. The error PCRE_ERROR_BADMODE is given when a compiled +pattern is passed to a function that processes patterns in the other +mode, for example, if a pattern compiled with \fBpcre_compile()\fP is passed to +\fBpcre16_exec()\fP. +.P +There are new error codes whose names begin with PCRE_UTF16_ERR for invalid +UTF-16 strings, corresponding to the PCRE_UTF8_ERR codes for UTF-8 strings that +are described in the section entitled +.\" HTML +.\" +"Reason codes for invalid UTF-8 strings" +.\" +in the main +.\" HREF +\fBpcreapi\fP +.\" +page. The UTF-16 errors are: +.sp + PCRE_UTF16_ERR1 Missing low surrogate at end of string + PCRE_UTF16_ERR2 Invalid low surrogate follows high surrogate + PCRE_UTF16_ERR3 Isolated low surrogate + PCRE_UTF16_ERR4 Non-character +. +. +.SH "ERROR TEXTS" +.rs +.sp +If there is an error while compiling a pattern, the error text that is passed +back by \fBpcre16_compile()\fP or \fBpcre16_compile2()\fP is still an 8-bit +character string, zero-terminated. +. +. +.SH "CALLOUTS" +.rs +.sp +The \fIsubject\fP and \fImark\fP fields in the callout block that is passed to +a callout function point to 16-bit vectors. +. +. +.SH "TESTING" +.rs +.sp +The \fBpcretest\fP program continues to operate with 8-bit input and output +files, but it can be used for testing the 16-bit library. If it is run with the +command line option \fB-16\fP, patterns and subject strings are converted from +8-bit to 16-bit before being passed to PCRE, and the 16-bit library functions +are used instead of the 8-bit ones. Returned 16-bit strings are converted to +8-bit for output. If both the 8-bit and the 32-bit libraries were not compiled, +\fBpcretest\fP defaults to 16-bit and the \fB-16\fP option is ignored. +.P +When PCRE is being built, the \fBRunTest\fP script that is called by "make +check" uses the \fBpcretest\fP \fB-C\fP option to discover which of the 8-bit, +16-bit and 32-bit libraries has been built, and runs the tests appropriately. +. +. +.SH "NOT SUPPORTED IN 16-BIT MODE" +.rs +.sp +Not all the features of the 8-bit library are available with the 16-bit +library. The C++ and POSIX wrapper functions support only the 8-bit library, +and the \fBpcregrep\fP program is at present 8-bit only. +. +. +.SH AUTHOR +.rs +.sp +.nf +Philip Hazel +University Computing Service +Cambridge CB2 3QH, England. +.fi +. +. +.SH REVISION +.rs +.sp +.nf +Last updated: 12 May 2013 +Copyright (c) 1997-2013 University of Cambridge. +.fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre32.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre32.3 new file mode 100644 index 0000000000000000000000000000000000000000..7cde8c087726659b9a224c4324502989a29e36d5 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre32.3 @@ -0,0 +1,369 @@ +.TH PCRE 3 "12 May 2013" "PCRE 8.33" +.SH NAME +PCRE - Perl-compatible regular expressions +.sp +.B #include +. +. +.SH "PCRE 32-BIT API BASIC FUNCTIONS" +.rs +.sp +.nf +.B pcre32 *pcre32_compile(PCRE_SPTR32 \fIpattern\fP, int \fIoptions\fP, +.B " const char **\fIerrptr\fP, int *\fIerroffset\fP," +.B " const unsigned char *\fItableptr\fP);" +.sp +.B pcre32 *pcre32_compile2(PCRE_SPTR32 \fIpattern\fP, int \fIoptions\fP, +.B " int *\fIerrorcodeptr\fP," +.B " const unsigned char *\fItableptr\fP);" +.sp +.B pcre32_extra *pcre32_study(const pcre32 *\fIcode\fP, int \fIoptions\fP, +.B " const char **\fIerrptr\fP);" +.sp +.B void pcre32_free_study(pcre32_extra *\fIextra\fP); +.sp +.B int pcre32_exec(const pcre32 *\fIcode\fP, "const pcre32_extra *\fIextra\fP," +.B " PCRE_SPTR32 \fIsubject\fP, int \fIlength\fP, int \fIstartoffset\fP," +.B " int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP);" +.sp +.B int pcre32_dfa_exec(const pcre32 *\fIcode\fP, "const pcre32_extra *\fIextra\fP," +.B " PCRE_SPTR32 \fIsubject\fP, int \fIlength\fP, int \fIstartoffset\fP," +.B " int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP," +.B " int *\fIworkspace\fP, int \fIwscount\fP);" +.fi +. +. +.SH "PCRE 32-BIT API STRING EXTRACTION FUNCTIONS" +.rs +.sp +.nf +.B int pcre32_copy_named_substring(const pcre32 *\fIcode\fP, +.B " PCRE_SPTR32 \fIsubject\fP, int *\fIovector\fP," +.B " int \fIstringcount\fP, PCRE_SPTR32 \fIstringname\fP," +.B " PCRE_UCHAR32 *\fIbuffer\fP, int \fIbuffersize\fP);" +.sp +.B int pcre32_copy_substring(PCRE_SPTR32 \fIsubject\fP, int *\fIovector\fP, +.B " int \fIstringcount\fP, int \fIstringnumber\fP, PCRE_UCHAR32 *\fIbuffer\fP," +.B " int \fIbuffersize\fP);" +.sp +.B int pcre32_get_named_substring(const pcre32 *\fIcode\fP, +.B " PCRE_SPTR32 \fIsubject\fP, int *\fIovector\fP," +.B " int \fIstringcount\fP, PCRE_SPTR32 \fIstringname\fP," +.B " PCRE_SPTR32 *\fIstringptr\fP);" +.sp +.B int pcre32_get_stringnumber(const pcre32 *\fIcode\fP, +.B " PCRE_SPTR32 \fIname\fP);" +.sp +.B int pcre32_get_stringtable_entries(const pcre32 *\fIcode\fP, +.B " PCRE_SPTR32 \fIname\fP, PCRE_UCHAR32 **\fIfirst\fP, PCRE_UCHAR32 **\fIlast\fP);" +.sp +.B int pcre32_get_substring(PCRE_SPTR32 \fIsubject\fP, int *\fIovector\fP, +.B " int \fIstringcount\fP, int \fIstringnumber\fP," +.B " PCRE_SPTR32 *\fIstringptr\fP);" +.sp +.B int pcre32_get_substring_list(PCRE_SPTR32 \fIsubject\fP, +.B " int *\fIovector\fP, int \fIstringcount\fP, PCRE_SPTR32 **\fIlistptr\fP);" +.sp +.B void pcre32_free_substring(PCRE_SPTR32 \fIstringptr\fP); +.sp +.B void pcre32_free_substring_list(PCRE_SPTR32 *\fIstringptr\fP); +.fi +. +. +.SH "PCRE 32-BIT API AUXILIARY FUNCTIONS" +.rs +.sp +.nf +.B pcre32_jit_stack *pcre32_jit_stack_alloc(int \fIstartsize\fP, int \fImaxsize\fP); +.sp +.B void pcre32_jit_stack_free(pcre32_jit_stack *\fIstack\fP); +.sp +.B void pcre32_assign_jit_stack(pcre32_extra *\fIextra\fP, +.B " pcre32_jit_callback \fIcallback\fP, void *\fIdata\fP);" +.sp +.B const unsigned char *pcre32_maketables(void); +.sp +.B int pcre32_fullinfo(const pcre32 *\fIcode\fP, "const pcre32_extra *\fIextra\fP," +.B " int \fIwhat\fP, void *\fIwhere\fP);" +.sp +.B int pcre32_refcount(pcre32 *\fIcode\fP, int \fIadjust\fP); +.sp +.B int pcre32_config(int \fIwhat\fP, void *\fIwhere\fP); +.sp +.B const char *pcre32_version(void); +.sp +.B int pcre32_pattern_to_host_byte_order(pcre32 *\fIcode\fP, +.B " pcre32_extra *\fIextra\fP, const unsigned char *\fItables\fP);" +.fi +. +. +.SH "PCRE 32-BIT API INDIRECTED FUNCTIONS" +.rs +.sp +.nf +.B void *(*pcre32_malloc)(size_t); +.sp +.B void (*pcre32_free)(void *); +.sp +.B void *(*pcre32_stack_malloc)(size_t); +.sp +.B void (*pcre32_stack_free)(void *); +.sp +.B int (*pcre32_callout)(pcre32_callout_block *); +.fi +. +. +.SH "PCRE 32-BIT API 32-BIT-ONLY FUNCTION" +.rs +.sp +.nf +.B int pcre32_utf32_to_host_byte_order(PCRE_UCHAR32 *\fIoutput\fP, +.B " PCRE_SPTR32 \fIinput\fP, int \fIlength\fP, int *\fIbyte_order\fP," +.B " int \fIkeep_boms\fP);" +.fi +. +. +.SH "THE PCRE 32-BIT LIBRARY" +.rs +.sp +Starting with release 8.32, it is possible to compile a PCRE library that +supports 32-bit character strings, including UTF-32 strings, as well as or +instead of the original 8-bit library. This work was done by Christian Persch, +based on the work done by Zoltan Herczeg for the 16-bit library. All three +libraries contain identical sets of functions, used in exactly the same way. +Only the names of the functions and the data types of their arguments and +results are different. To avoid over-complication and reduce the documentation +maintenance load, most of the PCRE documentation describes the 8-bit library, +with only occasional references to the 16-bit and 32-bit libraries. This page +describes what is different when you use the 32-bit library. +.P +WARNING: A single application can be linked with all or any of the three +libraries, but you must take care when processing any particular pattern +to use functions from just one library. For example, if you want to study +a pattern that was compiled with \fBpcre32_compile()\fP, you must do so +with \fBpcre32_study()\fP, not \fBpcre_study()\fP, and you must free the +study data with \fBpcre32_free_study()\fP. +. +. +.SH "THE HEADER FILE" +.rs +.sp +There is only one header file, \fBpcre.h\fP. It contains prototypes for all the +functions in all libraries, as well as definitions of flags, structures, error +codes, etc. +. +. +.SH "THE LIBRARY NAME" +.rs +.sp +In Unix-like systems, the 32-bit library is called \fBlibpcre32\fP, and can +normally be accesss by adding \fB-lpcre32\fP to the command for linking an +application that uses PCRE. +. +. +.SH "STRING TYPES" +.rs +.sp +In the 8-bit library, strings are passed to PCRE library functions as vectors +of bytes with the C type "char *". In the 32-bit library, strings are passed as +vectors of unsigned 32-bit quantities. The macro PCRE_UCHAR32 specifies an +appropriate data type, and PCRE_SPTR32 is defined as "const PCRE_UCHAR32 *". In +very many environments, "unsigned int" is a 32-bit data type. When PCRE is +built, it defines PCRE_UCHAR32 as "unsigned int", but checks that it really is +a 32-bit data type. If it is not, the build fails with an error message telling +the maintainer to modify the definition appropriately. +. +. +.SH "STRUCTURE TYPES" +.rs +.sp +The types of the opaque structures that are used for compiled 32-bit patterns +and JIT stacks are \fBpcre32\fP and \fBpcre32_jit_stack\fP respectively. The +type of the user-accessible structure that is returned by \fBpcre32_study()\fP +is \fBpcre32_extra\fP, and the type of the structure that is used for passing +data to a callout function is \fBpcre32_callout_block\fP. These structures +contain the same fields, with the same names, as their 8-bit counterparts. The +only difference is that pointers to character strings are 32-bit instead of +8-bit types. +. +. +.SH "32-BIT FUNCTIONS" +.rs +.sp +For every function in the 8-bit library there is a corresponding function in +the 32-bit library with a name that starts with \fBpcre32_\fP instead of +\fBpcre_\fP. The prototypes are listed above. In addition, there is one extra +function, \fBpcre32_utf32_to_host_byte_order()\fP. This is a utility function +that converts a UTF-32 character string to host byte order if necessary. The +other 32-bit functions expect the strings they are passed to be in host byte +order. +.P +The \fIinput\fP and \fIoutput\fP arguments of +\fBpcre32_utf32_to_host_byte_order()\fP may point to the same address, that is, +conversion in place is supported. The output buffer must be at least as long as +the input. +.P +The \fIlength\fP argument specifies the number of 32-bit data units in the +input string; a negative value specifies a zero-terminated string. +.P +If \fIbyte_order\fP is NULL, it is assumed that the string starts off in host +byte order. This may be changed by byte-order marks (BOMs) anywhere in the +string (commonly as the first character). +.P +If \fIbyte_order\fP is not NULL, a non-zero value of the integer to which it +points means that the input starts off in host byte order, otherwise the +opposite order is assumed. Again, BOMs in the string can change this. The final +byte order is passed back at the end of processing. +.P +If \fIkeep_boms\fP is not zero, byte-order mark characters (0xfeff) are copied +into the output string. Otherwise they are discarded. +.P +The result of the function is the number of 32-bit units placed into the output +buffer, including the zero terminator if the string was zero-terminated. +. +. +.SH "SUBJECT STRING OFFSETS" +.rs +.sp +The lengths and starting offsets of subject strings must be specified in 32-bit +data units, and the offsets within subject strings that are returned by the +matching functions are in also 32-bit units rather than bytes. +. +. +.SH "NAMED SUBPATTERNS" +.rs +.sp +The name-to-number translation table that is maintained for named subpatterns +uses 32-bit characters. The \fBpcre32_get_stringtable_entries()\fP function +returns the length of each entry in the table as the number of 32-bit data +units. +. +. +.SH "OPTION NAMES" +.rs +.sp +There are two new general option names, PCRE_UTF32 and PCRE_NO_UTF32_CHECK, +which correspond to PCRE_UTF8 and PCRE_NO_UTF8_CHECK in the 8-bit library. In +fact, these new options define the same bits in the options word. There is a +discussion about the +.\" HTML +.\" +validity of UTF-32 strings +.\" +in the +.\" HREF +\fBpcreunicode\fP +.\" +page. +.P +For the \fBpcre32_config()\fP function there is an option PCRE_CONFIG_UTF32 +that returns 1 if UTF-32 support is configured, otherwise 0. If this option is +given to \fBpcre_config()\fP or \fBpcre16_config()\fP, or if the +PCRE_CONFIG_UTF8 or PCRE_CONFIG_UTF16 option is given to \fBpcre32_config()\fP, +the result is the PCRE_ERROR_BADOPTION error. +. +. +.SH "CHARACTER CODES" +.rs +.sp +In 32-bit mode, when PCRE_UTF32 is not set, character values are treated in the +same way as in 8-bit, non UTF-8 mode, except, of course, that they can range +from 0 to 0x7fffffff instead of 0 to 0xff. Character types for characters less +than 0xff can therefore be influenced by the locale in the same way as before. +Characters greater than 0xff have only one case, and no "type" (such as letter +or digit). +.P +In UTF-32 mode, the character code is Unicode, in the range 0 to 0x10ffff, with +the exception of values in the range 0xd800 to 0xdfff because those are +"surrogate" values that are ill-formed in UTF-32. +.P +A UTF-32 string can indicate its endianness by special code knows as a +byte-order mark (BOM). The PCRE functions do not handle this, expecting strings +to be in host byte order. A utility function called +\fBpcre32_utf32_to_host_byte_order()\fP is provided to help with this (see +above). +. +. +.SH "ERROR NAMES" +.rs +.sp +The error PCRE_ERROR_BADUTF32 corresponds to its 8-bit counterpart. +The error PCRE_ERROR_BADMODE is given when a compiled +pattern is passed to a function that processes patterns in the other +mode, for example, if a pattern compiled with \fBpcre_compile()\fP is passed to +\fBpcre32_exec()\fP. +.P +There are new error codes whose names begin with PCRE_UTF32_ERR for invalid +UTF-32 strings, corresponding to the PCRE_UTF8_ERR codes for UTF-8 strings that +are described in the section entitled +.\" HTML +.\" +"Reason codes for invalid UTF-8 strings" +.\" +in the main +.\" HREF +\fBpcreapi\fP +.\" +page. The UTF-32 errors are: +.sp + PCRE_UTF32_ERR1 Surrogate character (range from 0xd800 to 0xdfff) + PCRE_UTF32_ERR2 Non-character + PCRE_UTF32_ERR3 Character > 0x10ffff +. +. +.SH "ERROR TEXTS" +.rs +.sp +If there is an error while compiling a pattern, the error text that is passed +back by \fBpcre32_compile()\fP or \fBpcre32_compile2()\fP is still an 8-bit +character string, zero-terminated. +. +. +.SH "CALLOUTS" +.rs +.sp +The \fIsubject\fP and \fImark\fP fields in the callout block that is passed to +a callout function point to 32-bit vectors. +. +. +.SH "TESTING" +.rs +.sp +The \fBpcretest\fP program continues to operate with 8-bit input and output +files, but it can be used for testing the 32-bit library. If it is run with the +command line option \fB-32\fP, patterns and subject strings are converted from +8-bit to 32-bit before being passed to PCRE, and the 32-bit library functions +are used instead of the 8-bit ones. Returned 32-bit strings are converted to +8-bit for output. If both the 8-bit and the 16-bit libraries were not compiled, +\fBpcretest\fP defaults to 32-bit and the \fB-32\fP option is ignored. +.P +When PCRE is being built, the \fBRunTest\fP script that is called by "make +check" uses the \fBpcretest\fP \fB-C\fP option to discover which of the 8-bit, +16-bit and 32-bit libraries has been built, and runs the tests appropriately. +. +. +.SH "NOT SUPPORTED IN 32-BIT MODE" +.rs +.sp +Not all the features of the 8-bit library are available with the 32-bit +library. The C++ and POSIX wrapper functions support only the 8-bit library, +and the \fBpcregrep\fP program is at present 8-bit only. +. +. +.SH AUTHOR +.rs +.sp +.nf +Philip Hazel +University Computing Service +Cambridge CB2 3QH, England. +.fi +. +. +.SH REVISION +.rs +.sp +.nf +Last updated: 12 May 2013 +Copyright (c) 1997-2013 University of Cambridge. +.fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_assign_jit_stack.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_assign_jit_stack.3 new file mode 100644 index 0000000000000000000000000000000000000000..0ecf6f2c60f7531e6ab814e3f1dde737163b6f46 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_assign_jit_stack.3 @@ -0,0 +1,59 @@ +.TH PCRE_ASSIGN_JIT_STACK 3 "24 June 2012" "PCRE 8.30" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.nf +.B void pcre_assign_jit_stack(pcre_extra *\fIextra\fP, +.B " pcre_jit_callback \fIcallback\fP, void *\fIdata\fP);" +.sp +.B void pcre16_assign_jit_stack(pcre16_extra *\fIextra\fP, +.B " pcre16_jit_callback \fIcallback\fP, void *\fIdata\fP);" +.sp +.B void pcre32_assign_jit_stack(pcre32_extra *\fIextra\fP, +.B " pcre32_jit_callback \fIcallback\fP, void *\fIdata\fP);" +.fi +. +.SH DESCRIPTION +.rs +.sp +This function provides control over the memory used as a stack at run-time by a +call to \fBpcre[16|32]_exec()\fP with a pattern that has been successfully +compiled with JIT optimization. The arguments are: +.sp + extra the data pointer returned by \fBpcre[16|32]_study()\fP + callback a callback function + data a JIT stack or a value to be passed to the callback + function +.P +If \fIcallback\fP is NULL and \fIdata\fP is NULL, an internal 32K block on +the machine stack is used. +.P +If \fIcallback\fP is NULL and \fIdata\fP is not NULL, \fIdata\fP must +be a valid JIT stack, the result of calling \fBpcre[16|32]_jit_stack_alloc()\fP. +.P +If \fIcallback\fP not NULL, it is called with \fIdata\fP as an argument at +the start of matching, in order to set up a JIT stack. If the result is NULL, +the internal 32K stack is used; otherwise the return value must be a valid JIT +stack, the result of calling \fBpcre[16|32]_jit_stack_alloc()\fP. +.P +You may safely assign the same JIT stack to multiple patterns, as long as they +are all matched in the same thread. In a multithread application, each thread +must use its own JIT stack. For more details, see the +.\" HREF +\fBpcrejit\fP +.\" +page. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_compile.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_compile.3 new file mode 100644 index 0000000000000000000000000000000000000000..5c16ebe26d56e8b7807a22fba9762689aa7f3376 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_compile.3 @@ -0,0 +1,96 @@ +.TH PCRE_COMPILE 3 "01 October 2013" "PCRE 8.34" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.nf +.B pcre *pcre_compile(const char *\fIpattern\fP, int \fIoptions\fP, +.B " const char **\fIerrptr\fP, int *\fIerroffset\fP," +.B " const unsigned char *\fItableptr\fP);" +.sp +.B pcre16 *pcre16_compile(PCRE_SPTR16 \fIpattern\fP, int \fIoptions\fP, +.B " const char **\fIerrptr\fP, int *\fIerroffset\fP," +.B " const unsigned char *\fItableptr\fP);" +.sp +.B pcre32 *pcre32_compile(PCRE_SPTR32 \fIpattern\fP, int \fIoptions\fP, +.B " const char **\fIerrptr\fP, int *\fIerroffset\fP," +.B " const unsigned char *\fItableptr\fP);" +.fi +. +.SH DESCRIPTION +.rs +.sp +This function compiles a regular expression into an internal form. It is the +same as \fBpcre[16|32]_compile2()\fP, except for the absence of the +\fIerrorcodeptr\fP argument. Its arguments are: +.sp + \fIpattern\fP A zero-terminated string containing the + regular expression to be compiled + \fIoptions\fP Zero or more option bits + \fIerrptr\fP Where to put an error message + \fIerroffset\fP Offset in pattern where error was found + \fItableptr\fP Pointer to character tables, or NULL to + use the built-in default +.sp +The option bits are: +.sp + PCRE_ANCHORED Force pattern anchoring + PCRE_AUTO_CALLOUT Compile automatic callouts + PCRE_BSR_ANYCRLF \eR matches only CR, LF, or CRLF + PCRE_BSR_UNICODE \eR matches all Unicode line endings + PCRE_CASELESS Do caseless matching + PCRE_DOLLAR_ENDONLY $ not to match newline at end + PCRE_DOTALL . matches anything including NL + PCRE_DUPNAMES Allow duplicate names for subpatterns + PCRE_EXTENDED Ignore white space and # comments + PCRE_EXTRA PCRE extra features + (not much use currently) + PCRE_FIRSTLINE Force matching to be before newline + PCRE_JAVASCRIPT_COMPAT JavaScript compatibility + PCRE_MULTILINE ^ and $ match newlines within data + PCRE_NEVER_UTF Lock out UTF, e.g. via (*UTF) + PCRE_NEWLINE_ANY Recognize any Unicode newline sequence + PCRE_NEWLINE_ANYCRLF Recognize CR, LF, and CRLF as newline + sequences + PCRE_NEWLINE_CR Set CR as the newline sequence + PCRE_NEWLINE_CRLF Set CRLF as the newline sequence + PCRE_NEWLINE_LF Set LF as the newline sequence + PCRE_NO_AUTO_CAPTURE Disable numbered capturing paren- + theses (named ones available) + PCRE_NO_AUTO_POSSESS Disable auto-possessification + PCRE_NO_START_OPTIMIZE Disable match-time start optimizations + PCRE_NO_UTF16_CHECK Do not check the pattern for UTF-16 + validity (only relevant if + PCRE_UTF16 is set) + PCRE_NO_UTF32_CHECK Do not check the pattern for UTF-32 + validity (only relevant if + PCRE_UTF32 is set) + PCRE_NO_UTF8_CHECK Do not check the pattern for UTF-8 + validity (only relevant if + PCRE_UTF8 is set) + PCRE_UCP Use Unicode properties for \ed, \ew, etc. + PCRE_UNGREEDY Invert greediness of quantifiers + PCRE_UTF16 Run in \fBpcre16_compile()\fP UTF-16 mode + PCRE_UTF32 Run in \fBpcre32_compile()\fP UTF-32 mode + PCRE_UTF8 Run in \fBpcre_compile()\fP UTF-8 mode +.sp +PCRE must be built with UTF support in order to use PCRE_UTF8/16/32 and +PCRE_NO_UTF8/16/32_CHECK, and with UCP support if PCRE_UCP is used. +.P +The yield of the function is a pointer to a private data structure that +contains the compiled pattern, or NULL if an error was detected. Note that +compiling regular expressions with one version of PCRE for use with a different +version is not guaranteed to work and may cause crashes. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_compile2.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_compile2.3 new file mode 100644 index 0000000000000000000000000000000000000000..377420180e9b75d5f799b0a24e8ef8928b982d95 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_compile2.3 @@ -0,0 +1,101 @@ +.TH PCRE_COMPILE2 3 "01 October 2013" "PCRE 8.34" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.nf +.B pcre *pcre_compile2(const char *\fIpattern\fP, int \fIoptions\fP, +.B " int *\fIerrorcodeptr\fP," +.B " const char **\fIerrptr\fP, int *\fIerroffset\fP," +.B " const unsigned char *\fItableptr\fP);" +.sp +.B pcre16 *pcre16_compile2(PCRE_SPTR16 \fIpattern\fP, int \fIoptions\fP, +.B " int *\fIerrorcodeptr\fP," +.B " const char **\fIerrptr\fP, int *\fIerroffset\fP," +.B " const unsigned char *\fItableptr\fP);" +.sp +.B pcre32 *pcre32_compile2(PCRE_SPTR32 \fIpattern\fP, int \fIoptions\fP, +.B " int *\fIerrorcodeptr\fP,£ +.B " const char **\fIerrptr\fP, int *\fIerroffset\fP," +.B " const unsigned char *\fItableptr\fP);" +.fi +. +.SH DESCRIPTION +.rs +.sp +This function compiles a regular expression into an internal form. It is the +same as \fBpcre[16|32]_compile()\fP, except for the addition of the +\fIerrorcodeptr\fP argument. The arguments are: +. +.sp + \fIpattern\fP A zero-terminated string containing the + regular expression to be compiled + \fIoptions\fP Zero or more option bits + \fIerrorcodeptr\fP Where to put an error code + \fIerrptr\fP Where to put an error message + \fIerroffset\fP Offset in pattern where error was found + \fItableptr\fP Pointer to character tables, or NULL to + use the built-in default +.sp +The option bits are: +.sp + PCRE_ANCHORED Force pattern anchoring + PCRE_AUTO_CALLOUT Compile automatic callouts + PCRE_BSR_ANYCRLF \eR matches only CR, LF, or CRLF + PCRE_BSR_UNICODE \eR matches all Unicode line endings + PCRE_CASELESS Do caseless matching + PCRE_DOLLAR_ENDONLY $ not to match newline at end + PCRE_DOTALL . matches anything including NL + PCRE_DUPNAMES Allow duplicate names for subpatterns + PCRE_EXTENDED Ignore white space and # comments + PCRE_EXTRA PCRE extra features + (not much use currently) + PCRE_FIRSTLINE Force matching to be before newline + PCRE_JAVASCRIPT_COMPAT JavaScript compatibility + PCRE_MULTILINE ^ and $ match newlines within data + PCRE_NEVER_UTF Lock out UTF, e.g. via (*UTF) + PCRE_NEWLINE_ANY Recognize any Unicode newline sequence + PCRE_NEWLINE_ANYCRLF Recognize CR, LF, and CRLF as newline + sequences + PCRE_NEWLINE_CR Set CR as the newline sequence + PCRE_NEWLINE_CRLF Set CRLF as the newline sequence + PCRE_NEWLINE_LF Set LF as the newline sequence + PCRE_NO_AUTO_CAPTURE Disable numbered capturing paren- + theses (named ones available) + PCRE_NO_AUTO_POSSESS Disable auto-possessification + PCRE_NO_START_OPTIMIZE Disable match-time start optimizations + PCRE_NO_UTF16_CHECK Do not check the pattern for UTF-16 + validity (only relevant if + PCRE_UTF16 is set) + PCRE_NO_UTF32_CHECK Do not check the pattern for UTF-32 + validity (only relevant if + PCRE_UTF32 is set) + PCRE_NO_UTF8_CHECK Do not check the pattern for UTF-8 + validity (only relevant if + PCRE_UTF8 is set) + PCRE_UCP Use Unicode properties for \ed, \ew, etc. + PCRE_UNGREEDY Invert greediness of quantifiers + PCRE_UTF16 Run \fBpcre16_compile()\fP in UTF-16 mode + PCRE_UTF32 Run \fBpcre32_compile()\fP in UTF-32 mode + PCRE_UTF8 Run \fBpcre_compile()\fP in UTF-8 mode +.sp +PCRE must be built with UTF support in order to use PCRE_UTF8/16/32 and +PCRE_NO_UTF8/16/32_CHECK, and with UCP support if PCRE_UCP is used. +.P +The yield of the function is a pointer to a private data structure that +contains the compiled pattern, or NULL if an error was detected. Note that +compiling regular expressions with one version of PCRE for use with a different +version is not guaranteed to work and may cause crashes. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_config.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_config.3 new file mode 100644 index 0000000000000000000000000000000000000000..d14ffdadeb18060f4b6c4fe07e7a46028587eefc --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_config.3 @@ -0,0 +1,79 @@ +.TH PCRE_CONFIG 3 "20 April 2014" "PCRE 8.36" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.B int pcre_config(int \fIwhat\fP, void *\fIwhere\fP); +.PP +.B int pcre16_config(int \fIwhat\fP, void *\fIwhere\fP); +.PP +.B int pcre32_config(int \fIwhat\fP, void *\fIwhere\fP); +. +.SH DESCRIPTION +.rs +.sp +This function makes it possible for a client program to find out which optional +features are available in the version of the PCRE library it is using. The +arguments are as follows: +.sp + \fIwhat\fP A code specifying what information is required + \fIwhere\fP Points to where to put the data +.sp +The \fIwhere\fP argument must point to an integer variable, except for +PCRE_CONFIG_MATCH_LIMIT, PCRE_CONFIG_MATCH_LIMIT_RECURSION, and +PCRE_CONFIG_PARENS_LIMIT, when it must point to an unsigned long integer, +and for PCRE_CONFIG_JITTARGET, when it must point to a const char*. +The available codes are: +.sp + PCRE_CONFIG_JIT Availability of just-in-time compiler + support (1=yes 0=no) + PCRE_CONFIG_JITTARGET String containing information about the + target architecture for the JIT compiler, + or NULL if there is no JIT support + PCRE_CONFIG_LINK_SIZE Internal link size: 2, 3, or 4 + PCRE_CONFIG_PARENS_LIMIT Parentheses nesting limit + PCRE_CONFIG_MATCH_LIMIT Internal resource limit + PCRE_CONFIG_MATCH_LIMIT_RECURSION + Internal recursion depth limit + PCRE_CONFIG_NEWLINE Value of the default newline sequence: + 13 (0x000d) for CR + 10 (0x000a) for LF + 3338 (0x0d0a) for CRLF + -2 for ANYCRLF + -1 for ANY + PCRE_CONFIG_BSR Indicates what \eR matches by default: + 0 all Unicode line endings + 1 CR, LF, or CRLF only + PCRE_CONFIG_POSIX_MALLOC_THRESHOLD + Threshold of return slots, above which + \fBmalloc()\fP is used by the POSIX API + PCRE_CONFIG_STACKRECURSE Recursion implementation (1=stack 0=heap) + PCRE_CONFIG_UTF16 Availability of UTF-16 support (1=yes + 0=no); option for \fBpcre16_config()\fP + PCRE_CONFIG_UTF32 Availability of UTF-32 support (1=yes + 0=no); option for \fBpcre32_config()\fP + PCRE_CONFIG_UTF8 Availability of UTF-8 support (1=yes 0=no); + option for \fBpcre_config()\fP + PCRE_CONFIG_UNICODE_PROPERTIES + Availability of Unicode property support + (1=yes 0=no) +.sp +The function yields 0 on success or PCRE_ERROR_BADOPTION otherwise. That error +is also given if PCRE_CONFIG_UTF16 or PCRE_CONFIG_UTF32 is passed to +\fBpcre_config()\fP, if PCRE_CONFIG_UTF8 or PCRE_CONFIG_UTF32 is passed to +\fBpcre16_config()\fP, or if PCRE_CONFIG_UTF8 or PCRE_CONFIG_UTF16 is passed to +\fBpcre32_config()\fP. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_copy_named_substring.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_copy_named_substring.3 new file mode 100644 index 0000000000000000000000000000000000000000..52582aecb2b85788aa08f84bc23c3e2fa0415eb3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_copy_named_substring.3 @@ -0,0 +1,51 @@ +.TH PCRE_COPY_NAMED_SUBSTRING 3 "24 June 2012" "PCRE 8.30" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.nf +.B int pcre_copy_named_substring(const pcre *\fIcode\fP, +.B " const char *\fIsubject\fP, int *\fIovector\fP," +.B " int \fIstringcount\fP, const char *\fIstringname\fP," +.B " char *\fIbuffer\fP, int \fIbuffersize\fP);" +.sp +.B int pcre16_copy_named_substring(const pcre16 *\fIcode\fP, +.B " PCRE_SPTR16 \fIsubject\fP, int *\fIovector\fP," +.B " int \fIstringcount\fP, PCRE_SPTR16 \fIstringname\fP," +.B " PCRE_UCHAR16 *\fIbuffer\fP, int \fIbuffersize\fP);" +.sp +.B int pcre32_copy_named_substring(const pcre32 *\fIcode\fP, +.B " PCRE_SPTR32 \fIsubject\fP, int *\fIovector\fP," +.B " int \fIstringcount\fP, PCRE_SPTR32 \fIstringname\fP," +.B " PCRE_UCHAR32 *\fIbuffer\fP, int \fIbuffersize\fP);" +.fi +. +.SH DESCRIPTION +.rs +.sp +This is a convenience function for extracting a captured substring, identified +by name, into a given buffer. The arguments are: +.sp + \fIcode\fP Pattern that was successfully matched + \fIsubject\fP Subject that has been successfully matched + \fIovector\fP Offset vector that \fBpcre[16|32]_exec()\fP used + \fIstringcount\fP Value returned by \fBpcre[16|32]_exec()\fP + \fIstringname\fP Name of the required substring + \fIbuffer\fP Buffer to receive the string + \fIbuffersize\fP Size of buffer +.sp +The yield is the length of the substring, PCRE_ERROR_NOMEMORY if the buffer was +too small, or PCRE_ERROR_NOSUBSTRING if the string name is invalid. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_copy_substring.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_copy_substring.3 new file mode 100644 index 0000000000000000000000000000000000000000..83af6e800afd56ecb12ee41272bb016e51da1254 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_copy_substring.3 @@ -0,0 +1,47 @@ +.TH PCRE_COPY_SUBSTRING 3 "24 June 2012" "PCRE 8.30" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.nf +.B int pcre_copy_substring(const char *\fIsubject\fP, int *\fIovector\fP, +.B " int \fIstringcount\fP, int \fIstringnumber\fP, char *\fIbuffer\fP," +.B " int \fIbuffersize\fP);" +.sp +.B int pcre16_copy_substring(PCRE_SPTR16 \fIsubject\fP, int *\fIovector\fP, +.B " int \fIstringcount\fP, int \fIstringnumber\fP, PCRE_UCHAR16 *\fIbuffer\fP," +.B " int \fIbuffersize\fP);" +.sp +.B int pcre32_copy_substring(PCRE_SPTR32 \fIsubject\fP, int *\fIovector\fP, +.B " int \fIstringcount\fP, int \fIstringnumber\fP, PCRE_UCHAR32 *\fIbuffer\fP," +.B " int \fIbuffersize\fP);" +.fi +. +.SH DESCRIPTION +.rs +.sp +This is a convenience function for extracting a captured substring into a given +buffer. The arguments are: +.sp + \fIsubject\fP Subject that has been successfully matched + \fIovector\fP Offset vector that \fBpcre[16|32]_exec()\fP used + \fIstringcount\fP Value returned by \fBpcre[16|32]_exec()\fP + \fIstringnumber\fP Number of the required substring + \fIbuffer\fP Buffer to receive the string + \fIbuffersize\fP Size of buffer +.sp +The yield is the length of the string, PCRE_ERROR_NOMEMORY if the buffer was +too small, or PCRE_ERROR_NOSUBSTRING if the string number is invalid. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_dfa_exec.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_dfa_exec.3 new file mode 100644 index 0000000000000000000000000000000000000000..39c2e836dac49decd1c93e11873527d39f82cac3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_dfa_exec.3 @@ -0,0 +1,118 @@ +.TH PCRE_DFA_EXEC 3 "12 May 2013" "PCRE 8.33" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.nf +.B int pcre_dfa_exec(const pcre *\fIcode\fP, "const pcre_extra *\fIextra\fP," +.B " const char *\fIsubject\fP, int \fIlength\fP, int \fIstartoffset\fP," +.B " int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP," +.B " int *\fIworkspace\fP, int \fIwscount\fP);" +.sp +.B int pcre16_dfa_exec(const pcre16 *\fIcode\fP, "const pcre16_extra *\fIextra\fP," +.B " PCRE_SPTR16 \fIsubject\fP, int \fIlength\fP, int \fIstartoffset\fP," +.B " int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP," +.B " int *\fIworkspace\fP, int \fIwscount\fP);" +.sp +.B int pcre32_dfa_exec(const pcre32 *\fIcode\fP, "const pcre32_extra *\fIextra\fP," +.B " PCRE_SPTR32 \fIsubject\fP, int \fIlength\fP, int \fIstartoffset\fP," +.B " int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP," +.B " int *\fIworkspace\fP, int \fIwscount\fP);" +.fi +. +.SH DESCRIPTION +.rs +.sp +This function matches a compiled regular expression against a given subject +string, using an alternative matching algorithm that scans the subject string +just once (\fInot\fP Perl-compatible). Note that the main, Perl-compatible, +matching function is \fBpcre[16|32]_exec()\fP. The arguments for this function +are: +.sp + \fIcode\fP Points to the compiled pattern + \fIextra\fP Points to an associated \fBpcre[16|32]_extra\fP structure, + or is NULL + \fIsubject\fP Points to the subject string + \fIlength\fP Length of the subject string + \fIstartoffset\fP Offset in the subject at which to start matching + \fIoptions\fP Option bits + \fIovector\fP Points to a vector of ints for result offsets + \fIovecsize\fP Number of elements in the vector + \fIworkspace\fP Points to a vector of ints used as working space + \fIwscount\fP Number of elements in the vector +.sp +The units for \fIlength\fP and \fIstartoffset\fP are bytes for +\fBpcre_exec()\fP, 16-bit data items for \fBpcre16_exec()\fP, and 32-bit items +for \fBpcre32_exec()\fP. The options are: +.sp + PCRE_ANCHORED Match only at the first position + PCRE_BSR_ANYCRLF \eR matches only CR, LF, or CRLF + PCRE_BSR_UNICODE \eR matches all Unicode line endings + PCRE_NEWLINE_ANY Recognize any Unicode newline sequence + PCRE_NEWLINE_ANYCRLF Recognize CR, LF, & CRLF as newline sequences + PCRE_NEWLINE_CR Recognize CR as the only newline sequence + PCRE_NEWLINE_CRLF Recognize CRLF as the only newline sequence + PCRE_NEWLINE_LF Recognize LF as the only newline sequence + PCRE_NOTBOL Subject is not the beginning of a line + PCRE_NOTEOL Subject is not the end of a line + PCRE_NOTEMPTY An empty string is not a valid match + PCRE_NOTEMPTY_ATSTART An empty string at the start of the subject + is not a valid match + PCRE_NO_START_OPTIMIZE Do not do "start-match" optimizations + PCRE_NO_UTF16_CHECK Do not check the subject for UTF-16 + validity (only relevant if PCRE_UTF16 + was set at compile time) + PCRE_NO_UTF32_CHECK Do not check the subject for UTF-32 + validity (only relevant if PCRE_UTF32 + was set at compile time) + PCRE_NO_UTF8_CHECK Do not check the subject for UTF-8 + validity (only relevant if PCRE_UTF8 + was set at compile time) + PCRE_PARTIAL ) Return PCRE_ERROR_PARTIAL for a partial + PCRE_PARTIAL_SOFT ) match if no full matches are found + PCRE_PARTIAL_HARD Return PCRE_ERROR_PARTIAL for a partial match + even if there is a full match as well + PCRE_DFA_SHORTEST Return only the shortest match + PCRE_DFA_RESTART Restart after a partial match +.sp +There are restrictions on what may appear in a pattern when using this matching +function. Details are given in the +.\" HREF +\fBpcrematching\fP +.\" +documentation. For details of partial matching, see the +.\" HREF +\fBpcrepartial\fP +.\" +page. +.P +A \fBpcre[16|32]_extra\fP structure contains the following fields: +.sp + \fIflags\fP Bits indicating which fields are set + \fIstudy_data\fP Opaque data from \fBpcre[16|32]_study()\fP + \fImatch_limit\fP Limit on internal resource use + \fImatch_limit_recursion\fP Limit on internal recursion depth + \fIcallout_data\fP Opaque data passed back to callouts + \fItables\fP Points to character tables or is NULL + \fImark\fP For passing back a *MARK pointer + \fIexecutable_jit\fP Opaque data from JIT compilation +.sp +The flag bits are PCRE_EXTRA_STUDY_DATA, PCRE_EXTRA_MATCH_LIMIT, +PCRE_EXTRA_MATCH_LIMIT_RECURSION, PCRE_EXTRA_CALLOUT_DATA, +PCRE_EXTRA_TABLES, PCRE_EXTRA_MARK and PCRE_EXTRA_EXECUTABLE_JIT. For this +matching function, the \fImatch_limit\fP and \fImatch_limit_recursion\fP fields +are not used, and must not be set. The PCRE_EXTRA_EXECUTABLE_JIT flag and +the corresponding variable are ignored. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_exec.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_exec.3 new file mode 100644 index 0000000000000000000000000000000000000000..4686bd6de063b017387abc625bf8af231e30d4b4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_exec.3 @@ -0,0 +1,99 @@ +.TH PCRE_EXEC 3 "12 May 2013" "PCRE 8.33" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.nf +.B int pcre_exec(const pcre *\fIcode\fP, "const pcre_extra *\fIextra\fP," +.B " const char *\fIsubject\fP, int \fIlength\fP, int \fIstartoffset\fP," +.B " int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP);" +.sp +.B int pcre16_exec(const pcre16 *\fIcode\fP, "const pcre16_extra *\fIextra\fP," +.B " PCRE_SPTR16 \fIsubject\fP, int \fIlength\fP, int \fIstartoffset\fP," +.B " int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP);" +.sp +.B int pcre32_exec(const pcre32 *\fIcode\fP, "const pcre32_extra *\fIextra\fP," +.B " PCRE_SPTR32 \fIsubject\fP, int \fIlength\fP, int \fIstartoffset\fP," +.B " int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP);" +.fi +. +.SH DESCRIPTION +.rs +.sp +This function matches a compiled regular expression against a given subject +string, using a matching algorithm that is similar to Perl's. It returns +offsets to captured substrings. Its arguments are: +.sp + \fIcode\fP Points to the compiled pattern + \fIextra\fP Points to an associated \fBpcre[16|32]_extra\fP structure, + or is NULL + \fIsubject\fP Points to the subject string + \fIlength\fP Length of the subject string + \fIstartoffset\fP Offset in the subject at which to start matching + \fIoptions\fP Option bits + \fIovector\fP Points to a vector of ints for result offsets + \fIovecsize\fP Number of elements in the vector (a multiple of 3) +.sp +The units for \fIlength\fP and \fIstartoffset\fP are bytes for +\fBpcre_exec()\fP, 16-bit data items for \fBpcre16_exec()\fP, and 32-bit items +for \fBpcre32_exec()\fP. The options are: +.sp + PCRE_ANCHORED Match only at the first position + PCRE_BSR_ANYCRLF \eR matches only CR, LF, or CRLF + PCRE_BSR_UNICODE \eR matches all Unicode line endings + PCRE_NEWLINE_ANY Recognize any Unicode newline sequence + PCRE_NEWLINE_ANYCRLF Recognize CR, LF, & CRLF as newline sequences + PCRE_NEWLINE_CR Recognize CR as the only newline sequence + PCRE_NEWLINE_CRLF Recognize CRLF as the only newline sequence + PCRE_NEWLINE_LF Recognize LF as the only newline sequence + PCRE_NOTBOL Subject string is not the beginning of a line + PCRE_NOTEOL Subject string is not the end of a line + PCRE_NOTEMPTY An empty string is not a valid match + PCRE_NOTEMPTY_ATSTART An empty string at the start of the subject + is not a valid match + PCRE_NO_START_OPTIMIZE Do not do "start-match" optimizations + PCRE_NO_UTF16_CHECK Do not check the subject for UTF-16 + validity (only relevant if PCRE_UTF16 + was set at compile time) + PCRE_NO_UTF32_CHECK Do not check the subject for UTF-32 + validity (only relevant if PCRE_UTF32 + was set at compile time) + PCRE_NO_UTF8_CHECK Do not check the subject for UTF-8 + validity (only relevant if PCRE_UTF8 + was set at compile time) + PCRE_PARTIAL ) Return PCRE_ERROR_PARTIAL for a partial + PCRE_PARTIAL_SOFT ) match if no full matches are found + PCRE_PARTIAL_HARD Return PCRE_ERROR_PARTIAL for a partial match + if that is found before a full match +.sp +For details of partial matching, see the +.\" HREF +\fBpcrepartial\fP +.\" +page. A \fBpcre_extra\fP structure contains the following fields: +.sp + \fIflags\fP Bits indicating which fields are set + \fIstudy_data\fP Opaque data from \fBpcre[16|32]_study()\fP + \fImatch_limit\fP Limit on internal resource use + \fImatch_limit_recursion\fP Limit on internal recursion depth + \fIcallout_data\fP Opaque data passed back to callouts + \fItables\fP Points to character tables or is NULL + \fImark\fP For passing back a *MARK pointer + \fIexecutable_jit\fP Opaque data from JIT compilation +.sp +The flag bits are PCRE_EXTRA_STUDY_DATA, PCRE_EXTRA_MATCH_LIMIT, +PCRE_EXTRA_MATCH_LIMIT_RECURSION, PCRE_EXTRA_CALLOUT_DATA, +PCRE_EXTRA_TABLES, PCRE_EXTRA_MARK and PCRE_EXTRA_EXECUTABLE_JIT. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_free_study.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_free_study.3 new file mode 100644 index 0000000000000000000000000000000000000000..8826b73597bc574a66288f779c51551615cb880b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_free_study.3 @@ -0,0 +1,31 @@ +.TH PCRE_FREE_STUDY 3 "24 June 2012" "PCRE 8.30" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.B void pcre_free_study(pcre_extra *\fIextra\fP); +.PP +.B void pcre16_free_study(pcre16_extra *\fIextra\fP); +.PP +.B void pcre32_free_study(pcre32_extra *\fIextra\fP); +. +.SH DESCRIPTION +.rs +.sp +This function is used to free the memory used for the data generated by a call +to \fBpcre[16|32]_study()\fP when it is no longer needed. The argument must be the +result of such a call. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_free_substring.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_free_substring.3 new file mode 100644 index 0000000000000000000000000000000000000000..88c04019f400e3ec320d55d950b5f8936dea518c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_free_substring.3 @@ -0,0 +1,31 @@ +.TH PCRE_FREE_SUBSTRING 3 "24 June 2012" "PCRE 8.30" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.B void pcre_free_substring(const char *\fIstringptr\fP); +.PP +.B void pcre16_free_substring(PCRE_SPTR16 \fIstringptr\fP); +.PP +.B void pcre32_free_substring(PCRE_SPTR32 \fIstringptr\fP); +. +.SH DESCRIPTION +.rs +.sp +This is a convenience function for freeing the store obtained by a previous +call to \fBpcre[16|32]_get_substring()\fP or \fBpcre[16|32]_get_named_substring()\fP. +Its only argument is a pointer to the string. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_free_substring_list.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_free_substring_list.3 new file mode 100644 index 0000000000000000000000000000000000000000..248b4bd01b97c19a955a4542afe04e0aceb71d34 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_free_substring_list.3 @@ -0,0 +1,31 @@ +.TH PCRE_FREE_SUBSTRING_LIST 3 "24 June 2012" "PCRE 8.30" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.B void pcre_free_substring_list(const char **\fIstringptr\fP); +.PP +.B void pcre16_free_substring_list(PCRE_SPTR16 *\fIstringptr\fP); +.PP +.B void pcre32_free_substring_list(PCRE_SPTR32 *\fIstringptr\fP); +. +.SH DESCRIPTION +.rs +.sp +This is a convenience function for freeing the store obtained by a previous +call to \fBpcre[16|32]_get_substring_list()\fP. Its only argument is a pointer to +the list of string pointers. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_fullinfo.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_fullinfo.3 new file mode 100644 index 0000000000000000000000000000000000000000..c9b2c656da5acd16d12d98083eb89d01f97bf386 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_fullinfo.3 @@ -0,0 +1,103 @@ +.TH PCRE_FULLINFO 3 "21 April 2014" "PCRE 8.36" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.nf +.B int pcre_fullinfo(const pcre *\fIcode\fP, "const pcre_extra *\fIextra\fP," +.B " int \fIwhat\fP, void *\fIwhere\fP);" +.sp +.B int pcre16_fullinfo(const pcre16 *\fIcode\fP, "const pcre16_extra *\fIextra\fP," +.B " int \fIwhat\fP, void *\fIwhere\fP);" +.sp +.B int pcre32_fullinfo(const pcre32 *\fIcode\fP, "const pcre32_extra *\fIextra\fP," +.B " int \fIwhat\fP, void *\fIwhere\fP);" +.fi +. +.SH DESCRIPTION +.rs +.sp +This function returns information about a compiled pattern. Its arguments are: +.sp + \fIcode\fP Compiled regular expression + \fIextra\fP Result of \fBpcre[16|32]_study()\fP or NULL + \fIwhat\fP What information is required + \fIwhere\fP Where to put the information +.sp +The following information is available: +.sp + PCRE_INFO_BACKREFMAX Number of highest back reference + PCRE_INFO_CAPTURECOUNT Number of capturing subpatterns + PCRE_INFO_DEFAULT_TABLES Pointer to default tables + PCRE_INFO_FIRSTBYTE Fixed first data unit for a match, or + -1 for start of string + or after newline, or + -2 otherwise + PCRE_INFO_FIRSTTABLE Table of first data units (after studying) + PCRE_INFO_HASCRORLF Return 1 if explicit CR or LF matches exist + PCRE_INFO_JCHANGED Return 1 if (?J) or (?-J) was used + PCRE_INFO_JIT Return 1 after successful JIT compilation + PCRE_INFO_JITSIZE Size of JIT compiled code + PCRE_INFO_LASTLITERAL Literal last data unit required + PCRE_INFO_MINLENGTH Lower bound length of matching strings + PCRE_INFO_MATCHEMPTY Return 1 if the pattern can match an empty string, + 0 otherwise + PCRE_INFO_MATCHLIMIT Match limit if set, otherwise PCRE_RROR_UNSET + PCRE_INFO_MAXLOOKBEHIND Length (in characters) of the longest lookbehind assertion + PCRE_INFO_NAMECOUNT Number of named subpatterns + PCRE_INFO_NAMEENTRYSIZE Size of name table entry + PCRE_INFO_NAMETABLE Pointer to name table + PCRE_INFO_OKPARTIAL Return 1 if partial matching can be tried + (always returns 1 after release 8.00) + PCRE_INFO_OPTIONS Option bits used for compilation + PCRE_INFO_SIZE Size of compiled pattern + PCRE_INFO_STUDYSIZE Size of study data + PCRE_INFO_FIRSTCHARACTER Fixed first data unit for a match + PCRE_INFO_FIRSTCHARACTERFLAGS Returns + 1 if there is a first data character set, which can + then be retrieved using PCRE_INFO_FIRSTCHARACTER, + 2 if the first character is at the start of the data + string or after a newline, and + 0 otherwise + PCRE_INFO_RECURSIONLIMIT Recursion limit if set, otherwise PCRE_ERROR_UNSET + PCRE_INFO_REQUIREDCHAR Literal last data unit required + PCRE_INFO_REQUIREDCHARFLAGS Returns 1 if the last data character is set (which can then + be retrieved using PCRE_INFO_REQUIREDCHAR); 0 otherwise +.sp +The \fIwhere\fP argument must point to an integer variable, except for the +following \fIwhat\fP values: +.sp + PCRE_INFO_DEFAULT_TABLES const uint8_t * + PCRE_INFO_FIRSTCHARACTER uint32_t + PCRE_INFO_FIRSTTABLE const uint8_t * + PCRE_INFO_JITSIZE size_t + PCRE_INFO_MATCHLIMIT uint32_t + PCRE_INFO_NAMETABLE PCRE_SPTR16 (16-bit library) + PCRE_INFO_NAMETABLE PCRE_SPTR32 (32-bit library) + PCRE_INFO_NAMETABLE const unsigned char * (8-bit library) + PCRE_INFO_OPTIONS unsigned long int + PCRE_INFO_SIZE size_t + PCRE_INFO_STUDYSIZE size_t + PCRE_INFO_RECURSIONLIMIT uint32_t + PCRE_INFO_REQUIREDCHAR uint32_t +.sp +The yield of the function is zero on success or: +.sp + PCRE_ERROR_NULL the argument \fIcode\fP was NULL + the argument \fIwhere\fP was NULL + PCRE_ERROR_BADMAGIC the "magic number" was not found + PCRE_ERROR_BADOPTION the value of \fIwhat\fP was invalid + PCRE_ERROR_UNSET the option was not set +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_get_named_substring.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_get_named_substring.3 new file mode 100644 index 0000000000000000000000000000000000000000..84d4ee7dbbf5171d738bb99eea601970c7f27d61 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_get_named_substring.3 @@ -0,0 +1,54 @@ +.TH PCRE_GET_NAMED_SUBSTRING 3 "24 June 2012" "PCRE 8.30" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.nf +.B int pcre_get_named_substring(const pcre *\fIcode\fP, +.B " const char *\fIsubject\fP, int *\fIovector\fP," +.B " int \fIstringcount\fP, const char *\fIstringname\fP," +.B " const char **\fIstringptr\fP);" +.sp +.B int pcre16_get_named_substring(const pcre16 *\fIcode\fP, +.B " PCRE_SPTR16 \fIsubject\fP, int *\fIovector\fP," +.B " int \fIstringcount\fP, PCRE_SPTR16 \fIstringname\fP," +.B " PCRE_SPTR16 *\fIstringptr\fP);" +.sp +.B int pcre32_get_named_substring(const pcre32 *\fIcode\fP, +.B " PCRE_SPTR32 \fIsubject\fP, int *\fIovector\fP," +.B " int \fIstringcount\fP, PCRE_SPTR32 \fIstringname\fP," +.B " PCRE_SPTR32 *\fIstringptr\fP);" +.fi +. +.SH DESCRIPTION +.rs +.sp +This is a convenience function for extracting a captured substring by name. The +arguments are: +.sp + \fIcode\fP Compiled pattern + \fIsubject\fP Subject that has been successfully matched + \fIovector\fP Offset vector that \fBpcre[16|32]_exec()\fP used + \fIstringcount\fP Value returned by \fBpcre[16|32]_exec()\fP + \fIstringname\fP Name of the required substring + \fIstringptr\fP Where to put the string pointer +.sp +The memory in which the substring is placed is obtained by calling +\fBpcre[16|32]_malloc()\fP. The convenience function +\fBpcre[16|32]_free_substring()\fP can be used to free it when it is no longer +needed. The yield of the function is the length of the extracted substring, +PCRE_ERROR_NOMEMORY if sufficient memory could not be obtained, or +PCRE_ERROR_NOSUBSTRING if the string name is invalid. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_get_stringnumber.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_get_stringnumber.3 new file mode 100644 index 0000000000000000000000000000000000000000..9fc5291dc88d16363923d762e989bc300433e9df --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_get_stringnumber.3 @@ -0,0 +1,43 @@ +.TH PCRE_GET_STRINGNUMBER 3 "24 June 2012" "PCRE 8.30" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.nf +.B int pcre_get_stringnumber(const pcre *\fIcode\fP, +.B " const char *\fIname\fP);" +.sp +.B int pcre16_get_stringnumber(const pcre16 *\fIcode\fP, +.B " PCRE_SPTR16 \fIname\fP);" +.sp +.B int pcre32_get_stringnumber(const pcre32 *\fIcode\fP, +.B " PCRE_SPTR32 \fIname\fP);" +.fi +. +.SH DESCRIPTION +.rs +.sp +This convenience function finds the number of a named substring capturing +parenthesis in a compiled pattern. Its arguments are: +.sp + \fIcode\fP Compiled regular expression + \fIname\fP Name whose number is required +.sp +The yield of the function is the number of the parenthesis if the name is +found, or PCRE_ERROR_NOSUBSTRING otherwise. When duplicate names are allowed +(PCRE_DUPNAMES is set), it is not defined which of the numbers is returned by +\fBpcre[16|32]_get_stringnumber()\fP. You can obtain the complete list by calling +\fBpcre[16|32]_get_stringtable_entries()\fP. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_get_stringtable_entries.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_get_stringtable_entries.3 new file mode 100644 index 0000000000000000000000000000000000000000..5c58c90c0e4c0ecb4fc0e1f62a87282dc244e144 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_get_stringtable_entries.3 @@ -0,0 +1,46 @@ +.TH PCRE_GET_STRINGTABLE_ENTRIES 3 "24 June 2012" "PCRE 8.30" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.nf +.B int pcre_get_stringtable_entries(const pcre *\fIcode\fP, +.B " const char *\fIname\fP, char **\fIfirst\fP, char **\fIlast\fP);" +.sp +.B int pcre16_get_stringtable_entries(const pcre16 *\fIcode\fP, +.B " PCRE_SPTR16 \fIname\fP, PCRE_UCHAR16 **\fIfirst\fP, PCRE_UCHAR16 **\fIlast\fP);" +.sp +.B int pcre32_get_stringtable_entries(const pcre32 *\fIcode\fP, +.B " PCRE_SPTR32 \fIname\fP, PCRE_UCHAR32 **\fIfirst\fP, PCRE_UCHAR32 **\fIlast\fP);" +.fi +. +.SH DESCRIPTION +.rs +.sp +This convenience function finds, for a compiled pattern, the first and last +entries for a given name in the table that translates capturing parenthesis +names into numbers. When names are required to be unique (PCRE_DUPNAMES is +\fInot\fP set), it is usually easier to use \fBpcre[16|32]_get_stringnumber()\fP +instead. +.sp + \fIcode\fP Compiled regular expression + \fIname\fP Name whose entries required + \fIfirst\fP Where to return a pointer to the first entry + \fIlast\fP Where to return a pointer to the last entry +.sp +The yield of the function is the length of each entry, or +PCRE_ERROR_NOSUBSTRING if none are found. +.P +There is a complete description of the PCRE native API, including the format of +the table entries, in the +.\" HREF +\fBpcreapi\fP +.\" +page, and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_get_substring.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_get_substring.3 new file mode 100644 index 0000000000000000000000000000000000000000..1e62b2c0c611f27f771713c5804f20c65ec9cc6e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_get_substring.3 @@ -0,0 +1,50 @@ +.TH PCRE_GET_SUBSTRING 3 "24 June 2012" "PCRE 8.30" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.nf +.B int pcre_get_substring(const char *\fIsubject\fP, int *\fIovector\fP, +.B " int \fIstringcount\fP, int \fIstringnumber\fP," +.B " const char **\fIstringptr\fP);" +.sp +.B int pcre16_get_substring(PCRE_SPTR16 \fIsubject\fP, int *\fIovector\fP, +.B " int \fIstringcount\fP, int \fIstringnumber\fP," +.B " PCRE_SPTR16 *\fIstringptr\fP);" +.sp +.B int pcre32_get_substring(PCRE_SPTR32 \fIsubject\fP, int *\fIovector\fP, +.B " int \fIstringcount\fP, int \fIstringnumber\fP," +.B " PCRE_SPTR32 *\fIstringptr\fP);" +.fi +. +.SH DESCRIPTION +.rs +.sp +This is a convenience function for extracting a captured substring. The +arguments are: +.sp + \fIsubject\fP Subject that has been successfully matched + \fIovector\fP Offset vector that \fBpcre[16|32]_exec()\fP used + \fIstringcount\fP Value returned by \fBpcre[16|32]_exec()\fP + \fIstringnumber\fP Number of the required substring + \fIstringptr\fP Where to put the string pointer +.sp +The memory in which the substring is placed is obtained by calling +\fBpcre[16|32]_malloc()\fP. The convenience function +\fBpcre[16|32]_free_substring()\fP can be used to free it when it is no longer +needed. The yield of the function is the length of the substring, +PCRE_ERROR_NOMEMORY if sufficient memory could not be obtained, or +PCRE_ERROR_NOSUBSTRING if the string number is invalid. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_get_substring_list.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_get_substring_list.3 new file mode 100644 index 0000000000000000000000000000000000000000..511a4a39d673d19ba85c31e60e9ef900bf9f84fd --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_get_substring_list.3 @@ -0,0 +1,47 @@ +.TH PCRE_GET_SUBSTRING_LIST 3 "24 June 2012" "PCRE 8.30" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.nf +.B int pcre_get_substring_list(const char *\fIsubject\fP, +.B " int *\fIovector\fP, int \fIstringcount\fP, const char ***\fIlistptr\fP);" +.sp +.B int pcre16_get_substring_list(PCRE_SPTR16 \fIsubject\fP, +.B " int *\fIovector\fP, int \fIstringcount\fP, PCRE_SPTR16 **\fIlistptr\fP);" +.sp +.B int pcre32_get_substring_list(PCRE_SPTR32 \fIsubject\fP, +.B " int *\fIovector\fP, int \fIstringcount\fP, PCRE_SPTR32 **\fIlistptr\fP);" +.fi +. +.SH DESCRIPTION +.rs +.sp +This is a convenience function for extracting a list of all the captured +substrings. The arguments are: +.sp + \fIsubject\fP Subject that has been successfully matched + \fIovector\fP Offset vector that \fBpcre[16|32]_exec\fP used + \fIstringcount\fP Value returned by \fBpcre[16|32]_exec\fP + \fIlistptr\fP Where to put a pointer to the list +.sp +The memory in which the substrings and the list are placed is obtained by +calling \fBpcre[16|32]_malloc()\fP. The convenience function +\fBpcre[16|32]_free_substring_list()\fP can be used to free it when it is no +longer needed. A pointer to a list of pointers is put in the variable whose +address is in \fIlistptr\fP. The list is terminated by a NULL pointer. The +yield of the function is zero on success or PCRE_ERROR_NOMEMORY if sufficient +memory could not be obtained. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_jit_exec.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_jit_exec.3 new file mode 100644 index 0000000000000000000000000000000000000000..ba85168178a0d55d065acea025fb98f7ec12d52a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_jit_exec.3 @@ -0,0 +1,96 @@ +.TH PCRE_EXEC 3 "31 October 2012" "PCRE 8.30" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.nf +.B int pcre_jit_exec(const pcre *\fIcode\fP, "const pcre_extra *\fIextra\fP," +.B " const char *\fIsubject\fP, int \fIlength\fP, int \fIstartoffset\fP," +.B " int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP," +.B " pcre_jit_stack *\fIjstack\fP);" +.sp +.B int pcre16_jit_exec(const pcre16 *\fIcode\fP, "const pcre16_extra *\fIextra\fP," +.B " PCRE_SPTR16 \fIsubject\fP, int \fIlength\fP, int \fIstartoffset\fP," +.B " int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP," +.B " pcre_jit_stack *\fIjstack\fP);" +.sp +.B int pcre32_jit_exec(const pcre32 *\fIcode\fP, "const pcre32_extra *\fIextra\fP," +.B " PCRE_SPTR32 \fIsubject\fP, int \fIlength\fP, int \fIstartoffset\fP," +.B " int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP," +.B " pcre_jit_stack *\fIjstack\fP);" +.fi +. +.SH DESCRIPTION +.rs +.sp +This function matches a compiled regular expression that has been successfully +studied with one of the JIT options against a given subject string, using a +matching algorithm that is similar to Perl's. It is a "fast path" interface to +JIT, and it bypasses some of the sanity checks that \fBpcre_exec()\fP applies. +It returns offsets to captured substrings. Its arguments are: +.sp + \fIcode\fP Points to the compiled pattern + \fIextra\fP Points to an associated \fBpcre[16|32]_extra\fP structure, + or is NULL + \fIsubject\fP Points to the subject string + \fIlength\fP Length of the subject string, in bytes + \fIstartoffset\fP Offset in bytes in the subject at which to + start matching + \fIoptions\fP Option bits + \fIovector\fP Points to a vector of ints for result offsets + \fIovecsize\fP Number of elements in the vector (a multiple of 3) + \fIjstack\fP Pointer to a JIT stack +.sp +The allowed options are: +.sp + PCRE_NOTBOL Subject string is not the beginning of a line + PCRE_NOTEOL Subject string is not the end of a line + PCRE_NOTEMPTY An empty string is not a valid match + PCRE_NOTEMPTY_ATSTART An empty string at the start of the subject + is not a valid match + PCRE_NO_UTF16_CHECK Do not check the subject for UTF-16 + validity (only relevant if PCRE_UTF16 + was set at compile time) + PCRE_NO_UTF32_CHECK Do not check the subject for UTF-32 + validity (only relevant if PCRE_UTF32 + was set at compile time) + PCRE_NO_UTF8_CHECK Do not check the subject for UTF-8 + validity (only relevant if PCRE_UTF8 + was set at compile time) + PCRE_PARTIAL ) Return PCRE_ERROR_PARTIAL for a partial + PCRE_PARTIAL_SOFT ) match if no full matches are found + PCRE_PARTIAL_HARD Return PCRE_ERROR_PARTIAL for a partial match + if that is found before a full match +.sp +However, the PCRE_NO_UTF[8|16|32]_CHECK options have no effect, as this check +is never applied. For details of partial matching, see the +.\" HREF +\fBpcrepartial\fP +.\" +page. A \fBpcre_extra\fP structure contains the following fields: +.sp + \fIflags\fP Bits indicating which fields are set + \fIstudy_data\fP Opaque data from \fBpcre[16|32]_study()\fP + \fImatch_limit\fP Limit on internal resource use + \fImatch_limit_recursion\fP Limit on internal recursion depth + \fIcallout_data\fP Opaque data passed back to callouts + \fItables\fP Points to character tables or is NULL + \fImark\fP For passing back a *MARK pointer + \fIexecutable_jit\fP Opaque data from JIT compilation +.sp +The flag bits are PCRE_EXTRA_STUDY_DATA, PCRE_EXTRA_MATCH_LIMIT, +PCRE_EXTRA_MATCH_LIMIT_RECURSION, PCRE_EXTRA_CALLOUT_DATA, +PCRE_EXTRA_TABLES, PCRE_EXTRA_MARK and PCRE_EXTRA_EXECUTABLE_JIT. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the JIT API in the +.\" HREF +\fBpcrejit\fP +.\" +page. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_jit_stack_alloc.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_jit_stack_alloc.3 new file mode 100644 index 0000000000000000000000000000000000000000..11c97a0fc8a3ccb4e30e51ed1144081c0faadc21 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_jit_stack_alloc.3 @@ -0,0 +1,43 @@ +.TH PCRE_JIT_STACK_ALLOC 3 "24 June 2012" "PCRE 8.30" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.nf +.B pcre_jit_stack *pcre_jit_stack_alloc(int \fIstartsize\fP, +.B " int \fImaxsize\fP);" +.sp +.B pcre16_jit_stack *pcre16_jit_stack_alloc(int \fIstartsize\fP, +.B " int \fImaxsize\fP);" +.sp +.B pcre32_jit_stack *pcre32_jit_stack_alloc(int \fIstartsize\fP, +.B " int \fImaxsize\fP);" +.fi +. +.SH DESCRIPTION +.rs +.sp +This function is used to create a stack for use by the code compiled by the JIT +optimization of \fBpcre[16|32]_study()\fP. The arguments are a starting size for +the stack, and a maximum size to which it is allowed to grow. The result can be +passed to the JIT run-time code by \fBpcre[16|32]_assign_jit_stack()\fP, or that +function can set up a callback for obtaining a stack. A maximum stack size of +512K to 1M should be more than enough for any pattern. For more details, see +the +.\" HREF +\fBpcrejit\fP +.\" +page. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_jit_stack_free.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_jit_stack_free.3 new file mode 100644 index 0000000000000000000000000000000000000000..494724e844f727796cf6bee74e7f7471cc7fadc3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_jit_stack_free.3 @@ -0,0 +1,35 @@ +.TH PCRE_JIT_STACK_FREE 3 "24 June 2012" "PCRE 8.30" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.B void pcre_jit_stack_free(pcre_jit_stack *\fIstack\fP); +.PP +.B void pcre16_jit_stack_free(pcre16_jit_stack *\fIstack\fP); +.PP +.B void pcre32_jit_stack_free(pcre32_jit_stack *\fIstack\fP); +. +.SH DESCRIPTION +.rs +.sp +This function is used to free a JIT stack that was created by +\fBpcre[16|32]_jit_stack_alloc()\fP when it is no longer needed. For more details, +see the +.\" HREF +\fBpcrejit\fP +.\" +page. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_maketables.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_maketables.3 new file mode 100644 index 0000000000000000000000000000000000000000..b2c3d23aa6885092683b6ec30c89e0e7da163898 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_maketables.3 @@ -0,0 +1,33 @@ +.TH PCRE_MAKETABLES 3 "24 June 2012" "PCRE 8.30" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.B const unsigned char *pcre_maketables(void); +.PP +.B const unsigned char *pcre16_maketables(void); +.PP +.B const unsigned char *pcre32_maketables(void); +. +.SH DESCRIPTION +.rs +.sp +This function builds a set of character tables for character values less than +256. These can be passed to \fBpcre[16|32]_compile()\fP to override PCRE's +internal, built-in tables (which were made by \fBpcre[16|32]_maketables()\fP when +PCRE was compiled). You might want to do this if you are using a non-standard +locale. The function yields a pointer to the tables. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_pattern_to_host_byte_order.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_pattern_to_host_byte_order.3 new file mode 100644 index 0000000000000000000000000000000000000000..b0c41c38e89433ef8ed2e8fbd31c56bcd502eeed --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_pattern_to_host_byte_order.3 @@ -0,0 +1,44 @@ +.TH PCRE_PATTERN_TO_HOST_BYTE_ORDER 3 "24 June 2012" "PCRE 8.30" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.nf +.B int pcre_pattern_to_host_byte_order(pcre *\fIcode\fP, +.B " pcre_extra *\fIextra\fP, const unsigned char *\fItables\fP);" +.sp +.B int pcre16_pattern_to_host_byte_order(pcre16 *\fIcode\fP, +.B " pcre16_extra *\fIextra\fP, const unsigned char *\fItables\fP);" +.sp +.B int pcre32_pattern_to_host_byte_order(pcre32 *\fIcode\fP, +.B " pcre32_extra *\fIextra\fP, const unsigned char *\fItables\fP);" +.fi +. +.SH DESCRIPTION +.rs +.sp +This function ensures that the bytes in 2-byte and 4-byte values in a compiled +pattern are in the correct order for the current host. It is useful when a +pattern that has been compiled on one host is transferred to another that might +have different endianness. The arguments are: +.sp + \fIcode\fP A compiled regular expression + \fIextra\fP Points to an associated \fBpcre[16|32]_extra\fP structure, + or is NULL + \fItables\fP Pointer to character tables, or NULL to + set the built-in default +.sp +The result is 0 for success, a negative PCRE_ERROR_xxx value otherwise. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_refcount.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_refcount.3 new file mode 100644 index 0000000000000000000000000000000000000000..45a41fef6a0bf80752832d77b054721437aa234c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_refcount.3 @@ -0,0 +1,36 @@ +.TH PCRE_REFCOUNT 3 "24 June 2012" "PCRE 8.30" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.B int pcre_refcount(pcre *\fIcode\fP, int \fIadjust\fP); +.PP +.B int pcre16_refcount(pcre16 *\fIcode\fP, int \fIadjust\fP); +.PP +.B int pcre32_refcount(pcre32 *\fIcode\fP, int \fIadjust\fP); +. +.SH DESCRIPTION +.rs +.sp +This function is used to maintain a reference count inside a data block that +contains a compiled pattern. Its arguments are: +.sp + \fIcode\fP Compiled regular expression + \fIadjust\fP Adjustment to reference value +.sp +The yield of the function is the adjusted reference value, which is constrained +to lie between 0 and 65535. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_study.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_study.3 new file mode 100644 index 0000000000000000000000000000000000000000..1200e0a668374bd6f8d4b2b7188c4cbfa5e44798 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_study.3 @@ -0,0 +1,54 @@ +.TH PCRE_STUDY 3 " 24 June 2012" "PCRE 8.30" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.nf +.B pcre_extra *pcre_study(const pcre *\fIcode\fP, int \fIoptions\fP, +.B " const char **\fIerrptr\fP);" +.sp +.B pcre16_extra *pcre16_study(const pcre16 *\fIcode\fP, int \fIoptions\fP, +.B " const char **\fIerrptr\fP);" +.sp +.B pcre32_extra *pcre32_study(const pcre32 *\fIcode\fP, int \fIoptions\fP, +.B " const char **\fIerrptr\fP);" +.fi +. +.SH DESCRIPTION +.rs +.sp +This function studies a compiled pattern, to see if additional information can +be extracted that might speed up matching. Its arguments are: +.sp + \fIcode\fP A compiled regular expression + \fIoptions\fP Options for \fBpcre[16|32]_study()\fP + \fIerrptr\fP Where to put an error message +.sp +If the function succeeds, it returns a value that can be passed to +\fBpcre[16|32]_exec()\fP or \fBpcre[16|32]_dfa_exec()\fP via their \fIextra\fP +arguments. +.P +If the function returns NULL, either it could not find any additional +information, or there was an error. You can tell the difference by looking at +the error value. It is NULL in first case. +.P +The only option is PCRE_STUDY_JIT_COMPILE. It requests just-in-time compilation +if possible. If PCRE has been compiled without JIT support, this option is +ignored. See the +.\" HREF +\fBpcrejit\fP +.\" +page for further details. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_utf16_to_host_byte_order.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_utf16_to_host_byte_order.3 new file mode 100644 index 0000000000000000000000000000000000000000..1851b619dad46d52ab4b251e47c45359cb3c0138 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_utf16_to_host_byte_order.3 @@ -0,0 +1,45 @@ +.TH PCRE_UTF16_TO_HOST_BYTE_ORDER 3 "21 January 2012" "PCRE 8.30" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.nf +.B int pcre16_utf16_to_host_byte_order(PCRE_UCHAR16 *\fIoutput\fP, +.B " PCRE_SPTR16 \fIinput\fP, int \fIlength\fP, int *\fIhost_byte_order\fP," +.B " int \fIkeep_boms\fP);" +.fi +. +. +.SH DESCRIPTION +.rs +.sp +This function, which exists only in the 16-bit library, converts a UTF-16 +string to the correct order for the current host, taking account of any byte +order marks (BOMs) within the string. Its arguments are: +.sp + \fIoutput\fP pointer to output buffer, may be the same as \fIinput\fP + \fIinput\fP pointer to input buffer + \fIlength\fP number of 16-bit units in the input, or negative for + a zero-terminated string + \fIhost_byte_order\fP a NULL value or a non-zero value pointed to means + start in host byte order + \fIkeep_boms\fP if non-zero, BOMs are copied to the output string +.sp +The result of the function is the number of 16-bit units placed into the output +buffer, including the zero terminator if the string was zero-terminated. +.P +If \fIhost_byte_order\fP is not NULL, it is set to indicate the byte order that +is current at the end of the string. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_utf32_to_host_byte_order.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_utf32_to_host_byte_order.3 new file mode 100644 index 0000000000000000000000000000000000000000..a415dcf5fad5c33481ba6340ac575f9c3dea547e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_utf32_to_host_byte_order.3 @@ -0,0 +1,45 @@ +.TH PCRE_UTF32_TO_HOST_BYTE_ORDER 3 "24 June 2012" "PCRE 8.30" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.nf +.B int pcre32_utf32_to_host_byte_order(PCRE_UCHAR32 *\fIoutput\fP, +.B " PCRE_SPTR32 \fIinput\fP, int \fIlength\fP, int *\fIhost_byte_order\fP," +.B " int \fIkeep_boms\fP);" +.fi +. +. +.SH DESCRIPTION +.rs +.sp +This function, which exists only in the 32-bit library, converts a UTF-32 +string to the correct order for the current host, taking account of any byte +order marks (BOMs) within the string. Its arguments are: +.sp + \fIoutput\fP pointer to output buffer, may be the same as \fIinput\fP + \fIinput\fP pointer to input buffer + \fIlength\fP number of 32-bit units in the input, or negative for + a zero-terminated string + \fIhost_byte_order\fP a NULL value or a non-zero value pointed to means + start in host byte order + \fIkeep_boms\fP if non-zero, BOMs are copied to the output string +.sp +The result of the function is the number of 32-bit units placed into the output +buffer, including the zero terminator if the string was zero-terminated. +.P +If \fIhost_byte_order\fP is not NULL, it is set to indicate the byte order that +is current at the end of the string. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_version.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_version.3 new file mode 100644 index 0000000000000000000000000000000000000000..0f4973f9c7d7aa7d4ef9b2e2fdb7e56917d6048d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcre_version.3 @@ -0,0 +1,31 @@ +.TH PCRE_VERSION 3 "24 June 2012" "PCRE 8.30" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.B const char *pcre_version(void); +.PP +.B const char *pcre16_version(void); +.PP +.B const char *pcre32_version(void); +. +.SH DESCRIPTION +.rs +.sp +This function (even in the 16-bit and 32-bit libraries) returns a +zero-terminated, 8-bit character string that gives the version number of the +PCRE library and the date of its release. +.P +There is a complete description of the PCRE native API in the +.\" HREF +\fBpcreapi\fP +.\" +page and a description of the POSIX API in the +.\" HREF +\fBpcreposix\fP +.\" +page. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcreapi.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcreapi.3 new file mode 100644 index 0000000000000000000000000000000000000000..685672a3cefdc3adee1313ff9ccb31646b9a88fd --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcreapi.3 @@ -0,0 +1,2918 @@ +.TH PCREAPI 3 "18 December 2015" "PCRE 8.39" +.SH NAME +PCRE - Perl-compatible regular expressions +.sp +.B #include +. +. +.SH "PCRE NATIVE API BASIC FUNCTIONS" +.rs +.sp +.nf +.B pcre *pcre_compile(const char *\fIpattern\fP, int \fIoptions\fP, +.B " const char **\fIerrptr\fP, int *\fIerroffset\fP," +.B " const unsigned char *\fItableptr\fP);" +.sp +.B pcre *pcre_compile2(const char *\fIpattern\fP, int \fIoptions\fP, +.B " int *\fIerrorcodeptr\fP," +.B " const char **\fIerrptr\fP, int *\fIerroffset\fP," +.B " const unsigned char *\fItableptr\fP);" +.sp +.B pcre_extra *pcre_study(const pcre *\fIcode\fP, int \fIoptions\fP, +.B " const char **\fIerrptr\fP);" +.sp +.B void pcre_free_study(pcre_extra *\fIextra\fP); +.sp +.B int pcre_exec(const pcre *\fIcode\fP, "const pcre_extra *\fIextra\fP," +.B " const char *\fIsubject\fP, int \fIlength\fP, int \fIstartoffset\fP," +.B " int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP);" +.sp +.B int pcre_dfa_exec(const pcre *\fIcode\fP, "const pcre_extra *\fIextra\fP," +.B " const char *\fIsubject\fP, int \fIlength\fP, int \fIstartoffset\fP," +.B " int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP," +.B " int *\fIworkspace\fP, int \fIwscount\fP);" +.fi +. +. +.SH "PCRE NATIVE API STRING EXTRACTION FUNCTIONS" +.rs +.sp +.nf +.B int pcre_copy_named_substring(const pcre *\fIcode\fP, +.B " const char *\fIsubject\fP, int *\fIovector\fP," +.B " int \fIstringcount\fP, const char *\fIstringname\fP," +.B " char *\fIbuffer\fP, int \fIbuffersize\fP);" +.sp +.B int pcre_copy_substring(const char *\fIsubject\fP, int *\fIovector\fP, +.B " int \fIstringcount\fP, int \fIstringnumber\fP, char *\fIbuffer\fP," +.B " int \fIbuffersize\fP);" +.sp +.B int pcre_get_named_substring(const pcre *\fIcode\fP, +.B " const char *\fIsubject\fP, int *\fIovector\fP," +.B " int \fIstringcount\fP, const char *\fIstringname\fP," +.B " const char **\fIstringptr\fP);" +.sp +.B int pcre_get_stringnumber(const pcre *\fIcode\fP, +.B " const char *\fIname\fP);" +.sp +.B int pcre_get_stringtable_entries(const pcre *\fIcode\fP, +.B " const char *\fIname\fP, char **\fIfirst\fP, char **\fIlast\fP);" +.sp +.B int pcre_get_substring(const char *\fIsubject\fP, int *\fIovector\fP, +.B " int \fIstringcount\fP, int \fIstringnumber\fP," +.B " const char **\fIstringptr\fP);" +.sp +.B int pcre_get_substring_list(const char *\fIsubject\fP, +.B " int *\fIovector\fP, int \fIstringcount\fP, const char ***\fIlistptr\fP);" +.sp +.B void pcre_free_substring(const char *\fIstringptr\fP); +.sp +.B void pcre_free_substring_list(const char **\fIstringptr\fP); +.fi +. +. +.SH "PCRE NATIVE API AUXILIARY FUNCTIONS" +.rs +.sp +.nf +.B int pcre_jit_exec(const pcre *\fIcode\fP, "const pcre_extra *\fIextra\fP," +.B " const char *\fIsubject\fP, int \fIlength\fP, int \fIstartoffset\fP," +.B " int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP," +.B " pcre_jit_stack *\fIjstack\fP);" +.sp +.B pcre_jit_stack *pcre_jit_stack_alloc(int \fIstartsize\fP, int \fImaxsize\fP); +.sp +.B void pcre_jit_stack_free(pcre_jit_stack *\fIstack\fP); +.sp +.B void pcre_assign_jit_stack(pcre_extra *\fIextra\fP, +.B " pcre_jit_callback \fIcallback\fP, void *\fIdata\fP);" +.sp +.B const unsigned char *pcre_maketables(void); +.sp +.B int pcre_fullinfo(const pcre *\fIcode\fP, "const pcre_extra *\fIextra\fP," +.B " int \fIwhat\fP, void *\fIwhere\fP);" +.sp +.B int pcre_refcount(pcre *\fIcode\fP, int \fIadjust\fP); +.sp +.B int pcre_config(int \fIwhat\fP, void *\fIwhere\fP); +.sp +.B const char *pcre_version(void); +.sp +.B int pcre_pattern_to_host_byte_order(pcre *\fIcode\fP, +.B " pcre_extra *\fIextra\fP, const unsigned char *\fItables\fP);" +.fi +. +. +.SH "PCRE NATIVE API INDIRECTED FUNCTIONS" +.rs +.sp +.nf +.B void *(*pcre_malloc)(size_t); +.sp +.B void (*pcre_free)(void *); +.sp +.B void *(*pcre_stack_malloc)(size_t); +.sp +.B void (*pcre_stack_free)(void *); +.sp +.B int (*pcre_callout)(pcre_callout_block *); +.sp +.B int (*pcre_stack_guard)(void); +.fi +. +. +.SH "PCRE 8-BIT, 16-BIT, AND 32-BIT LIBRARIES" +.rs +.sp +As well as support for 8-bit character strings, PCRE also supports 16-bit +strings (from release 8.30) and 32-bit strings (from release 8.32), by means of +two additional libraries. They can be built as well as, or instead of, the +8-bit library. To avoid too much complication, this document describes the +8-bit versions of the functions, with only occasional references to the 16-bit +and 32-bit libraries. +.P +The 16-bit and 32-bit functions operate in the same way as their 8-bit +counterparts; they just use different data types for their arguments and +results, and their names start with \fBpcre16_\fP or \fBpcre32_\fP instead of +\fBpcre_\fP. For every option that has UTF8 in its name (for example, +PCRE_UTF8), there are corresponding 16-bit and 32-bit names with UTF8 replaced +by UTF16 or UTF32, respectively. This facility is in fact just cosmetic; the +16-bit and 32-bit option names define the same bit values. +.P +References to bytes and UTF-8 in this document should be read as references to +16-bit data units and UTF-16 when using the 16-bit library, or 32-bit data +units and UTF-32 when using the 32-bit library, unless specified otherwise. +More details of the specific differences for the 16-bit and 32-bit libraries +are given in the +.\" HREF +\fBpcre16\fP +.\" +and +.\" HREF +\fBpcre32\fP +.\" +pages. +. +. +.SH "PCRE API OVERVIEW" +.rs +.sp +PCRE has its own native API, which is described in this document. There are +also some wrapper functions (for the 8-bit library only) that correspond to the +POSIX regular expression API, but they do not give access to all the +functionality. They are described in the +.\" HREF +\fBpcreposix\fP +.\" +documentation. Both of these APIs define a set of C function calls. A C++ +wrapper (again for the 8-bit library only) is also distributed with PCRE. It is +documented in the +.\" HREF +\fBpcrecpp\fP +.\" +page. +.P +The native API C function prototypes are defined in the header file +\fBpcre.h\fP, and on Unix-like systems the (8-bit) library itself is called +\fBlibpcre\fP. It can normally be accessed by adding \fB-lpcre\fP to the +command for linking an application that uses PCRE. The header file defines the +macros PCRE_MAJOR and PCRE_MINOR to contain the major and minor release numbers +for the library. Applications can use these to include support for different +releases of PCRE. +.P +In a Windows environment, if you want to statically link an application program +against a non-dll \fBpcre.a\fP file, you must define PCRE_STATIC before +including \fBpcre.h\fP or \fBpcrecpp.h\fP, because otherwise the +\fBpcre_malloc()\fP and \fBpcre_free()\fP exported functions will be declared +\fB__declspec(dllimport)\fP, with unwanted results. +.P +The functions \fBpcre_compile()\fP, \fBpcre_compile2()\fP, \fBpcre_study()\fP, +and \fBpcre_exec()\fP are used for compiling and matching regular expressions +in a Perl-compatible manner. A sample program that demonstrates the simplest +way of using them is provided in the file called \fIpcredemo.c\fP in the PCRE +source distribution. A listing of this program is given in the +.\" HREF +\fBpcredemo\fP +.\" +documentation, and the +.\" HREF +\fBpcresample\fP +.\" +documentation describes how to compile and run it. +.P +Just-in-time compiler support is an optional feature of PCRE that can be built +in appropriate hardware environments. It greatly speeds up the matching +performance of many patterns. Simple programs can easily request that it be +used if available, by setting an option that is ignored when it is not +relevant. More complicated programs might need to make use of the functions +\fBpcre_jit_stack_alloc()\fP, \fBpcre_jit_stack_free()\fP, and +\fBpcre_assign_jit_stack()\fP in order to control the JIT code's memory usage. +.P +From release 8.32 there is also a direct interface for JIT execution, which +gives improved performance. The JIT-specific functions are discussed in the +.\" HREF +\fBpcrejit\fP +.\" +documentation. +.P +A second matching function, \fBpcre_dfa_exec()\fP, which is not +Perl-compatible, is also provided. This uses a different algorithm for the +matching. The alternative algorithm finds all possible matches (at a given +point in the subject), and scans the subject just once (unless there are +lookbehind assertions). However, this algorithm does not return captured +substrings. A description of the two matching algorithms and their advantages +and disadvantages is given in the +.\" HREF +\fBpcrematching\fP +.\" +documentation. +.P +In addition to the main compiling and matching functions, there are convenience +functions for extracting captured substrings from a subject string that is +matched by \fBpcre_exec()\fP. They are: +.sp + \fBpcre_copy_substring()\fP + \fBpcre_copy_named_substring()\fP + \fBpcre_get_substring()\fP + \fBpcre_get_named_substring()\fP + \fBpcre_get_substring_list()\fP + \fBpcre_get_stringnumber()\fP + \fBpcre_get_stringtable_entries()\fP +.sp +\fBpcre_free_substring()\fP and \fBpcre_free_substring_list()\fP are also +provided, to free the memory used for extracted strings. +.P +The function \fBpcre_maketables()\fP is used to build a set of character tables +in the current locale for passing to \fBpcre_compile()\fP, \fBpcre_exec()\fP, +or \fBpcre_dfa_exec()\fP. This is an optional facility that is provided for +specialist use. Most commonly, no special tables are passed, in which case +internal tables that are generated when PCRE is built are used. +.P +The function \fBpcre_fullinfo()\fP is used to find out information about a +compiled pattern. The function \fBpcre_version()\fP returns a pointer to a +string containing the version of PCRE and its date of release. +.P +The function \fBpcre_refcount()\fP maintains a reference count in a data block +containing a compiled pattern. This is provided for the benefit of +object-oriented applications. +.P +The global variables \fBpcre_malloc\fP and \fBpcre_free\fP initially contain +the entry points of the standard \fBmalloc()\fP and \fBfree()\fP functions, +respectively. PCRE calls the memory management functions via these variables, +so a calling program can replace them if it wishes to intercept the calls. This +should be done before calling any PCRE functions. +.P +The global variables \fBpcre_stack_malloc\fP and \fBpcre_stack_free\fP are also +indirections to memory management functions. These special functions are used +only when PCRE is compiled to use the heap for remembering data, instead of +recursive function calls, when running the \fBpcre_exec()\fP function. See the +.\" HREF +\fBpcrebuild\fP +.\" +documentation for details of how to do this. It is a non-standard way of +building PCRE, for use in environments that have limited stacks. Because of the +greater use of memory management, it runs more slowly. Separate functions are +provided so that special-purpose external code can be used for this case. When +used, these functions always allocate memory blocks of the same size. There is +a discussion about PCRE's stack usage in the +.\" HREF +\fBpcrestack\fP +.\" +documentation. +.P +The global variable \fBpcre_callout\fP initially contains NULL. It can be set +by the caller to a "callout" function, which PCRE will then call at specified +points during a matching operation. Details are given in the +.\" HREF +\fBpcrecallout\fP +.\" +documentation. +.P +The global variable \fBpcre_stack_guard\fP initially contains NULL. It can be +set by the caller to a function that is called by PCRE whenever it starts +to compile a parenthesized part of a pattern. When parentheses are nested, PCRE +uses recursive function calls, which use up the system stack. This function is +provided so that applications with restricted stacks can force a compilation +error if the stack runs out. The function should return zero if all is well, or +non-zero to force an error. +. +. +.\" HTML +.SH NEWLINES +.rs +.sp +PCRE supports five different conventions for indicating line breaks in +strings: a single CR (carriage return) character, a single LF (linefeed) +character, the two-character sequence CRLF, any of the three preceding, or any +Unicode newline sequence. The Unicode newline sequences are the three just +mentioned, plus the single characters VT (vertical tab, U+000B), FF (form feed, +U+000C), NEL (next line, U+0085), LS (line separator, U+2028), and PS +(paragraph separator, U+2029). +.P +Each of the first three conventions is used by at least one operating system as +its standard newline sequence. When PCRE is built, a default can be specified. +The default default is LF, which is the Unix standard. When PCRE is run, the +default can be overridden, either when a pattern is compiled, or when it is +matched. +.P +At compile time, the newline convention can be specified by the \fIoptions\fP +argument of \fBpcre_compile()\fP, or it can be specified by special text at the +start of the pattern itself; this overrides any other settings. See the +.\" HREF +\fBpcrepattern\fP +.\" +page for details of the special character sequences. +.P +In the PCRE documentation the word "newline" is used to mean "the character or +pair of characters that indicate a line break". The choice of newline +convention affects the handling of the dot, circumflex, and dollar +metacharacters, the handling of #-comments in /x mode, and, when CRLF is a +recognized line ending sequence, the match position advancement for a +non-anchored pattern. There is more detail about this in the +.\" HTML +.\" +section on \fBpcre_exec()\fP options +.\" +below. +.P +The choice of newline convention does not affect the interpretation of +the \en or \er escape sequences, nor does it affect what \eR matches, which is +controlled in a similar way, but by separate options. +. +. +.SH MULTITHREADING +.rs +.sp +The PCRE functions can be used in multi-threading applications, with the +proviso that the memory management functions pointed to by \fBpcre_malloc\fP, +\fBpcre_free\fP, \fBpcre_stack_malloc\fP, and \fBpcre_stack_free\fP, and the +callout and stack-checking functions pointed to by \fBpcre_callout\fP and +\fBpcre_stack_guard\fP, are shared by all threads. +.P +The compiled form of a regular expression is not altered during matching, so +the same compiled pattern can safely be used by several threads at once. +.P +If the just-in-time optimization feature is being used, it needs separate +memory stack areas for each thread. See the +.\" HREF +\fBpcrejit\fP +.\" +documentation for more details. +. +. +.SH "SAVING PRECOMPILED PATTERNS FOR LATER USE" +.rs +.sp +The compiled form of a regular expression can be saved and re-used at a later +time, possibly by a different program, and even on a host other than the one on +which it was compiled. Details are given in the +.\" HREF +\fBpcreprecompile\fP +.\" +documentation, which includes a description of the +\fBpcre_pattern_to_host_byte_order()\fP function. However, compiling a regular +expression with one version of PCRE for use with a different version is not +guaranteed to work and may cause crashes. +. +. +.SH "CHECKING BUILD-TIME OPTIONS" +.rs +.sp +.B int pcre_config(int \fIwhat\fP, void *\fIwhere\fP); +.PP +The function \fBpcre_config()\fP makes it possible for a PCRE client to +discover which optional features have been compiled into the PCRE library. The +.\" HREF +\fBpcrebuild\fP +.\" +documentation has more details about these optional features. +.P +The first argument for \fBpcre_config()\fP is an integer, specifying which +information is required; the second argument is a pointer to a variable into +which the information is placed. The returned value is zero on success, or the +negative error code PCRE_ERROR_BADOPTION if the value in the first argument is +not recognized. The following information is available: +.sp + PCRE_CONFIG_UTF8 +.sp +The output is an integer that is set to one if UTF-8 support is available; +otherwise it is set to zero. This value should normally be given to the 8-bit +version of this function, \fBpcre_config()\fP. If it is given to the 16-bit +or 32-bit version of this function, the result is PCRE_ERROR_BADOPTION. +.sp + PCRE_CONFIG_UTF16 +.sp +The output is an integer that is set to one if UTF-16 support is available; +otherwise it is set to zero. This value should normally be given to the 16-bit +version of this function, \fBpcre16_config()\fP. If it is given to the 8-bit +or 32-bit version of this function, the result is PCRE_ERROR_BADOPTION. +.sp + PCRE_CONFIG_UTF32 +.sp +The output is an integer that is set to one if UTF-32 support is available; +otherwise it is set to zero. This value should normally be given to the 32-bit +version of this function, \fBpcre32_config()\fP. If it is given to the 8-bit +or 16-bit version of this function, the result is PCRE_ERROR_BADOPTION. +.sp + PCRE_CONFIG_UNICODE_PROPERTIES +.sp +The output is an integer that is set to one if support for Unicode character +properties is available; otherwise it is set to zero. +.sp + PCRE_CONFIG_JIT +.sp +The output is an integer that is set to one if support for just-in-time +compiling is available; otherwise it is set to zero. +.sp + PCRE_CONFIG_JITTARGET +.sp +The output is a pointer to a zero-terminated "const char *" string. If JIT +support is available, the string contains the name of the architecture for +which the JIT compiler is configured, for example "x86 32bit (little endian + +unaligned)". If JIT support is not available, the result is NULL. +.sp + PCRE_CONFIG_NEWLINE +.sp +The output is an integer whose value specifies the default character sequence +that is recognized as meaning "newline". The values that are supported in +ASCII/Unicode environments are: 10 for LF, 13 for CR, 3338 for CRLF, -2 for +ANYCRLF, and -1 for ANY. In EBCDIC environments, CR, ANYCRLF, and ANY yield the +same values. However, the value for LF is normally 21, though some EBCDIC +environments use 37. The corresponding values for CRLF are 3349 and 3365. The +default should normally correspond to the standard sequence for your operating +system. +.sp + PCRE_CONFIG_BSR +.sp +The output is an integer whose value indicates what character sequences the \eR +escape sequence matches by default. A value of 0 means that \eR matches any +Unicode line ending sequence; a value of 1 means that \eR matches only CR, LF, +or CRLF. The default can be overridden when a pattern is compiled or matched. +.sp + PCRE_CONFIG_LINK_SIZE +.sp +The output is an integer that contains the number of bytes used for internal +linkage in compiled regular expressions. For the 8-bit library, the value can +be 2, 3, or 4. For the 16-bit library, the value is either 2 or 4 and is still +a number of bytes. For the 32-bit library, the value is either 2 or 4 and is +still a number of bytes. The default value of 2 is sufficient for all but the +most massive patterns, since it allows the compiled pattern to be up to 64K in +size. Larger values allow larger regular expressions to be compiled, at the +expense of slower matching. +.sp + PCRE_CONFIG_POSIX_MALLOC_THRESHOLD +.sp +The output is an integer that contains the threshold above which the POSIX +interface uses \fBmalloc()\fP for output vectors. Further details are given in +the +.\" HREF +\fBpcreposix\fP +.\" +documentation. +.sp + PCRE_CONFIG_PARENS_LIMIT +.sp +The output is a long integer that gives the maximum depth of nesting of +parentheses (of any kind) in a pattern. This limit is imposed to cap the amount +of system stack used when a pattern is compiled. It is specified when PCRE is +built; the default is 250. This limit does not take into account the stack that +may already be used by the calling application. For finer control over +compilation stack usage, you can set a pointer to an external checking function +in \fBpcre_stack_guard\fP. +.sp + PCRE_CONFIG_MATCH_LIMIT +.sp +The output is a long integer that gives the default limit for the number of +internal matching function calls in a \fBpcre_exec()\fP execution. Further +details are given with \fBpcre_exec()\fP below. +.sp + PCRE_CONFIG_MATCH_LIMIT_RECURSION +.sp +The output is a long integer that gives the default limit for the depth of +recursion when calling the internal matching function in a \fBpcre_exec()\fP +execution. Further details are given with \fBpcre_exec()\fP below. +.sp + PCRE_CONFIG_STACKRECURSE +.sp +The output is an integer that is set to one if internal recursion when running +\fBpcre_exec()\fP is implemented by recursive function calls that use the stack +to remember their state. This is the usual way that PCRE is compiled. The +output is zero if PCRE was compiled to use blocks of data on the heap instead +of recursive function calls. In this case, \fBpcre_stack_malloc\fP and +\fBpcre_stack_free\fP are called to manage memory blocks on the heap, thus +avoiding the use of the stack. +. +. +.SH "COMPILING A PATTERN" +.rs +.sp +.nf +.B pcre *pcre_compile(const char *\fIpattern\fP, int \fIoptions\fP, +.B " const char **\fIerrptr\fP, int *\fIerroffset\fP," +.B " const unsigned char *\fItableptr\fP);" +.sp +.B pcre *pcre_compile2(const char *\fIpattern\fP, int \fIoptions\fP, +.B " int *\fIerrorcodeptr\fP," +.B " const char **\fIerrptr\fP, int *\fIerroffset\fP," +.B " const unsigned char *\fItableptr\fP);" +.fi +.P +Either of the functions \fBpcre_compile()\fP or \fBpcre_compile2()\fP can be +called to compile a pattern into an internal form. The only difference between +the two interfaces is that \fBpcre_compile2()\fP has an additional argument, +\fIerrorcodeptr\fP, via which a numerical error code can be returned. To avoid +too much repetition, we refer just to \fBpcre_compile()\fP below, but the +information applies equally to \fBpcre_compile2()\fP. +.P +The pattern is a C string terminated by a binary zero, and is passed in the +\fIpattern\fP argument. A pointer to a single block of memory that is obtained +via \fBpcre_malloc\fP is returned. This contains the compiled code and related +data. The \fBpcre\fP type is defined for the returned block; this is a typedef +for a structure whose contents are not externally defined. It is up to the +caller to free the memory (via \fBpcre_free\fP) when it is no longer required. +.P +Although the compiled code of a PCRE regex is relocatable, that is, it does not +depend on memory location, the complete \fBpcre\fP data block is not +fully relocatable, because it may contain a copy of the \fItableptr\fP +argument, which is an address (see below). +.P +The \fIoptions\fP argument contains various bit settings that affect the +compilation. It should be zero if no options are required. The available +options are described below. Some of them (in particular, those that are +compatible with Perl, but some others as well) can also be set and unset from +within the pattern (see the detailed description in the +.\" HREF +\fBpcrepattern\fP +.\" +documentation). For those options that can be different in different parts of +the pattern, the contents of the \fIoptions\fP argument specifies their +settings at the start of compilation and execution. The PCRE_ANCHORED, +PCRE_BSR_\fIxxx\fP, PCRE_NEWLINE_\fIxxx\fP, PCRE_NO_UTF8_CHECK, and +PCRE_NO_START_OPTIMIZE options can be set at the time of matching as well as at +compile time. +.P +If \fIerrptr\fP is NULL, \fBpcre_compile()\fP returns NULL immediately. +Otherwise, if compilation of a pattern fails, \fBpcre_compile()\fP returns +NULL, and sets the variable pointed to by \fIerrptr\fP to point to a textual +error message. This is a static string that is part of the library. You must +not try to free it. Normally, the offset from the start of the pattern to the +data unit that was being processed when the error was discovered is placed in +the variable pointed to by \fIerroffset\fP, which must not be NULL (if it is, +an immediate error is given). However, for an invalid UTF-8 or UTF-16 string, +the offset is that of the first data unit of the failing character. +.P +Some errors are not detected until the whole pattern has been scanned; in these +cases, the offset passed back is the length of the pattern. Note that the +offset is in data units, not characters, even in a UTF mode. It may sometimes +point into the middle of a UTF-8 or UTF-16 character. +.P +If \fBpcre_compile2()\fP is used instead of \fBpcre_compile()\fP, and the +\fIerrorcodeptr\fP argument is not NULL, a non-zero error code number is +returned via this argument in the event of an error. This is in addition to the +textual error message. Error codes and messages are listed below. +.P +If the final argument, \fItableptr\fP, is NULL, PCRE uses a default set of +character tables that are built when PCRE is compiled, using the default C +locale. Otherwise, \fItableptr\fP must be an address that is the result of a +call to \fBpcre_maketables()\fP. This value is stored with the compiled +pattern, and used again by \fBpcre_exec()\fP and \fBpcre_dfa_exec()\fP when the +pattern is matched. For more discussion, see the section on locale support +below. +.P +This code fragment shows a typical straightforward call to \fBpcre_compile()\fP: +.sp + pcre *re; + const char *error; + int erroffset; + re = pcre_compile( + "^A.*Z", /* the pattern */ + 0, /* default options */ + &error, /* for error message */ + &erroffset, /* for error offset */ + NULL); /* use default character tables */ +.sp +The following names for option bits are defined in the \fBpcre.h\fP header +file: +.sp + PCRE_ANCHORED +.sp +If this bit is set, the pattern is forced to be "anchored", that is, it is +constrained to match only at the first matching point in the string that is +being searched (the "subject string"). This effect can also be achieved by +appropriate constructs in the pattern itself, which is the only way to do it in +Perl. +.sp + PCRE_AUTO_CALLOUT +.sp +If this bit is set, \fBpcre_compile()\fP automatically inserts callout items, +all with number 255, before each pattern item. For discussion of the callout +facility, see the +.\" HREF +\fBpcrecallout\fP +.\" +documentation. +.sp + PCRE_BSR_ANYCRLF + PCRE_BSR_UNICODE +.sp +These options (which are mutually exclusive) control what the \eR escape +sequence matches. The choice is either to match only CR, LF, or CRLF, or to +match any Unicode newline sequence. The default is specified when PCRE is +built. It can be overridden from within the pattern, or by setting an option +when a compiled pattern is matched. +.sp + PCRE_CASELESS +.sp +If this bit is set, letters in the pattern match both upper and lower case +letters. It is equivalent to Perl's /i option, and it can be changed within a +pattern by a (?i) option setting. In UTF-8 mode, PCRE always understands the +concept of case for characters whose values are less than 128, so caseless +matching is always possible. For characters with higher values, the concept of +case is supported if PCRE is compiled with Unicode property support, but not +otherwise. If you want to use caseless matching for characters 128 and above, +you must ensure that PCRE is compiled with Unicode property support as well as +with UTF-8 support. +.sp + PCRE_DOLLAR_ENDONLY +.sp +If this bit is set, a dollar metacharacter in the pattern matches only at the +end of the subject string. Without this option, a dollar also matches +immediately before a newline at the end of the string (but not before any other +newlines). The PCRE_DOLLAR_ENDONLY option is ignored if PCRE_MULTILINE is set. +There is no equivalent to this option in Perl, and no way to set it within a +pattern. +.sp + PCRE_DOTALL +.sp +If this bit is set, a dot metacharacter in the pattern matches a character of +any value, including one that indicates a newline. However, it only ever +matches one character, even if newlines are coded as CRLF. Without this option, +a dot does not match when the current position is at a newline. This option is +equivalent to Perl's /s option, and it can be changed within a pattern by a +(?s) option setting. A negative class such as [^a] always matches newline +characters, independent of the setting of this option. +.sp + PCRE_DUPNAMES +.sp +If this bit is set, names used to identify capturing subpatterns need not be +unique. This can be helpful for certain types of pattern when it is known that +only one instance of the named subpattern can ever be matched. There are more +details of named subpatterns below; see also the +.\" HREF +\fBpcrepattern\fP +.\" +documentation. +.sp + PCRE_EXTENDED +.sp +If this bit is set, most white space characters in the pattern are totally +ignored except when escaped or inside a character class. However, white space +is not allowed within sequences such as (?> that introduce various +parenthesized subpatterns, nor within a numerical quantifier such as {1,3}. +However, ignorable white space is permitted between an item and a following +quantifier and between a quantifier and a following + that indicates +possessiveness. +.P +White space did not used to include the VT character (code 11), because Perl +did not treat this character as white space. However, Perl changed at release +5.18, so PCRE followed at release 8.34, and VT is now treated as white space. +.P +PCRE_EXTENDED also causes characters between an unescaped # outside a character +class and the next newline, inclusive, to be ignored. PCRE_EXTENDED is +equivalent to Perl's /x option, and it can be changed within a pattern by a +(?x) option setting. +.P +Which characters are interpreted as newlines is controlled by the options +passed to \fBpcre_compile()\fP or by a special sequence at the start of the +pattern, as described in the section entitled +.\" HTML +.\" +"Newline conventions" +.\" +in the \fBpcrepattern\fP documentation. Note that the end of this type of +comment is a literal newline sequence in the pattern; escape sequences that +happen to represent a newline do not count. +.P +This option makes it possible to include comments inside complicated patterns. +Note, however, that this applies only to data characters. White space characters +may never appear within special character sequences in a pattern, for example +within the sequence (?( that introduces a conditional subpattern. +.sp + PCRE_EXTRA +.sp +This option was invented in order to turn on additional functionality of PCRE +that is incompatible with Perl, but it is currently of very little use. When +set, any backslash in a pattern that is followed by a letter that has no +special meaning causes an error, thus reserving these combinations for future +expansion. By default, as in Perl, a backslash followed by a letter with no +special meaning is treated as a literal. (Perl can, however, be persuaded to +give an error for this, by running it with the -w option.) There are at present +no other features controlled by this option. It can also be set by a (?X) +option setting within a pattern. +.sp + PCRE_FIRSTLINE +.sp +If this option is set, an unanchored pattern is required to match before or at +the first newline in the subject string, though the matched text may continue +over the newline. +.sp + PCRE_JAVASCRIPT_COMPAT +.sp +If this option is set, PCRE's behaviour is changed in some ways so that it is +compatible with JavaScript rather than Perl. The changes are as follows: +.P +(1) A lone closing square bracket in a pattern causes a compile-time error, +because this is illegal in JavaScript (by default it is treated as a data +character). Thus, the pattern AB]CD becomes illegal when this option is set. +.P +(2) At run time, a back reference to an unset subpattern group matches an empty +string (by default this causes the current matching alternative to fail). A +pattern such as (\e1)(a) succeeds when this option is set (assuming it can find +an "a" in the subject), whereas it fails by default, for Perl compatibility. +.P +(3) \eU matches an upper case "U" character; by default \eU causes a compile +time error (Perl uses \eU to upper case subsequent characters). +.P +(4) \eu matches a lower case "u" character unless it is followed by four +hexadecimal digits, in which case the hexadecimal number defines the code point +to match. By default, \eu causes a compile time error (Perl uses it to upper +case the following character). +.P +(5) \ex matches a lower case "x" character unless it is followed by two +hexadecimal digits, in which case the hexadecimal number defines the code point +to match. By default, as in Perl, a hexadecimal number is always expected after +\ex, but it may have zero, one, or two digits (so, for example, \exz matches a +binary zero character followed by z). +.sp + PCRE_MULTILINE +.sp +By default, for the purposes of matching "start of line" and "end of line", +PCRE treats the subject string as consisting of a single line of characters, +even if it actually contains newlines. The "start of line" metacharacter (^) +matches only at the start of the string, and the "end of line" metacharacter +($) matches only at the end of the string, or before a terminating newline +(except when PCRE_DOLLAR_ENDONLY is set). Note, however, that unless +PCRE_DOTALL is set, the "any character" metacharacter (.) does not match at a +newline. This behaviour (for ^, $, and dot) is the same as Perl. +.P +When PCRE_MULTILINE it is set, the "start of line" and "end of line" constructs +match immediately following or immediately before internal newlines in the +subject string, respectively, as well as at the very start and end. This is +equivalent to Perl's /m option, and it can be changed within a pattern by a +(?m) option setting. If there are no newlines in a subject string, or no +occurrences of ^ or $ in a pattern, setting PCRE_MULTILINE has no effect. +.sp + PCRE_NEVER_UTF +.sp +This option locks out interpretation of the pattern as UTF-8 (or UTF-16 or +UTF-32 in the 16-bit and 32-bit libraries). In particular, it prevents the +creator of the pattern from switching to UTF interpretation by starting the +pattern with (*UTF). This may be useful in applications that process patterns +from external sources. The combination of PCRE_UTF8 and PCRE_NEVER_UTF also +causes an error. +.sp + PCRE_NEWLINE_CR + PCRE_NEWLINE_LF + PCRE_NEWLINE_CRLF + PCRE_NEWLINE_ANYCRLF + PCRE_NEWLINE_ANY +.sp +These options override the default newline definition that was chosen when PCRE +was built. Setting the first or the second specifies that a newline is +indicated by a single character (CR or LF, respectively). Setting +PCRE_NEWLINE_CRLF specifies that a newline is indicated by the two-character +CRLF sequence. Setting PCRE_NEWLINE_ANYCRLF specifies that any of the three +preceding sequences should be recognized. Setting PCRE_NEWLINE_ANY specifies +that any Unicode newline sequence should be recognized. +.P +In an ASCII/Unicode environment, the Unicode newline sequences are the three +just mentioned, plus the single characters VT (vertical tab, U+000B), FF (form +feed, U+000C), NEL (next line, U+0085), LS (line separator, U+2028), and PS +(paragraph separator, U+2029). For the 8-bit library, the last two are +recognized only in UTF-8 mode. +.P +When PCRE is compiled to run in an EBCDIC (mainframe) environment, the code for +CR is 0x0d, the same as ASCII. However, the character code for LF is normally +0x15, though in some EBCDIC environments 0x25 is used. Whichever of these is +not LF is made to correspond to Unicode's NEL character. EBCDIC codes are all +less than 256. For more details, see the +.\" HREF +\fBpcrebuild\fP +.\" +documentation. +.P +The newline setting in the options word uses three bits that are treated +as a number, giving eight possibilities. Currently only six are used (default +plus the five values above). This means that if you set more than one newline +option, the combination may or may not be sensible. For example, +PCRE_NEWLINE_CR with PCRE_NEWLINE_LF is equivalent to PCRE_NEWLINE_CRLF, but +other combinations may yield unused numbers and cause an error. +.P +The only time that a line break in a pattern is specially recognized when +compiling is when PCRE_EXTENDED is set. CR and LF are white space characters, +and so are ignored in this mode. Also, an unescaped # outside a character class +indicates a comment that lasts until after the next line break sequence. In +other circumstances, line break sequences in patterns are treated as literal +data. +.P +The newline option that is set at compile time becomes the default that is used +for \fBpcre_exec()\fP and \fBpcre_dfa_exec()\fP, but it can be overridden. +.sp + PCRE_NO_AUTO_CAPTURE +.sp +If this option is set, it disables the use of numbered capturing parentheses in +the pattern. Any opening parenthesis that is not followed by ? behaves as if it +were followed by ?: but named parentheses can still be used for capturing (and +they acquire numbers in the usual way). There is no equivalent of this option +in Perl. +.sp + PCRE_NO_AUTO_POSSESS +.sp +If this option is set, it disables "auto-possessification". This is an +optimization that, for example, turns a+b into a++b in order to avoid +backtracks into a+ that can never be successful. However, if callouts are in +use, auto-possessification means that some of them are never taken. You can set +this option if you want the matching functions to do a full unoptimized search +and run all the callouts, but it is mainly provided for testing purposes. +.sp + PCRE_NO_START_OPTIMIZE +.sp +This is an option that acts at matching time; that is, it is really an option +for \fBpcre_exec()\fP or \fBpcre_dfa_exec()\fP. If it is set at compile time, +it is remembered with the compiled pattern and assumed at matching time. This +is necessary if you want to use JIT execution, because the JIT compiler needs +to know whether or not this option is set. For details see the discussion of +PCRE_NO_START_OPTIMIZE +.\" HTML +.\" +below. +.\" +.sp + PCRE_UCP +.sp +This option changes the way PCRE processes \eB, \eb, \eD, \ed, \eS, \es, \eW, +\ew, and some of the POSIX character classes. By default, only ASCII characters +are recognized, but if PCRE_UCP is set, Unicode properties are used instead to +classify characters. More details are given in the section on +.\" HTML +.\" +generic character types +.\" +in the +.\" HREF +\fBpcrepattern\fP +.\" +page. If you set PCRE_UCP, matching one of the items it affects takes much +longer. The option is available only if PCRE has been compiled with Unicode +property support. +.sp + PCRE_UNGREEDY +.sp +This option inverts the "greediness" of the quantifiers so that they are not +greedy by default, but become greedy if followed by "?". It is not compatible +with Perl. It can also be set by a (?U) option setting within the pattern. +.sp + PCRE_UTF8 +.sp +This option causes PCRE to regard both the pattern and the subject as strings +of UTF-8 characters instead of single-byte strings. However, it is available +only when PCRE is built to include UTF support. If not, the use of this option +provokes an error. Details of how this option changes the behaviour of PCRE are +given in the +.\" HREF +\fBpcreunicode\fP +.\" +page. +.sp + PCRE_NO_UTF8_CHECK +.sp +When PCRE_UTF8 is set, the validity of the pattern as a UTF-8 string is +automatically checked. There is a discussion about the +.\" HTML +.\" +validity of UTF-8 strings +.\" +in the +.\" HREF +\fBpcreunicode\fP +.\" +page. If an invalid UTF-8 sequence is found, \fBpcre_compile()\fP returns an +error. If you already know that your pattern is valid, and you want to skip +this check for performance reasons, you can set the PCRE_NO_UTF8_CHECK option. +When it is set, the effect of passing an invalid UTF-8 string as a pattern is +undefined. It may cause your program to crash or loop. Note that this option +can also be passed to \fBpcre_exec()\fP and \fBpcre_dfa_exec()\fP, to suppress +the validity checking of subject strings only. If the same string is being +matched many times, the option can be safely set for the second and subsequent +matchings to improve performance. +. +. +.SH "COMPILATION ERROR CODES" +.rs +.sp +The following table lists the error codes than may be returned by +\fBpcre_compile2()\fP, along with the error messages that may be returned by +both compiling functions. Note that error messages are always 8-bit ASCII +strings, even in 16-bit or 32-bit mode. As PCRE has developed, some error codes +have fallen out of use. To avoid confusion, they have not been re-used. +.sp + 0 no error + 1 \e at end of pattern + 2 \ec at end of pattern + 3 unrecognized character follows \e + 4 numbers out of order in {} quantifier + 5 number too big in {} quantifier + 6 missing terminating ] for character class + 7 invalid escape sequence in character class + 8 range out of order in character class + 9 nothing to repeat + 10 [this code is not in use] + 11 internal error: unexpected repeat + 12 unrecognized character after (? or (?- + 13 POSIX named classes are supported only within a class + 14 missing ) + 15 reference to non-existent subpattern + 16 erroffset passed as NULL + 17 unknown option bit(s) set + 18 missing ) after comment + 19 [this code is not in use] + 20 regular expression is too large + 21 failed to get memory + 22 unmatched parentheses + 23 internal error: code overflow + 24 unrecognized character after (?< + 25 lookbehind assertion is not fixed length + 26 malformed number or name after (?( + 27 conditional group contains more than two branches + 28 assertion expected after (?( + 29 (?R or (?[+-]digits must be followed by ) + 30 unknown POSIX class name + 31 POSIX collating elements are not supported + 32 this version of PCRE is compiled without UTF support + 33 [this code is not in use] + 34 character value in \ex{} or \eo{} is too large + 35 invalid condition (?(0) + 36 \eC not allowed in lookbehind assertion + 37 PCRE does not support \eL, \el, \eN{name}, \eU, or \eu + 38 number after (?C is > 255 + 39 closing ) for (?C expected + 40 recursive call could loop indefinitely + 41 unrecognized character after (?P + 42 syntax error in subpattern name (missing terminator) + 43 two named subpatterns have the same name + 44 invalid UTF-8 string (specifically UTF-8) + 45 support for \eP, \ep, and \eX has not been compiled + 46 malformed \eP or \ep sequence + 47 unknown property name after \eP or \ep + 48 subpattern name is too long (maximum 32 characters) + 49 too many named subpatterns (maximum 10000) + 50 [this code is not in use] + 51 octal value is greater than \e377 in 8-bit non-UTF-8 mode + 52 internal error: overran compiling workspace + 53 internal error: previously-checked referenced subpattern + not found + 54 DEFINE group contains more than one branch + 55 repeating a DEFINE group is not allowed + 56 inconsistent NEWLINE options + 57 \eg is not followed by a braced, angle-bracketed, or quoted + name/number or by a plain number + 58 a numbered reference must not be zero + 59 an argument is not allowed for (*ACCEPT), (*FAIL), or (*COMMIT) + 60 (*VERB) not recognized or malformed + 61 number is too big + 62 subpattern name expected + 63 digit expected after (?+ + 64 ] is an invalid data character in JavaScript compatibility mode + 65 different names for subpatterns of the same number are + not allowed + 66 (*MARK) must have an argument + 67 this version of PCRE is not compiled with Unicode property + support + 68 \ec must be followed by an ASCII character + 69 \ek is not followed by a braced, angle-bracketed, or quoted name + 70 internal error: unknown opcode in find_fixedlength() + 71 \eN is not supported in a class + 72 too many forward references + 73 disallowed Unicode code point (>= 0xd800 && <= 0xdfff) + 74 invalid UTF-16 string (specifically UTF-16) + 75 name is too long in (*MARK), (*PRUNE), (*SKIP), or (*THEN) + 76 character value in \eu.... sequence is too large + 77 invalid UTF-32 string (specifically UTF-32) + 78 setting UTF is disabled by the application + 79 non-hex character in \ex{} (closing brace missing?) + 80 non-octal character in \eo{} (closing brace missing?) + 81 missing opening brace after \eo + 82 parentheses are too deeply nested + 83 invalid range in character class + 84 group name must start with a non-digit + 85 parentheses are too deeply nested (stack check) +.sp +The numbers 32 and 10000 in errors 48 and 49 are defaults; different values may +be used if the limits were changed when PCRE was built. +. +. +.\" HTML +.SH "STUDYING A PATTERN" +.rs +.sp +.nf +.B pcre_extra *pcre_study(const pcre *\fIcode\fP, int \fIoptions\fP, +.B " const char **\fIerrptr\fP);" +.fi +.PP +If a compiled pattern is going to be used several times, it is worth spending +more time analyzing it in order to speed up the time taken for matching. The +function \fBpcre_study()\fP takes a pointer to a compiled pattern as its first +argument. If studying the pattern produces additional information that will +help speed up matching, \fBpcre_study()\fP returns a pointer to a +\fBpcre_extra\fP block, in which the \fIstudy_data\fP field points to the +results of the study. +.P +The returned value from \fBpcre_study()\fP can be passed directly to +\fBpcre_exec()\fP or \fBpcre_dfa_exec()\fP. However, a \fBpcre_extra\fP block +also contains other fields that can be set by the caller before the block is +passed; these are described +.\" HTML +.\" +below +.\" +in the section on matching a pattern. +.P +If studying the pattern does not produce any useful information, +\fBpcre_study()\fP returns NULL by default. In that circumstance, if the +calling program wants to pass any of the other fields to \fBpcre_exec()\fP or +\fBpcre_dfa_exec()\fP, it must set up its own \fBpcre_extra\fP block. However, +if \fBpcre_study()\fP is called with the PCRE_STUDY_EXTRA_NEEDED option, it +returns a \fBpcre_extra\fP block even if studying did not find any additional +information. It may still return NULL, however, if an error occurs in +\fBpcre_study()\fP. +.P +The second argument of \fBpcre_study()\fP contains option bits. There are three +further options in addition to PCRE_STUDY_EXTRA_NEEDED: +.sp + PCRE_STUDY_JIT_COMPILE + PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE + PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE +.sp +If any of these are set, and the just-in-time compiler is available, the +pattern is further compiled into machine code that executes much faster than +the \fBpcre_exec()\fP interpretive matching function. If the just-in-time +compiler is not available, these options are ignored. All undefined bits in the +\fIoptions\fP argument must be zero. +.P +JIT compilation is a heavyweight optimization. It can take some time for +patterns to be analyzed, and for one-off matches and simple patterns the +benefit of faster execution might be offset by a much slower study time. +Not all patterns can be optimized by the JIT compiler. For those that cannot be +handled, matching automatically falls back to the \fBpcre_exec()\fP +interpreter. For more details, see the +.\" HREF +\fBpcrejit\fP +.\" +documentation. +.P +The third argument for \fBpcre_study()\fP is a pointer for an error message. If +studying succeeds (even if no data is returned), the variable it points to is +set to NULL. Otherwise it is set to point to a textual error message. This is a +static string that is part of the library. You must not try to free it. You +should test the error pointer for NULL after calling \fBpcre_study()\fP, to be +sure that it has run successfully. +.P +When you are finished with a pattern, you can free the memory used for the +study data by calling \fBpcre_free_study()\fP. This function was added to the +API for release 8.20. For earlier versions, the memory could be freed with +\fBpcre_free()\fP, just like the pattern itself. This will still work in cases +where JIT optimization is not used, but it is advisable to change to the new +function when convenient. +.P +This is a typical way in which \fBpcre_study\fP() is used (except that in a +real application there should be tests for errors): +.sp + int rc; + pcre *re; + pcre_extra *sd; + re = pcre_compile("pattern", 0, &error, &erroroffset, NULL); + sd = pcre_study( + re, /* result of pcre_compile() */ + 0, /* no options */ + &error); /* set to NULL or points to a message */ + rc = pcre_exec( /* see below for details of pcre_exec() options */ + re, sd, "subject", 7, 0, 0, ovector, 30); + ... + pcre_free_study(sd); + pcre_free(re); +.sp +Studying a pattern does two things: first, a lower bound for the length of +subject string that is needed to match the pattern is computed. This does not +mean that there are any strings of that length that match, but it does +guarantee that no shorter strings match. The value is used to avoid wasting +time by trying to match strings that are shorter than the lower bound. You can +find out the value in a calling program via the \fBpcre_fullinfo()\fP function. +.P +Studying a pattern is also useful for non-anchored patterns that do not have a +single fixed starting character. A bitmap of possible starting bytes is +created. This speeds up finding a position in the subject at which to start +matching. (In 16-bit mode, the bitmap is used for 16-bit values less than 256. +In 32-bit mode, the bitmap is used for 32-bit values less than 256.) +.P +These two optimizations apply to both \fBpcre_exec()\fP and +\fBpcre_dfa_exec()\fP, and the information is also used by the JIT compiler. +The optimizations can be disabled by setting the PCRE_NO_START_OPTIMIZE option. +You might want to do this if your pattern contains callouts or (*MARK) and you +want to make use of these facilities in cases where matching fails. +.P +PCRE_NO_START_OPTIMIZE can be specified at either compile time or execution +time. However, if PCRE_NO_START_OPTIMIZE is passed to \fBpcre_exec()\fP, (that +is, after any JIT compilation has happened) JIT execution is disabled. For JIT +execution to work with PCRE_NO_START_OPTIMIZE, the option must be set at +compile time. +.P +There is a longer discussion of PCRE_NO_START_OPTIMIZE +.\" HTML +.\" +below. +.\" +. +. +.\" HTML +.SH "LOCALE SUPPORT" +.rs +.sp +PCRE handles caseless matching, and determines whether characters are letters, +digits, or whatever, by reference to a set of tables, indexed by character +code point. When running in UTF-8 mode, or in the 16- or 32-bit libraries, this +applies only to characters with code points less than 256. By default, +higher-valued code points never match escapes such as \ew or \ed. However, if +PCRE is built with Unicode property support, all characters can be tested with +\ep and \eP, or, alternatively, the PCRE_UCP option can be set when a pattern +is compiled; this causes \ew and friends to use Unicode property support +instead of the built-in tables. +.P +The use of locales with Unicode is discouraged. If you are handling characters +with code points greater than 128, you should either use Unicode support, or +use locales, but not try to mix the two. +.P +PCRE contains an internal set of tables that are used when the final argument +of \fBpcre_compile()\fP is NULL. These are sufficient for many applications. +Normally, the internal tables recognize only ASCII characters. However, when +PCRE is built, it is possible to cause the internal tables to be rebuilt in the +default "C" locale of the local system, which may cause them to be different. +.P +The internal tables can always be overridden by tables supplied by the +application that calls PCRE. These may be created in a different locale from +the default. As more and more applications change to using Unicode, the need +for this locale support is expected to die away. +.P +External tables are built by calling the \fBpcre_maketables()\fP function, +which has no arguments, in the relevant locale. The result can then be passed +to \fBpcre_compile()\fP as often as necessary. For example, to build and use +tables that are appropriate for the French locale (where accented characters +with values greater than 128 are treated as letters), the following code could +be used: +.sp + setlocale(LC_CTYPE, "fr_FR"); + tables = pcre_maketables(); + re = pcre_compile(..., tables); +.sp +The locale name "fr_FR" is used on Linux and other Unix-like systems; if you +are using Windows, the name for the French locale is "french". +.P +When \fBpcre_maketables()\fP runs, the tables are built in memory that is +obtained via \fBpcre_malloc\fP. It is the caller's responsibility to ensure +that the memory containing the tables remains available for as long as it is +needed. +.P +The pointer that is passed to \fBpcre_compile()\fP is saved with the compiled +pattern, and the same tables are used via this pointer by \fBpcre_study()\fP +and also by \fBpcre_exec()\fP and \fBpcre_dfa_exec()\fP. Thus, for any single +pattern, compilation, studying and matching all happen in the same locale, but +different patterns can be processed in different locales. +.P +It is possible to pass a table pointer or NULL (indicating the use of the +internal tables) to \fBpcre_exec()\fP or \fBpcre_dfa_exec()\fP (see the +discussion below in the section on matching a pattern). This facility is +provided for use with pre-compiled patterns that have been saved and reloaded. +Character tables are not saved with patterns, so if a non-standard table was +used at compile time, it must be provided again when the reloaded pattern is +matched. Attempting to use this facility to match a pattern in a different +locale from the one in which it was compiled is likely to lead to anomalous +(usually incorrect) results. +. +. +.\" HTML +.SH "INFORMATION ABOUT A PATTERN" +.rs +.sp +.nf +.B int pcre_fullinfo(const pcre *\fIcode\fP, "const pcre_extra *\fIextra\fP," +.B " int \fIwhat\fP, void *\fIwhere\fP);" +.fi +.PP +The \fBpcre_fullinfo()\fP function returns information about a compiled +pattern. It replaces the \fBpcre_info()\fP function, which was removed from the +library at version 8.30, after more than 10 years of obsolescence. +.P +The first argument for \fBpcre_fullinfo()\fP is a pointer to the compiled +pattern. The second argument is the result of \fBpcre_study()\fP, or NULL if +the pattern was not studied. The third argument specifies which piece of +information is required, and the fourth argument is a pointer to a variable +to receive the data. The yield of the function is zero for success, or one of +the following negative numbers: +.sp + PCRE_ERROR_NULL the argument \fIcode\fP was NULL + the argument \fIwhere\fP was NULL + PCRE_ERROR_BADMAGIC the "magic number" was not found + PCRE_ERROR_BADENDIANNESS the pattern was compiled with different + endianness + PCRE_ERROR_BADOPTION the value of \fIwhat\fP was invalid + PCRE_ERROR_UNSET the requested field is not set +.sp +The "magic number" is placed at the start of each compiled pattern as a simple +check against passing an arbitrary memory pointer. The endianness error can +occur if a compiled pattern is saved and reloaded on a different host. Here is +a typical call of \fBpcre_fullinfo()\fP, to obtain the length of the compiled +pattern: +.sp + int rc; + size_t length; + rc = pcre_fullinfo( + re, /* result of pcre_compile() */ + sd, /* result of pcre_study(), or NULL */ + PCRE_INFO_SIZE, /* what is required */ + &length); /* where to put the data */ +.sp +The possible values for the third argument are defined in \fBpcre.h\fP, and are +as follows: +.sp + PCRE_INFO_BACKREFMAX +.sp +Return the number of the highest back reference in the pattern. The fourth +argument should point to an \fBint\fP variable. Zero is returned if there are +no back references. +.sp + PCRE_INFO_CAPTURECOUNT +.sp +Return the number of capturing subpatterns in the pattern. The fourth argument +should point to an \fBint\fP variable. +.sp + PCRE_INFO_DEFAULT_TABLES +.sp +Return a pointer to the internal default character tables within PCRE. The +fourth argument should point to an \fBunsigned char *\fP variable. This +information call is provided for internal use by the \fBpcre_study()\fP +function. External callers can cause PCRE to use its internal tables by passing +a NULL table pointer. +.sp + PCRE_INFO_FIRSTBYTE (deprecated) +.sp +Return information about the first data unit of any matched string, for a +non-anchored pattern. The name of this option refers to the 8-bit library, +where data units are bytes. The fourth argument should point to an \fBint\fP +variable. Negative values are used for special cases. However, this means that +when the 32-bit library is in non-UTF-32 mode, the full 32-bit range of +characters cannot be returned. For this reason, this value is deprecated; use +PCRE_INFO_FIRSTCHARACTERFLAGS and PCRE_INFO_FIRSTCHARACTER instead. +.P +If there is a fixed first value, for example, the letter "c" from a pattern +such as (cat|cow|coyote), its value is returned. In the 8-bit library, the +value is always less than 256. In the 16-bit library the value can be up to +0xffff. In the 32-bit library the value can be up to 0x10ffff. +.P +If there is no fixed first value, and if either +.sp +(a) the pattern was compiled with the PCRE_MULTILINE option, and every branch +starts with "^", or +.sp +(b) every branch of the pattern starts with ".*" and PCRE_DOTALL is not set +(if it were set, the pattern would be anchored), +.sp +-1 is returned, indicating that the pattern matches only at the start of a +subject string or after any newline within the string. Otherwise -2 is +returned. For anchored patterns, -2 is returned. +.sp + PCRE_INFO_FIRSTCHARACTER +.sp +Return the value of the first data unit (non-UTF character) of any matched +string in the situation where PCRE_INFO_FIRSTCHARACTERFLAGS returns 1; +otherwise return 0. The fourth argument should point to a \fBuint_t\fP +variable. +.P +In the 8-bit library, the value is always less than 256. In the 16-bit library +the value can be up to 0xffff. In the 32-bit library in UTF-32 mode the value +can be up to 0x10ffff, and up to 0xffffffff when not using UTF-32 mode. +.sp + PCRE_INFO_FIRSTCHARACTERFLAGS +.sp +Return information about the first data unit of any matched string, for a +non-anchored pattern. The fourth argument should point to an \fBint\fP +variable. +.P +If there is a fixed first value, for example, the letter "c" from a pattern +such as (cat|cow|coyote), 1 is returned, and the character value can be +retrieved using PCRE_INFO_FIRSTCHARACTER. If there is no fixed first value, and +if either +.sp +(a) the pattern was compiled with the PCRE_MULTILINE option, and every branch +starts with "^", or +.sp +(b) every branch of the pattern starts with ".*" and PCRE_DOTALL is not set +(if it were set, the pattern would be anchored), +.sp +2 is returned, indicating that the pattern matches only at the start of a +subject string or after any newline within the string. Otherwise 0 is +returned. For anchored patterns, 0 is returned. +.sp + PCRE_INFO_FIRSTTABLE +.sp +If the pattern was studied, and this resulted in the construction of a 256-bit +table indicating a fixed set of values for the first data unit in any matching +string, a pointer to the table is returned. Otherwise NULL is returned. The +fourth argument should point to an \fBunsigned char *\fP variable. +.sp + PCRE_INFO_HASCRORLF +.sp +Return 1 if the pattern contains any explicit matches for CR or LF characters, +otherwise 0. The fourth argument should point to an \fBint\fP variable. An +explicit match is either a literal CR or LF character, or \er or \en. +.sp + PCRE_INFO_JCHANGED +.sp +Return 1 if the (?J) or (?-J) option setting is used in the pattern, otherwise +0. The fourth argument should point to an \fBint\fP variable. (?J) and +(?-J) set and unset the local PCRE_DUPNAMES option, respectively. +.sp + PCRE_INFO_JIT +.sp +Return 1 if the pattern was studied with one of the JIT options, and +just-in-time compiling was successful. The fourth argument should point to an +\fBint\fP variable. A return value of 0 means that JIT support is not available +in this version of PCRE, or that the pattern was not studied with a JIT option, +or that the JIT compiler could not handle this particular pattern. See the +.\" HREF +\fBpcrejit\fP +.\" +documentation for details of what can and cannot be handled. +.sp + PCRE_INFO_JITSIZE +.sp +If the pattern was successfully studied with a JIT option, return the size of +the JIT compiled code, otherwise return zero. The fourth argument should point +to a \fBsize_t\fP variable. +.sp + PCRE_INFO_LASTLITERAL +.sp +Return the value of the rightmost literal data unit that must exist in any +matched string, other than at its start, if such a value has been recorded. The +fourth argument should point to an \fBint\fP variable. If there is no such +value, -1 is returned. For anchored patterns, a last literal value is recorded +only if it follows something of variable length. For example, for the pattern +/^a\ed+z\ed+/ the returned value is "z", but for /^a\edz\ed/ the returned value +is -1. +.P +Since for the 32-bit library using the non-UTF-32 mode, this function is unable +to return the full 32-bit range of characters, this value is deprecated; +instead the PCRE_INFO_REQUIREDCHARFLAGS and PCRE_INFO_REQUIREDCHAR values should +be used. +.sp + PCRE_INFO_MATCH_EMPTY +.sp +Return 1 if the pattern can match an empty string, otherwise 0. The fourth +argument should point to an \fBint\fP variable. +.sp + PCRE_INFO_MATCHLIMIT +.sp +If the pattern set a match limit by including an item of the form +(*LIMIT_MATCH=nnnn) at the start, the value is returned. The fourth argument +should point to an unsigned 32-bit integer. If no such value has been set, the +call to \fBpcre_fullinfo()\fP returns the error PCRE_ERROR_UNSET. +.sp + PCRE_INFO_MAXLOOKBEHIND +.sp +Return the number of characters (NB not data units) in the longest lookbehind +assertion in the pattern. This information is useful when doing multi-segment +matching using the partial matching facilities. Note that the simple assertions +\eb and \eB require a one-character lookbehind. \eA also registers a +one-character lookbehind, though it does not actually inspect the previous +character. This is to ensure that at least one character from the old segment +is retained when a new segment is processed. Otherwise, if there are no +lookbehinds in the pattern, \eA might match incorrectly at the start of a new +segment. +.sp + PCRE_INFO_MINLENGTH +.sp +If the pattern was studied and a minimum length for matching subject strings +was computed, its value is returned. Otherwise the returned value is -1. The +value is a number of characters, which in UTF mode may be different from the +number of data units. The fourth argument should point to an \fBint\fP +variable. A non-negative value is a lower bound to the length of any matching +string. There may not be any strings of that length that do actually match, but +every string that does match is at least that long. +.sp + PCRE_INFO_NAMECOUNT + PCRE_INFO_NAMEENTRYSIZE + PCRE_INFO_NAMETABLE +.sp +PCRE supports the use of named as well as numbered capturing parentheses. The +names are just an additional way of identifying the parentheses, which still +acquire numbers. Several convenience functions such as +\fBpcre_get_named_substring()\fP are provided for extracting captured +substrings by name. It is also possible to extract the data directly, by first +converting the name to a number in order to access the correct pointers in the +output vector (described with \fBpcre_exec()\fP below). To do the conversion, +you need to use the name-to-number map, which is described by these three +values. +.P +The map consists of a number of fixed-size entries. PCRE_INFO_NAMECOUNT gives +the number of entries, and PCRE_INFO_NAMEENTRYSIZE gives the size of each +entry; both of these return an \fBint\fP value. The entry size depends on the +length of the longest name. PCRE_INFO_NAMETABLE returns a pointer to the first +entry of the table. This is a pointer to \fBchar\fP in the 8-bit library, where +the first two bytes of each entry are the number of the capturing parenthesis, +most significant byte first. In the 16-bit library, the pointer points to +16-bit data units, the first of which contains the parenthesis number. In the +32-bit library, the pointer points to 32-bit data units, the first of which +contains the parenthesis number. The rest of the entry is the corresponding +name, zero terminated. +.P +The names are in alphabetical order. If (?| is used to create multiple groups +with the same number, as described in the +.\" HTML +.\" +section on duplicate subpattern numbers +.\" +in the +.\" HREF +\fBpcrepattern\fP +.\" +page, the groups may be given the same name, but there is only one entry in the +table. Different names for groups of the same number are not permitted. +Duplicate names for subpatterns with different numbers are permitted, +but only if PCRE_DUPNAMES is set. They appear in the table in the order in +which they were found in the pattern. In the absence of (?| this is the order +of increasing number; when (?| is used this is not necessarily the case because +later subpatterns may have lower numbers. +.P +As a simple example of the name/number table, consider the following pattern +after compilation by the 8-bit library (assume PCRE_EXTENDED is set, so white +space - including newlines - is ignored): +.sp +.\" JOIN + (? (?(\ed\ed)?\ed\ed) - + (?\ed\ed) - (?\ed\ed) ) +.sp +There are four named subpatterns, so the table has four entries, and each entry +in the table is eight bytes long. The table is as follows, with non-printing +bytes shows in hexadecimal, and undefined bytes shown as ??: +.sp + 00 01 d a t e 00 ?? + 00 05 d a y 00 ?? ?? + 00 04 m o n t h 00 + 00 02 y e a r 00 ?? +.sp +When writing code to extract data from named subpatterns using the +name-to-number map, remember that the length of the entries is likely to be +different for each compiled pattern. +.sp + PCRE_INFO_OKPARTIAL +.sp +Return 1 if the pattern can be used for partial matching with +\fBpcre_exec()\fP, otherwise 0. The fourth argument should point to an +\fBint\fP variable. From release 8.00, this always returns 1, because the +restrictions that previously applied to partial matching have been lifted. The +.\" HREF +\fBpcrepartial\fP +.\" +documentation gives details of partial matching. +.sp + PCRE_INFO_OPTIONS +.sp +Return a copy of the options with which the pattern was compiled. The fourth +argument should point to an \fBunsigned long int\fP variable. These option bits +are those specified in the call to \fBpcre_compile()\fP, modified by any +top-level option settings at the start of the pattern itself. In other words, +they are the options that will be in force when matching starts. For example, +if the pattern /(?im)abc(?-i)d/ is compiled with the PCRE_EXTENDED option, the +result is PCRE_CASELESS, PCRE_MULTILINE, and PCRE_EXTENDED. +.P +A pattern is automatically anchored by PCRE if all of its top-level +alternatives begin with one of the following: +.sp + ^ unless PCRE_MULTILINE is set + \eA always + \eG always +.\" JOIN + .* if PCRE_DOTALL is set and there are no back + references to the subpattern in which .* appears +.sp +For such patterns, the PCRE_ANCHORED bit is set in the options returned by +\fBpcre_fullinfo()\fP. +.sp + PCRE_INFO_RECURSIONLIMIT +.sp +If the pattern set a recursion limit by including an item of the form +(*LIMIT_RECURSION=nnnn) at the start, the value is returned. The fourth +argument should point to an unsigned 32-bit integer. If no such value has been +set, the call to \fBpcre_fullinfo()\fP returns the error PCRE_ERROR_UNSET. +.sp + PCRE_INFO_SIZE +.sp +Return the size of the compiled pattern in bytes (for all three libraries). The +fourth argument should point to a \fBsize_t\fP variable. This value does not +include the size of the \fBpcre\fP structure that is returned by +\fBpcre_compile()\fP. The value that is passed as the argument to +\fBpcre_malloc()\fP when \fBpcre_compile()\fP is getting memory in which to +place the compiled data is the value returned by this option plus the size of +the \fBpcre\fP structure. Studying a compiled pattern, with or without JIT, +does not alter the value returned by this option. +.sp + PCRE_INFO_STUDYSIZE +.sp +Return the size in bytes (for all three libraries) of the data block pointed to +by the \fIstudy_data\fP field in a \fBpcre_extra\fP block. If \fBpcre_extra\fP +is NULL, or there is no study data, zero is returned. The fourth argument +should point to a \fBsize_t\fP variable. The \fIstudy_data\fP field is set by +\fBpcre_study()\fP to record information that will speed up matching (see the +section entitled +.\" HTML +.\" +"Studying a pattern" +.\" +above). The format of the \fIstudy_data\fP block is private, but its length +is made available via this option so that it can be saved and restored (see the +.\" HREF +\fBpcreprecompile\fP +.\" +documentation for details). +.sp + PCRE_INFO_REQUIREDCHARFLAGS +.sp +Returns 1 if there is a rightmost literal data unit that must exist in any +matched string, other than at its start. The fourth argument should point to +an \fBint\fP variable. If there is no such value, 0 is returned. If returning +1, the character value itself can be retrieved using PCRE_INFO_REQUIREDCHAR. +.P +For anchored patterns, a last literal value is recorded only if it follows +something of variable length. For example, for the pattern /^a\ed+z\ed+/ the +returned value 1 (with "z" returned from PCRE_INFO_REQUIREDCHAR), but for +/^a\edz\ed/ the returned value is 0. +.sp + PCRE_INFO_REQUIREDCHAR +.sp +Return the value of the rightmost literal data unit that must exist in any +matched string, other than at its start, if such a value has been recorded. The +fourth argument should point to a \fBuint32_t\fP variable. If there is no such +value, 0 is returned. +. +. +.SH "REFERENCE COUNTS" +.rs +.sp +.B int pcre_refcount(pcre *\fIcode\fP, int \fIadjust\fP); +.PP +The \fBpcre_refcount()\fP function is used to maintain a reference count in the +data block that contains a compiled pattern. It is provided for the benefit of +applications that operate in an object-oriented manner, where different parts +of the application may be using the same compiled pattern, but you want to free +the block when they are all done. +.P +When a pattern is compiled, the reference count field is initialized to zero. +It is changed only by calling this function, whose action is to add the +\fIadjust\fP value (which may be positive or negative) to it. The yield of the +function is the new value. However, the value of the count is constrained to +lie between 0 and 65535, inclusive. If the new value is outside these limits, +it is forced to the appropriate limit value. +.P +Except when it is zero, the reference count is not correctly preserved if a +pattern is compiled on one host and then transferred to a host whose byte-order +is different. (This seems a highly unlikely scenario.) +. +. +.SH "MATCHING A PATTERN: THE TRADITIONAL FUNCTION" +.rs +.sp +.nf +.B int pcre_exec(const pcre *\fIcode\fP, "const pcre_extra *\fIextra\fP," +.B " const char *\fIsubject\fP," int \fIlength\fP, int \fIstartoffset\fP, +.B " int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP);" +.fi +.P +The function \fBpcre_exec()\fP is called to match a subject string against a +compiled pattern, which is passed in the \fIcode\fP argument. If the +pattern was studied, the result of the study should be passed in the +\fIextra\fP argument. You can call \fBpcre_exec()\fP with the same \fIcode\fP +and \fIextra\fP arguments as many times as you like, in order to match +different subject strings with the same pattern. +.P +This function is the main matching facility of the library, and it operates in +a Perl-like manner. For specialist use there is also an alternative matching +function, which is described +.\" HTML +.\" +below +.\" +in the section about the \fBpcre_dfa_exec()\fP function. +.P +In most applications, the pattern will have been compiled (and optionally +studied) in the same process that calls \fBpcre_exec()\fP. However, it is +possible to save compiled patterns and study data, and then use them later +in different processes, possibly even on different hosts. For a discussion +about this, see the +.\" HREF +\fBpcreprecompile\fP +.\" +documentation. +.P +Here is an example of a simple call to \fBpcre_exec()\fP: +.sp + int rc; + int ovector[30]; + rc = pcre_exec( + re, /* result of pcre_compile() */ + NULL, /* we didn't study the pattern */ + "some string", /* the subject string */ + 11, /* the length of the subject string */ + 0, /* start at offset 0 in the subject */ + 0, /* default options */ + ovector, /* vector of integers for substring information */ + 30); /* number of elements (NOT size in bytes) */ +. +. +.\" HTML +.SS "Extra data for \fBpcre_exec()\fR" +.rs +.sp +If the \fIextra\fP argument is not NULL, it must point to a \fBpcre_extra\fP +data block. The \fBpcre_study()\fP function returns such a block (when it +doesn't return NULL), but you can also create one for yourself, and pass +additional information in it. The \fBpcre_extra\fP block contains the following +fields (not necessarily in this order): +.sp + unsigned long int \fIflags\fP; + void *\fIstudy_data\fP; + void *\fIexecutable_jit\fP; + unsigned long int \fImatch_limit\fP; + unsigned long int \fImatch_limit_recursion\fP; + void *\fIcallout_data\fP; + const unsigned char *\fItables\fP; + unsigned char **\fImark\fP; +.sp +In the 16-bit version of this structure, the \fImark\fP field has type +"PCRE_UCHAR16 **". +.sp +In the 32-bit version of this structure, the \fImark\fP field has type +"PCRE_UCHAR32 **". +.P +The \fIflags\fP field is used to specify which of the other fields are set. The +flag bits are: +.sp + PCRE_EXTRA_CALLOUT_DATA + PCRE_EXTRA_EXECUTABLE_JIT + PCRE_EXTRA_MARK + PCRE_EXTRA_MATCH_LIMIT + PCRE_EXTRA_MATCH_LIMIT_RECURSION + PCRE_EXTRA_STUDY_DATA + PCRE_EXTRA_TABLES +.sp +Other flag bits should be set to zero. The \fIstudy_data\fP field and sometimes +the \fIexecutable_jit\fP field are set in the \fBpcre_extra\fP block that is +returned by \fBpcre_study()\fP, together with the appropriate flag bits. You +should not set these yourself, but you may add to the block by setting other +fields and their corresponding flag bits. +.P +The \fImatch_limit\fP field provides a means of preventing PCRE from using up a +vast amount of resources when running patterns that are not going to match, +but which have a very large number of possibilities in their search trees. The +classic example is a pattern that uses nested unlimited repeats. +.P +Internally, \fBpcre_exec()\fP uses a function called \fBmatch()\fP, which it +calls repeatedly (sometimes recursively). The limit set by \fImatch_limit\fP is +imposed on the number of times this function is called during a match, which +has the effect of limiting the amount of backtracking that can take place. For +patterns that are not anchored, the count restarts from zero for each position +in the subject string. +.P +When \fBpcre_exec()\fP is called with a pattern that was successfully studied +with a JIT option, the way that the matching is executed is entirely different. +However, there is still the possibility of runaway matching that goes on for a +very long time, and so the \fImatch_limit\fP value is also used in this case +(but in a different way) to limit how long the matching can continue. +.P +The default value for the limit can be set when PCRE is built; the default +default is 10 million, which handles all but the most extreme cases. You can +override the default by supplying \fBpcre_exec()\fP with a \fBpcre_extra\fP +block in which \fImatch_limit\fP is set, and PCRE_EXTRA_MATCH_LIMIT is set in +the \fIflags\fP field. If the limit is exceeded, \fBpcre_exec()\fP returns +PCRE_ERROR_MATCHLIMIT. +.P +A value for the match limit may also be supplied by an item at the start of a +pattern of the form +.sp + (*LIMIT_MATCH=d) +.sp +where d is a decimal number. However, such a setting is ignored unless d is +less than the limit set by the caller of \fBpcre_exec()\fP or, if no such limit +is set, less than the default. +.P +The \fImatch_limit_recursion\fP field is similar to \fImatch_limit\fP, but +instead of limiting the total number of times that \fBmatch()\fP is called, it +limits the depth of recursion. The recursion depth is a smaller number than the +total number of calls, because not all calls to \fBmatch()\fP are recursive. +This limit is of use only if it is set smaller than \fImatch_limit\fP. +.P +Limiting the recursion depth limits the amount of machine stack that can be +used, or, when PCRE has been compiled to use memory on the heap instead of the +stack, the amount of heap memory that can be used. This limit is not relevant, +and is ignored, when matching is done using JIT compiled code. +.P +The default value for \fImatch_limit_recursion\fP can be set when PCRE is +built; the default default is the same value as the default for +\fImatch_limit\fP. You can override the default by supplying \fBpcre_exec()\fP +with a \fBpcre_extra\fP block in which \fImatch_limit_recursion\fP is set, and +PCRE_EXTRA_MATCH_LIMIT_RECURSION is set in the \fIflags\fP field. If the limit +is exceeded, \fBpcre_exec()\fP returns PCRE_ERROR_RECURSIONLIMIT. +.P +A value for the recursion limit may also be supplied by an item at the start of +a pattern of the form +.sp + (*LIMIT_RECURSION=d) +.sp +where d is a decimal number. However, such a setting is ignored unless d is +less than the limit set by the caller of \fBpcre_exec()\fP or, if no such limit +is set, less than the default. +.P +The \fIcallout_data\fP field is used in conjunction with the "callout" feature, +and is described in the +.\" HREF +\fBpcrecallout\fP +.\" +documentation. +.P +The \fItables\fP field is provided for use with patterns that have been +pre-compiled using custom character tables, saved to disc or elsewhere, and +then reloaded, because the tables that were used to compile a pattern are not +saved with it. See the +.\" HREF +\fBpcreprecompile\fP +.\" +documentation for a discussion of saving compiled patterns for later use. If +NULL is passed using this mechanism, it forces PCRE's internal tables to be +used. +.P +\fBWarning:\fP The tables that \fBpcre_exec()\fP uses must be the same as those +that were used when the pattern was compiled. If this is not the case, the +behaviour of \fBpcre_exec()\fP is undefined. Therefore, when a pattern is +compiled and matched in the same process, this field should never be set. In +this (the most common) case, the correct table pointer is automatically passed +with the compiled pattern from \fBpcre_compile()\fP to \fBpcre_exec()\fP. +.P +If PCRE_EXTRA_MARK is set in the \fIflags\fP field, the \fImark\fP field must +be set to point to a suitable variable. If the pattern contains any +backtracking control verbs such as (*MARK:NAME), and the execution ends up with +a name to pass back, a pointer to the name string (zero terminated) is placed +in the variable pointed to by the \fImark\fP field. The names are within the +compiled pattern; if you wish to retain such a name you must copy it before +freeing the memory of a compiled pattern. If there is no name to pass back, the +variable pointed to by the \fImark\fP field is set to NULL. For details of the +backtracking control verbs, see the section entitled +.\" HTML +.\" +"Backtracking control" +.\" +in the +.\" HREF +\fBpcrepattern\fP +.\" +documentation. +. +. +.\" HTML +.SS "Option bits for \fBpcre_exec()\fP" +.rs +.sp +The unused bits of the \fIoptions\fP argument for \fBpcre_exec()\fP must be +zero. The only bits that may be set are PCRE_ANCHORED, PCRE_NEWLINE_\fIxxx\fP, +PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NOTEMPTY_ATSTART, +PCRE_NO_START_OPTIMIZE, PCRE_NO_UTF8_CHECK, PCRE_PARTIAL_HARD, and +PCRE_PARTIAL_SOFT. +.P +If the pattern was successfully studied with one of the just-in-time (JIT) +compile options, the only supported options for JIT execution are +PCRE_NO_UTF8_CHECK, PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, +PCRE_NOTEMPTY_ATSTART, PCRE_PARTIAL_HARD, and PCRE_PARTIAL_SOFT. If an +unsupported option is used, JIT execution is disabled and the normal +interpretive code in \fBpcre_exec()\fP is run. +.sp + PCRE_ANCHORED +.sp +The PCRE_ANCHORED option limits \fBpcre_exec()\fP to matching at the first +matching position. If a pattern was compiled with PCRE_ANCHORED, or turned out +to be anchored by virtue of its contents, it cannot be made unachored at +matching time. +.sp + PCRE_BSR_ANYCRLF + PCRE_BSR_UNICODE +.sp +These options (which are mutually exclusive) control what the \eR escape +sequence matches. The choice is either to match only CR, LF, or CRLF, or to +match any Unicode newline sequence. These options override the choice that was +made or defaulted when the pattern was compiled. +.sp + PCRE_NEWLINE_CR + PCRE_NEWLINE_LF + PCRE_NEWLINE_CRLF + PCRE_NEWLINE_ANYCRLF + PCRE_NEWLINE_ANY +.sp +These options override the newline definition that was chosen or defaulted when +the pattern was compiled. For details, see the description of +\fBpcre_compile()\fP above. During matching, the newline choice affects the +behaviour of the dot, circumflex, and dollar metacharacters. It may also alter +the way the match position is advanced after a match failure for an unanchored +pattern. +.P +When PCRE_NEWLINE_CRLF, PCRE_NEWLINE_ANYCRLF, or PCRE_NEWLINE_ANY is set, and a +match attempt for an unanchored pattern fails when the current position is at a +CRLF sequence, and the pattern contains no explicit matches for CR or LF +characters, the match position is advanced by two characters instead of one, in +other words, to after the CRLF. +.P +The above rule is a compromise that makes the most common cases work as +expected. For example, if the pattern is .+A (and the PCRE_DOTALL option is not +set), it does not match the string "\er\enA" because, after failing at the +start, it skips both the CR and the LF before retrying. However, the pattern +[\er\en]A does match that string, because it contains an explicit CR or LF +reference, and so advances only by one character after the first failure. +.P +An explicit match for CR of LF is either a literal appearance of one of those +characters, or one of the \er or \en escape sequences. Implicit matches such as +[^X] do not count, nor does \es (which includes CR and LF in the characters +that it matches). +.P +Notwithstanding the above, anomalous effects may still occur when CRLF is a +valid newline sequence and explicit \er or \en escapes appear in the pattern. +.sp + PCRE_NOTBOL +.sp +This option specifies that first character of the subject string is not the +beginning of a line, so the circumflex metacharacter should not match before +it. Setting this without PCRE_MULTILINE (at compile time) causes circumflex +never to match. This option affects only the behaviour of the circumflex +metacharacter. It does not affect \eA. +.sp + PCRE_NOTEOL +.sp +This option specifies that the end of the subject string is not the end of a +line, so the dollar metacharacter should not match it nor (except in multiline +mode) a newline immediately before it. Setting this without PCRE_MULTILINE (at +compile time) causes dollar never to match. This option affects only the +behaviour of the dollar metacharacter. It does not affect \eZ or \ez. +.sp + PCRE_NOTEMPTY +.sp +An empty string is not considered to be a valid match if this option is set. If +there are alternatives in the pattern, they are tried. If all the alternatives +match the empty string, the entire match fails. For example, if the pattern +.sp + a?b? +.sp +is applied to a string not beginning with "a" or "b", it matches an empty +string at the start of the subject. With PCRE_NOTEMPTY set, this match is not +valid, so PCRE searches further into the string for occurrences of "a" or "b". +.sp + PCRE_NOTEMPTY_ATSTART +.sp +This is like PCRE_NOTEMPTY, except that an empty string match that is not at +the start of the subject is permitted. If the pattern is anchored, such a match +can occur only if the pattern contains \eK. +.P +Perl has no direct equivalent of PCRE_NOTEMPTY or PCRE_NOTEMPTY_ATSTART, but it +does make a special case of a pattern match of the empty string within its +\fBsplit()\fP function, and when using the /g modifier. It is possible to +emulate Perl's behaviour after matching a null string by first trying the match +again at the same offset with PCRE_NOTEMPTY_ATSTART and PCRE_ANCHORED, and then +if that fails, by advancing the starting offset (see below) and trying an +ordinary match again. There is some code that demonstrates how to do this in +the +.\" HREF +\fBpcredemo\fP +.\" +sample program. In the most general case, you have to check to see if the +newline convention recognizes CRLF as a newline, and if so, and the current +character is CR followed by LF, advance the starting offset by two characters +instead of one. +.sp + PCRE_NO_START_OPTIMIZE +.sp +There are a number of optimizations that \fBpcre_exec()\fP uses at the start of +a match, in order to speed up the process. For example, if it is known that an +unanchored match must start with a specific character, it searches the subject +for that character, and fails immediately if it cannot find it, without +actually running the main matching function. This means that a special item +such as (*COMMIT) at the start of a pattern is not considered until after a +suitable starting point for the match has been found. Also, when callouts or +(*MARK) items are in use, these "start-up" optimizations can cause them to be +skipped if the pattern is never actually used. The start-up optimizations are +in effect a pre-scan of the subject that takes place before the pattern is run. +.P +The PCRE_NO_START_OPTIMIZE option disables the start-up optimizations, possibly +causing performance to suffer, but ensuring that in cases where the result is +"no match", the callouts do occur, and that items such as (*COMMIT) and (*MARK) +are considered at every possible starting position in the subject string. If +PCRE_NO_START_OPTIMIZE is set at compile time, it cannot be unset at matching +time. The use of PCRE_NO_START_OPTIMIZE at matching time (that is, passing it +to \fBpcre_exec()\fP) disables JIT execution; in this situation, matching is +always done using interpretively. +.P +Setting PCRE_NO_START_OPTIMIZE can change the outcome of a matching operation. +Consider the pattern +.sp + (*COMMIT)ABC +.sp +When this is compiled, PCRE records the fact that a match must start with the +character "A". Suppose the subject string is "DEFABC". The start-up +optimization scans along the subject, finds "A" and runs the first match +attempt from there. The (*COMMIT) item means that the pattern must match the +current starting position, which in this case, it does. However, if the same +match is run with PCRE_NO_START_OPTIMIZE set, the initial scan along the +subject string does not happen. The first match attempt is run starting from +"D" and when this fails, (*COMMIT) prevents any further matches being tried, so +the overall result is "no match". If the pattern is studied, more start-up +optimizations may be used. For example, a minimum length for the subject may be +recorded. Consider the pattern +.sp + (*MARK:A)(X|Y) +.sp +The minimum length for a match is one character. If the subject is "ABC", there +will be attempts to match "ABC", "BC", "C", and then finally an empty string. +If the pattern is studied, the final attempt does not take place, because PCRE +knows that the subject is too short, and so the (*MARK) is never encountered. +In this case, studying the pattern does not affect the overall match result, +which is still "no match", but it does affect the auxiliary information that is +returned. +.sp + PCRE_NO_UTF8_CHECK +.sp +When PCRE_UTF8 is set at compile time, the validity of the subject as a UTF-8 +string is automatically checked when \fBpcre_exec()\fP is subsequently called. +The entire string is checked before any other processing takes place. The value +of \fIstartoffset\fP is also checked to ensure that it points to the start of a +UTF-8 character. There is a discussion about the +.\" HTML +.\" +validity of UTF-8 strings +.\" +in the +.\" HREF +\fBpcreunicode\fP +.\" +page. If an invalid sequence of bytes is found, \fBpcre_exec()\fP returns the +error PCRE_ERROR_BADUTF8 or, if PCRE_PARTIAL_HARD is set and the problem is a +truncated character at the end of the subject, PCRE_ERROR_SHORTUTF8. In both +cases, information about the precise nature of the error may also be returned +(see the descriptions of these errors in the section entitled \fIError return +values from\fP \fBpcre_exec()\fP +.\" HTML +.\" +below). +.\" +If \fIstartoffset\fP contains a value that does not point to the start of a +UTF-8 character (or to the end of the subject), PCRE_ERROR_BADUTF8_OFFSET is +returned. +.P +If you already know that your subject is valid, and you want to skip these +checks for performance reasons, you can set the PCRE_NO_UTF8_CHECK option when +calling \fBpcre_exec()\fP. You might want to do this for the second and +subsequent calls to \fBpcre_exec()\fP if you are making repeated calls to find +all the matches in a single subject string. However, you should be sure that +the value of \fIstartoffset\fP points to the start of a character (or the end +of the subject). When PCRE_NO_UTF8_CHECK is set, the effect of passing an +invalid string as a subject or an invalid value of \fIstartoffset\fP is +undefined. Your program may crash or loop. +.sp + PCRE_PARTIAL_HARD + PCRE_PARTIAL_SOFT +.sp +These options turn on the partial matching feature. For backwards +compatibility, PCRE_PARTIAL is a synonym for PCRE_PARTIAL_SOFT. A partial match +occurs if the end of the subject string is reached successfully, but there are +not enough subject characters to complete the match. If this happens when +PCRE_PARTIAL_SOFT (but not PCRE_PARTIAL_HARD) is set, matching continues by +testing any remaining alternatives. Only if no complete match can be found is +PCRE_ERROR_PARTIAL returned instead of PCRE_ERROR_NOMATCH. In other words, +PCRE_PARTIAL_SOFT says that the caller is prepared to handle a partial match, +but only if no complete match can be found. +.P +If PCRE_PARTIAL_HARD is set, it overrides PCRE_PARTIAL_SOFT. In this case, if a +partial match is found, \fBpcre_exec()\fP immediately returns +PCRE_ERROR_PARTIAL, without considering any other alternatives. In other words, +when PCRE_PARTIAL_HARD is set, a partial match is considered to be more +important that an alternative complete match. +.P +In both cases, the portion of the string that was inspected when the partial +match was found is set as the first matching string. There is a more detailed +discussion of partial and multi-segment matching, with examples, in the +.\" HREF +\fBpcrepartial\fP +.\" +documentation. +. +. +.SS "The string to be matched by \fBpcre_exec()\fP" +.rs +.sp +The subject string is passed to \fBpcre_exec()\fP as a pointer in +\fIsubject\fP, a length in \fIlength\fP, and a starting offset in +\fIstartoffset\fP. The units for \fIlength\fP and \fIstartoffset\fP are bytes +for the 8-bit library, 16-bit data items for the 16-bit library, and 32-bit +data items for the 32-bit library. +.P +If \fIstartoffset\fP is negative or greater than the length of the subject, +\fBpcre_exec()\fP returns PCRE_ERROR_BADOFFSET. When the starting offset is +zero, the search for a match starts at the beginning of the subject, and this +is by far the most common case. In UTF-8 or UTF-16 mode, the offset must point +to the start of a character, or the end of the subject (in UTF-32 mode, one +data unit equals one character, so all offsets are valid). Unlike the pattern +string, the subject may contain binary zeroes. +.P +A non-zero starting offset is useful when searching for another match in the +same subject by calling \fBpcre_exec()\fP again after a previous success. +Setting \fIstartoffset\fP differs from just passing over a shortened string and +setting PCRE_NOTBOL in the case of a pattern that begins with any kind of +lookbehind. For example, consider the pattern +.sp + \eBiss\eB +.sp +which finds occurrences of "iss" in the middle of words. (\eB matches only if +the current position in the subject is not a word boundary.) When applied to +the string "Mississippi" the first call to \fBpcre_exec()\fP finds the first +occurrence. If \fBpcre_exec()\fP is called again with just the remainder of the +subject, namely "issippi", it does not match, because \eB is always false at +the start of the subject, which is deemed to be a word boundary. However, if +\fBpcre_exec()\fP is passed the entire string again, but with \fIstartoffset\fP +set to 4, it finds the second occurrence of "iss" because it is able to look +behind the starting point to discover that it is preceded by a letter. +.P +Finding all the matches in a subject is tricky when the pattern can match an +empty string. It is possible to emulate Perl's /g behaviour by first trying the +match again at the same offset, with the PCRE_NOTEMPTY_ATSTART and +PCRE_ANCHORED options, and then if that fails, advancing the starting offset +and trying an ordinary match again. There is some code that demonstrates how to +do this in the +.\" HREF +\fBpcredemo\fP +.\" +sample program. In the most general case, you have to check to see if the +newline convention recognizes CRLF as a newline, and if so, and the current +character is CR followed by LF, advance the starting offset by two characters +instead of one. +.P +If a non-zero starting offset is passed when the pattern is anchored, one +attempt to match at the given offset is made. This can only succeed if the +pattern does not require the match to be at the start of the subject. +. +. +.SS "How \fBpcre_exec()\fP returns captured substrings" +.rs +.sp +In general, a pattern matches a certain portion of the subject, and in +addition, further substrings from the subject may be picked out by parts of the +pattern. Following the usage in Jeffrey Friedl's book, this is called +"capturing" in what follows, and the phrase "capturing subpattern" is used for +a fragment of a pattern that picks out a substring. PCRE supports several other +kinds of parenthesized subpattern that do not cause substrings to be captured. +.P +Captured substrings are returned to the caller via a vector of integers whose +address is passed in \fIovector\fP. The number of elements in the vector is +passed in \fIovecsize\fP, which must be a non-negative number. \fBNote\fP: this +argument is NOT the size of \fIovector\fP in bytes. +.P +The first two-thirds of the vector is used to pass back captured substrings, +each substring using a pair of integers. The remaining third of the vector is +used as workspace by \fBpcre_exec()\fP while matching capturing subpatterns, +and is not available for passing back information. The number passed in +\fIovecsize\fP should always be a multiple of three. If it is not, it is +rounded down. +.P +When a match is successful, information about captured substrings is returned +in pairs of integers, starting at the beginning of \fIovector\fP, and +continuing up to two-thirds of its length at the most. The first element of +each pair is set to the offset of the first character in a substring, and the +second is set to the offset of the first character after the end of a +substring. These values are always data unit offsets, even in UTF mode. They +are byte offsets in the 8-bit library, 16-bit data item offsets in the 16-bit +library, and 32-bit data item offsets in the 32-bit library. \fBNote\fP: they +are not character counts. +.P +The first pair of integers, \fIovector[0]\fP and \fIovector[1]\fP, identify the +portion of the subject string matched by the entire pattern. The next pair is +used for the first capturing subpattern, and so on. The value returned by +\fBpcre_exec()\fP is one more than the highest numbered pair that has been set. +For example, if two substrings have been captured, the returned value is 3. If +there are no capturing subpatterns, the return value from a successful match is +1, indicating that just the first pair of offsets has been set. +.P +If a capturing subpattern is matched repeatedly, it is the last portion of the +string that it matched that is returned. +.P +If the vector is too small to hold all the captured substring offsets, it is +used as far as possible (up to two-thirds of its length), and the function +returns a value of zero. If neither the actual string matched nor any captured +substrings are of interest, \fBpcre_exec()\fP may be called with \fIovector\fP +passed as NULL and \fIovecsize\fP as zero. However, if the pattern contains +back references and the \fIovector\fP is not big enough to remember the related +substrings, PCRE has to get additional memory for use during matching. Thus it +is usually advisable to supply an \fIovector\fP of reasonable size. +.P +There are some cases where zero is returned (indicating vector overflow) when +in fact the vector is exactly the right size for the final match. For example, +consider the pattern +.sp + (a)(?:(b)c|bd) +.sp +If a vector of 6 elements (allowing for only 1 captured substring) is given +with subject string "abd", \fBpcre_exec()\fP will try to set the second +captured string, thereby recording a vector overflow, before failing to match +"c" and backing up to try the second alternative. The zero return, however, +does correctly indicate that the maximum number of slots (namely 2) have been +filled. In similar cases where there is temporary overflow, but the final +number of used slots is actually less than the maximum, a non-zero value is +returned. +.P +The \fBpcre_fullinfo()\fP function can be used to find out how many capturing +subpatterns there are in a compiled pattern. The smallest size for +\fIovector\fP that will allow for \fIn\fP captured substrings, in addition to +the offsets of the substring matched by the whole pattern, is (\fIn\fP+1)*3. +.P +It is possible for capturing subpattern number \fIn+1\fP to match some part of +the subject when subpattern \fIn\fP has not been used at all. For example, if +the string "abc" is matched against the pattern (a|(z))(bc) the return from the +function is 4, and subpatterns 1 and 3 are matched, but 2 is not. When this +happens, both values in the offset pairs corresponding to unused subpatterns +are set to -1. +.P +Offset values that correspond to unused subpatterns at the end of the +expression are also set to -1. For example, if the string "abc" is matched +against the pattern (abc)(x(yz)?)? subpatterns 2 and 3 are not matched. The +return from the function is 2, because the highest used capturing subpattern +number is 1, and the offsets for for the second and third capturing subpatterns +(assuming the vector is large enough, of course) are set to -1. +.P +\fBNote\fP: Elements in the first two-thirds of \fIovector\fP that do not +correspond to capturing parentheses in the pattern are never changed. That is, +if a pattern contains \fIn\fP capturing parentheses, no more than +\fIovector[0]\fP to \fIovector[2n+1]\fP are set by \fBpcre_exec()\fP. The other +elements (in the first two-thirds) retain whatever values they previously had. +.P +Some convenience functions are provided for extracting the captured substrings +as separate strings. These are described below. +. +. +.\" HTML +.SS "Error return values from \fBpcre_exec()\fP" +.rs +.sp +If \fBpcre_exec()\fP fails, it returns a negative number. The following are +defined in the header file: +.sp + PCRE_ERROR_NOMATCH (-1) +.sp +The subject string did not match the pattern. +.sp + PCRE_ERROR_NULL (-2) +.sp +Either \fIcode\fP or \fIsubject\fP was passed as NULL, or \fIovector\fP was +NULL and \fIovecsize\fP was not zero. +.sp + PCRE_ERROR_BADOPTION (-3) +.sp +An unrecognized bit was set in the \fIoptions\fP argument. +.sp + PCRE_ERROR_BADMAGIC (-4) +.sp +PCRE stores a 4-byte "magic number" at the start of the compiled code, to catch +the case when it is passed a junk pointer and to detect when a pattern that was +compiled in an environment of one endianness is run in an environment with the +other endianness. This is the error that PCRE gives when the magic number is +not present. +.sp + PCRE_ERROR_UNKNOWN_OPCODE (-5) +.sp +While running the pattern match, an unknown item was encountered in the +compiled pattern. This error could be caused by a bug in PCRE or by overwriting +of the compiled pattern. +.sp + PCRE_ERROR_NOMEMORY (-6) +.sp +If a pattern contains back references, but the \fIovector\fP that is passed to +\fBpcre_exec()\fP is not big enough to remember the referenced substrings, PCRE +gets a block of memory at the start of matching to use for this purpose. If the +call via \fBpcre_malloc()\fP fails, this error is given. The memory is +automatically freed at the end of matching. +.P +This error is also given if \fBpcre_stack_malloc()\fP fails in +\fBpcre_exec()\fP. This can happen only when PCRE has been compiled with +\fB--disable-stack-for-recursion\fP. +.sp + PCRE_ERROR_NOSUBSTRING (-7) +.sp +This error is used by the \fBpcre_copy_substring()\fP, +\fBpcre_get_substring()\fP, and \fBpcre_get_substring_list()\fP functions (see +below). It is never returned by \fBpcre_exec()\fP. +.sp + PCRE_ERROR_MATCHLIMIT (-8) +.sp +The backtracking limit, as specified by the \fImatch_limit\fP field in a +\fBpcre_extra\fP structure (or defaulted) was reached. See the description +above. +.sp + PCRE_ERROR_CALLOUT (-9) +.sp +This error is never generated by \fBpcre_exec()\fP itself. It is provided for +use by callout functions that want to yield a distinctive error code. See the +.\" HREF +\fBpcrecallout\fP +.\" +documentation for details. +.sp + PCRE_ERROR_BADUTF8 (-10) +.sp +A string that contains an invalid UTF-8 byte sequence was passed as a subject, +and the PCRE_NO_UTF8_CHECK option was not set. If the size of the output vector +(\fIovecsize\fP) is at least 2, the byte offset to the start of the the invalid +UTF-8 character is placed in the first element, and a reason code is placed in +the second element. The reason codes are listed in the +.\" HTML +.\" +following section. +.\" +For backward compatibility, if PCRE_PARTIAL_HARD is set and the problem is a +truncated UTF-8 character at the end of the subject (reason codes 1 to 5), +PCRE_ERROR_SHORTUTF8 is returned instead of PCRE_ERROR_BADUTF8. +.sp + PCRE_ERROR_BADUTF8_OFFSET (-11) +.sp +The UTF-8 byte sequence that was passed as a subject was checked and found to +be valid (the PCRE_NO_UTF8_CHECK option was not set), but the value of +\fIstartoffset\fP did not point to the beginning of a UTF-8 character or the +end of the subject. +.sp + PCRE_ERROR_PARTIAL (-12) +.sp +The subject string did not match, but it did match partially. See the +.\" HREF +\fBpcrepartial\fP +.\" +documentation for details of partial matching. +.sp + PCRE_ERROR_BADPARTIAL (-13) +.sp +This code is no longer in use. It was formerly returned when the PCRE_PARTIAL +option was used with a compiled pattern containing items that were not +supported for partial matching. From release 8.00 onwards, there are no +restrictions on partial matching. +.sp + PCRE_ERROR_INTERNAL (-14) +.sp +An unexpected internal error has occurred. This error could be caused by a bug +in PCRE or by overwriting of the compiled pattern. +.sp + PCRE_ERROR_BADCOUNT (-15) +.sp +This error is given if the value of the \fIovecsize\fP argument is negative. +.sp + PCRE_ERROR_RECURSIONLIMIT (-21) +.sp +The internal recursion limit, as specified by the \fImatch_limit_recursion\fP +field in a \fBpcre_extra\fP structure (or defaulted) was reached. See the +description above. +.sp + PCRE_ERROR_BADNEWLINE (-23) +.sp +An invalid combination of PCRE_NEWLINE_\fIxxx\fP options was given. +.sp + PCRE_ERROR_BADOFFSET (-24) +.sp +The value of \fIstartoffset\fP was negative or greater than the length of the +subject, that is, the value in \fIlength\fP. +.sp + PCRE_ERROR_SHORTUTF8 (-25) +.sp +This error is returned instead of PCRE_ERROR_BADUTF8 when the subject string +ends with a truncated UTF-8 character and the PCRE_PARTIAL_HARD option is set. +Information about the failure is returned as for PCRE_ERROR_BADUTF8. It is in +fact sufficient to detect this case, but this special error code for +PCRE_PARTIAL_HARD precedes the implementation of returned information; it is +retained for backwards compatibility. +.sp + PCRE_ERROR_RECURSELOOP (-26) +.sp +This error is returned when \fBpcre_exec()\fP detects a recursion loop within +the pattern. Specifically, it means that either the whole pattern or a +subpattern has been called recursively for the second time at the same position +in the subject string. Some simple patterns that might do this are detected and +faulted at compile time, but more complicated cases, in particular mutual +recursions between two different subpatterns, cannot be detected until run +time. +.sp + PCRE_ERROR_JIT_STACKLIMIT (-27) +.sp +This error is returned when a pattern that was successfully studied using a +JIT compile option is being matched, but the memory available for the +just-in-time processing stack is not large enough. See the +.\" HREF +\fBpcrejit\fP +.\" +documentation for more details. +.sp + PCRE_ERROR_BADMODE (-28) +.sp +This error is given if a pattern that was compiled by the 8-bit library is +passed to a 16-bit or 32-bit library function, or vice versa. +.sp + PCRE_ERROR_BADENDIANNESS (-29) +.sp +This error is given if a pattern that was compiled and saved is reloaded on a +host with different endianness. The utility function +\fBpcre_pattern_to_host_byte_order()\fP can be used to convert such a pattern +so that it runs on the new host. +.sp + PCRE_ERROR_JIT_BADOPTION +.sp +This error is returned when a pattern that was successfully studied using a JIT +compile option is being matched, but the matching mode (partial or complete +match) does not correspond to any JIT compilation mode. When the JIT fast path +function is used, this error may be also given for invalid options. See the +.\" HREF +\fBpcrejit\fP +.\" +documentation for more details. +.sp + PCRE_ERROR_BADLENGTH (-32) +.sp +This error is given if \fBpcre_exec()\fP is called with a negative value for +the \fIlength\fP argument. +.P +Error numbers -16 to -20, -22, and 30 are not used by \fBpcre_exec()\fP. +. +. +.\" HTML +.SS "Reason codes for invalid UTF-8 strings" +.rs +.sp +This section applies only to the 8-bit library. The corresponding information +for the 16-bit and 32-bit libraries is given in the +.\" HREF +\fBpcre16\fP +.\" +and +.\" HREF +\fBpcre32\fP +.\" +pages. +.P +When \fBpcre_exec()\fP returns either PCRE_ERROR_BADUTF8 or +PCRE_ERROR_SHORTUTF8, and the size of the output vector (\fIovecsize\fP) is at +least 2, the offset of the start of the invalid UTF-8 character is placed in +the first output vector element (\fIovector[0]\fP) and a reason code is placed +in the second element (\fIovector[1]\fP). The reason codes are given names in +the \fBpcre.h\fP header file: +.sp + PCRE_UTF8_ERR1 + PCRE_UTF8_ERR2 + PCRE_UTF8_ERR3 + PCRE_UTF8_ERR4 + PCRE_UTF8_ERR5 +.sp +The string ends with a truncated UTF-8 character; the code specifies how many +bytes are missing (1 to 5). Although RFC 3629 restricts UTF-8 characters to be +no longer than 4 bytes, the encoding scheme (originally defined by RFC 2279) +allows for up to 6 bytes, and this is checked first; hence the possibility of +4 or 5 missing bytes. +.sp + PCRE_UTF8_ERR6 + PCRE_UTF8_ERR7 + PCRE_UTF8_ERR8 + PCRE_UTF8_ERR9 + PCRE_UTF8_ERR10 +.sp +The two most significant bits of the 2nd, 3rd, 4th, 5th, or 6th byte of the +character do not have the binary value 0b10 (that is, either the most +significant bit is 0, or the next bit is 1). +.sp + PCRE_UTF8_ERR11 + PCRE_UTF8_ERR12 +.sp +A character that is valid by the RFC 2279 rules is either 5 or 6 bytes long; +these code points are excluded by RFC 3629. +.sp + PCRE_UTF8_ERR13 +.sp +A 4-byte character has a value greater than 0x10fff; these code points are +excluded by RFC 3629. +.sp + PCRE_UTF8_ERR14 +.sp +A 3-byte character has a value in the range 0xd800 to 0xdfff; this range of +code points are reserved by RFC 3629 for use with UTF-16, and so are excluded +from UTF-8. +.sp + PCRE_UTF8_ERR15 + PCRE_UTF8_ERR16 + PCRE_UTF8_ERR17 + PCRE_UTF8_ERR18 + PCRE_UTF8_ERR19 +.sp +A 2-, 3-, 4-, 5-, or 6-byte character is "overlong", that is, it codes for a +value that can be represented by fewer bytes, which is invalid. For example, +the two bytes 0xc0, 0xae give the value 0x2e, whose correct coding uses just +one byte. +.sp + PCRE_UTF8_ERR20 +.sp +The two most significant bits of the first byte of a character have the binary +value 0b10 (that is, the most significant bit is 1 and the second is 0). Such a +byte can only validly occur as the second or subsequent byte of a multi-byte +character. +.sp + PCRE_UTF8_ERR21 +.sp +The first byte of a character has the value 0xfe or 0xff. These values can +never occur in a valid UTF-8 string. +.sp + PCRE_UTF8_ERR22 +.sp +This error code was formerly used when the presence of a so-called +"non-character" caused an error. Unicode corrigendum #9 makes it clear that +such characters should not cause a string to be rejected, and so this code is +no longer in use and is never returned. +. +. +.SH "EXTRACTING CAPTURED SUBSTRINGS BY NUMBER" +.rs +.sp +.nf +.B int pcre_copy_substring(const char *\fIsubject\fP, int *\fIovector\fP, +.B " int \fIstringcount\fP, int \fIstringnumber\fP, char *\fIbuffer\fP," +.B " int \fIbuffersize\fP);" +.sp +.B int pcre_get_substring(const char *\fIsubject\fP, int *\fIovector\fP, +.B " int \fIstringcount\fP, int \fIstringnumber\fP," +.B " const char **\fIstringptr\fP);" +.sp +.B int pcre_get_substring_list(const char *\fIsubject\fP, +.B " int *\fIovector\fP, int \fIstringcount\fP, const char ***\fIlistptr\fP);" +.fi +.PP +Captured substrings can be accessed directly by using the offsets returned by +\fBpcre_exec()\fP in \fIovector\fP. For convenience, the functions +\fBpcre_copy_substring()\fP, \fBpcre_get_substring()\fP, and +\fBpcre_get_substring_list()\fP are provided for extracting captured substrings +as new, separate, zero-terminated strings. These functions identify substrings +by number. The next section describes functions for extracting named +substrings. +.P +A substring that contains a binary zero is correctly extracted and has a +further zero added on the end, but the result is not, of course, a C string. +However, you can process such a string by referring to the length that is +returned by \fBpcre_copy_substring()\fP and \fBpcre_get_substring()\fP. +Unfortunately, the interface to \fBpcre_get_substring_list()\fP is not adequate +for handling strings containing binary zeros, because the end of the final +string is not independently indicated. +.P +The first three arguments are the same for all three of these functions: +\fIsubject\fP is the subject string that has just been successfully matched, +\fIovector\fP is a pointer to the vector of integer offsets that was passed to +\fBpcre_exec()\fP, and \fIstringcount\fP is the number of substrings that were +captured by the match, including the substring that matched the entire regular +expression. This is the value returned by \fBpcre_exec()\fP if it is greater +than zero. If \fBpcre_exec()\fP returned zero, indicating that it ran out of +space in \fIovector\fP, the value passed as \fIstringcount\fP should be the +number of elements in the vector divided by three. +.P +The functions \fBpcre_copy_substring()\fP and \fBpcre_get_substring()\fP +extract a single substring, whose number is given as \fIstringnumber\fP. A +value of zero extracts the substring that matched the entire pattern, whereas +higher values extract the captured substrings. For \fBpcre_copy_substring()\fP, +the string is placed in \fIbuffer\fP, whose length is given by +\fIbuffersize\fP, while for \fBpcre_get_substring()\fP a new block of memory is +obtained via \fBpcre_malloc\fP, and its address is returned via +\fIstringptr\fP. The yield of the function is the length of the string, not +including the terminating zero, or one of these error codes: +.sp + PCRE_ERROR_NOMEMORY (-6) +.sp +The buffer was too small for \fBpcre_copy_substring()\fP, or the attempt to get +memory failed for \fBpcre_get_substring()\fP. +.sp + PCRE_ERROR_NOSUBSTRING (-7) +.sp +There is no substring whose number is \fIstringnumber\fP. +.P +The \fBpcre_get_substring_list()\fP function extracts all available substrings +and builds a list of pointers to them. All this is done in a single block of +memory that is obtained via \fBpcre_malloc\fP. The address of the memory block +is returned via \fIlistptr\fP, which is also the start of the list of string +pointers. The end of the list is marked by a NULL pointer. The yield of the +function is zero if all went well, or the error code +.sp + PCRE_ERROR_NOMEMORY (-6) +.sp +if the attempt to get the memory block failed. +.P +When any of these functions encounter a substring that is unset, which can +happen when capturing subpattern number \fIn+1\fP matches some part of the +subject, but subpattern \fIn\fP has not been used at all, they return an empty +string. This can be distinguished from a genuine zero-length substring by +inspecting the appropriate offset in \fIovector\fP, which is negative for unset +substrings. +.P +The two convenience functions \fBpcre_free_substring()\fP and +\fBpcre_free_substring_list()\fP can be used to free the memory returned by +a previous call of \fBpcre_get_substring()\fP or +\fBpcre_get_substring_list()\fP, respectively. They do nothing more than call +the function pointed to by \fBpcre_free\fP, which of course could be called +directly from a C program. However, PCRE is used in some situations where it is +linked via a special interface to another programming language that cannot use +\fBpcre_free\fP directly; it is for these cases that the functions are +provided. +. +. +.SH "EXTRACTING CAPTURED SUBSTRINGS BY NAME" +.rs +.sp +.nf +.B int pcre_get_stringnumber(const pcre *\fIcode\fP, +.B " const char *\fIname\fP);" +.sp +.B int pcre_copy_named_substring(const pcre *\fIcode\fP, +.B " const char *\fIsubject\fP, int *\fIovector\fP," +.B " int \fIstringcount\fP, const char *\fIstringname\fP," +.B " char *\fIbuffer\fP, int \fIbuffersize\fP);" +.sp +.B int pcre_get_named_substring(const pcre *\fIcode\fP, +.B " const char *\fIsubject\fP, int *\fIovector\fP," +.B " int \fIstringcount\fP, const char *\fIstringname\fP," +.B " const char **\fIstringptr\fP);" +.fi +.PP +To extract a substring by name, you first have to find associated number. +For example, for this pattern +.sp + (a+)b(?\ed+)... +.sp +the number of the subpattern called "xxx" is 2. If the name is known to be +unique (PCRE_DUPNAMES was not set), you can find the number from the name by +calling \fBpcre_get_stringnumber()\fP. The first argument is the compiled +pattern, and the second is the name. The yield of the function is the +subpattern number, or PCRE_ERROR_NOSUBSTRING (-7) if there is no subpattern of +that name. +.P +Given the number, you can extract the substring directly, or use one of the +functions described in the previous section. For convenience, there are also +two functions that do the whole job. +.P +Most of the arguments of \fBpcre_copy_named_substring()\fP and +\fBpcre_get_named_substring()\fP are the same as those for the similarly named +functions that extract by number. As these are described in the previous +section, they are not re-described here. There are just two differences: +.P +First, instead of a substring number, a substring name is given. Second, there +is an extra argument, given at the start, which is a pointer to the compiled +pattern. This is needed in order to gain access to the name-to-number +translation table. +.P +These functions call \fBpcre_get_stringnumber()\fP, and if it succeeds, they +then call \fBpcre_copy_substring()\fP or \fBpcre_get_substring()\fP, as +appropriate. \fBNOTE:\fP If PCRE_DUPNAMES is set and there are duplicate names, +the behaviour may not be what you want (see the next section). +.P +\fBWarning:\fP If the pattern uses the (?| feature to set up multiple +subpatterns with the same number, as described in the +.\" HTML +.\" +section on duplicate subpattern numbers +.\" +in the +.\" HREF +\fBpcrepattern\fP +.\" +page, you cannot use names to distinguish the different subpatterns, because +names are not included in the compiled code. The matching process uses only +numbers. For this reason, the use of different names for subpatterns of the +same number causes an error at compile time. +. +. +.SH "DUPLICATE SUBPATTERN NAMES" +.rs +.sp +.nf +.B int pcre_get_stringtable_entries(const pcre *\fIcode\fP, +.B " const char *\fIname\fP, char **\fIfirst\fP, char **\fIlast\fP);" +.fi +.PP +When a pattern is compiled with the PCRE_DUPNAMES option, names for subpatterns +are not required to be unique. (Duplicate names are always allowed for +subpatterns with the same number, created by using the (?| feature. Indeed, if +such subpatterns are named, they are required to use the same names.) +.P +Normally, patterns with duplicate names are such that in any one match, only +one of the named subpatterns participates. An example is shown in the +.\" HREF +\fBpcrepattern\fP +.\" +documentation. +.P +When duplicates are present, \fBpcre_copy_named_substring()\fP and +\fBpcre_get_named_substring()\fP return the first substring corresponding to +the given name that is set. If none are set, PCRE_ERROR_NOSUBSTRING (-7) is +returned; no data is returned. The \fBpcre_get_stringnumber()\fP function +returns one of the numbers that are associated with the name, but it is not +defined which it is. +.P +If you want to get full details of all captured substrings for a given name, +you must use the \fBpcre_get_stringtable_entries()\fP function. The first +argument is the compiled pattern, and the second is the name. The third and +fourth are pointers to variables which are updated by the function. After it +has run, they point to the first and last entries in the name-to-number table +for the given name. The function itself returns the length of each entry, or +PCRE_ERROR_NOSUBSTRING (-7) if there are none. The format of the table is +described above in the section entitled \fIInformation about a pattern\fP +.\" HTML +.\" +above. +.\" +Given all the relevant entries for the name, you can extract each of their +numbers, and hence the captured data, if any. +. +. +.SH "FINDING ALL POSSIBLE MATCHES" +.rs +.sp +The traditional matching function uses a similar algorithm to Perl, which stops +when it finds the first match, starting at a given point in the subject. If you +want to find all possible matches, or the longest possible match, consider +using the alternative matching function (see below) instead. If you cannot use +the alternative function, but still need to find all possible matches, you +can kludge it up by making use of the callout facility, which is described in +the +.\" HREF +\fBpcrecallout\fP +.\" +documentation. +.P +What you have to do is to insert a callout right at the end of the pattern. +When your callout function is called, extract and save the current matched +substring. Then return 1, which forces \fBpcre_exec()\fP to backtrack and try +other alternatives. Ultimately, when it runs out of matches, \fBpcre_exec()\fP +will yield PCRE_ERROR_NOMATCH. +. +. +.SH "OBTAINING AN ESTIMATE OF STACK USAGE" +.rs +.sp +Matching certain patterns using \fBpcre_exec()\fP can use a lot of process +stack, which in certain environments can be rather limited in size. Some users +find it helpful to have an estimate of the amount of stack that is used by +\fBpcre_exec()\fP, to help them set recursion limits, as described in the +.\" HREF +\fBpcrestack\fP +.\" +documentation. The estimate that is output by \fBpcretest\fP when called with +the \fB-m\fP and \fB-C\fP options is obtained by calling \fBpcre_exec\fP with +the values NULL, NULL, NULL, -999, and -999 for its first five arguments. +.P +Normally, if its first argument is NULL, \fBpcre_exec()\fP immediately returns +the negative error code PCRE_ERROR_NULL, but with this special combination of +arguments, it returns instead a negative number whose absolute value is the +approximate stack frame size in bytes. (A negative number is used so that it is +clear that no match has happened.) The value is approximate because in some +cases, recursive calls to \fBpcre_exec()\fP occur when there are one or two +additional variables on the stack. +.P +If PCRE has been compiled to use the heap instead of the stack for recursion, +the value returned is the size of each block that is obtained from the heap. +. +. +.\" HTML +.SH "MATCHING A PATTERN: THE ALTERNATIVE FUNCTION" +.rs +.sp +.nf +.B int pcre_dfa_exec(const pcre *\fIcode\fP, "const pcre_extra *\fIextra\fP," +.B " const char *\fIsubject\fP, int \fIlength\fP, int \fIstartoffset\fP," +.B " int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP," +.B " int *\fIworkspace\fP, int \fIwscount\fP);" +.fi +.P +The function \fBpcre_dfa_exec()\fP is called to match a subject string against +a compiled pattern, using a matching algorithm that scans the subject string +just once, and does not backtrack. This has different characteristics to the +normal algorithm, and is not compatible with Perl. Some of the features of PCRE +patterns are not supported. Nevertheless, there are times when this kind of +matching can be useful. For a discussion of the two matching algorithms, and a +list of features that \fBpcre_dfa_exec()\fP does not support, see the +.\" HREF +\fBpcrematching\fP +.\" +documentation. +.P +The arguments for the \fBpcre_dfa_exec()\fP function are the same as for +\fBpcre_exec()\fP, plus two extras. The \fIovector\fP argument is used in a +different way, and this is described below. The other common arguments are used +in the same way as for \fBpcre_exec()\fP, so their description is not repeated +here. +.P +The two additional arguments provide workspace for the function. The workspace +vector should contain at least 20 elements. It is used for keeping track of +multiple paths through the pattern tree. More workspace will be needed for +patterns and subjects where there are a lot of potential matches. +.P +Here is an example of a simple call to \fBpcre_dfa_exec()\fP: +.sp + int rc; + int ovector[10]; + int wspace[20]; + rc = pcre_dfa_exec( + re, /* result of pcre_compile() */ + NULL, /* we didn't study the pattern */ + "some string", /* the subject string */ + 11, /* the length of the subject string */ + 0, /* start at offset 0 in the subject */ + 0, /* default options */ + ovector, /* vector of integers for substring information */ + 10, /* number of elements (NOT size in bytes) */ + wspace, /* working space vector */ + 20); /* number of elements (NOT size in bytes) */ +. +.SS "Option bits for \fBpcre_dfa_exec()\fP" +.rs +.sp +The unused bits of the \fIoptions\fP argument for \fBpcre_dfa_exec()\fP must be +zero. The only bits that may be set are PCRE_ANCHORED, PCRE_NEWLINE_\fIxxx\fP, +PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NOTEMPTY_ATSTART, +PCRE_NO_UTF8_CHECK, PCRE_BSR_ANYCRLF, PCRE_BSR_UNICODE, PCRE_NO_START_OPTIMIZE, +PCRE_PARTIAL_HARD, PCRE_PARTIAL_SOFT, PCRE_DFA_SHORTEST, and PCRE_DFA_RESTART. +All but the last four of these are exactly the same as for \fBpcre_exec()\fP, +so their description is not repeated here. +.sp + PCRE_PARTIAL_HARD + PCRE_PARTIAL_SOFT +.sp +These have the same general effect as they do for \fBpcre_exec()\fP, but the +details are slightly different. When PCRE_PARTIAL_HARD is set for +\fBpcre_dfa_exec()\fP, it returns PCRE_ERROR_PARTIAL if the end of the subject +is reached and there is still at least one matching possibility that requires +additional characters. This happens even if some complete matches have also +been found. When PCRE_PARTIAL_SOFT is set, the return code PCRE_ERROR_NOMATCH +is converted into PCRE_ERROR_PARTIAL if the end of the subject is reached, +there have been no complete matches, but there is still at least one matching +possibility. The portion of the string that was inspected when the longest +partial match was found is set as the first matching string in both cases. +There is a more detailed discussion of partial and multi-segment matching, with +examples, in the +.\" HREF +\fBpcrepartial\fP +.\" +documentation. +.sp + PCRE_DFA_SHORTEST +.sp +Setting the PCRE_DFA_SHORTEST option causes the matching algorithm to stop as +soon as it has found one match. Because of the way the alternative algorithm +works, this is necessarily the shortest possible match at the first possible +matching point in the subject string. +.sp + PCRE_DFA_RESTART +.sp +When \fBpcre_dfa_exec()\fP returns a partial match, it is possible to call it +again, with additional subject characters, and have it continue with the same +match. The PCRE_DFA_RESTART option requests this action; when it is set, the +\fIworkspace\fP and \fIwscount\fP options must reference the same vector as +before because data about the match so far is left in them after a partial +match. There is more discussion of this facility in the +.\" HREF +\fBpcrepartial\fP +.\" +documentation. +. +. +.SS "Successful returns from \fBpcre_dfa_exec()\fP" +.rs +.sp +When \fBpcre_dfa_exec()\fP succeeds, it may have matched more than one +substring in the subject. Note, however, that all the matches from one run of +the function start at the same point in the subject. The shorter matches are +all initial substrings of the longer matches. For example, if the pattern +.sp + <.*> +.sp +is matched against the string +.sp + This is no more +.sp +the three matched strings are +.sp + + + +.sp +On success, the yield of the function is a number greater than zero, which is +the number of matched substrings. The substrings themselves are returned in +\fIovector\fP. Each string uses two elements; the first is the offset to the +start, and the second is the offset to the end. In fact, all the strings have +the same start offset. (Space could have been saved by giving this only once, +but it was decided to retain some compatibility with the way \fBpcre_exec()\fP +returns data, even though the meaning of the strings is different.) +.P +The strings are returned in reverse order of length; that is, the longest +matching string is given first. If there were too many matches to fit into +\fIovector\fP, the yield of the function is zero, and the vector is filled with +the longest matches. Unlike \fBpcre_exec()\fP, \fBpcre_dfa_exec()\fP can use +the entire \fIovector\fP for returning matched strings. +.P +NOTE: PCRE's "auto-possessification" optimization usually applies to character +repeats at the end of a pattern (as well as internally). For example, the +pattern "a\ed+" is compiled as if it were "a\ed++" because there is no point +even considering the possibility of backtracking into the repeated digits. For +DFA matching, this means that only one possible match is found. If you really +do want multiple matches in such cases, either use an ungreedy repeat +("a\ed+?") or set the PCRE_NO_AUTO_POSSESS option when compiling. +. +. +.SS "Error returns from \fBpcre_dfa_exec()\fP" +.rs +.sp +The \fBpcre_dfa_exec()\fP function returns a negative number when it fails. +Many of the errors are the same as for \fBpcre_exec()\fP, and these are +described +.\" HTML +.\" +above. +.\" +There are in addition the following errors that are specific to +\fBpcre_dfa_exec()\fP: +.sp + PCRE_ERROR_DFA_UITEM (-16) +.sp +This return is given if \fBpcre_dfa_exec()\fP encounters an item in the pattern +that it does not support, for instance, the use of \eC or a back reference. +.sp + PCRE_ERROR_DFA_UCOND (-17) +.sp +This return is given if \fBpcre_dfa_exec()\fP encounters a condition item that +uses a back reference for the condition, or a test for recursion in a specific +group. These are not supported. +.sp + PCRE_ERROR_DFA_UMLIMIT (-18) +.sp +This return is given if \fBpcre_dfa_exec()\fP is called with an \fIextra\fP +block that contains a setting of the \fImatch_limit\fP or +\fImatch_limit_recursion\fP fields. This is not supported (these fields are +meaningless for DFA matching). +.sp + PCRE_ERROR_DFA_WSSIZE (-19) +.sp +This return is given if \fBpcre_dfa_exec()\fP runs out of space in the +\fIworkspace\fP vector. +.sp + PCRE_ERROR_DFA_RECURSE (-20) +.sp +When a recursive subpattern is processed, the matching function calls itself +recursively, using private vectors for \fIovector\fP and \fIworkspace\fP. This +error is given if the output vector is not large enough. This should be +extremely rare, as a vector of size 1000 is used. +.sp + PCRE_ERROR_DFA_BADRESTART (-30) +.sp +When \fBpcre_dfa_exec()\fP is called with the \fBPCRE_DFA_RESTART\fP option, +some plausibility checks are made on the contents of the workspace, which +should contain data about the previous partial match. If any of these checks +fail, this error is given. +. +. +.SH "SEE ALSO" +.rs +.sp +\fBpcre16\fP(3), \fBpcre32\fP(3), \fBpcrebuild\fP(3), \fBpcrecallout\fP(3), +\fBpcrecpp(3)\fP(3), \fBpcrematching\fP(3), \fBpcrepartial\fP(3), +\fBpcreposix\fP(3), \fBpcreprecompile\fP(3), \fBpcresample\fP(3), +\fBpcrestack\fP(3). +. +. +.SH AUTHOR +.rs +.sp +.nf +Philip Hazel +University Computing Service +Cambridge CB2 3QH, England. +.fi +. +. +.SH REVISION +.rs +.sp +.nf +Last updated: 18 December 2015 +Copyright (c) 1997-2015 University of Cambridge. +.fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrebuild.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrebuild.3 new file mode 100644 index 0000000000000000000000000000000000000000..403f2ae32f14186671eb5fccc0f74208d190a34f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrebuild.3 @@ -0,0 +1,550 @@ +.TH PCREBUILD 3 "12 May 2013" "PCRE 8.33" +.SH NAME +PCRE - Perl-compatible regular expressions +. +. +.SH "BUILDING PCRE" +.rs +.sp +PCRE is distributed with a \fBconfigure\fP script that can be used to build the +library in Unix-like environments using the applications known as Autotools. +Also in the distribution are files to support building using \fBCMake\fP +instead of \fBconfigure\fP. The text file +.\" HTML +.\" +\fBREADME\fP +.\" +contains general information about building with Autotools (some of which is +repeated below), and also has some comments about building on various operating +systems. There is a lot more information about building PCRE without using +Autotools (including information about using \fBCMake\fP and building "by +hand") in the text file called +.\" HTML +.\" +\fBNON-AUTOTOOLS-BUILD\fP. +.\" +You should consult this file as well as the +.\" HTML +.\" +\fBREADME\fP +.\" +file if you are building in a non-Unix-like environment. +. +. +.SH "PCRE BUILD-TIME OPTIONS" +.rs +.sp +The rest of this document describes the optional features of PCRE that can be +selected when the library is compiled. It assumes use of the \fBconfigure\fP +script, where the optional features are selected or deselected by providing +options to \fBconfigure\fP before running the \fBmake\fP command. However, the +same options can be selected in both Unix-like and non-Unix-like environments +using the GUI facility of \fBcmake-gui\fP if you are using \fBCMake\fP instead +of \fBconfigure\fP to build PCRE. +.P +If you are not using Autotools or \fBCMake\fP, option selection can be done by +editing the \fBconfig.h\fP file, or by passing parameter settings to the +compiler, as described in +.\" HTML +.\" +\fBNON-AUTOTOOLS-BUILD\fP. +.\" +.P +The complete list of options for \fBconfigure\fP (which includes the standard +ones such as the selection of the installation directory) can be obtained by +running +.sp + ./configure --help +.sp +The following sections include descriptions of options whose names begin with +--enable or --disable. These settings specify changes to the defaults for the +\fBconfigure\fP command. Because of the way that \fBconfigure\fP works, +--enable and --disable always come in pairs, so the complementary option always +exists as well, but as it specifies the default, it is not described. +. +. +.SH "BUILDING 8-BIT, 16-BIT AND 32-BIT LIBRARIES" +.rs +.sp +By default, a library called \fBlibpcre\fP is built, containing functions that +take string arguments contained in vectors of bytes, either as single-byte +characters, or interpreted as UTF-8 strings. You can also build a separate +library, called \fBlibpcre16\fP, in which strings are contained in vectors of +16-bit data units and interpreted either as single-unit characters or UTF-16 +strings, by adding +.sp + --enable-pcre16 +.sp +to the \fBconfigure\fP command. You can also build yet another separate +library, called \fBlibpcre32\fP, in which strings are contained in vectors of +32-bit data units and interpreted either as single-unit characters or UTF-32 +strings, by adding +.sp + --enable-pcre32 +.sp +to the \fBconfigure\fP command. If you do not want the 8-bit library, add +.sp + --disable-pcre8 +.sp +as well. At least one of the three libraries must be built. Note that the C++ +and POSIX wrappers are for the 8-bit library only, and that \fBpcregrep\fP is +an 8-bit program. None of these are built if you select only the 16-bit or +32-bit libraries. +. +. +.SH "BUILDING SHARED AND STATIC LIBRARIES" +.rs +.sp +The Autotools PCRE building process uses \fBlibtool\fP to build both shared and +static libraries by default. You can suppress one of these by adding one of +.sp + --disable-shared + --disable-static +.sp +to the \fBconfigure\fP command, as required. +. +. +.SH "C++ SUPPORT" +.rs +.sp +By default, if the 8-bit library is being built, the \fBconfigure\fP script +will search for a C++ compiler and C++ header files. If it finds them, it +automatically builds the C++ wrapper library (which supports only 8-bit +strings). You can disable this by adding +.sp + --disable-cpp +.sp +to the \fBconfigure\fP command. +. +. +.SH "UTF-8, UTF-16 AND UTF-32 SUPPORT" +.rs +.sp +To build PCRE with support for UTF Unicode character strings, add +.sp + --enable-utf +.sp +to the \fBconfigure\fP command. This setting applies to all three libraries, +adding support for UTF-8 to the 8-bit library, support for UTF-16 to the 16-bit +library, and support for UTF-32 to the to the 32-bit library. There are no +separate options for enabling UTF-8, UTF-16 and UTF-32 independently because +that would allow ridiculous settings such as requesting UTF-16 support while +building only the 8-bit library. It is not possible to build one library with +UTF support and another without in the same configuration. (For backwards +compatibility, --enable-utf8 is a synonym of --enable-utf.) +.P +Of itself, this setting does not make PCRE treat strings as UTF-8, UTF-16 or +UTF-32. As well as compiling PCRE with this option, you also have have to set +the PCRE_UTF8, PCRE_UTF16 or PCRE_UTF32 option (as appropriate) when you call +one of the pattern compiling functions. +.P +If you set --enable-utf when compiling in an EBCDIC environment, PCRE expects +its input to be either ASCII or UTF-8 (depending on the run-time option). It is +not possible to support both EBCDIC and UTF-8 codes in the same version of the +library. Consequently, --enable-utf and --enable-ebcdic are mutually +exclusive. +. +. +.SH "UNICODE CHARACTER PROPERTY SUPPORT" +.rs +.sp +UTF support allows the libraries to process character codepoints up to 0x10ffff +in the strings that they handle. On its own, however, it does not provide any +facilities for accessing the properties of such characters. If you want to be +able to use the pattern escapes \eP, \ep, and \eX, which refer to Unicode +character properties, you must add +.sp + --enable-unicode-properties +.sp +to the \fBconfigure\fP command. This implies UTF support, even if you have +not explicitly requested it. +.P +Including Unicode property support adds around 30K of tables to the PCRE +library. Only the general category properties such as \fILu\fP and \fINd\fP are +supported. Details are given in the +.\" HREF +\fBpcrepattern\fP +.\" +documentation. +. +. +.SH "JUST-IN-TIME COMPILER SUPPORT" +.rs +.sp +Just-in-time compiler support is included in the build by specifying +.sp + --enable-jit +.sp +This support is available only for certain hardware architectures. If this +option is set for an unsupported architecture, a compile time error occurs. +See the +.\" HREF +\fBpcrejit\fP +.\" +documentation for a discussion of JIT usage. When JIT support is enabled, +pcregrep automatically makes use of it, unless you add +.sp + --disable-pcregrep-jit +.sp +to the "configure" command. +. +. +.SH "CODE VALUE OF NEWLINE" +.rs +.sp +By default, PCRE interprets the linefeed (LF) character as indicating the end +of a line. This is the normal newline character on Unix-like systems. You can +compile PCRE to use carriage return (CR) instead, by adding +.sp + --enable-newline-is-cr +.sp +to the \fBconfigure\fP command. There is also a --enable-newline-is-lf option, +which explicitly specifies linefeed as the newline character. +.sp +Alternatively, you can specify that line endings are to be indicated by the two +character sequence CRLF. If you want this, add +.sp + --enable-newline-is-crlf +.sp +to the \fBconfigure\fP command. There is a fourth option, specified by +.sp + --enable-newline-is-anycrlf +.sp +which causes PCRE to recognize any of the three sequences CR, LF, or CRLF as +indicating a line ending. Finally, a fifth option, specified by +.sp + --enable-newline-is-any +.sp +causes PCRE to recognize any Unicode newline sequence. +.P +Whatever line ending convention is selected when PCRE is built can be +overridden when the library functions are called. At build time it is +conventional to use the standard for your operating system. +. +. +.SH "WHAT \eR MATCHES" +.rs +.sp +By default, the sequence \eR in a pattern matches any Unicode newline sequence, +whatever has been selected as the line ending sequence. If you specify +.sp + --enable-bsr-anycrlf +.sp +the default is changed so that \eR matches only CR, LF, or CRLF. Whatever is +selected when PCRE is built can be overridden when the library functions are +called. +. +. +.SH "POSIX MALLOC USAGE" +.rs +.sp +When the 8-bit library is called through the POSIX interface (see the +.\" HREF +\fBpcreposix\fP +.\" +documentation), additional working storage is required for holding the pointers +to capturing substrings, because PCRE requires three integers per substring, +whereas the POSIX interface provides only two. If the number of expected +substrings is small, the wrapper function uses space on the stack, because this +is faster than using \fBmalloc()\fP for each call. The default threshold above +which the stack is no longer used is 10; it can be changed by adding a setting +such as +.sp + --with-posix-malloc-threshold=20 +.sp +to the \fBconfigure\fP command. +. +. +.SH "HANDLING VERY LARGE PATTERNS" +.rs +.sp +Within a compiled pattern, offset values are used to point from one part to +another (for example, from an opening parenthesis to an alternation +metacharacter). By default, in the 8-bit and 16-bit libraries, two-byte values +are used for these offsets, leading to a maximum size for a compiled pattern of +around 64K. This is sufficient to handle all but the most gigantic patterns. +Nevertheless, some people do want to process truly enormous patterns, so it is +possible to compile PCRE to use three-byte or four-byte offsets by adding a +setting such as +.sp + --with-link-size=3 +.sp +to the \fBconfigure\fP command. The value given must be 2, 3, or 4. For the +16-bit library, a value of 3 is rounded up to 4. In these libraries, using +longer offsets slows down the operation of PCRE because it has to load +additional data when handling them. For the 32-bit library the value is always +4 and cannot be overridden; the value of --with-link-size is ignored. +. +. +.SH "AVOIDING EXCESSIVE STACK USAGE" +.rs +.sp +When matching with the \fBpcre_exec()\fP function, PCRE implements backtracking +by making recursive calls to an internal function called \fBmatch()\fP. In +environments where the size of the stack is limited, this can severely limit +PCRE's operation. (The Unix environment does not usually suffer from this +problem, but it may sometimes be necessary to increase the maximum stack size. +There is a discussion in the +.\" HREF +\fBpcrestack\fP +.\" +documentation.) An alternative approach to recursion that uses memory from the +heap to remember data, instead of using recursive function calls, has been +implemented to work round the problem of limited stack size. If you want to +build a version of PCRE that works this way, add +.sp + --disable-stack-for-recursion +.sp +to the \fBconfigure\fP command. With this configuration, PCRE will use the +\fBpcre_stack_malloc\fP and \fBpcre_stack_free\fP variables to call memory +management functions. By default these point to \fBmalloc()\fP and +\fBfree()\fP, but you can replace the pointers so that your own functions are +used instead. +.P +Separate functions are provided rather than using \fBpcre_malloc\fP and +\fBpcre_free\fP because the usage is very predictable: the block sizes +requested are always the same, and the blocks are always freed in reverse +order. A calling program might be able to implement optimized functions that +perform better than \fBmalloc()\fP and \fBfree()\fP. PCRE runs noticeably more +slowly when built in this way. This option affects only the \fBpcre_exec()\fP +function; it is not relevant for \fBpcre_dfa_exec()\fP. +. +. +.SH "LIMITING PCRE RESOURCE USAGE" +.rs +.sp +Internally, PCRE has a function called \fBmatch()\fP, which it calls repeatedly +(sometimes recursively) when matching a pattern with the \fBpcre_exec()\fP +function. By controlling the maximum number of times this function may be +called during a single matching operation, a limit can be placed on the +resources used by a single call to \fBpcre_exec()\fP. The limit can be changed +at run time, as described in the +.\" HREF +\fBpcreapi\fP +.\" +documentation. The default is 10 million, but this can be changed by adding a +setting such as +.sp + --with-match-limit=500000 +.sp +to the \fBconfigure\fP command. This setting has no effect on the +\fBpcre_dfa_exec()\fP matching function. +.P +In some environments it is desirable to limit the depth of recursive calls of +\fBmatch()\fP more strictly than the total number of calls, in order to +restrict the maximum amount of stack (or heap, if --disable-stack-for-recursion +is specified) that is used. A second limit controls this; it defaults to the +value that is set for --with-match-limit, which imposes no additional +constraints. However, you can set a lower limit by adding, for example, +.sp + --with-match-limit-recursion=10000 +.sp +to the \fBconfigure\fP command. This value can also be overridden at run time. +. +. +.SH "CREATING CHARACTER TABLES AT BUILD TIME" +.rs +.sp +PCRE uses fixed tables for processing characters whose code values are less +than 256. By default, PCRE is built with a set of tables that are distributed +in the file \fIpcre_chartables.c.dist\fP. These tables are for ASCII codes +only. If you add +.sp + --enable-rebuild-chartables +.sp +to the \fBconfigure\fP command, the distributed tables are no longer used. +Instead, a program called \fBdftables\fP is compiled and run. This outputs the +source for new set of tables, created in the default locale of your C run-time +system. (This method of replacing the tables does not work if you are cross +compiling, because \fBdftables\fP is run on the local host. If you need to +create alternative tables when cross compiling, you will have to do so "by +hand".) +. +. +.SH "USING EBCDIC CODE" +.rs +.sp +PCRE assumes by default that it will run in an environment where the character +code is ASCII (or Unicode, which is a superset of ASCII). This is the case for +most computer operating systems. PCRE can, however, be compiled to run in an +EBCDIC environment by adding +.sp + --enable-ebcdic +.sp +to the \fBconfigure\fP command. This setting implies +--enable-rebuild-chartables. You should only use it if you know that you are in +an EBCDIC environment (for example, an IBM mainframe operating system). The +--enable-ebcdic option is incompatible with --enable-utf. +.P +The EBCDIC character that corresponds to an ASCII LF is assumed to have the +value 0x15 by default. However, in some EBCDIC environments, 0x25 is used. In +such an environment you should use +.sp + --enable-ebcdic-nl25 +.sp +as well as, or instead of, --enable-ebcdic. The EBCDIC character for CR has the +same value as in ASCII, namely, 0x0d. Whichever of 0x15 and 0x25 is \fInot\fP +chosen as LF is made to correspond to the Unicode NEL character (which, in +Unicode, is 0x85). +.P +The options that select newline behaviour, such as --enable-newline-is-cr, +and equivalent run-time options, refer to these character values in an EBCDIC +environment. +. +. +.SH "PCREGREP OPTIONS FOR COMPRESSED FILE SUPPORT" +.rs +.sp +By default, \fBpcregrep\fP reads all files as plain text. You can build it so +that it recognizes files whose names end in \fB.gz\fP or \fB.bz2\fP, and reads +them with \fBlibz\fP or \fBlibbz2\fP, respectively, by adding one or both of +.sp + --enable-pcregrep-libz + --enable-pcregrep-libbz2 +.sp +to the \fBconfigure\fP command. These options naturally require that the +relevant libraries are installed on your system. Configuration will fail if +they are not. +. +. +.SH "PCREGREP BUFFER SIZE" +.rs +.sp +\fBpcregrep\fP uses an internal buffer to hold a "window" on the file it is +scanning, in order to be able to output "before" and "after" lines when it +finds a match. The size of the buffer is controlled by a parameter whose +default value is 20K. The buffer itself is three times this size, but because +of the way it is used for holding "before" lines, the longest line that is +guaranteed to be processable is the parameter size. You can change the default +parameter value by adding, for example, +.sp + --with-pcregrep-bufsize=50K +.sp +to the \fBconfigure\fP command. The caller of \fPpcregrep\fP can, however, +override this value by specifying a run-time option. +. +. +.SH "PCRETEST OPTION FOR LIBREADLINE SUPPORT" +.rs +.sp +If you add +.sp + --enable-pcretest-libreadline +.sp +to the \fBconfigure\fP command, \fBpcretest\fP is linked with the +\fBlibreadline\fP library, and when its input is from a terminal, it reads it +using the \fBreadline()\fP function. This provides line-editing and history +facilities. Note that \fBlibreadline\fP is GPL-licensed, so if you distribute a +binary of \fBpcretest\fP linked in this way, there may be licensing issues. +.P +Setting this option causes the \fB-lreadline\fP option to be added to the +\fBpcretest\fP build. In many operating environments with a sytem-installed +\fBlibreadline\fP this is sufficient. However, in some environments (e.g. +if an unmodified distribution version of readline is in use), some extra +configuration may be necessary. The INSTALL file for \fBlibreadline\fP says +this: +.sp + "Readline uses the termcap functions, but does not link with the + termcap or curses library itself, allowing applications which link + with readline the to choose an appropriate library." +.sp +If your environment has not been set up so that an appropriate library is +automatically included, you may need to add something like +.sp + LIBS="-ncurses" +.sp +immediately before the \fBconfigure\fP command. +. +. +.SH "DEBUGGING WITH VALGRIND SUPPORT" +.rs +.sp +By adding the +.sp + --enable-valgrind +.sp +option to to the \fBconfigure\fP command, PCRE will use valgrind annotations +to mark certain memory regions as unaddressable. This allows it to detect +invalid memory accesses, and is mostly useful for debugging PCRE itself. +. +. +.SH "CODE COVERAGE REPORTING" +.rs +.sp +If your C compiler is gcc, you can build a version of PCRE that can generate a +code coverage report for its test suite. To enable this, you must install +\fBlcov\fP version 1.6 or above. Then specify +.sp + --enable-coverage +.sp +to the \fBconfigure\fP command and build PCRE in the usual way. +.P +Note that using \fBccache\fP (a caching C compiler) is incompatible with code +coverage reporting. If you have configured \fBccache\fP to run automatically +on your system, you must set the environment variable +.sp + CCACHE_DISABLE=1 +.sp +before running \fBmake\fP to build PCRE, so that \fBccache\fP is not used. +.P +When --enable-coverage is used, the following addition targets are added to the +\fIMakefile\fP: +.sp + make coverage +.sp +This creates a fresh coverage report for the PCRE test suite. It is equivalent +to running "make coverage-reset", "make coverage-baseline", "make check", and +then "make coverage-report". +.sp + make coverage-reset +.sp +This zeroes the coverage counters, but does nothing else. +.sp + make coverage-baseline +.sp +This captures baseline coverage information. +.sp + make coverage-report +.sp +This creates the coverage report. +.sp + make coverage-clean-report +.sp +This removes the generated coverage report without cleaning the coverage data +itself. +.sp + make coverage-clean-data +.sp +This removes the captured coverage data without removing the coverage files +created at compile time (*.gcno). +.sp + make coverage-clean +.sp +This cleans all coverage data including the generated coverage report. For more +information about code coverage, see the \fBgcov\fP and \fBlcov\fP +documentation. +. +. +.SH "SEE ALSO" +.rs +.sp +\fBpcreapi\fP(3), \fBpcre16\fP, \fBpcre32\fP, \fBpcre_config\fP(3). +. +. +.SH AUTHOR +.rs +.sp +.nf +Philip Hazel +University Computing Service +Cambridge CB2 3QH, England. +.fi +. +. +.SH REVISION +.rs +.sp +.nf +Last updated: 12 May 2013 +Copyright (c) 1997-2013 University of Cambridge. +.fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrecallout.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrecallout.3 new file mode 100644 index 0000000000000000000000000000000000000000..8ebc995952085d7e9803ae8e5c794ea472b03d5f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrecallout.3 @@ -0,0 +1,255 @@ +.TH PCRECALLOUT 3 "12 November 2013" "PCRE 8.34" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH SYNOPSIS +.rs +.sp +.B #include +.PP +.SM +.B int (*pcre_callout)(pcre_callout_block *); +.PP +.B int (*pcre16_callout)(pcre16_callout_block *); +.PP +.B int (*pcre32_callout)(pcre32_callout_block *); +. +.SH DESCRIPTION +.rs +.sp +PCRE provides a feature called "callout", which is a means of temporarily +passing control to the caller of PCRE in the middle of pattern matching. The +caller of PCRE provides an external function by putting its entry point in the +global variable \fIpcre_callout\fP (\fIpcre16_callout\fP for the 16-bit +library, \fIpcre32_callout\fP for the 32-bit library). By default, this +variable contains NULL, which disables all calling out. +.P +Within a regular expression, (?C) indicates the points at which the external +function is to be called. Different callout points can be identified by putting +a number less than 256 after the letter C. The default value is zero. +For example, this pattern has two callout points: +.sp + (?C1)abc(?C2)def +.sp +If the PCRE_AUTO_CALLOUT option bit is set when a pattern is compiled, PCRE +automatically inserts callouts, all with number 255, before each item in the +pattern. For example, if PCRE_AUTO_CALLOUT is used with the pattern +.sp + A(\ed{2}|--) +.sp +it is processed as if it were +.sp +(?C255)A(?C255)((?C255)\ed{2}(?C255)|(?C255)-(?C255)-(?C255))(?C255) +.sp +Notice that there is a callout before and after each parenthesis and +alternation bar. If the pattern contains a conditional group whose condition is +an assertion, an automatic callout is inserted immediately before the +condition. Such a callout may also be inserted explicitly, for example: +.sp + (?(?C9)(?=a)ab|de) +.sp +This applies only to assertion conditions (because they are themselves +independent groups). +.P +Automatic callouts can be used for tracking the progress of pattern matching. +The +.\" HREF +\fBpcretest\fP +.\" +program has a pattern qualifier (/C) that sets automatic callouts; when it is +used, the output indicates how the pattern is being matched. This is useful +information when you are trying to optimize the performance of a particular +pattern. +. +. +.SH "MISSING CALLOUTS" +.rs +.sp +You should be aware that, because of optimizations in the way PCRE compiles and +matches patterns, callouts sometimes do not happen exactly as you might expect. +.P +At compile time, PCRE "auto-possessifies" repeated items when it knows that +what follows cannot be part of the repeat. For example, a+[bc] is compiled as +if it were a++[bc]. The \fBpcretest\fP output when this pattern is anchored and +then applied with automatic callouts to the string "aaaa" is: +.sp + --->aaaa + +0 ^ ^ + +1 ^ a+ + +3 ^ ^ [bc] + No match +.sp +This indicates that when matching [bc] fails, there is no backtracking into a+ +and therefore the callouts that would be taken for the backtracks do not occur. +You can disable the auto-possessify feature by passing PCRE_NO_AUTO_POSSESS +to \fBpcre_compile()\fP, or starting the pattern with (*NO_AUTO_POSSESS). If +this is done in \fBpcretest\fP (using the /O qualifier), the output changes to +this: +.sp + --->aaaa + +0 ^ ^ + +1 ^ a+ + +3 ^ ^ [bc] + +3 ^ ^ [bc] + +3 ^ ^ [bc] + +3 ^^ [bc] + No match +.sp +This time, when matching [bc] fails, the matcher backtracks into a+ and tries +again, repeatedly, until a+ itself fails. +.P +Other optimizations that provide fast "no match" results also affect callouts. +For example, if the pattern is +.sp + ab(?C4)cd +.sp +PCRE knows that any matching string must contain the letter "d". If the subject +string is "abyz", the lack of "d" means that matching doesn't ever start, and +the callout is never reached. However, with "abyd", though the result is still +no match, the callout is obeyed. +.P +If the pattern is studied, PCRE knows the minimum length of a matching string, +and will immediately give a "no match" return without actually running a match +if the subject is not long enough, or, for unanchored patterns, if it has +been scanned far enough. +.P +You can disable these optimizations by passing the PCRE_NO_START_OPTIMIZE +option to the matching function, or by starting the pattern with +(*NO_START_OPT). This slows down the matching process, but does ensure that +callouts such as the example above are obeyed. +. +. +.SH "THE CALLOUT INTERFACE" +.rs +.sp +During matching, when PCRE reaches a callout point, the external function +defined by \fIpcre_callout\fP or \fIpcre[16|32]_callout\fP is called (if it is +set). This applies to both normal and DFA matching. The only argument to the +callout function is a pointer to a \fBpcre_callout\fP or +\fBpcre[16|32]_callout\fP block. These structures contains the following +fields: +.sp + int \fIversion\fP; + int \fIcallout_number\fP; + int *\fIoffset_vector\fP; + const char *\fIsubject\fP; (8-bit version) + PCRE_SPTR16 \fIsubject\fP; (16-bit version) + PCRE_SPTR32 \fIsubject\fP; (32-bit version) + int \fIsubject_length\fP; + int \fIstart_match\fP; + int \fIcurrent_position\fP; + int \fIcapture_top\fP; + int \fIcapture_last\fP; + void *\fIcallout_data\fP; + int \fIpattern_position\fP; + int \fInext_item_length\fP; + const unsigned char *\fImark\fP; (8-bit version) + const PCRE_UCHAR16 *\fImark\fP; (16-bit version) + const PCRE_UCHAR32 *\fImark\fP; (32-bit version) +.sp +The \fIversion\fP field is an integer containing the version number of the +block format. The initial version was 0; the current version is 2. The version +number will change again in future if additional fields are added, but the +intention is never to remove any of the existing fields. +.P +The \fIcallout_number\fP field contains the number of the callout, as compiled +into the pattern (that is, the number after ?C for manual callouts, and 255 for +automatically generated callouts). +.P +The \fIoffset_vector\fP field is a pointer to the vector of offsets that was +passed by the caller to the matching function. When \fBpcre_exec()\fP or +\fBpcre[16|32]_exec()\fP is used, the contents can be inspected, in order to +extract substrings that have been matched so far, in the same way as for +extracting substrings after a match has completed. For the DFA matching +functions, this field is not useful. +.P +The \fIsubject\fP and \fIsubject_length\fP fields contain copies of the values +that were passed to the matching function. +.P +The \fIstart_match\fP field normally contains the offset within the subject at +which the current match attempt started. However, if the escape sequence \eK +has been encountered, this value is changed to reflect the modified starting +point. If the pattern is not anchored, the callout function may be called +several times from the same point in the pattern for different starting points +in the subject. +.P +The \fIcurrent_position\fP field contains the offset within the subject of the +current match pointer. +.P +When the \fBpcre_exec()\fP or \fBpcre[16|32]_exec()\fP is used, the +\fIcapture_top\fP field contains one more than the number of the highest +numbered captured substring so far. If no substrings have been captured, the +value of \fIcapture_top\fP is one. This is always the case when the DFA +functions are used, because they do not support captured substrings. +.P +The \fIcapture_last\fP field contains the number of the most recently captured +substring. However, when a recursion exits, the value reverts to what it was +outside the recursion, as do the values of all captured substrings. If no +substrings have been captured, the value of \fIcapture_last\fP is -1. This is +always the case for the DFA matching functions. +.P +The \fIcallout_data\fP field contains a value that is passed to a matching +function specifically so that it can be passed back in callouts. It is passed +in the \fIcallout_data\fP field of a \fBpcre_extra\fP or \fBpcre[16|32]_extra\fP +data structure. If no such data was passed, the value of \fIcallout_data\fP in +a callout block is NULL. There is a description of the \fBpcre_extra\fP +structure in the +.\" HREF +\fBpcreapi\fP +.\" +documentation. +.P +The \fIpattern_position\fP field is present from version 1 of the callout +structure. It contains the offset to the next item to be matched in the pattern +string. +.P +The \fInext_item_length\fP field is present from version 1 of the callout +structure. It contains the length of the next item to be matched in the pattern +string. When the callout immediately precedes an alternation bar, a closing +parenthesis, or the end of the pattern, the length is zero. When the callout +precedes an opening parenthesis, the length is that of the entire subpattern. +.P +The \fIpattern_position\fP and \fInext_item_length\fP fields are intended to +help in distinguishing between different automatic callouts, which all have the +same callout number. However, they are set for all callouts. +.P +The \fImark\fP field is present from version 2 of the callout structure. In +callouts from \fBpcre_exec()\fP or \fBpcre[16|32]_exec()\fP it contains a +pointer to the zero-terminated name of the most recently passed (*MARK), +(*PRUNE), or (*THEN) item in the match, or NULL if no such items have been +passed. Instances of (*PRUNE) or (*THEN) without a name do not obliterate a +previous (*MARK). In callouts from the DFA matching functions this field always +contains NULL. +. +. +.SH "RETURN VALUES" +.rs +.sp +The external callout function returns an integer to PCRE. If the value is zero, +matching proceeds as normal. If the value is greater than zero, matching fails +at the current point, but the testing of other matching possibilities goes +ahead, just as if a lookahead assertion had failed. If the value is less than +zero, the match is abandoned, the matching function returns the negative value. +.P +Negative values should normally be chosen from the set of PCRE_ERROR_xxx +values. In particular, PCRE_ERROR_NOMATCH forces a standard "no match" failure. +The error number PCRE_ERROR_CALLOUT is reserved for use by callout functions; +it will never be used by PCRE itself. +. +. +.SH AUTHOR +.rs +.sp +.nf +Philip Hazel +University Computing Service +Cambridge CB2 3QH, England. +.fi +. +. +.SH REVISION +.rs +.sp +.nf +Last updated: 12 November 2013 +Copyright (c) 1997-2013 University of Cambridge. +.fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrecompat.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrecompat.3 new file mode 100644 index 0000000000000000000000000000000000000000..6156e776f5394d813083d06fc4f40efd1dca079e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrecompat.3 @@ -0,0 +1,200 @@ +.TH PCRECOMPAT 3 "10 November 2013" "PCRE 8.34" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH "DIFFERENCES BETWEEN PCRE AND PERL" +.rs +.sp +This document describes the differences in the ways that PCRE and Perl handle +regular expressions. The differences described here are with respect to Perl +versions 5.10 and above. +.P +1. PCRE has only a subset of Perl's Unicode support. Details of what it does +have are given in the +.\" HREF +\fBpcreunicode\fP +.\" +page. +.P +2. PCRE allows repeat quantifiers only on parenthesized assertions, but they do +not mean what you might think. For example, (?!a){3} does not assert that the +next three characters are not "a". It just asserts that the next character is +not "a" three times (in principle: PCRE optimizes this to run the assertion +just once). Perl allows repeat quantifiers on other assertions such as \eb, but +these do not seem to have any use. +.P +3. Capturing subpatterns that occur inside negative lookahead assertions are +counted, but their entries in the offsets vector are never set. Perl sometimes +(but not always) sets its numerical variables from inside negative assertions. +.P +4. Though binary zero characters are supported in the subject string, they are +not allowed in a pattern string because it is passed as a normal C string, +terminated by zero. The escape sequence \e0 can be used in the pattern to +represent a binary zero. +.P +5. The following Perl escape sequences are not supported: \el, \eu, \eL, +\eU, and \eN when followed by a character name or Unicode value. (\eN on its +own, matching a non-newline character, is supported.) In fact these are +implemented by Perl's general string-handling and are not part of its pattern +matching engine. If any of these are encountered by PCRE, an error is +generated by default. However, if the PCRE_JAVASCRIPT_COMPAT option is set, +\eU and \eu are interpreted as JavaScript interprets them. +.P +6. The Perl escape sequences \ep, \eP, and \eX are supported only if PCRE is +built with Unicode character property support. The properties that can be +tested with \ep and \eP are limited to the general category properties such as +Lu and Nd, script names such as Greek or Han, and the derived properties Any +and L&. PCRE does support the Cs (surrogate) property, which Perl does not; the +Perl documentation says "Because Perl hides the need for the user to understand +the internal representation of Unicode characters, there is no need to +implement the somewhat messy concept of surrogates." +.P +7. PCRE does support the \eQ...\eE escape for quoting substrings. Characters in +between are treated as literals. This is slightly different from Perl in that $ +and @ are also handled as literals inside the quotes. In Perl, they cause +variable interpolation (but of course PCRE does not have variables). Note the +following examples: +.sp + Pattern PCRE matches Perl matches +.sp +.\" JOIN + \eQabc$xyz\eE abc$xyz abc followed by the + contents of $xyz + \eQabc\e$xyz\eE abc\e$xyz abc\e$xyz + \eQabc\eE\e$\eQxyz\eE abc$xyz abc$xyz +.sp +The \eQ...\eE sequence is recognized both inside and outside character classes. +.P +8. Fairly obviously, PCRE does not support the (?{code}) and (??{code}) +constructions. However, there is support for recursive patterns. This is not +available in Perl 5.8, but it is in Perl 5.10. Also, the PCRE "callout" +feature allows an external function to be called during pattern matching. See +the +.\" HREF +\fBpcrecallout\fP +.\" +documentation for details. +.P +9. Subpatterns that are called as subroutines (whether or not recursively) are +always treated as atomic groups in PCRE. This is like Python, but unlike Perl. +Captured values that are set outside a subroutine call can be reference from +inside in PCRE, but not in Perl. There is a discussion that explains these +differences in more detail in the +.\" HTML +.\" +section on recursion differences from Perl +.\" +in the +.\" HREF +\fBpcrepattern\fP +.\" +page. +.P +10. If any of the backtracking control verbs are used in a subpattern that is +called as a subroutine (whether or not recursively), their effect is confined +to that subpattern; it does not extend to the surrounding pattern. This is not +always the case in Perl. In particular, if (*THEN) is present in a group that +is called as a subroutine, its action is limited to that group, even if the +group does not contain any | characters. Note that such subpatterns are +processed as anchored at the point where they are tested. +.P +11. If a pattern contains more than one backtracking control verb, the first +one that is backtracked onto acts. For example, in the pattern +A(*COMMIT)B(*PRUNE)C a failure in B triggers (*COMMIT), but a failure in C +triggers (*PRUNE). Perl's behaviour is more complex; in many cases it is the +same as PCRE, but there are examples where it differs. +.P +12. Most backtracking verbs in assertions have their normal actions. They are +not confined to the assertion. +.P +13. There are some differences that are concerned with the settings of captured +strings when part of a pattern is repeated. For example, matching "aba" against +the pattern /^(a(b)?)+$/ in Perl leaves $2 unset, but in PCRE it is set to "b". +.P +14. PCRE's handling of duplicate subpattern numbers and duplicate subpattern +names is not as general as Perl's. This is a consequence of the fact the PCRE +works internally just with numbers, using an external table to translate +between numbers and names. In particular, a pattern such as (?|(?A)|(?B), +where the two capturing parentheses have the same number but different names, +is not supported, and causes an error at compile time. If it were allowed, it +would not be possible to distinguish which parentheses matched, because both +names map to capturing subpattern number 1. To avoid this confusing situation, +an error is given at compile time. +.P +15. Perl recognizes comments in some places that PCRE does not, for example, +between the ( and ? at the start of a subpattern. If the /x modifier is set, +Perl allows white space between ( and ? (though current Perls warn that this is +deprecated) but PCRE never does, even if the PCRE_EXTENDED option is set. +.P +16. Perl, when in warning mode, gives warnings for character classes such as +[A-\ed] or [a-[:digit:]]. It then treats the hyphens as literals. PCRE has no +warning features, so it gives an error in these cases because they are almost +certainly user mistakes. +.P +17. In PCRE, the upper/lower case character properties Lu and Ll are not +affected when case-independent matching is specified. For example, \ep{Lu} +always matches an upper case letter. I think Perl has changed in this respect; +in the release at the time of writing (5.16), \ep{Lu} and \ep{Ll} match all +letters, regardless of case, when case independence is specified. +.P +18. PCRE provides some extensions to the Perl regular expression facilities. +Perl 5.10 includes new features that are not in earlier versions of Perl, some +of which (such as named parentheses) have been in PCRE for some time. This list +is with respect to Perl 5.10: +.sp +(a) Although lookbehind assertions in PCRE must match fixed length strings, +each alternative branch of a lookbehind assertion can match a different length +of string. Perl requires them all to have the same length. +.sp +(b) If PCRE_DOLLAR_ENDONLY is set and PCRE_MULTILINE is not set, the $ +meta-character matches only at the very end of the string. +.sp +(c) If PCRE_EXTRA is set, a backslash followed by a letter with no special +meaning is faulted. Otherwise, like Perl, the backslash is quietly ignored. +(Perl can be made to issue a warning.) +.sp +(d) If PCRE_UNGREEDY is set, the greediness of the repetition quantifiers is +inverted, that is, by default they are not greedy, but if followed by a +question mark they are. +.sp +(e) PCRE_ANCHORED can be used at matching time to force a pattern to be tried +only at the first matching position in the subject string. +.sp +(f) The PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NOTEMPTY_ATSTART, and +PCRE_NO_AUTO_CAPTURE options for \fBpcre_exec()\fP have no Perl equivalents. +.sp +(g) The \eR escape sequence can be restricted to match only CR, LF, or CRLF +by the PCRE_BSR_ANYCRLF option. +.sp +(h) The callout facility is PCRE-specific. +.sp +(i) The partial matching facility is PCRE-specific. +.sp +(j) Patterns compiled by PCRE can be saved and re-used at a later time, even on +different hosts that have the other endianness. However, this does not apply to +optimized data created by the just-in-time compiler. +.sp +(k) The alternative matching functions (\fBpcre_dfa_exec()\fP, +\fBpcre16_dfa_exec()\fP and \fBpcre32_dfa_exec()\fP,) match in a different way +and are not Perl-compatible. +.sp +(l) PCRE recognizes some special sequences such as (*CR) at the start of +a pattern that set overall options that cannot be changed within the pattern. +. +. +.SH AUTHOR +.rs +.sp +.nf +Philip Hazel +University Computing Service +Cambridge CB2 3QH, England. +.fi +. +. +.SH REVISION +.rs +.sp +.nf +Last updated: 10 November 2013 +Copyright (c) 1997-2013 University of Cambridge. +.fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrecpp.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrecpp.3 new file mode 100644 index 0000000000000000000000000000000000000000..fbddd86ab31ad245f97b6d009dfb862bbb06ce9e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrecpp.3 @@ -0,0 +1,348 @@ +.TH PCRECPP 3 "08 January 2012" "PCRE 8.30" +.SH NAME +PCRE - Perl-compatible regular expressions. +.SH "SYNOPSIS OF C++ WRAPPER" +.rs +.sp +.B #include +. +.SH DESCRIPTION +.rs +.sp +The C++ wrapper for PCRE was provided by Google Inc. Some additional +functionality was added by Giuseppe Maxia. This brief man page was constructed +from the notes in the \fIpcrecpp.h\fP file, which should be consulted for +further details. Note that the C++ wrapper supports only the original 8-bit +PCRE library. There is no 16-bit or 32-bit support at present. +. +. +.SH "MATCHING INTERFACE" +.rs +.sp +The "FullMatch" operation checks that supplied text matches a supplied pattern +exactly. If pointer arguments are supplied, it copies matched sub-strings that +match sub-patterns into them. +.sp + Example: successful match + pcrecpp::RE re("h.*o"); + re.FullMatch("hello"); +.sp + Example: unsuccessful match (requires full match): + pcrecpp::RE re("e"); + !re.FullMatch("hello"); +.sp + Example: creating a temporary RE object: + pcrecpp::RE("h.*o").FullMatch("hello"); +.sp +You can pass in a "const char*" or a "string" for "text". The examples below +tend to use a const char*. You can, as in the different examples above, store +the RE object explicitly in a variable or use a temporary RE object. The +examples below use one mode or the other arbitrarily. Either could correctly be +used for any of these examples. +.P +You must supply extra pointer arguments to extract matched subpieces. +.sp + Example: extracts "ruby" into "s" and 1234 into "i" + int i; + string s; + pcrecpp::RE re("(\e\ew+):(\e\ed+)"); + re.FullMatch("ruby:1234", &s, &i); +.sp + Example: does not try to extract any extra sub-patterns + re.FullMatch("ruby:1234", &s); +.sp + Example: does not try to extract into NULL + re.FullMatch("ruby:1234", NULL, &i); +.sp + Example: integer overflow causes failure + !re.FullMatch("ruby:1234567891234", NULL, &i); +.sp + Example: fails because there aren't enough sub-patterns: + !pcrecpp::RE("\e\ew+:\e\ed+").FullMatch("ruby:1234", &s); +.sp + Example: fails because string cannot be stored in integer + !pcrecpp::RE("(.*)").FullMatch("ruby", &i); +.sp +The provided pointer arguments can be pointers to any scalar numeric +type, or one of: +.sp + string (matched piece is copied to string) + StringPiece (StringPiece is mutated to point to matched piece) + T (where "bool T::ParseFrom(const char*, int)" exists) + NULL (the corresponding matched sub-pattern is not copied) +.sp +The function returns true iff all of the following conditions are satisfied: +.sp + a. "text" matches "pattern" exactly; +.sp + b. The number of matched sub-patterns is >= number of supplied + pointers; +.sp + c. The "i"th argument has a suitable type for holding the + string captured as the "i"th sub-pattern. If you pass in + void * NULL for the "i"th argument, or a non-void * NULL + of the correct type, or pass fewer arguments than the + number of sub-patterns, "i"th captured sub-pattern is + ignored. +.sp +CAVEAT: An optional sub-pattern that does not exist in the matched +string is assigned the empty string. Therefore, the following will +return false (because the empty string is not a valid number): +.sp + int number; + pcrecpp::RE::FullMatch("abc", "[a-z]+(\e\ed+)?", &number); +.sp +The matching interface supports at most 16 arguments per call. +If you need more, consider using the more general interface +\fBpcrecpp::RE::DoMatch\fP. See \fBpcrecpp.h\fP for the signature for +\fBDoMatch\fP. +.P +NOTE: Do not use \fBno_arg\fP, which is used internally to mark the end of a +list of optional arguments, as a placeholder for missing arguments, as this can +lead to segfaults. +. +. +.SH "QUOTING METACHARACTERS" +.rs +.sp +You can use the "QuoteMeta" operation to insert backslashes before all +potentially meaningful characters in a string. The returned string, used as a +regular expression, will exactly match the original string. +.sp + Example: + string quoted = RE::QuoteMeta(unquoted); +.sp +Note that it's legal to escape a character even if it has no special meaning in +a regular expression -- so this function does that. (This also makes it +identical to the perl function of the same name; see "perldoc -f quotemeta".) +For example, "1.5-2.0?" becomes "1\e.5\e-2\e.0\e?". +. +.SH "PARTIAL MATCHES" +.rs +.sp +You can use the "PartialMatch" operation when you want the pattern +to match any substring of the text. +.sp + Example: simple search for a string: + pcrecpp::RE("ell").PartialMatch("hello"); +.sp + Example: find first number in a string: + int number; + pcrecpp::RE re("(\e\ed+)"); + re.PartialMatch("x*100 + 20", &number); + assert(number == 100); +. +. +.SH "UTF-8 AND THE MATCHING INTERFACE" +.rs +.sp +By default, pattern and text are plain text, one byte per character. The UTF8 +flag, passed to the constructor, causes both pattern and string to be treated +as UTF-8 text, still a byte stream but potentially multiple bytes per +character. In practice, the text is likelier to be UTF-8 than the pattern, but +the match returned may depend on the UTF8 flag, so always use it when matching +UTF8 text. For example, "." will match one byte normally but with UTF8 set may +match up to three bytes of a multi-byte character. +.sp + Example: + pcrecpp::RE_Options options; + options.set_utf8(); + pcrecpp::RE re(utf8_pattern, options); + re.FullMatch(utf8_string); +.sp + Example: using the convenience function UTF8(): + pcrecpp::RE re(utf8_pattern, pcrecpp::UTF8()); + re.FullMatch(utf8_string); +.sp +NOTE: The UTF8 flag is ignored if pcre was not configured with the + --enable-utf8 flag. +. +. +.SH "PASSING MODIFIERS TO THE REGULAR EXPRESSION ENGINE" +.rs +.sp +PCRE defines some modifiers to change the behavior of the regular expression +engine. The C++ wrapper defines an auxiliary class, RE_Options, as a vehicle to +pass such modifiers to a RE class. Currently, the following modifiers are +supported: +.sp + modifier description Perl corresponding +.sp + PCRE_CASELESS case insensitive match /i + PCRE_MULTILINE multiple lines match /m + PCRE_DOTALL dot matches newlines /s + PCRE_DOLLAR_ENDONLY $ matches only at end N/A + PCRE_EXTRA strict escape parsing N/A + PCRE_EXTENDED ignore white spaces /x + PCRE_UTF8 handles UTF8 chars built-in + PCRE_UNGREEDY reverses * and *? N/A + PCRE_NO_AUTO_CAPTURE disables capturing parens N/A (*) +.sp +(*) Both Perl and PCRE allow non capturing parentheses by means of the +"?:" modifier within the pattern itself. e.g. (?:ab|cd) does not +capture, while (ab|cd) does. +.P +For a full account on how each modifier works, please check the +PCRE API reference page. +.P +For each modifier, there are two member functions whose name is made +out of the modifier in lowercase, without the "PCRE_" prefix. For +instance, PCRE_CASELESS is handled by +.sp + bool caseless() +.sp +which returns true if the modifier is set, and +.sp + RE_Options & set_caseless(bool) +.sp +which sets or unsets the modifier. Moreover, PCRE_EXTRA_MATCH_LIMIT can be +accessed through the \fBset_match_limit()\fP and \fBmatch_limit()\fP member +functions. Setting \fImatch_limit\fP to a non-zero value will limit the +execution of pcre to keep it from doing bad things like blowing the stack or +taking an eternity to return a result. A value of 5000 is good enough to stop +stack blowup in a 2MB thread stack. Setting \fImatch_limit\fP to zero disables +match limiting. Alternatively, you can call \fBmatch_limit_recursion()\fP +which uses PCRE_EXTRA_MATCH_LIMIT_RECURSION to limit how much PCRE +recurses. \fBmatch_limit()\fP limits the number of matches PCRE does; +\fBmatch_limit_recursion()\fP limits the depth of internal recursion, and +therefore the amount of stack that is used. +.P +Normally, to pass one or more modifiers to a RE class, you declare +a \fIRE_Options\fP object, set the appropriate options, and pass this +object to a RE constructor. Example: +.sp + RE_Options opt; + opt.set_caseless(true); + if (RE("HELLO", opt).PartialMatch("hello world")) ... +.sp +RE_options has two constructors. The default constructor takes no arguments and +creates a set of flags that are off by default. The optional parameter +\fIoption_flags\fP is to facilitate transfer of legacy code from C programs. +This lets you do +.sp + RE(pattern, + RE_Options(PCRE_CASELESS|PCRE_MULTILINE)).PartialMatch(str); +.sp +However, new code is better off doing +.sp + RE(pattern, + RE_Options().set_caseless(true).set_multiline(true)) + .PartialMatch(str); +.sp +If you are going to pass one of the most used modifiers, there are some +convenience functions that return a RE_Options class with the +appropriate modifier already set: \fBCASELESS()\fP, \fBUTF8()\fP, +\fBMULTILINE()\fP, \fBDOTALL\fP(), and \fBEXTENDED()\fP. +.P +If you need to set several options at once, and you don't want to go through +the pains of declaring a RE_Options object and setting several options, there +is a parallel method that give you such ability on the fly. You can concatenate +several \fBset_xxxxx()\fP member functions, since each of them returns a +reference to its class object. For example, to pass PCRE_CASELESS, +PCRE_EXTENDED, and PCRE_MULTILINE to a RE with one statement, you may write: +.sp + RE(" ^ xyz \e\es+ .* blah$", + RE_Options() + .set_caseless(true) + .set_extended(true) + .set_multiline(true)).PartialMatch(sometext); +.sp +. +. +.SH "SCANNING TEXT INCREMENTALLY" +.rs +.sp +The "Consume" operation may be useful if you want to repeatedly +match regular expressions at the front of a string and skip over +them as they match. This requires use of the "StringPiece" type, +which represents a sub-range of a real string. Like RE, StringPiece +is defined in the pcrecpp namespace. +.sp + Example: read lines of the form "var = value" from a string. + string contents = ...; // Fill string somehow + pcrecpp::StringPiece input(contents); // Wrap in a StringPiece +.sp + string var; + int value; + pcrecpp::RE re("(\e\ew+) = (\e\ed+)\en"); + while (re.Consume(&input, &var, &value)) { + ...; + } +.sp +Each successful call to "Consume" will set "var/value", and also +advance "input" so it points past the matched text. +.P +The "FindAndConsume" operation is similar to "Consume" but does not +anchor your match at the beginning of the string. For example, you +could extract all words from a string by repeatedly calling +.sp + pcrecpp::RE("(\e\ew+)").FindAndConsume(&input, &word) +. +. +.SH "PARSING HEX/OCTAL/C-RADIX NUMBERS" +.rs +.sp +By default, if you pass a pointer to a numeric value, the +corresponding text is interpreted as a base-10 number. You can +instead wrap the pointer with a call to one of the operators Hex(), +Octal(), or CRadix() to interpret the text in another base. The +CRadix operator interprets C-style "0" (base-8) and "0x" (base-16) +prefixes, but defaults to base-10. +.sp + Example: + int a, b, c, d; + pcrecpp::RE re("(.*) (.*) (.*) (.*)"); + re.FullMatch("100 40 0100 0x40", + pcrecpp::Octal(&a), pcrecpp::Hex(&b), + pcrecpp::CRadix(&c), pcrecpp::CRadix(&d)); +.sp +will leave 64 in a, b, c, and d. +. +. +.SH "REPLACING PARTS OF STRINGS" +.rs +.sp +You can replace the first match of "pattern" in "str" with "rewrite". +Within "rewrite", backslash-escaped digits (\e1 to \e9) can be +used to insert text matching corresponding parenthesized group +from the pattern. \e0 in "rewrite" refers to the entire matching +text. For example: +.sp + string s = "yabba dabba doo"; + pcrecpp::RE("b+").Replace("d", &s); +.sp +will leave "s" containing "yada dabba doo". The result is true if the pattern +matches and a replacement occurs, false otherwise. +.P +\fBGlobalReplace\fP is like \fBReplace\fP except that it replaces all +occurrences of the pattern in the string with the rewrite. Replacements are +not subject to re-matching. For example: +.sp + string s = "yabba dabba doo"; + pcrecpp::RE("b+").GlobalReplace("d", &s); +.sp +will leave "s" containing "yada dada doo". It returns the number of +replacements made. +.P +\fBExtract\fP is like \fBReplace\fP, except that if the pattern matches, +"rewrite" is copied into "out" (an additional argument) with substitutions. +The non-matching portions of "text" are ignored. Returns true iff a match +occurred and the extraction happened successfully; if no match occurs, the +string is left unaffected. +. +. +.SH AUTHOR +.rs +.sp +.nf +The C++ wrapper was contributed by Google Inc. +Copyright (c) 2007 Google Inc. +.fi +. +. +.SH REVISION +.rs +.sp +.nf +Last updated: 08 January 2012 +.fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcredemo.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcredemo.3 new file mode 100644 index 0000000000000000000000000000000000000000..4115ef1e36e8e90f21865a7f8f220b2cb1beaa63 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcredemo.3 @@ -0,0 +1,424 @@ +.\" Start example. +.de EX +. nr mE \\n(.f +. nf +. nh +. ft CW +.. +. +. +.\" End example. +.de EE +. ft \\n(mE +. fi +. hy \\n(HY +.. +. +.EX +/************************************************* +* PCRE DEMONSTRATION PROGRAM * +*************************************************/ + +/* This is a demonstration program to illustrate the most straightforward ways +of calling the PCRE regular expression library from a C program. See the +pcresample documentation for a short discussion ("man pcresample" if you have +the PCRE man pages installed). + +In Unix-like environments, if PCRE is installed in your standard system +libraries, you should be able to compile this program using this command: + +gcc -Wall pcredemo.c -lpcre -o pcredemo + +If PCRE is not installed in a standard place, it is likely to be installed with +support for the pkg-config mechanism. If you have pkg-config, you can compile +this program using this command: + +gcc -Wall pcredemo.c `pkg-config --cflags --libs libpcre` -o pcredemo + +If you do not have pkg-config, you may have to use this: + +gcc -Wall pcredemo.c -I/usr/local/include -L/usr/local/lib \e + -R/usr/local/lib -lpcre -o pcredemo + +Replace "/usr/local/include" and "/usr/local/lib" with wherever the include and +library files for PCRE are installed on your system. Only some operating +systems (e.g. Solaris) use the -R option. + +Building under Windows: + +If you want to statically link this program against a non-dll .a file, you must +define PCRE_STATIC before including pcre.h, otherwise the pcre_malloc() and +pcre_free() exported functions will be declared __declspec(dllimport), with +unwanted results. So in this environment, uncomment the following line. */ + +/* #define PCRE_STATIC */ + +#include +#include +#include + +#define OVECCOUNT 30 /* should be a multiple of 3 */ + + +int main(int argc, char **argv) +{ +pcre *re; +const char *error; +char *pattern; +char *subject; +unsigned char *name_table; +unsigned int option_bits; +int erroffset; +int find_all; +int crlf_is_newline; +int namecount; +int name_entry_size; +int ovector[OVECCOUNT]; +int subject_length; +int rc, i; +int utf8; + + +/************************************************************************** +* First, sort out the command line. There is only one possible option at * +* the moment, "-g" to request repeated matching to find all occurrences, * +* like Perl's /g option. We set the variable find_all to a non-zero value * +* if the -g option is present. Apart from that, there must be exactly two * +* arguments. * +**************************************************************************/ + +find_all = 0; +for (i = 1; i < argc; i++) + { + if (strcmp(argv[i], "-g") == 0) find_all = 1; + else break; + } + +/* After the options, we require exactly two arguments, which are the pattern, +and the subject string. */ + +if (argc - i != 2) + { + printf("Two arguments required: a regex and a subject string\en"); + return 1; + } + +pattern = argv[i]; +subject = argv[i+1]; +subject_length = (int)strlen(subject); + + +/************************************************************************* +* Now we are going to compile the regular expression pattern, and handle * +* and errors that are detected. * +*************************************************************************/ + +re = pcre_compile( + pattern, /* the pattern */ + 0, /* default options */ + &error, /* for error message */ + &erroffset, /* for error offset */ + NULL); /* use default character tables */ + +/* Compilation failed: print the error message and exit */ + +if (re == NULL) + { + printf("PCRE compilation failed at offset %d: %s\en", erroffset, error); + return 1; + } + + +/************************************************************************* +* If the compilation succeeded, we call PCRE again, in order to do a * +* pattern match against the subject string. This does just ONE match. If * +* further matching is needed, it will be done below. * +*************************************************************************/ + +rc = pcre_exec( + re, /* the compiled pattern */ + NULL, /* no extra data - we didn't study the pattern */ + subject, /* the subject string */ + subject_length, /* the length of the subject */ + 0, /* start at offset 0 in the subject */ + 0, /* default options */ + ovector, /* output vector for substring information */ + OVECCOUNT); /* number of elements in the output vector */ + +/* Matching failed: handle error cases */ + +if (rc < 0) + { + switch(rc) + { + case PCRE_ERROR_NOMATCH: printf("No match\en"); break; + /* + Handle other special cases if you like + */ + default: printf("Matching error %d\en", rc); break; + } + pcre_free(re); /* Release memory used for the compiled pattern */ + return 1; + } + +/* Match succeeded */ + +printf("\enMatch succeeded at offset %d\en", ovector[0]); + + +/************************************************************************* +* We have found the first match within the subject string. If the output * +* vector wasn't big enough, say so. Then output any substrings that were * +* captured. * +*************************************************************************/ + +/* The output vector wasn't big enough */ + +if (rc == 0) + { + rc = OVECCOUNT/3; + printf("ovector only has room for %d captured substrings\en", rc - 1); + } + +/* Show substrings stored in the output vector by number. Obviously, in a real +application you might want to do things other than print them. */ + +for (i = 0; i < rc; i++) + { + char *substring_start = subject + ovector[2*i]; + int substring_length = ovector[2*i+1] - ovector[2*i]; + printf("%2d: %.*s\en", i, substring_length, substring_start); + } + + +/************************************************************************** +* That concludes the basic part of this demonstration program. We have * +* compiled a pattern, and performed a single match. The code that follows * +* shows first how to access named substrings, and then how to code for * +* repeated matches on the same subject. * +**************************************************************************/ + +/* See if there are any named substrings, and if so, show them by name. First +we have to extract the count of named parentheses from the pattern. */ + +(void)pcre_fullinfo( + re, /* the compiled pattern */ + NULL, /* no extra data - we didn't study the pattern */ + PCRE_INFO_NAMECOUNT, /* number of named substrings */ + &namecount); /* where to put the answer */ + +if (namecount <= 0) printf("No named substrings\en"); else + { + unsigned char *tabptr; + printf("Named substrings\en"); + + /* Before we can access the substrings, we must extract the table for + translating names to numbers, and the size of each entry in the table. */ + + (void)pcre_fullinfo( + re, /* the compiled pattern */ + NULL, /* no extra data - we didn't study the pattern */ + PCRE_INFO_NAMETABLE, /* address of the table */ + &name_table); /* where to put the answer */ + + (void)pcre_fullinfo( + re, /* the compiled pattern */ + NULL, /* no extra data - we didn't study the pattern */ + PCRE_INFO_NAMEENTRYSIZE, /* size of each entry in the table */ + &name_entry_size); /* where to put the answer */ + + /* Now we can scan the table and, for each entry, print the number, the name, + and the substring itself. */ + + tabptr = name_table; + for (i = 0; i < namecount; i++) + { + int n = (tabptr[0] << 8) | tabptr[1]; + printf("(%d) %*s: %.*s\en", n, name_entry_size - 3, tabptr + 2, + ovector[2*n+1] - ovector[2*n], subject + ovector[2*n]); + tabptr += name_entry_size; + } + } + + +/************************************************************************* +* If the "-g" option was given on the command line, we want to continue * +* to search for additional matches in the subject string, in a similar * +* way to the /g option in Perl. This turns out to be trickier than you * +* might think because of the possibility of matching an empty string. * +* What happens is as follows: * +* * +* If the previous match was NOT for an empty string, we can just start * +* the next match at the end of the previous one. * +* * +* If the previous match WAS for an empty string, we can't do that, as it * +* would lead to an infinite loop. Instead, a special call of pcre_exec() * +* is made with the PCRE_NOTEMPTY_ATSTART and PCRE_ANCHORED flags set. * +* The first of these tells PCRE that an empty string at the start of the * +* subject is not a valid match; other possibilities must be tried. The * +* second flag restricts PCRE to one match attempt at the initial string * +* position. If this match succeeds, an alternative to the empty string * +* match has been found, and we can print it and proceed round the loop, * +* advancing by the length of whatever was found. If this match does not * +* succeed, we still stay in the loop, advancing by just one character. * +* In UTF-8 mode, which can be set by (*UTF8) in the pattern, this may be * +* more than one byte. * +* * +* However, there is a complication concerned with newlines. When the * +* newline convention is such that CRLF is a valid newline, we must * +* advance by two characters rather than one. The newline convention can * +* be set in the regex by (*CR), etc.; if not, we must find the default. * +*************************************************************************/ + +if (!find_all) /* Check for -g */ + { + pcre_free(re); /* Release the memory used for the compiled pattern */ + return 0; /* Finish unless -g was given */ + } + +/* Before running the loop, check for UTF-8 and whether CRLF is a valid newline +sequence. First, find the options with which the regex was compiled; extract +the UTF-8 state, and mask off all but the newline options. */ + +(void)pcre_fullinfo(re, NULL, PCRE_INFO_OPTIONS, &option_bits); +utf8 = option_bits & PCRE_UTF8; +option_bits &= PCRE_NEWLINE_CR|PCRE_NEWLINE_LF|PCRE_NEWLINE_CRLF| + PCRE_NEWLINE_ANY|PCRE_NEWLINE_ANYCRLF; + +/* If no newline options were set, find the default newline convention from the +build configuration. */ + +if (option_bits == 0) + { + int d; + (void)pcre_config(PCRE_CONFIG_NEWLINE, &d); + /* Note that these values are always the ASCII ones, even in + EBCDIC environments. CR = 13, NL = 10. */ + option_bits = (d == 13)? PCRE_NEWLINE_CR : + (d == 10)? PCRE_NEWLINE_LF : + (d == (13<<8 | 10))? PCRE_NEWLINE_CRLF : + (d == -2)? PCRE_NEWLINE_ANYCRLF : + (d == -1)? PCRE_NEWLINE_ANY : 0; + } + +/* See if CRLF is a valid newline sequence. */ + +crlf_is_newline = + option_bits == PCRE_NEWLINE_ANY || + option_bits == PCRE_NEWLINE_CRLF || + option_bits == PCRE_NEWLINE_ANYCRLF; + +/* Loop for second and subsequent matches */ + +for (;;) + { + int options = 0; /* Normally no options */ + int start_offset = ovector[1]; /* Start at end of previous match */ + + /* If the previous match was for an empty string, we are finished if we are + at the end of the subject. Otherwise, arrange to run another match at the + same point to see if a non-empty match can be found. */ + + if (ovector[0] == ovector[1]) + { + if (ovector[0] == subject_length) break; + options = PCRE_NOTEMPTY_ATSTART | PCRE_ANCHORED; + } + + /* Run the next matching operation */ + + rc = pcre_exec( + re, /* the compiled pattern */ + NULL, /* no extra data - we didn't study the pattern */ + subject, /* the subject string */ + subject_length, /* the length of the subject */ + start_offset, /* starting offset in the subject */ + options, /* options */ + ovector, /* output vector for substring information */ + OVECCOUNT); /* number of elements in the output vector */ + + /* This time, a result of NOMATCH isn't an error. If the value in "options" + is zero, it just means we have found all possible matches, so the loop ends. + Otherwise, it means we have failed to find a non-empty-string match at a + point where there was a previous empty-string match. In this case, we do what + Perl does: advance the matching position by one character, and continue. We + do this by setting the "end of previous match" offset, because that is picked + up at the top of the loop as the point at which to start again. + + There are two complications: (a) When CRLF is a valid newline sequence, and + the current position is just before it, advance by an extra byte. (b) + Otherwise we must ensure that we skip an entire UTF-8 character if we are in + UTF-8 mode. */ + + if (rc == PCRE_ERROR_NOMATCH) + { + if (options == 0) break; /* All matches found */ + ovector[1] = start_offset + 1; /* Advance one byte */ + if (crlf_is_newline && /* If CRLF is newline & */ + start_offset < subject_length - 1 && /* we are at CRLF, */ + subject[start_offset] == '\er' && + subject[start_offset + 1] == '\en') + ovector[1] += 1; /* Advance by one more. */ + else if (utf8) /* Otherwise, ensure we */ + { /* advance a whole UTF-8 */ + while (ovector[1] < subject_length) /* character. */ + { + if ((subject[ovector[1]] & 0xc0) != 0x80) break; + ovector[1] += 1; + } + } + continue; /* Go round the loop again */ + } + + /* Other matching errors are not recoverable. */ + + if (rc < 0) + { + printf("Matching error %d\en", rc); + pcre_free(re); /* Release memory used for the compiled pattern */ + return 1; + } + + /* Match succeeded */ + + printf("\enMatch succeeded again at offset %d\en", ovector[0]); + + /* The match succeeded, but the output vector wasn't big enough. */ + + if (rc == 0) + { + rc = OVECCOUNT/3; + printf("ovector only has room for %d captured substrings\en", rc - 1); + } + + /* As before, show substrings stored in the output vector by number, and then + also any named substrings. */ + + for (i = 0; i < rc; i++) + { + char *substring_start = subject + ovector[2*i]; + int substring_length = ovector[2*i+1] - ovector[2*i]; + printf("%2d: %.*s\en", i, substring_length, substring_start); + } + + if (namecount <= 0) printf("No named substrings\en"); else + { + unsigned char *tabptr = name_table; + printf("Named substrings\en"); + for (i = 0; i < namecount; i++) + { + int n = (tabptr[0] << 8) | tabptr[1]; + printf("(%d) %*s: %.*s\en", n, name_entry_size - 3, tabptr + 2, + ovector[2*n+1] - ovector[2*n], subject + ovector[2*n]); + tabptr += name_entry_size; + } + } + } /* End of loop to find second and subsequent matches */ + +printf("\en"); +pcre_free(re); /* Release memory used for the compiled pattern */ +return 0; +} + +/* End of pcredemo.c */ +.EE diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrejit.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrejit.3 new file mode 100644 index 0000000000000000000000000000000000000000..fe42db5617040f530cae70f4f8efd135c3661649 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrejit.3 @@ -0,0 +1,473 @@ +.TH PCREJIT 3 "05 July 2017" "PCRE 8.41" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH "PCRE JUST-IN-TIME COMPILER SUPPORT" +.rs +.sp +Just-in-time compiling is a heavyweight optimization that can greatly speed up +pattern matching. However, it comes at the cost of extra processing before the +match is performed. Therefore, it is of most benefit when the same pattern is +going to be matched many times. This does not necessarily mean many calls of a +matching function; if the pattern is not anchored, matching attempts may take +place many times at various positions in the subject, even for a single call. +Therefore, if the subject string is very long, it may still pay to use JIT for +one-off matches. +.P +JIT support applies only to the traditional Perl-compatible matching function. +It does not apply when the DFA matching function is being used. The code for +this support was written by Zoltan Herczeg. +. +. +.SH "8-BIT, 16-BIT AND 32-BIT SUPPORT" +.rs +.sp +JIT support is available for all of the 8-bit, 16-bit and 32-bit PCRE +libraries. To keep this documentation simple, only the 8-bit interface is +described in what follows. If you are using the 16-bit library, substitute the +16-bit functions and 16-bit structures (for example, \fIpcre16_jit_stack\fP +instead of \fIpcre_jit_stack\fP). If you are using the 32-bit library, +substitute the 32-bit functions and 32-bit structures (for example, +\fIpcre32_jit_stack\fP instead of \fIpcre_jit_stack\fP). +. +. +.SH "AVAILABILITY OF JIT SUPPORT" +.rs +.sp +JIT support is an optional feature of PCRE. The "configure" option --enable-jit +(or equivalent CMake option) must be set when PCRE is built if you want to use +JIT. The support is limited to the following hardware platforms: +.sp + ARM v5, v7, and Thumb2 + Intel x86 32-bit and 64-bit + MIPS 32-bit + Power PC 32-bit and 64-bit + SPARC 32-bit (experimental) +.sp +If --enable-jit is set on an unsupported platform, compilation fails. +.P +A program that is linked with PCRE 8.20 or later can tell if JIT support is +available by calling \fBpcre_config()\fP with the PCRE_CONFIG_JIT option. The +result is 1 when JIT is available, and 0 otherwise. However, a simple program +does not need to check this in order to use JIT. The normal API is implemented +in a way that falls back to the interpretive code if JIT is not available. For +programs that need the best possible performance, there is also a "fast path" +API that is JIT-specific. +.P +If your program may sometimes be linked with versions of PCRE that are older +than 8.20, but you want to use JIT when it is available, you can test the +values of PCRE_MAJOR and PCRE_MINOR, or the existence of a JIT macro such as +PCRE_CONFIG_JIT, for compile-time control of your code. Also beware that the +\fBpcre_jit_exec()\fP function was not available at all before 8.32, +and may not be available at all if PCRE isn't compiled with +--enable-jit. See the "JIT FAST PATH API" section below for details. +. +. +.SH "SIMPLE USE OF JIT" +.rs +.sp +You have to do two things to make use of the JIT support in the simplest way: +.sp + (1) Call \fBpcre_study()\fP with the PCRE_STUDY_JIT_COMPILE option for + each compiled pattern, and pass the resulting \fBpcre_extra\fP block to + \fBpcre_exec()\fP. +.sp + (2) Use \fBpcre_free_study()\fP to free the \fBpcre_extra\fP block when it is + no longer needed, instead of just freeing it yourself. This ensures that + any JIT data is also freed. +.sp +For a program that may be linked with pre-8.20 versions of PCRE, you can insert +.sp + #ifndef PCRE_STUDY_JIT_COMPILE + #define PCRE_STUDY_JIT_COMPILE 0 + #endif +.sp +so that no option is passed to \fBpcre_study()\fP, and then use something like +this to free the study data: +.sp + #ifdef PCRE_CONFIG_JIT + pcre_free_study(study_ptr); + #else + pcre_free(study_ptr); + #endif +.sp +PCRE_STUDY_JIT_COMPILE requests the JIT compiler to generate code for complete +matches. If you want to run partial matches using the PCRE_PARTIAL_HARD or +PCRE_PARTIAL_SOFT options of \fBpcre_exec()\fP, you should set one or both of +the following options in addition to, or instead of, PCRE_STUDY_JIT_COMPILE +when you call \fBpcre_study()\fP: +.sp + PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE + PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE +.sp +If using \fBpcre_jit_exec()\fP and supporting a pre-8.32 version of +PCRE, you can insert: +.sp + #if PCRE_MAJOR >= 8 && PCRE_MINOR >= 32 + pcre_jit_exec(...); + #else + pcre_exec(...) + #endif +.sp +but as described in the "JIT FAST PATH API" section below this assumes +version 8.32 and later are compiled with --enable-jit, which may +break. +.sp +The JIT compiler generates different optimized code for each of the three +modes (normal, soft partial, hard partial). When \fBpcre_exec()\fP is called, +the appropriate code is run if it is available. Otherwise, the pattern is +matched using interpretive code. +.P +In some circumstances you may need to call additional functions. These are +described in the section entitled +.\" HTML +.\" +"Controlling the JIT stack" +.\" +below. +.P +If JIT support is not available, PCRE_STUDY_JIT_COMPILE etc. are ignored, and +no JIT data is created. Otherwise, the compiled pattern is passed to the JIT +compiler, which turns it into machine code that executes much faster than the +normal interpretive code. When \fBpcre_exec()\fP is passed a \fBpcre_extra\fP +block containing a pointer to JIT code of the appropriate mode (normal or +hard/soft partial), it obeys that code instead of running the interpreter. The +result is identical, but the compiled JIT code runs much faster. +.P +There are some \fBpcre_exec()\fP options that are not supported for JIT +execution. There are also some pattern items that JIT cannot handle. Details +are given below. In both cases, execution automatically falls back to the +interpretive code. If you want to know whether JIT was actually used for a +particular match, you should arrange for a JIT callback function to be set up +as described in the section entitled +.\" HTML +.\" +"Controlling the JIT stack" +.\" +below, even if you do not need to supply a non-default JIT stack. Such a +callback function is called whenever JIT code is about to be obeyed. If the +execution options are not right for JIT execution, the callback function is not +obeyed. +.P +If the JIT compiler finds an unsupported item, no JIT data is generated. You +can find out if JIT execution is available after studying a pattern by calling +\fBpcre_fullinfo()\fP with the PCRE_INFO_JIT option. A result of 1 means that +JIT compilation was successful. A result of 0 means that JIT support is not +available, or the pattern was not studied with PCRE_STUDY_JIT_COMPILE etc., or +the JIT compiler was not able to handle the pattern. +.P +Once a pattern has been studied, with or without JIT, it can be used as many +times as you like for matching different subject strings. +. +. +.SH "UNSUPPORTED OPTIONS AND PATTERN ITEMS" +.rs +.sp +The only \fBpcre_exec()\fP options that are supported for JIT execution are +PCRE_NO_UTF8_CHECK, PCRE_NO_UTF16_CHECK, PCRE_NO_UTF32_CHECK, PCRE_NOTBOL, +PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NOTEMPTY_ATSTART, PCRE_PARTIAL_HARD, and +PCRE_PARTIAL_SOFT. +.P +The only unsupported pattern items are \eC (match a single data unit) when +running in a UTF mode, and a callout immediately before an assertion condition +in a conditional group. +. +. +.SH "RETURN VALUES FROM JIT EXECUTION" +.rs +.sp +When a pattern is matched using JIT execution, the return values are the same +as those given by the interpretive \fBpcre_exec()\fP code, with the addition of +one new error code: PCRE_ERROR_JIT_STACKLIMIT. This means that the memory used +for the JIT stack was insufficient. See +.\" HTML +.\" +"Controlling the JIT stack" +.\" +below for a discussion of JIT stack usage. For compatibility with the +interpretive \fBpcre_exec()\fP code, no more than two-thirds of the +\fIovector\fP argument is used for passing back captured substrings. +.P +The error code PCRE_ERROR_MATCHLIMIT is returned by the JIT code if searching a +very large pattern tree goes on for too long, as it is in the same circumstance +when JIT is not used, but the details of exactly what is counted are not the +same. The PCRE_ERROR_RECURSIONLIMIT error code is never returned by JIT +execution. +. +. +.SH "SAVING AND RESTORING COMPILED PATTERNS" +.rs +.sp +The code that is generated by the JIT compiler is architecture-specific, and is +also position dependent. For those reasons it cannot be saved (in a file or +database) and restored later like the bytecode and other data of a compiled +pattern. Saving and restoring compiled patterns is not something many people +do. More detail about this facility is given in the +.\" HREF +\fBpcreprecompile\fP +.\" +documentation. It should be possible to run \fBpcre_study()\fP on a saved and +restored pattern, and thereby recreate the JIT data, but because JIT +compilation uses significant resources, it is probably not worth doing this; +you might as well recompile the original pattern. +. +. +.\" HTML +.SH "CONTROLLING THE JIT STACK" +.rs +.sp +When the compiled JIT code runs, it needs a block of memory to use as a stack. +By default, it uses 32K on the machine stack. However, some large or +complicated patterns need more than this. The error PCRE_ERROR_JIT_STACKLIMIT +is given when there is not enough stack. Three functions are provided for +managing blocks of memory for use as JIT stacks. There is further discussion +about the use of JIT stacks in the section entitled +.\" HTML +.\" +"JIT stack FAQ" +.\" +below. +.P +The \fBpcre_jit_stack_alloc()\fP function creates a JIT stack. Its arguments +are a starting size and a maximum size, and it returns a pointer to an opaque +structure of type \fBpcre_jit_stack\fP, or NULL if there is an error. The +\fBpcre_jit_stack_free()\fP function can be used to free a stack that is no +longer needed. (For the technically minded: the address space is allocated by +mmap or VirtualAlloc.) +.P +JIT uses far less memory for recursion than the interpretive code, +and a maximum stack size of 512K to 1M should be more than enough for any +pattern. +.P +The \fBpcre_assign_jit_stack()\fP function specifies which stack JIT code +should use. Its arguments are as follows: +.sp + pcre_extra *extra + pcre_jit_callback callback + void *data +.sp +The \fIextra\fP argument must be the result of studying a pattern with +PCRE_STUDY_JIT_COMPILE etc. There are three cases for the values of the other +two options: +.sp + (1) If \fIcallback\fP is NULL and \fIdata\fP is NULL, an internal 32K block + on the machine stack is used. +.sp + (2) If \fIcallback\fP is NULL and \fIdata\fP is not NULL, \fIdata\fP must be + a valid JIT stack, the result of calling \fBpcre_jit_stack_alloc()\fP. +.sp + (3) If \fIcallback\fP is not NULL, it must point to a function that is + called with \fIdata\fP as an argument at the start of matching, in + order to set up a JIT stack. If the return from the callback + function is NULL, the internal 32K stack is used; otherwise the + return value must be a valid JIT stack, the result of calling + \fBpcre_jit_stack_alloc()\fP. +.sp +A callback function is obeyed whenever JIT code is about to be run; it is not +obeyed when \fBpcre_exec()\fP is called with options that are incompatible for +JIT execution. A callback function can therefore be used to determine whether a +match operation was executed by JIT or by the interpreter. +.P +You may safely use the same JIT stack for more than one pattern (either by +assigning directly or by callback), as long as the patterns are all matched +sequentially in the same thread. In a multithread application, if you do not +specify a JIT stack, or if you assign or pass back NULL from a callback, that +is thread-safe, because each thread has its own machine stack. However, if you +assign or pass back a non-NULL JIT stack, this must be a different stack for +each thread so that the application is thread-safe. +.P +Strictly speaking, even more is allowed. You can assign the same non-NULL stack +to any number of patterns as long as they are not used for matching by multiple +threads at the same time. For example, you can assign the same stack to all +compiled patterns, and use a global mutex in the callback to wait until the +stack is available for use. However, this is an inefficient solution, and not +recommended. +.P +This is a suggestion for how a multithreaded program that needs to set up +non-default JIT stacks might operate: +.sp + During thread initialization + thread_local_var = pcre_jit_stack_alloc(...) +.sp + During thread exit + pcre_jit_stack_free(thread_local_var) +.sp + Use a one-line callback function + return thread_local_var +.sp +All the functions described in this section do nothing if JIT is not available, +and \fBpcre_assign_jit_stack()\fP does nothing unless the \fBextra\fP argument +is non-NULL and points to a \fBpcre_extra\fP block that is the result of a +successful study with PCRE_STUDY_JIT_COMPILE etc. +. +. +.\" HTML +.SH "JIT STACK FAQ" +.rs +.sp +(1) Why do we need JIT stacks? +.sp +PCRE (and JIT) is a recursive, depth-first engine, so it needs a stack where +the local data of the current node is pushed before checking its child nodes. +Allocating real machine stack on some platforms is difficult. For example, the +stack chain needs to be updated every time if we extend the stack on PowerPC. +Although it is possible, its updating time overhead decreases performance. So +we do the recursion in memory. +.P +(2) Why don't we simply allocate blocks of memory with \fBmalloc()\fP? +.sp +Modern operating systems have a nice feature: they can reserve an address space +instead of allocating memory. We can safely allocate memory pages inside this +address space, so the stack could grow without moving memory data (this is +important because of pointers). Thus we can allocate 1M address space, and use +only a single memory page (usually 4K) if that is enough. However, we can still +grow up to 1M anytime if needed. +.P +(3) Who "owns" a JIT stack? +.sp +The owner of the stack is the user program, not the JIT studied pattern or +anything else. The user program must ensure that if a stack is used by +\fBpcre_exec()\fP, (that is, it is assigned to the pattern currently running), +that stack must not be used by any other threads (to avoid overwriting the same +memory area). The best practice for multithreaded programs is to allocate a +stack for each thread, and return this stack through the JIT callback function. +.P +(4) When should a JIT stack be freed? +.sp +You can free a JIT stack at any time, as long as it will not be used by +\fBpcre_exec()\fP again. When you assign the stack to a pattern, only a pointer +is set. There is no reference counting or any other magic. You can free the +patterns and stacks in any order, anytime. Just \fIdo not\fP call +\fBpcre_exec()\fP with a pattern pointing to an already freed stack, as that +will cause SEGFAULT. (Also, do not free a stack currently used by +\fBpcre_exec()\fP in another thread). You can also replace the stack for a +pattern at any time. You can even free the previous stack before assigning a +replacement. +.P +(5) Should I allocate/free a stack every time before/after calling +\fBpcre_exec()\fP? +.sp +No, because this is too costly in terms of resources. However, you could +implement some clever idea which release the stack if it is not used in let's +say two minutes. The JIT callback can help to achieve this without keeping a +list of the currently JIT studied patterns. +.P +(6) OK, the stack is for long term memory allocation. But what happens if a +pattern causes stack overflow with a stack of 1M? Is that 1M kept until the +stack is freed? +.sp +Especially on embedded sytems, it might be a good idea to release memory +sometimes without freeing the stack. There is no API for this at the moment. +Probably a function call which returns with the currently allocated memory for +any stack and another which allows releasing memory (shrinking the stack) would +be a good idea if someone needs this. +.P +(7) This is too much of a headache. Isn't there any better solution for JIT +stack handling? +.sp +No, thanks to Windows. If POSIX threads were used everywhere, we could throw +out this complicated API. +. +. +.SH "EXAMPLE CODE" +.rs +.sp +This is a single-threaded example that specifies a JIT stack without using a +callback. +.sp + int rc; + int ovector[30]; + pcre *re; + pcre_extra *extra; + pcre_jit_stack *jit_stack; +.sp + re = pcre_compile(pattern, 0, &error, &erroffset, NULL); + /* Check for errors */ + extra = pcre_study(re, PCRE_STUDY_JIT_COMPILE, &error); + jit_stack = pcre_jit_stack_alloc(32*1024, 512*1024); + /* Check for error (NULL) */ + pcre_assign_jit_stack(extra, NULL, jit_stack); + rc = pcre_exec(re, extra, subject, length, 0, 0, ovector, 30); + /* Check results */ + pcre_free(re); + pcre_free_study(extra); + pcre_jit_stack_free(jit_stack); +.sp +. +. +.SH "JIT FAST PATH API" +.rs +.sp +Because the API described above falls back to interpreted execution when JIT is +not available, it is convenient for programs that are written for general use +in many environments. However, calling JIT via \fBpcre_exec()\fP does have a +performance impact. Programs that are written for use where JIT is known to be +available, and which need the best possible performance, can instead use a +"fast path" API to call JIT execution directly instead of calling +\fBpcre_exec()\fP (obviously only for patterns that have been successfully +studied by JIT). +.P +The fast path function is called \fBpcre_jit_exec()\fP, and it takes exactly +the same arguments as \fBpcre_exec()\fP, plus one additional argument that +must point to a JIT stack. The JIT stack arrangements described above do not +apply. The return values are the same as for \fBpcre_exec()\fP. +.P +When you call \fBpcre_exec()\fP, as well as testing for invalid options, a +number of other sanity checks are performed on the arguments. For example, if +the subject pointer is NULL, or its length is negative, an immediate error is +given. Also, unless PCRE_NO_UTF[8|16|32] is set, a UTF subject string is tested +for validity. In the interests of speed, these checks do not happen on the JIT +fast path, and if invalid data is passed, the result is undefined. +.P +Bypassing the sanity checks and the \fBpcre_exec()\fP wrapping can give +speedups of more than 10%. +.P +Note that the \fBpcre_jit_exec()\fP function is not available in versions of +PCRE before 8.32 (released in November 2012). If you need to support versions +that old you must either use the slower \fBpcre_exec()\fP, or switch between +the two codepaths by checking the values of PCRE_MAJOR and PCRE_MINOR. +.P +Due to an unfortunate implementation oversight, even in versions 8.32 +and later there will be no \fBpcre_jit_exec()\fP stub function defined +when PCRE is compiled with --disable-jit, which is the default, and +there's no way to detect whether PCRE was compiled with --enable-jit +via a macro. +.P +If you need to support versions older than 8.32, or versions that may +not build with --enable-jit, you must either use the slower +\fBpcre_exec()\fP, or switch between the two codepaths by checking the +values of PCRE_MAJOR and PCRE_MINOR. +.P +Switching between the two by checking the version assumes that all the +versions being targeted are built with --enable-jit. To also support +builds that may use --disable-jit either \fBpcre_exec()\fP must be +used, or a compile-time check for JIT via \fBpcre_config()\fP (which +assumes the runtime environment will be the same), or as the Git +project decided to do, simply assume that \fBpcre_jit_exec()\fP is +present in 8.32 or later unless a compile-time flag is provided, see +the "grep: un-break building with PCRE >= 8.32 without --enable-jit" +commit in git.git for an example of that. +. +. +.SH "SEE ALSO" +.rs +.sp +\fBpcreapi\fP(3) +. +. +.SH AUTHOR +.rs +.sp +.nf +Philip Hazel (FAQ by Zoltan Herczeg) +University Computing Service +Cambridge CB2 3QH, England. +.fi +. +. +.SH REVISION +.rs +.sp +.nf +Last updated: 05 July 2017 +Copyright (c) 1997-2017 University of Cambridge. +.fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrelimits.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrelimits.3 new file mode 100644 index 0000000000000000000000000000000000000000..423d6a276848920716bfedeac41a8b94b2351ced --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrelimits.3 @@ -0,0 +1,71 @@ +.TH PCRELIMITS 3 "05 November 2013" "PCRE 8.34" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH "SIZE AND OTHER LIMITATIONS" +.rs +.sp +There are some size limitations in PCRE but it is hoped that they will never in +practice be relevant. +.P +The maximum length of a compiled pattern is approximately 64K data units (bytes +for the 8-bit library, 16-bit units for the 16-bit library, and 32-bit units for +the 32-bit library) if PCRE is compiled with the default internal linkage size, +which is 2 bytes for the 8-bit and 16-bit libraries, and 4 bytes for the 32-bit +library. If you want to process regular expressions that are truly enormous, +you can compile PCRE with an internal linkage size of 3 or 4 (when building the +16-bit or 32-bit library, 3 is rounded up to 4). See the \fBREADME\fP file in +the source distribution and the +.\" HREF +\fBpcrebuild\fP +.\" +documentation for details. In these cases the limit is substantially larger. +However, the speed of execution is slower. +.P +All values in repeating quantifiers must be less than 65536. +.P +There is no limit to the number of parenthesized subpatterns, but there can be +no more than 65535 capturing subpatterns. There is, however, a limit to the +depth of nesting of parenthesized subpatterns of all kinds. This is imposed in +order to limit the amount of system stack used at compile time. The limit can +be specified when PCRE is built; the default is 250. +.P +There is a limit to the number of forward references to subsequent subpatterns +of around 200,000. Repeated forward references with fixed upper limits, for +example, (?2){0,100} when subpattern number 2 is to the right, are included in +the count. There is no limit to the number of backward references. +.P +The maximum length of name for a named subpattern is 32 characters, and the +maximum number of named subpatterns is 10000. +.P +The maximum length of a name in a (*MARK), (*PRUNE), (*SKIP), or (*THEN) verb +is 255 for the 8-bit library and 65535 for the 16-bit and 32-bit libraries. +.P +The maximum length of a subject string is the largest positive number that an +integer variable can hold. However, when using the traditional matching +function, PCRE uses recursion to handle subpatterns and indefinite repetition. +This means that the available stack space may limit the size of a subject +string that can be processed by certain patterns. For a discussion of stack +issues, see the +.\" HREF +\fBpcrestack\fP +.\" +documentation. +. +. +.SH AUTHOR +.rs +.sp +.nf +Philip Hazel +University Computing Service +Cambridge CB2 3QH, England. +.fi +. +. +.SH REVISION +.rs +.sp +.nf +Last updated: 05 November 2013 +Copyright (c) 1997-2013 University of Cambridge. +.fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrematching.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrematching.3 new file mode 100644 index 0000000000000000000000000000000000000000..268baf9b8c6e3ebd4c20fe95b036b956dfbb7001 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrematching.3 @@ -0,0 +1,214 @@ +.TH PCREMATCHING 3 "12 November 2013" "PCRE 8.34" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH "PCRE MATCHING ALGORITHMS" +.rs +.sp +This document describes the two different algorithms that are available in PCRE +for matching a compiled regular expression against a given subject string. The +"standard" algorithm is the one provided by the \fBpcre_exec()\fP, +\fBpcre16_exec()\fP and \fBpcre32_exec()\fP functions. These work in the same +as as Perl's matching function, and provide a Perl-compatible matching operation. +The just-in-time (JIT) optimization that is described in the +.\" HREF +\fBpcrejit\fP +.\" +documentation is compatible with these functions. +.P +An alternative algorithm is provided by the \fBpcre_dfa_exec()\fP, +\fBpcre16_dfa_exec()\fP and \fBpcre32_dfa_exec()\fP functions; they operate in +a different way, and are not Perl-compatible. This alternative has advantages +and disadvantages compared with the standard algorithm, and these are described +below. +.P +When there is only one possible way in which a given subject string can match a +pattern, the two algorithms give the same answer. A difference arises, however, +when there are multiple possibilities. For example, if the pattern +.sp + ^<.*> +.sp +is matched against the string +.sp + +.sp +there are three possible answers. The standard algorithm finds only one of +them, whereas the alternative algorithm finds all three. +. +. +.SH "REGULAR EXPRESSIONS AS TREES" +.rs +.sp +The set of strings that are matched by a regular expression can be represented +as a tree structure. An unlimited repetition in the pattern makes the tree of +infinite size, but it is still a tree. Matching the pattern to a given subject +string (from a given starting point) can be thought of as a search of the tree. +There are two ways to search a tree: depth-first and breadth-first, and these +correspond to the two matching algorithms provided by PCRE. +. +. +.SH "THE STANDARD MATCHING ALGORITHM" +.rs +.sp +In the terminology of Jeffrey Friedl's book "Mastering Regular +Expressions", the standard algorithm is an "NFA algorithm". It conducts a +depth-first search of the pattern tree. That is, it proceeds along a single +path through the tree, checking that the subject matches what is required. When +there is a mismatch, the algorithm tries any alternatives at the current point, +and if they all fail, it backs up to the previous branch point in the tree, and +tries the next alternative branch at that level. This often involves backing up +(moving to the left) in the subject string as well. The order in which +repetition branches are tried is controlled by the greedy or ungreedy nature of +the quantifier. +.P +If a leaf node is reached, a matching string has been found, and at that point +the algorithm stops. Thus, if there is more than one possible match, this +algorithm returns the first one that it finds. Whether this is the shortest, +the longest, or some intermediate length depends on the way the greedy and +ungreedy repetition quantifiers are specified in the pattern. +.P +Because it ends up with a single path through the tree, it is relatively +straightforward for this algorithm to keep track of the substrings that are +matched by portions of the pattern in parentheses. This provides support for +capturing parentheses and back references. +. +. +.SH "THE ALTERNATIVE MATCHING ALGORITHM" +.rs +.sp +This algorithm conducts a breadth-first search of the tree. Starting from the +first matching point in the subject, it scans the subject string from left to +right, once, character by character, and as it does this, it remembers all the +paths through the tree that represent valid matches. In Friedl's terminology, +this is a kind of "DFA algorithm", though it is not implemented as a +traditional finite state machine (it keeps multiple states active +simultaneously). +.P +Although the general principle of this matching algorithm is that it scans the +subject string only once, without backtracking, there is one exception: when a +lookaround assertion is encountered, the characters following or preceding the +current point have to be independently inspected. +.P +The scan continues until either the end of the subject is reached, or there are +no more unterminated paths. At this point, terminated paths represent the +different matching possibilities (if there are none, the match has failed). +Thus, if there is more than one possible match, this algorithm finds all of +them, and in particular, it finds the longest. The matches are returned in +decreasing order of length. There is an option to stop the algorithm after the +first match (which is necessarily the shortest) is found. +.P +Note that all the matches that are found start at the same point in the +subject. If the pattern +.sp + cat(er(pillar)?)? +.sp +is matched against the string "the caterpillar catchment", the result will be +the three strings "caterpillar", "cater", and "cat" that start at the fifth +character of the subject. The algorithm does not automatically move on to find +matches that start at later positions. +.P +PCRE's "auto-possessification" optimization usually applies to character +repeats at the end of a pattern (as well as internally). For example, the +pattern "a\ed+" is compiled as if it were "a\ed++" because there is no point +even considering the possibility of backtracking into the repeated digits. For +DFA matching, this means that only one possible match is found. If you really +do want multiple matches in such cases, either use an ungreedy repeat +("a\ed+?") or set the PCRE_NO_AUTO_POSSESS option when compiling. +.P +There are a number of features of PCRE regular expressions that are not +supported by the alternative matching algorithm. They are as follows: +.P +1. Because the algorithm finds all possible matches, the greedy or ungreedy +nature of repetition quantifiers is not relevant. Greedy and ungreedy +quantifiers are treated in exactly the same way. However, possessive +quantifiers can make a difference when what follows could also match what is +quantified, for example in a pattern like this: +.sp + ^a++\ew! +.sp +This pattern matches "aaab!" but not "aaa!", which would be matched by a +non-possessive quantifier. Similarly, if an atomic group is present, it is +matched as if it were a standalone pattern at the current point, and the +longest match is then "locked in" for the rest of the overall pattern. +.P +2. When dealing with multiple paths through the tree simultaneously, it is not +straightforward to keep track of captured substrings for the different matching +possibilities, and PCRE's implementation of this algorithm does not attempt to +do this. This means that no captured substrings are available. +.P +3. Because no substrings are captured, back references within the pattern are +not supported, and cause errors if encountered. +.P +4. For the same reason, conditional expressions that use a backreference as the +condition or test for a specific group recursion are not supported. +.P +5. Because many paths through the tree may be active, the \eK escape sequence, +which resets the start of the match when encountered (but may be on some paths +and not on others), is not supported. It causes an error if encountered. +.P +6. Callouts are supported, but the value of the \fIcapture_top\fP field is +always 1, and the value of the \fIcapture_last\fP field is always -1. +.P +7. The \eC escape sequence, which (in the standard algorithm) always matches a +single data unit, even in UTF-8, UTF-16 or UTF-32 modes, is not supported in +these modes, because the alternative algorithm moves through the subject string +one character (not data unit) at a time, for all active paths through the tree. +.P +8. Except for (*FAIL), the backtracking control verbs such as (*PRUNE) are not +supported. (*FAIL) is supported, and behaves like a failing negative assertion. +. +. +.SH "ADVANTAGES OF THE ALTERNATIVE ALGORITHM" +.rs +.sp +Using the alternative matching algorithm provides the following advantages: +.P +1. All possible matches (at a single point in the subject) are automatically +found, and in particular, the longest match is found. To find more than one +match using the standard algorithm, you have to do kludgy things with +callouts. +.P +2. Because the alternative algorithm scans the subject string just once, and +never needs to backtrack (except for lookbehinds), it is possible to pass very +long subject strings to the matching function in several pieces, checking for +partial matching each time. Although it is possible to do multi-segment +matching using the standard algorithm by retaining partially matched +substrings, it is more complicated. The +.\" HREF +\fBpcrepartial\fP +.\" +documentation gives details of partial matching and discusses multi-segment +matching. +. +. +.SH "DISADVANTAGES OF THE ALTERNATIVE ALGORITHM" +.rs +.sp +The alternative algorithm suffers from a number of disadvantages: +.P +1. It is substantially slower than the standard algorithm. This is partly +because it has to search for all possible matches, but is also because it is +less susceptible to optimization. +.P +2. Capturing parentheses and back references are not supported. +.P +3. Although atomic groups are supported, their use does not provide the +performance advantage that it does for the standard algorithm. +. +. +.SH AUTHOR +.rs +.sp +.nf +Philip Hazel +University Computing Service +Cambridge CB2 3QH, England. +.fi +. +. +.SH REVISION +.rs +.sp +.nf +Last updated: 12 November 2013 +Copyright (c) 1997-2012 University of Cambridge. +.fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrepartial.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrepartial.3 new file mode 100644 index 0000000000000000000000000000000000000000..14d0124f1c271fef49809d2f01eab3667342849a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrepartial.3 @@ -0,0 +1,476 @@ +.TH PCREPARTIAL 3 "02 July 2013" "PCRE 8.34" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH "PARTIAL MATCHING IN PCRE" +.rs +.sp +In normal use of PCRE, if the subject string that is passed to a matching +function matches as far as it goes, but is too short to match the entire +pattern, PCRE_ERROR_NOMATCH is returned. There are circumstances where it might +be helpful to distinguish this case from other cases in which there is no +match. +.P +Consider, for example, an application where a human is required to type in data +for a field with specific formatting requirements. An example might be a date +in the form \fIddmmmyy\fP, defined by this pattern: +.sp + ^\ed?\ed(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\ed\ed$ +.sp +If the application sees the user's keystrokes one by one, and can check that +what has been typed so far is potentially valid, it is able to raise an error +as soon as a mistake is made, by beeping and not reflecting the character that +has been typed, for example. This immediate feedback is likely to be a better +user interface than a check that is delayed until the entire string has been +entered. Partial matching can also be useful when the subject string is very +long and is not all available at once. +.P +PCRE supports partial matching by means of the PCRE_PARTIAL_SOFT and +PCRE_PARTIAL_HARD options, which can be set when calling any of the matching +functions. For backwards compatibility, PCRE_PARTIAL is a synonym for +PCRE_PARTIAL_SOFT. The essential difference between the two options is whether +or not a partial match is preferred to an alternative complete match, though +the details differ between the two types of matching function. If both options +are set, PCRE_PARTIAL_HARD takes precedence. +.P +If you want to use partial matching with just-in-time optimized code, you must +call \fBpcre_study()\fP, \fBpcre16_study()\fP or \fBpcre32_study()\fP with one +or both of these options: +.sp + PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE + PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE +.sp +PCRE_STUDY_JIT_COMPILE should also be set if you are going to run non-partial +matches on the same pattern. If the appropriate JIT study mode has not been set +for a match, the interpretive matching code is used. +.P +Setting a partial matching option disables two of PCRE's standard +optimizations. PCRE remembers the last literal data unit in a pattern, and +abandons matching immediately if it is not present in the subject string. This +optimization cannot be used for a subject string that might match only +partially. If the pattern was studied, PCRE knows the minimum length of a +matching string, and does not bother to run the matching function on shorter +strings. This optimization is also disabled for partial matching. +. +. +.SH "PARTIAL MATCHING USING pcre_exec() OR pcre[16|32]_exec()" +.rs +.sp +A partial match occurs during a call to \fBpcre_exec()\fP or +\fBpcre[16|32]_exec()\fP when the end of the subject string is reached +successfully, but matching cannot continue because more characters are needed. +However, at least one character in the subject must have been inspected. This +character need not form part of the final matched string; lookbehind assertions +and the \eK escape sequence provide ways of inspecting characters before the +start of a matched substring. The requirement for inspecting at least one +character exists because an empty string can always be matched; without such a +restriction there would always be a partial match of an empty string at the end +of the subject. +.P +If there are at least two slots in the offsets vector when a partial match is +returned, the first slot is set to the offset of the earliest character that +was inspected. For convenience, the second offset points to the end of the +subject so that a substring can easily be identified. If there are at least +three slots in the offsets vector, the third slot is set to the offset of the +character where matching started. +.P +For the majority of patterns, the contents of the first and third slots will be +the same. However, for patterns that contain lookbehind assertions, or begin +with \eb or \eB, characters before the one where matching started may have been +inspected while carrying out the match. For example, consider this pattern: +.sp + /(?<=abc)123/ +.sp +This pattern matches "123", but only if it is preceded by "abc". If the subject +string is "xyzabc12", the first two offsets after a partial match are for the +substring "abc12", because all these characters were inspected. However, the +third offset is set to 6, because that is the offset where matching began. +.P +What happens when a partial match is identified depends on which of the two +partial matching options are set. +. +. +.SS "PCRE_PARTIAL_SOFT WITH pcre_exec() OR pcre[16|32]_exec()" +.rs +.sp +If PCRE_PARTIAL_SOFT is set when \fBpcre_exec()\fP or \fBpcre[16|32]_exec()\fP +identifies a partial match, the partial match is remembered, but matching +continues as normal, and other alternatives in the pattern are tried. If no +complete match can be found, PCRE_ERROR_PARTIAL is returned instead of +PCRE_ERROR_NOMATCH. +.P +This option is "soft" because it prefers a complete match over a partial match. +All the various matching items in a pattern behave as if the subject string is +potentially complete. For example, \ez, \eZ, and $ match at the end of the +subject, as normal, and for \eb and \eB the end of the subject is treated as a +non-alphanumeric. +.P +If there is more than one partial match, the first one that was found provides +the data that is returned. Consider this pattern: +.sp + /123\ew+X|dogY/ +.sp +If this is matched against the subject string "abc123dog", both +alternatives fail to match, but the end of the subject is reached during +matching, so PCRE_ERROR_PARTIAL is returned. The offsets are set to 3 and 9, +identifying "123dog" as the first partial match that was found. (In this +example, there are two partial matches, because "dog" on its own partially +matches the second alternative.) +. +. +.SS "PCRE_PARTIAL_HARD WITH pcre_exec() OR pcre[16|32]_exec()" +.rs +.sp +If PCRE_PARTIAL_HARD is set for \fBpcre_exec()\fP or \fBpcre[16|32]_exec()\fP, +PCRE_ERROR_PARTIAL is returned as soon as a partial match is found, without +continuing to search for possible complete matches. This option is "hard" +because it prefers an earlier partial match over a later complete match. For +this reason, the assumption is made that the end of the supplied subject string +may not be the true end of the available data, and so, if \ez, \eZ, \eb, \eB, +or $ are encountered at the end of the subject, the result is +PCRE_ERROR_PARTIAL, provided that at least one character in the subject has +been inspected. +.P +Setting PCRE_PARTIAL_HARD also affects the way UTF-8 and UTF-16 +subject strings are checked for validity. Normally, an invalid sequence +causes the error PCRE_ERROR_BADUTF8 or PCRE_ERROR_BADUTF16. However, in the +special case of a truncated character at the end of the subject, +PCRE_ERROR_SHORTUTF8 or PCRE_ERROR_SHORTUTF16 is returned when +PCRE_PARTIAL_HARD is set. +. +. +.SS "Comparing hard and soft partial matching" +.rs +.sp +The difference between the two partial matching options can be illustrated by a +pattern such as: +.sp + /dog(sbody)?/ +.sp +This matches either "dog" or "dogsbody", greedily (that is, it prefers the +longer string if possible). If it is matched against the string "dog" with +PCRE_PARTIAL_SOFT, it yields a complete match for "dog". However, if +PCRE_PARTIAL_HARD is set, the result is PCRE_ERROR_PARTIAL. On the other hand, +if the pattern is made ungreedy the result is different: +.sp + /dog(sbody)??/ +.sp +In this case the result is always a complete match because that is found first, +and matching never continues after finding a complete match. It might be easier +to follow this explanation by thinking of the two patterns like this: +.sp + /dog(sbody)?/ is the same as /dogsbody|dog/ + /dog(sbody)??/ is the same as /dog|dogsbody/ +.sp +The second pattern will never match "dogsbody", because it will always find the +shorter match first. +. +. +.SH "PARTIAL MATCHING USING pcre_dfa_exec() OR pcre[16|32]_dfa_exec()" +.rs +.sp +The DFA functions move along the subject string character by character, without +backtracking, searching for all possible matches simultaneously. If the end of +the subject is reached before the end of the pattern, there is the possibility +of a partial match, again provided that at least one character has been +inspected. +.P +When PCRE_PARTIAL_SOFT is set, PCRE_ERROR_PARTIAL is returned only if there +have been no complete matches. Otherwise, the complete matches are returned. +However, if PCRE_PARTIAL_HARD is set, a partial match takes precedence over any +complete matches. The portion of the string that was inspected when the longest +partial match was found is set as the first matching string, provided there are +at least two slots in the offsets vector. +.P +Because the DFA functions always search for all possible matches, and there is +no difference between greedy and ungreedy repetition, their behaviour is +different from the standard functions when PCRE_PARTIAL_HARD is set. Consider +the string "dog" matched against the ungreedy pattern shown above: +.sp + /dog(sbody)??/ +.sp +Whereas the standard functions stop as soon as they find the complete match for +"dog", the DFA functions also find the partial match for "dogsbody", and so +return that when PCRE_PARTIAL_HARD is set. +. +. +.SH "PARTIAL MATCHING AND WORD BOUNDARIES" +.rs +.sp +If a pattern ends with one of sequences \eb or \eB, which test for word +boundaries, partial matching with PCRE_PARTIAL_SOFT can give counter-intuitive +results. Consider this pattern: +.sp + /\ebcat\eb/ +.sp +This matches "cat", provided there is a word boundary at either end. If the +subject string is "the cat", the comparison of the final "t" with a following +character cannot take place, so a partial match is found. However, normal +matching carries on, and \eb matches at the end of the subject when the last +character is a letter, so a complete match is found. The result, therefore, is +\fInot\fP PCRE_ERROR_PARTIAL. Using PCRE_PARTIAL_HARD in this case does yield +PCRE_ERROR_PARTIAL, because then the partial match takes precedence. +. +. +.SH "FORMERLY RESTRICTED PATTERNS" +.rs +.sp +For releases of PCRE prior to 8.00, because of the way certain internal +optimizations were implemented in the \fBpcre_exec()\fP function, the +PCRE_PARTIAL option (predecessor of PCRE_PARTIAL_SOFT) could not be used with +all patterns. From release 8.00 onwards, the restrictions no longer apply, and +partial matching with can be requested for any pattern. +.P +Items that were formerly restricted were repeated single characters and +repeated metasequences. If PCRE_PARTIAL was set for a pattern that did not +conform to the restrictions, \fBpcre_exec()\fP returned the error code +PCRE_ERROR_BADPARTIAL (-13). This error code is no longer in use. The +PCRE_INFO_OKPARTIAL call to \fBpcre_fullinfo()\fP to find out if a compiled +pattern can be used for partial matching now always returns 1. +. +. +.SH "EXAMPLE OF PARTIAL MATCHING USING PCRETEST" +.rs +.sp +If the escape sequence \eP is present in a \fBpcretest\fP data line, the +PCRE_PARTIAL_SOFT option is used for the match. Here is a run of \fBpcretest\fP +that uses the date example quoted above: +.sp + re> /^\ed?\ed(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\ed\ed$/ + data> 25jun04\eP + 0: 25jun04 + 1: jun + data> 25dec3\eP + Partial match: 23dec3 + data> 3ju\eP + Partial match: 3ju + data> 3juj\eP + No match + data> j\eP + No match +.sp +The first data string is matched completely, so \fBpcretest\fP shows the +matched substrings. The remaining four strings do not match the complete +pattern, but the first two are partial matches. Similar output is obtained +if DFA matching is used. +.P +If the escape sequence \eP is present more than once in a \fBpcretest\fP data +line, the PCRE_PARTIAL_HARD option is set for the match. +. +. +.SH "MULTI-SEGMENT MATCHING WITH pcre_dfa_exec() OR pcre[16|32]_dfa_exec()" +.rs +.sp +When a partial match has been found using a DFA matching function, it is +possible to continue the match by providing additional subject data and calling +the function again with the same compiled regular expression, this time setting +the PCRE_DFA_RESTART option. You must pass the same working space as before, +because this is where details of the previous partial match are stored. Here is +an example using \fBpcretest\fP, using the \eR escape sequence to set the +PCRE_DFA_RESTART option (\eD specifies the use of the DFA matching function): +.sp + re> /^\ed?\ed(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\ed\ed$/ + data> 23ja\eP\eD + Partial match: 23ja + data> n05\eR\eD + 0: n05 +.sp +The first call has "23ja" as the subject, and requests partial matching; the +second call has "n05" as the subject for the continued (restarted) match. +Notice that when the match is complete, only the last part is shown; PCRE does +not retain the previously partially-matched string. It is up to the calling +program to do that if it needs to. +.P +That means that, for an unanchored pattern, if a continued match fails, it is +not possible to try again at a new starting point. All this facility is capable +of doing is continuing with the previous match attempt. In the previous +example, if the second set of data is "ug23" the result is no match, even +though there would be a match for "aug23" if the entire string were given at +once. Depending on the application, this may or may not be what you want. +The only way to allow for starting again at the next character is to retain the +matched part of the subject and try a new complete match. +.P +You can set the PCRE_PARTIAL_SOFT or PCRE_PARTIAL_HARD options with +PCRE_DFA_RESTART to continue partial matching over multiple segments. This +facility can be used to pass very long subject strings to the DFA matching +functions. +. +. +.SH "MULTI-SEGMENT MATCHING WITH pcre_exec() OR pcre[16|32]_exec()" +.rs +.sp +From release 8.00, the standard matching functions can also be used to do +multi-segment matching. Unlike the DFA functions, it is not possible to +restart the previous match with a new segment of data. Instead, new data must +be added to the previous subject string, and the entire match re-run, starting +from the point where the partial match occurred. Earlier data can be discarded. +.P +It is best to use PCRE_PARTIAL_HARD in this situation, because it does not +treat the end of a segment as the end of the subject when matching \ez, \eZ, +\eb, \eB, and $. Consider an unanchored pattern that matches dates: +.sp + re> /\ed?\ed(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\ed\ed/ + data> The date is 23ja\eP\eP + Partial match: 23ja +.sp +At this stage, an application could discard the text preceding "23ja", add on +text from the next segment, and call the matching function again. Unlike the +DFA matching functions, the entire matching string must always be available, +and the complete matching process occurs for each call, so more memory and more +processing time is needed. +.P +\fBNote:\fP If the pattern contains lookbehind assertions, or \eK, or starts +with \eb or \eB, the string that is returned for a partial match includes +characters that precede the start of what would be returned for a complete +match, because it contains all the characters that were inspected during the +partial match. +. +. +.SH "ISSUES WITH MULTI-SEGMENT MATCHING" +.rs +.sp +Certain types of pattern may give problems with multi-segment matching, +whichever matching function is used. +.P +1. If the pattern contains a test for the beginning of a line, you need to pass +the PCRE_NOTBOL option when the subject string for any call does start at the +beginning of a line. There is also a PCRE_NOTEOL option, but in practice when +doing multi-segment matching you should be using PCRE_PARTIAL_HARD, which +includes the effect of PCRE_NOTEOL. +.P +2. Lookbehind assertions that have already been obeyed are catered for in the +offsets that are returned for a partial match. However a lookbehind assertion +later in the pattern could require even earlier characters to be inspected. You +can handle this case by using the PCRE_INFO_MAXLOOKBEHIND option of the +\fBpcre_fullinfo()\fP or \fBpcre[16|32]_fullinfo()\fP functions to obtain the +length of the longest lookbehind in the pattern. This length is given in +characters, not bytes. If you always retain at least that many characters +before the partially matched string, all should be well. (Of course, near the +start of the subject, fewer characters may be present; in that case all +characters should be retained.) +.P +From release 8.33, there is a more accurate way of deciding which characters to +retain. Instead of subtracting the length of the longest lookbehind from the +earliest inspected character (\fIoffsets[0]\fP), the match start position +(\fIoffsets[2]\fP) should be used, and the next match attempt started at the +\fIoffsets[2]\fP character by setting the \fIstartoffset\fP argument of +\fBpcre_exec()\fP or \fBpcre_dfa_exec()\fP. +.P +For example, if the pattern "(?<=123)abc" is partially +matched against the string "xx123a", the three offset values returned are 2, 6, +and 5. This indicates that the matching process that gave a partial match +started at offset 5, but the characters "123a" were all inspected. The maximum +lookbehind for that pattern is 3, so taking that away from 5 shows that we need +only keep "123a", and the next match attempt can be started at offset 3 (that +is, at "a") when further characters have been added. When the match start is +not the earliest inspected character, \fBpcretest\fP shows it explicitly: +.sp + re> "(?<=123)abc" + data> xx123a\eP\eP + Partial match at offset 5: 123a +.P +3. Because a partial match must always contain at least one character, what +might be considered a partial match of an empty string actually gives a "no +match" result. For example: +.sp + re> /c(?<=abc)x/ + data> ab\eP + No match +.sp +If the next segment begins "cx", a match should be found, but this will only +happen if characters from the previous segment are retained. For this reason, a +"no match" result should be interpreted as "partial match of an empty string" +when the pattern contains lookbehinds. +.P +4. Matching a subject string that is split into multiple segments may not +always produce exactly the same result as matching over one single long string, +especially when PCRE_PARTIAL_SOFT is used. The section "Partial Matching and +Word Boundaries" above describes an issue that arises if the pattern ends with +\eb or \eB. Another kind of difference may occur when there are multiple +matching possibilities, because (for PCRE_PARTIAL_SOFT) a partial match result +is given only when there are no completed matches. This means that as soon as +the shortest match has been found, continuation to a new subject segment is no +longer possible. Consider again this \fBpcretest\fP example: +.sp + re> /dog(sbody)?/ + data> dogsb\eP + 0: dog + data> do\eP\eD + Partial match: do + data> gsb\eR\eP\eD + 0: g + data> dogsbody\eD + 0: dogsbody + 1: dog +.sp +The first data line passes the string "dogsb" to a standard matching function, +setting the PCRE_PARTIAL_SOFT option. Although the string is a partial match +for "dogsbody", the result is not PCRE_ERROR_PARTIAL, because the shorter +string "dog" is a complete match. Similarly, when the subject is presented to +a DFA matching function in several parts ("do" and "gsb" being the first two) +the match stops when "dog" has been found, and it is not possible to continue. +On the other hand, if "dogsbody" is presented as a single string, a DFA +matching function finds both matches. +.P +Because of these problems, it is best to use PCRE_PARTIAL_HARD when matching +multi-segment data. The example above then behaves differently: +.sp + re> /dog(sbody)?/ + data> dogsb\eP\eP + Partial match: dogsb + data> do\eP\eD + Partial match: do + data> gsb\eR\eP\eP\eD + Partial match: gsb +.sp +5. Patterns that contain alternatives at the top level which do not all start +with the same pattern item may not work as expected when PCRE_DFA_RESTART is +used. For example, consider this pattern: +.sp + 1234|3789 +.sp +If the first part of the subject is "ABC123", a partial match of the first +alternative is found at offset 3. There is no partial match for the second +alternative, because such a match does not start at the same point in the +subject string. Attempting to continue with the string "7890" does not yield a +match because only those alternatives that match at one point in the subject +are remembered. The problem arises because the start of the second alternative +matches within the first alternative. There is no problem with anchored +patterns or patterns such as: +.sp + 1234|ABCD +.sp +where no string can be a partial match for both alternatives. This is not a +problem if a standard matching function is used, because the entire match has +to be rerun each time: +.sp + re> /1234|3789/ + data> ABC123\eP\eP + Partial match: 123 + data> 1237890 + 0: 3789 +.sp +Of course, instead of using PCRE_DFA_RESTART, the same technique of re-running +the entire match can also be used with the DFA matching functions. Another +possibility is to work with two buffers. If a partial match at offset \fIn\fP +in the first buffer is followed by "no match" when PCRE_DFA_RESTART is used on +the second buffer, you can then try a new match starting at offset \fIn+1\fP in +the first buffer. +. +. +.SH AUTHOR +.rs +.sp +.nf +Philip Hazel +University Computing Service +Cambridge CB2 3QH, England. +.fi +. +. +.SH REVISION +.rs +.sp +.nf +Last updated: 02 July 2013 +Copyright (c) 1997-2013 University of Cambridge. +.fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrepattern.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrepattern.3 new file mode 100644 index 0000000000000000000000000000000000000000..2f501a6503b6a1066b5448be1697c7560aa20fe2 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrepattern.3 @@ -0,0 +1,3304 @@ +.TH PCREPATTERN 3 "23 October 2016" "PCRE 8.40" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH "PCRE REGULAR EXPRESSION DETAILS" +.rs +.sp +The syntax and semantics of the regular expressions that are supported by PCRE +are described in detail below. There is a quick-reference syntax summary in the +.\" HREF +\fBpcresyntax\fP +.\" +page. PCRE tries to match Perl syntax and semantics as closely as it can. PCRE +also supports some alternative regular expression syntax (which does not +conflict with the Perl syntax) in order to provide some compatibility with +regular expressions in Python, .NET, and Oniguruma. +.P +Perl's regular expressions are described in its own documentation, and +regular expressions in general are covered in a number of books, some of which +have copious examples. Jeffrey Friedl's "Mastering Regular Expressions", +published by O'Reilly, covers regular expressions in great detail. This +description of PCRE's regular expressions is intended as reference material. +.P +This document discusses the patterns that are supported by PCRE when one its +main matching functions, \fBpcre_exec()\fP (8-bit) or \fBpcre[16|32]_exec()\fP +(16- or 32-bit), is used. PCRE also has alternative matching functions, +\fBpcre_dfa_exec()\fP and \fBpcre[16|32_dfa_exec()\fP, which match using a +different algorithm that is not Perl-compatible. Some of the features discussed +below are not available when DFA matching is used. The advantages and +disadvantages of the alternative functions, and how they differ from the normal +functions, are discussed in the +.\" HREF +\fBpcrematching\fP +.\" +page. +. +. +.SH "SPECIAL START-OF-PATTERN ITEMS" +.rs +.sp +A number of options that can be passed to \fBpcre_compile()\fP can also be set +by special items at the start of a pattern. These are not Perl-compatible, but +are provided to make these options accessible to pattern writers who are not +able to change the program that processes the pattern. Any number of these +items may appear, but they must all be together right at the start of the +pattern string, and the letters must be in upper case. +. +. +.SS "UTF support" +.rs +.sp +The original operation of PCRE was on strings of one-byte characters. However, +there is now also support for UTF-8 strings in the original library, an +extra library that supports 16-bit and UTF-16 character strings, and a +third library that supports 32-bit and UTF-32 character strings. To use these +features, PCRE must be built to include appropriate support. When using UTF +strings you must either call the compiling function with the PCRE_UTF8, +PCRE_UTF16, or PCRE_UTF32 option, or the pattern must start with one of +these special sequences: +.sp + (*UTF8) + (*UTF16) + (*UTF32) + (*UTF) +.sp +(*UTF) is a generic sequence that can be used with any of the libraries. +Starting a pattern with such a sequence is equivalent to setting the relevant +option. How setting a UTF mode affects pattern matching is mentioned in several +places below. There is also a summary of features in the +.\" HREF +\fBpcreunicode\fP +.\" +page. +.P +Some applications that allow their users to supply patterns may wish to +restrict them to non-UTF data for security reasons. If the PCRE_NEVER_UTF +option is set at compile time, (*UTF) etc. are not allowed, and their +appearance causes an error. +. +. +.SS "Unicode property support" +.rs +.sp +Another special sequence that may appear at the start of a pattern is (*UCP). +This has the same effect as setting the PCRE_UCP option: it causes sequences +such as \ed and \ew to use Unicode properties to determine character types, +instead of recognizing only characters with codes less than 128 via a lookup +table. +. +. +.SS "Disabling auto-possessification" +.rs +.sp +If a pattern starts with (*NO_AUTO_POSSESS), it has the same effect as setting +the PCRE_NO_AUTO_POSSESS option at compile time. This stops PCRE from making +quantifiers possessive when what follows cannot match the repeated item. For +example, by default a+b is treated as a++b. For more details, see the +.\" HREF +\fBpcreapi\fP +.\" +documentation. +. +. +.SS "Disabling start-up optimizations" +.rs +.sp +If a pattern starts with (*NO_START_OPT), it has the same effect as setting the +PCRE_NO_START_OPTIMIZE option either at compile or matching time. This disables +several optimizations for quickly reaching "no match" results. For more +details, see the +.\" HREF +\fBpcreapi\fP +.\" +documentation. +. +. +.\" HTML +.SS "Newline conventions" +.rs +.sp +PCRE supports five different conventions for indicating line breaks in +strings: a single CR (carriage return) character, a single LF (linefeed) +character, the two-character sequence CRLF, any of the three preceding, or any +Unicode newline sequence. The +.\" HREF +\fBpcreapi\fP +.\" +page has +.\" HTML +.\" +further discussion +.\" +about newlines, and shows how to set the newline convention in the +\fIoptions\fP arguments for the compiling and matching functions. +.P +It is also possible to specify a newline convention by starting a pattern +string with one of the following five sequences: +.sp + (*CR) carriage return + (*LF) linefeed + (*CRLF) carriage return, followed by linefeed + (*ANYCRLF) any of the three above + (*ANY) all Unicode newline sequences +.sp +These override the default and the options given to the compiling function. For +example, on a Unix system where LF is the default newline sequence, the pattern +.sp + (*CR)a.b +.sp +changes the convention to CR. That pattern matches "a\enb" because LF is no +longer a newline. If more than one of these settings is present, the last one +is used. +.P +The newline convention affects where the circumflex and dollar assertions are +true. It also affects the interpretation of the dot metacharacter when +PCRE_DOTALL is not set, and the behaviour of \eN. However, it does not affect +what the \eR escape sequence matches. By default, this is any Unicode newline +sequence, for Perl compatibility. However, this can be changed; see the +description of \eR in the section entitled +.\" HTML +.\" +"Newline sequences" +.\" +below. A change of \eR setting can be combined with a change of newline +convention. +. +. +.SS "Setting match and recursion limits" +.rs +.sp +The caller of \fBpcre_exec()\fP can set a limit on the number of times the +internal \fBmatch()\fP function is called and on the maximum depth of +recursive calls. These facilities are provided to catch runaway matches that +are provoked by patterns with huge matching trees (a typical example is a +pattern with nested unlimited repeats) and to avoid running out of system stack +by too much recursion. When one of these limits is reached, \fBpcre_exec()\fP +gives an error return. The limits can also be set by items at the start of the +pattern of the form +.sp + (*LIMIT_MATCH=d) + (*LIMIT_RECURSION=d) +.sp +where d is any number of decimal digits. However, the value of the setting must +be less than the value set (or defaulted) by the caller of \fBpcre_exec()\fP +for it to have any effect. In other words, the pattern writer can lower the +limits set by the programmer, but not raise them. If there is more than one +setting of one of these limits, the lower value is used. +. +. +.SH "EBCDIC CHARACTER CODES" +.rs +.sp +PCRE can be compiled to run in an environment that uses EBCDIC as its character +code rather than ASCII or Unicode (typically a mainframe system). In the +sections below, character code values are ASCII or Unicode; in an EBCDIC +environment these characters may have different code values, and there are no +code points greater than 255. +. +. +.SH "CHARACTERS AND METACHARACTERS" +.rs +.sp +A regular expression is a pattern that is matched against a subject string from +left to right. Most characters stand for themselves in a pattern, and match the +corresponding characters in the subject. As a trivial example, the pattern +.sp + The quick brown fox +.sp +matches a portion of a subject string that is identical to itself. When +caseless matching is specified (the PCRE_CASELESS option), letters are matched +independently of case. In a UTF mode, PCRE always understands the concept of +case for characters whose values are less than 128, so caseless matching is +always possible. For characters with higher values, the concept of case is +supported if PCRE is compiled with Unicode property support, but not otherwise. +If you want to use caseless matching for characters 128 and above, you must +ensure that PCRE is compiled with Unicode property support as well as with +UTF support. +.P +The power of regular expressions comes from the ability to include alternatives +and repetitions in the pattern. These are encoded in the pattern by the use of +\fImetacharacters\fP, which do not stand for themselves but instead are +interpreted in some special way. +.P +There are two different sets of metacharacters: those that are recognized +anywhere in the pattern except within square brackets, and those that are +recognized within square brackets. Outside square brackets, the metacharacters +are as follows: +.sp + \e general escape character with several uses + ^ assert start of string (or line, in multiline mode) + $ assert end of string (or line, in multiline mode) + . match any character except newline (by default) + [ start character class definition + | start of alternative branch + ( start subpattern + ) end subpattern + ? extends the meaning of ( + also 0 or 1 quantifier + also quantifier minimizer + * 0 or more quantifier + + 1 or more quantifier + also "possessive quantifier" + { start min/max quantifier +.sp +Part of a pattern that is in square brackets is called a "character class". In +a character class the only metacharacters are: +.sp + \e general escape character + ^ negate the class, but only if the first character + - indicates character range +.\" JOIN + [ POSIX character class (only if followed by POSIX + syntax) + ] terminates the character class +.sp +The following sections describe the use of each of the metacharacters. +. +. +.SH BACKSLASH +.rs +.sp +The backslash character has several uses. Firstly, if it is followed by a +character that is not a number or a letter, it takes away any special meaning +that character may have. This use of backslash as an escape character applies +both inside and outside character classes. +.P +For example, if you want to match a * character, you write \e* in the pattern. +This escaping action applies whether or not the following character would +otherwise be interpreted as a metacharacter, so it is always safe to precede a +non-alphanumeric with backslash to specify that it stands for itself. In +particular, if you want to match a backslash, you write \e\e. +.P +In a UTF mode, only ASCII numbers and letters have any special meaning after a +backslash. All other characters (in particular, those whose codepoints are +greater than 127) are treated as literals. +.P +If a pattern is compiled with the PCRE_EXTENDED option, most white space in the +pattern (other than in a character class), and characters between a # outside a +character class and the next newline, inclusive, are ignored. An escaping +backslash can be used to include a white space or # character as part of the +pattern. +.P +If you want to remove the special meaning from a sequence of characters, you +can do so by putting them between \eQ and \eE. This is different from Perl in +that $ and @ are handled as literals in \eQ...\eE sequences in PCRE, whereas in +Perl, $ and @ cause variable interpolation. Note the following examples: +.sp + Pattern PCRE matches Perl matches +.sp +.\" JOIN + \eQabc$xyz\eE abc$xyz abc followed by the + contents of $xyz + \eQabc\e$xyz\eE abc\e$xyz abc\e$xyz + \eQabc\eE\e$\eQxyz\eE abc$xyz abc$xyz +.sp +The \eQ...\eE sequence is recognized both inside and outside character classes. +An isolated \eE that is not preceded by \eQ is ignored. If \eQ is not followed +by \eE later in the pattern, the literal interpretation continues to the end of +the pattern (that is, \eE is assumed at the end). If the isolated \eQ is inside +a character class, this causes an error, because the character class is not +terminated. +. +. +.\" HTML +.SS "Non-printing characters" +.rs +.sp +A second use of backslash provides a way of encoding non-printing characters +in patterns in a visible manner. There is no restriction on the appearance of +non-printing characters, apart from the binary zero that terminates a pattern, +but when a pattern is being prepared by text editing, it is often easier to use +one of the following escape sequences than the binary character it represents. +In an ASCII or Unicode environment, these escapes are as follows: +.sp + \ea alarm, that is, the BEL character (hex 07) + \ecx "control-x", where x is any ASCII character + \ee escape (hex 1B) + \ef form feed (hex 0C) + \en linefeed (hex 0A) + \er carriage return (hex 0D) + \et tab (hex 09) + \e0dd character with octal code 0dd + \eddd character with octal code ddd, or back reference + \eo{ddd..} character with octal code ddd.. + \exhh character with hex code hh + \ex{hhh..} character with hex code hhh.. (non-JavaScript mode) + \euhhhh character with hex code hhhh (JavaScript mode only) +.sp +The precise effect of \ecx on ASCII characters is as follows: if x is a lower +case letter, it is converted to upper case. Then bit 6 of the character (hex +40) is inverted. Thus \ecA to \ecZ become hex 01 to hex 1A (A is 41, Z is 5A), +but \ec{ becomes hex 3B ({ is 7B), and \ec; becomes hex 7B (; is 3B). If the +data item (byte or 16-bit value) following \ec has a value greater than 127, a +compile-time error occurs. This locks out non-ASCII characters in all modes. +.P +When PCRE is compiled in EBCDIC mode, \ea, \ee, \ef, \en, \er, and \et +generate the appropriate EBCDIC code values. The \ec escape is processed +as specified for Perl in the \fBperlebcdic\fP document. The only characters +that are allowed after \ec are A-Z, a-z, or one of @, [, \e, ], ^, _, or ?. Any +other character provokes a compile-time error. The sequence \ec@ encodes +character code 0; after \ec the letters (in either case) encode characters 1-26 +(hex 01 to hex 1A); [, \e, ], ^, and _ encode characters 27-31 (hex 1B to hex +1F), and \ec? becomes either 255 (hex FF) or 95 (hex 5F). +.P +Thus, apart from \ec?, these escapes generate the same character code values as +they do in an ASCII environment, though the meanings of the values mostly +differ. For example, \ecG always generates code value 7, which is BEL in ASCII +but DEL in EBCDIC. +.P +The sequence \ec? generates DEL (127, hex 7F) in an ASCII environment, but +because 127 is not a control character in EBCDIC, Perl makes it generate the +APC character. Unfortunately, there are several variants of EBCDIC. In most of +them the APC character has the value 255 (hex FF), but in the one Perl calls +POSIX-BC its value is 95 (hex 5F). If certain other characters have POSIX-BC +values, PCRE makes \ec? generate 95; otherwise it generates 255. +.P +After \e0 up to two further octal digits are read. If there are fewer than two +digits, just those that are present are used. Thus the sequence \e0\ex\e015 +specifies two binary zeros followed by a CR character (code value 13). Make +sure you supply two digits after the initial zero if the pattern character that +follows is itself an octal digit. +.P +The escape \eo must be followed by a sequence of octal digits, enclosed in +braces. An error occurs if this is not the case. This escape is a recent +addition to Perl; it provides way of specifying character code points as octal +numbers greater than 0777, and it also allows octal numbers and back references +to be unambiguously specified. +.P +For greater clarity and unambiguity, it is best to avoid following \e by a +digit greater than zero. Instead, use \eo{} or \ex{} to specify character +numbers, and \eg{} to specify back references. The following paragraphs +describe the old, ambiguous syntax. +.P +The handling of a backslash followed by a digit other than 0 is complicated, +and Perl has changed in recent releases, causing PCRE also to change. Outside a +character class, PCRE reads the digit and any following digits as a decimal +number. If the number is less than 8, or if there have been at least that many +previous capturing left parentheses in the expression, the entire sequence is +taken as a \fIback reference\fP. A description of how this works is given +.\" HTML +.\" +later, +.\" +following the discussion of +.\" HTML +.\" +parenthesized subpatterns. +.\" +.P +Inside a character class, or if the decimal number following \e is greater than +7 and there have not been that many capturing subpatterns, PCRE handles \e8 and +\e9 as the literal characters "8" and "9", and otherwise re-reads up to three +octal digits following the backslash, using them to generate a data character. +Any subsequent digits stand for themselves. For example: +.sp + \e040 is another way of writing an ASCII space +.\" JOIN + \e40 is the same, provided there are fewer than 40 + previous capturing subpatterns + \e7 is always a back reference +.\" JOIN + \e11 might be a back reference, or another way of + writing a tab + \e011 is always a tab + \e0113 is a tab followed by the character "3" +.\" JOIN + \e113 might be a back reference, otherwise the + character with octal code 113 +.\" JOIN + \e377 might be a back reference, otherwise + the value 255 (decimal) +.\" JOIN + \e81 is either a back reference, or the two + characters "8" and "1" +.sp +Note that octal values of 100 or greater that are specified using this syntax +must not be introduced by a leading zero, because no more than three octal +digits are ever read. +.P +By default, after \ex that is not followed by {, from zero to two hexadecimal +digits are read (letters can be in upper or lower case). Any number of +hexadecimal digits may appear between \ex{ and }. If a character other than +a hexadecimal digit appears between \ex{ and }, or if there is no terminating +}, an error occurs. +.P +If the PCRE_JAVASCRIPT_COMPAT option is set, the interpretation of \ex is +as just described only when it is followed by two hexadecimal digits. +Otherwise, it matches a literal "x" character. In JavaScript mode, support for +code points greater than 256 is provided by \eu, which must be followed by +four hexadecimal digits; otherwise it matches a literal "u" character. +.P +Characters whose value is less than 256 can be defined by either of the two +syntaxes for \ex (or by \eu in JavaScript mode). There is no difference in the +way they are handled. For example, \exdc is exactly the same as \ex{dc} (or +\eu00dc in JavaScript mode). +. +. +.SS "Constraints on character values" +.rs +.sp +Characters that are specified using octal or hexadecimal numbers are +limited to certain values, as follows: +.sp + 8-bit non-UTF mode less than 0x100 + 8-bit UTF-8 mode less than 0x10ffff and a valid codepoint + 16-bit non-UTF mode less than 0x10000 + 16-bit UTF-16 mode less than 0x10ffff and a valid codepoint + 32-bit non-UTF mode less than 0x100000000 + 32-bit UTF-32 mode less than 0x10ffff and a valid codepoint +.sp +Invalid Unicode codepoints are the range 0xd800 to 0xdfff (the so-called +"surrogate" codepoints), and 0xffef. +. +. +.SS "Escape sequences in character classes" +.rs +.sp +All the sequences that define a single character value can be used both inside +and outside character classes. In addition, inside a character class, \eb is +interpreted as the backspace character (hex 08). +.P +\eN is not allowed in a character class. \eB, \eR, and \eX are not special +inside a character class. Like other unrecognized escape sequences, they are +treated as the literal characters "B", "R", and "X" by default, but cause an +error if the PCRE_EXTRA option is set. Outside a character class, these +sequences have different meanings. +. +. +.SS "Unsupported escape sequences" +.rs +.sp +In Perl, the sequences \el, \eL, \eu, and \eU are recognized by its string +handler and used to modify the case of following characters. By default, PCRE +does not support these escape sequences. However, if the PCRE_JAVASCRIPT_COMPAT +option is set, \eU matches a "U" character, and \eu can be used to define a +character by code point, as described in the previous section. +. +. +.SS "Absolute and relative back references" +.rs +.sp +The sequence \eg followed by an unsigned or a negative number, optionally +enclosed in braces, is an absolute or relative back reference. A named back +reference can be coded as \eg{name}. Back references are discussed +.\" HTML +.\" +later, +.\" +following the discussion of +.\" HTML +.\" +parenthesized subpatterns. +.\" +. +. +.SS "Absolute and relative subroutine calls" +.rs +.sp +For compatibility with Oniguruma, the non-Perl syntax \eg followed by a name or +a number enclosed either in angle brackets or single quotes, is an alternative +syntax for referencing a subpattern as a "subroutine". Details are discussed +.\" HTML +.\" +later. +.\" +Note that \eg{...} (Perl syntax) and \eg<...> (Oniguruma syntax) are \fInot\fP +synonymous. The former is a back reference; the latter is a +.\" HTML +.\" +subroutine +.\" +call. +. +. +.\" HTML +.SS "Generic character types" +.rs +.sp +Another use of backslash is for specifying generic character types: +.sp + \ed any decimal digit + \eD any character that is not a decimal digit + \eh any horizontal white space character + \eH any character that is not a horizontal white space character + \es any white space character + \eS any character that is not a white space character + \ev any vertical white space character + \eV any character that is not a vertical white space character + \ew any "word" character + \eW any "non-word" character +.sp +There is also the single sequence \eN, which matches a non-newline character. +This is the same as +.\" HTML +.\" +the "." metacharacter +.\" +when PCRE_DOTALL is not set. Perl also uses \eN to match characters by name; +PCRE does not support this. +.P +Each pair of lower and upper case escape sequences partitions the complete set +of characters into two disjoint sets. Any given character matches one, and only +one, of each pair. The sequences can appear both inside and outside character +classes. They each match one character of the appropriate type. If the current +matching point is at the end of the subject string, all of them fail, because +there is no character to match. +.P +For compatibility with Perl, \es did not used to match the VT character (code +11), which made it different from the the POSIX "space" class. However, Perl +added VT at release 5.18, and PCRE followed suit at release 8.34. The default +\es characters are now HT (9), LF (10), VT (11), FF (12), CR (13), and space +(32), which are defined as white space in the "C" locale. This list may vary if +locale-specific matching is taking place. For example, in some locales the +"non-breaking space" character (\exA0) is recognized as white space, and in +others the VT character is not. +.P +A "word" character is an underscore or any character that is a letter or digit. +By default, the definition of letters and digits is controlled by PCRE's +low-valued character tables, and may vary if locale-specific matching is taking +place (see +.\" HTML +.\" +"Locale support" +.\" +in the +.\" HREF +\fBpcreapi\fP +.\" +page). For example, in a French locale such as "fr_FR" in Unix-like systems, +or "french" in Windows, some character codes greater than 127 are used for +accented letters, and these are then matched by \ew. The use of locales with +Unicode is discouraged. +.P +By default, characters whose code points are greater than 127 never match \ed, +\es, or \ew, and always match \eD, \eS, and \eW, although this may vary for +characters in the range 128-255 when locale-specific matching is happening. +These escape sequences retain their original meanings from before Unicode +support was available, mainly for efficiency reasons. If PCRE is compiled with +Unicode property support, and the PCRE_UCP option is set, the behaviour is +changed so that Unicode properties are used to determine character types, as +follows: +.sp + \ed any character that matches \ep{Nd} (decimal digit) + \es any character that matches \ep{Z} or \eh or \ev + \ew any character that matches \ep{L} or \ep{N}, plus underscore +.sp +The upper case escapes match the inverse sets of characters. Note that \ed +matches only decimal digits, whereas \ew matches any Unicode digit, as well as +any Unicode letter, and underscore. Note also that PCRE_UCP affects \eb, and +\eB because they are defined in terms of \ew and \eW. Matching these sequences +is noticeably slower when PCRE_UCP is set. +.P +The sequences \eh, \eH, \ev, and \eV are features that were added to Perl at +release 5.10. In contrast to the other sequences, which match only ASCII +characters by default, these always match certain high-valued code points, +whether or not PCRE_UCP is set. The horizontal space characters are: +.sp + U+0009 Horizontal tab (HT) + U+0020 Space + U+00A0 Non-break space + U+1680 Ogham space mark + U+180E Mongolian vowel separator + U+2000 En quad + U+2001 Em quad + U+2002 En space + U+2003 Em space + U+2004 Three-per-em space + U+2005 Four-per-em space + U+2006 Six-per-em space + U+2007 Figure space + U+2008 Punctuation space + U+2009 Thin space + U+200A Hair space + U+202F Narrow no-break space + U+205F Medium mathematical space + U+3000 Ideographic space +.sp +The vertical space characters are: +.sp + U+000A Linefeed (LF) + U+000B Vertical tab (VT) + U+000C Form feed (FF) + U+000D Carriage return (CR) + U+0085 Next line (NEL) + U+2028 Line separator + U+2029 Paragraph separator +.sp +In 8-bit, non-UTF-8 mode, only the characters with codepoints less than 256 are +relevant. +. +. +.\" HTML +.SS "Newline sequences" +.rs +.sp +Outside a character class, by default, the escape sequence \eR matches any +Unicode newline sequence. In 8-bit non-UTF-8 mode \eR is equivalent to the +following: +.sp + (?>\er\en|\en|\ex0b|\ef|\er|\ex85) +.sp +This is an example of an "atomic group", details of which are given +.\" HTML +.\" +below. +.\" +This particular group matches either the two-character sequence CR followed by +LF, or one of the single characters LF (linefeed, U+000A), VT (vertical tab, +U+000B), FF (form feed, U+000C), CR (carriage return, U+000D), or NEL (next +line, U+0085). The two-character sequence is treated as a single unit that +cannot be split. +.P +In other modes, two additional characters whose codepoints are greater than 255 +are added: LS (line separator, U+2028) and PS (paragraph separator, U+2029). +Unicode character property support is not needed for these characters to be +recognized. +.P +It is possible to restrict \eR to match only CR, LF, or CRLF (instead of the +complete set of Unicode line endings) by setting the option PCRE_BSR_ANYCRLF +either at compile time or when the pattern is matched. (BSR is an abbreviation +for "backslash R".) This can be made the default when PCRE is built; if this is +the case, the other behaviour can be requested via the PCRE_BSR_UNICODE option. +It is also possible to specify these settings by starting a pattern string with +one of the following sequences: +.sp + (*BSR_ANYCRLF) CR, LF, or CRLF only + (*BSR_UNICODE) any Unicode newline sequence +.sp +These override the default and the options given to the compiling function, but +they can themselves be overridden by options given to a matching function. Note +that these special settings, which are not Perl-compatible, are recognized only +at the very start of a pattern, and that they must be in upper case. If more +than one of them is present, the last one is used. They can be combined with a +change of newline convention; for example, a pattern can start with: +.sp + (*ANY)(*BSR_ANYCRLF) +.sp +They can also be combined with the (*UTF8), (*UTF16), (*UTF32), (*UTF) or +(*UCP) special sequences. Inside a character class, \eR is treated as an +unrecognized escape sequence, and so matches the letter "R" by default, but +causes an error if PCRE_EXTRA is set. +. +. +.\" HTML +.SS Unicode character properties +.rs +.sp +When PCRE is built with Unicode character property support, three additional +escape sequences that match characters with specific properties are available. +When in 8-bit non-UTF-8 mode, these sequences are of course limited to testing +characters whose codepoints are less than 256, but they do work in this mode. +The extra escape sequences are: +.sp + \ep{\fIxx\fP} a character with the \fIxx\fP property + \eP{\fIxx\fP} a character without the \fIxx\fP property + \eX a Unicode extended grapheme cluster +.sp +The property names represented by \fIxx\fP above are limited to the Unicode +script names, the general category properties, "Any", which matches any +character (including newline), and some special PCRE properties (described +in the +.\" HTML +.\" +next section). +.\" +Other Perl properties such as "InMusicalSymbols" are not currently supported by +PCRE. Note that \eP{Any} does not match any characters, so always causes a +match failure. +.P +Sets of Unicode characters are defined as belonging to certain scripts. A +character from one of these sets can be matched using a script name. For +example: +.sp + \ep{Greek} + \eP{Han} +.sp +Those that are not part of an identified script are lumped together as +"Common". The current list of scripts is: +.P +Arabic, +Armenian, +Avestan, +Balinese, +Bamum, +Bassa_Vah, +Batak, +Bengali, +Bopomofo, +Brahmi, +Braille, +Buginese, +Buhid, +Canadian_Aboriginal, +Carian, +Caucasian_Albanian, +Chakma, +Cham, +Cherokee, +Common, +Coptic, +Cuneiform, +Cypriot, +Cyrillic, +Deseret, +Devanagari, +Duployan, +Egyptian_Hieroglyphs, +Elbasan, +Ethiopic, +Georgian, +Glagolitic, +Gothic, +Grantha, +Greek, +Gujarati, +Gurmukhi, +Han, +Hangul, +Hanunoo, +Hebrew, +Hiragana, +Imperial_Aramaic, +Inherited, +Inscriptional_Pahlavi, +Inscriptional_Parthian, +Javanese, +Kaithi, +Kannada, +Katakana, +Kayah_Li, +Kharoshthi, +Khmer, +Khojki, +Khudawadi, +Lao, +Latin, +Lepcha, +Limbu, +Linear_A, +Linear_B, +Lisu, +Lycian, +Lydian, +Mahajani, +Malayalam, +Mandaic, +Manichaean, +Meetei_Mayek, +Mende_Kikakui, +Meroitic_Cursive, +Meroitic_Hieroglyphs, +Miao, +Modi, +Mongolian, +Mro, +Myanmar, +Nabataean, +New_Tai_Lue, +Nko, +Ogham, +Ol_Chiki, +Old_Italic, +Old_North_Arabian, +Old_Permic, +Old_Persian, +Old_South_Arabian, +Old_Turkic, +Oriya, +Osmanya, +Pahawh_Hmong, +Palmyrene, +Pau_Cin_Hau, +Phags_Pa, +Phoenician, +Psalter_Pahlavi, +Rejang, +Runic, +Samaritan, +Saurashtra, +Sharada, +Shavian, +Siddham, +Sinhala, +Sora_Sompeng, +Sundanese, +Syloti_Nagri, +Syriac, +Tagalog, +Tagbanwa, +Tai_Le, +Tai_Tham, +Tai_Viet, +Takri, +Tamil, +Telugu, +Thaana, +Thai, +Tibetan, +Tifinagh, +Tirhuta, +Ugaritic, +Vai, +Warang_Citi, +Yi. +.P +Each character has exactly one Unicode general category property, specified by +a two-letter abbreviation. For compatibility with Perl, negation can be +specified by including a circumflex between the opening brace and the property +name. For example, \ep{^Lu} is the same as \eP{Lu}. +.P +If only one letter is specified with \ep or \eP, it includes all the general +category properties that start with that letter. In this case, in the absence +of negation, the curly brackets in the escape sequence are optional; these two +examples have the same effect: +.sp + \ep{L} + \epL +.sp +The following general category property codes are supported: +.sp + C Other + Cc Control + Cf Format + Cn Unassigned + Co Private use + Cs Surrogate +.sp + L Letter + Ll Lower case letter + Lm Modifier letter + Lo Other letter + Lt Title case letter + Lu Upper case letter +.sp + M Mark + Mc Spacing mark + Me Enclosing mark + Mn Non-spacing mark +.sp + N Number + Nd Decimal number + Nl Letter number + No Other number +.sp + P Punctuation + Pc Connector punctuation + Pd Dash punctuation + Pe Close punctuation + Pf Final punctuation + Pi Initial punctuation + Po Other punctuation + Ps Open punctuation +.sp + S Symbol + Sc Currency symbol + Sk Modifier symbol + Sm Mathematical symbol + So Other symbol +.sp + Z Separator + Zl Line separator + Zp Paragraph separator + Zs Space separator +.sp +The special property L& is also supported: it matches a character that has +the Lu, Ll, or Lt property, in other words, a letter that is not classified as +a modifier or "other". +.P +The Cs (Surrogate) property applies only to characters in the range U+D800 to +U+DFFF. Such characters are not valid in Unicode strings and so +cannot be tested by PCRE, unless UTF validity checking has been turned off +(see the discussion of PCRE_NO_UTF8_CHECK, PCRE_NO_UTF16_CHECK and +PCRE_NO_UTF32_CHECK in the +.\" HREF +\fBpcreapi\fP +.\" +page). Perl does not support the Cs property. +.P +The long synonyms for property names that Perl supports (such as \ep{Letter}) +are not supported by PCRE, nor is it permitted to prefix any of these +properties with "Is". +.P +No character that is in the Unicode table has the Cn (unassigned) property. +Instead, this property is assumed for any code point that is not in the +Unicode table. +.P +Specifying caseless matching does not affect these escape sequences. For +example, \ep{Lu} always matches only upper case letters. This is different from +the behaviour of current versions of Perl. +.P +Matching characters by Unicode property is not fast, because PCRE has to do a +multistage table lookup in order to find a character's property. That is why +the traditional escape sequences such as \ed and \ew do not use Unicode +properties in PCRE by default, though you can make them do so by setting the +PCRE_UCP option or by starting the pattern with (*UCP). +. +. +.SS Extended grapheme clusters +.rs +.sp +The \eX escape matches any number of Unicode characters that form an "extended +grapheme cluster", and treats the sequence as an atomic group +.\" HTML +.\" +(see below). +.\" +Up to and including release 8.31, PCRE matched an earlier, simpler definition +that was equivalent to +.sp + (?>\ePM\epM*) +.sp +That is, it matched a character without the "mark" property, followed by zero +or more characters with the "mark" property. Characters with the "mark" +property are typically non-spacing accents that affect the preceding character. +.P +This simple definition was extended in Unicode to include more complicated +kinds of composite character by giving each character a grapheme breaking +property, and creating rules that use these properties to define the boundaries +of extended grapheme clusters. In releases of PCRE later than 8.31, \eX matches +one of these clusters. +.P +\eX always matches at least one character. Then it decides whether to add +additional characters according to the following rules for ending a cluster: +.P +1. End at the end of the subject string. +.P +2. Do not end between CR and LF; otherwise end after any control character. +.P +3. Do not break Hangul (a Korean script) syllable sequences. Hangul characters +are of five types: L, V, T, LV, and LVT. An L character may be followed by an +L, V, LV, or LVT character; an LV or V character may be followed by a V or T +character; an LVT or T character may be followed only by a T character. +.P +4. Do not end before extending characters or spacing marks. Characters with +the "mark" property always have the "extend" grapheme breaking property. +.P +5. Do not end after prepend characters. +.P +6. Otherwise, end the cluster. +. +. +.\" HTML +.SS PCRE's additional properties +.rs +.sp +As well as the standard Unicode properties described above, PCRE supports four +more that make it possible to convert traditional escape sequences such as \ew +and \es to use Unicode properties. PCRE uses these non-standard, non-Perl +properties internally when PCRE_UCP is set. However, they may also be used +explicitly. These properties are: +.sp + Xan Any alphanumeric character + Xps Any POSIX space character + Xsp Any Perl space character + Xwd Any Perl "word" character +.sp +Xan matches characters that have either the L (letter) or the N (number) +property. Xps matches the characters tab, linefeed, vertical tab, form feed, or +carriage return, and any other character that has the Z (separator) property. +Xsp is the same as Xps; it used to exclude vertical tab, for Perl +compatibility, but Perl changed, and so PCRE followed at release 8.34. Xwd +matches the same characters as Xan, plus underscore. +.P +There is another non-standard property, Xuc, which matches any character that +can be represented by a Universal Character Name in C++ and other programming +languages. These are the characters $, @, ` (grave accent), and all characters +with Unicode code points greater than or equal to U+00A0, except for the +surrogates U+D800 to U+DFFF. Note that most base (ASCII) characters are +excluded. (Universal Character Names are of the form \euHHHH or \eUHHHHHHHH +where H is a hexadecimal digit. Note that the Xuc property does not match these +sequences but the characters that they represent.) +. +. +.\" HTML +.SS "Resetting the match start" +.rs +.sp +The escape sequence \eK causes any previously matched characters not to be +included in the final matched sequence. For example, the pattern: +.sp + foo\eKbar +.sp +matches "foobar", but reports that it has matched "bar". This feature is +similar to a lookbehind assertion +.\" HTML +.\" +(described below). +.\" +However, in this case, the part of the subject before the real match does not +have to be of fixed length, as lookbehind assertions do. The use of \eK does +not interfere with the setting of +.\" HTML +.\" +captured substrings. +.\" +For example, when the pattern +.sp + (foo)\eKbar +.sp +matches "foobar", the first substring is still set to "foo". +.P +Perl documents that the use of \eK within assertions is "not well defined". In +PCRE, \eK is acted upon when it occurs inside positive assertions, but is +ignored in negative assertions. Note that when a pattern such as (?=ab\eK) +matches, the reported start of the match can be greater than the end of the +match. +. +. +.\" HTML +.SS "Simple assertions" +.rs +.sp +The final use of backslash is for certain simple assertions. An assertion +specifies a condition that has to be met at a particular point in a match, +without consuming any characters from the subject string. The use of +subpatterns for more complicated assertions is described +.\" HTML +.\" +below. +.\" +The backslashed assertions are: +.sp + \eb matches at a word boundary + \eB matches when not at a word boundary + \eA matches at the start of the subject + \eZ matches at the end of the subject + also matches before a newline at the end of the subject + \ez matches only at the end of the subject + \eG matches at the first matching position in the subject +.sp +Inside a character class, \eb has a different meaning; it matches the backspace +character. If any other of these assertions appears in a character class, by +default it matches the corresponding literal character (for example, \eB +matches the letter B). However, if the PCRE_EXTRA option is set, an "invalid +escape sequence" error is generated instead. +.P +A word boundary is a position in the subject string where the current character +and the previous character do not both match \ew or \eW (i.e. one matches +\ew and the other matches \eW), or the start or end of the string if the +first or last character matches \ew, respectively. In a UTF mode, the meanings +of \ew and \eW can be changed by setting the PCRE_UCP option. When this is +done, it also affects \eb and \eB. Neither PCRE nor Perl has a separate "start +of word" or "end of word" metasequence. However, whatever follows \eb normally +determines which it is. For example, the fragment \eba matches "a" at the start +of a word. +.P +The \eA, \eZ, and \ez assertions differ from the traditional circumflex and +dollar (described in the next section) in that they only ever match at the very +start and end of the subject string, whatever options are set. Thus, they are +independent of multiline mode. These three assertions are not affected by the +PCRE_NOTBOL or PCRE_NOTEOL options, which affect only the behaviour of the +circumflex and dollar metacharacters. However, if the \fIstartoffset\fP +argument of \fBpcre_exec()\fP is non-zero, indicating that matching is to start +at a point other than the beginning of the subject, \eA can never match. The +difference between \eZ and \ez is that \eZ matches before a newline at the end +of the string as well as at the very end, whereas \ez matches only at the end. +.P +The \eG assertion is true only when the current matching position is at the +start point of the match, as specified by the \fIstartoffset\fP argument of +\fBpcre_exec()\fP. It differs from \eA when the value of \fIstartoffset\fP is +non-zero. By calling \fBpcre_exec()\fP multiple times with appropriate +arguments, you can mimic Perl's /g option, and it is in this kind of +implementation where \eG can be useful. +.P +Note, however, that PCRE's interpretation of \eG, as the start of the current +match, is subtly different from Perl's, which defines it as the end of the +previous match. In Perl, these can be different when the previously matched +string was empty. Because PCRE does just one match at a time, it cannot +reproduce this behaviour. +.P +If all the alternatives of a pattern begin with \eG, the expression is anchored +to the starting match position, and the "anchored" flag is set in the compiled +regular expression. +. +. +.SH "CIRCUMFLEX AND DOLLAR" +.rs +.sp +The circumflex and dollar metacharacters are zero-width assertions. That is, +they test for a particular condition being true without consuming any +characters from the subject string. +.P +Outside a character class, in the default matching mode, the circumflex +character is an assertion that is true only if the current matching point is at +the start of the subject string. If the \fIstartoffset\fP argument of +\fBpcre_exec()\fP is non-zero, circumflex can never match if the PCRE_MULTILINE +option is unset. Inside a character class, circumflex has an entirely different +meaning +.\" HTML +.\" +(see below). +.\" +.P +Circumflex need not be the first character of the pattern if a number of +alternatives are involved, but it should be the first thing in each alternative +in which it appears if the pattern is ever to match that branch. If all +possible alternatives start with a circumflex, that is, if the pattern is +constrained to match only at the start of the subject, it is said to be an +"anchored" pattern. (There are also other constructs that can cause a pattern +to be anchored.) +.P +The dollar character is an assertion that is true only if the current matching +point is at the end of the subject string, or immediately before a newline at +the end of the string (by default). Note, however, that it does not actually +match the newline. Dollar need not be the last character of the pattern if a +number of alternatives are involved, but it should be the last item in any +branch in which it appears. Dollar has no special meaning in a character class. +.P +The meaning of dollar can be changed so that it matches only at the very end of +the string, by setting the PCRE_DOLLAR_ENDONLY option at compile time. This +does not affect the \eZ assertion. +.P +The meanings of the circumflex and dollar characters are changed if the +PCRE_MULTILINE option is set. When this is the case, a circumflex matches +immediately after internal newlines as well as at the start of the subject +string. It does not match after a newline that ends the string. A dollar +matches before any newlines in the string, as well as at the very end, when +PCRE_MULTILINE is set. When newline is specified as the two-character +sequence CRLF, isolated CR and LF characters do not indicate newlines. +.P +For example, the pattern /^abc$/ matches the subject string "def\enabc" (where +\en represents a newline) in multiline mode, but not otherwise. Consequently, +patterns that are anchored in single line mode because all branches start with +^ are not anchored in multiline mode, and a match for circumflex is possible +when the \fIstartoffset\fP argument of \fBpcre_exec()\fP is non-zero. The +PCRE_DOLLAR_ENDONLY option is ignored if PCRE_MULTILINE is set. +.P +Note that the sequences \eA, \eZ, and \ez can be used to match the start and +end of the subject in both modes, and if all branches of a pattern start with +\eA it is always anchored, whether or not PCRE_MULTILINE is set. +. +. +.\" HTML +.SH "FULL STOP (PERIOD, DOT) AND \eN" +.rs +.sp +Outside a character class, a dot in the pattern matches any one character in +the subject string except (by default) a character that signifies the end of a +line. +.P +When a line ending is defined as a single character, dot never matches that +character; when the two-character sequence CRLF is used, dot does not match CR +if it is immediately followed by LF, but otherwise it matches all characters +(including isolated CRs and LFs). When any Unicode line endings are being +recognized, dot does not match CR or LF or any of the other line ending +characters. +.P +The behaviour of dot with regard to newlines can be changed. If the PCRE_DOTALL +option is set, a dot matches any one character, without exception. If the +two-character sequence CRLF is present in the subject string, it takes two dots +to match it. +.P +The handling of dot is entirely independent of the handling of circumflex and +dollar, the only relationship being that they both involve newlines. Dot has no +special meaning in a character class. +.P +The escape sequence \eN behaves like a dot, except that it is not affected by +the PCRE_DOTALL option. In other words, it matches any character except one +that signifies the end of a line. Perl also uses \eN to match characters by +name; PCRE does not support this. +. +. +.SH "MATCHING A SINGLE DATA UNIT" +.rs +.sp +Outside a character class, the escape sequence \eC matches any one data unit, +whether or not a UTF mode is set. In the 8-bit library, one data unit is one +byte; in the 16-bit library it is a 16-bit unit; in the 32-bit library it is +a 32-bit unit. Unlike a dot, \eC always +matches line-ending characters. The feature is provided in Perl in order to +match individual bytes in UTF-8 mode, but it is unclear how it can usefully be +used. Because \eC breaks up characters into individual data units, matching one +unit with \eC in a UTF mode means that the rest of the string may start with a +malformed UTF character. This has undefined results, because PCRE assumes that +it is dealing with valid UTF strings (and by default it checks this at the +start of processing unless the PCRE_NO_UTF8_CHECK, PCRE_NO_UTF16_CHECK or +PCRE_NO_UTF32_CHECK option is used). +.P +PCRE does not allow \eC to appear in lookbehind assertions +.\" HTML +.\" +(described below) +.\" +in a UTF mode, because this would make it impossible to calculate the length of +the lookbehind. +.P +In general, the \eC escape sequence is best avoided. However, one +way of using it that avoids the problem of malformed UTF characters is to use a +lookahead to check the length of the next character, as in this pattern, which +could be used with a UTF-8 string (ignore white space and line breaks): +.sp + (?| (?=[\ex00-\ex7f])(\eC) | + (?=[\ex80-\ex{7ff}])(\eC)(\eC) | + (?=[\ex{800}-\ex{ffff}])(\eC)(\eC)(\eC) | + (?=[\ex{10000}-\ex{1fffff}])(\eC)(\eC)(\eC)(\eC)) +.sp +A group that starts with (?| resets the capturing parentheses numbers in each +alternative (see +.\" HTML +.\" +"Duplicate Subpattern Numbers" +.\" +below). The assertions at the start of each branch check the next UTF-8 +character for values whose encoding uses 1, 2, 3, or 4 bytes, respectively. The +character's individual bytes are then captured by the appropriate number of +groups. +. +. +.\" HTML +.SH "SQUARE BRACKETS AND CHARACTER CLASSES" +.rs +.sp +An opening square bracket introduces a character class, terminated by a closing +square bracket. A closing square bracket on its own is not special by default. +However, if the PCRE_JAVASCRIPT_COMPAT option is set, a lone closing square +bracket causes a compile-time error. If a closing square bracket is required as +a member of the class, it should be the first data character in the class +(after an initial circumflex, if present) or escaped with a backslash. +.P +A character class matches a single character in the subject. In a UTF mode, the +character may be more than one data unit long. A matched character must be in +the set of characters defined by the class, unless the first character in the +class definition is a circumflex, in which case the subject character must not +be in the set defined by the class. If a circumflex is actually required as a +member of the class, ensure it is not the first character, or escape it with a +backslash. +.P +For example, the character class [aeiou] matches any lower case vowel, while +[^aeiou] matches any character that is not a lower case vowel. Note that a +circumflex is just a convenient notation for specifying the characters that +are in the class by enumerating those that are not. A class that starts with a +circumflex is not an assertion; it still consumes a character from the subject +string, and therefore it fails if the current pointer is at the end of the +string. +.P +In UTF-8 (UTF-16, UTF-32) mode, characters with values greater than 255 (0xffff) +can be included in a class as a literal string of data units, or by using the +\ex{ escaping mechanism. +.P +When caseless matching is set, any letters in a class represent both their +upper case and lower case versions, so for example, a caseless [aeiou] matches +"A" as well as "a", and a caseless [^aeiou] does not match "A", whereas a +caseful version would. In a UTF mode, PCRE always understands the concept of +case for characters whose values are less than 128, so caseless matching is +always possible. For characters with higher values, the concept of case is +supported if PCRE is compiled with Unicode property support, but not otherwise. +If you want to use caseless matching in a UTF mode for characters 128 and +above, you must ensure that PCRE is compiled with Unicode property support as +well as with UTF support. +.P +Characters that might indicate line breaks are never treated in any special way +when matching character classes, whatever line-ending sequence is in use, and +whatever setting of the PCRE_DOTALL and PCRE_MULTILINE options is used. A class +such as [^a] always matches one of these characters. +.P +The minus (hyphen) character can be used to specify a range of characters in a +character class. For example, [d-m] matches any letter between d and m, +inclusive. If a minus character is required in a class, it must be escaped with +a backslash or appear in a position where it cannot be interpreted as +indicating a range, typically as the first or last character in the class, or +immediately after a range. For example, [b-d-z] matches letters in the range b +to d, a hyphen character, or z. +.P +It is not possible to have the literal character "]" as the end character of a +range. A pattern such as [W-]46] is interpreted as a class of two characters +("W" and "-") followed by a literal string "46]", so it would match "W46]" or +"-46]". However, if the "]" is escaped with a backslash it is interpreted as +the end of range, so [W-\e]46] is interpreted as a class containing a range +followed by two other characters. The octal or hexadecimal representation of +"]" can also be used to end a range. +.P +An error is generated if a POSIX character class (see below) or an escape +sequence other than one that defines a single character appears at a point +where a range ending character is expected. For example, [z-\exff] is valid, +but [A-\ed] and [A-[:digit:]] are not. +.P +Ranges operate in the collating sequence of character values. They can also be +used for characters specified numerically, for example [\e000-\e037]. Ranges +can include any characters that are valid for the current mode. +.P +If a range that includes letters is used when caseless matching is set, it +matches the letters in either case. For example, [W-c] is equivalent to +[][\e\e^_`wxyzabc], matched caselessly, and in a non-UTF mode, if character +tables for a French locale are in use, [\exc8-\excb] matches accented E +characters in both cases. In UTF modes, PCRE supports the concept of case for +characters with values greater than 128 only when it is compiled with Unicode +property support. +.P +The character escape sequences \ed, \eD, \eh, \eH, \ep, \eP, \es, \eS, \ev, +\eV, \ew, and \eW may appear in a character class, and add the characters that +they match to the class. For example, [\edABCDEF] matches any hexadecimal +digit. In UTF modes, the PCRE_UCP option affects the meanings of \ed, \es, \ew +and their upper case partners, just as it does when they appear outside a +character class, as described in the section entitled +.\" HTML +.\" +"Generic character types" +.\" +above. The escape sequence \eb has a different meaning inside a character +class; it matches the backspace character. The sequences \eB, \eN, \eR, and \eX +are not special inside a character class. Like any other unrecognized escape +sequences, they are treated as the literal characters "B", "N", "R", and "X" by +default, but cause an error if the PCRE_EXTRA option is set. +.P +A circumflex can conveniently be used with the upper case character types to +specify a more restricted set of characters than the matching lower case type. +For example, the class [^\eW_] matches any letter or digit, but not underscore, +whereas [\ew] includes underscore. A positive character class should be read as +"something OR something OR ..." and a negative class as "NOT something AND NOT +something AND NOT ...". +.P +The only metacharacters that are recognized in character classes are backslash, +hyphen (only where it can be interpreted as specifying a range), circumflex +(only at the start), opening square bracket (only when it can be interpreted as +introducing a POSIX class name, or for a special compatibility feature - see +the next two sections), and the terminating closing square bracket. However, +escaping other non-alphanumeric characters does no harm. +. +. +.SH "POSIX CHARACTER CLASSES" +.rs +.sp +Perl supports the POSIX notation for character classes. This uses names +enclosed by [: and :] within the enclosing square brackets. PCRE also supports +this notation. For example, +.sp + [01[:alpha:]%] +.sp +matches "0", "1", any alphabetic character, or "%". The supported class names +are: +.sp + alnum letters and digits + alpha letters + ascii character codes 0 - 127 + blank space or tab only + cntrl control characters + digit decimal digits (same as \ed) + graph printing characters, excluding space + lower lower case letters + print printing characters, including space + punct printing characters, excluding letters and digits and space + space white space (the same as \es from PCRE 8.34) + upper upper case letters + word "word" characters (same as \ew) + xdigit hexadecimal digits +.sp +The default "space" characters are HT (9), LF (10), VT (11), FF (12), CR (13), +and space (32). If locale-specific matching is taking place, the list of space +characters may be different; there may be fewer or more of them. "Space" used +to be different to \es, which did not include VT, for Perl compatibility. +However, Perl changed at release 5.18, and PCRE followed at release 8.34. +"Space" and \es now match the same set of characters. +.P +The name "word" is a Perl extension, and "blank" is a GNU extension from Perl +5.8. Another Perl extension is negation, which is indicated by a ^ character +after the colon. For example, +.sp + [12[:^digit:]] +.sp +matches "1", "2", or any non-digit. PCRE (and Perl) also recognize the POSIX +syntax [.ch.] and [=ch=] where "ch" is a "collating element", but these are not +supported, and an error is given if they are encountered. +.P +By default, characters with values greater than 128 do not match any of the +POSIX character classes. However, if the PCRE_UCP option is passed to +\fBpcre_compile()\fP, some of the classes are changed so that Unicode character +properties are used. This is achieved by replacing certain POSIX classes by +other sequences, as follows: +.sp + [:alnum:] becomes \ep{Xan} + [:alpha:] becomes \ep{L} + [:blank:] becomes \eh + [:digit:] becomes \ep{Nd} + [:lower:] becomes \ep{Ll} + [:space:] becomes \ep{Xps} + [:upper:] becomes \ep{Lu} + [:word:] becomes \ep{Xwd} +.sp +Negated versions, such as [:^alpha:] use \eP instead of \ep. Three other POSIX +classes are handled specially in UCP mode: +.TP 10 +[:graph:] +This matches characters that have glyphs that mark the page when printed. In +Unicode property terms, it matches all characters with the L, M, N, P, S, or Cf +properties, except for: +.sp + U+061C Arabic Letter Mark + U+180E Mongolian Vowel Separator + U+2066 - U+2069 Various "isolate"s +.sp +.TP 10 +[:print:] +This matches the same characters as [:graph:] plus space characters that are +not controls, that is, characters with the Zs property. +.TP 10 +[:punct:] +This matches all characters that have the Unicode P (punctuation) property, +plus those characters whose code points are less than 128 that have the S +(Symbol) property. +.P +The other POSIX classes are unchanged, and match only characters with code +points less than 128. +. +. +.SH "COMPATIBILITY FEATURE FOR WORD BOUNDARIES" +.rs +.sp +In the POSIX.2 compliant library that was included in 4.4BSD Unix, the ugly +syntax [[:<:]] and [[:>:]] is used for matching "start of word" and "end of +word". PCRE treats these items as follows: +.sp + [[:<:]] is converted to \eb(?=\ew) + [[:>:]] is converted to \eb(?<=\ew) +.sp +Only these exact character sequences are recognized. A sequence such as +[a[:<:]b] provokes error for an unrecognized POSIX class name. This support is +not compatible with Perl. It is provided to help migrations from other +environments, and is best not used in any new patterns. Note that \eb matches +at the start and the end of a word (see +.\" HTML +.\" +"Simple assertions" +.\" +above), and in a Perl-style pattern the preceding or following character +normally shows which is wanted, without the need for the assertions that are +used above in order to give exactly the POSIX behaviour. +. +. +.SH "VERTICAL BAR" +.rs +.sp +Vertical bar characters are used to separate alternative patterns. For example, +the pattern +.sp + gilbert|sullivan +.sp +matches either "gilbert" or "sullivan". Any number of alternatives may appear, +and an empty alternative is permitted (matching the empty string). The matching +process tries each alternative in turn, from left to right, and the first one +that succeeds is used. If the alternatives are within a subpattern +.\" HTML +.\" +(defined below), +.\" +"succeeds" means matching the rest of the main pattern as well as the +alternative in the subpattern. +. +. +.SH "INTERNAL OPTION SETTING" +.rs +.sp +The settings of the PCRE_CASELESS, PCRE_MULTILINE, PCRE_DOTALL, and +PCRE_EXTENDED options (which are Perl-compatible) can be changed from within +the pattern by a sequence of Perl option letters enclosed between "(?" and ")". +The option letters are +.sp + i for PCRE_CASELESS + m for PCRE_MULTILINE + s for PCRE_DOTALL + x for PCRE_EXTENDED +.sp +For example, (?im) sets caseless, multiline matching. It is also possible to +unset these options by preceding the letter with a hyphen, and a combined +setting and unsetting such as (?im-sx), which sets PCRE_CASELESS and +PCRE_MULTILINE while unsetting PCRE_DOTALL and PCRE_EXTENDED, is also +permitted. If a letter appears both before and after the hyphen, the option is +unset. +.P +The PCRE-specific options PCRE_DUPNAMES, PCRE_UNGREEDY, and PCRE_EXTRA can be +changed in the same way as the Perl-compatible options by using the characters +J, U and X respectively. +.P +When one of these option changes occurs at top level (that is, not inside +subpattern parentheses), the change applies to the remainder of the pattern +that follows. An option change within a subpattern (see below for a description +of subpatterns) affects only that part of the subpattern that follows it, so +.sp + (a(?i)b)c +.sp +matches abc and aBc and no other strings (assuming PCRE_CASELESS is not used). +By this means, options can be made to have different settings in different +parts of the pattern. Any changes made in one alternative do carry on +into subsequent branches within the same subpattern. For example, +.sp + (a(?i)b|c) +.sp +matches "ab", "aB", "c", and "C", even though when matching "C" the first +branch is abandoned before the option setting. This is because the effects of +option settings happen at compile time. There would be some very weird +behaviour otherwise. +.P +\fBNote:\fP There are other PCRE-specific options that can be set by the +application when the compiling or matching functions are called. In some cases +the pattern can contain special leading sequences such as (*CRLF) to override +what the application has set or what has been defaulted. Details are given in +the section entitled +.\" HTML +.\" +"Newline sequences" +.\" +above. There are also the (*UTF8), (*UTF16),(*UTF32), and (*UCP) leading +sequences that can be used to set UTF and Unicode property modes; they are +equivalent to setting the PCRE_UTF8, PCRE_UTF16, PCRE_UTF32 and the PCRE_UCP +options, respectively. The (*UTF) sequence is a generic version that can be +used with any of the libraries. However, the application can set the +PCRE_NEVER_UTF option, which locks out the use of the (*UTF) sequences. +. +. +.\" HTML +.SH SUBPATTERNS +.rs +.sp +Subpatterns are delimited by parentheses (round brackets), which can be nested. +Turning part of a pattern into a subpattern does two things: +.sp +1. It localizes a set of alternatives. For example, the pattern +.sp + cat(aract|erpillar|) +.sp +matches "cataract", "caterpillar", or "cat". Without the parentheses, it would +match "cataract", "erpillar" or an empty string. +.sp +2. It sets up the subpattern as a capturing subpattern. This means that, when +the whole pattern matches, that portion of the subject string that matched the +subpattern is passed back to the caller via the \fIovector\fP argument of the +matching function. (This applies only to the traditional matching functions; +the DFA matching functions do not support capturing.) +.P +Opening parentheses are counted from left to right (starting from 1) to obtain +numbers for the capturing subpatterns. For example, if the string "the red +king" is matched against the pattern +.sp + the ((red|white) (king|queen)) +.sp +the captured substrings are "red king", "red", and "king", and are numbered 1, +2, and 3, respectively. +.P +The fact that plain parentheses fulfil two functions is not always helpful. +There are often times when a grouping subpattern is required without a +capturing requirement. If an opening parenthesis is followed by a question mark +and a colon, the subpattern does not do any capturing, and is not counted when +computing the number of any subsequent capturing subpatterns. For example, if +the string "the white queen" is matched against the pattern +.sp + the ((?:red|white) (king|queen)) +.sp +the captured substrings are "white queen" and "queen", and are numbered 1 and +2. The maximum number of capturing subpatterns is 65535. +.P +As a convenient shorthand, if any option settings are required at the start of +a non-capturing subpattern, the option letters may appear between the "?" and +the ":". Thus the two patterns +.sp + (?i:saturday|sunday) + (?:(?i)saturday|sunday) +.sp +match exactly the same set of strings. Because alternative branches are tried +from left to right, and options are not reset until the end of the subpattern +is reached, an option setting in one branch does affect subsequent branches, so +the above patterns match "SUNDAY" as well as "Saturday". +. +. +.\" HTML +.SH "DUPLICATE SUBPATTERN NUMBERS" +.rs +.sp +Perl 5.10 introduced a feature whereby each alternative in a subpattern uses +the same numbers for its capturing parentheses. Such a subpattern starts with +(?| and is itself a non-capturing subpattern. For example, consider this +pattern: +.sp + (?|(Sat)ur|(Sun))day +.sp +Because the two alternatives are inside a (?| group, both sets of capturing +parentheses are numbered one. Thus, when the pattern matches, you can look +at captured substring number one, whichever alternative matched. This construct +is useful when you want to capture part, but not all, of one of a number of +alternatives. Inside a (?| group, parentheses are numbered as usual, but the +number is reset at the start of each branch. The numbers of any capturing +parentheses that follow the subpattern start after the highest number used in +any branch. The following example is taken from the Perl documentation. The +numbers underneath show in which buffer the captured content will be stored. +.sp + # before ---------------branch-reset----------- after + / ( a ) (?| x ( y ) z | (p (q) r) | (t) u (v) ) ( z ) /x + # 1 2 2 3 2 3 4 +.sp +A back reference to a numbered subpattern uses the most recent value that is +set for that number by any subpattern. The following pattern matches "abcabc" +or "defdef": +.sp + /(?|(abc)|(def))\e1/ +.sp +In contrast, a subroutine call to a numbered subpattern always refers to the +first one in the pattern with the given number. The following pattern matches +"abcabc" or "defabc": +.sp + /(?|(abc)|(def))(?1)/ +.sp +If a +.\" HTML +.\" +condition test +.\" +for a subpattern's having matched refers to a non-unique number, the test is +true if any of the subpatterns of that number have matched. +.P +An alternative approach to using this "branch reset" feature is to use +duplicate named subpatterns, as described in the next section. +. +. +.SH "NAMED SUBPATTERNS" +.rs +.sp +Identifying capturing parentheses by number is simple, but it can be very hard +to keep track of the numbers in complicated regular expressions. Furthermore, +if an expression is modified, the numbers may change. To help with this +difficulty, PCRE supports the naming of subpatterns. This feature was not +added to Perl until release 5.10. Python had the feature earlier, and PCRE +introduced it at release 4.0, using the Python syntax. PCRE now supports both +the Perl and the Python syntax. Perl allows identically numbered subpatterns to +have different names, but PCRE does not. +.P +In PCRE, a subpattern can be named in one of three ways: (?...) or +(?'name'...) as in Perl, or (?P...) as in Python. References to capturing +parentheses from other parts of the pattern, such as +.\" HTML +.\" +back references, +.\" +.\" HTML +.\" +recursion, +.\" +and +.\" HTML +.\" +conditions, +.\" +can be made by name as well as by number. +.P +Names consist of up to 32 alphanumeric characters and underscores, but must +start with a non-digit. Named capturing parentheses are still allocated numbers +as well as names, exactly as if the names were not present. The PCRE API +provides function calls for extracting the name-to-number translation table +from a compiled pattern. There is also a convenience function for extracting a +captured substring by name. +.P +By default, a name must be unique within a pattern, but it is possible to relax +this constraint by setting the PCRE_DUPNAMES option at compile time. (Duplicate +names are also always permitted for subpatterns with the same number, set up as +described in the previous section.) Duplicate names can be useful for patterns +where only one instance of the named parentheses can match. Suppose you want to +match the name of a weekday, either as a 3-letter abbreviation or as the full +name, and in both cases you want to extract the abbreviation. This pattern +(ignoring the line breaks) does the job: +.sp + (?Mon|Fri|Sun)(?:day)?| + (?Tue)(?:sday)?| + (?Wed)(?:nesday)?| + (?Thu)(?:rsday)?| + (?Sat)(?:urday)? +.sp +There are five capturing substrings, but only one is ever set after a match. +(An alternative way of solving this problem is to use a "branch reset" +subpattern, as described in the previous section.) +.P +The convenience function for extracting the data by name returns the substring +for the first (and in this example, the only) subpattern of that name that +matched. This saves searching to find which numbered subpattern it was. +.P +If you make a back reference to a non-unique named subpattern from elsewhere in +the pattern, the subpatterns to which the name refers are checked in the order +in which they appear in the overall pattern. The first one that is set is used +for the reference. For example, this pattern matches both "foofoo" and +"barbar" but not "foobar" or "barfoo": +.sp + (?:(?foo)|(?bar))\ek +.sp +.P +If you make a subroutine call to a non-unique named subpattern, the one that +corresponds to the first occurrence of the name is used. In the absence of +duplicate numbers (see the previous section) this is the one with the lowest +number. +.P +If you use a named reference in a condition +test (see the +.\" +.\" HTML +.\" +section about conditions +.\" +below), either to check whether a subpattern has matched, or to check for +recursion, all subpatterns with the same name are tested. If the condition is +true for any one of them, the overall condition is true. This is the same +behaviour as testing by number. For further details of the interfaces for +handling named subpatterns, see the +.\" HREF +\fBpcreapi\fP +.\" +documentation. +.P +\fBWarning:\fP You cannot use different names to distinguish between two +subpatterns with the same number because PCRE uses only the numbers when +matching. For this reason, an error is given at compile time if different names +are given to subpatterns with the same number. However, you can always give the +same name to subpatterns with the same number, even when PCRE_DUPNAMES is not +set. +. +. +.SH REPETITION +.rs +.sp +Repetition is specified by quantifiers, which can follow any of the following +items: +.sp + a literal data character + the dot metacharacter + the \eC escape sequence + the \eX escape sequence + the \eR escape sequence + an escape such as \ed or \epL that matches a single character + a character class + a back reference (see next section) + a parenthesized subpattern (including assertions) + a subroutine call to a subpattern (recursive or otherwise) +.sp +The general repetition quantifier specifies a minimum and maximum number of +permitted matches, by giving the two numbers in curly brackets (braces), +separated by a comma. The numbers must be less than 65536, and the first must +be less than or equal to the second. For example: +.sp + z{2,4} +.sp +matches "zz", "zzz", or "zzzz". A closing brace on its own is not a special +character. If the second number is omitted, but the comma is present, there is +no upper limit; if the second number and the comma are both omitted, the +quantifier specifies an exact number of required matches. Thus +.sp + [aeiou]{3,} +.sp +matches at least 3 successive vowels, but may match many more, while +.sp + \ed{8} +.sp +matches exactly 8 digits. An opening curly bracket that appears in a position +where a quantifier is not allowed, or one that does not match the syntax of a +quantifier, is taken as a literal character. For example, {,6} is not a +quantifier, but a literal string of four characters. +.P +In UTF modes, quantifiers apply to characters rather than to individual data +units. Thus, for example, \ex{100}{2} matches two characters, each of +which is represented by a two-byte sequence in a UTF-8 string. Similarly, +\eX{3} matches three Unicode extended grapheme clusters, each of which may be +several data units long (and they may be of different lengths). +.P +The quantifier {0} is permitted, causing the expression to behave as if the +previous item and the quantifier were not present. This may be useful for +subpatterns that are referenced as +.\" HTML +.\" +subroutines +.\" +from elsewhere in the pattern (but see also the section entitled +.\" HTML +.\" +"Defining subpatterns for use by reference only" +.\" +below). Items other than subpatterns that have a {0} quantifier are omitted +from the compiled pattern. +.P +For convenience, the three most common quantifiers have single-character +abbreviations: +.sp + * is equivalent to {0,} + + is equivalent to {1,} + ? is equivalent to {0,1} +.sp +It is possible to construct infinite loops by following a subpattern that can +match no characters with a quantifier that has no upper limit, for example: +.sp + (a?)* +.sp +Earlier versions of Perl and PCRE used to give an error at compile time for +such patterns. However, because there are cases where this can be useful, such +patterns are now accepted, but if any repetition of the subpattern does in fact +match no characters, the loop is forcibly broken. +.P +By default, the quantifiers are "greedy", that is, they match as much as +possible (up to the maximum number of permitted times), without causing the +rest of the pattern to fail. The classic example of where this gives problems +is in trying to match comments in C programs. These appear between /* and */ +and within the comment, individual * and / characters may appear. An attempt to +match C comments by applying the pattern +.sp + /\e*.*\e*/ +.sp +to the string +.sp + /* first comment */ not comment /* second comment */ +.sp +fails, because it matches the entire string owing to the greediness of the .* +item. +.P +However, if a quantifier is followed by a question mark, it ceases to be +greedy, and instead matches the minimum number of times possible, so the +pattern +.sp + /\e*.*?\e*/ +.sp +does the right thing with the C comments. The meaning of the various +quantifiers is not otherwise changed, just the preferred number of matches. +Do not confuse this use of question mark with its use as a quantifier in its +own right. Because it has two uses, it can sometimes appear doubled, as in +.sp + \ed??\ed +.sp +which matches one digit by preference, but can match two if that is the only +way the rest of the pattern matches. +.P +If the PCRE_UNGREEDY option is set (an option that is not available in Perl), +the quantifiers are not greedy by default, but individual ones can be made +greedy by following them with a question mark. In other words, it inverts the +default behaviour. +.P +When a parenthesized subpattern is quantified with a minimum repeat count that +is greater than 1 or with a limited maximum, more memory is required for the +compiled pattern, in proportion to the size of the minimum or maximum. +.P +If a pattern starts with .* or .{0,} and the PCRE_DOTALL option (equivalent +to Perl's /s) is set, thus allowing the dot to match newlines, the pattern is +implicitly anchored, because whatever follows will be tried against every +character position in the subject string, so there is no point in retrying the +overall match at any position after the first. PCRE normally treats such a +pattern as though it were preceded by \eA. +.P +In cases where it is known that the subject string contains no newlines, it is +worth setting PCRE_DOTALL in order to obtain this optimization, or +alternatively using ^ to indicate anchoring explicitly. +.P +However, there are some cases where the optimization cannot be used. When .* +is inside capturing parentheses that are the subject of a back reference +elsewhere in the pattern, a match at the start may fail where a later one +succeeds. Consider, for example: +.sp + (.*)abc\e1 +.sp +If the subject is "xyz123abc123" the match point is the fourth character. For +this reason, such a pattern is not implicitly anchored. +.P +Another case where implicit anchoring is not applied is when the leading .* is +inside an atomic group. Once again, a match at the start may fail where a later +one succeeds. Consider this pattern: +.sp + (?>.*?a)b +.sp +It matches "ab" in the subject "aab". The use of the backtracking control verbs +(*PRUNE) and (*SKIP) also disable this optimization. +.P +When a capturing subpattern is repeated, the value captured is the substring +that matched the final iteration. For example, after +.sp + (tweedle[dume]{3}\es*)+ +.sp +has matched "tweedledum tweedledee" the value of the captured substring is +"tweedledee". However, if there are nested capturing subpatterns, the +corresponding captured values may have been set in previous iterations. For +example, after +.sp + /(a|(b))+/ +.sp +matches "aba" the value of the second captured substring is "b". +. +. +.\" HTML +.SH "ATOMIC GROUPING AND POSSESSIVE QUANTIFIERS" +.rs +.sp +With both maximizing ("greedy") and minimizing ("ungreedy" or "lazy") +repetition, failure of what follows normally causes the repeated item to be +re-evaluated to see if a different number of repeats allows the rest of the +pattern to match. Sometimes it is useful to prevent this, either to change the +nature of the match, or to cause it fail earlier than it otherwise might, when +the author of the pattern knows there is no point in carrying on. +.P +Consider, for example, the pattern \ed+foo when applied to the subject line +.sp + 123456bar +.sp +After matching all 6 digits and then failing to match "foo", the normal +action of the matcher is to try again with only 5 digits matching the \ed+ +item, and then with 4, and so on, before ultimately failing. "Atomic grouping" +(a term taken from Jeffrey Friedl's book) provides the means for specifying +that once a subpattern has matched, it is not to be re-evaluated in this way. +.P +If we use atomic grouping for the previous example, the matcher gives up +immediately on failing to match "foo" the first time. The notation is a kind of +special parenthesis, starting with (?> as in this example: +.sp + (?>\ed+)foo +.sp +This kind of parenthesis "locks up" the part of the pattern it contains once +it has matched, and a failure further into the pattern is prevented from +backtracking into it. Backtracking past it to previous items, however, works as +normal. +.P +An alternative description is that a subpattern of this type matches the string +of characters that an identical standalone pattern would match, if anchored at +the current point in the subject string. +.P +Atomic grouping subpatterns are not capturing subpatterns. Simple cases such as +the above example can be thought of as a maximizing repeat that must swallow +everything it can. So, while both \ed+ and \ed+? are prepared to adjust the +number of digits they match in order to make the rest of the pattern match, +(?>\ed+) can only match an entire sequence of digits. +.P +Atomic groups in general can of course contain arbitrarily complicated +subpatterns, and can be nested. However, when the subpattern for an atomic +group is just a single repeated item, as in the example above, a simpler +notation, called a "possessive quantifier" can be used. This consists of an +additional + character following a quantifier. Using this notation, the +previous example can be rewritten as +.sp + \ed++foo +.sp +Note that a possessive quantifier can be used with an entire group, for +example: +.sp + (abc|xyz){2,3}+ +.sp +Possessive quantifiers are always greedy; the setting of the PCRE_UNGREEDY +option is ignored. They are a convenient notation for the simpler forms of +atomic group. However, there is no difference in the meaning of a possessive +quantifier and the equivalent atomic group, though there may be a performance +difference; possessive quantifiers should be slightly faster. +.P +The possessive quantifier syntax is an extension to the Perl 5.8 syntax. +Jeffrey Friedl originated the idea (and the name) in the first edition of his +book. Mike McCloskey liked it, so implemented it when he built Sun's Java +package, and PCRE copied it from there. It ultimately found its way into Perl +at release 5.10. +.P +PCRE has an optimization that automatically "possessifies" certain simple +pattern constructs. For example, the sequence A+B is treated as A++B because +there is no point in backtracking into a sequence of A's when B must follow. +.P +When a pattern contains an unlimited repeat inside a subpattern that can itself +be repeated an unlimited number of times, the use of an atomic group is the +only way to avoid some failing matches taking a very long time indeed. The +pattern +.sp + (\eD+|<\ed+>)*[!?] +.sp +matches an unlimited number of substrings that either consist of non-digits, or +digits enclosed in <>, followed by either ! or ?. When it matches, it runs +quickly. However, if it is applied to +.sp + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +.sp +it takes a long time before reporting failure. This is because the string can +be divided between the internal \eD+ repeat and the external * repeat in a +large number of ways, and all have to be tried. (The example uses [!?] rather +than a single character at the end, because both PCRE and Perl have an +optimization that allows for fast failure when a single character is used. They +remember the last single character that is required for a match, and fail early +if it is not present in the string.) If the pattern is changed so that it uses +an atomic group, like this: +.sp + ((?>\eD+)|<\ed+>)*[!?] +.sp +sequences of non-digits cannot be broken, and failure happens quickly. +. +. +.\" HTML +.SH "BACK REFERENCES" +.rs +.sp +Outside a character class, a backslash followed by a digit greater than 0 (and +possibly further digits) is a back reference to a capturing subpattern earlier +(that is, to its left) in the pattern, provided there have been that many +previous capturing left parentheses. +.P +However, if the decimal number following the backslash is less than 10, it is +always taken as a back reference, and causes an error only if there are not +that many capturing left parentheses in the entire pattern. In other words, the +parentheses that are referenced need not be to the left of the reference for +numbers less than 10. A "forward back reference" of this type can make sense +when a repetition is involved and the subpattern to the right has participated +in an earlier iteration. +.P +It is not possible to have a numerical "forward back reference" to a subpattern +whose number is 10 or more using this syntax because a sequence such as \e50 is +interpreted as a character defined in octal. See the subsection entitled +"Non-printing characters" +.\" HTML +.\" +above +.\" +for further details of the handling of digits following a backslash. There is +no such problem when named parentheses are used. A back reference to any +subpattern is possible using named parentheses (see below). +.P +Another way of avoiding the ambiguity inherent in the use of digits following a +backslash is to use the \eg escape sequence. This escape must be followed by an +unsigned number or a negative number, optionally enclosed in braces. These +examples are all identical: +.sp + (ring), \e1 + (ring), \eg1 + (ring), \eg{1} +.sp +An unsigned number specifies an absolute reference without the ambiguity that +is present in the older syntax. It is also useful when literal digits follow +the reference. A negative number is a relative reference. Consider this +example: +.sp + (abc(def)ghi)\eg{-1} +.sp +The sequence \eg{-1} is a reference to the most recently started capturing +subpattern before \eg, that is, is it equivalent to \e2 in this example. +Similarly, \eg{-2} would be equivalent to \e1. The use of relative references +can be helpful in long patterns, and also in patterns that are created by +joining together fragments that contain references within themselves. +.P +A back reference matches whatever actually matched the capturing subpattern in +the current subject string, rather than anything matching the subpattern +itself (see +.\" HTML +.\" +"Subpatterns as subroutines" +.\" +below for a way of doing that). So the pattern +.sp + (sens|respons)e and \e1ibility +.sp +matches "sense and sensibility" and "response and responsibility", but not +"sense and responsibility". If caseful matching is in force at the time of the +back reference, the case of letters is relevant. For example, +.sp + ((?i)rah)\es+\e1 +.sp +matches "rah rah" and "RAH RAH", but not "RAH rah", even though the original +capturing subpattern is matched caselessly. +.P +There are several different ways of writing back references to named +subpatterns. The .NET syntax \ek{name} and the Perl syntax \ek or +\ek'name' are supported, as is the Python syntax (?P=name). Perl 5.10's unified +back reference syntax, in which \eg can be used for both numeric and named +references, is also supported. We could rewrite the above example in any of +the following ways: +.sp + (?(?i)rah)\es+\ek + (?'p1'(?i)rah)\es+\ek{p1} + (?P(?i)rah)\es+(?P=p1) + (?(?i)rah)\es+\eg{p1} +.sp +A subpattern that is referenced by name may appear in the pattern before or +after the reference. +.P +There may be more than one back reference to the same subpattern. If a +subpattern has not actually been used in a particular match, any back +references to it always fail by default. For example, the pattern +.sp + (a|(bc))\e2 +.sp +always fails if it starts to match "a" rather than "bc". However, if the +PCRE_JAVASCRIPT_COMPAT option is set at compile time, a back reference to an +unset value matches an empty string. +.P +Because there may be many capturing parentheses in a pattern, all digits +following a backslash are taken as part of a potential back reference number. +If the pattern continues with a digit character, some delimiter must be used to +terminate the back reference. If the PCRE_EXTENDED option is set, this can be +white space. Otherwise, the \eg{ syntax or an empty comment (see +.\" HTML +.\" +"Comments" +.\" +below) can be used. +. +.SS "Recursive back references" +.rs +.sp +A back reference that occurs inside the parentheses to which it refers fails +when the subpattern is first used, so, for example, (a\e1) never matches. +However, such references can be useful inside repeated subpatterns. For +example, the pattern +.sp + (a|b\e1)+ +.sp +matches any number of "a"s and also "aba", "ababbaa" etc. At each iteration of +the subpattern, the back reference matches the character string corresponding +to the previous iteration. In order for this to work, the pattern must be such +that the first iteration does not need to match the back reference. This can be +done using alternation, as in the example above, or by a quantifier with a +minimum of zero. +.P +Back references of this type cause the group that they reference to be treated +as an +.\" HTML +.\" +atomic group. +.\" +Once the whole group has been matched, a subsequent matching failure cannot +cause backtracking into the middle of the group. +. +. +.\" HTML +.SH ASSERTIONS +.rs +.sp +An assertion is a test on the characters following or preceding the current +matching point that does not actually consume any characters. The simple +assertions coded as \eb, \eB, \eA, \eG, \eZ, \ez, ^ and $ are described +.\" HTML +.\" +above. +.\" +.P +More complicated assertions are coded as subpatterns. There are two kinds: +those that look ahead of the current position in the subject string, and those +that look behind it. An assertion subpattern is matched in the normal way, +except that it does not cause the current matching position to be changed. +.P +Assertion subpatterns are not capturing subpatterns. If such an assertion +contains capturing subpatterns within it, these are counted for the purposes of +numbering the capturing subpatterns in the whole pattern. However, substring +capturing is carried out only for positive assertions. (Perl sometimes, but not +always, does do capturing in negative assertions.) +.P +WARNING: If a positive assertion containing one or more capturing subpatterns +succeeds, but failure to match later in the pattern causes backtracking over +this assertion, the captures within the assertion are reset only if no higher +numbered captures are already set. This is, unfortunately, a fundamental +limitation of the current implementation, and as PCRE1 is now in +maintenance-only status, it is unlikely ever to change. +.P +For compatibility with Perl, assertion subpatterns may be repeated; though +it makes no sense to assert the same thing several times, the side effect of +capturing parentheses may occasionally be useful. In practice, there only three +cases: +.sp +(1) If the quantifier is {0}, the assertion is never obeyed during matching. +However, it may contain internal capturing parenthesized groups that are called +from elsewhere via the +.\" HTML +.\" +subroutine mechanism. +.\" +.sp +(2) If quantifier is {0,n} where n is greater than zero, it is treated as if it +were {0,1}. At run time, the rest of the pattern match is tried with and +without the assertion, the order depending on the greediness of the quantifier. +.sp +(3) If the minimum repetition is greater than zero, the quantifier is ignored. +The assertion is obeyed just once when encountered during matching. +. +. +.SS "Lookahead assertions" +.rs +.sp +Lookahead assertions start with (?= for positive assertions and (?! for +negative assertions. For example, +.sp + \ew+(?=;) +.sp +matches a word followed by a semicolon, but does not include the semicolon in +the match, and +.sp + foo(?!bar) +.sp +matches any occurrence of "foo" that is not followed by "bar". Note that the +apparently similar pattern +.sp + (?!foo)bar +.sp +does not find an occurrence of "bar" that is preceded by something other than +"foo"; it finds any occurrence of "bar" whatsoever, because the assertion +(?!foo) is always true when the next three characters are "bar". A +lookbehind assertion is needed to achieve the other effect. +.P +If you want to force a matching failure at some point in a pattern, the most +convenient way to do it is with (?!) because an empty string always matches, so +an assertion that requires there not to be an empty string must always fail. +The backtracking control verb (*FAIL) or (*F) is a synonym for (?!). +. +. +.\" HTML +.SS "Lookbehind assertions" +.rs +.sp +Lookbehind assertions start with (?<= for positive assertions and (? +.\" +(see above) +.\" +can be used instead of a lookbehind assertion to get round the fixed-length +restriction. +.P +The implementation of lookbehind assertions is, for each alternative, to +temporarily move the current position back by the fixed length and then try to +match. If there are insufficient characters before the current position, the +assertion fails. +.P +In a UTF mode, PCRE does not allow the \eC escape (which matches a single data +unit even in a UTF mode) to appear in lookbehind assertions, because it makes +it impossible to calculate the length of the lookbehind. The \eX and \eR +escapes, which can match different numbers of data units, are also not +permitted. +.P +.\" HTML +.\" +"Subroutine" +.\" +calls (see below) such as (?2) or (?&X) are permitted in lookbehinds, as long +as the subpattern matches a fixed-length string. +.\" HTML +.\" +Recursion, +.\" +however, is not supported. +.P +Possessive quantifiers can be used in conjunction with lookbehind assertions to +specify efficient matching of fixed-length strings at the end of subject +strings. Consider a simple pattern such as +.sp + abcd$ +.sp +when applied to a long string that does not match. Because matching proceeds +from left to right, PCRE will look for each "a" in the subject and then see if +what follows matches the rest of the pattern. If the pattern is specified as +.sp + ^.*abcd$ +.sp +the initial .* matches the entire string at first, but when this fails (because +there is no following "a"), it backtracks to match all but the last character, +then all but the last two characters, and so on. Once again the search for "a" +covers the entire string, from right to left, so we are no better off. However, +if the pattern is written as +.sp + ^.*+(?<=abcd) +.sp +there can be no backtracking for the .*+ item; it can match only the entire +string. The subsequent lookbehind assertion does a single test on the last four +characters. If it fails, the match fails immediately. For long strings, this +approach makes a significant difference to the processing time. +. +. +.SS "Using multiple assertions" +.rs +.sp +Several assertions (of any sort) may occur in succession. For example, +.sp + (?<=\ed{3})(? +.SH "CONDITIONAL SUBPATTERNS" +.rs +.sp +It is possible to cause the matching process to obey a subpattern +conditionally or to choose between two alternative subpatterns, depending on +the result of an assertion, or whether a specific capturing subpattern has +already been matched. The two possible forms of conditional subpattern are: +.sp + (?(condition)yes-pattern) + (?(condition)yes-pattern|no-pattern) +.sp +If the condition is satisfied, the yes-pattern is used; otherwise the +no-pattern (if present) is used. If there are more than two alternatives in the +subpattern, a compile-time error occurs. Each of the two alternatives may +itself contain nested subpatterns of any form, including conditional +subpatterns; the restriction to two alternatives applies only at the level of +the condition. This pattern fragment is an example where the alternatives are +complex: +.sp + (?(1) (A|B|C) | (D | (?(2)E|F) | E) ) +.sp +.P +There are four kinds of condition: references to subpatterns, references to +recursion, a pseudo-condition called DEFINE, and assertions. +. +.SS "Checking for a used subpattern by number" +.rs +.sp +If the text between the parentheses consists of a sequence of digits, the +condition is true if a capturing subpattern of that number has previously +matched. If there is more than one capturing subpattern with the same number +(see the earlier +.\" +.\" HTML +.\" +section about duplicate subpattern numbers), +.\" +the condition is true if any of them have matched. An alternative notation is +to precede the digits with a plus or minus sign. In this case, the subpattern +number is relative rather than absolute. The most recently opened parentheses +can be referenced by (?(-1), the next most recent by (?(-2), and so on. Inside +loops it can also make sense to refer to subsequent groups. The next +parentheses to be opened can be referenced as (?(+1), and so on. (The value +zero in any of these forms is not used; it provokes a compile-time error.) +.P +Consider the following pattern, which contains non-significant white space to +make it more readable (assume the PCRE_EXTENDED option) and to divide it into +three parts for ease of discussion: +.sp + ( \e( )? [^()]+ (?(1) \e) ) +.sp +The first part matches an optional opening parenthesis, and if that +character is present, sets it as the first captured substring. The second part +matches one or more characters that are not parentheses. The third part is a +conditional subpattern that tests whether or not the first set of parentheses +matched. If they did, that is, if subject started with an opening parenthesis, +the condition is true, and so the yes-pattern is executed and a closing +parenthesis is required. Otherwise, since no-pattern is not present, the +subpattern matches nothing. In other words, this pattern matches a sequence of +non-parentheses, optionally enclosed in parentheses. +.P +If you were embedding this pattern in a larger one, you could use a relative +reference: +.sp + ...other stuff... ( \e( )? [^()]+ (?(-1) \e) ) ... +.sp +This makes the fragment independent of the parentheses in the larger pattern. +. +.SS "Checking for a used subpattern by name" +.rs +.sp +Perl uses the syntax (?()...) or (?('name')...) to test for a used +subpattern by name. For compatibility with earlier versions of PCRE, which had +this facility before Perl, the syntax (?(name)...) is also recognized. +.P +Rewriting the above example to use a named subpattern gives this: +.sp + (? \e( )? [^()]+ (?() \e) ) +.sp +If the name used in a condition of this kind is a duplicate, the test is +applied to all subpatterns of the same name, and is true if any one of them has +matched. +. +.SS "Checking for pattern recursion" +.rs +.sp +If the condition is the string (R), and there is no subpattern with the name R, +the condition is true if a recursive call to the whole pattern or any +subpattern has been made. If digits or a name preceded by ampersand follow the +letter R, for example: +.sp + (?(R3)...) or (?(R&name)...) +.sp +the condition is true if the most recent recursion is into a subpattern whose +number or name is given. This condition does not check the entire recursion +stack. If the name used in a condition of this kind is a duplicate, the test is +applied to all subpatterns of the same name, and is true if any one of them is +the most recent recursion. +.P +At "top level", all these recursion test conditions are false. +.\" HTML +.\" +The syntax for recursive patterns +.\" +is described below. +. +.\" HTML +.SS "Defining subpatterns for use by reference only" +.rs +.sp +If the condition is the string (DEFINE), and there is no subpattern with the +name DEFINE, the condition is always false. In this case, there may be only one +alternative in the subpattern. It is always skipped if control reaches this +point in the pattern; the idea of DEFINE is that it can be used to define +subroutines that can be referenced from elsewhere. (The use of +.\" HTML +.\" +subroutines +.\" +is described below.) For example, a pattern to match an IPv4 address such as +"192.168.23.245" could be written like this (ignore white space and line +breaks): +.sp + (?(DEFINE) (? 2[0-4]\ed | 25[0-5] | 1\ed\ed | [1-9]?\ed) ) + \eb (?&byte) (\e.(?&byte)){3} \eb +.sp +The first part of the pattern is a DEFINE group inside which a another group +named "byte" is defined. This matches an individual component of an IPv4 +address (a number less than 256). When matching takes place, this part of the +pattern is skipped because DEFINE acts like a false condition. The rest of the +pattern uses references to the named group to match the four dot-separated +components of an IPv4 address, insisting on a word boundary at each end. +. +.SS "Assertion conditions" +.rs +.sp +If the condition is not in any of the above formats, it must be an assertion. +This may be a positive or negative lookahead or lookbehind assertion. Consider +this pattern, again containing non-significant white space, and with the two +alternatives on the second line: +.sp + (?(?=[^a-z]*[a-z]) + \ed{2}-[a-z]{3}-\ed{2} | \ed{2}-\ed{2}-\ed{2} ) +.sp +The condition is a positive lookahead assertion that matches an optional +sequence of non-letters followed by a letter. In other words, it tests for the +presence of at least one letter in the subject. If a letter is found, the +subject is matched against the first alternative; otherwise it is matched +against the second. This pattern matches strings in one of the two forms +dd-aaa-dd or dd-dd-dd, where aaa are letters and dd are digits. +. +. +.\" HTML +.SH COMMENTS +.rs +.sp +There are two ways of including comments in patterns that are processed by +PCRE. In both cases, the start of the comment must not be in a character class, +nor in the middle of any other sequence of related characters such as (?: or a +subpattern name or number. The characters that make up a comment play no part +in the pattern matching. +.P +The sequence (?# marks the start of a comment that continues up to the next +closing parenthesis. Nested parentheses are not permitted. If the PCRE_EXTENDED +option is set, an unescaped # character also introduces a comment, which in +this case continues to immediately after the next newline character or +character sequence in the pattern. Which characters are interpreted as newlines +is controlled by the options passed to a compiling function or by a special +sequence at the start of the pattern, as described in the section entitled +.\" HTML +.\" +"Newline conventions" +.\" +above. Note that the end of this type of comment is a literal newline sequence +in the pattern; escape sequences that happen to represent a newline do not +count. For example, consider this pattern when PCRE_EXTENDED is set, and the +default newline convention is in force: +.sp + abc #comment \en still comment +.sp +On encountering the # character, \fBpcre_compile()\fP skips along, looking for +a newline in the pattern. The sequence \en is still literal at this stage, so +it does not terminate the comment. Only an actual character with the code value +0x0a (the default newline) does so. +. +. +.\" HTML +.SH "RECURSIVE PATTERNS" +.rs +.sp +Consider the problem of matching a string in parentheses, allowing for +unlimited nested parentheses. Without the use of recursion, the best that can +be done is to use a pattern that matches up to some fixed depth of nesting. It +is not possible to handle an arbitrary nesting depth. +.P +For some time, Perl has provided a facility that allows regular expressions to +recurse (amongst other things). It does this by interpolating Perl code in the +expression at run time, and the code can refer to the expression itself. A Perl +pattern using code interpolation to solve the parentheses problem can be +created like this: +.sp + $re = qr{\e( (?: (?>[^()]+) | (?p{$re}) )* \e)}x; +.sp +The (?p{...}) item interpolates Perl code at run time, and in this case refers +recursively to the pattern in which it appears. +.P +Obviously, PCRE cannot support the interpolation of Perl code. Instead, it +supports special syntax for recursion of the entire pattern, and also for +individual subpattern recursion. After its introduction in PCRE and Python, +this kind of recursion was subsequently introduced into Perl at release 5.10. +.P +A special item that consists of (? followed by a number greater than zero and a +closing parenthesis is a recursive subroutine call of the subpattern of the +given number, provided that it occurs inside that subpattern. (If not, it is a +.\" HTML +.\" +non-recursive subroutine +.\" +call, which is described in the next section.) The special item (?R) or (?0) is +a recursive call of the entire regular expression. +.P +This PCRE pattern solves the nested parentheses problem (assume the +PCRE_EXTENDED option is set so that white space is ignored): +.sp + \e( ( [^()]++ | (?R) )* \e) +.sp +First it matches an opening parenthesis. Then it matches any number of +substrings which can either be a sequence of non-parentheses, or a recursive +match of the pattern itself (that is, a correctly parenthesized substring). +Finally there is a closing parenthesis. Note the use of a possessive quantifier +to avoid backtracking into sequences of non-parentheses. +.P +If this were part of a larger pattern, you would not want to recurse the entire +pattern, so instead you could use this: +.sp + ( \e( ( [^()]++ | (?1) )* \e) ) +.sp +We have put the pattern into parentheses, and caused the recursion to refer to +them instead of the whole pattern. +.P +In a larger pattern, keeping track of parenthesis numbers can be tricky. This +is made easier by the use of relative references. Instead of (?1) in the +pattern above you can write (?-2) to refer to the second most recently opened +parentheses preceding the recursion. In other words, a negative number counts +capturing parentheses leftwards from the point at which it is encountered. +.P +It is also possible to refer to subsequently opened parentheses, by writing +references such as (?+2). However, these cannot be recursive because the +reference is not inside the parentheses that are referenced. They are always +.\" HTML +.\" +non-recursive subroutine +.\" +calls, as described in the next section. +.P +An alternative approach is to use named parentheses instead. The Perl syntax +for this is (?&name); PCRE's earlier syntax (?P>name) is also supported. We +could rewrite the above example as follows: +.sp + (? \e( ( [^()]++ | (?&pn) )* \e) ) +.sp +If there is more than one subpattern with the same name, the earliest one is +used. +.P +This particular example pattern that we have been looking at contains nested +unlimited repeats, and so the use of a possessive quantifier for matching +strings of non-parentheses is important when applying the pattern to strings +that do not match. For example, when this pattern is applied to +.sp + (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa() +.sp +it yields "no match" quickly. However, if a possessive quantifier is not used, +the match runs for a very long time indeed because there are so many different +ways the + and * repeats can carve up the subject, and all have to be tested +before failure can be reported. +.P +At the end of a match, the values of capturing parentheses are those from +the outermost level. If you want to obtain intermediate values, a callout +function can be used (see below and the +.\" HREF +\fBpcrecallout\fP +.\" +documentation). If the pattern above is matched against +.sp + (ab(cd)ef) +.sp +the value for the inner capturing parentheses (numbered 2) is "ef", which is +the last value taken on at the top level. If a capturing subpattern is not +matched at the top level, its final captured value is unset, even if it was +(temporarily) set at a deeper level during the matching process. +.P +If there are more than 15 capturing parentheses in a pattern, PCRE has to +obtain extra memory to store data during a recursion, which it does by using +\fBpcre_malloc\fP, freeing it via \fBpcre_free\fP afterwards. If no memory can +be obtained, the match fails with the PCRE_ERROR_NOMEMORY error. +.P +Do not confuse the (?R) item with the condition (R), which tests for recursion. +Consider this pattern, which matches text in angle brackets, allowing for +arbitrary nesting. Only digits are allowed in nested brackets (that is, when +recursing), whereas any characters are permitted at the outer level. +.sp + < (?: (?(R) \ed++ | [^<>]*+) | (?R)) * > +.sp +In this pattern, (?(R) is the start of a conditional subpattern, with two +different alternatives for the recursive and non-recursive cases. The (?R) item +is the actual recursive call. +. +. +.\" HTML +.SS "Differences in recursion processing between PCRE and Perl" +.rs +.sp +Recursion processing in PCRE differs from Perl in two important ways. In PCRE +(like Python, but unlike Perl), a recursive subpattern call is always treated +as an atomic group. That is, once it has matched some of the subject string, it +is never re-entered, even if it contains untried alternatives and there is a +subsequent matching failure. This can be illustrated by the following pattern, +which purports to match a palindromic string that contains an odd number of +characters (for example, "a", "aba", "abcba", "abcdcba"): +.sp + ^(.|(.)(?1)\e2)$ +.sp +The idea is that it either matches a single character, or two identical +characters surrounding a sub-palindrome. In Perl, this pattern works; in PCRE +it does not if the pattern is longer than three characters. Consider the +subject string "abcba": +.P +At the top level, the first character is matched, but as it is not at the end +of the string, the first alternative fails; the second alternative is taken +and the recursion kicks in. The recursive call to subpattern 1 successfully +matches the next character ("b"). (Note that the beginning and end of line +tests are not part of the recursion). +.P +Back at the top level, the next character ("c") is compared with what +subpattern 2 matched, which was "a". This fails. Because the recursion is +treated as an atomic group, there are now no backtracking points, and so the +entire match fails. (Perl is able, at this point, to re-enter the recursion and +try the second alternative.) However, if the pattern is written with the +alternatives in the other order, things are different: +.sp + ^((.)(?1)\e2|.)$ +.sp +This time, the recursing alternative is tried first, and continues to recurse +until it runs out of characters, at which point the recursion fails. But this +time we do have another alternative to try at the higher level. That is the big +difference: in the previous case the remaining alternative is at a deeper +recursion level, which PCRE cannot use. +.P +To change the pattern so that it matches all palindromic strings, not just +those with an odd number of characters, it is tempting to change the pattern to +this: +.sp + ^((.)(?1)\e2|.?)$ +.sp +Again, this works in Perl, but not in PCRE, and for the same reason. When a +deeper recursion has matched a single character, it cannot be entered again in +order to match an empty string. The solution is to separate the two cases, and +write out the odd and even cases as alternatives at the higher level: +.sp + ^(?:((.)(?1)\e2|)|((.)(?3)\e4|.)) +.sp +If you want to match typical palindromic phrases, the pattern has to ignore all +non-word characters, which can be done like this: +.sp + ^\eW*+(?:((.)\eW*+(?1)\eW*+\e2|)|((.)\eW*+(?3)\eW*+\e4|\eW*+.\eW*+))\eW*+$ +.sp +If run with the PCRE_CASELESS option, this pattern matches phrases such as "A +man, a plan, a canal: Panama!" and it works well in both PCRE and Perl. Note +the use of the possessive quantifier *+ to avoid backtracking into sequences of +non-word characters. Without this, PCRE takes a great deal longer (ten times or +more) to match typical phrases, and Perl takes so long that you think it has +gone into a loop. +.P +\fBWARNING\fP: The palindrome-matching patterns above work only if the subject +string does not start with a palindrome that is shorter than the entire string. +For example, although "abcba" is correctly matched, if the subject is "ababa", +PCRE finds the palindrome "aba" at the start, then fails at top level because +the end of the string does not follow. Once again, it cannot jump back into the +recursion to try other alternatives, so the entire match fails. +.P +The second way in which PCRE and Perl differ in their recursion processing is +in the handling of captured values. In Perl, when a subpattern is called +recursively or as a subpattern (see the next section), it has no access to any +values that were captured outside the recursion, whereas in PCRE these values +can be referenced. Consider this pattern: +.sp + ^(.)(\e1|a(?2)) +.sp +In PCRE, this pattern matches "bab". The first capturing parentheses match "b", +then in the second group, when the back reference \e1 fails to match "b", the +second alternative matches "a" and then recurses. In the recursion, \e1 does +now match "b" and so the whole match succeeds. In Perl, the pattern fails to +match because inside the recursive call \e1 cannot access the externally set +value. +. +. +.\" HTML +.SH "SUBPATTERNS AS SUBROUTINES" +.rs +.sp +If the syntax for a recursive subpattern call (either by number or by +name) is used outside the parentheses to which it refers, it operates like a +subroutine in a programming language. The called subpattern may be defined +before or after the reference. A numbered reference can be absolute or +relative, as in these examples: +.sp + (...(absolute)...)...(?2)... + (...(relative)...)...(?-1)... + (...(?+1)...(relative)... +.sp +An earlier example pointed out that the pattern +.sp + (sens|respons)e and \e1ibility +.sp +matches "sense and sensibility" and "response and responsibility", but not +"sense and responsibility". If instead the pattern +.sp + (sens|respons)e and (?1)ibility +.sp +is used, it does match "sense and responsibility" as well as the other two +strings. Another example is given in the discussion of DEFINE above. +.P +All subroutine calls, whether recursive or not, are always treated as atomic +groups. That is, once a subroutine has matched some of the subject string, it +is never re-entered, even if it contains untried alternatives and there is a +subsequent matching failure. Any capturing parentheses that are set during the +subroutine call revert to their previous values afterwards. +.P +Processing options such as case-independence are fixed when a subpattern is +defined, so if it is used as a subroutine, such options cannot be changed for +different calls. For example, consider this pattern: +.sp + (abc)(?i:(?-1)) +.sp +It matches "abcabc". It does not match "abcABC" because the change of +processing option does not affect the called subpattern. +. +. +.\" HTML +.SH "ONIGURUMA SUBROUTINE SYNTAX" +.rs +.sp +For compatibility with Oniguruma, the non-Perl syntax \eg followed by a name or +a number enclosed either in angle brackets or single quotes, is an alternative +syntax for referencing a subpattern as a subroutine, possibly recursively. Here +are two of the examples used above, rewritten using this syntax: +.sp + (? \e( ( (?>[^()]+) | \eg )* \e) ) + (sens|respons)e and \eg'1'ibility +.sp +PCRE supports an extension to Oniguruma: if a number is preceded by a +plus or a minus sign it is taken as a relative reference. For example: +.sp + (abc)(?i:\eg<-1>) +.sp +Note that \eg{...} (Perl syntax) and \eg<...> (Oniguruma syntax) are \fInot\fP +synonymous. The former is a back reference; the latter is a subroutine call. +. +. +.SH CALLOUTS +.rs +.sp +Perl has a feature whereby using the sequence (?{...}) causes arbitrary Perl +code to be obeyed in the middle of matching a regular expression. This makes it +possible, amongst other things, to extract different substrings that match the +same pair of parentheses when there is a repetition. +.P +PCRE provides a similar feature, but of course it cannot obey arbitrary Perl +code. The feature is called "callout". The caller of PCRE provides an external +function by putting its entry point in the global variable \fIpcre_callout\fP +(8-bit library) or \fIpcre[16|32]_callout\fP (16-bit or 32-bit library). +By default, this variable contains NULL, which disables all calling out. +.P +Within a regular expression, (?C) indicates the points at which the external +function is to be called. If you want to identify different callout points, you +can put a number less than 256 after the letter C. The default value is zero. +For example, this pattern has two callout points: +.sp + (?C1)abc(?C2)def +.sp +If the PCRE_AUTO_CALLOUT flag is passed to a compiling function, callouts are +automatically installed before each item in the pattern. They are all numbered +255. If there is a conditional group in the pattern whose condition is an +assertion, an additional callout is inserted just before the condition. An +explicit callout may also be set at this position, as in this example: +.sp + (?(?C9)(?=a)abc|def) +.sp +Note that this applies only to assertion conditions, not to other types of +condition. +.P +During matching, when PCRE reaches a callout point, the external function is +called. It is provided with the number of the callout, the position in the +pattern, and, optionally, one item of data originally supplied by the caller of +the matching function. The callout function may cause matching to proceed, to +backtrack, or to fail altogether. +.P +By default, PCRE implements a number of optimizations at compile time and +matching time, and one side-effect is that sometimes callouts are skipped. If +you need all possible callouts to happen, you need to set options that disable +the relevant optimizations. More details, and a complete description of the +interface to the callout function, are given in the +.\" HREF +\fBpcrecallout\fP +.\" +documentation. +. +. +.\" HTML +.SH "BACKTRACKING CONTROL" +.rs +.sp +Perl 5.10 introduced a number of "Special Backtracking Control Verbs", which +are still described in the Perl documentation as "experimental and subject to +change or removal in a future version of Perl". It goes on to say: "Their usage +in production code should be noted to avoid problems during upgrades." The same +remarks apply to the PCRE features described in this section. +.P +The new verbs make use of what was previously invalid syntax: an opening +parenthesis followed by an asterisk. They are generally of the form +(*VERB) or (*VERB:NAME). Some may take either form, possibly behaving +differently depending on whether or not a name is present. A name is any +sequence of characters that does not include a closing parenthesis. The maximum +length of name is 255 in the 8-bit library and 65535 in the 16-bit and 32-bit +libraries. If the name is empty, that is, if the closing parenthesis +immediately follows the colon, the effect is as if the colon were not there. +Any number of these verbs may occur in a pattern. +.P +Since these verbs are specifically related to backtracking, most of them can be +used only when the pattern is to be matched using one of the traditional +matching functions, because these use a backtracking algorithm. With the +exception of (*FAIL), which behaves like a failing negative assertion, the +backtracking control verbs cause an error if encountered by a DFA matching +function. +.P +The behaviour of these verbs in +.\" HTML +.\" +repeated groups, +.\" +.\" HTML +.\" +assertions, +.\" +and in +.\" HTML +.\" +subpatterns called as subroutines +.\" +(whether or not recursively) is documented below. +. +. +.\" HTML +.SS "Optimizations that affect backtracking verbs" +.rs +.sp +PCRE contains some optimizations that are used to speed up matching by running +some checks at the start of each match attempt. For example, it may know the +minimum length of matching subject, or that a particular character must be +present. When one of these optimizations bypasses the running of a match, any +included backtracking verbs will not, of course, be processed. You can suppress +the start-of-match optimizations by setting the PCRE_NO_START_OPTIMIZE option +when calling \fBpcre_compile()\fP or \fBpcre_exec()\fP, or by starting the +pattern with (*NO_START_OPT). There is more discussion of this option in the +section entitled +.\" HTML +.\" +"Option bits for \fBpcre_exec()\fP" +.\" +in the +.\" HREF +\fBpcreapi\fP +.\" +documentation. +.P +Experiments with Perl suggest that it too has similar optimizations, sometimes +leading to anomalous results. +. +. +.SS "Verbs that act immediately" +.rs +.sp +The following verbs act as soon as they are encountered. They may not be +followed by a name. +.sp + (*ACCEPT) +.sp +This verb causes the match to end successfully, skipping the remainder of the +pattern. However, when it is inside a subpattern that is called as a +subroutine, only that subpattern is ended successfully. Matching then continues +at the outer level. If (*ACCEPT) in triggered in a positive assertion, the +assertion succeeds; in a negative assertion, the assertion fails. +.P +If (*ACCEPT) is inside capturing parentheses, the data so far is captured. For +example: +.sp + A((?:A|B(*ACCEPT)|C)D) +.sp +This matches "AB", "AAD", or "ACD"; when it matches "AB", "B" is captured by +the outer parentheses. +.sp + (*FAIL) or (*F) +.sp +This verb causes a matching failure, forcing backtracking to occur. It is +equivalent to (?!) but easier to read. The Perl documentation notes that it is +probably useful only when combined with (?{}) or (??{}). Those are, of course, +Perl features that are not present in PCRE. The nearest equivalent is the +callout feature, as for example in this pattern: +.sp + a+(?C)(*FAIL) +.sp +A match with the string "aaaa" always fails, but the callout is taken before +each backtrack happens (in this example, 10 times). +. +. +.SS "Recording which path was taken" +.rs +.sp +There is one verb whose main purpose is to track how a match was arrived at, +though it also has a secondary use in conjunction with advancing the match +starting point (see (*SKIP) below). +.sp + (*MARK:NAME) or (*:NAME) +.sp +A name is always required with this verb. There may be as many instances of +(*MARK) as you like in a pattern, and their names do not have to be unique. +.P +When a match succeeds, the name of the last-encountered (*MARK:NAME), +(*PRUNE:NAME), or (*THEN:NAME) on the matching path is passed back to the +caller as described in the section entitled +.\" HTML +.\" +"Extra data for \fBpcre_exec()\fP" +.\" +in the +.\" HREF +\fBpcreapi\fP +.\" +documentation. Here is an example of \fBpcretest\fP output, where the /K +modifier requests the retrieval and outputting of (*MARK) data: +.sp + re> /X(*MARK:A)Y|X(*MARK:B)Z/K + data> XY + 0: XY + MK: A + XZ + 0: XZ + MK: B +.sp +The (*MARK) name is tagged with "MK:" in this output, and in this example it +indicates which of the two alternatives matched. This is a more efficient way +of obtaining this information than putting each alternative in its own +capturing parentheses. +.P +If a verb with a name is encountered in a positive assertion that is true, the +name is recorded and passed back if it is the last-encountered. This does not +happen for negative assertions or failing positive assertions. +.P +After a partial match or a failed match, the last encountered name in the +entire match process is returned. For example: +.sp + re> /X(*MARK:A)Y|X(*MARK:B)Z/K + data> XP + No match, mark = B +.sp +Note that in this unanchored example the mark is retained from the match +attempt that started at the letter "X" in the subject. Subsequent match +attempts starting at "P" and then with an empty string do not get as far as the +(*MARK) item, but nevertheless do not reset it. +.P +If you are interested in (*MARK) values after failed matches, you should +probably set the PCRE_NO_START_OPTIMIZE option +.\" HTML +.\" +(see above) +.\" +to ensure that the match is always attempted. +. +. +.SS "Verbs that act after backtracking" +.rs +.sp +The following verbs do nothing when they are encountered. Matching continues +with what follows, but if there is no subsequent match, causing a backtrack to +the verb, a failure is forced. That is, backtracking cannot pass to the left of +the verb. However, when one of these verbs appears inside an atomic group or an +assertion that is true, its effect is confined to that group, because once the +group has been matched, there is never any backtracking into it. In this +situation, backtracking can "jump back" to the left of the entire atomic group +or assertion. (Remember also, as stated above, that this localization also +applies in subroutine calls.) +.P +These verbs differ in exactly what kind of failure occurs when backtracking +reaches them. The behaviour described below is what happens when the verb is +not in a subroutine or an assertion. Subsequent sections cover these special +cases. +.sp + (*COMMIT) +.sp +This verb, which may not be followed by a name, causes the whole match to fail +outright if there is a later matching failure that causes backtracking to reach +it. Even if the pattern is unanchored, no further attempts to find a match by +advancing the starting point take place. If (*COMMIT) is the only backtracking +verb that is encountered, once it has been passed \fBpcre_exec()\fP is +committed to finding a match at the current starting point, or not at all. For +example: +.sp + a+(*COMMIT)b +.sp +This matches "xxaab" but not "aacaab". It can be thought of as a kind of +dynamic anchor, or "I've started, so I must finish." The name of the most +recently passed (*MARK) in the path is passed back when (*COMMIT) forces a +match failure. +.P +If there is more than one backtracking verb in a pattern, a different one that +follows (*COMMIT) may be triggered first, so merely passing (*COMMIT) during a +match does not always guarantee that a match must be at this starting point. +.P +Note that (*COMMIT) at the start of a pattern is not the same as an anchor, +unless PCRE's start-of-match optimizations are turned off, as shown in this +output from \fBpcretest\fP: +.sp + re> /(*COMMIT)abc/ + data> xyzabc + 0: abc + data> xyzabc\eY + No match +.sp +For this pattern, PCRE knows that any match must start with "a", so the +optimization skips along the subject to "a" before applying the pattern to the +first set of data. The match attempt then succeeds. In the second set of data, +the escape sequence \eY is interpreted by the \fBpcretest\fP program. It causes +the PCRE_NO_START_OPTIMIZE option to be set when \fBpcre_exec()\fP is called. +This disables the optimization that skips along to the first character. The +pattern is now applied starting at "x", and so the (*COMMIT) causes the match +to fail without trying any other starting points. +.sp + (*PRUNE) or (*PRUNE:NAME) +.sp +This verb causes the match to fail at the current starting position in the +subject if there is a later matching failure that causes backtracking to reach +it. If the pattern is unanchored, the normal "bumpalong" advance to the next +starting character then happens. Backtracking can occur as usual to the left of +(*PRUNE), before it is reached, or when matching to the right of (*PRUNE), but +if there is no match to the right, backtracking cannot cross (*PRUNE). In +simple cases, the use of (*PRUNE) is just an alternative to an atomic group or +possessive quantifier, but there are some uses of (*PRUNE) that cannot be +expressed in any other way. In an anchored pattern (*PRUNE) has the same effect +as (*COMMIT). +.P +The behaviour of (*PRUNE:NAME) is the not the same as (*MARK:NAME)(*PRUNE). +It is like (*MARK:NAME) in that the name is remembered for passing back to the +caller. However, (*SKIP:NAME) searches only for names set with (*MARK). +.sp + (*SKIP) +.sp +This verb, when given without a name, is like (*PRUNE), except that if the +pattern is unanchored, the "bumpalong" advance is not to the next character, +but to the position in the subject where (*SKIP) was encountered. (*SKIP) +signifies that whatever text was matched leading up to it cannot be part of a +successful match. Consider: +.sp + a+(*SKIP)b +.sp +If the subject is "aaaac...", after the first match attempt fails (starting at +the first character in the string), the starting point skips on to start the +next attempt at "c". Note that a possessive quantifier does not have the same +effect as this example; although it would suppress backtracking during the +first match attempt, the second attempt would start at the second character +instead of skipping on to "c". +.sp + (*SKIP:NAME) +.sp +When (*SKIP) has an associated name, its behaviour is modified. When it is +triggered, the previous path through the pattern is searched for the most +recent (*MARK) that has the same name. If one is found, the "bumpalong" advance +is to the subject position that corresponds to that (*MARK) instead of to where +(*SKIP) was encountered. If no (*MARK) with a matching name is found, the +(*SKIP) is ignored. +.P +Note that (*SKIP:NAME) searches only for names set by (*MARK:NAME). It ignores +names that are set by (*PRUNE:NAME) or (*THEN:NAME). +.sp + (*THEN) or (*THEN:NAME) +.sp +This verb causes a skip to the next innermost alternative when backtracking +reaches it. That is, it cancels any further backtracking within the current +alternative. Its name comes from the observation that it can be used for a +pattern-based if-then-else block: +.sp + ( COND1 (*THEN) FOO | COND2 (*THEN) BAR | COND3 (*THEN) BAZ ) ... +.sp +If the COND1 pattern matches, FOO is tried (and possibly further items after +the end of the group if FOO succeeds); on failure, the matcher skips to the +second alternative and tries COND2, without backtracking into COND1. If that +succeeds and BAR fails, COND3 is tried. If subsequently BAZ fails, there are no +more alternatives, so there is a backtrack to whatever came before the entire +group. If (*THEN) is not inside an alternation, it acts like (*PRUNE). +.P +The behaviour of (*THEN:NAME) is the not the same as (*MARK:NAME)(*THEN). +It is like (*MARK:NAME) in that the name is remembered for passing back to the +caller. However, (*SKIP:NAME) searches only for names set with (*MARK). +.P +A subpattern that does not contain a | character is just a part of the +enclosing alternative; it is not a nested alternation with only one +alternative. The effect of (*THEN) extends beyond such a subpattern to the +enclosing alternative. Consider this pattern, where A, B, etc. are complex +pattern fragments that do not contain any | characters at this level: +.sp + A (B(*THEN)C) | D +.sp +If A and B are matched, but there is a failure in C, matching does not +backtrack into A; instead it moves to the next alternative, that is, D. +However, if the subpattern containing (*THEN) is given an alternative, it +behaves differently: +.sp + A (B(*THEN)C | (*FAIL)) | D +.sp +The effect of (*THEN) is now confined to the inner subpattern. After a failure +in C, matching moves to (*FAIL), which causes the whole subpattern to fail +because there are no more alternatives to try. In this case, matching does now +backtrack into A. +.P +Note that a conditional subpattern is not considered as having two +alternatives, because only one is ever used. In other words, the | character in +a conditional subpattern has a different meaning. Ignoring white space, +consider: +.sp + ^.*? (?(?=a) a | b(*THEN)c ) +.sp +If the subject is "ba", this pattern does not match. Because .*? is ungreedy, +it initially matches zero characters. The condition (?=a) then fails, the +character "b" is matched, but "c" is not. At this point, matching does not +backtrack to .*? as might perhaps be expected from the presence of the | +character. The conditional subpattern is part of the single alternative that +comprises the whole pattern, and so the match fails. (If there was a backtrack +into .*?, allowing it to match "b", the match would succeed.) +.P +The verbs just described provide four different "strengths" of control when +subsequent matching fails. (*THEN) is the weakest, carrying on the match at the +next alternative. (*PRUNE) comes next, failing the match at the current +starting position, but allowing an advance to the next character (for an +unanchored pattern). (*SKIP) is similar, except that the advance may be more +than one character. (*COMMIT) is the strongest, causing the entire match to +fail. +. +. +.SS "More than one backtracking verb" +.rs +.sp +If more than one backtracking verb is present in a pattern, the one that is +backtracked onto first acts. For example, consider this pattern, where A, B, +etc. are complex pattern fragments: +.sp + (A(*COMMIT)B(*THEN)C|ABD) +.sp +If A matches but B fails, the backtrack to (*COMMIT) causes the entire match to +fail. However, if A and B match, but C fails, the backtrack to (*THEN) causes +the next alternative (ABD) to be tried. This behaviour is consistent, but is +not always the same as Perl's. It means that if two or more backtracking verbs +appear in succession, all the the last of them has no effect. Consider this +example: +.sp + ...(*COMMIT)(*PRUNE)... +.sp +If there is a matching failure to the right, backtracking onto (*PRUNE) causes +it to be triggered, and its action is taken. There can never be a backtrack +onto (*COMMIT). +. +. +.\" HTML +.SS "Backtracking verbs in repeated groups" +.rs +.sp +PCRE differs from Perl in its handling of backtracking verbs in repeated +groups. For example, consider: +.sp + /(a(*COMMIT)b)+ac/ +.sp +If the subject is "abac", Perl matches, but PCRE fails because the (*COMMIT) in +the second repeat of the group acts. +. +. +.\" HTML +.SS "Backtracking verbs in assertions" +.rs +.sp +(*FAIL) in an assertion has its normal effect: it forces an immediate backtrack. +.P +(*ACCEPT) in a positive assertion causes the assertion to succeed without any +further processing. In a negative assertion, (*ACCEPT) causes the assertion to +fail without any further processing. +.P +The other backtracking verbs are not treated specially if they appear in a +positive assertion. In particular, (*THEN) skips to the next alternative in the +innermost enclosing group that has alternations, whether or not this is within +the assertion. +.P +Negative assertions are, however, different, in order to ensure that changing a +positive assertion into a negative assertion changes its result. Backtracking +into (*COMMIT), (*SKIP), or (*PRUNE) causes a negative assertion to be true, +without considering any further alternative branches in the assertion. +Backtracking into (*THEN) causes it to skip to the next enclosing alternative +within the assertion (the normal behaviour), but if the assertion does not have +such an alternative, (*THEN) behaves like (*PRUNE). +. +. +.\" HTML +.SS "Backtracking verbs in subroutines" +.rs +.sp +These behaviours occur whether or not the subpattern is called recursively. +Perl's treatment of subroutines is different in some cases. +.P +(*FAIL) in a subpattern called as a subroutine has its normal effect: it forces +an immediate backtrack. +.P +(*ACCEPT) in a subpattern called as a subroutine causes the subroutine match to +succeed without any further processing. Matching then continues after the +subroutine call. +.P +(*COMMIT), (*SKIP), and (*PRUNE) in a subpattern called as a subroutine cause +the subroutine match to fail. +.P +(*THEN) skips to the next alternative in the innermost enclosing group within +the subpattern that has alternatives. If there is no such group within the +subpattern, (*THEN) causes the subroutine match to fail. +. +. +.SH "SEE ALSO" +.rs +.sp +\fBpcreapi\fP(3), \fBpcrecallout\fP(3), \fBpcrematching\fP(3), +\fBpcresyntax\fP(3), \fBpcre\fP(3), \fBpcre16(3)\fP, \fBpcre32(3)\fP. +. +. +.SH AUTHOR +.rs +.sp +.nf +Philip Hazel +University Computing Service +Cambridge CB2 3QH, England. +.fi +. +. +.SH REVISION +.rs +.sp +.nf +Last updated: 23 October 2016 +Copyright (c) 1997-2016 University of Cambridge. +.fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcreperform.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcreperform.3 new file mode 100644 index 0000000000000000000000000000000000000000..fb2aa95926a6f31d4e89146e31848c38467dde8f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcreperform.3 @@ -0,0 +1,177 @@ +.TH PCREPERFORM 3 "09 January 2012" "PCRE 8.30" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH "PCRE PERFORMANCE" +.rs +.sp +Two aspects of performance are discussed below: memory usage and processing +time. The way you express your pattern as a regular expression can affect both +of them. +. +.SH "COMPILED PATTERN MEMORY USAGE" +.rs +.sp +Patterns are compiled by PCRE into a reasonably efficient interpretive code, so +that most simple patterns do not use much memory. However, there is one case +where the memory usage of a compiled pattern can be unexpectedly large. If a +parenthesized subpattern has a quantifier with a minimum greater than 1 and/or +a limited maximum, the whole subpattern is repeated in the compiled code. For +example, the pattern +.sp + (abc|def){2,4} +.sp +is compiled as if it were +.sp + (abc|def)(abc|def)((abc|def)(abc|def)?)? +.sp +(Technical aside: It is done this way so that backtrack points within each of +the repetitions can be independently maintained.) +.P +For regular expressions whose quantifiers use only small numbers, this is not +usually a problem. However, if the numbers are large, and particularly if such +repetitions are nested, the memory usage can become an embarrassment. For +example, the very simple pattern +.sp + ((ab){1,1000}c){1,3} +.sp +uses 51K bytes when compiled using the 8-bit library. When PCRE is compiled +with its default internal pointer size of two bytes, the size limit on a +compiled pattern is 64K data units, and this is reached with the above pattern +if the outer repetition is increased from 3 to 4. PCRE can be compiled to use +larger internal pointers and thus handle larger compiled patterns, but it is +better to try to rewrite your pattern to use less memory if you can. +.P +One way of reducing the memory usage for such patterns is to make use of PCRE's +.\" HTML +.\" +"subroutine" +.\" +facility. Re-writing the above pattern as +.sp + ((ab)(?2){0,999}c)(?1){0,2} +.sp +reduces the memory requirements to 18K, and indeed it remains under 20K even +with the outer repetition increased to 100. However, this pattern is not +exactly equivalent, because the "subroutine" calls are treated as +.\" HTML +.\" +atomic groups +.\" +into which there can be no backtracking if there is a subsequent matching +failure. Therefore, PCRE cannot do this kind of rewriting automatically. +Furthermore, there is a noticeable loss of speed when executing the modified +pattern. Nevertheless, if the atomic grouping is not a problem and the loss of +speed is acceptable, this kind of rewriting will allow you to process patterns +that PCRE cannot otherwise handle. +. +. +.SH "STACK USAGE AT RUN TIME" +.rs +.sp +When \fBpcre_exec()\fP or \fBpcre[16|32]_exec()\fP is used for matching, certain +kinds of pattern can cause it to use large amounts of the process stack. In +some environments the default process stack is quite small, and if it runs out +the result is often SIGSEGV. This issue is probably the most frequently raised +problem with PCRE. Rewriting your pattern can often help. The +.\" HREF +\fBpcrestack\fP +.\" +documentation discusses this issue in detail. +. +. +.SH "PROCESSING TIME" +.rs +.sp +Certain items in regular expression patterns are processed more efficiently +than others. It is more efficient to use a character class like [aeiou] than a +set of single-character alternatives such as (a|e|i|o|u). In general, the +simplest construction that provides the required behaviour is usually the most +efficient. Jeffrey Friedl's book contains a lot of useful general discussion +about optimizing regular expressions for efficient performance. This document +contains a few observations about PCRE. +.P +Using Unicode character properties (the \ep, \eP, and \eX escapes) is slow, +because PCRE has to use a multi-stage table lookup whenever it needs a +character's property. If you can find an alternative pattern that does not use +character properties, it will probably be faster. +.P +By default, the escape sequences \eb, \ed, \es, and \ew, and the POSIX +character classes such as [:alpha:] do not use Unicode properties, partly for +backwards compatibility, and partly for performance reasons. However, you can +set PCRE_UCP if you want Unicode character properties to be used. This can +double the matching time for items such as \ed, when matched with +a traditional matching function; the performance loss is less with +a DFA matching function, and in both cases there is not much difference for +\eb. +.P +When a pattern begins with .* not in parentheses, or in parentheses that are +not the subject of a backreference, and the PCRE_DOTALL option is set, the +pattern is implicitly anchored by PCRE, since it can match only at the start of +a subject string. However, if PCRE_DOTALL is not set, PCRE cannot make this +optimization, because the . metacharacter does not then match a newline, and if +the subject string contains newlines, the pattern may match from the character +immediately following one of them instead of from the very start. For example, +the pattern +.sp + .*second +.sp +matches the subject "first\enand second" (where \en stands for a newline +character), with the match starting at the seventh character. In order to do +this, PCRE has to retry the match starting after every newline in the subject. +.P +If you are using such a pattern with subject strings that do not contain +newlines, the best performance is obtained by setting PCRE_DOTALL, or starting +the pattern with ^.* or ^.*? to indicate explicit anchoring. That saves PCRE +from having to scan along the subject looking for a newline to restart at. +.P +Beware of patterns that contain nested indefinite repeats. These can take a +long time to run when applied to a string that does not match. Consider the +pattern fragment +.sp + ^(a+)* +.sp +This can match "aaaa" in 16 different ways, and this number increases very +rapidly as the string gets longer. (The * repeat can match 0, 1, 2, 3, or 4 +times, and for each of those cases other than 0 or 4, the + repeats can match +different numbers of times.) When the remainder of the pattern is such that the +entire match is going to fail, PCRE has in principle to try every possible +variation, and this can take an extremely long time, even for relatively short +strings. +.P +An optimization catches some of the more simple cases such as +.sp + (a+)*b +.sp +where a literal character follows. Before embarking on the standard matching +procedure, PCRE checks that there is a "b" later in the subject string, and if +there is not, it fails the match immediately. However, when there is no +following literal this optimization cannot be used. You can see the difference +by comparing the behaviour of +.sp + (a+)*\ed +.sp +with the pattern above. The former gives a failure almost instantly when +applied to a whole line of "a" characters, whereas the latter takes an +appreciable time with strings longer than about 20 characters. +.P +In many cases, the solution to this kind of performance issue is to use an +atomic group or a possessive quantifier. +. +. +.SH AUTHOR +.rs +.sp +.nf +Philip Hazel +University Computing Service +Cambridge CB2 3QH, England. +.fi +. +. +.SH REVISION +.rs +.sp +.nf +Last updated: 25 August 2012 +Copyright (c) 1997-2012 University of Cambridge. +.fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcreposix.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcreposix.3 new file mode 100644 index 0000000000000000000000000000000000000000..77890f36b46635e75be21ebcdc317caae19e4ac0 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcreposix.3 @@ -0,0 +1,267 @@ +.TH PCREPOSIX 3 "09 January 2012" "PCRE 8.30" +.SH NAME +PCRE - Perl-compatible regular expressions. +.SH "SYNOPSIS" +.rs +.sp +.B #include +.PP +.nf +.B int regcomp(regex_t *\fIpreg\fP, const char *\fIpattern\fP, +.B " int \fIcflags\fP);" +.sp +.B int regexec(regex_t *\fIpreg\fP, const char *\fIstring\fP, +.B " size_t \fInmatch\fP, regmatch_t \fIpmatch\fP[], int \fIeflags\fP);" +.B " size_t regerror(int \fIerrcode\fP, const regex_t *\fIpreg\fP," +.B " char *\fIerrbuf\fP, size_t \fIerrbuf_size\fP);" +.sp +.B void regfree(regex_t *\fIpreg\fP); +.fi +. +.SH DESCRIPTION +.rs +.sp +This set of functions provides a POSIX-style API for the PCRE regular +expression 8-bit library. See the +.\" HREF +\fBpcreapi\fP +.\" +documentation for a description of PCRE's native API, which contains much +additional functionality. There is no POSIX-style wrapper for PCRE's 16-bit +and 32-bit library. +.P +The functions described here are just wrapper functions that ultimately call +the PCRE native API. Their prototypes are defined in the \fBpcreposix.h\fP +header file, and on Unix systems the library itself is called +\fBpcreposix.a\fP, so can be accessed by adding \fB-lpcreposix\fP to the +command for linking an application that uses them. Because the POSIX functions +call the native ones, it is also necessary to add \fB-lpcre\fP. +.P +I have implemented only those POSIX option bits that can be reasonably mapped +to PCRE native options. In addition, the option REG_EXTENDED is defined with +the value zero. This has no effect, but since programs that are written to the +POSIX interface often use it, this makes it easier to slot in PCRE as a +replacement library. Other POSIX options are not even defined. +.P +There are also some other options that are not defined by POSIX. These have +been added at the request of users who want to make use of certain +PCRE-specific features via the POSIX calling interface. +.P +When PCRE is called via these functions, it is only the API that is POSIX-like +in style. The syntax and semantics of the regular expressions themselves are +still those of Perl, subject to the setting of various PCRE options, as +described below. "POSIX-like in style" means that the API approximates to the +POSIX definition; it is not fully POSIX-compatible, and in multi-byte encoding +domains it is probably even less compatible. +.P +The header for these functions is supplied as \fBpcreposix.h\fP to avoid any +potential clash with other POSIX libraries. It can, of course, be renamed or +aliased as \fBregex.h\fP, which is the "correct" name. It provides two +structure types, \fIregex_t\fP for compiled internal forms, and +\fIregmatch_t\fP for returning captured substrings. It also defines some +constants whose names start with "REG_"; these are used for setting options and +identifying error codes. +. +. +.SH "COMPILING A PATTERN" +.rs +.sp +The function \fBregcomp()\fP is called to compile a pattern into an +internal form. The pattern is a C string terminated by a binary zero, and +is passed in the argument \fIpattern\fP. The \fIpreg\fP argument is a pointer +to a \fBregex_t\fP structure that is used as a base for storing information +about the compiled regular expression. +.P +The argument \fIcflags\fP is either zero, or contains one or more of the bits +defined by the following macros: +.sp + REG_DOTALL +.sp +The PCRE_DOTALL option is set when the regular expression is passed for +compilation to the native function. Note that REG_DOTALL is not part of the +POSIX standard. +.sp + REG_ICASE +.sp +The PCRE_CASELESS option is set when the regular expression is passed for +compilation to the native function. +.sp + REG_NEWLINE +.sp +The PCRE_MULTILINE option is set when the regular expression is passed for +compilation to the native function. Note that this does \fInot\fP mimic the +defined POSIX behaviour for REG_NEWLINE (see the following section). +.sp + REG_NOSUB +.sp +The PCRE_NO_AUTO_CAPTURE option is set when the regular expression is passed +for compilation to the native function. In addition, when a pattern that is +compiled with this flag is passed to \fBregexec()\fP for matching, the +\fInmatch\fP and \fIpmatch\fP arguments are ignored, and no captured strings +are returned. +.sp + REG_UCP +.sp +The PCRE_UCP option is set when the regular expression is passed for +compilation to the native function. This causes PCRE to use Unicode properties +when matchine \ed, \ew, etc., instead of just recognizing ASCII values. Note +that REG_UTF8 is not part of the POSIX standard. +.sp + REG_UNGREEDY +.sp +The PCRE_UNGREEDY option is set when the regular expression is passed for +compilation to the native function. Note that REG_UNGREEDY is not part of the +POSIX standard. +.sp + REG_UTF8 +.sp +The PCRE_UTF8 option is set when the regular expression is passed for +compilation to the native function. This causes the pattern itself and all data +strings used for matching it to be treated as UTF-8 strings. Note that REG_UTF8 +is not part of the POSIX standard. +.P +In the absence of these flags, no options are passed to the native function. +This means the the regex is compiled with PCRE default semantics. In +particular, the way it handles newline characters in the subject string is the +Perl way, not the POSIX way. Note that setting PCRE_MULTILINE has only +\fIsome\fP of the effects specified for REG_NEWLINE. It does not affect the way +newlines are matched by . (they are not) or by a negative class such as [^a] +(they are). +.P +The yield of \fBregcomp()\fP is zero on success, and non-zero otherwise. The +\fIpreg\fP structure is filled in on success, and one member of the structure +is public: \fIre_nsub\fP contains the number of capturing subpatterns in +the regular expression. Various error codes are defined in the header file. +.P +NOTE: If the yield of \fBregcomp()\fP is non-zero, you must not attempt to +use the contents of the \fIpreg\fP structure. If, for example, you pass it to +\fBregexec()\fP, the result is undefined and your program is likely to crash. +. +. +.SH "MATCHING NEWLINE CHARACTERS" +.rs +.sp +This area is not simple, because POSIX and Perl take different views of things. +It is not possible to get PCRE to obey POSIX semantics, but then PCRE was never +intended to be a POSIX engine. The following table lists the different +possibilities for matching newline characters in PCRE: +.sp + Default Change with +.sp + . matches newline no PCRE_DOTALL + newline matches [^a] yes not changeable + $ matches \en at end yes PCRE_DOLLARENDONLY + $ matches \en in middle no PCRE_MULTILINE + ^ matches \en in middle no PCRE_MULTILINE +.sp +This is the equivalent table for POSIX: +.sp + Default Change with +.sp + . matches newline yes REG_NEWLINE + newline matches [^a] yes REG_NEWLINE + $ matches \en at end no REG_NEWLINE + $ matches \en in middle no REG_NEWLINE + ^ matches \en in middle no REG_NEWLINE +.sp +PCRE's behaviour is the same as Perl's, except that there is no equivalent for +PCRE_DOLLAR_ENDONLY in Perl. In both PCRE and Perl, there is no way to stop +newline from matching [^a]. +.P +The default POSIX newline handling can be obtained by setting PCRE_DOTALL and +PCRE_DOLLAR_ENDONLY, but there is no way to make PCRE behave exactly as for the +REG_NEWLINE action. +. +. +.SH "MATCHING A PATTERN" +.rs +.sp +The function \fBregexec()\fP is called to match a compiled pattern \fIpreg\fP +against a given \fIstring\fP, which is by default terminated by a zero byte +(but see REG_STARTEND below), subject to the options in \fIeflags\fP. These can +be: +.sp + REG_NOTBOL +.sp +The PCRE_NOTBOL option is set when calling the underlying PCRE matching +function. +.sp + REG_NOTEMPTY +.sp +The PCRE_NOTEMPTY option is set when calling the underlying PCRE matching +function. Note that REG_NOTEMPTY is not part of the POSIX standard. However, +setting this option can give more POSIX-like behaviour in some situations. +.sp + REG_NOTEOL +.sp +The PCRE_NOTEOL option is set when calling the underlying PCRE matching +function. +.sp + REG_STARTEND +.sp +The string is considered to start at \fIstring\fP + \fIpmatch[0].rm_so\fP and +to have a terminating NUL located at \fIstring\fP + \fIpmatch[0].rm_eo\fP +(there need not actually be a NUL at that location), regardless of the value of +\fInmatch\fP. This is a BSD extension, compatible with but not specified by +IEEE Standard 1003.2 (POSIX.2), and should be used with caution in software +intended to be portable to other systems. Note that a non-zero \fIrm_so\fP does +not imply REG_NOTBOL; REG_STARTEND affects only the location of the string, not +how it is matched. +.P +If the pattern was compiled with the REG_NOSUB flag, no data about any matched +strings is returned. The \fInmatch\fP and \fIpmatch\fP arguments of +\fBregexec()\fP are ignored. +.P +If the value of \fInmatch\fP is zero, or if the value \fIpmatch\fP is NULL, +no data about any matched strings is returned. +.P +Otherwise,the portion of the string that was matched, and also any captured +substrings, are returned via the \fIpmatch\fP argument, which points to an +array of \fInmatch\fP structures of type \fIregmatch_t\fP, containing the +members \fIrm_so\fP and \fIrm_eo\fP. These contain the offset to the first +character of each substring and the offset to the first character after the end +of each substring, respectively. The 0th element of the vector relates to the +entire portion of \fIstring\fP that was matched; subsequent elements relate to +the capturing subpatterns of the regular expression. Unused entries in the +array have both structure members set to -1. +.P +A successful match yields a zero return; various error codes are defined in the +header file, of which REG_NOMATCH is the "expected" failure code. +. +. +.SH "ERROR MESSAGES" +.rs +.sp +The \fBregerror()\fP function maps a non-zero errorcode from either +\fBregcomp()\fP or \fBregexec()\fP to a printable message. If \fIpreg\fP is not +NULL, the error should have arisen from the use of that structure. A message +terminated by a binary zero is placed in \fIerrbuf\fP. The length of the +message, including the zero, is limited to \fIerrbuf_size\fP. The yield of the +function is the size of buffer needed to hold the whole message. +. +. +.SH MEMORY USAGE +.rs +.sp +Compiling a regular expression causes memory to be allocated and associated +with the \fIpreg\fP structure. The function \fBregfree()\fP frees all such +memory, after which \fIpreg\fP may no longer be used as a compiled expression. +. +. +.SH AUTHOR +.rs +.sp +.nf +Philip Hazel +University Computing Service +Cambridge CB2 3QH, England. +.fi +. +. +.SH REVISION +.rs +.sp +.nf +Last updated: 09 January 2012 +Copyright (c) 1997-2012 University of Cambridge. +.fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcreprecompile.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcreprecompile.3 new file mode 100644 index 0000000000000000000000000000000000000000..40f257a98cba4be8b1347b37e562584cefae3078 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcreprecompile.3 @@ -0,0 +1,155 @@ +.TH PCREPRECOMPILE 3 "12 November 2013" "PCRE 8.34" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH "SAVING AND RE-USING PRECOMPILED PCRE PATTERNS" +.rs +.sp +If you are running an application that uses a large number of regular +expression patterns, it may be useful to store them in a precompiled form +instead of having to compile them every time the application is run. +If you are not using any private character tables (see the +.\" HREF +\fBpcre_maketables()\fP +.\" +documentation), this is relatively straightforward. If you are using private +tables, it is a little bit more complicated. However, if you are using the +just-in-time optimization feature, it is not possible to save and reload the +JIT data. +.P +If you save compiled patterns to a file, you can copy them to a different host +and run them there. If the two hosts have different endianness (byte order), +you should run the \fBpcre[16|32]_pattern_to_host_byte_order()\fP function on the +new host before trying to match the pattern. The matching functions return +PCRE_ERROR_BADENDIANNESS if they detect a pattern with the wrong endianness. +.P +Compiling regular expressions with one version of PCRE for use with a different +version is not guaranteed to work and may cause crashes, and saving and +restoring a compiled pattern loses any JIT optimization data. +. +. +.SH "SAVING A COMPILED PATTERN" +.rs +.sp +The value returned by \fBpcre[16|32]_compile()\fP points to a single block of +memory that holds the compiled pattern and associated data. You can find the +length of this block in bytes by calling \fBpcre[16|32]_fullinfo()\fP with an +argument of PCRE_INFO_SIZE. You can then save the data in any appropriate +manner. Here is sample code for the 8-bit library that compiles a pattern and +writes it to a file. It assumes that the variable \fIfd\fP refers to a file +that is open for output: +.sp + int erroroffset, rc, size; + char *error; + pcre *re; +.sp + re = pcre_compile("my pattern", 0, &error, &erroroffset, NULL); + if (re == NULL) { ... handle errors ... } + rc = pcre_fullinfo(re, NULL, PCRE_INFO_SIZE, &size); + if (rc < 0) { ... handle errors ... } + rc = fwrite(re, 1, size, fd); + if (rc != size) { ... handle errors ... } +.sp +In this example, the bytes that comprise the compiled pattern are copied +exactly. Note that this is binary data that may contain any of the 256 possible +byte values. On systems that make a distinction between binary and non-binary +data, be sure that the file is opened for binary output. +.P +If you want to write more than one pattern to a file, you will have to devise a +way of separating them. For binary data, preceding each pattern with its length +is probably the most straightforward approach. Another possibility is to write +out the data in hexadecimal instead of binary, one pattern to a line. +.P +Saving compiled patterns in a file is only one possible way of storing them for +later use. They could equally well be saved in a database, or in the memory of +some daemon process that passes them via sockets to the processes that want +them. +.P +If the pattern has been studied, it is also possible to save the normal study +data in a similar way to the compiled pattern itself. However, if the +PCRE_STUDY_JIT_COMPILE was used, the just-in-time data that is created cannot +be saved because it is too dependent on the current environment. When studying +generates additional information, \fBpcre[16|32]_study()\fP returns a pointer to a +\fBpcre[16|32]_extra\fP data block. Its format is defined in the +.\" HTML +.\" +section on matching a pattern +.\" +in the +.\" HREF +\fBpcreapi\fP +.\" +documentation. The \fIstudy_data\fP field points to the binary study data, and +this is what you must save (not the \fBpcre[16|32]_extra\fP block itself). The +length of the study data can be obtained by calling \fBpcre[16|32]_fullinfo()\fP +with an argument of PCRE_INFO_STUDYSIZE. Remember to check that +\fBpcre[16|32]_study()\fP did return a non-NULL value before trying to save the +study data. +. +. +.SH "RE-USING A PRECOMPILED PATTERN" +.rs +.sp +Re-using a precompiled pattern is straightforward. Having reloaded it into main +memory, called \fBpcre[16|32]_pattern_to_host_byte_order()\fP if necessary, you +pass its pointer to \fBpcre[16|32]_exec()\fP or \fBpcre[16|32]_dfa_exec()\fP in +the usual way. +.P +However, if you passed a pointer to custom character tables when the pattern +was compiled (the \fItableptr\fP argument of \fBpcre[16|32]_compile()\fP), you +must now pass a similar pointer to \fBpcre[16|32]_exec()\fP or +\fBpcre[16|32]_dfa_exec()\fP, because the value saved with the compiled pattern +will obviously be nonsense. A field in a \fBpcre[16|32]_extra()\fP block is used +to pass this data, as described in the +.\" HTML +.\" +section on matching a pattern +.\" +in the +.\" HREF +\fBpcreapi\fP +.\" +documentation. +.P +\fBWarning:\fP The tables that \fBpcre_exec()\fP and \fBpcre_dfa_exec()\fP use +must be the same as those that were used when the pattern was compiled. If this +is not the case, the behaviour is undefined. +.P +If you did not provide custom character tables when the pattern was compiled, +the pointer in the compiled pattern is NULL, which causes the matching +functions to use PCRE's internal tables. Thus, you do not need to take any +special action at run time in this case. +.P +If you saved study data with the compiled pattern, you need to create your own +\fBpcre[16|32]_extra\fP data block and set the \fIstudy_data\fP field to point +to the reloaded study data. You must also set the PCRE_EXTRA_STUDY_DATA bit in +the \fIflags\fP field to indicate that study data is present. Then pass the +\fBpcre[16|32]_extra\fP block to the matching function in the usual way. If the +pattern was studied for just-in-time optimization, that data cannot be saved, +and so is lost by a save/restore cycle. +. +. +.SH "COMPATIBILITY WITH DIFFERENT PCRE RELEASES" +.rs +.sp +In general, it is safest to recompile all saved patterns when you update to a +new PCRE release, though not all updates actually require this. +. +. +. +.SH AUTHOR +.rs +.sp +.nf +Philip Hazel +University Computing Service +Cambridge CB2 3QH, England. +.fi +. +. +.SH REVISION +.rs +.sp +.nf +Last updated: 12 November 2013 +Copyright (c) 1997-2013 University of Cambridge. +.fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcresample.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcresample.3 new file mode 100644 index 0000000000000000000000000000000000000000..d7fe7ec546b462361ae2561ef81581581403a7c7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcresample.3 @@ -0,0 +1,99 @@ +.TH PCRESAMPLE 3 "10 January 2012" "PCRE 8.30" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH "PCRE SAMPLE PROGRAM" +.rs +.sp +A simple, complete demonstration program, to get you started with using PCRE, +is supplied in the file \fIpcredemo.c\fP in the PCRE distribution. A listing of +this program is given in the +.\" HREF +\fBpcredemo\fP +.\" +documentation. If you do not have a copy of the PCRE distribution, you can save +this listing to re-create \fIpcredemo.c\fP. +.P +The demonstration program, which uses the original PCRE 8-bit library, compiles +the regular expression that is its first argument, and matches it against the +subject string in its second argument. No PCRE options are set, and default +character tables are used. If matching succeeds, the program outputs the +portion of the subject that matched, together with the contents of any captured +substrings. +.P +If the -g option is given on the command line, the program then goes on to +check for further matches of the same regular expression in the same subject +string. The logic is a little bit tricky because of the possibility of matching +an empty string. Comments in the code explain what is going on. +.P +If PCRE is installed in the standard include and library directories for your +operating system, you should be able to compile the demonstration program using +this command: +.sp + gcc -o pcredemo pcredemo.c -lpcre +.sp +If PCRE is installed elsewhere, you may need to add additional options to the +command line. For example, on a Unix-like system that has PCRE installed in +\fI/usr/local\fP, you can compile the demonstration program using a command +like this: +.sp +.\" JOINSH + gcc -o pcredemo -I/usr/local/include pcredemo.c \e + -L/usr/local/lib -lpcre +.sp +In a Windows environment, if you want to statically link the program against a +non-dll \fBpcre.a\fP file, you must uncomment the line that defines PCRE_STATIC +before including \fBpcre.h\fP, because otherwise the \fBpcre_malloc()\fP and +\fBpcre_free()\fP exported functions will be declared +\fB__declspec(dllimport)\fP, with unwanted results. +.P +Once you have compiled and linked the demonstration program, you can run simple +tests like this: +.sp + ./pcredemo 'cat|dog' 'the cat sat on the mat' + ./pcredemo -g 'cat|dog' 'the dog sat on the cat' +.sp +Note that there is a much more comprehensive test program, called +.\" HREF +\fBpcretest\fP, +.\" +which supports many more facilities for testing regular expressions and both +PCRE libraries. The +.\" HREF +\fBpcredemo\fP +.\" +program is provided as a simple coding example. +.P +If you try to run +.\" HREF +\fBpcredemo\fP +.\" +when PCRE is not installed in the standard library directory, you may get an +error like this on some operating systems (e.g. Solaris): +.sp + ld.so.1: a.out: fatal: libpcre.so.0: open failed: No such file or directory +.sp +This is caused by the way shared library support works on those systems. You +need to add +.sp + -R/usr/local/lib +.sp +(for example) to the compile command to get round this problem. +. +. +.SH AUTHOR +.rs +.sp +.nf +Philip Hazel +University Computing Service +Cambridge CB2 3QH, England. +.fi +. +. +.SH REVISION +.rs +.sp +.nf +Last updated: 10 January 2012 +Copyright (c) 1997-2012 University of Cambridge. +.fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrestack.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrestack.3 new file mode 100644 index 0000000000000000000000000000000000000000..798f0bca63e01c99c309dc2161ade9e0d2cdc191 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcrestack.3 @@ -0,0 +1,215 @@ +.TH PCRESTACK 3 "24 June 2012" "PCRE 8.30" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH "PCRE DISCUSSION OF STACK USAGE" +.rs +.sp +When you call \fBpcre[16|32]_exec()\fP, it makes use of an internal function +called \fBmatch()\fP. This calls itself recursively at branch points in the +pattern, in order to remember the state of the match so that it can back up and +try a different alternative if the first one fails. As matching proceeds deeper +and deeper into the tree of possibilities, the recursion depth increases. The +\fBmatch()\fP function is also called in other circumstances, for example, +whenever a parenthesized sub-pattern is entered, and in certain cases of +repetition. +.P +Not all calls of \fBmatch()\fP increase the recursion depth; for an item such +as a* it may be called several times at the same level, after matching +different numbers of a's. Furthermore, in a number of cases where the result of +the recursive call would immediately be passed back as the result of the +current call (a "tail recursion"), the function is just restarted instead. +.P +The above comments apply when \fBpcre[16|32]_exec()\fP is run in its normal +interpretive manner. If the pattern was studied with the +PCRE_STUDY_JIT_COMPILE option, and just-in-time compiling was successful, and +the options passed to \fBpcre[16|32]_exec()\fP were not incompatible, the matching +process uses the JIT-compiled code instead of the \fBmatch()\fP function. In +this case, the memory requirements are handled entirely differently. See the +.\" HREF +\fBpcrejit\fP +.\" +documentation for details. +.P +The \fBpcre[16|32]_dfa_exec()\fP function operates in an entirely different way, +and uses recursion only when there is a regular expression recursion or +subroutine call in the pattern. This includes the processing of assertion and +"once-only" subpatterns, which are handled like subroutine calls. Normally, +these are never very deep, and the limit on the complexity of +\fBpcre[16|32]_dfa_exec()\fP is controlled by the amount of workspace it is given. +However, it is possible to write patterns with runaway infinite recursions; +such patterns will cause \fBpcre[16|32]_dfa_exec()\fP to run out of stack. At +present, there is no protection against this. +.P +The comments that follow do NOT apply to \fBpcre[16|32]_dfa_exec()\fP; they are +relevant only for \fBpcre[16|32]_exec()\fP without the JIT optimization. +. +. +.SS "Reducing \fBpcre[16|32]_exec()\fP's stack usage" +.rs +.sp +Each time that \fBmatch()\fP is actually called recursively, it uses memory +from the process stack. For certain kinds of pattern and data, very large +amounts of stack may be needed, despite the recognition of "tail recursion". +You can often reduce the amount of recursion, and therefore the amount of stack +used, by modifying the pattern that is being matched. Consider, for example, +this pattern: +.sp + ([^<]|<(?!inet))+ +.sp +It matches from wherever it starts until it encounters " +.\" +section on extra data for \fBpcre[16|32]_exec()\fP +.\" +in the +.\" HREF +\fBpcreapi\fP +.\" +documentation. +.P +As a very rough rule of thumb, you should reckon on about 500 bytes per +recursion. Thus, if you want to limit your stack usage to 8Mb, you should set +the limit at 16000 recursions. A 64Mb stack, on the other hand, can support +around 128000 recursions. +.P +In Unix-like environments, the \fBpcretest\fP test program has a command line +option (\fB-S\fP) that can be used to increase the size of its stack. As long +as the stack is large enough, another option (\fB-M\fP) can be used to find the +smallest limits that allow a particular pattern to match a given subject +string. This is done by calling \fBpcre[16|32]_exec()\fP repeatedly with different +limits. +. +. +.SS "Obtaining an estimate of stack usage" +.rs +.sp +The actual amount of stack used per recursion can vary quite a lot, depending +on the compiler that was used to build PCRE and the optimization or debugging +options that were set for it. The rule of thumb value of 500 bytes mentioned +above may be larger or smaller than what is actually needed. A better +approximation can be obtained by running this command: +.sp + pcretest -m -C +.sp +The \fB-C\fP option causes \fBpcretest\fP to output information about the +options with which PCRE was compiled. When \fB-m\fP is also given (before +\fB-C\fP), information about stack use is given in a line like this: +.sp + Match recursion uses stack: approximate frame size = 640 bytes +.sp +The value is approximate because some recursions need a bit more (up to perhaps +16 more bytes). +.P +If the above command is given when PCRE is compiled to use the heap instead of +the stack for recursion, the value that is output is the size of each block +that is obtained from the heap. +. +. +.SS "Changing stack size in Unix-like systems" +.rs +.sp +In Unix-like environments, there is not often a problem with the stack unless +very long strings are involved, though the default limit on stack size varies +from system to system. Values from 8Mb to 64Mb are common. You can find your +default limit by running the command: +.sp + ulimit -s +.sp +Unfortunately, the effect of running out of stack is often SIGSEGV, though +sometimes a more explicit error message is given. You can normally increase the +limit on stack size by code such as this: +.sp + struct rlimit rlim; + getrlimit(RLIMIT_STACK, &rlim); + rlim.rlim_cur = 100*1024*1024; + setrlimit(RLIMIT_STACK, &rlim); +.sp +This reads the current limits (soft and hard) using \fBgetrlimit()\fP, then +attempts to increase the soft limit to 100Mb using \fBsetrlimit()\fP. You must +do this before calling \fBpcre[16|32]_exec()\fP. +. +. +.SS "Changing stack size in Mac OS X" +.rs +.sp +Using \fBsetrlimit()\fP, as described above, should also work on Mac OS X. It +is also possible to set a stack size when linking a program. There is a +discussion about stack sizes in Mac OS X at this web site: +.\" HTML +.\" +http://developer.apple.com/qa/qa2005/qa1419.html. +.\" +. +. +.SH AUTHOR +.rs +.sp +.nf +Philip Hazel +University Computing Service +Cambridge CB2 3QH, England. +.fi +. +. +.SH REVISION +.rs +.sp +.nf +Last updated: 24 June 2012 +Copyright (c) 1997-2012 University of Cambridge. +.fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcresyntax.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcresyntax.3 new file mode 100644 index 0000000000000000000000000000000000000000..b77a8664ed930991b21435d4ba9ad5ddd7430be2 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcresyntax.3 @@ -0,0 +1,540 @@ +.TH PCRESYNTAX 3 "08 January 2014" "PCRE 8.35" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH "PCRE REGULAR EXPRESSION SYNTAX SUMMARY" +.rs +.sp +The full syntax and semantics of the regular expressions that are supported by +PCRE are described in the +.\" HREF +\fBpcrepattern\fP +.\" +documentation. This document contains a quick-reference summary of the syntax. +. +. +.SH "QUOTING" +.rs +.sp + \ex where x is non-alphanumeric is a literal x + \eQ...\eE treat enclosed characters as literal +. +. +.SH "CHARACTERS" +.rs +.sp + \ea alarm, that is, the BEL character (hex 07) + \ecx "control-x", where x is any ASCII character + \ee escape (hex 1B) + \ef form feed (hex 0C) + \en newline (hex 0A) + \er carriage return (hex 0D) + \et tab (hex 09) + \e0dd character with octal code 0dd + \eddd character with octal code ddd, or backreference + \eo{ddd..} character with octal code ddd.. + \exhh character with hex code hh + \ex{hhh..} character with hex code hhh.. +.sp +Note that \e0dd is always an octal code, and that \e8 and \e9 are the literal +characters "8" and "9". +. +. +.SH "CHARACTER TYPES" +.rs +.sp + . any character except newline; + in dotall mode, any character whatsoever + \eC one data unit, even in UTF mode (best avoided) + \ed a decimal digit + \eD a character that is not a decimal digit + \eh a horizontal white space character + \eH a character that is not a horizontal white space character + \eN a character that is not a newline + \ep{\fIxx\fP} a character with the \fIxx\fP property + \eP{\fIxx\fP} a character without the \fIxx\fP property + \eR a newline sequence + \es a white space character + \eS a character that is not a white space character + \ev a vertical white space character + \eV a character that is not a vertical white space character + \ew a "word" character + \eW a "non-word" character + \eX a Unicode extended grapheme cluster +.sp +By default, \ed, \es, and \ew match only ASCII characters, even in UTF-8 mode +or in the 16- bit and 32-bit libraries. However, if locale-specific matching is +happening, \es and \ew may also match characters with code points in the range +128-255. If the PCRE_UCP option is set, the behaviour of these escape sequences +is changed to use Unicode properties and they match many more characters. +. +. +.SH "GENERAL CATEGORY PROPERTIES FOR \ep and \eP" +.rs +.sp + C Other + Cc Control + Cf Format + Cn Unassigned + Co Private use + Cs Surrogate +.sp + L Letter + Ll Lower case letter + Lm Modifier letter + Lo Other letter + Lt Title case letter + Lu Upper case letter + L& Ll, Lu, or Lt +.sp + M Mark + Mc Spacing mark + Me Enclosing mark + Mn Non-spacing mark +.sp + N Number + Nd Decimal number + Nl Letter number + No Other number +.sp + P Punctuation + Pc Connector punctuation + Pd Dash punctuation + Pe Close punctuation + Pf Final punctuation + Pi Initial punctuation + Po Other punctuation + Ps Open punctuation +.sp + S Symbol + Sc Currency symbol + Sk Modifier symbol + Sm Mathematical symbol + So Other symbol +.sp + Z Separator + Zl Line separator + Zp Paragraph separator + Zs Space separator +. +. +.SH "PCRE SPECIAL CATEGORY PROPERTIES FOR \ep and \eP" +.rs +.sp + Xan Alphanumeric: union of properties L and N + Xps POSIX space: property Z or tab, NL, VT, FF, CR + Xsp Perl space: property Z or tab, NL, VT, FF, CR + Xuc Universally-named character: one that can be + represented by a Universal Character Name + Xwd Perl word: property Xan or underscore +.sp +Perl and POSIX space are now the same. Perl added VT to its space character set +at release 5.18 and PCRE changed at release 8.34. +. +. +.SH "SCRIPT NAMES FOR \ep AND \eP" +.rs +.sp +Arabic, +Armenian, +Avestan, +Balinese, +Bamum, +Bassa_Vah, +Batak, +Bengali, +Bopomofo, +Brahmi, +Braille, +Buginese, +Buhid, +Canadian_Aboriginal, +Carian, +Caucasian_Albanian, +Chakma, +Cham, +Cherokee, +Common, +Coptic, +Cuneiform, +Cypriot, +Cyrillic, +Deseret, +Devanagari, +Duployan, +Egyptian_Hieroglyphs, +Elbasan, +Ethiopic, +Georgian, +Glagolitic, +Gothic, +Grantha, +Greek, +Gujarati, +Gurmukhi, +Han, +Hangul, +Hanunoo, +Hebrew, +Hiragana, +Imperial_Aramaic, +Inherited, +Inscriptional_Pahlavi, +Inscriptional_Parthian, +Javanese, +Kaithi, +Kannada, +Katakana, +Kayah_Li, +Kharoshthi, +Khmer, +Khojki, +Khudawadi, +Lao, +Latin, +Lepcha, +Limbu, +Linear_A, +Linear_B, +Lisu, +Lycian, +Lydian, +Mahajani, +Malayalam, +Mandaic, +Manichaean, +Meetei_Mayek, +Mende_Kikakui, +Meroitic_Cursive, +Meroitic_Hieroglyphs, +Miao, +Modi, +Mongolian, +Mro, +Myanmar, +Nabataean, +New_Tai_Lue, +Nko, +Ogham, +Ol_Chiki, +Old_Italic, +Old_North_Arabian, +Old_Permic, +Old_Persian, +Old_South_Arabian, +Old_Turkic, +Oriya, +Osmanya, +Pahawh_Hmong, +Palmyrene, +Pau_Cin_Hau, +Phags_Pa, +Phoenician, +Psalter_Pahlavi, +Rejang, +Runic, +Samaritan, +Saurashtra, +Sharada, +Shavian, +Siddham, +Sinhala, +Sora_Sompeng, +Sundanese, +Syloti_Nagri, +Syriac, +Tagalog, +Tagbanwa, +Tai_Le, +Tai_Tham, +Tai_Viet, +Takri, +Tamil, +Telugu, +Thaana, +Thai, +Tibetan, +Tifinagh, +Tirhuta, +Ugaritic, +Vai, +Warang_Citi, +Yi. +. +. +.SH "CHARACTER CLASSES" +.rs +.sp + [...] positive character class + [^...] negative character class + [x-y] range (can be used for hex characters) + [[:xxx:]] positive POSIX named set + [[:^xxx:]] negative POSIX named set +.sp + alnum alphanumeric + alpha alphabetic + ascii 0-127 + blank space or tab + cntrl control character + digit decimal digit + graph printing, excluding space + lower lower case letter + print printing, including space + punct printing, excluding alphanumeric + space white space + upper upper case letter + word same as \ew + xdigit hexadecimal digit +.sp +In PCRE, POSIX character set names recognize only ASCII characters by default, +but some of them use Unicode properties if PCRE_UCP is set. You can use +\eQ...\eE inside a character class. +. +. +.SH "QUANTIFIERS" +.rs +.sp + ? 0 or 1, greedy + ?+ 0 or 1, possessive + ?? 0 or 1, lazy + * 0 or more, greedy + *+ 0 or more, possessive + *? 0 or more, lazy + + 1 or more, greedy + ++ 1 or more, possessive + +? 1 or more, lazy + {n} exactly n + {n,m} at least n, no more than m, greedy + {n,m}+ at least n, no more than m, possessive + {n,m}? at least n, no more than m, lazy + {n,} n or more, greedy + {n,}+ n or more, possessive + {n,}? n or more, lazy +. +. +.SH "ANCHORS AND SIMPLE ASSERTIONS" +.rs +.sp + \eb word boundary + \eB not a word boundary + ^ start of subject + also after internal newline in multiline mode + \eA start of subject + $ end of subject + also before newline at end of subject + also before internal newline in multiline mode + \eZ end of subject + also before newline at end of subject + \ez end of subject + \eG first matching position in subject +. +. +.SH "MATCH POINT RESET" +.rs +.sp + \eK reset start of match +.sp +\eK is honoured in positive assertions, but ignored in negative ones. +. +. +.SH "ALTERNATION" +.rs +.sp + expr|expr|expr... +. +. +.SH "CAPTURING" +.rs +.sp + (...) capturing group + (?...) named capturing group (Perl) + (?'name'...) named capturing group (Perl) + (?P...) named capturing group (Python) + (?:...) non-capturing group + (?|...) non-capturing group; reset group numbers for + capturing groups in each alternative +. +. +.SH "ATOMIC GROUPS" +.rs +.sp + (?>...) atomic, non-capturing group +. +. +. +. +.SH "COMMENT" +.rs +.sp + (?#....) comment (not nestable) +. +. +.SH "OPTION SETTING" +.rs +.sp + (?i) caseless + (?J) allow duplicate names + (?m) multiline + (?s) single line (dotall) + (?U) default ungreedy (lazy) + (?x) extended (ignore white space) + (?-...) unset option(s) +.sp +The following are recognized only at the very start of a pattern or after one +of the newline or \eR options with similar syntax. More than one of them may +appear. +.sp + (*LIMIT_MATCH=d) set the match limit to d (decimal number) + (*LIMIT_RECURSION=d) set the recursion limit to d (decimal number) + (*NO_AUTO_POSSESS) no auto-possessification (PCRE_NO_AUTO_POSSESS) + (*NO_START_OPT) no start-match optimization (PCRE_NO_START_OPTIMIZE) + (*UTF8) set UTF-8 mode: 8-bit library (PCRE_UTF8) + (*UTF16) set UTF-16 mode: 16-bit library (PCRE_UTF16) + (*UTF32) set UTF-32 mode: 32-bit library (PCRE_UTF32) + (*UTF) set appropriate UTF mode for the library in use + (*UCP) set PCRE_UCP (use Unicode properties for \ed etc) +.sp +Note that LIMIT_MATCH and LIMIT_RECURSION can only reduce the value of the +limits set by the caller of pcre_exec(), not increase them. +. +. +.SH "NEWLINE CONVENTION" +.rs +.sp +These are recognized only at the very start of the pattern or after option +settings with a similar syntax. +.sp + (*CR) carriage return only + (*LF) linefeed only + (*CRLF) carriage return followed by linefeed + (*ANYCRLF) all three of the above + (*ANY) any Unicode newline sequence +. +. +.SH "WHAT \eR MATCHES" +.rs +.sp +These are recognized only at the very start of the pattern or after option +setting with a similar syntax. +.sp + (*BSR_ANYCRLF) CR, LF, or CRLF + (*BSR_UNICODE) any Unicode newline sequence +. +. +.SH "LOOKAHEAD AND LOOKBEHIND ASSERTIONS" +.rs +.sp + (?=...) positive look ahead + (?!...) negative look ahead + (?<=...) positive look behind + (? reference by name (Perl) + \ek'name' reference by name (Perl) + \eg{name} reference by name (Perl) + \ek{name} reference by name (.NET) + (?P=name) reference by name (Python) +. +. +.SH "SUBROUTINE REFERENCES (POSSIBLY RECURSIVE)" +.rs +.sp + (?R) recurse whole pattern + (?n) call subpattern by absolute number + (?+n) call subpattern by relative number + (?-n) call subpattern by relative number + (?&name) call subpattern by name (Perl) + (?P>name) call subpattern by name (Python) + \eg call subpattern by name (Oniguruma) + \eg'name' call subpattern by name (Oniguruma) + \eg call subpattern by absolute number (Oniguruma) + \eg'n' call subpattern by absolute number (Oniguruma) + \eg<+n> call subpattern by relative number (PCRE extension) + \eg'+n' call subpattern by relative number (PCRE extension) + \eg<-n> call subpattern by relative number (PCRE extension) + \eg'-n' call subpattern by relative number (PCRE extension) +. +. +.SH "CONDITIONAL PATTERNS" +.rs +.sp + (?(condition)yes-pattern) + (?(condition)yes-pattern|no-pattern) +.sp + (?(n)... absolute reference condition + (?(+n)... relative reference condition + (?(-n)... relative reference condition + (?()... named reference condition (Perl) + (?('name')... named reference condition (Perl) + (?(name)... named reference condition (PCRE) + (?(R)... overall recursion condition + (?(Rn)... specific group recursion condition + (?(R&name)... specific recursion condition + (?(DEFINE)... define subpattern for reference + (?(assert)... assertion condition +. +. +.SH "BACKTRACKING CONTROL" +.rs +.sp +The following act immediately they are reached: +.sp + (*ACCEPT) force successful match + (*FAIL) force backtrack; synonym (*F) + (*MARK:NAME) set name to be passed back; synonym (*:NAME) +.sp +The following act only when a subsequent match failure causes a backtrack to +reach them. They all force a match failure, but they differ in what happens +afterwards. Those that advance the start-of-match point do so only if the +pattern is not anchored. +.sp + (*COMMIT) overall failure, no advance of starting point + (*PRUNE) advance to next starting character + (*PRUNE:NAME) equivalent to (*MARK:NAME)(*PRUNE) + (*SKIP) advance to current matching position + (*SKIP:NAME) advance to position corresponding to an earlier + (*MARK:NAME); if not found, the (*SKIP) is ignored + (*THEN) local failure, backtrack to next alternation + (*THEN:NAME) equivalent to (*MARK:NAME)(*THEN) +. +. +.SH "CALLOUTS" +.rs +.sp + (?C) callout + (?Cn) callout with data n +. +. +.SH "SEE ALSO" +.rs +.sp +\fBpcrepattern\fP(3), \fBpcreapi\fP(3), \fBpcrecallout\fP(3), +\fBpcrematching\fP(3), \fBpcre\fP(3). +. +. +.SH AUTHOR +.rs +.sp +.nf +Philip Hazel +University Computing Service +Cambridge CB2 3QH, England. +.fi +. +. +.SH REVISION +.rs +.sp +.nf +Last updated: 08 January 2014 +Copyright (c) 1997-2014 University of Cambridge. +.fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcreunicode.3 b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcreunicode.3 new file mode 100644 index 0000000000000000000000000000000000000000..cb5e5269a41aeab160fae60d2e9e73498e48dc0a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/man/man3/pcreunicode.3 @@ -0,0 +1,249 @@ +.TH PCREUNICODE 3 "27 February 2013" "PCRE 8.33" +.SH NAME +PCRE - Perl-compatible regular expressions +.SH "UTF-8, UTF-16, UTF-32, AND UNICODE PROPERTY SUPPORT" +.rs +.sp +As well as UTF-8 support, PCRE also supports UTF-16 (from release 8.30) and +UTF-32 (from release 8.32), by means of two additional libraries. They can be +built as well as, or instead of, the 8-bit library. +. +. +.SH "UTF-8 SUPPORT" +.rs +.sp +In order process UTF-8 strings, you must build PCRE's 8-bit library with UTF +support, and, in addition, you must call +.\" HREF +\fBpcre_compile()\fP +.\" +with the PCRE_UTF8 option flag, or the pattern must start with the sequence +(*UTF8) or (*UTF). When either of these is the case, both the pattern and any +subject strings that are matched against it are treated as UTF-8 strings +instead of strings of individual 1-byte characters. +. +. +.SH "UTF-16 AND UTF-32 SUPPORT" +.rs +.sp +In order process UTF-16 or UTF-32 strings, you must build PCRE's 16-bit or +32-bit library with UTF support, and, in addition, you must call +.\" HREF +\fBpcre16_compile()\fP +.\" +or +.\" HREF +\fBpcre32_compile()\fP +.\" +with the PCRE_UTF16 or PCRE_UTF32 option flag, as appropriate. Alternatively, +the pattern must start with the sequence (*UTF16), (*UTF32), as appropriate, or +(*UTF), which can be used with either library. When UTF mode is set, both the +pattern and any subject strings that are matched against it are treated as +UTF-16 or UTF-32 strings instead of strings of individual 16-bit or 32-bit +characters. +. +. +.SH "UTF SUPPORT OVERHEAD" +.rs +.sp +If you compile PCRE with UTF support, but do not use it at run time, the +library will be a bit bigger, but the additional run time overhead is limited +to testing the PCRE_UTF[8|16|32] flag occasionally, so should not be very big. +. +. +.SH "UNICODE PROPERTY SUPPORT" +.rs +.sp +If PCRE is built with Unicode character property support (which implies UTF +support), the escape sequences \ep{..}, \eP{..}, and \eX can be used. +The available properties that can be tested are limited to the general +category properties such as Lu for an upper case letter or Nd for a decimal +number, the Unicode script names such as Arabic or Han, and the derived +properties Any and L&. Full lists is given in the +.\" HREF +\fBpcrepattern\fP +.\" +and +.\" HREF +\fBpcresyntax\fP +.\" +documentation. Only the short names for properties are supported. For example, +\ep{L} matches a letter. Its Perl synonym, \ep{Letter}, is not supported. +Furthermore, in Perl, many properties may optionally be prefixed by "Is", for +compatibility with Perl 5.6. PCRE does not support this. +. +. +.\" HTML +.SS "Validity of UTF-8 strings" +.rs +.sp +When you set the PCRE_UTF8 flag, the byte strings passed as patterns and +subjects are (by default) checked for validity on entry to the relevant +functions. The entire string is checked before any other processing takes +place. From release 7.3 of PCRE, the check is according the rules of RFC 3629, +which are themselves derived from the Unicode specification. Earlier releases +of PCRE followed the rules of RFC 2279, which allows the full range of 31-bit +values (0 to 0x7FFFFFFF). The current check allows only values in the range U+0 +to U+10FFFF, excluding the surrogate area. (From release 8.33 the so-called +"non-character" code points are no longer excluded because Unicode corrigendum +#9 makes it clear that they should not be.) +.P +Characters in the "Surrogate Area" of Unicode are reserved for use by UTF-16, +where they are used in pairs to encode codepoints with values greater than +0xFFFF. The code points that are encoded by UTF-16 pairs are available +independently in the UTF-8 and UTF-32 encodings. (In other words, the whole +surrogate thing is a fudge for UTF-16 which unfortunately messes up UTF-8 and +UTF-32.) +.P +If an invalid UTF-8 string is passed to PCRE, an error return is given. At +compile time, the only additional information is the offset to the first byte +of the failing character. The run-time functions \fBpcre_exec()\fP and +\fBpcre_dfa_exec()\fP also pass back this information, as well as a more +detailed reason code if the caller has provided memory in which to do this. +.P +In some situations, you may already know that your strings are valid, and +therefore want to skip these checks in order to improve performance, for +example in the case of a long subject string that is being scanned repeatedly. +If you set the PCRE_NO_UTF8_CHECK flag at compile time or at run time, PCRE +assumes that the pattern or subject it is given (respectively) contains only +valid UTF-8 codes. In this case, it does not diagnose an invalid UTF-8 string. +.P +Note that passing PCRE_NO_UTF8_CHECK to \fBpcre_compile()\fP just disables the +check for the pattern; it does not also apply to subject strings. If you want +to disable the check for a subject string you must pass this option to +\fBpcre_exec()\fP or \fBpcre_dfa_exec()\fP. +.P +If you pass an invalid UTF-8 string when PCRE_NO_UTF8_CHECK is set, the result +is undefined and your program may crash. +. +. +.\" HTML +.SS "Validity of UTF-16 strings" +.rs +.sp +When you set the PCRE_UTF16 flag, the strings of 16-bit data units that are +passed as patterns and subjects are (by default) checked for validity on entry +to the relevant functions. Values other than those in the surrogate range +U+D800 to U+DFFF are independent code points. Values in the surrogate range +must be used in pairs in the correct manner. +.P +If an invalid UTF-16 string is passed to PCRE, an error return is given. At +compile time, the only additional information is the offset to the first data +unit of the failing character. The run-time functions \fBpcre16_exec()\fP and +\fBpcre16_dfa_exec()\fP also pass back this information, as well as a more +detailed reason code if the caller has provided memory in which to do this. +.P +In some situations, you may already know that your strings are valid, and +therefore want to skip these checks in order to improve performance. If you set +the PCRE_NO_UTF16_CHECK flag at compile time or at run time, PCRE assumes that +the pattern or subject it is given (respectively) contains only valid UTF-16 +sequences. In this case, it does not diagnose an invalid UTF-16 string. +However, if an invalid string is passed, the result is undefined. +. +. +.\" HTML +.SS "Validity of UTF-32 strings" +.rs +.sp +When you set the PCRE_UTF32 flag, the strings of 32-bit data units that are +passed as patterns and subjects are (by default) checked for validity on entry +to the relevant functions. This check allows only values in the range U+0 +to U+10FFFF, excluding the surrogate area U+D800 to U+DFFF. +.P +If an invalid UTF-32 string is passed to PCRE, an error return is given. At +compile time, the only additional information is the offset to the first data +unit of the failing character. The run-time functions \fBpcre32_exec()\fP and +\fBpcre32_dfa_exec()\fP also pass back this information, as well as a more +detailed reason code if the caller has provided memory in which to do this. +.P +In some situations, you may already know that your strings are valid, and +therefore want to skip these checks in order to improve performance. If you set +the PCRE_NO_UTF32_CHECK flag at compile time or at run time, PCRE assumes that +the pattern or subject it is given (respectively) contains only valid UTF-32 +sequences. In this case, it does not diagnose an invalid UTF-32 string. +However, if an invalid string is passed, the result is undefined. +. +. +.SS "General comments about UTF modes" +.rs +.sp +1. Codepoints less than 256 can be specified in patterns by either braced or +unbraced hexadecimal escape sequences (for example, \ex{b3} or \exb3). Larger +values have to use braced sequences. +.P +2. Octal numbers up to \e777 are recognized, and in UTF-8 mode they match +two-byte characters for values greater than \e177. +.P +3. Repeat quantifiers apply to complete UTF characters, not to individual +data units, for example: \ex{100}{3}. +.P +4. The dot metacharacter matches one UTF character instead of a single data +unit. +.P +5. The escape sequence \eC can be used to match a single byte in UTF-8 mode, or +a single 16-bit data unit in UTF-16 mode, or a single 32-bit data unit in +UTF-32 mode, but its use can lead to some strange effects because it breaks up +multi-unit characters (see the description of \eC in the +.\" HREF +\fBpcrepattern\fP +.\" +documentation). The use of \eC is not supported in the alternative matching +function \fBpcre[16|32]_dfa_exec()\fP, nor is it supported in UTF mode by the +JIT optimization of \fBpcre[16|32]_exec()\fP. If JIT optimization is requested +for a UTF pattern that contains \eC, it will not succeed, and so the matching +will be carried out by the normal interpretive function. +.P +6. The character escapes \eb, \eB, \ed, \eD, \es, \eS, \ew, and \eW correctly +test characters of any code value, but, by default, the characters that PCRE +recognizes as digits, spaces, or word characters remain the same set as in +non-UTF mode, all with values less than 256. This remains true even when PCRE +is built to include Unicode property support, because to do otherwise would +slow down PCRE in many common cases. Note in particular that this applies to +\eb and \eB, because they are defined in terms of \ew and \eW. If you really +want to test for a wider sense of, say, "digit", you can use explicit Unicode +property tests such as \ep{Nd}. Alternatively, if you set the PCRE_UCP option, +the way that the character escapes work is changed so that Unicode properties +are used to determine which characters match. There are more details in the +section on +.\" HTML +.\" +generic character types +.\" +in the +.\" HREF +\fBpcrepattern\fP +.\" +documentation. +.P +7. Similarly, characters that match the POSIX named character classes are all +low-valued characters, unless the PCRE_UCP option is set. +.P +8. However, the horizontal and vertical white space matching escapes (\eh, \eH, +\ev, and \eV) do match all the appropriate Unicode characters, whether or not +PCRE_UCP is set. +.P +9. Case-insensitive matching applies only to characters whose values are less +than 128, unless PCRE is built with Unicode property support. A few Unicode +characters such as Greek sigma have more than two codepoints that are +case-equivalent. Up to and including PCRE release 8.31, only one-to-one case +mappings were supported, but later releases (with Unicode property support) do +treat as case-equivalent all versions of characters such as Greek sigma. +. +. +.SH AUTHOR +.rs +.sp +.nf +Philip Hazel +University Computing Service +Cambridge CB2 3QH, England. +.fi +. +. +.SH REVISION +.rs +.sp +.nf +Last updated: 27 February 2013 +Copyright (c) 1997-2013 University of Cambridge. +.fi diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/index.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/index.html new file mode 100644 index 0000000000000000000000000000000000000000..352c55df2f1a7c66b15be13ecac5bca586199c3d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/index.html @@ -0,0 +1,185 @@ + + + +PCRE specification + + +

Perl-compatible Regular Expressions (PCRE)

+

+The HTML documentation for PCRE consists of a number of pages that are listed +below in alphabetical order. If you are new to PCRE, please read the first one +first. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
pcre  Introductory page
pcre-config  Information about the installation configuration
pcre16  Discussion of the 16-bit PCRE library
pcre32  Discussion of the 32-bit PCRE library
pcreapi  PCRE's native API
pcrebuild  Building PCRE
pcrecallout  The callout facility
pcrecompat  Compability with Perl
pcrecpp  The C++ wrapper for the PCRE library
pcredemo  A demonstration C program that uses the PCRE library
pcregrep  The pcregrep command
pcrejit  Discussion of the just-in-time optimization support
pcrelimits  Details of size and other limits
pcrematching  Discussion of the two matching algorithms
pcrepartial  Using PCRE for partial matching
pcrepattern  Specification of the regular expressions supported by PCRE
pcreperform  Some comments on performance
pcreposix  The POSIX API to the PCRE 8-bit library
pcreprecompile  How to save and re-use compiled patterns
pcresample  Discussion of the pcredemo program
pcrestack  Discussion of PCRE's stack usage
pcresyntax  Syntax quick-reference summary
pcretest  The pcretest command for testing PCRE
pcreunicode  Discussion of Unicode and UTF-8/UTF-16/UTF-32 support
+ +

+There are also individual pages that summarize the interface for each function +in the library. There is a single page for each triple of 8-bit/16-bit/32-bit +functions. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
pcre_assign_jit_stack  Assign stack for JIT matching
pcre_compile  Compile a regular expression
pcre_compile2  Compile a regular expression (alternate interface)
pcre_config  Show build-time configuration options
pcre_copy_named_substring  Extract named substring into given buffer
pcre_copy_substring  Extract numbered substring into given buffer
pcre_dfa_exec  Match a compiled pattern to a subject string + (DFA algorithm; not Perl compatible)
pcre_exec  Match a compiled pattern to a subject string + (Perl compatible)
pcre_free_study  Free study data
pcre_free_substring  Free extracted substring
pcre_free_substring_list  Free list of extracted substrings
pcre_fullinfo  Extract information about a pattern
pcre_get_named_substring  Extract named substring into new memory
pcre_get_stringnumber  Convert captured string name to number
pcre_get_stringtable_entries  Find table entries for given string name
pcre_get_substring  Extract numbered substring into new memory
pcre_get_substring_list  Extract all substrings into new memory
pcre_jit_exec  Fast path interface to JIT matching
pcre_jit_stack_alloc  Create a stack for JIT matching
pcre_jit_stack_free  Free a JIT matching stack
pcre_maketables  Build character tables in current locale
pcre_pattern_to_host_byte_order  Convert compiled pattern to host byte order if necessary
pcre_refcount  Maintain reference count in compiled pattern
pcre_study  Study a compiled pattern
pcre_utf16_to_host_byte_order  Convert UTF-16 string to host byte order if necessary
pcre_utf32_to_host_byte_order  Convert UTF-32 string to host byte order if necessary
pcre_version  Return PCRE version and release date
+ + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre-config.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre-config.html new file mode 100644 index 0000000000000000000000000000000000000000..56a80604920c67324e4a68c5572a2a0879ee0ec2 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre-config.html @@ -0,0 +1,109 @@ + + +pcre-config specification + + +

pcre-config man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+

+
SYNOPSIS
+

+pcre-config [--prefix] [--exec-prefix] [--version] [--libs] + [--libs16] [--libs32] [--libs-cpp] [--libs-posix] + [--cflags] [--cflags-posix] +

+
DESCRIPTION
+

+pcre-config returns the configuration of the installed PCRE +libraries and the options required to compile a program to use them. Some of +the options apply only to the 8-bit, or 16-bit, or 32-bit libraries, +respectively, and are +not available if only one of those libraries has been built. If an unavailable +option is encountered, the "usage" information is output. +

+
OPTIONS
+

+--prefix +Writes the directory prefix used in the PCRE installation for architecture +independent files (/usr on many systems, /usr/local on some +systems) to the standard output. +

+

+--exec-prefix +Writes the directory prefix used in the PCRE installation for architecture +dependent files (normally the same as --prefix) to the standard output. +

+

+--version +Writes the version number of the installed PCRE libraries to the standard +output. +

+

+--libs +Writes to the standard output the command line options required to link +with the 8-bit PCRE library (-lpcre on many systems). +

+

+--libs16 +Writes to the standard output the command line options required to link +with the 16-bit PCRE library (-lpcre16 on many systems). +

+

+--libs32 +Writes to the standard output the command line options required to link +with the 32-bit PCRE library (-lpcre32 on many systems). +

+

+--libs-cpp +Writes to the standard output the command line options required to link with +PCRE's C++ wrapper library (-lpcrecpp -lpcre on many +systems). +

+

+--libs-posix +Writes to the standard output the command line options required to link with +PCRE's POSIX API wrapper library (-lpcreposix -lpcre on many +systems). +

+

+--cflags +Writes to the standard output the command line options required to compile +files that use PCRE (this may include some -I options, but is blank on +many systems). +

+

+--cflags-posix +Writes to the standard output the command line options required to compile +files that use PCRE's POSIX API wrapper library (this may include some -I +options, but is blank on many systems). +

+
SEE ALSO
+

+pcre(3) +

+
AUTHOR
+

+This manual page was originally written by Mark Baker for the Debian GNU/Linux +system. It has been subsequently revised as a generic PCRE man page. +

+
REVISION
+

+Last updated: 24 June 2012 +
+

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre.html new file mode 100644 index 0000000000000000000000000000000000000000..31391f5c00a1f6fc4fa2ee5a7a9a61364692862b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre.html @@ -0,0 +1,223 @@ + + +pcre specification + + +

pcre man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+

+
PLEASE TAKE NOTE
+

+This document relates to PCRE releases that use the original API, with library +names libpcre, libpcre16, and libpcre32. January 2015 saw the first release of +a new API, known as PCRE2, with release numbers starting at 10.00 and library +names libpcre2-8, libpcre2-16, and libpcre2-32. The old libraries (now called +PCRE1) are now at end of life, and 8.45 is the final release. New projects are +advised to use the new PCRE2 libraries. +

+
INTRODUCTION
+

+The PCRE library is a set of functions that implement regular expression +pattern matching using the same syntax and semantics as Perl, with just a few +differences. Some features that appeared in Python and PCRE before they +appeared in Perl are also available using the Python syntax, there is some +support for one or two .NET and Oniguruma syntax items, and there is an option +for requesting some minor changes that give better JavaScript compatibility. +

+

+Starting with release 8.30, it is possible to compile two separate PCRE +libraries: the original, which supports 8-bit character strings (including +UTF-8 strings), and a second library that supports 16-bit character strings +(including UTF-16 strings). The build process allows either one or both to be +built. The majority of the work to make this possible was done by Zoltan +Herczeg. +

+

+Starting with release 8.32 it is possible to compile a third separate PCRE +library that supports 32-bit character strings (including UTF-32 strings). The +build process allows any combination of the 8-, 16- and 32-bit libraries. The +work to make this possible was done by Christian Persch. +

+

+The three libraries contain identical sets of functions, except that the names +in the 16-bit library start with pcre16_ instead of pcre_, and the +names in the 32-bit library start with pcre32_ instead of pcre_. To +avoid over-complication and reduce the documentation maintenance load, most of +the documentation describes the 8-bit library, with the differences for the +16-bit and 32-bit libraries described separately in the +pcre16 +and +pcre32 +pages. References to functions or structures of the form pcre[16|32]_xxx +should be read as meaning "pcre_xxx when using the 8-bit library, +pcre16_xxx when using the 16-bit library, or pcre32_xxx when using +the 32-bit library". +

+

+The current implementation of PCRE corresponds approximately with Perl 5.12, +including support for UTF-8/16/32 encoded strings and Unicode general category +properties. However, UTF-8/16/32 and Unicode support has to be explicitly +enabled; it is not the default. The Unicode tables correspond to Unicode +release 6.3.0. +

+

+In addition to the Perl-compatible matching function, PCRE contains an +alternative function that matches the same compiled patterns in a different +way. In certain circumstances, the alternative function has some advantages. +For a discussion of the two matching algorithms, see the +pcrematching +page. +

+

+PCRE is written in C and released as a C library. A number of people have +written wrappers and interfaces of various kinds. In particular, Google Inc. +have provided a comprehensive C++ wrapper for the 8-bit library. This is now +included as part of the PCRE distribution. The +pcrecpp +page has details of this interface. Other people's contributions can be found +in the Contrib directory at the primary FTP site, which is: +ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre +

+

+Details of exactly which Perl regular expression features are and are not +supported by PCRE are given in separate documents. See the +pcrepattern +and +pcrecompat +pages. There is a syntax summary in the +pcresyntax +page. +

+

+Some features of PCRE can be included, excluded, or changed when the library is +built. The +pcre_config() +function makes it possible for a client to discover which features are +available. The features themselves are described in the +pcrebuild +page. Documentation about building PCRE for various operating systems can be +found in the +README +and +NON-AUTOTOOLS_BUILD +files in the source distribution. +

+

+The libraries contains a number of undocumented internal functions and data +tables that are used by more than one of the exported external functions, but +which are not intended for use by external callers. Their names all begin with +"_pcre_" or "_pcre16_" or "_pcre32_", which hopefully will not provoke any name +clashes. In some environments, it is possible to control which external symbols +are exported when a shared library is built, and in these cases the +undocumented symbols are not exported. +

+
SECURITY CONSIDERATIONS
+

+If you are using PCRE in a non-UTF application that permits users to supply +arbitrary patterns for compilation, you should be aware of a feature that +allows users to turn on UTF support from within a pattern, provided that PCRE +was built with UTF support. For example, an 8-bit pattern that begins with +"(*UTF8)" or "(*UTF)" turns on UTF-8 mode, which interprets patterns and +subjects as strings of UTF-8 characters instead of individual 8-bit characters. +This causes both the pattern and any data against which it is matched to be +checked for UTF-8 validity. If the data string is very long, such a check might +use sufficiently many resources as to cause your application to lose +performance. +

+

+One way of guarding against this possibility is to use the +pcre_fullinfo() function to check the compiled pattern's options for UTF. +Alternatively, from release 8.33, you can set the PCRE_NEVER_UTF option at +compile time. This causes a compile time error if a pattern contains a +UTF-setting sequence. +

+

+If your application is one that supports UTF, be aware that validity checking +can take time. If the same data string is to be matched many times, you can use +the PCRE_NO_UTF[8|16|32]_CHECK option for the second and subsequent matches to +save redundant checks. +

+

+Another way that performance can be hit is by running a pattern that has a very +large search tree against a string that will never match. Nested unlimited +repeats in a pattern are a common example. PCRE provides some protection +against this: see the PCRE_EXTRA_MATCH_LIMIT feature in the +pcreapi +page. +

+
USER DOCUMENTATION
+

+The user documentation for PCRE comprises a number of different sections. In +the "man" format, each of these is a separate "man page". In the HTML format, +each is a separate page, linked from the index page. In the plain text format, +the descriptions of the pcregrep and pcretest programs are in files +called pcregrep.txt and pcretest.txt, respectively. The remaining +sections, except for the pcredemo section (which is a program listing), +are concatenated in pcre.txt, for ease of searching. The sections are as +follows: +

+  pcre              this document
+  pcre-config       show PCRE installation configuration information
+  pcre16            details of the 16-bit library
+  pcre32            details of the 32-bit library
+  pcreapi           details of PCRE's native C API
+  pcrebuild         building PCRE
+  pcrecallout       details of the callout feature
+  pcrecompat        discussion of Perl compatibility
+  pcrecpp           details of the C++ wrapper for the 8-bit library
+  pcredemo          a demonstration C program that uses PCRE
+  pcregrep          description of the pcregrep command (8-bit only)
+  pcrejit           discussion of the just-in-time optimization support
+  pcrelimits        details of size and other limits
+  pcrematching      discussion of the two matching algorithms
+  pcrepartial       details of the partial matching facility
+  pcrepattern       syntax and semantics of supported regular expressions
+  pcreperform       discussion of performance issues
+  pcreposix         the POSIX-compatible C API for the 8-bit library
+  pcreprecompile    details of saving and re-using precompiled patterns
+  pcresample        discussion of the pcredemo program
+  pcrestack         discussion of stack usage
+  pcresyntax        quick syntax reference
+  pcretest          description of the pcretest testing command
+  pcreunicode       discussion of Unicode and UTF-8/16/32 support
+
+In the "man" and HTML formats, there is also a short page for each C library +function, listing its arguments and results. +

+
AUTHOR
+

+Philip Hazel +
+University Computing Service +
+Cambridge CB2 3QH, England. +
+

+

+Putting an actual email address here seems to have been a spam magnet, so I've +taken it away. If you want to email me, use my two initials, followed by the +two digits 10, at the domain cam.ac.uk. +

+
REVISION
+

+Last updated: 14 June 2021 +
+Copyright © 1997-2021 University of Cambridge. +
+

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre16.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre16.html new file mode 100644 index 0000000000000000000000000000000000000000..f00859f052361c259c99c725eb58050226c1496a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre16.html @@ -0,0 +1,384 @@ + + +pcre16 specification + + +

pcre16 man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+

+

+#include <pcre.h> +

+
PCRE 16-BIT API BASIC FUNCTIONS
+

+pcre16 *pcre16_compile(PCRE_SPTR16 pattern, int options, + const char **errptr, int *erroffset, + const unsigned char *tableptr); +
+
+pcre16 *pcre16_compile2(PCRE_SPTR16 pattern, int options, + int *errorcodeptr, + const char **errptr, int *erroffset, + const unsigned char *tableptr); +
+
+pcre16_extra *pcre16_study(const pcre16 *code, int options, + const char **errptr); +
+
+void pcre16_free_study(pcre16_extra *extra); +
+
+int pcre16_exec(const pcre16 *code, const pcre16_extra *extra, + PCRE_SPTR16 subject, int length, int startoffset, + int options, int *ovector, int ovecsize); +
+
+int pcre16_dfa_exec(const pcre16 *code, const pcre16_extra *extra, + PCRE_SPTR16 subject, int length, int startoffset, + int options, int *ovector, int ovecsize, + int *workspace, int wscount); +

+
PCRE 16-BIT API STRING EXTRACTION FUNCTIONS
+

+int pcre16_copy_named_substring(const pcre16 *code, + PCRE_SPTR16 subject, int *ovector, + int stringcount, PCRE_SPTR16 stringname, + PCRE_UCHAR16 *buffer, int buffersize); +
+
+int pcre16_copy_substring(PCRE_SPTR16 subject, int *ovector, + int stringcount, int stringnumber, PCRE_UCHAR16 *buffer, + int buffersize); +
+
+int pcre16_get_named_substring(const pcre16 *code, + PCRE_SPTR16 subject, int *ovector, + int stringcount, PCRE_SPTR16 stringname, + PCRE_SPTR16 *stringptr); +
+
+int pcre16_get_stringnumber(const pcre16 *code, +" PCRE_SPTR16 name); +
+
+int pcre16_get_stringtable_entries(const pcre16 *code, + PCRE_SPTR16 name, PCRE_UCHAR16 **first, PCRE_UCHAR16 **last); +
+
+int pcre16_get_substring(PCRE_SPTR16 subject, int *ovector, + int stringcount, int stringnumber, + PCRE_SPTR16 *stringptr); +
+
+int pcre16_get_substring_list(PCRE_SPTR16 subject, + int *ovector, int stringcount, PCRE_SPTR16 **listptr); +
+
+void pcre16_free_substring(PCRE_SPTR16 stringptr); +
+
+void pcre16_free_substring_list(PCRE_SPTR16 *stringptr); +

+
PCRE 16-BIT API AUXILIARY FUNCTIONS
+

+pcre16_jit_stack *pcre16_jit_stack_alloc(int startsize, int maxsize); +
+
+void pcre16_jit_stack_free(pcre16_jit_stack *stack); +
+
+void pcre16_assign_jit_stack(pcre16_extra *extra, + pcre16_jit_callback callback, void *data); +
+
+const unsigned char *pcre16_maketables(void); +
+
+int pcre16_fullinfo(const pcre16 *code, const pcre16_extra *extra, + int what, void *where); +
+
+int pcre16_refcount(pcre16 *code, int adjust); +
+
+int pcre16_config(int what, void *where); +
+
+const char *pcre16_version(void); +
+
+int pcre16_pattern_to_host_byte_order(pcre16 *code, + pcre16_extra *extra, const unsigned char *tables); +

+
PCRE 16-BIT API INDIRECTED FUNCTIONS
+

+void *(*pcre16_malloc)(size_t); +
+
+void (*pcre16_free)(void *); +
+
+void *(*pcre16_stack_malloc)(size_t); +
+
+void (*pcre16_stack_free)(void *); +
+
+int (*pcre16_callout)(pcre16_callout_block *); +

+
PCRE 16-BIT API 16-BIT-ONLY FUNCTION
+

+int pcre16_utf16_to_host_byte_order(PCRE_UCHAR16 *output, + PCRE_SPTR16 input, int length, int *byte_order, + int keep_boms); +

+
THE PCRE 16-BIT LIBRARY
+

+Starting with release 8.30, it is possible to compile a PCRE library that +supports 16-bit character strings, including UTF-16 strings, as well as or +instead of the original 8-bit library. The majority of the work to make this +possible was done by Zoltan Herczeg. The two libraries contain identical sets +of functions, used in exactly the same way. Only the names of the functions and +the data types of their arguments and results are different. To avoid +over-complication and reduce the documentation maintenance load, most of the +PCRE documentation describes the 8-bit library, with only occasional references +to the 16-bit library. This page describes what is different when you use the +16-bit library. +

+

+WARNING: A single application can be linked with both libraries, but you must +take care when processing any particular pattern to use functions from just one +library. For example, if you want to study a pattern that was compiled with +pcre16_compile(), you must do so with pcre16_study(), not +pcre_study(), and you must free the study data with +pcre16_free_study(). +

+
THE HEADER FILE
+

+There is only one header file, pcre.h. It contains prototypes for all the +functions in all libraries, as well as definitions of flags, structures, error +codes, etc. +

+
THE LIBRARY NAME
+

+In Unix-like systems, the 16-bit library is called libpcre16, and can +normally be accesss by adding -lpcre16 to the command for linking an +application that uses PCRE. +

+
STRING TYPES
+

+In the 8-bit library, strings are passed to PCRE library functions as vectors +of bytes with the C type "char *". In the 16-bit library, strings are passed as +vectors of unsigned 16-bit quantities. The macro PCRE_UCHAR16 specifies an +appropriate data type, and PCRE_SPTR16 is defined as "const PCRE_UCHAR16 *". In +very many environments, "short int" is a 16-bit data type. When PCRE is built, +it defines PCRE_UCHAR16 as "unsigned short int", but checks that it really is a +16-bit data type. If it is not, the build fails with an error message telling +the maintainer to modify the definition appropriately. +

+
STRUCTURE TYPES
+

+The types of the opaque structures that are used for compiled 16-bit patterns +and JIT stacks are pcre16 and pcre16_jit_stack respectively. The +type of the user-accessible structure that is returned by pcre16_study() +is pcre16_extra, and the type of the structure that is used for passing +data to a callout function is pcre16_callout_block. These structures +contain the same fields, with the same names, as their 8-bit counterparts. The +only difference is that pointers to character strings are 16-bit instead of +8-bit types. +

+
16-BIT FUNCTIONS
+

+For every function in the 8-bit library there is a corresponding function in +the 16-bit library with a name that starts with pcre16_ instead of +pcre_. The prototypes are listed above. In addition, there is one extra +function, pcre16_utf16_to_host_byte_order(). This is a utility function +that converts a UTF-16 character string to host byte order if necessary. The +other 16-bit functions expect the strings they are passed to be in host byte +order. +

+

+The input and output arguments of +pcre16_utf16_to_host_byte_order() may point to the same address, that is, +conversion in place is supported. The output buffer must be at least as long as +the input. +

+

+The length argument specifies the number of 16-bit data units in the +input string; a negative value specifies a zero-terminated string. +

+

+If byte_order is NULL, it is assumed that the string starts off in host +byte order. This may be changed by byte-order marks (BOMs) anywhere in the +string (commonly as the first character). +

+

+If byte_order is not NULL, a non-zero value of the integer to which it +points means that the input starts off in host byte order, otherwise the +opposite order is assumed. Again, BOMs in the string can change this. The final +byte order is passed back at the end of processing. +

+

+If keep_boms is not zero, byte-order mark characters (0xfeff) are copied +into the output string. Otherwise they are discarded. +

+

+The result of the function is the number of 16-bit units placed into the output +buffer, including the zero terminator if the string was zero-terminated. +

+
SUBJECT STRING OFFSETS
+

+The lengths and starting offsets of subject strings must be specified in 16-bit +data units, and the offsets within subject strings that are returned by the +matching functions are in also 16-bit units rather than bytes. +

+
NAMED SUBPATTERNS
+

+The name-to-number translation table that is maintained for named subpatterns +uses 16-bit characters. The pcre16_get_stringtable_entries() function +returns the length of each entry in the table as the number of 16-bit data +units. +

+
OPTION NAMES
+

+There are two new general option names, PCRE_UTF16 and PCRE_NO_UTF16_CHECK, +which correspond to PCRE_UTF8 and PCRE_NO_UTF8_CHECK in the 8-bit library. In +fact, these new options define the same bits in the options word. There is a +discussion about the +validity of UTF-16 strings +in the +pcreunicode +page. +

+

+For the pcre16_config() function there is an option PCRE_CONFIG_UTF16 +that returns 1 if UTF-16 support is configured, otherwise 0. If this option is +given to pcre_config() or pcre32_config(), or if the +PCRE_CONFIG_UTF8 or PCRE_CONFIG_UTF32 option is given to pcre16_config(), +the result is the PCRE_ERROR_BADOPTION error. +

+
CHARACTER CODES
+

+In 16-bit mode, when PCRE_UTF16 is not set, character values are treated in the +same way as in 8-bit, non UTF-8 mode, except, of course, that they can range +from 0 to 0xffff instead of 0 to 0xff. Character types for characters less than +0xff can therefore be influenced by the locale in the same way as before. +Characters greater than 0xff have only one case, and no "type" (such as letter +or digit). +

+

+In UTF-16 mode, the character code is Unicode, in the range 0 to 0x10ffff, with +the exception of values in the range 0xd800 to 0xdfff because those are +"surrogate" values that are used in pairs to encode values greater than 0xffff. +

+

+A UTF-16 string can indicate its endianness by special code knows as a +byte-order mark (BOM). The PCRE functions do not handle this, expecting strings +to be in host byte order. A utility function called +pcre16_utf16_to_host_byte_order() is provided to help with this (see +above). +

+
ERROR NAMES
+

+The errors PCRE_ERROR_BADUTF16_OFFSET and PCRE_ERROR_SHORTUTF16 correspond to +their 8-bit counterparts. The error PCRE_ERROR_BADMODE is given when a compiled +pattern is passed to a function that processes patterns in the other +mode, for example, if a pattern compiled with pcre_compile() is passed to +pcre16_exec(). +

+

+There are new error codes whose names begin with PCRE_UTF16_ERR for invalid +UTF-16 strings, corresponding to the PCRE_UTF8_ERR codes for UTF-8 strings that +are described in the section entitled +"Reason codes for invalid UTF-8 strings" +in the main +pcreapi +page. The UTF-16 errors are: +

+  PCRE_UTF16_ERR1  Missing low surrogate at end of string
+  PCRE_UTF16_ERR2  Invalid low surrogate follows high surrogate
+  PCRE_UTF16_ERR3  Isolated low surrogate
+  PCRE_UTF16_ERR4  Non-character
+
+

+
ERROR TEXTS
+

+If there is an error while compiling a pattern, the error text that is passed +back by pcre16_compile() or pcre16_compile2() is still an 8-bit +character string, zero-terminated. +

+
CALLOUTS
+

+The subject and mark fields in the callout block that is passed to +a callout function point to 16-bit vectors. +

+
TESTING
+

+The pcretest program continues to operate with 8-bit input and output +files, but it can be used for testing the 16-bit library. If it is run with the +command line option -16, patterns and subject strings are converted from +8-bit to 16-bit before being passed to PCRE, and the 16-bit library functions +are used instead of the 8-bit ones. Returned 16-bit strings are converted to +8-bit for output. If both the 8-bit and the 32-bit libraries were not compiled, +pcretest defaults to 16-bit and the -16 option is ignored. +

+

+When PCRE is being built, the RunTest script that is called by "make +check" uses the pcretest -C option to discover which of the 8-bit, +16-bit and 32-bit libraries has been built, and runs the tests appropriately. +

+
NOT SUPPORTED IN 16-BIT MODE
+

+Not all the features of the 8-bit library are available with the 16-bit +library. The C++ and POSIX wrapper functions support only the 8-bit library, +and the pcregrep program is at present 8-bit only. +

+
AUTHOR
+

+Philip Hazel +
+University Computing Service +
+Cambridge CB2 3QH, England. +
+

+
REVISION
+

+Last updated: 12 May 2013 +
+Copyright © 1997-2013 University of Cambridge. +
+

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre32.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre32.html new file mode 100644 index 0000000000000000000000000000000000000000..f96876e7502bf4d0c6b65b65db5f7bbdfb79a698 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre32.html @@ -0,0 +1,382 @@ + + +pcre32 specification + + +

pcre32 man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+

+

+#include <pcre.h> +

+
PCRE 32-BIT API BASIC FUNCTIONS
+

+pcre32 *pcre32_compile(PCRE_SPTR32 pattern, int options, + const char **errptr, int *erroffset, + const unsigned char *tableptr); +
+
+pcre32 *pcre32_compile2(PCRE_SPTR32 pattern, int options, + int *errorcodeptr, + const unsigned char *tableptr); +
+
+pcre32_extra *pcre32_study(const pcre32 *code, int options, + const char **errptr); +
+
+void pcre32_free_study(pcre32_extra *extra); +
+
+int pcre32_exec(const pcre32 *code, const pcre32_extra *extra, + PCRE_SPTR32 subject, int length, int startoffset, + int options, int *ovector, int ovecsize); +
+
+int pcre32_dfa_exec(const pcre32 *code, const pcre32_extra *extra, + PCRE_SPTR32 subject, int length, int startoffset, + int options, int *ovector, int ovecsize, + int *workspace, int wscount); +

+
PCRE 32-BIT API STRING EXTRACTION FUNCTIONS
+

+int pcre32_copy_named_substring(const pcre32 *code, + PCRE_SPTR32 subject, int *ovector, + int stringcount, PCRE_SPTR32 stringname, + PCRE_UCHAR32 *buffer, int buffersize); +
+
+int pcre32_copy_substring(PCRE_SPTR32 subject, int *ovector, + int stringcount, int stringnumber, PCRE_UCHAR32 *buffer, + int buffersize); +
+
+int pcre32_get_named_substring(const pcre32 *code, + PCRE_SPTR32 subject, int *ovector, + int stringcount, PCRE_SPTR32 stringname, + PCRE_SPTR32 *stringptr); +
+
+int pcre32_get_stringnumber(const pcre32 *code, + PCRE_SPTR32 name); +
+
+int pcre32_get_stringtable_entries(const pcre32 *code, + PCRE_SPTR32 name, PCRE_UCHAR32 **first, PCRE_UCHAR32 **last); +
+
+int pcre32_get_substring(PCRE_SPTR32 subject, int *ovector, + int stringcount, int stringnumber, + PCRE_SPTR32 *stringptr); +
+
+int pcre32_get_substring_list(PCRE_SPTR32 subject, + int *ovector, int stringcount, PCRE_SPTR32 **listptr); +
+
+void pcre32_free_substring(PCRE_SPTR32 stringptr); +
+
+void pcre32_free_substring_list(PCRE_SPTR32 *stringptr); +

+
PCRE 32-BIT API AUXILIARY FUNCTIONS
+

+pcre32_jit_stack *pcre32_jit_stack_alloc(int startsize, int maxsize); +
+
+void pcre32_jit_stack_free(pcre32_jit_stack *stack); +
+
+void pcre32_assign_jit_stack(pcre32_extra *extra, + pcre32_jit_callback callback, void *data); +
+
+const unsigned char *pcre32_maketables(void); +
+
+int pcre32_fullinfo(const pcre32 *code, const pcre32_extra *extra, + int what, void *where); +
+
+int pcre32_refcount(pcre32 *code, int adjust); +
+
+int pcre32_config(int what, void *where); +
+
+const char *pcre32_version(void); +
+
+int pcre32_pattern_to_host_byte_order(pcre32 *code, + pcre32_extra *extra, const unsigned char *tables); +

+
PCRE 32-BIT API INDIRECTED FUNCTIONS
+

+void *(*pcre32_malloc)(size_t); +
+
+void (*pcre32_free)(void *); +
+
+void *(*pcre32_stack_malloc)(size_t); +
+
+void (*pcre32_stack_free)(void *); +
+
+int (*pcre32_callout)(pcre32_callout_block *); +

+
PCRE 32-BIT API 32-BIT-ONLY FUNCTION
+

+int pcre32_utf32_to_host_byte_order(PCRE_UCHAR32 *output, + PCRE_SPTR32 input, int length, int *byte_order, + int keep_boms); +

+
THE PCRE 32-BIT LIBRARY
+

+Starting with release 8.32, it is possible to compile a PCRE library that +supports 32-bit character strings, including UTF-32 strings, as well as or +instead of the original 8-bit library. This work was done by Christian Persch, +based on the work done by Zoltan Herczeg for the 16-bit library. All three +libraries contain identical sets of functions, used in exactly the same way. +Only the names of the functions and the data types of their arguments and +results are different. To avoid over-complication and reduce the documentation +maintenance load, most of the PCRE documentation describes the 8-bit library, +with only occasional references to the 16-bit and 32-bit libraries. This page +describes what is different when you use the 32-bit library. +

+

+WARNING: A single application can be linked with all or any of the three +libraries, but you must take care when processing any particular pattern +to use functions from just one library. For example, if you want to study +a pattern that was compiled with pcre32_compile(), you must do so +with pcre32_study(), not pcre_study(), and you must free the +study data with pcre32_free_study(). +

+
THE HEADER FILE
+

+There is only one header file, pcre.h. It contains prototypes for all the +functions in all libraries, as well as definitions of flags, structures, error +codes, etc. +

+
THE LIBRARY NAME
+

+In Unix-like systems, the 32-bit library is called libpcre32, and can +normally be accesss by adding -lpcre32 to the command for linking an +application that uses PCRE. +

+
STRING TYPES
+

+In the 8-bit library, strings are passed to PCRE library functions as vectors +of bytes with the C type "char *". In the 32-bit library, strings are passed as +vectors of unsigned 32-bit quantities. The macro PCRE_UCHAR32 specifies an +appropriate data type, and PCRE_SPTR32 is defined as "const PCRE_UCHAR32 *". In +very many environments, "unsigned int" is a 32-bit data type. When PCRE is +built, it defines PCRE_UCHAR32 as "unsigned int", but checks that it really is +a 32-bit data type. If it is not, the build fails with an error message telling +the maintainer to modify the definition appropriately. +

+
STRUCTURE TYPES
+

+The types of the opaque structures that are used for compiled 32-bit patterns +and JIT stacks are pcre32 and pcre32_jit_stack respectively. The +type of the user-accessible structure that is returned by pcre32_study() +is pcre32_extra, and the type of the structure that is used for passing +data to a callout function is pcre32_callout_block. These structures +contain the same fields, with the same names, as their 8-bit counterparts. The +only difference is that pointers to character strings are 32-bit instead of +8-bit types. +

+
32-BIT FUNCTIONS
+

+For every function in the 8-bit library there is a corresponding function in +the 32-bit library with a name that starts with pcre32_ instead of +pcre_. The prototypes are listed above. In addition, there is one extra +function, pcre32_utf32_to_host_byte_order(). This is a utility function +that converts a UTF-32 character string to host byte order if necessary. The +other 32-bit functions expect the strings they are passed to be in host byte +order. +

+

+The input and output arguments of +pcre32_utf32_to_host_byte_order() may point to the same address, that is, +conversion in place is supported. The output buffer must be at least as long as +the input. +

+

+The length argument specifies the number of 32-bit data units in the +input string; a negative value specifies a zero-terminated string. +

+

+If byte_order is NULL, it is assumed that the string starts off in host +byte order. This may be changed by byte-order marks (BOMs) anywhere in the +string (commonly as the first character). +

+

+If byte_order is not NULL, a non-zero value of the integer to which it +points means that the input starts off in host byte order, otherwise the +opposite order is assumed. Again, BOMs in the string can change this. The final +byte order is passed back at the end of processing. +

+

+If keep_boms is not zero, byte-order mark characters (0xfeff) are copied +into the output string. Otherwise they are discarded. +

+

+The result of the function is the number of 32-bit units placed into the output +buffer, including the zero terminator if the string was zero-terminated. +

+
SUBJECT STRING OFFSETS
+

+The lengths and starting offsets of subject strings must be specified in 32-bit +data units, and the offsets within subject strings that are returned by the +matching functions are in also 32-bit units rather than bytes. +

+
NAMED SUBPATTERNS
+

+The name-to-number translation table that is maintained for named subpatterns +uses 32-bit characters. The pcre32_get_stringtable_entries() function +returns the length of each entry in the table as the number of 32-bit data +units. +

+
OPTION NAMES
+

+There are two new general option names, PCRE_UTF32 and PCRE_NO_UTF32_CHECK, +which correspond to PCRE_UTF8 and PCRE_NO_UTF8_CHECK in the 8-bit library. In +fact, these new options define the same bits in the options word. There is a +discussion about the +validity of UTF-32 strings +in the +pcreunicode +page. +

+

+For the pcre32_config() function there is an option PCRE_CONFIG_UTF32 +that returns 1 if UTF-32 support is configured, otherwise 0. If this option is +given to pcre_config() or pcre16_config(), or if the +PCRE_CONFIG_UTF8 or PCRE_CONFIG_UTF16 option is given to pcre32_config(), +the result is the PCRE_ERROR_BADOPTION error. +

+
CHARACTER CODES
+

+In 32-bit mode, when PCRE_UTF32 is not set, character values are treated in the +same way as in 8-bit, non UTF-8 mode, except, of course, that they can range +from 0 to 0x7fffffff instead of 0 to 0xff. Character types for characters less +than 0xff can therefore be influenced by the locale in the same way as before. +Characters greater than 0xff have only one case, and no "type" (such as letter +or digit). +

+

+In UTF-32 mode, the character code is Unicode, in the range 0 to 0x10ffff, with +the exception of values in the range 0xd800 to 0xdfff because those are +"surrogate" values that are ill-formed in UTF-32. +

+

+A UTF-32 string can indicate its endianness by special code knows as a +byte-order mark (BOM). The PCRE functions do not handle this, expecting strings +to be in host byte order. A utility function called +pcre32_utf32_to_host_byte_order() is provided to help with this (see +above). +

+
ERROR NAMES
+

+The error PCRE_ERROR_BADUTF32 corresponds to its 8-bit counterpart. +The error PCRE_ERROR_BADMODE is given when a compiled +pattern is passed to a function that processes patterns in the other +mode, for example, if a pattern compiled with pcre_compile() is passed to +pcre32_exec(). +

+

+There are new error codes whose names begin with PCRE_UTF32_ERR for invalid +UTF-32 strings, corresponding to the PCRE_UTF8_ERR codes for UTF-8 strings that +are described in the section entitled +"Reason codes for invalid UTF-8 strings" +in the main +pcreapi +page. The UTF-32 errors are: +

+  PCRE_UTF32_ERR1  Surrogate character (range from 0xd800 to 0xdfff)
+  PCRE_UTF32_ERR2  Non-character
+  PCRE_UTF32_ERR3  Character > 0x10ffff
+
+

+
ERROR TEXTS
+

+If there is an error while compiling a pattern, the error text that is passed +back by pcre32_compile() or pcre32_compile2() is still an 8-bit +character string, zero-terminated. +

+
CALLOUTS
+

+The subject and mark fields in the callout block that is passed to +a callout function point to 32-bit vectors. +

+
TESTING
+

+The pcretest program continues to operate with 8-bit input and output +files, but it can be used for testing the 32-bit library. If it is run with the +command line option -32, patterns and subject strings are converted from +8-bit to 32-bit before being passed to PCRE, and the 32-bit library functions +are used instead of the 8-bit ones. Returned 32-bit strings are converted to +8-bit for output. If both the 8-bit and the 16-bit libraries were not compiled, +pcretest defaults to 32-bit and the -32 option is ignored. +

+

+When PCRE is being built, the RunTest script that is called by "make +check" uses the pcretest -C option to discover which of the 8-bit, +16-bit and 32-bit libraries has been built, and runs the tests appropriately. +

+
NOT SUPPORTED IN 32-BIT MODE
+

+Not all the features of the 8-bit library are available with the 32-bit +library. The C++ and POSIX wrapper functions support only the 8-bit library, +and the pcregrep program is at present 8-bit only. +

+
AUTHOR
+

+Philip Hazel +
+University Computing Service +
+Cambridge CB2 3QH, England. +
+

+
REVISION
+

+Last updated: 12 May 2013 +
+Copyright © 1997-2013 University of Cambridge. +
+

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_assign_jit_stack.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_assign_jit_stack.html new file mode 100644 index 0000000000000000000000000000000000000000..b2eef704db85068b23ab861bd0df32796cd47c1b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_assign_jit_stack.html @@ -0,0 +1,76 @@ + + +pcre_assign_jit_stack specification + + +

pcre_assign_jit_stack man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre.h> +

+

+void pcre_assign_jit_stack(pcre_extra *extra, + pcre_jit_callback callback, void *data); +
+
+void pcre16_assign_jit_stack(pcre16_extra *extra, + pcre16_jit_callback callback, void *data); +
+
+void pcre32_assign_jit_stack(pcre32_extra *extra, + pcre32_jit_callback callback, void *data); +

+
+DESCRIPTION +
+

+This function provides control over the memory used as a stack at run-time by a +call to pcre[16|32]_exec() with a pattern that has been successfully +compiled with JIT optimization. The arguments are: +

+  extra     the data pointer returned by pcre[16|32]_study()
+  callback  a callback function
+  data      a JIT stack or a value to be passed to the callback
+              function
+
+

+

+If callback is NULL and data is NULL, an internal 32K block on +the machine stack is used. +

+

+If callback is NULL and data is not NULL, data must +be a valid JIT stack, the result of calling pcre[16|32]_jit_stack_alloc(). +

+

+If callback not NULL, it is called with data as an argument at +the start of matching, in order to set up a JIT stack. If the result is NULL, +the internal 32K stack is used; otherwise the return value must be a valid JIT +stack, the result of calling pcre[16|32]_jit_stack_alloc(). +

+

+You may safely assign the same JIT stack to multiple patterns, as long as they +are all matched in the same thread. In a multithread application, each thread +must use its own JIT stack. For more details, see the +pcrejit +page. +

+

+There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_compile.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_compile.html new file mode 100644 index 0000000000000000000000000000000000000000..95b4bec63c607247e0ff9caba2ef95b9f3a72e75 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_compile.html @@ -0,0 +1,111 @@ + + +pcre_compile specification + + +

pcre_compile man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre.h> +

+

+pcre *pcre_compile(const char *pattern, int options, + const char **errptr, int *erroffset, + const unsigned char *tableptr); +
+
+pcre16 *pcre16_compile(PCRE_SPTR16 pattern, int options, + const char **errptr, int *erroffset, + const unsigned char *tableptr); +
+
+pcre32 *pcre32_compile(PCRE_SPTR32 pattern, int options, + const char **errptr, int *erroffset, + const unsigned char *tableptr); +

+
+DESCRIPTION +
+

+This function compiles a regular expression into an internal form. It is the +same as pcre[16|32]_compile2(), except for the absence of the +errorcodeptr argument. Its arguments are: +

+  pattern       A zero-terminated string containing the
+                  regular expression to be compiled
+  options       Zero or more option bits
+  errptr        Where to put an error message
+  erroffset     Offset in pattern where error was found
+  tableptr      Pointer to character tables, or NULL to
+                  use the built-in default
+
+The option bits are: +
+  PCRE_ANCHORED           Force pattern anchoring
+  PCRE_AUTO_CALLOUT       Compile automatic callouts
+  PCRE_BSR_ANYCRLF        \R matches only CR, LF, or CRLF
+  PCRE_BSR_UNICODE        \R matches all Unicode line endings
+  PCRE_CASELESS           Do caseless matching
+  PCRE_DOLLAR_ENDONLY     $ not to match newline at end
+  PCRE_DOTALL             . matches anything including NL
+  PCRE_DUPNAMES           Allow duplicate names for subpatterns
+  PCRE_EXTENDED           Ignore white space and # comments
+  PCRE_EXTRA              PCRE extra features
+                            (not much use currently)
+  PCRE_FIRSTLINE          Force matching to be before newline
+  PCRE_JAVASCRIPT_COMPAT  JavaScript compatibility
+  PCRE_MULTILINE          ^ and $ match newlines within data
+  PCRE_NEVER_UTF          Lock out UTF, e.g. via (*UTF)
+  PCRE_NEWLINE_ANY        Recognize any Unicode newline sequence
+  PCRE_NEWLINE_ANYCRLF    Recognize CR, LF, and CRLF as newline
+                            sequences
+  PCRE_NEWLINE_CR         Set CR as the newline sequence
+  PCRE_NEWLINE_CRLF       Set CRLF as the newline sequence
+  PCRE_NEWLINE_LF         Set LF as the newline sequence
+  PCRE_NO_AUTO_CAPTURE    Disable numbered capturing paren-
+                            theses (named ones available)
+  PCRE_NO_AUTO_POSSESS    Disable auto-possessification
+  PCRE_NO_START_OPTIMIZE  Disable match-time start optimizations
+  PCRE_NO_UTF16_CHECK     Do not check the pattern for UTF-16
+                            validity (only relevant if
+                            PCRE_UTF16 is set)
+  PCRE_NO_UTF32_CHECK     Do not check the pattern for UTF-32
+                            validity (only relevant if
+                            PCRE_UTF32 is set)
+  PCRE_NO_UTF8_CHECK      Do not check the pattern for UTF-8
+                            validity (only relevant if
+                            PCRE_UTF8 is set)
+  PCRE_UCP                Use Unicode properties for \d, \w, etc.
+  PCRE_UNGREEDY           Invert greediness of quantifiers
+  PCRE_UTF16              Run in pcre16_compile() UTF-16 mode
+  PCRE_UTF32              Run in pcre32_compile() UTF-32 mode
+  PCRE_UTF8               Run in pcre_compile() UTF-8 mode
+
+PCRE must be built with UTF support in order to use PCRE_UTF8/16/32 and +PCRE_NO_UTF8/16/32_CHECK, and with UCP support if PCRE_UCP is used. +

+

+The yield of the function is a pointer to a private data structure that +contains the compiled pattern, or NULL if an error was detected. Note that +compiling regular expressions with one version of PCRE for use with a different +version is not guaranteed to work and may cause crashes. +

+

+There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_compile2.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_compile2.html new file mode 100644 index 0000000000000000000000000000000000000000..9cd56a237baf4c586e373096fc5f3ed53723082d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_compile2.html @@ -0,0 +1,115 @@ + + +pcre_compile2 specification + + +

pcre_compile2 man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre.h> +

+

+pcre *pcre_compile2(const char *pattern, int options, + int *errorcodeptr, + const char **errptr, int *erroffset, + const unsigned char *tableptr); +
+
+pcre16 *pcre16_compile2(PCRE_SPTR16 pattern, int options, + int *errorcodeptr, + const char **errptr, int *erroffset, + const unsigned char *tableptr); +
+
+pcre32 *pcre32_compile2(PCRE_SPTR32 pattern, int options, +" int *errorcodeptr + const char **errptr, int *erroffset, + const unsigned char *tableptr); +

+
+DESCRIPTION +
+

+This function compiles a regular expression into an internal form. It is the +same as pcre[16|32]_compile(), except for the addition of the +errorcodeptr argument. The arguments are: +

+  pattern       A zero-terminated string containing the
+                  regular expression to be compiled
+  options       Zero or more option bits
+  errorcodeptr  Where to put an error code
+  errptr        Where to put an error message
+  erroffset     Offset in pattern where error was found
+  tableptr      Pointer to character tables, or NULL to
+                  use the built-in default
+
+The option bits are: +
+  PCRE_ANCHORED           Force pattern anchoring
+  PCRE_AUTO_CALLOUT       Compile automatic callouts
+  PCRE_BSR_ANYCRLF        \R matches only CR, LF, or CRLF
+  PCRE_BSR_UNICODE        \R matches all Unicode line endings
+  PCRE_CASELESS           Do caseless matching
+  PCRE_DOLLAR_ENDONLY     $ not to match newline at end
+  PCRE_DOTALL             . matches anything including NL
+  PCRE_DUPNAMES           Allow duplicate names for subpatterns
+  PCRE_EXTENDED           Ignore white space and # comments
+  PCRE_EXTRA              PCRE extra features
+                            (not much use currently)
+  PCRE_FIRSTLINE          Force matching to be before newline
+  PCRE_JAVASCRIPT_COMPAT  JavaScript compatibility
+  PCRE_MULTILINE          ^ and $ match newlines within data
+  PCRE_NEVER_UTF          Lock out UTF, e.g. via (*UTF)
+  PCRE_NEWLINE_ANY        Recognize any Unicode newline sequence
+  PCRE_NEWLINE_ANYCRLF    Recognize CR, LF, and CRLF as newline
+                            sequences
+  PCRE_NEWLINE_CR         Set CR as the newline sequence
+  PCRE_NEWLINE_CRLF       Set CRLF as the newline sequence
+  PCRE_NEWLINE_LF         Set LF as the newline sequence
+  PCRE_NO_AUTO_CAPTURE    Disable numbered capturing paren-
+                            theses (named ones available)
+  PCRE_NO_AUTO_POSSESS    Disable auto-possessification
+  PCRE_NO_START_OPTIMIZE  Disable match-time start optimizations
+  PCRE_NO_UTF16_CHECK     Do not check the pattern for UTF-16
+                            validity (only relevant if
+                            PCRE_UTF16 is set)
+  PCRE_NO_UTF32_CHECK     Do not check the pattern for UTF-32
+                            validity (only relevant if
+                            PCRE_UTF32 is set)
+  PCRE_NO_UTF8_CHECK      Do not check the pattern for UTF-8
+                            validity (only relevant if
+                            PCRE_UTF8 is set)
+  PCRE_UCP                Use Unicode properties for \d, \w, etc.
+  PCRE_UNGREEDY           Invert greediness of quantifiers
+  PCRE_UTF16              Run pcre16_compile() in UTF-16 mode
+  PCRE_UTF32              Run pcre32_compile() in UTF-32 mode
+  PCRE_UTF8               Run pcre_compile() in UTF-8 mode
+
+PCRE must be built with UTF support in order to use PCRE_UTF8/16/32 and +PCRE_NO_UTF8/16/32_CHECK, and with UCP support if PCRE_UCP is used. +

+

+The yield of the function is a pointer to a private data structure that +contains the compiled pattern, or NULL if an error was detected. Note that +compiling regular expressions with one version of PCRE for use with a different +version is not guaranteed to work and may cause crashes. +

+

+There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_config.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_config.html new file mode 100644 index 0000000000000000000000000000000000000000..72fb9caa1ffb1ed805e8c46425a446ba92ba758c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_config.html @@ -0,0 +1,94 @@ + + +pcre_config specification + + +

pcre_config man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre.h> +

+

+int pcre_config(int what, void *where); +

+

+int pcre16_config(int what, void *where); +

+

+int pcre32_config(int what, void *where); +

+
+DESCRIPTION +
+

+This function makes it possible for a client program to find out which optional +features are available in the version of the PCRE library it is using. The +arguments are as follows: +

+  what     A code specifying what information is required
+  where    Points to where to put the data
+
+The where argument must point to an integer variable, except for +PCRE_CONFIG_MATCH_LIMIT, PCRE_CONFIG_MATCH_LIMIT_RECURSION, and +PCRE_CONFIG_PARENS_LIMIT, when it must point to an unsigned long integer, +and for PCRE_CONFIG_JITTARGET, when it must point to a const char*. +The available codes are: +
+  PCRE_CONFIG_JIT           Availability of just-in-time compiler
+                              support (1=yes 0=no)
+  PCRE_CONFIG_JITTARGET     String containing information about the
+                              target architecture for the JIT compiler,
+                              or NULL if there is no JIT support
+  PCRE_CONFIG_LINK_SIZE     Internal link size: 2, 3, or 4
+  PCRE_CONFIG_PARENS_LIMIT  Parentheses nesting limit
+  PCRE_CONFIG_MATCH_LIMIT   Internal resource limit
+  PCRE_CONFIG_MATCH_LIMIT_RECURSION
+                            Internal recursion depth limit
+  PCRE_CONFIG_NEWLINE       Value of the default newline sequence:
+                                13 (0x000d)    for CR
+                                10 (0x000a)    for LF
+                              3338 (0x0d0a)    for CRLF
+                                -2             for ANYCRLF
+                                -1             for ANY
+  PCRE_CONFIG_BSR           Indicates what \R matches by default:
+                                 0             all Unicode line endings
+                                 1             CR, LF, or CRLF only
+  PCRE_CONFIG_POSIX_MALLOC_THRESHOLD
+                            Threshold of return slots, above which
+                              malloc() is used by the POSIX API
+  PCRE_CONFIG_STACKRECURSE  Recursion implementation (1=stack 0=heap)
+  PCRE_CONFIG_UTF16         Availability of UTF-16 support (1=yes
+                               0=no); option for pcre16_config()
+  PCRE_CONFIG_UTF32         Availability of UTF-32 support (1=yes
+                               0=no); option for pcre32_config()
+  PCRE_CONFIG_UTF8          Availability of UTF-8 support (1=yes 0=no);
+                              option for pcre_config()
+  PCRE_CONFIG_UNICODE_PROPERTIES
+                            Availability of Unicode property support
+                              (1=yes 0=no)
+
+The function yields 0 on success or PCRE_ERROR_BADOPTION otherwise. That error +is also given if PCRE_CONFIG_UTF16 or PCRE_CONFIG_UTF32 is passed to +pcre_config(), if PCRE_CONFIG_UTF8 or PCRE_CONFIG_UTF32 is passed to +pcre16_config(), or if PCRE_CONFIG_UTF8 or PCRE_CONFIG_UTF16 is passed to +pcre32_config(). +

+

+There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_copy_named_substring.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_copy_named_substring.html new file mode 100644 index 0000000000000000000000000000000000000000..77b48043cd2f63dbe1d1a49afcea4848927f6534 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_copy_named_substring.html @@ -0,0 +1,65 @@ + + +pcre_copy_named_substring specification + + +

pcre_copy_named_substring man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre.h> +

+

+int pcre_copy_named_substring(const pcre *code, + const char *subject, int *ovector, + int stringcount, const char *stringname, + char *buffer, int buffersize); +
+
+int pcre16_copy_named_substring(const pcre16 *code, + PCRE_SPTR16 subject, int *ovector, + int stringcount, PCRE_SPTR16 stringname, + PCRE_UCHAR16 *buffer, int buffersize); +
+
+int pcre32_copy_named_substring(const pcre32 *code, + PCRE_SPTR32 subject, int *ovector, + int stringcount, PCRE_SPTR32 stringname, + PCRE_UCHAR32 *buffer, int buffersize); +

+
+DESCRIPTION +
+

+This is a convenience function for extracting a captured substring, identified +by name, into a given buffer. The arguments are: +

+  code          Pattern that was successfully matched
+  subject       Subject that has been successfully matched
+  ovector       Offset vector that pcre[16|32]_exec() used
+  stringcount   Value returned by pcre[16|32]_exec()
+  stringname    Name of the required substring
+  buffer        Buffer to receive the string
+  buffersize    Size of buffer
+
+The yield is the length of the substring, PCRE_ERROR_NOMEMORY if the buffer was +too small, or PCRE_ERROR_NOSUBSTRING if the string name is invalid. +

+

+There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_copy_substring.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_copy_substring.html new file mode 100644 index 0000000000000000000000000000000000000000..ecaebe8533854a60fa4f77c3dcaf89c1871d7346 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_copy_substring.html @@ -0,0 +1,61 @@ + + +pcre_copy_substring specification + + +

pcre_copy_substring man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre.h> +

+

+int pcre_copy_substring(const char *subject, int *ovector, + int stringcount, int stringnumber, char *buffer, + int buffersize); +
+
+int pcre16_copy_substring(PCRE_SPTR16 subject, int *ovector, + int stringcount, int stringnumber, PCRE_UCHAR16 *buffer, + int buffersize); +
+
+int pcre32_copy_substring(PCRE_SPTR32 subject, int *ovector, + int stringcount, int stringnumber, PCRE_UCHAR32 *buffer, + int buffersize); +

+
+DESCRIPTION +
+

+This is a convenience function for extracting a captured substring into a given +buffer. The arguments are: +

+  subject       Subject that has been successfully matched
+  ovector       Offset vector that pcre[16|32]_exec() used
+  stringcount   Value returned by pcre[16|32]_exec()
+  stringnumber  Number of the required substring
+  buffer        Buffer to receive the string
+  buffersize    Size of buffer
+
+The yield is the length of the string, PCRE_ERROR_NOMEMORY if the buffer was +too small, or PCRE_ERROR_NOSUBSTRING if the string number is invalid. +

+

+There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_dfa_exec.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_dfa_exec.html new file mode 100644 index 0000000000000000000000000000000000000000..5fff6a7e0a55cd03e83b313e6422909bb8eaf21a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_dfa_exec.html @@ -0,0 +1,129 @@ + + +pcre_dfa_exec specification + + +

pcre_dfa_exec man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre.h> +

+

+int pcre_dfa_exec(const pcre *code, const pcre_extra *extra, + const char *subject, int length, int startoffset, + int options, int *ovector, int ovecsize, + int *workspace, int wscount); +
+
+int pcre16_dfa_exec(const pcre16 *code, const pcre16_extra *extra, + PCRE_SPTR16 subject, int length, int startoffset, + int options, int *ovector, int ovecsize, + int *workspace, int wscount); +
+
+int pcre32_dfa_exec(const pcre32 *code, const pcre32_extra *extra, + PCRE_SPTR32 subject, int length, int startoffset, + int options, int *ovector, int ovecsize, + int *workspace, int wscount); +

+
+DESCRIPTION +
+

+This function matches a compiled regular expression against a given subject +string, using an alternative matching algorithm that scans the subject string +just once (not Perl-compatible). Note that the main, Perl-compatible, +matching function is pcre[16|32]_exec(). The arguments for this function +are: +

+  code         Points to the compiled pattern
+  extra        Points to an associated pcre[16|32]_extra structure,
+                 or is NULL
+  subject      Points to the subject string
+  length       Length of the subject string
+  startoffset  Offset in the subject at which to start matching
+  options      Option bits
+  ovector      Points to a vector of ints for result offsets
+  ovecsize     Number of elements in the vector
+  workspace    Points to a vector of ints used as working space
+  wscount      Number of elements in the vector
+
+The units for length and startoffset are bytes for +pcre_exec(), 16-bit data items for pcre16_exec(), and 32-bit items +for pcre32_exec(). The options are: +
+  PCRE_ANCHORED          Match only at the first position
+  PCRE_BSR_ANYCRLF       \R matches only CR, LF, or CRLF
+  PCRE_BSR_UNICODE       \R matches all Unicode line endings
+  PCRE_NEWLINE_ANY       Recognize any Unicode newline sequence
+  PCRE_NEWLINE_ANYCRLF   Recognize CR, LF, & CRLF as newline sequences
+  PCRE_NEWLINE_CR        Recognize CR as the only newline sequence
+  PCRE_NEWLINE_CRLF      Recognize CRLF as the only newline sequence
+  PCRE_NEWLINE_LF        Recognize LF as the only newline sequence
+  PCRE_NOTBOL            Subject is not the beginning of a line
+  PCRE_NOTEOL            Subject is not the end of a line
+  PCRE_NOTEMPTY          An empty string is not a valid match
+  PCRE_NOTEMPTY_ATSTART  An empty string at the start of the subject
+                           is not a valid match
+  PCRE_NO_START_OPTIMIZE Do not do "start-match" optimizations
+  PCRE_NO_UTF16_CHECK    Do not check the subject for UTF-16
+                           validity (only relevant if PCRE_UTF16
+                           was set at compile time)
+  PCRE_NO_UTF32_CHECK    Do not check the subject for UTF-32
+                           validity (only relevant if PCRE_UTF32
+                           was set at compile time)
+  PCRE_NO_UTF8_CHECK     Do not check the subject for UTF-8
+                           validity (only relevant if PCRE_UTF8
+                           was set at compile time)
+  PCRE_PARTIAL           ) Return PCRE_ERROR_PARTIAL for a partial
+  PCRE_PARTIAL_SOFT      )   match if no full matches are found
+  PCRE_PARTIAL_HARD      Return PCRE_ERROR_PARTIAL for a partial match
+                           even if there is a full match as well
+  PCRE_DFA_SHORTEST      Return only the shortest match
+  PCRE_DFA_RESTART       Restart after a partial match
+
+There are restrictions on what may appear in a pattern when using this matching +function. Details are given in the +pcrematching +documentation. For details of partial matching, see the +pcrepartial +page. +

+

+A pcre[16|32]_extra structure contains the following fields: +

+  flags            Bits indicating which fields are set
+  study_data       Opaque data from pcre[16|32]_study()
+  match_limit      Limit on internal resource use
+  match_limit_recursion  Limit on internal recursion depth
+  callout_data     Opaque data passed back to callouts
+  tables           Points to character tables or is NULL
+  mark             For passing back a *MARK pointer
+  executable_jit   Opaque data from JIT compilation
+
+The flag bits are PCRE_EXTRA_STUDY_DATA, PCRE_EXTRA_MATCH_LIMIT, +PCRE_EXTRA_MATCH_LIMIT_RECURSION, PCRE_EXTRA_CALLOUT_DATA, +PCRE_EXTRA_TABLES, PCRE_EXTRA_MARK and PCRE_EXTRA_EXECUTABLE_JIT. For this +matching function, the match_limit and match_limit_recursion fields +are not used, and must not be set. The PCRE_EXTRA_EXECUTABLE_JIT flag and +the corresponding variable are ignored. +

+

+There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_exec.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_exec.html new file mode 100644 index 0000000000000000000000000000000000000000..18e1a13ff8df50d2dca504d23e66f694a5578f8c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_exec.html @@ -0,0 +1,111 @@ + + +pcre_exec specification + + +

pcre_exec man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre.h> +

+

+int pcre_exec(const pcre *code, const pcre_extra *extra, + const char *subject, int length, int startoffset, + int options, int *ovector, int ovecsize); +
+
+int pcre16_exec(const pcre16 *code, const pcre16_extra *extra, + PCRE_SPTR16 subject, int length, int startoffset, + int options, int *ovector, int ovecsize); +
+
+int pcre32_exec(const pcre32 *code, const pcre32_extra *extra, + PCRE_SPTR32 subject, int length, int startoffset, + int options, int *ovector, int ovecsize); +

+
+DESCRIPTION +
+

+This function matches a compiled regular expression against a given subject +string, using a matching algorithm that is similar to Perl's. It returns +offsets to captured substrings. Its arguments are: +

+  code         Points to the compiled pattern
+  extra        Points to an associated pcre[16|32]_extra structure,
+                 or is NULL
+  subject      Points to the subject string
+  length       Length of the subject string
+  startoffset  Offset in the subject at which to start matching
+  options      Option bits
+  ovector      Points to a vector of ints for result offsets
+  ovecsize     Number of elements in the vector (a multiple of 3)
+
+The units for length and startoffset are bytes for +pcre_exec(), 16-bit data items for pcre16_exec(), and 32-bit items +for pcre32_exec(). The options are: +
+  PCRE_ANCHORED          Match only at the first position
+  PCRE_BSR_ANYCRLF       \R matches only CR, LF, or CRLF
+  PCRE_BSR_UNICODE       \R matches all Unicode line endings
+  PCRE_NEWLINE_ANY       Recognize any Unicode newline sequence
+  PCRE_NEWLINE_ANYCRLF   Recognize CR, LF, & CRLF as newline sequences
+  PCRE_NEWLINE_CR        Recognize CR as the only newline sequence
+  PCRE_NEWLINE_CRLF      Recognize CRLF as the only newline sequence
+  PCRE_NEWLINE_LF        Recognize LF as the only newline sequence
+  PCRE_NOTBOL            Subject string is not the beginning of a line
+  PCRE_NOTEOL            Subject string is not the end of a line
+  PCRE_NOTEMPTY          An empty string is not a valid match
+  PCRE_NOTEMPTY_ATSTART  An empty string at the start of the subject
+                           is not a valid match
+  PCRE_NO_START_OPTIMIZE Do not do "start-match" optimizations
+  PCRE_NO_UTF16_CHECK    Do not check the subject for UTF-16
+                           validity (only relevant if PCRE_UTF16
+                           was set at compile time)
+  PCRE_NO_UTF32_CHECK    Do not check the subject for UTF-32
+                           validity (only relevant if PCRE_UTF32
+                           was set at compile time)
+  PCRE_NO_UTF8_CHECK     Do not check the subject for UTF-8
+                           validity (only relevant if PCRE_UTF8
+                           was set at compile time)
+  PCRE_PARTIAL           ) Return PCRE_ERROR_PARTIAL for a partial
+  PCRE_PARTIAL_SOFT      )   match if no full matches are found
+  PCRE_PARTIAL_HARD      Return PCRE_ERROR_PARTIAL for a partial match
+                           if that is found before a full match
+
+For details of partial matching, see the +pcrepartial +page. A pcre_extra structure contains the following fields: +
+  flags            Bits indicating which fields are set
+  study_data       Opaque data from pcre[16|32]_study()
+  match_limit      Limit on internal resource use
+  match_limit_recursion  Limit on internal recursion depth
+  callout_data     Opaque data passed back to callouts
+  tables           Points to character tables or is NULL
+  mark             For passing back a *MARK pointer
+  executable_jit   Opaque data from JIT compilation
+
+The flag bits are PCRE_EXTRA_STUDY_DATA, PCRE_EXTRA_MATCH_LIMIT, +PCRE_EXTRA_MATCH_LIMIT_RECURSION, PCRE_EXTRA_CALLOUT_DATA, +PCRE_EXTRA_TABLES, PCRE_EXTRA_MARK and PCRE_EXTRA_EXECUTABLE_JIT. +

+

+There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_free_study.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_free_study.html new file mode 100644 index 0000000000000000000000000000000000000000..7f9e10e863279fe99336500dbf8ce7b93e413347 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_free_study.html @@ -0,0 +1,46 @@ + + +pcre_free_study specification + + +

pcre_free_study man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre.h> +

+

+void pcre_free_study(pcre_extra *extra); +

+

+void pcre16_free_study(pcre16_extra *extra); +

+

+void pcre32_free_study(pcre32_extra *extra); +

+
+DESCRIPTION +
+

+This function is used to free the memory used for the data generated by a call +to pcre[16|32]_study() when it is no longer needed. The argument must be the +result of such a call. +

+

+There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_free_substring.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_free_substring.html new file mode 100644 index 0000000000000000000000000000000000000000..1fe6610746337d54ea35d0c7834342241a26ea8d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_free_substring.html @@ -0,0 +1,46 @@ + + +pcre_free_substring specification + + +

pcre_free_substring man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre.h> +

+

+void pcre_free_substring(const char *stringptr); +

+

+void pcre16_free_substring(PCRE_SPTR16 stringptr); +

+

+void pcre32_free_substring(PCRE_SPTR32 stringptr); +

+
+DESCRIPTION +
+

+This is a convenience function for freeing the store obtained by a previous +call to pcre[16|32]_get_substring() or pcre[16|32]_get_named_substring(). +Its only argument is a pointer to the string. +

+

+There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_free_substring_list.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_free_substring_list.html new file mode 100644 index 0000000000000000000000000000000000000000..c0861780b42e0e7e70587639af1b0293ad6c8038 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_free_substring_list.html @@ -0,0 +1,46 @@ + + +pcre_free_substring_list specification + + +

pcre_free_substring_list man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre.h> +

+

+void pcre_free_substring_list(const char **stringptr); +

+

+void pcre16_free_substring_list(PCRE_SPTR16 *stringptr); +

+

+void pcre32_free_substring_list(PCRE_SPTR32 *stringptr); +

+
+DESCRIPTION +
+

+This is a convenience function for freeing the store obtained by a previous +call to pcre[16|32]_get_substring_list(). Its only argument is a pointer to +the list of string pointers. +

+

+There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_fullinfo.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_fullinfo.html new file mode 100644 index 0000000000000000000000000000000000000000..2b7c72b3b98d3d95df10c117fbdbe50a771d8f28 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_fullinfo.html @@ -0,0 +1,118 @@ + + +pcre_fullinfo specification + + +

pcre_fullinfo man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre.h> +

+

+int pcre_fullinfo(const pcre *code, const pcre_extra *extra, + int what, void *where); +
+
+int pcre16_fullinfo(const pcre16 *code, const pcre16_extra *extra, + int what, void *where); +
+
+int pcre32_fullinfo(const pcre32 *code, const pcre32_extra *extra, + int what, void *where); +

+
+DESCRIPTION +
+

+This function returns information about a compiled pattern. Its arguments are: +

+  code                      Compiled regular expression
+  extra                     Result of pcre[16|32]_study() or NULL
+  what                      What information is required
+  where                     Where to put the information
+
+The following information is available: +
+  PCRE_INFO_BACKREFMAX      Number of highest back reference
+  PCRE_INFO_CAPTURECOUNT    Number of capturing subpatterns
+  PCRE_INFO_DEFAULT_TABLES  Pointer to default tables
+  PCRE_INFO_FIRSTBYTE       Fixed first data unit for a match, or
+                              -1 for start of string
+                                 or after newline, or
+                              -2 otherwise
+  PCRE_INFO_FIRSTTABLE      Table of first data units (after studying)
+  PCRE_INFO_HASCRORLF       Return 1 if explicit CR or LF matches exist
+  PCRE_INFO_JCHANGED        Return 1 if (?J) or (?-J) was used
+  PCRE_INFO_JIT             Return 1 after successful JIT compilation
+  PCRE_INFO_JITSIZE         Size of JIT compiled code
+  PCRE_INFO_LASTLITERAL     Literal last data unit required
+  PCRE_INFO_MINLENGTH       Lower bound length of matching strings
+  PCRE_INFO_MATCHEMPTY      Return 1 if the pattern can match an empty string,
+                               0 otherwise
+  PCRE_INFO_MATCHLIMIT      Match limit if set, otherwise PCRE_RROR_UNSET
+  PCRE_INFO_MAXLOOKBEHIND   Length (in characters) of the longest lookbehind assertion
+  PCRE_INFO_NAMECOUNT       Number of named subpatterns
+  PCRE_INFO_NAMEENTRYSIZE   Size of name table entry
+  PCRE_INFO_NAMETABLE       Pointer to name table
+  PCRE_INFO_OKPARTIAL       Return 1 if partial matching can be tried
+                              (always returns 1 after release 8.00)
+  PCRE_INFO_OPTIONS         Option bits used for compilation
+  PCRE_INFO_SIZE            Size of compiled pattern
+  PCRE_INFO_STUDYSIZE       Size of study data
+  PCRE_INFO_FIRSTCHARACTER      Fixed first data unit for a match
+  PCRE_INFO_FIRSTCHARACTERFLAGS Returns
+                                  1 if there is a first data character set, which can
+                                    then be retrieved using PCRE_INFO_FIRSTCHARACTER,
+                                  2 if the first character is at the start of the data
+                                    string or after a newline, and
+                                  0 otherwise
+  PCRE_INFO_RECURSIONLIMIT    Recursion limit if set, otherwise PCRE_ERROR_UNSET
+  PCRE_INFO_REQUIREDCHAR      Literal last data unit required
+  PCRE_INFO_REQUIREDCHARFLAGS Returns 1 if the last data character is set (which can then
+                              be retrieved using PCRE_INFO_REQUIREDCHAR); 0 otherwise
+
+The where argument must point to an integer variable, except for the +following what values: +
+  PCRE_INFO_DEFAULT_TABLES  const uint8_t *
+  PCRE_INFO_FIRSTCHARACTER  uint32_t
+  PCRE_INFO_FIRSTTABLE      const uint8_t *
+  PCRE_INFO_JITSIZE         size_t
+  PCRE_INFO_MATCHLIMIT      uint32_t
+  PCRE_INFO_NAMETABLE       PCRE_SPTR16           (16-bit library)
+  PCRE_INFO_NAMETABLE       PCRE_SPTR32           (32-bit library)
+  PCRE_INFO_NAMETABLE       const unsigned char * (8-bit library)
+  PCRE_INFO_OPTIONS         unsigned long int
+  PCRE_INFO_SIZE            size_t
+  PCRE_INFO_STUDYSIZE       size_t
+  PCRE_INFO_RECURSIONLIMIT  uint32_t
+  PCRE_INFO_REQUIREDCHAR    uint32_t
+
+The yield of the function is zero on success or: +
+  PCRE_ERROR_NULL           the argument code was NULL
+                            the argument where was NULL
+  PCRE_ERROR_BADMAGIC       the "magic number" was not found
+  PCRE_ERROR_BADOPTION      the value of what was invalid
+  PCRE_ERROR_UNSET          the option was not set
+
+

+

+There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_get_named_substring.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_get_named_substring.html new file mode 100644 index 0000000000000000000000000000000000000000..72924d9b252e7a474e34339e8ff884c6bb48d341 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_get_named_substring.html @@ -0,0 +1,68 @@ + + +pcre_get_named_substring specification + + +

pcre_get_named_substring man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre.h> +

+

+int pcre_get_named_substring(const pcre *code, + const char *subject, int *ovector, + int stringcount, const char *stringname, + const char **stringptr); +
+
+int pcre16_get_named_substring(const pcre16 *code, + PCRE_SPTR16 subject, int *ovector, + int stringcount, PCRE_SPTR16 stringname, + PCRE_SPTR16 *stringptr); +
+
+int pcre32_get_named_substring(const pcre32 *code, + PCRE_SPTR32 subject, int *ovector, + int stringcount, PCRE_SPTR32 stringname, + PCRE_SPTR32 *stringptr); +

+
+DESCRIPTION +
+

+This is a convenience function for extracting a captured substring by name. The +arguments are: +

+  code          Compiled pattern
+  subject       Subject that has been successfully matched
+  ovector       Offset vector that pcre[16|32]_exec() used
+  stringcount   Value returned by pcre[16|32]_exec()
+  stringname    Name of the required substring
+  stringptr     Where to put the string pointer
+
+The memory in which the substring is placed is obtained by calling +pcre[16|32]_malloc(). The convenience function +pcre[16|32]_free_substring() can be used to free it when it is no longer +needed. The yield of the function is the length of the extracted substring, +PCRE_ERROR_NOMEMORY if sufficient memory could not be obtained, or +PCRE_ERROR_NOSUBSTRING if the string name is invalid. +

+

+There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_get_stringnumber.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_get_stringnumber.html new file mode 100644 index 0000000000000000000000000000000000000000..7324d782e72c850d1cc72a2073450f4fdedbb21c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_get_stringnumber.html @@ -0,0 +1,57 @@ + + +pcre_get_stringnumber specification + + +

pcre_get_stringnumber man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre.h> +

+

+int pcre_get_stringnumber(const pcre *code, + const char *name); +
+
+int pcre16_get_stringnumber(const pcre16 *code, + PCRE_SPTR16 name); +
+
+int pcre32_get_stringnumber(const pcre32 *code, + PCRE_SPTR32 name); +

+
+DESCRIPTION +
+

+This convenience function finds the number of a named substring capturing +parenthesis in a compiled pattern. Its arguments are: +

+  code    Compiled regular expression
+  name    Name whose number is required
+
+The yield of the function is the number of the parenthesis if the name is +found, or PCRE_ERROR_NOSUBSTRING otherwise. When duplicate names are allowed +(PCRE_DUPNAMES is set), it is not defined which of the numbers is returned by +pcre[16|32]_get_stringnumber(). You can obtain the complete list by calling +pcre[16|32]_get_stringtable_entries(). +

+

+There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_get_stringtable_entries.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_get_stringtable_entries.html new file mode 100644 index 0000000000000000000000000000000000000000..79906798e680543a294a631d843382cbe1735471 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_get_stringtable_entries.html @@ -0,0 +1,60 @@ + + +pcre_get_stringtable_entries specification + + +

pcre_get_stringtable_entries man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre.h> +

+

+int pcre_get_stringtable_entries(const pcre *code, + const char *name, char **first, char **last); +
+
+int pcre16_get_stringtable_entries(const pcre16 *code, + PCRE_SPTR16 name, PCRE_UCHAR16 **first, PCRE_UCHAR16 **last); +
+
+int pcre32_get_stringtable_entries(const pcre32 *code, + PCRE_SPTR32 name, PCRE_UCHAR32 **first, PCRE_UCHAR32 **last); +

+
+DESCRIPTION +
+

+This convenience function finds, for a compiled pattern, the first and last +entries for a given name in the table that translates capturing parenthesis +names into numbers. When names are required to be unique (PCRE_DUPNAMES is +not set), it is usually easier to use pcre[16|32]_get_stringnumber() +instead. +

+  code    Compiled regular expression
+  name    Name whose entries required
+  first   Where to return a pointer to the first entry
+  last    Where to return a pointer to the last entry
+
+The yield of the function is the length of each entry, or +PCRE_ERROR_NOSUBSTRING if none are found. +

+

+There is a complete description of the PCRE native API, including the format of +the table entries, in the +pcreapi +page, and a description of the POSIX API in the +pcreposix +page. +

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_get_substring.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_get_substring.html new file mode 100644 index 0000000000000000000000000000000000000000..1a8e4f5a4992c61544fe85585cc36a2932327b5f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_get_substring.html @@ -0,0 +1,64 @@ + + +pcre_get_substring specification + + +

pcre_get_substring man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre.h> +

+

+int pcre_get_substring(const char *subject, int *ovector, + int stringcount, int stringnumber, + const char **stringptr); +
+
+int pcre16_get_substring(PCRE_SPTR16 subject, int *ovector, + int stringcount, int stringnumber, + PCRE_SPTR16 *stringptr); +
+
+int pcre32_get_substring(PCRE_SPTR32 subject, int *ovector, + int stringcount, int stringnumber, + PCRE_SPTR32 *stringptr); +

+
+DESCRIPTION +
+

+This is a convenience function for extracting a captured substring. The +arguments are: +

+  subject       Subject that has been successfully matched
+  ovector       Offset vector that pcre[16|32]_exec() used
+  stringcount   Value returned by pcre[16|32]_exec()
+  stringnumber  Number of the required substring
+  stringptr     Where to put the string pointer
+
+The memory in which the substring is placed is obtained by calling +pcre[16|32]_malloc(). The convenience function +pcre[16|32]_free_substring() can be used to free it when it is no longer +needed. The yield of the function is the length of the substring, +PCRE_ERROR_NOMEMORY if sufficient memory could not be obtained, or +PCRE_ERROR_NOSUBSTRING if the string number is invalid. +

+

+There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_get_substring_list.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_get_substring_list.html new file mode 100644 index 0000000000000000000000000000000000000000..7e8c6bc85843f6081500b8d2040f5b07c559bebd --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_get_substring_list.html @@ -0,0 +1,61 @@ + + +pcre_get_substring_list specification + + +

pcre_get_substring_list man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre.h> +

+

+int pcre_get_substring_list(const char *subject, + int *ovector, int stringcount, const char ***listptr); +
+
+int pcre16_get_substring_list(PCRE_SPTR16 subject, + int *ovector, int stringcount, PCRE_SPTR16 **listptr); +
+
+int pcre32_get_substring_list(PCRE_SPTR32 subject, + int *ovector, int stringcount, PCRE_SPTR32 **listptr); +

+
+DESCRIPTION +
+

+This is a convenience function for extracting a list of all the captured +substrings. The arguments are: +

+  subject       Subject that has been successfully matched
+  ovector       Offset vector that pcre[16|32]_exec used
+  stringcount   Value returned by pcre[16|32]_exec
+  listptr       Where to put a pointer to the list
+
+The memory in which the substrings and the list are placed is obtained by +calling pcre[16|32]_malloc(). The convenience function +pcre[16|32]_free_substring_list() can be used to free it when it is no +longer needed. A pointer to a list of pointers is put in the variable whose +address is in listptr. The list is terminated by a NULL pointer. The +yield of the function is zero on success or PCRE_ERROR_NOMEMORY if sufficient +memory could not be obtained. +

+

+There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_jit_exec.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_jit_exec.html new file mode 100644 index 0000000000000000000000000000000000000000..4ebb0cbcac40eb75b7bc20781594763fe2925dd1 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_jit_exec.html @@ -0,0 +1,108 @@ + + +pcre_jit_exec specification + + +

pcre_jit_exec man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre.h> +

+

+int pcre_jit_exec(const pcre *code, const pcre_extra *extra, + const char *subject, int length, int startoffset, + int options, int *ovector, int ovecsize, + pcre_jit_stack *jstack); +
+
+int pcre16_jit_exec(const pcre16 *code, const pcre16_extra *extra, + PCRE_SPTR16 subject, int length, int startoffset, + int options, int *ovector, int ovecsize, + pcre_jit_stack *jstack); +
+
+int pcre32_jit_exec(const pcre32 *code, const pcre32_extra *extra, + PCRE_SPTR32 subject, int length, int startoffset, + int options, int *ovector, int ovecsize, + pcre_jit_stack *jstack); +

+
+DESCRIPTION +
+

+This function matches a compiled regular expression that has been successfully +studied with one of the JIT options against a given subject string, using a +matching algorithm that is similar to Perl's. It is a "fast path" interface to +JIT, and it bypasses some of the sanity checks that pcre_exec() applies. +It returns offsets to captured substrings. Its arguments are: +

+  code         Points to the compiled pattern
+  extra        Points to an associated pcre[16|32]_extra structure,
+                 or is NULL
+  subject      Points to the subject string
+  length       Length of the subject string, in bytes
+  startoffset  Offset in bytes in the subject at which to
+                 start matching
+  options      Option bits
+  ovector      Points to a vector of ints for result offsets
+  ovecsize     Number of elements in the vector (a multiple of 3)
+  jstack       Pointer to a JIT stack
+
+The allowed options are: +
+  PCRE_NOTBOL            Subject string is not the beginning of a line
+  PCRE_NOTEOL            Subject string is not the end of a line
+  PCRE_NOTEMPTY          An empty string is not a valid match
+  PCRE_NOTEMPTY_ATSTART  An empty string at the start of the subject
+                           is not a valid match
+  PCRE_NO_UTF16_CHECK    Do not check the subject for UTF-16
+                           validity (only relevant if PCRE_UTF16
+                           was set at compile time)
+  PCRE_NO_UTF32_CHECK    Do not check the subject for UTF-32
+                           validity (only relevant if PCRE_UTF32
+                           was set at compile time)
+  PCRE_NO_UTF8_CHECK     Do not check the subject for UTF-8
+                           validity (only relevant if PCRE_UTF8
+                           was set at compile time)
+  PCRE_PARTIAL           ) Return PCRE_ERROR_PARTIAL for a partial
+  PCRE_PARTIAL_SOFT      )   match if no full matches are found
+  PCRE_PARTIAL_HARD      Return PCRE_ERROR_PARTIAL for a partial match
+                           if that is found before a full match
+
+However, the PCRE_NO_UTF[8|16|32]_CHECK options have no effect, as this check +is never applied. For details of partial matching, see the +pcrepartial +page. A pcre_extra structure contains the following fields: +
+  flags            Bits indicating which fields are set
+  study_data       Opaque data from pcre[16|32]_study()
+  match_limit      Limit on internal resource use
+  match_limit_recursion  Limit on internal recursion depth
+  callout_data     Opaque data passed back to callouts
+  tables           Points to character tables or is NULL
+  mark             For passing back a *MARK pointer
+  executable_jit   Opaque data from JIT compilation
+
+The flag bits are PCRE_EXTRA_STUDY_DATA, PCRE_EXTRA_MATCH_LIMIT, +PCRE_EXTRA_MATCH_LIMIT_RECURSION, PCRE_EXTRA_CALLOUT_DATA, +PCRE_EXTRA_TABLES, PCRE_EXTRA_MARK and PCRE_EXTRA_EXECUTABLE_JIT. +

+

+There is a complete description of the PCRE native API in the +pcreapi +page and a description of the JIT API in the +pcrejit +page. +

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_jit_stack_alloc.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_jit_stack_alloc.html new file mode 100644 index 0000000000000000000000000000000000000000..23ba450750c9927911c8ec19796045b0183f9ec2 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_jit_stack_alloc.html @@ -0,0 +1,55 @@ + + +pcre_jit_stack_alloc specification + + +

pcre_jit_stack_alloc man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre.h> +

+

+pcre_jit_stack *pcre_jit_stack_alloc(int startsize, + int maxsize); +
+
+pcre16_jit_stack *pcre16_jit_stack_alloc(int startsize, + int maxsize); +
+
+pcre32_jit_stack *pcre32_jit_stack_alloc(int startsize, + int maxsize); +

+
+DESCRIPTION +
+

+This function is used to create a stack for use by the code compiled by the JIT +optimization of pcre[16|32]_study(). The arguments are a starting size for +the stack, and a maximum size to which it is allowed to grow. The result can be +passed to the JIT run-time code by pcre[16|32]_assign_jit_stack(), or that +function can set up a callback for obtaining a stack. A maximum stack size of +512K to 1M should be more than enough for any pattern. For more details, see +the +pcrejit +page. +

+

+There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_jit_stack_free.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_jit_stack_free.html new file mode 100644 index 0000000000000000000000000000000000000000..8bd06e4655a9c61dcee44e56d7cd647b35418906 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_jit_stack_free.html @@ -0,0 +1,48 @@ + + +pcre_jit_stack_free specification + + +

pcre_jit_stack_free man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre.h> +

+

+void pcre_jit_stack_free(pcre_jit_stack *stack); +

+

+void pcre16_jit_stack_free(pcre16_jit_stack *stack); +

+

+void pcre32_jit_stack_free(pcre32_jit_stack *stack); +

+
+DESCRIPTION +
+

+This function is used to free a JIT stack that was created by +pcre[16|32]_jit_stack_alloc() when it is no longer needed. For more details, +see the +pcrejit +page. +

+

+There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_maketables.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_maketables.html new file mode 100644 index 0000000000000000000000000000000000000000..3a7b5ebc4a9bc5d9d8a5943d524e6e1580dc4e2d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_maketables.html @@ -0,0 +1,48 @@ + + +pcre_maketables specification + + +

pcre_maketables man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre.h> +

+

+const unsigned char *pcre_maketables(void); +

+

+const unsigned char *pcre16_maketables(void); +

+

+const unsigned char *pcre32_maketables(void); +

+
+DESCRIPTION +
+

+This function builds a set of character tables for character values less than +256. These can be passed to pcre[16|32]_compile() to override PCRE's +internal, built-in tables (which were made by pcre[16|32]_maketables() when +PCRE was compiled). You might want to do this if you are using a non-standard +locale. The function yields a pointer to the tables. +

+

+There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_pattern_to_host_byte_order.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_pattern_to_host_byte_order.html new file mode 100644 index 0000000000000000000000000000000000000000..1b1c80372b81dc3ac4eae17cf06f1710132c2ef7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_pattern_to_host_byte_order.html @@ -0,0 +1,58 @@ + + +pcre_pattern_to_host_byte_order specification + + +

pcre_pattern_to_host_byte_order man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre.h> +

+

+int pcre_pattern_to_host_byte_order(pcre *code, + pcre_extra *extra, const unsigned char *tables); +
+
+int pcre16_pattern_to_host_byte_order(pcre16 *code, + pcre16_extra *extra, const unsigned char *tables); +
+
+int pcre32_pattern_to_host_byte_order(pcre32 *code, + pcre32_extra *extra, const unsigned char *tables); +

+
+DESCRIPTION +
+

+This function ensures that the bytes in 2-byte and 4-byte values in a compiled +pattern are in the correct order for the current host. It is useful when a +pattern that has been compiled on one host is transferred to another that might +have different endianness. The arguments are: +

+  code         A compiled regular expression
+  extra        Points to an associated pcre[16|32]_extra structure,
+                 or is NULL
+  tables       Pointer to character tables, or NULL to
+                 set the built-in default
+
+The result is 0 for success, a negative PCRE_ERROR_xxx value otherwise. +

+

+There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_refcount.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_refcount.html new file mode 100644 index 0000000000000000000000000000000000000000..bfb92e6d8a9f8f365f78eb14d28f78170f664f6b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_refcount.html @@ -0,0 +1,51 @@ + + +pcre_refcount specification + + +

pcre_refcount man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre.h> +

+

+int pcre_refcount(pcre *code, int adjust); +

+

+int pcre16_refcount(pcre16 *code, int adjust); +

+

+int pcre32_refcount(pcre32 *code, int adjust); +

+
+DESCRIPTION +
+

+This function is used to maintain a reference count inside a data block that +contains a compiled pattern. Its arguments are: +

+  code                      Compiled regular expression
+  adjust                    Adjustment to reference value
+
+The yield of the function is the adjusted reference value, which is constrained +to lie between 0 and 65535. +

+

+There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_study.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_study.html new file mode 100644 index 0000000000000000000000000000000000000000..af82f11409d9bd1d63952ec645a24667fae5940a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_study.html @@ -0,0 +1,68 @@ + + +pcre_study specification + + +

pcre_study man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre.h> +

+

+pcre_extra *pcre_study(const pcre *code, int options, + const char **errptr); +
+
+pcre16_extra *pcre16_study(const pcre16 *code, int options, + const char **errptr); +
+
+pcre32_extra *pcre32_study(const pcre32 *code, int options, + const char **errptr); +

+
+DESCRIPTION +
+

+This function studies a compiled pattern, to see if additional information can +be extracted that might speed up matching. Its arguments are: +

+  code       A compiled regular expression
+  options    Options for pcre[16|32]_study()
+  errptr     Where to put an error message
+
+If the function succeeds, it returns a value that can be passed to +pcre[16|32]_exec() or pcre[16|32]_dfa_exec() via their extra +arguments. +

+

+If the function returns NULL, either it could not find any additional +information, or there was an error. You can tell the difference by looking at +the error value. It is NULL in first case. +

+

+The only option is PCRE_STUDY_JIT_COMPILE. It requests just-in-time compilation +if possible. If PCRE has been compiled without JIT support, this option is +ignored. See the +pcrejit +page for further details. +

+

+There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_utf16_to_host_byte_order.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_utf16_to_host_byte_order.html new file mode 100644 index 0000000000000000000000000000000000000000..18e7788f6826451c596e3b0887395e85252348a8 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_utf16_to_host_byte_order.html @@ -0,0 +1,57 @@ + + +pcre_utf16_to_host_byte_order specification + + +

pcre_utf16_to_host_byte_order man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre.h> +

+

+int pcre16_utf16_to_host_byte_order(PCRE_UCHAR16 *output, + PCRE_SPTR16 input, int length, int *host_byte_order, + int keep_boms); +

+
+DESCRIPTION +
+

+This function, which exists only in the 16-bit library, converts a UTF-16 +string to the correct order for the current host, taking account of any byte +order marks (BOMs) within the string. Its arguments are: +

+  output           pointer to output buffer, may be the same as input
+  input            pointer to input buffer
+  length           number of 16-bit units in the input, or negative for
+                     a zero-terminated string
+  host_byte_order  a NULL value or a non-zero value pointed to means
+                     start in host byte order
+  keep_boms        if non-zero, BOMs are copied to the output string
+
+The result of the function is the number of 16-bit units placed into the output +buffer, including the zero terminator if the string was zero-terminated. +

+

+If host_byte_order is not NULL, it is set to indicate the byte order that +is current at the end of the string. +

+

+There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_utf32_to_host_byte_order.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_utf32_to_host_byte_order.html new file mode 100644 index 0000000000000000000000000000000000000000..772ae40cd9285f6c7f22279ffcf60cf81aedca5c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_utf32_to_host_byte_order.html @@ -0,0 +1,57 @@ + + +pcre_utf32_to_host_byte_order specification + + +

pcre_utf32_to_host_byte_order man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre.h> +

+

+int pcre32_utf32_to_host_byte_order(PCRE_UCHAR32 *output, + PCRE_SPTR32 input, int length, int *host_byte_order, + int keep_boms); +

+
+DESCRIPTION +
+

+This function, which exists only in the 32-bit library, converts a UTF-32 +string to the correct order for the current host, taking account of any byte +order marks (BOMs) within the string. Its arguments are: +

+  output           pointer to output buffer, may be the same as input
+  input            pointer to input buffer
+  length           number of 32-bit units in the input, or negative for
+                     a zero-terminated string
+  host_byte_order  a NULL value or a non-zero value pointed to means
+                     start in host byte order
+  keep_boms        if non-zero, BOMs are copied to the output string
+
+The result of the function is the number of 32-bit units placed into the output +buffer, including the zero terminator if the string was zero-terminated. +

+

+If host_byte_order is not NULL, it is set to indicate the byte order that +is current at the end of the string. +

+

+There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_version.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_version.html new file mode 100644 index 0000000000000000000000000000000000000000..d33e7189559a09134e02da4570a3bf75a14c993f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcre_version.html @@ -0,0 +1,46 @@ + + +pcre_version specification + + +

pcre_version man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre.h> +

+

+const char *pcre_version(void); +

+

+const char *pcre16_version(void); +

+

+const char *pcre32_version(void); +

+
+DESCRIPTION +
+

+This function (even in the 16-bit and 32-bit libraries) returns a +zero-terminated, 8-bit character string that gives the version number of the +PCRE library and the date of its release. +

+

+There is a complete description of the PCRE native API in the +pcreapi +page and a description of the POSIX API in the +pcreposix +page. +

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcreapi.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcreapi.html new file mode 100644 index 0000000000000000000000000000000000000000..2a0491f0f82fa76417d5e9735cd98c1a6dba2e9b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcreapi.html @@ -0,0 +1,2921 @@ + + +pcreapi specification + + +

pcreapi man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+

+

+#include <pcre.h> +

+
PCRE NATIVE API BASIC FUNCTIONS
+

+pcre *pcre_compile(const char *pattern, int options, + const char **errptr, int *erroffset, + const unsigned char *tableptr); +
+
+pcre *pcre_compile2(const char *pattern, int options, + int *errorcodeptr, + const char **errptr, int *erroffset, + const unsigned char *tableptr); +
+
+pcre_extra *pcre_study(const pcre *code, int options, + const char **errptr); +
+
+void pcre_free_study(pcre_extra *extra); +
+
+int pcre_exec(const pcre *code, const pcre_extra *extra, + const char *subject, int length, int startoffset, + int options, int *ovector, int ovecsize); +
+
+int pcre_dfa_exec(const pcre *code, const pcre_extra *extra, + const char *subject, int length, int startoffset, + int options, int *ovector, int ovecsize, + int *workspace, int wscount); +

+
PCRE NATIVE API STRING EXTRACTION FUNCTIONS
+

+int pcre_copy_named_substring(const pcre *code, + const char *subject, int *ovector, + int stringcount, const char *stringname, + char *buffer, int buffersize); +
+
+int pcre_copy_substring(const char *subject, int *ovector, + int stringcount, int stringnumber, char *buffer, + int buffersize); +
+
+int pcre_get_named_substring(const pcre *code, + const char *subject, int *ovector, + int stringcount, const char *stringname, + const char **stringptr); +
+
+int pcre_get_stringnumber(const pcre *code, + const char *name); +
+
+int pcre_get_stringtable_entries(const pcre *code, + const char *name, char **first, char **last); +
+
+int pcre_get_substring(const char *subject, int *ovector, + int stringcount, int stringnumber, + const char **stringptr); +
+
+int pcre_get_substring_list(const char *subject, + int *ovector, int stringcount, const char ***listptr); +
+
+void pcre_free_substring(const char *stringptr); +
+
+void pcre_free_substring_list(const char **stringptr); +

+
PCRE NATIVE API AUXILIARY FUNCTIONS
+

+int pcre_jit_exec(const pcre *code, const pcre_extra *extra, + const char *subject, int length, int startoffset, + int options, int *ovector, int ovecsize, + pcre_jit_stack *jstack); +
+
+pcre_jit_stack *pcre_jit_stack_alloc(int startsize, int maxsize); +
+
+void pcre_jit_stack_free(pcre_jit_stack *stack); +
+
+void pcre_assign_jit_stack(pcre_extra *extra, + pcre_jit_callback callback, void *data); +
+
+const unsigned char *pcre_maketables(void); +
+
+int pcre_fullinfo(const pcre *code, const pcre_extra *extra, + int what, void *where); +
+
+int pcre_refcount(pcre *code, int adjust); +
+
+int pcre_config(int what, void *where); +
+
+const char *pcre_version(void); +
+
+int pcre_pattern_to_host_byte_order(pcre *code, + pcre_extra *extra, const unsigned char *tables); +

+
PCRE NATIVE API INDIRECTED FUNCTIONS
+

+void *(*pcre_malloc)(size_t); +
+
+void (*pcre_free)(void *); +
+
+void *(*pcre_stack_malloc)(size_t); +
+
+void (*pcre_stack_free)(void *); +
+
+int (*pcre_callout)(pcre_callout_block *); +
+
+int (*pcre_stack_guard)(void); +

+
PCRE 8-BIT, 16-BIT, AND 32-BIT LIBRARIES
+

+As well as support for 8-bit character strings, PCRE also supports 16-bit +strings (from release 8.30) and 32-bit strings (from release 8.32), by means of +two additional libraries. They can be built as well as, or instead of, the +8-bit library. To avoid too much complication, this document describes the +8-bit versions of the functions, with only occasional references to the 16-bit +and 32-bit libraries. +

+

+The 16-bit and 32-bit functions operate in the same way as their 8-bit +counterparts; they just use different data types for their arguments and +results, and their names start with pcre16_ or pcre32_ instead of +pcre_. For every option that has UTF8 in its name (for example, +PCRE_UTF8), there are corresponding 16-bit and 32-bit names with UTF8 replaced +by UTF16 or UTF32, respectively. This facility is in fact just cosmetic; the +16-bit and 32-bit option names define the same bit values. +

+

+References to bytes and UTF-8 in this document should be read as references to +16-bit data units and UTF-16 when using the 16-bit library, or 32-bit data +units and UTF-32 when using the 32-bit library, unless specified otherwise. +More details of the specific differences for the 16-bit and 32-bit libraries +are given in the +pcre16 +and +pcre32 +pages. +

+
PCRE API OVERVIEW
+

+PCRE has its own native API, which is described in this document. There are +also some wrapper functions (for the 8-bit library only) that correspond to the +POSIX regular expression API, but they do not give access to all the +functionality. They are described in the +pcreposix +documentation. Both of these APIs define a set of C function calls. A C++ +wrapper (again for the 8-bit library only) is also distributed with PCRE. It is +documented in the +pcrecpp +page. +

+

+The native API C function prototypes are defined in the header file +pcre.h, and on Unix-like systems the (8-bit) library itself is called +libpcre. It can normally be accessed by adding -lpcre to the +command for linking an application that uses PCRE. The header file defines the +macros PCRE_MAJOR and PCRE_MINOR to contain the major and minor release numbers +for the library. Applications can use these to include support for different +releases of PCRE. +

+

+In a Windows environment, if you want to statically link an application program +against a non-dll pcre.a file, you must define PCRE_STATIC before +including pcre.h or pcrecpp.h, because otherwise the +pcre_malloc() and pcre_free() exported functions will be declared +__declspec(dllimport), with unwanted results. +

+

+The functions pcre_compile(), pcre_compile2(), pcre_study(), +and pcre_exec() are used for compiling and matching regular expressions +in a Perl-compatible manner. A sample program that demonstrates the simplest +way of using them is provided in the file called pcredemo.c in the PCRE +source distribution. A listing of this program is given in the +pcredemo +documentation, and the +pcresample +documentation describes how to compile and run it. +

+

+Just-in-time compiler support is an optional feature of PCRE that can be built +in appropriate hardware environments. It greatly speeds up the matching +performance of many patterns. Simple programs can easily request that it be +used if available, by setting an option that is ignored when it is not +relevant. More complicated programs might need to make use of the functions +pcre_jit_stack_alloc(), pcre_jit_stack_free(), and +pcre_assign_jit_stack() in order to control the JIT code's memory usage. +

+

+From release 8.32 there is also a direct interface for JIT execution, which +gives improved performance. The JIT-specific functions are discussed in the +pcrejit +documentation. +

+

+A second matching function, pcre_dfa_exec(), which is not +Perl-compatible, is also provided. This uses a different algorithm for the +matching. The alternative algorithm finds all possible matches (at a given +point in the subject), and scans the subject just once (unless there are +lookbehind assertions). However, this algorithm does not return captured +substrings. A description of the two matching algorithms and their advantages +and disadvantages is given in the +pcrematching +documentation. +

+

+In addition to the main compiling and matching functions, there are convenience +functions for extracting captured substrings from a subject string that is +matched by pcre_exec(). They are: +

+  pcre_copy_substring()
+  pcre_copy_named_substring()
+  pcre_get_substring()
+  pcre_get_named_substring()
+  pcre_get_substring_list()
+  pcre_get_stringnumber()
+  pcre_get_stringtable_entries()
+
+pcre_free_substring() and pcre_free_substring_list() are also +provided, to free the memory used for extracted strings. +

+

+The function pcre_maketables() is used to build a set of character tables +in the current locale for passing to pcre_compile(), pcre_exec(), +or pcre_dfa_exec(). This is an optional facility that is provided for +specialist use. Most commonly, no special tables are passed, in which case +internal tables that are generated when PCRE is built are used. +

+

+The function pcre_fullinfo() is used to find out information about a +compiled pattern. The function pcre_version() returns a pointer to a +string containing the version of PCRE and its date of release. +

+

+The function pcre_refcount() maintains a reference count in a data block +containing a compiled pattern. This is provided for the benefit of +object-oriented applications. +

+

+The global variables pcre_malloc and pcre_free initially contain +the entry points of the standard malloc() and free() functions, +respectively. PCRE calls the memory management functions via these variables, +so a calling program can replace them if it wishes to intercept the calls. This +should be done before calling any PCRE functions. +

+

+The global variables pcre_stack_malloc and pcre_stack_free are also +indirections to memory management functions. These special functions are used +only when PCRE is compiled to use the heap for remembering data, instead of +recursive function calls, when running the pcre_exec() function. See the +pcrebuild +documentation for details of how to do this. It is a non-standard way of +building PCRE, for use in environments that have limited stacks. Because of the +greater use of memory management, it runs more slowly. Separate functions are +provided so that special-purpose external code can be used for this case. When +used, these functions always allocate memory blocks of the same size. There is +a discussion about PCRE's stack usage in the +pcrestack +documentation. +

+

+The global variable pcre_callout initially contains NULL. It can be set +by the caller to a "callout" function, which PCRE will then call at specified +points during a matching operation. Details are given in the +pcrecallout +documentation. +

+

+The global variable pcre_stack_guard initially contains NULL. It can be +set by the caller to a function that is called by PCRE whenever it starts +to compile a parenthesized part of a pattern. When parentheses are nested, PCRE +uses recursive function calls, which use up the system stack. This function is +provided so that applications with restricted stacks can force a compilation +error if the stack runs out. The function should return zero if all is well, or +non-zero to force an error. +

+
NEWLINES
+

+PCRE supports five different conventions for indicating line breaks in +strings: a single CR (carriage return) character, a single LF (linefeed) +character, the two-character sequence CRLF, any of the three preceding, or any +Unicode newline sequence. The Unicode newline sequences are the three just +mentioned, plus the single characters VT (vertical tab, U+000B), FF (form feed, +U+000C), NEL (next line, U+0085), LS (line separator, U+2028), and PS +(paragraph separator, U+2029). +

+

+Each of the first three conventions is used by at least one operating system as +its standard newline sequence. When PCRE is built, a default can be specified. +The default default is LF, which is the Unix standard. When PCRE is run, the +default can be overridden, either when a pattern is compiled, or when it is +matched. +

+

+At compile time, the newline convention can be specified by the options +argument of pcre_compile(), or it can be specified by special text at the +start of the pattern itself; this overrides any other settings. See the +pcrepattern +page for details of the special character sequences. +

+

+In the PCRE documentation the word "newline" is used to mean "the character or +pair of characters that indicate a line break". The choice of newline +convention affects the handling of the dot, circumflex, and dollar +metacharacters, the handling of #-comments in /x mode, and, when CRLF is a +recognized line ending sequence, the match position advancement for a +non-anchored pattern. There is more detail about this in the +section on pcre_exec() options +below. +

+

+The choice of newline convention does not affect the interpretation of +the \n or \r escape sequences, nor does it affect what \R matches, which is +controlled in a similar way, but by separate options. +

+
MULTITHREADING
+

+The PCRE functions can be used in multi-threading applications, with the +proviso that the memory management functions pointed to by pcre_malloc, +pcre_free, pcre_stack_malloc, and pcre_stack_free, and the +callout and stack-checking functions pointed to by pcre_callout and +pcre_stack_guard, are shared by all threads. +

+

+The compiled form of a regular expression is not altered during matching, so +the same compiled pattern can safely be used by several threads at once. +

+

+If the just-in-time optimization feature is being used, it needs separate +memory stack areas for each thread. See the +pcrejit +documentation for more details. +

+
SAVING PRECOMPILED PATTERNS FOR LATER USE
+

+The compiled form of a regular expression can be saved and re-used at a later +time, possibly by a different program, and even on a host other than the one on +which it was compiled. Details are given in the +pcreprecompile +documentation, which includes a description of the +pcre_pattern_to_host_byte_order() function. However, compiling a regular +expression with one version of PCRE for use with a different version is not +guaranteed to work and may cause crashes. +

+
CHECKING BUILD-TIME OPTIONS
+

+int pcre_config(int what, void *where); +

+

+The function pcre_config() makes it possible for a PCRE client to +discover which optional features have been compiled into the PCRE library. The +pcrebuild +documentation has more details about these optional features. +

+

+The first argument for pcre_config() is an integer, specifying which +information is required; the second argument is a pointer to a variable into +which the information is placed. The returned value is zero on success, or the +negative error code PCRE_ERROR_BADOPTION if the value in the first argument is +not recognized. The following information is available: +

+  PCRE_CONFIG_UTF8
+
+The output is an integer that is set to one if UTF-8 support is available; +otherwise it is set to zero. This value should normally be given to the 8-bit +version of this function, pcre_config(). If it is given to the 16-bit +or 32-bit version of this function, the result is PCRE_ERROR_BADOPTION. +
+  PCRE_CONFIG_UTF16
+
+The output is an integer that is set to one if UTF-16 support is available; +otherwise it is set to zero. This value should normally be given to the 16-bit +version of this function, pcre16_config(). If it is given to the 8-bit +or 32-bit version of this function, the result is PCRE_ERROR_BADOPTION. +
+  PCRE_CONFIG_UTF32
+
+The output is an integer that is set to one if UTF-32 support is available; +otherwise it is set to zero. This value should normally be given to the 32-bit +version of this function, pcre32_config(). If it is given to the 8-bit +or 16-bit version of this function, the result is PCRE_ERROR_BADOPTION. +
+  PCRE_CONFIG_UNICODE_PROPERTIES
+
+The output is an integer that is set to one if support for Unicode character +properties is available; otherwise it is set to zero. +
+  PCRE_CONFIG_JIT
+
+The output is an integer that is set to one if support for just-in-time +compiling is available; otherwise it is set to zero. +
+  PCRE_CONFIG_JITTARGET
+
+The output is a pointer to a zero-terminated "const char *" string. If JIT +support is available, the string contains the name of the architecture for +which the JIT compiler is configured, for example "x86 32bit (little endian + +unaligned)". If JIT support is not available, the result is NULL. +
+  PCRE_CONFIG_NEWLINE
+
+The output is an integer whose value specifies the default character sequence +that is recognized as meaning "newline". The values that are supported in +ASCII/Unicode environments are: 10 for LF, 13 for CR, 3338 for CRLF, -2 for +ANYCRLF, and -1 for ANY. In EBCDIC environments, CR, ANYCRLF, and ANY yield the +same values. However, the value for LF is normally 21, though some EBCDIC +environments use 37. The corresponding values for CRLF are 3349 and 3365. The +default should normally correspond to the standard sequence for your operating +system. +
+  PCRE_CONFIG_BSR
+
+The output is an integer whose value indicates what character sequences the \R +escape sequence matches by default. A value of 0 means that \R matches any +Unicode line ending sequence; a value of 1 means that \R matches only CR, LF, +or CRLF. The default can be overridden when a pattern is compiled or matched. +
+  PCRE_CONFIG_LINK_SIZE
+
+The output is an integer that contains the number of bytes used for internal +linkage in compiled regular expressions. For the 8-bit library, the value can +be 2, 3, or 4. For the 16-bit library, the value is either 2 or 4 and is still +a number of bytes. For the 32-bit library, the value is either 2 or 4 and is +still a number of bytes. The default value of 2 is sufficient for all but the +most massive patterns, since it allows the compiled pattern to be up to 64K in +size. Larger values allow larger regular expressions to be compiled, at the +expense of slower matching. +
+  PCRE_CONFIG_POSIX_MALLOC_THRESHOLD
+
+The output is an integer that contains the threshold above which the POSIX +interface uses malloc() for output vectors. Further details are given in +the +pcreposix +documentation. +
+  PCRE_CONFIG_PARENS_LIMIT
+
+The output is a long integer that gives the maximum depth of nesting of +parentheses (of any kind) in a pattern. This limit is imposed to cap the amount +of system stack used when a pattern is compiled. It is specified when PCRE is +built; the default is 250. This limit does not take into account the stack that +may already be used by the calling application. For finer control over +compilation stack usage, you can set a pointer to an external checking function +in pcre_stack_guard. +
+  PCRE_CONFIG_MATCH_LIMIT
+
+The output is a long integer that gives the default limit for the number of +internal matching function calls in a pcre_exec() execution. Further +details are given with pcre_exec() below. +
+  PCRE_CONFIG_MATCH_LIMIT_RECURSION
+
+The output is a long integer that gives the default limit for the depth of +recursion when calling the internal matching function in a pcre_exec() +execution. Further details are given with pcre_exec() below. +
+  PCRE_CONFIG_STACKRECURSE
+
+The output is an integer that is set to one if internal recursion when running +pcre_exec() is implemented by recursive function calls that use the stack +to remember their state. This is the usual way that PCRE is compiled. The +output is zero if PCRE was compiled to use blocks of data on the heap instead +of recursive function calls. In this case, pcre_stack_malloc and +pcre_stack_free are called to manage memory blocks on the heap, thus +avoiding the use of the stack. +

+
COMPILING A PATTERN
+

+pcre *pcre_compile(const char *pattern, int options, + const char **errptr, int *erroffset, + const unsigned char *tableptr); +
+
+pcre *pcre_compile2(const char *pattern, int options, + int *errorcodeptr, + const char **errptr, int *erroffset, + const unsigned char *tableptr); +

+

+Either of the functions pcre_compile() or pcre_compile2() can be +called to compile a pattern into an internal form. The only difference between +the two interfaces is that pcre_compile2() has an additional argument, +errorcodeptr, via which a numerical error code can be returned. To avoid +too much repetition, we refer just to pcre_compile() below, but the +information applies equally to pcre_compile2(). +

+

+The pattern is a C string terminated by a binary zero, and is passed in the +pattern argument. A pointer to a single block of memory that is obtained +via pcre_malloc is returned. This contains the compiled code and related +data. The pcre type is defined for the returned block; this is a typedef +for a structure whose contents are not externally defined. It is up to the +caller to free the memory (via pcre_free) when it is no longer required. +

+

+Although the compiled code of a PCRE regex is relocatable, that is, it does not +depend on memory location, the complete pcre data block is not +fully relocatable, because it may contain a copy of the tableptr +argument, which is an address (see below). +

+

+The options argument contains various bit settings that affect the +compilation. It should be zero if no options are required. The available +options are described below. Some of them (in particular, those that are +compatible with Perl, but some others as well) can also be set and unset from +within the pattern (see the detailed description in the +pcrepattern +documentation). For those options that can be different in different parts of +the pattern, the contents of the options argument specifies their +settings at the start of compilation and execution. The PCRE_ANCHORED, +PCRE_BSR_xxx, PCRE_NEWLINE_xxx, PCRE_NO_UTF8_CHECK, and +PCRE_NO_START_OPTIMIZE options can be set at the time of matching as well as at +compile time. +

+

+If errptr is NULL, pcre_compile() returns NULL immediately. +Otherwise, if compilation of a pattern fails, pcre_compile() returns +NULL, and sets the variable pointed to by errptr to point to a textual +error message. This is a static string that is part of the library. You must +not try to free it. Normally, the offset from the start of the pattern to the +data unit that was being processed when the error was discovered is placed in +the variable pointed to by erroffset, which must not be NULL (if it is, +an immediate error is given). However, for an invalid UTF-8 or UTF-16 string, +the offset is that of the first data unit of the failing character. +

+

+Some errors are not detected until the whole pattern has been scanned; in these +cases, the offset passed back is the length of the pattern. Note that the +offset is in data units, not characters, even in a UTF mode. It may sometimes +point into the middle of a UTF-8 or UTF-16 character. +

+

+If pcre_compile2() is used instead of pcre_compile(), and the +errorcodeptr argument is not NULL, a non-zero error code number is +returned via this argument in the event of an error. This is in addition to the +textual error message. Error codes and messages are listed below. +

+

+If the final argument, tableptr, is NULL, PCRE uses a default set of +character tables that are built when PCRE is compiled, using the default C +locale. Otherwise, tableptr must be an address that is the result of a +call to pcre_maketables(). This value is stored with the compiled +pattern, and used again by pcre_exec() and pcre_dfa_exec() when the +pattern is matched. For more discussion, see the section on locale support +below. +

+

+This code fragment shows a typical straightforward call to pcre_compile(): +

+  pcre *re;
+  const char *error;
+  int erroffset;
+  re = pcre_compile(
+    "^A.*Z",          /* the pattern */
+    0,                /* default options */
+    &error,           /* for error message */
+    &erroffset,       /* for error offset */
+    NULL);            /* use default character tables */
+
+The following names for option bits are defined in the pcre.h header +file: +
+  PCRE_ANCHORED
+
+If this bit is set, the pattern is forced to be "anchored", that is, it is +constrained to match only at the first matching point in the string that is +being searched (the "subject string"). This effect can also be achieved by +appropriate constructs in the pattern itself, which is the only way to do it in +Perl. +
+  PCRE_AUTO_CALLOUT
+
+If this bit is set, pcre_compile() automatically inserts callout items, +all with number 255, before each pattern item. For discussion of the callout +facility, see the +pcrecallout +documentation. +
+  PCRE_BSR_ANYCRLF
+  PCRE_BSR_UNICODE
+
+These options (which are mutually exclusive) control what the \R escape +sequence matches. The choice is either to match only CR, LF, or CRLF, or to +match any Unicode newline sequence. The default is specified when PCRE is +built. It can be overridden from within the pattern, or by setting an option +when a compiled pattern is matched. +
+  PCRE_CASELESS
+
+If this bit is set, letters in the pattern match both upper and lower case +letters. It is equivalent to Perl's /i option, and it can be changed within a +pattern by a (?i) option setting. In UTF-8 mode, PCRE always understands the +concept of case for characters whose values are less than 128, so caseless +matching is always possible. For characters with higher values, the concept of +case is supported if PCRE is compiled with Unicode property support, but not +otherwise. If you want to use caseless matching for characters 128 and above, +you must ensure that PCRE is compiled with Unicode property support as well as +with UTF-8 support. +
+  PCRE_DOLLAR_ENDONLY
+
+If this bit is set, a dollar metacharacter in the pattern matches only at the +end of the subject string. Without this option, a dollar also matches +immediately before a newline at the end of the string (but not before any other +newlines). The PCRE_DOLLAR_ENDONLY option is ignored if PCRE_MULTILINE is set. +There is no equivalent to this option in Perl, and no way to set it within a +pattern. +
+  PCRE_DOTALL
+
+If this bit is set, a dot metacharacter in the pattern matches a character of +any value, including one that indicates a newline. However, it only ever +matches one character, even if newlines are coded as CRLF. Without this option, +a dot does not match when the current position is at a newline. This option is +equivalent to Perl's /s option, and it can be changed within a pattern by a +(?s) option setting. A negative class such as [^a] always matches newline +characters, independent of the setting of this option. +
+  PCRE_DUPNAMES
+
+If this bit is set, names used to identify capturing subpatterns need not be +unique. This can be helpful for certain types of pattern when it is known that +only one instance of the named subpattern can ever be matched. There are more +details of named subpatterns below; see also the +pcrepattern +documentation. +
+  PCRE_EXTENDED
+
+If this bit is set, most white space characters in the pattern are totally +ignored except when escaped or inside a character class. However, white space +is not allowed within sequences such as (?> that introduce various +parenthesized subpatterns, nor within a numerical quantifier such as {1,3}. +However, ignorable white space is permitted between an item and a following +quantifier and between a quantifier and a following + that indicates +possessiveness. +

+

+White space did not used to include the VT character (code 11), because Perl +did not treat this character as white space. However, Perl changed at release +5.18, so PCRE followed at release 8.34, and VT is now treated as white space. +

+

+PCRE_EXTENDED also causes characters between an unescaped # outside a character +class and the next newline, inclusive, to be ignored. PCRE_EXTENDED is +equivalent to Perl's /x option, and it can be changed within a pattern by a +(?x) option setting. +

+

+Which characters are interpreted as newlines is controlled by the options +passed to pcre_compile() or by a special sequence at the start of the +pattern, as described in the section entitled +"Newline conventions" +in the pcrepattern documentation. Note that the end of this type of +comment is a literal newline sequence in the pattern; escape sequences that +happen to represent a newline do not count. +

+

+This option makes it possible to include comments inside complicated patterns. +Note, however, that this applies only to data characters. White space characters +may never appear within special character sequences in a pattern, for example +within the sequence (?( that introduces a conditional subpattern. +

+  PCRE_EXTRA
+
+This option was invented in order to turn on additional functionality of PCRE +that is incompatible with Perl, but it is currently of very little use. When +set, any backslash in a pattern that is followed by a letter that has no +special meaning causes an error, thus reserving these combinations for future +expansion. By default, as in Perl, a backslash followed by a letter with no +special meaning is treated as a literal. (Perl can, however, be persuaded to +give an error for this, by running it with the -w option.) There are at present +no other features controlled by this option. It can also be set by a (?X) +option setting within a pattern. +
+  PCRE_FIRSTLINE
+
+If this option is set, an unanchored pattern is required to match before or at +the first newline in the subject string, though the matched text may continue +over the newline. +
+  PCRE_JAVASCRIPT_COMPAT
+
+If this option is set, PCRE's behaviour is changed in some ways so that it is +compatible with JavaScript rather than Perl. The changes are as follows: +

+

+(1) A lone closing square bracket in a pattern causes a compile-time error, +because this is illegal in JavaScript (by default it is treated as a data +character). Thus, the pattern AB]CD becomes illegal when this option is set. +

+

+(2) At run time, a back reference to an unset subpattern group matches an empty +string (by default this causes the current matching alternative to fail). A +pattern such as (\1)(a) succeeds when this option is set (assuming it can find +an "a" in the subject), whereas it fails by default, for Perl compatibility. +

+

+(3) \U matches an upper case "U" character; by default \U causes a compile +time error (Perl uses \U to upper case subsequent characters). +

+

+(4) \u matches a lower case "u" character unless it is followed by four +hexadecimal digits, in which case the hexadecimal number defines the code point +to match. By default, \u causes a compile time error (Perl uses it to upper +case the following character). +

+

+(5) \x matches a lower case "x" character unless it is followed by two +hexadecimal digits, in which case the hexadecimal number defines the code point +to match. By default, as in Perl, a hexadecimal number is always expected after +\x, but it may have zero, one, or two digits (so, for example, \xz matches a +binary zero character followed by z). +

+  PCRE_MULTILINE
+
+By default, for the purposes of matching "start of line" and "end of line", +PCRE treats the subject string as consisting of a single line of characters, +even if it actually contains newlines. The "start of line" metacharacter (^) +matches only at the start of the string, and the "end of line" metacharacter +($) matches only at the end of the string, or before a terminating newline +(except when PCRE_DOLLAR_ENDONLY is set). Note, however, that unless +PCRE_DOTALL is set, the "any character" metacharacter (.) does not match at a +newline. This behaviour (for ^, $, and dot) is the same as Perl. +

+

+When PCRE_MULTILINE it is set, the "start of line" and "end of line" constructs +match immediately following or immediately before internal newlines in the +subject string, respectively, as well as at the very start and end. This is +equivalent to Perl's /m option, and it can be changed within a pattern by a +(?m) option setting. If there are no newlines in a subject string, or no +occurrences of ^ or $ in a pattern, setting PCRE_MULTILINE has no effect. +

+  PCRE_NEVER_UTF
+
+This option locks out interpretation of the pattern as UTF-8 (or UTF-16 or +UTF-32 in the 16-bit and 32-bit libraries). In particular, it prevents the +creator of the pattern from switching to UTF interpretation by starting the +pattern with (*UTF). This may be useful in applications that process patterns +from external sources. The combination of PCRE_UTF8 and PCRE_NEVER_UTF also +causes an error. +
+  PCRE_NEWLINE_CR
+  PCRE_NEWLINE_LF
+  PCRE_NEWLINE_CRLF
+  PCRE_NEWLINE_ANYCRLF
+  PCRE_NEWLINE_ANY
+
+These options override the default newline definition that was chosen when PCRE +was built. Setting the first or the second specifies that a newline is +indicated by a single character (CR or LF, respectively). Setting +PCRE_NEWLINE_CRLF specifies that a newline is indicated by the two-character +CRLF sequence. Setting PCRE_NEWLINE_ANYCRLF specifies that any of the three +preceding sequences should be recognized. Setting PCRE_NEWLINE_ANY specifies +that any Unicode newline sequence should be recognized. +

+

+In an ASCII/Unicode environment, the Unicode newline sequences are the three +just mentioned, plus the single characters VT (vertical tab, U+000B), FF (form +feed, U+000C), NEL (next line, U+0085), LS (line separator, U+2028), and PS +(paragraph separator, U+2029). For the 8-bit library, the last two are +recognized only in UTF-8 mode. +

+

+When PCRE is compiled to run in an EBCDIC (mainframe) environment, the code for +CR is 0x0d, the same as ASCII. However, the character code for LF is normally +0x15, though in some EBCDIC environments 0x25 is used. Whichever of these is +not LF is made to correspond to Unicode's NEL character. EBCDIC codes are all +less than 256. For more details, see the +pcrebuild +documentation. +

+

+The newline setting in the options word uses three bits that are treated +as a number, giving eight possibilities. Currently only six are used (default +plus the five values above). This means that if you set more than one newline +option, the combination may or may not be sensible. For example, +PCRE_NEWLINE_CR with PCRE_NEWLINE_LF is equivalent to PCRE_NEWLINE_CRLF, but +other combinations may yield unused numbers and cause an error. +

+

+The only time that a line break in a pattern is specially recognized when +compiling is when PCRE_EXTENDED is set. CR and LF are white space characters, +and so are ignored in this mode. Also, an unescaped # outside a character class +indicates a comment that lasts until after the next line break sequence. In +other circumstances, line break sequences in patterns are treated as literal +data. +

+

+The newline option that is set at compile time becomes the default that is used +for pcre_exec() and pcre_dfa_exec(), but it can be overridden. +

+  PCRE_NO_AUTO_CAPTURE
+
+If this option is set, it disables the use of numbered capturing parentheses in +the pattern. Any opening parenthesis that is not followed by ? behaves as if it +were followed by ?: but named parentheses can still be used for capturing (and +they acquire numbers in the usual way). There is no equivalent of this option +in Perl. +
+  PCRE_NO_AUTO_POSSESS
+
+If this option is set, it disables "auto-possessification". This is an +optimization that, for example, turns a+b into a++b in order to avoid +backtracks into a+ that can never be successful. However, if callouts are in +use, auto-possessification means that some of them are never taken. You can set +this option if you want the matching functions to do a full unoptimized search +and run all the callouts, but it is mainly provided for testing purposes. +
+  PCRE_NO_START_OPTIMIZE
+
+This is an option that acts at matching time; that is, it is really an option +for pcre_exec() or pcre_dfa_exec(). If it is set at compile time, +it is remembered with the compiled pattern and assumed at matching time. This +is necessary if you want to use JIT execution, because the JIT compiler needs +to know whether or not this option is set. For details see the discussion of +PCRE_NO_START_OPTIMIZE +below. +
+  PCRE_UCP
+
+This option changes the way PCRE processes \B, \b, \D, \d, \S, \s, \W, +\w, and some of the POSIX character classes. By default, only ASCII characters +are recognized, but if PCRE_UCP is set, Unicode properties are used instead to +classify characters. More details are given in the section on +generic character types +in the +pcrepattern +page. If you set PCRE_UCP, matching one of the items it affects takes much +longer. The option is available only if PCRE has been compiled with Unicode +property support. +
+  PCRE_UNGREEDY
+
+This option inverts the "greediness" of the quantifiers so that they are not +greedy by default, but become greedy if followed by "?". It is not compatible +with Perl. It can also be set by a (?U) option setting within the pattern. +
+  PCRE_UTF8
+
+This option causes PCRE to regard both the pattern and the subject as strings +of UTF-8 characters instead of single-byte strings. However, it is available +only when PCRE is built to include UTF support. If not, the use of this option +provokes an error. Details of how this option changes the behaviour of PCRE are +given in the +pcreunicode +page. +
+  PCRE_NO_UTF8_CHECK
+
+When PCRE_UTF8 is set, the validity of the pattern as a UTF-8 string is +automatically checked. There is a discussion about the +validity of UTF-8 strings +in the +pcreunicode +page. If an invalid UTF-8 sequence is found, pcre_compile() returns an +error. If you already know that your pattern is valid, and you want to skip +this check for performance reasons, you can set the PCRE_NO_UTF8_CHECK option. +When it is set, the effect of passing an invalid UTF-8 string as a pattern is +undefined. It may cause your program to crash or loop. Note that this option +can also be passed to pcre_exec() and pcre_dfa_exec(), to suppress +the validity checking of subject strings only. If the same string is being +matched many times, the option can be safely set for the second and subsequent +matchings to improve performance. +

+
COMPILATION ERROR CODES
+

+The following table lists the error codes than may be returned by +pcre_compile2(), along with the error messages that may be returned by +both compiling functions. Note that error messages are always 8-bit ASCII +strings, even in 16-bit or 32-bit mode. As PCRE has developed, some error codes +have fallen out of use. To avoid confusion, they have not been re-used. +

+   0  no error
+   1  \ at end of pattern
+   2  \c at end of pattern
+   3  unrecognized character follows \
+   4  numbers out of order in {} quantifier
+   5  number too big in {} quantifier
+   6  missing terminating ] for character class
+   7  invalid escape sequence in character class
+   8  range out of order in character class
+   9  nothing to repeat
+  10  [this code is not in use]
+  11  internal error: unexpected repeat
+  12  unrecognized character after (? or (?-
+  13  POSIX named classes are supported only within a class
+  14  missing )
+  15  reference to non-existent subpattern
+  16  erroffset passed as NULL
+  17  unknown option bit(s) set
+  18  missing ) after comment
+  19  [this code is not in use]
+  20  regular expression is too large
+  21  failed to get memory
+  22  unmatched parentheses
+  23  internal error: code overflow
+  24  unrecognized character after (?<
+  25  lookbehind assertion is not fixed length
+  26  malformed number or name after (?(
+  27  conditional group contains more than two branches
+  28  assertion expected after (?(
+  29  (?R or (?[+-]digits must be followed by )
+  30  unknown POSIX class name
+  31  POSIX collating elements are not supported
+  32  this version of PCRE is compiled without UTF support
+  33  [this code is not in use]
+  34  character value in \x{} or \o{} is too large
+  35  invalid condition (?(0)
+  36  \C not allowed in lookbehind assertion
+  37  PCRE does not support \L, \l, \N{name}, \U, or \u
+  38  number after (?C is > 255
+  39  closing ) for (?C expected
+  40  recursive call could loop indefinitely
+  41  unrecognized character after (?P
+  42  syntax error in subpattern name (missing terminator)
+  43  two named subpatterns have the same name
+  44  invalid UTF-8 string (specifically UTF-8)
+  45  support for \P, \p, and \X has not been compiled
+  46  malformed \P or \p sequence
+  47  unknown property name after \P or \p
+  48  subpattern name is too long (maximum 32 characters)
+  49  too many named subpatterns (maximum 10000)
+  50  [this code is not in use]
+  51  octal value is greater than \377 in 8-bit non-UTF-8 mode
+  52  internal error: overran compiling workspace
+  53  internal error: previously-checked referenced subpattern
+        not found
+  54  DEFINE group contains more than one branch
+  55  repeating a DEFINE group is not allowed
+  56  inconsistent NEWLINE options
+  57  \g is not followed by a braced, angle-bracketed, or quoted
+        name/number or by a plain number
+  58  a numbered reference must not be zero
+  59  an argument is not allowed for (*ACCEPT), (*FAIL), or (*COMMIT)
+  60  (*VERB) not recognized or malformed
+  61  number is too big
+  62  subpattern name expected
+  63  digit expected after (?+
+  64  ] is an invalid data character in JavaScript compatibility mode
+  65  different names for subpatterns of the same number are
+        not allowed
+  66  (*MARK) must have an argument
+  67  this version of PCRE is not compiled with Unicode property
+        support
+  68  \c must be followed by an ASCII character
+  69  \k is not followed by a braced, angle-bracketed, or quoted name
+  70  internal error: unknown opcode in find_fixedlength()
+  71  \N is not supported in a class
+  72  too many forward references
+  73  disallowed Unicode code point (>= 0xd800 && <= 0xdfff)
+  74  invalid UTF-16 string (specifically UTF-16)
+  75  name is too long in (*MARK), (*PRUNE), (*SKIP), or (*THEN)
+  76  character value in \u.... sequence is too large
+  77  invalid UTF-32 string (specifically UTF-32)
+  78  setting UTF is disabled by the application
+  79  non-hex character in \x{} (closing brace missing?)
+  80  non-octal character in \o{} (closing brace missing?)
+  81  missing opening brace after \o
+  82  parentheses are too deeply nested
+  83  invalid range in character class
+  84  group name must start with a non-digit
+  85  parentheses are too deeply nested (stack check)
+
+The numbers 32 and 10000 in errors 48 and 49 are defaults; different values may +be used if the limits were changed when PCRE was built. +

+
STUDYING A PATTERN
+

+pcre_extra *pcre_study(const pcre *code, int options, + const char **errptr); +

+

+If a compiled pattern is going to be used several times, it is worth spending +more time analyzing it in order to speed up the time taken for matching. The +function pcre_study() takes a pointer to a compiled pattern as its first +argument. If studying the pattern produces additional information that will +help speed up matching, pcre_study() returns a pointer to a +pcre_extra block, in which the study_data field points to the +results of the study. +

+

+The returned value from pcre_study() can be passed directly to +pcre_exec() or pcre_dfa_exec(). However, a pcre_extra block +also contains other fields that can be set by the caller before the block is +passed; these are described +below +in the section on matching a pattern. +

+

+If studying the pattern does not produce any useful information, +pcre_study() returns NULL by default. In that circumstance, if the +calling program wants to pass any of the other fields to pcre_exec() or +pcre_dfa_exec(), it must set up its own pcre_extra block. However, +if pcre_study() is called with the PCRE_STUDY_EXTRA_NEEDED option, it +returns a pcre_extra block even if studying did not find any additional +information. It may still return NULL, however, if an error occurs in +pcre_study(). +

+

+The second argument of pcre_study() contains option bits. There are three +further options in addition to PCRE_STUDY_EXTRA_NEEDED: +

+  PCRE_STUDY_JIT_COMPILE
+  PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE
+  PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE
+
+If any of these are set, and the just-in-time compiler is available, the +pattern is further compiled into machine code that executes much faster than +the pcre_exec() interpretive matching function. If the just-in-time +compiler is not available, these options are ignored. All undefined bits in the +options argument must be zero. +

+

+JIT compilation is a heavyweight optimization. It can take some time for +patterns to be analyzed, and for one-off matches and simple patterns the +benefit of faster execution might be offset by a much slower study time. +Not all patterns can be optimized by the JIT compiler. For those that cannot be +handled, matching automatically falls back to the pcre_exec() +interpreter. For more details, see the +pcrejit +documentation. +

+

+The third argument for pcre_study() is a pointer for an error message. If +studying succeeds (even if no data is returned), the variable it points to is +set to NULL. Otherwise it is set to point to a textual error message. This is a +static string that is part of the library. You must not try to free it. You +should test the error pointer for NULL after calling pcre_study(), to be +sure that it has run successfully. +

+

+When you are finished with a pattern, you can free the memory used for the +study data by calling pcre_free_study(). This function was added to the +API for release 8.20. For earlier versions, the memory could be freed with +pcre_free(), just like the pattern itself. This will still work in cases +where JIT optimization is not used, but it is advisable to change to the new +function when convenient. +

+

+This is a typical way in which pcre_study() is used (except that in a +real application there should be tests for errors): +

+  int rc;
+  pcre *re;
+  pcre_extra *sd;
+  re = pcre_compile("pattern", 0, &error, &erroroffset, NULL);
+  sd = pcre_study(
+    re,             /* result of pcre_compile() */
+    0,              /* no options */
+    &error);        /* set to NULL or points to a message */
+  rc = pcre_exec(   /* see below for details of pcre_exec() options */
+    re, sd, "subject", 7, 0, 0, ovector, 30);
+  ...
+  pcre_free_study(sd);
+  pcre_free(re);
+
+Studying a pattern does two things: first, a lower bound for the length of +subject string that is needed to match the pattern is computed. This does not +mean that there are any strings of that length that match, but it does +guarantee that no shorter strings match. The value is used to avoid wasting +time by trying to match strings that are shorter than the lower bound. You can +find out the value in a calling program via the pcre_fullinfo() function. +

+

+Studying a pattern is also useful for non-anchored patterns that do not have a +single fixed starting character. A bitmap of possible starting bytes is +created. This speeds up finding a position in the subject at which to start +matching. (In 16-bit mode, the bitmap is used for 16-bit values less than 256. +In 32-bit mode, the bitmap is used for 32-bit values less than 256.) +

+

+These two optimizations apply to both pcre_exec() and +pcre_dfa_exec(), and the information is also used by the JIT compiler. +The optimizations can be disabled by setting the PCRE_NO_START_OPTIMIZE option. +You might want to do this if your pattern contains callouts or (*MARK) and you +want to make use of these facilities in cases where matching fails. +

+

+PCRE_NO_START_OPTIMIZE can be specified at either compile time or execution +time. However, if PCRE_NO_START_OPTIMIZE is passed to pcre_exec(), (that +is, after any JIT compilation has happened) JIT execution is disabled. For JIT +execution to work with PCRE_NO_START_OPTIMIZE, the option must be set at +compile time. +

+

+There is a longer discussion of PCRE_NO_START_OPTIMIZE +below. +

+
LOCALE SUPPORT
+

+PCRE handles caseless matching, and determines whether characters are letters, +digits, or whatever, by reference to a set of tables, indexed by character +code point. When running in UTF-8 mode, or in the 16- or 32-bit libraries, this +applies only to characters with code points less than 256. By default, +higher-valued code points never match escapes such as \w or \d. However, if +PCRE is built with Unicode property support, all characters can be tested with +\p and \P, or, alternatively, the PCRE_UCP option can be set when a pattern +is compiled; this causes \w and friends to use Unicode property support +instead of the built-in tables. +

+

+The use of locales with Unicode is discouraged. If you are handling characters +with code points greater than 128, you should either use Unicode support, or +use locales, but not try to mix the two. +

+

+PCRE contains an internal set of tables that are used when the final argument +of pcre_compile() is NULL. These are sufficient for many applications. +Normally, the internal tables recognize only ASCII characters. However, when +PCRE is built, it is possible to cause the internal tables to be rebuilt in the +default "C" locale of the local system, which may cause them to be different. +

+

+The internal tables can always be overridden by tables supplied by the +application that calls PCRE. These may be created in a different locale from +the default. As more and more applications change to using Unicode, the need +for this locale support is expected to die away. +

+

+External tables are built by calling the pcre_maketables() function, +which has no arguments, in the relevant locale. The result can then be passed +to pcre_compile() as often as necessary. For example, to build and use +tables that are appropriate for the French locale (where accented characters +with values greater than 128 are treated as letters), the following code could +be used: +

+  setlocale(LC_CTYPE, "fr_FR");
+  tables = pcre_maketables();
+  re = pcre_compile(..., tables);
+
+The locale name "fr_FR" is used on Linux and other Unix-like systems; if you +are using Windows, the name for the French locale is "french". +

+

+When pcre_maketables() runs, the tables are built in memory that is +obtained via pcre_malloc. It is the caller's responsibility to ensure +that the memory containing the tables remains available for as long as it is +needed. +

+

+The pointer that is passed to pcre_compile() is saved with the compiled +pattern, and the same tables are used via this pointer by pcre_study() +and also by pcre_exec() and pcre_dfa_exec(). Thus, for any single +pattern, compilation, studying and matching all happen in the same locale, but +different patterns can be processed in different locales. +

+

+It is possible to pass a table pointer or NULL (indicating the use of the +internal tables) to pcre_exec() or pcre_dfa_exec() (see the +discussion below in the section on matching a pattern). This facility is +provided for use with pre-compiled patterns that have been saved and reloaded. +Character tables are not saved with patterns, so if a non-standard table was +used at compile time, it must be provided again when the reloaded pattern is +matched. Attempting to use this facility to match a pattern in a different +locale from the one in which it was compiled is likely to lead to anomalous +(usually incorrect) results. +

+
INFORMATION ABOUT A PATTERN
+

+int pcre_fullinfo(const pcre *code, const pcre_extra *extra, + int what, void *where); +

+

+The pcre_fullinfo() function returns information about a compiled +pattern. It replaces the pcre_info() function, which was removed from the +library at version 8.30, after more than 10 years of obsolescence. +

+

+The first argument for pcre_fullinfo() is a pointer to the compiled +pattern. The second argument is the result of pcre_study(), or NULL if +the pattern was not studied. The third argument specifies which piece of +information is required, and the fourth argument is a pointer to a variable +to receive the data. The yield of the function is zero for success, or one of +the following negative numbers: +

+  PCRE_ERROR_NULL           the argument code was NULL
+                            the argument where was NULL
+  PCRE_ERROR_BADMAGIC       the "magic number" was not found
+  PCRE_ERROR_BADENDIANNESS  the pattern was compiled with different
+                            endianness
+  PCRE_ERROR_BADOPTION      the value of what was invalid
+  PCRE_ERROR_UNSET          the requested field is not set
+
+The "magic number" is placed at the start of each compiled pattern as a simple +check against passing an arbitrary memory pointer. The endianness error can +occur if a compiled pattern is saved and reloaded on a different host. Here is +a typical call of pcre_fullinfo(), to obtain the length of the compiled +pattern: +
+  int rc;
+  size_t length;
+  rc = pcre_fullinfo(
+    re,               /* result of pcre_compile() */
+    sd,               /* result of pcre_study(), or NULL */
+    PCRE_INFO_SIZE,   /* what is required */
+    &length);         /* where to put the data */
+
+The possible values for the third argument are defined in pcre.h, and are +as follows: +
+  PCRE_INFO_BACKREFMAX
+
+Return the number of the highest back reference in the pattern. The fourth +argument should point to an int variable. Zero is returned if there are +no back references. +
+  PCRE_INFO_CAPTURECOUNT
+
+Return the number of capturing subpatterns in the pattern. The fourth argument +should point to an int variable. +
+  PCRE_INFO_DEFAULT_TABLES
+
+Return a pointer to the internal default character tables within PCRE. The +fourth argument should point to an unsigned char * variable. This +information call is provided for internal use by the pcre_study() +function. External callers can cause PCRE to use its internal tables by passing +a NULL table pointer. +
+  PCRE_INFO_FIRSTBYTE (deprecated)
+
+Return information about the first data unit of any matched string, for a +non-anchored pattern. The name of this option refers to the 8-bit library, +where data units are bytes. The fourth argument should point to an int +variable. Negative values are used for special cases. However, this means that +when the 32-bit library is in non-UTF-32 mode, the full 32-bit range of +characters cannot be returned. For this reason, this value is deprecated; use +PCRE_INFO_FIRSTCHARACTERFLAGS and PCRE_INFO_FIRSTCHARACTER instead. +

+

+If there is a fixed first value, for example, the letter "c" from a pattern +such as (cat|cow|coyote), its value is returned. In the 8-bit library, the +value is always less than 256. In the 16-bit library the value can be up to +0xffff. In the 32-bit library the value can be up to 0x10ffff. +

+

+If there is no fixed first value, and if either +
+
+(a) the pattern was compiled with the PCRE_MULTILINE option, and every branch +starts with "^", or +
+
+(b) every branch of the pattern starts with ".*" and PCRE_DOTALL is not set +(if it were set, the pattern would be anchored), +
+
+-1 is returned, indicating that the pattern matches only at the start of a +subject string or after any newline within the string. Otherwise -2 is +returned. For anchored patterns, -2 is returned. +

+  PCRE_INFO_FIRSTCHARACTER
+
+Return the value of the first data unit (non-UTF character) of any matched +string in the situation where PCRE_INFO_FIRSTCHARACTERFLAGS returns 1; +otherwise return 0. The fourth argument should point to a uint_t +variable. +

+

+In the 8-bit library, the value is always less than 256. In the 16-bit library +the value can be up to 0xffff. In the 32-bit library in UTF-32 mode the value +can be up to 0x10ffff, and up to 0xffffffff when not using UTF-32 mode. +

+  PCRE_INFO_FIRSTCHARACTERFLAGS
+
+Return information about the first data unit of any matched string, for a +non-anchored pattern. The fourth argument should point to an int +variable. +

+

+If there is a fixed first value, for example, the letter "c" from a pattern +such as (cat|cow|coyote), 1 is returned, and the character value can be +retrieved using PCRE_INFO_FIRSTCHARACTER. If there is no fixed first value, and +if either +
+
+(a) the pattern was compiled with the PCRE_MULTILINE option, and every branch +starts with "^", or +
+
+(b) every branch of the pattern starts with ".*" and PCRE_DOTALL is not set +(if it were set, the pattern would be anchored), +
+
+2 is returned, indicating that the pattern matches only at the start of a +subject string or after any newline within the string. Otherwise 0 is +returned. For anchored patterns, 0 is returned. +

+  PCRE_INFO_FIRSTTABLE
+
+If the pattern was studied, and this resulted in the construction of a 256-bit +table indicating a fixed set of values for the first data unit in any matching +string, a pointer to the table is returned. Otherwise NULL is returned. The +fourth argument should point to an unsigned char * variable. +
+  PCRE_INFO_HASCRORLF
+
+Return 1 if the pattern contains any explicit matches for CR or LF characters, +otherwise 0. The fourth argument should point to an int variable. An +explicit match is either a literal CR or LF character, or \r or \n. +
+  PCRE_INFO_JCHANGED
+
+Return 1 if the (?J) or (?-J) option setting is used in the pattern, otherwise +0. The fourth argument should point to an int variable. (?J) and +(?-J) set and unset the local PCRE_DUPNAMES option, respectively. +
+  PCRE_INFO_JIT
+
+Return 1 if the pattern was studied with one of the JIT options, and +just-in-time compiling was successful. The fourth argument should point to an +int variable. A return value of 0 means that JIT support is not available +in this version of PCRE, or that the pattern was not studied with a JIT option, +or that the JIT compiler could not handle this particular pattern. See the +pcrejit +documentation for details of what can and cannot be handled. +
+  PCRE_INFO_JITSIZE
+
+If the pattern was successfully studied with a JIT option, return the size of +the JIT compiled code, otherwise return zero. The fourth argument should point +to a size_t variable. +
+  PCRE_INFO_LASTLITERAL
+
+Return the value of the rightmost literal data unit that must exist in any +matched string, other than at its start, if such a value has been recorded. The +fourth argument should point to an int variable. If there is no such +value, -1 is returned. For anchored patterns, a last literal value is recorded +only if it follows something of variable length. For example, for the pattern +/^a\d+z\d+/ the returned value is "z", but for /^a\dz\d/ the returned value +is -1. +

+

+Since for the 32-bit library using the non-UTF-32 mode, this function is unable +to return the full 32-bit range of characters, this value is deprecated; +instead the PCRE_INFO_REQUIREDCHARFLAGS and PCRE_INFO_REQUIREDCHAR values should +be used. +

+  PCRE_INFO_MATCH_EMPTY
+
+Return 1 if the pattern can match an empty string, otherwise 0. The fourth +argument should point to an int variable. +
+  PCRE_INFO_MATCHLIMIT
+
+If the pattern set a match limit by including an item of the form +(*LIMIT_MATCH=nnnn) at the start, the value is returned. The fourth argument +should point to an unsigned 32-bit integer. If no such value has been set, the +call to pcre_fullinfo() returns the error PCRE_ERROR_UNSET. +
+  PCRE_INFO_MAXLOOKBEHIND
+
+Return the number of characters (NB not data units) in the longest lookbehind +assertion in the pattern. This information is useful when doing multi-segment +matching using the partial matching facilities. Note that the simple assertions +\b and \B require a one-character lookbehind. \A also registers a +one-character lookbehind, though it does not actually inspect the previous +character. This is to ensure that at least one character from the old segment +is retained when a new segment is processed. Otherwise, if there are no +lookbehinds in the pattern, \A might match incorrectly at the start of a new +segment. +
+  PCRE_INFO_MINLENGTH
+
+If the pattern was studied and a minimum length for matching subject strings +was computed, its value is returned. Otherwise the returned value is -1. The +value is a number of characters, which in UTF mode may be different from the +number of data units. The fourth argument should point to an int +variable. A non-negative value is a lower bound to the length of any matching +string. There may not be any strings of that length that do actually match, but +every string that does match is at least that long. +
+  PCRE_INFO_NAMECOUNT
+  PCRE_INFO_NAMEENTRYSIZE
+  PCRE_INFO_NAMETABLE
+
+PCRE supports the use of named as well as numbered capturing parentheses. The +names are just an additional way of identifying the parentheses, which still +acquire numbers. Several convenience functions such as +pcre_get_named_substring() are provided for extracting captured +substrings by name. It is also possible to extract the data directly, by first +converting the name to a number in order to access the correct pointers in the +output vector (described with pcre_exec() below). To do the conversion, +you need to use the name-to-number map, which is described by these three +values. +

+

+The map consists of a number of fixed-size entries. PCRE_INFO_NAMECOUNT gives +the number of entries, and PCRE_INFO_NAMEENTRYSIZE gives the size of each +entry; both of these return an int value. The entry size depends on the +length of the longest name. PCRE_INFO_NAMETABLE returns a pointer to the first +entry of the table. This is a pointer to char in the 8-bit library, where +the first two bytes of each entry are the number of the capturing parenthesis, +most significant byte first. In the 16-bit library, the pointer points to +16-bit data units, the first of which contains the parenthesis number. In the +32-bit library, the pointer points to 32-bit data units, the first of which +contains the parenthesis number. The rest of the entry is the corresponding +name, zero terminated. +

+

+The names are in alphabetical order. If (?| is used to create multiple groups +with the same number, as described in the +section on duplicate subpattern numbers +in the +pcrepattern +page, the groups may be given the same name, but there is only one entry in the +table. Different names for groups of the same number are not permitted. +Duplicate names for subpatterns with different numbers are permitted, +but only if PCRE_DUPNAMES is set. They appear in the table in the order in +which they were found in the pattern. In the absence of (?| this is the order +of increasing number; when (?| is used this is not necessarily the case because +later subpatterns may have lower numbers. +

+

+As a simple example of the name/number table, consider the following pattern +after compilation by the 8-bit library (assume PCRE_EXTENDED is set, so white +space - including newlines - is ignored): +

+  (?<date> (?<year>(\d\d)?\d\d) - (?<month>\d\d) - (?<day>\d\d) )
+
+There are four named subpatterns, so the table has four entries, and each entry +in the table is eight bytes long. The table is as follows, with non-printing +bytes shows in hexadecimal, and undefined bytes shown as ??: +
+  00 01 d  a  t  e  00 ??
+  00 05 d  a  y  00 ?? ??
+  00 04 m  o  n  t  h  00
+  00 02 y  e  a  r  00 ??
+
+When writing code to extract data from named subpatterns using the +name-to-number map, remember that the length of the entries is likely to be +different for each compiled pattern. +
+  PCRE_INFO_OKPARTIAL
+
+Return 1 if the pattern can be used for partial matching with +pcre_exec(), otherwise 0. The fourth argument should point to an +int variable. From release 8.00, this always returns 1, because the +restrictions that previously applied to partial matching have been lifted. The +pcrepartial +documentation gives details of partial matching. +
+  PCRE_INFO_OPTIONS
+
+Return a copy of the options with which the pattern was compiled. The fourth +argument should point to an unsigned long int variable. These option bits +are those specified in the call to pcre_compile(), modified by any +top-level option settings at the start of the pattern itself. In other words, +they are the options that will be in force when matching starts. For example, +if the pattern /(?im)abc(?-i)d/ is compiled with the PCRE_EXTENDED option, the +result is PCRE_CASELESS, PCRE_MULTILINE, and PCRE_EXTENDED. +

+

+A pattern is automatically anchored by PCRE if all of its top-level +alternatives begin with one of the following: +

+  ^     unless PCRE_MULTILINE is set
+  \A    always
+  \G    always
+  .*    if PCRE_DOTALL is set and there are no back references to the subpattern in which .* appears
+
+For such patterns, the PCRE_ANCHORED bit is set in the options returned by +pcre_fullinfo(). +
+  PCRE_INFO_RECURSIONLIMIT
+
+If the pattern set a recursion limit by including an item of the form +(*LIMIT_RECURSION=nnnn) at the start, the value is returned. The fourth +argument should point to an unsigned 32-bit integer. If no such value has been +set, the call to pcre_fullinfo() returns the error PCRE_ERROR_UNSET. +
+  PCRE_INFO_SIZE
+
+Return the size of the compiled pattern in bytes (for all three libraries). The +fourth argument should point to a size_t variable. This value does not +include the size of the pcre structure that is returned by +pcre_compile(). The value that is passed as the argument to +pcre_malloc() when pcre_compile() is getting memory in which to +place the compiled data is the value returned by this option plus the size of +the pcre structure. Studying a compiled pattern, with or without JIT, +does not alter the value returned by this option. +
+  PCRE_INFO_STUDYSIZE
+
+Return the size in bytes (for all three libraries) of the data block pointed to +by the study_data field in a pcre_extra block. If pcre_extra +is NULL, or there is no study data, zero is returned. The fourth argument +should point to a size_t variable. The study_data field is set by +pcre_study() to record information that will speed up matching (see the +section entitled +"Studying a pattern" +above). The format of the study_data block is private, but its length +is made available via this option so that it can be saved and restored (see the +pcreprecompile +documentation for details). +
+  PCRE_INFO_REQUIREDCHARFLAGS
+
+Returns 1 if there is a rightmost literal data unit that must exist in any +matched string, other than at its start. The fourth argument should point to +an int variable. If there is no such value, 0 is returned. If returning +1, the character value itself can be retrieved using PCRE_INFO_REQUIREDCHAR. +

+

+For anchored patterns, a last literal value is recorded only if it follows +something of variable length. For example, for the pattern /^a\d+z\d+/ the +returned value 1 (with "z" returned from PCRE_INFO_REQUIREDCHAR), but for +/^a\dz\d/ the returned value is 0. +

+  PCRE_INFO_REQUIREDCHAR
+
+Return the value of the rightmost literal data unit that must exist in any +matched string, other than at its start, if such a value has been recorded. The +fourth argument should point to a uint32_t variable. If there is no such +value, 0 is returned. +

+
REFERENCE COUNTS
+

+int pcre_refcount(pcre *code, int adjust); +

+

+The pcre_refcount() function is used to maintain a reference count in the +data block that contains a compiled pattern. It is provided for the benefit of +applications that operate in an object-oriented manner, where different parts +of the application may be using the same compiled pattern, but you want to free +the block when they are all done. +

+

+When a pattern is compiled, the reference count field is initialized to zero. +It is changed only by calling this function, whose action is to add the +adjust value (which may be positive or negative) to it. The yield of the +function is the new value. However, the value of the count is constrained to +lie between 0 and 65535, inclusive. If the new value is outside these limits, +it is forced to the appropriate limit value. +

+

+Except when it is zero, the reference count is not correctly preserved if a +pattern is compiled on one host and then transferred to a host whose byte-order +is different. (This seems a highly unlikely scenario.) +

+
MATCHING A PATTERN: THE TRADITIONAL FUNCTION
+

+int pcre_exec(const pcre *code, const pcre_extra *extra, + const char *subject, int length, int startoffset, + int options, int *ovector, int ovecsize); +

+

+The function pcre_exec() is called to match a subject string against a +compiled pattern, which is passed in the code argument. If the +pattern was studied, the result of the study should be passed in the +extra argument. You can call pcre_exec() with the same code +and extra arguments as many times as you like, in order to match +different subject strings with the same pattern. +

+

+This function is the main matching facility of the library, and it operates in +a Perl-like manner. For specialist use there is also an alternative matching +function, which is described +below +in the section about the pcre_dfa_exec() function. +

+

+In most applications, the pattern will have been compiled (and optionally +studied) in the same process that calls pcre_exec(). However, it is +possible to save compiled patterns and study data, and then use them later +in different processes, possibly even on different hosts. For a discussion +about this, see the +pcreprecompile +documentation. +

+

+Here is an example of a simple call to pcre_exec(): +

+  int rc;
+  int ovector[30];
+  rc = pcre_exec(
+    re,             /* result of pcre_compile() */
+    NULL,           /* we didn't study the pattern */
+    "some string",  /* the subject string */
+    11,             /* the length of the subject string */
+    0,              /* start at offset 0 in the subject */
+    0,              /* default options */
+    ovector,        /* vector of integers for substring information */
+    30);            /* number of elements (NOT size in bytes) */
+
+

+
+Extra data for pcre_exec() +
+

+If the extra argument is not NULL, it must point to a pcre_extra +data block. The pcre_study() function returns such a block (when it +doesn't return NULL), but you can also create one for yourself, and pass +additional information in it. The pcre_extra block contains the following +fields (not necessarily in this order): +

+  unsigned long int flags;
+  void *study_data;
+  void *executable_jit;
+  unsigned long int match_limit;
+  unsigned long int match_limit_recursion;
+  void *callout_data;
+  const unsigned char *tables;
+  unsigned char **mark;
+
+In the 16-bit version of this structure, the mark field has type +"PCRE_UCHAR16 **". +
+
+In the 32-bit version of this structure, the mark field has type +"PCRE_UCHAR32 **". +

+

+The flags field is used to specify which of the other fields are set. The +flag bits are: +

+  PCRE_EXTRA_CALLOUT_DATA
+  PCRE_EXTRA_EXECUTABLE_JIT
+  PCRE_EXTRA_MARK
+  PCRE_EXTRA_MATCH_LIMIT
+  PCRE_EXTRA_MATCH_LIMIT_RECURSION
+  PCRE_EXTRA_STUDY_DATA
+  PCRE_EXTRA_TABLES
+
+Other flag bits should be set to zero. The study_data field and sometimes +the executable_jit field are set in the pcre_extra block that is +returned by pcre_study(), together with the appropriate flag bits. You +should not set these yourself, but you may add to the block by setting other +fields and their corresponding flag bits. +

+

+The match_limit field provides a means of preventing PCRE from using up a +vast amount of resources when running patterns that are not going to match, +but which have a very large number of possibilities in their search trees. The +classic example is a pattern that uses nested unlimited repeats. +

+

+Internally, pcre_exec() uses a function called match(), which it +calls repeatedly (sometimes recursively). The limit set by match_limit is +imposed on the number of times this function is called during a match, which +has the effect of limiting the amount of backtracking that can take place. For +patterns that are not anchored, the count restarts from zero for each position +in the subject string. +

+

+When pcre_exec() is called with a pattern that was successfully studied +with a JIT option, the way that the matching is executed is entirely different. +However, there is still the possibility of runaway matching that goes on for a +very long time, and so the match_limit value is also used in this case +(but in a different way) to limit how long the matching can continue. +

+

+The default value for the limit can be set when PCRE is built; the default +default is 10 million, which handles all but the most extreme cases. You can +override the default by supplying pcre_exec() with a pcre_extra +block in which match_limit is set, and PCRE_EXTRA_MATCH_LIMIT is set in +the flags field. If the limit is exceeded, pcre_exec() returns +PCRE_ERROR_MATCHLIMIT. +

+

+A value for the match limit may also be supplied by an item at the start of a +pattern of the form +

+  (*LIMIT_MATCH=d)
+
+where d is a decimal number. However, such a setting is ignored unless d is +less than the limit set by the caller of pcre_exec() or, if no such limit +is set, less than the default. +

+

+The match_limit_recursion field is similar to match_limit, but +instead of limiting the total number of times that match() is called, it +limits the depth of recursion. The recursion depth is a smaller number than the +total number of calls, because not all calls to match() are recursive. +This limit is of use only if it is set smaller than match_limit. +

+

+Limiting the recursion depth limits the amount of machine stack that can be +used, or, when PCRE has been compiled to use memory on the heap instead of the +stack, the amount of heap memory that can be used. This limit is not relevant, +and is ignored, when matching is done using JIT compiled code. +

+

+The default value for match_limit_recursion can be set when PCRE is +built; the default default is the same value as the default for +match_limit. You can override the default by supplying pcre_exec() +with a pcre_extra block in which match_limit_recursion is set, and +PCRE_EXTRA_MATCH_LIMIT_RECURSION is set in the flags field. If the limit +is exceeded, pcre_exec() returns PCRE_ERROR_RECURSIONLIMIT. +

+

+A value for the recursion limit may also be supplied by an item at the start of +a pattern of the form +

+  (*LIMIT_RECURSION=d)
+
+where d is a decimal number. However, such a setting is ignored unless d is +less than the limit set by the caller of pcre_exec() or, if no such limit +is set, less than the default. +

+

+The callout_data field is used in conjunction with the "callout" feature, +and is described in the +pcrecallout +documentation. +

+

+The tables field is provided for use with patterns that have been +pre-compiled using custom character tables, saved to disc or elsewhere, and +then reloaded, because the tables that were used to compile a pattern are not +saved with it. See the +pcreprecompile +documentation for a discussion of saving compiled patterns for later use. If +NULL is passed using this mechanism, it forces PCRE's internal tables to be +used. +

+

+Warning: The tables that pcre_exec() uses must be the same as those +that were used when the pattern was compiled. If this is not the case, the +behaviour of pcre_exec() is undefined. Therefore, when a pattern is +compiled and matched in the same process, this field should never be set. In +this (the most common) case, the correct table pointer is automatically passed +with the compiled pattern from pcre_compile() to pcre_exec(). +

+

+If PCRE_EXTRA_MARK is set in the flags field, the mark field must +be set to point to a suitable variable. If the pattern contains any +backtracking control verbs such as (*MARK:NAME), and the execution ends up with +a name to pass back, a pointer to the name string (zero terminated) is placed +in the variable pointed to by the mark field. The names are within the +compiled pattern; if you wish to retain such a name you must copy it before +freeing the memory of a compiled pattern. If there is no name to pass back, the +variable pointed to by the mark field is set to NULL. For details of the +backtracking control verbs, see the section entitled +"Backtracking control" +in the +pcrepattern +documentation. +

+
+Option bits for pcre_exec() +
+

+The unused bits of the options argument for pcre_exec() must be +zero. The only bits that may be set are PCRE_ANCHORED, PCRE_NEWLINE_xxx, +PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NOTEMPTY_ATSTART, +PCRE_NO_START_OPTIMIZE, PCRE_NO_UTF8_CHECK, PCRE_PARTIAL_HARD, and +PCRE_PARTIAL_SOFT. +

+

+If the pattern was successfully studied with one of the just-in-time (JIT) +compile options, the only supported options for JIT execution are +PCRE_NO_UTF8_CHECK, PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, +PCRE_NOTEMPTY_ATSTART, PCRE_PARTIAL_HARD, and PCRE_PARTIAL_SOFT. If an +unsupported option is used, JIT execution is disabled and the normal +interpretive code in pcre_exec() is run. +

+  PCRE_ANCHORED
+
+The PCRE_ANCHORED option limits pcre_exec() to matching at the first +matching position. If a pattern was compiled with PCRE_ANCHORED, or turned out +to be anchored by virtue of its contents, it cannot be made unachored at +matching time. +
+  PCRE_BSR_ANYCRLF
+  PCRE_BSR_UNICODE
+
+These options (which are mutually exclusive) control what the \R escape +sequence matches. The choice is either to match only CR, LF, or CRLF, or to +match any Unicode newline sequence. These options override the choice that was +made or defaulted when the pattern was compiled. +
+  PCRE_NEWLINE_CR
+  PCRE_NEWLINE_LF
+  PCRE_NEWLINE_CRLF
+  PCRE_NEWLINE_ANYCRLF
+  PCRE_NEWLINE_ANY
+
+These options override the newline definition that was chosen or defaulted when +the pattern was compiled. For details, see the description of +pcre_compile() above. During matching, the newline choice affects the +behaviour of the dot, circumflex, and dollar metacharacters. It may also alter +the way the match position is advanced after a match failure for an unanchored +pattern. +

+

+When PCRE_NEWLINE_CRLF, PCRE_NEWLINE_ANYCRLF, or PCRE_NEWLINE_ANY is set, and a +match attempt for an unanchored pattern fails when the current position is at a +CRLF sequence, and the pattern contains no explicit matches for CR or LF +characters, the match position is advanced by two characters instead of one, in +other words, to after the CRLF. +

+

+The above rule is a compromise that makes the most common cases work as +expected. For example, if the pattern is .+A (and the PCRE_DOTALL option is not +set), it does not match the string "\r\nA" because, after failing at the +start, it skips both the CR and the LF before retrying. However, the pattern +[\r\n]A does match that string, because it contains an explicit CR or LF +reference, and so advances only by one character after the first failure. +

+

+An explicit match for CR of LF is either a literal appearance of one of those +characters, or one of the \r or \n escape sequences. Implicit matches such as +[^X] do not count, nor does \s (which includes CR and LF in the characters +that it matches). +

+

+Notwithstanding the above, anomalous effects may still occur when CRLF is a +valid newline sequence and explicit \r or \n escapes appear in the pattern. +

+  PCRE_NOTBOL
+
+This option specifies that first character of the subject string is not the +beginning of a line, so the circumflex metacharacter should not match before +it. Setting this without PCRE_MULTILINE (at compile time) causes circumflex +never to match. This option affects only the behaviour of the circumflex +metacharacter. It does not affect \A. +
+  PCRE_NOTEOL
+
+This option specifies that the end of the subject string is not the end of a +line, so the dollar metacharacter should not match it nor (except in multiline +mode) a newline immediately before it. Setting this without PCRE_MULTILINE (at +compile time) causes dollar never to match. This option affects only the +behaviour of the dollar metacharacter. It does not affect \Z or \z. +
+  PCRE_NOTEMPTY
+
+An empty string is not considered to be a valid match if this option is set. If +there are alternatives in the pattern, they are tried. If all the alternatives +match the empty string, the entire match fails. For example, if the pattern +
+  a?b?
+
+is applied to a string not beginning with "a" or "b", it matches an empty +string at the start of the subject. With PCRE_NOTEMPTY set, this match is not +valid, so PCRE searches further into the string for occurrences of "a" or "b". +
+  PCRE_NOTEMPTY_ATSTART
+
+This is like PCRE_NOTEMPTY, except that an empty string match that is not at +the start of the subject is permitted. If the pattern is anchored, such a match +can occur only if the pattern contains \K. +

+

+Perl has no direct equivalent of PCRE_NOTEMPTY or PCRE_NOTEMPTY_ATSTART, but it +does make a special case of a pattern match of the empty string within its +split() function, and when using the /g modifier. It is possible to +emulate Perl's behaviour after matching a null string by first trying the match +again at the same offset with PCRE_NOTEMPTY_ATSTART and PCRE_ANCHORED, and then +if that fails, by advancing the starting offset (see below) and trying an +ordinary match again. There is some code that demonstrates how to do this in +the +pcredemo +sample program. In the most general case, you have to check to see if the +newline convention recognizes CRLF as a newline, and if so, and the current +character is CR followed by LF, advance the starting offset by two characters +instead of one. +

+  PCRE_NO_START_OPTIMIZE
+
+There are a number of optimizations that pcre_exec() uses at the start of +a match, in order to speed up the process. For example, if it is known that an +unanchored match must start with a specific character, it searches the subject +for that character, and fails immediately if it cannot find it, without +actually running the main matching function. This means that a special item +such as (*COMMIT) at the start of a pattern is not considered until after a +suitable starting point for the match has been found. Also, when callouts or +(*MARK) items are in use, these "start-up" optimizations can cause them to be +skipped if the pattern is never actually used. The start-up optimizations are +in effect a pre-scan of the subject that takes place before the pattern is run. +

+

+The PCRE_NO_START_OPTIMIZE option disables the start-up optimizations, possibly +causing performance to suffer, but ensuring that in cases where the result is +"no match", the callouts do occur, and that items such as (*COMMIT) and (*MARK) +are considered at every possible starting position in the subject string. If +PCRE_NO_START_OPTIMIZE is set at compile time, it cannot be unset at matching +time. The use of PCRE_NO_START_OPTIMIZE at matching time (that is, passing it +to pcre_exec()) disables JIT execution; in this situation, matching is +always done using interpretively. +

+

+Setting PCRE_NO_START_OPTIMIZE can change the outcome of a matching operation. +Consider the pattern +

+  (*COMMIT)ABC
+
+When this is compiled, PCRE records the fact that a match must start with the +character "A". Suppose the subject string is "DEFABC". The start-up +optimization scans along the subject, finds "A" and runs the first match +attempt from there. The (*COMMIT) item means that the pattern must match the +current starting position, which in this case, it does. However, if the same +match is run with PCRE_NO_START_OPTIMIZE set, the initial scan along the +subject string does not happen. The first match attempt is run starting from +"D" and when this fails, (*COMMIT) prevents any further matches being tried, so +the overall result is "no match". If the pattern is studied, more start-up +optimizations may be used. For example, a minimum length for the subject may be +recorded. Consider the pattern +
+  (*MARK:A)(X|Y)
+
+The minimum length for a match is one character. If the subject is "ABC", there +will be attempts to match "ABC", "BC", "C", and then finally an empty string. +If the pattern is studied, the final attempt does not take place, because PCRE +knows that the subject is too short, and so the (*MARK) is never encountered. +In this case, studying the pattern does not affect the overall match result, +which is still "no match", but it does affect the auxiliary information that is +returned. +
+  PCRE_NO_UTF8_CHECK
+
+When PCRE_UTF8 is set at compile time, the validity of the subject as a UTF-8 +string is automatically checked when pcre_exec() is subsequently called. +The entire string is checked before any other processing takes place. The value +of startoffset is also checked to ensure that it points to the start of a +UTF-8 character. There is a discussion about the +validity of UTF-8 strings +in the +pcreunicode +page. If an invalid sequence of bytes is found, pcre_exec() returns the +error PCRE_ERROR_BADUTF8 or, if PCRE_PARTIAL_HARD is set and the problem is a +truncated character at the end of the subject, PCRE_ERROR_SHORTUTF8. In both +cases, information about the precise nature of the error may also be returned +(see the descriptions of these errors in the section entitled \fIError return +values from\fP pcre_exec() +below). +If startoffset contains a value that does not point to the start of a +UTF-8 character (or to the end of the subject), PCRE_ERROR_BADUTF8_OFFSET is +returned. +

+

+If you already know that your subject is valid, and you want to skip these +checks for performance reasons, you can set the PCRE_NO_UTF8_CHECK option when +calling pcre_exec(). You might want to do this for the second and +subsequent calls to pcre_exec() if you are making repeated calls to find +all the matches in a single subject string. However, you should be sure that +the value of startoffset points to the start of a character (or the end +of the subject). When PCRE_NO_UTF8_CHECK is set, the effect of passing an +invalid string as a subject or an invalid value of startoffset is +undefined. Your program may crash or loop. +

+  PCRE_PARTIAL_HARD
+  PCRE_PARTIAL_SOFT
+
+These options turn on the partial matching feature. For backwards +compatibility, PCRE_PARTIAL is a synonym for PCRE_PARTIAL_SOFT. A partial match +occurs if the end of the subject string is reached successfully, but there are +not enough subject characters to complete the match. If this happens when +PCRE_PARTIAL_SOFT (but not PCRE_PARTIAL_HARD) is set, matching continues by +testing any remaining alternatives. Only if no complete match can be found is +PCRE_ERROR_PARTIAL returned instead of PCRE_ERROR_NOMATCH. In other words, +PCRE_PARTIAL_SOFT says that the caller is prepared to handle a partial match, +but only if no complete match can be found. +

+

+If PCRE_PARTIAL_HARD is set, it overrides PCRE_PARTIAL_SOFT. In this case, if a +partial match is found, pcre_exec() immediately returns +PCRE_ERROR_PARTIAL, without considering any other alternatives. In other words, +when PCRE_PARTIAL_HARD is set, a partial match is considered to be more +important that an alternative complete match. +

+

+In both cases, the portion of the string that was inspected when the partial +match was found is set as the first matching string. There is a more detailed +discussion of partial and multi-segment matching, with examples, in the +pcrepartial +documentation. +

+
+The string to be matched by pcre_exec() +
+

+The subject string is passed to pcre_exec() as a pointer in +subject, a length in length, and a starting offset in +startoffset. The units for length and startoffset are bytes +for the 8-bit library, 16-bit data items for the 16-bit library, and 32-bit +data items for the 32-bit library. +

+

+If startoffset is negative or greater than the length of the subject, +pcre_exec() returns PCRE_ERROR_BADOFFSET. When the starting offset is +zero, the search for a match starts at the beginning of the subject, and this +is by far the most common case. In UTF-8 or UTF-16 mode, the offset must point +to the start of a character, or the end of the subject (in UTF-32 mode, one +data unit equals one character, so all offsets are valid). Unlike the pattern +string, the subject may contain binary zeroes. +

+

+A non-zero starting offset is useful when searching for another match in the +same subject by calling pcre_exec() again after a previous success. +Setting startoffset differs from just passing over a shortened string and +setting PCRE_NOTBOL in the case of a pattern that begins with any kind of +lookbehind. For example, consider the pattern +

+  \Biss\B
+
+which finds occurrences of "iss" in the middle of words. (\B matches only if +the current position in the subject is not a word boundary.) When applied to +the string "Mississippi" the first call to pcre_exec() finds the first +occurrence. If pcre_exec() is called again with just the remainder of the +subject, namely "issippi", it does not match, because \B is always false at +the start of the subject, which is deemed to be a word boundary. However, if +pcre_exec() is passed the entire string again, but with startoffset +set to 4, it finds the second occurrence of "iss" because it is able to look +behind the starting point to discover that it is preceded by a letter. +

+

+Finding all the matches in a subject is tricky when the pattern can match an +empty string. It is possible to emulate Perl's /g behaviour by first trying the +match again at the same offset, with the PCRE_NOTEMPTY_ATSTART and +PCRE_ANCHORED options, and then if that fails, advancing the starting offset +and trying an ordinary match again. There is some code that demonstrates how to +do this in the +pcredemo +sample program. In the most general case, you have to check to see if the +newline convention recognizes CRLF as a newline, and if so, and the current +character is CR followed by LF, advance the starting offset by two characters +instead of one. +

+

+If a non-zero starting offset is passed when the pattern is anchored, one +attempt to match at the given offset is made. This can only succeed if the +pattern does not require the match to be at the start of the subject. +

+
+How pcre_exec() returns captured substrings +
+

+In general, a pattern matches a certain portion of the subject, and in +addition, further substrings from the subject may be picked out by parts of the +pattern. Following the usage in Jeffrey Friedl's book, this is called +"capturing" in what follows, and the phrase "capturing subpattern" is used for +a fragment of a pattern that picks out a substring. PCRE supports several other +kinds of parenthesized subpattern that do not cause substrings to be captured. +

+

+Captured substrings are returned to the caller via a vector of integers whose +address is passed in ovector. The number of elements in the vector is +passed in ovecsize, which must be a non-negative number. Note: this +argument is NOT the size of ovector in bytes. +

+

+The first two-thirds of the vector is used to pass back captured substrings, +each substring using a pair of integers. The remaining third of the vector is +used as workspace by pcre_exec() while matching capturing subpatterns, +and is not available for passing back information. The number passed in +ovecsize should always be a multiple of three. If it is not, it is +rounded down. +

+

+When a match is successful, information about captured substrings is returned +in pairs of integers, starting at the beginning of ovector, and +continuing up to two-thirds of its length at the most. The first element of +each pair is set to the offset of the first character in a substring, and the +second is set to the offset of the first character after the end of a +substring. These values are always data unit offsets, even in UTF mode. They +are byte offsets in the 8-bit library, 16-bit data item offsets in the 16-bit +library, and 32-bit data item offsets in the 32-bit library. Note: they +are not character counts. +

+

+The first pair of integers, ovector[0] and ovector[1], identify the +portion of the subject string matched by the entire pattern. The next pair is +used for the first capturing subpattern, and so on. The value returned by +pcre_exec() is one more than the highest numbered pair that has been set. +For example, if two substrings have been captured, the returned value is 3. If +there are no capturing subpatterns, the return value from a successful match is +1, indicating that just the first pair of offsets has been set. +

+

+If a capturing subpattern is matched repeatedly, it is the last portion of the +string that it matched that is returned. +

+

+If the vector is too small to hold all the captured substring offsets, it is +used as far as possible (up to two-thirds of its length), and the function +returns a value of zero. If neither the actual string matched nor any captured +substrings are of interest, pcre_exec() may be called with ovector +passed as NULL and ovecsize as zero. However, if the pattern contains +back references and the ovector is not big enough to remember the related +substrings, PCRE has to get additional memory for use during matching. Thus it +is usually advisable to supply an ovector of reasonable size. +

+

+There are some cases where zero is returned (indicating vector overflow) when +in fact the vector is exactly the right size for the final match. For example, +consider the pattern +

+  (a)(?:(b)c|bd)
+
+If a vector of 6 elements (allowing for only 1 captured substring) is given +with subject string "abd", pcre_exec() will try to set the second +captured string, thereby recording a vector overflow, before failing to match +"c" and backing up to try the second alternative. The zero return, however, +does correctly indicate that the maximum number of slots (namely 2) have been +filled. In similar cases where there is temporary overflow, but the final +number of used slots is actually less than the maximum, a non-zero value is +returned. +

+

+The pcre_fullinfo() function can be used to find out how many capturing +subpatterns there are in a compiled pattern. The smallest size for +ovector that will allow for n captured substrings, in addition to +the offsets of the substring matched by the whole pattern, is (n+1)*3. +

+

+It is possible for capturing subpattern number n+1 to match some part of +the subject when subpattern n has not been used at all. For example, if +the string "abc" is matched against the pattern (a|(z))(bc) the return from the +function is 4, and subpatterns 1 and 3 are matched, but 2 is not. When this +happens, both values in the offset pairs corresponding to unused subpatterns +are set to -1. +

+

+Offset values that correspond to unused subpatterns at the end of the +expression are also set to -1. For example, if the string "abc" is matched +against the pattern (abc)(x(yz)?)? subpatterns 2 and 3 are not matched. The +return from the function is 2, because the highest used capturing subpattern +number is 1, and the offsets for for the second and third capturing subpatterns +(assuming the vector is large enough, of course) are set to -1. +

+

+Note: Elements in the first two-thirds of ovector that do not +correspond to capturing parentheses in the pattern are never changed. That is, +if a pattern contains n capturing parentheses, no more than +ovector[0] to ovector[2n+1] are set by pcre_exec(). The other +elements (in the first two-thirds) retain whatever values they previously had. +

+

+Some convenience functions are provided for extracting the captured substrings +as separate strings. These are described below. +

+
+Error return values from pcre_exec() +
+

+If pcre_exec() fails, it returns a negative number. The following are +defined in the header file: +

+  PCRE_ERROR_NOMATCH        (-1)
+
+The subject string did not match the pattern. +
+  PCRE_ERROR_NULL           (-2)
+
+Either code or subject was passed as NULL, or ovector was +NULL and ovecsize was not zero. +
+  PCRE_ERROR_BADOPTION      (-3)
+
+An unrecognized bit was set in the options argument. +
+  PCRE_ERROR_BADMAGIC       (-4)
+
+PCRE stores a 4-byte "magic number" at the start of the compiled code, to catch +the case when it is passed a junk pointer and to detect when a pattern that was +compiled in an environment of one endianness is run in an environment with the +other endianness. This is the error that PCRE gives when the magic number is +not present. +
+  PCRE_ERROR_UNKNOWN_OPCODE (-5)
+
+While running the pattern match, an unknown item was encountered in the +compiled pattern. This error could be caused by a bug in PCRE or by overwriting +of the compiled pattern. +
+  PCRE_ERROR_NOMEMORY       (-6)
+
+If a pattern contains back references, but the ovector that is passed to +pcre_exec() is not big enough to remember the referenced substrings, PCRE +gets a block of memory at the start of matching to use for this purpose. If the +call via pcre_malloc() fails, this error is given. The memory is +automatically freed at the end of matching. +

+

+This error is also given if pcre_stack_malloc() fails in +pcre_exec(). This can happen only when PCRE has been compiled with +--disable-stack-for-recursion. +

+  PCRE_ERROR_NOSUBSTRING    (-7)
+
+This error is used by the pcre_copy_substring(), +pcre_get_substring(), and pcre_get_substring_list() functions (see +below). It is never returned by pcre_exec(). +
+  PCRE_ERROR_MATCHLIMIT     (-8)
+
+The backtracking limit, as specified by the match_limit field in a +pcre_extra structure (or defaulted) was reached. See the description +above. +
+  PCRE_ERROR_CALLOUT        (-9)
+
+This error is never generated by pcre_exec() itself. It is provided for +use by callout functions that want to yield a distinctive error code. See the +pcrecallout +documentation for details. +
+  PCRE_ERROR_BADUTF8        (-10)
+
+A string that contains an invalid UTF-8 byte sequence was passed as a subject, +and the PCRE_NO_UTF8_CHECK option was not set. If the size of the output vector +(ovecsize) is at least 2, the byte offset to the start of the the invalid +UTF-8 character is placed in the first element, and a reason code is placed in +the second element. The reason codes are listed in the +following section. +For backward compatibility, if PCRE_PARTIAL_HARD is set and the problem is a +truncated UTF-8 character at the end of the subject (reason codes 1 to 5), +PCRE_ERROR_SHORTUTF8 is returned instead of PCRE_ERROR_BADUTF8. +
+  PCRE_ERROR_BADUTF8_OFFSET (-11)
+
+The UTF-8 byte sequence that was passed as a subject was checked and found to +be valid (the PCRE_NO_UTF8_CHECK option was not set), but the value of +startoffset did not point to the beginning of a UTF-8 character or the +end of the subject. +
+  PCRE_ERROR_PARTIAL        (-12)
+
+The subject string did not match, but it did match partially. See the +pcrepartial +documentation for details of partial matching. +
+  PCRE_ERROR_BADPARTIAL     (-13)
+
+This code is no longer in use. It was formerly returned when the PCRE_PARTIAL +option was used with a compiled pattern containing items that were not +supported for partial matching. From release 8.00 onwards, there are no +restrictions on partial matching. +
+  PCRE_ERROR_INTERNAL       (-14)
+
+An unexpected internal error has occurred. This error could be caused by a bug +in PCRE or by overwriting of the compiled pattern. +
+  PCRE_ERROR_BADCOUNT       (-15)
+
+This error is given if the value of the ovecsize argument is negative. +
+  PCRE_ERROR_RECURSIONLIMIT (-21)
+
+The internal recursion limit, as specified by the match_limit_recursion +field in a pcre_extra structure (or defaulted) was reached. See the +description above. +
+  PCRE_ERROR_BADNEWLINE     (-23)
+
+An invalid combination of PCRE_NEWLINE_xxx options was given. +
+  PCRE_ERROR_BADOFFSET      (-24)
+
+The value of startoffset was negative or greater than the length of the +subject, that is, the value in length. +
+  PCRE_ERROR_SHORTUTF8      (-25)
+
+This error is returned instead of PCRE_ERROR_BADUTF8 when the subject string +ends with a truncated UTF-8 character and the PCRE_PARTIAL_HARD option is set. +Information about the failure is returned as for PCRE_ERROR_BADUTF8. It is in +fact sufficient to detect this case, but this special error code for +PCRE_PARTIAL_HARD precedes the implementation of returned information; it is +retained for backwards compatibility. +
+  PCRE_ERROR_RECURSELOOP    (-26)
+
+This error is returned when pcre_exec() detects a recursion loop within +the pattern. Specifically, it means that either the whole pattern or a +subpattern has been called recursively for the second time at the same position +in the subject string. Some simple patterns that might do this are detected and +faulted at compile time, but more complicated cases, in particular mutual +recursions between two different subpatterns, cannot be detected until run +time. +
+  PCRE_ERROR_JIT_STACKLIMIT (-27)
+
+This error is returned when a pattern that was successfully studied using a +JIT compile option is being matched, but the memory available for the +just-in-time processing stack is not large enough. See the +pcrejit +documentation for more details. +
+  PCRE_ERROR_BADMODE        (-28)
+
+This error is given if a pattern that was compiled by the 8-bit library is +passed to a 16-bit or 32-bit library function, or vice versa. +
+  PCRE_ERROR_BADENDIANNESS  (-29)
+
+This error is given if a pattern that was compiled and saved is reloaded on a +host with different endianness. The utility function +pcre_pattern_to_host_byte_order() can be used to convert such a pattern +so that it runs on the new host. +
+  PCRE_ERROR_JIT_BADOPTION
+
+This error is returned when a pattern that was successfully studied using a JIT +compile option is being matched, but the matching mode (partial or complete +match) does not correspond to any JIT compilation mode. When the JIT fast path +function is used, this error may be also given for invalid options. See the +pcrejit +documentation for more details. +
+  PCRE_ERROR_BADLENGTH      (-32)
+
+This error is given if pcre_exec() is called with a negative value for +the length argument. +

+

+Error numbers -16 to -20, -22, and 30 are not used by pcre_exec(). +

+
+Reason codes for invalid UTF-8 strings +
+

+This section applies only to the 8-bit library. The corresponding information +for the 16-bit and 32-bit libraries is given in the +pcre16 +and +pcre32 +pages. +

+

+When pcre_exec() returns either PCRE_ERROR_BADUTF8 or +PCRE_ERROR_SHORTUTF8, and the size of the output vector (ovecsize) is at +least 2, the offset of the start of the invalid UTF-8 character is placed in +the first output vector element (ovector[0]) and a reason code is placed +in the second element (ovector[1]). The reason codes are given names in +the pcre.h header file: +

+  PCRE_UTF8_ERR1
+  PCRE_UTF8_ERR2
+  PCRE_UTF8_ERR3
+  PCRE_UTF8_ERR4
+  PCRE_UTF8_ERR5
+
+The string ends with a truncated UTF-8 character; the code specifies how many +bytes are missing (1 to 5). Although RFC 3629 restricts UTF-8 characters to be +no longer than 4 bytes, the encoding scheme (originally defined by RFC 2279) +allows for up to 6 bytes, and this is checked first; hence the possibility of +4 or 5 missing bytes. +
+  PCRE_UTF8_ERR6
+  PCRE_UTF8_ERR7
+  PCRE_UTF8_ERR8
+  PCRE_UTF8_ERR9
+  PCRE_UTF8_ERR10
+
+The two most significant bits of the 2nd, 3rd, 4th, 5th, or 6th byte of the +character do not have the binary value 0b10 (that is, either the most +significant bit is 0, or the next bit is 1). +
+  PCRE_UTF8_ERR11
+  PCRE_UTF8_ERR12
+
+A character that is valid by the RFC 2279 rules is either 5 or 6 bytes long; +these code points are excluded by RFC 3629. +
+  PCRE_UTF8_ERR13
+
+A 4-byte character has a value greater than 0x10fff; these code points are +excluded by RFC 3629. +
+  PCRE_UTF8_ERR14
+
+A 3-byte character has a value in the range 0xd800 to 0xdfff; this range of +code points are reserved by RFC 3629 for use with UTF-16, and so are excluded +from UTF-8. +
+  PCRE_UTF8_ERR15
+  PCRE_UTF8_ERR16
+  PCRE_UTF8_ERR17
+  PCRE_UTF8_ERR18
+  PCRE_UTF8_ERR19
+
+A 2-, 3-, 4-, 5-, or 6-byte character is "overlong", that is, it codes for a +value that can be represented by fewer bytes, which is invalid. For example, +the two bytes 0xc0, 0xae give the value 0x2e, whose correct coding uses just +one byte. +
+  PCRE_UTF8_ERR20
+
+The two most significant bits of the first byte of a character have the binary +value 0b10 (that is, the most significant bit is 1 and the second is 0). Such a +byte can only validly occur as the second or subsequent byte of a multi-byte +character. +
+  PCRE_UTF8_ERR21
+
+The first byte of a character has the value 0xfe or 0xff. These values can +never occur in a valid UTF-8 string. +
+  PCRE_UTF8_ERR22
+
+This error code was formerly used when the presence of a so-called +"non-character" caused an error. Unicode corrigendum #9 makes it clear that +such characters should not cause a string to be rejected, and so this code is +no longer in use and is never returned. +

+
EXTRACTING CAPTURED SUBSTRINGS BY NUMBER
+

+int pcre_copy_substring(const char *subject, int *ovector, + int stringcount, int stringnumber, char *buffer, + int buffersize); +
+
+int pcre_get_substring(const char *subject, int *ovector, + int stringcount, int stringnumber, + const char **stringptr); +
+
+int pcre_get_substring_list(const char *subject, + int *ovector, int stringcount, const char ***listptr); +

+

+Captured substrings can be accessed directly by using the offsets returned by +pcre_exec() in ovector. For convenience, the functions +pcre_copy_substring(), pcre_get_substring(), and +pcre_get_substring_list() are provided for extracting captured substrings +as new, separate, zero-terminated strings. These functions identify substrings +by number. The next section describes functions for extracting named +substrings. +

+

+A substring that contains a binary zero is correctly extracted and has a +further zero added on the end, but the result is not, of course, a C string. +However, you can process such a string by referring to the length that is +returned by pcre_copy_substring() and pcre_get_substring(). +Unfortunately, the interface to pcre_get_substring_list() is not adequate +for handling strings containing binary zeros, because the end of the final +string is not independently indicated. +

+

+The first three arguments are the same for all three of these functions: +subject is the subject string that has just been successfully matched, +ovector is a pointer to the vector of integer offsets that was passed to +pcre_exec(), and stringcount is the number of substrings that were +captured by the match, including the substring that matched the entire regular +expression. This is the value returned by pcre_exec() if it is greater +than zero. If pcre_exec() returned zero, indicating that it ran out of +space in ovector, the value passed as stringcount should be the +number of elements in the vector divided by three. +

+

+The functions pcre_copy_substring() and pcre_get_substring() +extract a single substring, whose number is given as stringnumber. A +value of zero extracts the substring that matched the entire pattern, whereas +higher values extract the captured substrings. For pcre_copy_substring(), +the string is placed in buffer, whose length is given by +buffersize, while for pcre_get_substring() a new block of memory is +obtained via pcre_malloc, and its address is returned via +stringptr. The yield of the function is the length of the string, not +including the terminating zero, or one of these error codes: +

+  PCRE_ERROR_NOMEMORY       (-6)
+
+The buffer was too small for pcre_copy_substring(), or the attempt to get +memory failed for pcre_get_substring(). +
+  PCRE_ERROR_NOSUBSTRING    (-7)
+
+There is no substring whose number is stringnumber. +

+

+The pcre_get_substring_list() function extracts all available substrings +and builds a list of pointers to them. All this is done in a single block of +memory that is obtained via pcre_malloc. The address of the memory block +is returned via listptr, which is also the start of the list of string +pointers. The end of the list is marked by a NULL pointer. The yield of the +function is zero if all went well, or the error code +

+  PCRE_ERROR_NOMEMORY       (-6)
+
+if the attempt to get the memory block failed. +

+

+When any of these functions encounter a substring that is unset, which can +happen when capturing subpattern number n+1 matches some part of the +subject, but subpattern n has not been used at all, they return an empty +string. This can be distinguished from a genuine zero-length substring by +inspecting the appropriate offset in ovector, which is negative for unset +substrings. +

+

+The two convenience functions pcre_free_substring() and +pcre_free_substring_list() can be used to free the memory returned by +a previous call of pcre_get_substring() or +pcre_get_substring_list(), respectively. They do nothing more than call +the function pointed to by pcre_free, which of course could be called +directly from a C program. However, PCRE is used in some situations where it is +linked via a special interface to another programming language that cannot use +pcre_free directly; it is for these cases that the functions are +provided. +

+
EXTRACTING CAPTURED SUBSTRINGS BY NAME
+

+int pcre_get_stringnumber(const pcre *code, + const char *name); +
+
+int pcre_copy_named_substring(const pcre *code, + const char *subject, int *ovector, + int stringcount, const char *stringname, + char *buffer, int buffersize); +
+
+int pcre_get_named_substring(const pcre *code, + const char *subject, int *ovector, + int stringcount, const char *stringname, + const char **stringptr); +

+

+To extract a substring by name, you first have to find associated number. +For example, for this pattern +

+  (a+)b(?<xxx>\d+)...
+
+the number of the subpattern called "xxx" is 2. If the name is known to be +unique (PCRE_DUPNAMES was not set), you can find the number from the name by +calling pcre_get_stringnumber(). The first argument is the compiled +pattern, and the second is the name. The yield of the function is the +subpattern number, or PCRE_ERROR_NOSUBSTRING (-7) if there is no subpattern of +that name. +

+

+Given the number, you can extract the substring directly, or use one of the +functions described in the previous section. For convenience, there are also +two functions that do the whole job. +

+

+Most of the arguments of pcre_copy_named_substring() and +pcre_get_named_substring() are the same as those for the similarly named +functions that extract by number. As these are described in the previous +section, they are not re-described here. There are just two differences: +

+

+First, instead of a substring number, a substring name is given. Second, there +is an extra argument, given at the start, which is a pointer to the compiled +pattern. This is needed in order to gain access to the name-to-number +translation table. +

+

+These functions call pcre_get_stringnumber(), and if it succeeds, they +then call pcre_copy_substring() or pcre_get_substring(), as +appropriate. NOTE: If PCRE_DUPNAMES is set and there are duplicate names, +the behaviour may not be what you want (see the next section). +

+

+Warning: If the pattern uses the (?| feature to set up multiple +subpatterns with the same number, as described in the +section on duplicate subpattern numbers +in the +pcrepattern +page, you cannot use names to distinguish the different subpatterns, because +names are not included in the compiled code. The matching process uses only +numbers. For this reason, the use of different names for subpatterns of the +same number causes an error at compile time. +

+
DUPLICATE SUBPATTERN NAMES
+

+int pcre_get_stringtable_entries(const pcre *code, + const char *name, char **first, char **last); +

+

+When a pattern is compiled with the PCRE_DUPNAMES option, names for subpatterns +are not required to be unique. (Duplicate names are always allowed for +subpatterns with the same number, created by using the (?| feature. Indeed, if +such subpatterns are named, they are required to use the same names.) +

+

+Normally, patterns with duplicate names are such that in any one match, only +one of the named subpatterns participates. An example is shown in the +pcrepattern +documentation. +

+

+When duplicates are present, pcre_copy_named_substring() and +pcre_get_named_substring() return the first substring corresponding to +the given name that is set. If none are set, PCRE_ERROR_NOSUBSTRING (-7) is +returned; no data is returned. The pcre_get_stringnumber() function +returns one of the numbers that are associated with the name, but it is not +defined which it is. +

+

+If you want to get full details of all captured substrings for a given name, +you must use the pcre_get_stringtable_entries() function. The first +argument is the compiled pattern, and the second is the name. The third and +fourth are pointers to variables which are updated by the function. After it +has run, they point to the first and last entries in the name-to-number table +for the given name. The function itself returns the length of each entry, or +PCRE_ERROR_NOSUBSTRING (-7) if there are none. The format of the table is +described above in the section entitled Information about a pattern +above. +Given all the relevant entries for the name, you can extract each of their +numbers, and hence the captured data, if any. +

+
FINDING ALL POSSIBLE MATCHES
+

+The traditional matching function uses a similar algorithm to Perl, which stops +when it finds the first match, starting at a given point in the subject. If you +want to find all possible matches, or the longest possible match, consider +using the alternative matching function (see below) instead. If you cannot use +the alternative function, but still need to find all possible matches, you +can kludge it up by making use of the callout facility, which is described in +the +pcrecallout +documentation. +

+

+What you have to do is to insert a callout right at the end of the pattern. +When your callout function is called, extract and save the current matched +substring. Then return 1, which forces pcre_exec() to backtrack and try +other alternatives. Ultimately, when it runs out of matches, pcre_exec() +will yield PCRE_ERROR_NOMATCH. +

+
OBTAINING AN ESTIMATE OF STACK USAGE
+

+Matching certain patterns using pcre_exec() can use a lot of process +stack, which in certain environments can be rather limited in size. Some users +find it helpful to have an estimate of the amount of stack that is used by +pcre_exec(), to help them set recursion limits, as described in the +pcrestack +documentation. The estimate that is output by pcretest when called with +the -m and -C options is obtained by calling pcre_exec with +the values NULL, NULL, NULL, -999, and -999 for its first five arguments. +

+

+Normally, if its first argument is NULL, pcre_exec() immediately returns +the negative error code PCRE_ERROR_NULL, but with this special combination of +arguments, it returns instead a negative number whose absolute value is the +approximate stack frame size in bytes. (A negative number is used so that it is +clear that no match has happened.) The value is approximate because in some +cases, recursive calls to pcre_exec() occur when there are one or two +additional variables on the stack. +

+

+If PCRE has been compiled to use the heap instead of the stack for recursion, +the value returned is the size of each block that is obtained from the heap. +

+
MATCHING A PATTERN: THE ALTERNATIVE FUNCTION
+

+int pcre_dfa_exec(const pcre *code, const pcre_extra *extra, + const char *subject, int length, int startoffset, + int options, int *ovector, int ovecsize, + int *workspace, int wscount); +

+

+The function pcre_dfa_exec() is called to match a subject string against +a compiled pattern, using a matching algorithm that scans the subject string +just once, and does not backtrack. This has different characteristics to the +normal algorithm, and is not compatible with Perl. Some of the features of PCRE +patterns are not supported. Nevertheless, there are times when this kind of +matching can be useful. For a discussion of the two matching algorithms, and a +list of features that pcre_dfa_exec() does not support, see the +pcrematching +documentation. +

+

+The arguments for the pcre_dfa_exec() function are the same as for +pcre_exec(), plus two extras. The ovector argument is used in a +different way, and this is described below. The other common arguments are used +in the same way as for pcre_exec(), so their description is not repeated +here. +

+

+The two additional arguments provide workspace for the function. The workspace +vector should contain at least 20 elements. It is used for keeping track of +multiple paths through the pattern tree. More workspace will be needed for +patterns and subjects where there are a lot of potential matches. +

+

+Here is an example of a simple call to pcre_dfa_exec(): +

+  int rc;
+  int ovector[10];
+  int wspace[20];
+  rc = pcre_dfa_exec(
+    re,             /* result of pcre_compile() */
+    NULL,           /* we didn't study the pattern */
+    "some string",  /* the subject string */
+    11,             /* the length of the subject string */
+    0,              /* start at offset 0 in the subject */
+    0,              /* default options */
+    ovector,        /* vector of integers for substring information */
+    10,             /* number of elements (NOT size in bytes) */
+    wspace,         /* working space vector */
+    20);            /* number of elements (NOT size in bytes) */
+
+

+
+Option bits for pcre_dfa_exec() +
+

+The unused bits of the options argument for pcre_dfa_exec() must be +zero. The only bits that may be set are PCRE_ANCHORED, PCRE_NEWLINE_xxx, +PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NOTEMPTY_ATSTART, +PCRE_NO_UTF8_CHECK, PCRE_BSR_ANYCRLF, PCRE_BSR_UNICODE, PCRE_NO_START_OPTIMIZE, +PCRE_PARTIAL_HARD, PCRE_PARTIAL_SOFT, PCRE_DFA_SHORTEST, and PCRE_DFA_RESTART. +All but the last four of these are exactly the same as for pcre_exec(), +so their description is not repeated here. +

+  PCRE_PARTIAL_HARD
+  PCRE_PARTIAL_SOFT
+
+These have the same general effect as they do for pcre_exec(), but the +details are slightly different. When PCRE_PARTIAL_HARD is set for +pcre_dfa_exec(), it returns PCRE_ERROR_PARTIAL if the end of the subject +is reached and there is still at least one matching possibility that requires +additional characters. This happens even if some complete matches have also +been found. When PCRE_PARTIAL_SOFT is set, the return code PCRE_ERROR_NOMATCH +is converted into PCRE_ERROR_PARTIAL if the end of the subject is reached, +there have been no complete matches, but there is still at least one matching +possibility. The portion of the string that was inspected when the longest +partial match was found is set as the first matching string in both cases. +There is a more detailed discussion of partial and multi-segment matching, with +examples, in the +pcrepartial +documentation. +
+  PCRE_DFA_SHORTEST
+
+Setting the PCRE_DFA_SHORTEST option causes the matching algorithm to stop as +soon as it has found one match. Because of the way the alternative algorithm +works, this is necessarily the shortest possible match at the first possible +matching point in the subject string. +
+  PCRE_DFA_RESTART
+
+When pcre_dfa_exec() returns a partial match, it is possible to call it +again, with additional subject characters, and have it continue with the same +match. The PCRE_DFA_RESTART option requests this action; when it is set, the +workspace and wscount options must reference the same vector as +before because data about the match so far is left in them after a partial +match. There is more discussion of this facility in the +pcrepartial +documentation. +

+
+Successful returns from pcre_dfa_exec() +
+

+When pcre_dfa_exec() succeeds, it may have matched more than one +substring in the subject. Note, however, that all the matches from one run of +the function start at the same point in the subject. The shorter matches are +all initial substrings of the longer matches. For example, if the pattern +

+  <.*>
+
+is matched against the string +
+  This is <something> <something else> <something further> no more
+
+the three matched strings are +
+  <something>
+  <something> <something else>
+  <something> <something else> <something further>
+
+On success, the yield of the function is a number greater than zero, which is +the number of matched substrings. The substrings themselves are returned in +ovector. Each string uses two elements; the first is the offset to the +start, and the second is the offset to the end. In fact, all the strings have +the same start offset. (Space could have been saved by giving this only once, +but it was decided to retain some compatibility with the way pcre_exec() +returns data, even though the meaning of the strings is different.) +

+

+The strings are returned in reverse order of length; that is, the longest +matching string is given first. If there were too many matches to fit into +ovector, the yield of the function is zero, and the vector is filled with +the longest matches. Unlike pcre_exec(), pcre_dfa_exec() can use +the entire ovector for returning matched strings. +

+

+NOTE: PCRE's "auto-possessification" optimization usually applies to character +repeats at the end of a pattern (as well as internally). For example, the +pattern "a\d+" is compiled as if it were "a\d++" because there is no point +even considering the possibility of backtracking into the repeated digits. For +DFA matching, this means that only one possible match is found. If you really +do want multiple matches in such cases, either use an ungreedy repeat +("a\d+?") or set the PCRE_NO_AUTO_POSSESS option when compiling. +

+
+Error returns from pcre_dfa_exec() +
+

+The pcre_dfa_exec() function returns a negative number when it fails. +Many of the errors are the same as for pcre_exec(), and these are +described +above. +There are in addition the following errors that are specific to +pcre_dfa_exec(): +

+  PCRE_ERROR_DFA_UITEM      (-16)
+
+This return is given if pcre_dfa_exec() encounters an item in the pattern +that it does not support, for instance, the use of \C or a back reference. +
+  PCRE_ERROR_DFA_UCOND      (-17)
+
+This return is given if pcre_dfa_exec() encounters a condition item that +uses a back reference for the condition, or a test for recursion in a specific +group. These are not supported. +
+  PCRE_ERROR_DFA_UMLIMIT    (-18)
+
+This return is given if pcre_dfa_exec() is called with an extra +block that contains a setting of the match_limit or +match_limit_recursion fields. This is not supported (these fields are +meaningless for DFA matching). +
+  PCRE_ERROR_DFA_WSSIZE     (-19)
+
+This return is given if pcre_dfa_exec() runs out of space in the +workspace vector. +
+  PCRE_ERROR_DFA_RECURSE    (-20)
+
+When a recursive subpattern is processed, the matching function calls itself +recursively, using private vectors for ovector and workspace. This +error is given if the output vector is not large enough. This should be +extremely rare, as a vector of size 1000 is used. +
+  PCRE_ERROR_DFA_BADRESTART (-30)
+
+When pcre_dfa_exec() is called with the PCRE_DFA_RESTART option, +some plausibility checks are made on the contents of the workspace, which +should contain data about the previous partial match. If any of these checks +fail, this error is given. +

+
SEE ALSO
+

+pcre16(3), pcre32(3), pcrebuild(3), pcrecallout(3), +pcrecpp(3)(3), pcrematching(3), pcrepartial(3), +pcreposix(3), pcreprecompile(3), pcresample(3), +pcrestack(3). +

+
AUTHOR
+

+Philip Hazel +
+University Computing Service +
+Cambridge CB2 3QH, England. +
+

+
REVISION
+

+Last updated: 18 December 2015 +
+Copyright © 1997-2015 University of Cambridge. +
+

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrebuild.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrebuild.html new file mode 100644 index 0000000000000000000000000000000000000000..03c8cbe0b21a630d0e288ec829398d460d8df6d7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrebuild.html @@ -0,0 +1,534 @@ + + +pcrebuild specification + + +

pcrebuild man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+

+
BUILDING PCRE
+

+PCRE is distributed with a configure script that can be used to build the +library in Unix-like environments using the applications known as Autotools. +Also in the distribution are files to support building using CMake +instead of configure. The text file +README +contains general information about building with Autotools (some of which is +repeated below), and also has some comments about building on various operating +systems. There is a lot more information about building PCRE without using +Autotools (including information about using CMake and building "by +hand") in the text file called +NON-AUTOTOOLS-BUILD. +You should consult this file as well as the +README +file if you are building in a non-Unix-like environment. +

+
PCRE BUILD-TIME OPTIONS
+

+The rest of this document describes the optional features of PCRE that can be +selected when the library is compiled. It assumes use of the configure +script, where the optional features are selected or deselected by providing +options to configure before running the make command. However, the +same options can be selected in both Unix-like and non-Unix-like environments +using the GUI facility of cmake-gui if you are using CMake instead +of configure to build PCRE. +

+

+If you are not using Autotools or CMake, option selection can be done by +editing the config.h file, or by passing parameter settings to the +compiler, as described in +NON-AUTOTOOLS-BUILD. +

+

+The complete list of options for configure (which includes the standard +ones such as the selection of the installation directory) can be obtained by +running +

+  ./configure --help
+
+The following sections include descriptions of options whose names begin with +--enable or --disable. These settings specify changes to the defaults for the +configure command. Because of the way that configure works, +--enable and --disable always come in pairs, so the complementary option always +exists as well, but as it specifies the default, it is not described. +

+
BUILDING 8-BIT, 16-BIT AND 32-BIT LIBRARIES
+

+By default, a library called libpcre is built, containing functions that +take string arguments contained in vectors of bytes, either as single-byte +characters, or interpreted as UTF-8 strings. You can also build a separate +library, called libpcre16, in which strings are contained in vectors of +16-bit data units and interpreted either as single-unit characters or UTF-16 +strings, by adding +

+  --enable-pcre16
+
+to the configure command. You can also build yet another separate +library, called libpcre32, in which strings are contained in vectors of +32-bit data units and interpreted either as single-unit characters or UTF-32 +strings, by adding +
+  --enable-pcre32
+
+to the configure command. If you do not want the 8-bit library, add +
+  --disable-pcre8
+
+as well. At least one of the three libraries must be built. Note that the C++ +and POSIX wrappers are for the 8-bit library only, and that pcregrep is +an 8-bit program. None of these are built if you select only the 16-bit or +32-bit libraries. +

+
BUILDING SHARED AND STATIC LIBRARIES
+

+The Autotools PCRE building process uses libtool to build both shared and +static libraries by default. You can suppress one of these by adding one of +

+  --disable-shared
+  --disable-static
+
+to the configure command, as required. +

+
C++ SUPPORT
+

+By default, if the 8-bit library is being built, the configure script +will search for a C++ compiler and C++ header files. If it finds them, it +automatically builds the C++ wrapper library (which supports only 8-bit +strings). You can disable this by adding +

+  --disable-cpp
+
+to the configure command. +

+
UTF-8, UTF-16 AND UTF-32 SUPPORT
+

+To build PCRE with support for UTF Unicode character strings, add +

+  --enable-utf
+
+to the configure command. This setting applies to all three libraries, +adding support for UTF-8 to the 8-bit library, support for UTF-16 to the 16-bit +library, and support for UTF-32 to the to the 32-bit library. There are no +separate options for enabling UTF-8, UTF-16 and UTF-32 independently because +that would allow ridiculous settings such as requesting UTF-16 support while +building only the 8-bit library. It is not possible to build one library with +UTF support and another without in the same configuration. (For backwards +compatibility, --enable-utf8 is a synonym of --enable-utf.) +

+

+Of itself, this setting does not make PCRE treat strings as UTF-8, UTF-16 or +UTF-32. As well as compiling PCRE with this option, you also have have to set +the PCRE_UTF8, PCRE_UTF16 or PCRE_UTF32 option (as appropriate) when you call +one of the pattern compiling functions. +

+

+If you set --enable-utf when compiling in an EBCDIC environment, PCRE expects +its input to be either ASCII or UTF-8 (depending on the run-time option). It is +not possible to support both EBCDIC and UTF-8 codes in the same version of the +library. Consequently, --enable-utf and --enable-ebcdic are mutually +exclusive. +

+
UNICODE CHARACTER PROPERTY SUPPORT
+

+UTF support allows the libraries to process character codepoints up to 0x10ffff +in the strings that they handle. On its own, however, it does not provide any +facilities for accessing the properties of such characters. If you want to be +able to use the pattern escapes \P, \p, and \X, which refer to Unicode +character properties, you must add +

+  --enable-unicode-properties
+
+to the configure command. This implies UTF support, even if you have +not explicitly requested it. +

+

+Including Unicode property support adds around 30K of tables to the PCRE +library. Only the general category properties such as Lu and Nd are +supported. Details are given in the +pcrepattern +documentation. +

+
JUST-IN-TIME COMPILER SUPPORT
+

+Just-in-time compiler support is included in the build by specifying +

+  --enable-jit
+
+This support is available only for certain hardware architectures. If this +option is set for an unsupported architecture, a compile time error occurs. +See the +pcrejit +documentation for a discussion of JIT usage. When JIT support is enabled, +pcregrep automatically makes use of it, unless you add +
+  --disable-pcregrep-jit
+
+to the "configure" command. +

+
CODE VALUE OF NEWLINE
+

+By default, PCRE interprets the linefeed (LF) character as indicating the end +of a line. This is the normal newline character on Unix-like systems. You can +compile PCRE to use carriage return (CR) instead, by adding +

+  --enable-newline-is-cr
+
+to the configure command. There is also a --enable-newline-is-lf option, +which explicitly specifies linefeed as the newline character. +
+
+Alternatively, you can specify that line endings are to be indicated by the two +character sequence CRLF. If you want this, add +
+  --enable-newline-is-crlf
+
+to the configure command. There is a fourth option, specified by +
+  --enable-newline-is-anycrlf
+
+which causes PCRE to recognize any of the three sequences CR, LF, or CRLF as +indicating a line ending. Finally, a fifth option, specified by +
+  --enable-newline-is-any
+
+causes PCRE to recognize any Unicode newline sequence. +

+

+Whatever line ending convention is selected when PCRE is built can be +overridden when the library functions are called. At build time it is +conventional to use the standard for your operating system. +

+
WHAT \R MATCHES
+

+By default, the sequence \R in a pattern matches any Unicode newline sequence, +whatever has been selected as the line ending sequence. If you specify +

+  --enable-bsr-anycrlf
+
+the default is changed so that \R matches only CR, LF, or CRLF. Whatever is +selected when PCRE is built can be overridden when the library functions are +called. +

+
POSIX MALLOC USAGE
+

+When the 8-bit library is called through the POSIX interface (see the +pcreposix +documentation), additional working storage is required for holding the pointers +to capturing substrings, because PCRE requires three integers per substring, +whereas the POSIX interface provides only two. If the number of expected +substrings is small, the wrapper function uses space on the stack, because this +is faster than using malloc() for each call. The default threshold above +which the stack is no longer used is 10; it can be changed by adding a setting +such as +

+  --with-posix-malloc-threshold=20
+
+to the configure command. +

+
HANDLING VERY LARGE PATTERNS
+

+Within a compiled pattern, offset values are used to point from one part to +another (for example, from an opening parenthesis to an alternation +metacharacter). By default, in the 8-bit and 16-bit libraries, two-byte values +are used for these offsets, leading to a maximum size for a compiled pattern of +around 64K. This is sufficient to handle all but the most gigantic patterns. +Nevertheless, some people do want to process truly enormous patterns, so it is +possible to compile PCRE to use three-byte or four-byte offsets by adding a +setting such as +

+  --with-link-size=3
+
+to the configure command. The value given must be 2, 3, or 4. For the +16-bit library, a value of 3 is rounded up to 4. In these libraries, using +longer offsets slows down the operation of PCRE because it has to load +additional data when handling them. For the 32-bit library the value is always +4 and cannot be overridden; the value of --with-link-size is ignored. +

+
AVOIDING EXCESSIVE STACK USAGE
+

+When matching with the pcre_exec() function, PCRE implements backtracking +by making recursive calls to an internal function called match(). In +environments where the size of the stack is limited, this can severely limit +PCRE's operation. (The Unix environment does not usually suffer from this +problem, but it may sometimes be necessary to increase the maximum stack size. +There is a discussion in the +pcrestack +documentation.) An alternative approach to recursion that uses memory from the +heap to remember data, instead of using recursive function calls, has been +implemented to work round the problem of limited stack size. If you want to +build a version of PCRE that works this way, add +

+  --disable-stack-for-recursion
+
+to the configure command. With this configuration, PCRE will use the +pcre_stack_malloc and pcre_stack_free variables to call memory +management functions. By default these point to malloc() and +free(), but you can replace the pointers so that your own functions are +used instead. +

+

+Separate functions are provided rather than using pcre_malloc and +pcre_free because the usage is very predictable: the block sizes +requested are always the same, and the blocks are always freed in reverse +order. A calling program might be able to implement optimized functions that +perform better than malloc() and free(). PCRE runs noticeably more +slowly when built in this way. This option affects only the pcre_exec() +function; it is not relevant for pcre_dfa_exec(). +

+
LIMITING PCRE RESOURCE USAGE
+

+Internally, PCRE has a function called match(), which it calls repeatedly +(sometimes recursively) when matching a pattern with the pcre_exec() +function. By controlling the maximum number of times this function may be +called during a single matching operation, a limit can be placed on the +resources used by a single call to pcre_exec(). The limit can be changed +at run time, as described in the +pcreapi +documentation. The default is 10 million, but this can be changed by adding a +setting such as +

+  --with-match-limit=500000
+
+to the configure command. This setting has no effect on the +pcre_dfa_exec() matching function. +

+

+In some environments it is desirable to limit the depth of recursive calls of +match() more strictly than the total number of calls, in order to +restrict the maximum amount of stack (or heap, if --disable-stack-for-recursion +is specified) that is used. A second limit controls this; it defaults to the +value that is set for --with-match-limit, which imposes no additional +constraints. However, you can set a lower limit by adding, for example, +

+  --with-match-limit-recursion=10000
+
+to the configure command. This value can also be overridden at run time. +

+
CREATING CHARACTER TABLES AT BUILD TIME
+

+PCRE uses fixed tables for processing characters whose code values are less +than 256. By default, PCRE is built with a set of tables that are distributed +in the file pcre_chartables.c.dist. These tables are for ASCII codes +only. If you add +

+  --enable-rebuild-chartables
+
+to the configure command, the distributed tables are no longer used. +Instead, a program called dftables is compiled and run. This outputs the +source for new set of tables, created in the default locale of your C run-time +system. (This method of replacing the tables does not work if you are cross +compiling, because dftables is run on the local host. If you need to +create alternative tables when cross compiling, you will have to do so "by +hand".) +

+
USING EBCDIC CODE
+

+PCRE assumes by default that it will run in an environment where the character +code is ASCII (or Unicode, which is a superset of ASCII). This is the case for +most computer operating systems. PCRE can, however, be compiled to run in an +EBCDIC environment by adding +

+  --enable-ebcdic
+
+to the configure command. This setting implies +--enable-rebuild-chartables. You should only use it if you know that you are in +an EBCDIC environment (for example, an IBM mainframe operating system). The +--enable-ebcdic option is incompatible with --enable-utf. +

+

+The EBCDIC character that corresponds to an ASCII LF is assumed to have the +value 0x15 by default. However, in some EBCDIC environments, 0x25 is used. In +such an environment you should use +

+  --enable-ebcdic-nl25
+
+as well as, or instead of, --enable-ebcdic. The EBCDIC character for CR has the +same value as in ASCII, namely, 0x0d. Whichever of 0x15 and 0x25 is not +chosen as LF is made to correspond to the Unicode NEL character (which, in +Unicode, is 0x85). +

+

+The options that select newline behaviour, such as --enable-newline-is-cr, +and equivalent run-time options, refer to these character values in an EBCDIC +environment. +

+
PCREGREP OPTIONS FOR COMPRESSED FILE SUPPORT
+

+By default, pcregrep reads all files as plain text. You can build it so +that it recognizes files whose names end in .gz or .bz2, and reads +them with libz or libbz2, respectively, by adding one or both of +

+  --enable-pcregrep-libz
+  --enable-pcregrep-libbz2
+
+to the configure command. These options naturally require that the +relevant libraries are installed on your system. Configuration will fail if +they are not. +

+
PCREGREP BUFFER SIZE
+

+pcregrep uses an internal buffer to hold a "window" on the file it is +scanning, in order to be able to output "before" and "after" lines when it +finds a match. The size of the buffer is controlled by a parameter whose +default value is 20K. The buffer itself is three times this size, but because +of the way it is used for holding "before" lines, the longest line that is +guaranteed to be processable is the parameter size. You can change the default +parameter value by adding, for example, +

+  --with-pcregrep-bufsize=50K
+
+to the configure command. The caller of \fPpcregrep\fP can, however, +override this value by specifying a run-time option. +

+
PCRETEST OPTION FOR LIBREADLINE SUPPORT
+

+If you add +

+  --enable-pcretest-libreadline
+
+to the configure command, pcretest is linked with the +libreadline library, and when its input is from a terminal, it reads it +using the readline() function. This provides line-editing and history +facilities. Note that libreadline is GPL-licensed, so if you distribute a +binary of pcretest linked in this way, there may be licensing issues. +

+

+Setting this option causes the -lreadline option to be added to the +pcretest build. In many operating environments with a sytem-installed +libreadline this is sufficient. However, in some environments (e.g. +if an unmodified distribution version of readline is in use), some extra +configuration may be necessary. The INSTALL file for libreadline says +this: +

+  "Readline uses the termcap functions, but does not link with the
+  termcap or curses library itself, allowing applications which link
+  with readline the to choose an appropriate library."
+
+If your environment has not been set up so that an appropriate library is +automatically included, you may need to add something like +
+  LIBS="-ncurses"
+
+immediately before the configure command. +

+
DEBUGGING WITH VALGRIND SUPPORT
+

+By adding the +

+  --enable-valgrind
+
+option to to the configure command, PCRE will use valgrind annotations +to mark certain memory regions as unaddressable. This allows it to detect +invalid memory accesses, and is mostly useful for debugging PCRE itself. +

+
CODE COVERAGE REPORTING
+

+If your C compiler is gcc, you can build a version of PCRE that can generate a +code coverage report for its test suite. To enable this, you must install +lcov version 1.6 or above. Then specify +

+  --enable-coverage
+
+to the configure command and build PCRE in the usual way. +

+

+Note that using ccache (a caching C compiler) is incompatible with code +coverage reporting. If you have configured ccache to run automatically +on your system, you must set the environment variable +

+  CCACHE_DISABLE=1
+
+before running make to build PCRE, so that ccache is not used. +

+

+When --enable-coverage is used, the following addition targets are added to the +Makefile: +

+  make coverage
+
+This creates a fresh coverage report for the PCRE test suite. It is equivalent +to running "make coverage-reset", "make coverage-baseline", "make check", and +then "make coverage-report". +
+  make coverage-reset
+
+This zeroes the coverage counters, but does nothing else. +
+  make coverage-baseline
+
+This captures baseline coverage information. +
+  make coverage-report
+
+This creates the coverage report. +
+  make coverage-clean-report
+
+This removes the generated coverage report without cleaning the coverage data +itself. +
+  make coverage-clean-data
+
+This removes the captured coverage data without removing the coverage files +created at compile time (*.gcno). +
+  make coverage-clean
+
+This cleans all coverage data including the generated coverage report. For more +information about code coverage, see the gcov and lcov +documentation. +

+
SEE ALSO
+

+pcreapi(3), pcre16, pcre32, pcre_config(3). +

+
AUTHOR
+

+Philip Hazel +
+University Computing Service +
+Cambridge CB2 3QH, England. +
+

+
REVISION
+

+Last updated: 12 May 2013 +
+Copyright © 1997-2013 University of Cambridge. +
+

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrecallout.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrecallout.html new file mode 100644 index 0000000000000000000000000000000000000000..53a937f52dd741505b8e60b6688001be58dbc6d3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrecallout.html @@ -0,0 +1,286 @@ + + +pcrecallout specification + + +

pcrecallout man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+

+
SYNOPSIS
+

+#include <pcre.h> +

+

+int (*pcre_callout)(pcre_callout_block *); +

+

+int (*pcre16_callout)(pcre16_callout_block *); +

+

+int (*pcre32_callout)(pcre32_callout_block *); +

+
DESCRIPTION
+

+PCRE provides a feature called "callout", which is a means of temporarily +passing control to the caller of PCRE in the middle of pattern matching. The +caller of PCRE provides an external function by putting its entry point in the +global variable pcre_callout (pcre16_callout for the 16-bit +library, pcre32_callout for the 32-bit library). By default, this +variable contains NULL, which disables all calling out. +

+

+Within a regular expression, (?C) indicates the points at which the external +function is to be called. Different callout points can be identified by putting +a number less than 256 after the letter C. The default value is zero. +For example, this pattern has two callout points: +

+  (?C1)abc(?C2)def
+
+If the PCRE_AUTO_CALLOUT option bit is set when a pattern is compiled, PCRE +automatically inserts callouts, all with number 255, before each item in the +pattern. For example, if PCRE_AUTO_CALLOUT is used with the pattern +
+  A(\d{2}|--)
+
+it is processed as if it were +
+
+(?C255)A(?C255)((?C255)\d{2}(?C255)|(?C255)-(?C255)-(?C255))(?C255) +
+
+Notice that there is a callout before and after each parenthesis and +alternation bar. If the pattern contains a conditional group whose condition is +an assertion, an automatic callout is inserted immediately before the +condition. Such a callout may also be inserted explicitly, for example: +
+  (?(?C9)(?=a)ab|de)
+
+This applies only to assertion conditions (because they are themselves +independent groups). +

+

+Automatic callouts can be used for tracking the progress of pattern matching. +The +pcretest +program has a pattern qualifier (/C) that sets automatic callouts; when it is +used, the output indicates how the pattern is being matched. This is useful +information when you are trying to optimize the performance of a particular +pattern. +

+
MISSING CALLOUTS
+

+You should be aware that, because of optimizations in the way PCRE compiles and +matches patterns, callouts sometimes do not happen exactly as you might expect. +

+

+At compile time, PCRE "auto-possessifies" repeated items when it knows that +what follows cannot be part of the repeat. For example, a+[bc] is compiled as +if it were a++[bc]. The pcretest output when this pattern is anchored and +then applied with automatic callouts to the string "aaaa" is: +

+  --->aaaa
+   +0 ^        ^
+   +1 ^        a+
+   +3 ^   ^    [bc]
+  No match
+
+This indicates that when matching [bc] fails, there is no backtracking into a+ +and therefore the callouts that would be taken for the backtracks do not occur. +You can disable the auto-possessify feature by passing PCRE_NO_AUTO_POSSESS +to pcre_compile(), or starting the pattern with (*NO_AUTO_POSSESS). If +this is done in pcretest (using the /O qualifier), the output changes to +this: +
+  --->aaaa
+   +0 ^        ^
+   +1 ^        a+
+   +3 ^   ^    [bc]
+   +3 ^  ^     [bc]
+   +3 ^ ^      [bc]
+   +3 ^^       [bc]
+  No match
+
+This time, when matching [bc] fails, the matcher backtracks into a+ and tries +again, repeatedly, until a+ itself fails. +

+

+Other optimizations that provide fast "no match" results also affect callouts. +For example, if the pattern is +

+  ab(?C4)cd
+
+PCRE knows that any matching string must contain the letter "d". If the subject +string is "abyz", the lack of "d" means that matching doesn't ever start, and +the callout is never reached. However, with "abyd", though the result is still +no match, the callout is obeyed. +

+

+If the pattern is studied, PCRE knows the minimum length of a matching string, +and will immediately give a "no match" return without actually running a match +if the subject is not long enough, or, for unanchored patterns, if it has +been scanned far enough. +

+

+You can disable these optimizations by passing the PCRE_NO_START_OPTIMIZE +option to the matching function, or by starting the pattern with +(*NO_START_OPT). This slows down the matching process, but does ensure that +callouts such as the example above are obeyed. +

+
THE CALLOUT INTERFACE
+

+During matching, when PCRE reaches a callout point, the external function +defined by pcre_callout or pcre[16|32]_callout is called (if it is +set). This applies to both normal and DFA matching. The only argument to the +callout function is a pointer to a pcre_callout or +pcre[16|32]_callout block. These structures contains the following +fields: +

+  int           version;
+  int           callout_number;
+  int          *offset_vector;
+  const char   *subject;           (8-bit version)
+  PCRE_SPTR16   subject;           (16-bit version)
+  PCRE_SPTR32   subject;           (32-bit version)
+  int           subject_length;
+  int           start_match;
+  int           current_position;
+  int           capture_top;
+  int           capture_last;
+  void         *callout_data;
+  int           pattern_position;
+  int           next_item_length;
+  const unsigned char *mark;       (8-bit version)
+  const PCRE_UCHAR16  *mark;       (16-bit version)
+  const PCRE_UCHAR32  *mark;       (32-bit version)
+
+The version field is an integer containing the version number of the +block format. The initial version was 0; the current version is 2. The version +number will change again in future if additional fields are added, but the +intention is never to remove any of the existing fields. +

+

+The callout_number field contains the number of the callout, as compiled +into the pattern (that is, the number after ?C for manual callouts, and 255 for +automatically generated callouts). +

+

+The offset_vector field is a pointer to the vector of offsets that was +passed by the caller to the matching function. When pcre_exec() or +pcre[16|32]_exec() is used, the contents can be inspected, in order to +extract substrings that have been matched so far, in the same way as for +extracting substrings after a match has completed. For the DFA matching +functions, this field is not useful. +

+

+The subject and subject_length fields contain copies of the values +that were passed to the matching function. +

+

+The start_match field normally contains the offset within the subject at +which the current match attempt started. However, if the escape sequence \K +has been encountered, this value is changed to reflect the modified starting +point. If the pattern is not anchored, the callout function may be called +several times from the same point in the pattern for different starting points +in the subject. +

+

+The current_position field contains the offset within the subject of the +current match pointer. +

+

+When the pcre_exec() or pcre[16|32]_exec() is used, the +capture_top field contains one more than the number of the highest +numbered captured substring so far. If no substrings have been captured, the +value of capture_top is one. This is always the case when the DFA +functions are used, because they do not support captured substrings. +

+

+The capture_last field contains the number of the most recently captured +substring. However, when a recursion exits, the value reverts to what it was +outside the recursion, as do the values of all captured substrings. If no +substrings have been captured, the value of capture_last is -1. This is +always the case for the DFA matching functions. +

+

+The callout_data field contains a value that is passed to a matching +function specifically so that it can be passed back in callouts. It is passed +in the callout_data field of a pcre_extra or pcre[16|32]_extra +data structure. If no such data was passed, the value of callout_data in +a callout block is NULL. There is a description of the pcre_extra +structure in the +pcreapi +documentation. +

+

+The pattern_position field is present from version 1 of the callout +structure. It contains the offset to the next item to be matched in the pattern +string. +

+

+The next_item_length field is present from version 1 of the callout +structure. It contains the length of the next item to be matched in the pattern +string. When the callout immediately precedes an alternation bar, a closing +parenthesis, or the end of the pattern, the length is zero. When the callout +precedes an opening parenthesis, the length is that of the entire subpattern. +

+

+The pattern_position and next_item_length fields are intended to +help in distinguishing between different automatic callouts, which all have the +same callout number. However, they are set for all callouts. +

+

+The mark field is present from version 2 of the callout structure. In +callouts from pcre_exec() or pcre[16|32]_exec() it contains a +pointer to the zero-terminated name of the most recently passed (*MARK), +(*PRUNE), or (*THEN) item in the match, or NULL if no such items have been +passed. Instances of (*PRUNE) or (*THEN) without a name do not obliterate a +previous (*MARK). In callouts from the DFA matching functions this field always +contains NULL. +

+
RETURN VALUES
+

+The external callout function returns an integer to PCRE. If the value is zero, +matching proceeds as normal. If the value is greater than zero, matching fails +at the current point, but the testing of other matching possibilities goes +ahead, just as if a lookahead assertion had failed. If the value is less than +zero, the match is abandoned, the matching function returns the negative value. +

+

+Negative values should normally be chosen from the set of PCRE_ERROR_xxx +values. In particular, PCRE_ERROR_NOMATCH forces a standard "no match" failure. +The error number PCRE_ERROR_CALLOUT is reserved for use by callout functions; +it will never be used by PCRE itself. +

+
AUTHOR
+

+Philip Hazel +
+University Computing Service +
+Cambridge CB2 3QH, England. +
+

+
REVISION
+

+Last updated: 12 November 2013 +
+Copyright © 1997-2013 University of Cambridge. +
+

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrecompat.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrecompat.html new file mode 100644 index 0000000000000000000000000000000000000000..d95570ef17903775e3890d61f0d529db709bb9ec --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrecompat.html @@ -0,0 +1,235 @@ + + +pcrecompat specification + + +

pcrecompat man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+DIFFERENCES BETWEEN PCRE AND PERL +
+

+This document describes the differences in the ways that PCRE and Perl handle +regular expressions. The differences described here are with respect to Perl +versions 5.10 and above. +

+

+1. PCRE has only a subset of Perl's Unicode support. Details of what it does +have are given in the +pcreunicode +page. +

+

+2. PCRE allows repeat quantifiers only on parenthesized assertions, but they do +not mean what you might think. For example, (?!a){3} does not assert that the +next three characters are not "a". It just asserts that the next character is +not "a" three times (in principle: PCRE optimizes this to run the assertion +just once). Perl allows repeat quantifiers on other assertions such as \b, but +these do not seem to have any use. +

+

+3. Capturing subpatterns that occur inside negative lookahead assertions are +counted, but their entries in the offsets vector are never set. Perl sometimes +(but not always) sets its numerical variables from inside negative assertions. +

+

+4. Though binary zero characters are supported in the subject string, they are +not allowed in a pattern string because it is passed as a normal C string, +terminated by zero. The escape sequence \0 can be used in the pattern to +represent a binary zero. +

+

+5. The following Perl escape sequences are not supported: \l, \u, \L, +\U, and \N when followed by a character name or Unicode value. (\N on its +own, matching a non-newline character, is supported.) In fact these are +implemented by Perl's general string-handling and are not part of its pattern +matching engine. If any of these are encountered by PCRE, an error is +generated by default. However, if the PCRE_JAVASCRIPT_COMPAT option is set, +\U and \u are interpreted as JavaScript interprets them. +

+

+6. The Perl escape sequences \p, \P, and \X are supported only if PCRE is +built with Unicode character property support. The properties that can be +tested with \p and \P are limited to the general category properties such as +Lu and Nd, script names such as Greek or Han, and the derived properties Any +and L&. PCRE does support the Cs (surrogate) property, which Perl does not; the +Perl documentation says "Because Perl hides the need for the user to understand +the internal representation of Unicode characters, there is no need to +implement the somewhat messy concept of surrogates." +

+

+7. PCRE does support the \Q...\E escape for quoting substrings. Characters in +between are treated as literals. This is slightly different from Perl in that $ +and @ are also handled as literals inside the quotes. In Perl, they cause +variable interpolation (but of course PCRE does not have variables). Note the +following examples: +

+    Pattern            PCRE matches      Perl matches
+
+    \Qabc$xyz\E        abc$xyz           abc followed by the contents of $xyz
+    \Qabc\$xyz\E       abc\$xyz          abc\$xyz
+    \Qabc\E\$\Qxyz\E   abc$xyz           abc$xyz
+
+The \Q...\E sequence is recognized both inside and outside character classes. +

+

+8. Fairly obviously, PCRE does not support the (?{code}) and (??{code}) +constructions. However, there is support for recursive patterns. This is not +available in Perl 5.8, but it is in Perl 5.10. Also, the PCRE "callout" +feature allows an external function to be called during pattern matching. See +the +pcrecallout +documentation for details. +

+

+9. Subpatterns that are called as subroutines (whether or not recursively) are +always treated as atomic groups in PCRE. This is like Python, but unlike Perl. +Captured values that are set outside a subroutine call can be reference from +inside in PCRE, but not in Perl. There is a discussion that explains these +differences in more detail in the +section on recursion differences from Perl +in the +pcrepattern +page. +

+

+10. If any of the backtracking control verbs are used in a subpattern that is +called as a subroutine (whether or not recursively), their effect is confined +to that subpattern; it does not extend to the surrounding pattern. This is not +always the case in Perl. In particular, if (*THEN) is present in a group that +is called as a subroutine, its action is limited to that group, even if the +group does not contain any | characters. Note that such subpatterns are +processed as anchored at the point where they are tested. +

+

+11. If a pattern contains more than one backtracking control verb, the first +one that is backtracked onto acts. For example, in the pattern +A(*COMMIT)B(*PRUNE)C a failure in B triggers (*COMMIT), but a failure in C +triggers (*PRUNE). Perl's behaviour is more complex; in many cases it is the +same as PCRE, but there are examples where it differs. +

+

+12. Most backtracking verbs in assertions have their normal actions. They are +not confined to the assertion. +

+

+13. There are some differences that are concerned with the settings of captured +strings when part of a pattern is repeated. For example, matching "aba" against +the pattern /^(a(b)?)+$/ in Perl leaves $2 unset, but in PCRE it is set to "b". +

+

+14. PCRE's handling of duplicate subpattern numbers and duplicate subpattern +names is not as general as Perl's. This is a consequence of the fact the PCRE +works internally just with numbers, using an external table to translate +between numbers and names. In particular, a pattern such as (?|(?<a>A)|(?<b>B), +where the two capturing parentheses have the same number but different names, +is not supported, and causes an error at compile time. If it were allowed, it +would not be possible to distinguish which parentheses matched, because both +names map to capturing subpattern number 1. To avoid this confusing situation, +an error is given at compile time. +

+

+15. Perl recognizes comments in some places that PCRE does not, for example, +between the ( and ? at the start of a subpattern. If the /x modifier is set, +Perl allows white space between ( and ? (though current Perls warn that this is +deprecated) but PCRE never does, even if the PCRE_EXTENDED option is set. +

+

+16. Perl, when in warning mode, gives warnings for character classes such as +[A-\d] or [a-[:digit:]]. It then treats the hyphens as literals. PCRE has no +warning features, so it gives an error in these cases because they are almost +certainly user mistakes. +

+

+17. In PCRE, the upper/lower case character properties Lu and Ll are not +affected when case-independent matching is specified. For example, \p{Lu} +always matches an upper case letter. I think Perl has changed in this respect; +in the release at the time of writing (5.16), \p{Lu} and \p{Ll} match all +letters, regardless of case, when case independence is specified. +

+

+18. PCRE provides some extensions to the Perl regular expression facilities. +Perl 5.10 includes new features that are not in earlier versions of Perl, some +of which (such as named parentheses) have been in PCRE for some time. This list +is with respect to Perl 5.10: +
+
+(a) Although lookbehind assertions in PCRE must match fixed length strings, +each alternative branch of a lookbehind assertion can match a different length +of string. Perl requires them all to have the same length. +
+
+(b) If PCRE_DOLLAR_ENDONLY is set and PCRE_MULTILINE is not set, the $ +meta-character matches only at the very end of the string. +
+
+(c) If PCRE_EXTRA is set, a backslash followed by a letter with no special +meaning is faulted. Otherwise, like Perl, the backslash is quietly ignored. +(Perl can be made to issue a warning.) +
+
+(d) If PCRE_UNGREEDY is set, the greediness of the repetition quantifiers is +inverted, that is, by default they are not greedy, but if followed by a +question mark they are. +
+
+(e) PCRE_ANCHORED can be used at matching time to force a pattern to be tried +only at the first matching position in the subject string. +
+
+(f) The PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NOTEMPTY_ATSTART, and +PCRE_NO_AUTO_CAPTURE options for pcre_exec() have no Perl equivalents. +
+
+(g) The \R escape sequence can be restricted to match only CR, LF, or CRLF +by the PCRE_BSR_ANYCRLF option. +
+
+(h) The callout facility is PCRE-specific. +
+
+(i) The partial matching facility is PCRE-specific. +
+
+(j) Patterns compiled by PCRE can be saved and re-used at a later time, even on +different hosts that have the other endianness. However, this does not apply to +optimized data created by the just-in-time compiler. +
+
+(k) The alternative matching functions (pcre_dfa_exec(), +pcre16_dfa_exec() and pcre32_dfa_exec(),) match in a different way +and are not Perl-compatible. +
+
+(l) PCRE recognizes some special sequences such as (*CR) at the start of +a pattern that set overall options that cannot be changed within the pattern. +

+
+AUTHOR +
+

+Philip Hazel +
+University Computing Service +
+Cambridge CB2 3QH, England. +
+

+
+REVISION +
+

+Last updated: 10 November 2013 +
+Copyright © 1997-2013 University of Cambridge. +
+

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrecpp.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrecpp.html new file mode 100644 index 0000000000000000000000000000000000000000..b7eac3a3d7a9d9d098215eb9779e37708bad87b6 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrecpp.html @@ -0,0 +1,368 @@ + + +pcrecpp specification + + +

pcrecpp man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+

+
SYNOPSIS OF C++ WRAPPER
+

+#include <pcrecpp.h> +

+
DESCRIPTION
+

+The C++ wrapper for PCRE was provided by Google Inc. Some additional +functionality was added by Giuseppe Maxia. This brief man page was constructed +from the notes in the pcrecpp.h file, which should be consulted for +further details. Note that the C++ wrapper supports only the original 8-bit +PCRE library. There is no 16-bit or 32-bit support at present. +

+
MATCHING INTERFACE
+

+The "FullMatch" operation checks that supplied text matches a supplied pattern +exactly. If pointer arguments are supplied, it copies matched sub-strings that +match sub-patterns into them. +

+  Example: successful match
+     pcrecpp::RE re("h.*o");
+     re.FullMatch("hello");
+
+  Example: unsuccessful match (requires full match):
+     pcrecpp::RE re("e");
+     !re.FullMatch("hello");
+
+  Example: creating a temporary RE object:
+     pcrecpp::RE("h.*o").FullMatch("hello");
+
+You can pass in a "const char*" or a "string" for "text". The examples below +tend to use a const char*. You can, as in the different examples above, store +the RE object explicitly in a variable or use a temporary RE object. The +examples below use one mode or the other arbitrarily. Either could correctly be +used for any of these examples. +

+

+You must supply extra pointer arguments to extract matched subpieces. +

+  Example: extracts "ruby" into "s" and 1234 into "i"
+     int i;
+     string s;
+     pcrecpp::RE re("(\\w+):(\\d+)");
+     re.FullMatch("ruby:1234", &s, &i);
+
+  Example: does not try to extract any extra sub-patterns
+     re.FullMatch("ruby:1234", &s);
+
+  Example: does not try to extract into NULL
+     re.FullMatch("ruby:1234", NULL, &i);
+
+  Example: integer overflow causes failure
+     !re.FullMatch("ruby:1234567891234", NULL, &i);
+
+  Example: fails because there aren't enough sub-patterns:
+     !pcrecpp::RE("\\w+:\\d+").FullMatch("ruby:1234", &s);
+
+  Example: fails because string cannot be stored in integer
+     !pcrecpp::RE("(.*)").FullMatch("ruby", &i);
+
+The provided pointer arguments can be pointers to any scalar numeric +type, or one of: +
+   string        (matched piece is copied to string)
+   StringPiece   (StringPiece is mutated to point to matched piece)
+   T             (where "bool T::ParseFrom(const char*, int)" exists)
+   NULL          (the corresponding matched sub-pattern is not copied)
+
+The function returns true iff all of the following conditions are satisfied: +
+  a. "text" matches "pattern" exactly;
+
+  b. The number of matched sub-patterns is >= number of supplied
+     pointers;
+
+  c. The "i"th argument has a suitable type for holding the
+     string captured as the "i"th sub-pattern. If you pass in
+     void * NULL for the "i"th argument, or a non-void * NULL
+     of the correct type, or pass fewer arguments than the
+     number of sub-patterns, "i"th captured sub-pattern is
+     ignored.
+
+CAVEAT: An optional sub-pattern that does not exist in the matched +string is assigned the empty string. Therefore, the following will +return false (because the empty string is not a valid number): +
+   int number;
+   pcrecpp::RE::FullMatch("abc", "[a-z]+(\\d+)?", &number);
+
+The matching interface supports at most 16 arguments per call. +If you need more, consider using the more general interface +pcrecpp::RE::DoMatch. See pcrecpp.h for the signature for +DoMatch. +

+

+NOTE: Do not use no_arg, which is used internally to mark the end of a +list of optional arguments, as a placeholder for missing arguments, as this can +lead to segfaults. +

+
QUOTING METACHARACTERS
+

+You can use the "QuoteMeta" operation to insert backslashes before all +potentially meaningful characters in a string. The returned string, used as a +regular expression, will exactly match the original string. +

+  Example:
+     string quoted = RE::QuoteMeta(unquoted);
+
+Note that it's legal to escape a character even if it has no special meaning in +a regular expression -- so this function does that. (This also makes it +identical to the perl function of the same name; see "perldoc -f quotemeta".) +For example, "1.5-2.0?" becomes "1\.5\-2\.0\?". +

+
PARTIAL MATCHES
+

+You can use the "PartialMatch" operation when you want the pattern +to match any substring of the text. +

+  Example: simple search for a string:
+     pcrecpp::RE("ell").PartialMatch("hello");
+
+  Example: find first number in a string:
+     int number;
+     pcrecpp::RE re("(\\d+)");
+     re.PartialMatch("x*100 + 20", &number);
+     assert(number == 100);
+
+

+
UTF-8 AND THE MATCHING INTERFACE
+

+By default, pattern and text are plain text, one byte per character. The UTF8 +flag, passed to the constructor, causes both pattern and string to be treated +as UTF-8 text, still a byte stream but potentially multiple bytes per +character. In practice, the text is likelier to be UTF-8 than the pattern, but +the match returned may depend on the UTF8 flag, so always use it when matching +UTF8 text. For example, "." will match one byte normally but with UTF8 set may +match up to three bytes of a multi-byte character. +

+  Example:
+     pcrecpp::RE_Options options;
+     options.set_utf8();
+     pcrecpp::RE re(utf8_pattern, options);
+     re.FullMatch(utf8_string);
+
+  Example: using the convenience function UTF8():
+     pcrecpp::RE re(utf8_pattern, pcrecpp::UTF8());
+     re.FullMatch(utf8_string);
+
+NOTE: The UTF8 flag is ignored if pcre was not configured with the +
+      --enable-utf8 flag.
+
+

+
PASSING MODIFIERS TO THE REGULAR EXPRESSION ENGINE
+

+PCRE defines some modifiers to change the behavior of the regular expression +engine. The C++ wrapper defines an auxiliary class, RE_Options, as a vehicle to +pass such modifiers to a RE class. Currently, the following modifiers are +supported: +

+   modifier              description               Perl corresponding
+
+   PCRE_CASELESS         case insensitive match      /i
+   PCRE_MULTILINE        multiple lines match        /m
+   PCRE_DOTALL           dot matches newlines        /s
+   PCRE_DOLLAR_ENDONLY   $ matches only at end       N/A
+   PCRE_EXTRA            strict escape parsing       N/A
+   PCRE_EXTENDED         ignore white spaces         /x
+   PCRE_UTF8             handles UTF8 chars          built-in
+   PCRE_UNGREEDY         reverses * and *?           N/A
+   PCRE_NO_AUTO_CAPTURE  disables capturing parens   N/A (*)
+
+(*) Both Perl and PCRE allow non capturing parentheses by means of the +"?:" modifier within the pattern itself. e.g. (?:ab|cd) does not +capture, while (ab|cd) does. +

+

+For a full account on how each modifier works, please check the +PCRE API reference page. +

+

+For each modifier, there are two member functions whose name is made +out of the modifier in lowercase, without the "PCRE_" prefix. For +instance, PCRE_CASELESS is handled by +

+  bool caseless()
+
+which returns true if the modifier is set, and +
+  RE_Options & set_caseless(bool)
+
+which sets or unsets the modifier. Moreover, PCRE_EXTRA_MATCH_LIMIT can be +accessed through the set_match_limit() and match_limit() member +functions. Setting match_limit to a non-zero value will limit the +execution of pcre to keep it from doing bad things like blowing the stack or +taking an eternity to return a result. A value of 5000 is good enough to stop +stack blowup in a 2MB thread stack. Setting match_limit to zero disables +match limiting. Alternatively, you can call match_limit_recursion() +which uses PCRE_EXTRA_MATCH_LIMIT_RECURSION to limit how much PCRE +recurses. match_limit() limits the number of matches PCRE does; +match_limit_recursion() limits the depth of internal recursion, and +therefore the amount of stack that is used. +

+

+Normally, to pass one or more modifiers to a RE class, you declare +a RE_Options object, set the appropriate options, and pass this +object to a RE constructor. Example: +

+   RE_Options opt;
+   opt.set_caseless(true);
+   if (RE("HELLO", opt).PartialMatch("hello world")) ...
+
+RE_options has two constructors. The default constructor takes no arguments and +creates a set of flags that are off by default. The optional parameter +option_flags is to facilitate transfer of legacy code from C programs. +This lets you do +
+   RE(pattern,
+     RE_Options(PCRE_CASELESS|PCRE_MULTILINE)).PartialMatch(str);
+
+However, new code is better off doing +
+   RE(pattern,
+     RE_Options().set_caseless(true).set_multiline(true))
+       .PartialMatch(str);
+
+If you are going to pass one of the most used modifiers, there are some +convenience functions that return a RE_Options class with the +appropriate modifier already set: CASELESS(), UTF8(), +MULTILINE(), DOTALL(), and EXTENDED(). +

+

+If you need to set several options at once, and you don't want to go through +the pains of declaring a RE_Options object and setting several options, there +is a parallel method that give you such ability on the fly. You can concatenate +several set_xxxxx() member functions, since each of them returns a +reference to its class object. For example, to pass PCRE_CASELESS, +PCRE_EXTENDED, and PCRE_MULTILINE to a RE with one statement, you may write: +

+   RE(" ^ xyz \\s+ .* blah$",
+     RE_Options()
+       .set_caseless(true)
+       .set_extended(true)
+       .set_multiline(true)).PartialMatch(sometext);
+
+
+

+
SCANNING TEXT INCREMENTALLY
+

+The "Consume" operation may be useful if you want to repeatedly +match regular expressions at the front of a string and skip over +them as they match. This requires use of the "StringPiece" type, +which represents a sub-range of a real string. Like RE, StringPiece +is defined in the pcrecpp namespace. +

+  Example: read lines of the form "var = value" from a string.
+     string contents = ...;                 // Fill string somehow
+     pcrecpp::StringPiece input(contents);  // Wrap in a StringPiece
+
+     string var;
+     int value;
+     pcrecpp::RE re("(\\w+) = (\\d+)\n");
+     while (re.Consume(&input, &var, &value)) {
+       ...;
+     }
+
+Each successful call to "Consume" will set "var/value", and also +advance "input" so it points past the matched text. +

+

+The "FindAndConsume" operation is similar to "Consume" but does not +anchor your match at the beginning of the string. For example, you +could extract all words from a string by repeatedly calling +

+  pcrecpp::RE("(\\w+)").FindAndConsume(&input, &word)
+
+

+
PARSING HEX/OCTAL/C-RADIX NUMBERS
+

+By default, if you pass a pointer to a numeric value, the +corresponding text is interpreted as a base-10 number. You can +instead wrap the pointer with a call to one of the operators Hex(), +Octal(), or CRadix() to interpret the text in another base. The +CRadix operator interprets C-style "0" (base-8) and "0x" (base-16) +prefixes, but defaults to base-10. +

+  Example:
+    int a, b, c, d;
+    pcrecpp::RE re("(.*) (.*) (.*) (.*)");
+    re.FullMatch("100 40 0100 0x40",
+                 pcrecpp::Octal(&a), pcrecpp::Hex(&b),
+                 pcrecpp::CRadix(&c), pcrecpp::CRadix(&d));
+
+will leave 64 in a, b, c, and d. +

+
REPLACING PARTS OF STRINGS
+

+You can replace the first match of "pattern" in "str" with "rewrite". +Within "rewrite", backslash-escaped digits (\1 to \9) can be +used to insert text matching corresponding parenthesized group +from the pattern. \0 in "rewrite" refers to the entire matching +text. For example: +

+  string s = "yabba dabba doo";
+  pcrecpp::RE("b+").Replace("d", &s);
+
+will leave "s" containing "yada dabba doo". The result is true if the pattern +matches and a replacement occurs, false otherwise. +

+

+GlobalReplace is like Replace except that it replaces all +occurrences of the pattern in the string with the rewrite. Replacements are +not subject to re-matching. For example: +

+  string s = "yabba dabba doo";
+  pcrecpp::RE("b+").GlobalReplace("d", &s);
+
+will leave "s" containing "yada dada doo". It returns the number of +replacements made. +

+

+Extract is like Replace, except that if the pattern matches, +"rewrite" is copied into "out" (an additional argument) with substitutions. +The non-matching portions of "text" are ignored. Returns true iff a match +occurred and the extraction happened successfully; if no match occurs, the +string is left unaffected. +

+
AUTHOR
+

+The C++ wrapper was contributed by Google Inc. +
+Copyright © 2007 Google Inc. +
+

+
REVISION
+

+Last updated: 08 January 2012 +
+

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcredemo.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcredemo.html new file mode 100644 index 0000000000000000000000000000000000000000..d84c5c8c99c9fdb2ac917c1db3356e87a1a0e048 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcredemo.html @@ -0,0 +1,426 @@ + + +pcredemo specification + + +

pcredemo man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+

    +
+
+/*************************************************
+*           PCRE DEMONSTRATION PROGRAM           *
+*************************************************/
+
+/* This is a demonstration program to illustrate the most straightforward ways
+of calling the PCRE regular expression library from a C program. See the
+pcresample documentation for a short discussion ("man pcresample" if you have
+the PCRE man pages installed).
+
+In Unix-like environments, if PCRE is installed in your standard system
+libraries, you should be able to compile this program using this command:
+
+gcc -Wall pcredemo.c -lpcre -o pcredemo
+
+If PCRE is not installed in a standard place, it is likely to be installed with
+support for the pkg-config mechanism. If you have pkg-config, you can compile
+this program using this command:
+
+gcc -Wall pcredemo.c `pkg-config --cflags --libs libpcre` -o pcredemo
+
+If you do not have pkg-config, you may have to use this:
+
+gcc -Wall pcredemo.c -I/usr/local/include -L/usr/local/lib \
+  -R/usr/local/lib -lpcre -o pcredemo
+
+Replace "/usr/local/include" and "/usr/local/lib" with wherever the include and
+library files for PCRE are installed on your system. Only some operating
+systems (e.g. Solaris) use the -R option.
+
+Building under Windows:
+
+If you want to statically link this program against a non-dll .a file, you must
+define PCRE_STATIC before including pcre.h, otherwise the pcre_malloc() and
+pcre_free() exported functions will be declared __declspec(dllimport), with
+unwanted results. So in this environment, uncomment the following line. */
+
+/* #define PCRE_STATIC */
+
+#include <stdio.h>
+#include <string.h>
+#include <pcre.h>
+
+#define OVECCOUNT 30    /* should be a multiple of 3 */
+
+
+int main(int argc, char **argv)
+{
+pcre *re;
+const char *error;
+char *pattern;
+char *subject;
+unsigned char *name_table;
+unsigned int option_bits;
+int erroffset;
+int find_all;
+int crlf_is_newline;
+int namecount;
+int name_entry_size;
+int ovector[OVECCOUNT];
+int subject_length;
+int rc, i;
+int utf8;
+
+
+/**************************************************************************
+* First, sort out the command line. There is only one possible option at  *
+* the moment, "-g" to request repeated matching to find all occurrences,  *
+* like Perl's /g option. We set the variable find_all to a non-zero value *
+* if the -g option is present. Apart from that, there must be exactly two *
+* arguments.                                                              *
+**************************************************************************/
+
+find_all = 0;
+for (i = 1; i < argc; i++)
+  {
+  if (strcmp(argv[i], "-g") == 0) find_all = 1;
+    else break;
+  }
+
+/* After the options, we require exactly two arguments, which are the pattern,
+and the subject string. */
+
+if (argc - i != 2)
+  {
+  printf("Two arguments required: a regex and a subject string\n");
+  return 1;
+  }
+
+pattern = argv[i];
+subject = argv[i+1];
+subject_length = (int)strlen(subject);
+
+
+/*************************************************************************
+* Now we are going to compile the regular expression pattern, and handle *
+* and errors that are detected.                                          *
+*************************************************************************/
+
+re = pcre_compile(
+  pattern,              /* the pattern */
+  0,                    /* default options */
+  &error,               /* for error message */
+  &erroffset,           /* for error offset */
+  NULL);                /* use default character tables */
+
+/* Compilation failed: print the error message and exit */
+
+if (re == NULL)
+  {
+  printf("PCRE compilation failed at offset %d: %s\n", erroffset, error);
+  return 1;
+  }
+
+
+/*************************************************************************
+* If the compilation succeeded, we call PCRE again, in order to do a     *
+* pattern match against the subject string. This does just ONE match. If *
+* further matching is needed, it will be done below.                     *
+*************************************************************************/
+
+rc = pcre_exec(
+  re,                   /* the compiled pattern */
+  NULL,                 /* no extra data - we didn't study the pattern */
+  subject,              /* the subject string */
+  subject_length,       /* the length of the subject */
+  0,                    /* start at offset 0 in the subject */
+  0,                    /* default options */
+  ovector,              /* output vector for substring information */
+  OVECCOUNT);           /* number of elements in the output vector */
+
+/* Matching failed: handle error cases */
+
+if (rc < 0)
+  {
+  switch(rc)
+    {
+    case PCRE_ERROR_NOMATCH: printf("No match\n"); break;
+    /*
+    Handle other special cases if you like
+    */
+    default: printf("Matching error %d\n", rc); break;
+    }
+  pcre_free(re);     /* Release memory used for the compiled pattern */
+  return 1;
+  }
+
+/* Match succeeded */
+
+printf("\nMatch succeeded at offset %d\n", ovector[0]);
+
+
+/*************************************************************************
+* We have found the first match within the subject string. If the output *
+* vector wasn't big enough, say so. Then output any substrings that were *
+* captured.                                                              *
+*************************************************************************/
+
+/* The output vector wasn't big enough */
+
+if (rc == 0)
+  {
+  rc = OVECCOUNT/3;
+  printf("ovector only has room for %d captured substrings\n", rc - 1);
+  }
+
+/* Show substrings stored in the output vector by number. Obviously, in a real
+application you might want to do things other than print them. */
+
+for (i = 0; i < rc; i++)
+  {
+  char *substring_start = subject + ovector[2*i];
+  int substring_length = ovector[2*i+1] - ovector[2*i];
+  printf("%2d: %.*s\n", i, substring_length, substring_start);
+  }
+
+
+/**************************************************************************
+* That concludes the basic part of this demonstration program. We have    *
+* compiled a pattern, and performed a single match. The code that follows *
+* shows first how to access named substrings, and then how to code for    *
+* repeated matches on the same subject.                                   *
+**************************************************************************/
+
+/* See if there are any named substrings, and if so, show them by name. First
+we have to extract the count of named parentheses from the pattern. */
+
+(void)pcre_fullinfo(
+  re,                   /* the compiled pattern */
+  NULL,                 /* no extra data - we didn't study the pattern */
+  PCRE_INFO_NAMECOUNT,  /* number of named substrings */
+  &namecount);          /* where to put the answer */
+
+if (namecount <= 0) printf("No named substrings\n"); else
+  {
+  unsigned char *tabptr;
+  printf("Named substrings\n");
+
+  /* Before we can access the substrings, we must extract the table for
+  translating names to numbers, and the size of each entry in the table. */
+
+  (void)pcre_fullinfo(
+    re,                       /* the compiled pattern */
+    NULL,                     /* no extra data - we didn't study the pattern */
+    PCRE_INFO_NAMETABLE,      /* address of the table */
+    &name_table);             /* where to put the answer */
+
+  (void)pcre_fullinfo(
+    re,                       /* the compiled pattern */
+    NULL,                     /* no extra data - we didn't study the pattern */
+    PCRE_INFO_NAMEENTRYSIZE,  /* size of each entry in the table */
+    &name_entry_size);        /* where to put the answer */
+
+  /* Now we can scan the table and, for each entry, print the number, the name,
+  and the substring itself. */
+
+  tabptr = name_table;
+  for (i = 0; i < namecount; i++)
+    {
+    int n = (tabptr[0] << 8) | tabptr[1];
+    printf("(%d) %*s: %.*s\n", n, name_entry_size - 3, tabptr + 2,
+      ovector[2*n+1] - ovector[2*n], subject + ovector[2*n]);
+    tabptr += name_entry_size;
+    }
+  }
+
+
+/*************************************************************************
+* If the "-g" option was given on the command line, we want to continue  *
+* to search for additional matches in the subject string, in a similar   *
+* way to the /g option in Perl. This turns out to be trickier than you   *
+* might think because of the possibility of matching an empty string.    *
+* What happens is as follows:                                            *
+*                                                                        *
+* If the previous match was NOT for an empty string, we can just start   *
+* the next match at the end of the previous one.                         *
+*                                                                        *
+* If the previous match WAS for an empty string, we can't do that, as it *
+* would lead to an infinite loop. Instead, a special call of pcre_exec() *
+* is made with the PCRE_NOTEMPTY_ATSTART and PCRE_ANCHORED flags set.    *
+* The first of these tells PCRE that an empty string at the start of the *
+* subject is not a valid match; other possibilities must be tried. The   *
+* second flag restricts PCRE to one match attempt at the initial string  *
+* position. If this match succeeds, an alternative to the empty string   *
+* match has been found, and we can print it and proceed round the loop,  *
+* advancing by the length of whatever was found. If this match does not  *
+* succeed, we still stay in the loop, advancing by just one character.   *
+* In UTF-8 mode, which can be set by (*UTF8) in the pattern, this may be *
+* more than one byte.                                                    *
+*                                                                        *
+* However, there is a complication concerned with newlines. When the     *
+* newline convention is such that CRLF is a valid newline, we must       *
+* advance by two characters rather than one. The newline convention can  *
+* be set in the regex by (*CR), etc.; if not, we must find the default.  *
+*************************************************************************/
+
+if (!find_all)     /* Check for -g */
+  {
+  pcre_free(re);   /* Release the memory used for the compiled pattern */
+  return 0;        /* Finish unless -g was given */
+  }
+
+/* Before running the loop, check for UTF-8 and whether CRLF is a valid newline
+sequence. First, find the options with which the regex was compiled; extract
+the UTF-8 state, and mask off all but the newline options. */
+
+(void)pcre_fullinfo(re, NULL, PCRE_INFO_OPTIONS, &option_bits);
+utf8 = option_bits & PCRE_UTF8;
+option_bits &= PCRE_NEWLINE_CR|PCRE_NEWLINE_LF|PCRE_NEWLINE_CRLF|
+               PCRE_NEWLINE_ANY|PCRE_NEWLINE_ANYCRLF;
+
+/* If no newline options were set, find the default newline convention from the
+build configuration. */
+
+if (option_bits == 0)
+  {
+  int d;
+  (void)pcre_config(PCRE_CONFIG_NEWLINE, &d);
+  /* Note that these values are always the ASCII ones, even in
+  EBCDIC environments. CR = 13, NL = 10. */
+  option_bits = (d == 13)? PCRE_NEWLINE_CR :
+          (d == 10)? PCRE_NEWLINE_LF :
+          (d == (13<<8 | 10))? PCRE_NEWLINE_CRLF :
+          (d == -2)? PCRE_NEWLINE_ANYCRLF :
+          (d == -1)? PCRE_NEWLINE_ANY : 0;
+  }
+
+/* See if CRLF is a valid newline sequence. */
+
+crlf_is_newline =
+     option_bits == PCRE_NEWLINE_ANY ||
+     option_bits == PCRE_NEWLINE_CRLF ||
+     option_bits == PCRE_NEWLINE_ANYCRLF;
+
+/* Loop for second and subsequent matches */
+
+for (;;)
+  {
+  int options = 0;                 /* Normally no options */
+  int start_offset = ovector[1];   /* Start at end of previous match */
+
+  /* If the previous match was for an empty string, we are finished if we are
+  at the end of the subject. Otherwise, arrange to run another match at the
+  same point to see if a non-empty match can be found. */
+
+  if (ovector[0] == ovector[1])
+    {
+    if (ovector[0] == subject_length) break;
+    options = PCRE_NOTEMPTY_ATSTART | PCRE_ANCHORED;
+    }
+
+  /* Run the next matching operation */
+
+  rc = pcre_exec(
+    re,                   /* the compiled pattern */
+    NULL,                 /* no extra data - we didn't study the pattern */
+    subject,              /* the subject string */
+    subject_length,       /* the length of the subject */
+    start_offset,         /* starting offset in the subject */
+    options,              /* options */
+    ovector,              /* output vector for substring information */
+    OVECCOUNT);           /* number of elements in the output vector */
+
+  /* This time, a result of NOMATCH isn't an error. If the value in "options"
+  is zero, it just means we have found all possible matches, so the loop ends.
+  Otherwise, it means we have failed to find a non-empty-string match at a
+  point where there was a previous empty-string match. In this case, we do what
+  Perl does: advance the matching position by one character, and continue. We
+  do this by setting the "end of previous match" offset, because that is picked
+  up at the top of the loop as the point at which to start again.
+
+  There are two complications: (a) When CRLF is a valid newline sequence, and
+  the current position is just before it, advance by an extra byte. (b)
+  Otherwise we must ensure that we skip an entire UTF-8 character if we are in
+  UTF-8 mode. */
+
+  if (rc == PCRE_ERROR_NOMATCH)
+    {
+    if (options == 0) break;                    /* All matches found */
+    ovector[1] = start_offset + 1;              /* Advance one byte */
+    if (crlf_is_newline &&                      /* If CRLF is newline & */
+        start_offset < subject_length - 1 &&    /* we are at CRLF, */
+        subject[start_offset] == '\r' &&
+        subject[start_offset + 1] == '\n')
+      ovector[1] += 1;                          /* Advance by one more. */
+    else if (utf8)                              /* Otherwise, ensure we */
+      {                                         /* advance a whole UTF-8 */
+      while (ovector[1] < subject_length)       /* character. */
+        {
+        if ((subject[ovector[1]] & 0xc0) != 0x80) break;
+        ovector[1] += 1;
+        }
+      }
+    continue;    /* Go round the loop again */
+    }
+
+  /* Other matching errors are not recoverable. */
+
+  if (rc < 0)
+    {
+    printf("Matching error %d\n", rc);
+    pcre_free(re);    /* Release memory used for the compiled pattern */
+    return 1;
+    }
+
+  /* Match succeeded */
+
+  printf("\nMatch succeeded again at offset %d\n", ovector[0]);
+
+  /* The match succeeded, but the output vector wasn't big enough. */
+
+  if (rc == 0)
+    {
+    rc = OVECCOUNT/3;
+    printf("ovector only has room for %d captured substrings\n", rc - 1);
+    }
+
+  /* As before, show substrings stored in the output vector by number, and then
+  also any named substrings. */
+
+  for (i = 0; i < rc; i++)
+    {
+    char *substring_start = subject + ovector[2*i];
+    int substring_length = ovector[2*i+1] - ovector[2*i];
+    printf("%2d: %.*s\n", i, substring_length, substring_start);
+    }
+
+  if (namecount <= 0) printf("No named substrings\n"); else
+    {
+    unsigned char *tabptr = name_table;
+    printf("Named substrings\n");
+    for (i = 0; i < namecount; i++)
+      {
+      int n = (tabptr[0] << 8) | tabptr[1];
+      printf("(%d) %*s: %.*s\n", n, name_entry_size - 3, tabptr + 2,
+        ovector[2*n+1] - ovector[2*n], subject + ovector[2*n]);
+      tabptr += name_entry_size;
+      }
+    }
+  }      /* End of loop to find second and subsequent matches */
+
+printf("\n");
+pcre_free(re);       /* Release memory used for the compiled pattern */
+return 0;
+}
+
+/* End of pcredemo.c */
+

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcregrep.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcregrep.html new file mode 100644 index 0000000000000000000000000000000000000000..dacbb4998f830b943cfe3d3fa54988e83925ebb3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcregrep.html @@ -0,0 +1,759 @@ + + +pcregrep specification + + +

pcregrep man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+

+
SYNOPSIS
+

+pcregrep [options] [long options] [pattern] [path1 path2 ...] +

+
DESCRIPTION
+

+pcregrep searches files for character patterns, in the same way as other +grep commands do, but it uses the PCRE regular expression library to support +patterns that are compatible with the regular expressions of Perl 5. See +pcresyntax(3) +for a quick-reference summary of pattern syntax, or +pcrepattern(3) +for a full description of the syntax and semantics of the regular expressions +that PCRE supports. +

+

+Patterns, whether supplied on the command line or in a separate file, are given +without delimiters. For example: +

+  pcregrep Thursday /etc/motd
+
+If you attempt to use delimiters (for example, by surrounding a pattern with +slashes, as is common in Perl scripts), they are interpreted as part of the +pattern. Quotes can of course be used to delimit patterns on the command line +because they are interpreted by the shell, and indeed quotes are required if a +pattern contains white space or shell metacharacters. +

+

+The first argument that follows any option settings is treated as the single +pattern to be matched when neither -e nor -f is present. +Conversely, when one or both of these options are used to specify patterns, all +arguments are treated as path names. At least one of -e, -f, or an +argument pattern must be provided. +

+

+If no files are specified, pcregrep reads the standard input. The +standard input can also be referenced by a name consisting of a single hyphen. +For example: +

+  pcregrep some-pattern /file1 - /file3
+
+By default, each line that matches a pattern is copied to the standard +output, and if there is more than one file, the file name is output at the +start of each line, followed by a colon. However, there are options that can +change how pcregrep behaves. In particular, the -M option makes it +possible to search for patterns that span line boundaries. What defines a line +boundary is controlled by the -N (--newline) option. +

+

+The amount of memory used for buffering files that are being scanned is +controlled by a parameter that can be set by the --buffer-size option. +The default value for this parameter is specified when pcregrep is built, +with the default default being 20K. A block of memory three times this size is +used (to allow for buffering "before" and "after" lines). An error occurs if a +line overflows the buffer. +

+

+Patterns can be no longer than 8K or BUFSIZ bytes, whichever is the greater. +BUFSIZ is defined in <stdio.h>. When there is more than one pattern +(specified by the use of -e and/or -f), each pattern is applied to +each line in the order in which they are defined, except that all the -e +patterns are tried before the -f patterns. +

+

+By default, as soon as one pattern matches a line, no further patterns are +considered. However, if --colour (or --color) is used to colour the +matching substrings, or if --only-matching, --file-offsets, or +--line-offsets is used to output only the part of the line that matched +(either shown literally, or as an offset), scanning resumes immediately +following the match, so that further matches on the same line can be found. If +there are multiple patterns, they are all tried on the remainder of the line, +but patterns that follow the one that matched are not tried on the earlier part +of the line. +

+

+This behaviour means that the order in which multiple patterns are specified +can affect the output when one of the above options is used. This is no longer +the same behaviour as GNU grep, which now manages to display earlier matches +for later patterns (as long as there is no overlap). +

+

+Patterns that can match an empty string are accepted, but empty string +matches are never recognized. An example is the pattern "(super)?(man)?", in +which all components are optional. This pattern finds all occurrences of both +"super" and "man"; the output differs from matching with "super|man" when only +the matching substrings are being shown. +

+

+If the LC_ALL or LC_CTYPE environment variable is set, +pcregrep uses the value to set a locale when calling the PCRE library. +The --locale option can be used to override this. +

+
SUPPORT FOR COMPRESSED FILES
+

+It is possible to compile pcregrep so that it uses libz or +libbz2 to read files whose names end in .gz or .bz2, +respectively. You can find out whether your binary has support for one or both +of these file types by running it with the --help option. If the +appropriate support is not present, files are treated as plain text. The +standard input is always so treated. +

+
BINARY FILES
+

+By default, a file that contains a binary zero byte within the first 1024 bytes +is identified as a binary file, and is processed specially. (GNU grep also +identifies binary files in this manner.) See the --binary-files option +for a means of changing the way binary files are handled. +

+
OPTIONS
+

+The order in which some of the options appear can affect the output. For +example, both the -h and -l options affect the printing of file +names. Whichever comes later in the command line will be the one that takes +effect. Similarly, except where noted below, if an option is given twice, the +later setting is used. Numerical values for options may be followed by K or M, +to signify multiplication by 1024 or 1024*1024 respectively. +

+

+-- +This terminates the list of options. It is useful if the next item on the +command line starts with a hyphen but is not an option. This allows for the +processing of patterns and filenames that start with hyphens. +

+

+-A number, --after-context=number +Output number lines of context after each matching line. If filenames +and/or line numbers are being output, a hyphen separator is used instead of a +colon for the context lines. A line containing "--" is output between each +group of lines, unless they are in fact contiguous in the input file. The value +of number is expected to be relatively small. However, pcregrep +guarantees to have up to 8K of following text available for context output. +

+

+-a, --text +Treat binary files as text. This is equivalent to +--binary-files=text. +

+

+-B number, --before-context=number +Output number lines of context before each matching line. If filenames +and/or line numbers are being output, a hyphen separator is used instead of a +colon for the context lines. A line containing "--" is output between each +group of lines, unless they are in fact contiguous in the input file. The value +of number is expected to be relatively small. However, pcregrep +guarantees to have up to 8K of preceding text available for context output. +

+

+--binary-files=word +Specify how binary files are to be processed. If the word is "binary" (the +default), pattern matching is performed on binary files, but the only output is +"Binary file <name> matches" when a match succeeds. If the word is "text", +which is equivalent to the -a or --text option, binary files are +processed in the same way as any other file. In this case, when a match +succeeds, the output may be binary garbage, which can have nasty effects if +sent to a terminal. If the word is "without-match", which is equivalent to the +-I option, binary files are not processed at all; they are assumed not to +be of interest. +

+

+--buffer-size=number +Set the parameter that controls how much memory is used for buffering files +that are being scanned. +

+

+-C number, --context=number +Output number lines of context both before and after each matching line. +This is equivalent to setting both -A and -B to the same value. +

+

+-c, --count +Do not output individual lines from the files that are being scanned; instead +output the number of lines that would otherwise have been shown. If no lines +are selected, the number zero is output. If several files are are being +scanned, a count is output for each of them. However, if the +--files-with-matches option is also used, only those files whose counts +are greater than zero are listed. When -c is used, the -A, +-B, and -C options are ignored. +

+

+--colour, --color +If this option is given without any data, it is equivalent to "--colour=auto". +If data is required, it must be given in the same shell item, separated by an +equals sign. +

+

+--colour=value, --color=value +This option specifies under what circumstances the parts of a line that matched +a pattern should be coloured in the output. By default, the output is not +coloured. The value (which is optional, see above) may be "never", "always", or +"auto". In the latter case, colouring happens only if the standard output is +connected to a terminal. More resources are used when colouring is enabled, +because pcregrep has to search for all possible matches in a line, not +just one, in order to colour them all. +
+
+The colour that is used can be specified by setting the environment variable +PCREGREP_COLOUR or PCREGREP_COLOR. The value of this variable should be a +string of two numbers, separated by a semicolon. They are copied directly into +the control string for setting colour on a terminal, so it is your +responsibility to ensure that they make sense. If neither of the environment +variables is set, the default is "1;31", which gives red. +

+

+-D action, --devices=action +If an input path is not a regular file or a directory, "action" specifies how +it is to be processed. Valid values are "read" (the default) or "skip" +(silently skip the path). +

+

+-d action, --directories=action +If an input path is a directory, "action" specifies how it is to be processed. +Valid values are "read" (the default in non-Windows environments, for +compatibility with GNU grep), "recurse" (equivalent to the -r option), or +"skip" (silently skip the path, the default in Windows environments). In the +"read" case, directories are read as if they were ordinary files. In some +operating systems the effect of reading a directory like this is an immediate +end-of-file; in others it may provoke an error. +

+

+-e pattern, --regex=pattern, --regexp=pattern +Specify a pattern to be matched. This option can be used multiple times in +order to specify several patterns. It can also be used as a way of specifying a +single pattern that starts with a hyphen. When -e is used, no argument +pattern is taken from the command line; all arguments are treated as file +names. There is no limit to the number of patterns. They are applied to each +line in the order in which they are defined until one matches. +
+
+If -f is used with -e, the command line patterns are matched first, +followed by the patterns from the file(s), independent of the order in which +these options are specified. Note that multiple use of -e is not the same +as a single pattern with alternatives. For example, X|Y finds the first +character in a line that is X or Y, whereas if the two patterns are given +separately, with X first, pcregrep finds X if it is present, even if it +follows Y in the line. It finds Y only if there is no X in the line. This +matters only if you are using -o or --colo(u)r to show the part(s) +of the line that matched. +

+

+--exclude=pattern +Files (but not directories) whose names match the pattern are skipped without +being processed. This applies to all files, whether listed on the command line, +obtained from --file-list, or by scanning a directory. The pattern is a +PCRE regular expression, and is matched against the final component of the file +name, not the entire path. The -F, -w, and -x options do not +apply to this pattern. The option may be given any number of times in order to +specify multiple patterns. If a file name matches both an --include +and an --exclude pattern, it is excluded. There is no short form for this +option. +

+

+--exclude-from=filename +Treat each non-empty line of the file as the data for an --exclude +option. What constitutes a newline when reading the file is the operating +system's default. The --newline option has no effect on this option. This +option may be given more than once in order to specify a number of files to +read. +

+

+--exclude-dir=pattern +Directories whose names match the pattern are skipped without being processed, +whatever the setting of the --recursive option. This applies to all +directories, whether listed on the command line, obtained from +--file-list, or by scanning a parent directory. The pattern is a PCRE +regular expression, and is matched against the final component of the directory +name, not the entire path. The -F, -w, and -x options do not +apply to this pattern. The option may be given any number of times in order to +specify more than one pattern. If a directory matches both --include-dir +and --exclude-dir, it is excluded. There is no short form for this +option. +

+

+-F, --fixed-strings +Interpret each data-matching pattern as a list of fixed strings, separated by +newlines, instead of as a regular expression. What constitutes a newline for +this purpose is controlled by the --newline option. The -w (match +as a word) and -x (match whole line) options can be used with -F. +They apply to each of the fixed strings. A line is selected if any of the fixed +strings are found in it (subject to -w or -x, if present). This +option applies only to the patterns that are matched against the contents of +files; it does not apply to patterns specified by any of the --include or +--exclude options. +

+

+-f filename, --file=filename +Read patterns from the file, one per line, and match them against +each line of input. What constitutes a newline when reading the file is the +operating system's default. The --newline option has no effect on this +option. Trailing white space is removed from each line, and blank lines are +ignored. An empty file contains no patterns and therefore matches nothing. See +also the comments about multiple patterns versus a single pattern with +alternatives in the description of -e above. +
+
+If this option is given more than once, all the specified files are +read. A data line is output if any of the patterns match it. A filename can +be given as "-" to refer to the standard input. When -f is used, patterns +specified on the command line using -e may also be present; they are +tested before the file's patterns. However, no other pattern is taken from the +command line; all arguments are treated as the names of paths to be searched. +

+

+--file-list=filename +Read a list of files and/or directories that are to be scanned from the given +file, one per line. Trailing white space is removed from each line, and blank +lines are ignored. These paths are processed before any that are listed on the +command line. The filename can be given as "-" to refer to the standard input. +If --file and --file-list are both specified as "-", patterns are +read first. This is useful only when the standard input is a terminal, from +which further lines (the list of files) can be read after an end-of-file +indication. If this option is given more than once, all the specified files are +read. +

+

+--file-offsets +Instead of showing lines or parts of lines that match, show each match as an +offset from the start of the file and a length, separated by a comma. In this +mode, no context is shown. That is, the -A, -B, and -C +options are ignored. If there is more than one match in a line, each of them is +shown separately. This option is mutually exclusive with --line-offsets +and --only-matching. +

+

+-H, --with-filename +Force the inclusion of the filename at the start of output lines when searching +a single file. By default, the filename is not shown in this case. For matching +lines, the filename is followed by a colon; for context lines, a hyphen +separator is used. If a line number is also being output, it follows the file +name. +

+

+-h, --no-filename +Suppress the output filenames when searching multiple files. By default, +filenames are shown when multiple files are searched. For matching lines, the +filename is followed by a colon; for context lines, a hyphen separator is used. +If a line number is also being output, it follows the file name. +

+

+--help +Output a help message, giving brief details of the command options and file +type support, and then exit. Anything else on the command line is +ignored. +

+

+-I +Treat binary files as never matching. This is equivalent to +--binary-files=without-match. +

+

+-i, --ignore-case +Ignore upper/lower case distinctions during comparisons. +

+

+--include=pattern +If any --include patterns are specified, the only files that are +processed are those that match one of the patterns (and do not match an +--exclude pattern). This option does not affect directories, but it +applies to all files, whether listed on the command line, obtained from +--file-list, or by scanning a directory. The pattern is a PCRE regular +expression, and is matched against the final component of the file name, not +the entire path. The -F, -w, and -x options do not apply to +this pattern. The option may be given any number of times. If a file name +matches both an --include and an --exclude pattern, it is excluded. +There is no short form for this option. +

+

+--include-from=filename +Treat each non-empty line of the file as the data for an --include +option. What constitutes a newline for this purpose is the operating system's +default. The --newline option has no effect on this option. This option +may be given any number of times; all the files are read. +

+

+--include-dir=pattern +If any --include-dir patterns are specified, the only directories that +are processed are those that match one of the patterns (and do not match an +--exclude-dir pattern). This applies to all directories, whether listed +on the command line, obtained from --file-list, or by scanning a parent +directory. The pattern is a PCRE regular expression, and is matched against the +final component of the directory name, not the entire path. The -F, +-w, and -x options do not apply to this pattern. The option may be +given any number of times. If a directory matches both --include-dir and +--exclude-dir, it is excluded. There is no short form for this option. +

+

+-L, --files-without-match +Instead of outputting lines from the files, just output the names of the files +that do not contain any lines that would have been output. Each file name is +output once, on a separate line. +

+

+-l, --files-with-matches +Instead of outputting lines from the files, just output the names of the files +containing lines that would have been output. Each file name is output +once, on a separate line. Searching normally stops as soon as a matching line +is found in a file. However, if the -c (count) option is also used, +matching continues in order to obtain the correct count, and those files that +have at least one match are listed along with their counts. Using this option +with -c is a way of suppressing the listing of files with no matches. +

+

+--label=name +This option supplies a name to be used for the standard input when file names +are being output. If not supplied, "(standard input)" is used. There is no +short form for this option. +

+

+--line-buffered +When this option is given, input is read and processed line by line, and the +output is flushed after each write. By default, input is read in large chunks, +unless pcregrep can determine that it is reading from a terminal (which +is currently possible only in Unix-like environments). Output to terminal is +normally automatically flushed by the operating system. This option can be +useful when the input or output is attached to a pipe and you do not want +pcregrep to buffer up large amounts of data. However, its use will affect +performance, and the -M (multiline) option ceases to work. +

+

+--line-offsets +Instead of showing lines or parts of lines that match, show each match as a +line number, the offset from the start of the line, and a length. The line +number is terminated by a colon (as usual; see the -n option), and the +offset and length are separated by a comma. In this mode, no context is shown. +That is, the -A, -B, and -C options are ignored. If there is +more than one match in a line, each of them is shown separately. This option is +mutually exclusive with --file-offsets and --only-matching. +

+

+--locale=locale-name +This option specifies a locale to be used for pattern matching. It overrides +the value in the LC_ALL or LC_CTYPE environment variables. If no +locale is specified, the PCRE library's default (usually the "C" locale) is +used. There is no short form for this option. +

+

+--match-limit=number +Processing some regular expression patterns can require a very large amount of +memory, leading in some cases to a program crash if not enough is available. +Other patterns may take a very long time to search for all possible matching +strings. The pcre_exec() function that is called by pcregrep to do +the matching has two parameters that can limit the resources that it uses. +
+
+The --match-limit option provides a means of limiting resource usage +when processing patterns that are not going to match, but which have a very +large number of possibilities in their search trees. The classic example is a +pattern that uses nested unlimited repeats. Internally, PCRE uses a function +called match() which it calls repeatedly (sometimes recursively). The +limit set by --match-limit is imposed on the number of times this +function is called during a match, which has the effect of limiting the amount +of backtracking that can take place. +
+
+The --recursion-limit option is similar to --match-limit, but +instead of limiting the total number of times that match() is called, it +limits the depth of recursive calls, which in turn limits the amount of memory +that can be used. The recursion depth is a smaller number than the total number +of calls, because not all calls to match() are recursive. This limit is +of use only if it is set smaller than --match-limit. +
+
+There are no short forms for these options. The default settings are specified +when the PCRE library is compiled, with the default default being 10 million. +

+

+-M, --multiline +Allow patterns to match more than one line. When this option is given, patterns +may usefully contain literal newline characters and internal occurrences of ^ +and $ characters. The output for a successful match may consist of more than +one line, the last of which is the one in which the match ended. If the matched +string ends with a newline sequence the output ends at the end of that line. +
+
+When this option is set, the PCRE library is called in "multiline" mode. +There is a limit to the number of lines that can be matched, imposed by the way +that pcregrep buffers the input file as it scans it. However, +pcregrep ensures that at least 8K characters or the rest of the document +(whichever is the shorter) are available for forward matching, and similarly +the previous 8K characters (or all the previous characters, if fewer than 8K) +are guaranteed to be available for lookbehind assertions. This option does not +work when input is read line by line (see \fP--line-buffered\fP.) +

+

+-N newline-type, --newline=newline-type +The PCRE library supports five different conventions for indicating +the ends of lines. They are the single-character sequences CR (carriage return) +and LF (linefeed), the two-character sequence CRLF, an "anycrlf" convention, +which recognizes any of the preceding three types, and an "any" convention, in +which any Unicode line ending sequence is assumed to end a line. The Unicode +sequences are the three just mentioned, plus VT (vertical tab, U+000B), FF +(form feed, U+000C), NEL (next line, U+0085), LS (line separator, U+2028), and +PS (paragraph separator, U+2029). +
+
+When the PCRE library is built, a default line-ending sequence is specified. +This is normally the standard sequence for the operating system. Unless +otherwise specified by this option, pcregrep uses the library's default. +The possible values for this option are CR, LF, CRLF, ANYCRLF, or ANY. This +makes it possible to use pcregrep to scan files that have come from other +environments without having to modify their line endings. If the data that is +being scanned does not agree with the convention set by this option, +pcregrep may behave in strange ways. Note that this option does not +apply to files specified by the -f, --exclude-from, or +--include-from options, which are expected to use the operating system's +standard newline sequence. +

+

+-n, --line-number +Precede each output line by its line number in the file, followed by a colon +for matching lines or a hyphen for context lines. If the filename is also being +output, it precedes the line number. This option is forced if +--line-offsets is used. +

+

+--no-jit +If the PCRE library is built with support for just-in-time compiling (which +speeds up matching), pcregrep automatically makes use of this, unless it +was explicitly disabled at build time. This option can be used to disable the +use of JIT at run time. It is provided for testing and working round problems. +It should never be needed in normal use. +

+

+-o, --only-matching +Show only the part of the line that matched a pattern instead of the whole +line. In this mode, no context is shown. That is, the -A, -B, and +-C options are ignored. If there is more than one match in a line, each +of them is shown separately. If -o is combined with -v (invert the +sense of the match to find non-matching lines), no output is generated, but the +return code is set appropriately. If the matched portion of the line is empty, +nothing is output unless the file name or line number are being printed, in +which case they are shown on an otherwise empty line. This option is mutually +exclusive with --file-offsets and --line-offsets. +

+

+-onumber, --only-matching=number +Show only the part of the line that matched the capturing parentheses of the +given number. Up to 32 capturing parentheses are supported, and -o0 is +equivalent to -o without a number. Because these options can be given +without an argument (see above), if an argument is present, it must be given in +the same shell item, for example, -o3 or --only-matching=2. The comments given +for the non-argument case above also apply to this case. If the specified +capturing parentheses do not exist in the pattern, or were not set in the +match, nothing is output unless the file name or line number are being printed. +
+
+If this option is given multiple times, multiple substrings are output, in the +order the options are given. For example, -o3 -o1 -o3 causes the substrings +matched by capturing parentheses 3 and 1 and then 3 again to be output. By +default, there is no separator (but see the next option). +

+

+--om-separator=text +Specify a separating string for multiple occurrences of -o. The default +is an empty string. Separating strings are never coloured. +

+

+-q, --quiet +Work quietly, that is, display nothing except error messages. The exit +status indicates whether or not any matches were found. +

+

+-r, --recursive +If any given path is a directory, recursively scan the files it contains, +taking note of any --include and --exclude settings. By default, a +directory is read as a normal file; in some operating systems this gives an +immediate end-of-file. This option is a shorthand for setting the -d +option to "recurse". +

+

+--recursion-limit=number +See --match-limit above. +

+

+-s, --no-messages +Suppress error messages about non-existent or unreadable files. Such files are +quietly skipped. However, the return code is still 2, even if matches were +found in other files. +

+

+-u, --utf-8 +Operate in UTF-8 mode. This option is available only if PCRE has been compiled +with UTF-8 support. All patterns (including those for any --exclude and +--include options) and all subject lines that are scanned must be valid +strings of UTF-8 characters. +

+

+-V, --version +Write the version numbers of pcregrep and the PCRE library to the +standard output and then exit. Anything else on the command line is +ignored. +

+

+-v, --invert-match +Invert the sense of the match, so that lines which do not match any of +the patterns are the ones that are found. +

+

+-w, --word-regex, --word-regexp +Force the patterns to match only whole words. This is equivalent to having \b +at the start and end of the pattern. This option applies only to the patterns +that are matched against the contents of files; it does not apply to patterns +specified by any of the --include or --exclude options. +

+

+-x, --line-regex, --line-regexp +Force the patterns to be anchored (each must start matching at the beginning of +a line) and in addition, require them to match entire lines. This is equivalent +to having ^ and $ characters at the start and end of each alternative branch in +every pattern. This option applies only to the patterns that are matched +against the contents of files; it does not apply to patterns specified by any +of the --include or --exclude options. +

+
ENVIRONMENT VARIABLES
+

+The environment variables LC_ALL and LC_CTYPE are examined, in that +order, for a locale. The first one that is set is used. This can be overridden +by the --locale option. If no locale is set, the PCRE library's default +(usually the "C" locale) is used. +

+
NEWLINES
+

+The -N (--newline) option allows pcregrep to scan files with +different newline conventions from the default. Any parts of the input files +that are written to the standard output are copied identically, with whatever +newline sequences they have in the input. However, the setting of this option +does not affect the interpretation of files specified by the -f, +--exclude-from, or --include-from options, which are assumed to use +the operating system's standard newline sequence, nor does it affect the way in +which pcregrep writes informational messages to the standard error and +output streams. For these it uses the string "\n" to indicate newlines, +relying on the C I/O library to convert this to an appropriate sequence. +

+
OPTIONS COMPATIBILITY
+

+Many of the short and long forms of pcregrep's options are the same +as in the GNU grep program. Any long option of the form +--xxx-regexp (GNU terminology) is also available as --xxx-regex +(PCRE terminology). However, the --file-list, --file-offsets, +--include-dir, --line-offsets, --locale, --match-limit, +-M, --multiline, -N, --newline, --om-separator, +--recursion-limit, -u, and --utf-8 options are specific to +pcregrep, as is the use of the --only-matching option with a +capturing parentheses number. +

+

+Although most of the common options work the same way, a few are different in +pcregrep. For example, the --include option's argument is a glob +for GNU grep, but a regular expression for pcregrep. If both the +-c and -l options are given, GNU grep lists only file names, +without counts, but pcregrep gives the counts. +

+
OPTIONS WITH DATA
+

+There are four different ways in which an option with data can be specified. +If a short form option is used, the data may follow immediately, or (with one +exception) in the next command line item. For example: +

+  -f/some/file
+  -f /some/file
+
+The exception is the -o option, which may appear with or without data. +Because of this, if data is present, it must follow immediately in the same +item, for example -o3. +

+

+If a long form option is used, the data may appear in the same command line +item, separated by an equals character, or (with two exceptions) it may appear +in the next command line item. For example: +

+  --file=/some/file
+  --file /some/file
+
+Note, however, that if you want to supply a file name beginning with ~ as data +in a shell command, and have the shell expand ~ to a home directory, you must +separate the file name from the option, because the shell does not treat ~ +specially unless it is at the start of an item. +

+

+The exceptions to the above are the --colour (or --color) and +--only-matching options, for which the data is optional. If one of these +options does have data, it must be given in the first form, using an equals +character. Otherwise pcregrep will assume that it has no data. +

+
MATCHING ERRORS
+

+It is possible to supply a regular expression that takes a very long time to +fail to match certain lines. Such patterns normally involve nested indefinite +repeats, for example: (a+)*\d when matched against a line of a's with no final +digit. The PCRE matching function has a resource limit that causes it to abort +in these circumstances. If this happens, pcregrep outputs an error +message and the line that caused the problem to the standard error stream. If +there are more than 20 such errors, pcregrep gives up. +

+

+The --match-limit option of pcregrep can be used to set the overall +resource limit; there is a second option called --recursion-limit that +sets a limit on the amount of memory (usually stack) that is used (see the +discussion of these options above). +

+
DIAGNOSTICS
+

+Exit status is 0 if any matches were found, 1 if no matches were found, and 2 +for syntax errors, overlong lines, non-existent or inaccessible files (even if +matches were found in other files) or too many matching errors. Using the +-s option to suppress error messages about inaccessible files does not +affect the return code. +

+
SEE ALSO
+

+pcrepattern(3), pcresyntax(3), pcretest(1). +

+
AUTHOR
+

+Philip Hazel +
+University Computing Service +
+Cambridge CB2 3QH, England. +
+

+
REVISION
+

+Last updated: 03 April 2014 +
+Copyright © 1997-2014 University of Cambridge. +
+

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrejit.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrejit.html new file mode 100644 index 0000000000000000000000000000000000000000..c1e0310defc0bb2374154e9f3c494e888586fb4e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrejit.html @@ -0,0 +1,499 @@ + + +pcrejit specification + + +

pcrejit man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+

+
PCRE JUST-IN-TIME COMPILER SUPPORT
+

+Just-in-time compiling is a heavyweight optimization that can greatly speed up +pattern matching. However, it comes at the cost of extra processing before the +match is performed. Therefore, it is of most benefit when the same pattern is +going to be matched many times. This does not necessarily mean many calls of a +matching function; if the pattern is not anchored, matching attempts may take +place many times at various positions in the subject, even for a single call. +Therefore, if the subject string is very long, it may still pay to use JIT for +one-off matches. +

+

+JIT support applies only to the traditional Perl-compatible matching function. +It does not apply when the DFA matching function is being used. The code for +this support was written by Zoltan Herczeg. +

+
8-BIT, 16-BIT AND 32-BIT SUPPORT
+

+JIT support is available for all of the 8-bit, 16-bit and 32-bit PCRE +libraries. To keep this documentation simple, only the 8-bit interface is +described in what follows. If you are using the 16-bit library, substitute the +16-bit functions and 16-bit structures (for example, pcre16_jit_stack +instead of pcre_jit_stack). If you are using the 32-bit library, +substitute the 32-bit functions and 32-bit structures (for example, +pcre32_jit_stack instead of pcre_jit_stack). +

+
AVAILABILITY OF JIT SUPPORT
+

+JIT support is an optional feature of PCRE. The "configure" option --enable-jit +(or equivalent CMake option) must be set when PCRE is built if you want to use +JIT. The support is limited to the following hardware platforms: +

+  ARM v5, v7, and Thumb2
+  Intel x86 32-bit and 64-bit
+  MIPS 32-bit
+  Power PC 32-bit and 64-bit
+  SPARC 32-bit (experimental)
+
+If --enable-jit is set on an unsupported platform, compilation fails. +

+

+A program that is linked with PCRE 8.20 or later can tell if JIT support is +available by calling pcre_config() with the PCRE_CONFIG_JIT option. The +result is 1 when JIT is available, and 0 otherwise. However, a simple program +does not need to check this in order to use JIT. The normal API is implemented +in a way that falls back to the interpretive code if JIT is not available. For +programs that need the best possible performance, there is also a "fast path" +API that is JIT-specific. +

+

+If your program may sometimes be linked with versions of PCRE that are older +than 8.20, but you want to use JIT when it is available, you can test the +values of PCRE_MAJOR and PCRE_MINOR, or the existence of a JIT macro such as +PCRE_CONFIG_JIT, for compile-time control of your code. Also beware that the +pcre_jit_exec() function was not available at all before 8.32, +and may not be available at all if PCRE isn't compiled with +--enable-jit. See the "JIT FAST PATH API" section below for details. +

+
SIMPLE USE OF JIT
+

+You have to do two things to make use of the JIT support in the simplest way: +

+  (1) Call pcre_study() with the PCRE_STUDY_JIT_COMPILE option for
+      each compiled pattern, and pass the resulting pcre_extra block to
+      pcre_exec().
+
+  (2) Use pcre_free_study() to free the pcre_extra block when it is
+      no longer needed, instead of just freeing it yourself. This ensures that
+      any JIT data is also freed.
+
+For a program that may be linked with pre-8.20 versions of PCRE, you can insert +
+  #ifndef PCRE_STUDY_JIT_COMPILE
+  #define PCRE_STUDY_JIT_COMPILE 0
+  #endif
+
+so that no option is passed to pcre_study(), and then use something like +this to free the study data: +
+  #ifdef PCRE_CONFIG_JIT
+      pcre_free_study(study_ptr);
+  #else
+      pcre_free(study_ptr);
+  #endif
+
+PCRE_STUDY_JIT_COMPILE requests the JIT compiler to generate code for complete +matches. If you want to run partial matches using the PCRE_PARTIAL_HARD or +PCRE_PARTIAL_SOFT options of pcre_exec(), you should set one or both of +the following options in addition to, or instead of, PCRE_STUDY_JIT_COMPILE +when you call pcre_study(): +
+  PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE
+  PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE
+
+If using pcre_jit_exec() and supporting a pre-8.32 version of +PCRE, you can insert: +
+   #if PCRE_MAJOR >= 8 && PCRE_MINOR >= 32
+   pcre_jit_exec(...);
+   #else
+   pcre_exec(...)
+   #endif
+
+but as described in the "JIT FAST PATH API" section below this assumes +version 8.32 and later are compiled with --enable-jit, which may +break. +
+
+The JIT compiler generates different optimized code for each of the three +modes (normal, soft partial, hard partial). When pcre_exec() is called, +the appropriate code is run if it is available. Otherwise, the pattern is +matched using interpretive code. +

+

+In some circumstances you may need to call additional functions. These are +described in the section entitled +"Controlling the JIT stack" +below. +

+

+If JIT support is not available, PCRE_STUDY_JIT_COMPILE etc. are ignored, and +no JIT data is created. Otherwise, the compiled pattern is passed to the JIT +compiler, which turns it into machine code that executes much faster than the +normal interpretive code. When pcre_exec() is passed a pcre_extra +block containing a pointer to JIT code of the appropriate mode (normal or +hard/soft partial), it obeys that code instead of running the interpreter. The +result is identical, but the compiled JIT code runs much faster. +

+

+There are some pcre_exec() options that are not supported for JIT +execution. There are also some pattern items that JIT cannot handle. Details +are given below. In both cases, execution automatically falls back to the +interpretive code. If you want to know whether JIT was actually used for a +particular match, you should arrange for a JIT callback function to be set up +as described in the section entitled +"Controlling the JIT stack" +below, even if you do not need to supply a non-default JIT stack. Such a +callback function is called whenever JIT code is about to be obeyed. If the +execution options are not right for JIT execution, the callback function is not +obeyed. +

+

+If the JIT compiler finds an unsupported item, no JIT data is generated. You +can find out if JIT execution is available after studying a pattern by calling +pcre_fullinfo() with the PCRE_INFO_JIT option. A result of 1 means that +JIT compilation was successful. A result of 0 means that JIT support is not +available, or the pattern was not studied with PCRE_STUDY_JIT_COMPILE etc., or +the JIT compiler was not able to handle the pattern. +

+

+Once a pattern has been studied, with or without JIT, it can be used as many +times as you like for matching different subject strings. +

+
UNSUPPORTED OPTIONS AND PATTERN ITEMS
+

+The only pcre_exec() options that are supported for JIT execution are +PCRE_NO_UTF8_CHECK, PCRE_NO_UTF16_CHECK, PCRE_NO_UTF32_CHECK, PCRE_NOTBOL, +PCRE_NOTEOL, PCRE_NOTEMPTY, PCRE_NOTEMPTY_ATSTART, PCRE_PARTIAL_HARD, and +PCRE_PARTIAL_SOFT. +

+

+The only unsupported pattern items are \C (match a single data unit) when +running in a UTF mode, and a callout immediately before an assertion condition +in a conditional group. +

+
RETURN VALUES FROM JIT EXECUTION
+

+When a pattern is matched using JIT execution, the return values are the same +as those given by the interpretive pcre_exec() code, with the addition of +one new error code: PCRE_ERROR_JIT_STACKLIMIT. This means that the memory used +for the JIT stack was insufficient. See +"Controlling the JIT stack" +below for a discussion of JIT stack usage. For compatibility with the +interpretive pcre_exec() code, no more than two-thirds of the +ovector argument is used for passing back captured substrings. +

+

+The error code PCRE_ERROR_MATCHLIMIT is returned by the JIT code if searching a +very large pattern tree goes on for too long, as it is in the same circumstance +when JIT is not used, but the details of exactly what is counted are not the +same. The PCRE_ERROR_RECURSIONLIMIT error code is never returned by JIT +execution. +

+
SAVING AND RESTORING COMPILED PATTERNS
+

+The code that is generated by the JIT compiler is architecture-specific, and is +also position dependent. For those reasons it cannot be saved (in a file or +database) and restored later like the bytecode and other data of a compiled +pattern. Saving and restoring compiled patterns is not something many people +do. More detail about this facility is given in the +pcreprecompile +documentation. It should be possible to run pcre_study() on a saved and +restored pattern, and thereby recreate the JIT data, but because JIT +compilation uses significant resources, it is probably not worth doing this; +you might as well recompile the original pattern. +

+
CONTROLLING THE JIT STACK
+

+When the compiled JIT code runs, it needs a block of memory to use as a stack. +By default, it uses 32K on the machine stack. However, some large or +complicated patterns need more than this. The error PCRE_ERROR_JIT_STACKLIMIT +is given when there is not enough stack. Three functions are provided for +managing blocks of memory for use as JIT stacks. There is further discussion +about the use of JIT stacks in the section entitled +"JIT stack FAQ" +below. +

+

+The pcre_jit_stack_alloc() function creates a JIT stack. Its arguments +are a starting size and a maximum size, and it returns a pointer to an opaque +structure of type pcre_jit_stack, or NULL if there is an error. The +pcre_jit_stack_free() function can be used to free a stack that is no +longer needed. (For the technically minded: the address space is allocated by +mmap or VirtualAlloc.) +

+

+JIT uses far less memory for recursion than the interpretive code, +and a maximum stack size of 512K to 1M should be more than enough for any +pattern. +

+

+The pcre_assign_jit_stack() function specifies which stack JIT code +should use. Its arguments are as follows: +

+  pcre_extra         *extra
+  pcre_jit_callback  callback
+  void               *data
+
+The extra argument must be the result of studying a pattern with +PCRE_STUDY_JIT_COMPILE etc. There are three cases for the values of the other +two options: +
+  (1) If callback is NULL and data is NULL, an internal 32K block
+      on the machine stack is used.
+
+  (2) If callback is NULL and data is not NULL, data must be
+      a valid JIT stack, the result of calling pcre_jit_stack_alloc().
+
+  (3) If callback is not NULL, it must point to a function that is
+      called with data as an argument at the start of matching, in
+      order to set up a JIT stack. If the return from the callback
+      function is NULL, the internal 32K stack is used; otherwise the
+      return value must be a valid JIT stack, the result of calling
+      pcre_jit_stack_alloc().
+
+A callback function is obeyed whenever JIT code is about to be run; it is not +obeyed when pcre_exec() is called with options that are incompatible for +JIT execution. A callback function can therefore be used to determine whether a +match operation was executed by JIT or by the interpreter. +

+

+You may safely use the same JIT stack for more than one pattern (either by +assigning directly or by callback), as long as the patterns are all matched +sequentially in the same thread. In a multithread application, if you do not +specify a JIT stack, or if you assign or pass back NULL from a callback, that +is thread-safe, because each thread has its own machine stack. However, if you +assign or pass back a non-NULL JIT stack, this must be a different stack for +each thread so that the application is thread-safe. +

+

+Strictly speaking, even more is allowed. You can assign the same non-NULL stack +to any number of patterns as long as they are not used for matching by multiple +threads at the same time. For example, you can assign the same stack to all +compiled patterns, and use a global mutex in the callback to wait until the +stack is available for use. However, this is an inefficient solution, and not +recommended. +

+

+This is a suggestion for how a multithreaded program that needs to set up +non-default JIT stacks might operate: +

+  During thread initialization
+    thread_local_var = pcre_jit_stack_alloc(...)
+
+  During thread exit
+    pcre_jit_stack_free(thread_local_var)
+
+  Use a one-line callback function
+    return thread_local_var
+
+All the functions described in this section do nothing if JIT is not available, +and pcre_assign_jit_stack() does nothing unless the extra argument +is non-NULL and points to a pcre_extra block that is the result of a +successful study with PCRE_STUDY_JIT_COMPILE etc. +

+
JIT STACK FAQ
+

+(1) Why do we need JIT stacks? +
+
+PCRE (and JIT) is a recursive, depth-first engine, so it needs a stack where +the local data of the current node is pushed before checking its child nodes. +Allocating real machine stack on some platforms is difficult. For example, the +stack chain needs to be updated every time if we extend the stack on PowerPC. +Although it is possible, its updating time overhead decreases performance. So +we do the recursion in memory. +

+

+(2) Why don't we simply allocate blocks of memory with malloc()? +
+
+Modern operating systems have a nice feature: they can reserve an address space +instead of allocating memory. We can safely allocate memory pages inside this +address space, so the stack could grow without moving memory data (this is +important because of pointers). Thus we can allocate 1M address space, and use +only a single memory page (usually 4K) if that is enough. However, we can still +grow up to 1M anytime if needed. +

+

+(3) Who "owns" a JIT stack? +
+
+The owner of the stack is the user program, not the JIT studied pattern or +anything else. The user program must ensure that if a stack is used by +pcre_exec(), (that is, it is assigned to the pattern currently running), +that stack must not be used by any other threads (to avoid overwriting the same +memory area). The best practice for multithreaded programs is to allocate a +stack for each thread, and return this stack through the JIT callback function. +

+

+(4) When should a JIT stack be freed? +
+
+You can free a JIT stack at any time, as long as it will not be used by +pcre_exec() again. When you assign the stack to a pattern, only a pointer +is set. There is no reference counting or any other magic. You can free the +patterns and stacks in any order, anytime. Just do not call +pcre_exec() with a pattern pointing to an already freed stack, as that +will cause SEGFAULT. (Also, do not free a stack currently used by +pcre_exec() in another thread). You can also replace the stack for a +pattern at any time. You can even free the previous stack before assigning a +replacement. +

+

+(5) Should I allocate/free a stack every time before/after calling +pcre_exec()? +
+
+No, because this is too costly in terms of resources. However, you could +implement some clever idea which release the stack if it is not used in let's +say two minutes. The JIT callback can help to achieve this without keeping a +list of the currently JIT studied patterns. +

+

+(6) OK, the stack is for long term memory allocation. But what happens if a +pattern causes stack overflow with a stack of 1M? Is that 1M kept until the +stack is freed? +
+
+Especially on embedded sytems, it might be a good idea to release memory +sometimes without freeing the stack. There is no API for this at the moment. +Probably a function call which returns with the currently allocated memory for +any stack and another which allows releasing memory (shrinking the stack) would +be a good idea if someone needs this. +

+

+(7) This is too much of a headache. Isn't there any better solution for JIT +stack handling? +
+
+No, thanks to Windows. If POSIX threads were used everywhere, we could throw +out this complicated API. +

+
EXAMPLE CODE
+

+This is a single-threaded example that specifies a JIT stack without using a +callback. +

+  int rc;
+  int ovector[30];
+  pcre *re;
+  pcre_extra *extra;
+  pcre_jit_stack *jit_stack;
+
+  re = pcre_compile(pattern, 0, &error, &erroffset, NULL);
+  /* Check for errors */
+  extra = pcre_study(re, PCRE_STUDY_JIT_COMPILE, &error);
+  jit_stack = pcre_jit_stack_alloc(32*1024, 512*1024);
+  /* Check for error (NULL) */
+  pcre_assign_jit_stack(extra, NULL, jit_stack);
+  rc = pcre_exec(re, extra, subject, length, 0, 0, ovector, 30);
+  /* Check results */
+  pcre_free(re);
+  pcre_free_study(extra);
+  pcre_jit_stack_free(jit_stack);
+
+
+

+
JIT FAST PATH API
+

+Because the API described above falls back to interpreted execution when JIT is +not available, it is convenient for programs that are written for general use +in many environments. However, calling JIT via pcre_exec() does have a +performance impact. Programs that are written for use where JIT is known to be +available, and which need the best possible performance, can instead use a +"fast path" API to call JIT execution directly instead of calling +pcre_exec() (obviously only for patterns that have been successfully +studied by JIT). +

+

+The fast path function is called pcre_jit_exec(), and it takes exactly +the same arguments as pcre_exec(), plus one additional argument that +must point to a JIT stack. The JIT stack arrangements described above do not +apply. The return values are the same as for pcre_exec(). +

+

+When you call pcre_exec(), as well as testing for invalid options, a +number of other sanity checks are performed on the arguments. For example, if +the subject pointer is NULL, or its length is negative, an immediate error is +given. Also, unless PCRE_NO_UTF[8|16|32] is set, a UTF subject string is tested +for validity. In the interests of speed, these checks do not happen on the JIT +fast path, and if invalid data is passed, the result is undefined. +

+

+Bypassing the sanity checks and the pcre_exec() wrapping can give +speedups of more than 10%. +

+

+Note that the pcre_jit_exec() function is not available in versions of +PCRE before 8.32 (released in November 2012). If you need to support versions +that old you must either use the slower pcre_exec(), or switch between +the two codepaths by checking the values of PCRE_MAJOR and PCRE_MINOR. +

+

+Due to an unfortunate implementation oversight, even in versions 8.32 +and later there will be no pcre_jit_exec() stub function defined +when PCRE is compiled with --disable-jit, which is the default, and +there's no way to detect whether PCRE was compiled with --enable-jit +via a macro. +

+

+If you need to support versions older than 8.32, or versions that may +not build with --enable-jit, you must either use the slower +pcre_exec(), or switch between the two codepaths by checking the +values of PCRE_MAJOR and PCRE_MINOR. +

+

+Switching between the two by checking the version assumes that all the +versions being targeted are built with --enable-jit. To also support +builds that may use --disable-jit either pcre_exec() must be +used, or a compile-time check for JIT via pcre_config() (which +assumes the runtime environment will be the same), or as the Git +project decided to do, simply assume that pcre_jit_exec() is +present in 8.32 or later unless a compile-time flag is provided, see +the "grep: un-break building with PCRE >= 8.32 without --enable-jit" +commit in git.git for an example of that. +

+
SEE ALSO
+

+pcreapi(3) +

+
AUTHOR
+

+Philip Hazel (FAQ by Zoltan Herczeg) +
+University Computing Service +
+Cambridge CB2 3QH, England. +
+

+
REVISION
+

+Last updated: 05 July 2017 +
+Copyright © 1997-2017 University of Cambridge. +
+

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrelimits.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrelimits.html new file mode 100644 index 0000000000000000000000000000000000000000..ee5ebf033d9d1378b6bf21fac1efec3c7ec7343b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrelimits.html @@ -0,0 +1,90 @@ + + +pcrelimits specification + + +

pcrelimits man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+SIZE AND OTHER LIMITATIONS +
+

+There are some size limitations in PCRE but it is hoped that they will never in +practice be relevant. +

+

+The maximum length of a compiled pattern is approximately 64K data units (bytes +for the 8-bit library, 16-bit units for the 16-bit library, and 32-bit units for +the 32-bit library) if PCRE is compiled with the default internal linkage size, +which is 2 bytes for the 8-bit and 16-bit libraries, and 4 bytes for the 32-bit +library. If you want to process regular expressions that are truly enormous, +you can compile PCRE with an internal linkage size of 3 or 4 (when building the +16-bit or 32-bit library, 3 is rounded up to 4). See the README file in +the source distribution and the +pcrebuild +documentation for details. In these cases the limit is substantially larger. +However, the speed of execution is slower. +

+

+All values in repeating quantifiers must be less than 65536. +

+

+There is no limit to the number of parenthesized subpatterns, but there can be +no more than 65535 capturing subpatterns. There is, however, a limit to the +depth of nesting of parenthesized subpatterns of all kinds. This is imposed in +order to limit the amount of system stack used at compile time. The limit can +be specified when PCRE is built; the default is 250. +

+

+There is a limit to the number of forward references to subsequent subpatterns +of around 200,000. Repeated forward references with fixed upper limits, for +example, (?2){0,100} when subpattern number 2 is to the right, are included in +the count. There is no limit to the number of backward references. +

+

+The maximum length of name for a named subpattern is 32 characters, and the +maximum number of named subpatterns is 10000. +

+

+The maximum length of a name in a (*MARK), (*PRUNE), (*SKIP), or (*THEN) verb +is 255 for the 8-bit library and 65535 for the 16-bit and 32-bit libraries. +

+

+The maximum length of a subject string is the largest positive number that an +integer variable can hold. However, when using the traditional matching +function, PCRE uses recursion to handle subpatterns and indefinite repetition. +This means that the available stack space may limit the size of a subject +string that can be processed by certain patterns. For a discussion of stack +issues, see the +pcrestack +documentation. +

+
+AUTHOR +
+

+Philip Hazel +
+University Computing Service +
+Cambridge CB2 3QH, England. +
+

+
+REVISION +
+

+Last updated: 05 November 2013 +
+Copyright © 1997-2013 University of Cambridge. +
+

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrematching.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrematching.html new file mode 100644 index 0000000000000000000000000000000000000000..a1af39b68d3abebc295d1d0115b35ed5ecd3a412 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrematching.html @@ -0,0 +1,242 @@ + + +pcrematching specification + + +

pcrematching man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+

+
PCRE MATCHING ALGORITHMS
+

+This document describes the two different algorithms that are available in PCRE +for matching a compiled regular expression against a given subject string. The +"standard" algorithm is the one provided by the pcre_exec(), +pcre16_exec() and pcre32_exec() functions. These work in the same +as as Perl's matching function, and provide a Perl-compatible matching operation. +The just-in-time (JIT) optimization that is described in the +pcrejit +documentation is compatible with these functions. +

+

+An alternative algorithm is provided by the pcre_dfa_exec(), +pcre16_dfa_exec() and pcre32_dfa_exec() functions; they operate in +a different way, and are not Perl-compatible. This alternative has advantages +and disadvantages compared with the standard algorithm, and these are described +below. +

+

+When there is only one possible way in which a given subject string can match a +pattern, the two algorithms give the same answer. A difference arises, however, +when there are multiple possibilities. For example, if the pattern +

+  ^<.*>
+
+is matched against the string +
+  <something> <something else> <something further>
+
+there are three possible answers. The standard algorithm finds only one of +them, whereas the alternative algorithm finds all three. +

+
REGULAR EXPRESSIONS AS TREES
+

+The set of strings that are matched by a regular expression can be represented +as a tree structure. An unlimited repetition in the pattern makes the tree of +infinite size, but it is still a tree. Matching the pattern to a given subject +string (from a given starting point) can be thought of as a search of the tree. +There are two ways to search a tree: depth-first and breadth-first, and these +correspond to the two matching algorithms provided by PCRE. +

+
THE STANDARD MATCHING ALGORITHM
+

+In the terminology of Jeffrey Friedl's book "Mastering Regular +Expressions", the standard algorithm is an "NFA algorithm". It conducts a +depth-first search of the pattern tree. That is, it proceeds along a single +path through the tree, checking that the subject matches what is required. When +there is a mismatch, the algorithm tries any alternatives at the current point, +and if they all fail, it backs up to the previous branch point in the tree, and +tries the next alternative branch at that level. This often involves backing up +(moving to the left) in the subject string as well. The order in which +repetition branches are tried is controlled by the greedy or ungreedy nature of +the quantifier. +

+

+If a leaf node is reached, a matching string has been found, and at that point +the algorithm stops. Thus, if there is more than one possible match, this +algorithm returns the first one that it finds. Whether this is the shortest, +the longest, or some intermediate length depends on the way the greedy and +ungreedy repetition quantifiers are specified in the pattern. +

+

+Because it ends up with a single path through the tree, it is relatively +straightforward for this algorithm to keep track of the substrings that are +matched by portions of the pattern in parentheses. This provides support for +capturing parentheses and back references. +

+
THE ALTERNATIVE MATCHING ALGORITHM
+

+This algorithm conducts a breadth-first search of the tree. Starting from the +first matching point in the subject, it scans the subject string from left to +right, once, character by character, and as it does this, it remembers all the +paths through the tree that represent valid matches. In Friedl's terminology, +this is a kind of "DFA algorithm", though it is not implemented as a +traditional finite state machine (it keeps multiple states active +simultaneously). +

+

+Although the general principle of this matching algorithm is that it scans the +subject string only once, without backtracking, there is one exception: when a +lookaround assertion is encountered, the characters following or preceding the +current point have to be independently inspected. +

+

+The scan continues until either the end of the subject is reached, or there are +no more unterminated paths. At this point, terminated paths represent the +different matching possibilities (if there are none, the match has failed). +Thus, if there is more than one possible match, this algorithm finds all of +them, and in particular, it finds the longest. The matches are returned in +decreasing order of length. There is an option to stop the algorithm after the +first match (which is necessarily the shortest) is found. +

+

+Note that all the matches that are found start at the same point in the +subject. If the pattern +

+  cat(er(pillar)?)?
+
+is matched against the string "the caterpillar catchment", the result will be +the three strings "caterpillar", "cater", and "cat" that start at the fifth +character of the subject. The algorithm does not automatically move on to find +matches that start at later positions. +

+

+PCRE's "auto-possessification" optimization usually applies to character +repeats at the end of a pattern (as well as internally). For example, the +pattern "a\d+" is compiled as if it were "a\d++" because there is no point +even considering the possibility of backtracking into the repeated digits. For +DFA matching, this means that only one possible match is found. If you really +do want multiple matches in such cases, either use an ungreedy repeat +("a\d+?") or set the PCRE_NO_AUTO_POSSESS option when compiling. +

+

+There are a number of features of PCRE regular expressions that are not +supported by the alternative matching algorithm. They are as follows: +

+

+1. Because the algorithm finds all possible matches, the greedy or ungreedy +nature of repetition quantifiers is not relevant. Greedy and ungreedy +quantifiers are treated in exactly the same way. However, possessive +quantifiers can make a difference when what follows could also match what is +quantified, for example in a pattern like this: +

+  ^a++\w!
+
+This pattern matches "aaab!" but not "aaa!", which would be matched by a +non-possessive quantifier. Similarly, if an atomic group is present, it is +matched as if it were a standalone pattern at the current point, and the +longest match is then "locked in" for the rest of the overall pattern. +

+

+2. When dealing with multiple paths through the tree simultaneously, it is not +straightforward to keep track of captured substrings for the different matching +possibilities, and PCRE's implementation of this algorithm does not attempt to +do this. This means that no captured substrings are available. +

+

+3. Because no substrings are captured, back references within the pattern are +not supported, and cause errors if encountered. +

+

+4. For the same reason, conditional expressions that use a backreference as the +condition or test for a specific group recursion are not supported. +

+

+5. Because many paths through the tree may be active, the \K escape sequence, +which resets the start of the match when encountered (but may be on some paths +and not on others), is not supported. It causes an error if encountered. +

+

+6. Callouts are supported, but the value of the capture_top field is +always 1, and the value of the capture_last field is always -1. +

+

+7. The \C escape sequence, which (in the standard algorithm) always matches a +single data unit, even in UTF-8, UTF-16 or UTF-32 modes, is not supported in +these modes, because the alternative algorithm moves through the subject string +one character (not data unit) at a time, for all active paths through the tree. +

+

+8. Except for (*FAIL), the backtracking control verbs such as (*PRUNE) are not +supported. (*FAIL) is supported, and behaves like a failing negative assertion. +

+
ADVANTAGES OF THE ALTERNATIVE ALGORITHM
+

+Using the alternative matching algorithm provides the following advantages: +

+

+1. All possible matches (at a single point in the subject) are automatically +found, and in particular, the longest match is found. To find more than one +match using the standard algorithm, you have to do kludgy things with +callouts. +

+

+2. Because the alternative algorithm scans the subject string just once, and +never needs to backtrack (except for lookbehinds), it is possible to pass very +long subject strings to the matching function in several pieces, checking for +partial matching each time. Although it is possible to do multi-segment +matching using the standard algorithm by retaining partially matched +substrings, it is more complicated. The +pcrepartial +documentation gives details of partial matching and discusses multi-segment +matching. +

+
DISADVANTAGES OF THE ALTERNATIVE ALGORITHM
+

+The alternative algorithm suffers from a number of disadvantages: +

+

+1. It is substantially slower than the standard algorithm. This is partly +because it has to search for all possible matches, but is also because it is +less susceptible to optimization. +

+

+2. Capturing parentheses and back references are not supported. +

+

+3. Although atomic groups are supported, their use does not provide the +performance advantage that it does for the standard algorithm. +

+
AUTHOR
+

+Philip Hazel +
+University Computing Service +
+Cambridge CB2 3QH, England. +
+

+
REVISION
+

+Last updated: 12 November 2013 +
+Copyright © 1997-2012 University of Cambridge. +
+

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrepartial.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrepartial.html new file mode 100644 index 0000000000000000000000000000000000000000..4faeafcb68836a96a34c2e5d2727e000e901de5a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrepartial.html @@ -0,0 +1,509 @@ + + +pcrepartial specification + + +

pcrepartial man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+

+
PARTIAL MATCHING IN PCRE
+

+In normal use of PCRE, if the subject string that is passed to a matching +function matches as far as it goes, but is too short to match the entire +pattern, PCRE_ERROR_NOMATCH is returned. There are circumstances where it might +be helpful to distinguish this case from other cases in which there is no +match. +

+

+Consider, for example, an application where a human is required to type in data +for a field with specific formatting requirements. An example might be a date +in the form ddmmmyy, defined by this pattern: +

+  ^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$
+
+If the application sees the user's keystrokes one by one, and can check that +what has been typed so far is potentially valid, it is able to raise an error +as soon as a mistake is made, by beeping and not reflecting the character that +has been typed, for example. This immediate feedback is likely to be a better +user interface than a check that is delayed until the entire string has been +entered. Partial matching can also be useful when the subject string is very +long and is not all available at once. +

+

+PCRE supports partial matching by means of the PCRE_PARTIAL_SOFT and +PCRE_PARTIAL_HARD options, which can be set when calling any of the matching +functions. For backwards compatibility, PCRE_PARTIAL is a synonym for +PCRE_PARTIAL_SOFT. The essential difference between the two options is whether +or not a partial match is preferred to an alternative complete match, though +the details differ between the two types of matching function. If both options +are set, PCRE_PARTIAL_HARD takes precedence. +

+

+If you want to use partial matching with just-in-time optimized code, you must +call pcre_study(), pcre16_study() or pcre32_study() with one +or both of these options: +

+  PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE
+  PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE
+
+PCRE_STUDY_JIT_COMPILE should also be set if you are going to run non-partial +matches on the same pattern. If the appropriate JIT study mode has not been set +for a match, the interpretive matching code is used. +

+

+Setting a partial matching option disables two of PCRE's standard +optimizations. PCRE remembers the last literal data unit in a pattern, and +abandons matching immediately if it is not present in the subject string. This +optimization cannot be used for a subject string that might match only +partially. If the pattern was studied, PCRE knows the minimum length of a +matching string, and does not bother to run the matching function on shorter +strings. This optimization is also disabled for partial matching. +

+
PARTIAL MATCHING USING pcre_exec() OR pcre[16|32]_exec()
+

+A partial match occurs during a call to pcre_exec() or +pcre[16|32]_exec() when the end of the subject string is reached +successfully, but matching cannot continue because more characters are needed. +However, at least one character in the subject must have been inspected. This +character need not form part of the final matched string; lookbehind assertions +and the \K escape sequence provide ways of inspecting characters before the +start of a matched substring. The requirement for inspecting at least one +character exists because an empty string can always be matched; without such a +restriction there would always be a partial match of an empty string at the end +of the subject. +

+

+If there are at least two slots in the offsets vector when a partial match is +returned, the first slot is set to the offset of the earliest character that +was inspected. For convenience, the second offset points to the end of the +subject so that a substring can easily be identified. If there are at least +three slots in the offsets vector, the third slot is set to the offset of the +character where matching started. +

+

+For the majority of patterns, the contents of the first and third slots will be +the same. However, for patterns that contain lookbehind assertions, or begin +with \b or \B, characters before the one where matching started may have been +inspected while carrying out the match. For example, consider this pattern: +

+  /(?<=abc)123/
+
+This pattern matches "123", but only if it is preceded by "abc". If the subject +string is "xyzabc12", the first two offsets after a partial match are for the +substring "abc12", because all these characters were inspected. However, the +third offset is set to 6, because that is the offset where matching began. +

+

+What happens when a partial match is identified depends on which of the two +partial matching options are set. +

+
+PCRE_PARTIAL_SOFT WITH pcre_exec() OR pcre[16|32]_exec() +
+

+If PCRE_PARTIAL_SOFT is set when pcre_exec() or pcre[16|32]_exec() +identifies a partial match, the partial match is remembered, but matching +continues as normal, and other alternatives in the pattern are tried. If no +complete match can be found, PCRE_ERROR_PARTIAL is returned instead of +PCRE_ERROR_NOMATCH. +

+

+This option is "soft" because it prefers a complete match over a partial match. +All the various matching items in a pattern behave as if the subject string is +potentially complete. For example, \z, \Z, and $ match at the end of the +subject, as normal, and for \b and \B the end of the subject is treated as a +non-alphanumeric. +

+

+If there is more than one partial match, the first one that was found provides +the data that is returned. Consider this pattern: +

+  /123\w+X|dogY/
+
+If this is matched against the subject string "abc123dog", both +alternatives fail to match, but the end of the subject is reached during +matching, so PCRE_ERROR_PARTIAL is returned. The offsets are set to 3 and 9, +identifying "123dog" as the first partial match that was found. (In this +example, there are two partial matches, because "dog" on its own partially +matches the second alternative.) +

+
+PCRE_PARTIAL_HARD WITH pcre_exec() OR pcre[16|32]_exec() +
+

+If PCRE_PARTIAL_HARD is set for pcre_exec() or pcre[16|32]_exec(), +PCRE_ERROR_PARTIAL is returned as soon as a partial match is found, without +continuing to search for possible complete matches. This option is "hard" +because it prefers an earlier partial match over a later complete match. For +this reason, the assumption is made that the end of the supplied subject string +may not be the true end of the available data, and so, if \z, \Z, \b, \B, +or $ are encountered at the end of the subject, the result is +PCRE_ERROR_PARTIAL, provided that at least one character in the subject has +been inspected. +

+

+Setting PCRE_PARTIAL_HARD also affects the way UTF-8 and UTF-16 +subject strings are checked for validity. Normally, an invalid sequence +causes the error PCRE_ERROR_BADUTF8 or PCRE_ERROR_BADUTF16. However, in the +special case of a truncated character at the end of the subject, +PCRE_ERROR_SHORTUTF8 or PCRE_ERROR_SHORTUTF16 is returned when +PCRE_PARTIAL_HARD is set. +

+
+Comparing hard and soft partial matching +
+

+The difference between the two partial matching options can be illustrated by a +pattern such as: +

+  /dog(sbody)?/
+
+This matches either "dog" or "dogsbody", greedily (that is, it prefers the +longer string if possible). If it is matched against the string "dog" with +PCRE_PARTIAL_SOFT, it yields a complete match for "dog". However, if +PCRE_PARTIAL_HARD is set, the result is PCRE_ERROR_PARTIAL. On the other hand, +if the pattern is made ungreedy the result is different: +
+  /dog(sbody)??/
+
+In this case the result is always a complete match because that is found first, +and matching never continues after finding a complete match. It might be easier +to follow this explanation by thinking of the two patterns like this: +
+  /dog(sbody)?/    is the same as  /dogsbody|dog/
+  /dog(sbody)??/   is the same as  /dog|dogsbody/
+
+The second pattern will never match "dogsbody", because it will always find the +shorter match first. +

+
PARTIAL MATCHING USING pcre_dfa_exec() OR pcre[16|32]_dfa_exec()
+

+The DFA functions move along the subject string character by character, without +backtracking, searching for all possible matches simultaneously. If the end of +the subject is reached before the end of the pattern, there is the possibility +of a partial match, again provided that at least one character has been +inspected. +

+

+When PCRE_PARTIAL_SOFT is set, PCRE_ERROR_PARTIAL is returned only if there +have been no complete matches. Otherwise, the complete matches are returned. +However, if PCRE_PARTIAL_HARD is set, a partial match takes precedence over any +complete matches. The portion of the string that was inspected when the longest +partial match was found is set as the first matching string, provided there are +at least two slots in the offsets vector. +

+

+Because the DFA functions always search for all possible matches, and there is +no difference between greedy and ungreedy repetition, their behaviour is +different from the standard functions when PCRE_PARTIAL_HARD is set. Consider +the string "dog" matched against the ungreedy pattern shown above: +

+  /dog(sbody)??/
+
+Whereas the standard functions stop as soon as they find the complete match for +"dog", the DFA functions also find the partial match for "dogsbody", and so +return that when PCRE_PARTIAL_HARD is set. +

+
PARTIAL MATCHING AND WORD BOUNDARIES
+

+If a pattern ends with one of sequences \b or \B, which test for word +boundaries, partial matching with PCRE_PARTIAL_SOFT can give counter-intuitive +results. Consider this pattern: +

+  /\bcat\b/
+
+This matches "cat", provided there is a word boundary at either end. If the +subject string is "the cat", the comparison of the final "t" with a following +character cannot take place, so a partial match is found. However, normal +matching carries on, and \b matches at the end of the subject when the last +character is a letter, so a complete match is found. The result, therefore, is +not PCRE_ERROR_PARTIAL. Using PCRE_PARTIAL_HARD in this case does yield +PCRE_ERROR_PARTIAL, because then the partial match takes precedence. +

+
FORMERLY RESTRICTED PATTERNS
+

+For releases of PCRE prior to 8.00, because of the way certain internal +optimizations were implemented in the pcre_exec() function, the +PCRE_PARTIAL option (predecessor of PCRE_PARTIAL_SOFT) could not be used with +all patterns. From release 8.00 onwards, the restrictions no longer apply, and +partial matching with can be requested for any pattern. +

+

+Items that were formerly restricted were repeated single characters and +repeated metasequences. If PCRE_PARTIAL was set for a pattern that did not +conform to the restrictions, pcre_exec() returned the error code +PCRE_ERROR_BADPARTIAL (-13). This error code is no longer in use. The +PCRE_INFO_OKPARTIAL call to pcre_fullinfo() to find out if a compiled +pattern can be used for partial matching now always returns 1. +

+
EXAMPLE OF PARTIAL MATCHING USING PCRETEST
+

+If the escape sequence \P is present in a pcretest data line, the +PCRE_PARTIAL_SOFT option is used for the match. Here is a run of pcretest +that uses the date example quoted above: +

+    re> /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/
+  data> 25jun04\P
+   0: 25jun04
+   1: jun
+  data> 25dec3\P
+  Partial match: 23dec3
+  data> 3ju\P
+  Partial match: 3ju
+  data> 3juj\P
+  No match
+  data> j\P
+  No match
+
+The first data string is matched completely, so pcretest shows the +matched substrings. The remaining four strings do not match the complete +pattern, but the first two are partial matches. Similar output is obtained +if DFA matching is used. +

+

+If the escape sequence \P is present more than once in a pcretest data +line, the PCRE_PARTIAL_HARD option is set for the match. +

+
MULTI-SEGMENT MATCHING WITH pcre_dfa_exec() OR pcre[16|32]_dfa_exec()
+

+When a partial match has been found using a DFA matching function, it is +possible to continue the match by providing additional subject data and calling +the function again with the same compiled regular expression, this time setting +the PCRE_DFA_RESTART option. You must pass the same working space as before, +because this is where details of the previous partial match are stored. Here is +an example using pcretest, using the \R escape sequence to set the +PCRE_DFA_RESTART option (\D specifies the use of the DFA matching function): +

+    re> /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/
+  data> 23ja\P\D
+  Partial match: 23ja
+  data> n05\R\D
+   0: n05
+
+The first call has "23ja" as the subject, and requests partial matching; the +second call has "n05" as the subject for the continued (restarted) match. +Notice that when the match is complete, only the last part is shown; PCRE does +not retain the previously partially-matched string. It is up to the calling +program to do that if it needs to. +

+

+That means that, for an unanchored pattern, if a continued match fails, it is +not possible to try again at a new starting point. All this facility is capable +of doing is continuing with the previous match attempt. In the previous +example, if the second set of data is "ug23" the result is no match, even +though there would be a match for "aug23" if the entire string were given at +once. Depending on the application, this may or may not be what you want. +The only way to allow for starting again at the next character is to retain the +matched part of the subject and try a new complete match. +

+

+You can set the PCRE_PARTIAL_SOFT or PCRE_PARTIAL_HARD options with +PCRE_DFA_RESTART to continue partial matching over multiple segments. This +facility can be used to pass very long subject strings to the DFA matching +functions. +

+
MULTI-SEGMENT MATCHING WITH pcre_exec() OR pcre[16|32]_exec()
+

+From release 8.00, the standard matching functions can also be used to do +multi-segment matching. Unlike the DFA functions, it is not possible to +restart the previous match with a new segment of data. Instead, new data must +be added to the previous subject string, and the entire match re-run, starting +from the point where the partial match occurred. Earlier data can be discarded. +

+

+It is best to use PCRE_PARTIAL_HARD in this situation, because it does not +treat the end of a segment as the end of the subject when matching \z, \Z, +\b, \B, and $. Consider an unanchored pattern that matches dates: +

+    re> /\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d/
+  data> The date is 23ja\P\P
+  Partial match: 23ja
+
+At this stage, an application could discard the text preceding "23ja", add on +text from the next segment, and call the matching function again. Unlike the +DFA matching functions, the entire matching string must always be available, +and the complete matching process occurs for each call, so more memory and more +processing time is needed. +

+

+Note: If the pattern contains lookbehind assertions, or \K, or starts +with \b or \B, the string that is returned for a partial match includes +characters that precede the start of what would be returned for a complete +match, because it contains all the characters that were inspected during the +partial match. +

+
ISSUES WITH MULTI-SEGMENT MATCHING
+

+Certain types of pattern may give problems with multi-segment matching, +whichever matching function is used. +

+

+1. If the pattern contains a test for the beginning of a line, you need to pass +the PCRE_NOTBOL option when the subject string for any call does start at the +beginning of a line. There is also a PCRE_NOTEOL option, but in practice when +doing multi-segment matching you should be using PCRE_PARTIAL_HARD, which +includes the effect of PCRE_NOTEOL. +

+

+2. Lookbehind assertions that have already been obeyed are catered for in the +offsets that are returned for a partial match. However a lookbehind assertion +later in the pattern could require even earlier characters to be inspected. You +can handle this case by using the PCRE_INFO_MAXLOOKBEHIND option of the +pcre_fullinfo() or pcre[16|32]_fullinfo() functions to obtain the +length of the longest lookbehind in the pattern. This length is given in +characters, not bytes. If you always retain at least that many characters +before the partially matched string, all should be well. (Of course, near the +start of the subject, fewer characters may be present; in that case all +characters should be retained.) +

+

+From release 8.33, there is a more accurate way of deciding which characters to +retain. Instead of subtracting the length of the longest lookbehind from the +earliest inspected character (offsets[0]), the match start position +(offsets[2]) should be used, and the next match attempt started at the +offsets[2] character by setting the startoffset argument of +pcre_exec() or pcre_dfa_exec(). +

+

+For example, if the pattern "(?<=123)abc" is partially +matched against the string "xx123a", the three offset values returned are 2, 6, +and 5. This indicates that the matching process that gave a partial match +started at offset 5, but the characters "123a" were all inspected. The maximum +lookbehind for that pattern is 3, so taking that away from 5 shows that we need +only keep "123a", and the next match attempt can be started at offset 3 (that +is, at "a") when further characters have been added. When the match start is +not the earliest inspected character, pcretest shows it explicitly: +

+    re> "(?<=123)abc"
+  data> xx123a\P\P
+  Partial match at offset 5: 123a
+
+

+

+3. Because a partial match must always contain at least one character, what +might be considered a partial match of an empty string actually gives a "no +match" result. For example: +

+    re> /c(?<=abc)x/
+  data> ab\P
+  No match
+
+If the next segment begins "cx", a match should be found, but this will only +happen if characters from the previous segment are retained. For this reason, a +"no match" result should be interpreted as "partial match of an empty string" +when the pattern contains lookbehinds. +

+

+4. Matching a subject string that is split into multiple segments may not +always produce exactly the same result as matching over one single long string, +especially when PCRE_PARTIAL_SOFT is used. The section "Partial Matching and +Word Boundaries" above describes an issue that arises if the pattern ends with +\b or \B. Another kind of difference may occur when there are multiple +matching possibilities, because (for PCRE_PARTIAL_SOFT) a partial match result +is given only when there are no completed matches. This means that as soon as +the shortest match has been found, continuation to a new subject segment is no +longer possible. Consider again this pcretest example: +

+    re> /dog(sbody)?/
+  data> dogsb\P
+   0: dog
+  data> do\P\D
+  Partial match: do
+  data> gsb\R\P\D
+   0: g
+  data> dogsbody\D
+   0: dogsbody
+   1: dog
+
+The first data line passes the string "dogsb" to a standard matching function, +setting the PCRE_PARTIAL_SOFT option. Although the string is a partial match +for "dogsbody", the result is not PCRE_ERROR_PARTIAL, because the shorter +string "dog" is a complete match. Similarly, when the subject is presented to +a DFA matching function in several parts ("do" and "gsb" being the first two) +the match stops when "dog" has been found, and it is not possible to continue. +On the other hand, if "dogsbody" is presented as a single string, a DFA +matching function finds both matches. +

+

+Because of these problems, it is best to use PCRE_PARTIAL_HARD when matching +multi-segment data. The example above then behaves differently: +

+    re> /dog(sbody)?/
+  data> dogsb\P\P
+  Partial match: dogsb
+  data> do\P\D
+  Partial match: do
+  data> gsb\R\P\P\D
+  Partial match: gsb
+
+5. Patterns that contain alternatives at the top level which do not all start +with the same pattern item may not work as expected when PCRE_DFA_RESTART is +used. For example, consider this pattern: +
+  1234|3789
+
+If the first part of the subject is "ABC123", a partial match of the first +alternative is found at offset 3. There is no partial match for the second +alternative, because such a match does not start at the same point in the +subject string. Attempting to continue with the string "7890" does not yield a +match because only those alternatives that match at one point in the subject +are remembered. The problem arises because the start of the second alternative +matches within the first alternative. There is no problem with anchored +patterns or patterns such as: +
+  1234|ABCD
+
+where no string can be a partial match for both alternatives. This is not a +problem if a standard matching function is used, because the entire match has +to be rerun each time: +
+    re> /1234|3789/
+  data> ABC123\P\P
+  Partial match: 123
+  data> 1237890
+   0: 3789
+
+Of course, instead of using PCRE_DFA_RESTART, the same technique of re-running +the entire match can also be used with the DFA matching functions. Another +possibility is to work with two buffers. If a partial match at offset n +in the first buffer is followed by "no match" when PCRE_DFA_RESTART is used on +the second buffer, you can then try a new match starting at offset n+1 in +the first buffer. +

+
AUTHOR
+

+Philip Hazel +
+University Computing Service +
+Cambridge CB2 3QH, England. +
+

+
REVISION
+

+Last updated: 02 July 2013 +
+Copyright © 1997-2013 University of Cambridge. +
+

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrepattern.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrepattern.html new file mode 100644 index 0000000000000000000000000000000000000000..2e3e6263e494439ae1f3b242b983c5ace7028927 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrepattern.html @@ -0,0 +1,3276 @@ + + +pcrepattern specification + + +

pcrepattern man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+

+
PCRE REGULAR EXPRESSION DETAILS
+

+The syntax and semantics of the regular expressions that are supported by PCRE +are described in detail below. There is a quick-reference syntax summary in the +pcresyntax +page. PCRE tries to match Perl syntax and semantics as closely as it can. PCRE +also supports some alternative regular expression syntax (which does not +conflict with the Perl syntax) in order to provide some compatibility with +regular expressions in Python, .NET, and Oniguruma. +

+

+Perl's regular expressions are described in its own documentation, and +regular expressions in general are covered in a number of books, some of which +have copious examples. Jeffrey Friedl's "Mastering Regular Expressions", +published by O'Reilly, covers regular expressions in great detail. This +description of PCRE's regular expressions is intended as reference material. +

+

+This document discusses the patterns that are supported by PCRE when one its +main matching functions, pcre_exec() (8-bit) or pcre[16|32]_exec() +(16- or 32-bit), is used. PCRE also has alternative matching functions, +pcre_dfa_exec() and pcre[16|32_dfa_exec(), which match using a +different algorithm that is not Perl-compatible. Some of the features discussed +below are not available when DFA matching is used. The advantages and +disadvantages of the alternative functions, and how they differ from the normal +functions, are discussed in the +pcrematching +page. +

+
SPECIAL START-OF-PATTERN ITEMS
+

+A number of options that can be passed to pcre_compile() can also be set +by special items at the start of a pattern. These are not Perl-compatible, but +are provided to make these options accessible to pattern writers who are not +able to change the program that processes the pattern. Any number of these +items may appear, but they must all be together right at the start of the +pattern string, and the letters must be in upper case. +

+
+UTF support +
+

+The original operation of PCRE was on strings of one-byte characters. However, +there is now also support for UTF-8 strings in the original library, an +extra library that supports 16-bit and UTF-16 character strings, and a +third library that supports 32-bit and UTF-32 character strings. To use these +features, PCRE must be built to include appropriate support. When using UTF +strings you must either call the compiling function with the PCRE_UTF8, +PCRE_UTF16, or PCRE_UTF32 option, or the pattern must start with one of +these special sequences: +

+  (*UTF8)
+  (*UTF16)
+  (*UTF32)
+  (*UTF)
+
+(*UTF) is a generic sequence that can be used with any of the libraries. +Starting a pattern with such a sequence is equivalent to setting the relevant +option. How setting a UTF mode affects pattern matching is mentioned in several +places below. There is also a summary of features in the +pcreunicode +page. +

+

+Some applications that allow their users to supply patterns may wish to +restrict them to non-UTF data for security reasons. If the PCRE_NEVER_UTF +option is set at compile time, (*UTF) etc. are not allowed, and their +appearance causes an error. +

+
+Unicode property support +
+

+Another special sequence that may appear at the start of a pattern is (*UCP). +This has the same effect as setting the PCRE_UCP option: it causes sequences +such as \d and \w to use Unicode properties to determine character types, +instead of recognizing only characters with codes less than 128 via a lookup +table. +

+
+Disabling auto-possessification +
+

+If a pattern starts with (*NO_AUTO_POSSESS), it has the same effect as setting +the PCRE_NO_AUTO_POSSESS option at compile time. This stops PCRE from making +quantifiers possessive when what follows cannot match the repeated item. For +example, by default a+b is treated as a++b. For more details, see the +pcreapi +documentation. +

+
+Disabling start-up optimizations +
+

+If a pattern starts with (*NO_START_OPT), it has the same effect as setting the +PCRE_NO_START_OPTIMIZE option either at compile or matching time. This disables +several optimizations for quickly reaching "no match" results. For more +details, see the +pcreapi +documentation. +

+
+Newline conventions +
+

+PCRE supports five different conventions for indicating line breaks in +strings: a single CR (carriage return) character, a single LF (linefeed) +character, the two-character sequence CRLF, any of the three preceding, or any +Unicode newline sequence. The +pcreapi +page has +further discussion +about newlines, and shows how to set the newline convention in the +options arguments for the compiling and matching functions. +

+

+It is also possible to specify a newline convention by starting a pattern +string with one of the following five sequences: +

+  (*CR)        carriage return
+  (*LF)        linefeed
+  (*CRLF)      carriage return, followed by linefeed
+  (*ANYCRLF)   any of the three above
+  (*ANY)       all Unicode newline sequences
+
+These override the default and the options given to the compiling function. For +example, on a Unix system where LF is the default newline sequence, the pattern +
+  (*CR)a.b
+
+changes the convention to CR. That pattern matches "a\nb" because LF is no +longer a newline. If more than one of these settings is present, the last one +is used. +

+

+The newline convention affects where the circumflex and dollar assertions are +true. It also affects the interpretation of the dot metacharacter when +PCRE_DOTALL is not set, and the behaviour of \N. However, it does not affect +what the \R escape sequence matches. By default, this is any Unicode newline +sequence, for Perl compatibility. However, this can be changed; see the +description of \R in the section entitled +"Newline sequences" +below. A change of \R setting can be combined with a change of newline +convention. +

+
+Setting match and recursion limits +
+

+The caller of pcre_exec() can set a limit on the number of times the +internal match() function is called and on the maximum depth of +recursive calls. These facilities are provided to catch runaway matches that +are provoked by patterns with huge matching trees (a typical example is a +pattern with nested unlimited repeats) and to avoid running out of system stack +by too much recursion. When one of these limits is reached, pcre_exec() +gives an error return. The limits can also be set by items at the start of the +pattern of the form +

+  (*LIMIT_MATCH=d)
+  (*LIMIT_RECURSION=d)
+
+where d is any number of decimal digits. However, the value of the setting must +be less than the value set (or defaulted) by the caller of pcre_exec() +for it to have any effect. In other words, the pattern writer can lower the +limits set by the programmer, but not raise them. If there is more than one +setting of one of these limits, the lower value is used. +

+
EBCDIC CHARACTER CODES
+

+PCRE can be compiled to run in an environment that uses EBCDIC as its character +code rather than ASCII or Unicode (typically a mainframe system). In the +sections below, character code values are ASCII or Unicode; in an EBCDIC +environment these characters may have different code values, and there are no +code points greater than 255. +

+
CHARACTERS AND METACHARACTERS
+

+A regular expression is a pattern that is matched against a subject string from +left to right. Most characters stand for themselves in a pattern, and match the +corresponding characters in the subject. As a trivial example, the pattern +

+  The quick brown fox
+
+matches a portion of a subject string that is identical to itself. When +caseless matching is specified (the PCRE_CASELESS option), letters are matched +independently of case. In a UTF mode, PCRE always understands the concept of +case for characters whose values are less than 128, so caseless matching is +always possible. For characters with higher values, the concept of case is +supported if PCRE is compiled with Unicode property support, but not otherwise. +If you want to use caseless matching for characters 128 and above, you must +ensure that PCRE is compiled with Unicode property support as well as with +UTF support. +

+

+The power of regular expressions comes from the ability to include alternatives +and repetitions in the pattern. These are encoded in the pattern by the use of +metacharacters, which do not stand for themselves but instead are +interpreted in some special way. +

+

+There are two different sets of metacharacters: those that are recognized +anywhere in the pattern except within square brackets, and those that are +recognized within square brackets. Outside square brackets, the metacharacters +are as follows: +

+  \      general escape character with several uses
+  ^      assert start of string (or line, in multiline mode)
+  $      assert end of string (or line, in multiline mode)
+  .      match any character except newline (by default)
+  [      start character class definition
+  |      start of alternative branch
+  (      start subpattern
+  )      end subpattern
+  ?      extends the meaning of (
+         also 0 or 1 quantifier
+         also quantifier minimizer
+  *      0 or more quantifier
+  +      1 or more quantifier
+         also "possessive quantifier"
+  {      start min/max quantifier
+
+Part of a pattern that is in square brackets is called a "character class". In +a character class the only metacharacters are: +
+  \      general escape character
+  ^      negate the class, but only if the first character
+  -      indicates character range
+  [      POSIX character class (only if followed by POSIX syntax)
+  ]      terminates the character class
+
+The following sections describe the use of each of the metacharacters. +

+
BACKSLASH
+

+The backslash character has several uses. Firstly, if it is followed by a +character that is not a number or a letter, it takes away any special meaning +that character may have. This use of backslash as an escape character applies +both inside and outside character classes. +

+

+For example, if you want to match a * character, you write \* in the pattern. +This escaping action applies whether or not the following character would +otherwise be interpreted as a metacharacter, so it is always safe to precede a +non-alphanumeric with backslash to specify that it stands for itself. In +particular, if you want to match a backslash, you write \\. +

+

+In a UTF mode, only ASCII numbers and letters have any special meaning after a +backslash. All other characters (in particular, those whose codepoints are +greater than 127) are treated as literals. +

+

+If a pattern is compiled with the PCRE_EXTENDED option, most white space in the +pattern (other than in a character class), and characters between a # outside a +character class and the next newline, inclusive, are ignored. An escaping +backslash can be used to include a white space or # character as part of the +pattern. +

+

+If you want to remove the special meaning from a sequence of characters, you +can do so by putting them between \Q and \E. This is different from Perl in +that $ and @ are handled as literals in \Q...\E sequences in PCRE, whereas in +Perl, $ and @ cause variable interpolation. Note the following examples: +

+  Pattern            PCRE matches   Perl matches
+
+  \Qabc$xyz\E        abc$xyz        abc followed by the contents of $xyz
+  \Qabc\$xyz\E       abc\$xyz       abc\$xyz
+  \Qabc\E\$\Qxyz\E   abc$xyz        abc$xyz
+
+The \Q...\E sequence is recognized both inside and outside character classes. +An isolated \E that is not preceded by \Q is ignored. If \Q is not followed +by \E later in the pattern, the literal interpretation continues to the end of +the pattern (that is, \E is assumed at the end). If the isolated \Q is inside +a character class, this causes an error, because the character class is not +terminated. +

+
+Non-printing characters +
+

+A second use of backslash provides a way of encoding non-printing characters +in patterns in a visible manner. There is no restriction on the appearance of +non-printing characters, apart from the binary zero that terminates a pattern, +but when a pattern is being prepared by text editing, it is often easier to use +one of the following escape sequences than the binary character it represents. +In an ASCII or Unicode environment, these escapes are as follows: +

+  \a        alarm, that is, the BEL character (hex 07)
+  \cx       "control-x", where x is any ASCII character
+  \e        escape (hex 1B)
+  \f        form feed (hex 0C)
+  \n        linefeed (hex 0A)
+  \r        carriage return (hex 0D)
+  \t        tab (hex 09)
+  \0dd      character with octal code 0dd
+  \ddd      character with octal code ddd, or back reference
+  \o{ddd..} character with octal code ddd..
+  \xhh      character with hex code hh
+  \x{hhh..} character with hex code hhh.. (non-JavaScript mode)
+  \uhhhh    character with hex code hhhh (JavaScript mode only)
+
+The precise effect of \cx on ASCII characters is as follows: if x is a lower +case letter, it is converted to upper case. Then bit 6 of the character (hex +40) is inverted. Thus \cA to \cZ become hex 01 to hex 1A (A is 41, Z is 5A), +but \c{ becomes hex 3B ({ is 7B), and \c; becomes hex 7B (; is 3B). If the +data item (byte or 16-bit value) following \c has a value greater than 127, a +compile-time error occurs. This locks out non-ASCII characters in all modes. +

+

+When PCRE is compiled in EBCDIC mode, \a, \e, \f, \n, \r, and \t +generate the appropriate EBCDIC code values. The \c escape is processed +as specified for Perl in the perlebcdic document. The only characters +that are allowed after \c are A-Z, a-z, or one of @, [, \, ], ^, _, or ?. Any +other character provokes a compile-time error. The sequence \c@ encodes +character code 0; after \c the letters (in either case) encode characters 1-26 +(hex 01 to hex 1A); [, \, ], ^, and _ encode characters 27-31 (hex 1B to hex +1F), and \c? becomes either 255 (hex FF) or 95 (hex 5F). +

+

+Thus, apart from \c?, these escapes generate the same character code values as +they do in an ASCII environment, though the meanings of the values mostly +differ. For example, \cG always generates code value 7, which is BEL in ASCII +but DEL in EBCDIC. +

+

+The sequence \c? generates DEL (127, hex 7F) in an ASCII environment, but +because 127 is not a control character in EBCDIC, Perl makes it generate the +APC character. Unfortunately, there are several variants of EBCDIC. In most of +them the APC character has the value 255 (hex FF), but in the one Perl calls +POSIX-BC its value is 95 (hex 5F). If certain other characters have POSIX-BC +values, PCRE makes \c? generate 95; otherwise it generates 255. +

+

+After \0 up to two further octal digits are read. If there are fewer than two +digits, just those that are present are used. Thus the sequence \0\x\015 +specifies two binary zeros followed by a CR character (code value 13). Make +sure you supply two digits after the initial zero if the pattern character that +follows is itself an octal digit. +

+

+The escape \o must be followed by a sequence of octal digits, enclosed in +braces. An error occurs if this is not the case. This escape is a recent +addition to Perl; it provides way of specifying character code points as octal +numbers greater than 0777, and it also allows octal numbers and back references +to be unambiguously specified. +

+

+For greater clarity and unambiguity, it is best to avoid following \ by a +digit greater than zero. Instead, use \o{} or \x{} to specify character +numbers, and \g{} to specify back references. The following paragraphs +describe the old, ambiguous syntax. +

+

+The handling of a backslash followed by a digit other than 0 is complicated, +and Perl has changed in recent releases, causing PCRE also to change. Outside a +character class, PCRE reads the digit and any following digits as a decimal +number. If the number is less than 8, or if there have been at least that many +previous capturing left parentheses in the expression, the entire sequence is +taken as a back reference. A description of how this works is given +later, +following the discussion of +parenthesized subpatterns. +

+

+Inside a character class, or if the decimal number following \ is greater than +7 and there have not been that many capturing subpatterns, PCRE handles \8 and +\9 as the literal characters "8" and "9", and otherwise re-reads up to three +octal digits following the backslash, using them to generate a data character. +Any subsequent digits stand for themselves. For example: +

+  \040   is another way of writing an ASCII space
+  \40    is the same, provided there are fewer than 40 previous capturing subpatterns
+  \7     is always a back reference
+  \11    might be a back reference, or another way of writing a tab
+  \011   is always a tab
+  \0113  is a tab followed by the character "3"
+  \113   might be a back reference, otherwise the character with octal code 113
+  \377   might be a back reference, otherwise the value 255 (decimal)
+  \81    is either a back reference, or the two characters "8" and "1"
+
+Note that octal values of 100 or greater that are specified using this syntax +must not be introduced by a leading zero, because no more than three octal +digits are ever read. +

+

+By default, after \x that is not followed by {, from zero to two hexadecimal +digits are read (letters can be in upper or lower case). Any number of +hexadecimal digits may appear between \x{ and }. If a character other than +a hexadecimal digit appears between \x{ and }, or if there is no terminating +}, an error occurs. +

+

+If the PCRE_JAVASCRIPT_COMPAT option is set, the interpretation of \x is +as just described only when it is followed by two hexadecimal digits. +Otherwise, it matches a literal "x" character. In JavaScript mode, support for +code points greater than 256 is provided by \u, which must be followed by +four hexadecimal digits; otherwise it matches a literal "u" character. +

+

+Characters whose value is less than 256 can be defined by either of the two +syntaxes for \x (or by \u in JavaScript mode). There is no difference in the +way they are handled. For example, \xdc is exactly the same as \x{dc} (or +\u00dc in JavaScript mode). +

+
+Constraints on character values +
+

+Characters that are specified using octal or hexadecimal numbers are +limited to certain values, as follows: +

+  8-bit non-UTF mode    less than 0x100
+  8-bit UTF-8 mode      less than 0x10ffff and a valid codepoint
+  16-bit non-UTF mode   less than 0x10000
+  16-bit UTF-16 mode    less than 0x10ffff and a valid codepoint
+  32-bit non-UTF mode   less than 0x100000000
+  32-bit UTF-32 mode    less than 0x10ffff and a valid codepoint
+
+Invalid Unicode codepoints are the range 0xd800 to 0xdfff (the so-called +"surrogate" codepoints), and 0xffef. +

+
+Escape sequences in character classes +
+

+All the sequences that define a single character value can be used both inside +and outside character classes. In addition, inside a character class, \b is +interpreted as the backspace character (hex 08). +

+

+\N is not allowed in a character class. \B, \R, and \X are not special +inside a character class. Like other unrecognized escape sequences, they are +treated as the literal characters "B", "R", and "X" by default, but cause an +error if the PCRE_EXTRA option is set. Outside a character class, these +sequences have different meanings. +

+
+Unsupported escape sequences +
+

+In Perl, the sequences \l, \L, \u, and \U are recognized by its string +handler and used to modify the case of following characters. By default, PCRE +does not support these escape sequences. However, if the PCRE_JAVASCRIPT_COMPAT +option is set, \U matches a "U" character, and \u can be used to define a +character by code point, as described in the previous section. +

+
+Absolute and relative back references +
+

+The sequence \g followed by an unsigned or a negative number, optionally +enclosed in braces, is an absolute or relative back reference. A named back +reference can be coded as \g{name}. Back references are discussed +later, +following the discussion of +parenthesized subpatterns. +

+
+Absolute and relative subroutine calls +
+

+For compatibility with Oniguruma, the non-Perl syntax \g followed by a name or +a number enclosed either in angle brackets or single quotes, is an alternative +syntax for referencing a subpattern as a "subroutine". Details are discussed +later. +Note that \g{...} (Perl syntax) and \g<...> (Oniguruma syntax) are not +synonymous. The former is a back reference; the latter is a +subroutine +call. +

+
+Generic character types +
+

+Another use of backslash is for specifying generic character types: +

+  \d     any decimal digit
+  \D     any character that is not a decimal digit
+  \h     any horizontal white space character
+  \H     any character that is not a horizontal white space character
+  \s     any white space character
+  \S     any character that is not a white space character
+  \v     any vertical white space character
+  \V     any character that is not a vertical white space character
+  \w     any "word" character
+  \W     any "non-word" character
+
+There is also the single sequence \N, which matches a non-newline character. +This is the same as +the "." metacharacter +when PCRE_DOTALL is not set. Perl also uses \N to match characters by name; +PCRE does not support this. +

+

+Each pair of lower and upper case escape sequences partitions the complete set +of characters into two disjoint sets. Any given character matches one, and only +one, of each pair. The sequences can appear both inside and outside character +classes. They each match one character of the appropriate type. If the current +matching point is at the end of the subject string, all of them fail, because +there is no character to match. +

+

+For compatibility with Perl, \s did not used to match the VT character (code +11), which made it different from the the POSIX "space" class. However, Perl +added VT at release 5.18, and PCRE followed suit at release 8.34. The default +\s characters are now HT (9), LF (10), VT (11), FF (12), CR (13), and space +(32), which are defined as white space in the "C" locale. This list may vary if +locale-specific matching is taking place. For example, in some locales the +"non-breaking space" character (\xA0) is recognized as white space, and in +others the VT character is not. +

+

+A "word" character is an underscore or any character that is a letter or digit. +By default, the definition of letters and digits is controlled by PCRE's +low-valued character tables, and may vary if locale-specific matching is taking +place (see +"Locale support" +in the +pcreapi +page). For example, in a French locale such as "fr_FR" in Unix-like systems, +or "french" in Windows, some character codes greater than 127 are used for +accented letters, and these are then matched by \w. The use of locales with +Unicode is discouraged. +

+

+By default, characters whose code points are greater than 127 never match \d, +\s, or \w, and always match \D, \S, and \W, although this may vary for +characters in the range 128-255 when locale-specific matching is happening. +These escape sequences retain their original meanings from before Unicode +support was available, mainly for efficiency reasons. If PCRE is compiled with +Unicode property support, and the PCRE_UCP option is set, the behaviour is +changed so that Unicode properties are used to determine character types, as +follows: +

+  \d  any character that matches \p{Nd} (decimal digit)
+  \s  any character that matches \p{Z} or \h or \v
+  \w  any character that matches \p{L} or \p{N}, plus underscore
+
+The upper case escapes match the inverse sets of characters. Note that \d +matches only decimal digits, whereas \w matches any Unicode digit, as well as +any Unicode letter, and underscore. Note also that PCRE_UCP affects \b, and +\B because they are defined in terms of \w and \W. Matching these sequences +is noticeably slower when PCRE_UCP is set. +

+

+The sequences \h, \H, \v, and \V are features that were added to Perl at +release 5.10. In contrast to the other sequences, which match only ASCII +characters by default, these always match certain high-valued code points, +whether or not PCRE_UCP is set. The horizontal space characters are: +

+  U+0009     Horizontal tab (HT)
+  U+0020     Space
+  U+00A0     Non-break space
+  U+1680     Ogham space mark
+  U+180E     Mongolian vowel separator
+  U+2000     En quad
+  U+2001     Em quad
+  U+2002     En space
+  U+2003     Em space
+  U+2004     Three-per-em space
+  U+2005     Four-per-em space
+  U+2006     Six-per-em space
+  U+2007     Figure space
+  U+2008     Punctuation space
+  U+2009     Thin space
+  U+200A     Hair space
+  U+202F     Narrow no-break space
+  U+205F     Medium mathematical space
+  U+3000     Ideographic space
+
+The vertical space characters are: +
+  U+000A     Linefeed (LF)
+  U+000B     Vertical tab (VT)
+  U+000C     Form feed (FF)
+  U+000D     Carriage return (CR)
+  U+0085     Next line (NEL)
+  U+2028     Line separator
+  U+2029     Paragraph separator
+
+In 8-bit, non-UTF-8 mode, only the characters with codepoints less than 256 are +relevant. +

+
+Newline sequences +
+

+Outside a character class, by default, the escape sequence \R matches any +Unicode newline sequence. In 8-bit non-UTF-8 mode \R is equivalent to the +following: +

+  (?>\r\n|\n|\x0b|\f|\r|\x85)
+
+This is an example of an "atomic group", details of which are given +below. +This particular group matches either the two-character sequence CR followed by +LF, or one of the single characters LF (linefeed, U+000A), VT (vertical tab, +U+000B), FF (form feed, U+000C), CR (carriage return, U+000D), or NEL (next +line, U+0085). The two-character sequence is treated as a single unit that +cannot be split. +

+

+In other modes, two additional characters whose codepoints are greater than 255 +are added: LS (line separator, U+2028) and PS (paragraph separator, U+2029). +Unicode character property support is not needed for these characters to be +recognized. +

+

+It is possible to restrict \R to match only CR, LF, or CRLF (instead of the +complete set of Unicode line endings) by setting the option PCRE_BSR_ANYCRLF +either at compile time or when the pattern is matched. (BSR is an abbreviation +for "backslash R".) This can be made the default when PCRE is built; if this is +the case, the other behaviour can be requested via the PCRE_BSR_UNICODE option. +It is also possible to specify these settings by starting a pattern string with +one of the following sequences: +

+  (*BSR_ANYCRLF)   CR, LF, or CRLF only
+  (*BSR_UNICODE)   any Unicode newline sequence
+
+These override the default and the options given to the compiling function, but +they can themselves be overridden by options given to a matching function. Note +that these special settings, which are not Perl-compatible, are recognized only +at the very start of a pattern, and that they must be in upper case. If more +than one of them is present, the last one is used. They can be combined with a +change of newline convention; for example, a pattern can start with: +
+  (*ANY)(*BSR_ANYCRLF)
+
+They can also be combined with the (*UTF8), (*UTF16), (*UTF32), (*UTF) or +(*UCP) special sequences. Inside a character class, \R is treated as an +unrecognized escape sequence, and so matches the letter "R" by default, but +causes an error if PCRE_EXTRA is set. +

+
+Unicode character properties +
+

+When PCRE is built with Unicode character property support, three additional +escape sequences that match characters with specific properties are available. +When in 8-bit non-UTF-8 mode, these sequences are of course limited to testing +characters whose codepoints are less than 256, but they do work in this mode. +The extra escape sequences are: +

+  \p{xx}   a character with the xx property
+  \P{xx}   a character without the xx property
+  \X       a Unicode extended grapheme cluster
+
+The property names represented by xx above are limited to the Unicode +script names, the general category properties, "Any", which matches any +character (including newline), and some special PCRE properties (described +in the +next section). +Other Perl properties such as "InMusicalSymbols" are not currently supported by +PCRE. Note that \P{Any} does not match any characters, so always causes a +match failure. +

+

+Sets of Unicode characters are defined as belonging to certain scripts. A +character from one of these sets can be matched using a script name. For +example: +

+  \p{Greek}
+  \P{Han}
+
+Those that are not part of an identified script are lumped together as +"Common". The current list of scripts is: +

+

+Arabic, +Armenian, +Avestan, +Balinese, +Bamum, +Bassa_Vah, +Batak, +Bengali, +Bopomofo, +Brahmi, +Braille, +Buginese, +Buhid, +Canadian_Aboriginal, +Carian, +Caucasian_Albanian, +Chakma, +Cham, +Cherokee, +Common, +Coptic, +Cuneiform, +Cypriot, +Cyrillic, +Deseret, +Devanagari, +Duployan, +Egyptian_Hieroglyphs, +Elbasan, +Ethiopic, +Georgian, +Glagolitic, +Gothic, +Grantha, +Greek, +Gujarati, +Gurmukhi, +Han, +Hangul, +Hanunoo, +Hebrew, +Hiragana, +Imperial_Aramaic, +Inherited, +Inscriptional_Pahlavi, +Inscriptional_Parthian, +Javanese, +Kaithi, +Kannada, +Katakana, +Kayah_Li, +Kharoshthi, +Khmer, +Khojki, +Khudawadi, +Lao, +Latin, +Lepcha, +Limbu, +Linear_A, +Linear_B, +Lisu, +Lycian, +Lydian, +Mahajani, +Malayalam, +Mandaic, +Manichaean, +Meetei_Mayek, +Mende_Kikakui, +Meroitic_Cursive, +Meroitic_Hieroglyphs, +Miao, +Modi, +Mongolian, +Mro, +Myanmar, +Nabataean, +New_Tai_Lue, +Nko, +Ogham, +Ol_Chiki, +Old_Italic, +Old_North_Arabian, +Old_Permic, +Old_Persian, +Old_South_Arabian, +Old_Turkic, +Oriya, +Osmanya, +Pahawh_Hmong, +Palmyrene, +Pau_Cin_Hau, +Phags_Pa, +Phoenician, +Psalter_Pahlavi, +Rejang, +Runic, +Samaritan, +Saurashtra, +Sharada, +Shavian, +Siddham, +Sinhala, +Sora_Sompeng, +Sundanese, +Syloti_Nagri, +Syriac, +Tagalog, +Tagbanwa, +Tai_Le, +Tai_Tham, +Tai_Viet, +Takri, +Tamil, +Telugu, +Thaana, +Thai, +Tibetan, +Tifinagh, +Tirhuta, +Ugaritic, +Vai, +Warang_Citi, +Yi. +

+

+Each character has exactly one Unicode general category property, specified by +a two-letter abbreviation. For compatibility with Perl, negation can be +specified by including a circumflex between the opening brace and the property +name. For example, \p{^Lu} is the same as \P{Lu}. +

+

+If only one letter is specified with \p or \P, it includes all the general +category properties that start with that letter. In this case, in the absence +of negation, the curly brackets in the escape sequence are optional; these two +examples have the same effect: +

+  \p{L}
+  \pL
+
+The following general category property codes are supported: +
+  C     Other
+  Cc    Control
+  Cf    Format
+  Cn    Unassigned
+  Co    Private use
+  Cs    Surrogate
+
+  L     Letter
+  Ll    Lower case letter
+  Lm    Modifier letter
+  Lo    Other letter
+  Lt    Title case letter
+  Lu    Upper case letter
+
+  M     Mark
+  Mc    Spacing mark
+  Me    Enclosing mark
+  Mn    Non-spacing mark
+
+  N     Number
+  Nd    Decimal number
+  Nl    Letter number
+  No    Other number
+
+  P     Punctuation
+  Pc    Connector punctuation
+  Pd    Dash punctuation
+  Pe    Close punctuation
+  Pf    Final punctuation
+  Pi    Initial punctuation
+  Po    Other punctuation
+  Ps    Open punctuation
+
+  S     Symbol
+  Sc    Currency symbol
+  Sk    Modifier symbol
+  Sm    Mathematical symbol
+  So    Other symbol
+
+  Z     Separator
+  Zl    Line separator
+  Zp    Paragraph separator
+  Zs    Space separator
+
+The special property L& is also supported: it matches a character that has +the Lu, Ll, or Lt property, in other words, a letter that is not classified as +a modifier or "other". +

+

+The Cs (Surrogate) property applies only to characters in the range U+D800 to +U+DFFF. Such characters are not valid in Unicode strings and so +cannot be tested by PCRE, unless UTF validity checking has been turned off +(see the discussion of PCRE_NO_UTF8_CHECK, PCRE_NO_UTF16_CHECK and +PCRE_NO_UTF32_CHECK in the +pcreapi +page). Perl does not support the Cs property. +

+

+The long synonyms for property names that Perl supports (such as \p{Letter}) +are not supported by PCRE, nor is it permitted to prefix any of these +properties with "Is". +

+

+No character that is in the Unicode table has the Cn (unassigned) property. +Instead, this property is assumed for any code point that is not in the +Unicode table. +

+

+Specifying caseless matching does not affect these escape sequences. For +example, \p{Lu} always matches only upper case letters. This is different from +the behaviour of current versions of Perl. +

+

+Matching characters by Unicode property is not fast, because PCRE has to do a +multistage table lookup in order to find a character's property. That is why +the traditional escape sequences such as \d and \w do not use Unicode +properties in PCRE by default, though you can make them do so by setting the +PCRE_UCP option or by starting the pattern with (*UCP). +

+
+Extended grapheme clusters +
+

+The \X escape matches any number of Unicode characters that form an "extended +grapheme cluster", and treats the sequence as an atomic group +(see below). +Up to and including release 8.31, PCRE matched an earlier, simpler definition +that was equivalent to +

+  (?>\PM\pM*)
+
+That is, it matched a character without the "mark" property, followed by zero +or more characters with the "mark" property. Characters with the "mark" +property are typically non-spacing accents that affect the preceding character. +

+

+This simple definition was extended in Unicode to include more complicated +kinds of composite character by giving each character a grapheme breaking +property, and creating rules that use these properties to define the boundaries +of extended grapheme clusters. In releases of PCRE later than 8.31, \X matches +one of these clusters. +

+

+\X always matches at least one character. Then it decides whether to add +additional characters according to the following rules for ending a cluster: +

+

+1. End at the end of the subject string. +

+

+2. Do not end between CR and LF; otherwise end after any control character. +

+

+3. Do not break Hangul (a Korean script) syllable sequences. Hangul characters +are of five types: L, V, T, LV, and LVT. An L character may be followed by an +L, V, LV, or LVT character; an LV or V character may be followed by a V or T +character; an LVT or T character may be followed only by a T character. +

+

+4. Do not end before extending characters or spacing marks. Characters with +the "mark" property always have the "extend" grapheme breaking property. +

+

+5. Do not end after prepend characters. +

+

+6. Otherwise, end the cluster. +

+
+PCRE's additional properties +
+

+As well as the standard Unicode properties described above, PCRE supports four +more that make it possible to convert traditional escape sequences such as \w +and \s to use Unicode properties. PCRE uses these non-standard, non-Perl +properties internally when PCRE_UCP is set. However, they may also be used +explicitly. These properties are: +

+  Xan   Any alphanumeric character
+  Xps   Any POSIX space character
+  Xsp   Any Perl space character
+  Xwd   Any Perl "word" character
+
+Xan matches characters that have either the L (letter) or the N (number) +property. Xps matches the characters tab, linefeed, vertical tab, form feed, or +carriage return, and any other character that has the Z (separator) property. +Xsp is the same as Xps; it used to exclude vertical tab, for Perl +compatibility, but Perl changed, and so PCRE followed at release 8.34. Xwd +matches the same characters as Xan, plus underscore. +

+

+There is another non-standard property, Xuc, which matches any character that +can be represented by a Universal Character Name in C++ and other programming +languages. These are the characters $, @, ` (grave accent), and all characters +with Unicode code points greater than or equal to U+00A0, except for the +surrogates U+D800 to U+DFFF. Note that most base (ASCII) characters are +excluded. (Universal Character Names are of the form \uHHHH or \UHHHHHHHH +where H is a hexadecimal digit. Note that the Xuc property does not match these +sequences but the characters that they represent.) +

+
+Resetting the match start +
+

+The escape sequence \K causes any previously matched characters not to be +included in the final matched sequence. For example, the pattern: +

+  foo\Kbar
+
+matches "foobar", but reports that it has matched "bar". This feature is +similar to a lookbehind assertion +(described below). +However, in this case, the part of the subject before the real match does not +have to be of fixed length, as lookbehind assertions do. The use of \K does +not interfere with the setting of +captured substrings. +For example, when the pattern +
+  (foo)\Kbar
+
+matches "foobar", the first substring is still set to "foo". +

+

+Perl documents that the use of \K within assertions is "not well defined". In +PCRE, \K is acted upon when it occurs inside positive assertions, but is +ignored in negative assertions. Note that when a pattern such as (?=ab\K) +matches, the reported start of the match can be greater than the end of the +match. +

+
+Simple assertions +
+

+The final use of backslash is for certain simple assertions. An assertion +specifies a condition that has to be met at a particular point in a match, +without consuming any characters from the subject string. The use of +subpatterns for more complicated assertions is described +below. +The backslashed assertions are: +

+  \b     matches at a word boundary
+  \B     matches when not at a word boundary
+  \A     matches at the start of the subject
+  \Z     matches at the end of the subject
+          also matches before a newline at the end of the subject
+  \z     matches only at the end of the subject
+  \G     matches at the first matching position in the subject
+
+Inside a character class, \b has a different meaning; it matches the backspace +character. If any other of these assertions appears in a character class, by +default it matches the corresponding literal character (for example, \B +matches the letter B). However, if the PCRE_EXTRA option is set, an "invalid +escape sequence" error is generated instead. +

+

+A word boundary is a position in the subject string where the current character +and the previous character do not both match \w or \W (i.e. one matches +\w and the other matches \W), or the start or end of the string if the +first or last character matches \w, respectively. In a UTF mode, the meanings +of \w and \W can be changed by setting the PCRE_UCP option. When this is +done, it also affects \b and \B. Neither PCRE nor Perl has a separate "start +of word" or "end of word" metasequence. However, whatever follows \b normally +determines which it is. For example, the fragment \ba matches "a" at the start +of a word. +

+

+The \A, \Z, and \z assertions differ from the traditional circumflex and +dollar (described in the next section) in that they only ever match at the very +start and end of the subject string, whatever options are set. Thus, they are +independent of multiline mode. These three assertions are not affected by the +PCRE_NOTBOL or PCRE_NOTEOL options, which affect only the behaviour of the +circumflex and dollar metacharacters. However, if the startoffset +argument of pcre_exec() is non-zero, indicating that matching is to start +at a point other than the beginning of the subject, \A can never match. The +difference between \Z and \z is that \Z matches before a newline at the end +of the string as well as at the very end, whereas \z matches only at the end. +

+

+The \G assertion is true only when the current matching position is at the +start point of the match, as specified by the startoffset argument of +pcre_exec(). It differs from \A when the value of startoffset is +non-zero. By calling pcre_exec() multiple times with appropriate +arguments, you can mimic Perl's /g option, and it is in this kind of +implementation where \G can be useful. +

+

+Note, however, that PCRE's interpretation of \G, as the start of the current +match, is subtly different from Perl's, which defines it as the end of the +previous match. In Perl, these can be different when the previously matched +string was empty. Because PCRE does just one match at a time, it cannot +reproduce this behaviour. +

+

+If all the alternatives of a pattern begin with \G, the expression is anchored +to the starting match position, and the "anchored" flag is set in the compiled +regular expression. +

+
CIRCUMFLEX AND DOLLAR
+

+The circumflex and dollar metacharacters are zero-width assertions. That is, +they test for a particular condition being true without consuming any +characters from the subject string. +

+

+Outside a character class, in the default matching mode, the circumflex +character is an assertion that is true only if the current matching point is at +the start of the subject string. If the startoffset argument of +pcre_exec() is non-zero, circumflex can never match if the PCRE_MULTILINE +option is unset. Inside a character class, circumflex has an entirely different +meaning +(see below). +

+

+Circumflex need not be the first character of the pattern if a number of +alternatives are involved, but it should be the first thing in each alternative +in which it appears if the pattern is ever to match that branch. If all +possible alternatives start with a circumflex, that is, if the pattern is +constrained to match only at the start of the subject, it is said to be an +"anchored" pattern. (There are also other constructs that can cause a pattern +to be anchored.) +

+

+The dollar character is an assertion that is true only if the current matching +point is at the end of the subject string, or immediately before a newline at +the end of the string (by default). Note, however, that it does not actually +match the newline. Dollar need not be the last character of the pattern if a +number of alternatives are involved, but it should be the last item in any +branch in which it appears. Dollar has no special meaning in a character class. +

+

+The meaning of dollar can be changed so that it matches only at the very end of +the string, by setting the PCRE_DOLLAR_ENDONLY option at compile time. This +does not affect the \Z assertion. +

+

+The meanings of the circumflex and dollar characters are changed if the +PCRE_MULTILINE option is set. When this is the case, a circumflex matches +immediately after internal newlines as well as at the start of the subject +string. It does not match after a newline that ends the string. A dollar +matches before any newlines in the string, as well as at the very end, when +PCRE_MULTILINE is set. When newline is specified as the two-character +sequence CRLF, isolated CR and LF characters do not indicate newlines. +

+

+For example, the pattern /^abc$/ matches the subject string "def\nabc" (where +\n represents a newline) in multiline mode, but not otherwise. Consequently, +patterns that are anchored in single line mode because all branches start with +^ are not anchored in multiline mode, and a match for circumflex is possible +when the startoffset argument of pcre_exec() is non-zero. The +PCRE_DOLLAR_ENDONLY option is ignored if PCRE_MULTILINE is set. +

+

+Note that the sequences \A, \Z, and \z can be used to match the start and +end of the subject in both modes, and if all branches of a pattern start with +\A it is always anchored, whether or not PCRE_MULTILINE is set. +

+
FULL STOP (PERIOD, DOT) AND \N
+

+Outside a character class, a dot in the pattern matches any one character in +the subject string except (by default) a character that signifies the end of a +line. +

+

+When a line ending is defined as a single character, dot never matches that +character; when the two-character sequence CRLF is used, dot does not match CR +if it is immediately followed by LF, but otherwise it matches all characters +(including isolated CRs and LFs). When any Unicode line endings are being +recognized, dot does not match CR or LF or any of the other line ending +characters. +

+

+The behaviour of dot with regard to newlines can be changed. If the PCRE_DOTALL +option is set, a dot matches any one character, without exception. If the +two-character sequence CRLF is present in the subject string, it takes two dots +to match it. +

+

+The handling of dot is entirely independent of the handling of circumflex and +dollar, the only relationship being that they both involve newlines. Dot has no +special meaning in a character class. +

+

+The escape sequence \N behaves like a dot, except that it is not affected by +the PCRE_DOTALL option. In other words, it matches any character except one +that signifies the end of a line. Perl also uses \N to match characters by +name; PCRE does not support this. +

+
MATCHING A SINGLE DATA UNIT
+

+Outside a character class, the escape sequence \C matches any one data unit, +whether or not a UTF mode is set. In the 8-bit library, one data unit is one +byte; in the 16-bit library it is a 16-bit unit; in the 32-bit library it is +a 32-bit unit. Unlike a dot, \C always +matches line-ending characters. The feature is provided in Perl in order to +match individual bytes in UTF-8 mode, but it is unclear how it can usefully be +used. Because \C breaks up characters into individual data units, matching one +unit with \C in a UTF mode means that the rest of the string may start with a +malformed UTF character. This has undefined results, because PCRE assumes that +it is dealing with valid UTF strings (and by default it checks this at the +start of processing unless the PCRE_NO_UTF8_CHECK, PCRE_NO_UTF16_CHECK or +PCRE_NO_UTF32_CHECK option is used). +

+

+PCRE does not allow \C to appear in lookbehind assertions +(described below) +in a UTF mode, because this would make it impossible to calculate the length of +the lookbehind. +

+

+In general, the \C escape sequence is best avoided. However, one +way of using it that avoids the problem of malformed UTF characters is to use a +lookahead to check the length of the next character, as in this pattern, which +could be used with a UTF-8 string (ignore white space and line breaks): +

+  (?| (?=[\x00-\x7f])(\C) |
+      (?=[\x80-\x{7ff}])(\C)(\C) |
+      (?=[\x{800}-\x{ffff}])(\C)(\C)(\C) |
+      (?=[\x{10000}-\x{1fffff}])(\C)(\C)(\C)(\C))
+
+A group that starts with (?| resets the capturing parentheses numbers in each +alternative (see +"Duplicate Subpattern Numbers" +below). The assertions at the start of each branch check the next UTF-8 +character for values whose encoding uses 1, 2, 3, or 4 bytes, respectively. The +character's individual bytes are then captured by the appropriate number of +groups. +

+
SQUARE BRACKETS AND CHARACTER CLASSES
+

+An opening square bracket introduces a character class, terminated by a closing +square bracket. A closing square bracket on its own is not special by default. +However, if the PCRE_JAVASCRIPT_COMPAT option is set, a lone closing square +bracket causes a compile-time error. If a closing square bracket is required as +a member of the class, it should be the first data character in the class +(after an initial circumflex, if present) or escaped with a backslash. +

+

+A character class matches a single character in the subject. In a UTF mode, the +character may be more than one data unit long. A matched character must be in +the set of characters defined by the class, unless the first character in the +class definition is a circumflex, in which case the subject character must not +be in the set defined by the class. If a circumflex is actually required as a +member of the class, ensure it is not the first character, or escape it with a +backslash. +

+

+For example, the character class [aeiou] matches any lower case vowel, while +[^aeiou] matches any character that is not a lower case vowel. Note that a +circumflex is just a convenient notation for specifying the characters that +are in the class by enumerating those that are not. A class that starts with a +circumflex is not an assertion; it still consumes a character from the subject +string, and therefore it fails if the current pointer is at the end of the +string. +

+

+In UTF-8 (UTF-16, UTF-32) mode, characters with values greater than 255 (0xffff) +can be included in a class as a literal string of data units, or by using the +\x{ escaping mechanism. +

+

+When caseless matching is set, any letters in a class represent both their +upper case and lower case versions, so for example, a caseless [aeiou] matches +"A" as well as "a", and a caseless [^aeiou] does not match "A", whereas a +caseful version would. In a UTF mode, PCRE always understands the concept of +case for characters whose values are less than 128, so caseless matching is +always possible. For characters with higher values, the concept of case is +supported if PCRE is compiled with Unicode property support, but not otherwise. +If you want to use caseless matching in a UTF mode for characters 128 and +above, you must ensure that PCRE is compiled with Unicode property support as +well as with UTF support. +

+

+Characters that might indicate line breaks are never treated in any special way +when matching character classes, whatever line-ending sequence is in use, and +whatever setting of the PCRE_DOTALL and PCRE_MULTILINE options is used. A class +such as [^a] always matches one of these characters. +

+

+The minus (hyphen) character can be used to specify a range of characters in a +character class. For example, [d-m] matches any letter between d and m, +inclusive. If a minus character is required in a class, it must be escaped with +a backslash or appear in a position where it cannot be interpreted as +indicating a range, typically as the first or last character in the class, or +immediately after a range. For example, [b-d-z] matches letters in the range b +to d, a hyphen character, or z. +

+

+It is not possible to have the literal character "]" as the end character of a +range. A pattern such as [W-]46] is interpreted as a class of two characters +("W" and "-") followed by a literal string "46]", so it would match "W46]" or +"-46]". However, if the "]" is escaped with a backslash it is interpreted as +the end of range, so [W-\]46] is interpreted as a class containing a range +followed by two other characters. The octal or hexadecimal representation of +"]" can also be used to end a range. +

+

+An error is generated if a POSIX character class (see below) or an escape +sequence other than one that defines a single character appears at a point +where a range ending character is expected. For example, [z-\xff] is valid, +but [A-\d] and [A-[:digit:]] are not. +

+

+Ranges operate in the collating sequence of character values. They can also be +used for characters specified numerically, for example [\000-\037]. Ranges +can include any characters that are valid for the current mode. +

+

+If a range that includes letters is used when caseless matching is set, it +matches the letters in either case. For example, [W-c] is equivalent to +[][\\^_`wxyzabc], matched caselessly, and in a non-UTF mode, if character +tables for a French locale are in use, [\xc8-\xcb] matches accented E +characters in both cases. In UTF modes, PCRE supports the concept of case for +characters with values greater than 128 only when it is compiled with Unicode +property support. +

+

+The character escape sequences \d, \D, \h, \H, \p, \P, \s, \S, \v, +\V, \w, and \W may appear in a character class, and add the characters that +they match to the class. For example, [\dABCDEF] matches any hexadecimal +digit. In UTF modes, the PCRE_UCP option affects the meanings of \d, \s, \w +and their upper case partners, just as it does when they appear outside a +character class, as described in the section entitled +"Generic character types" +above. The escape sequence \b has a different meaning inside a character +class; it matches the backspace character. The sequences \B, \N, \R, and \X +are not special inside a character class. Like any other unrecognized escape +sequences, they are treated as the literal characters "B", "N", "R", and "X" by +default, but cause an error if the PCRE_EXTRA option is set. +

+

+A circumflex can conveniently be used with the upper case character types to +specify a more restricted set of characters than the matching lower case type. +For example, the class [^\W_] matches any letter or digit, but not underscore, +whereas [\w] includes underscore. A positive character class should be read as +"something OR something OR ..." and a negative class as "NOT something AND NOT +something AND NOT ...". +

+

+The only metacharacters that are recognized in character classes are backslash, +hyphen (only where it can be interpreted as specifying a range), circumflex +(only at the start), opening square bracket (only when it can be interpreted as +introducing a POSIX class name, or for a special compatibility feature - see +the next two sections), and the terminating closing square bracket. However, +escaping other non-alphanumeric characters does no harm. +

+
POSIX CHARACTER CLASSES
+

+Perl supports the POSIX notation for character classes. This uses names +enclosed by [: and :] within the enclosing square brackets. PCRE also supports +this notation. For example, +

+  [01[:alpha:]%]
+
+matches "0", "1", any alphabetic character, or "%". The supported class names +are: +
+  alnum    letters and digits
+  alpha    letters
+  ascii    character codes 0 - 127
+  blank    space or tab only
+  cntrl    control characters
+  digit    decimal digits (same as \d)
+  graph    printing characters, excluding space
+  lower    lower case letters
+  print    printing characters, including space
+  punct    printing characters, excluding letters and digits and space
+  space    white space (the same as \s from PCRE 8.34)
+  upper    upper case letters
+  word     "word" characters (same as \w)
+  xdigit   hexadecimal digits
+
+The default "space" characters are HT (9), LF (10), VT (11), FF (12), CR (13), +and space (32). If locale-specific matching is taking place, the list of space +characters may be different; there may be fewer or more of them. "Space" used +to be different to \s, which did not include VT, for Perl compatibility. +However, Perl changed at release 5.18, and PCRE followed at release 8.34. +"Space" and \s now match the same set of characters. +

+

+The name "word" is a Perl extension, and "blank" is a GNU extension from Perl +5.8. Another Perl extension is negation, which is indicated by a ^ character +after the colon. For example, +

+  [12[:^digit:]]
+
+matches "1", "2", or any non-digit. PCRE (and Perl) also recognize the POSIX +syntax [.ch.] and [=ch=] where "ch" is a "collating element", but these are not +supported, and an error is given if they are encountered. +

+

+By default, characters with values greater than 128 do not match any of the +POSIX character classes. However, if the PCRE_UCP option is passed to +pcre_compile(), some of the classes are changed so that Unicode character +properties are used. This is achieved by replacing certain POSIX classes by +other sequences, as follows: +

+  [:alnum:]  becomes  \p{Xan}
+  [:alpha:]  becomes  \p{L}
+  [:blank:]  becomes  \h
+  [:digit:]  becomes  \p{Nd}
+  [:lower:]  becomes  \p{Ll}
+  [:space:]  becomes  \p{Xps}
+  [:upper:]  becomes  \p{Lu}
+  [:word:]   becomes  \p{Xwd}
+
+Negated versions, such as [:^alpha:] use \P instead of \p. Three other POSIX +classes are handled specially in UCP mode: +

+

+[:graph:] +This matches characters that have glyphs that mark the page when printed. In +Unicode property terms, it matches all characters with the L, M, N, P, S, or Cf +properties, except for: +

+  U+061C           Arabic Letter Mark
+  U+180E           Mongolian Vowel Separator
+  U+2066 - U+2069  Various "isolate"s
+
+
+

+

+[:print:] +This matches the same characters as [:graph:] plus space characters that are +not controls, that is, characters with the Zs property. +

+

+[:punct:] +This matches all characters that have the Unicode P (punctuation) property, +plus those characters whose code points are less than 128 that have the S +(Symbol) property. +

+

+The other POSIX classes are unchanged, and match only characters with code +points less than 128. +

+
COMPATIBILITY FEATURE FOR WORD BOUNDARIES
+

+In the POSIX.2 compliant library that was included in 4.4BSD Unix, the ugly +syntax [[:<:]] and [[:>:]] is used for matching "start of word" and "end of +word". PCRE treats these items as follows: +

+  [[:<:]]  is converted to  \b(?=\w)
+  [[:>:]]  is converted to  \b(?<=\w)
+
+Only these exact character sequences are recognized. A sequence such as +[a[:<:]b] provokes error for an unrecognized POSIX class name. This support is +not compatible with Perl. It is provided to help migrations from other +environments, and is best not used in any new patterns. Note that \b matches +at the start and the end of a word (see +"Simple assertions" +above), and in a Perl-style pattern the preceding or following character +normally shows which is wanted, without the need for the assertions that are +used above in order to give exactly the POSIX behaviour. +

+
VERTICAL BAR
+

+Vertical bar characters are used to separate alternative patterns. For example, +the pattern +

+  gilbert|sullivan
+
+matches either "gilbert" or "sullivan". Any number of alternatives may appear, +and an empty alternative is permitted (matching the empty string). The matching +process tries each alternative in turn, from left to right, and the first one +that succeeds is used. If the alternatives are within a subpattern +(defined below), +"succeeds" means matching the rest of the main pattern as well as the +alternative in the subpattern. +

+
INTERNAL OPTION SETTING
+

+The settings of the PCRE_CASELESS, PCRE_MULTILINE, PCRE_DOTALL, and +PCRE_EXTENDED options (which are Perl-compatible) can be changed from within +the pattern by a sequence of Perl option letters enclosed between "(?" and ")". +The option letters are +

+  i  for PCRE_CASELESS
+  m  for PCRE_MULTILINE
+  s  for PCRE_DOTALL
+  x  for PCRE_EXTENDED
+
+For example, (?im) sets caseless, multiline matching. It is also possible to +unset these options by preceding the letter with a hyphen, and a combined +setting and unsetting such as (?im-sx), which sets PCRE_CASELESS and +PCRE_MULTILINE while unsetting PCRE_DOTALL and PCRE_EXTENDED, is also +permitted. If a letter appears both before and after the hyphen, the option is +unset. +

+

+The PCRE-specific options PCRE_DUPNAMES, PCRE_UNGREEDY, and PCRE_EXTRA can be +changed in the same way as the Perl-compatible options by using the characters +J, U and X respectively. +

+

+When one of these option changes occurs at top level (that is, not inside +subpattern parentheses), the change applies to the remainder of the pattern +that follows. An option change within a subpattern (see below for a description +of subpatterns) affects only that part of the subpattern that follows it, so +

+  (a(?i)b)c
+
+matches abc and aBc and no other strings (assuming PCRE_CASELESS is not used). +By this means, options can be made to have different settings in different +parts of the pattern. Any changes made in one alternative do carry on +into subsequent branches within the same subpattern. For example, +
+  (a(?i)b|c)
+
+matches "ab", "aB", "c", and "C", even though when matching "C" the first +branch is abandoned before the option setting. This is because the effects of +option settings happen at compile time. There would be some very weird +behaviour otherwise. +

+

+Note: There are other PCRE-specific options that can be set by the +application when the compiling or matching functions are called. In some cases +the pattern can contain special leading sequences such as (*CRLF) to override +what the application has set or what has been defaulted. Details are given in +the section entitled +"Newline sequences" +above. There are also the (*UTF8), (*UTF16),(*UTF32), and (*UCP) leading +sequences that can be used to set UTF and Unicode property modes; they are +equivalent to setting the PCRE_UTF8, PCRE_UTF16, PCRE_UTF32 and the PCRE_UCP +options, respectively. The (*UTF) sequence is a generic version that can be +used with any of the libraries. However, the application can set the +PCRE_NEVER_UTF option, which locks out the use of the (*UTF) sequences. +

+
SUBPATTERNS
+

+Subpatterns are delimited by parentheses (round brackets), which can be nested. +Turning part of a pattern into a subpattern does two things: +
+
+1. It localizes a set of alternatives. For example, the pattern +

+  cat(aract|erpillar|)
+
+matches "cataract", "caterpillar", or "cat". Without the parentheses, it would +match "cataract", "erpillar" or an empty string. +
+
+2. It sets up the subpattern as a capturing subpattern. This means that, when +the whole pattern matches, that portion of the subject string that matched the +subpattern is passed back to the caller via the ovector argument of the +matching function. (This applies only to the traditional matching functions; +the DFA matching functions do not support capturing.) +

+

+Opening parentheses are counted from left to right (starting from 1) to obtain +numbers for the capturing subpatterns. For example, if the string "the red +king" is matched against the pattern +

+  the ((red|white) (king|queen))
+
+the captured substrings are "red king", "red", and "king", and are numbered 1, +2, and 3, respectively. +

+

+The fact that plain parentheses fulfil two functions is not always helpful. +There are often times when a grouping subpattern is required without a +capturing requirement. If an opening parenthesis is followed by a question mark +and a colon, the subpattern does not do any capturing, and is not counted when +computing the number of any subsequent capturing subpatterns. For example, if +the string "the white queen" is matched against the pattern +

+  the ((?:red|white) (king|queen))
+
+the captured substrings are "white queen" and "queen", and are numbered 1 and +2. The maximum number of capturing subpatterns is 65535. +

+

+As a convenient shorthand, if any option settings are required at the start of +a non-capturing subpattern, the option letters may appear between the "?" and +the ":". Thus the two patterns +

+  (?i:saturday|sunday)
+  (?:(?i)saturday|sunday)
+
+match exactly the same set of strings. Because alternative branches are tried +from left to right, and options are not reset until the end of the subpattern +is reached, an option setting in one branch does affect subsequent branches, so +the above patterns match "SUNDAY" as well as "Saturday". +

+
DUPLICATE SUBPATTERN NUMBERS
+

+Perl 5.10 introduced a feature whereby each alternative in a subpattern uses +the same numbers for its capturing parentheses. Such a subpattern starts with +(?| and is itself a non-capturing subpattern. For example, consider this +pattern: +

+  (?|(Sat)ur|(Sun))day
+
+Because the two alternatives are inside a (?| group, both sets of capturing +parentheses are numbered one. Thus, when the pattern matches, you can look +at captured substring number one, whichever alternative matched. This construct +is useful when you want to capture part, but not all, of one of a number of +alternatives. Inside a (?| group, parentheses are numbered as usual, but the +number is reset at the start of each branch. The numbers of any capturing +parentheses that follow the subpattern start after the highest number used in +any branch. The following example is taken from the Perl documentation. The +numbers underneath show in which buffer the captured content will be stored. +
+  # before  ---------------branch-reset----------- after
+  / ( a )  (?| x ( y ) z | (p (q) r) | (t) u (v) ) ( z ) /x
+  # 1            2         2  3        2     3     4
+
+A back reference to a numbered subpattern uses the most recent value that is +set for that number by any subpattern. The following pattern matches "abcabc" +or "defdef": +
+  /(?|(abc)|(def))\1/
+
+In contrast, a subroutine call to a numbered subpattern always refers to the +first one in the pattern with the given number. The following pattern matches +"abcabc" or "defabc": +
+  /(?|(abc)|(def))(?1)/
+
+If a +condition test +for a subpattern's having matched refers to a non-unique number, the test is +true if any of the subpatterns of that number have matched. +

+

+An alternative approach to using this "branch reset" feature is to use +duplicate named subpatterns, as described in the next section. +

+
NAMED SUBPATTERNS
+

+Identifying capturing parentheses by number is simple, but it can be very hard +to keep track of the numbers in complicated regular expressions. Furthermore, +if an expression is modified, the numbers may change. To help with this +difficulty, PCRE supports the naming of subpatterns. This feature was not +added to Perl until release 5.10. Python had the feature earlier, and PCRE +introduced it at release 4.0, using the Python syntax. PCRE now supports both +the Perl and the Python syntax. Perl allows identically numbered subpatterns to +have different names, but PCRE does not. +

+

+In PCRE, a subpattern can be named in one of three ways: (?<name>...) or +(?'name'...) as in Perl, or (?P<name>...) as in Python. References to capturing +parentheses from other parts of the pattern, such as +back references, +recursion, +and +conditions, +can be made by name as well as by number. +

+

+Names consist of up to 32 alphanumeric characters and underscores, but must +start with a non-digit. Named capturing parentheses are still allocated numbers +as well as names, exactly as if the names were not present. The PCRE API +provides function calls for extracting the name-to-number translation table +from a compiled pattern. There is also a convenience function for extracting a +captured substring by name. +

+

+By default, a name must be unique within a pattern, but it is possible to relax +this constraint by setting the PCRE_DUPNAMES option at compile time. (Duplicate +names are also always permitted for subpatterns with the same number, set up as +described in the previous section.) Duplicate names can be useful for patterns +where only one instance of the named parentheses can match. Suppose you want to +match the name of a weekday, either as a 3-letter abbreviation or as the full +name, and in both cases you want to extract the abbreviation. This pattern +(ignoring the line breaks) does the job: +

+  (?<DN>Mon|Fri|Sun)(?:day)?|
+  (?<DN>Tue)(?:sday)?|
+  (?<DN>Wed)(?:nesday)?|
+  (?<DN>Thu)(?:rsday)?|
+  (?<DN>Sat)(?:urday)?
+
+There are five capturing substrings, but only one is ever set after a match. +(An alternative way of solving this problem is to use a "branch reset" +subpattern, as described in the previous section.) +

+

+The convenience function for extracting the data by name returns the substring +for the first (and in this example, the only) subpattern of that name that +matched. This saves searching to find which numbered subpattern it was. +

+

+If you make a back reference to a non-unique named subpattern from elsewhere in +the pattern, the subpatterns to which the name refers are checked in the order +in which they appear in the overall pattern. The first one that is set is used +for the reference. For example, this pattern matches both "foofoo" and +"barbar" but not "foobar" or "barfoo": +

+  (?:(?<n>foo)|(?<n>bar))\k<n>
+
+
+

+

+If you make a subroutine call to a non-unique named subpattern, the one that +corresponds to the first occurrence of the name is used. In the absence of +duplicate numbers (see the previous section) this is the one with the lowest +number. +

+

+If you use a named reference in a condition +test (see the +section about conditions +below), either to check whether a subpattern has matched, or to check for +recursion, all subpatterns with the same name are tested. If the condition is +true for any one of them, the overall condition is true. This is the same +behaviour as testing by number. For further details of the interfaces for +handling named subpatterns, see the +pcreapi +documentation. +

+

+Warning: You cannot use different names to distinguish between two +subpatterns with the same number because PCRE uses only the numbers when +matching. For this reason, an error is given at compile time if different names +are given to subpatterns with the same number. However, you can always give the +same name to subpatterns with the same number, even when PCRE_DUPNAMES is not +set. +

+
REPETITION
+

+Repetition is specified by quantifiers, which can follow any of the following +items: +

+  a literal data character
+  the dot metacharacter
+  the \C escape sequence
+  the \X escape sequence
+  the \R escape sequence
+  an escape such as \d or \pL that matches a single character
+  a character class
+  a back reference (see next section)
+  a parenthesized subpattern (including assertions)
+  a subroutine call to a subpattern (recursive or otherwise)
+
+The general repetition quantifier specifies a minimum and maximum number of +permitted matches, by giving the two numbers in curly brackets (braces), +separated by a comma. The numbers must be less than 65536, and the first must +be less than or equal to the second. For example: +
+  z{2,4}
+
+matches "zz", "zzz", or "zzzz". A closing brace on its own is not a special +character. If the second number is omitted, but the comma is present, there is +no upper limit; if the second number and the comma are both omitted, the +quantifier specifies an exact number of required matches. Thus +
+  [aeiou]{3,}
+
+matches at least 3 successive vowels, but may match many more, while +
+  \d{8}
+
+matches exactly 8 digits. An opening curly bracket that appears in a position +where a quantifier is not allowed, or one that does not match the syntax of a +quantifier, is taken as a literal character. For example, {,6} is not a +quantifier, but a literal string of four characters. +

+

+In UTF modes, quantifiers apply to characters rather than to individual data +units. Thus, for example, \x{100}{2} matches two characters, each of +which is represented by a two-byte sequence in a UTF-8 string. Similarly, +\X{3} matches three Unicode extended grapheme clusters, each of which may be +several data units long (and they may be of different lengths). +

+

+The quantifier {0} is permitted, causing the expression to behave as if the +previous item and the quantifier were not present. This may be useful for +subpatterns that are referenced as +subroutines +from elsewhere in the pattern (but see also the section entitled +"Defining subpatterns for use by reference only" +below). Items other than subpatterns that have a {0} quantifier are omitted +from the compiled pattern. +

+

+For convenience, the three most common quantifiers have single-character +abbreviations: +

+  *    is equivalent to {0,}
+  +    is equivalent to {1,}
+  ?    is equivalent to {0,1}
+
+It is possible to construct infinite loops by following a subpattern that can +match no characters with a quantifier that has no upper limit, for example: +
+  (a?)*
+
+Earlier versions of Perl and PCRE used to give an error at compile time for +such patterns. However, because there are cases where this can be useful, such +patterns are now accepted, but if any repetition of the subpattern does in fact +match no characters, the loop is forcibly broken. +

+

+By default, the quantifiers are "greedy", that is, they match as much as +possible (up to the maximum number of permitted times), without causing the +rest of the pattern to fail. The classic example of where this gives problems +is in trying to match comments in C programs. These appear between /* and */ +and within the comment, individual * and / characters may appear. An attempt to +match C comments by applying the pattern +

+  /\*.*\*/
+
+to the string +
+  /* first comment */  not comment  /* second comment */
+
+fails, because it matches the entire string owing to the greediness of the .* +item. +

+

+However, if a quantifier is followed by a question mark, it ceases to be +greedy, and instead matches the minimum number of times possible, so the +pattern +

+  /\*.*?\*/
+
+does the right thing with the C comments. The meaning of the various +quantifiers is not otherwise changed, just the preferred number of matches. +Do not confuse this use of question mark with its use as a quantifier in its +own right. Because it has two uses, it can sometimes appear doubled, as in +
+  \d??\d
+
+which matches one digit by preference, but can match two if that is the only +way the rest of the pattern matches. +

+

+If the PCRE_UNGREEDY option is set (an option that is not available in Perl), +the quantifiers are not greedy by default, but individual ones can be made +greedy by following them with a question mark. In other words, it inverts the +default behaviour. +

+

+When a parenthesized subpattern is quantified with a minimum repeat count that +is greater than 1 or with a limited maximum, more memory is required for the +compiled pattern, in proportion to the size of the minimum or maximum. +

+

+If a pattern starts with .* or .{0,} and the PCRE_DOTALL option (equivalent +to Perl's /s) is set, thus allowing the dot to match newlines, the pattern is +implicitly anchored, because whatever follows will be tried against every +character position in the subject string, so there is no point in retrying the +overall match at any position after the first. PCRE normally treats such a +pattern as though it were preceded by \A. +

+

+In cases where it is known that the subject string contains no newlines, it is +worth setting PCRE_DOTALL in order to obtain this optimization, or +alternatively using ^ to indicate anchoring explicitly. +

+

+However, there are some cases where the optimization cannot be used. When .* +is inside capturing parentheses that are the subject of a back reference +elsewhere in the pattern, a match at the start may fail where a later one +succeeds. Consider, for example: +

+  (.*)abc\1
+
+If the subject is "xyz123abc123" the match point is the fourth character. For +this reason, such a pattern is not implicitly anchored. +

+

+Another case where implicit anchoring is not applied is when the leading .* is +inside an atomic group. Once again, a match at the start may fail where a later +one succeeds. Consider this pattern: +

+  (?>.*?a)b
+
+It matches "ab" in the subject "aab". The use of the backtracking control verbs +(*PRUNE) and (*SKIP) also disable this optimization. +

+

+When a capturing subpattern is repeated, the value captured is the substring +that matched the final iteration. For example, after +

+  (tweedle[dume]{3}\s*)+
+
+has matched "tweedledum tweedledee" the value of the captured substring is +"tweedledee". However, if there are nested capturing subpatterns, the +corresponding captured values may have been set in previous iterations. For +example, after +
+  /(a|(b))+/
+
+matches "aba" the value of the second captured substring is "b". +

+
ATOMIC GROUPING AND POSSESSIVE QUANTIFIERS
+

+With both maximizing ("greedy") and minimizing ("ungreedy" or "lazy") +repetition, failure of what follows normally causes the repeated item to be +re-evaluated to see if a different number of repeats allows the rest of the +pattern to match. Sometimes it is useful to prevent this, either to change the +nature of the match, or to cause it fail earlier than it otherwise might, when +the author of the pattern knows there is no point in carrying on. +

+

+Consider, for example, the pattern \d+foo when applied to the subject line +

+  123456bar
+
+After matching all 6 digits and then failing to match "foo", the normal +action of the matcher is to try again with only 5 digits matching the \d+ +item, and then with 4, and so on, before ultimately failing. "Atomic grouping" +(a term taken from Jeffrey Friedl's book) provides the means for specifying +that once a subpattern has matched, it is not to be re-evaluated in this way. +

+

+If we use atomic grouping for the previous example, the matcher gives up +immediately on failing to match "foo" the first time. The notation is a kind of +special parenthesis, starting with (?> as in this example: +

+  (?>\d+)foo
+
+This kind of parenthesis "locks up" the part of the pattern it contains once +it has matched, and a failure further into the pattern is prevented from +backtracking into it. Backtracking past it to previous items, however, works as +normal. +

+

+An alternative description is that a subpattern of this type matches the string +of characters that an identical standalone pattern would match, if anchored at +the current point in the subject string. +

+

+Atomic grouping subpatterns are not capturing subpatterns. Simple cases such as +the above example can be thought of as a maximizing repeat that must swallow +everything it can. So, while both \d+ and \d+? are prepared to adjust the +number of digits they match in order to make the rest of the pattern match, +(?>\d+) can only match an entire sequence of digits. +

+

+Atomic groups in general can of course contain arbitrarily complicated +subpatterns, and can be nested. However, when the subpattern for an atomic +group is just a single repeated item, as in the example above, a simpler +notation, called a "possessive quantifier" can be used. This consists of an +additional + character following a quantifier. Using this notation, the +previous example can be rewritten as +

+  \d++foo
+
+Note that a possessive quantifier can be used with an entire group, for +example: +
+  (abc|xyz){2,3}+
+
+Possessive quantifiers are always greedy; the setting of the PCRE_UNGREEDY +option is ignored. They are a convenient notation for the simpler forms of +atomic group. However, there is no difference in the meaning of a possessive +quantifier and the equivalent atomic group, though there may be a performance +difference; possessive quantifiers should be slightly faster. +

+

+The possessive quantifier syntax is an extension to the Perl 5.8 syntax. +Jeffrey Friedl originated the idea (and the name) in the first edition of his +book. Mike McCloskey liked it, so implemented it when he built Sun's Java +package, and PCRE copied it from there. It ultimately found its way into Perl +at release 5.10. +

+

+PCRE has an optimization that automatically "possessifies" certain simple +pattern constructs. For example, the sequence A+B is treated as A++B because +there is no point in backtracking into a sequence of A's when B must follow. +

+

+When a pattern contains an unlimited repeat inside a subpattern that can itself +be repeated an unlimited number of times, the use of an atomic group is the +only way to avoid some failing matches taking a very long time indeed. The +pattern +

+  (\D+|<\d+>)*[!?]
+
+matches an unlimited number of substrings that either consist of non-digits, or +digits enclosed in <>, followed by either ! or ?. When it matches, it runs +quickly. However, if it is applied to +
+  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
+it takes a long time before reporting failure. This is because the string can +be divided between the internal \D+ repeat and the external * repeat in a +large number of ways, and all have to be tried. (The example uses [!?] rather +than a single character at the end, because both PCRE and Perl have an +optimization that allows for fast failure when a single character is used. They +remember the last single character that is required for a match, and fail early +if it is not present in the string.) If the pattern is changed so that it uses +an atomic group, like this: +
+  ((?>\D+)|<\d+>)*[!?]
+
+sequences of non-digits cannot be broken, and failure happens quickly. +

+
BACK REFERENCES
+

+Outside a character class, a backslash followed by a digit greater than 0 (and +possibly further digits) is a back reference to a capturing subpattern earlier +(that is, to its left) in the pattern, provided there have been that many +previous capturing left parentheses. +

+

+However, if the decimal number following the backslash is less than 10, it is +always taken as a back reference, and causes an error only if there are not +that many capturing left parentheses in the entire pattern. In other words, the +parentheses that are referenced need not be to the left of the reference for +numbers less than 10. A "forward back reference" of this type can make sense +when a repetition is involved and the subpattern to the right has participated +in an earlier iteration. +

+

+It is not possible to have a numerical "forward back reference" to a subpattern +whose number is 10 or more using this syntax because a sequence such as \50 is +interpreted as a character defined in octal. See the subsection entitled +"Non-printing characters" +above +for further details of the handling of digits following a backslash. There is +no such problem when named parentheses are used. A back reference to any +subpattern is possible using named parentheses (see below). +

+

+Another way of avoiding the ambiguity inherent in the use of digits following a +backslash is to use the \g escape sequence. This escape must be followed by an +unsigned number or a negative number, optionally enclosed in braces. These +examples are all identical: +

+  (ring), \1
+  (ring), \g1
+  (ring), \g{1}
+
+An unsigned number specifies an absolute reference without the ambiguity that +is present in the older syntax. It is also useful when literal digits follow +the reference. A negative number is a relative reference. Consider this +example: +
+  (abc(def)ghi)\g{-1}
+
+The sequence \g{-1} is a reference to the most recently started capturing +subpattern before \g, that is, is it equivalent to \2 in this example. +Similarly, \g{-2} would be equivalent to \1. The use of relative references +can be helpful in long patterns, and also in patterns that are created by +joining together fragments that contain references within themselves. +

+

+A back reference matches whatever actually matched the capturing subpattern in +the current subject string, rather than anything matching the subpattern +itself (see +"Subpatterns as subroutines" +below for a way of doing that). So the pattern +

+  (sens|respons)e and \1ibility
+
+matches "sense and sensibility" and "response and responsibility", but not +"sense and responsibility". If caseful matching is in force at the time of the +back reference, the case of letters is relevant. For example, +
+  ((?i)rah)\s+\1
+
+matches "rah rah" and "RAH RAH", but not "RAH rah", even though the original +capturing subpattern is matched caselessly. +

+

+There are several different ways of writing back references to named +subpatterns. The .NET syntax \k{name} and the Perl syntax \k<name> or +\k'name' are supported, as is the Python syntax (?P=name). Perl 5.10's unified +back reference syntax, in which \g can be used for both numeric and named +references, is also supported. We could rewrite the above example in any of +the following ways: +

+  (?<p1>(?i)rah)\s+\k<p1>
+  (?'p1'(?i)rah)\s+\k{p1}
+  (?P<p1>(?i)rah)\s+(?P=p1)
+  (?<p1>(?i)rah)\s+\g{p1}
+
+A subpattern that is referenced by name may appear in the pattern before or +after the reference. +

+

+There may be more than one back reference to the same subpattern. If a +subpattern has not actually been used in a particular match, any back +references to it always fail by default. For example, the pattern +

+  (a|(bc))\2
+
+always fails if it starts to match "a" rather than "bc". However, if the +PCRE_JAVASCRIPT_COMPAT option is set at compile time, a back reference to an +unset value matches an empty string. +

+

+Because there may be many capturing parentheses in a pattern, all digits +following a backslash are taken as part of a potential back reference number. +If the pattern continues with a digit character, some delimiter must be used to +terminate the back reference. If the PCRE_EXTENDED option is set, this can be +white space. Otherwise, the \g{ syntax or an empty comment (see +"Comments" +below) can be used. +

+
+Recursive back references +
+

+A back reference that occurs inside the parentheses to which it refers fails +when the subpattern is first used, so, for example, (a\1) never matches. +However, such references can be useful inside repeated subpatterns. For +example, the pattern +

+  (a|b\1)+
+
+matches any number of "a"s and also "aba", "ababbaa" etc. At each iteration of +the subpattern, the back reference matches the character string corresponding +to the previous iteration. In order for this to work, the pattern must be such +that the first iteration does not need to match the back reference. This can be +done using alternation, as in the example above, or by a quantifier with a +minimum of zero. +

+

+Back references of this type cause the group that they reference to be treated +as an +atomic group. +Once the whole group has been matched, a subsequent matching failure cannot +cause backtracking into the middle of the group. +

+
ASSERTIONS
+

+An assertion is a test on the characters following or preceding the current +matching point that does not actually consume any characters. The simple +assertions coded as \b, \B, \A, \G, \Z, \z, ^ and $ are described +above. +

+

+More complicated assertions are coded as subpatterns. There are two kinds: +those that look ahead of the current position in the subject string, and those +that look behind it. An assertion subpattern is matched in the normal way, +except that it does not cause the current matching position to be changed. +

+

+Assertion subpatterns are not capturing subpatterns. If such an assertion +contains capturing subpatterns within it, these are counted for the purposes of +numbering the capturing subpatterns in the whole pattern. However, substring +capturing is carried out only for positive assertions. (Perl sometimes, but not +always, does do capturing in negative assertions.) +

+

+WARNING: If a positive assertion containing one or more capturing subpatterns +succeeds, but failure to match later in the pattern causes backtracking over +this assertion, the captures within the assertion are reset only if no higher +numbered captures are already set. This is, unfortunately, a fundamental +limitation of the current implementation, and as PCRE1 is now in +maintenance-only status, it is unlikely ever to change. +

+

+For compatibility with Perl, assertion subpatterns may be repeated; though +it makes no sense to assert the same thing several times, the side effect of +capturing parentheses may occasionally be useful. In practice, there only three +cases: +
+
+(1) If the quantifier is {0}, the assertion is never obeyed during matching. +However, it may contain internal capturing parenthesized groups that are called +from elsewhere via the +subroutine mechanism. +
+
+(2) If quantifier is {0,n} where n is greater than zero, it is treated as if it +were {0,1}. At run time, the rest of the pattern match is tried with and +without the assertion, the order depending on the greediness of the quantifier. +
+
+(3) If the minimum repetition is greater than zero, the quantifier is ignored. +The assertion is obeyed just once when encountered during matching. +

+
+Lookahead assertions +
+

+Lookahead assertions start with (?= for positive assertions and (?! for +negative assertions. For example, +

+  \w+(?=;)
+
+matches a word followed by a semicolon, but does not include the semicolon in +the match, and +
+  foo(?!bar)
+
+matches any occurrence of "foo" that is not followed by "bar". Note that the +apparently similar pattern +
+  (?!foo)bar
+
+does not find an occurrence of "bar" that is preceded by something other than +"foo"; it finds any occurrence of "bar" whatsoever, because the assertion +(?!foo) is always true when the next three characters are "bar". A +lookbehind assertion is needed to achieve the other effect. +

+

+If you want to force a matching failure at some point in a pattern, the most +convenient way to do it is with (?!) because an empty string always matches, so +an assertion that requires there not to be an empty string must always fail. +The backtracking control verb (*FAIL) or (*F) is a synonym for (?!). +

+
+Lookbehind assertions +
+

+Lookbehind assertions start with (?<= for positive assertions and (?<! for +negative assertions. For example, +

+  (?<!foo)bar
+
+does find an occurrence of "bar" that is not preceded by "foo". The contents of +a lookbehind assertion are restricted such that all the strings it matches must +have a fixed length. However, if there are several top-level alternatives, they +do not all have to have the same fixed length. Thus +
+  (?<=bullock|donkey)
+
+is permitted, but +
+  (?<!dogs?|cats?)
+
+causes an error at compile time. Branches that match different length strings +are permitted only at the top level of a lookbehind assertion. This is an +extension compared with Perl, which requires all branches to match the same +length of string. An assertion such as +
+  (?<=ab(c|de))
+
+is not permitted, because its single top-level branch can match two different +lengths, but it is acceptable to PCRE if rewritten to use two top-level +branches: +
+  (?<=abc|abde)
+
+In some cases, the escape sequence \K +(see above) +can be used instead of a lookbehind assertion to get round the fixed-length +restriction. +

+

+The implementation of lookbehind assertions is, for each alternative, to +temporarily move the current position back by the fixed length and then try to +match. If there are insufficient characters before the current position, the +assertion fails. +

+

+In a UTF mode, PCRE does not allow the \C escape (which matches a single data +unit even in a UTF mode) to appear in lookbehind assertions, because it makes +it impossible to calculate the length of the lookbehind. The \X and \R +escapes, which can match different numbers of data units, are also not +permitted. +

+

+"Subroutine" +calls (see below) such as (?2) or (?&X) are permitted in lookbehinds, as long +as the subpattern matches a fixed-length string. +Recursion, +however, is not supported. +

+

+Possessive quantifiers can be used in conjunction with lookbehind assertions to +specify efficient matching of fixed-length strings at the end of subject +strings. Consider a simple pattern such as +

+  abcd$
+
+when applied to a long string that does not match. Because matching proceeds +from left to right, PCRE will look for each "a" in the subject and then see if +what follows matches the rest of the pattern. If the pattern is specified as +
+  ^.*abcd$
+
+the initial .* matches the entire string at first, but when this fails (because +there is no following "a"), it backtracks to match all but the last character, +then all but the last two characters, and so on. Once again the search for "a" +covers the entire string, from right to left, so we are no better off. However, +if the pattern is written as +
+  ^.*+(?<=abcd)
+
+there can be no backtracking for the .*+ item; it can match only the entire +string. The subsequent lookbehind assertion does a single test on the last four +characters. If it fails, the match fails immediately. For long strings, this +approach makes a significant difference to the processing time. +

+
+Using multiple assertions +
+

+Several assertions (of any sort) may occur in succession. For example, +

+  (?<=\d{3})(?<!999)foo
+
+matches "foo" preceded by three digits that are not "999". Notice that each of +the assertions is applied independently at the same point in the subject +string. First there is a check that the previous three characters are all +digits, and then there is a check that the same three characters are not "999". +This pattern does not match "foo" preceded by six characters, the first +of which are digits and the last three of which are not "999". For example, it +doesn't match "123abcfoo". A pattern to do that is +
+  (?<=\d{3}...)(?<!999)foo
+
+This time the first assertion looks at the preceding six characters, checking +that the first three are digits, and then the second assertion checks that the +preceding three characters are not "999". +

+

+Assertions can be nested in any combination. For example, +

+  (?<=(?<!foo)bar)baz
+
+matches an occurrence of "baz" that is preceded by "bar" which in turn is not +preceded by "foo", while +
+  (?<=\d{3}(?!999)...)foo
+
+is another pattern that matches "foo" preceded by three digits and any three +characters that are not "999". +

+
CONDITIONAL SUBPATTERNS
+

+It is possible to cause the matching process to obey a subpattern +conditionally or to choose between two alternative subpatterns, depending on +the result of an assertion, or whether a specific capturing subpattern has +already been matched. The two possible forms of conditional subpattern are: +

+  (?(condition)yes-pattern)
+  (?(condition)yes-pattern|no-pattern)
+
+If the condition is satisfied, the yes-pattern is used; otherwise the +no-pattern (if present) is used. If there are more than two alternatives in the +subpattern, a compile-time error occurs. Each of the two alternatives may +itself contain nested subpatterns of any form, including conditional +subpatterns; the restriction to two alternatives applies only at the level of +the condition. This pattern fragment is an example where the alternatives are +complex: +
+  (?(1) (A|B|C) | (D | (?(2)E|F) | E) )
+
+
+

+

+There are four kinds of condition: references to subpatterns, references to +recursion, a pseudo-condition called DEFINE, and assertions. +

+
+Checking for a used subpattern by number +
+

+If the text between the parentheses consists of a sequence of digits, the +condition is true if a capturing subpattern of that number has previously +matched. If there is more than one capturing subpattern with the same number +(see the earlier +section about duplicate subpattern numbers), +the condition is true if any of them have matched. An alternative notation is +to precede the digits with a plus or minus sign. In this case, the subpattern +number is relative rather than absolute. The most recently opened parentheses +can be referenced by (?(-1), the next most recent by (?(-2), and so on. Inside +loops it can also make sense to refer to subsequent groups. The next +parentheses to be opened can be referenced as (?(+1), and so on. (The value +zero in any of these forms is not used; it provokes a compile-time error.) +

+

+Consider the following pattern, which contains non-significant white space to +make it more readable (assume the PCRE_EXTENDED option) and to divide it into +three parts for ease of discussion: +

+  ( \( )?    [^()]+    (?(1) \) )
+
+The first part matches an optional opening parenthesis, and if that +character is present, sets it as the first captured substring. The second part +matches one or more characters that are not parentheses. The third part is a +conditional subpattern that tests whether or not the first set of parentheses +matched. If they did, that is, if subject started with an opening parenthesis, +the condition is true, and so the yes-pattern is executed and a closing +parenthesis is required. Otherwise, since no-pattern is not present, the +subpattern matches nothing. In other words, this pattern matches a sequence of +non-parentheses, optionally enclosed in parentheses. +

+

+If you were embedding this pattern in a larger one, you could use a relative +reference: +

+  ...other stuff... ( \( )?    [^()]+    (?(-1) \) ) ...
+
+This makes the fragment independent of the parentheses in the larger pattern. +

+
+Checking for a used subpattern by name +
+

+Perl uses the syntax (?(<name>)...) or (?('name')...) to test for a used +subpattern by name. For compatibility with earlier versions of PCRE, which had +this facility before Perl, the syntax (?(name)...) is also recognized. +

+

+Rewriting the above example to use a named subpattern gives this: +

+  (?<OPEN> \( )?    [^()]+    (?(<OPEN>) \) )
+
+If the name used in a condition of this kind is a duplicate, the test is +applied to all subpatterns of the same name, and is true if any one of them has +matched. +

+
+Checking for pattern recursion +
+

+If the condition is the string (R), and there is no subpattern with the name R, +the condition is true if a recursive call to the whole pattern or any +subpattern has been made. If digits or a name preceded by ampersand follow the +letter R, for example: +

+  (?(R3)...) or (?(R&name)...)
+
+the condition is true if the most recent recursion is into a subpattern whose +number or name is given. This condition does not check the entire recursion +stack. If the name used in a condition of this kind is a duplicate, the test is +applied to all subpatterns of the same name, and is true if any one of them is +the most recent recursion. +

+

+At "top level", all these recursion test conditions are false. +The syntax for recursive patterns +is described below. +

+
+Defining subpatterns for use by reference only +
+

+If the condition is the string (DEFINE), and there is no subpattern with the +name DEFINE, the condition is always false. In this case, there may be only one +alternative in the subpattern. It is always skipped if control reaches this +point in the pattern; the idea of DEFINE is that it can be used to define +subroutines that can be referenced from elsewhere. (The use of +subroutines +is described below.) For example, a pattern to match an IPv4 address such as +"192.168.23.245" could be written like this (ignore white space and line +breaks): +

+  (?(DEFINE) (?<byte> 2[0-4]\d | 25[0-5] | 1\d\d | [1-9]?\d) )
+  \b (?&byte) (\.(?&byte)){3} \b
+
+The first part of the pattern is a DEFINE group inside which a another group +named "byte" is defined. This matches an individual component of an IPv4 +address (a number less than 256). When matching takes place, this part of the +pattern is skipped because DEFINE acts like a false condition. The rest of the +pattern uses references to the named group to match the four dot-separated +components of an IPv4 address, insisting on a word boundary at each end. +

+
+Assertion conditions +
+

+If the condition is not in any of the above formats, it must be an assertion. +This may be a positive or negative lookahead or lookbehind assertion. Consider +this pattern, again containing non-significant white space, and with the two +alternatives on the second line: +

+  (?(?=[^a-z]*[a-z])
+  \d{2}-[a-z]{3}-\d{2}  |  \d{2}-\d{2}-\d{2} )
+
+The condition is a positive lookahead assertion that matches an optional +sequence of non-letters followed by a letter. In other words, it tests for the +presence of at least one letter in the subject. If a letter is found, the +subject is matched against the first alternative; otherwise it is matched +against the second. This pattern matches strings in one of the two forms +dd-aaa-dd or dd-dd-dd, where aaa are letters and dd are digits. +

+
COMMENTS
+

+There are two ways of including comments in patterns that are processed by +PCRE. In both cases, the start of the comment must not be in a character class, +nor in the middle of any other sequence of related characters such as (?: or a +subpattern name or number. The characters that make up a comment play no part +in the pattern matching. +

+

+The sequence (?# marks the start of a comment that continues up to the next +closing parenthesis. Nested parentheses are not permitted. If the PCRE_EXTENDED +option is set, an unescaped # character also introduces a comment, which in +this case continues to immediately after the next newline character or +character sequence in the pattern. Which characters are interpreted as newlines +is controlled by the options passed to a compiling function or by a special +sequence at the start of the pattern, as described in the section entitled +"Newline conventions" +above. Note that the end of this type of comment is a literal newline sequence +in the pattern; escape sequences that happen to represent a newline do not +count. For example, consider this pattern when PCRE_EXTENDED is set, and the +default newline convention is in force: +

+  abc #comment \n still comment
+
+On encountering the # character, pcre_compile() skips along, looking for +a newline in the pattern. The sequence \n is still literal at this stage, so +it does not terminate the comment. Only an actual character with the code value +0x0a (the default newline) does so. +

+
RECURSIVE PATTERNS
+

+Consider the problem of matching a string in parentheses, allowing for +unlimited nested parentheses. Without the use of recursion, the best that can +be done is to use a pattern that matches up to some fixed depth of nesting. It +is not possible to handle an arbitrary nesting depth. +

+

+For some time, Perl has provided a facility that allows regular expressions to +recurse (amongst other things). It does this by interpolating Perl code in the +expression at run time, and the code can refer to the expression itself. A Perl +pattern using code interpolation to solve the parentheses problem can be +created like this: +

+  $re = qr{\( (?: (?>[^()]+) | (?p{$re}) )* \)}x;
+
+The (?p{...}) item interpolates Perl code at run time, and in this case refers +recursively to the pattern in which it appears. +

+

+Obviously, PCRE cannot support the interpolation of Perl code. Instead, it +supports special syntax for recursion of the entire pattern, and also for +individual subpattern recursion. After its introduction in PCRE and Python, +this kind of recursion was subsequently introduced into Perl at release 5.10. +

+

+A special item that consists of (? followed by a number greater than zero and a +closing parenthesis is a recursive subroutine call of the subpattern of the +given number, provided that it occurs inside that subpattern. (If not, it is a +non-recursive subroutine +call, which is described in the next section.) The special item (?R) or (?0) is +a recursive call of the entire regular expression. +

+

+This PCRE pattern solves the nested parentheses problem (assume the +PCRE_EXTENDED option is set so that white space is ignored): +

+  \( ( [^()]++ | (?R) )* \)
+
+First it matches an opening parenthesis. Then it matches any number of +substrings which can either be a sequence of non-parentheses, or a recursive +match of the pattern itself (that is, a correctly parenthesized substring). +Finally there is a closing parenthesis. Note the use of a possessive quantifier +to avoid backtracking into sequences of non-parentheses. +

+

+If this were part of a larger pattern, you would not want to recurse the entire +pattern, so instead you could use this: +

+  ( \( ( [^()]++ | (?1) )* \) )
+
+We have put the pattern into parentheses, and caused the recursion to refer to +them instead of the whole pattern. +

+

+In a larger pattern, keeping track of parenthesis numbers can be tricky. This +is made easier by the use of relative references. Instead of (?1) in the +pattern above you can write (?-2) to refer to the second most recently opened +parentheses preceding the recursion. In other words, a negative number counts +capturing parentheses leftwards from the point at which it is encountered. +

+

+It is also possible to refer to subsequently opened parentheses, by writing +references such as (?+2). However, these cannot be recursive because the +reference is not inside the parentheses that are referenced. They are always +non-recursive subroutine +calls, as described in the next section. +

+

+An alternative approach is to use named parentheses instead. The Perl syntax +for this is (?&name); PCRE's earlier syntax (?P>name) is also supported. We +could rewrite the above example as follows: +

+  (?<pn> \( ( [^()]++ | (?&pn) )* \) )
+
+If there is more than one subpattern with the same name, the earliest one is +used. +

+

+This particular example pattern that we have been looking at contains nested +unlimited repeats, and so the use of a possessive quantifier for matching +strings of non-parentheses is important when applying the pattern to strings +that do not match. For example, when this pattern is applied to +

+  (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()
+
+it yields "no match" quickly. However, if a possessive quantifier is not used, +the match runs for a very long time indeed because there are so many different +ways the + and * repeats can carve up the subject, and all have to be tested +before failure can be reported. +

+

+At the end of a match, the values of capturing parentheses are those from +the outermost level. If you want to obtain intermediate values, a callout +function can be used (see below and the +pcrecallout +documentation). If the pattern above is matched against +

+  (ab(cd)ef)
+
+the value for the inner capturing parentheses (numbered 2) is "ef", which is +the last value taken on at the top level. If a capturing subpattern is not +matched at the top level, its final captured value is unset, even if it was +(temporarily) set at a deeper level during the matching process. +

+

+If there are more than 15 capturing parentheses in a pattern, PCRE has to +obtain extra memory to store data during a recursion, which it does by using +pcre_malloc, freeing it via pcre_free afterwards. If no memory can +be obtained, the match fails with the PCRE_ERROR_NOMEMORY error. +

+

+Do not confuse the (?R) item with the condition (R), which tests for recursion. +Consider this pattern, which matches text in angle brackets, allowing for +arbitrary nesting. Only digits are allowed in nested brackets (that is, when +recursing), whereas any characters are permitted at the outer level. +

+  < (?: (?(R) \d++  | [^<>]*+) | (?R)) * >
+
+In this pattern, (?(R) is the start of a conditional subpattern, with two +different alternatives for the recursive and non-recursive cases. The (?R) item +is the actual recursive call. +

+
+Differences in recursion processing between PCRE and Perl +
+

+Recursion processing in PCRE differs from Perl in two important ways. In PCRE +(like Python, but unlike Perl), a recursive subpattern call is always treated +as an atomic group. That is, once it has matched some of the subject string, it +is never re-entered, even if it contains untried alternatives and there is a +subsequent matching failure. This can be illustrated by the following pattern, +which purports to match a palindromic string that contains an odd number of +characters (for example, "a", "aba", "abcba", "abcdcba"): +

+  ^(.|(.)(?1)\2)$
+
+The idea is that it either matches a single character, or two identical +characters surrounding a sub-palindrome. In Perl, this pattern works; in PCRE +it does not if the pattern is longer than three characters. Consider the +subject string "abcba": +

+

+At the top level, the first character is matched, but as it is not at the end +of the string, the first alternative fails; the second alternative is taken +and the recursion kicks in. The recursive call to subpattern 1 successfully +matches the next character ("b"). (Note that the beginning and end of line +tests are not part of the recursion). +

+

+Back at the top level, the next character ("c") is compared with what +subpattern 2 matched, which was "a". This fails. Because the recursion is +treated as an atomic group, there are now no backtracking points, and so the +entire match fails. (Perl is able, at this point, to re-enter the recursion and +try the second alternative.) However, if the pattern is written with the +alternatives in the other order, things are different: +

+  ^((.)(?1)\2|.)$
+
+This time, the recursing alternative is tried first, and continues to recurse +until it runs out of characters, at which point the recursion fails. But this +time we do have another alternative to try at the higher level. That is the big +difference: in the previous case the remaining alternative is at a deeper +recursion level, which PCRE cannot use. +

+

+To change the pattern so that it matches all palindromic strings, not just +those with an odd number of characters, it is tempting to change the pattern to +this: +

+  ^((.)(?1)\2|.?)$
+
+Again, this works in Perl, but not in PCRE, and for the same reason. When a +deeper recursion has matched a single character, it cannot be entered again in +order to match an empty string. The solution is to separate the two cases, and +write out the odd and even cases as alternatives at the higher level: +
+  ^(?:((.)(?1)\2|)|((.)(?3)\4|.))
+
+If you want to match typical palindromic phrases, the pattern has to ignore all +non-word characters, which can be done like this: +
+  ^\W*+(?:((.)\W*+(?1)\W*+\2|)|((.)\W*+(?3)\W*+\4|\W*+.\W*+))\W*+$
+
+If run with the PCRE_CASELESS option, this pattern matches phrases such as "A +man, a plan, a canal: Panama!" and it works well in both PCRE and Perl. Note +the use of the possessive quantifier *+ to avoid backtracking into sequences of +non-word characters. Without this, PCRE takes a great deal longer (ten times or +more) to match typical phrases, and Perl takes so long that you think it has +gone into a loop. +

+

+WARNING: The palindrome-matching patterns above work only if the subject +string does not start with a palindrome that is shorter than the entire string. +For example, although "abcba" is correctly matched, if the subject is "ababa", +PCRE finds the palindrome "aba" at the start, then fails at top level because +the end of the string does not follow. Once again, it cannot jump back into the +recursion to try other alternatives, so the entire match fails. +

+

+The second way in which PCRE and Perl differ in their recursion processing is +in the handling of captured values. In Perl, when a subpattern is called +recursively or as a subpattern (see the next section), it has no access to any +values that were captured outside the recursion, whereas in PCRE these values +can be referenced. Consider this pattern: +

+  ^(.)(\1|a(?2))
+
+In PCRE, this pattern matches "bab". The first capturing parentheses match "b", +then in the second group, when the back reference \1 fails to match "b", the +second alternative matches "a" and then recurses. In the recursion, \1 does +now match "b" and so the whole match succeeds. In Perl, the pattern fails to +match because inside the recursive call \1 cannot access the externally set +value. +

+
SUBPATTERNS AS SUBROUTINES
+

+If the syntax for a recursive subpattern call (either by number or by +name) is used outside the parentheses to which it refers, it operates like a +subroutine in a programming language. The called subpattern may be defined +before or after the reference. A numbered reference can be absolute or +relative, as in these examples: +

+  (...(absolute)...)...(?2)...
+  (...(relative)...)...(?-1)...
+  (...(?+1)...(relative)...
+
+An earlier example pointed out that the pattern +
+  (sens|respons)e and \1ibility
+
+matches "sense and sensibility" and "response and responsibility", but not +"sense and responsibility". If instead the pattern +
+  (sens|respons)e and (?1)ibility
+
+is used, it does match "sense and responsibility" as well as the other two +strings. Another example is given in the discussion of DEFINE above. +

+

+All subroutine calls, whether recursive or not, are always treated as atomic +groups. That is, once a subroutine has matched some of the subject string, it +is never re-entered, even if it contains untried alternatives and there is a +subsequent matching failure. Any capturing parentheses that are set during the +subroutine call revert to their previous values afterwards. +

+

+Processing options such as case-independence are fixed when a subpattern is +defined, so if it is used as a subroutine, such options cannot be changed for +different calls. For example, consider this pattern: +

+  (abc)(?i:(?-1))
+
+It matches "abcabc". It does not match "abcABC" because the change of +processing option does not affect the called subpattern. +

+
ONIGURUMA SUBROUTINE SYNTAX
+

+For compatibility with Oniguruma, the non-Perl syntax \g followed by a name or +a number enclosed either in angle brackets or single quotes, is an alternative +syntax for referencing a subpattern as a subroutine, possibly recursively. Here +are two of the examples used above, rewritten using this syntax: +

+  (?<pn> \( ( (?>[^()]+) | \g<pn> )* \) )
+  (sens|respons)e and \g'1'ibility
+
+PCRE supports an extension to Oniguruma: if a number is preceded by a +plus or a minus sign it is taken as a relative reference. For example: +
+  (abc)(?i:\g<-1>)
+
+Note that \g{...} (Perl syntax) and \g<...> (Oniguruma syntax) are not +synonymous. The former is a back reference; the latter is a subroutine call. +

+
CALLOUTS
+

+Perl has a feature whereby using the sequence (?{...}) causes arbitrary Perl +code to be obeyed in the middle of matching a regular expression. This makes it +possible, amongst other things, to extract different substrings that match the +same pair of parentheses when there is a repetition. +

+

+PCRE provides a similar feature, but of course it cannot obey arbitrary Perl +code. The feature is called "callout". The caller of PCRE provides an external +function by putting its entry point in the global variable pcre_callout +(8-bit library) or pcre[16|32]_callout (16-bit or 32-bit library). +By default, this variable contains NULL, which disables all calling out. +

+

+Within a regular expression, (?C) indicates the points at which the external +function is to be called. If you want to identify different callout points, you +can put a number less than 256 after the letter C. The default value is zero. +For example, this pattern has two callout points: +

+  (?C1)abc(?C2)def
+
+If the PCRE_AUTO_CALLOUT flag is passed to a compiling function, callouts are +automatically installed before each item in the pattern. They are all numbered +255. If there is a conditional group in the pattern whose condition is an +assertion, an additional callout is inserted just before the condition. An +explicit callout may also be set at this position, as in this example: +
+  (?(?C9)(?=a)abc|def)
+
+Note that this applies only to assertion conditions, not to other types of +condition. +

+

+During matching, when PCRE reaches a callout point, the external function is +called. It is provided with the number of the callout, the position in the +pattern, and, optionally, one item of data originally supplied by the caller of +the matching function. The callout function may cause matching to proceed, to +backtrack, or to fail altogether. +

+

+By default, PCRE implements a number of optimizations at compile time and +matching time, and one side-effect is that sometimes callouts are skipped. If +you need all possible callouts to happen, you need to set options that disable +the relevant optimizations. More details, and a complete description of the +interface to the callout function, are given in the +pcrecallout +documentation. +

+
BACKTRACKING CONTROL
+

+Perl 5.10 introduced a number of "Special Backtracking Control Verbs", which +are still described in the Perl documentation as "experimental and subject to +change or removal in a future version of Perl". It goes on to say: "Their usage +in production code should be noted to avoid problems during upgrades." The same +remarks apply to the PCRE features described in this section. +

+

+The new verbs make use of what was previously invalid syntax: an opening +parenthesis followed by an asterisk. They are generally of the form +(*VERB) or (*VERB:NAME). Some may take either form, possibly behaving +differently depending on whether or not a name is present. A name is any +sequence of characters that does not include a closing parenthesis. The maximum +length of name is 255 in the 8-bit library and 65535 in the 16-bit and 32-bit +libraries. If the name is empty, that is, if the closing parenthesis +immediately follows the colon, the effect is as if the colon were not there. +Any number of these verbs may occur in a pattern. +

+

+Since these verbs are specifically related to backtracking, most of them can be +used only when the pattern is to be matched using one of the traditional +matching functions, because these use a backtracking algorithm. With the +exception of (*FAIL), which behaves like a failing negative assertion, the +backtracking control verbs cause an error if encountered by a DFA matching +function. +

+

+The behaviour of these verbs in +repeated groups, +assertions, +and in +subpatterns called as subroutines +(whether or not recursively) is documented below. +

+
+Optimizations that affect backtracking verbs +
+

+PCRE contains some optimizations that are used to speed up matching by running +some checks at the start of each match attempt. For example, it may know the +minimum length of matching subject, or that a particular character must be +present. When one of these optimizations bypasses the running of a match, any +included backtracking verbs will not, of course, be processed. You can suppress +the start-of-match optimizations by setting the PCRE_NO_START_OPTIMIZE option +when calling pcre_compile() or pcre_exec(), or by starting the +pattern with (*NO_START_OPT). There is more discussion of this option in the +section entitled +"Option bits for pcre_exec()" +in the +pcreapi +documentation. +

+

+Experiments with Perl suggest that it too has similar optimizations, sometimes +leading to anomalous results. +

+
+Verbs that act immediately +
+

+The following verbs act as soon as they are encountered. They may not be +followed by a name. +

+   (*ACCEPT)
+
+This verb causes the match to end successfully, skipping the remainder of the +pattern. However, when it is inside a subpattern that is called as a +subroutine, only that subpattern is ended successfully. Matching then continues +at the outer level. If (*ACCEPT) in triggered in a positive assertion, the +assertion succeeds; in a negative assertion, the assertion fails. +

+

+If (*ACCEPT) is inside capturing parentheses, the data so far is captured. For +example: +

+  A((?:A|B(*ACCEPT)|C)D)
+
+This matches "AB", "AAD", or "ACD"; when it matches "AB", "B" is captured by +the outer parentheses. +
+  (*FAIL) or (*F)
+
+This verb causes a matching failure, forcing backtracking to occur. It is +equivalent to (?!) but easier to read. The Perl documentation notes that it is +probably useful only when combined with (?{}) or (??{}). Those are, of course, +Perl features that are not present in PCRE. The nearest equivalent is the +callout feature, as for example in this pattern: +
+  a+(?C)(*FAIL)
+
+A match with the string "aaaa" always fails, but the callout is taken before +each backtrack happens (in this example, 10 times). +

+
+Recording which path was taken +
+

+There is one verb whose main purpose is to track how a match was arrived at, +though it also has a secondary use in conjunction with advancing the match +starting point (see (*SKIP) below). +

+  (*MARK:NAME) or (*:NAME)
+
+A name is always required with this verb. There may be as many instances of +(*MARK) as you like in a pattern, and their names do not have to be unique. +

+

+When a match succeeds, the name of the last-encountered (*MARK:NAME), +(*PRUNE:NAME), or (*THEN:NAME) on the matching path is passed back to the +caller as described in the section entitled +"Extra data for pcre_exec()" +in the +pcreapi +documentation. Here is an example of pcretest output, where the /K +modifier requests the retrieval and outputting of (*MARK) data: +

+    re> /X(*MARK:A)Y|X(*MARK:B)Z/K
+  data> XY
+   0: XY
+  MK: A
+  XZ
+   0: XZ
+  MK: B
+
+The (*MARK) name is tagged with "MK:" in this output, and in this example it +indicates which of the two alternatives matched. This is a more efficient way +of obtaining this information than putting each alternative in its own +capturing parentheses. +

+

+If a verb with a name is encountered in a positive assertion that is true, the +name is recorded and passed back if it is the last-encountered. This does not +happen for negative assertions or failing positive assertions. +

+

+After a partial match or a failed match, the last encountered name in the +entire match process is returned. For example: +

+    re> /X(*MARK:A)Y|X(*MARK:B)Z/K
+  data> XP
+  No match, mark = B
+
+Note that in this unanchored example the mark is retained from the match +attempt that started at the letter "X" in the subject. Subsequent match +attempts starting at "P" and then with an empty string do not get as far as the +(*MARK) item, but nevertheless do not reset it. +

+

+If you are interested in (*MARK) values after failed matches, you should +probably set the PCRE_NO_START_OPTIMIZE option +(see above) +to ensure that the match is always attempted. +

+
+Verbs that act after backtracking +
+

+The following verbs do nothing when they are encountered. Matching continues +with what follows, but if there is no subsequent match, causing a backtrack to +the verb, a failure is forced. That is, backtracking cannot pass to the left of +the verb. However, when one of these verbs appears inside an atomic group or an +assertion that is true, its effect is confined to that group, because once the +group has been matched, there is never any backtracking into it. In this +situation, backtracking can "jump back" to the left of the entire atomic group +or assertion. (Remember also, as stated above, that this localization also +applies in subroutine calls.) +

+

+These verbs differ in exactly what kind of failure occurs when backtracking +reaches them. The behaviour described below is what happens when the verb is +not in a subroutine or an assertion. Subsequent sections cover these special +cases. +

+  (*COMMIT)
+
+This verb, which may not be followed by a name, causes the whole match to fail +outright if there is a later matching failure that causes backtracking to reach +it. Even if the pattern is unanchored, no further attempts to find a match by +advancing the starting point take place. If (*COMMIT) is the only backtracking +verb that is encountered, once it has been passed pcre_exec() is +committed to finding a match at the current starting point, or not at all. For +example: +
+  a+(*COMMIT)b
+
+This matches "xxaab" but not "aacaab". It can be thought of as a kind of +dynamic anchor, or "I've started, so I must finish." The name of the most +recently passed (*MARK) in the path is passed back when (*COMMIT) forces a +match failure. +

+

+If there is more than one backtracking verb in a pattern, a different one that +follows (*COMMIT) may be triggered first, so merely passing (*COMMIT) during a +match does not always guarantee that a match must be at this starting point. +

+

+Note that (*COMMIT) at the start of a pattern is not the same as an anchor, +unless PCRE's start-of-match optimizations are turned off, as shown in this +output from pcretest: +

+    re> /(*COMMIT)abc/
+  data> xyzabc
+   0: abc
+  data> xyzabc\Y
+  No match
+
+For this pattern, PCRE knows that any match must start with "a", so the +optimization skips along the subject to "a" before applying the pattern to the +first set of data. The match attempt then succeeds. In the second set of data, +the escape sequence \Y is interpreted by the pcretest program. It causes +the PCRE_NO_START_OPTIMIZE option to be set when pcre_exec() is called. +This disables the optimization that skips along to the first character. The +pattern is now applied starting at "x", and so the (*COMMIT) causes the match +to fail without trying any other starting points. +
+  (*PRUNE) or (*PRUNE:NAME)
+
+This verb causes the match to fail at the current starting position in the +subject if there is a later matching failure that causes backtracking to reach +it. If the pattern is unanchored, the normal "bumpalong" advance to the next +starting character then happens. Backtracking can occur as usual to the left of +(*PRUNE), before it is reached, or when matching to the right of (*PRUNE), but +if there is no match to the right, backtracking cannot cross (*PRUNE). In +simple cases, the use of (*PRUNE) is just an alternative to an atomic group or +possessive quantifier, but there are some uses of (*PRUNE) that cannot be +expressed in any other way. In an anchored pattern (*PRUNE) has the same effect +as (*COMMIT). +

+

+The behaviour of (*PRUNE:NAME) is the not the same as (*MARK:NAME)(*PRUNE). +It is like (*MARK:NAME) in that the name is remembered for passing back to the +caller. However, (*SKIP:NAME) searches only for names set with (*MARK). +

+  (*SKIP)
+
+This verb, when given without a name, is like (*PRUNE), except that if the +pattern is unanchored, the "bumpalong" advance is not to the next character, +but to the position in the subject where (*SKIP) was encountered. (*SKIP) +signifies that whatever text was matched leading up to it cannot be part of a +successful match. Consider: +
+  a+(*SKIP)b
+
+If the subject is "aaaac...", after the first match attempt fails (starting at +the first character in the string), the starting point skips on to start the +next attempt at "c". Note that a possessive quantifier does not have the same +effect as this example; although it would suppress backtracking during the +first match attempt, the second attempt would start at the second character +instead of skipping on to "c". +
+  (*SKIP:NAME)
+
+When (*SKIP) has an associated name, its behaviour is modified. When it is +triggered, the previous path through the pattern is searched for the most +recent (*MARK) that has the same name. If one is found, the "bumpalong" advance +is to the subject position that corresponds to that (*MARK) instead of to where +(*SKIP) was encountered. If no (*MARK) with a matching name is found, the +(*SKIP) is ignored. +

+

+Note that (*SKIP:NAME) searches only for names set by (*MARK:NAME). It ignores +names that are set by (*PRUNE:NAME) or (*THEN:NAME). +

+  (*THEN) or (*THEN:NAME)
+
+This verb causes a skip to the next innermost alternative when backtracking +reaches it. That is, it cancels any further backtracking within the current +alternative. Its name comes from the observation that it can be used for a +pattern-based if-then-else block: +
+  ( COND1 (*THEN) FOO | COND2 (*THEN) BAR | COND3 (*THEN) BAZ ) ...
+
+If the COND1 pattern matches, FOO is tried (and possibly further items after +the end of the group if FOO succeeds); on failure, the matcher skips to the +second alternative and tries COND2, without backtracking into COND1. If that +succeeds and BAR fails, COND3 is tried. If subsequently BAZ fails, there are no +more alternatives, so there is a backtrack to whatever came before the entire +group. If (*THEN) is not inside an alternation, it acts like (*PRUNE). +

+

+The behaviour of (*THEN:NAME) is the not the same as (*MARK:NAME)(*THEN). +It is like (*MARK:NAME) in that the name is remembered for passing back to the +caller. However, (*SKIP:NAME) searches only for names set with (*MARK). +

+

+A subpattern that does not contain a | character is just a part of the +enclosing alternative; it is not a nested alternation with only one +alternative. The effect of (*THEN) extends beyond such a subpattern to the +enclosing alternative. Consider this pattern, where A, B, etc. are complex +pattern fragments that do not contain any | characters at this level: +

+  A (B(*THEN)C) | D
+
+If A and B are matched, but there is a failure in C, matching does not +backtrack into A; instead it moves to the next alternative, that is, D. +However, if the subpattern containing (*THEN) is given an alternative, it +behaves differently: +
+  A (B(*THEN)C | (*FAIL)) | D
+
+The effect of (*THEN) is now confined to the inner subpattern. After a failure +in C, matching moves to (*FAIL), which causes the whole subpattern to fail +because there are no more alternatives to try. In this case, matching does now +backtrack into A. +

+

+Note that a conditional subpattern is not considered as having two +alternatives, because only one is ever used. In other words, the | character in +a conditional subpattern has a different meaning. Ignoring white space, +consider: +

+  ^.*? (?(?=a) a | b(*THEN)c )
+
+If the subject is "ba", this pattern does not match. Because .*? is ungreedy, +it initially matches zero characters. The condition (?=a) then fails, the +character "b" is matched, but "c" is not. At this point, matching does not +backtrack to .*? as might perhaps be expected from the presence of the | +character. The conditional subpattern is part of the single alternative that +comprises the whole pattern, and so the match fails. (If there was a backtrack +into .*?, allowing it to match "b", the match would succeed.) +

+

+The verbs just described provide four different "strengths" of control when +subsequent matching fails. (*THEN) is the weakest, carrying on the match at the +next alternative. (*PRUNE) comes next, failing the match at the current +starting position, but allowing an advance to the next character (for an +unanchored pattern). (*SKIP) is similar, except that the advance may be more +than one character. (*COMMIT) is the strongest, causing the entire match to +fail. +

+
+More than one backtracking verb +
+

+If more than one backtracking verb is present in a pattern, the one that is +backtracked onto first acts. For example, consider this pattern, where A, B, +etc. are complex pattern fragments: +

+  (A(*COMMIT)B(*THEN)C|ABD)
+
+If A matches but B fails, the backtrack to (*COMMIT) causes the entire match to +fail. However, if A and B match, but C fails, the backtrack to (*THEN) causes +the next alternative (ABD) to be tried. This behaviour is consistent, but is +not always the same as Perl's. It means that if two or more backtracking verbs +appear in succession, all the the last of them has no effect. Consider this +example: +
+  ...(*COMMIT)(*PRUNE)...
+
+If there is a matching failure to the right, backtracking onto (*PRUNE) causes +it to be triggered, and its action is taken. There can never be a backtrack +onto (*COMMIT). +

+
+Backtracking verbs in repeated groups +
+

+PCRE differs from Perl in its handling of backtracking verbs in repeated +groups. For example, consider: +

+  /(a(*COMMIT)b)+ac/
+
+If the subject is "abac", Perl matches, but PCRE fails because the (*COMMIT) in +the second repeat of the group acts. +

+
+Backtracking verbs in assertions +
+

+(*FAIL) in an assertion has its normal effect: it forces an immediate backtrack. +

+

+(*ACCEPT) in a positive assertion causes the assertion to succeed without any +further processing. In a negative assertion, (*ACCEPT) causes the assertion to +fail without any further processing. +

+

+The other backtracking verbs are not treated specially if they appear in a +positive assertion. In particular, (*THEN) skips to the next alternative in the +innermost enclosing group that has alternations, whether or not this is within +the assertion. +

+

+Negative assertions are, however, different, in order to ensure that changing a +positive assertion into a negative assertion changes its result. Backtracking +into (*COMMIT), (*SKIP), or (*PRUNE) causes a negative assertion to be true, +without considering any further alternative branches in the assertion. +Backtracking into (*THEN) causes it to skip to the next enclosing alternative +within the assertion (the normal behaviour), but if the assertion does not have +such an alternative, (*THEN) behaves like (*PRUNE). +

+
+Backtracking verbs in subroutines +
+

+These behaviours occur whether or not the subpattern is called recursively. +Perl's treatment of subroutines is different in some cases. +

+

+(*FAIL) in a subpattern called as a subroutine has its normal effect: it forces +an immediate backtrack. +

+

+(*ACCEPT) in a subpattern called as a subroutine causes the subroutine match to +succeed without any further processing. Matching then continues after the +subroutine call. +

+

+(*COMMIT), (*SKIP), and (*PRUNE) in a subpattern called as a subroutine cause +the subroutine match to fail. +

+

+(*THEN) skips to the next alternative in the innermost enclosing group within +the subpattern that has alternatives. If there is no such group within the +subpattern, (*THEN) causes the subroutine match to fail. +

+
SEE ALSO
+

+pcreapi(3), pcrecallout(3), pcrematching(3), +pcresyntax(3), pcre(3), pcre16(3), pcre32(3). +

+
AUTHOR
+

+Philip Hazel +
+University Computing Service +
+Cambridge CB2 3QH, England. +
+

+
REVISION
+

+Last updated: 23 October 2016 +
+Copyright © 1997-2016 University of Cambridge. +
+

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcreperform.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcreperform.html new file mode 100644 index 0000000000000000000000000000000000000000..dda207f90180b3183ed26245ff54b410e184a1b6 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcreperform.html @@ -0,0 +1,195 @@ + + +pcreperform specification + + +

pcreperform man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+PCRE PERFORMANCE +
+

+Two aspects of performance are discussed below: memory usage and processing +time. The way you express your pattern as a regular expression can affect both +of them. +

+
+COMPILED PATTERN MEMORY USAGE +
+

+Patterns are compiled by PCRE into a reasonably efficient interpretive code, so +that most simple patterns do not use much memory. However, there is one case +where the memory usage of a compiled pattern can be unexpectedly large. If a +parenthesized subpattern has a quantifier with a minimum greater than 1 and/or +a limited maximum, the whole subpattern is repeated in the compiled code. For +example, the pattern +

+  (abc|def){2,4}
+
+is compiled as if it were +
+  (abc|def)(abc|def)((abc|def)(abc|def)?)?
+
+(Technical aside: It is done this way so that backtrack points within each of +the repetitions can be independently maintained.) +

+

+For regular expressions whose quantifiers use only small numbers, this is not +usually a problem. However, if the numbers are large, and particularly if such +repetitions are nested, the memory usage can become an embarrassment. For +example, the very simple pattern +

+  ((ab){1,1000}c){1,3}
+
+uses 51K bytes when compiled using the 8-bit library. When PCRE is compiled +with its default internal pointer size of two bytes, the size limit on a +compiled pattern is 64K data units, and this is reached with the above pattern +if the outer repetition is increased from 3 to 4. PCRE can be compiled to use +larger internal pointers and thus handle larger compiled patterns, but it is +better to try to rewrite your pattern to use less memory if you can. +

+

+One way of reducing the memory usage for such patterns is to make use of PCRE's +"subroutine" +facility. Re-writing the above pattern as +

+  ((ab)(?2){0,999}c)(?1){0,2}
+
+reduces the memory requirements to 18K, and indeed it remains under 20K even +with the outer repetition increased to 100. However, this pattern is not +exactly equivalent, because the "subroutine" calls are treated as +atomic groups +into which there can be no backtracking if there is a subsequent matching +failure. Therefore, PCRE cannot do this kind of rewriting automatically. +Furthermore, there is a noticeable loss of speed when executing the modified +pattern. Nevertheless, if the atomic grouping is not a problem and the loss of +speed is acceptable, this kind of rewriting will allow you to process patterns +that PCRE cannot otherwise handle. +

+
+STACK USAGE AT RUN TIME +
+

+When pcre_exec() or pcre[16|32]_exec() is used for matching, certain +kinds of pattern can cause it to use large amounts of the process stack. In +some environments the default process stack is quite small, and if it runs out +the result is often SIGSEGV. This issue is probably the most frequently raised +problem with PCRE. Rewriting your pattern can often help. The +pcrestack +documentation discusses this issue in detail. +

+
+PROCESSING TIME +
+

+Certain items in regular expression patterns are processed more efficiently +than others. It is more efficient to use a character class like [aeiou] than a +set of single-character alternatives such as (a|e|i|o|u). In general, the +simplest construction that provides the required behaviour is usually the most +efficient. Jeffrey Friedl's book contains a lot of useful general discussion +about optimizing regular expressions for efficient performance. This document +contains a few observations about PCRE. +

+

+Using Unicode character properties (the \p, \P, and \X escapes) is slow, +because PCRE has to use a multi-stage table lookup whenever it needs a +character's property. If you can find an alternative pattern that does not use +character properties, it will probably be faster. +

+

+By default, the escape sequences \b, \d, \s, and \w, and the POSIX +character classes such as [:alpha:] do not use Unicode properties, partly for +backwards compatibility, and partly for performance reasons. However, you can +set PCRE_UCP if you want Unicode character properties to be used. This can +double the matching time for items such as \d, when matched with +a traditional matching function; the performance loss is less with +a DFA matching function, and in both cases there is not much difference for +\b. +

+

+When a pattern begins with .* not in parentheses, or in parentheses that are +not the subject of a backreference, and the PCRE_DOTALL option is set, the +pattern is implicitly anchored by PCRE, since it can match only at the start of +a subject string. However, if PCRE_DOTALL is not set, PCRE cannot make this +optimization, because the . metacharacter does not then match a newline, and if +the subject string contains newlines, the pattern may match from the character +immediately following one of them instead of from the very start. For example, +the pattern +

+  .*second
+
+matches the subject "first\nand second" (where \n stands for a newline +character), with the match starting at the seventh character. In order to do +this, PCRE has to retry the match starting after every newline in the subject. +

+

+If you are using such a pattern with subject strings that do not contain +newlines, the best performance is obtained by setting PCRE_DOTALL, or starting +the pattern with ^.* or ^.*? to indicate explicit anchoring. That saves PCRE +from having to scan along the subject looking for a newline to restart at. +

+

+Beware of patterns that contain nested indefinite repeats. These can take a +long time to run when applied to a string that does not match. Consider the +pattern fragment +

+  ^(a+)*
+
+This can match "aaaa" in 16 different ways, and this number increases very +rapidly as the string gets longer. (The * repeat can match 0, 1, 2, 3, or 4 +times, and for each of those cases other than 0 or 4, the + repeats can match +different numbers of times.) When the remainder of the pattern is such that the +entire match is going to fail, PCRE has in principle to try every possible +variation, and this can take an extremely long time, even for relatively short +strings. +

+

+An optimization catches some of the more simple cases such as +

+  (a+)*b
+
+where a literal character follows. Before embarking on the standard matching +procedure, PCRE checks that there is a "b" later in the subject string, and if +there is not, it fails the match immediately. However, when there is no +following literal this optimization cannot be used. You can see the difference +by comparing the behaviour of +
+  (a+)*\d
+
+with the pattern above. The former gives a failure almost instantly when +applied to a whole line of "a" characters, whereas the latter takes an +appreciable time with strings longer than about 20 characters. +

+

+In many cases, the solution to this kind of performance issue is to use an +atomic group or a possessive quantifier. +

+
+AUTHOR +
+

+Philip Hazel +
+University Computing Service +
+Cambridge CB2 3QH, England. +
+

+
+REVISION +
+

+Last updated: 25 August 2012 +
+Copyright © 1997-2012 University of Cambridge. +
+

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcreposix.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcreposix.html new file mode 100644 index 0000000000000000000000000000000000000000..18924cf7f94fb7c44e81394b0d1957c84a77f255 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcreposix.html @@ -0,0 +1,290 @@ + + +pcreposix specification + + +

pcreposix man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+

+
SYNOPSIS
+

+#include <pcreposix.h> +

+

+int regcomp(regex_t *preg, const char *pattern, + int cflags); +
+
+int regexec(regex_t *preg, const char *string, + size_t nmatch, regmatch_t pmatch[], int eflags); + size_t regerror(int errcode, const regex_t *preg, + char *errbuf, size_t errbuf_size); +
+
+void regfree(regex_t *preg); +

+
DESCRIPTION
+

+This set of functions provides a POSIX-style API for the PCRE regular +expression 8-bit library. See the +pcreapi +documentation for a description of PCRE's native API, which contains much +additional functionality. There is no POSIX-style wrapper for PCRE's 16-bit +and 32-bit library. +

+

+The functions described here are just wrapper functions that ultimately call +the PCRE native API. Their prototypes are defined in the pcreposix.h +header file, and on Unix systems the library itself is called +pcreposix.a, so can be accessed by adding -lpcreposix to the +command for linking an application that uses them. Because the POSIX functions +call the native ones, it is also necessary to add -lpcre. +

+

+I have implemented only those POSIX option bits that can be reasonably mapped +to PCRE native options. In addition, the option REG_EXTENDED is defined with +the value zero. This has no effect, but since programs that are written to the +POSIX interface often use it, this makes it easier to slot in PCRE as a +replacement library. Other POSIX options are not even defined. +

+

+There are also some other options that are not defined by POSIX. These have +been added at the request of users who want to make use of certain +PCRE-specific features via the POSIX calling interface. +

+

+When PCRE is called via these functions, it is only the API that is POSIX-like +in style. The syntax and semantics of the regular expressions themselves are +still those of Perl, subject to the setting of various PCRE options, as +described below. "POSIX-like in style" means that the API approximates to the +POSIX definition; it is not fully POSIX-compatible, and in multi-byte encoding +domains it is probably even less compatible. +

+

+The header for these functions is supplied as pcreposix.h to avoid any +potential clash with other POSIX libraries. It can, of course, be renamed or +aliased as regex.h, which is the "correct" name. It provides two +structure types, regex_t for compiled internal forms, and +regmatch_t for returning captured substrings. It also defines some +constants whose names start with "REG_"; these are used for setting options and +identifying error codes. +

+
COMPILING A PATTERN
+

+The function regcomp() is called to compile a pattern into an +internal form. The pattern is a C string terminated by a binary zero, and +is passed in the argument pattern. The preg argument is a pointer +to a regex_t structure that is used as a base for storing information +about the compiled regular expression. +

+

+The argument cflags is either zero, or contains one or more of the bits +defined by the following macros: +

+  REG_DOTALL
+
+The PCRE_DOTALL option is set when the regular expression is passed for +compilation to the native function. Note that REG_DOTALL is not part of the +POSIX standard. +
+  REG_ICASE
+
+The PCRE_CASELESS option is set when the regular expression is passed for +compilation to the native function. +
+  REG_NEWLINE
+
+The PCRE_MULTILINE option is set when the regular expression is passed for +compilation to the native function. Note that this does not mimic the +defined POSIX behaviour for REG_NEWLINE (see the following section). +
+  REG_NOSUB
+
+The PCRE_NO_AUTO_CAPTURE option is set when the regular expression is passed +for compilation to the native function. In addition, when a pattern that is +compiled with this flag is passed to regexec() for matching, the +nmatch and pmatch arguments are ignored, and no captured strings +are returned. +
+  REG_UCP
+
+The PCRE_UCP option is set when the regular expression is passed for +compilation to the native function. This causes PCRE to use Unicode properties +when matchine \d, \w, etc., instead of just recognizing ASCII values. Note +that REG_UTF8 is not part of the POSIX standard. +
+  REG_UNGREEDY
+
+The PCRE_UNGREEDY option is set when the regular expression is passed for +compilation to the native function. Note that REG_UNGREEDY is not part of the +POSIX standard. +
+  REG_UTF8
+
+The PCRE_UTF8 option is set when the regular expression is passed for +compilation to the native function. This causes the pattern itself and all data +strings used for matching it to be treated as UTF-8 strings. Note that REG_UTF8 +is not part of the POSIX standard. +

+

+In the absence of these flags, no options are passed to the native function. +This means the the regex is compiled with PCRE default semantics. In +particular, the way it handles newline characters in the subject string is the +Perl way, not the POSIX way. Note that setting PCRE_MULTILINE has only +some of the effects specified for REG_NEWLINE. It does not affect the way +newlines are matched by . (they are not) or by a negative class such as [^a] +(they are). +

+

+The yield of regcomp() is zero on success, and non-zero otherwise. The +preg structure is filled in on success, and one member of the structure +is public: re_nsub contains the number of capturing subpatterns in +the regular expression. Various error codes are defined in the header file. +

+

+NOTE: If the yield of regcomp() is non-zero, you must not attempt to +use the contents of the preg structure. If, for example, you pass it to +regexec(), the result is undefined and your program is likely to crash. +

+
MATCHING NEWLINE CHARACTERS
+

+This area is not simple, because POSIX and Perl take different views of things. +It is not possible to get PCRE to obey POSIX semantics, but then PCRE was never +intended to be a POSIX engine. The following table lists the different +possibilities for matching newline characters in PCRE: +

+                          Default   Change with
+
+  . matches newline          no     PCRE_DOTALL
+  newline matches [^a]       yes    not changeable
+  $ matches \n at end        yes    PCRE_DOLLARENDONLY
+  $ matches \n in middle     no     PCRE_MULTILINE
+  ^ matches \n in middle     no     PCRE_MULTILINE
+
+This is the equivalent table for POSIX: +
+                          Default   Change with
+
+  . matches newline          yes    REG_NEWLINE
+  newline matches [^a]       yes    REG_NEWLINE
+  $ matches \n at end        no     REG_NEWLINE
+  $ matches \n in middle     no     REG_NEWLINE
+  ^ matches \n in middle     no     REG_NEWLINE
+
+PCRE's behaviour is the same as Perl's, except that there is no equivalent for +PCRE_DOLLAR_ENDONLY in Perl. In both PCRE and Perl, there is no way to stop +newline from matching [^a]. +

+

+The default POSIX newline handling can be obtained by setting PCRE_DOTALL and +PCRE_DOLLAR_ENDONLY, but there is no way to make PCRE behave exactly as for the +REG_NEWLINE action. +

+
MATCHING A PATTERN
+

+The function regexec() is called to match a compiled pattern preg +against a given string, which is by default terminated by a zero byte +(but see REG_STARTEND below), subject to the options in eflags. These can +be: +

+  REG_NOTBOL
+
+The PCRE_NOTBOL option is set when calling the underlying PCRE matching +function. +
+  REG_NOTEMPTY
+
+The PCRE_NOTEMPTY option is set when calling the underlying PCRE matching +function. Note that REG_NOTEMPTY is not part of the POSIX standard. However, +setting this option can give more POSIX-like behaviour in some situations. +
+  REG_NOTEOL
+
+The PCRE_NOTEOL option is set when calling the underlying PCRE matching +function. +
+  REG_STARTEND
+
+The string is considered to start at string + pmatch[0].rm_so and +to have a terminating NUL located at string + pmatch[0].rm_eo +(there need not actually be a NUL at that location), regardless of the value of +nmatch. This is a BSD extension, compatible with but not specified by +IEEE Standard 1003.2 (POSIX.2), and should be used with caution in software +intended to be portable to other systems. Note that a non-zero rm_so does +not imply REG_NOTBOL; REG_STARTEND affects only the location of the string, not +how it is matched. +

+

+If the pattern was compiled with the REG_NOSUB flag, no data about any matched +strings is returned. The nmatch and pmatch arguments of +regexec() are ignored. +

+

+If the value of nmatch is zero, or if the value pmatch is NULL, +no data about any matched strings is returned. +

+

+Otherwise,the portion of the string that was matched, and also any captured +substrings, are returned via the pmatch argument, which points to an +array of nmatch structures of type regmatch_t, containing the +members rm_so and rm_eo. These contain the offset to the first +character of each substring and the offset to the first character after the end +of each substring, respectively. The 0th element of the vector relates to the +entire portion of string that was matched; subsequent elements relate to +the capturing subpatterns of the regular expression. Unused entries in the +array have both structure members set to -1. +

+

+A successful match yields a zero return; various error codes are defined in the +header file, of which REG_NOMATCH is the "expected" failure code. +

+
ERROR MESSAGES
+

+The regerror() function maps a non-zero errorcode from either +regcomp() or regexec() to a printable message. If preg is not +NULL, the error should have arisen from the use of that structure. A message +terminated by a binary zero is placed in errbuf. The length of the +message, including the zero, is limited to errbuf_size. The yield of the +function is the size of buffer needed to hold the whole message. +

+
MEMORY USAGE
+

+Compiling a regular expression causes memory to be allocated and associated +with the preg structure. The function regfree() frees all such +memory, after which preg may no longer be used as a compiled expression. +

+
AUTHOR
+

+Philip Hazel +
+University Computing Service +
+Cambridge CB2 3QH, England. +
+

+
REVISION
+

+Last updated: 09 January 2012 +
+Copyright © 1997-2012 University of Cambridge. +
+

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcreprecompile.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcreprecompile.html new file mode 100644 index 0000000000000000000000000000000000000000..decb1d6ce05f4426fbed48c9aec2d886987bdbe7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcreprecompile.html @@ -0,0 +1,163 @@ + + +pcreprecompile specification + + +

pcreprecompile man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+

+
SAVING AND RE-USING PRECOMPILED PCRE PATTERNS
+

+If you are running an application that uses a large number of regular +expression patterns, it may be useful to store them in a precompiled form +instead of having to compile them every time the application is run. +If you are not using any private character tables (see the +pcre_maketables() +documentation), this is relatively straightforward. If you are using private +tables, it is a little bit more complicated. However, if you are using the +just-in-time optimization feature, it is not possible to save and reload the +JIT data. +

+

+If you save compiled patterns to a file, you can copy them to a different host +and run them there. If the two hosts have different endianness (byte order), +you should run the pcre[16|32]_pattern_to_host_byte_order() function on the +new host before trying to match the pattern. The matching functions return +PCRE_ERROR_BADENDIANNESS if they detect a pattern with the wrong endianness. +

+

+Compiling regular expressions with one version of PCRE for use with a different +version is not guaranteed to work and may cause crashes, and saving and +restoring a compiled pattern loses any JIT optimization data. +

+
SAVING A COMPILED PATTERN
+

+The value returned by pcre[16|32]_compile() points to a single block of +memory that holds the compiled pattern and associated data. You can find the +length of this block in bytes by calling pcre[16|32]_fullinfo() with an +argument of PCRE_INFO_SIZE. You can then save the data in any appropriate +manner. Here is sample code for the 8-bit library that compiles a pattern and +writes it to a file. It assumes that the variable fd refers to a file +that is open for output: +

+  int erroroffset, rc, size;
+  char *error;
+  pcre *re;
+
+  re = pcre_compile("my pattern", 0, &error, &erroroffset, NULL);
+  if (re == NULL) { ... handle errors ... }
+  rc = pcre_fullinfo(re, NULL, PCRE_INFO_SIZE, &size);
+  if (rc < 0) { ... handle errors ... }
+  rc = fwrite(re, 1, size, fd);
+  if (rc != size) { ... handle errors ... }
+
+In this example, the bytes that comprise the compiled pattern are copied +exactly. Note that this is binary data that may contain any of the 256 possible +byte values. On systems that make a distinction between binary and non-binary +data, be sure that the file is opened for binary output. +

+

+If you want to write more than one pattern to a file, you will have to devise a +way of separating them. For binary data, preceding each pattern with its length +is probably the most straightforward approach. Another possibility is to write +out the data in hexadecimal instead of binary, one pattern to a line. +

+

+Saving compiled patterns in a file is only one possible way of storing them for +later use. They could equally well be saved in a database, or in the memory of +some daemon process that passes them via sockets to the processes that want +them. +

+

+If the pattern has been studied, it is also possible to save the normal study +data in a similar way to the compiled pattern itself. However, if the +PCRE_STUDY_JIT_COMPILE was used, the just-in-time data that is created cannot +be saved because it is too dependent on the current environment. When studying +generates additional information, pcre[16|32]_study() returns a pointer to a +pcre[16|32]_extra data block. Its format is defined in the +section on matching a pattern +in the +pcreapi +documentation. The study_data field points to the binary study data, and +this is what you must save (not the pcre[16|32]_extra block itself). The +length of the study data can be obtained by calling pcre[16|32]_fullinfo() +with an argument of PCRE_INFO_STUDYSIZE. Remember to check that +pcre[16|32]_study() did return a non-NULL value before trying to save the +study data. +

+
RE-USING A PRECOMPILED PATTERN
+

+Re-using a precompiled pattern is straightforward. Having reloaded it into main +memory, called pcre[16|32]_pattern_to_host_byte_order() if necessary, you +pass its pointer to pcre[16|32]_exec() or pcre[16|32]_dfa_exec() in +the usual way. +

+

+However, if you passed a pointer to custom character tables when the pattern +was compiled (the tableptr argument of pcre[16|32]_compile()), you +must now pass a similar pointer to pcre[16|32]_exec() or +pcre[16|32]_dfa_exec(), because the value saved with the compiled pattern +will obviously be nonsense. A field in a pcre[16|32]_extra() block is used +to pass this data, as described in the +section on matching a pattern +in the +pcreapi +documentation. +

+

+Warning: The tables that pcre_exec() and pcre_dfa_exec() use +must be the same as those that were used when the pattern was compiled. If this +is not the case, the behaviour is undefined. +

+

+If you did not provide custom character tables when the pattern was compiled, +the pointer in the compiled pattern is NULL, which causes the matching +functions to use PCRE's internal tables. Thus, you do not need to take any +special action at run time in this case. +

+

+If you saved study data with the compiled pattern, you need to create your own +pcre[16|32]_extra data block and set the study_data field to point +to the reloaded study data. You must also set the PCRE_EXTRA_STUDY_DATA bit in +the flags field to indicate that study data is present. Then pass the +pcre[16|32]_extra block to the matching function in the usual way. If the +pattern was studied for just-in-time optimization, that data cannot be saved, +and so is lost by a save/restore cycle. +

+
COMPATIBILITY WITH DIFFERENT PCRE RELEASES
+

+In general, it is safest to recompile all saved patterns when you update to a +new PCRE release, though not all updates actually require this. +

+
AUTHOR
+

+Philip Hazel +
+University Computing Service +
+Cambridge CB2 3QH, England. +
+

+
REVISION
+

+Last updated: 12 November 2013 +
+Copyright © 1997-2013 University of Cambridge. +
+

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcresample.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcresample.html new file mode 100644 index 0000000000000000000000000000000000000000..aca9184e00e1d73c23e1b5e357c2ea4b88ee5ef6 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcresample.html @@ -0,0 +1,110 @@ + + +pcresample specification + + +

pcresample man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+PCRE SAMPLE PROGRAM +
+

+A simple, complete demonstration program, to get you started with using PCRE, +is supplied in the file pcredemo.c in the PCRE distribution. A listing of +this program is given in the +pcredemo +documentation. If you do not have a copy of the PCRE distribution, you can save +this listing to re-create pcredemo.c. +

+

+The demonstration program, which uses the original PCRE 8-bit library, compiles +the regular expression that is its first argument, and matches it against the +subject string in its second argument. No PCRE options are set, and default +character tables are used. If matching succeeds, the program outputs the +portion of the subject that matched, together with the contents of any captured +substrings. +

+

+If the -g option is given on the command line, the program then goes on to +check for further matches of the same regular expression in the same subject +string. The logic is a little bit tricky because of the possibility of matching +an empty string. Comments in the code explain what is going on. +

+

+If PCRE is installed in the standard include and library directories for your +operating system, you should be able to compile the demonstration program using +this command: +

+  gcc -o pcredemo pcredemo.c -lpcre
+
+If PCRE is installed elsewhere, you may need to add additional options to the +command line. For example, on a Unix-like system that has PCRE installed in +/usr/local, you can compile the demonstration program using a command +like this: +
+  gcc -o pcredemo -I/usr/local/include pcredemo.c -L/usr/local/lib -lpcre
+
+In a Windows environment, if you want to statically link the program against a +non-dll pcre.a file, you must uncomment the line that defines PCRE_STATIC +before including pcre.h, because otherwise the pcre_malloc() and +pcre_free() exported functions will be declared +__declspec(dllimport), with unwanted results. +

+

+Once you have compiled and linked the demonstration program, you can run simple +tests like this: +

+  ./pcredemo 'cat|dog' 'the cat sat on the mat'
+  ./pcredemo -g 'cat|dog' 'the dog sat on the cat'
+
+Note that there is a much more comprehensive test program, called +pcretest, +which supports many more facilities for testing regular expressions and both +PCRE libraries. The +pcredemo +program is provided as a simple coding example. +

+

+If you try to run +pcredemo +when PCRE is not installed in the standard library directory, you may get an +error like this on some operating systems (e.g. Solaris): +

+  ld.so.1: a.out: fatal: libpcre.so.0: open failed: No such file or directory
+
+This is caused by the way shared library support works on those systems. You +need to add +
+  -R/usr/local/lib
+
+(for example) to the compile command to get round this problem. +

+
+AUTHOR +
+

+Philip Hazel +
+University Computing Service +
+Cambridge CB2 3QH, England. +
+

+
+REVISION +
+

+Last updated: 10 January 2012 +
+Copyright © 1997-2012 University of Cambridge. +
+

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrestack.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrestack.html new file mode 100644 index 0000000000000000000000000000000000000000..af6406d0708df01ec46905a7945c0916d843c9c1 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcrestack.html @@ -0,0 +1,225 @@ + + +pcrestack specification + + +

pcrestack man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+PCRE DISCUSSION OF STACK USAGE +
+

+When you call pcre[16|32]_exec(), it makes use of an internal function +called match(). This calls itself recursively at branch points in the +pattern, in order to remember the state of the match so that it can back up and +try a different alternative if the first one fails. As matching proceeds deeper +and deeper into the tree of possibilities, the recursion depth increases. The +match() function is also called in other circumstances, for example, +whenever a parenthesized sub-pattern is entered, and in certain cases of +repetition. +

+

+Not all calls of match() increase the recursion depth; for an item such +as a* it may be called several times at the same level, after matching +different numbers of a's. Furthermore, in a number of cases where the result of +the recursive call would immediately be passed back as the result of the +current call (a "tail recursion"), the function is just restarted instead. +

+

+The above comments apply when pcre[16|32]_exec() is run in its normal +interpretive manner. If the pattern was studied with the +PCRE_STUDY_JIT_COMPILE option, and just-in-time compiling was successful, and +the options passed to pcre[16|32]_exec() were not incompatible, the matching +process uses the JIT-compiled code instead of the match() function. In +this case, the memory requirements are handled entirely differently. See the +pcrejit +documentation for details. +

+

+The pcre[16|32]_dfa_exec() function operates in an entirely different way, +and uses recursion only when there is a regular expression recursion or +subroutine call in the pattern. This includes the processing of assertion and +"once-only" subpatterns, which are handled like subroutine calls. Normally, +these are never very deep, and the limit on the complexity of +pcre[16|32]_dfa_exec() is controlled by the amount of workspace it is given. +However, it is possible to write patterns with runaway infinite recursions; +such patterns will cause pcre[16|32]_dfa_exec() to run out of stack. At +present, there is no protection against this. +

+

+The comments that follow do NOT apply to pcre[16|32]_dfa_exec(); they are +relevant only for pcre[16|32]_exec() without the JIT optimization. +

+
+Reducing pcre[16|32]_exec()'s stack usage +
+

+Each time that match() is actually called recursively, it uses memory +from the process stack. For certain kinds of pattern and data, very large +amounts of stack may be needed, despite the recognition of "tail recursion". +You can often reduce the amount of recursion, and therefore the amount of stack +used, by modifying the pattern that is being matched. Consider, for example, +this pattern: +

+  ([^<]|<(?!inet))+
+
+It matches from wherever it starts until it encounters "<inet" or the end of +the data, and is the kind of pattern that might be used when processing an XML +file. Each iteration of the outer parentheses matches either one character that +is not "<" or a "<" that is not followed by "inet". However, each time a +parenthesis is processed, a recursion occurs, so this formulation uses a stack +frame for each matched character. For a long string, a lot of stack is +required. Consider now this rewritten pattern, which matches exactly the same +strings: +
+  ([^<]++|<(?!inet))+
+
+This uses very much less stack, because runs of characters that do not contain +"<" are "swallowed" in one item inside the parentheses. Recursion happens only +when a "<" character that is not followed by "inet" is encountered (and we +assume this is relatively rare). A possessive quantifier is used to stop any +backtracking into the runs of non-"<" characters, but that is not related to +stack usage. +

+

+This example shows that one way of avoiding stack problems when matching long +subject strings is to write repeated parenthesized subpatterns to match more +than one character whenever possible. +

+
+Compiling PCRE to use heap instead of stack for pcre[16|32]_exec() +
+

+In environments where stack memory is constrained, you might want to compile +PCRE to use heap memory instead of stack for remembering back-up points when +pcre[16|32]_exec() is running. This makes it run a lot more slowly, however. +Details of how to do this are given in the +pcrebuild +documentation. When built in this way, instead of using the stack, PCRE obtains +and frees memory by calling the functions that are pointed to by the +pcre[16|32]_stack_malloc and pcre[16|32]_stack_free variables. By +default, these point to malloc() and free(), but you can replace +the pointers to cause PCRE to use your own functions. Since the block sizes are +always the same, and are always freed in reverse order, it may be possible to +implement customized memory handlers that are more efficient than the standard +functions. +

+
+Limiting pcre[16|32]_exec()'s stack usage +
+

+You can set limits on the number of times that match() is called, both in +total and recursively. If a limit is exceeded, pcre[16|32]_exec() returns an +error code. Setting suitable limits should prevent it from running out of +stack. The default values of the limits are very large, and unlikely ever to +operate. They can be changed when PCRE is built, and they can also be set when +pcre[16|32]_exec() is called. For details of these interfaces, see the +pcrebuild +documentation and the +section on extra data for pcre[16|32]_exec() +in the +pcreapi +documentation. +

+

+As a very rough rule of thumb, you should reckon on about 500 bytes per +recursion. Thus, if you want to limit your stack usage to 8Mb, you should set +the limit at 16000 recursions. A 64Mb stack, on the other hand, can support +around 128000 recursions. +

+

+In Unix-like environments, the pcretest test program has a command line +option (-S) that can be used to increase the size of its stack. As long +as the stack is large enough, another option (-M) can be used to find the +smallest limits that allow a particular pattern to match a given subject +string. This is done by calling pcre[16|32]_exec() repeatedly with different +limits. +

+
+Obtaining an estimate of stack usage +
+

+The actual amount of stack used per recursion can vary quite a lot, depending +on the compiler that was used to build PCRE and the optimization or debugging +options that were set for it. The rule of thumb value of 500 bytes mentioned +above may be larger or smaller than what is actually needed. A better +approximation can be obtained by running this command: +

+  pcretest -m -C
+
+The -C option causes pcretest to output information about the +options with which PCRE was compiled. When -m is also given (before +-C), information about stack use is given in a line like this: +
+  Match recursion uses stack: approximate frame size = 640 bytes
+
+The value is approximate because some recursions need a bit more (up to perhaps +16 more bytes). +

+

+If the above command is given when PCRE is compiled to use the heap instead of +the stack for recursion, the value that is output is the size of each block +that is obtained from the heap. +

+
+Changing stack size in Unix-like systems +
+

+In Unix-like environments, there is not often a problem with the stack unless +very long strings are involved, though the default limit on stack size varies +from system to system. Values from 8Mb to 64Mb are common. You can find your +default limit by running the command: +

+  ulimit -s
+
+Unfortunately, the effect of running out of stack is often SIGSEGV, though +sometimes a more explicit error message is given. You can normally increase the +limit on stack size by code such as this: +
+  struct rlimit rlim;
+  getrlimit(RLIMIT_STACK, &rlim);
+  rlim.rlim_cur = 100*1024*1024;
+  setrlimit(RLIMIT_STACK, &rlim);
+
+This reads the current limits (soft and hard) using getrlimit(), then +attempts to increase the soft limit to 100Mb using setrlimit(). You must +do this before calling pcre[16|32]_exec(). +

+
+Changing stack size in Mac OS X +
+

+Using setrlimit(), as described above, should also work on Mac OS X. It +is also possible to set a stack size when linking a program. There is a +discussion about stack sizes in Mac OS X at this web site: +http://developer.apple.com/qa/qa2005/qa1419.html. +

+
+AUTHOR +
+

+Philip Hazel +
+University Computing Service +
+Cambridge CB2 3QH, England. +
+

+
+REVISION +
+

+Last updated: 24 June 2012 +
+Copyright © 1997-2012 University of Cambridge. +
+

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcresyntax.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcresyntax.html new file mode 100644 index 0000000000000000000000000000000000000000..2946ab328724aa83efc462f98f8a6e8d63d02fa3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcresyntax.html @@ -0,0 +1,561 @@ + + +pcresyntax specification + + +

pcresyntax man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+

+
PCRE REGULAR EXPRESSION SYNTAX SUMMARY
+

+The full syntax and semantics of the regular expressions that are supported by +PCRE are described in the +pcrepattern +documentation. This document contains a quick-reference summary of the syntax. +

+
QUOTING
+

+

+  \x         where x is non-alphanumeric is a literal x
+  \Q...\E    treat enclosed characters as literal
+
+

+
CHARACTERS
+

+

+  \a         alarm, that is, the BEL character (hex 07)
+  \cx        "control-x", where x is any ASCII character
+  \e         escape (hex 1B)
+  \f         form feed (hex 0C)
+  \n         newline (hex 0A)
+  \r         carriage return (hex 0D)
+  \t         tab (hex 09)
+  \0dd       character with octal code 0dd
+  \ddd       character with octal code ddd, or backreference
+  \o{ddd..}  character with octal code ddd..
+  \xhh       character with hex code hh
+  \x{hhh..}  character with hex code hhh..
+
+Note that \0dd is always an octal code, and that \8 and \9 are the literal +characters "8" and "9". +

+
CHARACTER TYPES
+

+

+  .          any character except newline;
+               in dotall mode, any character whatsoever
+  \C         one data unit, even in UTF mode (best avoided)
+  \d         a decimal digit
+  \D         a character that is not a decimal digit
+  \h         a horizontal white space character
+  \H         a character that is not a horizontal white space character
+  \N         a character that is not a newline
+  \p{xx}     a character with the xx property
+  \P{xx}     a character without the xx property
+  \R         a newline sequence
+  \s         a white space character
+  \S         a character that is not a white space character
+  \v         a vertical white space character
+  \V         a character that is not a vertical white space character
+  \w         a "word" character
+  \W         a "non-word" character
+  \X         a Unicode extended grapheme cluster
+
+By default, \d, \s, and \w match only ASCII characters, even in UTF-8 mode +or in the 16- bit and 32-bit libraries. However, if locale-specific matching is +happening, \s and \w may also match characters with code points in the range +128-255. If the PCRE_UCP option is set, the behaviour of these escape sequences +is changed to use Unicode properties and they match many more characters. +

+
GENERAL CATEGORY PROPERTIES FOR \p and \P
+

+

+  C          Other
+  Cc         Control
+  Cf         Format
+  Cn         Unassigned
+  Co         Private use
+  Cs         Surrogate
+
+  L          Letter
+  Ll         Lower case letter
+  Lm         Modifier letter
+  Lo         Other letter
+  Lt         Title case letter
+  Lu         Upper case letter
+  L&         Ll, Lu, or Lt
+
+  M          Mark
+  Mc         Spacing mark
+  Me         Enclosing mark
+  Mn         Non-spacing mark
+
+  N          Number
+  Nd         Decimal number
+  Nl         Letter number
+  No         Other number
+
+  P          Punctuation
+  Pc         Connector punctuation
+  Pd         Dash punctuation
+  Pe         Close punctuation
+  Pf         Final punctuation
+  Pi         Initial punctuation
+  Po         Other punctuation
+  Ps         Open punctuation
+
+  S          Symbol
+  Sc         Currency symbol
+  Sk         Modifier symbol
+  Sm         Mathematical symbol
+  So         Other symbol
+
+  Z          Separator
+  Zl         Line separator
+  Zp         Paragraph separator
+  Zs         Space separator
+
+

+
PCRE SPECIAL CATEGORY PROPERTIES FOR \p and \P
+

+

+  Xan        Alphanumeric: union of properties L and N
+  Xps        POSIX space: property Z or tab, NL, VT, FF, CR
+  Xsp        Perl space: property Z or tab, NL, VT, FF, CR
+  Xuc        Universally-named character: one that can be
+               represented by a Universal Character Name
+  Xwd        Perl word: property Xan or underscore
+
+Perl and POSIX space are now the same. Perl added VT to its space character set +at release 5.18 and PCRE changed at release 8.34. +

+
SCRIPT NAMES FOR \p AND \P
+

+Arabic, +Armenian, +Avestan, +Balinese, +Bamum, +Bassa_Vah, +Batak, +Bengali, +Bopomofo, +Brahmi, +Braille, +Buginese, +Buhid, +Canadian_Aboriginal, +Carian, +Caucasian_Albanian, +Chakma, +Cham, +Cherokee, +Common, +Coptic, +Cuneiform, +Cypriot, +Cyrillic, +Deseret, +Devanagari, +Duployan, +Egyptian_Hieroglyphs, +Elbasan, +Ethiopic, +Georgian, +Glagolitic, +Gothic, +Grantha, +Greek, +Gujarati, +Gurmukhi, +Han, +Hangul, +Hanunoo, +Hebrew, +Hiragana, +Imperial_Aramaic, +Inherited, +Inscriptional_Pahlavi, +Inscriptional_Parthian, +Javanese, +Kaithi, +Kannada, +Katakana, +Kayah_Li, +Kharoshthi, +Khmer, +Khojki, +Khudawadi, +Lao, +Latin, +Lepcha, +Limbu, +Linear_A, +Linear_B, +Lisu, +Lycian, +Lydian, +Mahajani, +Malayalam, +Mandaic, +Manichaean, +Meetei_Mayek, +Mende_Kikakui, +Meroitic_Cursive, +Meroitic_Hieroglyphs, +Miao, +Modi, +Mongolian, +Mro, +Myanmar, +Nabataean, +New_Tai_Lue, +Nko, +Ogham, +Ol_Chiki, +Old_Italic, +Old_North_Arabian, +Old_Permic, +Old_Persian, +Old_South_Arabian, +Old_Turkic, +Oriya, +Osmanya, +Pahawh_Hmong, +Palmyrene, +Pau_Cin_Hau, +Phags_Pa, +Phoenician, +Psalter_Pahlavi, +Rejang, +Runic, +Samaritan, +Saurashtra, +Sharada, +Shavian, +Siddham, +Sinhala, +Sora_Sompeng, +Sundanese, +Syloti_Nagri, +Syriac, +Tagalog, +Tagbanwa, +Tai_Le, +Tai_Tham, +Tai_Viet, +Takri, +Tamil, +Telugu, +Thaana, +Thai, +Tibetan, +Tifinagh, +Tirhuta, +Ugaritic, +Vai, +Warang_Citi, +Yi. +

+
CHARACTER CLASSES
+

+

+  [...]       positive character class
+  [^...]      negative character class
+  [x-y]       range (can be used for hex characters)
+  [[:xxx:]]   positive POSIX named set
+  [[:^xxx:]]  negative POSIX named set
+
+  alnum       alphanumeric
+  alpha       alphabetic
+  ascii       0-127
+  blank       space or tab
+  cntrl       control character
+  digit       decimal digit
+  graph       printing, excluding space
+  lower       lower case letter
+  print       printing, including space
+  punct       printing, excluding alphanumeric
+  space       white space
+  upper       upper case letter
+  word        same as \w
+  xdigit      hexadecimal digit
+
+In PCRE, POSIX character set names recognize only ASCII characters by default, +but some of them use Unicode properties if PCRE_UCP is set. You can use +\Q...\E inside a character class. +

+
QUANTIFIERS
+

+

+  ?           0 or 1, greedy
+  ?+          0 or 1, possessive
+  ??          0 or 1, lazy
+  *           0 or more, greedy
+  *+          0 or more, possessive
+  *?          0 or more, lazy
+  +           1 or more, greedy
+  ++          1 or more, possessive
+  +?          1 or more, lazy
+  {n}         exactly n
+  {n,m}       at least n, no more than m, greedy
+  {n,m}+      at least n, no more than m, possessive
+  {n,m}?      at least n, no more than m, lazy
+  {n,}        n or more, greedy
+  {n,}+       n or more, possessive
+  {n,}?       n or more, lazy
+
+

+
ANCHORS AND SIMPLE ASSERTIONS
+

+

+  \b          word boundary
+  \B          not a word boundary
+  ^           start of subject
+               also after internal newline in multiline mode
+  \A          start of subject
+  $           end of subject
+               also before newline at end of subject
+               also before internal newline in multiline mode
+  \Z          end of subject
+               also before newline at end of subject
+  \z          end of subject
+  \G          first matching position in subject
+
+

+
MATCH POINT RESET
+

+

+  \K          reset start of match
+
+\K is honoured in positive assertions, but ignored in negative ones. +

+
ALTERNATION
+

+

+  expr|expr|expr...
+
+

+
CAPTURING
+

+

+  (...)           capturing group
+  (?<name>...)    named capturing group (Perl)
+  (?'name'...)    named capturing group (Perl)
+  (?P<name>...)   named capturing group (Python)
+  (?:...)         non-capturing group
+  (?|...)         non-capturing group; reset group numbers for
+                   capturing groups in each alternative
+
+

+
ATOMIC GROUPS
+

+

+  (?>...)         atomic, non-capturing group
+
+

+
COMMENT
+

+

+  (?#....)        comment (not nestable)
+
+

+
OPTION SETTING
+

+

+  (?i)            caseless
+  (?J)            allow duplicate names
+  (?m)            multiline
+  (?s)            single line (dotall)
+  (?U)            default ungreedy (lazy)
+  (?x)            extended (ignore white space)
+  (?-...)         unset option(s)
+
+The following are recognized only at the very start of a pattern or after one +of the newline or \R options with similar syntax. More than one of them may +appear. +
+  (*LIMIT_MATCH=d) set the match limit to d (decimal number)
+  (*LIMIT_RECURSION=d) set the recursion limit to d (decimal number)
+  (*NO_AUTO_POSSESS) no auto-possessification (PCRE_NO_AUTO_POSSESS)
+  (*NO_START_OPT) no start-match optimization (PCRE_NO_START_OPTIMIZE)
+  (*UTF8)         set UTF-8 mode: 8-bit library (PCRE_UTF8)
+  (*UTF16)        set UTF-16 mode: 16-bit library (PCRE_UTF16)
+  (*UTF32)        set UTF-32 mode: 32-bit library (PCRE_UTF32)
+  (*UTF)          set appropriate UTF mode for the library in use
+  (*UCP)          set PCRE_UCP (use Unicode properties for \d etc)
+
+Note that LIMIT_MATCH and LIMIT_RECURSION can only reduce the value of the +limits set by the caller of pcre_exec(), not increase them. +

+
NEWLINE CONVENTION
+

+These are recognized only at the very start of the pattern or after option +settings with a similar syntax. +

+  (*CR)           carriage return only
+  (*LF)           linefeed only
+  (*CRLF)         carriage return followed by linefeed
+  (*ANYCRLF)      all three of the above
+  (*ANY)          any Unicode newline sequence
+
+

+
WHAT \R MATCHES
+

+These are recognized only at the very start of the pattern or after option +setting with a similar syntax. +

+  (*BSR_ANYCRLF)  CR, LF, or CRLF
+  (*BSR_UNICODE)  any Unicode newline sequence
+
+

+
LOOKAHEAD AND LOOKBEHIND ASSERTIONS
+

+

+  (?=...)         positive look ahead
+  (?!...)         negative look ahead
+  (?<=...)        positive look behind
+  (?<!...)        negative look behind
+
+Each top-level branch of a look behind must be of a fixed length. +

+
BACKREFERENCES
+

+

+  \n              reference by number (can be ambiguous)
+  \gn             reference by number
+  \g{n}           reference by number
+  \g{-n}          relative reference by number
+  \k<name>        reference by name (Perl)
+  \k'name'        reference by name (Perl)
+  \g{name}        reference by name (Perl)
+  \k{name}        reference by name (.NET)
+  (?P=name)       reference by name (Python)
+
+

+
SUBROUTINE REFERENCES (POSSIBLY RECURSIVE)
+

+

+  (?R)            recurse whole pattern
+  (?n)            call subpattern by absolute number
+  (?+n)           call subpattern by relative number
+  (?-n)           call subpattern by relative number
+  (?&name)        call subpattern by name (Perl)
+  (?P>name)       call subpattern by name (Python)
+  \g<name>        call subpattern by name (Oniguruma)
+  \g'name'        call subpattern by name (Oniguruma)
+  \g<n>           call subpattern by absolute number (Oniguruma)
+  \g'n'           call subpattern by absolute number (Oniguruma)
+  \g<+n>          call subpattern by relative number (PCRE extension)
+  \g'+n'          call subpattern by relative number (PCRE extension)
+  \g<-n>          call subpattern by relative number (PCRE extension)
+  \g'-n'          call subpattern by relative number (PCRE extension)
+
+

+
CONDITIONAL PATTERNS
+

+

+  (?(condition)yes-pattern)
+  (?(condition)yes-pattern|no-pattern)
+
+  (?(n)...        absolute reference condition
+  (?(+n)...       relative reference condition
+  (?(-n)...       relative reference condition
+  (?(<name>)...   named reference condition (Perl)
+  (?('name')...   named reference condition (Perl)
+  (?(name)...     named reference condition (PCRE)
+  (?(R)...        overall recursion condition
+  (?(Rn)...       specific group recursion condition
+  (?(R&name)...   specific recursion condition
+  (?(DEFINE)...   define subpattern for reference
+  (?(assert)...   assertion condition
+
+

+
BACKTRACKING CONTROL
+

+The following act immediately they are reached: +

+  (*ACCEPT)       force successful match
+  (*FAIL)         force backtrack; synonym (*F)
+  (*MARK:NAME)    set name to be passed back; synonym (*:NAME)
+
+The following act only when a subsequent match failure causes a backtrack to +reach them. They all force a match failure, but they differ in what happens +afterwards. Those that advance the start-of-match point do so only if the +pattern is not anchored. +
+  (*COMMIT)       overall failure, no advance of starting point
+  (*PRUNE)        advance to next starting character
+  (*PRUNE:NAME)   equivalent to (*MARK:NAME)(*PRUNE)
+  (*SKIP)         advance to current matching position
+  (*SKIP:NAME)    advance to position corresponding to an earlier
+                  (*MARK:NAME); if not found, the (*SKIP) is ignored
+  (*THEN)         local failure, backtrack to next alternation
+  (*THEN:NAME)    equivalent to (*MARK:NAME)(*THEN)
+
+

+
CALLOUTS
+

+

+  (?C)      callout
+  (?Cn)     callout with data n
+
+

+
SEE ALSO
+

+pcrepattern(3), pcreapi(3), pcrecallout(3), +pcrematching(3), pcre(3). +

+
AUTHOR
+

+Philip Hazel +
+University Computing Service +
+Cambridge CB2 3QH, England. +
+

+
REVISION
+

+Last updated: 08 January 2014 +
+Copyright © 1997-2014 University of Cambridge. +
+

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcretest.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcretest.html new file mode 100644 index 0000000000000000000000000000000000000000..842ff3cbe53777d6857c01735639eea9448115bc --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcretest.html @@ -0,0 +1,1161 @@ + + +pcretest specification + + +

pcretest man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+

+
SYNOPSIS
+

+pcretest [options] [input file [output file]] +
+
+pcretest was written as a test program for the PCRE regular expression +library itself, but it can also be used for experimenting with regular +expressions. This document describes the features of the test program; for +details of the regular expressions themselves, see the +pcrepattern +documentation. For details of the PCRE library function calls and their +options, see the +pcreapi +, +pcre16 +and +pcre32 +documentation. +

+

+The input for pcretest is a sequence of regular expression patterns and +strings to be matched, as described below. The output shows the result of each +match. Options on the command line and the patterns control PCRE options and +exactly what is output. +

+

+As PCRE has evolved, it has acquired many different features, and as a result, +pcretest now has rather a lot of obscure options for testing every +possible feature. Some of these options are specifically designed for use in +conjunction with the test script and data files that are distributed as part of +PCRE, and are unlikely to be of use otherwise. They are all documented here, +but without much justification. +

+
INPUT DATA FORMAT
+

+Input to pcretest is processed line by line, either by calling the C +library's fgets() function, or via the libreadline library (see +below). In Unix-like environments, fgets() treats any bytes other than +newline as data characters. However, in some Windows environments character 26 +(hex 1A) causes an immediate end of file, and no further data is read. For +maximum portability, therefore, it is safest to use only ASCII characters in +pcretest input files. +

+

+The input is processed using using C's string functions, so must not +contain binary zeroes, even though in Unix-like environments, fgets() +treats any bytes other than newline as data characters. +

+
PCRE's 8-BIT, 16-BIT AND 32-BIT LIBRARIES
+

+From release 8.30, two separate PCRE libraries can be built. The original one +supports 8-bit character strings, whereas the newer 16-bit library supports +character strings encoded in 16-bit units. From release 8.32, a third library +can be built, supporting character strings encoded in 32-bit units. The +pcretest program can be used to test all three libraries. However, it is +itself still an 8-bit program, reading 8-bit input and writing 8-bit output. +When testing the 16-bit or 32-bit library, the patterns and data strings are +converted to 16- or 32-bit format before being passed to the PCRE library +functions. Results are converted to 8-bit for output. +

+

+References to functions and structures of the form pcre[16|32]_xx below +mean "pcre_xx when using the 8-bit library, pcre16_xx when using +the 16-bit library, or pcre32_xx when using the 32-bit library". +

+
COMMAND LINE OPTIONS
+

+-8 +If the 8-bit library has been built, this option causes it to be used (this is +the default). If the 8-bit library has not been built, this option causes an +error. +

+

+-16 +If the 16-bit library has been built, this option causes it to be used. If only +the 16-bit library has been built, this is the default. If the 16-bit library +has not been built, this option causes an error. +

+

+-32 +If the 32-bit library has been built, this option causes it to be used. If only +the 32-bit library has been built, this is the default. If the 32-bit library +has not been built, this option causes an error. +

+

+-b +Behave as if each pattern has the /B (show byte code) modifier; the +internal form is output after compilation. +

+

+-C +Output the version number of the PCRE library, and all available information +about the optional features that are included, and then exit with zero exit +code. All other options are ignored. +

+

+-C option +Output information about a specific build-time option, then exit. This +functionality is intended for use in scripts such as RunTest. The +following options output the value and set the exit code as indicated: +

+  ebcdic-nl  the code for LF (= NL) in an EBCDIC environment:
+               0x15 or 0x25
+               0 if used in an ASCII environment
+               exit code is always 0
+  linksize   the configured internal link size (2, 3, or 4)
+               exit code is set to the link size
+  newline    the default newline setting:
+               CR, LF, CRLF, ANYCRLF, or ANY
+               exit code is always 0
+  bsr        the default setting for what \R matches:
+               ANYCRLF or ANY
+               exit code is always 0
+
+The following options output 1 for true or 0 for false, and set the exit code +to the same value: +
+  ebcdic     compiled for an EBCDIC environment
+  jit        just-in-time support is available
+  pcre16     the 16-bit library was built
+  pcre32     the 32-bit library was built
+  pcre8      the 8-bit library was built
+  ucp        Unicode property support is available
+  utf        UTF-8 and/or UTF-16 and/or UTF-32 support
+               is available
+
+If an unknown option is given, an error message is output; the exit code is 0. +

+

+-d +Behave as if each pattern has the /D (debug) modifier; the internal +form and information about the compiled pattern is output after compilation; +-d is equivalent to -b -i. +

+

+-dfa +Behave as if each data line contains the \D escape sequence; this causes the +alternative matching function, pcre[16|32]_dfa_exec(), to be used instead +of the standard pcre[16|32]_exec() function (more detail is given below). +

+

+-help +Output a brief summary these options and then exit. +

+

+-i +Behave as if each pattern has the /I modifier; information about the +compiled pattern is given after compilation. +

+

+-M +Behave as if each data line contains the \M escape sequence; this causes +PCRE to discover the minimum MATCH_LIMIT and MATCH_LIMIT_RECURSION settings by +calling pcre[16|32]_exec() repeatedly with different limits. +

+

+-m +Output the size of each compiled pattern after it has been compiled. This is +equivalent to adding /M to each regular expression. The size is given in +bytes for both libraries. +

+

+-O +Behave as if each pattern has the /O modifier, that is disable +auto-possessification for all patterns. +

+

+-o osize +Set the number of elements in the output vector that is used when calling +pcre[16|32]_exec() or pcre[16|32]_dfa_exec() to be osize. The +default value is 45, which is enough for 14 capturing subexpressions for +pcre[16|32]_exec() or 22 different matches for +pcre[16|32]_dfa_exec(). +The vector size can be changed for individual matching calls by including \O +in the data line (see below). +

+

+-p +Behave as if each pattern has the /P modifier; the POSIX wrapper API is +used to call PCRE. None of the other options has any effect when -p is +set. This option can be used only with the 8-bit library. +

+

+-q +Do not output the version number of pcretest at the start of execution. +

+

+-S size +On Unix-like systems, set the size of the run-time stack to size +megabytes. +

+

+-s or -s+ +Behave as if each pattern has the /S modifier; in other words, force each +pattern to be studied. If -s+ is used, all the JIT compile options are +passed to pcre[16|32]_study(), causing just-in-time optimization to be set +up if it is available, for both full and partial matching. Specific JIT compile +options can be selected by following -s+ with a digit in the range 1 to +7, which selects the JIT compile modes as follows: +

+  1  normal match only
+  2  soft partial match only
+  3  normal match and soft partial match
+  4  hard partial match only
+  6  soft and hard partial match
+  7  all three modes (default)
+
+If -s++ is used instead of -s+ (with or without a following digit), +the text "(JIT)" is added to the first output line after a match or no match +when JIT-compiled code was actually used. +
+
+Note that there are pattern options that can override -s, either +specifying no studying at all, or suppressing JIT compilation. +
+
+If the /I or /D option is present on a pattern (requesting output +about the compiled pattern), information about the result of studying is not +included when studying is caused only by -s and neither -i nor +-d is present on the command line. This behaviour means that the output +from tests that are run with and without -s should be identical, except +when options that output information about the actual running of a match are +set. +
+
+The -M, -t, and -tm options, which give information about +resources used, are likely to produce different output with and without +-s. Output may also differ if the /C option is present on an +individual pattern. This uses callouts to trace the the matching process, and +this may be different between studied and non-studied patterns. If the pattern +contains (*MARK) items there may also be differences, for the same reason. The +-s command line option can be overridden for specific patterns that +should never be studied (see the /S pattern modifier below). +

+

+-t +Run each compile, study, and match many times with a timer, and output the +resulting times per compile, study, or match (in milliseconds). Do not set +-m with -t, because you will then get the size output a zillion +times, and the timing will be distorted. You can control the number of +iterations that are used for timing by following -t with a number (as a +separate item on the command line). For example, "-t 1000" iterates 1000 times. +The default is to iterate 500000 times. +

+

+-tm +This is like -t except that it times only the matching phase, not the +compile or study phases. +

+

+-T -TM +These behave like -t and -tm, but in addition, at the end of a run, +the total times for all compiles, studies, and matches are output. +

+
DESCRIPTION
+

+If pcretest is given two filename arguments, it reads from the first and +writes to the second. If it is given only one filename argument, it reads from +that file and writes to stdout. Otherwise, it reads from stdin and writes to +stdout, and prompts for each line of input, using "re>" to prompt for regular +expressions, and "data>" to prompt for data lines. +

+

+When pcretest is built, a configuration option can specify that it should +be linked with the libreadline library. When this is done, if the input +is from a terminal, it is read using the readline() function. This +provides line-editing and history facilities. The output from the -help +option states whether or not readline() will be used. +

+

+The program handles any number of sets of input on a single input file. Each +set starts with a regular expression, and continues with any number of data +lines to be matched against that pattern. +

+

+Each data line is matched separately and independently. If you want to do +multi-line matches, you have to use the \n escape sequence (or \r or \r\n, +etc., depending on the newline setting) in a single line of input to encode the +newline sequences. There is no limit on the length of data lines; the input +buffer is automatically extended if it is too small. +

+

+An empty line signals the end of the data lines, at which point a new regular +expression is read. The regular expressions are given enclosed in any +non-alphanumeric delimiters other than backslash, for example: +

+  /(a|bc)x+yz/
+
+White space before the initial delimiter is ignored. A regular expression may +be continued over several input lines, in which case the newline characters are +included within it. It is possible to include the delimiter within the pattern +by escaping it, for example +
+  /abc\/def/
+
+If you do so, the escape and the delimiter form part of the pattern, but since +delimiters are always non-alphanumeric, this does not affect its interpretation. +If the terminating delimiter is immediately followed by a backslash, for +example, +
+  /abc/\
+
+then a backslash is added to the end of the pattern. This is done to provide a +way of testing the error condition that arises if a pattern finishes with a +backslash, because +
+  /abc\/
+
+is interpreted as the first line of a pattern that starts with "abc/", causing +pcretest to read the next line as a continuation of the regular expression. +

+
PATTERN MODIFIERS
+

+A pattern may be followed by any number of modifiers, which are mostly single +characters, though some of these can be qualified by further characters. +Following Perl usage, these are referred to below as, for example, "the +/i modifier", even though the delimiter of the pattern need not always be +a slash, and no slash is used when writing modifiers. White space may appear +between the final pattern delimiter and the first modifier, and between the +modifiers themselves. For reference, here is a complete list of modifiers. They +fall into several groups that are described in detail in the following +sections. +

+  /8              set UTF mode
+  /9              set PCRE_NEVER_UTF (locks out UTF mode)
+  /?              disable UTF validity check
+  /+              show remainder of subject after match
+  /=              show all captures (not just those that are set)
+
+  /A              set PCRE_ANCHORED
+  /B              show compiled code
+  /C              set PCRE_AUTO_CALLOUT
+  /D              same as /B plus /I
+  /E              set PCRE_DOLLAR_ENDONLY
+  /F              flip byte order in compiled pattern
+  /f              set PCRE_FIRSTLINE
+  /G              find all matches (shorten string)
+  /g              find all matches (use startoffset)
+  /I              show information about pattern
+  /i              set PCRE_CASELESS
+  /J              set PCRE_DUPNAMES
+  /K              show backtracking control names
+  /L              set locale
+  /M              show compiled memory size
+  /m              set PCRE_MULTILINE
+  /N              set PCRE_NO_AUTO_CAPTURE
+  /O              set PCRE_NO_AUTO_POSSESS
+  /P              use the POSIX wrapper
+  /Q              test external stack check function
+  /S              study the pattern after compilation
+  /s              set PCRE_DOTALL
+  /T              select character tables
+  /U              set PCRE_UNGREEDY
+  /W              set PCRE_UCP
+  /X              set PCRE_EXTRA
+  /x              set PCRE_EXTENDED
+  /Y              set PCRE_NO_START_OPTIMIZE
+  /Z              don't show lengths in /B output
+
+  /<any>          set PCRE_NEWLINE_ANY
+  /<anycrlf>      set PCRE_NEWLINE_ANYCRLF
+  /<cr>           set PCRE_NEWLINE_CR
+  /<crlf>         set PCRE_NEWLINE_CRLF
+  /<lf>           set PCRE_NEWLINE_LF
+  /<bsr_anycrlf>  set PCRE_BSR_ANYCRLF
+  /<bsr_unicode>  set PCRE_BSR_UNICODE
+  /<JS>           set PCRE_JAVASCRIPT_COMPAT
+
+
+

+
+Perl-compatible modifiers +
+

+The /i, /m, /s, and /x modifiers set the PCRE_CASELESS, +PCRE_MULTILINE, PCRE_DOTALL, or PCRE_EXTENDED options, respectively, when +pcre[16|32]_compile() is called. These four modifier letters have the same +effect as they do in Perl. For example: +

+  /caseless/i
+
+
+

+
+Modifiers for other PCRE options +
+

+The following table shows additional modifiers for setting PCRE compile-time +options that do not correspond to anything in Perl: +

+  /8              PCRE_UTF8           ) when using the 8-bit
+  /?              PCRE_NO_UTF8_CHECK  )   library
+
+  /8              PCRE_UTF16          ) when using the 16-bit
+  /?              PCRE_NO_UTF16_CHECK )   library
+
+  /8              PCRE_UTF32          ) when using the 32-bit
+  /?              PCRE_NO_UTF32_CHECK )   library
+
+  /9              PCRE_NEVER_UTF
+  /A              PCRE_ANCHORED
+  /C              PCRE_AUTO_CALLOUT
+  /E              PCRE_DOLLAR_ENDONLY
+  /f              PCRE_FIRSTLINE
+  /J              PCRE_DUPNAMES
+  /N              PCRE_NO_AUTO_CAPTURE
+  /O              PCRE_NO_AUTO_POSSESS
+  /U              PCRE_UNGREEDY
+  /W              PCRE_UCP
+  /X              PCRE_EXTRA
+  /Y              PCRE_NO_START_OPTIMIZE
+  /<any>          PCRE_NEWLINE_ANY
+  /<anycrlf>      PCRE_NEWLINE_ANYCRLF
+  /<cr>           PCRE_NEWLINE_CR
+  /<crlf>         PCRE_NEWLINE_CRLF
+  /<lf>           PCRE_NEWLINE_LF
+  /<bsr_anycrlf>  PCRE_BSR_ANYCRLF
+  /<bsr_unicode>  PCRE_BSR_UNICODE
+  /<JS>           PCRE_JAVASCRIPT_COMPAT
+
+The modifiers that are enclosed in angle brackets are literal strings as shown, +including the angle brackets, but the letters within can be in either case. +This example sets multiline matching with CRLF as the line ending sequence: +
+  /^abc/m<CRLF>
+
+As well as turning on the PCRE_UTF8/16/32 option, the /8 modifier causes +all non-printing characters in output strings to be printed using the +\x{hh...} notation. Otherwise, those less than 0x100 are output in hex without +the curly brackets. +

+

+Full details of the PCRE options are given in the +pcreapi +documentation. +

+
+Finding all matches in a string +
+

+Searching for all possible matches within each subject string can be requested +by the /g or /G modifier. After finding a match, PCRE is called +again to search the remainder of the subject string. The difference between +/g and /G is that the former uses the startoffset argument to +pcre[16|32]_exec() to start searching at a new point within the entire +string (which is in effect what Perl does), whereas the latter passes over a +shortened substring. This makes a difference to the matching process if the +pattern begins with a lookbehind assertion (including \b or \B). +

+

+If any call to pcre[16|32]_exec() in a /g or /G sequence matches +an empty string, the next call is done with the PCRE_NOTEMPTY_ATSTART and +PCRE_ANCHORED flags set in order to search for another, non-empty, match at the +same point. If this second match fails, the start offset is advanced, and the +normal match is retried. This imitates the way Perl handles such cases when +using the /g modifier or the split() function. Normally, the start +offset is advanced by one character, but if the newline convention recognizes +CRLF as a newline, and the current character is CR followed by LF, an advance +of two is used. +

+
+Other modifiers +
+

+There are yet more modifiers for controlling the way pcretest +operates. +

+

+The /+ modifier requests that as well as outputting the substring that +matched the entire pattern, pcretest should in addition output the +remainder of the subject string. This is useful for tests where the subject +contains multiple copies of the same substring. If the + modifier appears +twice, the same action is taken for captured substrings. In each case the +remainder is output on the following line with a plus character following the +capture number. Note that this modifier must not immediately follow the /S +modifier because /S+ and /S++ have other meanings. +

+

+The /= modifier requests that the values of all potential captured +parentheses be output after a match. By default, only those up to the highest +one actually used in the match are output (corresponding to the return code +from pcre[16|32]_exec()). Values in the offsets vector corresponding to +higher numbers should be set to -1, and these are output as "<unset>". This +modifier gives a way of checking that this is happening. +

+

+The /B modifier is a debugging feature. It requests that pcretest +output a representation of the compiled code after compilation. Normally this +information contains length and offset values; however, if /Z is also +present, this data is replaced by spaces. This is a special feature for use in +the automatic test scripts; it ensures that the same output is generated for +different internal link sizes. +

+

+The /D modifier is a PCRE debugging feature, and is equivalent to +/BI, that is, both the /B and the /I modifiers. +

+

+The /F modifier causes pcretest to flip the byte order of the +2-byte and 4-byte fields in the compiled pattern. This facility is for testing +the feature in PCRE that allows it to execute patterns that were compiled on a +host with a different endianness. This feature is not available when the POSIX +interface to PCRE is being used, that is, when the /P pattern modifier is +specified. See also the section about saving and reloading compiled patterns +below. +

+

+The /I modifier requests that pcretest output information about the +compiled pattern (whether it is anchored, has a fixed first character, and +so on). It does this by calling pcre[16|32]_fullinfo() after compiling a +pattern. If the pattern is studied, the results of that are also output. In +this output, the word "char" means a non-UTF character, that is, the value of a +single data item (8-bit, 16-bit, or 32-bit, depending on the library that is +being tested). +

+

+The /K modifier requests pcretest to show names from backtracking +control verbs that are returned from calls to pcre[16|32]_exec(). It causes +pcretest to create a pcre[16|32]_extra block if one has not already +been created by a call to pcre[16|32]_study(), and to set the +PCRE_EXTRA_MARK flag and the mark field within it, every time that +pcre[16|32]_exec() is called. If the variable that the mark field +points to is non-NULL for a match, non-match, or partial match, pcretest +prints the string to which it points. For a match, this is shown on a line by +itself, tagged with "MK:". For a non-match it is added to the message. +

+

+The /L modifier must be followed directly by the name of a locale, for +example, +

+  /pattern/Lfr_FR
+
+For this reason, it must be the last modifier. The given locale is set, +pcre[16|32]_maketables() is called to build a set of character tables for +the locale, and this is then passed to pcre[16|32]_compile() when compiling +the regular expression. Without an /L (or /T) modifier, NULL is +passed as the tables pointer; that is, /L applies only to the expression +on which it appears. +

+

+The /M modifier causes the size in bytes of the memory block used to hold +the compiled pattern to be output. This does not include the size of the +pcre[16|32] block; it is just the actual compiled data. If the pattern is +successfully studied with the PCRE_STUDY_JIT_COMPILE option, the size of the +JIT compiled code is also output. +

+

+The /Q modifier is used to test the use of pcre_stack_guard. It +must be followed by '0' or '1', specifying the return code to be given from an +external function that is passed to PCRE and used for stack checking during +compilation (see the +pcreapi +documentation for details). +

+

+The /S modifier causes pcre[16|32]_study() to be called after the +expression has been compiled, and the results used when the expression is +matched. There are a number of qualifying characters that may follow /S. +They may appear in any order. +

+

+If /S is followed by an exclamation mark, pcre[16|32]_study() is +called with the PCRE_STUDY_EXTRA_NEEDED option, causing it always to return a +pcre_extra block, even when studying discovers no useful information. +

+

+If /S is followed by a second S character, it suppresses studying, even +if it was requested externally by the -s command line option. This makes +it possible to specify that certain patterns are always studied, and others are +never studied, independently of -s. This feature is used in the test +files in a few cases where the output is different when the pattern is studied. +

+

+If the /S modifier is followed by a + character, the call to +pcre[16|32]_study() is made with all the JIT study options, requesting +just-in-time optimization support if it is available, for both normal and +partial matching. If you want to restrict the JIT compiling modes, you can +follow /S+ with a digit in the range 1 to 7: +

+  1  normal match only
+  2  soft partial match only
+  3  normal match and soft partial match
+  4  hard partial match only
+  6  soft and hard partial match
+  7  all three modes (default)
+
+If /S++ is used instead of /S+ (with or without a following digit), +the text "(JIT)" is added to the first output line after a match or no match +when JIT-compiled code was actually used. +

+

+Note that there is also an independent /+ modifier; it must not be given +immediately after /S or /S+ because this will be misinterpreted. +

+

+If JIT studying is successful, the compiled JIT code will automatically be used +when pcre[16|32]_exec() is run, except when incompatible run-time options +are specified. For more details, see the +pcrejit +documentation. See also the \J escape sequence below for a way of +setting the size of the JIT stack. +

+

+Finally, if /S is followed by a minus character, JIT compilation is +suppressed, even if it was requested externally by the -s command line +option. This makes it possible to specify that JIT is never to be used for +certain patterns. +

+

+The /T modifier must be followed by a single digit. It causes a specific +set of built-in character tables to be passed to pcre[16|32]_compile(). It +is used in the standard PCRE tests to check behaviour with different character +tables. The digit specifies the tables as follows: +

+  0   the default ASCII tables, as distributed in
+        pcre_chartables.c.dist
+  1   a set of tables defining ISO 8859 characters
+
+In table 1, some characters whose codes are greater than 128 are identified as +letters, digits, spaces, etc. +

+
+Using the POSIX wrapper API +
+

+The /P modifier causes pcretest to call PCRE via the POSIX wrapper +API rather than its native API. This supports only the 8-bit library. When +/P is set, the following modifiers set options for the regcomp() +function: +

+  /i    REG_ICASE
+  /m    REG_NEWLINE
+  /N    REG_NOSUB
+  /s    REG_DOTALL     )
+  /U    REG_UNGREEDY   ) These options are not part of
+  /W    REG_UCP        )   the POSIX standard
+  /8    REG_UTF8       )
+
+The /+ modifier works as described above. All other modifiers are +ignored. +

+
+Locking out certain modifiers +
+

+PCRE can be compiled with or without support for certain features such as +UTF-8/16/32 or Unicode properties. Accordingly, the standard tests are split up +into a number of different files that are selected for running depending on +which features are available. When updating the tests, it is all too easy to +put a new test into the wrong file by mistake; for example, to put a test that +requires UTF support into a file that is used when it is not available. To help +detect such mistakes as early as possible, there is a facility for locking out +specific modifiers. If an input line for pcretest starts with the string +"< forbid " the following sequence of characters is taken as a list of +forbidden modifiers. For example, in the test files that must not use UTF or +Unicode property support, this line appears: +

+  < forbid 8W
+
+This locks out the /8 and /W modifiers. An immediate error is given if they are +subsequently encountered. If the character string contains < but not >, all the +multi-character modifiers that begin with < are locked out. Otherwise, such +modifiers must be explicitly listed, for example: +
+  < forbid <JS><cr>
+
+There must be a single space between < and "forbid" for this feature to be +recognised. If there is not, the line is interpreted either as a request to +re-load a pre-compiled pattern (see "SAVING AND RELOADING COMPILED PATTERNS" +below) or, if there is a another < character, as a pattern that uses < as its +delimiter. +

+
DATA LINES
+

+Before each data line is passed to pcre[16|32]_exec(), leading and trailing +white space is removed, and it is then scanned for \ escapes. Some of these +are pretty esoteric features, intended for checking out some of the more +complicated features of PCRE. If you are just testing "ordinary" regular +expressions, you probably don't need any of these. The following escapes are +recognized: +

+  \a         alarm (BEL, \x07)
+  \b         backspace (\x08)
+  \e         escape (\x27)
+  \f         form feed (\x0c)
+  \n         newline (\x0a)
+  \qdd       set the PCRE_MATCH_LIMIT limit to dd (any number of digits)
+  \r         carriage return (\x0d)
+  \t         tab (\x09)
+  \v         vertical tab (\x0b)
+  \nnn       octal character (up to 3 octal digits); always
+               a byte unless > 255 in UTF-8 or 16-bit or 32-bit mode
+  \o{dd...}  octal character (any number of octal digits}
+  \xhh       hexadecimal byte (up to 2 hex digits)
+  \x{hh...}  hexadecimal character (any number of hex digits)
+  \A         pass the PCRE_ANCHORED option to pcre[16|32]_exec() or pcre[16|32]_dfa_exec()
+  \B         pass the PCRE_NOTBOL option to pcre[16|32]_exec() or pcre[16|32]_dfa_exec()
+  \Cdd       call pcre[16|32]_copy_substring() for substring dd after a successful match (number less than 32)
+  \Cname     call pcre[16|32]_copy_named_substring() for substring "name" after a successful match (name termin-
+               ated by next non alphanumeric character)
+  \C+        show the current captured substrings at callout time
+  \C-        do not supply a callout function
+  \C!n       return 1 instead of 0 when callout number n is reached
+  \C!n!m     return 1 instead of 0 when callout number n is reached for the nth time
+  \C*n       pass the number n (may be negative) as callout data; this is used as the callout return value
+  \D         use the pcre[16|32]_dfa_exec() match function
+  \F         only shortest match for pcre[16|32]_dfa_exec()
+  \Gdd       call pcre[16|32]_get_substring() for substring dd after a successful match (number less than 32)
+  \Gname     call pcre[16|32]_get_named_substring() for substring "name" after a successful match (name termin-
+               ated by next non-alphanumeric character)
+  \Jdd       set up a JIT stack of dd kilobytes maximum (any number of digits)
+  \L         call pcre[16|32]_get_substringlist() after a successful match
+  \M         discover the minimum MATCH_LIMIT and MATCH_LIMIT_RECURSION settings
+  \N         pass the PCRE_NOTEMPTY option to pcre[16|32]_exec() or pcre[16|32]_dfa_exec(); if used twice, pass the
+               PCRE_NOTEMPTY_ATSTART option
+  \Odd       set the size of the output vector passed to pcre[16|32]_exec() to dd (any number of digits)
+  \P         pass the PCRE_PARTIAL_SOFT option to pcre[16|32]_exec() or pcre[16|32]_dfa_exec(); if used twice, pass the
+               PCRE_PARTIAL_HARD option
+  \Qdd       set the PCRE_MATCH_LIMIT_RECURSION limit to dd (any number of digits)
+  \R         pass the PCRE_DFA_RESTART option to pcre[16|32]_dfa_exec()
+  \S         output details of memory get/free calls during matching
+  \Y         pass the PCRE_NO_START_OPTIMIZE option to pcre[16|32]_exec() or pcre[16|32]_dfa_exec()
+  \Z         pass the PCRE_NOTEOL option to pcre[16|32]_exec() or pcre[16|32]_dfa_exec()
+  \?         pass the PCRE_NO_UTF[8|16|32]_CHECK option to pcre[16|32]_exec() or pcre[16|32]_dfa_exec()
+  \>dd       start the match at offset dd (optional "-"; then any number of digits); this sets the startoffset
+               argument for pcre[16|32]_exec() or pcre[16|32]_dfa_exec()
+  \<cr>      pass the PCRE_NEWLINE_CR option to pcre[16|32]_exec() or pcre[16|32]_dfa_exec()
+  \<lf>      pass the PCRE_NEWLINE_LF option to pcre[16|32]_exec() or pcre[16|32]_dfa_exec()
+  \<crlf>    pass the PCRE_NEWLINE_CRLF option to pcre[16|32]_exec() or pcre[16|32]_dfa_exec()
+  \<anycrlf> pass the PCRE_NEWLINE_ANYCRLF option to pcre[16|32]_exec() or pcre[16|32]_dfa_exec()
+  \<any>     pass the PCRE_NEWLINE_ANY option to pcre[16|32]_exec() or pcre[16|32]_dfa_exec()
+
+The use of \x{hh...} is not dependent on the use of the /8 modifier on +the pattern. It is recognized always. There may be any number of hexadecimal +digits inside the braces; invalid values provoke error messages. +

+

+Note that \xhh specifies one byte rather than one character in UTF-8 mode; +this makes it possible to construct invalid UTF-8 sequences for testing +purposes. On the other hand, \x{hh} is interpreted as a UTF-8 character in +UTF-8 mode, generating more than one byte if the value is greater than 127. +When testing the 8-bit library not in UTF-8 mode, \x{hh} generates one byte +for values less than 256, and causes an error for greater values. +

+

+In UTF-16 mode, all 4-digit \x{hhhh} values are accepted. This makes it +possible to construct invalid UTF-16 sequences for testing purposes. +

+

+In UTF-32 mode, all 4- to 8-digit \x{...} values are accepted. This makes it +possible to construct invalid UTF-32 sequences for testing purposes. +

+

+The escapes that specify line ending sequences are literal strings, exactly as +shown. No more than one newline setting should be present in any data line. +

+

+A backslash followed by anything else just escapes the anything else. If +the very last character is a backslash, it is ignored. This gives a way of +passing an empty line as data, since a real empty line terminates the data +input. +

+

+The \J escape provides a way of setting the maximum stack size that is +used by the just-in-time optimization code. It is ignored if JIT optimization +is not being used. Providing a stack that is larger than the default 32K is +necessary only for very complicated patterns. +

+

+If \M is present, pcretest calls pcre[16|32]_exec() several times, +with different values in the match_limit and match_limit_recursion +fields of the pcre[16|32]_extra data structure, until it finds the minimum +numbers for each parameter that allow pcre[16|32]_exec() to complete without +error. Because this is testing a specific feature of the normal interpretive +pcre[16|32]_exec() execution, the use of any JIT optimization that might +have been set up by the /S+ qualifier of -s+ option is disabled. +

+

+The match_limit number is a measure of the amount of backtracking +that takes place, and checking it out can be instructive. For most simple +matches, the number is quite small, but for patterns with very large numbers of +matching possibilities, it can become large very quickly with increasing length +of subject string. The match_limit_recursion number is a measure of how +much stack (or, if PCRE is compiled with NO_RECURSE, how much heap) memory is +needed to complete the match attempt. +

+

+When \O is used, the value specified may be higher or lower than the size set +by the -O command line option (or defaulted to 45); \O applies only to +the call of pcre[16|32]_exec() for the line in which it appears. +

+

+If the /P modifier was present on the pattern, causing the POSIX wrapper +API to be used, the only option-setting sequences that have any effect are \B, +\N, and \Z, causing REG_NOTBOL, REG_NOTEMPTY, and REG_NOTEOL, respectively, +to be passed to regexec(). +

+
THE ALTERNATIVE MATCHING FUNCTION
+

+By default, pcretest uses the standard PCRE matching function, +pcre[16|32]_exec() to match each data line. PCRE also supports an +alternative matching function, pcre[16|32]_dfa_test(), which operates in a +different way, and has some restrictions. The differences between the two +functions are described in the +pcrematching +documentation. +

+

+If a data line contains the \D escape sequence, or if the command line +contains the -dfa option, the alternative matching function is used. +This function finds all possible matches at a given point. If, however, the \F +escape sequence is present in the data line, it stops after the first match is +found. This is always the shortest possible match. +

+
DEFAULT OUTPUT FROM PCRETEST
+

+This section describes the output when the normal matching function, +pcre[16|32]_exec(), is being used. +

+

+When a match succeeds, pcretest outputs the list of captured substrings +that pcre[16|32]_exec() returns, starting with number 0 for the string that +matched the whole pattern. Otherwise, it outputs "No match" when the return is +PCRE_ERROR_NOMATCH, and "Partial match:" followed by the partially matching +substring when pcre[16|32]_exec() returns PCRE_ERROR_PARTIAL. (Note that +this is the entire substring that was inspected during the partial match; it +may include characters before the actual match start if a lookbehind assertion, +\K, \b, or \B was involved.) For any other return, pcretest outputs +the PCRE negative error number and a short descriptive phrase. If the error is +a failed UTF string check, the offset of the start of the failing character and +the reason code are also output, provided that the size of the output vector is +at least two. Here is an example of an interactive pcretest run. +

+  $ pcretest
+  PCRE version 8.13 2011-04-30
+
+    re> /^abc(\d+)/
+  data> abc123
+   0: abc123
+   1: 123
+  data> xyz
+  No match
+
+Unset capturing substrings that are not followed by one that is set are not +returned by pcre[16|32]_exec(), and are not shown by pcretest. In the +following example, there are two capturing substrings, but when the first data +line is matched, the second, unset substring is not shown. An "internal" unset +substring is shown as "<unset>", as for the second data line. +
+    re> /(a)|(b)/
+  data> a
+   0: a
+   1: a
+  data> b
+   0: b
+   1: <unset>
+   2: b
+
+If the strings contain any non-printing characters, they are output as \xhh +escapes if the value is less than 256 and UTF mode is not set. Otherwise they +are output as \x{hh...} escapes. See below for the definition of non-printing +characters. If the pattern has the /+ modifier, the output for substring +0 is followed by the the rest of the subject string, identified by "0+" like +this: +
+    re> /cat/+
+  data> cataract
+   0: cat
+   0+ aract
+
+If the pattern has the /g or /G modifier, the results of successive +matching attempts are output in sequence, like this: +
+    re> /\Bi(\w\w)/g
+  data> Mississippi
+   0: iss
+   1: ss
+   0: iss
+   1: ss
+   0: ipp
+   1: pp
+
+"No match" is output only if the first match attempt fails. Here is an example +of a failure message (the offset 4 that is specified by \>4 is past the end of +the subject string): +
+    re> /xyz/
+  data> xyz\>4
+  Error -24 (bad offset value)
+
+

+

+If any of the sequences \C, \G, or \L are present in a +data line that is successfully matched, the substrings extracted by the +convenience functions are output with C, G, or L after the string number +instead of a colon. This is in addition to the normal full list. The string +length (that is, the return from the extraction function) is given in +parentheses after each string for \C and \G. +

+

+Note that whereas patterns can be continued over several lines (a plain ">" +prompt is used for continuations), data lines may not. However newlines can be +included in data by means of the \n escape (or \r, \r\n, etc., depending on +the newline sequence setting). +

+
OUTPUT FROM THE ALTERNATIVE MATCHING FUNCTION
+

+When the alternative matching function, pcre[16|32]_dfa_exec(), is used (by +means of the \D escape sequence or the -dfa command line option), the +output consists of a list of all the matches that start at the first point in +the subject where there is at least one match. For example: +

+    re> /(tang|tangerine|tan)/
+  data> yellow tangerine\D
+   0: tangerine
+   1: tang
+   2: tan
+
+(Using the normal matching function on this data finds only "tang".) The +longest matching string is always given first (and numbered zero). After a +PCRE_ERROR_PARTIAL return, the output is "Partial match:", followed by the +partially matching substring. (Note that this is the entire substring that was +inspected during the partial match; it may include characters before the actual +match start if a lookbehind assertion, \K, \b, or \B was involved.) +

+

+If /g is present on the pattern, the search for further matches resumes +at the end of the longest match. For example: +

+    re> /(tang|tangerine|tan)/g
+  data> yellow tangerine and tangy sultana\D
+   0: tangerine
+   1: tang
+   2: tan
+   0: tang
+   1: tan
+   0: tan
+
+Since the matching function does not support substring capture, the escape +sequences that are concerned with captured substrings are not relevant. +

+
RESTARTING AFTER A PARTIAL MATCH
+

+When the alternative matching function has given the PCRE_ERROR_PARTIAL return, +indicating that the subject partially matched the pattern, you can restart the +match with additional subject data by means of the \R escape sequence. For +example: +

+    re> /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/
+  data> 23ja\P\D
+  Partial match: 23ja
+  data> n05\R\D
+   0: n05
+
+For further information about partial matching, see the +pcrepartial +documentation. +

+
CALLOUTS
+

+If the pattern contains any callout requests, pcretest's callout function +is called during matching. This works with both matching functions. By default, +the called function displays the callout number, the start and current +positions in the text at the callout time, and the next pattern item to be +tested. For example: +

+  --->pqrabcdef
+    0    ^  ^     \d
+
+This output indicates that callout number 0 occurred for a match attempt +starting at the fourth character of the subject string, when the pointer was at +the seventh character of the data, and when the next pattern item was \d. Just +one circumflex is output if the start and current positions are the same. +

+

+Callouts numbered 255 are assumed to be automatic callouts, inserted as a +result of the /C pattern modifier. In this case, instead of showing the +callout number, the offset in the pattern, preceded by a plus, is output. For +example: +

+    re> /\d?[A-E]\*/C
+  data> E*
+  --->E*
+   +0 ^      \d?
+   +3 ^      [A-E]
+   +8 ^^     \*
+  +10 ^ ^
+   0: E*
+
+If a pattern contains (*MARK) items, an additional line is output whenever +a change of latest mark is passed to the callout function. For example: +
+    re> /a(*MARK:X)bc/C
+  data> abc
+  --->abc
+   +0 ^       a
+   +1 ^^      (*MARK:X)
+  +10 ^^      b
+  Latest Mark: X
+  +11 ^ ^     c
+  +12 ^  ^
+   0: abc
+
+The mark changes between matching "a" and "b", but stays the same for the rest +of the match, so nothing more is output. If, as a result of backtracking, the +mark reverts to being unset, the text "<unset>" is output. +

+

+The callout function in pcretest returns zero (carry on matching) by +default, but you can use a \C item in a data line (as described above) to +change this and other parameters of the callout. +

+

+Inserting callouts can be helpful when using pcretest to check +complicated regular expressions. For further information about callouts, see +the +pcrecallout +documentation. +

+
NON-PRINTING CHARACTERS
+

+When pcretest is outputting text in the compiled version of a pattern, +bytes other than 32-126 are always treated as non-printing characters are are +therefore shown as hex escapes. +

+

+When pcretest is outputting text that is a matched part of a subject +string, it behaves in the same way, unless a different locale has been set for +the pattern (using the /L modifier). In this case, the isprint() +function to distinguish printing and non-printing characters. +

+
SAVING AND RELOADING COMPILED PATTERNS
+

+The facilities described in this section are not available when the POSIX +interface to PCRE is being used, that is, when the /P pattern modifier is +specified. +

+

+When the POSIX interface is not in use, you can cause pcretest to write a +compiled pattern to a file, by following the modifiers with > and a file name. +For example: +

+  /pattern/im >/some/file
+
+See the +pcreprecompile +documentation for a discussion about saving and re-using compiled patterns. +Note that if the pattern was successfully studied with JIT optimization, the +JIT data cannot be saved. +

+

+The data that is written is binary. The first eight bytes are the length of the +compiled pattern data followed by the length of the optional study data, each +written as four bytes in big-endian order (most significant byte first). If +there is no study data (either the pattern was not studied, or studying did not +return any data), the second length is zero. The lengths are followed by an +exact copy of the compiled pattern. If there is additional study data, this +(excluding any JIT data) follows immediately after the compiled pattern. After +writing the file, pcretest expects to read a new pattern. +

+

+A saved pattern can be reloaded into pcretest by specifying < and a file +name instead of a pattern. There must be no space between < and the file name, +which must not contain a < character, as otherwise pcretest will +interpret the line as a pattern delimited by < characters. For example: +

+   re> </some/file
+  Compiled pattern loaded from /some/file
+  No study data
+
+If the pattern was previously studied with the JIT optimization, the JIT +information cannot be saved and restored, and so is lost. When the pattern has +been loaded, pcretest proceeds to read data lines in the usual way. +

+

+You can copy a file written by pcretest to a different host and reload it +there, even if the new host has opposite endianness to the one on which the +pattern was compiled. For example, you can compile on an i86 machine and run on +a SPARC machine. When a pattern is reloaded on a host with different +endianness, the confirmation message is changed to: +

+  Compiled pattern (byte-inverted) loaded from /some/file
+
+The test suite contains some saved pre-compiled patterns with different +endianness. These are reloaded using "<!" instead of just "<". This suppresses +the "(byte-inverted)" text so that the output is the same on all hosts. It also +forces debugging output once the pattern has been reloaded. +

+

+File names for saving and reloading can be absolute or relative, but note that +the shell facility of expanding a file name that starts with a tilde (~) is not +available. +

+

+The ability to save and reload files in pcretest is intended for testing +and experimentation. It is not intended for production use because only a +single pattern can be written to a file. Furthermore, there is no facility for +supplying custom character tables for use with a reloaded pattern. If the +original pattern was compiled with custom tables, an attempt to match a subject +string using a reloaded pattern is likely to cause pcretest to crash. +Finally, if you attempt to load a file that is not in the correct format, the +result is undefined. +

+
SEE ALSO
+

+pcre(3), pcre16(3), pcre32(3), pcreapi(3), +pcrecallout(3), +pcrejit, pcrematching(3), pcrepartial(d), +pcrepattern(3), pcreprecompile(3). +

+
AUTHOR
+

+Philip Hazel +
+University Computing Service +
+Cambridge CB2 3QH, England. +
+

+
REVISION
+

+Last updated: 10 February 2020 +
+Copyright © 1997-2020 University of Cambridge. +
+

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcreunicode.html b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcreunicode.html new file mode 100644 index 0000000000000000000000000000000000000000..ab36bc61e37d9beb35be41582ab4cec6728af4b5 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/share/doc/pcre/html/pcreunicode.html @@ -0,0 +1,262 @@ + + +pcreunicode specification + + +

pcreunicode man page

+

+Return to the PCRE index page. +

+

+This page is part of the PCRE HTML documentation. It was generated automatically +from the original man page. If there is any nonsense in it, please consult the +man page, in case the conversion went wrong. +
+
+UTF-8, UTF-16, UTF-32, AND UNICODE PROPERTY SUPPORT +
+

+As well as UTF-8 support, PCRE also supports UTF-16 (from release 8.30) and +UTF-32 (from release 8.32), by means of two additional libraries. They can be +built as well as, or instead of, the 8-bit library. +

+
+UTF-8 SUPPORT +
+

+In order process UTF-8 strings, you must build PCRE's 8-bit library with UTF +support, and, in addition, you must call +pcre_compile() +with the PCRE_UTF8 option flag, or the pattern must start with the sequence +(*UTF8) or (*UTF). When either of these is the case, both the pattern and any +subject strings that are matched against it are treated as UTF-8 strings +instead of strings of individual 1-byte characters. +

+
+UTF-16 AND UTF-32 SUPPORT +
+

+In order process UTF-16 or UTF-32 strings, you must build PCRE's 16-bit or +32-bit library with UTF support, and, in addition, you must call +pcre16_compile() +or +pcre32_compile() +with the PCRE_UTF16 or PCRE_UTF32 option flag, as appropriate. Alternatively, +the pattern must start with the sequence (*UTF16), (*UTF32), as appropriate, or +(*UTF), which can be used with either library. When UTF mode is set, both the +pattern and any subject strings that are matched against it are treated as +UTF-16 or UTF-32 strings instead of strings of individual 16-bit or 32-bit +characters. +

+
+UTF SUPPORT OVERHEAD +
+

+If you compile PCRE with UTF support, but do not use it at run time, the +library will be a bit bigger, but the additional run time overhead is limited +to testing the PCRE_UTF[8|16|32] flag occasionally, so should not be very big. +

+
+UNICODE PROPERTY SUPPORT +
+

+If PCRE is built with Unicode character property support (which implies UTF +support), the escape sequences \p{..}, \P{..}, and \X can be used. +The available properties that can be tested are limited to the general +category properties such as Lu for an upper case letter or Nd for a decimal +number, the Unicode script names such as Arabic or Han, and the derived +properties Any and L&. Full lists is given in the +pcrepattern +and +pcresyntax +documentation. Only the short names for properties are supported. For example, +\p{L} matches a letter. Its Perl synonym, \p{Letter}, is not supported. +Furthermore, in Perl, many properties may optionally be prefixed by "Is", for +compatibility with Perl 5.6. PCRE does not support this. +

+
+Validity of UTF-8 strings +
+

+When you set the PCRE_UTF8 flag, the byte strings passed as patterns and +subjects are (by default) checked for validity on entry to the relevant +functions. The entire string is checked before any other processing takes +place. From release 7.3 of PCRE, the check is according the rules of RFC 3629, +which are themselves derived from the Unicode specification. Earlier releases +of PCRE followed the rules of RFC 2279, which allows the full range of 31-bit +values (0 to 0x7FFFFFFF). The current check allows only values in the range U+0 +to U+10FFFF, excluding the surrogate area. (From release 8.33 the so-called +"non-character" code points are no longer excluded because Unicode corrigendum +#9 makes it clear that they should not be.) +

+

+Characters in the "Surrogate Area" of Unicode are reserved for use by UTF-16, +where they are used in pairs to encode codepoints with values greater than +0xFFFF. The code points that are encoded by UTF-16 pairs are available +independently in the UTF-8 and UTF-32 encodings. (In other words, the whole +surrogate thing is a fudge for UTF-16 which unfortunately messes up UTF-8 and +UTF-32.) +

+

+If an invalid UTF-8 string is passed to PCRE, an error return is given. At +compile time, the only additional information is the offset to the first byte +of the failing character. The run-time functions pcre_exec() and +pcre_dfa_exec() also pass back this information, as well as a more +detailed reason code if the caller has provided memory in which to do this. +

+

+In some situations, you may already know that your strings are valid, and +therefore want to skip these checks in order to improve performance, for +example in the case of a long subject string that is being scanned repeatedly. +If you set the PCRE_NO_UTF8_CHECK flag at compile time or at run time, PCRE +assumes that the pattern or subject it is given (respectively) contains only +valid UTF-8 codes. In this case, it does not diagnose an invalid UTF-8 string. +

+

+Note that passing PCRE_NO_UTF8_CHECK to pcre_compile() just disables the +check for the pattern; it does not also apply to subject strings. If you want +to disable the check for a subject string you must pass this option to +pcre_exec() or pcre_dfa_exec(). +

+

+If you pass an invalid UTF-8 string when PCRE_NO_UTF8_CHECK is set, the result +is undefined and your program may crash. +

+
+Validity of UTF-16 strings +
+

+When you set the PCRE_UTF16 flag, the strings of 16-bit data units that are +passed as patterns and subjects are (by default) checked for validity on entry +to the relevant functions. Values other than those in the surrogate range +U+D800 to U+DFFF are independent code points. Values in the surrogate range +must be used in pairs in the correct manner. +

+

+If an invalid UTF-16 string is passed to PCRE, an error return is given. At +compile time, the only additional information is the offset to the first data +unit of the failing character. The run-time functions pcre16_exec() and +pcre16_dfa_exec() also pass back this information, as well as a more +detailed reason code if the caller has provided memory in which to do this. +

+

+In some situations, you may already know that your strings are valid, and +therefore want to skip these checks in order to improve performance. If you set +the PCRE_NO_UTF16_CHECK flag at compile time or at run time, PCRE assumes that +the pattern or subject it is given (respectively) contains only valid UTF-16 +sequences. In this case, it does not diagnose an invalid UTF-16 string. +However, if an invalid string is passed, the result is undefined. +

+
+Validity of UTF-32 strings +
+

+When you set the PCRE_UTF32 flag, the strings of 32-bit data units that are +passed as patterns and subjects are (by default) checked for validity on entry +to the relevant functions. This check allows only values in the range U+0 +to U+10FFFF, excluding the surrogate area U+D800 to U+DFFF. +

+

+If an invalid UTF-32 string is passed to PCRE, an error return is given. At +compile time, the only additional information is the offset to the first data +unit of the failing character. The run-time functions pcre32_exec() and +pcre32_dfa_exec() also pass back this information, as well as a more +detailed reason code if the caller has provided memory in which to do this. +

+

+In some situations, you may already know that your strings are valid, and +therefore want to skip these checks in order to improve performance. If you set +the PCRE_NO_UTF32_CHECK flag at compile time or at run time, PCRE assumes that +the pattern or subject it is given (respectively) contains only valid UTF-32 +sequences. In this case, it does not diagnose an invalid UTF-32 string. +However, if an invalid string is passed, the result is undefined. +

+
+General comments about UTF modes +
+

+1. Codepoints less than 256 can be specified in patterns by either braced or +unbraced hexadecimal escape sequences (for example, \x{b3} or \xb3). Larger +values have to use braced sequences. +

+

+2. Octal numbers up to \777 are recognized, and in UTF-8 mode they match +two-byte characters for values greater than \177. +

+

+3. Repeat quantifiers apply to complete UTF characters, not to individual +data units, for example: \x{100}{3}. +

+

+4. The dot metacharacter matches one UTF character instead of a single data +unit. +

+

+5. The escape sequence \C can be used to match a single byte in UTF-8 mode, or +a single 16-bit data unit in UTF-16 mode, or a single 32-bit data unit in +UTF-32 mode, but its use can lead to some strange effects because it breaks up +multi-unit characters (see the description of \C in the +pcrepattern +documentation). The use of \C is not supported in the alternative matching +function pcre[16|32]_dfa_exec(), nor is it supported in UTF mode by the +JIT optimization of pcre[16|32]_exec(). If JIT optimization is requested +for a UTF pattern that contains \C, it will not succeed, and so the matching +will be carried out by the normal interpretive function. +

+

+6. The character escapes \b, \B, \d, \D, \s, \S, \w, and \W correctly +test characters of any code value, but, by default, the characters that PCRE +recognizes as digits, spaces, or word characters remain the same set as in +non-UTF mode, all with values less than 256. This remains true even when PCRE +is built to include Unicode property support, because to do otherwise would +slow down PCRE in many common cases. Note in particular that this applies to +\b and \B, because they are defined in terms of \w and \W. If you really +want to test for a wider sense of, say, "digit", you can use explicit Unicode +property tests such as \p{Nd}. Alternatively, if you set the PCRE_UCP option, +the way that the character escapes work is changed so that Unicode properties +are used to determine which characters match. There are more details in the +section on +generic character types +in the +pcrepattern +documentation. +

+

+7. Similarly, characters that match the POSIX named character classes are all +low-valued characters, unless the PCRE_UCP option is set. +

+

+8. However, the horizontal and vertical white space matching escapes (\h, \H, +\v, and \V) do match all the appropriate Unicode characters, whether or not +PCRE_UCP is set. +

+

+9. Case-insensitive matching applies only to characters whose values are less +than 128, unless PCRE is built with Unicode property support. A few Unicode +characters such as Greek sigma have more than two codepoints that are +case-equivalent. Up to and including PCRE release 8.31, only one-to-one case +mappings were supported, but later releases (with Unicode property support) do +treat as case-equivalent all versions of characters such as Greek sigma. +

+
+AUTHOR +
+

+Philip Hazel +
+University Computing Service +
+Cambridge CB2 3QH, England. +
+

+
+REVISION +
+

+Last updated: 27 February 2013 +
+Copyright © 1997-2013 University of Cambridge. +
+

+Return to the PCRE index page. +

diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/about.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/about.json new file mode 100644 index 0000000000000000000000000000000000000000..ab7a183f1f567bf546808b0d46a4f9527e4e1371 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/about.json @@ -0,0 +1,186 @@ +{ + "channels": [ + "https://conda.anaconda.org/conda-forge", + "https://repo.anaconda.com/pkgs/main" + ], + "conda_build_version": "3.21.4", + "conda_private": false, + "conda_version": "4.10.1", + "env_vars": { + "CIO_TEST": "" + }, + "extra": { + "copy_test_source_files": true, + "final": true, + "recipe-maintainers": [ + "jakirkham", + "scopatz", + "sebastian-luna-valero", + "saraedum", + "ocefpaf" + ] + }, + "home": "http://www.pcre.org/", + "identifiers": [], + "keywords": [], + "license": "BSD-3-Clause", + "license_file": "LICENCE", + "root_pkgs": [ + "anaconda-client 1.7.2 pyhd8ed1ab_1", + "attrs 21.2.0 pyhd8ed1ab_0", + "beautifulsoup4 4.9.3 pyhb0f4dca_0", + "brotlipy 0.7.0 py36h68aa20f_1001", + "bzip2 1.0.8 h8ffe710_4", + "ca-certificates 2021.5.30 h5b45459_0", + "certifi 2021.5.30 py36ha15d459_0", + "cffi 1.14.5 py36he58ceb7_0", + "chardet 4.0.0 py36ha15d459_1", + "click 8.0.1 py36ha15d459_0", + "clyent 1.2.2 py_1", + "colorama 0.4.4 pyh9f0ad1d_0", + "conda 4.10.1 py36ha15d459_0", + "conda-build 3.21.4 py36ha15d459_0", + "conda-env 2.6.0 1", + "conda-forge-ci-setup 3.9.4 py36h6e52ffc_0", + "conda-package-handling 1.7.3 py36hb5e345e_0", + "console_shortcut 0.1.1 4", + "cryptography 3.4.7 py36hd0de82c_0", + "decorator 5.0.9 pyhd8ed1ab_0", + "filelock 3.0.12 pyh9f0ad1d_0", + "glob2 0.7 py_0", + "idna 2.10 pyhd3eb1b0_0", + "importlib-metadata 4.5.0 py36ha15d459_0", + "ipython_genutils 0.2.0 py_1", + "jinja2 3.0.1 pyhd8ed1ab_0", + "jsonschema 3.2.0 pyhd8ed1ab_3", + "jupyter_core 4.7.1 py36ha15d459_0", + "libarchive 3.5.1 hb45042f_2", + "libiconv 1.16 he774522_0", + "liblief 0.11.5 h0e60522_0", + "libxml2 2.9.12 hf5bbc77_0", + "lz4-c 1.9.3 h8ffe710_0", + "lzo 2.10 he774522_1000", + "m2-bash 4.3.042 5", + "m2-ca-certificates 20150426 103", + "m2-coreutils 8.25 102", + "m2-curl 7.47.1 3", + "m2-db 5.3.28 3", + "m2-expat 2.1.1 2", + "m2-findutils 4.6.0 2", + "m2-gcc-libs 5.3.0 4", + "m2-gdbm 1.11 4", + "m2-git 2.8.1 2", + "m2-gmp 6.1.0 3", + "m2-gzip 1.7 2", + "m2-heimdal 1.5.3 10", + "m2-heimdal-libs 1.5.3 10", + "m2-icu 56.1 2", + "m2-info 6.0 2", + "m2-less 481 2", + "m2-libcrypt 1.3 2", + "m2-libcurl 7.47.1 3", + "m2-libdb 5.3.28 3", + "m2-libedit 3.1 20150326", + "m2-libexpat 2.1.1 2", + "m2-libffi 3.2.1 2", + "m2-libgdbm 1.11 4", + "m2-libiconv 1.14 3", + "m2-libidn 1.32 2", + "m2-libintl 0.19.7 4", + "m2-libmetalink 0.1.2 3", + "m2-libopenssl 1.0.2.g 2", + "m2-libp11-kit 0.23.2 2", + "m2-libpcre 8.38 2", + "m2-libreadline 6.3.008 8", + "m2-libsqlite 3.10.0.0 2", + "m2-libssh2 1.6.0 2", + "m2-libtasn1 4.7 2", + "m2-msys2-runtime 2.5.0.17080.65c939c 3", + "m2-ncurses 6.0.20160220 2", + "m2-openssh 7.1p2 2", + "m2-openssl 1.0.2.g 2", + "m2-p11-kit 0.23.2 2", + "m2-patch 2.7.5 2", + "m2-perl 5.22.1 2", + "m2-perl-authen-sasl 2.16 3", + "m2-perl-convert-binhex 1.123 3", + "m2-perl-encode-locale 1.04 2", + "m2-perl-error 0.17024 2", + "m2-perl-file-listing 6.04 3", + "m2-perl-html-parser 3.71 4", + "m2-perl-html-tagset 3.20 3", + "m2-perl-http-cookies 6.01 3", + "m2-perl-http-daemon 6.01 3", + "m2-perl-http-date 6.02 3", + "m2-perl-http-message 6.06 3", + "m2-perl-http-negotiate 6.01 3", + "m2-perl-io-socket-ssl 2.016 2", + "m2-perl-io-stringy 2.111 2", + "m2-perl-libwww 6.13 2", + "m2-perl-lwp-mediatypes 6.02 3", + "m2-perl-mailtools 2.14 2", + "m2-perl-mime-tools 5.506 2", + "m2-perl-net-http 6.09 2", + "m2-perl-net-smtp-ssl 1.02 2", + "m2-perl-net-ssleay 1.72 2", + "m2-perl-termreadkey 2.33 2", + "m2-perl-timedate 2.30 3", + "m2-perl-uri 1.68 2", + "m2-perl-www-robotrules 6.02 3", + "m2-sed 4.2.2 3", + "m2-vim 7.4.1721 2", + "m2-zlib 1.2.8 4", + "m2w64-gcc-libgfortran 5.3.0 6", + "m2w64-gcc-libs 5.3.0 7", + "m2w64-gcc-libs-core 5.3.0 7", + "m2w64-gmp 6.1.0 2", + "m2w64-libwinpthread-git 5.0.0.4634.697f757 2", + "markupsafe 2.0.1 py36h68aa20f_0", + "menuinst 1.4.16 py36h9f0ad1d_1", + "msys2-conda-epoch 20160418 1", + "nbformat 5.1.3 pyhd8ed1ab_0", + "openssl 1.1.1k h8ffe710_0", + "pip 21.1.2 pyhd8ed1ab_0", + "pkginfo 1.7.0 pyhd8ed1ab_0", + "powershell_shortcut 0.0.1 3", + "psutil 5.8.0 py36h68aa20f_1", + "py-lief 0.11.5 py36he2d232f_0", + "pycosat 0.6.3 py36h68aa20f_1006", + "pycparser 2.20 py_2", + "pyopenssl 20.0.1 pyhd3eb1b0_1", + "pyrsistent 0.17.3 py36h68aa20f_2", + "pysocks 1.7.1 py36ha15d459_3", + "python 3.6.13 h39d44d4_0_cpython", + "python-dateutil 2.8.1 py_0", + "python-libarchive-c 3.1 py36ha15d459_0", + "python_abi 3.6 1_cp36m", + "pytz 2021.1 pyhd8ed1ab_0", + "pywin32 300 py36h68aa20f_0", + "pyyaml 5.4.1 py36h68aa20f_0", + "requests 2.25.1 pyhd3eb1b0_0", + "ripgrep 13.0.0 h7f3b576_0", + "ruamel_yaml 0.15.80 py36h68aa20f_1004", + "setuptools 49.6.0 py36ha15d459_3", + "shyaml 0.6.2 pyhd3deb0d_0", + "six 1.16.0 pyhd3eb1b0_0", + "soupsieve 2.0.1 py_1", + "sqlite 3.35.4 h2bbff1b_0", + "tqdm 4.59.0 pyhd3eb1b0_1", + "traitlets 4.3.3 py36h9f0ad1d_1", + "typing_extensions 3.10.0.0 pyha770c72_0", + "urllib3 1.26.4 pyhd3eb1b0_0", + "vc 14.2 h21ff451_1", + "vs2008_express_vc_python_patch 1.0.0 0", + "vs2015_runtime 14.27.29016 h5e58377_2", + "wheel 0.36.2 pyhd3eb1b0_0", + "wincertstore 0.2 py36ha15d459_1006", + "win_inet_pton 1.1.0 py36ha15d459_2", + "xz 5.2.5 h62dcd97_1", + "yaml 0.2.5 he774522_0", + "zipp 3.4.1 pyhd8ed1ab_0", + "zlib 1.2.11 h62dcd97_1010", + "zstd 1.5.0 h6255e5f_0" + ], + "summary": "Regular expression pattern matching using the same syntax and semantics as Perl 5.", + "tags": [] +} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/files b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/files new file mode 100644 index 0000000000000000000000000000000000000000..60d9151f7650655ff169e75842a3bb1e9fe408c6 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/files @@ -0,0 +1,124 @@ +Library/bin/pcre-config +Library/bin/pcre.dll +Library/bin/pcre_scanner_unittest.exe +Library/bin/pcre_stringpiece_unittest.exe +Library/bin/pcrecpp.dll +Library/bin/pcrecpp_unittest.exe +Library/bin/pcregrep.exe +Library/bin/pcreposix.dll +Library/bin/pcretest.exe +Library/include/pcre.h +Library/include/pcre_scanner.h +Library/include/pcre_stringpiece.h +Library/include/pcrecpp.h +Library/include/pcrecpparg.h +Library/include/pcreposix.h +Library/lib/pcre.lib +Library/lib/pcrecpp.lib +Library/lib/pcreposix.lib +Library/lib/pkgconfig/libpcre.pc +Library/lib/pkgconfig/libpcrecpp.pc +Library/lib/pkgconfig/libpcreposix.pc +Library/man/man1/pcre-config.1 +Library/man/man1/pcregrep.1 +Library/man/man1/pcretest.1 +Library/man/man3/pcre.3 +Library/man/man3/pcre16.3 +Library/man/man3/pcre32.3 +Library/man/man3/pcre_assign_jit_stack.3 +Library/man/man3/pcre_compile.3 +Library/man/man3/pcre_compile2.3 +Library/man/man3/pcre_config.3 +Library/man/man3/pcre_copy_named_substring.3 +Library/man/man3/pcre_copy_substring.3 +Library/man/man3/pcre_dfa_exec.3 +Library/man/man3/pcre_exec.3 +Library/man/man3/pcre_free_study.3 +Library/man/man3/pcre_free_substring.3 +Library/man/man3/pcre_free_substring_list.3 +Library/man/man3/pcre_fullinfo.3 +Library/man/man3/pcre_get_named_substring.3 +Library/man/man3/pcre_get_stringnumber.3 +Library/man/man3/pcre_get_stringtable_entries.3 +Library/man/man3/pcre_get_substring.3 +Library/man/man3/pcre_get_substring_list.3 +Library/man/man3/pcre_jit_exec.3 +Library/man/man3/pcre_jit_stack_alloc.3 +Library/man/man3/pcre_jit_stack_free.3 +Library/man/man3/pcre_maketables.3 +Library/man/man3/pcre_pattern_to_host_byte_order.3 +Library/man/man3/pcre_refcount.3 +Library/man/man3/pcre_study.3 +Library/man/man3/pcre_utf16_to_host_byte_order.3 +Library/man/man3/pcre_utf32_to_host_byte_order.3 +Library/man/man3/pcre_version.3 +Library/man/man3/pcreapi.3 +Library/man/man3/pcrebuild.3 +Library/man/man3/pcrecallout.3 +Library/man/man3/pcrecompat.3 +Library/man/man3/pcrecpp.3 +Library/man/man3/pcredemo.3 +Library/man/man3/pcrejit.3 +Library/man/man3/pcrelimits.3 +Library/man/man3/pcrematching.3 +Library/man/man3/pcrepartial.3 +Library/man/man3/pcrepattern.3 +Library/man/man3/pcreperform.3 +Library/man/man3/pcreposix.3 +Library/man/man3/pcreprecompile.3 +Library/man/man3/pcresample.3 +Library/man/man3/pcrestack.3 +Library/man/man3/pcresyntax.3 +Library/man/man3/pcreunicode.3 +Library/share/doc/pcre/html/index.html +Library/share/doc/pcre/html/pcre-config.html +Library/share/doc/pcre/html/pcre.html +Library/share/doc/pcre/html/pcre16.html +Library/share/doc/pcre/html/pcre32.html +Library/share/doc/pcre/html/pcre_assign_jit_stack.html +Library/share/doc/pcre/html/pcre_compile.html +Library/share/doc/pcre/html/pcre_compile2.html +Library/share/doc/pcre/html/pcre_config.html +Library/share/doc/pcre/html/pcre_copy_named_substring.html +Library/share/doc/pcre/html/pcre_copy_substring.html +Library/share/doc/pcre/html/pcre_dfa_exec.html +Library/share/doc/pcre/html/pcre_exec.html +Library/share/doc/pcre/html/pcre_free_study.html +Library/share/doc/pcre/html/pcre_free_substring.html +Library/share/doc/pcre/html/pcre_free_substring_list.html +Library/share/doc/pcre/html/pcre_fullinfo.html +Library/share/doc/pcre/html/pcre_get_named_substring.html +Library/share/doc/pcre/html/pcre_get_stringnumber.html +Library/share/doc/pcre/html/pcre_get_stringtable_entries.html +Library/share/doc/pcre/html/pcre_get_substring.html +Library/share/doc/pcre/html/pcre_get_substring_list.html +Library/share/doc/pcre/html/pcre_jit_exec.html +Library/share/doc/pcre/html/pcre_jit_stack_alloc.html +Library/share/doc/pcre/html/pcre_jit_stack_free.html +Library/share/doc/pcre/html/pcre_maketables.html +Library/share/doc/pcre/html/pcre_pattern_to_host_byte_order.html +Library/share/doc/pcre/html/pcre_refcount.html +Library/share/doc/pcre/html/pcre_study.html +Library/share/doc/pcre/html/pcre_utf16_to_host_byte_order.html +Library/share/doc/pcre/html/pcre_utf32_to_host_byte_order.html +Library/share/doc/pcre/html/pcre_version.html +Library/share/doc/pcre/html/pcreapi.html +Library/share/doc/pcre/html/pcrebuild.html +Library/share/doc/pcre/html/pcrecallout.html +Library/share/doc/pcre/html/pcrecompat.html +Library/share/doc/pcre/html/pcrecpp.html +Library/share/doc/pcre/html/pcredemo.html +Library/share/doc/pcre/html/pcregrep.html +Library/share/doc/pcre/html/pcrejit.html +Library/share/doc/pcre/html/pcrelimits.html +Library/share/doc/pcre/html/pcrematching.html +Library/share/doc/pcre/html/pcrepartial.html +Library/share/doc/pcre/html/pcrepattern.html +Library/share/doc/pcre/html/pcreperform.html +Library/share/doc/pcre/html/pcreposix.html +Library/share/doc/pcre/html/pcreprecompile.html +Library/share/doc/pcre/html/pcresample.html +Library/share/doc/pcre/html/pcrestack.html +Library/share/doc/pcre/html/pcresyntax.html +Library/share/doc/pcre/html/pcretest.html +Library/share/doc/pcre/html/pcreunicode.html diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/git b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/git new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/has_prefix b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/has_prefix new file mode 100644 index 0000000000000000000000000000000000000000..ff5c300f823aa2109656e44aa8d7902fd812a338 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/has_prefix @@ -0,0 +1,4 @@ +"D:/bld/pcre_1623788775763/_h_env" text "Library/bin/pcre-config" +"D:/bld/pcre_1623788775763/_h_env" text "Library/lib/pkgconfig/libpcre.pc" +"D:/bld/pcre_1623788775763/_h_env" text "Library/lib/pkgconfig/libpcrecpp.pc" +"D:/bld/pcre_1623788775763/_h_env" text "Library/lib/pkgconfig/libpcreposix.pc" diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/hash_input.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/hash_input.json new file mode 100644 index 0000000000000000000000000000000000000000..d6a829e5dfc9f61124e9c13da5055ec6fefe7732 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/hash_input.json @@ -0,0 +1,6 @@ +{ + "channel_targets": "conda-forge main", + "cxx_compiler": "vs2017", + "target_platform": "win-64", + "c_compiler": "vs2017" +} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/index.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/index.json new file mode 100644 index 0000000000000000000000000000000000000000..22ba87838104e7fb636dd19db7a56fb5f3e96de7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/index.json @@ -0,0 +1,15 @@ +{ + "arch": "x86_64", + "build": "h0e60522_0", + "build_number": 0, + "depends": [ + "vc >=14.1,<15.0a0", + "vs2015_runtime >=14.16.27012" + ], + "license": "BSD-3-Clause", + "name": "pcre", + "platform": "win", + "subdir": "win-64", + "timestamp": 1623789181657, + "version": "8.45" +} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/licenses/LICENCE b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/licenses/LICENCE new file mode 100644 index 0000000000000000000000000000000000000000..803b4119e50fb5f4ce36949e855e5daeef453cc0 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/licenses/LICENCE @@ -0,0 +1,93 @@ +PCRE LICENCE +------------ + +PCRE is a library of functions to support regular expressions whose syntax +and semantics are as close as possible to those of the Perl 5 language. + +Release 8 of PCRE is distributed under the terms of the "BSD" licence, as +specified below. The documentation for PCRE, supplied in the "doc" +directory, is distributed under the same terms as the software itself. The data +in the testdata directory is not copyrighted and is in the public domain. + +The basic library functions are written in C and are freestanding. Also +included in the distribution is a set of C++ wrapper functions, and a +just-in-time compiler that can be used to optimize pattern matching. These +are both optional features that can be omitted when the library is built. + + +THE BASIC LIBRARY FUNCTIONS +--------------------------- + +Written by: Philip Hazel +Email local part: Philip.Hazel +Email domain: gmail.com + +University of Cambridge Computing Service, +Cambridge, England. + +Copyright (c) 1997-2021 University of Cambridge +All rights reserved. + + +PCRE JUST-IN-TIME COMPILATION SUPPORT +------------------------------------- + +Written by: Zoltan Herczeg +Email local part: hzmester +Email domain: freemail.hu + +Copyright(c) 2010-2021 Zoltan Herczeg +All rights reserved. + + +STACK-LESS JUST-IN-TIME COMPILER +-------------------------------- + +Written by: Zoltan Herczeg +Email local part: hzmester +Email domain: freemail.hu + +Copyright(c) 2009-2021 Zoltan Herczeg +All rights reserved. + + +THE C++ WRAPPER FUNCTIONS +------------------------- + +Contributed by: Google Inc. + +Copyright (c) 2007-2012, Google Inc. +All rights reserved. + + +THE "BSD" LICENCE +----------------- + +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 University of Cambridge nor the name of Google + Inc. nor the names of their 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. + +End diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/paths.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/paths.json new file mode 100644 index 0000000000000000000000000000000000000000..cb850ccf74aa0edf840aa5e9b118fd41ed1004ed --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/paths.json @@ -0,0 +1,757 @@ +{ + "paths": [ + { + "_path": "Library/bin/pcre-config", + "file_mode": "text", + "path_type": "hardlink", + "prefix_placeholder": "D:/bld/pcre_1623788775763/_h_env", + "sha256": "3875f622a3aa07482808b4da8e83e7c85451849e15c495cff7c0b09150ac374d", + "size_in_bytes": 2526 + }, + { + "_path": "Library/bin/pcre.dll", + "path_type": "hardlink", + "sha256": "b076c09cbaa66887c4d58f302e8d81f683c95dfe543780a302c69a79d4e0e3a6", + "size_in_bytes": 240640 + }, + { + "_path": "Library/bin/pcre_scanner_unittest.exe", + "path_type": "hardlink", + "sha256": "e38865383e6df79d241a6aef3dd09d734a914e72b9dc0ca85bb6d29523588865", + "size_in_bytes": 23552 + }, + { + "_path": "Library/bin/pcre_stringpiece_unittest.exe", + "path_type": "hardlink", + "sha256": "8455ad4a8e38e5d9b7797ab7ef4bcbcfa42a3317f0e65dcf42890242bb1e28d8", + "size_in_bytes": 36864 + }, + { + "_path": "Library/bin/pcrecpp.dll", + "path_type": "hardlink", + "sha256": "1d1ef944f2abc9da6b37a263739f56ad435db2f535b15ac7bc525cf70b9dfdb1", + "size_in_bytes": 51200 + }, + { + "_path": "Library/bin/pcrecpp_unittest.exe", + "path_type": "hardlink", + "sha256": "9daf3efafc3e99859de14c0b219f3e64f25b7cb5a660f5211ebf57bf5aa466d8", + "size_in_bytes": 120832 + }, + { + "_path": "Library/bin/pcregrep.exe", + "path_type": "hardlink", + "sha256": "9303b407766255fd0002d820fe3610cc7f96ef39b5a987c3e3fa672427459906", + "size_in_bytes": 39936 + }, + { + "_path": "Library/bin/pcreposix.dll", + "path_type": "hardlink", + "sha256": "61a15c199f45beaa356e5e640e51d0037629729e6d31a5df10681ae0590c8ab0", + "size_in_bytes": 12800 + }, + { + "_path": "Library/bin/pcretest.exe", + "path_type": "hardlink", + "sha256": "5684c10b9098f12012a79f3867f8de73ddf0e56710329eb838824b9e6cf797c2", + "size_in_bytes": 61952 + }, + { + "_path": "Library/include/pcre.h", + "path_type": "hardlink", + "sha256": "1660743406101263cf88161ae4f3ee02db9f5cd42b6a040becc9d59bd3fbde06", + "size_in_bytes": 32395 + }, + { + "_path": "Library/include/pcre_scanner.h", + "path_type": "hardlink", + "sha256": "7442638d75522e87497d442425dc51a6d69ef6bed73c8ab266dbb73343039fb6", + "size_in_bytes": 6600 + }, + { + "_path": "Library/include/pcre_stringpiece.h", + "path_type": "hardlink", + "sha256": "17b1431eb7b94f694dd5fd3544080d31963df45fd3c07414a6c0cd13e63aa59b", + "size_in_bytes": 6492 + }, + { + "_path": "Library/include/pcrecpp.h", + "path_type": "hardlink", + "sha256": "165767e52e03797cbbce3e6147e2436459f8b468ffecefedfd8477c157aecfe7", + "size_in_bytes": 26529 + }, + { + "_path": "Library/include/pcrecpparg.h", + "path_type": "hardlink", + "sha256": "d6fc85e3dc7a76e80f19f688b0a53f44c2bf847fe23816be294d458c238b59f0", + "size_in_bytes": 6957 + }, + { + "_path": "Library/include/pcreposix.h", + "path_type": "hardlink", + "sha256": "1770f2b30c0af2f24543428173cf6e6479e921045efdbd009fd07817b84e04ad", + "size_in_bytes": 5452 + }, + { + "_path": "Library/lib/pcre.lib", + "path_type": "hardlink", + "sha256": "ab514494bedcc05fa18b926922c981cf382ce68037a827fdf3ef3d59d0a092b7", + "size_in_bytes": 7774 + }, + { + "_path": "Library/lib/pcrecpp.lib", + "path_type": "hardlink", + "sha256": "985be47948079b96ad80c3ba76c882481e49c7926c78436503fc578a927c0ea3", + "size_in_bytes": 68958 + }, + { + "_path": "Library/lib/pcreposix.lib", + "path_type": "hardlink", + "sha256": "a942282ff929e7909c5cf42f698e3596dfee11bea243e2f3709e0af900559aea", + "size_in_bytes": 2212 + }, + { + "_path": "Library/lib/pkgconfig/libpcre.pc", + "file_mode": "text", + "path_type": "hardlink", + "prefix_placeholder": "D:/bld/pcre_1623788775763/_h_env", + "sha256": "1ceb927bee185751607778ca09bb7223177c4e6822dbda76ded48c2cb8433a08", + "size_in_bytes": 366 + }, + { + "_path": "Library/lib/pkgconfig/libpcrecpp.pc", + "file_mode": "text", + "path_type": "hardlink", + "prefix_placeholder": "D:/bld/pcre_1623788775763/_h_env", + "sha256": "3d3eb92f20a31b05faee2e033c289dc048f917fc6f3bfeed8b5dda43ae3994c1", + "size_in_bytes": 311 + }, + { + "_path": "Library/lib/pkgconfig/libpcreposix.pc", + "file_mode": "text", + "path_type": "hardlink", + "prefix_placeholder": "D:/bld/pcre_1623788775763/_h_env", + "sha256": "ecf64a20e3686f095316bf664465a9775b1db49989c6b3b3d6b1951320f3195b", + "size_in_bytes": 354 + }, + { + "_path": "Library/man/man1/pcre-config.1", + "path_type": "hardlink", + "sha256": "87ff5019948e7b4a18a0308511d9f49139110ab4bb34acc5196390af57428bed", + "size_in_bytes": 2731 + }, + { + "_path": "Library/man/man1/pcregrep.1", + "path_type": "hardlink", + "sha256": "73b871cf752aef725721b911c239d1e3adfdffdd800359abdd59f62eac52f9c9", + "size_in_bytes": 35450 + }, + { + "_path": "Library/man/man1/pcretest.1", + "path_type": "hardlink", + "sha256": "26069cf6e0405bbdb8d7e837d1c4dd58c4053e7e5bf8c554c60a8cda8235ca2a", + "size_in_bytes": 49267 + }, + { + "_path": "Library/man/man3/pcre.3", + "path_type": "hardlink", + "sha256": "e2b52240cd935bb43ad893460b82fa255c8ff43f109ca0eae775a1585d8e20f2", + "size_in_bytes": 9244 + }, + { + "_path": "Library/man/man3/pcre16.3", + "path_type": "hardlink", + "sha256": "9ec9bab668870f0daceef180f7d997689c114b71f4455614f8871a084bf7f768", + "size_in_bytes": 13298 + }, + { + "_path": "Library/man/man3/pcre32.3", + "path_type": "hardlink", + "sha256": "e7f3501536e39435e20a82f08e6e203a50d9bc59162ad4b4a1a3e5da5a3eb118", + "size_in_bytes": 13184 + }, + { + "_path": "Library/man/man3/pcre_assign_jit_stack.3", + "path_type": "hardlink", + "sha256": "0a0da0666ad554a9b1b786e6154ad033e41591ac3fccff781d6443c03770c32e", + "size_in_bytes": 1938 + }, + { + "_path": "Library/man/man3/pcre_compile.3", + "path_type": "hardlink", + "sha256": "fda690fac79ca451ab4ce0b2f3dc7c4e21d0638c5542d7c111d0730cf794a620", + "size_in_bytes": 4169 + }, + { + "_path": "Library/man/man3/pcre_compile2.3", + "path_type": "hardlink", + "sha256": "e9116a881d28fc2b3ced7aca427c58a8608ca183feb0428afaa4c6403f7a75bf", + "size_in_bytes": 4330 + }, + { + "_path": "Library/man/man3/pcre_config.3", + "path_type": "hardlink", + "sha256": "2d03aa70d67e5d1121c6186be0e48a1934171f4df9cc382be113597848de472d", + "size_in_bytes": 3393 + }, + { + "_path": "Library/man/man3/pcre_copy_named_substring.3", + "path_type": "hardlink", + "sha256": "720b0505370d0e07f514d610f9d7922120928fedb4062af9e68d3717d41be30c", + "size_in_bytes": 1773 + }, + { + "_path": "Library/man/man3/pcre_copy_substring.3", + "path_type": "hardlink", + "sha256": "c86b6609334fddb61dd2378dd5c7d485fbcb0dcad562f8ad9d355ee707cacdb6", + "size_in_bytes": 1545 + }, + { + "_path": "Library/man/man3/pcre_dfa_exec.3", + "path_type": "hardlink", + "sha256": "a0437e609c3157b1741ddf2ca1471b1bd2f79d4dabb3c2a796d26479f58e06ab", + "size_in_bytes": 5317 + }, + { + "_path": "Library/man/man3/pcre_exec.3", + "path_type": "hardlink", + "sha256": "d3f5f36cc80fe4735a83023274e76346dfc439c4ea52cf7d3851df1b8f853a36", + "size_in_bytes": 4455 + }, + { + "_path": "Library/man/man3/pcre_free_study.3", + "path_type": "hardlink", + "sha256": "73f6997946ff623adfa826c59f4028e141c7dc0d9b8d94a8f619aa41dd13a211", + "size_in_bytes": 702 + }, + { + "_path": "Library/man/man3/pcre_free_substring.3", + "path_type": "hardlink", + "sha256": "7846e360407d0d15224bc72394ac746d69b5282419b1df47ebba28cffb2978e3", + "size_in_bytes": 749 + }, + { + "_path": "Library/man/man3/pcre_free_substring_list.3", + "path_type": "hardlink", + "sha256": "680ac9ba4106ebbb641cb442cf446e1ff82936c741d84c67fc9aff72ae919a1c", + "size_in_bytes": 751 + }, + { + "_path": "Library/man/man3/pcre_fullinfo.3", + "path_type": "hardlink", + "sha256": "4d97c74d610855af543eaeb5a1ad79795eb85f7ec236b2d29083052e7e1c1ce4", + "size_in_bytes": 4584 + }, + { + "_path": "Library/man/man3/pcre_get_named_substring.3", + "path_type": "hardlink", + "sha256": "942f52ae9e46cbe4d17f5bbbf1c5f30310ee2672f2aefb43e73f8578603df14e", + "size_in_bytes": 1877 + }, + { + "_path": "Library/man/man3/pcre_get_stringnumber.3", + "path_type": "hardlink", + "sha256": "a88c59d1d123f9ab2afc0e1d75b1464131ae80a01a18680b7d4a9672ce0d2748", + "size_in_bytes": 1223 + }, + { + "_path": "Library/man/man3/pcre_get_stringtable_entries.3", + "path_type": "hardlink", + "sha256": "515a26b44640bed7b872890022115108503b2fe63a28e966726a868d57aab5db", + "size_in_bytes": 1497 + }, + { + "_path": "Library/man/man3/pcre_get_substring.3", + "path_type": "hardlink", + "sha256": "b4a547cbddc573ea2bfcb2c81c69dd64cfb87568a50895a9050d7d1092088d3c", + "size_in_bytes": 1676 + }, + { + "_path": "Library/man/man3/pcre_get_substring_list.3", + "path_type": "hardlink", + "sha256": "19b26f9d564bc696ce69f7002ed0f601a3e39c072d65e5bc07b2171ffd0b9386", + "size_in_bytes": 1635 + }, + { + "_path": "Library/man/man3/pcre_jit_exec.3", + "path_type": "hardlink", + "sha256": "01c6ed1346eca0af1d7a62ae71cff82725948fcb481cb9dc07b512b273aa927f", + "size_in_bytes": 4200 + }, + { + "_path": "Library/man/man3/pcre_jit_stack_alloc.3", + "path_type": "hardlink", + "sha256": "703deed28ca6953036555b8cb0a8f2995d895e3e668ca16a373cd5eb438c8535", + "size_in_bytes": 1163 + }, + { + "_path": "Library/man/man3/pcre_jit_stack_free.3", + "path_type": "hardlink", + "sha256": "b8e9a6ddde44e5a82eb9391188a0e6cd9014e561e12304f4099975b085f6a3ae", + "size_in_bytes": 731 + }, + { + "_path": "Library/man/man3/pcre_maketables.3", + "path_type": "hardlink", + "sha256": "962e718f707a5e3729ddb8bf1c7fde5c0e309986a5a27d48f262cd09a55946f9", + "size_in_bytes": 870 + }, + { + "_path": "Library/man/man3/pcre_pattern_to_host_byte_order.3", + "path_type": "hardlink", + "sha256": "72c9fede6a45a391f2c6300824230cb4e0c49c176c666694078b39f26b1fc225", + "size_in_bytes": 1397 + }, + { + "_path": "Library/man/man3/pcre_refcount.3", + "path_type": "hardlink", + "sha256": "488da8b97f6dc6d8cb99e0c571aee22e66f293ef2c9f2185ddd93b63ef9b6a4d", + "size_in_bytes": 906 + }, + { + "_path": "Library/man/man3/pcre_study.3", + "path_type": "hardlink", + "sha256": "4ede4e7e5b06e3e790e6b3b7f85b0f3160d9ffb1930af5b52683bc3d7994572d", + "size_in_bytes": 1575 + }, + { + "_path": "Library/man/man3/pcre_utf16_to_host_byte_order.3", + "path_type": "hardlink", + "sha256": "e9cb80f06bdb03a1ae5be79ef5c14a604b7f4a1e50119a4547e432927974d794", + "size_in_bytes": 1494 + }, + { + "_path": "Library/man/man3/pcre_utf32_to_host_byte_order.3", + "path_type": "hardlink", + "sha256": "d28451636848d8e1d1276ebcc928db0029453f6ee367bd3a56dcfd73788595e1", + "size_in_bytes": 1491 + }, + { + "_path": "Library/man/man3/pcre_version.3", + "path_type": "hardlink", + "sha256": "25885c1ee3d2b55c44af860defb34c383795e9ada74eff29dcd6f3b26335be8a", + "size_in_bytes": 650 + }, + { + "_path": "Library/man/man3/pcreapi.3", + "path_type": "hardlink", + "sha256": "b3f48bab04cd70c1fe2b38d9d20ca3eda7db332873cf1238acd3e2da8fa66ed6", + "size_in_bytes": 129130 + }, + { + "_path": "Library/man/man3/pcrebuild.3", + "path_type": "hardlink", + "sha256": "df24afe0675e0568a32a0fb947535207b08553275a8ffe86769a482997e8bba3", + "size_in_bytes": 19745 + }, + { + "_path": "Library/man/man3/pcrecallout.3", + "path_type": "hardlink", + "sha256": "a8a967c050286122197667c85640de0b432763caa688c0965e4a90961b2b347f", + "size_in_bytes": 10374 + }, + { + "_path": "Library/man/man3/pcrecompat.3", + "path_type": "hardlink", + "sha256": "0240435dc2c3eb10458f8ef677358349c38fe5b10213cd06db10369132a87de9", + "size_in_bytes": 9178 + }, + { + "_path": "Library/man/man3/pcrecpp.3", + "path_type": "hardlink", + "sha256": "9aae1472acedeb4900368e60c32a70d25076ca201e52627fdbf25eea3373ba63", + "size_in_bytes": 12709 + }, + { + "_path": "Library/man/man3/pcredemo.3", + "path_type": "hardlink", + "sha256": "7115db0d9936121e6bad798e895c08a8de92ecb506e30b2d86e5f6400ff5f021", + "size_in_bytes": 15684 + }, + { + "_path": "Library/man/man3/pcrejit.3", + "path_type": "hardlink", + "sha256": "6422a575b4f8f2b526bd1bcca58d444ed6b1f677b150a71892c2f2d1f9352563", + "size_in_bytes": 20125 + }, + { + "_path": "Library/man/man3/pcrelimits.3", + "path_type": "hardlink", + "sha256": "f942f0c6ac4d6aba33d7ae3018d57c24e56169638cadbc24f90914470440e35b", + "size_in_bytes": 2657 + }, + { + "_path": "Library/man/man3/pcrematching.3", + "path_type": "hardlink", + "sha256": "0f5c3c0742c4dce0c07ae424960f82cbe85f894cf838275cbdc8794df0a6c6a0", + "size_in_bytes": 9472 + }, + { + "_path": "Library/man/man3/pcrepartial.3", + "path_type": "hardlink", + "sha256": "47e8a36b27f14151cf82d85202cabcf68e53ecb1b87f89ffe8b029504ecce3d6", + "size_in_bytes": 21605 + }, + { + "_path": "Library/man/man3/pcrepattern.3", + "path_type": "hardlink", + "sha256": "ebf18c089b426e73af53e86c155b16a149ba2712084d137c6bf4b8519562ef3f", + "size_in_bytes": 136541 + }, + { + "_path": "Library/man/man3/pcreperform.3", + "path_type": "hardlink", + "sha256": "9dd40e3ffc8750f1127d0fbf0e0a91f14acdd2195b28db0e1235bf15c28ff9aa", + "size_in_bytes": 7275 + }, + { + "_path": "Library/man/man3/pcreposix.3", + "path_type": "hardlink", + "sha256": "14053288c3b15a1a6b3b605f1d9a7b4ef45c5a6287be135b2b960e8e1f039126", + "size_in_bytes": 10693 + }, + { + "_path": "Library/man/man3/pcreprecompile.3", + "path_type": "hardlink", + "sha256": "35264269aff14f9e3c8742feac20279554ab1c5d2f15c07c30541a4e0cf9f93d", + "size_in_bytes": 6285 + }, + { + "_path": "Library/man/man3/pcresample.3", + "path_type": "hardlink", + "sha256": "b31537bb0cb94539c04c8511cab02efe6360a1bba48bb41cabc1c4a64d5a8529", + "size_in_bytes": 3215 + }, + { + "_path": "Library/man/man3/pcrestack.3", + "path_type": "hardlink", + "sha256": "16acc66262d122bd4aef42cd5a2bb05fe870079c1edd0b388f29f88075fdd03b", + "size_in_bytes": 8901 + }, + { + "_path": "Library/man/man3/pcresyntax.3", + "path_type": "hardlink", + "sha256": "4a7bae353908776e5d9fb96f21b3b834b9a41a503bdefa207f59cfe58dad4c79", + "size_in_bytes": 13590 + }, + { + "_path": "Library/man/man3/pcreunicode.3", + "path_type": "hardlink", + "sha256": "af4c887650469b30f322a3527516d235d23f1b300e773a0f7c4fd41f9dccb827", + "size_in_bytes": 10746 + }, + { + "_path": "Library/share/doc/pcre/html/index.html", + "path_type": "hardlink", + "sha256": "a9941170673b9d59f007f7f1e7a313fa12e2001054b653e697043718e27f8b5e", + "size_in_bytes": 7677 + }, + { + "_path": "Library/share/doc/pcre/html/pcre-config.html", + "path_type": "hardlink", + "sha256": "94a9a5f654d94c66c6ee29e57ebadba2b2ccfd8801d9a4f76d9953732c4c3fa3", + "size_in_bytes": 3659 + }, + { + "_path": "Library/share/doc/pcre/html/pcre.html", + "path_type": "hardlink", + "sha256": "9720883c8ca6a98713e01a1fa7fa36f13c31627deb91a2d3db732473c157c4e2", + "size_in_bytes": 10352 + }, + { + "_path": "Library/share/doc/pcre/html/pcre16.html", + "path_type": "hardlink", + "sha256": "4424a27195c4be03780375d03888f8665de37aa5abbdc0a40a1ceee722a13bb5", + "size_in_bytes": 16214 + }, + { + "_path": "Library/share/doc/pcre/html/pcre32.html", + "path_type": "hardlink", + "sha256": "5def7511cdd3968a01cf6270433f34889bc197c6e1d35febb0f9b6e62b9197c9", + "size_in_bytes": 16098 + }, + { + "_path": "Library/share/doc/pcre/html/pcre_assign_jit_stack.html", + "path_type": "hardlink", + "sha256": "978388a268d26dbbd49e458b39e33c0b948055461e3163b5fe42383351f74fc9", + "size_in_bytes": 2541 + }, + { + "_path": "Library/share/doc/pcre/html/pcre_compile.html", + "path_type": "hardlink", + "sha256": "d3e538afcc263a962581f1fa7cb35882a85bf681dda1856ec3af55a0066d1a95", + "size_in_bytes": 4735 + }, + { + "_path": "Library/share/doc/pcre/html/pcre_compile2.html", + "path_type": "hardlink", + "sha256": "58ad9115a332db73807c1014efd0a89819fbfb64dedafac10922573df6b3ad06", + "size_in_bytes": 4907 + }, + { + "_path": "Library/share/doc/pcre/html/pcre_config.html", + "path_type": "hardlink", + "sha256": "71647b6d007dea79cc40205f9cf485dabed5e2eb43c509ca39390faf797f006a", + "size_in_bytes": 3938 + }, + { + "_path": "Library/share/doc/pcre/html/pcre_copy_named_substring.html", + "path_type": "hardlink", + "sha256": "22eaa88e6472522c88f9eee619a0a0d4e8bd4e1535a1026041cfa5ed0a7fcea2", + "size_in_bytes": 2359 + }, + { + "_path": "Library/share/doc/pcre/html/pcre_copy_substring.html", + "path_type": "hardlink", + "sha256": "148a4bcbc4c5c7fd3d164b483273f270767118481a01d088206a98d7c836c8f3", + "size_in_bytes": 2115 + }, + { + "_path": "Library/share/doc/pcre/html/pcre_dfa_exec.html", + "path_type": "hardlink", + "sha256": "f6d8f490d440b4ddf411a0e8273b9cfa179ad93bfcb3be5efe7ff8bb4f24a1d3", + "size_in_bytes": 5969 + }, + { + "_path": "Library/share/doc/pcre/html/pcre_exec.html", + "path_type": "hardlink", + "sha256": "4d1a7b7faed38d5a16dc706085f4ae83bb4a849ea2f4d7a15e7a07b83723bec7", + "size_in_bytes": 5059 + }, + { + "_path": "Library/share/doc/pcre/html/pcre_free_study.html", + "path_type": "hardlink", + "sha256": "6b56becdd9224aa6210e0eb6f965cec36f33f224b07a8707cefad0872c9e0ddb", + "size_in_bytes": 1231 + }, + { + "_path": "Library/share/doc/pcre/html/pcre_free_substring.html", + "path_type": "hardlink", + "sha256": "893b6cb61d3586c8be88a09b82f4437255dc0cd0ef68823cd163076aaf132245", + "size_in_bytes": 1283 + }, + { + "_path": "Library/share/doc/pcre/html/pcre_free_substring_list.html", + "path_type": "hardlink", + "sha256": "da8b3d404a180035b3901b802aaa1a84d1ffc00635a3960b108ddeb7f6975de8", + "size_in_bytes": 1289 + }, + { + "_path": "Library/share/doc/pcre/html/pcre_fullinfo.html", + "path_type": "hardlink", + "sha256": "b1acdc0b83f9e30b83a2dab6da97fe14a83369b306f2935b4bfe07e9a875585e", + "size_in_bytes": 5150 + }, + { + "_path": "Library/share/doc/pcre/html/pcre_get_named_substring.html", + "path_type": "hardlink", + "sha256": "02c6688c100e2901a3c1762708e162a0bbbca6760c6bf3a37460f1d7cc18579e", + "size_in_bytes": 2460 + }, + { + "_path": "Library/share/doc/pcre/html/pcre_get_stringnumber.html", + "path_type": "hardlink", + "sha256": "058cef975e594a2c1379bb316b18916d3be14b5a590e268b3b8503ebf4d5a7ae", + "size_in_bytes": 1773 + }, + { + "_path": "Library/share/doc/pcre/html/pcre_get_stringtable_entries.html", + "path_type": "hardlink", + "sha256": "e7670e707d5097657c54bb28caf158f0fa5b8c8ec1fa134c4f378689f7c62510", + "size_in_bytes": 2062 + }, + { + "_path": "Library/share/doc/pcre/html/pcre_get_substring.html", + "path_type": "hardlink", + "sha256": "5929e160e6c24610614da399b5a48b5b54eb9fd6c2b0727827fcae42bdf6fa1c", + "size_in_bytes": 2243 + }, + { + "_path": "Library/share/doc/pcre/html/pcre_get_substring_list.html", + "path_type": "hardlink", + "sha256": "53f52712e894b0e7612df4ada5140d5730f3fdcca1b2c9c6049eed21714e6c4e", + "size_in_bytes": 2198 + }, + { + "_path": "Library/share/doc/pcre/html/pcre_jit_exec.html", + "path_type": "hardlink", + "sha256": "13aef7fb3df09e4365792d78c170757ccbc18efff21ae0edfcc48d0445a40093", + "size_in_bytes": 4814 + }, + { + "_path": "Library/share/doc/pcre/html/pcre_jit_stack_alloc.html", + "path_type": "hardlink", + "sha256": "0a4cb6fd44431a608a9f767fe537e5a2899dff0187f18f9e0ba9873cf5bb09ad", + "size_in_bytes": 1720 + }, + { + "_path": "Library/share/doc/pcre/html/pcre_jit_stack_free.html", + "path_type": "hardlink", + "sha256": "87ffc0f24a1532c003f0d903a0004151836796826474bc5e9890b317d31b9d9e", + "size_in_bytes": 1279 + }, + { + "_path": "Library/share/doc/pcre/html/pcre_maketables.html", + "path_type": "hardlink", + "sha256": "e406c945fc3b76a7d259e06483f58df1a401c00f516aa737b7cd19152c8f552e", + "size_in_bytes": 1397 + }, + { + "_path": "Library/share/doc/pcre/html/pcre_pattern_to_host_byte_order.html", + "path_type": "hardlink", + "sha256": "be9188eb308c8491a5ee7b1c7f53632b5b9459682171b6d903c57ba6822ef684", + "size_in_bytes": 1960 + }, + { + "_path": "Library/share/doc/pcre/html/pcre_refcount.html", + "path_type": "hardlink", + "sha256": "bcdc552b5ef7dbd9f31bf24459d160b9e84da972715479f8295a1dd6e6cf5a64", + "size_in_bytes": 1442 + }, + { + "_path": "Library/share/doc/pcre/html/pcre_study.html", + "path_type": "hardlink", + "sha256": "073cd842e9eee11f5c3155b66f823a205af6df0e9365ab275c8ea4fb6a8a599d", + "size_in_bytes": 2146 + }, + { + "_path": "Library/share/doc/pcre/html/pcre_utf16_to_host_byte_order.html", + "path_type": "hardlink", + "sha256": "d4a19bba244b82fe518ac61ffbcd7c15875c851a6a78edbc1fccaf1aad02e328", + "size_in_bytes": 2033 + }, + { + "_path": "Library/share/doc/pcre/html/pcre_utf32_to_host_byte_order.html", + "path_type": "hardlink", + "sha256": "3fb6d536232e8ce0c0c738357a9a1af867d73b8fab1f752ed6d7b0edf056d6b7", + "size_in_bytes": 2033 + }, + { + "_path": "Library/share/doc/pcre/html/pcre_version.html", + "path_type": "hardlink", + "sha256": "bcc32e6f56972b256eca12a3927c6ea7ab27312d862ab4c8b87d54a3b9651efc", + "size_in_bytes": 1172 + }, + { + "_path": "Library/share/doc/pcre/html/pcreapi.html", + "path_type": "hardlink", + "sha256": "6941cc1f09b9f6934e497301ca8e6c7a359fc94577f2cf835c79ab67bb56ed24", + "size_in_bytes": 135355 + }, + { + "_path": "Library/share/doc/pcre/html/pcrebuild.html", + "path_type": "hardlink", + "sha256": "27ca87062537a0e9259973d048d2582f3e3dd68ec7552440f68bfa41b6d0738a", + "size_in_bytes": 22838 + }, + { + "_path": "Library/share/doc/pcre/html/pcrecallout.html", + "path_type": "hardlink", + "sha256": "1557ed06851c266b57220b97c8dd1cdb2334bd728e8eaee994486ba77badca17", + "size_in_bytes": 11675 + }, + { + "_path": "Library/share/doc/pcre/html/pcrecompat.html", + "path_type": "hardlink", + "sha256": "2d897fd66f336165d407b9dcbbe9c35f19d732b39267f637ded5585fac95c9c4", + "size_in_bytes": 9791 + }, + { + "_path": "Library/share/doc/pcre/html/pcrecpp.html", + "path_type": "hardlink", + "sha256": "87b967d907fb8a88c60e94359013d89a1204cca04e735030b11beee2e69cba5e", + "size_in_bytes": 14395 + }, + { + "_path": "Library/share/doc/pcre/html/pcredemo.html", + "path_type": "hardlink", + "sha256": "d49570d467396d10c554cfc5020d33e794864ab49f8596d1416252bad7b0a08e", + "size_in_bytes": 16194 + }, + { + "_path": "Library/share/doc/pcre/html/pcregrep.html", + "path_type": "hardlink", + "sha256": "d93c93ebab667437d23ea6678124f73297dc6eea22a256642a4c1315891995f1", + "size_in_bytes": 37847 + }, + { + "_path": "Library/share/doc/pcre/html/pcrejit.html", + "path_type": "hardlink", + "sha256": "3416072061a1ccf8e2331ad11cbfb1c67030fe6f9af31e3290460a0395326064", + "size_in_bytes": 22104 + }, + { + "_path": "Library/share/doc/pcre/html/pcrelimits.html", + "path_type": "hardlink", + "sha256": "a72349ea60630c45ea0ef848eff8959f4a27808f101ce94c7ec3ef42572903d8", + "size_in_bytes": 3195 + }, + { + "_path": "Library/share/doc/pcre/html/pcrematching.html", + "path_type": "hardlink", + "sha256": "c5afdfbf6ef736026d0af74368f5da1e3041ce4b241ef62cc8407e53e3631953", + "size_in_bytes": 10898 + }, + { + "_path": "Library/share/doc/pcre/html/pcrepartial.html", + "path_type": "hardlink", + "sha256": "ffef90c566c5f4ec2238ca69529f4a7dd9e68d9219a3c653e83d5da32380ab34", + "size_in_bytes": 23592 + }, + { + "_path": "Library/share/doc/pcre/html/pcrepattern.html", + "path_type": "hardlink", + "sha256": "c7686043de054f985e0723969b456e08c86b1b15a43db1c67c366963d8b5a807", + "size_in_bytes": 140693 + }, + { + "_path": "Library/share/doc/pcre/html/pcreperform.html", + "path_type": "hardlink", + "sha256": "d3eea74fc04a20f31c0b8447ca4d4b0e751bba990a8711212a466cfb4363dad6", + "size_in_bytes": 7827 + }, + { + "_path": "Library/share/doc/pcre/html/pcreposix.html", + "path_type": "hardlink", + "sha256": "62cb7a13a033dfb7b90ac88dd4c3f26f994c6ce707c15c4a102728d410930a07", + "size_in_bytes": 12139 + }, + { + "_path": "Library/share/doc/pcre/html/pcreprecompile.html", + "path_type": "hardlink", + "sha256": "5beb7314ba12fd534f67eb38d363c1740426559bda24d143b9b4283b53d85da3", + "size_in_bytes": 7399 + }, + { + "_path": "Library/share/doc/pcre/html/pcresample.html", + "path_type": "hardlink", + "sha256": "9d21477a6f04a1cff3f37582a455ce4ce0f68977c644921cc91976f18e78d86e", + "size_in_bytes": 3784 + }, + { + "_path": "Library/share/doc/pcre/html/pcrestack.html", + "path_type": "hardlink", + "sha256": "48d8a5afb5ee4a587768b0033b5ff69aafb16d37ffc564a6456bd10f7e43015c", + "size_in_bytes": 9594 + }, + { + "_path": "Library/share/doc/pcre/html/pcresyntax.html", + "path_type": "hardlink", + "sha256": "17b829a7d19bd7b9519f63e2df7ce3ba676375922f05ddbda5149ee988d11aaf", + "size_in_bytes": 16695 + }, + { + "_path": "Library/share/doc/pcre/html/pcretest.html", + "path_type": "hardlink", + "sha256": "a449956ead49a25aefece6c5cede2fa665f18768181213e0d0dc1ca62902e022", + "size_in_bytes": 51994 + }, + { + "_path": "Library/share/doc/pcre/html/pcreunicode.html", + "path_type": "hardlink", + "sha256": "5490e93a21c250099cb45820e3c617573efd70689332664f02f1cc9de839ccea", + "size_in_bytes": 11444 + } + ], + "paths_version": 1 +} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/recipe/0001-Define-snprintf-for-old-VS.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/recipe/0001-Define-snprintf-for-old-VS.patch new file mode 100644 index 0000000000000000000000000000000000000000..73cc5551c0f7174e9ca7096a0f0a4047b636e730 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/recipe/0001-Define-snprintf-for-old-VS.patch @@ -0,0 +1,17 @@ +Patch by @mingwandroid + +--- work/pcregrep.c.orig 2018-02-25 06:22:13.000000000 -0600 ++++ work/pcregrep.c 2018-04-11 17:29:35.172681800 -0500 +@@ -71,6 +71,12 @@ + + #include "pcre.h" + ++#if defined(_MSC_VER) ++#if (_MSC_VER < 1900) ++#define snprintf(_o, _n, _f, ...) _snprintf_s(_o, _n, _n, _f, __VA_ARGS__) ++#endif ++#endif ++ + #define FALSE 0 + #define TRUE 1 + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/recipe/bld.bat b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/recipe/bld.bat new file mode 100644 index 0000000000000000000000000000000000000000..04b1b36dcd0ad7123ad916c90f1d1dd69308af93 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/recipe/bld.bat @@ -0,0 +1,21 @@ +cmake -G "NMake Makefiles" ^ + -D CMAKE_BUILD_TYPE=Release ^ + -D BUILD_SHARED_LIBS=ON ^ + -D PCRE_SUPPORT_UTF=ON ^ + -D PCRE_SUPPORT_UNICODE_PROPERTIES=ON ^ + -D CMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^ + -D CMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^ + --trace --debug-output --debug-trycompile ^ + . +if errorlevel 1 exit 1 + +nmake +if errorlevel 1 exit 1 + +:: pcre_test_bat fails to run for some reason +:: might need more investigation +ctest -E pcre_test_bat . +if errorlevel 1 exit 1 + +nmake install +if errorlevel 1 exit 1 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/recipe/build.sh b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/recipe/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..0b66c78ca02587075453e9c1e2b2bbe9a9eacfb7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/recipe/build.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Get an updated config.sub and config.guess +cp $BUILD_PREFIX/share/libtool/build-aux/config.* . + +./configure --prefix="${PREFIX}" \ + --host="${HOST}" \ + --enable-utf \ + --enable-unicode-properties +make -j${CPU_COUNT} ${VERBOSE_AT} +if [[ "${CONDA_BUILD_CROSS_COMPILATION}" != "1" ]]; then +make check || { cat ./test-suite.log; exit 1; } +fi +make install + +# Delete man pages. +rm -rf "${PREFIX}/share" + +# We can remove this when we start using the new conda-build. +find $PREFIX -name '*.la' -delete diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/recipe/conda_build_config.yaml b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/recipe/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..14fff9096dc1fe5cd6ccc5d44743b0b7b9a6f580 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/recipe/conda_build_config.yaml @@ -0,0 +1,30 @@ +CI: azure +c_compiler: vs2017 +channel_sources: conda-forge,defaults +channel_targets: conda-forge main +cpu_optimization_target: nocona +cran_mirror: https://cran.r-project.org +cxx_compiler: vs2017 +extend_keys: +- ignore_build_only_deps +- extend_keys +- pin_run_as_build +- ignore_version +fortran_compiler: gfortran +ignore_build_only_deps: +- numpy +- python +lua: '5' +numpy: '1.16' +perl: 5.26.2 +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x + r-base: + min_pin: x.x + max_pin: x.x +python: '3.6' +r_base: '3.4' +target_platform: win-64 +vc: '14' diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/recipe/meta.yaml b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/recipe/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9ed0aa800f9485a6c7dc673d4b9c3f4dc877baa1 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/recipe/meta.yaml @@ -0,0 +1,61 @@ +# This file created by conda-build 3.21.4 +# meta.yaml template originally from: +# D:\a\1\s\recipe, last modified Tue Jun 15 20:22:53 2021 +# ------------------------------------------------ + +package: + name: pcre + version: '8.45' +source: + patches: + - 0001-Define-snprintf-for-old-VS.patch + sha256: 4e6ce03e0336e8b4a3d6c2b70b1c5e18590a5673a98186da90d4f33c23defc09 + url: https://ftp.pcre.org/pub/pcre/pcre-8.45.tar.gz +build: + number: '0' + run_exports: + - pcre >=8.45,<9.0a0 + string: h0e60522_0 +requirements: + build: + - cmake 3.20.4 h39d44d4_0 + - vs2015_runtime 14.28.29325 h5e1d092_4 + - vs2017_win-64 19.16.27038 h2e3bad8_2 + - vswhere 2.8.4 h57928b3_0 + host: + - vc 14.2 hb210afc_4 + - vs2015_runtime 14.28.29325 h5e1d092_4 + run: + - vc >=14.1,<15.0a0 + - vs2015_runtime >=14.16.27012 +test: + commands: + - pcregrep --help + - pcretest --help + - if not exist %LIBRARY_INC%\pcre.h exit 1 + - if not exist %LIBRARY_INC%\pcre_scanner.h exit 1 + - if not exist %LIBRARY_INC%\pcre_stringpiece.h exit 1 + - if not exist %LIBRARY_INC%\pcrecpp.h exit 1 + - if not exist %LIBRARY_INC%\pcrecpparg.h exit 1 + - if not exist %LIBRARY_INC%\pcreposix.h exit 1 + - if not exist %LIBRARY_LIB%\pcre.lib exit 1 + - if not exist %LIBRARY_BIN%\pcre.dll exit 1 + - if not exist %LIBRARY_LIB%\pcreposix.lib exit 1 + - if not exist %LIBRARY_BIN%\pcreposix.dll exit 1 + - if not exist %LIBRARY_LIB%\pcrecpp.lib exit 1 + - if not exist %LIBRARY_BIN%\pcrecpp.dll exit 1 +about: + home: http://www.pcre.org/ + license: BSD-3-Clause + license_file: LICENCE + summary: Regular expression pattern matching using the same syntax and semantics + as Perl 5. +extra: + copy_test_source_files: true + final: true + recipe-maintainers: + - jakirkham + - ocefpaf + - saraedum + - scopatz + - sebastian-luna-valero diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/recipe/meta.yaml.template b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/recipe/meta.yaml.template new file mode 100644 index 0000000000000000000000000000000000000000..4daf62a8f6d9c2016637fc9b41953eeade8aeb4c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/recipe/meta.yaml.template @@ -0,0 +1,77 @@ +{% set version = "8.45" %} + +package: + name: pcre + version: {{ version }} + +source: + url: https://ftp.pcre.org/pub/pcre/pcre-{{ version }}.tar.gz + sha256: 4e6ce03e0336e8b4a3d6c2b70b1c5e18590a5673a98186da90d4f33c23defc09 + patches: + - 0001-Define-snprintf-for-old-VS.patch + +build: + number: 0 + run_exports: + # mostly OK, but some scary symbol removal. Let's try for trusting them. + # https://abi-laboratory.pro/tracker/timeline/pcre/ + - {{ pin_subpackage('pcre', max_pin='x') }} + +requirements: + build: + - libtool # [unix] + - {{ compiler('c') }} + - {{ compiler('cxx') }} + - cmake # [win] + - pkg-config # [not win] + - libtool # [not win] + - make # [unix] + +test: + commands: + # CLI tests. + - pcre-config --version # [not win] + - pcregrep --help + - pcretest --help + + # Verify headers. + - test -f "${PREFIX}/include/pcre.h" # [not win] + - test -f "${PREFIX}/include/pcre_scanner.h" # [not win] + - test -f "${PREFIX}/include/pcre_stringpiece.h" # [not win] + - test -f "${PREFIX}/include/pcrecpp.h" # [not win] + - test -f "${PREFIX}/include/pcrecpparg.h" # [not win] + - test -f "${PREFIX}/include/pcreposix.h" # [not win] + - if not exist %LIBRARY_INC%\pcre.h exit 1 # [win] + - if not exist %LIBRARY_INC%\pcre_scanner.h exit 1 # [win] + - if not exist %LIBRARY_INC%\pcre_stringpiece.h exit 1 # [win] + - if not exist %LIBRARY_INC%\pcrecpp.h exit 1 # [win] + - if not exist %LIBRARY_INC%\pcrecpparg.h exit 1 # [win] + - if not exist %LIBRARY_INC%\pcreposix.h exit 1 # [win] + + # Verify libraries. + - test -f "${PREFIX}/lib/libpcre.a" # [not win] + - test -f "${PREFIX}/lib/libpcre${SHLIB_EXT}" # [not win] + - test -f "${PREFIX}/lib/libpcrecpp.a" # [not win] + - test -f "${PREFIX}/lib/libpcrecpp${SHLIB_EXT}" # [not win] + - test -f "${PREFIX}/lib/libpcreposix.a" # [not win] + - test -f "${PREFIX}/lib/libpcreposix${SHLIB_EXT}" # [not win] + - if not exist %LIBRARY_LIB%\pcre.lib exit 1 # [win] + - if not exist %LIBRARY_BIN%\pcre.dll exit 1 # [win] + - if not exist %LIBRARY_LIB%\pcreposix.lib exit 1 # [win] + - if not exist %LIBRARY_BIN%\pcreposix.dll exit 1 # [win] + - if not exist %LIBRARY_LIB%\pcrecpp.lib exit 1 # [win] + - if not exist %LIBRARY_BIN%\pcrecpp.dll exit 1 # [win] + +about: + home: http://www.pcre.org/ + license: BSD-3-Clause + license_file: LICENCE + summary: Regular expression pattern matching using the same syntax and semantics as Perl 5. + +extra: + recipe-maintainers: + - jakirkham + - scopatz + - sebastian-luna-valero + - saraedum + - ocefpaf diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/repodata_record.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/repodata_record.json new file mode 100644 index 0000000000000000000000000000000000000000..ef0584d9fad09636b715e10f7995195e9ffb9239 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/repodata_record.json @@ -0,0 +1,23 @@ +{ + "arch": "x86_64", + "build": "h0e60522_0", + "build_number": 0, + "build_string": "h0e60522_0", + "channel": "conda-forge", + "constrains": [], + "depends": [ + "vc >=14.1,<15.0a0", + "vs2015_runtime >=14.16.27012" + ], + "fn": "pcre-8.45-h0e60522_0.tar.bz2", + "license": "BSD-3-Clause", + "md5": "3cd3948bb5de74ebef93b6be6d8cf0d5", + "name": "pcre", + "platform": "win", + "sha256": "2ee62337b921b2d60a87aa9a91bf34bc855a0bbf6a5642ec66a7a175a772be6d", + "size": 530818, + "subdir": "win-64", + "timestamp": 1623789181, + "url": "https://conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0.tar.bz2", + "version": "8.45" +} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/run_exports.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/run_exports.json new file mode 100644 index 0000000000000000000000000000000000000000..1febe7fc9f481c2e47b8e0b637650a3833019e18 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/run_exports.json @@ -0,0 +1 @@ +{"weak": ["pcre >=8.45,<9.0a0"]} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/test/run_test.bat b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/test/run_test.bat new file mode 100644 index 0000000000000000000000000000000000000000..5dfcc6634d90173b2056082dcc42e5ea3dd07516 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/info/test/run_test.bat @@ -0,0 +1,33 @@ + + + + +pcregrep --help +IF %ERRORLEVEL% NEQ 0 exit /B 1 +pcretest --help +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if not exist %LIBRARY_INC%\pcre.h exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if not exist %LIBRARY_INC%\pcre_scanner.h exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if not exist %LIBRARY_INC%\pcre_stringpiece.h exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if not exist %LIBRARY_INC%\pcrecpp.h exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if not exist %LIBRARY_INC%\pcrecpparg.h exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if not exist %LIBRARY_INC%\pcreposix.h exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if not exist %LIBRARY_LIB%\pcre.lib exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if not exist %LIBRARY_BIN%\pcre.dll exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if not exist %LIBRARY_LIB%\pcreposix.lib exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if not exist %LIBRARY_BIN%\pcreposix.dll exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if not exist %LIBRARY_LIB%\pcrecpp.lib exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if not exist %LIBRARY_BIN%\pcrecpp.dll exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +exit /B 0 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil-7.2.2.dist-info/INSTALLER b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil-7.2.2.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a34a7e56db35cc4c85bfa166244b3d63a6a240d4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil-7.2.2.dist-info/INSTALLER @@ -0,0 +1 @@ +conda diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil-7.2.2.dist-info/METADATA b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil-7.2.2.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..8319b3fd872402bdba1f950c0197b40613cdb2b9 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil-7.2.2.dist-info/METADATA @@ -0,0 +1,555 @@ +Metadata-Version: 2.4 +Name: psutil +Version: 7.2.2 +Summary: Cross-platform lib for process and system monitoring. +Home-page: https://github.com/giampaolo/psutil +Author: Giampaolo Rodola +Author-email: g.rodola@gmail.com +License: BSD-3-Clause +Keywords: ps,top,kill,free,lsof,netstat,nice,tty,ionice,uptime,taskmgr,process,df,iotop,iostat,ifconfig,taskset,who,pidof,pmap,smem,pstree,monitoring,ulimit,prlimit,smem,performance,metrics,agent,observability +Platform: Platform Independent +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Console +Classifier: Intended Audience :: Developers +Classifier: Intended Audience :: Information Technology +Classifier: Intended Audience :: System Administrators +Classifier: Operating System :: MacOS :: MacOS X +Classifier: Operating System :: Microsoft :: Windows :: Windows 10 +Classifier: Operating System :: Microsoft :: Windows :: Windows 11 +Classifier: Operating System :: Microsoft :: Windows :: Windows 7 +Classifier: Operating System :: Microsoft :: Windows :: Windows 8 +Classifier: Operating System :: Microsoft :: Windows :: Windows 8.1 +Classifier: Operating System :: Microsoft :: Windows :: Windows Server 2003 +Classifier: Operating System :: Microsoft :: Windows :: Windows Server 2008 +Classifier: Operating System :: Microsoft :: Windows :: Windows Vista +Classifier: Operating System :: Microsoft :: Windows +Classifier: Operating System :: Microsoft +Classifier: Operating System :: OS Independent +Classifier: Operating System :: POSIX :: AIX +Classifier: Operating System :: POSIX :: BSD :: FreeBSD +Classifier: Operating System :: POSIX :: BSD :: NetBSD +Classifier: Operating System :: POSIX :: BSD :: OpenBSD +Classifier: Operating System :: POSIX :: BSD +Classifier: Operating System :: POSIX :: Linux +Classifier: Operating System :: POSIX :: SunOS/Solaris +Classifier: Operating System :: POSIX +Classifier: Programming Language :: C +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Classifier: Programming Language :: Python +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Topic :: Software Development :: Libraries +Classifier: Topic :: System :: Benchmark +Classifier: Topic :: System :: Hardware +Classifier: Topic :: System :: Monitoring +Classifier: Topic :: System :: Networking :: Monitoring :: Hardware Watchdog +Classifier: Topic :: System :: Networking :: Monitoring +Classifier: Topic :: System :: Networking +Classifier: Topic :: System :: Operating System +Classifier: Topic :: System :: Systems Administration +Classifier: Topic :: Utilities +Requires-Python: >=3.6 +Description-Content-Type: text/x-rst +License-File: LICENSE +Provides-Extra: dev +Requires-Dist: psleak; extra == "dev" +Requires-Dist: pytest; extra == "dev" +Requires-Dist: pytest-instafail; extra == "dev" +Requires-Dist: pytest-xdist; extra == "dev" +Requires-Dist: setuptools; extra == "dev" +Requires-Dist: pywin32; (os_name == "nt" and implementation_name != "pypy") and extra == "dev" +Requires-Dist: wheel; (os_name == "nt" and implementation_name != "pypy") and extra == "dev" +Requires-Dist: wmi; (os_name == "nt" and implementation_name != "pypy") and extra == "dev" +Requires-Dist: abi3audit; extra == "dev" +Requires-Dist: black; extra == "dev" +Requires-Dist: check-manifest; extra == "dev" +Requires-Dist: coverage; extra == "dev" +Requires-Dist: packaging; extra == "dev" +Requires-Dist: pylint; extra == "dev" +Requires-Dist: pyperf; extra == "dev" +Requires-Dist: pypinfo; extra == "dev" +Requires-Dist: pytest-cov; extra == "dev" +Requires-Dist: requests; extra == "dev" +Requires-Dist: rstcheck; extra == "dev" +Requires-Dist: ruff; extra == "dev" +Requires-Dist: sphinx; extra == "dev" +Requires-Dist: sphinx_rtd_theme; extra == "dev" +Requires-Dist: toml-sort; extra == "dev" +Requires-Dist: twine; extra == "dev" +Requires-Dist: validate-pyproject[all]; extra == "dev" +Requires-Dist: virtualenv; extra == "dev" +Requires-Dist: vulture; extra == "dev" +Requires-Dist: wheel; extra == "dev" +Requires-Dist: colorama; os_name == "nt" and extra == "dev" +Requires-Dist: pyreadline3; os_name == "nt" and extra == "dev" +Provides-Extra: test +Requires-Dist: psleak; extra == "test" +Requires-Dist: pytest; extra == "test" +Requires-Dist: pytest-instafail; extra == "test" +Requires-Dist: pytest-xdist; extra == "test" +Requires-Dist: setuptools; extra == "test" +Requires-Dist: pywin32; (os_name == "nt" and implementation_name != "pypy") and extra == "test" +Requires-Dist: wheel; (os_name == "nt" and implementation_name != "pypy") and extra == "test" +Requires-Dist: wmi; (os_name == "nt" and implementation_name != "pypy") and extra == "test" +Dynamic: author +Dynamic: author-email +Dynamic: classifier +Dynamic: description +Dynamic: description-content-type +Dynamic: home-page +Dynamic: keywords +Dynamic: license +Dynamic: license-file +Dynamic: platform +Dynamic: provides-extra +Dynamic: requires-python +Dynamic: summary + +| |downloads| |stars| |forks| |contributors| |packages| +| |version| |license| |stackoverflow| |twitter| |tidelift| +| |github-actions-wheels| |github-actions-bsd| + +.. |downloads| image:: https://img.shields.io/pypi/dm/psutil.svg + :target: https://clickpy.clickhouse.com/dashboard/psutil + :alt: Downloads + +.. |stars| image:: https://img.shields.io/github/stars/giampaolo/psutil.svg + :target: https://github.com/giampaolo/psutil/stargazers + :alt: Github stars + +.. |forks| image:: https://img.shields.io/github/forks/giampaolo/psutil.svg + :target: https://github.com/giampaolo/psutil/network/members + :alt: Github forks + +.. |contributors| image:: https://img.shields.io/github/contributors/giampaolo/psutil.svg + :target: https://github.com/giampaolo/psutil/graphs/contributors + :alt: Contributors + +.. |stackoverflow| image:: https://img.shields.io/badge/stackoverflow-Ask%20questions-blue.svg + :target: https://stackoverflow.com/questions/tagged/psutil + :alt: Stackoverflow + +.. |github-actions-wheels| image:: https://img.shields.io/github/actions/workflow/status/giampaolo/psutil/.github/workflows/build.yml.svg?label=Linux%2C%20macOS%2C%20Windows + :target: https://github.com/giampaolo/psutil/actions?query=workflow%3Abuild + :alt: Linux, macOS, Windows + +.. |github-actions-bsd| image:: https://img.shields.io/github/actions/workflow/status/giampaolo/psutil/.github/workflows/bsd.yml.svg?label=FreeBSD,%20NetBSD,%20OpenBSD + :target: https://github.com/giampaolo/psutil/actions?query=workflow%3Absd-tests + :alt: FreeBSD, NetBSD, OpenBSD + +.. |version| image:: https://img.shields.io/pypi/v/psutil.svg?label=pypi + :target: https://pypi.org/project/psutil + :alt: Latest version + +.. |packages| image:: https://repology.org/badge/tiny-repos/python:psutil.svg + :target: https://repology.org/metapackage/python:psutil/versions + :alt: Binary packages + +.. |license| image:: https://img.shields.io/pypi/l/psutil.svg + :target: https://github.com/giampaolo/psutil/blob/master/LICENSE + :alt: License + +.. |twitter| image:: https://img.shields.io/twitter/follow/grodola?style=flat + :target: https://twitter.com/grodola + :alt: Twitter Follow + +.. |tidelift| image:: https://tidelift.com/badges/github/giampaolo/psutil?style=flat + :target: https://tidelift.com/subscription/pkg/pypi-psutil?utm_source=pypi-psutil&utm_medium=referral&utm_campaign=readme + :alt: Tidelift + +----- + +Quick links +=========== + +- `Home page `_ +- `Install `_ +- `Documentation `_ +- `Download `_ +- `Forum `_ +- `StackOverflow `_ +- `Blog `_ +- `What's new `_ + + +Summary +======= + +psutil (process and system utilities) is a cross-platform library for +retrieving information on **running processes** and **system utilization** +(CPU, memory, disks, network, sensors) in Python. +It is useful mainly for **system monitoring**, **profiling and limiting process +resources** and **management of running processes**. +It implements many functionalities offered by classic UNIX command line tools +such as *ps, top, iotop, lsof, netstat, ifconfig, free* and others. +psutil currently supports the following platforms: + +- **Linux** +- **Windows** +- **macOS** +- **FreeBSD, OpenBSD**, **NetBSD** +- **Sun Solaris** +- **AIX** + +Supported Python versions are cPython 3.6+ and `PyPy `__. +Latest psutil version supporting Python 2.7 is +`psutil 6.1.1 `__. + +Example usages +============== + +This represents pretty much the whole psutil API. + +CPU +--- + +.. code-block:: python + + >>> import psutil + >>> + >>> psutil.cpu_times() + scputimes(user=3961.46, nice=169.729, system=2150.659, idle=16900.540, iowait=629.59, irq=0.0, softirq=19.42, steal=0.0, guest=0, guest_nice=0.0) + >>> + >>> for x in range(3): + ... psutil.cpu_percent(interval=1) + ... + 4.0 + 5.9 + 3.8 + >>> + >>> for x in range(3): + ... psutil.cpu_percent(interval=1, percpu=True) + ... + [4.0, 6.9, 3.7, 9.2] + [7.0, 8.5, 2.4, 2.1] + [1.2, 9.0, 9.9, 7.2] + >>> + >>> for x in range(3): + ... psutil.cpu_times_percent(interval=1, percpu=False) + ... + scputimes(user=1.5, nice=0.0, system=0.5, idle=96.5, iowait=1.5, irq=0.0, softirq=0.0, steal=0.0, guest=0.0, guest_nice=0.0) + scputimes(user=1.0, nice=0.0, system=0.0, idle=99.0, iowait=0.0, irq=0.0, softirq=0.0, steal=0.0, guest=0.0, guest_nice=0.0) + scputimes(user=2.0, nice=0.0, system=0.0, idle=98.0, iowait=0.0, irq=0.0, softirq=0.0, steal=0.0, guest=0.0, guest_nice=0.0) + >>> + >>> psutil.cpu_count() + 4 + >>> psutil.cpu_count(logical=False) + 2 + >>> + >>> psutil.cpu_stats() + scpustats(ctx_switches=20455687, interrupts=6598984, soft_interrupts=2134212, syscalls=0) + >>> + >>> psutil.cpu_freq() + scpufreq(current=931.42925, min=800.0, max=3500.0) + >>> + >>> psutil.getloadavg() # also on Windows (emulated) + (3.14, 3.89, 4.67) + +Memory +------ + +.. code-block:: python + + >>> psutil.virtual_memory() + svmem(total=10367352832, available=6472179712, percent=37.6, used=8186245120, free=2181107712, active=4748992512, inactive=2758115328, buffers=790724608, cached=3500347392, shared=787554304) + >>> psutil.swap_memory() + sswap(total=2097147904, used=296128512, free=1801019392, percent=14.1, sin=304193536, sout=677842944) + >>> + +Disks +----- + +.. code-block:: python + + >>> psutil.disk_partitions() + [sdiskpart(device='/dev/sda1', mountpoint='/', fstype='ext4', opts='rw,nosuid'), + sdiskpart(device='/dev/sda2', mountpoint='/home', fstype='ext', opts='rw')] + >>> + >>> psutil.disk_usage('/') + sdiskusage(total=21378641920, used=4809781248, free=15482871808, percent=22.5) + >>> + >>> psutil.disk_io_counters(perdisk=False) + sdiskio(read_count=719566, write_count=1082197, read_bytes=18626220032, write_bytes=24081764352, read_time=5023392, write_time=63199568, read_merged_count=619166, write_merged_count=812396, busy_time=4523412) + >>> + +Network +------- + +.. code-block:: python + + >>> psutil.net_io_counters(pernic=True) + {'eth0': netio(bytes_sent=485291293, bytes_recv=6004858642, packets_sent=3251564, packets_recv=4787798, errin=0, errout=0, dropin=0, dropout=0), + 'lo': netio(bytes_sent=2838627, bytes_recv=2838627, packets_sent=30567, packets_recv=30567, errin=0, errout=0, dropin=0, dropout=0)} + >>> + >>> psutil.net_connections(kind='tcp') + [sconn(fd=115, family=, type=, laddr=addr(ip='10.0.0.1', port=48776), raddr=addr(ip='93.186.135.91', port=80), status='ESTABLISHED', pid=1254), + sconn(fd=117, family=, type=, laddr=addr(ip='10.0.0.1', port=43761), raddr=addr(ip='72.14.234.100', port=80), status='CLOSING', pid=2987), + ...] + >>> + >>> psutil.net_if_addrs() + {'lo': [snicaddr(family=, address='127.0.0.1', netmask='255.0.0.0', broadcast='127.0.0.1', ptp=None), + snicaddr(family=, address='::1', netmask='ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', broadcast=None, ptp=None), + snicaddr(family=, address='00:00:00:00:00:00', netmask=None, broadcast='00:00:00:00:00:00', ptp=None)], + 'wlan0': [snicaddr(family=, address='192.168.1.3', netmask='255.255.255.0', broadcast='192.168.1.255', ptp=None), + snicaddr(family=, address='fe80::c685:8ff:fe45:641%wlan0', netmask='ffff:ffff:ffff:ffff::', broadcast=None, ptp=None), + snicaddr(family=, address='c4:85:08:45:06:41', netmask=None, broadcast='ff:ff:ff:ff:ff:ff', ptp=None)]} + >>> + >>> psutil.net_if_stats() + {'lo': snicstats(isup=True, duplex=, speed=0, mtu=65536, flags='up,loopback,running'), + 'wlan0': snicstats(isup=True, duplex=, speed=100, mtu=1500, flags='up,broadcast,running,multicast')} + >>> + +Sensors +------- + +.. code-block:: python + + >>> import psutil + >>> psutil.sensors_temperatures() + {'acpitz': [shwtemp(label='', current=47.0, high=103.0, critical=103.0)], + 'asus': [shwtemp(label='', current=47.0, high=None, critical=None)], + 'coretemp': [shwtemp(label='Physical id 0', current=52.0, high=100.0, critical=100.0), + shwtemp(label='Core 0', current=45.0, high=100.0, critical=100.0)]} + >>> + >>> psutil.sensors_fans() + {'asus': [sfan(label='cpu_fan', current=3200)]} + >>> + >>> psutil.sensors_battery() + sbattery(percent=93, secsleft=16628, power_plugged=False) + >>> + +Other system info +----------------- + +.. code-block:: python + + >>> import psutil + >>> psutil.users() + [suser(name='giampaolo', terminal='pts/2', host='localhost', started=1340737536.0, pid=1352), + suser(name='giampaolo', terminal='pts/3', host='localhost', started=1340737792.0, pid=1788)] + >>> + >>> psutil.boot_time() + 1365519115.0 + >>> + +Process management +------------------ + +.. code-block:: python + + >>> import psutil + >>> psutil.pids() + [1, 2, 3, 4, 5, 6, 7, 46, 48, 50, 51, 178, 182, 222, 223, 224, 268, 1215, + 1216, 1220, 1221, 1243, 1244, 1301, 1601, 2237, 2355, 2637, 2774, 3932, + 4176, 4177, 4185, 4187, 4189, 4225, 4243, 4245, 4263, 4282, 4306, 4311, + 4312, 4313, 4314, 4337, 4339, 4357, 4358, 4363, 4383, 4395, 4408, 4433, + 4443, 4445, 4446, 5167, 5234, 5235, 5252, 5318, 5424, 5644, 6987, 7054, + 7055, 7071] + >>> + >>> p = psutil.Process(7055) + >>> p + psutil.Process(pid=7055, name='python3', status='running', started='09:04:44') + >>> p.pid + 7055 + >>> p.name() + 'python3' + >>> p.exe() + '/usr/bin/python3' + >>> p.cwd() + '/home/giampaolo' + >>> p.cmdline() + ['/usr/bin/python3', 'main.py'] + >>> + >>> p.ppid() + 7054 + >>> p.parent() + psutil.Process(pid=4699, name='bash', status='sleeping', started='09:06:44') + >>> p.parents() + [psutil.Process(pid=4699, name='bash', started='09:06:44'), + psutil.Process(pid=4689, name='gnome-terminal-server', status='sleeping', started='0:06:44'), + psutil.Process(pid=1, name='systemd', status='sleeping', started='05:56:55')] + >>> p.children(recursive=True) + [psutil.Process(pid=29835, name='python3', status='sleeping', started='11:45:38'), + psutil.Process(pid=29836, name='python3', status='waking', started='11:43:39')] + >>> + >>> p.status() + 'running' + >>> p.create_time() + 1267551141.5019531 + >>> p.terminal() + '/dev/pts/0' + >>> + >>> p.username() + 'giampaolo' + >>> p.uids() + puids(real=1000, effective=1000, saved=1000) + >>> p.gids() + pgids(real=1000, effective=1000, saved=1000) + >>> + >>> p.cpu_times() + pcputimes(user=1.02, system=0.31, children_user=0.32, children_system=0.1, iowait=0.0) + >>> p.cpu_percent(interval=1.0) + 12.1 + >>> p.cpu_affinity() + [0, 1, 2, 3] + >>> p.cpu_affinity([0, 1]) # set + >>> p.cpu_num() + 1 + >>> + >>> p.memory_info() + pmem(rss=10915840, vms=67608576, shared=3313664, text=2310144, lib=0, data=7262208, dirty=0) + >>> p.memory_full_info() # "real" USS memory usage (Linux, macOS, Win only) + pfullmem(rss=10199040, vms=52133888, shared=3887104, text=2867200, lib=0, data=5967872, dirty=0, uss=6545408, pss=6872064, swap=0) + >>> p.memory_percent() + 0.7823 + >>> p.memory_maps() + [pmmap_grouped(path='/lib/x8664-linux-gnu/libutil-2.15.so', rss=32768, size=2125824, pss=32768, shared_clean=0, shared_dirty=0, private_clean=20480, private_dirty=12288, referenced=32768, anonymous=12288, swap=0), + pmmap_grouped(path='/lib/x8664-linux-gnu/libc-2.15.so', rss=3821568, size=3842048, pss=3821568, shared_clean=0, shared_dirty=0, private_clean=0, private_dirty=3821568, referenced=3575808, anonymous=3821568, swap=0), + pmmap_grouped(path='[heap]', rss=32768, size=139264, pss=32768, shared_clean=0, shared_dirty=0, private_clean=0, private_dirty=32768, referenced=32768, anonymous=32768, swap=0), + pmmap_grouped(path='[stack]', rss=2465792, size=2494464, pss=2465792, shared_clean=0, shared_dirty=0, private_clean=0, private_dirty=2465792, referenced=2277376, anonymous=2465792, swap=0), + ...] + >>> + >>> p.io_counters() + pio(read_count=478001, write_count=59371, read_bytes=700416, write_bytes=69632, read_chars=456232, write_chars=517543) + >>> + >>> p.open_files() + [popenfile(path='/home/giampaolo/monit.py', fd=3, position=0, mode='r', flags=32768), + popenfile(path='/var/log/monit.log', fd=4, position=235542, mode='a', flags=33793)] + >>> + >>> p.net_connections(kind='tcp') + [pconn(fd=115, family=, type=, laddr=addr(ip='10.0.0.1', port=48776), raddr=addr(ip='93.186.135.91', port=80), status='ESTABLISHED'), + pconn(fd=117, family=, type=, laddr=addr(ip='10.0.0.1', port=43761), raddr=addr(ip='72.14.234.100', port=80), status='CLOSING')] + >>> + >>> p.threads() + [pthread(id=5234, user_time=22.5, system_time=9.2891), + pthread(id=5237, user_time=0.0707, system_time=1.1)] + >>> + >>> p.num_threads() + 4 + >>> p.num_fds() + 8 + >>> p.num_ctx_switches() + pctxsw(voluntary=78, involuntary=19) + >>> + >>> p.nice() + 0 + >>> p.nice(10) # set + >>> + >>> p.ionice(psutil.IOPRIO_CLASS_IDLE) # IO priority (Win and Linux only) + >>> p.ionice() + pionice(ioclass=, value=0) + >>> + >>> p.rlimit(psutil.RLIMIT_NOFILE, (5, 5)) # set resource limits (Linux only) + >>> p.rlimit(psutil.RLIMIT_NOFILE) + (5, 5) + >>> + >>> p.environ() + {'LC_PAPER': 'it_IT.UTF-8', 'SHELL': '/bin/bash', 'GREP_OPTIONS': '--color=auto', + 'XDG_CONFIG_DIRS': '/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg', + ...} + >>> + >>> p.as_dict() + {'status': 'running', 'num_ctx_switches': pctxsw(voluntary=63, involuntary=1), 'pid': 5457, ...} + >>> p.is_running() + True + >>> p.suspend() + >>> p.resume() + >>> + >>> p.terminate() + >>> p.kill() + >>> p.wait(timeout=3) + + >>> + >>> psutil.test() + USER PID %CPU %MEM VSZ RSS TTY START TIME COMMAND + root 1 0.0 0.0 24584 2240 Jun17 00:00 init + root 2 0.0 0.0 0 0 Jun17 00:00 kthreadd + ... + giampaolo 31475 0.0 0.0 20760 3024 /dev/pts/0 Jun19 00:00 python2.4 + giampaolo 31721 0.0 2.2 773060 181896 00:04 10:30 chrome + root 31763 0.0 0.0 0 0 00:05 00:00 kworker/0:1 + >>> + +Further process APIs +-------------------- + +.. code-block:: python + + >>> import psutil + >>> for proc in psutil.process_iter(['pid', 'name']): + ... print(proc.info) + ... + {'pid': 1, 'name': 'systemd'} + {'pid': 2, 'name': 'kthreadd'} + {'pid': 3, 'name': 'ksoftirqd/0'} + ... + >>> + >>> psutil.pid_exists(3) + True + >>> + >>> def on_terminate(proc): + ... print("process {} terminated".format(proc)) + ... + >>> # waits for multiple processes to terminate + >>> gone, alive = psutil.wait_procs(procs_list, timeout=3, callback=on_terminate) + >>> + +Heap info +--------- + +.. code-block:: python + + >>> import psutil + >>> psutil.heap_info() + pheap(heap_used=5177792, mmap_used=819200) + >>> psutil.heap_trim() + +See also `psleak `__ + +Windows services +---------------- + +.. code-block:: python + + >>> list(psutil.win_service_iter()) + [, + , + , + , + ...] + >>> s = psutil.win_service_get('alg') + >>> s.as_dict() + {'binpath': 'C:\\Windows\\System32\\alg.exe', + 'description': 'Provides support for 3rd party protocol plug-ins for Internet Connection Sharing', + 'display_name': 'Application Layer Gateway Service', + 'name': 'alg', + 'pid': None, + 'start_type': 'manual', + 'status': 'stopped', + 'username': 'NT AUTHORITY\\LocalService'} + +Projects using psutil +===================== + +Here's some I find particularly interesting: + +- https://github.com/giampaolo/psleak +- https://github.com/google/grr +- https://github.com/facebook/osquery/ +- https://github.com/nicolargo/glances +- https://github.com/aristocratos/bpytop +- https://github.com/Jahaja/psdash +- https://github.com/ajenti/ajenti +- https://github.com/home-assistant/home-assistant/ + +Portings +======== + +- Go: https://github.com/shirou/gopsutil +- C: https://github.com/hamon-in/cpslib +- Rust: https://github.com/rust-psutil/rust-psutil +- Nim: https://github.com/johnscillieri/psutil-nim + + + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil-7.2.2.dist-info/RECORD b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil-7.2.2.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..e091f11965e510a7f7f058d4ab84ce2e13958af0 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil-7.2.2.dist-info/RECORD @@ -0,0 +1,29 @@ +psutil-7.2.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +psutil-7.2.2.dist-info/METADATA,sha256=7sP_UB2h_DIjG_gTmfCkgMCyKaBYDuUpjNuzWrZVIQM,22973 +psutil-7.2.2.dist-info/RECORD,, +psutil-7.2.2.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +psutil-7.2.2.dist-info/WHEEL,sha256=pPKXVQdVJh9wBTyNVSCAWMcpjHNgMx0OZisx7G_uWdA,103 +psutil-7.2.2.dist-info/direct_url.json,sha256=TwAUFp_NwDx9rcZTbxnisSPIqlOHlLMgppbbpoykIHQ,82 +psutil-7.2.2.dist-info/licenses/LICENSE,sha256=uJwGOzeG4o4MCjjxkx22H-015p3SopZvvs_-4PRsjRA,1548 +psutil-7.2.2.dist-info/top_level.txt,sha256=gCNhn57wzksDjSAISmgMJ0aiXzQulk0GJhb2-BAyYgw,7 +psutil/__init__.py,sha256=HLMFt5EXYYZYyAvHGRBSTlNyTKpqC70sweMMivi7ZNk,89857 +psutil/__pycache__/__init__.cpython-314.pyc,, +psutil/__pycache__/_common.cpython-314.pyc,, +psutil/__pycache__/_ntuples.cpython-314.pyc,, +psutil/__pycache__/_psaix.cpython-314.pyc,, +psutil/__pycache__/_psbsd.cpython-314.pyc,, +psutil/__pycache__/_pslinux.cpython-314.pyc,, +psutil/__pycache__/_psosx.cpython-314.pyc,, +psutil/__pycache__/_psposix.cpython-314.pyc,, +psutil/__pycache__/_pssunos.cpython-314.pyc,, +psutil/__pycache__/_pswindows.cpython-314.pyc,, +psutil/_common.py,sha256=G7zp_Zfm9UOaDThfKEAfUnxanZeNnQYlk9fvb-IV_HU,25254 +psutil/_ntuples.py,sha256=m46Lk4q64nhqUV9ob02BMiGL6Jfra0WbkyTtF9iKMcc,10970 +psutil/_psaix.py,sha256=r-QDjV4UVFWfF9rJ5sLFatjPhz1DiA9lA-hUnMBqGOw,17616 +psutil/_psbsd.py,sha256=wagxSpZAZJyZGX_yYdvuwfAIAXXko_a1yzcKOTMt65Q,29263 +psutil/_pslinux.py,sha256=qKCbq4eEgHW2kcRhErAGknRXhajJ1aLIcDeuEktGl0k,84787 +psutil/_psosx.py,sha256=ifDqDpwf448iS2Enkr8x0HyIgNeSgYBuU3nABRT2s_I,15913 +psutil/_psposix.py,sha256=KIiHtY9ZOeOwDgIfbntJDC9_SFKASjWZGKt9nG-zmDk,11575 +psutil/_pssunos.py,sha256=zDSEQgCKVMtgVCmbLsrg2aEjwHu0uh-OFLMZSH-DzuU,23934 +psutil/_psutil_windows.cp314t-win_amd64.pyd,sha256=QGvNcwyKPEcfhaZCMbwkACIbYdLk3-IPtWwc6uhcj8o,75776 +psutil/_pswindows.py,sha256=WArTkd5zTBE2giAO6fQkXjRzf14mrwpzpOjJtEWN4iA,35370 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil-7.2.2.dist-info/REQUESTED b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil-7.2.2.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil-7.2.2.dist-info/WHEEL b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil-7.2.2.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..c0bf8266ae7fc8ff2ba934f374a41dee60581575 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil-7.2.2.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: setuptools (80.10.2) +Root-Is-Purelib: false +Tag: cp314-cp314t-win_amd64 + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil-7.2.2.dist-info/direct_url.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil-7.2.2.dist-info/direct_url.json new file mode 100644 index 0000000000000000000000000000000000000000..161a507b3c43919860b0d5631a5e190d557d7a8c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil-7.2.2.dist-info/direct_url.json @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///D:/bld/bld/rattler-build_psutil_1769678173/work"} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil-7.2.2.dist-info/licenses/LICENSE b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil-7.2.2.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..cff5eb74e1badd1c5237ed2654b349530179ad1d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil-7.2.2.dist-info/licenses/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2009, Jay Loden, Dave Daeschler, Giampaolo Rodola +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 psutil authors 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. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil-7.2.2.dist-info/top_level.txt b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil-7.2.2.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..a4d92cc08db6a0d8bfedbbbd620d1fb11f84677b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil-7.2.2.dist-info/top_level.txt @@ -0,0 +1 @@ +psutil diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f10598e9bcca7b301782c519a7270ac3c56a8c71 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__init__.py @@ -0,0 +1,2484 @@ +# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""psutil is a cross-platform library for retrieving information on +running processes and system utilization (CPU, memory, disks, network, +sensors) in Python. Supported platforms: + + - Linux + - Windows + - macOS + - FreeBSD + - OpenBSD + - NetBSD + - Sun Solaris + - AIX + +Supported Python versions are cPython 3.6+ and PyPy. +""" + +import collections +import contextlib +import datetime +import functools +import os +import signal +import socket +import subprocess +import sys +import threading +import time + +try: + import pwd +except ImportError: + pwd = None + +from . import _common +from . import _ntuples as _ntp +from ._common import AIX +from ._common import BSD +from ._common import CONN_CLOSE +from ._common import CONN_CLOSE_WAIT +from ._common import CONN_CLOSING +from ._common import CONN_ESTABLISHED +from ._common import CONN_FIN_WAIT1 +from ._common import CONN_FIN_WAIT2 +from ._common import CONN_LAST_ACK +from ._common import CONN_LISTEN +from ._common import CONN_NONE +from ._common import CONN_SYN_RECV +from ._common import CONN_SYN_SENT +from ._common import CONN_TIME_WAIT +from ._common import FREEBSD +from ._common import LINUX +from ._common import MACOS +from ._common import NETBSD +from ._common import NIC_DUPLEX_FULL +from ._common import NIC_DUPLEX_HALF +from ._common import NIC_DUPLEX_UNKNOWN +from ._common import OPENBSD +from ._common import OSX # deprecated alias +from ._common import POSIX +from ._common import POWER_TIME_UNKNOWN +from ._common import POWER_TIME_UNLIMITED +from ._common import STATUS_DEAD +from ._common import STATUS_DISK_SLEEP +from ._common import STATUS_IDLE +from ._common import STATUS_LOCKED +from ._common import STATUS_PARKED +from ._common import STATUS_RUNNING +from ._common import STATUS_SLEEPING +from ._common import STATUS_STOPPED +from ._common import STATUS_TRACING_STOP +from ._common import STATUS_WAITING +from ._common import STATUS_WAKING +from ._common import STATUS_ZOMBIE +from ._common import SUNOS +from ._common import WINDOWS +from ._common import AccessDenied +from ._common import Error +from ._common import NoSuchProcess +from ._common import TimeoutExpired +from ._common import ZombieProcess +from ._common import debug +from ._common import memoize_when_activated +from ._common import wrap_numbers as _wrap_numbers + +if LINUX: + # This is public API and it will be retrieved from _pslinux.py + # via sys.modules. + PROCFS_PATH = "/proc" + + from . import _pslinux as _psplatform + from ._pslinux import IOPRIO_CLASS_BE # noqa: F401 + from ._pslinux import IOPRIO_CLASS_IDLE # noqa: F401 + from ._pslinux import IOPRIO_CLASS_NONE # noqa: F401 + from ._pslinux import IOPRIO_CLASS_RT # noqa: F401 + +elif WINDOWS: + from . import _pswindows as _psplatform + from ._psutil_windows import ABOVE_NORMAL_PRIORITY_CLASS # noqa: F401 + from ._psutil_windows import BELOW_NORMAL_PRIORITY_CLASS # noqa: F401 + from ._psutil_windows import HIGH_PRIORITY_CLASS # noqa: F401 + from ._psutil_windows import IDLE_PRIORITY_CLASS # noqa: F401 + from ._psutil_windows import NORMAL_PRIORITY_CLASS # noqa: F401 + from ._psutil_windows import REALTIME_PRIORITY_CLASS # noqa: F401 + from ._pswindows import CONN_DELETE_TCB # noqa: F401 + from ._pswindows import IOPRIO_HIGH # noqa: F401 + from ._pswindows import IOPRIO_LOW # noqa: F401 + from ._pswindows import IOPRIO_NORMAL # noqa: F401 + from ._pswindows import IOPRIO_VERYLOW # noqa: F401 + +elif MACOS: + from . import _psosx as _psplatform + +elif BSD: + from . import _psbsd as _psplatform + +elif SUNOS: + from . import _pssunos as _psplatform + from ._pssunos import CONN_BOUND # noqa: F401 + from ._pssunos import CONN_IDLE # noqa: F401 + + # This is public writable API which is read from _pslinux.py and + # _pssunos.py via sys.modules. + PROCFS_PATH = "/proc" + +elif AIX: + from . import _psaix as _psplatform + + # This is public API and it will be retrieved from _pslinux.py + # via sys.modules. + PROCFS_PATH = "/proc" + +else: # pragma: no cover + msg = f"platform {sys.platform} is not supported" + raise NotImplementedError(msg) + + +# fmt: off +__all__ = [ + # exceptions + "Error", "NoSuchProcess", "ZombieProcess", "AccessDenied", + "TimeoutExpired", + + # constants + "version_info", "__version__", + + "STATUS_RUNNING", "STATUS_IDLE", "STATUS_SLEEPING", "STATUS_DISK_SLEEP", + "STATUS_STOPPED", "STATUS_TRACING_STOP", "STATUS_ZOMBIE", "STATUS_DEAD", + "STATUS_WAKING", "STATUS_LOCKED", "STATUS_WAITING", "STATUS_PARKED", + + "CONN_ESTABLISHED", "CONN_SYN_SENT", "CONN_SYN_RECV", "CONN_FIN_WAIT1", + "CONN_FIN_WAIT2", "CONN_TIME_WAIT", "CONN_CLOSE", "CONN_CLOSE_WAIT", + "CONN_LAST_ACK", "CONN_LISTEN", "CONN_CLOSING", "CONN_NONE", + # "CONN_IDLE", "CONN_BOUND", + + "AF_LINK", + + "NIC_DUPLEX_FULL", "NIC_DUPLEX_HALF", "NIC_DUPLEX_UNKNOWN", + + "POWER_TIME_UNKNOWN", "POWER_TIME_UNLIMITED", + + "BSD", "FREEBSD", "LINUX", "NETBSD", "OPENBSD", "MACOS", "OSX", "POSIX", + "SUNOS", "WINDOWS", "AIX", + + # "RLIM_INFINITY", "RLIMIT_AS", "RLIMIT_CORE", "RLIMIT_CPU", "RLIMIT_DATA", + # "RLIMIT_FSIZE", "RLIMIT_LOCKS", "RLIMIT_MEMLOCK", "RLIMIT_NOFILE", + # "RLIMIT_NPROC", "RLIMIT_RSS", "RLIMIT_STACK", "RLIMIT_MSGQUEUE", + # "RLIMIT_NICE", "RLIMIT_RTPRIO", "RLIMIT_RTTIME", "RLIMIT_SIGPENDING", + + # classes + "Process", "Popen", + + # functions + "pid_exists", "pids", "process_iter", "wait_procs", # proc + "virtual_memory", "swap_memory", # memory + "cpu_times", "cpu_percent", "cpu_times_percent", "cpu_count", # cpu + "cpu_stats", # "cpu_freq", "getloadavg" + "net_io_counters", "net_connections", "net_if_addrs", # network + "net_if_stats", + "disk_io_counters", "disk_partitions", "disk_usage", # disk + # "sensors_temperatures", "sensors_battery", "sensors_fans" # sensors + "users", "boot_time", # others +] +# fmt: on + + +__all__.extend(_psplatform.__extra__all__) + +# Linux, FreeBSD +if hasattr(_psplatform.Process, "rlimit"): + # Populate global namespace with RLIM* constants. + _globals = globals() + _name = None + for _name in dir(_psplatform.cext): + if _name.startswith('RLIM') and _name.isupper(): + _globals[_name] = getattr(_psplatform.cext, _name) + __all__.append(_name) + del _globals, _name + +AF_LINK = _psplatform.AF_LINK + +__author__ = "Giampaolo Rodola'" +__version__ = "7.2.2" +version_info = tuple(int(num) for num in __version__.split('.')) + +_timer = getattr(time, 'monotonic', time.time) +_TOTAL_PHYMEM = None +_LOWEST_PID = None +_SENTINEL = object() + +# Sanity check in case the user messed up with psutil installation +# or did something weird with sys.path. In this case we might end +# up importing a python module using a C extension module which +# was compiled for a different version of psutil. +# We want to prevent that by failing sooner rather than later. +# See: https://github.com/giampaolo/psutil/issues/564 +if int(__version__.replace('.', '')) != getattr( + _psplatform.cext, 'version', None +): + msg = f"version conflict: {_psplatform.cext.__file__!r} C extension " + msg += "module was built for another version of psutil" + if hasattr(_psplatform.cext, 'version'): + v = ".".join(list(str(_psplatform.cext.version))) + msg += f" ({v} instead of {__version__})" + else: + msg += f" (different than {__version__})" + what = getattr( + _psplatform.cext, + "__file__", + "the existing psutil install directory", + ) + msg += f"; you may try to 'pip uninstall psutil', manually remove {what}" + msg += " or clean the virtual env somehow, then reinstall" + raise ImportError(msg) + + +# ===================================================================== +# --- Utils +# ===================================================================== + + +if hasattr(_psplatform, 'ppid_map'): + # Faster version (Windows and Linux). + _ppid_map = _psplatform.ppid_map +else: # pragma: no cover + + def _ppid_map(): + """Return a {pid: ppid, ...} dict for all running processes in + one shot. Used to speed up Process.children(). + """ + ret = {} + for pid in pids(): + try: + ret[pid] = _psplatform.Process(pid).ppid() + except (NoSuchProcess, ZombieProcess): + pass + return ret + + +def _pprint_secs(secs): + """Format seconds in a human readable form.""" + now = time.time() + secs_ago = int(now - secs) + fmt = "%H:%M:%S" if secs_ago < 60 * 60 * 24 else "%Y-%m-%d %H:%M:%S" + return datetime.datetime.fromtimestamp(secs).strftime(fmt) + + +def _check_conn_kind(kind): + """Check net_connections()'s `kind` parameter.""" + kinds = tuple(_common.conn_tmap) + if kind not in kinds: + msg = f"invalid kind argument {kind!r}; valid ones are: {kinds}" + raise ValueError(msg) + + +# ===================================================================== +# --- Process class +# ===================================================================== + + +class Process: + """Represents an OS process with the given PID. + If PID is omitted current process PID (os.getpid()) is used. + Raise NoSuchProcess if PID does not exist. + + Note that most of the methods of this class do not make sure that + the PID of the process being queried has been reused. That means + that you may end up retrieving information for another process. + + The only exceptions for which process identity is pre-emptively + checked and guaranteed are: + + - parent() + - children() + - nice() (set) + - ionice() (set) + - rlimit() (set) + - cpu_affinity (set) + - suspend() + - resume() + - send_signal() + - terminate() + - kill() + + To prevent this problem for all other methods you can use + is_running() before querying the process. + """ + + def __init__(self, pid=None): + self._init(pid) + + def _init(self, pid, _ignore_nsp=False): + if pid is None: + pid = os.getpid() + else: + if pid < 0: + msg = f"pid must be a positive integer (got {pid})" + raise ValueError(msg) + try: + _psplatform.cext.check_pid_range(pid) + except OverflowError as err: + msg = "process PID out of range" + raise NoSuchProcess(pid, msg=msg) from err + + self._pid = pid + self._name = None + self._exe = None + self._create_time = None + self._gone = False + self._pid_reused = False + self._hash = None + self._lock = threading.RLock() + # used for caching on Windows only (on POSIX ppid may change) + self._ppid = None + # platform-specific modules define an _psplatform.Process + # implementation class + self._proc = _psplatform.Process(pid) + self._last_sys_cpu_times = None + self._last_proc_cpu_times = None + self._exitcode = _SENTINEL + self._ident = (self.pid, None) + try: + self._ident = self._get_ident() + except AccessDenied: + # This should happen on Windows only, since we use the fast + # create time method. AFAIK, on all other platforms we are + # able to get create time for all PIDs. + pass + except ZombieProcess: + # Zombies can still be queried by this class (although + # not always) and pids() return them so just go on. + pass + except NoSuchProcess: + if not _ignore_nsp: + msg = "process PID not found" + raise NoSuchProcess(pid, msg=msg) from None + self._gone = True + + def _get_ident(self): + """Return a (pid, uid) tuple which is supposed to identify a + Process instance univocally over time. The PID alone is not + enough, as it can be assigned to a new process after this one + terminates, so we add process creation time to the mix. We need + this in order to prevent killing the wrong process later on. + This is also known as PID reuse or PID recycling problem. + + The reliability of this strategy mostly depends on + create_time() precision, which is 0.01 secs on Linux. The + assumption is that, after a process terminates, the kernel + won't reuse the same PID after such a short period of time + (0.01 secs). Technically this is inherently racy, but + practically it should be good enough. + + NOTE: unreliable on FreeBSD and OpenBSD as ctime is subject to + system clock updates. + """ + + if WINDOWS: + # Use create_time() fast method in order to speedup + # `process_iter()`. This means we'll get AccessDenied for + # most ADMIN processes, but that's fine since it means + # we'll also get AccessDenied on kill(). + # https://github.com/giampaolo/psutil/issues/2366#issuecomment-2381646555 + self._create_time = self._proc.create_time(fast_only=True) + return (self.pid, self._create_time) + elif LINUX or NETBSD or OSX: + # Use 'monotonic' process starttime since boot to form unique + # process identity, since it is stable over changes to system + # time. + return (self.pid, self._proc.create_time(monotonic=True)) + else: + return (self.pid, self.create_time()) + + def __str__(self): + info = collections.OrderedDict() + info["pid"] = self.pid + if self._name: + info['name'] = self._name + with self.oneshot(): + if self._pid_reused: + info["status"] = "terminated + PID reused" + else: + try: + info["name"] = self.name() + info["status"] = self.status() + except ZombieProcess: + info["status"] = "zombie" + except NoSuchProcess: + info["status"] = "terminated" + except AccessDenied: + pass + + if self._exitcode not in {_SENTINEL, None}: + info["exitcode"] = self._exitcode + if self._create_time is not None: + info['started'] = _pprint_secs(self._create_time) + + return "{}.{}({})".format( + self.__class__.__module__, + self.__class__.__name__, + ", ".join([f"{k}={v!r}" for k, v in info.items()]), + ) + + __repr__ = __str__ + + def __eq__(self, other): + # Test for equality with another Process object based + # on PID and creation time. + if not isinstance(other, Process): + return NotImplemented + if OPENBSD or NETBSD or SUNOS: # pragma: no cover + # Zombie processes on Open/NetBSD/illumos/Solaris have a + # creation time of 0.0. This covers the case when a process + # started normally (so it has a ctime), then it turned into a + # zombie. It's important to do this because is_running() + # depends on __eq__. + pid1, ident1 = self._ident + pid2, ident2 = other._ident + if pid1 == pid2: + if ident1 and not ident2: + try: + return self.status() == STATUS_ZOMBIE + except Error: + pass + return self._ident == other._ident + + def __ne__(self, other): + return not self == other + + def __hash__(self): + if self._hash is None: + self._hash = hash(self._ident) + return self._hash + + def _raise_if_pid_reused(self): + """Raises NoSuchProcess in case process PID has been reused.""" + if self._pid_reused or (not self.is_running() and self._pid_reused): + # We may directly raise NSP in here already if PID is just + # not running, but I prefer NSP to be raised naturally by + # the actual Process API call. This way unit tests will tell + # us if the API is broken (aka don't raise NSP when it + # should). We also remain consistent with all other "get" + # APIs which don't use _raise_if_pid_reused(). + msg = "process no longer exists and its PID has been reused" + raise NoSuchProcess(self.pid, self._name, msg=msg) + + @property + def pid(self): + """The process PID.""" + return self._pid + + # --- utility methods + + @contextlib.contextmanager + def oneshot(self): + """Utility context manager which considerably speeds up the + retrieval of multiple process information at the same time. + + Internally different process info (e.g. name, ppid, uids, + gids, ...) may be fetched by using the same routine, but + only one information is returned and the others are discarded. + When using this context manager the internal routine is + executed once (in the example below on name()) and the + other info are cached. + + The cache is cleared when exiting the context manager block. + The advice is to use this every time you retrieve more than + one information about the process. If you're lucky, you'll + get a hell of a speedup. + + >>> import psutil + >>> p = psutil.Process() + >>> with p.oneshot(): + ... p.name() # collect multiple info + ... p.cpu_times() # return cached value + ... p.cpu_percent() # return cached value + ... p.create_time() # return cached value + ... + >>> + """ + with self._lock: + if hasattr(self, "_cache"): + # NOOP: this covers the use case where the user enters the + # context twice: + # + # >>> with p.oneshot(): + # ... with p.oneshot(): + # ... + # + # Also, since as_dict() internally uses oneshot() + # I expect that the code below will be a pretty common + # "mistake" that the user will make, so let's guard + # against that: + # + # >>> with p.oneshot(): + # ... p.as_dict() + # ... + yield + else: + try: + # cached in case cpu_percent() is used + self.cpu_times.cache_activate(self) + # cached in case memory_percent() is used + self.memory_info.cache_activate(self) + # cached in case parent() is used + self.ppid.cache_activate(self) + # cached in case username() is used + if POSIX: + self.uids.cache_activate(self) + # specific implementation cache + self._proc.oneshot_enter() + yield + finally: + self.cpu_times.cache_deactivate(self) + self.memory_info.cache_deactivate(self) + self.ppid.cache_deactivate(self) + if POSIX: + self.uids.cache_deactivate(self) + self._proc.oneshot_exit() + + def as_dict(self, attrs=None, ad_value=None): + """Utility method returning process information as a + hashable dictionary. + If *attrs* is specified it must be a list of strings + reflecting available Process class' attribute names + (e.g. ['cpu_times', 'name']) else all public (read + only) attributes are assumed. + *ad_value* is the value which gets assigned in case + AccessDenied or ZombieProcess exception is raised when + retrieving that particular process information. + """ + valid_names = _as_dict_attrnames + if attrs is not None: + if not isinstance(attrs, (list, tuple, set, frozenset)): + msg = f"invalid attrs type {type(attrs)}" + raise TypeError(msg) + attrs = set(attrs) + invalid_names = attrs - valid_names + if invalid_names: + msg = "invalid attr name{} {}".format( + "s" if len(invalid_names) > 1 else "", + ", ".join(map(repr, invalid_names)), + ) + raise ValueError(msg) + + retdict = {} + ls = attrs or valid_names + with self.oneshot(): + for name in ls: + try: + if name == 'pid': + ret = self.pid + else: + meth = getattr(self, name) + ret = meth() + except (AccessDenied, ZombieProcess): + ret = ad_value + except NotImplementedError: + # in case of not implemented functionality (may happen + # on old or exotic systems) we want to crash only if + # the user explicitly asked for that particular attr + if attrs: + raise + continue + retdict[name] = ret + return retdict + + def parent(self): + """Return the parent process as a Process object pre-emptively + checking whether PID has been reused. + If no parent is known return None. + """ + lowest_pid = _LOWEST_PID if _LOWEST_PID is not None else pids()[0] + if self.pid == lowest_pid: + return None + ppid = self.ppid() + if ppid is not None: + # Get a fresh (non-cached) ctime in case the system clock + # was updated. TODO: use a monotonic ctime on platforms + # where it's supported. + proc_ctime = Process(self.pid).create_time() + try: + parent = Process(ppid) + if parent.create_time() <= proc_ctime: + return parent + # ...else ppid has been reused by another process + except NoSuchProcess: + pass + + def parents(self): + """Return the parents of this process as a list of Process + instances. If no parents are known return an empty list. + """ + parents = [] + proc = self.parent() + while proc is not None: + parents.append(proc) + proc = proc.parent() + return parents + + def is_running(self): + """Return whether this process is running. + + It also checks if PID has been reused by another process, in + which case it will remove the process from `process_iter()` + internal cache and return False. + """ + if self._gone or self._pid_reused: + return False + try: + # Checking if PID is alive is not enough as the PID might + # have been reused by another process. Process identity / + # uniqueness over time is guaranteed by (PID + creation + # time) and that is verified in __eq__. + self._pid_reused = self != Process(self.pid) + if self._pid_reused: + _pids_reused.add(self.pid) + raise NoSuchProcess(self.pid) + return True + except ZombieProcess: + # We should never get here as it's already handled in + # Process.__init__; here just for extra safety. + return True + except NoSuchProcess: + self._gone = True + return False + + # --- actual API + + @memoize_when_activated + def ppid(self): + """The process parent PID. + On Windows the return value is cached after first call. + """ + # On POSIX we don't want to cache the ppid as it may unexpectedly + # change to 1 (init) in case this process turns into a zombie: + # https://github.com/giampaolo/psutil/issues/321 + # http://stackoverflow.com/questions/356722/ + + # XXX should we check creation time here rather than in + # Process.parent()? + self._raise_if_pid_reused() + if POSIX: + return self._proc.ppid() + else: # pragma: no cover + self._ppid = self._ppid or self._proc.ppid() + return self._ppid + + def name(self): + """The process name. The return value is cached after first call.""" + # Process name is only cached on Windows as on POSIX it may + # change, see: + # https://github.com/giampaolo/psutil/issues/692 + if WINDOWS and self._name is not None: + return self._name + name = self._proc.name() + if POSIX and len(name) >= 15: + # On UNIX the name gets truncated to the first 15 characters. + # If it matches the first part of the cmdline we return that + # one instead because it's usually more explicative. + # Examples are "gnome-keyring-d" vs. "gnome-keyring-daemon". + try: + cmdline = self.cmdline() + except (AccessDenied, ZombieProcess): + # Just pass and return the truncated name: it's better + # than nothing. Note: there are actual cases where a + # zombie process can return a name() but not a + # cmdline(), see: + # https://github.com/giampaolo/psutil/issues/2239 + pass + else: + if cmdline: + extended_name = os.path.basename(cmdline[0]) + if extended_name.startswith(name): + name = extended_name + self._name = name + self._proc._name = name + return name + + def exe(self): + """The process executable as an absolute path. + May also be an empty string. + The return value is cached after first call. + """ + + def guess_it(fallback): + # try to guess exe from cmdline[0] in absence of a native + # exe representation + cmdline = self.cmdline() + if cmdline and hasattr(os, 'access') and hasattr(os, 'X_OK'): + exe = cmdline[0] # the possible exe + # Attempt to guess only in case of an absolute path. + # It is not safe otherwise as the process might have + # changed cwd. + if ( + os.path.isabs(exe) + and os.path.isfile(exe) + and os.access(exe, os.X_OK) + ): + return exe + if isinstance(fallback, AccessDenied): + raise fallback + return fallback + + if self._exe is None: + try: + exe = self._proc.exe() + except AccessDenied as err: + return guess_it(fallback=err) + else: + if not exe: + # underlying implementation can legitimately return an + # empty string; if that's the case we don't want to + # raise AD while guessing from the cmdline + try: + exe = guess_it(fallback=exe) + except AccessDenied: + pass + self._exe = exe + return self._exe + + def cmdline(self): + """The command line this process has been called with.""" + return self._proc.cmdline() + + def status(self): + """The process current status as a STATUS_* constant.""" + try: + return self._proc.status() + except ZombieProcess: + return STATUS_ZOMBIE + + def username(self): + """The name of the user that owns the process. + On UNIX this is calculated by using *real* process uid. + """ + if POSIX: + if pwd is None: + # might happen if python was installed from sources + msg = "requires pwd module shipped with standard python" + raise ImportError(msg) + real_uid = self.uids().real + try: + return pwd.getpwuid(real_uid).pw_name + except KeyError: + # the uid can't be resolved by the system + return str(real_uid) + else: + return self._proc.username() + + def create_time(self): + """The process creation time as a floating point number + expressed in seconds since the epoch (seconds since January 1, + 1970, at midnight UTC). The return value, which is cached after + first call, is based on the system clock, which means it may be + affected by changes such as manual adjustments or time + synchronization (e.g. NTP). + """ + if self._create_time is None: + self._create_time = self._proc.create_time() + return self._create_time + + def cwd(self): + """Process current working directory as an absolute path.""" + return self._proc.cwd() + + def nice(self, value=None): + """Get or set process niceness (priority).""" + if value is None: + return self._proc.nice_get() + else: + self._raise_if_pid_reused() + self._proc.nice_set(value) + + if POSIX: + + @memoize_when_activated + def uids(self): + """Return process UIDs as a (real, effective, saved) + namedtuple. + """ + return self._proc.uids() + + def gids(self): + """Return process GIDs as a (real, effective, saved) + namedtuple. + """ + return self._proc.gids() + + def terminal(self): + """The terminal associated with this process, if any, + else None. + """ + return self._proc.terminal() + + def num_fds(self): + """Return the number of file descriptors opened by this + process (POSIX only). + """ + return self._proc.num_fds() + + # Linux, BSD, AIX and Windows only + if hasattr(_psplatform.Process, "io_counters"): + + def io_counters(self): + """Return process I/O statistics as a + (read_count, write_count, read_bytes, write_bytes) + namedtuple. + Those are the number of read/write calls performed and the + amount of bytes read and written by the process. + """ + return self._proc.io_counters() + + # Linux and Windows + if hasattr(_psplatform.Process, "ionice_get"): + + def ionice(self, ioclass=None, value=None): + """Get or set process I/O niceness (priority). + + On Linux *ioclass* is one of the IOPRIO_CLASS_* constants. + *value* is a number which goes from 0 to 7. The higher the + value, the lower the I/O priority of the process. + + On Windows only *ioclass* is used and it can be set to 2 + (normal), 1 (low) or 0 (very low). + + Available on Linux and Windows > Vista only. + """ + if ioclass is None: + if value is not None: + msg = "'ioclass' argument must be specified" + raise ValueError(msg) + return self._proc.ionice_get() + else: + self._raise_if_pid_reused() + return self._proc.ionice_set(ioclass, value) + + # Linux / FreeBSD only + if hasattr(_psplatform.Process, "rlimit"): + + def rlimit(self, resource, limits=None): + """Get or set process resource limits as a (soft, hard) + tuple. + + *resource* is one of the RLIMIT_* constants. + *limits* is supposed to be a (soft, hard) tuple. + + See "man prlimit" for further info. + Available on Linux and FreeBSD only. + """ + if limits is not None: + self._raise_if_pid_reused() + return self._proc.rlimit(resource, limits) + + # Windows, Linux and FreeBSD only + if hasattr(_psplatform.Process, "cpu_affinity_get"): + + def cpu_affinity(self, cpus=None): + """Get or set process CPU affinity. + If specified, *cpus* must be a list of CPUs for which you + want to set the affinity (e.g. [0, 1]). + If an empty list is passed, all egible CPUs are assumed + (and set). + (Windows, Linux and BSD only). + """ + if cpus is None: + return sorted(set(self._proc.cpu_affinity_get())) + else: + self._raise_if_pid_reused() + if not cpus: + if hasattr(self._proc, "_get_eligible_cpus"): + cpus = self._proc._get_eligible_cpus() + else: + cpus = tuple(range(len(cpu_times(percpu=True)))) + self._proc.cpu_affinity_set(list(set(cpus))) + + # Linux, FreeBSD, SunOS + if hasattr(_psplatform.Process, "cpu_num"): + + def cpu_num(self): + """Return what CPU this process is currently running on. + The returned number should be <= psutil.cpu_count() + and <= len(psutil.cpu_percent(percpu=True)). + It may be used in conjunction with + psutil.cpu_percent(percpu=True) to observe the system + workload distributed across CPUs. + """ + return self._proc.cpu_num() + + # All platforms has it, but maybe not in the future. + if hasattr(_psplatform.Process, "environ"): + + def environ(self): + """The environment variables of the process as a dict. Note: this + might not reflect changes made after the process started. + """ + return self._proc.environ() + + if WINDOWS: + + def num_handles(self): + """Return the number of handles opened by this process + (Windows only). + """ + return self._proc.num_handles() + + def num_ctx_switches(self): + """Return the number of voluntary and involuntary context + switches performed by this process. + """ + return self._proc.num_ctx_switches() + + def num_threads(self): + """Return the number of threads used by this process.""" + return self._proc.num_threads() + + if hasattr(_psplatform.Process, "threads"): + + def threads(self): + """Return threads opened by process as a list of + (id, user_time, system_time) namedtuples representing + thread id and thread CPU times (user/system). + On OpenBSD this method requires root access. + """ + return self._proc.threads() + + def children(self, recursive=False): + """Return the children of this process as a list of Process + instances, pre-emptively checking whether PID has been reused. + If *recursive* is True return all the parent descendants. + + Example (A == this process): + + A ─┐ + │ + ├─ B (child) ─┐ + │ └─ X (grandchild) ─┐ + │ └─ Y (great grandchild) + ├─ C (child) + └─ D (child) + + >>> import psutil + >>> p = psutil.Process() + >>> p.children() + B, C, D + >>> p.children(recursive=True) + B, X, Y, C, D + + Note that in the example above if process X disappears + process Y won't be listed as the reference to process A + is lost. + """ + self._raise_if_pid_reused() + ppid_map = _ppid_map() + # Get a fresh (non-cached) ctime in case the system clock was + # updated. TODO: use a monotonic ctime on platforms where it's + # supported. + proc_ctime = Process(self.pid).create_time() + ret = [] + if not recursive: + for pid, ppid in ppid_map.items(): + if ppid == self.pid: + try: + child = Process(pid) + # if child happens to be older than its parent + # (self) it means child's PID has been reused + if proc_ctime <= child.create_time(): + ret.append(child) + except (NoSuchProcess, ZombieProcess): + pass + else: + # Construct a {pid: [child pids]} dict + reverse_ppid_map = collections.defaultdict(list) + for pid, ppid in ppid_map.items(): + reverse_ppid_map[ppid].append(pid) + # Recursively traverse that dict, starting from self.pid, + # such that we only call Process() on actual children + seen = set() + stack = [self.pid] + while stack: + pid = stack.pop() + if pid in seen: + # Since pids can be reused while the ppid_map is + # constructed, there may be rare instances where + # there's a cycle in the recorded process "tree". + continue + seen.add(pid) + for child_pid in reverse_ppid_map[pid]: + try: + child = Process(child_pid) + # if child happens to be older than its parent + # (self) it means child's PID has been reused + intime = proc_ctime <= child.create_time() + if intime: + ret.append(child) + stack.append(child_pid) + except (NoSuchProcess, ZombieProcess): + pass + return ret + + def cpu_percent(self, interval=None): + """Return a float representing the current process CPU + utilization as a percentage. + + When *interval* is 0.0 or None (default) compares process times + to system CPU times elapsed since last call, returning + immediately (non-blocking). That means that the first time + this is called it will return a meaningful 0.0 value. + + When *interval* is > 0.0 compares process times to system CPU + times elapsed before and after the interval (blocking). + + In this case is recommended for accuracy that this function + be called with at least 0.1 seconds between calls. + + A value > 100.0 can be returned in case of processes running + multiple threads on different CPU cores. + + The returned value is explicitly NOT split evenly between + all available logical CPUs. This means that a busy loop process + running on a system with 2 logical CPUs will be reported as + having 100% CPU utilization instead of 50%. + + Examples: + + >>> import psutil + >>> p = psutil.Process(os.getpid()) + >>> # blocking + >>> p.cpu_percent(interval=1) + 2.0 + >>> # non-blocking (percentage since last call) + >>> p.cpu_percent(interval=None) + 2.9 + >>> + """ + blocking = interval is not None and interval > 0.0 + if interval is not None and interval < 0: + msg = f"interval is not positive (got {interval!r})" + raise ValueError(msg) + num_cpus = cpu_count() or 1 + + def timer(): + return _timer() * num_cpus + + if blocking: + st1 = timer() + pt1 = self._proc.cpu_times() + time.sleep(interval) + st2 = timer() + pt2 = self._proc.cpu_times() + else: + st1 = self._last_sys_cpu_times + pt1 = self._last_proc_cpu_times + st2 = timer() + pt2 = self._proc.cpu_times() + if st1 is None or pt1 is None: + self._last_sys_cpu_times = st2 + self._last_proc_cpu_times = pt2 + return 0.0 + + delta_proc = (pt2.user - pt1.user) + (pt2.system - pt1.system) + delta_time = st2 - st1 + # reset values for next call in case of interval == None + self._last_sys_cpu_times = st2 + self._last_proc_cpu_times = pt2 + + try: + # This is the utilization split evenly between all CPUs. + # E.g. a busy loop process on a 2-CPU-cores system at this + # point is reported as 50% instead of 100%. + overall_cpus_percent = (delta_proc / delta_time) * 100 + except ZeroDivisionError: + # interval was too low + return 0.0 + else: + # Note 1: + # in order to emulate "top" we multiply the value for the num + # of CPU cores. This way the busy process will be reported as + # having 100% (or more) usage. + # + # Note 2: + # taskmgr.exe on Windows differs in that it will show 50% + # instead. + # + # Note 3: + # a percentage > 100 is legitimate as it can result from a + # process with multiple threads running on different CPU + # cores (top does the same), see: + # http://stackoverflow.com/questions/1032357 + # https://github.com/giampaolo/psutil/issues/474 + single_cpu_percent = overall_cpus_percent * num_cpus + return round(single_cpu_percent, 1) + + @memoize_when_activated + def cpu_times(self): + """Return a (user, system, children_user, children_system) + namedtuple representing the accumulated process time, in + seconds. + This is similar to os.times() but per-process. + On macOS and Windows children_user and children_system are + always set to 0. + """ + return self._proc.cpu_times() + + @memoize_when_activated + def memory_info(self): + """Return a namedtuple with variable fields depending on the + platform, representing memory information about the process. + + The "portable" fields available on all platforms are `rss` and `vms`. + + All numbers are expressed in bytes. + """ + return self._proc.memory_info() + + def memory_full_info(self): + """This method returns the same information as memory_info(), + plus, on some platform (Linux, macOS, Windows), also provides + additional metrics (USS, PSS and swap). + The additional metrics provide a better representation of actual + process memory usage. + + Namely USS is the memory which is unique to a process and which + would be freed if the process was terminated right now. + + It does so by passing through the whole process address. + As such it usually requires higher user privileges than + memory_info() and is considerably slower. + """ + return self._proc.memory_full_info() + + def memory_percent(self, memtype="rss"): + """Compare process memory to total physical system memory and + calculate process memory utilization as a percentage. + *memtype* argument is a string that dictates what type of + process memory you want to compare against (defaults to "rss"). + The list of available strings can be obtained like this: + + >>> psutil.Process().memory_info()._fields + ('rss', 'vms', 'shared', 'text', 'lib', 'data', 'dirty', 'uss', 'pss') + """ + valid_types = list(_ntp.pfullmem._fields) + if memtype not in valid_types: + msg = ( + f"invalid memtype {memtype!r}; valid types are" + f" {tuple(valid_types)!r}" + ) + raise ValueError(msg) + fun = ( + self.memory_info + if memtype in _ntp.pmem._fields + else self.memory_full_info + ) + metrics = fun() + value = getattr(metrics, memtype) + + # use cached value if available + total_phymem = _TOTAL_PHYMEM or virtual_memory().total + if not total_phymem > 0: + # we should never get here + msg = ( + "can't calculate process memory percent because total physical" + f" system memory is not positive ({total_phymem!r})" + ) + raise ValueError(msg) + return (value / float(total_phymem)) * 100 + + if hasattr(_psplatform.Process, "memory_maps"): + + def memory_maps(self, grouped=True): + """Return process' mapped memory regions as a list of namedtuples + whose fields are variable depending on the platform. + + If *grouped* is True the mapped regions with the same 'path' + are grouped together and the different memory fields are summed. + + If *grouped* is False every mapped region is shown as a single + entity and the namedtuple will also include the mapped region's + address space ('addr') and permission set ('perms'). + """ + it = self._proc.memory_maps() + if grouped: + d = {} + for tupl in it: + path = tupl[2] + nums = tupl[3:] + try: + d[path] = list(map(lambda x, y: x + y, d[path], nums)) + except KeyError: + d[path] = nums + return [_ntp.pmmap_grouped(path, *d[path]) for path in d] + else: + return [_ntp.pmmap_ext(*x) for x in it] + + def open_files(self): + """Return files opened by process as a list of + (path, fd) namedtuples including the absolute file name + and file descriptor number. + """ + return self._proc.open_files() + + def net_connections(self, kind='inet'): + """Return socket connections opened by process as a list of + (fd, family, type, laddr, raddr, status) namedtuples. + The *kind* parameter filters for connections that match the + following criteria: + + +------------+----------------------------------------------------+ + | Kind Value | Connections using | + +------------+----------------------------------------------------+ + | inet | IPv4 and IPv6 | + | inet4 | IPv4 | + | inet6 | IPv6 | + | tcp | TCP | + | tcp4 | TCP over IPv4 | + | tcp6 | TCP over IPv6 | + | udp | UDP | + | udp4 | UDP over IPv4 | + | udp6 | UDP over IPv6 | + | unix | UNIX socket (both UDP and TCP protocols) | + | all | the sum of all the possible families and protocols | + +------------+----------------------------------------------------+ + """ + _check_conn_kind(kind) + return self._proc.net_connections(kind) + + @_common.deprecated_method(replacement="net_connections") + def connections(self, kind="inet"): + return self.net_connections(kind=kind) + + # --- signals + + if POSIX: + + def _send_signal(self, sig): + assert not self.pid < 0, self.pid + self._raise_if_pid_reused() + + pid, ppid, name = self.pid, self._ppid, self._name + if pid == 0: + # see "man 2 kill" + msg = ( + "preventing sending signal to process with PID 0 as it " + "would affect every process in the process group of the " + "calling process (os.getpid()) instead of PID 0" + ) + raise ValueError(msg) + try: + os.kill(pid, sig) + except ProcessLookupError as err: + if OPENBSD and pid_exists(pid): + # We do this because os.kill() lies in case of + # zombie processes. + raise ZombieProcess(pid, name, ppid) from err + self._gone = True + raise NoSuchProcess(pid, name) from err + except PermissionError as err: + raise AccessDenied(pid, name) from err + + def send_signal(self, sig): + """Send a signal *sig* to process pre-emptively checking + whether PID has been reused (see signal module constants) . + On Windows only SIGTERM is valid and is treated as an alias + for kill(). + """ + if POSIX: + self._send_signal(sig) + else: # pragma: no cover + self._raise_if_pid_reused() + if sig != signal.SIGTERM and not self.is_running(): + msg = "process no longer exists" + raise NoSuchProcess(self.pid, self._name, msg=msg) + self._proc.send_signal(sig) + + def suspend(self): + """Suspend process execution with SIGSTOP pre-emptively checking + whether PID has been reused. + On Windows this has the effect of suspending all process threads. + """ + if POSIX: + self._send_signal(signal.SIGSTOP) + else: # pragma: no cover + self._raise_if_pid_reused() + self._proc.suspend() + + def resume(self): + """Resume process execution with SIGCONT pre-emptively checking + whether PID has been reused. + On Windows this has the effect of resuming all process threads. + """ + if POSIX: + self._send_signal(signal.SIGCONT) + else: # pragma: no cover + self._raise_if_pid_reused() + self._proc.resume() + + def terminate(self): + """Terminate the process with SIGTERM pre-emptively checking + whether PID has been reused. + On Windows this is an alias for kill(). + """ + if POSIX: + self._send_signal(signal.SIGTERM) + else: # pragma: no cover + self._raise_if_pid_reused() + self._proc.kill() + + def kill(self): + """Kill the current process with SIGKILL pre-emptively checking + whether PID has been reused. + """ + if POSIX: + self._send_signal(signal.SIGKILL) + else: # pragma: no cover + self._raise_if_pid_reused() + self._proc.kill() + + def wait(self, timeout=None): + """Wait for process to terminate, and if process is a children + of os.getpid(), also return its exit code, else None. + On Windows there's no such limitation (exit code is always + returned). + + If the process is already terminated, immediately return None + instead of raising NoSuchProcess. + + If *timeout* (in seconds) is specified and process is still + alive, raise TimeoutExpired. + + If *timeout=0* either return immediately or raise + TimeoutExpired (non-blocking). + + To wait for multiple Process objects use psutil.wait_procs(). + """ + if self.pid == 0: + msg = "can't wait for PID 0" + raise ValueError(msg) + if timeout is not None: + if not isinstance(timeout, (int, float)): + msg = f"timeout must be an int or float (got {type(timeout)})" + raise TypeError(msg) + if timeout < 0: + msg = f"timeout must be positive or zero (got {timeout})" + raise ValueError(msg) + + if self._exitcode is not _SENTINEL: + return self._exitcode + + try: + self._exitcode = self._proc.wait(timeout) + except TimeoutExpired as err: + exc = TimeoutExpired(timeout, pid=self.pid, name=self._name) + raise exc from err + + return self._exitcode + + +# The valid attr names which can be processed by Process.as_dict(). +# fmt: off +_as_dict_attrnames = { + x for x in dir(Process) if not x.startswith("_") and x not in + {'send_signal', 'suspend', 'resume', 'terminate', 'kill', 'wait', + 'is_running', 'as_dict', 'parent', 'parents', 'children', 'rlimit', + 'connections', 'oneshot'} +} +# fmt: on + + +# ===================================================================== +# --- Popen class +# ===================================================================== + + +class Popen(Process): + """Same as subprocess.Popen, but in addition it provides all + psutil.Process methods in a single class. + For the following methods which are common to both classes, psutil + implementation takes precedence: + + * send_signal() + * terminate() + * kill() + + This is done in order to avoid killing another process in case its + PID has been reused, fixing BPO-6973. + + >>> import psutil + >>> from subprocess import PIPE + >>> p = psutil.Popen(["python", "-c", "print 'hi'"], stdout=PIPE) + >>> p.name() + 'python' + >>> p.uids() + user(real=1000, effective=1000, saved=1000) + >>> p.username() + 'giampaolo' + >>> p.communicate() + ('hi', None) + >>> p.terminate() + >>> p.wait(timeout=2) + 0 + >>> + """ + + def __init__(self, *args, **kwargs): + # Explicitly avoid to raise NoSuchProcess in case the process + # spawned by subprocess.Popen terminates too quickly, see: + # https://github.com/giampaolo/psutil/issues/193 + self.__subproc = subprocess.Popen(*args, **kwargs) + self._init(self.__subproc.pid, _ignore_nsp=True) + + def __dir__(self): + return sorted(set(dir(Popen) + dir(subprocess.Popen))) + + def __enter__(self): + if hasattr(self.__subproc, '__enter__'): + self.__subproc.__enter__() + return self + + def __exit__(self, *args, **kwargs): + if hasattr(self.__subproc, '__exit__'): + return self.__subproc.__exit__(*args, **kwargs) + else: + if self.stdout: + self.stdout.close() + if self.stderr: + self.stderr.close() + try: + # Flushing a BufferedWriter may raise an error. + if self.stdin: + self.stdin.close() + finally: + # Wait for the process to terminate, to avoid zombies. + self.wait() + + def __getattribute__(self, name): + try: + return object.__getattribute__(self, name) + except AttributeError: + try: + return object.__getattribute__(self.__subproc, name) + except AttributeError: + msg = f"{self.__class__!r} has no attribute {name!r}" + raise AttributeError(msg) from None + + def wait(self, timeout=None): + if self.__subproc.returncode is not None: + return self.__subproc.returncode + ret = super().wait(timeout) + self.__subproc.returncode = ret + return ret + + +# ===================================================================== +# --- system processes related functions +# ===================================================================== + + +def pids(): + """Return a list of current running PIDs.""" + global _LOWEST_PID + ret = sorted(_psplatform.pids()) + _LOWEST_PID = ret[0] + return ret + + +def pid_exists(pid): + """Return True if given PID exists in the current process list. + This is faster than doing "pid in psutil.pids()" and + should be preferred. + """ + if pid < 0: + return False + elif pid == 0 and POSIX: + # On POSIX we use os.kill() to determine PID existence. + # According to "man 2 kill" PID 0 has a special meaning + # though: it refers to <> and that is not we want + # to do here. + return pid in pids() + else: + return _psplatform.pid_exists(pid) + + +_pmap = {} +_pids_reused = set() + + +def process_iter(attrs=None, ad_value=None): + """Return a generator yielding a Process instance for all + running processes. + + Every new Process instance is only created once and then cached + into an internal table which is updated every time this is used. + Cache can optionally be cleared via `process_iter.cache_clear()`. + + The sorting order in which processes are yielded is based on + their PIDs. + + *attrs* and *ad_value* have the same meaning as in + Process.as_dict(). If *attrs* is specified as_dict() is called + and the resulting dict is stored as a 'info' attribute attached + to returned Process instance. + If *attrs* is an empty list it will retrieve all process info + (slow). + """ + global _pmap + + def add(pid): + proc = Process(pid) + pmap[proc.pid] = proc + return proc + + def remove(pid): + pmap.pop(pid, None) + + pmap = _pmap.copy() + a = set(pids()) + b = set(pmap.keys()) + new_pids = a - b + gone_pids = b - a + for pid in gone_pids: + remove(pid) + while _pids_reused: + pid = _pids_reused.pop() + debug(f"refreshing Process instance for reused PID {pid}") + remove(pid) + try: + ls = sorted(list(pmap.items()) + list(dict.fromkeys(new_pids).items())) + for pid, proc in ls: + try: + if proc is None: # new process + proc = add(pid) + if attrs is not None: + proc.info = proc.as_dict(attrs=attrs, ad_value=ad_value) + yield proc + except NoSuchProcess: + remove(pid) + finally: + _pmap = pmap + + +process_iter.cache_clear = lambda: _pmap.clear() # noqa: PLW0108 +process_iter.cache_clear.__doc__ = "Clear process_iter() internal cache." + + +def wait_procs(procs, timeout=None, callback=None): + """Convenience function which waits for a list of processes to + terminate. + + Return a (gone, alive) tuple indicating which processes + are gone and which ones are still alive. + + The gone ones will have a new *returncode* attribute indicating + process exit status (may be None). + + *callback* is a function which gets called every time a process + terminates (a Process instance is passed as callback argument). + + Function will return as soon as all processes terminate or when + *timeout* occurs. + Differently from Process.wait() it will not raise TimeoutExpired if + *timeout* occurs. + + Typical use case is: + + - send SIGTERM to a list of processes + - give them some time to terminate + - send SIGKILL to those ones which are still alive + + Example: + + >>> def on_terminate(proc): + ... print("process {} terminated".format(proc)) + ... + >>> for p in procs: + ... p.terminate() + ... + >>> gone, alive = wait_procs(procs, timeout=3, callback=on_terminate) + >>> for p in alive: + ... p.kill() + """ + + def check_gone(proc, timeout): + try: + returncode = proc.wait(timeout=timeout) + except (TimeoutExpired, subprocess.TimeoutExpired): + pass + else: + if returncode is not None or not proc.is_running(): + # Set new Process instance attribute. + proc.returncode = returncode + gone.add(proc) + if callback is not None: + callback(proc) + + if timeout is not None and not timeout >= 0: + msg = f"timeout must be a positive integer, got {timeout}" + raise ValueError(msg) + if callback is not None and not callable(callback): + msg = f"callback {callback!r} is not a callable" + raise TypeError(msg) + + gone = set() + alive = set(procs) + if timeout is not None: + deadline = _timer() + timeout + + while alive: + if timeout is not None and timeout <= 0: + break + for proc in alive: + # Make sure that every complete iteration (all processes) + # will last max 1 sec. + # We do this because we don't want to wait too long on a + # single process: in case it terminates too late other + # processes may disappear in the meantime and their PID + # reused. + max_timeout = 1.0 / len(alive) + if timeout is not None: + timeout = min((deadline - _timer()), max_timeout) + if timeout <= 0: + break + check_gone(proc, timeout) + else: + check_gone(proc, max_timeout) + alive = alive - gone # noqa: PLR6104 + + if alive: + # Last attempt over processes survived so far. + # timeout == 0 won't make this function wait any further. + for proc in alive: + check_gone(proc, 0) + alive = alive - gone # noqa: PLR6104 + + return (list(gone), list(alive)) + + +# ===================================================================== +# --- CPU related functions +# ===================================================================== + + +def cpu_count(logical=True): + """Return the number of logical CPUs in the system (same as + os.cpu_count()). + + If *logical* is False return the number of physical cores only + (e.g. hyper thread CPUs are excluded). + + Return None if undetermined. + + The return value is cached after first call. + If desired cache can be cleared like this: + + >>> psutil.cpu_count.cache_clear() + """ + if logical: + ret = _psplatform.cpu_count_logical() + else: + ret = _psplatform.cpu_count_cores() + if ret is not None and ret < 1: + ret = None + return ret + + +def cpu_times(percpu=False): + """Return system-wide CPU times as a namedtuple. + Every CPU time represents the seconds the CPU has spent in the + given mode. The namedtuple's fields availability varies depending on the + platform: + + - user + - system + - idle + - nice (UNIX) + - iowait (Linux) + - irq (Linux, FreeBSD) + - softirq (Linux) + - steal (Linux >= 2.6.11) + - guest (Linux >= 2.6.24) + - guest_nice (Linux >= 3.2.0) + + When *percpu* is True return a list of namedtuples for each CPU. + First element of the list refers to first CPU, second element + to second CPU and so on. + The order of the list is consistent across calls. + """ + if not percpu: + return _psplatform.cpu_times() + else: + return _psplatform.per_cpu_times() + + +try: + _last_cpu_times = {threading.current_thread().ident: cpu_times()} +except Exception: # noqa: BLE001 + # Don't want to crash at import time. + _last_cpu_times = {} + +try: + _last_per_cpu_times = { + threading.current_thread().ident: cpu_times(percpu=True) + } +except Exception: # noqa: BLE001 + # Don't want to crash at import time. + _last_per_cpu_times = {} + + +def _cpu_tot_time(times): + """Given a cpu_time() ntuple calculates the total CPU time + (including idle time). + """ + tot = sum(times) + if LINUX: + # On Linux guest times are already accounted in "user" or + # "nice" times, so we subtract them from total. + # Htop does the same. References: + # https://github.com/giampaolo/psutil/pull/940 + # http://unix.stackexchange.com/questions/178045 + # https://github.com/torvalds/linux/blob/ + # 447976ef4fd09b1be88b316d1a81553f1aa7cd07/kernel/sched/ + # cputime.c#L158 + tot -= getattr(times, "guest", 0) # Linux 2.6.24+ + tot -= getattr(times, "guest_nice", 0) # Linux 3.2.0+ + return tot + + +def _cpu_busy_time(times): + """Given a cpu_time() ntuple calculates the busy CPU time. + We do so by subtracting all idle CPU times. + """ + busy = _cpu_tot_time(times) + busy -= times.idle + # Linux: "iowait" is time during which the CPU does not do anything + # (waits for IO to complete). On Linux IO wait is *not* accounted + # in "idle" time so we subtract it. Htop does the same. + # References: + # https://github.com/torvalds/linux/blob/ + # 447976ef4fd09b1be88b316d1a81553f1aa7cd07/kernel/sched/cputime.c#L244 + busy -= getattr(times, "iowait", 0) + return busy + + +def _cpu_times_deltas(t1, t2): + assert t1._fields == t2._fields, (t1, t2) + field_deltas = [] + for field in _ntp.scputimes._fields: + field_delta = getattr(t2, field) - getattr(t1, field) + # CPU times are always supposed to increase over time + # or at least remain the same and that's because time + # cannot go backwards. + # Surprisingly sometimes this might not be the case (at + # least on Windows and Linux), see: + # https://github.com/giampaolo/psutil/issues/392 + # https://github.com/giampaolo/psutil/issues/645 + # https://github.com/giampaolo/psutil/issues/1210 + # Trim negative deltas to zero to ignore decreasing fields. + # top does the same. Reference: + # https://gitlab.com/procps-ng/procps/blob/v3.3.12/top/top.c#L5063 + field_delta = max(0, field_delta) + field_deltas.append(field_delta) + return _ntp.scputimes(*field_deltas) + + +def cpu_percent(interval=None, percpu=False): + """Return a float representing the current system-wide CPU + utilization as a percentage. + + When *interval* is > 0.0 compares system CPU times elapsed before + and after the interval (blocking). + + When *interval* is 0.0 or None compares system CPU times elapsed + since last call or module import, returning immediately (non + blocking). That means the first time this is called it will + return a meaningless 0.0 value which you should ignore. + In this case is recommended for accuracy that this function be + called with at least 0.1 seconds between calls. + + When *percpu* is True returns a list of floats representing the + utilization as a percentage for each CPU. + First element of the list refers to first CPU, second element + to second CPU and so on. + The order of the list is consistent across calls. + + Examples: + + >>> # blocking, system-wide + >>> psutil.cpu_percent(interval=1) + 2.0 + >>> + >>> # blocking, per-cpu + >>> psutil.cpu_percent(interval=1, percpu=True) + [2.0, 1.0] + >>> + >>> # non-blocking (percentage since last call) + >>> psutil.cpu_percent(interval=None) + 2.9 + >>> + """ + tid = threading.current_thread().ident + blocking = interval is not None and interval > 0.0 + if interval is not None and interval < 0: + msg = f"interval is not positive (got {interval})" + raise ValueError(msg) + + def calculate(t1, t2): + times_delta = _cpu_times_deltas(t1, t2) + all_delta = _cpu_tot_time(times_delta) + busy_delta = _cpu_busy_time(times_delta) + + try: + busy_perc = (busy_delta / all_delta) * 100 + except ZeroDivisionError: + return 0.0 + else: + return round(busy_perc, 1) + + # system-wide usage + if not percpu: + if blocking: + t1 = cpu_times() + time.sleep(interval) + else: + t1 = _last_cpu_times.get(tid) or cpu_times() + _last_cpu_times[tid] = cpu_times() + return calculate(t1, _last_cpu_times[tid]) + # per-cpu usage + else: + ret = [] + if blocking: + tot1 = cpu_times(percpu=True) + time.sleep(interval) + else: + tot1 = _last_per_cpu_times.get(tid) or cpu_times(percpu=True) + _last_per_cpu_times[tid] = cpu_times(percpu=True) + for t1, t2 in zip(tot1, _last_per_cpu_times[tid]): + ret.append(calculate(t1, t2)) + return ret + + +# Use a separate dict for cpu_times_percent(), so it's independent from +# cpu_percent() and they can both be used within the same program. +_last_cpu_times_2 = _last_cpu_times.copy() +_last_per_cpu_times_2 = _last_per_cpu_times.copy() + + +def cpu_times_percent(interval=None, percpu=False): + """Same as cpu_percent() but provides utilization percentages + for each specific CPU time as is returned by cpu_times(). + For instance, on Linux we'll get: + + >>> cpu_times_percent() + cpupercent(user=4.8, nice=0.0, system=4.8, idle=90.5, iowait=0.0, + irq=0.0, softirq=0.0, steal=0.0, guest=0.0, guest_nice=0.0) + >>> + + *interval* and *percpu* arguments have the same meaning as in + cpu_percent(). + """ + tid = threading.current_thread().ident + blocking = interval is not None and interval > 0.0 + if interval is not None and interval < 0: + msg = f"interval is not positive (got {interval!r})" + raise ValueError(msg) + + def calculate(t1, t2): + nums = [] + times_delta = _cpu_times_deltas(t1, t2) + all_delta = _cpu_tot_time(times_delta) + # "scale" is the value to multiply each delta with to get percentages. + # We use "max" to avoid division by zero (if all_delta is 0, then all + # fields are 0 so percentages will be 0 too. all_delta cannot be a + # fraction because cpu times are integers) + scale = 100.0 / max(1, all_delta) + for field_delta in times_delta: + field_perc = field_delta * scale + field_perc = round(field_perc, 1) + # make sure we don't return negative values or values over 100% + field_perc = min(max(0.0, field_perc), 100.0) + nums.append(field_perc) + return _ntp.scputimes(*nums) + + # system-wide usage + if not percpu: + if blocking: + t1 = cpu_times() + time.sleep(interval) + else: + t1 = _last_cpu_times_2.get(tid) or cpu_times() + _last_cpu_times_2[tid] = cpu_times() + return calculate(t1, _last_cpu_times_2[tid]) + # per-cpu usage + else: + ret = [] + if blocking: + tot1 = cpu_times(percpu=True) + time.sleep(interval) + else: + tot1 = _last_per_cpu_times_2.get(tid) or cpu_times(percpu=True) + _last_per_cpu_times_2[tid] = cpu_times(percpu=True) + for t1, t2 in zip(tot1, _last_per_cpu_times_2[tid]): + ret.append(calculate(t1, t2)) + return ret + + +def cpu_stats(): + """Return CPU statistics.""" + return _psplatform.cpu_stats() + + +if hasattr(_psplatform, "cpu_freq"): + + def cpu_freq(percpu=False): + """Return CPU frequency as a namedtuple including current, + min and max frequency expressed in Mhz. + + If *percpu* is True and the system supports per-cpu frequency + retrieval (Linux only) a list of frequencies is returned for + each CPU. If not a list with one element is returned. + """ + ret = _psplatform.cpu_freq() + if percpu: + return ret + else: + num_cpus = float(len(ret)) + if num_cpus == 0: + return None + elif num_cpus == 1: + return ret[0] + else: + currs, mins, maxs = 0.0, 0.0, 0.0 + set_none = False + for cpu in ret: + currs += cpu.current + # On Linux if /proc/cpuinfo is used min/max are set + # to None. + if LINUX and cpu.min is None: + set_none = True + continue + mins += cpu.min + maxs += cpu.max + + current = currs / num_cpus + + if set_none: + min_ = max_ = None + else: + min_ = mins / num_cpus + max_ = maxs / num_cpus + + return _ntp.scpufreq(current, min_, max_) + + __all__.append("cpu_freq") + + +if hasattr(os, "getloadavg") or hasattr(_psplatform, "getloadavg"): + # Perform this hasattr check once on import time to either use the + # platform based code or proxy straight from the os module. + if hasattr(os, "getloadavg"): + getloadavg = os.getloadavg + else: + getloadavg = _psplatform.getloadavg + + __all__.append("getloadavg") + + +# ===================================================================== +# --- system memory related functions +# ===================================================================== + + +def virtual_memory(): + """Return statistics about system memory usage as a namedtuple + including the following fields, expressed in bytes: + + - total: + total physical memory available. + + - available: + the memory that can be given instantly to processes without the + system going into swap. + This is calculated by summing different memory values depending + on the platform and it is supposed to be used to monitor actual + memory usage in a cross platform fashion. + + - percent: + the percentage usage calculated as (total - available) / total * 100 + + - used: + memory used, calculated differently depending on the platform and + designed for informational purposes only: + macOS: active + wired + BSD: active + wired + cached + Linux: total - free + + - free: + memory not being used at all (zeroed) that is readily available; + note that this doesn't reflect the actual memory available + (use 'available' instead) + + Platform-specific fields: + + - active (UNIX): + memory currently in use or very recently used, and so it is in RAM. + + - inactive (UNIX): + memory that is marked as not used. + + - buffers (BSD, Linux): + cache for things like file system metadata. + + - cached (BSD, macOS): + cache for various things. + + - wired (macOS, BSD): + memory that is marked to always stay in RAM. It is never moved to disk. + + - shared (BSD): + memory that may be simultaneously accessed by multiple processes. + + The sum of 'used' and 'available' does not necessarily equal total. + On Windows 'available' and 'free' are the same. + """ + global _TOTAL_PHYMEM + ret = _psplatform.virtual_memory() + # cached for later use in Process.memory_percent() + _TOTAL_PHYMEM = ret.total + return ret + + +def swap_memory(): + """Return system swap memory statistics as a namedtuple including + the following fields: + + - total: total swap memory in bytes + - used: used swap memory in bytes + - free: free swap memory in bytes + - percent: the percentage usage + - sin: no. of bytes the system has swapped in from disk (cumulative) + - sout: no. of bytes the system has swapped out from disk (cumulative) + + 'sin' and 'sout' on Windows are meaningless and always set to 0. + """ + return _psplatform.swap_memory() + + +# ===================================================================== +# --- disks/partitions related functions +# ===================================================================== + + +def disk_usage(path): + """Return disk usage statistics about the given *path* as a + namedtuple including total, used and free space expressed in bytes + plus the percentage usage. + """ + return _psplatform.disk_usage(path) + + +def disk_partitions(all=False): + """Return mounted partitions as a list of + (device, mountpoint, fstype, opts) namedtuple. + 'opts' field is a raw string separated by commas indicating mount + options which may vary depending on the platform. + + If *all* parameter is False return physical devices only and ignore + all others. + """ + return _psplatform.disk_partitions(all) + + +def disk_io_counters(perdisk=False, nowrap=True): + """Return system disk I/O statistics as a namedtuple including + the following fields: + + - read_count: number of reads + - write_count: number of writes + - read_bytes: number of bytes read + - write_bytes: number of bytes written + - read_time: time spent reading from disk (in ms) + - write_time: time spent writing to disk (in ms) + + Platform specific: + + - busy_time: (Linux, FreeBSD) time spent doing actual I/Os (in ms) + - read_merged_count (Linux): number of merged reads + - write_merged_count (Linux): number of merged writes + + If *perdisk* is True return the same information for every + physical disk installed on the system as a dictionary + with partition names as the keys and the namedtuple + described above as the values. + + If *nowrap* is True it detects and adjust the numbers which overflow + and wrap (restart from 0) and add "old value" to "new value" so that + the returned numbers will always be increasing or remain the same, + but never decrease. + "disk_io_counters.cache_clear()" can be used to invalidate the + cache. + + On recent Windows versions 'diskperf -y' command may need to be + executed first otherwise this function won't find any disk. + """ + kwargs = dict(perdisk=perdisk) if LINUX else {} + rawdict = _psplatform.disk_io_counters(**kwargs) + if not rawdict: + return {} if perdisk else None + if nowrap: + rawdict = _wrap_numbers(rawdict, 'psutil.disk_io_counters') + if perdisk: + for disk, fields in rawdict.items(): + rawdict[disk] = _ntp.sdiskio(*fields) + return rawdict + else: + return _ntp.sdiskio(*(sum(x) for x in zip(*rawdict.values()))) + + +disk_io_counters.cache_clear = functools.partial( + _wrap_numbers.cache_clear, 'psutil.disk_io_counters' +) +disk_io_counters.cache_clear.__doc__ = "Clears nowrap argument cache" + + +# ===================================================================== +# --- network related functions +# ===================================================================== + + +def net_io_counters(pernic=False, nowrap=True): + """Return network I/O statistics as a namedtuple including + the following fields: + + - bytes_sent: number of bytes sent + - bytes_recv: number of bytes received + - packets_sent: number of packets sent + - packets_recv: number of packets received + - errin: total number of errors while receiving + - errout: total number of errors while sending + - dropin: total number of incoming packets which were dropped + - dropout: total number of outgoing packets which were dropped + (always 0 on macOS and BSD) + + If *pernic* is True return the same information for every + network interface installed on the system as a dictionary + with network interface names as the keys and the namedtuple + described above as the values. + + If *nowrap* is True it detects and adjust the numbers which overflow + and wrap (restart from 0) and add "old value" to "new value" so that + the returned numbers will always be increasing or remain the same, + but never decrease. + "net_io_counters.cache_clear()" can be used to invalidate the + cache. + """ + rawdict = _psplatform.net_io_counters() + if not rawdict: + return {} if pernic else None + if nowrap: + rawdict = _wrap_numbers(rawdict, 'psutil.net_io_counters') + if pernic: + for nic, fields in rawdict.items(): + rawdict[nic] = _ntp.snetio(*fields) + return rawdict + else: + return _ntp.snetio(*[sum(x) for x in zip(*rawdict.values())]) + + +net_io_counters.cache_clear = functools.partial( + _wrap_numbers.cache_clear, 'psutil.net_io_counters' +) +net_io_counters.cache_clear.__doc__ = "Clears nowrap argument cache" + + +def net_connections(kind='inet'): + """Return system-wide socket connections as a list of + (fd, family, type, laddr, raddr, status, pid) namedtuples. + In case of limited privileges 'fd' and 'pid' may be set to -1 + and None respectively. + The *kind* parameter filters for connections that fit the + following criteria: + + +------------+----------------------------------------------------+ + | Kind Value | Connections using | + +------------+----------------------------------------------------+ + | inet | IPv4 and IPv6 | + | inet4 | IPv4 | + | inet6 | IPv6 | + | tcp | TCP | + | tcp4 | TCP over IPv4 | + | tcp6 | TCP over IPv6 | + | udp | UDP | + | udp4 | UDP over IPv4 | + | udp6 | UDP over IPv6 | + | unix | UNIX socket (both UDP and TCP protocols) | + | all | the sum of all the possible families and protocols | + +------------+----------------------------------------------------+ + + On macOS this function requires root privileges. + """ + _check_conn_kind(kind) + return _psplatform.net_connections(kind) + + +def net_if_addrs(): + """Return the addresses associated to each NIC (network interface + card) installed on the system as a dictionary whose keys are the + NIC names and value is a list of namedtuples for each address + assigned to the NIC. Each namedtuple includes 5 fields: + + - family: can be either socket.AF_INET, socket.AF_INET6 or + psutil.AF_LINK, which refers to a MAC address. + - address: is the primary address and it is always set. + - netmask: and 'broadcast' and 'ptp' may be None. + - ptp: stands for "point to point" and references the + destination address on a point to point interface + (typically a VPN). + - broadcast: and *ptp* are mutually exclusive. + + Note: you can have more than one address of the same family + associated with each interface. + """ + rawlist = _psplatform.net_if_addrs() + rawlist.sort(key=lambda x: x[1]) # sort by family + ret = collections.defaultdict(list) + for name, fam, addr, mask, broadcast, ptp in rawlist: + try: + fam = socket.AddressFamily(fam) + except ValueError: + if WINDOWS and fam == -1: + fam = _psplatform.AF_LINK + elif ( + hasattr(_psplatform, "AF_LINK") and fam == _psplatform.AF_LINK + ): + # Linux defines AF_LINK as an alias for AF_PACKET. + # We re-set the family here so that repr(family) + # will show AF_LINK rather than AF_PACKET + fam = _psplatform.AF_LINK + + if fam == _psplatform.AF_LINK: + # The underlying C function may return an incomplete MAC + # address in which case we fill it with null bytes, see: + # https://github.com/giampaolo/psutil/issues/786 + separator = ":" if POSIX else "-" + while addr.count(separator) < 5: + addr += f"{separator}00" + + nt = _ntp.snicaddr(fam, addr, mask, broadcast, ptp) + + # On Windows broadcast is None, so we determine it via + # ipaddress module. + if WINDOWS and fam in {socket.AF_INET, socket.AF_INET6}: + try: + broadcast = _common.broadcast_addr(nt) + except Exception as err: # noqa: BLE001 + debug(err) + else: + if broadcast is not None: + nt._replace(broadcast=broadcast) + + ret[name].append(nt) + + return dict(ret) + + +def net_if_stats(): + """Return information about each NIC (network interface card) + installed on the system as a dictionary whose keys are the + NIC names and value is a namedtuple with the following fields: + + - isup: whether the interface is up (bool) + - duplex: can be either NIC_DUPLEX_FULL, NIC_DUPLEX_HALF or + NIC_DUPLEX_UNKNOWN + - speed: the NIC speed expressed in mega bits (MB); if it can't + be determined (e.g. 'localhost') it will be set to 0. + - mtu: the maximum transmission unit expressed in bytes. + """ + return _psplatform.net_if_stats() + + +# ===================================================================== +# --- sensors +# ===================================================================== + + +# Linux, macOS +if hasattr(_psplatform, "sensors_temperatures"): + + def sensors_temperatures(fahrenheit=False): + """Return hardware temperatures. Each entry is a namedtuple + representing a certain hardware sensor (it may be a CPU, an + hard disk or something else, depending on the OS and its + configuration). + All temperatures are expressed in celsius unless *fahrenheit* + is set to True. + """ + + def convert(n): + if n is not None: + return (float(n) * 9 / 5) + 32 if fahrenheit else n + + ret = collections.defaultdict(list) + rawdict = _psplatform.sensors_temperatures() + + for name, values in rawdict.items(): + while values: + label, current, high, critical = values.pop(0) + current = convert(current) + high = convert(high) + critical = convert(critical) + + if high and not critical: + critical = high + elif critical and not high: + high = critical + + ret[name].append(_ntp.shwtemp(label, current, high, critical)) + + return dict(ret) + + __all__.append("sensors_temperatures") + + +# Linux +if hasattr(_psplatform, "sensors_fans"): + + def sensors_fans(): + """Return fans speed. Each entry is a namedtuple + representing a certain hardware sensor. + All speed are expressed in RPM (rounds per minute). + """ + return _psplatform.sensors_fans() + + __all__.append("sensors_fans") + + +# Linux, Windows, FreeBSD, macOS +if hasattr(_psplatform, "sensors_battery"): + + def sensors_battery(): + """Return battery information. If no battery is installed + returns None. + + - percent: battery power left as a percentage. + - secsleft: a rough approximation of how many seconds are left + before the battery runs out of power. May be + POWER_TIME_UNLIMITED or POWER_TIME_UNLIMITED. + - power_plugged: True if the AC power cable is connected. + """ + return _psplatform.sensors_battery() + + __all__.append("sensors_battery") + + +# ===================================================================== +# --- other system related functions +# ===================================================================== + + +def boot_time(): + """Return the system boot time expressed in seconds since the epoch + (seconds since January 1, 1970, at midnight UTC). The returned + value is based on the system clock, which means it may be affected + by changes such as manual adjustments or time synchronization (e.g. + NTP). + """ + return _psplatform.boot_time() + + +def users(): + """Return users currently connected on the system as a list of + namedtuples including the following fields. + + - user: the name of the user + - terminal: the tty or pseudo-tty associated with the user, if any. + - host: the host name associated with the entry, if any. + - started: the creation time as a floating point number expressed in + seconds since the epoch. + """ + return _psplatform.users() + + +# ===================================================================== +# --- Windows services +# ===================================================================== + + +if WINDOWS: + + def win_service_iter(): + """Return a generator yielding a WindowsService instance for all + Windows services installed. + """ + return _psplatform.win_service_iter() + + def win_service_get(name): + """Get a Windows service by *name*. + Raise NoSuchProcess if no service with such name exists. + """ + return _psplatform.win_service_get(name) + + +# ===================================================================== +# --- malloc / heap +# ===================================================================== + + +# Linux + glibc, Windows, macOS, FreeBSD, NetBSD +if hasattr(_psplatform, "heap_info"): + + def heap_info(): + """Return low-level heap statistics from the C heap allocator + (glibc). + + - `heap_used`: the total number of bytes allocated via + malloc/free. These are typically allocations smaller than + MMAP_THRESHOLD. + + - `mmap_used`: the total number of bytes allocated via `mmap()` + or via large ``malloc()`` allocations. + + - `heap_count` (Windows only): number of private heaps created + via `HeapCreate()`. + """ + return _ntp.pheap(*_psplatform.heap_info()) + + def heap_trim(): + """Request that the underlying allocator free any unused memory + it's holding in the heap (typically small `malloc()` + allocations). + + In practice, modern allocators rarely comply, so this is not a + general-purpose memory-reduction tool and won't meaningfully + shrink RSS in real programs. Its primary value is in **leak + detection tools**. + + Calling `heap_trim()` before taking measurements helps reduce + allocator noise, giving you a cleaner baseline so that changes + in `heap_used` come from the code you're testing, not from + internal allocator caching or fragmentation. Its effectiveness + depends on allocator behavior and fragmentation patterns. + """ + _psplatform.heap_trim() + + __all__.append("heap_info") + __all__.append("heap_trim") + + +# ===================================================================== + + +def _set_debug(value): + """Enable or disable PSUTIL_DEBUG option, which prints debugging + messages to stderr. + """ + import psutil._common + + psutil._common.PSUTIL_DEBUG = bool(value) + _psplatform.cext.set_debug(bool(value)) + + +del memoize_when_activated diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2824f39e66154b7994f96ccc07d1463643e46373 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/_common.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/_common.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b9a00d952de77224fcd23441d7992fef46fbbe98 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/_common.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/_ntuples.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/_ntuples.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..03f5fb57b8a0aae615cffec96462deb1902f8007 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/_ntuples.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/_psaix.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/_psaix.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..48bc5183609d5ea13e332d8925aa41cac120b6aa Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/_psaix.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/_psbsd.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/_psbsd.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8a06e11b67a0687cba8fd91f024e0cc92b65588c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/_psbsd.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/_pslinux.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/_pslinux.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3ba4c0dad76e74e901d914b87e5b935655b45778 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/_pslinux.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/_psosx.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/_psosx.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7b6ee63a50e38fa2a143c55e0b704ded7850f415 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/_psosx.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/_psposix.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/_psposix.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f454e427f76fb6215c1c75cf6ce84f48a3c5dd6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/_psposix.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/_pssunos.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/_pssunos.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7b79e04c53d53ce1b6e85a91ce12554659d2d5d0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/_pssunos.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/_pswindows.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/_pswindows.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7fad2eb9f436ed90482a801c3bfc1f48fc977f67 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/__pycache__/_pswindows.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_common.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_common.py new file mode 100644 index 0000000000000000000000000000000000000000..33b6282253ac3321193fdd882aaf38185dee9d49 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_common.py @@ -0,0 +1,861 @@ +# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Common objects shared by __init__.py and _ps*.py modules. + +Note: this module is imported by setup.py, so it should not import +psutil or third-party modules. +""" + +import collections +import enum +import functools +import os +import socket +import stat +import sys +import threading +import warnings +from socket import AF_INET +from socket import SOCK_DGRAM +from socket import SOCK_STREAM + +try: + from socket import AF_INET6 +except ImportError: + AF_INET6 = None +try: + from socket import AF_UNIX +except ImportError: + AF_UNIX = None + + +PSUTIL_DEBUG = bool(os.getenv('PSUTIL_DEBUG')) +_DEFAULT = object() + +# fmt: off +__all__ = [ + # OS constants + 'FREEBSD', 'BSD', 'LINUX', 'NETBSD', 'OPENBSD', 'MACOS', 'OSX', 'POSIX', + 'SUNOS', 'WINDOWS', + # connection constants + 'CONN_CLOSE', 'CONN_CLOSE_WAIT', 'CONN_CLOSING', 'CONN_ESTABLISHED', + 'CONN_FIN_WAIT1', 'CONN_FIN_WAIT2', 'CONN_LAST_ACK', 'CONN_LISTEN', + 'CONN_NONE', 'CONN_SYN_RECV', 'CONN_SYN_SENT', 'CONN_TIME_WAIT', + # net constants + 'NIC_DUPLEX_FULL', 'NIC_DUPLEX_HALF', 'NIC_DUPLEX_UNKNOWN', # noqa: F822 + # process status constants + 'STATUS_DEAD', 'STATUS_DISK_SLEEP', 'STATUS_IDLE', 'STATUS_LOCKED', + 'STATUS_RUNNING', 'STATUS_SLEEPING', 'STATUS_STOPPED', 'STATUS_SUSPENDED', + 'STATUS_TRACING_STOP', 'STATUS_WAITING', 'STATUS_WAKE_KILL', + 'STATUS_WAKING', 'STATUS_ZOMBIE', 'STATUS_PARKED', + # other constants + 'ENCODING', 'ENCODING_ERRS', 'AF_INET6', + # utility functions + 'conn_tmap', 'deprecated_method', 'isfile_strict', 'memoize', + 'parse_environ_block', 'path_exists_strict', 'usage_percent', + 'supports_ipv6', 'sockfam_to_enum', 'socktype_to_enum', "wrap_numbers", + 'open_text', 'open_binary', 'cat', 'bcat', + 'bytes2human', 'conn_to_ntuple', 'debug', + # shell utils + 'hilite', 'term_supports_colors', 'print_color', +] +# fmt: on + + +# =================================================================== +# --- OS constants +# =================================================================== + + +POSIX = os.name == "posix" +WINDOWS = os.name == "nt" +LINUX = sys.platform.startswith("linux") +MACOS = sys.platform.startswith("darwin") +OSX = MACOS # deprecated alias +FREEBSD = sys.platform.startswith(("freebsd", "midnightbsd")) +OPENBSD = sys.platform.startswith("openbsd") +NETBSD = sys.platform.startswith("netbsd") +BSD = FREEBSD or OPENBSD or NETBSD +SUNOS = sys.platform.startswith(("sunos", "solaris")) +AIX = sys.platform.startswith("aix") + + +# =================================================================== +# --- API constants +# =================================================================== + + +# Process.status() +STATUS_RUNNING = "running" +STATUS_SLEEPING = "sleeping" +STATUS_DISK_SLEEP = "disk-sleep" +STATUS_STOPPED = "stopped" +STATUS_TRACING_STOP = "tracing-stop" +STATUS_ZOMBIE = "zombie" +STATUS_DEAD = "dead" +STATUS_WAKE_KILL = "wake-kill" +STATUS_WAKING = "waking" +STATUS_IDLE = "idle" # Linux, macOS, FreeBSD +STATUS_LOCKED = "locked" # FreeBSD +STATUS_WAITING = "waiting" # FreeBSD +STATUS_SUSPENDED = "suspended" # NetBSD +STATUS_PARKED = "parked" # Linux + +# Process.net_connections() and psutil.net_connections() +CONN_ESTABLISHED = "ESTABLISHED" +CONN_SYN_SENT = "SYN_SENT" +CONN_SYN_RECV = "SYN_RECV" +CONN_FIN_WAIT1 = "FIN_WAIT1" +CONN_FIN_WAIT2 = "FIN_WAIT2" +CONN_TIME_WAIT = "TIME_WAIT" +CONN_CLOSE = "CLOSE" +CONN_CLOSE_WAIT = "CLOSE_WAIT" +CONN_LAST_ACK = "LAST_ACK" +CONN_LISTEN = "LISTEN" +CONN_CLOSING = "CLOSING" +CONN_NONE = "NONE" + + +# net_if_stats() +class NicDuplex(enum.IntEnum): + NIC_DUPLEX_FULL = 2 + NIC_DUPLEX_HALF = 1 + NIC_DUPLEX_UNKNOWN = 0 + + +globals().update(NicDuplex.__members__) + + +# sensors_battery() +class BatteryTime(enum.IntEnum): + POWER_TIME_UNKNOWN = -1 + POWER_TIME_UNLIMITED = -2 + + +globals().update(BatteryTime.__members__) + +# --- others + +ENCODING = sys.getfilesystemencoding() +ENCODING_ERRS = sys.getfilesystemencodeerrors() + + +# =================================================================== +# --- Process.net_connections() 'kind' parameter mapping +# =================================================================== + + +conn_tmap = { + "all": ([AF_INET, AF_INET6, AF_UNIX], [SOCK_STREAM, SOCK_DGRAM]), + "tcp": ([AF_INET, AF_INET6], [SOCK_STREAM]), + "tcp4": ([AF_INET], [SOCK_STREAM]), + "udp": ([AF_INET, AF_INET6], [SOCK_DGRAM]), + "udp4": ([AF_INET], [SOCK_DGRAM]), + "inet": ([AF_INET, AF_INET6], [SOCK_STREAM, SOCK_DGRAM]), + "inet4": ([AF_INET], [SOCK_STREAM, SOCK_DGRAM]), + "inet6": ([AF_INET6], [SOCK_STREAM, SOCK_DGRAM]), +} + +if AF_INET6 is not None: + conn_tmap.update({ + "tcp6": ([AF_INET6], [SOCK_STREAM]), + "udp6": ([AF_INET6], [SOCK_DGRAM]), + }) + +if AF_UNIX is not None and not SUNOS: + conn_tmap.update({"unix": ([AF_UNIX], [SOCK_STREAM, SOCK_DGRAM])}) + + +# ===================================================================== +# --- Exceptions +# ===================================================================== + + +class Error(Exception): + """Base exception class. All other psutil exceptions inherit + from this one. + """ + + __module__ = 'psutil' + + def _infodict(self, attrs): + info = collections.OrderedDict() + for name in attrs: + value = getattr(self, name, None) + if value or (name == "pid" and value == 0): + info[name] = value + return info + + def __str__(self): + # invoked on `raise Error` + info = self._infodict(("pid", "ppid", "name")) + if info: + details = "({})".format( + ", ".join([f"{k}={v!r}" for k, v in info.items()]) + ) + else: + details = None + return " ".join([x for x in (getattr(self, "msg", ""), details) if x]) + + def __repr__(self): + # invoked on `repr(Error)` + info = self._infodict(("pid", "ppid", "name", "seconds", "msg")) + details = ", ".join([f"{k}={v!r}" for k, v in info.items()]) + return f"psutil.{self.__class__.__name__}({details})" + + +class NoSuchProcess(Error): + """Exception raised when a process with a certain PID doesn't + or no longer exists. + """ + + __module__ = 'psutil' + + def __init__(self, pid, name=None, msg=None): + Error.__init__(self) + self.pid = pid + self.name = name + self.msg = msg or "process no longer exists" + + def __reduce__(self): + return (self.__class__, (self.pid, self.name, self.msg)) + + +class ZombieProcess(NoSuchProcess): + """Exception raised when querying a zombie process. This is + raised on macOS, BSD and Solaris only, and not always: depending + on the query the OS may be able to succeed anyway. + On Linux all zombie processes are querable (hence this is never + raised). Windows doesn't have zombie processes. + """ + + __module__ = 'psutil' + + def __init__(self, pid, name=None, ppid=None, msg=None): + NoSuchProcess.__init__(self, pid, name, msg) + self.ppid = ppid + self.msg = msg or "PID still exists but it's a zombie" + + def __reduce__(self): + return (self.__class__, (self.pid, self.name, self.ppid, self.msg)) + + +class AccessDenied(Error): + """Exception raised when permission to perform an action is denied.""" + + __module__ = 'psutil' + + def __init__(self, pid=None, name=None, msg=None): + Error.__init__(self) + self.pid = pid + self.name = name + self.msg = msg or "" + + def __reduce__(self): + return (self.__class__, (self.pid, self.name, self.msg)) + + +class TimeoutExpired(Error): + """Raised on Process.wait(timeout) if timeout expires and process + is still alive. + """ + + __module__ = 'psutil' + + def __init__(self, seconds, pid=None, name=None): + Error.__init__(self) + self.seconds = seconds + self.pid = pid + self.name = name + self.msg = f"timeout after {seconds} seconds" + + def __reduce__(self): + return (self.__class__, (self.seconds, self.pid, self.name)) + + +# =================================================================== +# --- utils +# =================================================================== + + +def usage_percent(used, total, round_=None): + """Calculate percentage usage of 'used' against 'total'.""" + try: + ret = (float(used) / total) * 100 + except ZeroDivisionError: + return 0.0 + else: + if round_ is not None: + ret = round(ret, round_) + return ret + + +def memoize(fun): + """A simple memoize decorator for functions supporting (hashable) + positional arguments. + It also provides a cache_clear() function for clearing the cache: + + >>> @memoize + ... def foo() + ... return 1 + ... + >>> foo() + 1 + >>> foo.cache_clear() + >>> + + It supports: + - functions + - classes (acts as a @singleton) + - staticmethods + - classmethods + + It does NOT support: + - methods + """ + + @functools.wraps(fun) + def wrapper(*args, **kwargs): + key = (args, frozenset(sorted(kwargs.items()))) + try: + return cache[key] + except KeyError: + try: + ret = cache[key] = fun(*args, **kwargs) + except Exception as err: + raise err from None + return ret + + def cache_clear(): + """Clear cache.""" + cache.clear() + + cache = {} + wrapper.cache_clear = cache_clear + return wrapper + + +def memoize_when_activated(fun): + """A memoize decorator which is disabled by default. It can be + activated and deactivated on request. + For efficiency reasons it can be used only against class methods + accepting no arguments. + + >>> class Foo: + ... @memoize + ... def foo() + ... print(1) + ... + >>> f = Foo() + >>> # deactivated (default) + >>> foo() + 1 + >>> foo() + 1 + >>> + >>> # activated + >>> foo.cache_activate(self) + >>> foo() + 1 + >>> foo() + >>> foo() + >>> + """ + + @functools.wraps(fun) + def wrapper(self): + try: + # case 1: we previously entered oneshot() ctx + ret = self._cache[fun] + except AttributeError: + # case 2: we never entered oneshot() ctx + try: + return fun(self) + except Exception as err: + raise err from None + except KeyError: + # case 3: we entered oneshot() ctx but there's no cache + # for this entry yet + try: + ret = fun(self) + except Exception as err: + raise err from None + try: + self._cache[fun] = ret + except AttributeError: + # multi-threading race condition, see: + # https://github.com/giampaolo/psutil/issues/1948 + pass + return ret + + def cache_activate(proc): + """Activate cache. Expects a Process instance. Cache will be + stored as a "_cache" instance attribute. + """ + proc._cache = {} + + def cache_deactivate(proc): + """Deactivate and clear cache.""" + try: + del proc._cache + except AttributeError: + pass + + wrapper.cache_activate = cache_activate + wrapper.cache_deactivate = cache_deactivate + return wrapper + + +def isfile_strict(path): + """Same as os.path.isfile() but does not swallow EACCES / EPERM + exceptions, see: + http://mail.python.org/pipermail/python-dev/2012-June/120787.html. + """ + try: + st = os.stat(path) + except PermissionError: + raise + except OSError: + return False + else: + return stat.S_ISREG(st.st_mode) + + +def path_exists_strict(path): + """Same as os.path.exists() but does not swallow EACCES / EPERM + exceptions. See: + http://mail.python.org/pipermail/python-dev/2012-June/120787.html. + """ + try: + os.stat(path) + except PermissionError: + raise + except OSError: + return False + else: + return True + + +def supports_ipv6(): + """Return True if IPv6 is supported on this platform.""" + if not socket.has_ipv6 or AF_INET6 is None: + return False + try: + with socket.socket(AF_INET6, socket.SOCK_STREAM) as sock: + sock.bind(("::1", 0)) + return True + except OSError: + return False + + +def parse_environ_block(data): + """Parse a C environ block of environment variables into a dictionary.""" + # The block is usually raw data from the target process. It might contain + # trailing garbage and lines that do not look like assignments. + ret = {} + pos = 0 + + # localize global variable to speed up access. + WINDOWS_ = WINDOWS + while True: + next_pos = data.find("\0", pos) + # nul byte at the beginning or double nul byte means finish + if next_pos <= pos: + break + # there might not be an equals sign + equal_pos = data.find("=", pos, next_pos) + if equal_pos > pos: + key = data[pos:equal_pos] + value = data[equal_pos + 1 : next_pos] + # Windows expects environment variables to be uppercase only + if WINDOWS_: + key = key.upper() + ret[key] = value + pos = next_pos + 1 + + return ret + + +def sockfam_to_enum(num): + """Convert a numeric socket family value to an IntEnum member. + If it's not a known member, return the numeric value itself. + """ + try: + return socket.AddressFamily(num) + except ValueError: + return num + + +def socktype_to_enum(num): + """Convert a numeric socket type value to an IntEnum member. + If it's not a known member, return the numeric value itself. + """ + try: + return socket.SocketKind(num) + except ValueError: + return num + + +def conn_to_ntuple(fd, fam, type_, laddr, raddr, status, status_map, pid=None): + """Convert a raw connection tuple to a proper ntuple.""" + from . import _ntuples as ntp + + if fam in {socket.AF_INET, AF_INET6}: + if laddr: + laddr = ntp.addr(*laddr) + if raddr: + raddr = ntp.addr(*raddr) + if type_ == socket.SOCK_STREAM and fam in {AF_INET, AF_INET6}: + status = status_map.get(status, CONN_NONE) + else: + status = CONN_NONE # ignore whatever C returned to us + fam = sockfam_to_enum(fam) + type_ = socktype_to_enum(type_) + if pid is None: + return ntp.pconn(fd, fam, type_, laddr, raddr, status) + else: + return ntp.sconn(fd, fam, type_, laddr, raddr, status, pid) + + +def broadcast_addr(addr): + """Given the address ntuple returned by ``net_if_addrs()`` + calculates the broadcast address. + """ + import ipaddress + + if not addr.address or not addr.netmask: + return None + if addr.family == socket.AF_INET: + return str( + ipaddress.IPv4Network( + f"{addr.address}/{addr.netmask}", strict=False + ).broadcast_address + ) + if addr.family == socket.AF_INET6: + return str( + ipaddress.IPv6Network( + f"{addr.address}/{addr.netmask}", strict=False + ).broadcast_address + ) + + +def deprecated_method(replacement): + """A decorator which can be used to mark a method as deprecated + 'replcement' is the method name which will be called instead. + """ + + def outer(fun): + msg = ( + f"{fun.__name__}() is deprecated and will be removed; use" + f" {replacement}() instead" + ) + if fun.__doc__ is None: + fun.__doc__ = msg + + @functools.wraps(fun) + def inner(self, *args, **kwargs): + warnings.warn(msg, category=DeprecationWarning, stacklevel=2) + return getattr(self, replacement)(*args, **kwargs) + + return inner + + return outer + + +class _WrapNumbers: + """Watches numbers so that they don't overflow and wrap + (reset to zero). + """ + + def __init__(self): + self.lock = threading.Lock() + self.cache = {} + self.reminders = {} + self.reminder_keys = {} + + def _add_dict(self, input_dict, name): + assert name not in self.cache + assert name not in self.reminders + assert name not in self.reminder_keys + self.cache[name] = input_dict + self.reminders[name] = collections.defaultdict(int) + self.reminder_keys[name] = collections.defaultdict(set) + + def _remove_dead_reminders(self, input_dict, name): + """In case the number of keys changed between calls (e.g. a + disk disappears) this removes the entry from self.reminders. + """ + old_dict = self.cache[name] + gone_keys = set(old_dict.keys()) - set(input_dict.keys()) + for gone_key in gone_keys: + for remkey in self.reminder_keys[name][gone_key]: + del self.reminders[name][remkey] + del self.reminder_keys[name][gone_key] + + def run(self, input_dict, name): + """Cache dict and sum numbers which overflow and wrap. + Return an updated copy of `input_dict`. + """ + if name not in self.cache: + # This was the first call. + self._add_dict(input_dict, name) + return input_dict + + self._remove_dead_reminders(input_dict, name) + + old_dict = self.cache[name] + new_dict = {} + for key in input_dict: + input_tuple = input_dict[key] + try: + old_tuple = old_dict[key] + except KeyError: + # The input dict has a new key (e.g. a new disk or NIC) + # which didn't exist in the previous call. + new_dict[key] = input_tuple + continue + + bits = [] + for i in range(len(input_tuple)): + input_value = input_tuple[i] + old_value = old_tuple[i] + remkey = (key, i) + if input_value < old_value: + # it wrapped! + self.reminders[name][remkey] += old_value + self.reminder_keys[name][key].add(remkey) + bits.append(input_value + self.reminders[name][remkey]) + + new_dict[key] = tuple(bits) + + self.cache[name] = input_dict + return new_dict + + def cache_clear(self, name=None): + """Clear the internal cache, optionally only for function 'name'.""" + with self.lock: + if name is None: + self.cache.clear() + self.reminders.clear() + self.reminder_keys.clear() + else: + self.cache.pop(name, None) + self.reminders.pop(name, None) + self.reminder_keys.pop(name, None) + + def cache_info(self): + """Return internal cache dicts as a tuple of 3 elements.""" + with self.lock: + return (self.cache, self.reminders, self.reminder_keys) + + +def wrap_numbers(input_dict, name): + """Given an `input_dict` and a function `name`, adjust the numbers + which "wrap" (restart from zero) across different calls by adding + "old value" to "new value" and return an updated dict. + """ + with _wn.lock: + return _wn.run(input_dict, name) + + +_wn = _WrapNumbers() +wrap_numbers.cache_clear = _wn.cache_clear +wrap_numbers.cache_info = _wn.cache_info + + +# The read buffer size for open() builtin. This (also) dictates how +# much data we read(2) when iterating over file lines as in: +# >>> with open(file) as f: +# ... for line in f: +# ... ... +# Default per-line buffer size for binary files is 1K. For text files +# is 8K. We use a bigger buffer (32K) in order to have more consistent +# results when reading /proc pseudo files on Linux, see: +# https://github.com/giampaolo/psutil/issues/2050 +# https://github.com/giampaolo/psutil/issues/708 +FILE_READ_BUFFER_SIZE = 32 * 1024 + + +def open_binary(fname): + return open(fname, "rb", buffering=FILE_READ_BUFFER_SIZE) + + +def open_text(fname): + """Open a file in text mode by using the proper FS encoding and + en/decoding error handlers. + """ + # See: + # https://github.com/giampaolo/psutil/issues/675 + # https://github.com/giampaolo/psutil/pull/733 + fobj = open( # noqa: SIM115 + fname, + buffering=FILE_READ_BUFFER_SIZE, + encoding=ENCODING, + errors=ENCODING_ERRS, + ) + try: + # Dictates per-line read(2) buffer size. Defaults is 8k. See: + # https://github.com/giampaolo/psutil/issues/2050#issuecomment-1013387546 + fobj._CHUNK_SIZE = FILE_READ_BUFFER_SIZE + except AttributeError: + pass + except Exception: + fobj.close() + raise + + return fobj + + +def cat(fname, fallback=_DEFAULT, _open=open_text): + """Read entire file content and return it as a string. File is + opened in text mode. If specified, `fallback` is the value + returned in case of error, either if the file does not exist or + it can't be read(). + """ + if fallback is _DEFAULT: + with _open(fname) as f: + return f.read() + else: + try: + with _open(fname) as f: + return f.read() + except OSError: + return fallback + + +def bcat(fname, fallback=_DEFAULT): + """Same as above but opens file in binary mode.""" + return cat(fname, fallback=fallback, _open=open_binary) + + +def bytes2human(n, format="%(value).1f%(symbol)s"): + """Used by various scripts. See: https://code.activestate.com/recipes/578019-bytes-to-human-human-to-bytes-converter/?in=user-4178764. + + >>> bytes2human(10000) + '9.8K' + >>> bytes2human(100001221) + '95.4M' + """ + symbols = ('B', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y') + prefix = {} + for i, s in enumerate(symbols[1:]): + prefix[s] = 1 << (i + 1) * 10 + for symbol in reversed(symbols[1:]): + if abs(n) >= prefix[symbol]: + value = float(n) / prefix[symbol] + return format % locals() + return format % dict(symbol=symbols[0], value=n) + + +def get_procfs_path(): + """Return updated psutil.PROCFS_PATH constant.""" + return sys.modules['psutil'].PROCFS_PATH + + +def decode(s): + return s.decode(encoding=ENCODING, errors=ENCODING_ERRS) + + +# ===================================================================== +# --- shell utils +# ===================================================================== + + +@memoize +def term_supports_colors(file=sys.stdout): # pragma: no cover + if not hasattr(file, "isatty") or not file.isatty(): + return False + try: + file.fileno() + except Exception: # noqa: BLE001 + return False + return True + + +def hilite(s, color=None, bold=False): # pragma: no cover + """Return an highlighted version of 'string'.""" + if not term_supports_colors(): + return s + attr = [] + colors = dict( + blue='34', + brown='33', + darkgrey='30', + green='32', + grey='37', + lightblue='36', + red='91', + violet='35', + yellow='93', + ) + colors[None] = '29' + try: + color = colors[color] + except KeyError: + msg = f"invalid color {color!r}; choose amongst {list(colors.keys())}" + raise ValueError(msg) from None + attr.append(color) + if bold: + attr.append('1') + return f"\x1b[{';'.join(attr)}m{s}\x1b[0m" + + +def print_color( + s, color=None, bold=False, file=sys.stdout +): # pragma: no cover + """Print a colorized version of string.""" + if not term_supports_colors(): + print(s, file=file) + elif POSIX: + print(hilite(s, color, bold), file=file) + else: + import ctypes + + DEFAULT_COLOR = 7 + GetStdHandle = ctypes.windll.Kernel32.GetStdHandle + SetConsoleTextAttribute = ( + ctypes.windll.Kernel32.SetConsoleTextAttribute + ) + + colors = dict(green=2, red=4, brown=6, yellow=6) + colors[None] = DEFAULT_COLOR + try: + color = colors[color] + except KeyError: + msg = ( + f"invalid color {color!r}; choose between" + f" {list(colors.keys())!r}" + ) + raise ValueError(msg) from None + if bold and color <= 7: + color += 8 + + handle_id = -12 if file is sys.stderr else -11 + GetStdHandle.restype = ctypes.c_ulong + handle = GetStdHandle(handle_id) + SetConsoleTextAttribute(handle, color) + try: + print(s, file=file) + finally: + SetConsoleTextAttribute(handle, DEFAULT_COLOR) + + +def debug(msg): + """If PSUTIL_DEBUG env var is set, print a debug message to stderr.""" + if PSUTIL_DEBUG: + import inspect + + fname, lineno, _, _lines, _index = inspect.getframeinfo( + inspect.currentframe().f_back + ) + if isinstance(msg, Exception): + if isinstance(msg, OSError): + # ...because str(exc) may contain info about the file name + msg = f"ignoring {msg}" + else: + msg = f"ignoring {msg!r}" + print( # noqa: T201 + f"psutil-debug [{fname}:{lineno}]> {msg}", file=sys.stderr + ) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_ntuples.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_ntuples.py new file mode 100644 index 0000000000000000000000000000000000000000..f0ab0393763f0969d2f4b4302fa638771c6c0bdb --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_ntuples.py @@ -0,0 +1,429 @@ +# Copyright (c) 2009, Giampaolo Rodola". All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +from collections import namedtuple as nt + +from ._common import AIX +from ._common import BSD +from ._common import FREEBSD +from ._common import LINUX +from ._common import MACOS +from ._common import SUNOS +from ._common import WINDOWS + +# =================================================================== +# --- system functions +# =================================================================== + +# psutil.swap_memory() +sswap = nt("sswap", ("total", "used", "free", "percent", "sin", "sout")) + +# psutil.disk_usage() +sdiskusage = nt("sdiskusage", ("total", "used", "free", "percent")) + +# psutil.disk_io_counters() +sdiskio = nt( + "sdiskio", + ( + "read_count", + "write_count", + "read_bytes", + "write_bytes", + "read_time", + "write_time", + ), +) + +# psutil.disk_partitions() +sdiskpart = nt("sdiskpart", ("device", "mountpoint", "fstype", "opts")) + +# psutil.net_io_counters() +snetio = nt( + "snetio", + ( + "bytes_sent", + "bytes_recv", + "packets_sent", + "packets_recv", + "errin", + "errout", + "dropin", + "dropout", + ), +) + +# psutil.users() +suser = nt("suser", ("name", "terminal", "host", "started", "pid")) + +# psutil.net_connections() +sconn = nt( + "sconn", ("fd", "family", "type", "laddr", "raddr", "status", "pid") +) + +# psutil.net_if_addrs() +snicaddr = nt("snicaddr", ("family", "address", "netmask", "broadcast", "ptp")) + +# psutil.net_if_stats() +snicstats = nt("snicstats", ("isup", "duplex", "speed", "mtu", "flags")) + +# psutil.cpu_stats() +scpustats = nt( + "scpustats", ("ctx_switches", "interrupts", "soft_interrupts", "syscalls") +) + +# psutil.cpu_freq() +scpufreq = nt("scpufreq", ("current", "min", "max")) + +# psutil.sensors_temperatures() +shwtemp = nt("shwtemp", ("label", "current", "high", "critical")) + +# psutil.sensors_battery() +sbattery = nt("sbattery", ("percent", "secsleft", "power_plugged")) + +# psutil.sensors_fans() +sfan = nt("sfan", ("label", "current")) + +# psutil.heap_info() (mallinfo2 Linux struct) +if LINUX or WINDOWS or MACOS or BSD: + pheap = nt( + "pheap", + [ + "heap_used", # uordblks, memory allocated via malloc() + "mmap_used", # hblkhd, memory allocated via mmap() (large blocks) + ], + ) + if WINDOWS: + pheap = nt("pheap", pheap._fields + ("heap_count",)) + +# =================================================================== +# --- Process class +# =================================================================== + +# psutil.Process.cpu_times() +pcputimes = nt( + "pcputimes", ("user", "system", "children_user", "children_system") +) + +# psutil.Process.open_files() +popenfile = nt("popenfile", ("path", "fd")) + +# psutil.Process.threads() +pthread = nt("pthread", ("id", "user_time", "system_time")) + +# psutil.Process.uids() +puids = nt("puids", ("real", "effective", "saved")) + +# psutil.Process.gids() +pgids = nt("pgids", ("real", "effective", "saved")) + +# psutil.Process.io_counters() +pio = nt("pio", ("read_count", "write_count", "read_bytes", "write_bytes")) + +# psutil.Process.ionice() +pionice = nt("pionice", ("ioclass", "value")) + +# psutil.Process.ctx_switches() +pctxsw = nt("pctxsw", ("voluntary", "involuntary")) + +# psutil.Process.net_connections() +pconn = nt("pconn", ("fd", "family", "type", "laddr", "raddr", "status")) + +# psutil.net_connections() and psutil.Process.net_connections() +addr = nt("addr", ("ip", "port")) + +# =================================================================== +# --- Linux +# =================================================================== + +if LINUX: + + # This gets set from _pslinux.py + scputimes = None + + # psutil.virtual_memory() + svmem = nt( + "svmem", + ( + "total", + "available", + "percent", + "used", + "free", + "active", + "inactive", + "buffers", + "cached", + "shared", + "slab", + ), + ) + + # psutil.disk_io_counters() + sdiskio = nt( + "sdiskio", + ( + "read_count", + "write_count", + "read_bytes", + "write_bytes", + "read_time", + "write_time", + "read_merged_count", + "write_merged_count", + "busy_time", + ), + ) + + # psutil.Process().open_files() + popenfile = nt("popenfile", ("path", "fd", "position", "mode", "flags")) + + # psutil.Process().memory_info() + pmem = nt("pmem", ("rss", "vms", "shared", "text", "lib", "data", "dirty")) + + # psutil.Process().memory_full_info() + pfullmem = nt("pfullmem", pmem._fields + ("uss", "pss", "swap")) + + # psutil.Process().memory_maps(grouped=True) + pmmap_grouped = nt( + "pmmap_grouped", + ( + "path", + "rss", + "size", + "pss", + "shared_clean", + "shared_dirty", + "private_clean", + "private_dirty", + "referenced", + "anonymous", + "swap", + ), + ) + + # psutil.Process().memory_maps(grouped=False) + pmmap_ext = nt( + "pmmap_ext", "addr perms " + " ".join(pmmap_grouped._fields) + ) + + # psutil.Process.io_counters() + pio = nt( + "pio", + ( + "read_count", + "write_count", + "read_bytes", + "write_bytes", + "read_chars", + "write_chars", + ), + ) + + # psutil.Process.cpu_times() + pcputimes = nt( + "pcputimes", + ("user", "system", "children_user", "children_system", "iowait"), + ) + +# =================================================================== +# --- Windows +# =================================================================== + +elif WINDOWS: + + # psutil.cpu_times() + scputimes = nt("scputimes", ("user", "system", "idle", "interrupt", "dpc")) + + # psutil.virtual_memory() + svmem = nt("svmem", ("total", "available", "percent", "used", "free")) + + # psutil.Process.memory_info() + pmem = nt( + "pmem", + ( + "rss", + "vms", + "num_page_faults", + "peak_wset", + "wset", + "peak_paged_pool", + "paged_pool", + "peak_nonpaged_pool", + "nonpaged_pool", + "pagefile", + "peak_pagefile", + "private", + ), + ) + + # psutil.Process.memory_full_info() + pfullmem = nt("pfullmem", pmem._fields + ("uss",)) + + # psutil.Process.memory_maps(grouped=True) + pmmap_grouped = nt("pmmap_grouped", ("path", "rss")) + + # psutil.Process.memory_maps(grouped=False) + pmmap_ext = nt( + "pmmap_ext", "addr perms " + " ".join(pmmap_grouped._fields) + ) + + # psutil.Process.io_counters() + pio = nt( + "pio", + ( + "read_count", + "write_count", + "read_bytes", + "write_bytes", + "other_count", + "other_bytes", + ), + ) + +# =================================================================== +# --- macOS +# =================================================================== + +elif MACOS: + + # psutil.cpu_times() + scputimes = nt("scputimes", ("user", "nice", "system", "idle")) + + # psutil.virtual_memory() + svmem = nt( + "svmem", + ( + "total", + "available", + "percent", + "used", + "free", + "active", + "inactive", + "wired", + ), + ) + + # psutil.Process.memory_info() + pmem = nt("pmem", ("rss", "vms", "pfaults", "pageins")) + + # psutil.Process.memory_full_info() + pfullmem = nt("pfullmem", pmem._fields + ("uss",)) + +# =================================================================== +# --- BSD +# =================================================================== + +elif BSD: + + # psutil.virtual_memory() + svmem = nt( + "svmem", + ( + "total", + "available", + "percent", + "used", + "free", + "active", + "inactive", + "buffers", + "cached", + "shared", + "wired", + ), + ) + + # psutil.cpu_times() + scputimes = nt("scputimes", ("user", "nice", "system", "idle", "irq")) + + # psutil.Process.memory_info() + pmem = nt("pmem", ("rss", "vms", "text", "data", "stack")) + + # psutil.Process.memory_full_info() + pfullmem = pmem + + # psutil.Process.cpu_times() + pcputimes = nt( + "pcputimes", ("user", "system", "children_user", "children_system") + ) + + # psutil.Process.memory_maps(grouped=True) + pmmap_grouped = nt( + "pmmap_grouped", "path rss, private, ref_count, shadow_count" + ) + + # psutil.Process.memory_maps(grouped=False) + pmmap_ext = nt( + "pmmap_ext", "addr, perms path rss, private, ref_count, shadow_count" + ) + + # psutil.disk_io_counters() + if FREEBSD: + sdiskio = nt( + "sdiskio", + ( + "read_count", + "write_count", + "read_bytes", + "write_bytes", + "read_time", + "write_time", + "busy_time", + ), + ) + else: + sdiskio = nt( + "sdiskio", + ("read_count", "write_count", "read_bytes", "write_bytes"), + ) + +# =================================================================== +# --- SunOS +# =================================================================== + +elif SUNOS: + + # psutil.cpu_times() + scputimes = nt("scputimes", ("user", "system", "idle", "iowait")) + + # psutil.cpu_times(percpu=True) + pcputimes = nt( + "pcputimes", ("user", "system", "children_user", "children_system") + ) + + # psutil.virtual_memory() + svmem = nt("svmem", ("total", "available", "percent", "used", "free")) + + # psutil.Process.memory_info() + pmem = nt("pmem", ("rss", "vms")) + + # psutil.Process.memory_full_info() + pfullmem = pmem + + # psutil.Process.memory_maps(grouped=True) + pmmap_grouped = nt("pmmap_grouped", ("path", "rss", "anonymous", "locked")) + + # psutil.Process.memory_maps(grouped=False) + pmmap_ext = nt( + "pmmap_ext", "addr perms " + " ".join(pmmap_grouped._fields) + ) + +# =================================================================== +# --- AIX +# =================================================================== + +elif AIX: + + # psutil.Process.memory_info() + pmem = nt("pmem", ("rss", "vms")) + + # psutil.Process.memory_full_info() + pfullmem = pmem + + # psutil.Process.cpu_times() + scputimes = nt("scputimes", ("user", "system", "idle", "iowait")) + + # psutil.virtual_memory() + svmem = nt("svmem", ("total", "available", "percent", "used", "free")) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_psaix.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_psaix.py new file mode 100644 index 0000000000000000000000000000000000000000..1f628ad93c1b1464b16d63daee79fe161204730e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_psaix.py @@ -0,0 +1,546 @@ +# Copyright (c) 2009, Giampaolo Rodola' +# Copyright (c) 2017, Arnon Yaari +# All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""AIX platform implementation.""" + +import functools +import glob +import os +import re +import subprocess +import sys + +from . import _common +from . import _ntuples as ntp +from . import _psposix +from . import _psutil_aix as cext +from ._common import NIC_DUPLEX_FULL +from ._common import NIC_DUPLEX_HALF +from ._common import NIC_DUPLEX_UNKNOWN +from ._common import AccessDenied +from ._common import NoSuchProcess +from ._common import ZombieProcess +from ._common import conn_to_ntuple +from ._common import get_procfs_path +from ._common import memoize_when_activated +from ._common import usage_percent + +__extra__all__ = ["PROCFS_PATH"] + + +# ===================================================================== +# --- globals +# ===================================================================== + + +HAS_THREADS = hasattr(cext, "proc_threads") +HAS_NET_IO_COUNTERS = hasattr(cext, "net_io_counters") +HAS_PROC_IO_COUNTERS = hasattr(cext, "proc_io_counters") + +PAGE_SIZE = cext.getpagesize() +AF_LINK = cext.AF_LINK + +PROC_STATUSES = { + cext.SIDL: _common.STATUS_IDLE, + cext.SZOMB: _common.STATUS_ZOMBIE, + cext.SACTIVE: _common.STATUS_RUNNING, + cext.SSWAP: _common.STATUS_RUNNING, # TODO what status is this? + cext.SSTOP: _common.STATUS_STOPPED, +} + +TCP_STATUSES = { + cext.TCPS_ESTABLISHED: _common.CONN_ESTABLISHED, + cext.TCPS_SYN_SENT: _common.CONN_SYN_SENT, + cext.TCPS_SYN_RCVD: _common.CONN_SYN_RECV, + cext.TCPS_FIN_WAIT_1: _common.CONN_FIN_WAIT1, + cext.TCPS_FIN_WAIT_2: _common.CONN_FIN_WAIT2, + cext.TCPS_TIME_WAIT: _common.CONN_TIME_WAIT, + cext.TCPS_CLOSED: _common.CONN_CLOSE, + cext.TCPS_CLOSE_WAIT: _common.CONN_CLOSE_WAIT, + cext.TCPS_LAST_ACK: _common.CONN_LAST_ACK, + cext.TCPS_LISTEN: _common.CONN_LISTEN, + cext.TCPS_CLOSING: _common.CONN_CLOSING, + cext.PSUTIL_CONN_NONE: _common.CONN_NONE, +} + +proc_info_map = dict( + ppid=0, + rss=1, + vms=2, + create_time=3, + nice=4, + num_threads=5, + status=6, + ttynr=7, +) + + +# ===================================================================== +# --- memory +# ===================================================================== + + +def virtual_memory(): + total, avail, free, _pinned, inuse = cext.virtual_mem() + percent = usage_percent((total - avail), total, round_=1) + return ntp.svmem(total, avail, percent, inuse, free) + + +def swap_memory(): + """Swap system memory as a (total, used, free, sin, sout) tuple.""" + total, free, sin, sout = cext.swap_mem() + used = total - free + percent = usage_percent(used, total, round_=1) + return ntp.sswap(total, used, free, percent, sin, sout) + + +# ===================================================================== +# --- CPU +# ===================================================================== + + +def cpu_times(): + """Return system-wide CPU times as a named tuple.""" + ret = cext.per_cpu_times() + return ntp.scputimes(*[sum(x) for x in zip(*ret)]) + + +def per_cpu_times(): + """Return system per-CPU times as a list of named tuples.""" + ret = cext.per_cpu_times() + return [ntp.scputimes(*x) for x in ret] + + +def cpu_count_logical(): + """Return the number of logical CPUs in the system.""" + try: + return os.sysconf("SC_NPROCESSORS_ONLN") + except ValueError: + # mimic os.cpu_count() behavior + return None + + +def cpu_count_cores(): + cmd = ["lsdev", "-Cc", "processor"] + p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout, stderr = p.communicate() + stdout, stderr = (x.decode(sys.stdout.encoding) for x in (stdout, stderr)) + if p.returncode != 0: + msg = f"{cmd!r} command error\n{stderr}" + raise RuntimeError(msg) + processors = stdout.strip().splitlines() + return len(processors) or None + + +def cpu_stats(): + """Return various CPU stats as a named tuple.""" + ctx_switches, interrupts, soft_interrupts, syscalls = cext.cpu_stats() + return ntp.scpustats(ctx_switches, interrupts, soft_interrupts, syscalls) + + +# ===================================================================== +# --- disks +# ===================================================================== + + +disk_io_counters = cext.disk_io_counters +disk_usage = _psposix.disk_usage + + +def disk_partitions(all=False): + """Return system disk partitions.""" + # TODO - the filtering logic should be better checked so that + # it tries to reflect 'df' as much as possible + retlist = [] + partitions = cext.disk_partitions() + for partition in partitions: + device, mountpoint, fstype, opts = partition + if device == 'none': + device = '' + if not all: + # Differently from, say, Linux, we don't have a list of + # common fs types so the best we can do, AFAIK, is to + # filter by filesystem having a total size > 0. + if not disk_usage(mountpoint).total: + continue + ntuple = ntp.sdiskpart(device, mountpoint, fstype, opts) + retlist.append(ntuple) + return retlist + + +# ===================================================================== +# --- network +# ===================================================================== + + +net_if_addrs = cext.net_if_addrs + +if HAS_NET_IO_COUNTERS: + net_io_counters = cext.net_io_counters + + +def net_connections(kind, _pid=-1): + """Return socket connections. If pid == -1 return system-wide + connections (as opposed to connections opened by one process only). + """ + families, types = _common.conn_tmap[kind] + rawlist = cext.net_connections(_pid) + ret = [] + for item in rawlist: + fd, fam, type_, laddr, raddr, status, pid = item + if fam not in families: + continue + if type_ not in types: + continue + nt = conn_to_ntuple( + fd, + fam, + type_, + laddr, + raddr, + status, + TCP_STATUSES, + pid=pid if _pid == -1 else None, + ) + ret.append(nt) + return ret + + +def net_if_stats(): + """Get NIC stats (isup, duplex, speed, mtu).""" + duplex_map = {"Full": NIC_DUPLEX_FULL, "Half": NIC_DUPLEX_HALF} + names = {x[0] for x in net_if_addrs()} + ret = {} + for name in names: + mtu = cext.net_if_mtu(name) + flags = cext.net_if_flags(name) + + # try to get speed and duplex + # TODO: rewrite this in C (entstat forks, so use truss -f to follow. + # looks like it is using an undocumented ioctl?) + duplex = "" + speed = 0 + p = subprocess.Popen( + ["/usr/bin/entstat", "-d", name], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) + stdout, stderr = p.communicate() + stdout, stderr = ( + x.decode(sys.stdout.encoding) for x in (stdout, stderr) + ) + if p.returncode == 0: + re_result = re.search( + r"Running: (\d+) Mbps.*?(\w+) Duplex", stdout + ) + if re_result is not None: + speed = int(re_result.group(1)) + duplex = re_result.group(2) + + output_flags = ','.join(flags) + isup = 'running' in flags + duplex = duplex_map.get(duplex, NIC_DUPLEX_UNKNOWN) + ret[name] = ntp.snicstats(isup, duplex, speed, mtu, output_flags) + return ret + + +# ===================================================================== +# --- other system functions +# ===================================================================== + + +def boot_time(): + """The system boot time expressed in seconds since the epoch.""" + return cext.boot_time() + + +def users(): + """Return currently connected users as a list of namedtuples.""" + retlist = [] + rawlist = cext.users() + localhost = (':0.0', ':0') + for item in rawlist: + user, tty, hostname, tstamp, user_process, pid = item + # note: the underlying C function includes entries about + # system boot, run level and others. We might want + # to use them in the future. + if not user_process: + continue + if hostname in localhost: + hostname = 'localhost' + nt = ntp.suser(user, tty, hostname, tstamp, pid) + retlist.append(nt) + return retlist + + +# ===================================================================== +# --- processes +# ===================================================================== + + +def pids(): + """Returns a list of PIDs currently running on the system.""" + return [int(x) for x in os.listdir(get_procfs_path()) if x.isdigit()] + + +def pid_exists(pid): + """Check for the existence of a unix pid.""" + return os.path.exists(os.path.join(get_procfs_path(), str(pid), "psinfo")) + + +def wrap_exceptions(fun): + """Call callable into a try/except clause and translate ENOENT, + EACCES and EPERM in NoSuchProcess or AccessDenied exceptions. + """ + + @functools.wraps(fun) + def wrapper(self, *args, **kwargs): + pid, ppid, name = self.pid, self._ppid, self._name + try: + return fun(self, *args, **kwargs) + except (FileNotFoundError, ProcessLookupError) as err: + # ENOENT (no such file or directory) gets raised on open(). + # ESRCH (no such process) can get raised on read() if + # process is gone in meantime. + if not pid_exists(pid): + raise NoSuchProcess(pid, name) from err + raise ZombieProcess(pid, name, ppid) from err + except PermissionError as err: + raise AccessDenied(pid, name) from err + + return wrapper + + +class Process: + """Wrapper class around underlying C implementation.""" + + __slots__ = ["_cache", "_name", "_ppid", "_procfs_path", "pid"] + + def __init__(self, pid): + self.pid = pid + self._name = None + self._ppid = None + self._procfs_path = get_procfs_path() + + def oneshot_enter(self): + self._proc_basic_info.cache_activate(self) + self._proc_cred.cache_activate(self) + + def oneshot_exit(self): + self._proc_basic_info.cache_deactivate(self) + self._proc_cred.cache_deactivate(self) + + @wrap_exceptions + @memoize_when_activated + def _proc_basic_info(self): + return cext.proc_basic_info(self.pid, self._procfs_path) + + @wrap_exceptions + @memoize_when_activated + def _proc_cred(self): + return cext.proc_cred(self.pid, self._procfs_path) + + @wrap_exceptions + def name(self): + if self.pid == 0: + return "swapper" + # note: max 16 characters + return cext.proc_name(self.pid, self._procfs_path).rstrip("\x00") + + @wrap_exceptions + def exe(self): + # there is no way to get executable path in AIX other than to guess, + # and guessing is more complex than what's in the wrapping class + cmdline = self.cmdline() + if not cmdline: + return '' + exe = cmdline[0] + if os.path.sep in exe: + # relative or absolute path + if not os.path.isabs(exe): + # if cwd has changed, we're out of luck - this may be wrong! + exe = os.path.abspath(os.path.join(self.cwd(), exe)) + if ( + os.path.isabs(exe) + and os.path.isfile(exe) + and os.access(exe, os.X_OK) + ): + return exe + # not found, move to search in PATH using basename only + exe = os.path.basename(exe) + # search for exe name PATH + for path in os.environ["PATH"].split(":"): + possible_exe = os.path.abspath(os.path.join(path, exe)) + if os.path.isfile(possible_exe) and os.access( + possible_exe, os.X_OK + ): + return possible_exe + return '' + + @wrap_exceptions + def cmdline(self): + return cext.proc_args(self.pid) + + @wrap_exceptions + def environ(self): + return cext.proc_environ(self.pid) + + @wrap_exceptions + def create_time(self): + return self._proc_basic_info()[proc_info_map['create_time']] + + @wrap_exceptions + def num_threads(self): + return self._proc_basic_info()[proc_info_map['num_threads']] + + if HAS_THREADS: + + @wrap_exceptions + def threads(self): + rawlist = cext.proc_threads(self.pid) + retlist = [] + for thread_id, utime, stime in rawlist: + ntuple = ntp.pthread(thread_id, utime, stime) + retlist.append(ntuple) + # The underlying C implementation retrieves all OS threads + # and filters them by PID. At this point we can't tell whether + # an empty list means there were no connections for process or + # process is no longer active so we force NSP in case the PID + # is no longer there. + if not retlist: + # will raise NSP if process is gone + os.stat(f"{self._procfs_path}/{self.pid}") + return retlist + + @wrap_exceptions + def net_connections(self, kind='inet'): + ret = net_connections(kind, _pid=self.pid) + # The underlying C implementation retrieves all OS connections + # and filters them by PID. At this point we can't tell whether + # an empty list means there were no connections for process or + # process is no longer active so we force NSP in case the PID + # is no longer there. + if not ret: + # will raise NSP if process is gone + os.stat(f"{self._procfs_path}/{self.pid}") + return ret + + @wrap_exceptions + def nice_get(self): + return cext.proc_priority_get(self.pid) + + @wrap_exceptions + def nice_set(self, value): + return cext.proc_priority_set(self.pid, value) + + @wrap_exceptions + def ppid(self): + self._ppid = self._proc_basic_info()[proc_info_map['ppid']] + return self._ppid + + @wrap_exceptions + def uids(self): + real, effective, saved, _, _, _ = self._proc_cred() + return ntp.puids(real, effective, saved) + + @wrap_exceptions + def gids(self): + _, _, _, real, effective, saved = self._proc_cred() + return ntp.puids(real, effective, saved) + + @wrap_exceptions + def cpu_times(self): + t = cext.proc_cpu_times(self.pid, self._procfs_path) + return ntp.pcputimes(*t) + + @wrap_exceptions + def terminal(self): + ttydev = self._proc_basic_info()[proc_info_map['ttynr']] + # convert from 64-bit dev_t to 32-bit dev_t and then map the device + ttydev = ((ttydev & 0x0000FFFF00000000) >> 16) | (ttydev & 0xFFFF) + # try to match rdev of /dev/pts/* files ttydev + for dev in glob.glob("/dev/**/*"): + if os.stat(dev).st_rdev == ttydev: + return dev + return None + + @wrap_exceptions + def cwd(self): + procfs_path = self._procfs_path + try: + result = os.readlink(f"{procfs_path}/{self.pid}/cwd") + return result.rstrip('/') + except FileNotFoundError: + os.stat(f"{procfs_path}/{self.pid}") # raise NSP or AD + return "" + + @wrap_exceptions + def memory_info(self): + ret = self._proc_basic_info() + rss = ret[proc_info_map['rss']] * 1024 + vms = ret[proc_info_map['vms']] * 1024 + return ntp.pmem(rss, vms) + + memory_full_info = memory_info + + @wrap_exceptions + def status(self): + code = self._proc_basic_info()[proc_info_map['status']] + # XXX is '?' legit? (we're not supposed to return it anyway) + return PROC_STATUSES.get(code, '?') + + def open_files(self): + # TODO rewrite without using procfiles (stat /proc/pid/fd/* and then + # find matching name of the inode) + p = subprocess.Popen( + ["/usr/bin/procfiles", "-n", str(self.pid)], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) + stdout, stderr = p.communicate() + stdout, stderr = ( + x.decode(sys.stdout.encoding) for x in (stdout, stderr) + ) + if "no such process" in stderr.lower(): + raise NoSuchProcess(self.pid, self._name) + procfiles = re.findall(r"(\d+): S_IFREG.*name:(.*)\n", stdout) + retlist = [] + for fd, path in procfiles: + path = path.strip() + if path.startswith("//"): + path = path[1:] + if path.lower() == "cannot be retrieved": + continue + retlist.append(ntp.popenfile(path, int(fd))) + return retlist + + @wrap_exceptions + def num_fds(self): + if self.pid == 0: # no /proc/0/fd + return 0 + return len(os.listdir(f"{self._procfs_path}/{self.pid}/fd")) + + @wrap_exceptions + def num_ctx_switches(self): + return ntp.pctxsw(*cext.proc_num_ctx_switches(self.pid)) + + @wrap_exceptions + def wait(self, timeout=None): + return _psposix.wait_pid(self.pid, timeout) + + if HAS_PROC_IO_COUNTERS: + + @wrap_exceptions + def io_counters(self): + try: + rc, wc, rb, wb = cext.proc_io_counters(self.pid) + except OSError as err: + # if process is terminated, proc_io_counters returns OSError + # instead of NSP + if not pid_exists(self.pid): + raise NoSuchProcess(self.pid, self._name) from err + raise + return ntp.pio(rc, wc, rb, wb) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_psbsd.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_psbsd.py new file mode 100644 index 0000000000000000000000000000000000000000..a75cd1af131973c0f78caa65a22c0a7e91645959 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_psbsd.py @@ -0,0 +1,904 @@ +# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""FreeBSD, OpenBSD and NetBSD platforms implementation.""" + +import contextlib +import errno +import functools +import os +from collections import defaultdict +from collections import namedtuple +from xml.etree import ElementTree # noqa: ICN001 + +from . import _common +from . import _ntuples as ntp +from . import _psposix +from . import _psutil_bsd as cext +from ._common import FREEBSD +from ._common import NETBSD +from ._common import OPENBSD +from ._common import AccessDenied +from ._common import NoSuchProcess +from ._common import ZombieProcess +from ._common import conn_tmap +from ._common import conn_to_ntuple +from ._common import debug +from ._common import memoize +from ._common import memoize_when_activated +from ._common import usage_percent + +__extra__all__ = [] + + +# ===================================================================== +# --- globals +# ===================================================================== + + +if FREEBSD: + PROC_STATUSES = { + cext.SIDL: _common.STATUS_IDLE, + cext.SRUN: _common.STATUS_RUNNING, + cext.SSLEEP: _common.STATUS_SLEEPING, + cext.SSTOP: _common.STATUS_STOPPED, + cext.SZOMB: _common.STATUS_ZOMBIE, + cext.SWAIT: _common.STATUS_WAITING, + cext.SLOCK: _common.STATUS_LOCKED, + } +elif OPENBSD: + PROC_STATUSES = { + cext.SIDL: _common.STATUS_IDLE, + cext.SSLEEP: _common.STATUS_SLEEPING, + cext.SSTOP: _common.STATUS_STOPPED, + # According to /usr/include/sys/proc.h SZOMB is unused. + # test_zombie_process() shows that SDEAD is the right + # equivalent. Also it appears there's no equivalent of + # psutil.STATUS_DEAD. SDEAD really means STATUS_ZOMBIE. + # cext.SZOMB: _common.STATUS_ZOMBIE, + cext.SDEAD: _common.STATUS_ZOMBIE, + cext.SZOMB: _common.STATUS_ZOMBIE, + # From http://www.eecs.harvard.edu/~margo/cs161/videos/proc.h.txt + # OpenBSD has SRUN and SONPROC: SRUN indicates that a process + # is runnable but *not* yet running, i.e. is on a run queue. + # SONPROC indicates that the process is actually executing on + # a CPU, i.e. it is no longer on a run queue. + # As such we'll map SRUN to STATUS_WAKING and SONPROC to + # STATUS_RUNNING + cext.SRUN: _common.STATUS_WAKING, + cext.SONPROC: _common.STATUS_RUNNING, + } +elif NETBSD: + PROC_STATUSES = { + cext.SIDL: _common.STATUS_IDLE, + cext.SSLEEP: _common.STATUS_SLEEPING, + cext.SSTOP: _common.STATUS_STOPPED, + cext.SZOMB: _common.STATUS_ZOMBIE, + cext.SRUN: _common.STATUS_WAKING, + cext.SONPROC: _common.STATUS_RUNNING, + } + +TCP_STATUSES = { + cext.TCPS_ESTABLISHED: _common.CONN_ESTABLISHED, + cext.TCPS_SYN_SENT: _common.CONN_SYN_SENT, + cext.TCPS_SYN_RECEIVED: _common.CONN_SYN_RECV, + cext.TCPS_FIN_WAIT_1: _common.CONN_FIN_WAIT1, + cext.TCPS_FIN_WAIT_2: _common.CONN_FIN_WAIT2, + cext.TCPS_TIME_WAIT: _common.CONN_TIME_WAIT, + cext.TCPS_CLOSED: _common.CONN_CLOSE, + cext.TCPS_CLOSE_WAIT: _common.CONN_CLOSE_WAIT, + cext.TCPS_LAST_ACK: _common.CONN_LAST_ACK, + cext.TCPS_LISTEN: _common.CONN_LISTEN, + cext.TCPS_CLOSING: _common.CONN_CLOSING, + cext.PSUTIL_CONN_NONE: _common.CONN_NONE, +} + +PAGESIZE = cext.getpagesize() +AF_LINK = cext.AF_LINK + +HAS_PROC_NUM_THREADS = hasattr(cext, "proc_num_threads") + +kinfo_proc_map = dict( + ppid=0, + status=1, + real_uid=2, + effective_uid=3, + saved_uid=4, + real_gid=5, + effective_gid=6, + saved_gid=7, + ttynr=8, + create_time=9, + ctx_switches_vol=10, + ctx_switches_unvol=11, + read_io_count=12, + write_io_count=13, + user_time=14, + sys_time=15, + ch_user_time=16, + ch_sys_time=17, + rss=18, + vms=19, + memtext=20, + memdata=21, + memstack=22, + cpunum=23, + name=24, +) + + +# ===================================================================== +# --- memory +# ===================================================================== + + +def virtual_memory(): + mem = cext.virtual_mem() + if NETBSD: + total, free, active, inactive, wired, cached = mem + # On NetBSD buffers and shared mem is determined via /proc. + # The C ext set them to 0. + with open('/proc/meminfo', 'rb') as f: + for line in f: + if line.startswith(b'Buffers:'): + buffers = int(line.split()[1]) * 1024 + elif line.startswith(b'MemShared:'): + shared = int(line.split()[1]) * 1024 + # Before avail was calculated as (inactive + cached + free), + # same as zabbix, but it turned out it could exceed total (see + # #2233), so zabbix seems to be wrong. Htop calculates it + # differently, and the used value seem more realistic, so let's + # match htop. + # https://github.com/htop-dev/htop/blob/e7f447b/netbsd/NetBSDProcessList.c#L162 + # https://github.com/zabbix/zabbix/blob/af5e0f8/src/libs/zbxsysinfo/netbsd/memory.c#L135 + used = active + wired + avail = total - used + else: + total, free, active, inactive, wired, cached, buffers, shared = mem + # matches freebsd-memory CLI: + # * https://people.freebsd.org/~rse/dist/freebsd-memory + # * https://www.cyberciti.biz/files/scripts/freebsd-memory.pl.txt + # matches zabbix: + # * https://github.com/zabbix/zabbix/blob/af5e0f8/src/libs/zbxsysinfo/freebsd/memory.c#L143 + avail = inactive + cached + free + used = active + wired + cached + + percent = usage_percent((total - avail), total, round_=1) + return ntp.svmem( + total, + avail, + percent, + used, + free, + active, + inactive, + buffers, + cached, + shared, + wired, + ) + + +def swap_memory(): + """System swap memory as (total, used, free, sin, sout) namedtuple.""" + total, used, free, sin, sout = cext.swap_mem() + percent = usage_percent(used, total, round_=1) + return ntp.sswap(total, used, free, percent, sin, sout) + + +# malloc / heap functions (FreeBSD / NetBSD) +if hasattr(cext, "heap_info"): + heap_info = cext.heap_info + heap_trim = cext.heap_trim + + +# ===================================================================== +# --- CPU +# ===================================================================== + + +def cpu_times(): + """Return system per-CPU times as a namedtuple.""" + user, nice, system, idle, irq = cext.cpu_times() + return ntp.scputimes(user, nice, system, idle, irq) + + +def per_cpu_times(): + """Return system CPU times as a namedtuple.""" + ret = [] + for cpu_t in cext.per_cpu_times(): + user, nice, system, idle, irq = cpu_t + item = ntp.scputimes(user, nice, system, idle, irq) + ret.append(item) + return ret + + +def cpu_count_logical(): + """Return the number of logical CPUs in the system.""" + return cext.cpu_count_logical() + + +if OPENBSD or NETBSD: + + def cpu_count_cores(): + # OpenBSD and NetBSD do not implement this. + return 1 if cpu_count_logical() == 1 else None + +else: + + def cpu_count_cores(): + """Return the number of CPU cores in the system.""" + # From the C module we'll get an XML string similar to this: + # http://manpages.ubuntu.com/manpages/precise/man4/smp.4freebsd.html + # We may get None in case "sysctl kern.sched.topology_spec" + # is not supported on this BSD version, in which case we'll mimic + # os.cpu_count() and return None. + ret = None + s = cext.cpu_topology() + if s is not None: + # get rid of padding chars appended at the end of the string + index = s.rfind("") + if index != -1: + s = s[: index + 9] + root = ElementTree.fromstring(s) + try: + ret = len(root.findall('group/children/group/cpu')) or None + finally: + # needed otherwise it will memleak + root.clear() + if not ret: + # If logical CPUs == 1 it's obvious we' have only 1 core. + if cpu_count_logical() == 1: + return 1 + return ret + + +def cpu_stats(): + """Return various CPU stats as a named tuple.""" + if FREEBSD: + # Note: the C ext is returning some metrics we are not exposing: + # traps. + ctxsw, intrs, soft_intrs, syscalls, _traps = cext.cpu_stats() + elif NETBSD: + # XXX + # Note about intrs: the C extension returns 0. intrs + # can be determined via /proc/stat; it has the same value as + # soft_intrs thought so the kernel is faking it (?). + # + # Note about syscalls: the C extension always sets it to 0 (?). + # + # Note: the C ext is returning some metrics we are not exposing: + # traps, faults and forks. + ctxsw, intrs, soft_intrs, syscalls, _traps, _faults, _forks = ( + cext.cpu_stats() + ) + with open('/proc/stat', 'rb') as f: + for line in f: + if line.startswith(b'intr'): + intrs = int(line.split()[1]) + elif OPENBSD: + # Note: the C ext is returning some metrics we are not exposing: + # traps, faults and forks. + ctxsw, intrs, soft_intrs, syscalls, _traps, _faults, _forks = ( + cext.cpu_stats() + ) + return ntp.scpustats(ctxsw, intrs, soft_intrs, syscalls) + + +if FREEBSD: + + def cpu_freq(): + """Return frequency metrics for CPUs. As of Dec 2018 only + CPU 0 appears to be supported by FreeBSD and all other cores + match the frequency of CPU 0. + """ + ret = [] + num_cpus = cpu_count_logical() + for cpu in range(num_cpus): + try: + current, available_freq = cext.cpu_freq(cpu) + except NotImplementedError: + continue + if available_freq: + try: + min_freq = int(available_freq.split(" ")[-1].split("/")[0]) + except (IndexError, ValueError): + min_freq = None + try: + max_freq = int(available_freq.split(" ")[0].split("/")[0]) + except (IndexError, ValueError): + max_freq = None + ret.append(ntp.scpufreq(current, min_freq, max_freq)) + return ret + +elif OPENBSD: + + def cpu_freq(): + curr = float(cext.cpu_freq()) + return [ntp.scpufreq(curr, 0.0, 0.0)] + + +# ===================================================================== +# --- disks +# ===================================================================== + + +def disk_partitions(all=False): + """Return mounted disk partitions as a list of namedtuples. + 'all' argument is ignored, see: + https://github.com/giampaolo/psutil/issues/906. + """ + retlist = [] + partitions = cext.disk_partitions() + for partition in partitions: + device, mountpoint, fstype, opts = partition + ntuple = ntp.sdiskpart(device, mountpoint, fstype, opts) + retlist.append(ntuple) + return retlist + + +disk_usage = _psposix.disk_usage +disk_io_counters = cext.disk_io_counters + + +# ===================================================================== +# --- network +# ===================================================================== + + +net_io_counters = cext.net_io_counters +net_if_addrs = cext.net_if_addrs + + +def net_if_stats(): + """Get NIC stats (isup, duplex, speed, mtu).""" + names = net_io_counters().keys() + ret = {} + for name in names: + try: + mtu = cext.net_if_mtu(name) + flags = cext.net_if_flags(name) + duplex, speed = cext.net_if_duplex_speed(name) + except OSError as err: + # https://github.com/giampaolo/psutil/issues/1279 + if err.errno != errno.ENODEV: + raise + else: + if hasattr(_common, 'NicDuplex'): + duplex = _common.NicDuplex(duplex) + output_flags = ','.join(flags) + isup = 'running' in flags + ret[name] = ntp.snicstats(isup, duplex, speed, mtu, output_flags) + return ret + + +def net_connections(kind): + """System-wide network connections.""" + families, types = conn_tmap[kind] + ret = set() + if OPENBSD: + rawlist = cext.net_connections(-1, families, types) + elif NETBSD: + rawlist = cext.net_connections(-1, kind) + else: # FreeBSD + rawlist = cext.net_connections(families, types) + + for item in rawlist: + fd, fam, type, laddr, raddr, status, pid = item + nt = conn_to_ntuple( + fd, fam, type, laddr, raddr, status, TCP_STATUSES, pid + ) + ret.add(nt) + return list(ret) + + +# ===================================================================== +# --- sensors +# ===================================================================== + + +if FREEBSD: + + def sensors_battery(): + """Return battery info.""" + try: + percent, minsleft, power_plugged = cext.sensors_battery() + except NotImplementedError: + # See: https://github.com/giampaolo/psutil/issues/1074 + return None + power_plugged = power_plugged == 1 + if power_plugged: + secsleft = _common.POWER_TIME_UNLIMITED + elif minsleft == -1: + secsleft = _common.POWER_TIME_UNKNOWN + else: + secsleft = minsleft * 60 + return ntp.sbattery(percent, secsleft, power_plugged) + + def sensors_temperatures(): + """Return CPU cores temperatures if available, else an empty dict.""" + ret = defaultdict(list) + num_cpus = cpu_count_logical() + for cpu in range(num_cpus): + try: + current, high = cext.sensors_cpu_temperature(cpu) + if high <= 0: + high = None + name = f"Core {cpu}" + ret["coretemp"].append(ntp.shwtemp(name, current, high, high)) + except NotImplementedError: + pass + + return ret + + +# ===================================================================== +# --- other system functions +# ===================================================================== + + +def boot_time(): + """The system boot time expressed in seconds since the epoch.""" + return cext.boot_time() + + +if NETBSD: + + try: + INIT_BOOT_TIME = boot_time() + except Exception as err: # noqa: BLE001 + # Don't want to crash at import time. + debug(f"ignoring exception on import: {err!r}") + INIT_BOOT_TIME = 0 + + def adjust_proc_create_time(ctime): + """Account for system clock updates.""" + if INIT_BOOT_TIME == 0: + return ctime + + diff = INIT_BOOT_TIME - boot_time() + if diff == 0 or abs(diff) < 1: + return ctime + + debug("system clock was updated; adjusting process create_time()") + if diff < 0: + return ctime - diff + return ctime + diff + + +def users(): + """Return currently connected users as a list of namedtuples.""" + retlist = [] + rawlist = cext.users() + for item in rawlist: + user, tty, hostname, tstamp, pid = item + if tty == '~': + continue # reboot or shutdown + nt = ntp.suser(user, tty or None, hostname, tstamp, pid) + retlist.append(nt) + return retlist + + +# ===================================================================== +# --- processes +# ===================================================================== + + +@memoize +def _pid_0_exists(): + try: + Process(0).name() + except NoSuchProcess: + return False + except AccessDenied: + return True + else: + return True + + +def pids(): + """Returns a list of PIDs currently running on the system.""" + ret = cext.pids() + if OPENBSD and (0 not in ret) and _pid_0_exists(): + # On OpenBSD the kernel does not return PID 0 (neither does + # ps) but it's actually querable (Process(0) will succeed). + ret.insert(0, 0) + return ret + + +if NETBSD: + + def pid_exists(pid): + exists = _psposix.pid_exists(pid) + if not exists: + # We do this because _psposix.pid_exists() lies in case of + # zombie processes. + return pid in pids() + else: + return True + +elif OPENBSD: + + def pid_exists(pid): + exists = _psposix.pid_exists(pid) + if not exists: + return False + else: + # OpenBSD seems to be the only BSD platform where + # _psposix.pid_exists() returns True for thread IDs (tids), + # so we can't use it. + return pid in pids() + +else: # FreeBSD + pid_exists = _psposix.pid_exists + + +def wrap_exceptions(fun): + """Decorator which translates bare OSError exceptions into + NoSuchProcess and AccessDenied. + """ + + @functools.wraps(fun) + def wrapper(self, *args, **kwargs): + pid, ppid, name = self.pid, self._ppid, self._name + try: + return fun(self, *args, **kwargs) + except ProcessLookupError as err: + if cext.proc_is_zombie(pid): + raise ZombieProcess(pid, name, ppid) from err + raise NoSuchProcess(pid, name) from err + except PermissionError as err: + raise AccessDenied(pid, name) from err + except cext.ZombieProcessError as err: + raise ZombieProcess(pid, name, ppid) from err + except OSError as err: + if pid == 0 and 0 in pids(): + raise AccessDenied(pid, name) from err + raise err from None + + return wrapper + + +@contextlib.contextmanager +def wrap_exceptions_procfs(inst): + """Same as above, for routines relying on reading /proc fs.""" + pid, name, ppid = inst.pid, inst._name, inst._ppid + try: + yield + except (ProcessLookupError, FileNotFoundError) as err: + # ENOENT (no such file or directory) gets raised on open(). + # ESRCH (no such process) can get raised on read() if + # process is gone in meantime. + if cext.proc_is_zombie(inst.pid): + raise ZombieProcess(pid, name, ppid) from err + else: + raise NoSuchProcess(pid, name) from err + except PermissionError as err: + raise AccessDenied(pid, name) from err + + +class Process: + """Wrapper class around underlying C implementation.""" + + __slots__ = ["_cache", "_name", "_ppid", "pid"] + + def __init__(self, pid): + self.pid = pid + self._name = None + self._ppid = None + + def _assert_alive(self): + """Raise NSP if the process disappeared on us.""" + # For those C function who do not raise NSP, possibly returning + # incorrect or incomplete result. + cext.proc_name(self.pid) + + @wrap_exceptions + @memoize_when_activated + def oneshot(self): + """Retrieves multiple process info in one shot as a raw tuple.""" + ret = cext.proc_oneshot_info(self.pid) + assert len(ret) == len(kinfo_proc_map) + return ret + + def oneshot_enter(self): + self.oneshot.cache_activate(self) + + def oneshot_exit(self): + self.oneshot.cache_deactivate(self) + + @wrap_exceptions + def name(self): + name = self.oneshot()[kinfo_proc_map['name']] + return name if name is not None else cext.proc_name(self.pid) + + @wrap_exceptions + def exe(self): + if FREEBSD: + if self.pid == 0: + return '' # else NSP + return cext.proc_exe(self.pid) + elif NETBSD: + if self.pid == 0: + # /proc/0 dir exists but /proc/0/exe doesn't + return "" + with wrap_exceptions_procfs(self): + return os.readlink(f"/proc/{self.pid}/exe") + else: + # OpenBSD: exe cannot be determined; references: + # https://chromium.googlesource.com/chromium/src/base/+/ + # master/base_paths_posix.cc + # We try our best guess by using which against the first + # cmdline arg (may return None). + import shutil + + cmdline = self.cmdline() + if cmdline: + return shutil.which(cmdline[0]) or "" + else: + return "" + + @wrap_exceptions + def cmdline(self): + if OPENBSD and self.pid == 0: + return [] # ...else it crashes + elif NETBSD: + # XXX - most of the times the underlying sysctl() call on + # NetBSD and OpenBSD returns a truncated string. Also + # /proc/pid/cmdline behaves the same so it looks like this + # is a kernel bug. + try: + return cext.proc_cmdline(self.pid) + except OSError as err: + if err.errno == errno.EINVAL: + pid, name, ppid = self.pid, self._name, self._ppid + if cext.proc_is_zombie(self.pid): + raise ZombieProcess(pid, name, ppid) from err + if not pid_exists(self.pid): + raise NoSuchProcess(pid, name, ppid) from err + # XXX: this happens with unicode tests. It means the C + # routine is unable to decode invalid unicode chars. + debug(f"ignoring {err!r} and returning an empty list") + return [] + else: + raise + else: + return cext.proc_cmdline(self.pid) + + @wrap_exceptions + def environ(self): + return cext.proc_environ(self.pid) + + @wrap_exceptions + def terminal(self): + tty_nr = self.oneshot()[kinfo_proc_map['ttynr']] + tmap = _psposix.get_terminal_map() + try: + return tmap[tty_nr] + except KeyError: + return None + + @wrap_exceptions + def ppid(self): + self._ppid = self.oneshot()[kinfo_proc_map['ppid']] + return self._ppid + + @wrap_exceptions + def uids(self): + rawtuple = self.oneshot() + return ntp.puids( + rawtuple[kinfo_proc_map['real_uid']], + rawtuple[kinfo_proc_map['effective_uid']], + rawtuple[kinfo_proc_map['saved_uid']], + ) + + @wrap_exceptions + def gids(self): + rawtuple = self.oneshot() + return ntp.pgids( + rawtuple[kinfo_proc_map['real_gid']], + rawtuple[kinfo_proc_map['effective_gid']], + rawtuple[kinfo_proc_map['saved_gid']], + ) + + @wrap_exceptions + def cpu_times(self): + rawtuple = self.oneshot() + return ntp.pcputimes( + rawtuple[kinfo_proc_map['user_time']], + rawtuple[kinfo_proc_map['sys_time']], + rawtuple[kinfo_proc_map['ch_user_time']], + rawtuple[kinfo_proc_map['ch_sys_time']], + ) + + if FREEBSD: + + @wrap_exceptions + def cpu_num(self): + return self.oneshot()[kinfo_proc_map['cpunum']] + + @wrap_exceptions + def memory_info(self): + rawtuple = self.oneshot() + return ntp.pmem( + rawtuple[kinfo_proc_map['rss']], + rawtuple[kinfo_proc_map['vms']], + rawtuple[kinfo_proc_map['memtext']], + rawtuple[kinfo_proc_map['memdata']], + rawtuple[kinfo_proc_map['memstack']], + ) + + memory_full_info = memory_info + + @wrap_exceptions + def create_time(self, monotonic=False): + ctime = self.oneshot()[kinfo_proc_map['create_time']] + if NETBSD and not monotonic: + # NetBSD: ctime subject to system clock updates. + ctime = adjust_proc_create_time(ctime) + return ctime + + @wrap_exceptions + def num_threads(self): + if HAS_PROC_NUM_THREADS: + # FreeBSD / NetBSD + return cext.proc_num_threads(self.pid) + else: + return len(self.threads()) + + @wrap_exceptions + def num_ctx_switches(self): + rawtuple = self.oneshot() + return ntp.pctxsw( + rawtuple[kinfo_proc_map['ctx_switches_vol']], + rawtuple[kinfo_proc_map['ctx_switches_unvol']], + ) + + @wrap_exceptions + def threads(self): + # Note: on OpenSBD this (/dev/mem) requires root access. + rawlist = cext.proc_threads(self.pid) + retlist = [] + for thread_id, utime, stime in rawlist: + ntuple = ntp.pthread(thread_id, utime, stime) + retlist.append(ntuple) + if OPENBSD: + self._assert_alive() + return retlist + + @wrap_exceptions + def net_connections(self, kind='inet'): + families, types = conn_tmap[kind] + ret = [] + + if NETBSD: + rawlist = cext.net_connections(self.pid, kind) + elif OPENBSD: + rawlist = cext.net_connections(self.pid, families, types) + else: + rawlist = cext.proc_net_connections(self.pid, families, types) + + for item in rawlist: + fd, fam, type, laddr, raddr, status = item[:6] + if FREEBSD: + if (fam not in families) or (type not in types): + continue + nt = conn_to_ntuple( + fd, fam, type, laddr, raddr, status, TCP_STATUSES + ) + ret.append(nt) + + self._assert_alive() + return ret + + @wrap_exceptions + def wait(self, timeout=None): + return _psposix.wait_pid(self.pid, timeout) + + @wrap_exceptions + def nice_get(self): + return cext.proc_priority_get(self.pid) + + @wrap_exceptions + def nice_set(self, value): + return cext.proc_priority_set(self.pid, value) + + @wrap_exceptions + def status(self): + code = self.oneshot()[kinfo_proc_map['status']] + # XXX is '?' legit? (we're not supposed to return it anyway) + return PROC_STATUSES.get(code, '?') + + @wrap_exceptions + def io_counters(self): + rawtuple = self.oneshot() + return ntp.pio( + rawtuple[kinfo_proc_map['read_io_count']], + rawtuple[kinfo_proc_map['write_io_count']], + -1, + -1, + ) + + @wrap_exceptions + def cwd(self): + """Return process current working directory.""" + # sometimes we get an empty string, in which case we turn + # it into None + if OPENBSD and self.pid == 0: + return "" # ...else it would raise EINVAL + return cext.proc_cwd(self.pid) + + nt_mmap_grouped = namedtuple( + 'mmap', 'path rss, private, ref_count, shadow_count' + ) + nt_mmap_ext = namedtuple( + 'mmap', 'addr, perms path rss, private, ref_count, shadow_count' + ) + + @wrap_exceptions + def open_files(self): + """Return files opened by process as a list of namedtuples.""" + rawlist = cext.proc_open_files(self.pid) + return [ntp.popenfile(path, fd) for path, fd in rawlist] + + @wrap_exceptions + def num_fds(self): + """Return the number of file descriptors opened by this process.""" + ret = cext.proc_num_fds(self.pid) + if NETBSD: + self._assert_alive() + return ret + + # --- FreeBSD only APIs + + if FREEBSD: + + @wrap_exceptions + def cpu_affinity_get(self): + return cext.proc_cpu_affinity_get(self.pid) + + @wrap_exceptions + def cpu_affinity_set(self, cpus): + # Pre-emptively check if CPUs are valid because the C + # function has a weird behavior in case of invalid CPUs, + # see: https://github.com/giampaolo/psutil/issues/586 + allcpus = set(range(len(per_cpu_times()))) + for cpu in cpus: + if cpu not in allcpus: + msg = f"invalid CPU {cpu!r} (choose between {allcpus})" + raise ValueError(msg) + try: + cext.proc_cpu_affinity_set(self.pid, cpus) + except OSError as err: + # 'man cpuset_setaffinity' about EDEADLK: + # <> + if err.errno in {errno.EINVAL, errno.EDEADLK}: + for cpu in cpus: + if cpu not in allcpus: + msg = ( + f"invalid CPU {cpu!r} (choose between" + f" {allcpus})" + ) + raise ValueError(msg) from err + raise + + @wrap_exceptions + def memory_maps(self): + return cext.proc_memory_maps(self.pid) + + @wrap_exceptions + def rlimit(self, resource, limits=None): + if limits is None: + return cext.proc_getrlimit(self.pid, resource) + else: + if len(limits) != 2: + msg = ( + "second argument must be a (soft, hard) tuple, got" + f" {limits!r}" + ) + raise ValueError(msg) + soft, hard = limits + return cext.proc_setrlimit(self.pid, resource, soft, hard) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_pslinux.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_pslinux.py new file mode 100644 index 0000000000000000000000000000000000000000..dc305b59559e9b97f96eacf2a2002d2b02e3fe41 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_pslinux.py @@ -0,0 +1,2269 @@ +# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Linux platform implementation.""" + +import base64 +import collections +import enum +import errno +import functools +import glob +import os +import re +import resource +import socket +import struct +import sys +import warnings +from collections import defaultdict +from collections import namedtuple + +from . import _common +from . import _ntuples as ntp +from . import _psposix +from . import _psutil_linux as cext +from ._common import ENCODING +from ._common import NIC_DUPLEX_FULL +from ._common import NIC_DUPLEX_HALF +from ._common import NIC_DUPLEX_UNKNOWN +from ._common import AccessDenied +from ._common import NoSuchProcess +from ._common import ZombieProcess +from ._common import bcat +from ._common import cat +from ._common import debug +from ._common import decode +from ._common import get_procfs_path +from ._common import isfile_strict +from ._common import memoize +from ._common import memoize_when_activated +from ._common import open_binary +from ._common import open_text +from ._common import parse_environ_block +from ._common import path_exists_strict +from ._common import supports_ipv6 +from ._common import usage_percent + +# fmt: off +__extra__all__ = [ + 'PROCFS_PATH', + # io prio constants + "IOPRIO_CLASS_NONE", "IOPRIO_CLASS_RT", "IOPRIO_CLASS_BE", + "IOPRIO_CLASS_IDLE", + # connection status constants + "CONN_ESTABLISHED", "CONN_SYN_SENT", "CONN_SYN_RECV", "CONN_FIN_WAIT1", + "CONN_FIN_WAIT2", "CONN_TIME_WAIT", "CONN_CLOSE", "CONN_CLOSE_WAIT", + "CONN_LAST_ACK", "CONN_LISTEN", "CONN_CLOSING", +] +# fmt: on + + +# ===================================================================== +# --- globals +# ===================================================================== + + +POWER_SUPPLY_PATH = "/sys/class/power_supply" +HAS_PROC_SMAPS = os.path.exists(f"/proc/{os.getpid()}/smaps") +HAS_PROC_SMAPS_ROLLUP = os.path.exists(f"/proc/{os.getpid()}/smaps_rollup") +HAS_PROC_IO_PRIORITY = hasattr(cext, "proc_ioprio_get") +HAS_CPU_AFFINITY = hasattr(cext, "proc_cpu_affinity_get") + +# Number of clock ticks per second +CLOCK_TICKS = os.sysconf("SC_CLK_TCK") +PAGESIZE = cext.getpagesize() +LITTLE_ENDIAN = sys.byteorder == 'little' +UNSET = object() + +# "man iostat" states that sectors are equivalent with blocks and have +# a size of 512 bytes. Despite this value can be queried at runtime +# via /sys/block/{DISK}/queue/hw_sector_size and results may vary +# between 1k, 2k, or 4k... 512 appears to be a magic constant used +# throughout Linux source code: +# * https://stackoverflow.com/a/38136179/376587 +# * https://lists.gt.net/linux/kernel/2241060 +# * https://github.com/giampaolo/psutil/issues/1305 +# * https://github.com/torvalds/linux/blob/ +# 4f671fe2f9523a1ea206f63fe60a7c7b3a56d5c7/include/linux/bio.h#L99 +# * https://lkml.org/lkml/2015/8/17/234 +DISK_SECTOR_SIZE = 512 + +AddressFamily = enum.IntEnum( + 'AddressFamily', {'AF_LINK': int(socket.AF_PACKET)} +) +AF_LINK = AddressFamily.AF_LINK + + +# ioprio_* constants http://linux.die.net/man/2/ioprio_get +class IOPriority(enum.IntEnum): + IOPRIO_CLASS_NONE = 0 + IOPRIO_CLASS_RT = 1 + IOPRIO_CLASS_BE = 2 + IOPRIO_CLASS_IDLE = 3 + + +globals().update(IOPriority.__members__) + +# See: +# https://github.com/torvalds/linux/blame/master/fs/proc/array.c +# ...and (TASK_* constants): +# https://github.com/torvalds/linux/blob/master/include/linux/sched.h +PROC_STATUSES = { + "R": _common.STATUS_RUNNING, + "S": _common.STATUS_SLEEPING, + "D": _common.STATUS_DISK_SLEEP, + "T": _common.STATUS_STOPPED, + "t": _common.STATUS_TRACING_STOP, + "Z": _common.STATUS_ZOMBIE, + "X": _common.STATUS_DEAD, + "x": _common.STATUS_DEAD, + "K": _common.STATUS_WAKE_KILL, + "W": _common.STATUS_WAKING, + "I": _common.STATUS_IDLE, + "P": _common.STATUS_PARKED, +} + +# https://github.com/torvalds/linux/blob/master/include/net/tcp_states.h +TCP_STATUSES = { + "01": _common.CONN_ESTABLISHED, + "02": _common.CONN_SYN_SENT, + "03": _common.CONN_SYN_RECV, + "04": _common.CONN_FIN_WAIT1, + "05": _common.CONN_FIN_WAIT2, + "06": _common.CONN_TIME_WAIT, + "07": _common.CONN_CLOSE, + "08": _common.CONN_CLOSE_WAIT, + "09": _common.CONN_LAST_ACK, + "0A": _common.CONN_LISTEN, + "0B": _common.CONN_CLOSING, +} + + +# ===================================================================== +# --- utils +# ===================================================================== + + +def readlink(path): + """Wrapper around os.readlink().""" + assert isinstance(path, str), path + path = os.readlink(path) + # readlink() might return paths containing null bytes ('\x00') + # resulting in "TypeError: must be encoded string without NULL + # bytes, not str" errors when the string is passed to other + # fs-related functions (os.*, open(), ...). + # Apparently everything after '\x00' is garbage (we can have + # ' (deleted)', 'new' and possibly others), see: + # https://github.com/giampaolo/psutil/issues/717 + path = path.split('\x00')[0] + # Certain paths have ' (deleted)' appended. Usually this is + # bogus as the file actually exists. Even if it doesn't we + # don't care. + if path.endswith(' (deleted)') and not path_exists_strict(path): + path = path[:-10] + return path + + +def file_flags_to_mode(flags): + """Convert file's open() flags into a readable string. + Used by Process.open_files(). + """ + modes_map = {os.O_RDONLY: 'r', os.O_WRONLY: 'w', os.O_RDWR: 'w+'} + mode = modes_map[flags & (os.O_RDONLY | os.O_WRONLY | os.O_RDWR)] + if flags & os.O_APPEND: + mode = mode.replace('w', 'a', 1) + mode = mode.replace('w+', 'r+') + # possible values: r, w, a, r+, a+ + return mode + + +def is_storage_device(name): + """Return True if the given name refers to a root device (e.g. + "sda", "nvme0n1") as opposed to a logical partition (e.g. "sda1", + "nvme0n1p1"). If name is a virtual device (e.g. "loop1", "ram") + return True. + """ + # Re-adapted from iostat source code, see: + # https://github.com/sysstat/sysstat/blob/ + # 97912938cd476645b267280069e83b1c8dc0e1c7/common.c#L208 + # Some devices may have a slash in their name (e.g. cciss/c0d0...). + name = name.replace('/', '!') + including_virtual = True + if including_virtual: + path = f"/sys/block/{name}" + else: + path = f"/sys/block/{name}/device" + return os.access(path, os.F_OK) + + +@memoize +def _scputimes_ntuple(procfs_path): + """Return a namedtuple of variable fields depending on the CPU times + available on this Linux kernel version which may be: + (user, nice, system, idle, iowait, irq, softirq, [steal, [guest, + [guest_nice]]]) + Used by cpu_times() function. + """ + with open_binary(f"{procfs_path}/stat") as f: + values = f.readline().split()[1:] + fields = ['user', 'nice', 'system', 'idle', 'iowait', 'irq', 'softirq'] + vlen = len(values) + if vlen >= 8: + # Linux >= 2.6.11 + fields.append('steal') + if vlen >= 9: + # Linux >= 2.6.24 + fields.append('guest') + if vlen >= 10: + # Linux >= 3.2.0 + fields.append('guest_nice') + return namedtuple('scputimes', fields) + + +# Set it into _ntuples.py namespace. +try: + ntp.scputimes = _scputimes_ntuple("/proc") +except Exception as err: # noqa: BLE001 + # Don't want to crash at import time. + debug(f"ignoring exception on import: {err!r}") + ntp.scputimes = namedtuple('scputimes', 'user system idle')(0.0, 0.0, 0.0) + +# XXX: must be available also at this module level in order to be +# serialized (tests/test_misc.py::TestMisc::test_serialization). +scputimes = ntp.scputimes + + +# ===================================================================== +# --- system memory +# ===================================================================== + + +def calculate_avail_vmem(mems): + """Fallback for kernels < 3.14 where /proc/meminfo does not provide + "MemAvailable", see: + https://blog.famzah.net/2014/09/24/. + + This code reimplements the algorithm outlined here: + https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/ + commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773 + + We use this function also when "MemAvailable" returns 0 (possibly a + kernel bug, see: https://github.com/giampaolo/psutil/issues/1915). + In that case this routine matches "free" CLI tool result ("available" + column). + + XXX: on recent kernels this calculation may differ by ~1.5% compared + to "MemAvailable:", as it's calculated slightly differently. + It is still way more realistic than doing (free + cached) though. + See: + * https://gitlab.com/procps-ng/procps/issues/42 + * https://github.com/famzah/linux-memavailable-procfs/issues/2 + """ + # Note about "fallback" value. According to: + # https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/ + # commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773 + # ...long ago "available" memory was calculated as (free + cached), + # We use fallback when one of these is missing from /proc/meminfo: + # "Active(file)": introduced in 2.6.28 / Dec 2008 + # "Inactive(file)": introduced in 2.6.28 / Dec 2008 + # "SReclaimable": introduced in 2.6.19 / Nov 2006 + # /proc/zoneinfo: introduced in 2.6.13 / Aug 2005 + free = mems[b'MemFree:'] + fallback = free + mems.get(b"Cached:", 0) + try: + lru_active_file = mems[b'Active(file):'] + lru_inactive_file = mems[b'Inactive(file):'] + slab_reclaimable = mems[b'SReclaimable:'] + except KeyError as err: + debug( + f"{err.args[0]} is missing from /proc/meminfo; using an" + " approximation for calculating available memory" + ) + return fallback + try: + f = open_binary(f"{get_procfs_path()}/zoneinfo") + except OSError: + return fallback # kernel 2.6.13 + + watermark_low = 0 + with f: + for line in f: + line = line.strip() + if line.startswith(b'low'): + watermark_low += int(line.split()[1]) + watermark_low *= PAGESIZE + + avail = free - watermark_low + pagecache = lru_active_file + lru_inactive_file + pagecache -= min(pagecache / 2, watermark_low) + avail += pagecache + avail += slab_reclaimable - min(slab_reclaimable / 2.0, watermark_low) + return int(avail) + + +def virtual_memory(): + """Report virtual memory stats. + This implementation mimics procps-ng-3.3.12, aka "free" CLI tool: + https://gitlab.com/procps-ng/procps/blob/ + 24fd2605c51fccc375ab0287cec33aa767f06718/proc/sysinfo.c#L778-791 + The returned values are supposed to match both "free" and "vmstat -s" + CLI tools. + """ + missing_fields = [] + mems = {} + with open_binary(f"{get_procfs_path()}/meminfo") as f: + for line in f: + fields = line.split() + mems[fields[0]] = int(fields[1]) * 1024 + + # /proc doc states that the available fields in /proc/meminfo vary + # by architecture and compile options, but these 3 values are also + # returned by sysinfo(2); as such we assume they are always there. + total = mems[b'MemTotal:'] + free = mems[b'MemFree:'] + try: + buffers = mems[b'Buffers:'] + except KeyError: + # https://github.com/giampaolo/psutil/issues/1010 + buffers = 0 + missing_fields.append('buffers') + try: + cached = mems[b"Cached:"] + except KeyError: + cached = 0 + missing_fields.append('cached') + else: + # "free" cmdline utility sums reclaimable to cached. + # Older versions of procps used to add slab memory instead. + # This got changed in: + # https://gitlab.com/procps-ng/procps/commit/ + # 05d751c4f076a2f0118b914c5e51cfbb4762ad8e + cached += mems.get(b"SReclaimable:", 0) # since kernel 2.6.19 + + try: + shared = mems[b'Shmem:'] # since kernel 2.6.32 + except KeyError: + try: + shared = mems[b'MemShared:'] # kernels 2.4 + except KeyError: + shared = 0 + missing_fields.append('shared') + + try: + active = mems[b"Active:"] + except KeyError: + active = 0 + missing_fields.append('active') + + try: + inactive = mems[b"Inactive:"] + except KeyError: + try: + inactive = ( + mems[b"Inact_dirty:"] + + mems[b"Inact_clean:"] + + mems[b"Inact_laundry:"] + ) + except KeyError: + inactive = 0 + missing_fields.append('inactive') + + try: + slab = mems[b"Slab:"] + except KeyError: + slab = 0 + + # - starting from 4.4.0 we match free's "available" column. + # Before 4.4.0 we calculated it as (free + buffers + cached) + # which matched htop. + # - free and htop available memory differs as per: + # http://askubuntu.com/a/369589 + # http://unix.stackexchange.com/a/65852/168884 + # - MemAvailable has been introduced in kernel 3.14 + try: + avail = mems[b'MemAvailable:'] + except KeyError: + avail = calculate_avail_vmem(mems) + else: + if avail == 0: + # Yes, it can happen (probably a kernel bug): + # https://github.com/giampaolo/psutil/issues/1915 + # In this case "free" CLI tool makes an estimate. We do the same, + # and it matches "free" CLI tool. + avail = calculate_avail_vmem(mems) + + if avail < 0: + avail = 0 + missing_fields.append('available') + elif avail > total: + # If avail is greater than total or our calculation overflows, + # that's symptomatic of running within a LCX container where such + # values will be dramatically distorted over those of the host. + # https://gitlab.com/procps-ng/procps/blob/ + # 24fd2605c51fccc375ab0287cec33aa767f06718/proc/sysinfo.c#L764 + avail = free + + used = total - avail + + percent = usage_percent((total - avail), total, round_=1) + + # Warn about missing metrics which are set to 0. + if missing_fields: + msg = "{} memory stats couldn't be determined and {} set to 0".format( + ", ".join(missing_fields), + "was" if len(missing_fields) == 1 else "were", + ) + warnings.warn(msg, RuntimeWarning, stacklevel=2) + + return ntp.svmem( + total, + avail, + percent, + used, + free, + active, + inactive, + buffers, + cached, + shared, + slab, + ) + + +def swap_memory(): + """Return swap memory metrics.""" + mems = {} + with open_binary(f"{get_procfs_path()}/meminfo") as f: + for line in f: + fields = line.split() + mems[fields[0]] = int(fields[1]) * 1024 + # We prefer /proc/meminfo over sysinfo() syscall so that + # psutil.PROCFS_PATH can be used in order to allow retrieval + # for linux containers, see: + # https://github.com/giampaolo/psutil/issues/1015 + try: + total = mems[b'SwapTotal:'] + free = mems[b'SwapFree:'] + except KeyError: + _, _, _, _, total, free, unit_multiplier = cext.linux_sysinfo() + total *= unit_multiplier + free *= unit_multiplier + + used = total - free + percent = usage_percent(used, total, round_=1) + # get pgin/pgouts + try: + f = open_binary(f"{get_procfs_path()}/vmstat") + except OSError as err: + # see https://github.com/giampaolo/psutil/issues/722 + msg = ( + "'sin' and 'sout' swap memory stats couldn't " + f"be determined and were set to 0 ({err})" + ) + warnings.warn(msg, RuntimeWarning, stacklevel=2) + sin = sout = 0 + else: + with f: + sin = sout = None + for line in f: + # values are expressed in 4 kilo bytes, we want + # bytes instead + if line.startswith(b'pswpin'): + sin = int(line.split(b' ')[1]) * 4 * 1024 + elif line.startswith(b'pswpout'): + sout = int(line.split(b' ')[1]) * 4 * 1024 + if sin is not None and sout is not None: + break + else: + # we might get here when dealing with exotic Linux + # flavors, see: + # https://github.com/giampaolo/psutil/issues/313 + msg = "'sin' and 'sout' swap memory stats couldn't " + msg += "be determined and were set to 0" + warnings.warn(msg, RuntimeWarning, stacklevel=2) + sin = sout = 0 + return ntp.sswap(total, used, free, percent, sin, sout) + + +# malloc / heap functions; require glibc +if hasattr(cext, "heap_info"): + heap_info = cext.heap_info + heap_trim = cext.heap_trim + + +# ===================================================================== +# --- CPU +# ===================================================================== + + +def cpu_times(): + """Return a named tuple representing the following system-wide + CPU times: + (user, nice, system, idle, iowait, irq, softirq [steal, [guest, + [guest_nice]]]) + Last 3 fields may not be available on all Linux kernel versions. + """ + procfs_path = get_procfs_path() + with open_binary(f"{procfs_path}/stat") as f: + values = f.readline().split() + fields = values[1 : len(ntp.scputimes._fields) + 1] + fields = [float(x) / CLOCK_TICKS for x in fields] + return ntp.scputimes(*fields) + + +def per_cpu_times(): + """Return a list of namedtuple representing the CPU times + for every CPU available on the system. + """ + procfs_path = get_procfs_path() + cpus = [] + with open_binary(f"{procfs_path}/stat") as f: + # get rid of the first line which refers to system wide CPU stats + f.readline() + for line in f: + if line.startswith(b'cpu'): + values = line.split() + fields = values[1 : len(ntp.scputimes._fields) + 1] + fields = [float(x) / CLOCK_TICKS for x in fields] + entry = ntp.scputimes(*fields) + cpus.append(entry) + return cpus + + +def cpu_count_logical(): + """Return the number of logical CPUs in the system.""" + try: + return os.sysconf("SC_NPROCESSORS_ONLN") + except ValueError: + # as a second fallback we try to parse /proc/cpuinfo + num = 0 + with open_binary(f"{get_procfs_path()}/cpuinfo") as f: + for line in f: + if line.lower().startswith(b'processor'): + num += 1 + + # unknown format (e.g. amrel/sparc architectures), see: + # https://github.com/giampaolo/psutil/issues/200 + # try to parse /proc/stat as a last resort + if num == 0: + search = re.compile(r'cpu\d') + with open_text(f"{get_procfs_path()}/stat") as f: + for line in f: + line = line.split(' ')[0] + if search.match(line): + num += 1 + + if num == 0: + # mimic os.cpu_count() + return None + return num + + +def cpu_count_cores(): + """Return the number of CPU cores in the system.""" + # Method #1 + ls = set() + # These 2 files are the same but */core_cpus_list is newer while + # */thread_siblings_list is deprecated and may disappear in the future. + # https://www.kernel.org/doc/Documentation/admin-guide/cputopology.rst + # https://github.com/giampaolo/psutil/pull/1727#issuecomment-707624964 + # https://lkml.org/lkml/2019/2/26/41 + p1 = "/sys/devices/system/cpu/cpu[0-9]*/topology/core_cpus_list" + p2 = "/sys/devices/system/cpu/cpu[0-9]*/topology/thread_siblings_list" + for path in glob.glob(p1) or glob.glob(p2): + with open_binary(path) as f: + ls.add(f.read().strip()) + result = len(ls) + if result != 0: + return result + + # Method #2 + mapping = {} + current_info = {} + with open_binary(f"{get_procfs_path()}/cpuinfo") as f: + for line in f: + line = line.strip().lower() + if not line: + # new section + try: + mapping[current_info[b'physical id']] = current_info[ + b'cpu cores' + ] + except KeyError: + pass + current_info = {} + elif line.startswith((b'physical id', b'cpu cores')): + # ongoing section + key, value = line.split(b'\t:', 1) + current_info[key] = int(value) + + result = sum(mapping.values()) + return result or None # mimic os.cpu_count() + + +def cpu_stats(): + """Return various CPU stats as a named tuple.""" + with open_binary(f"{get_procfs_path()}/stat") as f: + ctx_switches = None + interrupts = None + soft_interrupts = None + for line in f: + if line.startswith(b'ctxt'): + ctx_switches = int(line.split()[1]) + elif line.startswith(b'intr'): + interrupts = int(line.split()[1]) + elif line.startswith(b'softirq'): + soft_interrupts = int(line.split()[1]) + if ( + ctx_switches is not None + and soft_interrupts is not None + and interrupts is not None + ): + break + syscalls = 0 + return ntp.scpustats(ctx_switches, interrupts, soft_interrupts, syscalls) + + +def _cpu_get_cpuinfo_freq(): + """Return current CPU frequency from cpuinfo if available.""" + with open_binary(f"{get_procfs_path()}/cpuinfo") as f: + return [ + float(line.split(b':', 1)[1]) + for line in f + if line.lower().startswith(b'cpu mhz') + ] + + +if os.path.exists("/sys/devices/system/cpu/cpufreq/policy0") or os.path.exists( + "/sys/devices/system/cpu/cpu0/cpufreq" +): + + def cpu_freq(): + """Return frequency metrics for all CPUs. + Contrarily to other OSes, Linux updates these values in + real-time. + """ + cpuinfo_freqs = _cpu_get_cpuinfo_freq() + paths = glob.glob( + "/sys/devices/system/cpu/cpufreq/policy[0-9]*" + ) or glob.glob("/sys/devices/system/cpu/cpu[0-9]*/cpufreq") + paths.sort(key=lambda x: int(re.search(r"[0-9]+", x).group())) + ret = [] + pjoin = os.path.join + for i, path in enumerate(paths): + if len(paths) == len(cpuinfo_freqs): + # take cached value from cpuinfo if available, see: + # https://github.com/giampaolo/psutil/issues/1851 + curr = cpuinfo_freqs[i] * 1000 + else: + curr = bcat(pjoin(path, "scaling_cur_freq"), fallback=None) + if curr is None: + # Likely an old RedHat, see: + # https://github.com/giampaolo/psutil/issues/1071 + curr = bcat(pjoin(path, "cpuinfo_cur_freq"), fallback=None) + if curr is None: + online_path = f"/sys/devices/system/cpu/cpu{i}/online" + # if cpu core is offline, set to all zeroes + if cat(online_path, fallback=None) == "0\n": + ret.append(ntp.scpufreq(0.0, 0.0, 0.0)) + continue + msg = "can't find current frequency file" + raise NotImplementedError(msg) + curr = int(curr) / 1000 + max_ = int(bcat(pjoin(path, "scaling_max_freq"))) / 1000 + min_ = int(bcat(pjoin(path, "scaling_min_freq"))) / 1000 + ret.append(ntp.scpufreq(curr, min_, max_)) + return ret + +else: + + def cpu_freq(): + """Alternate implementation using /proc/cpuinfo. + min and max frequencies are not available and are set to None. + """ + return [ntp.scpufreq(x, 0.0, 0.0) for x in _cpu_get_cpuinfo_freq()] + + +# ===================================================================== +# --- network +# ===================================================================== + + +net_if_addrs = cext.net_if_addrs + + +class _Ipv6UnsupportedError(Exception): + pass + + +class NetConnections: + """A wrapper on top of /proc/net/* files, retrieving per-process + and system-wide open connections (TCP, UDP, UNIX) similarly to + "netstat -an". + + Note: in case of UNIX sockets we're only able to determine the + local endpoint/path, not the one it's connected to. + According to [1] it would be possible but not easily. + + [1] http://serverfault.com/a/417946 + """ + + def __init__(self): + # The string represents the basename of the corresponding + # /proc/net/{proto_name} file. + tcp4 = ("tcp", socket.AF_INET, socket.SOCK_STREAM) + tcp6 = ("tcp6", socket.AF_INET6, socket.SOCK_STREAM) + udp4 = ("udp", socket.AF_INET, socket.SOCK_DGRAM) + udp6 = ("udp6", socket.AF_INET6, socket.SOCK_DGRAM) + unix = ("unix", socket.AF_UNIX, None) + self.tmap = { + "all": (tcp4, tcp6, udp4, udp6, unix), + "tcp": (tcp4, tcp6), + "tcp4": (tcp4,), + "tcp6": (tcp6,), + "udp": (udp4, udp6), + "udp4": (udp4,), + "udp6": (udp6,), + "unix": (unix,), + "inet": (tcp4, tcp6, udp4, udp6), + "inet4": (tcp4, udp4), + "inet6": (tcp6, udp6), + } + self._procfs_path = None + + def get_proc_inodes(self, pid): + inodes = defaultdict(list) + for fd in os.listdir(f"{self._procfs_path}/{pid}/fd"): + try: + inode = readlink(f"{self._procfs_path}/{pid}/fd/{fd}") + except (FileNotFoundError, ProcessLookupError): + # ENOENT == file which is gone in the meantime; + # os.stat(f"/proc/{self.pid}") will be done later + # to force NSP (if it's the case) + continue + except OSError as err: + if err.errno == errno.EINVAL: + # not a link + continue + if err.errno == errno.ENAMETOOLONG: + # file name too long + debug(err) + continue + raise + else: + if inode.startswith('socket:['): + # the process is using a socket + inode = inode[8:][:-1] + inodes[inode].append((pid, int(fd))) + return inodes + + def get_all_inodes(self): + inodes = {} + for pid in pids(): + try: + inodes.update(self.get_proc_inodes(pid)) + except (FileNotFoundError, ProcessLookupError, PermissionError): + # os.listdir() is gonna raise a lot of access denied + # exceptions in case of unprivileged user; that's fine + # as we'll just end up returning a connection with PID + # and fd set to None anyway. + # Both netstat -an and lsof does the same so it's + # unlikely we can do any better. + # ENOENT just means a PID disappeared on us. + continue + return inodes + + @staticmethod + def decode_address(addr, family): + """Accept an "ip:port" address as displayed in /proc/net/* + and convert it into a human readable form, like: + + "0500000A:0016" -> ("10.0.0.5", 22) + "0000000000000000FFFF00000100007F:9E49" -> ("::ffff:127.0.0.1", 40521) + + The IP address portion is a little or big endian four-byte + hexadecimal number; that is, the least significant byte is listed + first, so we need to reverse the order of the bytes to convert it + to an IP address. + The port is represented as a two-byte hexadecimal number. + + Reference: + http://linuxdevcenter.com/pub/a/linux/2000/11/16/LinuxAdmin.html + """ + ip, port = addr.split(':') + port = int(port, 16) + # this usually refers to a local socket in listen mode with + # no end-points connected + if not port: + return () + ip = ip.encode('ascii') + if family == socket.AF_INET: + # see: https://github.com/giampaolo/psutil/issues/201 + if LITTLE_ENDIAN: + ip = socket.inet_ntop(family, base64.b16decode(ip)[::-1]) + else: + ip = socket.inet_ntop(family, base64.b16decode(ip)) + else: # IPv6 + ip = base64.b16decode(ip) + try: + # see: https://github.com/giampaolo/psutil/issues/201 + if LITTLE_ENDIAN: + ip = socket.inet_ntop( + socket.AF_INET6, + struct.pack('>4I', *struct.unpack('<4I', ip)), + ) + else: + ip = socket.inet_ntop( + socket.AF_INET6, + struct.pack('<4I', *struct.unpack('<4I', ip)), + ) + except ValueError: + # see: https://github.com/giampaolo/psutil/issues/623 + if not supports_ipv6(): + raise _Ipv6UnsupportedError from None + raise + return ntp.addr(ip, port) + + @staticmethod + def process_inet(file, family, type_, inodes, filter_pid=None): + """Parse /proc/net/tcp* and /proc/net/udp* files.""" + if file.endswith('6') and not os.path.exists(file): + # IPv6 not supported + return + with open_text(file) as f: + f.readline() # skip the first line + for lineno, line in enumerate(f, 1): + try: + _, laddr, raddr, status, _, _, _, _, _, inode = ( + line.split()[:10] + ) + except ValueError: + msg = ( + f"error while parsing {file}; malformed line" + f" {lineno} {line!r}" + ) + raise RuntimeError(msg) from None + if inode in inodes: + # # We assume inet sockets are unique, so we error + # # out if there are multiple references to the + # # same inode. We won't do this for UNIX sockets. + # if len(inodes[inode]) > 1 and family != socket.AF_UNIX: + # raise ValueError("ambiguous inode with multiple " + # "PIDs references") + pid, fd = inodes[inode][0] + else: + pid, fd = None, -1 + if filter_pid is not None and filter_pid != pid: + continue + else: + if type_ == socket.SOCK_STREAM: + status = TCP_STATUSES[status] + else: + status = _common.CONN_NONE + try: + laddr = NetConnections.decode_address(laddr, family) + raddr = NetConnections.decode_address(raddr, family) + except _Ipv6UnsupportedError: + continue + yield (fd, family, type_, laddr, raddr, status, pid) + + @staticmethod + def process_unix(file, family, inodes, filter_pid=None): + """Parse /proc/net/unix files.""" + with open_text(file) as f: + f.readline() # skip the first line + for line in f: + tokens = line.split() + try: + _, _, _, _, type_, _, inode = tokens[0:7] + except ValueError: + if ' ' not in line: + # see: https://github.com/giampaolo/psutil/issues/766 + continue + msg = ( + f"error while parsing {file}; malformed line {line!r}" + ) + raise RuntimeError(msg) # noqa: B904 + if inode in inodes: # noqa: SIM108 + # With UNIX sockets we can have a single inode + # referencing many file descriptors. + pairs = inodes[inode] + else: + pairs = [(None, -1)] + for pid, fd in pairs: + if filter_pid is not None and filter_pid != pid: + continue + else: + path = tokens[-1] if len(tokens) == 8 else '' + type_ = _common.socktype_to_enum(int(type_)) + # XXX: determining the remote endpoint of a + # UNIX socket on Linux is not possible, see: + # https://serverfault.com/questions/252723/ + raddr = "" + status = _common.CONN_NONE + yield (fd, family, type_, path, raddr, status, pid) + + def retrieve(self, kind, pid=None): + self._procfs_path = get_procfs_path() + if pid is not None: + inodes = self.get_proc_inodes(pid) + if not inodes: + # no connections for this process + return [] + else: + inodes = self.get_all_inodes() + ret = set() + for proto_name, family, type_ in self.tmap[kind]: + path = f"{self._procfs_path}/net/{proto_name}" + if family in {socket.AF_INET, socket.AF_INET6}: + ls = self.process_inet( + path, family, type_, inodes, filter_pid=pid + ) + else: + ls = self.process_unix(path, family, inodes, filter_pid=pid) + for fd, family, type_, laddr, raddr, status, bound_pid in ls: + if pid: + conn = ntp.pconn(fd, family, type_, laddr, raddr, status) + else: + conn = ntp.sconn( + fd, family, type_, laddr, raddr, status, bound_pid + ) + ret.add(conn) + return list(ret) + + +_net_connections = NetConnections() + + +def net_connections(kind='inet'): + """Return system-wide open connections.""" + return _net_connections.retrieve(kind) + + +def net_io_counters(): + """Return network I/O statistics for every network interface + installed on the system as a dict of raw tuples. + """ + with open_text(f"{get_procfs_path()}/net/dev") as f: + lines = f.readlines() + retdict = {} + for line in lines[2:]: + colon = line.rfind(':') + assert colon > 0, repr(line) + name = line[:colon].strip() + fields = line[colon + 1 :].strip().split() + + ( + # in + bytes_recv, + packets_recv, + errin, + dropin, + _fifoin, # unused + _framein, # unused + _compressedin, # unused + _multicastin, # unused + # out + bytes_sent, + packets_sent, + errout, + dropout, + _fifoout, # unused + _collisionsout, # unused + _carrierout, # unused + _compressedout, # unused + ) = map(int, fields) + + retdict[name] = ( + bytes_sent, + bytes_recv, + packets_sent, + packets_recv, + errin, + errout, + dropin, + dropout, + ) + return retdict + + +def net_if_stats(): + """Get NIC stats (isup, duplex, speed, mtu).""" + duplex_map = { + cext.DUPLEX_FULL: NIC_DUPLEX_FULL, + cext.DUPLEX_HALF: NIC_DUPLEX_HALF, + cext.DUPLEX_UNKNOWN: NIC_DUPLEX_UNKNOWN, + } + names = net_io_counters().keys() + ret = {} + for name in names: + try: + mtu = cext.net_if_mtu(name) + flags = cext.net_if_flags(name) + duplex, speed = cext.net_if_duplex_speed(name) + except OSError as err: + # https://github.com/giampaolo/psutil/issues/1279 + if err.errno != errno.ENODEV: + raise + debug(err) + else: + output_flags = ','.join(flags) + isup = 'running' in flags + ret[name] = ntp.snicstats( + isup, duplex_map[duplex], speed, mtu, output_flags + ) + return ret + + +# ===================================================================== +# --- disks +# ===================================================================== + + +disk_usage = _psposix.disk_usage + + +def disk_io_counters(perdisk=False): + """Return disk I/O statistics for every disk installed on the + system as a dict of raw tuples. + """ + + def read_procfs(): + # OK, this is a bit confusing. The format of /proc/diskstats can + # have 3 variations. + # On Linux 2.4 each line has always 15 fields, e.g.: + # "3 0 8 hda 8 8 8 8 8 8 8 8 8 8 8" + # On Linux 2.6+ each line *usually* has 14 fields, and the disk + # name is in another position, like this: + # "3 0 hda 8 8 8 8 8 8 8 8 8 8 8" + # ...unless (Linux 2.6) the line refers to a partition instead + # of a disk, in which case the line has less fields (7): + # "3 1 hda1 8 8 8 8" + # 4.18+ has 4 fields added: + # "3 0 hda 8 8 8 8 8 8 8 8 8 8 8 0 0 0 0" + # 5.5 has 2 more fields. + # See: + # https://www.kernel.org/doc/Documentation/iostats.txt + # https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats + with open_text(f"{get_procfs_path()}/diskstats") as f: + lines = f.readlines() + for line in lines: + fields = line.split() + flen = len(fields) + # fmt: off + if flen == 15: + # Linux 2.4 + name = fields[3] + reads = int(fields[2]) + (reads_merged, rbytes, rtime, writes, writes_merged, + wbytes, wtime, _, busy_time, _) = map(int, fields[4:14]) + elif flen == 14 or flen >= 18: + # Linux 2.6+, line referring to a disk + name = fields[2] + (reads, reads_merged, rbytes, rtime, writes, writes_merged, + wbytes, wtime, _, busy_time, _) = map(int, fields[3:14]) + elif flen == 7: + # Linux 2.6+, line referring to a partition + name = fields[2] + reads, rbytes, writes, wbytes = map(int, fields[3:]) + rtime = wtime = reads_merged = writes_merged = busy_time = 0 + else: + msg = f"not sure how to interpret line {line!r}" + raise ValueError(msg) + yield (name, reads, writes, rbytes, wbytes, rtime, wtime, + reads_merged, writes_merged, busy_time) + # fmt: on + + def read_sysfs(): + for block in os.listdir('/sys/block'): + for root, _, files in os.walk(os.path.join('/sys/block', block)): + if 'stat' not in files: + continue + with open_text(os.path.join(root, 'stat')) as f: + fields = f.read().strip().split() + name = os.path.basename(root) + # fmt: off + (reads, reads_merged, rbytes, rtime, writes, writes_merged, + wbytes, wtime, _, busy_time) = map(int, fields[:10]) + yield (name, reads, writes, rbytes, wbytes, rtime, + wtime, reads_merged, writes_merged, busy_time) + # fmt: on + + if os.path.exists(f"{get_procfs_path()}/diskstats"): + gen = read_procfs() + elif os.path.exists('/sys/block'): + gen = read_sysfs() + else: + msg = ( + f"{get_procfs_path()}/diskstats nor /sys/block are available on" + " this system" + ) + raise NotImplementedError(msg) + + retdict = {} + for entry in gen: + # fmt: off + (name, reads, writes, rbytes, wbytes, rtime, wtime, reads_merged, + writes_merged, busy_time) = entry + if not perdisk and not is_storage_device(name): + # perdisk=False means we want to calculate totals so we skip + # partitions (e.g. 'sda1', 'nvme0n1p1') and only include + # base disk devices (e.g. 'sda', 'nvme0n1'). Base disks + # include a total of all their partitions + some extra size + # of their own: + # $ cat /proc/diskstats + # 259 0 sda 10485760 ... + # 259 1 sda1 5186039 ... + # 259 1 sda2 5082039 ... + # See: + # https://github.com/giampaolo/psutil/pull/1313 + continue + + rbytes *= DISK_SECTOR_SIZE + wbytes *= DISK_SECTOR_SIZE + retdict[name] = (reads, writes, rbytes, wbytes, rtime, wtime, + reads_merged, writes_merged, busy_time) + # fmt: on + + return retdict + + +class RootFsDeviceFinder: + """disk_partitions() may return partitions with device == "/dev/root" + or "rootfs". This container class uses different strategies to try to + obtain the real device path. Resources: + https://bootlin.com/blog/find-root-device/ + https://www.systutorials.com/how-to-find-the-disk-where-root-is-on-in-bash-on-linux/. + """ + + __slots__ = ['major', 'minor'] + + def __init__(self): + dev = os.stat("/").st_dev + self.major = os.major(dev) + self.minor = os.minor(dev) + + def ask_proc_partitions(self): + with open_text(f"{get_procfs_path()}/partitions") as f: + for line in f.readlines()[2:]: + fields = line.split() + if len(fields) < 4: # just for extra safety + continue + major = int(fields[0]) if fields[0].isdigit() else None + minor = int(fields[1]) if fields[1].isdigit() else None + name = fields[3] + if major == self.major and minor == self.minor: + if name: # just for extra safety + return f"/dev/{name}" + + def ask_sys_dev_block(self): + path = f"/sys/dev/block/{self.major}:{self.minor}/uevent" + with open_text(path) as f: + for line in f: + if line.startswith("DEVNAME="): + name = line.strip().rpartition("DEVNAME=")[2] + if name: # just for extra safety + return f"/dev/{name}" + + def ask_sys_class_block(self): + needle = f"{self.major}:{self.minor}" + files = glob.iglob("/sys/class/block/*/dev") + for file in files: + try: + f = open_text(file) + except FileNotFoundError: # race condition + continue + else: + with f: + data = f.read().strip() + if data == needle: + name = os.path.basename(os.path.dirname(file)) + return f"/dev/{name}" + + def find(self): + path = None + if path is None: + try: + path = self.ask_proc_partitions() + except OSError as err: + debug(err) + if path is None: + try: + path = self.ask_sys_dev_block() + except OSError as err: + debug(err) + if path is None: + try: + path = self.ask_sys_class_block() + except OSError as err: + debug(err) + # We use exists() because the "/dev/*" part of the path is hard + # coded, so we want to be sure. + if path is not None and os.path.exists(path): + return path + + +def disk_partitions(all=False): + """Return mounted disk partitions as a list of namedtuples.""" + fstypes = set() + procfs_path = get_procfs_path() + if not all: + with open_text(f"{procfs_path}/filesystems") as f: + for line in f: + line = line.strip() + if not line.startswith("nodev"): + fstypes.add(line.strip()) + else: + # ignore all lines starting with "nodev" except "nodev zfs" + fstype = line.split("\t")[1] + if fstype == "zfs": + fstypes.add("zfs") + + # See: https://github.com/giampaolo/psutil/issues/1307 + if procfs_path == "/proc" and os.path.isfile('/etc/mtab'): + mounts_path = os.path.realpath("/etc/mtab") + else: + mounts_path = os.path.realpath(f"{procfs_path}/self/mounts") + + retlist = [] + partitions = cext.disk_partitions(mounts_path) + for partition in partitions: + device, mountpoint, fstype, opts = partition + if device == 'none': + device = '' + if device in {"/dev/root", "rootfs"}: + device = RootFsDeviceFinder().find() or device + if not all: + if not device or fstype not in fstypes: + continue + ntuple = ntp.sdiskpart(device, mountpoint, fstype, opts) + retlist.append(ntuple) + + return retlist + + +# ===================================================================== +# --- sensors +# ===================================================================== + + +def sensors_temperatures(): + """Return hardware (CPU and others) temperatures as a dict + including hardware name, label, current, max and critical + temperatures. + + Implementation notes: + - /sys/class/hwmon looks like the most recent interface to + retrieve this info, and this implementation relies on it + only (old distros will probably use something else) + - lm-sensors on Ubuntu 16.04 relies on /sys/class/hwmon + - /sys/class/thermal/thermal_zone* is another one but it's more + difficult to parse + """ + ret = collections.defaultdict(list) + basenames = glob.glob('/sys/class/hwmon/hwmon*/temp*_*') + # CentOS has an intermediate /device directory: + # https://github.com/giampaolo/psutil/issues/971 + # https://github.com/nicolargo/glances/issues/1060 + basenames.extend(glob.glob('/sys/class/hwmon/hwmon*/device/temp*_*')) + basenames = sorted({x.split('_')[0] for x in basenames}) + + # Only add the coretemp hwmon entries if they're not already in + # /sys/class/hwmon/ + # https://github.com/giampaolo/psutil/issues/1708 + # https://github.com/giampaolo/psutil/pull/1648 + basenames2 = glob.glob( + '/sys/devices/platform/coretemp.*/hwmon/hwmon*/temp*_*' + ) + repl = re.compile(r"/sys/devices/platform/coretemp.*/hwmon/") + for name in basenames2: + altname = repl.sub('/sys/class/hwmon/', name) + if altname not in basenames: + basenames.append(name) + + for base in basenames: + try: + path = base + '_input' + current = float(bcat(path)) / 1000.0 + path = os.path.join(os.path.dirname(base), 'name') + unit_name = cat(path).strip() + except (OSError, ValueError): + # A lot of things can go wrong here, so let's just skip the + # whole entry. Sure thing is Linux's /sys/class/hwmon really + # is a stinky broken mess. + # https://github.com/giampaolo/psutil/issues/1009 + # https://github.com/giampaolo/psutil/issues/1101 + # https://github.com/giampaolo/psutil/issues/1129 + # https://github.com/giampaolo/psutil/issues/1245 + # https://github.com/giampaolo/psutil/issues/1323 + continue + + high = bcat(base + '_max', fallback=None) + critical = bcat(base + '_crit', fallback=None) + label = cat(base + '_label', fallback='').strip() + + if high is not None: + try: + high = float(high) / 1000.0 + except ValueError: + high = None + if critical is not None: + try: + critical = float(critical) / 1000.0 + except ValueError: + critical = None + + ret[unit_name].append((label, current, high, critical)) + + # Indication that no sensors were detected in /sys/class/hwmon/ + if not basenames: + basenames = glob.glob('/sys/class/thermal/thermal_zone*') + basenames = sorted(set(basenames)) + + for base in basenames: + try: + path = os.path.join(base, 'temp') + current = float(bcat(path)) / 1000.0 + path = os.path.join(base, 'type') + unit_name = cat(path).strip() + except (OSError, ValueError) as err: + debug(err) + continue + + trip_paths = glob.glob(base + '/trip_point*') + trip_points = { + '_'.join(os.path.basename(p).split('_')[0:3]) + for p in trip_paths + } + critical = None + high = None + for trip_point in trip_points: + path = os.path.join(base, trip_point + "_type") + trip_type = cat(path, fallback='').strip() + if trip_type == 'critical': + critical = bcat( + os.path.join(base, trip_point + "_temp"), fallback=None + ) + elif trip_type == 'high': + high = bcat( + os.path.join(base, trip_point + "_temp"), fallback=None + ) + + if high is not None: + try: + high = float(high) / 1000.0 + except ValueError: + high = None + if critical is not None: + try: + critical = float(critical) / 1000.0 + except ValueError: + critical = None + + ret[unit_name].append(('', current, high, critical)) + + return dict(ret) + + +def sensors_fans(): + """Return hardware fans info (for CPU and other peripherals) as a + dict including hardware label and current speed. + + Implementation notes: + - /sys/class/hwmon looks like the most recent interface to + retrieve this info, and this implementation relies on it + only (old distros will probably use something else) + - lm-sensors on Ubuntu 16.04 relies on /sys/class/hwmon + """ + ret = collections.defaultdict(list) + basenames = glob.glob('/sys/class/hwmon/hwmon*/fan*_*') + if not basenames: + # CentOS has an intermediate /device directory: + # https://github.com/giampaolo/psutil/issues/971 + basenames = glob.glob('/sys/class/hwmon/hwmon*/device/fan*_*') + + basenames = sorted({x.split("_")[0] for x in basenames}) + for base in basenames: + try: + current = int(bcat(base + '_input')) + except OSError as err: + debug(err) + continue + unit_name = cat(os.path.join(os.path.dirname(base), 'name')).strip() + label = cat(base + '_label', fallback='').strip() + ret[unit_name].append(ntp.sfan(label, current)) + + return dict(ret) + + +def sensors_battery(): + """Return battery information. + Implementation note: it appears /sys/class/power_supply/BAT0/ + directory structure may vary and provide files with the same + meaning but under different names, see: + https://github.com/giampaolo/psutil/issues/966. + """ + null = object() + + def multi_bcat(*paths): + """Attempt to read the content of multiple files which may + not exist. If none of them exist return None. + """ + for path in paths: + ret = bcat(path, fallback=null) + if ret != null: + try: + return int(ret) + except ValueError: + return ret.strip() + return None + + bats = [ + x + for x in os.listdir(POWER_SUPPLY_PATH) + if x.startswith('BAT') or 'battery' in x.lower() + ] + if not bats: + return None + # Get the first available battery. Usually this is "BAT0", except + # some rare exceptions: + # https://github.com/giampaolo/psutil/issues/1238 + root = os.path.join(POWER_SUPPLY_PATH, min(bats)) + + # Base metrics. + energy_now = multi_bcat(root + "/energy_now", root + "/charge_now") + power_now = multi_bcat(root + "/power_now", root + "/current_now") + energy_full = multi_bcat(root + "/energy_full", root + "/charge_full") + time_to_empty = multi_bcat(root + "/time_to_empty_now") + + # Percent. If we have energy_full the percentage will be more + # accurate compared to reading /capacity file (float vs. int). + if energy_full is not None and energy_now is not None: + try: + percent = 100.0 * energy_now / energy_full + except ZeroDivisionError: + percent = 0.0 + else: + percent = int(cat(root + "/capacity", fallback=-1)) + if percent == -1: + return None + + # Is AC power cable plugged in? + # Note: AC0 is not always available and sometimes (e.g. CentOS7) + # it's called "AC". + power_plugged = None + online = multi_bcat( + os.path.join(POWER_SUPPLY_PATH, "AC0/online"), + os.path.join(POWER_SUPPLY_PATH, "AC/online"), + ) + if online is not None: + power_plugged = online == 1 + else: + status = cat(root + "/status", fallback="").strip().lower() + if status == "discharging": + power_plugged = False + elif status in {"charging", "full"}: + power_plugged = True + + # Seconds left. + # Note to self: we may also calculate the charging ETA as per: + # https://github.com/thialfihar/dotfiles/blob/ + # 013937745fd9050c30146290e8f963d65c0179e6/bin/battery.py#L55 + if power_plugged: + secsleft = _common.POWER_TIME_UNLIMITED + elif energy_now is not None and power_now is not None: + try: + secsleft = int(energy_now / abs(power_now) * 3600) + except ZeroDivisionError: + secsleft = _common.POWER_TIME_UNKNOWN + elif time_to_empty is not None: + secsleft = int(time_to_empty * 60) + if secsleft < 0: + secsleft = _common.POWER_TIME_UNKNOWN + else: + secsleft = _common.POWER_TIME_UNKNOWN + + return ntp.sbattery(percent, secsleft, power_plugged) + + +# ===================================================================== +# --- other system functions +# ===================================================================== + + +def users(): + """Return currently connected users as a list of namedtuples.""" + retlist = [] + rawlist = cext.users() + for item in rawlist: + user, tty, hostname, tstamp, pid = item + nt = ntp.suser(user, tty or None, hostname, tstamp, pid) + retlist.append(nt) + return retlist + + +def boot_time(): + """Return the system boot time expressed in seconds since the epoch.""" + path = f"{get_procfs_path()}/stat" + with open_binary(path) as f: + for line in f: + if line.startswith(b'btime'): + return float(line.strip().split()[1]) + msg = f"line 'btime' not found in {path}" + raise RuntimeError(msg) + + +# ===================================================================== +# --- processes +# ===================================================================== + + +def pids(): + """Returns a list of PIDs currently running on the system.""" + path = get_procfs_path().encode(ENCODING) + return [int(x) for x in os.listdir(path) if x.isdigit()] + + +def pid_exists(pid): + """Check for the existence of a unix PID. Linux TIDs are not + supported (always return False). + """ + if not _psposix.pid_exists(pid): + return False + else: + # Linux's apparently does not distinguish between PIDs and TIDs + # (thread IDs). + # listdir("/proc") won't show any TID (only PIDs) but + # os.stat("/proc/{tid}") will succeed if {tid} exists. + # os.kill() can also be passed a TID. This is quite confusing. + # In here we want to enforce this distinction and support PIDs + # only, see: + # https://github.com/giampaolo/psutil/issues/687 + try: + # Note: already checked that this is faster than using a + # regular expr. Also (a lot) faster than doing + # 'return pid in pids()' + path = f"{get_procfs_path()}/{pid}/status" + with open_binary(path) as f: + for line in f: + if line.startswith(b"Tgid:"): + tgid = int(line.split()[1]) + # If tgid and pid are the same then we're + # dealing with a process PID. + return tgid == pid + msg = f"'Tgid' line not found in {path}" + raise ValueError(msg) + except (OSError, ValueError): + return pid in pids() + + +def ppid_map(): + """Obtain a {pid: ppid, ...} dict for all running processes in + one shot. Used to speed up Process.children(). + """ + ret = {} + procfs_path = get_procfs_path() + for pid in pids(): + try: + with open_binary(f"{procfs_path}/{pid}/stat") as f: + data = f.read() + except (FileNotFoundError, ProcessLookupError): + pass + except PermissionError as err: + raise AccessDenied(pid) from err + else: + rpar = data.rfind(b')') + dset = data[rpar + 2 :].split() + ppid = int(dset[1]) + ret[pid] = ppid + return ret + + +def wrap_exceptions(fun): + """Decorator which translates bare OSError exceptions into + NoSuchProcess and AccessDenied. + """ + + @functools.wraps(fun) + def wrapper(self, *args, **kwargs): + pid, name = self.pid, self._name + try: + return fun(self, *args, **kwargs) + except PermissionError as err: + raise AccessDenied(pid, name) from err + except ProcessLookupError as err: + self._raise_if_zombie() + raise NoSuchProcess(pid, name) from err + except FileNotFoundError as err: + self._raise_if_zombie() + # /proc/PID directory may still exist, but the files within + # it may not, indicating the process is gone, see: + # https://github.com/giampaolo/psutil/issues/2418 + if not os.path.exists(f"{self._procfs_path}/{pid}/stat"): + raise NoSuchProcess(pid, name) from err + raise + + return wrapper + + +class Process: + """Linux process implementation.""" + + __slots__ = [ + "_cache", + "_ctime", + "_name", + "_ppid", + "_procfs_path", + "pid", + ] + + def __init__(self, pid): + self.pid = pid + self._name = None + self._ppid = None + self._ctime = None + self._procfs_path = get_procfs_path() + + def _is_zombie(self): + # Note: most of the times Linux is able to return info about the + # process even if it's a zombie, and /proc/{pid} will exist. + # There are some exceptions though, like exe(), cmdline() and + # memory_maps(). In these cases /proc/{pid}/{file} exists but + # it's empty. Instead of returning a "null" value we'll raise an + # exception. + try: + data = bcat(f"{self._procfs_path}/{self.pid}/stat") + except OSError: + return False + else: + rpar = data.rfind(b')') + status = data[rpar + 2 : rpar + 3] + return status == b"Z" + + def _raise_if_zombie(self): + if self._is_zombie(): + raise ZombieProcess(self.pid, self._name, self._ppid) + + def _raise_if_not_alive(self): + """Raise NSP if the process disappeared on us.""" + # For those C function who do not raise NSP, possibly returning + # incorrect or incomplete result. + os.stat(f"{self._procfs_path}/{self.pid}") + + def _readlink(self, path, fallback=UNSET): + # * https://github.com/giampaolo/psutil/issues/503 + # os.readlink('/proc/pid/exe') may raise ESRCH (ProcessLookupError) + # instead of ENOENT (FileNotFoundError) when it races. + # * ENOENT may occur also if the path actually exists if PID is + # a low PID (~0-20 range). + # * https://github.com/giampaolo/psutil/issues/2514 + try: + return readlink(path) + except (FileNotFoundError, ProcessLookupError): + if os.path.lexists(f"{self._procfs_path}/{self.pid}"): + self._raise_if_zombie() + if fallback is not UNSET: + return fallback + raise + + @wrap_exceptions + @memoize_when_activated + def _parse_stat_file(self): + """Parse /proc/{pid}/stat file and return a dict with various + process info. + Using "man proc" as a reference: where "man proc" refers to + position N always subtract 3 (e.g ppid position 4 in + 'man proc' == position 1 in here). + The return value is cached in case oneshot() ctx manager is + in use. + """ + data = bcat(f"{self._procfs_path}/{self.pid}/stat") + # Process name is between parentheses. It can contain spaces and + # other parentheses. This is taken into account by looking for + # the first occurrence of "(" and the last occurrence of ")". + rpar = data.rfind(b')') + name = data[data.find(b'(') + 1 : rpar] + fields = data[rpar + 2 :].split() + + ret = {} + ret['name'] = name + ret['status'] = fields[0] + ret['ppid'] = fields[1] + ret['ttynr'] = fields[4] + ret['utime'] = fields[11] + ret['stime'] = fields[12] + ret['children_utime'] = fields[13] + ret['children_stime'] = fields[14] + ret['create_time'] = fields[19] + ret['cpu_num'] = fields[36] + try: + ret['blkio_ticks'] = fields[39] # aka 'delayacct_blkio_ticks' + except IndexError: + # https://github.com/giampaolo/psutil/issues/2455 + debug("can't get blkio_ticks, set iowait to 0") + ret['blkio_ticks'] = 0 + + return ret + + @wrap_exceptions + @memoize_when_activated + def _read_status_file(self): + """Read /proc/{pid}/stat file and return its content. + The return value is cached in case oneshot() ctx manager is + in use. + """ + with open_binary(f"{self._procfs_path}/{self.pid}/status") as f: + return f.read() + + @wrap_exceptions + @memoize_when_activated + def _read_smaps_file(self): + with open_binary(f"{self._procfs_path}/{self.pid}/smaps") as f: + return f.read().strip() + + def oneshot_enter(self): + self._parse_stat_file.cache_activate(self) + self._read_status_file.cache_activate(self) + self._read_smaps_file.cache_activate(self) + + def oneshot_exit(self): + self._parse_stat_file.cache_deactivate(self) + self._read_status_file.cache_deactivate(self) + self._read_smaps_file.cache_deactivate(self) + + @wrap_exceptions + def name(self): + # XXX - gets changed later and probably needs refactoring + return decode(self._parse_stat_file()['name']) + + @wrap_exceptions + def exe(self): + return self._readlink( + f"{self._procfs_path}/{self.pid}/exe", fallback="" + ) + + @wrap_exceptions + def cmdline(self): + with open_text(f"{self._procfs_path}/{self.pid}/cmdline") as f: + data = f.read() + if not data: + # may happen in case of zombie process + self._raise_if_zombie() + return [] + # 'man proc' states that args are separated by null bytes '\0' + # and last char is supposed to be a null byte. Nevertheless + # some processes may change their cmdline after being started + # (via setproctitle() or similar), they are usually not + # compliant with this rule and use spaces instead. Google + # Chrome process is an example. See: + # https://github.com/giampaolo/psutil/issues/1179 + sep = '\x00' if data.endswith('\x00') else ' ' + if data.endswith(sep): + data = data[:-1] + cmdline = data.split(sep) + # Sometimes last char is a null byte '\0' but the args are + # separated by spaces, see: https://github.com/giampaolo/psutil/ + # issues/1179#issuecomment-552984549 + if sep == '\x00' and len(cmdline) == 1 and ' ' in data: + cmdline = data.split(' ') + return cmdline + + @wrap_exceptions + def environ(self): + with open_text(f"{self._procfs_path}/{self.pid}/environ") as f: + data = f.read() + return parse_environ_block(data) + + @wrap_exceptions + def terminal(self): + tty_nr = int(self._parse_stat_file()['ttynr']) + tmap = _psposix.get_terminal_map() + try: + return tmap[tty_nr] + except KeyError: + return None + + # May not be available on old kernels. + if os.path.exists(f"/proc/{os.getpid()}/io"): + + @wrap_exceptions + def io_counters(self): + fname = f"{self._procfs_path}/{self.pid}/io" + fields = {} + with open_binary(fname) as f: + for line in f: + # https://github.com/giampaolo/psutil/issues/1004 + line = line.strip() + if line: + try: + name, value = line.split(b': ') + except ValueError: + # https://github.com/giampaolo/psutil/issues/1004 + continue + else: + fields[name] = int(value) + if not fields: + msg = f"{fname} file was empty" + raise RuntimeError(msg) + try: + return ntp.pio( + fields[b'syscr'], # read syscalls + fields[b'syscw'], # write syscalls + fields[b'read_bytes'], # read bytes + fields[b'write_bytes'], # write bytes + fields[b'rchar'], # read chars + fields[b'wchar'], # write chars + ) + except KeyError as err: + msg = ( + f"{err.args[0]!r} field was not found in {fname}; found" + f" fields are {fields!r}" + ) + raise ValueError(msg) from None + + @wrap_exceptions + def cpu_times(self): + values = self._parse_stat_file() + utime = float(values['utime']) / CLOCK_TICKS + stime = float(values['stime']) / CLOCK_TICKS + children_utime = float(values['children_utime']) / CLOCK_TICKS + children_stime = float(values['children_stime']) / CLOCK_TICKS + iowait = float(values['blkio_ticks']) / CLOCK_TICKS + return ntp.pcputimes( + utime, stime, children_utime, children_stime, iowait + ) + + @wrap_exceptions + def cpu_num(self): + """What CPU the process is on.""" + return int(self._parse_stat_file()['cpu_num']) + + @wrap_exceptions + def wait(self, timeout=None): + return _psposix.wait_pid(self.pid, timeout) + + @wrap_exceptions + def create_time(self, monotonic=False): + # The 'starttime' field in /proc/[pid]/stat is expressed in + # jiffies (clock ticks per second), a relative value which + # represents the number of clock ticks that have passed since + # the system booted until the process was created. It never + # changes and is unaffected by system clock updates. + if self._ctime is None: + self._ctime = ( + float(self._parse_stat_file()['create_time']) / CLOCK_TICKS + ) + if monotonic: + return self._ctime + # Add the boot time, returning time expressed in seconds since + # the epoch. This is subject to system clock updates. + return self._ctime + boot_time() + + @wrap_exceptions + def memory_info(self): + # ============================================================ + # | FIELD | DESCRIPTION | AKA | TOP | + # ============================================================ + # | rss | resident set size | | RES | + # | vms | total program size | size | VIRT | + # | shared | shared pages (from shared mappings) | | SHR | + # | text | text ('code') | trs | CODE | + # | lib | library (unused in Linux 2.6) | lrs | | + # | data | data + stack | drs | DATA | + # | dirty | dirty pages (unused in Linux 2.6) | dt | | + # ============================================================ + with open_binary(f"{self._procfs_path}/{self.pid}/statm") as f: + vms, rss, shared, text, lib, data, dirty = ( + int(x) * PAGESIZE for x in f.readline().split()[:7] + ) + return ntp.pmem(rss, vms, shared, text, lib, data, dirty) + + if HAS_PROC_SMAPS_ROLLUP or HAS_PROC_SMAPS: + + def _parse_smaps_rollup(self): + # /proc/pid/smaps_rollup was added to Linux in 2017. Faster + # than /proc/pid/smaps. It reports higher PSS than */smaps + # (from 1k up to 200k higher; tested against all processes). + # IMPORTANT: /proc/pid/smaps_rollup is weird, because it + # raises ESRCH / ENOENT for many PIDs, even if they're alive + # (also as root). In that case we'll use /proc/pid/smaps as + # fallback, which is slower but has a +50% success rate + # compared to /proc/pid/smaps_rollup. + uss = pss = swap = 0 + with open_binary( + f"{self._procfs_path}/{self.pid}/smaps_rollup" + ) as f: + for line in f: + if line.startswith(b"Private_"): + # Private_Clean, Private_Dirty, Private_Hugetlb + uss += int(line.split()[1]) * 1024 + elif line.startswith(b"Pss:"): + pss = int(line.split()[1]) * 1024 + elif line.startswith(b"Swap:"): + swap = int(line.split()[1]) * 1024 + return (uss, pss, swap) + + @wrap_exceptions + def _parse_smaps( + self, + # Gets Private_Clean, Private_Dirty, Private_Hugetlb. + _private_re=re.compile(br"\nPrivate.*:\s+(\d+)"), + _pss_re=re.compile(br"\nPss\:\s+(\d+)"), + _swap_re=re.compile(br"\nSwap\:\s+(\d+)"), + ): + # /proc/pid/smaps does not exist on kernels < 2.6.14 or if + # CONFIG_MMU kernel configuration option is not enabled. + + # Note: using 3 regexes is faster than reading the file + # line by line. + # + # You might be tempted to calculate USS by subtracting + # the "shared" value from the "resident" value in + # /proc//statm. But at least on Linux, statm's "shared" + # value actually counts pages backed by files, which has + # little to do with whether the pages are actually shared. + # /proc/self/smaps on the other hand appears to give us the + # correct information. + smaps_data = self._read_smaps_file() + # Note: smaps file can be empty for certain processes. + # The code below will not crash though and will result to 0. + uss = sum(map(int, _private_re.findall(smaps_data))) * 1024 + pss = sum(map(int, _pss_re.findall(smaps_data))) * 1024 + swap = sum(map(int, _swap_re.findall(smaps_data))) * 1024 + return (uss, pss, swap) + + @wrap_exceptions + def memory_full_info(self): + if HAS_PROC_SMAPS_ROLLUP: # faster + try: + uss, pss, swap = self._parse_smaps_rollup() + except (ProcessLookupError, FileNotFoundError): + uss, pss, swap = self._parse_smaps() + else: + uss, pss, swap = self._parse_smaps() + basic_mem = self.memory_info() + return ntp.pfullmem(*basic_mem + (uss, pss, swap)) + + else: + memory_full_info = memory_info + + if HAS_PROC_SMAPS: + + @wrap_exceptions + def memory_maps(self): + """Return process's mapped memory regions as a list of named + tuples. Fields are explained in 'man proc'; here is an updated + (Apr 2012) version: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/proc.txt?id=b76437579d1344b612cf1851ae610c636cec7db0. + + /proc/{PID}/smaps does not exist on kernels < 2.6.14 or if + CONFIG_MMU kernel configuration option is not enabled. + """ + + def get_blocks(lines, current_block): + data = {} + for line in lines: + fields = line.split(None, 5) + if not fields[0].endswith(b':'): + # new block section + yield (current_block.pop(), data) + current_block.append(line) + else: + try: + data[fields[0]] = int(fields[1]) * 1024 + except (ValueError, IndexError): + if fields[0].startswith(b'VmFlags:'): + # see issue #369 + continue + msg = f"don't know how to interpret line {line!r}" + raise ValueError(msg) from None + yield (current_block.pop(), data) + + data = self._read_smaps_file() + # Note: smaps file can be empty for certain processes or for + # zombies. + if not data: + self._raise_if_zombie() + return [] + lines = data.split(b'\n') + ls = [] + first_line = lines.pop(0) + current_block = [first_line] + for header, data in get_blocks(lines, current_block): + hfields = header.split(None, 5) + try: + addr, perms, _offset, _dev, _inode, path = hfields + except ValueError: + addr, perms, _offset, _dev, _inode, path = hfields + [''] + if not path: + path = '[anon]' + else: + path = decode(path) + path = path.strip() + if path.endswith(' (deleted)') and not path_exists_strict( + path + ): + path = path[:-10] + item = ( + decode(addr), + decode(perms), + path, + data.get(b'Rss:', 0), + data.get(b'Size:', 0), + data.get(b'Pss:', 0), + data.get(b'Shared_Clean:', 0), + data.get(b'Shared_Dirty:', 0), + data.get(b'Private_Clean:', 0), + data.get(b'Private_Dirty:', 0), + data.get(b'Referenced:', 0), + data.get(b'Anonymous:', 0), + data.get(b'Swap:', 0), + ) + ls.append(item) + return ls + + @wrap_exceptions + def cwd(self): + return self._readlink( + f"{self._procfs_path}/{self.pid}/cwd", fallback="" + ) + + @wrap_exceptions + def num_ctx_switches( + self, _ctxsw_re=re.compile(br'ctxt_switches:\t(\d+)') + ): + data = self._read_status_file() + ctxsw = _ctxsw_re.findall(data) + if not ctxsw: + msg = ( + "'voluntary_ctxt_switches' and" + " 'nonvoluntary_ctxt_switches'lines were not found in" + f" {self._procfs_path}/{self.pid}/status; the kernel is" + " probably older than 2.6.23" + ) + raise NotImplementedError(msg) + return ntp.pctxsw(int(ctxsw[0]), int(ctxsw[1])) + + @wrap_exceptions + def num_threads(self, _num_threads_re=re.compile(br'Threads:\t(\d+)')): + # Using a re is faster than iterating over file line by line. + data = self._read_status_file() + return int(_num_threads_re.findall(data)[0]) + + @wrap_exceptions + def threads(self): + thread_ids = os.listdir(f"{self._procfs_path}/{self.pid}/task") + thread_ids.sort() + retlist = [] + hit_enoent = False + for thread_id in thread_ids: + fname = f"{self._procfs_path}/{self.pid}/task/{thread_id}/stat" + try: + with open_binary(fname) as f: + st = f.read().strip() + except (FileNotFoundError, ProcessLookupError): + # no such file or directory or no such process; + # it means thread disappeared on us + hit_enoent = True + continue + # ignore the first two values ("pid (exe)") + st = st[st.find(b')') + 2 :] + values = st.split(b' ') + utime = float(values[11]) / CLOCK_TICKS + stime = float(values[12]) / CLOCK_TICKS + ntuple = ntp.pthread(int(thread_id), utime, stime) + retlist.append(ntuple) + if hit_enoent: + self._raise_if_not_alive() + return retlist + + @wrap_exceptions + def nice_get(self): + # with open_text(f"{self._procfs_path}/{self.pid}/stat") as f: + # data = f.read() + # return int(data.split()[18]) + + # Use C implementation + return cext.proc_priority_get(self.pid) + + @wrap_exceptions + def nice_set(self, value): + return cext.proc_priority_set(self.pid, value) + + # starting from CentOS 6. + if HAS_CPU_AFFINITY: + + @wrap_exceptions + def cpu_affinity_get(self): + return cext.proc_cpu_affinity_get(self.pid) + + def _get_eligible_cpus( + self, _re=re.compile(br"Cpus_allowed_list:\t(\d+)-(\d+)") + ): + # See: https://github.com/giampaolo/psutil/issues/956 + data = self._read_status_file() + match = _re.findall(data) + if match: + return list(range(int(match[0][0]), int(match[0][1]) + 1)) + else: + return list(range(len(per_cpu_times()))) + + @wrap_exceptions + def cpu_affinity_set(self, cpus): + try: + cext.proc_cpu_affinity_set(self.pid, cpus) + except (OSError, ValueError) as err: + if isinstance(err, ValueError) or err.errno == errno.EINVAL: + eligible_cpus = self._get_eligible_cpus() + all_cpus = tuple(range(len(per_cpu_times()))) + for cpu in cpus: + if cpu not in all_cpus: + msg = ( + f"invalid CPU {cpu!r}; choose between" + f" {eligible_cpus!r}" + ) + raise ValueError(msg) from None + if cpu not in eligible_cpus: + msg = ( + f"CPU number {cpu} is not eligible; choose" + f" between {eligible_cpus}" + ) + raise ValueError(msg) from err + raise + + # only starting from kernel 2.6.13 + if HAS_PROC_IO_PRIORITY: + + @wrap_exceptions + def ionice_get(self): + ioclass, value = cext.proc_ioprio_get(self.pid) + ioclass = IOPriority(ioclass) + return ntp.pionice(ioclass, value) + + @wrap_exceptions + def ionice_set(self, ioclass, value): + if value is None: + value = 0 + if value and ioclass in { + IOPriority.IOPRIO_CLASS_IDLE, + IOPriority.IOPRIO_CLASS_NONE, + }: + msg = f"{ioclass!r} ioclass accepts no value" + raise ValueError(msg) + if value < 0 or value > 7: + msg = "value not in 0-7 range" + raise ValueError(msg) + return cext.proc_ioprio_set(self.pid, ioclass, value) + + if hasattr(resource, "prlimit"): + + @wrap_exceptions + def rlimit(self, resource_, limits=None): + # If pid is 0 prlimit() applies to the calling process and + # we don't want that. We should never get here though as + # PID 0 is not supported on Linux. + if self.pid == 0: + msg = "can't use prlimit() against PID 0 process" + raise ValueError(msg) + try: + if limits is None: + # get + return resource.prlimit(self.pid, resource_) + else: + # set + if len(limits) != 2: + msg = ( + "second argument must be a (soft, hard) " + f"tuple, got {limits!r}" + ) + raise ValueError(msg) + resource.prlimit(self.pid, resource_, limits) + except OSError as err: + if err.errno == errno.ENOSYS: + # I saw this happening on Travis: + # https://travis-ci.org/giampaolo/psutil/jobs/51368273 + self._raise_if_zombie() + raise + + @wrap_exceptions + def status(self): + letter = self._parse_stat_file()['status'] + letter = letter.decode() + # XXX is '?' legit? (we're not supposed to return it anyway) + return PROC_STATUSES.get(letter, '?') + + @wrap_exceptions + def open_files(self): + retlist = [] + files = os.listdir(f"{self._procfs_path}/{self.pid}/fd") + hit_enoent = False + for fd in files: + file = f"{self._procfs_path}/{self.pid}/fd/{fd}" + try: + path = readlink(file) + except (FileNotFoundError, ProcessLookupError): + # ENOENT == file which is gone in the meantime + hit_enoent = True + continue + except OSError as err: + if err.errno == errno.EINVAL: + # not a link + continue + if err.errno == errno.ENAMETOOLONG: + # file name too long + debug(err) + continue + raise + else: + # If path is not an absolute there's no way to tell + # whether it's a regular file or not, so we skip it. + # A regular file is always supposed to be have an + # absolute path though. + if path.startswith('/') and isfile_strict(path): + # Get file position and flags. + file = f"{self._procfs_path}/{self.pid}/fdinfo/{fd}" + try: + with open_binary(file) as f: + pos = int(f.readline().split()[1]) + flags = int(f.readline().split()[1], 8) + except (FileNotFoundError, ProcessLookupError): + # fd gone in the meantime; process may + # still be alive + hit_enoent = True + else: + mode = file_flags_to_mode(flags) + ntuple = ntp.popenfile( + path, int(fd), int(pos), mode, flags + ) + retlist.append(ntuple) + if hit_enoent: + self._raise_if_not_alive() + return retlist + + @wrap_exceptions + def net_connections(self, kind='inet'): + ret = _net_connections.retrieve(kind, self.pid) + self._raise_if_not_alive() + return ret + + @wrap_exceptions + def num_fds(self): + return len(os.listdir(f"{self._procfs_path}/{self.pid}/fd")) + + @wrap_exceptions + def ppid(self): + return int(self._parse_stat_file()['ppid']) + + @wrap_exceptions + def uids(self, _uids_re=re.compile(br'Uid:\t(\d+)\t(\d+)\t(\d+)')): + data = self._read_status_file() + real, effective, saved = _uids_re.findall(data)[0] + return ntp.puids(int(real), int(effective), int(saved)) + + @wrap_exceptions + def gids(self, _gids_re=re.compile(br'Gid:\t(\d+)\t(\d+)\t(\d+)')): + data = self._read_status_file() + real, effective, saved = _gids_re.findall(data)[0] + return ntp.pgids(int(real), int(effective), int(saved)) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_psosx.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_psosx.py new file mode 100644 index 0000000000000000000000000000000000000000..b14d5e023bec1f9cb5cb06b4caf7170489f3d4c7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_psosx.py @@ -0,0 +1,549 @@ +# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""macOS platform implementation.""" + +import errno +import functools +import os + +from . import _common +from . import _ntuples as ntp +from . import _psposix +from . import _psutil_osx as cext +from ._common import AccessDenied +from ._common import NoSuchProcess +from ._common import ZombieProcess +from ._common import conn_tmap +from ._common import conn_to_ntuple +from ._common import debug +from ._common import isfile_strict +from ._common import memoize_when_activated +from ._common import parse_environ_block +from ._common import usage_percent + +__extra__all__ = [] + + +# ===================================================================== +# --- globals +# ===================================================================== + + +PAGESIZE = cext.getpagesize() +AF_LINK = cext.AF_LINK + +TCP_STATUSES = { + cext.TCPS_ESTABLISHED: _common.CONN_ESTABLISHED, + cext.TCPS_SYN_SENT: _common.CONN_SYN_SENT, + cext.TCPS_SYN_RECEIVED: _common.CONN_SYN_RECV, + cext.TCPS_FIN_WAIT_1: _common.CONN_FIN_WAIT1, + cext.TCPS_FIN_WAIT_2: _common.CONN_FIN_WAIT2, + cext.TCPS_TIME_WAIT: _common.CONN_TIME_WAIT, + cext.TCPS_CLOSED: _common.CONN_CLOSE, + cext.TCPS_CLOSE_WAIT: _common.CONN_CLOSE_WAIT, + cext.TCPS_LAST_ACK: _common.CONN_LAST_ACK, + cext.TCPS_LISTEN: _common.CONN_LISTEN, + cext.TCPS_CLOSING: _common.CONN_CLOSING, + cext.PSUTIL_CONN_NONE: _common.CONN_NONE, +} + +PROC_STATUSES = { + cext.SIDL: _common.STATUS_IDLE, + cext.SRUN: _common.STATUS_RUNNING, + cext.SSLEEP: _common.STATUS_SLEEPING, + cext.SSTOP: _common.STATUS_STOPPED, + cext.SZOMB: _common.STATUS_ZOMBIE, +} + +kinfo_proc_map = dict( + ppid=0, + ruid=1, + euid=2, + suid=3, + rgid=4, + egid=5, + sgid=6, + ttynr=7, + ctime=8, + status=9, + name=10, +) + +pidtaskinfo_map = dict( + cpuutime=0, + cpustime=1, + rss=2, + vms=3, + pfaults=4, + pageins=5, + numthreads=6, + volctxsw=7, +) + + +# ===================================================================== +# --- memory +# ===================================================================== + + +def virtual_memory(): + """System virtual memory as a namedtuple.""" + total, active, inactive, wired, free, speculative = cext.virtual_mem() + # This is how Zabbix calculate avail and used mem: + # https://github.com/zabbix/zabbix/blob/master/src/libs/zbxsysinfo/osx/memory.c + # Also see: https://github.com/giampaolo/psutil/issues/1277 + avail = inactive + free + used = active + wired + # This is NOT how Zabbix calculates free mem but it matches "free" + # cmdline utility. + free -= speculative + percent = usage_percent((total - avail), total, round_=1) + return ntp.svmem( + total, avail, percent, used, free, active, inactive, wired + ) + + +def swap_memory(): + """Swap system memory as a (total, used, free, sin, sout) tuple.""" + total, used, free, sin, sout = cext.swap_mem() + percent = usage_percent(used, total, round_=1) + return ntp.sswap(total, used, free, percent, sin, sout) + + +# malloc / heap functions +heap_info = cext.heap_info +heap_trim = cext.heap_trim + + +# ===================================================================== +# --- CPU +# ===================================================================== + + +def cpu_times(): + """Return system CPU times as a namedtuple.""" + user, nice, system, idle = cext.cpu_times() + return ntp.scputimes(user, nice, system, idle) + + +def per_cpu_times(): + """Return system CPU times as a named tuple.""" + ret = [] + for cpu_t in cext.per_cpu_times(): + user, nice, system, idle = cpu_t + item = ntp.scputimes(user, nice, system, idle) + ret.append(item) + return ret + + +def cpu_count_logical(): + """Return the number of logical CPUs in the system.""" + return cext.cpu_count_logical() + + +def cpu_count_cores(): + """Return the number of CPU cores in the system.""" + return cext.cpu_count_cores() + + +def cpu_stats(): + ctx_switches, interrupts, soft_interrupts, syscalls, _traps = ( + cext.cpu_stats() + ) + return ntp.scpustats(ctx_switches, interrupts, soft_interrupts, syscalls) + + +if cext.has_cpu_freq(): # not always available on ARM64 + + def cpu_freq(): + """Return CPU frequency. + On macOS per-cpu frequency is not supported. + Also, the returned frequency never changes, see: + https://arstechnica.com/civis/viewtopic.php?f=19&t=465002. + """ + curr, min_, max_ = cext.cpu_freq() + return [ntp.scpufreq(curr, min_, max_)] + + +# ===================================================================== +# --- disks +# ===================================================================== + + +disk_usage = _psposix.disk_usage +disk_io_counters = cext.disk_io_counters + + +def disk_partitions(all=False): + """Return mounted disk partitions as a list of namedtuples.""" + retlist = [] + partitions = cext.disk_partitions() + for partition in partitions: + device, mountpoint, fstype, opts = partition + if device == 'none': + device = '' + if not all: + if not os.path.isabs(device) or not os.path.exists(device): + continue + ntuple = ntp.sdiskpart(device, mountpoint, fstype, opts) + retlist.append(ntuple) + return retlist + + +# ===================================================================== +# --- sensors +# ===================================================================== + + +def sensors_battery(): + """Return battery information.""" + try: + percent, minsleft, power_plugged = cext.sensors_battery() + except NotImplementedError: + # no power source - return None according to interface + return None + power_plugged = power_plugged == 1 + if power_plugged: + secsleft = _common.POWER_TIME_UNLIMITED + elif minsleft == -1: + secsleft = _common.POWER_TIME_UNKNOWN + else: + secsleft = minsleft * 60 + return ntp.sbattery(percent, secsleft, power_plugged) + + +# ===================================================================== +# --- network +# ===================================================================== + + +net_io_counters = cext.net_io_counters +net_if_addrs = cext.net_if_addrs + + +def net_connections(kind='inet'): + """System-wide network connections.""" + # Note: on macOS this will fail with AccessDenied unless + # the process is owned by root. + ret = [] + for pid in pids(): + try: + cons = Process(pid).net_connections(kind) + except NoSuchProcess: + continue + else: + if cons: + for c in cons: + c = list(c) + [pid] + ret.append(ntp.sconn(*c)) + return ret + + +def net_if_stats(): + """Get NIC stats (isup, duplex, speed, mtu).""" + names = net_io_counters().keys() + ret = {} + for name in names: + try: + mtu = cext.net_if_mtu(name) + flags = cext.net_if_flags(name) + duplex, speed = cext.net_if_duplex_speed(name) + except OSError as err: + # https://github.com/giampaolo/psutil/issues/1279 + if err.errno != errno.ENODEV: + raise + else: + if hasattr(_common, 'NicDuplex'): + duplex = _common.NicDuplex(duplex) + output_flags = ','.join(flags) + isup = 'running' in flags + ret[name] = ntp.snicstats(isup, duplex, speed, mtu, output_flags) + return ret + + +# ===================================================================== +# --- other system functions +# ===================================================================== + + +def boot_time(): + """The system boot time expressed in seconds since the epoch.""" + return cext.boot_time() + + +try: + INIT_BOOT_TIME = boot_time() +except Exception as err: # noqa: BLE001 + # Don't want to crash at import time. + debug(f"ignoring exception on import: {err!r}") + INIT_BOOT_TIME = 0 + + +def adjust_proc_create_time(ctime): + """Account for system clock updates.""" + if INIT_BOOT_TIME == 0: + return ctime + + diff = INIT_BOOT_TIME - boot_time() + if diff == 0 or abs(diff) < 1: + return ctime + + debug("system clock was updated; adjusting process create_time()") + if diff < 0: + return ctime - diff + return ctime + diff + + +def users(): + """Return currently connected users as a list of namedtuples.""" + retlist = [] + rawlist = cext.users() + for item in rawlist: + user, tty, hostname, tstamp, pid = item + if tty == '~': + continue # reboot or shutdown + if not tstamp: + continue + nt = ntp.suser(user, tty or None, hostname or None, tstamp, pid) + retlist.append(nt) + return retlist + + +# ===================================================================== +# --- processes +# ===================================================================== + + +def pids(): + ls = cext.pids() + if 0 not in ls: + # On certain macOS versions pids() C doesn't return PID 0 but + # "ps" does and the process is querable via sysctl(): + # https://travis-ci.org/giampaolo/psutil/jobs/309619941 + try: + Process(0).create_time() + ls.insert(0, 0) + except NoSuchProcess: + pass + except AccessDenied: + ls.insert(0, 0) + return ls + + +pid_exists = _psposix.pid_exists + + +def wrap_exceptions(fun): + """Decorator which translates bare OSError exceptions into + NoSuchProcess and AccessDenied. + """ + + @functools.wraps(fun) + def wrapper(self, *args, **kwargs): + pid, ppid, name = self.pid, self._ppid, self._name + try: + return fun(self, *args, **kwargs) + except ProcessLookupError as err: + if cext.proc_is_zombie(pid): + raise ZombieProcess(pid, name, ppid) from err + raise NoSuchProcess(pid, name) from err + except PermissionError as err: + raise AccessDenied(pid, name) from err + except cext.ZombieProcessError as err: + raise ZombieProcess(pid, name, ppid) from err + + return wrapper + + +class Process: + """Wrapper class around underlying C implementation.""" + + __slots__ = ["_cache", "_name", "_ppid", "pid"] + + def __init__(self, pid): + self.pid = pid + self._name = None + self._ppid = None + + @wrap_exceptions + @memoize_when_activated + def _get_kinfo_proc(self): + # Note: should work with all PIDs without permission issues. + ret = cext.proc_kinfo_oneshot(self.pid) + assert len(ret) == len(kinfo_proc_map) + return ret + + @wrap_exceptions + @memoize_when_activated + def _get_pidtaskinfo(self): + # Note: should work for PIDs owned by user only. + ret = cext.proc_pidtaskinfo_oneshot(self.pid) + assert len(ret) == len(pidtaskinfo_map) + return ret + + def oneshot_enter(self): + self._get_kinfo_proc.cache_activate(self) + self._get_pidtaskinfo.cache_activate(self) + + def oneshot_exit(self): + self._get_kinfo_proc.cache_deactivate(self) + self._get_pidtaskinfo.cache_deactivate(self) + + @wrap_exceptions + def name(self): + name = self._get_kinfo_proc()[kinfo_proc_map['name']] + return name if name is not None else cext.proc_name(self.pid) + + @wrap_exceptions + def exe(self): + return cext.proc_exe(self.pid) + + @wrap_exceptions + def cmdline(self): + return cext.proc_cmdline(self.pid) + + @wrap_exceptions + def environ(self): + return parse_environ_block(cext.proc_environ(self.pid)) + + @wrap_exceptions + def ppid(self): + self._ppid = self._get_kinfo_proc()[kinfo_proc_map['ppid']] + return self._ppid + + @wrap_exceptions + def cwd(self): + return cext.proc_cwd(self.pid) + + @wrap_exceptions + def uids(self): + rawtuple = self._get_kinfo_proc() + return ntp.puids( + rawtuple[kinfo_proc_map['ruid']], + rawtuple[kinfo_proc_map['euid']], + rawtuple[kinfo_proc_map['suid']], + ) + + @wrap_exceptions + def gids(self): + rawtuple = self._get_kinfo_proc() + return ntp.puids( + rawtuple[kinfo_proc_map['rgid']], + rawtuple[kinfo_proc_map['egid']], + rawtuple[kinfo_proc_map['sgid']], + ) + + @wrap_exceptions + def terminal(self): + tty_nr = self._get_kinfo_proc()[kinfo_proc_map['ttynr']] + tmap = _psposix.get_terminal_map() + try: + return tmap[tty_nr] + except KeyError: + return None + + @wrap_exceptions + def memory_info(self): + rawtuple = self._get_pidtaskinfo() + return ntp.pmem( + rawtuple[pidtaskinfo_map['rss']], + rawtuple[pidtaskinfo_map['vms']], + rawtuple[pidtaskinfo_map['pfaults']], + rawtuple[pidtaskinfo_map['pageins']], + ) + + @wrap_exceptions + def memory_full_info(self): + basic_mem = self.memory_info() + uss = cext.proc_memory_uss(self.pid) + return ntp.pfullmem(*basic_mem + (uss,)) + + @wrap_exceptions + def cpu_times(self): + rawtuple = self._get_pidtaskinfo() + return ntp.pcputimes( + rawtuple[pidtaskinfo_map['cpuutime']], + rawtuple[pidtaskinfo_map['cpustime']], + # children user / system times are not retrievable (set to 0) + 0.0, + 0.0, + ) + + @wrap_exceptions + def create_time(self, monotonic=False): + ctime = self._get_kinfo_proc()[kinfo_proc_map['ctime']] + if not monotonic: + ctime = adjust_proc_create_time(ctime) + return ctime + + @wrap_exceptions + def num_ctx_switches(self): + # Unvoluntary value seems not to be available; + # getrusage() numbers seems to confirm this theory. + # We set it to 0. + vol = self._get_pidtaskinfo()[pidtaskinfo_map['volctxsw']] + return ntp.pctxsw(vol, 0) + + @wrap_exceptions + def num_threads(self): + return self._get_pidtaskinfo()[pidtaskinfo_map['numthreads']] + + @wrap_exceptions + def open_files(self): + if self.pid == 0: + return [] + files = [] + rawlist = cext.proc_open_files(self.pid) + for path, fd in rawlist: + if isfile_strict(path): + ntuple = ntp.popenfile(path, fd) + files.append(ntuple) + return files + + @wrap_exceptions + def net_connections(self, kind='inet'): + families, types = conn_tmap[kind] + rawlist = cext.proc_net_connections(self.pid, families, types) + ret = [] + for item in rawlist: + fd, fam, type, laddr, raddr, status = item + nt = conn_to_ntuple( + fd, fam, type, laddr, raddr, status, TCP_STATUSES + ) + ret.append(nt) + return ret + + @wrap_exceptions + def num_fds(self): + if self.pid == 0: + return 0 + return cext.proc_num_fds(self.pid) + + @wrap_exceptions + def wait(self, timeout=None): + return _psposix.wait_pid(self.pid, timeout) + + @wrap_exceptions + def nice_get(self): + return cext.proc_priority_get(self.pid) + + @wrap_exceptions + def nice_set(self, value): + return cext.proc_priority_set(self.pid, value) + + @wrap_exceptions + def status(self): + code = self._get_kinfo_proc()[kinfo_proc_map['status']] + # XXX is '?' legit? (we're not supposed to return it anyway) + return PROC_STATUSES.get(code, '?') + + @wrap_exceptions + def threads(self): + rawlist = cext.proc_threads(self.pid) + retlist = [] + for thread_id, utime, stime in rawlist: + ntuple = ntp.pthread(thread_id, utime, stime) + retlist.append(ntuple) + return retlist diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_psposix.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_psposix.py new file mode 100644 index 0000000000000000000000000000000000000000..c7ad2fdabd30ee585642b49e38db9afc489b6ede --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_psposix.py @@ -0,0 +1,363 @@ +# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Routines common to all posix systems.""" + +import enum +import errno +import glob +import os +import select +import signal +import time + +from . import _ntuples as ntp +from ._common import MACOS +from ._common import TimeoutExpired +from ._common import debug +from ._common import memoize +from ._common import usage_percent + +if MACOS: + from . import _psutil_osx + + +__all__ = ['pid_exists', 'wait_pid', 'disk_usage', 'get_terminal_map'] + + +def pid_exists(pid): + """Check whether pid exists in the current process table.""" + if pid == 0: + # According to "man 2 kill" PID 0 has a special meaning: + # it refers to <> so we don't want to go any further. + # If we get here it means this UNIX platform *does* have + # a process with id 0. + return True + try: + os.kill(pid, 0) + except ProcessLookupError: + return False + except PermissionError: + # EPERM clearly means there's a process to deny access to + return True + # According to "man 2 kill" possible error values are + # (EINVAL, EPERM, ESRCH) + else: + return True + + +Negsignal = enum.IntEnum( + 'Negsignal', {x.name: -x.value for x in signal.Signals} +) + + +def negsig_to_enum(num): + """Convert a negative signal value to an enum.""" + try: + return Negsignal(num) + except ValueError: + return num + + +def convert_exit_code(status): + """Convert a os.waitpid() status to an exit code.""" + if os.WIFEXITED(status): + # Process terminated normally by calling exit(3) or _exit(2), + # or by returning from main(). The return value is the + # positive integer passed to *exit(). + return os.WEXITSTATUS(status) + if os.WIFSIGNALED(status): + # Process exited due to a signal. Return the negative value + # of that signal. + return negsig_to_enum(-os.WTERMSIG(status)) + # if os.WIFSTOPPED(status): + # # Process was stopped via SIGSTOP or is being traced, and + # # waitpid() was called with WUNTRACED flag. PID is still + # # alive. From now on waitpid() will keep returning (0, 0) + # # until the process state doesn't change. + # # It may make sense to catch/enable this since stopped PIDs + # # ignore SIGTERM. + # interval = sleep(interval) + # continue + # if os.WIFCONTINUED(status): + # # Process was resumed via SIGCONT and waitpid() was called + # # with WCONTINUED flag. + # interval = sleep(interval) + # continue + + # Should never happen. + msg = f"unknown process exit status {status!r}" + raise ValueError(msg) + + +def wait_pid_posix( + pid, + timeout=None, + _waitpid=os.waitpid, + _timer=getattr(time, 'monotonic', time.time), # noqa: B008 + _min=min, + _sleep=time.sleep, + _pid_exists=pid_exists, +): + """Wait for a process PID to terminate. + + If the process terminated normally by calling exit(3) or _exit(2), + or by returning from main(), the return value is the positive integer + passed to *exit(). + + If it was terminated by a signal it returns the negated value of the + signal which caused the termination (e.g. -SIGTERM). + + If PID is not a children of os.getpid() (current process) just + wait until the process disappears and return None. + + If PID does not exist at all return None immediately. + + If timeout is specified and process is still alive raise + TimeoutExpired. + + If timeout=0 either return immediately or raise TimeoutExpired + (non-blocking). + """ + interval = 0.0001 + max_interval = 0.04 + flags = 0 + stop_at = None + + if timeout is not None: + flags |= os.WNOHANG + if timeout != 0: + stop_at = _timer() + timeout + + def sleep_or_timeout(interval): + # Sleep for some time and return a new increased interval. + if timeout == 0 or (stop_at is not None and _timer() >= stop_at): + raise TimeoutExpired(timeout) + _sleep(interval) + return _min(interval * 2, max_interval) + + # See: https://linux.die.net/man/2/waitpid + while True: + try: + retpid, status = os.waitpid(pid, flags) + except ChildProcessError: + # This has two meanings: + # - PID is not a child of os.getpid() in which case + # we keep polling until it's gone + # - PID never existed in the first place + # In both cases we'll eventually return None as we + # can't determine its exit status code. + while _pid_exists(pid): + interval = sleep_or_timeout(interval) + return None + else: + if retpid == 0: + # WNOHANG flag was used and PID is still running. + interval = sleep_or_timeout(interval) + else: + return convert_exit_code(status) + + +def _waitpid(pid, timeout): + """Wrapper around os.waitpid(). PID is supposed to be gone already, + it just returns the exit code. + """ + try: + retpid, status = os.waitpid(pid, 0) + except ChildProcessError: + # PID is not a child of os.getpid(). + return wait_pid_posix(pid, timeout) + else: + assert retpid != 0 + return convert_exit_code(status) + + +def wait_pid_pidfd_open(pid, timeout=None): + """Wait for PID to terminate using pidfd_open() + poll(). Linux >= + 5.3 + Python >= 3.9 only. + """ + try: + pidfd = os.pidfd_open(pid, 0) + except OSError as err: + if err.errno == errno.ESRCH: + # No such process. os.waitpid() may still be able to return + # the status code. + return wait_pid_posix(pid, timeout) + if err.errno in {errno.EMFILE, errno.ENFILE, errno.ENODEV}: + # EMFILE, ENFILE: too many open files + # ENODEV: anonymous inode filesystem not supported + debug(f"pidfd_open() failed ({err!r}); use fallback") + return wait_pid_posix(pid, timeout) + raise + + try: + # poll() / select() have the advantage of not requiring any + # extra file descriptor, contrary to epoll() / kqueue(). + # select() crashes if process opens > 1024 FDs, so we use + # poll(). + poller = select.poll() + poller.register(pidfd, select.POLLIN) + timeout_ms = None if timeout is None else int(timeout * 1000) + events = poller.poll(timeout_ms) # wait + + if not events: + raise TimeoutExpired(timeout) + return _waitpid(pid, timeout) + finally: + os.close(pidfd) + + +def wait_pid_kqueue(pid, timeout=None): + """Wait for PID to terminate using kqueue(). macOS and BSD only.""" + try: + kq = select.kqueue() + except OSError as err: + if err.errno in {errno.EMFILE, errno.ENFILE}: # too many open files + debug(f"kqueue() failed ({err!r}); use fallback") + return wait_pid_posix(pid, timeout) + raise + + try: + kev = select.kevent( + pid, + filter=select.KQ_FILTER_PROC, + flags=select.KQ_EV_ADD | select.KQ_EV_ONESHOT, + fflags=select.KQ_NOTE_EXIT, + ) + try: + events = kq.control([kev], 1, timeout) # wait + except OSError as err: + if err.errno in {errno.EACCES, errno.EPERM, errno.ESRCH}: + debug(f"kqueue.control() failed ({err!r}); use fallback") + return wait_pid_posix(pid, timeout) + raise + else: + if not events: + raise TimeoutExpired(timeout) + return _waitpid(pid, timeout) + finally: + kq.close() + + +@memoize +def can_use_pidfd_open(): + # Availability: Linux >= 5.3, Python >= 3.9 + if not hasattr(os, "pidfd_open"): + return False + try: + pidfd = os.pidfd_open(os.getpid(), 0) + except OSError as err: + if err.errno in {errno.EMFILE, errno.ENFILE}: # noqa: SIM103 + # transitory 'too many open files' + return True + # likely blocked by security policy like SECCOMP (EPERM, + # EACCES, ENOSYS) + return False + else: + os.close(pidfd) + return True + + +@memoize +def can_use_kqueue(): + # Availability: macOS, BSD + names = ( + "kqueue", + "KQ_EV_ADD", + "KQ_EV_ONESHOT", + "KQ_FILTER_PROC", + "KQ_NOTE_EXIT", + ) + if not all(hasattr(select, x) for x in names): + return False + kq = None + try: + kq = select.kqueue() + kev = select.kevent( + os.getpid(), + filter=select.KQ_FILTER_PROC, + flags=select.KQ_EV_ADD | select.KQ_EV_ONESHOT, + fflags=select.KQ_NOTE_EXIT, + ) + kq.control([kev], 1, 0) + return True + except OSError as err: + if err.errno in {errno.EMFILE, errno.ENFILE}: # noqa: SIM103 + # transitory 'too many open files' + return True + return False + finally: + if kq is not None: + kq.close() + + +def wait_pid(pid, timeout=None): + # PID 0 passed to waitpid() waits for any child of the current + # process to change state. + assert pid > 0 + if timeout is not None: + assert timeout >= 0 + + if can_use_pidfd_open(): + return wait_pid_pidfd_open(pid, timeout) + elif can_use_kqueue(): + return wait_pid_kqueue(pid, timeout) + else: + return wait_pid_posix(pid, timeout) + + +wait_pid.__doc__ = wait_pid_posix.__doc__ + + +def disk_usage(path): + """Return disk usage associated with path. + Note: UNIX usually reserves 5% disk space which is not accessible + by user. In this function "total" and "used" values reflect the + total and used disk space whereas "free" and "percent" represent + the "free" and "used percent" user disk space. + """ + st = os.statvfs(path) + # Total space which is only available to root (unless changed + # at system level). + total = st.f_blocks * st.f_frsize + # Remaining free space usable by root. + avail_to_root = st.f_bfree * st.f_frsize + # Remaining free space usable by user. + avail_to_user = st.f_bavail * st.f_frsize + # Total space being used in general. + used = total - avail_to_root + if MACOS: + # see: https://github.com/giampaolo/psutil/pull/2152 + used = _psutil_osx.disk_usage_used(path, used) + # Total space which is available to user (same as 'total' but + # for the user). + total_user = used + avail_to_user + # User usage percent compared to the total amount of space + # the user can use. This number would be higher if compared + # to root's because the user has less space (usually -5%). + usage_percent_user = usage_percent(used, total_user, round_=1) + + # NB: the percentage is -5% than what shown by df due to + # reserved blocks that we are currently not considering: + # https://github.com/giampaolo/psutil/issues/829#issuecomment-223750462 + return ntp.sdiskusage( + total=total, used=used, free=avail_to_user, percent=usage_percent_user + ) + + +@memoize +def get_terminal_map(): + """Get a map of device-id -> path as a dict. + Used by Process.terminal(). + """ + ret = {} + ls = glob.glob('/dev/tty*') + glob.glob('/dev/pts/*') + for name in ls: + assert name not in ret, name + try: + ret[os.stat(name).st_rdev] = name + except FileNotFoundError: + pass + return ret diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_pssunos.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_pssunos.py new file mode 100644 index 0000000000000000000000000000000000000000..a0e70581f5a02dfbc8e61a9d26e105ee6160a8aa --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_pssunos.py @@ -0,0 +1,704 @@ +# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Sun OS Solaris platform implementation.""" + +import errno +import functools +import os +import socket +import subprocess +import sys +from collections import namedtuple +from socket import AF_INET + +from . import _common +from . import _ntuples as ntp +from . import _psposix +from . import _psutil_sunos as cext +from ._common import AF_INET6 +from ._common import ENCODING +from ._common import AccessDenied +from ._common import NoSuchProcess +from ._common import ZombieProcess +from ._common import debug +from ._common import get_procfs_path +from ._common import isfile_strict +from ._common import memoize_when_activated +from ._common import sockfam_to_enum +from ._common import socktype_to_enum +from ._common import usage_percent + +__extra__all__ = ["CONN_IDLE", "CONN_BOUND", "PROCFS_PATH"] + + +# ===================================================================== +# --- globals +# ===================================================================== + + +PAGE_SIZE = cext.getpagesize() +AF_LINK = cext.AF_LINK +IS_64_BIT = sys.maxsize > 2**32 + +CONN_IDLE = "IDLE" +CONN_BOUND = "BOUND" + +PROC_STATUSES = { + cext.SSLEEP: _common.STATUS_SLEEPING, + cext.SRUN: _common.STATUS_RUNNING, + cext.SZOMB: _common.STATUS_ZOMBIE, + cext.SSTOP: _common.STATUS_STOPPED, + cext.SIDL: _common.STATUS_IDLE, + cext.SONPROC: _common.STATUS_RUNNING, # same as run + cext.SWAIT: _common.STATUS_WAITING, +} + +TCP_STATUSES = { + cext.TCPS_ESTABLISHED: _common.CONN_ESTABLISHED, + cext.TCPS_SYN_SENT: _common.CONN_SYN_SENT, + cext.TCPS_SYN_RCVD: _common.CONN_SYN_RECV, + cext.TCPS_FIN_WAIT_1: _common.CONN_FIN_WAIT1, + cext.TCPS_FIN_WAIT_2: _common.CONN_FIN_WAIT2, + cext.TCPS_TIME_WAIT: _common.CONN_TIME_WAIT, + cext.TCPS_CLOSED: _common.CONN_CLOSE, + cext.TCPS_CLOSE_WAIT: _common.CONN_CLOSE_WAIT, + cext.TCPS_LAST_ACK: _common.CONN_LAST_ACK, + cext.TCPS_LISTEN: _common.CONN_LISTEN, + cext.TCPS_CLOSING: _common.CONN_CLOSING, + cext.PSUTIL_CONN_NONE: _common.CONN_NONE, + cext.TCPS_IDLE: CONN_IDLE, # sunos specific + cext.TCPS_BOUND: CONN_BOUND, # sunos specific +} + +proc_info_map = dict( + ppid=0, + rss=1, + vms=2, + create_time=3, + nice=4, + num_threads=5, + status=6, + ttynr=7, + uid=8, + euid=9, + gid=10, + egid=11, +) + + +# ===================================================================== +# --- memory +# ===================================================================== + + +def virtual_memory(): + """Report virtual memory metrics.""" + # we could have done this with kstat, but IMHO this is good enough + total = os.sysconf('SC_PHYS_PAGES') * PAGE_SIZE + # note: there's no difference on Solaris + free = avail = os.sysconf('SC_AVPHYS_PAGES') * PAGE_SIZE + used = total - free + percent = usage_percent(used, total, round_=1) + return ntp.svmem(total, avail, percent, used, free) + + +def swap_memory(): + """Report swap memory metrics.""" + sin, sout = cext.swap_mem() + # XXX + # we are supposed to get total/free by doing so: + # http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/ + # usr/src/cmd/swap/swap.c + # ...nevertheless I can't manage to obtain the same numbers as 'swap' + # cmdline utility, so let's parse its output (sigh!) + p = subprocess.Popen( + [ + '/usr/bin/env', + f"PATH=/usr/sbin:/sbin:{os.environ['PATH']}", + 'swap', + '-l', + ], + stdout=subprocess.PIPE, + ) + stdout, _ = p.communicate() + stdout = stdout.decode(sys.stdout.encoding) + if p.returncode != 0: + msg = f"'swap -l' failed (retcode={p.returncode})" + raise RuntimeError(msg) + + lines = stdout.strip().split('\n')[1:] + if not lines: + msg = 'no swap device(s) configured' + raise RuntimeError(msg) + total = free = 0 + for line in lines: + line = line.split() + t, f = line[3:5] + total += int(int(t) * 512) + free += int(int(f) * 512) + used = total - free + percent = usage_percent(used, total, round_=1) + return ntp.sswap( + total, used, free, percent, sin * PAGE_SIZE, sout * PAGE_SIZE + ) + + +# ===================================================================== +# --- CPU +# ===================================================================== + + +def cpu_times(): + """Return system-wide CPU times as a named tuple.""" + ret = cext.per_cpu_times() + return ntp.scputimes(*[sum(x) for x in zip(*ret)]) + + +def per_cpu_times(): + """Return system per-CPU times as a list of named tuples.""" + ret = cext.per_cpu_times() + return [ntp.scputimes(*x) for x in ret] + + +def cpu_count_logical(): + """Return the number of logical CPUs in the system.""" + try: + return os.sysconf("SC_NPROCESSORS_ONLN") + except ValueError: + # mimic os.cpu_count() behavior + return None + + +def cpu_count_cores(): + """Return the number of CPU cores in the system.""" + return cext.cpu_count_cores() + + +def cpu_stats(): + """Return various CPU stats as a named tuple.""" + ctx_switches, interrupts, syscalls, _traps = cext.cpu_stats() + soft_interrupts = 0 + return ntp.scpustats(ctx_switches, interrupts, soft_interrupts, syscalls) + + +# ===================================================================== +# --- disks +# ===================================================================== + + +disk_io_counters = cext.disk_io_counters +disk_usage = _psposix.disk_usage + + +def disk_partitions(all=False): + """Return system disk partitions.""" + # TODO - the filtering logic should be better checked so that + # it tries to reflect 'df' as much as possible + retlist = [] + partitions = cext.disk_partitions() + for partition in partitions: + device, mountpoint, fstype, opts = partition + if device == 'none': + device = '' + if not all: + # Differently from, say, Linux, we don't have a list of + # common fs types so the best we can do, AFAIK, is to + # filter by filesystem having a total size > 0. + try: + if not disk_usage(mountpoint).total: + continue + except OSError as err: + # https://github.com/giampaolo/psutil/issues/1674 + debug(f"skipping {mountpoint!r}: {err}") + continue + ntuple = ntp.sdiskpart(device, mountpoint, fstype, opts) + retlist.append(ntuple) + return retlist + + +# ===================================================================== +# --- network +# ===================================================================== + + +net_io_counters = cext.net_io_counters +net_if_addrs = cext.net_if_addrs + + +def net_connections(kind, _pid=-1): + """Return socket connections. If pid == -1 return system-wide + connections (as opposed to connections opened by one process only). + Only INET sockets are returned (UNIX are not). + """ + families, types = _common.conn_tmap[kind] + rawlist = cext.net_connections(_pid) + ret = set() + for item in rawlist: + fd, fam, type_, laddr, raddr, status, pid = item + if fam not in families: + continue + if type_ not in types: + continue + # TODO: refactor and use _common.conn_to_ntuple. + if fam in {AF_INET, AF_INET6}: + if laddr: + laddr = ntp.addr(*laddr) + if raddr: + raddr = ntp.addr(*raddr) + status = TCP_STATUSES[status] + fam = sockfam_to_enum(fam) + type_ = socktype_to_enum(type_) + if _pid == -1: + nt = ntp.sconn(fd, fam, type_, laddr, raddr, status, pid) + else: + nt = ntp.pconn(fd, fam, type_, laddr, raddr, status) + ret.add(nt) + return list(ret) + + +def net_if_stats(): + """Get NIC stats (isup, duplex, speed, mtu).""" + ret = cext.net_if_stats() + for name, items in ret.items(): + isup, duplex, speed, mtu = items + if hasattr(_common, 'NicDuplex'): + duplex = _common.NicDuplex(duplex) + ret[name] = ntp.snicstats(isup, duplex, speed, mtu, '') + return ret + + +# ===================================================================== +# --- other system functions +# ===================================================================== + + +def boot_time(): + """The system boot time expressed in seconds since the epoch.""" + return cext.boot_time() + + +def users(): + """Return currently connected users as a list of namedtuples.""" + retlist = [] + rawlist = cext.users() + localhost = (':0.0', ':0') + for item in rawlist: + user, tty, hostname, tstamp, user_process, pid = item + # note: the underlying C function includes entries about + # system boot, run level and others. We might want + # to use them in the future. + if not user_process: + continue + if hostname in localhost: + hostname = 'localhost' + nt = ntp.suser(user, tty, hostname, tstamp, pid) + retlist.append(nt) + return retlist + + +# ===================================================================== +# --- processes +# ===================================================================== + + +def pids(): + """Returns a list of PIDs currently running on the system.""" + path = get_procfs_path().encode(ENCODING) + return [int(x) for x in os.listdir(path) if x.isdigit()] + + +def pid_exists(pid): + """Check for the existence of a unix pid.""" + return _psposix.pid_exists(pid) + + +def wrap_exceptions(fun): + """Call callable into a try/except clause and translate ENOENT, + EACCES and EPERM in NoSuchProcess or AccessDenied exceptions. + """ + + @functools.wraps(fun) + def wrapper(self, *args, **kwargs): + pid, ppid, name = self.pid, self._ppid, self._name + try: + return fun(self, *args, **kwargs) + except (FileNotFoundError, ProcessLookupError) as err: + # ENOENT (no such file or directory) gets raised on open(). + # ESRCH (no such process) can get raised on read() if + # process is gone in meantime. + if not pid_exists(pid): + raise NoSuchProcess(pid, name) from err + raise ZombieProcess(pid, name, ppid) from err + except PermissionError as err: + raise AccessDenied(pid, name) from err + except OSError as err: + if pid == 0: + if 0 in pids(): + raise AccessDenied(pid, name) from err + raise + raise + + return wrapper + + +class Process: + """Wrapper class around underlying C implementation.""" + + __slots__ = ["_cache", "_name", "_ppid", "_procfs_path", "pid"] + + def __init__(self, pid): + self.pid = pid + self._name = None + self._ppid = None + self._procfs_path = get_procfs_path() + + def _assert_alive(self): + """Raise NSP if the process disappeared on us.""" + # For those C function who do not raise NSP, possibly returning + # incorrect or incomplete result. + os.stat(f"{self._procfs_path}/{self.pid}") + + def oneshot_enter(self): + self._proc_name_and_args.cache_activate(self) + self._proc_basic_info.cache_activate(self) + self._proc_cred.cache_activate(self) + + def oneshot_exit(self): + self._proc_name_and_args.cache_deactivate(self) + self._proc_basic_info.cache_deactivate(self) + self._proc_cred.cache_deactivate(self) + + @wrap_exceptions + @memoize_when_activated + def _proc_name_and_args(self): + return cext.proc_name_and_args(self.pid, self._procfs_path) + + @wrap_exceptions + @memoize_when_activated + def _proc_basic_info(self): + if self.pid == 0 and not os.path.exists( + f"{self._procfs_path}/{self.pid}/psinfo" + ): + raise AccessDenied(self.pid) + ret = cext.proc_basic_info(self.pid, self._procfs_path) + assert len(ret) == len(proc_info_map) + return ret + + @wrap_exceptions + @memoize_when_activated + def _proc_cred(self): + return cext.proc_cred(self.pid, self._procfs_path) + + @wrap_exceptions + def name(self): + # note: max len == 15 + return self._proc_name_and_args()[0] + + @wrap_exceptions + def exe(self): + try: + return os.readlink(f"{self._procfs_path}/{self.pid}/path/a.out") + except OSError: + pass # continue and guess the exe name from the cmdline + # Will be guessed later from cmdline but we want to explicitly + # invoke cmdline here in order to get an AccessDenied + # exception if the user has not enough privileges. + self.cmdline() + return "" + + @wrap_exceptions + def cmdline(self): + return self._proc_name_and_args()[1] + + @wrap_exceptions + def environ(self): + return cext.proc_environ(self.pid, self._procfs_path) + + @wrap_exceptions + def create_time(self): + return self._proc_basic_info()[proc_info_map['create_time']] + + @wrap_exceptions + def num_threads(self): + return self._proc_basic_info()[proc_info_map['num_threads']] + + @wrap_exceptions + def nice_get(self): + # Note #1: getpriority(3) doesn't work for realtime processes. + # Psinfo is what ps uses, see: + # https://github.com/giampaolo/psutil/issues/1194 + return self._proc_basic_info()[proc_info_map['nice']] + + @wrap_exceptions + def nice_set(self, value): + if self.pid in {2, 3}: + # Special case PIDs: internally setpriority(3) return ESRCH + # (no such process), no matter what. + # The process actually exists though, as it has a name, + # creation time, etc. + raise AccessDenied(self.pid, self._name) + return cext.proc_priority_set(self.pid, value) + + @wrap_exceptions + def ppid(self): + self._ppid = self._proc_basic_info()[proc_info_map['ppid']] + return self._ppid + + @wrap_exceptions + def uids(self): + try: + real, effective, saved, _, _, _ = self._proc_cred() + except AccessDenied: + real = self._proc_basic_info()[proc_info_map['uid']] + effective = self._proc_basic_info()[proc_info_map['euid']] + saved = None + return ntp.puids(real, effective, saved) + + @wrap_exceptions + def gids(self): + try: + _, _, _, real, effective, saved = self._proc_cred() + except AccessDenied: + real = self._proc_basic_info()[proc_info_map['gid']] + effective = self._proc_basic_info()[proc_info_map['egid']] + saved = None + return ntp.puids(real, effective, saved) + + @wrap_exceptions + def cpu_times(self): + try: + times = cext.proc_cpu_times(self.pid, self._procfs_path) + except OSError as err: + if err.errno == errno.EOVERFLOW and not IS_64_BIT: + # We may get here if we attempt to query a 64bit process + # with a 32bit python. + # Error originates from read() and also tools like "cat" + # fail in the same way (!). + # Since there simply is no way to determine CPU times we + # return 0.0 as a fallback. See: + # https://github.com/giampaolo/psutil/issues/857 + times = (0.0, 0.0, 0.0, 0.0) + else: + raise + return ntp.pcputimes(*times) + + @wrap_exceptions + def cpu_num(self): + return cext.proc_cpu_num(self.pid, self._procfs_path) + + @wrap_exceptions + def terminal(self): + procfs_path = self._procfs_path + hit_enoent = False + tty = wrap_exceptions(self._proc_basic_info()[proc_info_map['ttynr']]) + if tty != cext.PRNODEV: + for x in (0, 1, 2, 255): + try: + return os.readlink(f"{procfs_path}/{self.pid}/path/{x}") + except FileNotFoundError: + hit_enoent = True + continue + if hit_enoent: + self._assert_alive() + + @wrap_exceptions + def cwd(self): + # /proc/PID/path/cwd may not be resolved by readlink() even if + # it exists (ls shows it). If that's the case and the process + # is still alive return None (we can return None also on BSD). + # Reference: https://groups.google.com/g/comp.unix.solaris/c/tcqvhTNFCAs + procfs_path = self._procfs_path + try: + return os.readlink(f"{procfs_path}/{self.pid}/path/cwd") + except FileNotFoundError: + os.stat(f"{procfs_path}/{self.pid}") # raise NSP or AD + return "" + + @wrap_exceptions + def memory_info(self): + ret = self._proc_basic_info() + rss = ret[proc_info_map['rss']] * 1024 + vms = ret[proc_info_map['vms']] * 1024 + return ntp.pmem(rss, vms) + + memory_full_info = memory_info + + @wrap_exceptions + def status(self): + code = self._proc_basic_info()[proc_info_map['status']] + # XXX is '?' legit? (we're not supposed to return it anyway) + return PROC_STATUSES.get(code, '?') + + @wrap_exceptions + def threads(self): + procfs_path = self._procfs_path + ret = [] + tids = os.listdir(f"{procfs_path}/{self.pid}/lwp") + hit_enoent = False + for tid in tids: + tid = int(tid) + try: + utime, stime = cext.query_process_thread( + self.pid, tid, procfs_path + ) + except OSError as err: + if err.errno == errno.EOVERFLOW and not IS_64_BIT: + # We may get here if we attempt to query a 64bit process + # with a 32bit python. + # Error originates from read() and also tools like "cat" + # fail in the same way (!). + # Since there simply is no way to determine CPU times we + # return 0.0 as a fallback. See: + # https://github.com/giampaolo/psutil/issues/857 + continue + # ENOENT == thread gone in meantime + if err.errno == errno.ENOENT: + hit_enoent = True + continue + raise + else: + nt = ntp.pthread(tid, utime, stime) + ret.append(nt) + if hit_enoent: + self._assert_alive() + return ret + + @wrap_exceptions + def open_files(self): + retlist = [] + hit_enoent = False + procfs_path = self._procfs_path + pathdir = f"{procfs_path}/{self.pid}/path" + for fd in os.listdir(f"{procfs_path}/{self.pid}/fd"): + path = os.path.join(pathdir, fd) + if os.path.islink(path): + try: + file = os.readlink(path) + except FileNotFoundError: + hit_enoent = True + continue + else: + if isfile_strict(file): + retlist.append(ntp.popenfile(file, int(fd))) + if hit_enoent: + self._assert_alive() + return retlist + + def _get_unix_sockets(self, pid): + """Get UNIX sockets used by process by parsing 'pfiles' output.""" + # TODO: rewrite this in C (...but the damn netstat source code + # does not include this part! Argh!!) + cmd = ["pfiles", str(pid)] + p = subprocess.Popen( + cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE + ) + stdout, stderr = p.communicate() + stdout, stderr = ( + x.decode(sys.stdout.encoding) for x in (stdout, stderr) + ) + if p.returncode != 0: + if 'permission denied' in stderr.lower(): + raise AccessDenied(self.pid, self._name) + if 'no such process' in stderr.lower(): + raise NoSuchProcess(self.pid, self._name) + msg = f"{cmd!r} command error\n{stderr}" + raise RuntimeError(msg) + + lines = stdout.split('\n')[2:] + for i, line in enumerate(lines): + line = line.lstrip() + if line.startswith('sockname: AF_UNIX'): + path = line.split(' ', 2)[2] + type = lines[i - 2].strip() + if type == 'SOCK_STREAM': + type = socket.SOCK_STREAM + elif type == 'SOCK_DGRAM': + type = socket.SOCK_DGRAM + else: + type = -1 + yield (-1, socket.AF_UNIX, type, path, "", _common.CONN_NONE) + + @wrap_exceptions + def net_connections(self, kind='inet'): + ret = net_connections(kind, _pid=self.pid) + # The underlying C implementation retrieves all OS connections + # and filters them by PID. At this point we can't tell whether + # an empty list means there were no connections for process or + # process is no longer active so we force NSP in case the PID + # is no longer there. + if not ret: + # will raise NSP if process is gone + os.stat(f"{self._procfs_path}/{self.pid}") + + # UNIX sockets + if kind in {'all', 'unix'}: + ret.extend( + [ntp.pconn(*conn) for conn in self._get_unix_sockets(self.pid)] + ) + return ret + + nt_mmap_grouped = namedtuple('mmap', 'path rss anon locked') + nt_mmap_ext = namedtuple('mmap', 'addr perms path rss anon locked') + + @wrap_exceptions + def memory_maps(self): + def toaddr(start, end): + return "{}-{}".format( + hex(start)[2:].strip('L'), hex(end)[2:].strip('L') + ) + + procfs_path = self._procfs_path + retlist = [] + try: + rawlist = cext.proc_memory_maps(self.pid, procfs_path) + except OSError as err: + if err.errno == errno.EOVERFLOW and not IS_64_BIT: + # We may get here if we attempt to query a 64bit process + # with a 32bit python. + # Error originates from read() and also tools like "cat" + # fail in the same way (!). + # Since there simply is no way to determine CPU times we + # return 0.0 as a fallback. See: + # https://github.com/giampaolo/psutil/issues/857 + return [] + else: + raise + hit_enoent = False + for item in rawlist: + addr, addrsize, perm, name, rss, anon, locked = item + addr = toaddr(addr, addrsize) + if not name.startswith('['): + try: + name = os.readlink(f"{procfs_path}/{self.pid}/path/{name}") + except OSError as err: + if err.errno == errno.ENOENT: + # sometimes the link may not be resolved by + # readlink() even if it exists (ls shows it). + # If that's the case we just return the + # unresolved link path. + # This seems an inconsistency with /proc similar + # to: http://goo.gl/55XgO + name = f"{procfs_path}/{self.pid}/path/{name}" + hit_enoent = True + else: + raise + retlist.append((addr, perm, name, rss, anon, locked)) + if hit_enoent: + self._assert_alive() + return retlist + + @wrap_exceptions + def num_fds(self): + return len(os.listdir(f"{self._procfs_path}/{self.pid}/fd")) + + @wrap_exceptions + def num_ctx_switches(self): + return ntp.pctxsw( + *cext.proc_num_ctx_switches(self.pid, self._procfs_path) + ) + + @wrap_exceptions + def wait(self, timeout=None): + return _psposix.wait_pid(self.pid, timeout) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_psutil_windows.cp314t-win_amd64.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_psutil_windows.cp314t-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..c79a58c9e83fca1b8d5dc5ddff5f45625036c816 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_psutil_windows.cp314t-win_amd64.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_pswindows.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_pswindows.py new file mode 100644 index 0000000000000000000000000000000000000000..3ee1eafce0bb08f86df6d08d30a66bb2058c6f7c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/Lib/site-packages/psutil/_pswindows.py @@ -0,0 +1,1096 @@ +# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Windows platform implementation.""" + +import contextlib +import enum +import functools +import os +import signal +import sys +import threading +import time + +from . import _common +from . import _ntuples as ntp +from ._common import ENCODING +from ._common import AccessDenied +from ._common import NoSuchProcess +from ._common import TimeoutExpired +from ._common import conn_tmap +from ._common import conn_to_ntuple +from ._common import debug +from ._common import isfile_strict +from ._common import memoize +from ._common import memoize_when_activated +from ._common import parse_environ_block +from ._common import usage_percent +from ._psutil_windows import ABOVE_NORMAL_PRIORITY_CLASS +from ._psutil_windows import BELOW_NORMAL_PRIORITY_CLASS +from ._psutil_windows import HIGH_PRIORITY_CLASS +from ._psutil_windows import IDLE_PRIORITY_CLASS +from ._psutil_windows import NORMAL_PRIORITY_CLASS +from ._psutil_windows import REALTIME_PRIORITY_CLASS + +try: + from . import _psutil_windows as cext +except ImportError as err: + if ( + str(err).lower().startswith("dll load failed") + and sys.getwindowsversion()[0] < 6 + ): + # We may get here if: + # 1) we are on an old Windows version + # 2) psutil was installed via pip + wheel + # See: https://github.com/giampaolo/psutil/issues/811 + msg = "this Windows version is too old (< Windows Vista); " + msg += "psutil 3.4.2 is the latest version which supports Windows " + msg += "2000, XP and 2003 server" + raise RuntimeError(msg) from err + else: + raise + + +# process priority constants, import from __init__.py: +# http://msdn.microsoft.com/en-us/library/ms686219(v=vs.85).aspx +# fmt: off +__extra__all__ = [ + "win_service_iter", "win_service_get", + # Process priority + "ABOVE_NORMAL_PRIORITY_CLASS", "BELOW_NORMAL_PRIORITY_CLASS", + "HIGH_PRIORITY_CLASS", "IDLE_PRIORITY_CLASS", "NORMAL_PRIORITY_CLASS", + "REALTIME_PRIORITY_CLASS", + # IO priority + "IOPRIO_VERYLOW", "IOPRIO_LOW", "IOPRIO_NORMAL", "IOPRIO_HIGH", + # others + "CONN_DELETE_TCB", "AF_LINK", +] +# fmt: on + + +# ===================================================================== +# --- globals +# ===================================================================== + +CONN_DELETE_TCB = "DELETE_TCB" +ERROR_PARTIAL_COPY = 299 +PYPY = '__pypy__' in sys.builtin_module_names + +AddressFamily = enum.IntEnum('AddressFamily', {'AF_LINK': -1}) +AF_LINK = AddressFamily.AF_LINK + +TCP_STATUSES = { + cext.MIB_TCP_STATE_ESTAB: _common.CONN_ESTABLISHED, + cext.MIB_TCP_STATE_SYN_SENT: _common.CONN_SYN_SENT, + cext.MIB_TCP_STATE_SYN_RCVD: _common.CONN_SYN_RECV, + cext.MIB_TCP_STATE_FIN_WAIT1: _common.CONN_FIN_WAIT1, + cext.MIB_TCP_STATE_FIN_WAIT2: _common.CONN_FIN_WAIT2, + cext.MIB_TCP_STATE_TIME_WAIT: _common.CONN_TIME_WAIT, + cext.MIB_TCP_STATE_CLOSED: _common.CONN_CLOSE, + cext.MIB_TCP_STATE_CLOSE_WAIT: _common.CONN_CLOSE_WAIT, + cext.MIB_TCP_STATE_LAST_ACK: _common.CONN_LAST_ACK, + cext.MIB_TCP_STATE_LISTEN: _common.CONN_LISTEN, + cext.MIB_TCP_STATE_CLOSING: _common.CONN_CLOSING, + cext.MIB_TCP_STATE_DELETE_TCB: CONN_DELETE_TCB, + cext.PSUTIL_CONN_NONE: _common.CONN_NONE, +} + + +class Priority(enum.IntEnum): + ABOVE_NORMAL_PRIORITY_CLASS = ABOVE_NORMAL_PRIORITY_CLASS + BELOW_NORMAL_PRIORITY_CLASS = BELOW_NORMAL_PRIORITY_CLASS + HIGH_PRIORITY_CLASS = HIGH_PRIORITY_CLASS + IDLE_PRIORITY_CLASS = IDLE_PRIORITY_CLASS + NORMAL_PRIORITY_CLASS = NORMAL_PRIORITY_CLASS + REALTIME_PRIORITY_CLASS = REALTIME_PRIORITY_CLASS + + +globals().update(Priority.__members__) + + +class IOPriority(enum.IntEnum): + IOPRIO_VERYLOW = 0 + IOPRIO_LOW = 1 + IOPRIO_NORMAL = 2 + IOPRIO_HIGH = 3 + + +globals().update(IOPriority.__members__) + +pinfo_map = dict( + num_handles=0, + ctx_switches=1, + user_time=2, + kernel_time=3, + create_time=4, + num_threads=5, + io_rcount=6, + io_wcount=7, + io_rbytes=8, + io_wbytes=9, + io_count_others=10, + io_bytes_others=11, + num_page_faults=12, + peak_wset=13, + wset=14, + peak_paged_pool=15, + paged_pool=16, + peak_non_paged_pool=17, + non_paged_pool=18, + pagefile=19, + peak_pagefile=20, + mem_private=21, +) + + +# ===================================================================== +# --- utils +# ===================================================================== + + +@functools.lru_cache(maxsize=512) +def convert_dos_path(s): + r"""Convert paths using native DOS format like: + "\Device\HarddiskVolume1\Windows\systemew\file.txt" or + "\??\C:\Windows\systemew\file.txt" + into: + "C:\Windows\systemew\file.txt". + """ + if s.startswith('\\\\'): + return s + rawdrive = '\\'.join(s.split('\\')[:3]) + if rawdrive in {"\\??\\UNC", "\\Device\\Mup"}: + rawdrive = '\\'.join(s.split('\\')[:5]) + driveletter = '\\\\' + '\\'.join(s.split('\\')[3:5]) + elif rawdrive.startswith('\\??\\'): + driveletter = s.split('\\')[2] + else: + driveletter = cext.QueryDosDevice(rawdrive) + remainder = s[len(rawdrive) :] + return os.path.join(driveletter, remainder) + + +@memoize +def getpagesize(): + return cext.getpagesize() + + +# ===================================================================== +# --- memory +# ===================================================================== + + +def virtual_memory(): + """System virtual memory as a namedtuple.""" + mem = cext.virtual_mem() + totphys, availphys, _totsys, _availsys = mem + total = totphys + avail = availphys + free = availphys + used = total - avail + percent = usage_percent((total - avail), total, round_=1) + return ntp.svmem(total, avail, percent, used, free) + + +def swap_memory(): + """Swap system memory as a (total, used, free, sin, sout) tuple.""" + mem = cext.virtual_mem() + + total_phys = mem[0] + total_system = mem[2] + + # system memory (commit total/limit) is the sum of physical and swap + # thus physical memory values need to be subtracted to get swap values + total = total_system - total_phys + # commit total is incremented immediately (decrementing free_system) + # while the corresponding free physical value is not decremented until + # pages are accessed, so we can't use free system memory for swap. + # instead, we calculate page file usage based on performance counter + if total > 0: + percentswap = cext.swap_percent() + used = int(0.01 * percentswap * total) + else: + percentswap = 0.0 + used = 0 + + free = total - used + percent = round(percentswap, 1) + return ntp.sswap(total, used, free, percent, 0, 0) + + +# malloc / heap functions +heap_info = cext.heap_info +heap_trim = cext.heap_trim + + +# ===================================================================== +# --- disk +# ===================================================================== + + +disk_io_counters = cext.disk_io_counters + + +def disk_usage(path): + """Return disk usage associated with path.""" + if isinstance(path, bytes): + # XXX: do we want to use "strict"? Probably yes, in order + # to fail immediately. After all we are accepting input here... + path = path.decode(ENCODING, errors="strict") + total, used, free = cext.disk_usage(path) + percent = usage_percent(used, total, round_=1) + return ntp.sdiskusage(total, used, free, percent) + + +def disk_partitions(all): + """Return disk partitions.""" + rawlist = cext.disk_partitions(all) + return [ntp.sdiskpart(*x) for x in rawlist] + + +# ===================================================================== +# --- CPU +# ===================================================================== + + +def cpu_times(): + """Return system CPU times as a named tuple.""" + user, system, idle = cext.cpu_times() + # Internally, GetSystemTimes() is used, and it doesn't return + # interrupt and dpc times. cext.per_cpu_times() does, so we + # rely on it to get those only. + percpu_summed = ntp.scputimes( + *[sum(n) for n in zip(*cext.per_cpu_times())] + ) + return ntp.scputimes( + user, system, idle, percpu_summed.interrupt, percpu_summed.dpc + ) + + +def per_cpu_times(): + """Return system per-CPU times as a list of named tuples.""" + ret = [] + for user, system, idle, interrupt, dpc in cext.per_cpu_times(): + item = ntp.scputimes(user, system, idle, interrupt, dpc) + ret.append(item) + return ret + + +def cpu_count_logical(): + """Return the number of logical CPUs in the system.""" + return cext.cpu_count_logical() + + +def cpu_count_cores(): + """Return the number of CPU cores in the system.""" + return cext.cpu_count_cores() + + +def cpu_stats(): + """Return CPU statistics.""" + ctx_switches, interrupts, _dpcs, syscalls = cext.cpu_stats() + soft_interrupts = 0 + return ntp.scpustats(ctx_switches, interrupts, soft_interrupts, syscalls) + + +def cpu_freq(): + """Return CPU frequency. + On Windows per-cpu frequency is not supported. + """ + curr, max_ = cext.cpu_freq() + min_ = 0.0 + return [ntp.scpufreq(float(curr), min_, float(max_))] + + +_loadavg_initialized = False +_lock = threading.Lock() + + +def _getloadavg_impl(): + # Drop to 2 decimal points which is what Linux does + raw_loads = cext.getloadavg() + return tuple(round(load, 2) for load in raw_loads) + + +def getloadavg(): + """Return the number of processes in the system run queue averaged + over the last 1, 5, and 15 minutes respectively as a tuple. + """ + global _loadavg_initialized + + if _loadavg_initialized: + return _getloadavg_impl() + + with _lock: + if not _loadavg_initialized: + cext.init_loadavg_counter() + _loadavg_initialized = True + + return _getloadavg_impl() + + +# ===================================================================== +# --- network +# ===================================================================== + + +def net_connections(kind, _pid=-1): + """Return socket connections. If pid == -1 return system-wide + connections (as opposed to connections opened by one process only). + """ + families, types = conn_tmap[kind] + rawlist = cext.net_connections(_pid, families, types) + ret = set() + for item in rawlist: + fd, fam, type, laddr, raddr, status, pid = item + nt = conn_to_ntuple( + fd, + fam, + type, + laddr, + raddr, + status, + TCP_STATUSES, + pid=pid if _pid == -1 else None, + ) + ret.add(nt) + return list(ret) + + +def net_if_stats(): + """Get NIC stats (isup, duplex, speed, mtu).""" + ret = {} + rawdict = cext.net_if_stats() + for name, items in rawdict.items(): + isup, duplex, speed, mtu = items + if hasattr(_common, 'NicDuplex'): + duplex = _common.NicDuplex(duplex) + ret[name] = ntp.snicstats(isup, duplex, speed, mtu, '') + return ret + + +def net_io_counters(): + """Return network I/O statistics for every network interface + installed on the system as a dict of raw tuples. + """ + return cext.net_io_counters() + + +def net_if_addrs(): + """Return the addresses associated to each NIC.""" + return cext.net_if_addrs() + + +# ===================================================================== +# --- sensors +# ===================================================================== + + +def sensors_battery(): + """Return battery information.""" + # For constants meaning see: + # https://msdn.microsoft.com/en-us/library/windows/desktop/ + # aa373232(v=vs.85).aspx + acline_status, flags, percent, secsleft = cext.sensors_battery() + power_plugged = acline_status == 1 + no_battery = bool(flags & 128) + charging = bool(flags & 8) + + if no_battery: + return None + if power_plugged or charging: + secsleft = _common.POWER_TIME_UNLIMITED + elif secsleft == -1: + secsleft = _common.POWER_TIME_UNKNOWN + + return ntp.sbattery(percent, secsleft, power_plugged) + + +# ===================================================================== +# --- other system functions +# ===================================================================== + + +_last_btime = 0 + + +def boot_time(): + """The system boot time expressed in seconds since the epoch. This + also includes the time spent during hybernate / suspend. + """ + # This dirty hack is to adjust the precision of the returned + # value which may have a 1 second fluctuation, see: + # https://github.com/giampaolo/psutil/issues/1007 + global _last_btime + ret = time.time() - cext.uptime() + if abs(ret - _last_btime) <= 1: + return _last_btime + else: + _last_btime = ret + return ret + + +def users(): + """Return currently connected users as a list of namedtuples.""" + retlist = [] + rawlist = cext.users() + for item in rawlist: + user, hostname, tstamp = item + nt = ntp.suser(user, None, hostname, tstamp, None) + retlist.append(nt) + return retlist + + +# ===================================================================== +# --- Windows services +# ===================================================================== + + +def win_service_iter(): + """Yields a list of WindowsService instances.""" + for name, display_name in cext.winservice_enumerate(): + yield WindowsService(name, display_name) + + +def win_service_get(name): + """Open a Windows service and return it as a WindowsService instance.""" + service = WindowsService(name, None) + service._display_name = service._query_config()['display_name'] + return service + + +class WindowsService: # noqa: PLW1641 + """Represents an installed Windows service.""" + + def __init__(self, name, display_name): + self._name = name + self._display_name = display_name + + def __str__(self): + details = f"(name={self._name!r}, display_name={self._display_name!r})" + return f"{self.__class__.__name__}{details}" + + def __repr__(self): + return f"<{self.__str__()} at {id(self)}>" + + def __eq__(self, other): + # Test for equality with another WindosService object based + # on name. + if not isinstance(other, WindowsService): + return NotImplemented + return self._name == other._name + + def __ne__(self, other): + return not self == other + + def _query_config(self): + with self._wrap_exceptions(): + display_name, binpath, username, start_type = ( + cext.winservice_query_config(self._name) + ) + # XXX - update _self.display_name? + return dict( + display_name=display_name, + binpath=binpath, + username=username, + start_type=start_type, + ) + + def _query_status(self): + with self._wrap_exceptions(): + status, pid = cext.winservice_query_status(self._name) + if pid == 0: + pid = None + return dict(status=status, pid=pid) + + @contextlib.contextmanager + def _wrap_exceptions(self): + """Ctx manager which translates bare OSError and WindowsError + exceptions into NoSuchProcess and AccessDenied. + """ + try: + yield + except OSError as err: + name = self._name + if is_permission_err(err): + msg = ( + f"service {name!r} is not querable (not enough privileges)" + ) + raise AccessDenied(pid=None, name=name, msg=msg) from err + elif err.winerror in { + cext.ERROR_INVALID_NAME, + cext.ERROR_SERVICE_DOES_NOT_EXIST, + }: + msg = f"service {name!r} does not exist" + raise NoSuchProcess(pid=None, name=name, msg=msg) from err + else: + raise + + # config query + + def name(self): + """The service name. This string is how a service is referenced + and can be passed to win_service_get() to get a new + WindowsService instance. + """ + return self._name + + def display_name(self): + """The service display name. The value is cached when this class + is instantiated. + """ + return self._display_name + + def binpath(self): + """The fully qualified path to the service binary/exe file as + a string, including command line arguments. + """ + return self._query_config()['binpath'] + + def username(self): + """The name of the user that owns this service.""" + return self._query_config()['username'] + + def start_type(self): + """A string which can either be "automatic", "manual" or + "disabled". + """ + return self._query_config()['start_type'] + + # status query + + def pid(self): + """The process PID, if any, else None. This can be passed + to Process class to control the service's process. + """ + return self._query_status()['pid'] + + def status(self): + """Service status as a string.""" + return self._query_status()['status'] + + def description(self): + """Service long description.""" + return cext.winservice_query_descr(self.name()) + + # utils + + def as_dict(self): + """Utility method retrieving all the information above as a + dictionary. + """ + d = self._query_config() + d.update(self._query_status()) + d['name'] = self.name() + d['display_name'] = self.display_name() + d['description'] = self.description() + return d + + # actions + # XXX: the necessary C bindings for start() and stop() are + # implemented but for now I prefer not to expose them. + # I may change my mind in the future. Reasons: + # - they require Administrator privileges + # - can't implement a timeout for stop() (unless by using a thread, + # which sucks) + # - would require adding ServiceAlreadyStarted and + # ServiceAlreadyStopped exceptions, adding two new APIs. + # - we might also want to have modify(), which would basically mean + # rewriting win32serviceutil.ChangeServiceConfig, which involves a + # lot of stuff (and API constants which would pollute the API), see: + # http://pyxr.sourceforge.net/PyXR/c/python24/lib/site-packages/ + # win32/lib/win32serviceutil.py.html#0175 + # - psutil is typically about "read only" monitoring stuff; + # win_service_* APIs should only be used to retrieve a service and + # check whether it's running + + # def start(self, timeout=None): + # with self._wrap_exceptions(): + # cext.winservice_start(self.name()) + # if timeout: + # giveup_at = time.time() + timeout + # while True: + # if self.status() == "running": + # return + # else: + # if time.time() > giveup_at: + # raise TimeoutExpired(timeout) + # else: + # time.sleep(.1) + + # def stop(self): + # # Note: timeout is not implemented because it's just not + # # possible, see: + # # http://stackoverflow.com/questions/11973228/ + # with self._wrap_exceptions(): + # return cext.winservice_stop(self.name()) + + +# ===================================================================== +# --- processes +# ===================================================================== + + +pids = cext.pids +pid_exists = cext.pid_exists +ppid_map = cext.ppid_map # used internally by Process.children() + + +def is_permission_err(exc): + """Return True if this is a permission error.""" + assert isinstance(exc, OSError), exc + return isinstance(exc, PermissionError) or exc.winerror in { + cext.ERROR_ACCESS_DENIED, + cext.ERROR_PRIVILEGE_NOT_HELD, + } + + +def convert_oserror(exc, pid=None, name=None): + """Convert OSError into NoSuchProcess or AccessDenied.""" + assert isinstance(exc, OSError), exc + if is_permission_err(exc): + return AccessDenied(pid=pid, name=name) + if isinstance(exc, ProcessLookupError): + return NoSuchProcess(pid=pid, name=name) + raise exc + + +def wrap_exceptions(fun): + """Decorator which converts OSError into NoSuchProcess or AccessDenied.""" + + @functools.wraps(fun) + def wrapper(self, *args, **kwargs): + try: + return fun(self, *args, **kwargs) + except OSError as err: + raise convert_oserror(err, pid=self.pid, name=self._name) from err + + return wrapper + + +def retry_error_partial_copy(fun): + """Workaround for https://github.com/giampaolo/psutil/issues/875. + See: https://stackoverflow.com/questions/4457745#4457745. + """ + + @functools.wraps(fun) + def wrapper(self, *args, **kwargs): + delay = 0.0001 + times = 33 + for _ in range(times): # retries for roughly 1 second + try: + return fun(self, *args, **kwargs) + except OSError as _: + err = _ + if err.winerror == ERROR_PARTIAL_COPY: + time.sleep(delay) + delay = min(delay * 2, 0.04) + continue + raise + msg = ( + f"{fun} retried {times} times, converted to AccessDenied as it's " + f"still returning {err}" + ) + raise AccessDenied(pid=self.pid, name=self._name, msg=msg) + + return wrapper + + +class Process: + """Wrapper class around underlying C implementation.""" + + __slots__ = ["_cache", "_name", "_ppid", "pid"] + + def __init__(self, pid): + self.pid = pid + self._name = None + self._ppid = None + + # --- oneshot() stuff + + def oneshot_enter(self): + self._proc_info.cache_activate(self) + self.exe.cache_activate(self) + + def oneshot_exit(self): + self._proc_info.cache_deactivate(self) + self.exe.cache_deactivate(self) + + @memoize_when_activated + def _proc_info(self): + """Return multiple information about this process as a + raw tuple. + """ + ret = cext.proc_info(self.pid) + assert len(ret) == len(pinfo_map) + return ret + + def name(self): + """Return process name, which on Windows is always the final + part of the executable. + """ + # This is how PIDs 0 and 4 are always represented in taskmgr + # and process-hacker. + if self.pid == 0: + return "System Idle Process" + if self.pid == 4: + return "System" + return os.path.basename(self.exe()) + + @wrap_exceptions + @memoize_when_activated + def exe(self): + if PYPY: + try: + exe = cext.proc_exe(self.pid) + except OSError as err: + # 24 = ERROR_TOO_MANY_OPEN_FILES. Not sure why this happens + # (perhaps PyPy's JIT delaying garbage collection of files?). + if err.errno == 24: + debug(f"{err!r} translated into AccessDenied") + raise AccessDenied(self.pid, self._name) from err + raise + else: + exe = cext.proc_exe(self.pid) + if exe.startswith('\\'): + return convert_dos_path(exe) + return exe # May be "Registry", "MemCompression", ... + + @wrap_exceptions + @retry_error_partial_copy + def cmdline(self): + if cext.WINVER >= cext.WINDOWS_8_1: + # PEB method detects cmdline changes but requires more + # privileges: https://github.com/giampaolo/psutil/pull/1398 + try: + return cext.proc_cmdline(self.pid, use_peb=True) + except OSError as err: + if is_permission_err(err): + return cext.proc_cmdline(self.pid, use_peb=False) + else: + raise + else: + return cext.proc_cmdline(self.pid, use_peb=True) + + @wrap_exceptions + @retry_error_partial_copy + def environ(self): + s = cext.proc_environ(self.pid) + return parse_environ_block(s) + + def ppid(self): + try: + return ppid_map()[self.pid] + except KeyError: + raise NoSuchProcess(self.pid, self._name) from None + + def _get_raw_meminfo(self): + try: + return cext.proc_memory_info(self.pid) + except OSError as err: + if is_permission_err(err): + # TODO: the C ext can probably be refactored in order + # to get this from cext.proc_info() + debug("attempting memory_info() fallback (slower)") + info = self._proc_info() + return ( + info[pinfo_map['num_page_faults']], + info[pinfo_map['peak_wset']], + info[pinfo_map['wset']], + info[pinfo_map['peak_paged_pool']], + info[pinfo_map['paged_pool']], + info[pinfo_map['peak_non_paged_pool']], + info[pinfo_map['non_paged_pool']], + info[pinfo_map['pagefile']], + info[pinfo_map['peak_pagefile']], + info[pinfo_map['mem_private']], + ) + raise + + @wrap_exceptions + def memory_info(self): + # on Windows RSS == WorkingSetSize and VSM == PagefileUsage. + # Underlying C function returns fields of PROCESS_MEMORY_COUNTERS + # struct. + t = self._get_raw_meminfo() + rss = t[2] # wset + vms = t[7] # pagefile + return ntp.pmem(*(rss, vms) + t) + + @wrap_exceptions + def memory_full_info(self): + basic_mem = self.memory_info() + uss = cext.proc_memory_uss(self.pid) + uss *= getpagesize() + return ntp.pfullmem(*basic_mem + (uss,)) + + def memory_maps(self): + try: + raw = cext.proc_memory_maps(self.pid) + except OSError as err: + # XXX - can't use wrap_exceptions decorator as we're + # returning a generator; probably needs refactoring. + raise convert_oserror(err, self.pid, self._name) from err + else: + for addr, perm, path, rss in raw: + path = convert_dos_path(path) + addr = hex(addr) + yield (addr, perm, path, rss) + + @wrap_exceptions + def kill(self): + return cext.proc_kill(self.pid) + + @wrap_exceptions + def send_signal(self, sig): + if sig == signal.SIGTERM: + cext.proc_kill(self.pid) + elif sig in {signal.CTRL_C_EVENT, signal.CTRL_BREAK_EVENT}: + os.kill(self.pid, sig) + else: + msg = ( + "only SIGTERM, CTRL_C_EVENT and CTRL_BREAK_EVENT signals " + "are supported on Windows" + ) + raise ValueError(msg) + + @wrap_exceptions + def wait(self, timeout=None): + if timeout is None: + cext_timeout = cext.INFINITE + else: + # WaitForSingleObject() expects time in milliseconds. + cext_timeout = int(timeout * 1000) + + timer = getattr(time, 'monotonic', time.time) + stop_at = timer() + timeout if timeout is not None else None + + try: + # Exit code is supposed to come from GetExitCodeProcess(). + # May also be None if OpenProcess() failed with + # ERROR_INVALID_PARAMETER, meaning PID is already gone. + exit_code = cext.proc_wait(self.pid, cext_timeout) + except cext.TimeoutExpired as err: + # WaitForSingleObject() returned WAIT_TIMEOUT. Just raise. + raise TimeoutExpired(timeout, self.pid, self._name) from err + except cext.TimeoutAbandoned: + # WaitForSingleObject() returned WAIT_ABANDONED, see: + # https://github.com/giampaolo/psutil/issues/1224 + # We'll just rely on the internal polling and return None + # when the PID disappears. Subprocess module does the same + # (return None): + # https://github.com/python/cpython/blob/ + # be50a7b627d0aa37e08fa8e2d5568891f19903ce/ + # Lib/subprocess.py#L1193-L1194 + exit_code = None + + # At this point WaitForSingleObject() returned WAIT_OBJECT_0, + # meaning the process is gone. Stupidly there are cases where + # its PID may still stick around so we do a further internal + # polling. + delay = 0.0001 + while True: + if not pid_exists(self.pid): + return exit_code + if stop_at and timer() >= stop_at: + raise TimeoutExpired(timeout, pid=self.pid, name=self._name) + time.sleep(delay) + delay = min(delay * 2, 0.04) # incremental delay + + @wrap_exceptions + def username(self): + if self.pid in {0, 4}: + return 'NT AUTHORITY\\SYSTEM' + domain, user = cext.proc_username(self.pid) + return f"{domain}\\{user}" + + @wrap_exceptions + def create_time(self, fast_only=False): + # Note: proc_times() not put under oneshot() 'cause create_time() + # is already cached by the main Process class. + try: + _user, _system, created = cext.proc_times(self.pid) + return created + except OSError as err: + if is_permission_err(err): + if fast_only: + raise + debug("attempting create_time() fallback (slower)") + return self._proc_info()[pinfo_map['create_time']] + raise + + @wrap_exceptions + def num_threads(self): + return self._proc_info()[pinfo_map['num_threads']] + + @wrap_exceptions + def threads(self): + rawlist = cext.proc_threads(self.pid) + retlist = [] + for thread_id, utime, stime in rawlist: + ntuple = ntp.pthread(thread_id, utime, stime) + retlist.append(ntuple) + return retlist + + @wrap_exceptions + def cpu_times(self): + try: + user, system, _created = cext.proc_times(self.pid) + except OSError as err: + if not is_permission_err(err): + raise + debug("attempting cpu_times() fallback (slower)") + info = self._proc_info() + user = info[pinfo_map['user_time']] + system = info[pinfo_map['kernel_time']] + # Children user/system times are not retrievable (set to 0). + return ntp.pcputimes(user, system, 0.0, 0.0) + + @wrap_exceptions + def suspend(self): + cext.proc_suspend_or_resume(self.pid, True) + + @wrap_exceptions + def resume(self): + cext.proc_suspend_or_resume(self.pid, False) + + @wrap_exceptions + @retry_error_partial_copy + def cwd(self): + if self.pid in {0, 4}: + raise AccessDenied(self.pid, self._name) + # return a normalized pathname since the native C function appends + # "\\" at the and of the path + path = cext.proc_cwd(self.pid) + return os.path.normpath(path) + + @wrap_exceptions + def open_files(self): + if self.pid in {0, 4}: + return [] + ret = set() + # Filenames come in in native format like: + # "\Device\HarddiskVolume1\Windows\systemew\file.txt" + # Convert the first part in the corresponding drive letter + # (e.g. "C:\") by using Windows's QueryDosDevice() + raw_file_names = cext.proc_open_files(self.pid) + for file in raw_file_names: + file = convert_dos_path(file) + if isfile_strict(file): + ntuple = ntp.popenfile(file, -1) + ret.add(ntuple) + return list(ret) + + @wrap_exceptions + def net_connections(self, kind='inet'): + return net_connections(kind, _pid=self.pid) + + @wrap_exceptions + def nice_get(self): + value = cext.proc_priority_get(self.pid) + value = Priority(value) + return value + + @wrap_exceptions + def nice_set(self, value): + return cext.proc_priority_set(self.pid, value) + + @wrap_exceptions + def ionice_get(self): + ret = cext.proc_io_priority_get(self.pid) + ret = IOPriority(ret) + return ret + + @wrap_exceptions + def ionice_set(self, ioclass, value): + if value: + msg = "value argument not accepted on Windows" + raise TypeError(msg) + if ioclass not in { + IOPriority.IOPRIO_VERYLOW, + IOPriority.IOPRIO_LOW, + IOPriority.IOPRIO_NORMAL, + IOPriority.IOPRIO_HIGH, + }: + msg = f"{ioclass} is not a valid priority" + raise ValueError(msg) + cext.proc_io_priority_set(self.pid, ioclass) + + @wrap_exceptions + def io_counters(self): + try: + ret = cext.proc_io_counters(self.pid) + except OSError as err: + if not is_permission_err(err): + raise + debug("attempting io_counters() fallback (slower)") + info = self._proc_info() + ret = ( + info[pinfo_map['io_rcount']], + info[pinfo_map['io_wcount']], + info[pinfo_map['io_rbytes']], + info[pinfo_map['io_wbytes']], + info[pinfo_map['io_count_others']], + info[pinfo_map['io_bytes_others']], + ) + return ntp.pio(*ret) + + @wrap_exceptions + def status(self): + suspended = cext.proc_is_suspended(self.pid) + if suspended: + return _common.STATUS_STOPPED + else: + return _common.STATUS_RUNNING + + @wrap_exceptions + def cpu_affinity_get(self): + def from_bitmask(x): + return [i for i in range(64) if (1 << i) & x] + + bitmask = cext.proc_cpu_affinity_get(self.pid) + return from_bitmask(bitmask) + + @wrap_exceptions + def cpu_affinity_set(self, value): + def to_bitmask(ls): + if not ls: + msg = f"invalid argument {ls!r}" + raise ValueError(msg) + out = 0 + for b in ls: + out |= 2**b + return out + + # SetProcessAffinityMask() states that ERROR_INVALID_PARAMETER + # is returned for an invalid CPU but this seems not to be true, + # therefore we check CPUs validy beforehand. + allcpus = list(range(len(per_cpu_times()))) + for cpu in value: + if cpu not in allcpus: + if not isinstance(cpu, int): + msg = f"invalid CPU {cpu!r}; an integer is required" + raise TypeError(msg) + msg = f"invalid CPU {cpu!r}" + raise ValueError(msg) + + bitmask = to_bitmask(value) + cext.proc_cpu_affinity_set(self.pid, bitmask) + + @wrap_exceptions + def num_handles(self): + try: + return cext.proc_num_handles(self.pid) + except OSError as err: + if is_permission_err(err): + debug("attempting num_handles() fallback (slower)") + return self._proc_info()[pinfo_map['num_handles']] + raise + + @wrap_exceptions + def num_ctx_switches(self): + ctx_switches = self._proc_info()[pinfo_map['ctx_switches']] + # only voluntary ctx switches are supported + return ntp.pctxsw(ctx_switches, 0) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/about.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/about.json new file mode 100644 index 0000000000000000000000000000000000000000..fe1f99066b76b29de8050a2ec1937ca9d76c4ec9 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/about.json @@ -0,0 +1,16 @@ +{ + "channels": [ + "https://conda.anaconda.org/conda-forge/" + ], + "description": "psutil (process and system utilities) is a cross-platform library for\nretrieving information on running processes and system utilization (CPU,\nmemory, disks, network) in Python. It is useful mainly for system\nmonitoring, profiling and limiting process resources and management of\nrunning processes.", + "dev_url": "https://github.com/giampaolo/psutil", + "doc_url": "https://psutil.readthedocs.io/", + "extra": { + "flow_run_id": "azure_20260129.4.1", + "remote_url": "https://github.com/conda-forge/psutil-feedstock", + "sha": "bbd3baefd9321a72c980b9419495043d4e44b3a1" + }, + "home": "https://github.com/giampaolo/psutil", + "license": "BSD-3-Clause", + "summary": "A cross-platform process and system utilities module for Python" +} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/hash_input.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/hash_input.json new file mode 100644 index 0000000000000000000000000000000000000000..b7340a227511d8079999e5f6248d4249689d7448 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/hash_input.json @@ -0,0 +1 @@ +{"build_platform": "win-64", "c_compiler": "vs2022", "c_stdlib": "vs", "channel_sources": "conda-forge", "channel_targets": "conda-forge main", "python": "3.14.* *_cp314t", "target_platform": "win-64"} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/index.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/index.json new file mode 100644 index 0000000000000000000000000000000000000000..f98a0295d5f270372552bd443285af9a501963f1 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/index.json @@ -0,0 +1,18 @@ +{ + "arch": "x86_64", + "build": "py314h8f04a7f_0", + "build_number": 0, + "depends": [ + "python", + "vc >=14.3,<15", + "vc14_runtime >=14.44.35208", + "ucrt >=10.0.20348.0", + "python_abi 3.14.* *_cp314t" + ], + "license": "BSD-3-Clause", + "name": "psutil", + "platform": "win", + "subdir": "win-64", + "timestamp": 1769678173524, + "version": "7.2.2" +} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/licenses/LICENSE b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..cff5eb74e1badd1c5237ed2654b349530179ad1d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/licenses/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2009, Jay Loden, Dave Daeschler, Giampaolo Rodola +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 psutil authors 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. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/paths.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/paths.json new file mode 100644 index 0000000000000000000000000000000000000000..ca013436f7ce2337942709694f8d18f21e940c2f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/paths.json @@ -0,0 +1,179 @@ +{ + "paths": [ + { + "_path": "Lib/site-packages/psutil/__init__.py", + "path_type": "hardlink", + "sha256": "1cb305b79117618658c80bc71910524e53724caa6a0bbd2cc1e30c8af8bb64d9", + "size_in_bytes": 89857 + }, + { + "_path": "Lib/site-packages/psutil/__pycache__/__init__.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "808873979af429579a75e7afaa4563a723db94c4d26258eab661e2fc86182ec3", + "size_in_bytes": 91738 + }, + { + "_path": "Lib/site-packages/psutil/__pycache__/_common.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "0ec74fe6e06330037e0f3f501cc116c2dd4943626b470da6065191322faae16b", + "size_in_bytes": 33206 + }, + { + "_path": "Lib/site-packages/psutil/__pycache__/_ntuples.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "cbed9f623102c850dc8648bc5b6f1ff26689ed23170d2f35be5ae71175ecac7e", + "size_in_bytes": 5778 + }, + { + "_path": "Lib/site-packages/psutil/__pycache__/_psaix.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "5e5fc6411a9d4f2671cdc7f34440310617856481b787657362369c1ece1adb76", + "size_in_bytes": 25048 + }, + { + "_path": "Lib/site-packages/psutil/__pycache__/_psbsd.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "1e0248e17c3f584b5c00857c5bb2d80c29f3b9b02fe493daa67ef2a3513d5cb4", + "size_in_bytes": 35092 + }, + { + "_path": "Lib/site-packages/psutil/__pycache__/_pslinux.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "87d160f75e0a84d1f3106671e9047012668b594ce9d347d458c632fe8c482001", + "size_in_bytes": 93480 + }, + { + "_path": "Lib/site-packages/psutil/__pycache__/_psosx.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "33a11546645cafdfecb3c149af22b03142528f4580acba7079674d5fee9e9c8d", + "size_in_bytes": 22678 + }, + { + "_path": "Lib/site-packages/psutil/__pycache__/_psposix.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "cf9a43d6c079794af295e3f1e7dc69d7b5261e84d2c7c6322f3dc7d994cca692", + "size_in_bytes": 12410 + }, + { + "_path": "Lib/site-packages/psutil/__pycache__/_pssunos.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "0835319926d2bd74a1db07921d9d9d7a040365b88cd8f340a89e07bc1d2d173f", + "size_in_bytes": 30697 + }, + { + "_path": "Lib/site-packages/psutil/__pycache__/_pswindows.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "32bbd3951a4ab82c274362a3074762c56b03c2d405fc4ea11404e78ee3c7ed9d", + "size_in_bytes": 44824 + }, + { + "_path": "Lib/site-packages/psutil/_common.py", + "path_type": "hardlink", + "sha256": "1bbce9fd97e6f5439a0d385f28401f527c5a9d978d9d062593d7ef6fe215fc75", + "size_in_bytes": 25254 + }, + { + "_path": "Lib/site-packages/psutil/_ntuples.py", + "path_type": "hardlink", + "sha256": "9b8e8b938abae2786a515f686f4d8132218be897eb6b459b9324ed17d88a31c7", + "size_in_bytes": 10970 + }, + { + "_path": "Lib/site-packages/psutil/_psaix.py", + "path_type": "hardlink", + "sha256": "afe4038d5e1454559f17dac9e6c2c56ad8cf873d43880f6503e8549cc06a18ec", + "size_in_bytes": 17616 + }, + { + "_path": "Lib/site-packages/psutil/_psbsd.py", + "path_type": "hardlink", + "sha256": "c1a8314a9640649c99197ff261dbeec1f0080175e4a3f6b5cb370a39332deb94", + "size_in_bytes": 29263 + }, + { + "_path": "Lib/site-packages/psutil/_pslinux.py", + "path_type": "hardlink", + "sha256": "a8a09bab87848075b691c46112b00692745785a8c9d5a2c87037ae124b469749", + "size_in_bytes": 84787 + }, + { + "_path": "Lib/site-packages/psutil/_psosx.py", + "path_type": "hardlink", + "sha256": "89f0ea0e9c1fe38f224b612792bf31d07c8880d79281806e5379c00514f6b3f2", + "size_in_bytes": 15913 + }, + { + "_path": "Lib/site-packages/psutil/_psposix.py", + "path_type": "hardlink", + "sha256": "288887b58f5939e3b00e021f6e7b490c2f7f4852804a359918ab7d9c6fb39839", + "size_in_bytes": 11575 + }, + { + "_path": "Lib/site-packages/psutil/_pssunos.py", + "path_type": "hardlink", + "sha256": "cc348442008a54cb6054299b2ecae0d9a123c07bb4ba1f8e14b319487f83cee5", + "size_in_bytes": 23934 + }, + { + "_path": "Lib/site-packages/psutil/_psutil_windows.cp314t-win_amd64.pyd", + "path_type": "hardlink", + "sha256": "406bcd730c8a3c471f85a64231bc2400221b61d2e4dfe20fb56c1ceae85c8fca", + "size_in_bytes": 75776 + }, + { + "_path": "Lib/site-packages/psutil/_pswindows.py", + "path_type": "hardlink", + "sha256": "580ad391de734c113682200ee9f4245e34737f5e26af0a73a4e8c9b4458de220", + "size_in_bytes": 35370 + }, + { + "_path": "Lib/site-packages/psutil-7.2.2.dist-info/INSTALLER", + "path_type": "hardlink", + "sha256": "bc33022edcb7639ff53355b4e91dade50a0bbf0299efeb6171d1ec0ba5029cfc", + "size_in_bytes": 6 + }, + { + "_path": "Lib/site-packages/psutil-7.2.2.dist-info/METADATA", + "path_type": "hardlink", + "sha256": "eec3ff501da1fc32231bf81399f0a480c0b229a0580ee5298cdbb35ab6552103", + "size_in_bytes": 22973 + }, + { + "_path": "Lib/site-packages/psutil-7.2.2.dist-info/RECORD", + "path_type": "hardlink", + "sha256": "9775ce48123d0cd74273349d88aa7d1b1183a081ad1184a1bd717dff5c9f8aa7", + "size_in_bytes": 1996 + }, + { + "_path": "Lib/site-packages/psutil-7.2.2.dist-info/REQUESTED", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/psutil-7.2.2.dist-info/WHEEL", + "path_type": "hardlink", + "sha256": "a4f297550755261f70053c8d55208058c7298c7360331d0e662b31ec6fee59d0", + "size_in_bytes": 103 + }, + { + "_path": "Lib/site-packages/psutil-7.2.2.dist-info/direct_url.json", + "path_type": "hardlink", + "sha256": "4f0014169fcdc03c7dadc6536f19e2b123c8aa538794b320a696dba68ca42074", + "size_in_bytes": 82 + }, + { + "_path": "Lib/site-packages/psutil-7.2.2.dist-info/licenses/LICENSE", + "path_type": "hardlink", + "sha256": "b89c063b3786e28e0c0a38f1931db61fed35e69dd2a2966fbecffee0f46c8d10", + "size_in_bytes": 1548 + }, + { + "_path": "Lib/site-packages/psutil-7.2.2.dist-info/top_level.txt", + "path_type": "hardlink", + "sha256": "8023619f9ef0ce4b038d20084a680c2746a25f342e964d062616f6f81032620c", + "size_in_bytes": 7 + } + ], + "paths_version": 1 +} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/recipe/recipe-scripts-license.txt b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/recipe/recipe-scripts-license.txt new file mode 100644 index 0000000000000000000000000000000000000000..f093e06198e8f9997e31fe9bf3cedf8d12a5c6dd --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/recipe/recipe-scripts-license.txt @@ -0,0 +1,27 @@ +BSD-3-Clause license +Copyright (c) 2015-2022, conda-forge contributors +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 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. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/recipe/recipe.yaml b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/recipe/recipe.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f50f42982f57b817a1233f3b0102027f4b907cdf --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/recipe/recipe.yaml @@ -0,0 +1,73 @@ +schema_version: 1 + +context: + version: "7.2.2" + sha256: 0746f5f8d406af344fd547f1c8daa5f5c33dbc293bb8d6a16d80b4bb88f59372 + +package: + name: psutil + version: ${{ version }} + +source: + url: https://pypi.org/packages/source/p/psutil/psutil-${{ version }}.tar.gz + sha256: ${{ sha256 }} + +build: + number: 0 + script: + # macOS renamed this variable, but it is `NULL` in either case. + # Workaround the missing definition by setting it to `0`. + # + # xref: https://github.com/giampaolo/psutil/issues/2354 + - if: osx + then: export CFLAGS="${CFLAGS} -DkIOMainPortDefault=0" + - ${{ PYTHON }} -m pip install --ignore-installed --no-deps . + +requirements: + build: + - if: build_platform != target_platform + then: + - python + - cross-python_${{ target_platform }} + - ${{ compiler("c") }} + - ${{ stdlib("c") }} + host: + - python + - pip + - setuptools >=43 + - wheel + run: + - python + +tests: + - python: + imports: + - psutil + - if: linux + then: psutil._psutil_linux + - if: osx + then: psutil._psutil_osx + - if: win + then: psutil._psutil_windows + +about: + license: BSD-3-Clause + license_file: LICENSE + summary: A cross-platform process and system utilities module for Python + description: | + psutil (process and system utilities) is a cross-platform library for + retrieving information on running processes and system utilization (CPU, + memory, disks, network) in Python. It is useful mainly for system + monitoring, profiling and limiting process resources and management of + running processes. + homepage: https://github.com/giampaolo/psutil + repository: https://github.com/giampaolo/psutil + documentation: https://psutil.readthedocs.io + +extra: + recipe-maintainers: + - jan-janssen + - gqmelo + - jakirkham + - pelson + - nehaljwani diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/recipe/rendered_recipe.yaml b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/recipe/rendered_recipe.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0bd2026a29e3aac5b05c715e9a1fb3703d1e8b0d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/recipe/rendered_recipe.yaml @@ -0,0 +1,673 @@ +recipe: + schema_version: 1 + context: + version: 7.2.2 + sha256: 0746f5f8d406af344fd547f1c8daa5f5c33dbc293bb8d6a16d80b4bb88f59372 + package: + name: psutil + version: 7.2.2 + source: + - url: https://pypi.org/packages/source/p/psutil/psutil-7.2.2.tar.gz + sha256: 0746f5f8d406af344fd547f1c8daa5f5c33dbc293bb8d6a16d80b4bb88f59372 + build: + number: 0 + string: py314h8f04a7f_0 + script: ${{ PYTHON }} -m pip install --ignore-installed --no-deps . + requirements: + build: + - vs2022_win-64 + - vs_win-64 + host: + - python + - pip + - setuptools >=43 + - wheel + run: + - python + tests: + - python: + imports: + - psutil + - psutil._psutil_windows + about: + homepage: https://github.com/giampaolo/psutil + repository: https://github.com/giampaolo/psutil + documentation: https://psutil.readthedocs.io/ + license: BSD-3-Clause + license_file: + - LICENSE + summary: A cross-platform process and system utilities module for Python + description: |- + psutil (process and system utilities) is a cross-platform library for + retrieving information on running processes and system utilization (CPU, + memory, disks, network) in Python. It is useful mainly for system + monitoring, profiling and limiting process resources and management of + running processes. + extra: + recipe-maintainers: + - jan-janssen + - gqmelo + - jakirkham + - pelson + - nehaljwani +build_configuration: + target_platform: win-64 + host_platform: + platform: win-64 + virtual_packages: + - __win=10.0.20348=0 + - __archspec=1=x86_64_v3 + build_platform: + platform: win-64 + virtual_packages: + - __win=10.0.20348=0 + - __archspec=1=x86_64_v3 + variant: + build_platform: win-64 + c_compiler: vs2022 + c_stdlib: vs + channel_sources: conda-forge + channel_targets: conda-forge main + python: 3.14.* *_cp314t + target_platform: win-64 + hash: + hash: 8f04a7f + prefix: py314 + directories: + host_prefix: D:\bld\bld\rattler-build_psutil_1769678173\h_env + build_prefix: D:\bld\bld\rattler-build_psutil_1769678173\build_env + work_dir: D:\bld\bld\rattler-build_psutil_1769678173\work + build_dir: D:\bld\bld\rattler-build_psutil_1769678173 + channels: + - https://conda.anaconda.org/conda-forge + channel_priority: strict + solve_strategy: highest + timestamp: 2026-01-29T09:16:13.524581Z + subpackages: + psutil: + name: psutil + version: 7.2.2 + build_string: py314h8f04a7f_0 + packaging_settings: + archive_type: conda + compression_level: 15 +finalized_dependencies: + build: + specs: + - source: vs2022_win-64 + - source: vs_win-64 + resolved: + - build: ha74f236_34 + build_number: 34 + constrains: + - vs_win-64 2022.14 + depends: + - vswhere + license: BSD-3-Clause + license_family: BSD + md5: 1d699ffd41c140b98e199ddd9787e1e1 + name: vs2022_win-64 + run_exports: + strong: + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + sha256: 05bc657625b58159bcea039a35cc89d1f8baf54bf4060019c2b559a03ba4a45e + size: 23060 + subdir: win-64 + timestamp: 1767320175868 + track_features: vc14 + version: 19.44.35207 + fn: vs2022_win-64-19.44.35207-ha74f236_34.conda + url: https://conda.anaconda.org/conda-forge/win-64/vs2022_win-64-19.44.35207-ha74f236_34.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: ha74f236_34 + build_number: 34 + depends: + - vs2022_win-64 19.44.35207.* + license: BSD-3-Clause + license_family: BSD + md5: b8f1c3f5c2347270f0fa06385ab16c5c + name: vs_win-64 + run_exports: + strong: + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + sha256: b07ba17e1f407eba3e8c714530cce9b111439e3ffecd123e58555308a7304a60 + size: 19606 + subdir: win-64 + timestamp: 1767320221083 + track_features: vc14 + version: '2022.14' + fn: vs_win-64-2022.14-ha74f236_34.conda + url: https://conda.anaconda.org/conda-forge/win-64/vs_win-64-2022.14-ha74f236_34.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h40126e0_1 + build_number: 1 + depends: + - __win + license: MIT + license_family: MIT + md5: f622897afff347b715d046178ad745a5 + name: vswhere + noarch: generic + run_exports: {} + sha256: b72270395326dc56de9bd6ca82f63791b3c8c9e2b98e25242a9869a4ca821895 + size: 238764 + subdir: noarch + timestamp: 1745560912727 + version: 3.1.7 + fn: vswhere-3.1.7-h40126e0_1.conda + url: https://conda.anaconda.org/conda-forge/noarch/vswhere-3.1.7-h40126e0_1.conda + channel: https://conda.anaconda.org/conda-forge/ + host: + specs: + - variant: python + spec: python 3.14.* *_cp314t + - source: pip + - source: setuptools >=43 + - source: wheel + - spec: vc >=14.3,<15 + from: build + run_export: vs2022_win-64 + - spec: vc14_runtime >=14.44.35208 + from: build + run_export: vs2022_win-64 + - spec: ucrt >=10.0.20348.0 + from: build + run_export: vs2022_win-64 + - spec: vc >=14.3,<15 + from: build + run_export: vs_win-64 + - spec: vc14_runtime >=14.44.35208 + from: build + run_export: vs_win-64 + - spec: ucrt >=10.0.20348.0 + from: build + run_export: vs_win-64 + resolved: + - build: h7c1dbca_1_cp314t + build_number: 1 + depends: + - bzip2 >=1.0.8,<2.0a0 + - libexpat >=2.7.3,<3.0a0 + - libffi >=3.5.2,<3.6.0a0 + - liblzma >=5.8.2,<6.0a0 + - libmpdec >=4.0.0,<5.0a0 + - libsqlite >=3.51.2,<4.0a0 + - libzlib >=1.3.1,<2.0a0 + - openssl >=3.5.4,<4.0a0 + - python_abi 3.14.* *_cp314t + - tk >=8.6.13,<8.7.0a0 + - tzdata + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - zstd >=1.5.7,<1.6.0a0 + license: Python-2.0 + md5: cfe37fb131fecf3ca3e53a0970487c66 + name: python + python_site_packages_path: Lib/site-packages + run_exports: + weak: + - python_abi 3.14.* *_cp314t + noarch: + - python + sha256: e884bd6a3e773355b6d77a6609d7be2172e2131a0d80473c2e6014f7857b7fac + size: 17349594 + subdir: win-64 + timestamp: 1769456880723 + version: 3.14.2 + fn: python-3.14.2-h7c1dbca_1_cp314t.conda + url: https://conda.anaconda.org/conda-forge/win-64/python-3.14.2-h7c1dbca_1_cp314t.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: 8_cp314t + build_number: 8 + constrains: + - python 3.14.* *_cp314t + depends: [] + license: BSD-3-Clause + license_family: BSD + md5: 3251796e09870c978e0f69fa05e38fb6 + name: python_abi + noarch: generic + run_exports: {} + sha256: d9ed2538fba61265a330ee1b1afe99a4bb23ace706172b9464546c7e01259d63 + size: 7020 + subdir: noarch + timestamp: 1752805919426 + version: '3.14' + fn: python_abi-3.14-8_cp314t.conda + url: https://conda.anaconda.org/conda-forge/noarch/python_abi-3.14-8_cp314t.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: hf5d6505_0 + build_number: 0 + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: blessing + md5: 903979414b47d777d548e5f0165e6cd8 + name: libsqlite + run_exports: + weak: + - libsqlite >=3.51.2,<4.0a0 + sha256: 756478128e3e104bd7e7c3ce6c1b0efad7e08c7320c69fdc726e039323c63fbb + size: 1291616 + subdir: win-64 + timestamp: 1768148278261 + version: 3.51.2 + fn: libsqlite-3.51.2-hf5d6505_0.conda + url: https://conda.anaconda.org/conda-forge/win-64/libsqlite-3.51.2-hf5d6505_0.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: hfd05255_0 + build_number: 0 + constrains: + - xz 5.8.2.* + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: 0BSD + md5: ba0bfd4c3cf73f299ffe46ff0eaeb8e3 + name: liblzma + run_exports: + weak: + - liblzma >=5.8.2,<6.0a0 + sha256: f25bf293f550c8ed2e0c7145eb404324611cfccff37660869d97abf526eb957c + size: 106169 + subdir: win-64 + timestamp: 1768752763559 + version: 5.8.2 + fn: liblzma-5.8.2-hfd05255_0.conda + url: https://conda.anaconda.org/conda-forge/win-64/liblzma-5.8.2-hfd05255_0.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: hac47afa_0 + build_number: 0 + constrains: + - expat 2.7.3.* + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: MIT + license_family: MIT + md5: 8c9e4f1a0e688eef2e95711178061a0f + name: libexpat + run_exports: {} + sha256: 844ab708594bdfbd7b35e1a67c379861bcd180d6efe57b654f482ae2f7f5c21e + size: 70137 + subdir: win-64 + timestamp: 1763550049107 + version: 2.7.3 + fn: libexpat-2.7.3-hac47afa_0.conda + url: https://conda.anaconda.org/conda-forge/win-64/libexpat-2.7.3-hac47afa_0.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: pyh145f28c_0 + build_number: 0 + depends: + - python >=3.13.0a0 + license: MIT + license_family: MIT + md5: bf47878473e5ab9fdb4115735230e191 + name: pip + noarch: python + run_exports: {} + sha256: 4d5e2faca810459724f11f78d19a0feee27a7be2b3fc5f7abbbec4c9fdcae93d + size: 1177084 + subdir: noarch + timestamp: 1762776338614 + version: '25.3' + fn: pip-25.3-pyh145f28c_0.conda + url: https://conda.anaconda.org/conda-forge/noarch/pip-25.3-pyh145f28c_0.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: pyh332efcf_0 + build_number: 0 + depends: + - python >=3.10 + license: MIT + license_family: MIT + md5: 7b446fcbb6779ee479debb4fd7453e6c + name: setuptools + noarch: python + run_exports: {} + sha256: f5fcb7854d2b7639a5b1aca41dd0f2d5a69a60bbc313e7f192e2dc385ca52f86 + size: 678888 + subdir: noarch + timestamp: 1769601206751 + version: 80.10.2 + fn: setuptools-80.10.2-pyh332efcf_0.conda + url: https://conda.anaconda.org/conda-forge/noarch/setuptools-80.10.2-pyh332efcf_0.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: pyhd8ed1ab_0 + build_number: 0 + depends: + - packaging >=24.0 + - python >=3.10 + license: MIT + license_family: MIT + md5: bdbd7385b4a67025ac2dba4ef8cb6a8f + name: wheel + noarch: python + run_exports: {} + sha256: d6cf2f0ebd5e09120c28ecba450556ce553752652d91795442f0e70f837126ae + size: 31858 + subdir: noarch + timestamp: 1769139207397 + version: 0.46.3 + fn: wheel-0.46.3-pyhd8ed1ab_0.conda + url: https://conda.anaconda.org/conda-forge/noarch/wheel-0.46.3-pyhd8ed1ab_0.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h41ae7f8_34 + build_number: 34 + depends: + - vc14_runtime >=14.44.35208 + license: BSD-3-Clause + license_family: BSD + md5: 1e610f2416b6acdd231c5f573d754a0f + name: vc + run_exports: {} + sha256: 9dc40c2610a6e6727d635c62cced5ef30b7b30123f5ef67d6139e23d21744b3a + size: 19356 + subdir: win-64 + timestamp: 1767320221521 + track_features: vc14 + version: '14.3' + fn: vc-14.3-h41ae7f8_34.conda + url: https://conda.anaconda.org/conda-forge/win-64/vc-14.3-h41ae7f8_34.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h818238b_34 + build_number: 34 + constrains: + - vs2015_runtime 14.44.35208.* *_34 + depends: + - ucrt >=10.0.20348.0 + - vcomp14 14.44.35208 h818238b_34 + license: LicenseRef-MicrosoftVisualCpp2015-2022Runtime + license_family: Proprietary + md5: 37eb311485d2d8b2c419449582046a42 + name: vc14_runtime + run_exports: {} + sha256: 02732f953292cce179de9b633e74928037fa3741eb5ef91c3f8bae4f761d32a5 + size: 683233 + subdir: win-64 + timestamp: 1767320219644 + version: 14.44.35208 + fn: vc14_runtime-14.44.35208-h818238b_34.conda + url: https://conda.anaconda.org/conda-forge/win-64/vc14_runtime-14.44.35208-h818238b_34.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h818238b_34 + build_number: 34 + constrains: + - vs2015_runtime 14.44.35208.* *_34 + depends: + - ucrt >=10.0.20348.0 + license: LicenseRef-MicrosoftVisualCpp2015-2022Runtime + license_family: Proprietary + md5: 242d9f25d2ae60c76b38a5e42858e51d + name: vcomp14 + run_exports: + strong: + - vcomp14 >=14.44.35208 + sha256: 878d5d10318b119bd98ed3ed874bd467acbe21996e1d81597a1dbf8030ea0ce6 + size: 115235 + subdir: win-64 + timestamp: 1767320173250 + version: 14.44.35208 + fn: vcomp14-14.44.35208-h818238b_34.conda + url: https://conda.anaconda.org/conda-forge/win-64/vcomp14-14.44.35208-h818238b_34.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h57928b3_0 + build_number: 0 + constrains: + - vc14_runtime >=14.29.30037 + - vs2015_runtime >=14.29.30037 + depends: [] + license: LicenseRef-MicrosoftWindowsSDK10 + md5: 71b24316859acd00bdb8b38f5e2ce328 + name: ucrt + run_exports: {} + sha256: 3005729dce6f3d3f5ec91dfc49fc75a0095f9cd23bab49efb899657297ac91a5 + size: 694692 + subdir: win-64 + timestamp: 1756385147981 + version: 10.0.26100.0 + fn: ucrt-10.0.26100.0-h57928b3_0.conda + url: https://conda.anaconda.org/conda-forge/win-64/ucrt-10.0.26100.0-h57928b3_0.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h0ad9c76_8 + build_number: 8 + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: bzip2-1.0.6 + license_family: BSD + md5: 1077e9333c41ff0be8edd1a5ec0ddace + name: bzip2 + run_exports: + weak: + - bzip2 >=1.0.8,<2.0a0 + sha256: d882712855624641f48aa9dc3f5feea2ed6b4e6004585d3616386a18186fe692 + size: 55977 + subdir: win-64 + timestamp: 1757437738856 + version: 1.0.8 + fn: bzip2-1.0.8-h0ad9c76_8.conda + url: https://conda.anaconda.org/conda-forge/win-64/bzip2-1.0.8-h0ad9c76_8.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h3d046cb_0 + build_number: 0 + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: MIT + license_family: MIT + md5: 720b39f5ec0610457b725eb3f396219a + name: libffi + run_exports: + weak: + - libffi >=3.5.2,<3.6.0a0 + sha256: 59d01f2dfa8b77491b5888a5ab88ff4e1574c9359f7e229da254cdfe27ddc190 + size: 45831 + subdir: win-64 + timestamp: 1769456418774 + version: 3.5.2 + fn: libffi-3.5.2-h3d046cb_0.conda + url: https://conda.anaconda.org/conda-forge/win-64/libffi-3.5.2-h3d046cb_0.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: hfd05255_1 + build_number: 1 + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: BSD-2-Clause + license_family: BSD + md5: e4a9fc2bba3b022dad998c78856afe47 + name: libmpdec + run_exports: {} + sha256: 40dcd0b9522a6e0af72a9db0ced619176e7cfdb114855c7a64f278e73f8a7514 + size: 89411 + subdir: win-64 + timestamp: 1769482314283 + version: 4.0.0 + fn: libmpdec-4.0.0-hfd05255_1.conda + url: https://conda.anaconda.org/conda-forge/win-64/libmpdec-4.0.0-hfd05255_1.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h2466b09_2 + build_number: 2 + constrains: + - zlib 1.3.1 *_2 + depends: + - ucrt >=10.0.20348.0 + - vc >=14.2,<15 + - vc14_runtime >=14.29.30139 + license: Zlib + license_family: Other + md5: 41fbfac52c601159df6c01f875de31b9 + name: libzlib + run_exports: + weak: + - libzlib >=1.3.1,<2.0a0 + sha256: ba945c6493449bed0e6e29883c4943817f7c79cbff52b83360f7b341277c6402 + size: 55476 + subdir: win-64 + timestamp: 1727963768015 + version: 1.3.1 + fn: libzlib-1.3.1-h2466b09_2.conda + url: https://conda.anaconda.org/conda-forge/win-64/libzlib-1.3.1-h2466b09_2.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: hf411b9b_1 + build_number: 1 + depends: + - ca-certificates + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: Apache-2.0 + license_family: Apache + md5: eb585509b815415bc964b2c7e11c7eb3 + name: openssl + run_exports: + weak: + - openssl >=3.6.1,<4.0a0 + sha256: 53a5ad2e5553b8157a91bb8aa375f78c5958f77cb80e9d2ce59471ea8e5c0bd6 + size: 9343023 + subdir: win-64 + timestamp: 1769557547888 + version: 3.6.1 + fn: openssl-3.6.1-hf411b9b_1.conda + url: https://conda.anaconda.org/conda-forge/win-64/openssl-3.6.1-hf411b9b_1.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h6ed50ae_3 + build_number: 3 + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: TCL + license_family: BSD + md5: 0481bfd9814bf525bd4b3ee4b51494c4 + name: tk + run_exports: + weak: + - tk >=8.6.13,<8.7.0a0 + sha256: 0e79810fae28f3b69fe7391b0d43f5474d6bd91d451d5f2bde02f55ae481d5e3 + size: 3526350 + subdir: win-64 + timestamp: 1769460339384 + version: 8.6.13 + fn: tk-8.6.13-h6ed50ae_3.conda + url: https://conda.anaconda.org/conda-forge/win-64/tk-8.6.13-h6ed50ae_3.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: hc9c84f9_1 + build_number: 1 + depends: [] + license: LicenseRef-Public-Domain + md5: ad659d0a2b3e47e38d829aa8cad2d610 + name: tzdata + noarch: generic + run_exports: {} + sha256: 1d30098909076af33a35017eed6f2953af1c769e273a0626a04722ac4acaba3c + size: 119135 + subdir: noarch + timestamp: 1767016325805 + version: 2025c + fn: tzdata-2025c-hc9c84f9_1.conda + url: https://conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h534d264_6 + build_number: 6 + depends: + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - libzlib >=1.3.1,<2.0a0 + license: BSD-3-Clause + license_family: BSD + md5: 053b84beec00b71ea8ff7a4f84b55207 + name: zstd + run_exports: + weak: + - zstd >=1.5.7,<1.6.0a0 + sha256: 368d8628424966fd8f9c8018326a9c779e06913dd39e646cf331226acc90e5b2 + size: 388453 + subdir: win-64 + timestamp: 1764777142545 + version: 1.5.7 + fn: zstd-1.5.7-h534d264_6.conda + url: https://conda.anaconda.org/conda-forge/win-64/zstd-1.5.7-h534d264_6.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: pyhcf101f3_0 + build_number: 0 + depends: + - python >=3.8 + - python + license: Apache-2.0 + license_family: APACHE + md5: b76541e68fea4d511b1ac46a28dcd2c6 + name: packaging + noarch: python + run_exports: {} + sha256: c1fc0f953048f743385d31c468b4a678b3ad20caffdeaa94bed85ba63049fd58 + size: 72010 + subdir: noarch + timestamp: 1769093650580 + version: '26.0' + fn: packaging-26.0-pyhcf101f3_0.conda + url: https://conda.anaconda.org/conda-forge/noarch/packaging-26.0-pyhcf101f3_0.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h4c7d964_0 + build_number: 0 + depends: + - __win + license: ISC + md5: 84d389c9eee640dda3d26fc5335c67d8 + name: ca-certificates + noarch: generic + run_exports: {} + sha256: 4ddcb01be03f85d3db9d881407fb13a673372f1b9fac9c836ea441893390e049 + size: 147139 + subdir: noarch + timestamp: 1767500904211 + version: 2026.1.4 + fn: ca-certificates-2026.1.4-h4c7d964_0.conda + url: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.1.4-h4c7d964_0.conda + channel: https://conda.anaconda.org/conda-forge/ + run: + depends: + - source: python + - spec: vc >=14.3,<15 + from: build + run_export: vs2022_win-64 + - spec: vc14_runtime >=14.44.35208 + from: build + run_export: vs2022_win-64 + - spec: ucrt >=10.0.20348.0 + from: build + run_export: vs2022_win-64 + - spec: vc >=14.3,<15 + from: build + run_export: vs_win-64 + - spec: vc14_runtime >=14.44.35208 + from: build + run_export: vs_win-64 + - spec: ucrt >=10.0.20348.0 + from: build + run_export: vs_win-64 + - spec: python_abi 3.14.* *_cp314t + from: host + run_export: python + constraints: [] +finalized_sources: +- url: https://pypi.org/packages/source/p/psutil/psutil-7.2.2.tar.gz + sha256: 0746f5f8d406af344fd547f1c8daa5f5c33dbc293bb8d6a16d80b4bb88f59372 +system_tools: + rattler-build: 0.55.1 +extra_meta: + flow_run_id: azure_20260129.4.1 + remote_url: https://github.com/conda-forge/psutil-feedstock + sha: bbd3baefd9321a72c980b9419495043d4e44b3a1 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/recipe/variant_config.yaml b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/recipe/variant_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..17acb443ab7f09a620ff66df999aa66696eb239b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/recipe/variant_config.yaml @@ -0,0 +1,7 @@ +build_platform: win-64 +c_compiler: vs2022 +c_stdlib: vs +channel_sources: conda-forge +channel_targets: conda-forge main +python: 3.14.* *_cp314t +target_platform: win-64 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/repodata_record.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/repodata_record.json new file mode 100644 index 0000000000000000000000000000000000000000..0fbd6cd9b6ab46cb4c2d6d3025a352841603cedc --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/repodata_record.json @@ -0,0 +1,26 @@ +{ + "arch": "x86_64", + "build": "py314h8f04a7f_0", + "build_number": 0, + "build_string": "py314h8f04a7f_0", + "channel": "conda-forge", + "constrains": [], + "depends": [ + "python", + "vc >=14.3,<15", + "vc14_runtime >=14.44.35208", + "ucrt >=10.0.20348.0", + "python_abi 3.14.* *_cp314t" + ], + "fn": "psutil-7.2.2-py314h8f04a7f_0.conda", + "license": "BSD-3-Clause", + "md5": "cf22d3d710d26bdf848625f7b668b734", + "name": "psutil", + "platform": "win", + "sha256": "3189d8ba29c76902f8f49650537e1062927aa22d2e67b54b1700c6c35347033a", + "size": 251992, + "subdir": "win-64", + "timestamp": 1769678173, + "url": "https://conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0.conda", + "version": "7.2.2" +} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/tests/tests.yaml b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/tests/tests.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1ae04b38bbd7d73a827d679d0079ffe9002ac08f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0/info/tests/tests.yaml @@ -0,0 +1,4 @@ +- python: + imports: + - psutil + - psutil._psutil_windows diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil-7.2.2.dist-info/INSTALLER b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil-7.2.2.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a34a7e56db35cc4c85bfa166244b3d63a6a240d4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil-7.2.2.dist-info/INSTALLER @@ -0,0 +1 @@ +conda diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil-7.2.2.dist-info/METADATA b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil-7.2.2.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..8319b3fd872402bdba1f950c0197b40613cdb2b9 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil-7.2.2.dist-info/METADATA @@ -0,0 +1,555 @@ +Metadata-Version: 2.4 +Name: psutil +Version: 7.2.2 +Summary: Cross-platform lib for process and system monitoring. +Home-page: https://github.com/giampaolo/psutil +Author: Giampaolo Rodola +Author-email: g.rodola@gmail.com +License: BSD-3-Clause +Keywords: ps,top,kill,free,lsof,netstat,nice,tty,ionice,uptime,taskmgr,process,df,iotop,iostat,ifconfig,taskset,who,pidof,pmap,smem,pstree,monitoring,ulimit,prlimit,smem,performance,metrics,agent,observability +Platform: Platform Independent +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Console +Classifier: Intended Audience :: Developers +Classifier: Intended Audience :: Information Technology +Classifier: Intended Audience :: System Administrators +Classifier: Operating System :: MacOS :: MacOS X +Classifier: Operating System :: Microsoft :: Windows :: Windows 10 +Classifier: Operating System :: Microsoft :: Windows :: Windows 11 +Classifier: Operating System :: Microsoft :: Windows :: Windows 7 +Classifier: Operating System :: Microsoft :: Windows :: Windows 8 +Classifier: Operating System :: Microsoft :: Windows :: Windows 8.1 +Classifier: Operating System :: Microsoft :: Windows :: Windows Server 2003 +Classifier: Operating System :: Microsoft :: Windows :: Windows Server 2008 +Classifier: Operating System :: Microsoft :: Windows :: Windows Vista +Classifier: Operating System :: Microsoft :: Windows +Classifier: Operating System :: Microsoft +Classifier: Operating System :: OS Independent +Classifier: Operating System :: POSIX :: AIX +Classifier: Operating System :: POSIX :: BSD :: FreeBSD +Classifier: Operating System :: POSIX :: BSD :: NetBSD +Classifier: Operating System :: POSIX :: BSD :: OpenBSD +Classifier: Operating System :: POSIX :: BSD +Classifier: Operating System :: POSIX :: Linux +Classifier: Operating System :: POSIX :: SunOS/Solaris +Classifier: Operating System :: POSIX +Classifier: Programming Language :: C +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Classifier: Programming Language :: Python +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Topic :: Software Development :: Libraries +Classifier: Topic :: System :: Benchmark +Classifier: Topic :: System :: Hardware +Classifier: Topic :: System :: Monitoring +Classifier: Topic :: System :: Networking :: Monitoring :: Hardware Watchdog +Classifier: Topic :: System :: Networking :: Monitoring +Classifier: Topic :: System :: Networking +Classifier: Topic :: System :: Operating System +Classifier: Topic :: System :: Systems Administration +Classifier: Topic :: Utilities +Requires-Python: >=3.6 +Description-Content-Type: text/x-rst +License-File: LICENSE +Provides-Extra: dev +Requires-Dist: psleak; extra == "dev" +Requires-Dist: pytest; extra == "dev" +Requires-Dist: pytest-instafail; extra == "dev" +Requires-Dist: pytest-xdist; extra == "dev" +Requires-Dist: setuptools; extra == "dev" +Requires-Dist: pywin32; (os_name == "nt" and implementation_name != "pypy") and extra == "dev" +Requires-Dist: wheel; (os_name == "nt" and implementation_name != "pypy") and extra == "dev" +Requires-Dist: wmi; (os_name == "nt" and implementation_name != "pypy") and extra == "dev" +Requires-Dist: abi3audit; extra == "dev" +Requires-Dist: black; extra == "dev" +Requires-Dist: check-manifest; extra == "dev" +Requires-Dist: coverage; extra == "dev" +Requires-Dist: packaging; extra == "dev" +Requires-Dist: pylint; extra == "dev" +Requires-Dist: pyperf; extra == "dev" +Requires-Dist: pypinfo; extra == "dev" +Requires-Dist: pytest-cov; extra == "dev" +Requires-Dist: requests; extra == "dev" +Requires-Dist: rstcheck; extra == "dev" +Requires-Dist: ruff; extra == "dev" +Requires-Dist: sphinx; extra == "dev" +Requires-Dist: sphinx_rtd_theme; extra == "dev" +Requires-Dist: toml-sort; extra == "dev" +Requires-Dist: twine; extra == "dev" +Requires-Dist: validate-pyproject[all]; extra == "dev" +Requires-Dist: virtualenv; extra == "dev" +Requires-Dist: vulture; extra == "dev" +Requires-Dist: wheel; extra == "dev" +Requires-Dist: colorama; os_name == "nt" and extra == "dev" +Requires-Dist: pyreadline3; os_name == "nt" and extra == "dev" +Provides-Extra: test +Requires-Dist: psleak; extra == "test" +Requires-Dist: pytest; extra == "test" +Requires-Dist: pytest-instafail; extra == "test" +Requires-Dist: pytest-xdist; extra == "test" +Requires-Dist: setuptools; extra == "test" +Requires-Dist: pywin32; (os_name == "nt" and implementation_name != "pypy") and extra == "test" +Requires-Dist: wheel; (os_name == "nt" and implementation_name != "pypy") and extra == "test" +Requires-Dist: wmi; (os_name == "nt" and implementation_name != "pypy") and extra == "test" +Dynamic: author +Dynamic: author-email +Dynamic: classifier +Dynamic: description +Dynamic: description-content-type +Dynamic: home-page +Dynamic: keywords +Dynamic: license +Dynamic: license-file +Dynamic: platform +Dynamic: provides-extra +Dynamic: requires-python +Dynamic: summary + +| |downloads| |stars| |forks| |contributors| |packages| +| |version| |license| |stackoverflow| |twitter| |tidelift| +| |github-actions-wheels| |github-actions-bsd| + +.. |downloads| image:: https://img.shields.io/pypi/dm/psutil.svg + :target: https://clickpy.clickhouse.com/dashboard/psutil + :alt: Downloads + +.. |stars| image:: https://img.shields.io/github/stars/giampaolo/psutil.svg + :target: https://github.com/giampaolo/psutil/stargazers + :alt: Github stars + +.. |forks| image:: https://img.shields.io/github/forks/giampaolo/psutil.svg + :target: https://github.com/giampaolo/psutil/network/members + :alt: Github forks + +.. |contributors| image:: https://img.shields.io/github/contributors/giampaolo/psutil.svg + :target: https://github.com/giampaolo/psutil/graphs/contributors + :alt: Contributors + +.. |stackoverflow| image:: https://img.shields.io/badge/stackoverflow-Ask%20questions-blue.svg + :target: https://stackoverflow.com/questions/tagged/psutil + :alt: Stackoverflow + +.. |github-actions-wheels| image:: https://img.shields.io/github/actions/workflow/status/giampaolo/psutil/.github/workflows/build.yml.svg?label=Linux%2C%20macOS%2C%20Windows + :target: https://github.com/giampaolo/psutil/actions?query=workflow%3Abuild + :alt: Linux, macOS, Windows + +.. |github-actions-bsd| image:: https://img.shields.io/github/actions/workflow/status/giampaolo/psutil/.github/workflows/bsd.yml.svg?label=FreeBSD,%20NetBSD,%20OpenBSD + :target: https://github.com/giampaolo/psutil/actions?query=workflow%3Absd-tests + :alt: FreeBSD, NetBSD, OpenBSD + +.. |version| image:: https://img.shields.io/pypi/v/psutil.svg?label=pypi + :target: https://pypi.org/project/psutil + :alt: Latest version + +.. |packages| image:: https://repology.org/badge/tiny-repos/python:psutil.svg + :target: https://repology.org/metapackage/python:psutil/versions + :alt: Binary packages + +.. |license| image:: https://img.shields.io/pypi/l/psutil.svg + :target: https://github.com/giampaolo/psutil/blob/master/LICENSE + :alt: License + +.. |twitter| image:: https://img.shields.io/twitter/follow/grodola?style=flat + :target: https://twitter.com/grodola + :alt: Twitter Follow + +.. |tidelift| image:: https://tidelift.com/badges/github/giampaolo/psutil?style=flat + :target: https://tidelift.com/subscription/pkg/pypi-psutil?utm_source=pypi-psutil&utm_medium=referral&utm_campaign=readme + :alt: Tidelift + +----- + +Quick links +=========== + +- `Home page `_ +- `Install `_ +- `Documentation `_ +- `Download `_ +- `Forum `_ +- `StackOverflow `_ +- `Blog `_ +- `What's new `_ + + +Summary +======= + +psutil (process and system utilities) is a cross-platform library for +retrieving information on **running processes** and **system utilization** +(CPU, memory, disks, network, sensors) in Python. +It is useful mainly for **system monitoring**, **profiling and limiting process +resources** and **management of running processes**. +It implements many functionalities offered by classic UNIX command line tools +such as *ps, top, iotop, lsof, netstat, ifconfig, free* and others. +psutil currently supports the following platforms: + +- **Linux** +- **Windows** +- **macOS** +- **FreeBSD, OpenBSD**, **NetBSD** +- **Sun Solaris** +- **AIX** + +Supported Python versions are cPython 3.6+ and `PyPy `__. +Latest psutil version supporting Python 2.7 is +`psutil 6.1.1 `__. + +Example usages +============== + +This represents pretty much the whole psutil API. + +CPU +--- + +.. code-block:: python + + >>> import psutil + >>> + >>> psutil.cpu_times() + scputimes(user=3961.46, nice=169.729, system=2150.659, idle=16900.540, iowait=629.59, irq=0.0, softirq=19.42, steal=0.0, guest=0, guest_nice=0.0) + >>> + >>> for x in range(3): + ... psutil.cpu_percent(interval=1) + ... + 4.0 + 5.9 + 3.8 + >>> + >>> for x in range(3): + ... psutil.cpu_percent(interval=1, percpu=True) + ... + [4.0, 6.9, 3.7, 9.2] + [7.0, 8.5, 2.4, 2.1] + [1.2, 9.0, 9.9, 7.2] + >>> + >>> for x in range(3): + ... psutil.cpu_times_percent(interval=1, percpu=False) + ... + scputimes(user=1.5, nice=0.0, system=0.5, idle=96.5, iowait=1.5, irq=0.0, softirq=0.0, steal=0.0, guest=0.0, guest_nice=0.0) + scputimes(user=1.0, nice=0.0, system=0.0, idle=99.0, iowait=0.0, irq=0.0, softirq=0.0, steal=0.0, guest=0.0, guest_nice=0.0) + scputimes(user=2.0, nice=0.0, system=0.0, idle=98.0, iowait=0.0, irq=0.0, softirq=0.0, steal=0.0, guest=0.0, guest_nice=0.0) + >>> + >>> psutil.cpu_count() + 4 + >>> psutil.cpu_count(logical=False) + 2 + >>> + >>> psutil.cpu_stats() + scpustats(ctx_switches=20455687, interrupts=6598984, soft_interrupts=2134212, syscalls=0) + >>> + >>> psutil.cpu_freq() + scpufreq(current=931.42925, min=800.0, max=3500.0) + >>> + >>> psutil.getloadavg() # also on Windows (emulated) + (3.14, 3.89, 4.67) + +Memory +------ + +.. code-block:: python + + >>> psutil.virtual_memory() + svmem(total=10367352832, available=6472179712, percent=37.6, used=8186245120, free=2181107712, active=4748992512, inactive=2758115328, buffers=790724608, cached=3500347392, shared=787554304) + >>> psutil.swap_memory() + sswap(total=2097147904, used=296128512, free=1801019392, percent=14.1, sin=304193536, sout=677842944) + >>> + +Disks +----- + +.. code-block:: python + + >>> psutil.disk_partitions() + [sdiskpart(device='/dev/sda1', mountpoint='/', fstype='ext4', opts='rw,nosuid'), + sdiskpart(device='/dev/sda2', mountpoint='/home', fstype='ext', opts='rw')] + >>> + >>> psutil.disk_usage('/') + sdiskusage(total=21378641920, used=4809781248, free=15482871808, percent=22.5) + >>> + >>> psutil.disk_io_counters(perdisk=False) + sdiskio(read_count=719566, write_count=1082197, read_bytes=18626220032, write_bytes=24081764352, read_time=5023392, write_time=63199568, read_merged_count=619166, write_merged_count=812396, busy_time=4523412) + >>> + +Network +------- + +.. code-block:: python + + >>> psutil.net_io_counters(pernic=True) + {'eth0': netio(bytes_sent=485291293, bytes_recv=6004858642, packets_sent=3251564, packets_recv=4787798, errin=0, errout=0, dropin=0, dropout=0), + 'lo': netio(bytes_sent=2838627, bytes_recv=2838627, packets_sent=30567, packets_recv=30567, errin=0, errout=0, dropin=0, dropout=0)} + >>> + >>> psutil.net_connections(kind='tcp') + [sconn(fd=115, family=, type=, laddr=addr(ip='10.0.0.1', port=48776), raddr=addr(ip='93.186.135.91', port=80), status='ESTABLISHED', pid=1254), + sconn(fd=117, family=, type=, laddr=addr(ip='10.0.0.1', port=43761), raddr=addr(ip='72.14.234.100', port=80), status='CLOSING', pid=2987), + ...] + >>> + >>> psutil.net_if_addrs() + {'lo': [snicaddr(family=, address='127.0.0.1', netmask='255.0.0.0', broadcast='127.0.0.1', ptp=None), + snicaddr(family=, address='::1', netmask='ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', broadcast=None, ptp=None), + snicaddr(family=, address='00:00:00:00:00:00', netmask=None, broadcast='00:00:00:00:00:00', ptp=None)], + 'wlan0': [snicaddr(family=, address='192.168.1.3', netmask='255.255.255.0', broadcast='192.168.1.255', ptp=None), + snicaddr(family=, address='fe80::c685:8ff:fe45:641%wlan0', netmask='ffff:ffff:ffff:ffff::', broadcast=None, ptp=None), + snicaddr(family=, address='c4:85:08:45:06:41', netmask=None, broadcast='ff:ff:ff:ff:ff:ff', ptp=None)]} + >>> + >>> psutil.net_if_stats() + {'lo': snicstats(isup=True, duplex=, speed=0, mtu=65536, flags='up,loopback,running'), + 'wlan0': snicstats(isup=True, duplex=, speed=100, mtu=1500, flags='up,broadcast,running,multicast')} + >>> + +Sensors +------- + +.. code-block:: python + + >>> import psutil + >>> psutil.sensors_temperatures() + {'acpitz': [shwtemp(label='', current=47.0, high=103.0, critical=103.0)], + 'asus': [shwtemp(label='', current=47.0, high=None, critical=None)], + 'coretemp': [shwtemp(label='Physical id 0', current=52.0, high=100.0, critical=100.0), + shwtemp(label='Core 0', current=45.0, high=100.0, critical=100.0)]} + >>> + >>> psutil.sensors_fans() + {'asus': [sfan(label='cpu_fan', current=3200)]} + >>> + >>> psutil.sensors_battery() + sbattery(percent=93, secsleft=16628, power_plugged=False) + >>> + +Other system info +----------------- + +.. code-block:: python + + >>> import psutil + >>> psutil.users() + [suser(name='giampaolo', terminal='pts/2', host='localhost', started=1340737536.0, pid=1352), + suser(name='giampaolo', terminal='pts/3', host='localhost', started=1340737792.0, pid=1788)] + >>> + >>> psutil.boot_time() + 1365519115.0 + >>> + +Process management +------------------ + +.. code-block:: python + + >>> import psutil + >>> psutil.pids() + [1, 2, 3, 4, 5, 6, 7, 46, 48, 50, 51, 178, 182, 222, 223, 224, 268, 1215, + 1216, 1220, 1221, 1243, 1244, 1301, 1601, 2237, 2355, 2637, 2774, 3932, + 4176, 4177, 4185, 4187, 4189, 4225, 4243, 4245, 4263, 4282, 4306, 4311, + 4312, 4313, 4314, 4337, 4339, 4357, 4358, 4363, 4383, 4395, 4408, 4433, + 4443, 4445, 4446, 5167, 5234, 5235, 5252, 5318, 5424, 5644, 6987, 7054, + 7055, 7071] + >>> + >>> p = psutil.Process(7055) + >>> p + psutil.Process(pid=7055, name='python3', status='running', started='09:04:44') + >>> p.pid + 7055 + >>> p.name() + 'python3' + >>> p.exe() + '/usr/bin/python3' + >>> p.cwd() + '/home/giampaolo' + >>> p.cmdline() + ['/usr/bin/python3', 'main.py'] + >>> + >>> p.ppid() + 7054 + >>> p.parent() + psutil.Process(pid=4699, name='bash', status='sleeping', started='09:06:44') + >>> p.parents() + [psutil.Process(pid=4699, name='bash', started='09:06:44'), + psutil.Process(pid=4689, name='gnome-terminal-server', status='sleeping', started='0:06:44'), + psutil.Process(pid=1, name='systemd', status='sleeping', started='05:56:55')] + >>> p.children(recursive=True) + [psutil.Process(pid=29835, name='python3', status='sleeping', started='11:45:38'), + psutil.Process(pid=29836, name='python3', status='waking', started='11:43:39')] + >>> + >>> p.status() + 'running' + >>> p.create_time() + 1267551141.5019531 + >>> p.terminal() + '/dev/pts/0' + >>> + >>> p.username() + 'giampaolo' + >>> p.uids() + puids(real=1000, effective=1000, saved=1000) + >>> p.gids() + pgids(real=1000, effective=1000, saved=1000) + >>> + >>> p.cpu_times() + pcputimes(user=1.02, system=0.31, children_user=0.32, children_system=0.1, iowait=0.0) + >>> p.cpu_percent(interval=1.0) + 12.1 + >>> p.cpu_affinity() + [0, 1, 2, 3] + >>> p.cpu_affinity([0, 1]) # set + >>> p.cpu_num() + 1 + >>> + >>> p.memory_info() + pmem(rss=10915840, vms=67608576, shared=3313664, text=2310144, lib=0, data=7262208, dirty=0) + >>> p.memory_full_info() # "real" USS memory usage (Linux, macOS, Win only) + pfullmem(rss=10199040, vms=52133888, shared=3887104, text=2867200, lib=0, data=5967872, dirty=0, uss=6545408, pss=6872064, swap=0) + >>> p.memory_percent() + 0.7823 + >>> p.memory_maps() + [pmmap_grouped(path='/lib/x8664-linux-gnu/libutil-2.15.so', rss=32768, size=2125824, pss=32768, shared_clean=0, shared_dirty=0, private_clean=20480, private_dirty=12288, referenced=32768, anonymous=12288, swap=0), + pmmap_grouped(path='/lib/x8664-linux-gnu/libc-2.15.so', rss=3821568, size=3842048, pss=3821568, shared_clean=0, shared_dirty=0, private_clean=0, private_dirty=3821568, referenced=3575808, anonymous=3821568, swap=0), + pmmap_grouped(path='[heap]', rss=32768, size=139264, pss=32768, shared_clean=0, shared_dirty=0, private_clean=0, private_dirty=32768, referenced=32768, anonymous=32768, swap=0), + pmmap_grouped(path='[stack]', rss=2465792, size=2494464, pss=2465792, shared_clean=0, shared_dirty=0, private_clean=0, private_dirty=2465792, referenced=2277376, anonymous=2465792, swap=0), + ...] + >>> + >>> p.io_counters() + pio(read_count=478001, write_count=59371, read_bytes=700416, write_bytes=69632, read_chars=456232, write_chars=517543) + >>> + >>> p.open_files() + [popenfile(path='/home/giampaolo/monit.py', fd=3, position=0, mode='r', flags=32768), + popenfile(path='/var/log/monit.log', fd=4, position=235542, mode='a', flags=33793)] + >>> + >>> p.net_connections(kind='tcp') + [pconn(fd=115, family=, type=, laddr=addr(ip='10.0.0.1', port=48776), raddr=addr(ip='93.186.135.91', port=80), status='ESTABLISHED'), + pconn(fd=117, family=, type=, laddr=addr(ip='10.0.0.1', port=43761), raddr=addr(ip='72.14.234.100', port=80), status='CLOSING')] + >>> + >>> p.threads() + [pthread(id=5234, user_time=22.5, system_time=9.2891), + pthread(id=5237, user_time=0.0707, system_time=1.1)] + >>> + >>> p.num_threads() + 4 + >>> p.num_fds() + 8 + >>> p.num_ctx_switches() + pctxsw(voluntary=78, involuntary=19) + >>> + >>> p.nice() + 0 + >>> p.nice(10) # set + >>> + >>> p.ionice(psutil.IOPRIO_CLASS_IDLE) # IO priority (Win and Linux only) + >>> p.ionice() + pionice(ioclass=, value=0) + >>> + >>> p.rlimit(psutil.RLIMIT_NOFILE, (5, 5)) # set resource limits (Linux only) + >>> p.rlimit(psutil.RLIMIT_NOFILE) + (5, 5) + >>> + >>> p.environ() + {'LC_PAPER': 'it_IT.UTF-8', 'SHELL': '/bin/bash', 'GREP_OPTIONS': '--color=auto', + 'XDG_CONFIG_DIRS': '/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg', + ...} + >>> + >>> p.as_dict() + {'status': 'running', 'num_ctx_switches': pctxsw(voluntary=63, involuntary=1), 'pid': 5457, ...} + >>> p.is_running() + True + >>> p.suspend() + >>> p.resume() + >>> + >>> p.terminate() + >>> p.kill() + >>> p.wait(timeout=3) + + >>> + >>> psutil.test() + USER PID %CPU %MEM VSZ RSS TTY START TIME COMMAND + root 1 0.0 0.0 24584 2240 Jun17 00:00 init + root 2 0.0 0.0 0 0 Jun17 00:00 kthreadd + ... + giampaolo 31475 0.0 0.0 20760 3024 /dev/pts/0 Jun19 00:00 python2.4 + giampaolo 31721 0.0 2.2 773060 181896 00:04 10:30 chrome + root 31763 0.0 0.0 0 0 00:05 00:00 kworker/0:1 + >>> + +Further process APIs +-------------------- + +.. code-block:: python + + >>> import psutil + >>> for proc in psutil.process_iter(['pid', 'name']): + ... print(proc.info) + ... + {'pid': 1, 'name': 'systemd'} + {'pid': 2, 'name': 'kthreadd'} + {'pid': 3, 'name': 'ksoftirqd/0'} + ... + >>> + >>> psutil.pid_exists(3) + True + >>> + >>> def on_terminate(proc): + ... print("process {} terminated".format(proc)) + ... + >>> # waits for multiple processes to terminate + >>> gone, alive = psutil.wait_procs(procs_list, timeout=3, callback=on_terminate) + >>> + +Heap info +--------- + +.. code-block:: python + + >>> import psutil + >>> psutil.heap_info() + pheap(heap_used=5177792, mmap_used=819200) + >>> psutil.heap_trim() + +See also `psleak `__ + +Windows services +---------------- + +.. code-block:: python + + >>> list(psutil.win_service_iter()) + [, + , + , + , + ...] + >>> s = psutil.win_service_get('alg') + >>> s.as_dict() + {'binpath': 'C:\\Windows\\System32\\alg.exe', + 'description': 'Provides support for 3rd party protocol plug-ins for Internet Connection Sharing', + 'display_name': 'Application Layer Gateway Service', + 'name': 'alg', + 'pid': None, + 'start_type': 'manual', + 'status': 'stopped', + 'username': 'NT AUTHORITY\\LocalService'} + +Projects using psutil +===================== + +Here's some I find particularly interesting: + +- https://github.com/giampaolo/psleak +- https://github.com/google/grr +- https://github.com/facebook/osquery/ +- https://github.com/nicolargo/glances +- https://github.com/aristocratos/bpytop +- https://github.com/Jahaja/psdash +- https://github.com/ajenti/ajenti +- https://github.com/home-assistant/home-assistant/ + +Portings +======== + +- Go: https://github.com/shirou/gopsutil +- C: https://github.com/hamon-in/cpslib +- Rust: https://github.com/rust-psutil/rust-psutil +- Nim: https://github.com/johnscillieri/psutil-nim + + + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil-7.2.2.dist-info/RECORD b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil-7.2.2.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..b03337dab68251a5e8f6157e973cb52e98b96480 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil-7.2.2.dist-info/RECORD @@ -0,0 +1,29 @@ +psutil-7.2.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +psutil-7.2.2.dist-info/METADATA,sha256=7sP_UB2h_DIjG_gTmfCkgMCyKaBYDuUpjNuzWrZVIQM,22973 +psutil-7.2.2.dist-info/RECORD,, +psutil-7.2.2.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +psutil-7.2.2.dist-info/WHEEL,sha256=cMcQWxr0mPhFRPjwRMzQO4N4DwJVdxU9Wjg08Cyz1B4,100 +psutil-7.2.2.dist-info/direct_url.json,sha256=Vh8El1kW6ulSr_Kf4jwWK8y1pqo8nzKTPaeDJEmZSVc,82 +psutil-7.2.2.dist-info/licenses/LICENSE,sha256=uJwGOzeG4o4MCjjxkx22H-015p3SopZvvs_-4PRsjRA,1548 +psutil-7.2.2.dist-info/top_level.txt,sha256=gCNhn57wzksDjSAISmgMJ0aiXzQulk0GJhb2-BAyYgw,7 +psutil/__init__.py,sha256=HLMFt5EXYYZYyAvHGRBSTlNyTKpqC70sweMMivi7ZNk,89857 +psutil/__pycache__/__init__.cpython-314.pyc,, +psutil/__pycache__/_common.cpython-314.pyc,, +psutil/__pycache__/_ntuples.cpython-314.pyc,, +psutil/__pycache__/_psaix.cpython-314.pyc,, +psutil/__pycache__/_psbsd.cpython-314.pyc,, +psutil/__pycache__/_pslinux.cpython-314.pyc,, +psutil/__pycache__/_psosx.cpython-314.pyc,, +psutil/__pycache__/_psposix.cpython-314.pyc,, +psutil/__pycache__/_pssunos.cpython-314.pyc,, +psutil/__pycache__/_pswindows.cpython-314.pyc,, +psutil/_common.py,sha256=G7zp_Zfm9UOaDThfKEAfUnxanZeNnQYlk9fvb-IV_HU,25254 +psutil/_ntuples.py,sha256=m46Lk4q64nhqUV9ob02BMiGL6Jfra0WbkyTtF9iKMcc,10970 +psutil/_psaix.py,sha256=r-QDjV4UVFWfF9rJ5sLFatjPhz1DiA9lA-hUnMBqGOw,17616 +psutil/_psbsd.py,sha256=wagxSpZAZJyZGX_yYdvuwfAIAXXko_a1yzcKOTMt65Q,29263 +psutil/_pslinux.py,sha256=qKCbq4eEgHW2kcRhErAGknRXhajJ1aLIcDeuEktGl0k,84787 +psutil/_psosx.py,sha256=ifDqDpwf448iS2Enkr8x0HyIgNeSgYBuU3nABRT2s_I,15913 +psutil/_psposix.py,sha256=KIiHtY9ZOeOwDgIfbntJDC9_SFKASjWZGKt9nG-zmDk,11575 +psutil/_pssunos.py,sha256=zDSEQgCKVMtgVCmbLsrg2aEjwHu0uh-OFLMZSH-DzuU,23934 +psutil/_psutil_windows.pyd,sha256=y_KwD7B8sHINE8IdW9sE2IbwTA-Fzizz0EDN6NPSkCk,71680 +psutil/_pswindows.py,sha256=WArTkd5zTBE2giAO6fQkXjRzf14mrwpzpOjJtEWN4iA,35370 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil-7.2.2.dist-info/REQUESTED b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil-7.2.2.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil-7.2.2.dist-info/WHEEL b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil-7.2.2.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..2e01717dd1bb1a01d1e097c506cbb47284ee6933 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil-7.2.2.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: setuptools (80.10.2) +Root-Is-Purelib: false +Tag: cp37-abi3-win_amd64 + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil-7.2.2.dist-info/direct_url.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil-7.2.2.dist-info/direct_url.json new file mode 100644 index 0000000000000000000000000000000000000000..22a3f8f036548932e5234e40a1a24c76c849491f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil-7.2.2.dist-info/direct_url.json @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///D:/bld/bld/rattler-build_psutil_1769678167/work"} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil-7.2.2.dist-info/licenses/LICENSE b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil-7.2.2.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..cff5eb74e1badd1c5237ed2654b349530179ad1d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil-7.2.2.dist-info/licenses/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2009, Jay Loden, Dave Daeschler, Giampaolo Rodola +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 psutil authors 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. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil-7.2.2.dist-info/top_level.txt b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil-7.2.2.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..a4d92cc08db6a0d8bfedbbbd620d1fb11f84677b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil-7.2.2.dist-info/top_level.txt @@ -0,0 +1 @@ +psutil diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f10598e9bcca7b301782c519a7270ac3c56a8c71 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__init__.py @@ -0,0 +1,2484 @@ +# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""psutil is a cross-platform library for retrieving information on +running processes and system utilization (CPU, memory, disks, network, +sensors) in Python. Supported platforms: + + - Linux + - Windows + - macOS + - FreeBSD + - OpenBSD + - NetBSD + - Sun Solaris + - AIX + +Supported Python versions are cPython 3.6+ and PyPy. +""" + +import collections +import contextlib +import datetime +import functools +import os +import signal +import socket +import subprocess +import sys +import threading +import time + +try: + import pwd +except ImportError: + pwd = None + +from . import _common +from . import _ntuples as _ntp +from ._common import AIX +from ._common import BSD +from ._common import CONN_CLOSE +from ._common import CONN_CLOSE_WAIT +from ._common import CONN_CLOSING +from ._common import CONN_ESTABLISHED +from ._common import CONN_FIN_WAIT1 +from ._common import CONN_FIN_WAIT2 +from ._common import CONN_LAST_ACK +from ._common import CONN_LISTEN +from ._common import CONN_NONE +from ._common import CONN_SYN_RECV +from ._common import CONN_SYN_SENT +from ._common import CONN_TIME_WAIT +from ._common import FREEBSD +from ._common import LINUX +from ._common import MACOS +from ._common import NETBSD +from ._common import NIC_DUPLEX_FULL +from ._common import NIC_DUPLEX_HALF +from ._common import NIC_DUPLEX_UNKNOWN +from ._common import OPENBSD +from ._common import OSX # deprecated alias +from ._common import POSIX +from ._common import POWER_TIME_UNKNOWN +from ._common import POWER_TIME_UNLIMITED +from ._common import STATUS_DEAD +from ._common import STATUS_DISK_SLEEP +from ._common import STATUS_IDLE +from ._common import STATUS_LOCKED +from ._common import STATUS_PARKED +from ._common import STATUS_RUNNING +from ._common import STATUS_SLEEPING +from ._common import STATUS_STOPPED +from ._common import STATUS_TRACING_STOP +from ._common import STATUS_WAITING +from ._common import STATUS_WAKING +from ._common import STATUS_ZOMBIE +from ._common import SUNOS +from ._common import WINDOWS +from ._common import AccessDenied +from ._common import Error +from ._common import NoSuchProcess +from ._common import TimeoutExpired +from ._common import ZombieProcess +from ._common import debug +from ._common import memoize_when_activated +from ._common import wrap_numbers as _wrap_numbers + +if LINUX: + # This is public API and it will be retrieved from _pslinux.py + # via sys.modules. + PROCFS_PATH = "/proc" + + from . import _pslinux as _psplatform + from ._pslinux import IOPRIO_CLASS_BE # noqa: F401 + from ._pslinux import IOPRIO_CLASS_IDLE # noqa: F401 + from ._pslinux import IOPRIO_CLASS_NONE # noqa: F401 + from ._pslinux import IOPRIO_CLASS_RT # noqa: F401 + +elif WINDOWS: + from . import _pswindows as _psplatform + from ._psutil_windows import ABOVE_NORMAL_PRIORITY_CLASS # noqa: F401 + from ._psutil_windows import BELOW_NORMAL_PRIORITY_CLASS # noqa: F401 + from ._psutil_windows import HIGH_PRIORITY_CLASS # noqa: F401 + from ._psutil_windows import IDLE_PRIORITY_CLASS # noqa: F401 + from ._psutil_windows import NORMAL_PRIORITY_CLASS # noqa: F401 + from ._psutil_windows import REALTIME_PRIORITY_CLASS # noqa: F401 + from ._pswindows import CONN_DELETE_TCB # noqa: F401 + from ._pswindows import IOPRIO_HIGH # noqa: F401 + from ._pswindows import IOPRIO_LOW # noqa: F401 + from ._pswindows import IOPRIO_NORMAL # noqa: F401 + from ._pswindows import IOPRIO_VERYLOW # noqa: F401 + +elif MACOS: + from . import _psosx as _psplatform + +elif BSD: + from . import _psbsd as _psplatform + +elif SUNOS: + from . import _pssunos as _psplatform + from ._pssunos import CONN_BOUND # noqa: F401 + from ._pssunos import CONN_IDLE # noqa: F401 + + # This is public writable API which is read from _pslinux.py and + # _pssunos.py via sys.modules. + PROCFS_PATH = "/proc" + +elif AIX: + from . import _psaix as _psplatform + + # This is public API and it will be retrieved from _pslinux.py + # via sys.modules. + PROCFS_PATH = "/proc" + +else: # pragma: no cover + msg = f"platform {sys.platform} is not supported" + raise NotImplementedError(msg) + + +# fmt: off +__all__ = [ + # exceptions + "Error", "NoSuchProcess", "ZombieProcess", "AccessDenied", + "TimeoutExpired", + + # constants + "version_info", "__version__", + + "STATUS_RUNNING", "STATUS_IDLE", "STATUS_SLEEPING", "STATUS_DISK_SLEEP", + "STATUS_STOPPED", "STATUS_TRACING_STOP", "STATUS_ZOMBIE", "STATUS_DEAD", + "STATUS_WAKING", "STATUS_LOCKED", "STATUS_WAITING", "STATUS_PARKED", + + "CONN_ESTABLISHED", "CONN_SYN_SENT", "CONN_SYN_RECV", "CONN_FIN_WAIT1", + "CONN_FIN_WAIT2", "CONN_TIME_WAIT", "CONN_CLOSE", "CONN_CLOSE_WAIT", + "CONN_LAST_ACK", "CONN_LISTEN", "CONN_CLOSING", "CONN_NONE", + # "CONN_IDLE", "CONN_BOUND", + + "AF_LINK", + + "NIC_DUPLEX_FULL", "NIC_DUPLEX_HALF", "NIC_DUPLEX_UNKNOWN", + + "POWER_TIME_UNKNOWN", "POWER_TIME_UNLIMITED", + + "BSD", "FREEBSD", "LINUX", "NETBSD", "OPENBSD", "MACOS", "OSX", "POSIX", + "SUNOS", "WINDOWS", "AIX", + + # "RLIM_INFINITY", "RLIMIT_AS", "RLIMIT_CORE", "RLIMIT_CPU", "RLIMIT_DATA", + # "RLIMIT_FSIZE", "RLIMIT_LOCKS", "RLIMIT_MEMLOCK", "RLIMIT_NOFILE", + # "RLIMIT_NPROC", "RLIMIT_RSS", "RLIMIT_STACK", "RLIMIT_MSGQUEUE", + # "RLIMIT_NICE", "RLIMIT_RTPRIO", "RLIMIT_RTTIME", "RLIMIT_SIGPENDING", + + # classes + "Process", "Popen", + + # functions + "pid_exists", "pids", "process_iter", "wait_procs", # proc + "virtual_memory", "swap_memory", # memory + "cpu_times", "cpu_percent", "cpu_times_percent", "cpu_count", # cpu + "cpu_stats", # "cpu_freq", "getloadavg" + "net_io_counters", "net_connections", "net_if_addrs", # network + "net_if_stats", + "disk_io_counters", "disk_partitions", "disk_usage", # disk + # "sensors_temperatures", "sensors_battery", "sensors_fans" # sensors + "users", "boot_time", # others +] +# fmt: on + + +__all__.extend(_psplatform.__extra__all__) + +# Linux, FreeBSD +if hasattr(_psplatform.Process, "rlimit"): + # Populate global namespace with RLIM* constants. + _globals = globals() + _name = None + for _name in dir(_psplatform.cext): + if _name.startswith('RLIM') and _name.isupper(): + _globals[_name] = getattr(_psplatform.cext, _name) + __all__.append(_name) + del _globals, _name + +AF_LINK = _psplatform.AF_LINK + +__author__ = "Giampaolo Rodola'" +__version__ = "7.2.2" +version_info = tuple(int(num) for num in __version__.split('.')) + +_timer = getattr(time, 'monotonic', time.time) +_TOTAL_PHYMEM = None +_LOWEST_PID = None +_SENTINEL = object() + +# Sanity check in case the user messed up with psutil installation +# or did something weird with sys.path. In this case we might end +# up importing a python module using a C extension module which +# was compiled for a different version of psutil. +# We want to prevent that by failing sooner rather than later. +# See: https://github.com/giampaolo/psutil/issues/564 +if int(__version__.replace('.', '')) != getattr( + _psplatform.cext, 'version', None +): + msg = f"version conflict: {_psplatform.cext.__file__!r} C extension " + msg += "module was built for another version of psutil" + if hasattr(_psplatform.cext, 'version'): + v = ".".join(list(str(_psplatform.cext.version))) + msg += f" ({v} instead of {__version__})" + else: + msg += f" (different than {__version__})" + what = getattr( + _psplatform.cext, + "__file__", + "the existing psutil install directory", + ) + msg += f"; you may try to 'pip uninstall psutil', manually remove {what}" + msg += " or clean the virtual env somehow, then reinstall" + raise ImportError(msg) + + +# ===================================================================== +# --- Utils +# ===================================================================== + + +if hasattr(_psplatform, 'ppid_map'): + # Faster version (Windows and Linux). + _ppid_map = _psplatform.ppid_map +else: # pragma: no cover + + def _ppid_map(): + """Return a {pid: ppid, ...} dict for all running processes in + one shot. Used to speed up Process.children(). + """ + ret = {} + for pid in pids(): + try: + ret[pid] = _psplatform.Process(pid).ppid() + except (NoSuchProcess, ZombieProcess): + pass + return ret + + +def _pprint_secs(secs): + """Format seconds in a human readable form.""" + now = time.time() + secs_ago = int(now - secs) + fmt = "%H:%M:%S" if secs_ago < 60 * 60 * 24 else "%Y-%m-%d %H:%M:%S" + return datetime.datetime.fromtimestamp(secs).strftime(fmt) + + +def _check_conn_kind(kind): + """Check net_connections()'s `kind` parameter.""" + kinds = tuple(_common.conn_tmap) + if kind not in kinds: + msg = f"invalid kind argument {kind!r}; valid ones are: {kinds}" + raise ValueError(msg) + + +# ===================================================================== +# --- Process class +# ===================================================================== + + +class Process: + """Represents an OS process with the given PID. + If PID is omitted current process PID (os.getpid()) is used. + Raise NoSuchProcess if PID does not exist. + + Note that most of the methods of this class do not make sure that + the PID of the process being queried has been reused. That means + that you may end up retrieving information for another process. + + The only exceptions for which process identity is pre-emptively + checked and guaranteed are: + + - parent() + - children() + - nice() (set) + - ionice() (set) + - rlimit() (set) + - cpu_affinity (set) + - suspend() + - resume() + - send_signal() + - terminate() + - kill() + + To prevent this problem for all other methods you can use + is_running() before querying the process. + """ + + def __init__(self, pid=None): + self._init(pid) + + def _init(self, pid, _ignore_nsp=False): + if pid is None: + pid = os.getpid() + else: + if pid < 0: + msg = f"pid must be a positive integer (got {pid})" + raise ValueError(msg) + try: + _psplatform.cext.check_pid_range(pid) + except OverflowError as err: + msg = "process PID out of range" + raise NoSuchProcess(pid, msg=msg) from err + + self._pid = pid + self._name = None + self._exe = None + self._create_time = None + self._gone = False + self._pid_reused = False + self._hash = None + self._lock = threading.RLock() + # used for caching on Windows only (on POSIX ppid may change) + self._ppid = None + # platform-specific modules define an _psplatform.Process + # implementation class + self._proc = _psplatform.Process(pid) + self._last_sys_cpu_times = None + self._last_proc_cpu_times = None + self._exitcode = _SENTINEL + self._ident = (self.pid, None) + try: + self._ident = self._get_ident() + except AccessDenied: + # This should happen on Windows only, since we use the fast + # create time method. AFAIK, on all other platforms we are + # able to get create time for all PIDs. + pass + except ZombieProcess: + # Zombies can still be queried by this class (although + # not always) and pids() return them so just go on. + pass + except NoSuchProcess: + if not _ignore_nsp: + msg = "process PID not found" + raise NoSuchProcess(pid, msg=msg) from None + self._gone = True + + def _get_ident(self): + """Return a (pid, uid) tuple which is supposed to identify a + Process instance univocally over time. The PID alone is not + enough, as it can be assigned to a new process after this one + terminates, so we add process creation time to the mix. We need + this in order to prevent killing the wrong process later on. + This is also known as PID reuse or PID recycling problem. + + The reliability of this strategy mostly depends on + create_time() precision, which is 0.01 secs on Linux. The + assumption is that, after a process terminates, the kernel + won't reuse the same PID after such a short period of time + (0.01 secs). Technically this is inherently racy, but + practically it should be good enough. + + NOTE: unreliable on FreeBSD and OpenBSD as ctime is subject to + system clock updates. + """ + + if WINDOWS: + # Use create_time() fast method in order to speedup + # `process_iter()`. This means we'll get AccessDenied for + # most ADMIN processes, but that's fine since it means + # we'll also get AccessDenied on kill(). + # https://github.com/giampaolo/psutil/issues/2366#issuecomment-2381646555 + self._create_time = self._proc.create_time(fast_only=True) + return (self.pid, self._create_time) + elif LINUX or NETBSD or OSX: + # Use 'monotonic' process starttime since boot to form unique + # process identity, since it is stable over changes to system + # time. + return (self.pid, self._proc.create_time(monotonic=True)) + else: + return (self.pid, self.create_time()) + + def __str__(self): + info = collections.OrderedDict() + info["pid"] = self.pid + if self._name: + info['name'] = self._name + with self.oneshot(): + if self._pid_reused: + info["status"] = "terminated + PID reused" + else: + try: + info["name"] = self.name() + info["status"] = self.status() + except ZombieProcess: + info["status"] = "zombie" + except NoSuchProcess: + info["status"] = "terminated" + except AccessDenied: + pass + + if self._exitcode not in {_SENTINEL, None}: + info["exitcode"] = self._exitcode + if self._create_time is not None: + info['started'] = _pprint_secs(self._create_time) + + return "{}.{}({})".format( + self.__class__.__module__, + self.__class__.__name__, + ", ".join([f"{k}={v!r}" for k, v in info.items()]), + ) + + __repr__ = __str__ + + def __eq__(self, other): + # Test for equality with another Process object based + # on PID and creation time. + if not isinstance(other, Process): + return NotImplemented + if OPENBSD or NETBSD or SUNOS: # pragma: no cover + # Zombie processes on Open/NetBSD/illumos/Solaris have a + # creation time of 0.0. This covers the case when a process + # started normally (so it has a ctime), then it turned into a + # zombie. It's important to do this because is_running() + # depends on __eq__. + pid1, ident1 = self._ident + pid2, ident2 = other._ident + if pid1 == pid2: + if ident1 and not ident2: + try: + return self.status() == STATUS_ZOMBIE + except Error: + pass + return self._ident == other._ident + + def __ne__(self, other): + return not self == other + + def __hash__(self): + if self._hash is None: + self._hash = hash(self._ident) + return self._hash + + def _raise_if_pid_reused(self): + """Raises NoSuchProcess in case process PID has been reused.""" + if self._pid_reused or (not self.is_running() and self._pid_reused): + # We may directly raise NSP in here already if PID is just + # not running, but I prefer NSP to be raised naturally by + # the actual Process API call. This way unit tests will tell + # us if the API is broken (aka don't raise NSP when it + # should). We also remain consistent with all other "get" + # APIs which don't use _raise_if_pid_reused(). + msg = "process no longer exists and its PID has been reused" + raise NoSuchProcess(self.pid, self._name, msg=msg) + + @property + def pid(self): + """The process PID.""" + return self._pid + + # --- utility methods + + @contextlib.contextmanager + def oneshot(self): + """Utility context manager which considerably speeds up the + retrieval of multiple process information at the same time. + + Internally different process info (e.g. name, ppid, uids, + gids, ...) may be fetched by using the same routine, but + only one information is returned and the others are discarded. + When using this context manager the internal routine is + executed once (in the example below on name()) and the + other info are cached. + + The cache is cleared when exiting the context manager block. + The advice is to use this every time you retrieve more than + one information about the process. If you're lucky, you'll + get a hell of a speedup. + + >>> import psutil + >>> p = psutil.Process() + >>> with p.oneshot(): + ... p.name() # collect multiple info + ... p.cpu_times() # return cached value + ... p.cpu_percent() # return cached value + ... p.create_time() # return cached value + ... + >>> + """ + with self._lock: + if hasattr(self, "_cache"): + # NOOP: this covers the use case where the user enters the + # context twice: + # + # >>> with p.oneshot(): + # ... with p.oneshot(): + # ... + # + # Also, since as_dict() internally uses oneshot() + # I expect that the code below will be a pretty common + # "mistake" that the user will make, so let's guard + # against that: + # + # >>> with p.oneshot(): + # ... p.as_dict() + # ... + yield + else: + try: + # cached in case cpu_percent() is used + self.cpu_times.cache_activate(self) + # cached in case memory_percent() is used + self.memory_info.cache_activate(self) + # cached in case parent() is used + self.ppid.cache_activate(self) + # cached in case username() is used + if POSIX: + self.uids.cache_activate(self) + # specific implementation cache + self._proc.oneshot_enter() + yield + finally: + self.cpu_times.cache_deactivate(self) + self.memory_info.cache_deactivate(self) + self.ppid.cache_deactivate(self) + if POSIX: + self.uids.cache_deactivate(self) + self._proc.oneshot_exit() + + def as_dict(self, attrs=None, ad_value=None): + """Utility method returning process information as a + hashable dictionary. + If *attrs* is specified it must be a list of strings + reflecting available Process class' attribute names + (e.g. ['cpu_times', 'name']) else all public (read + only) attributes are assumed. + *ad_value* is the value which gets assigned in case + AccessDenied or ZombieProcess exception is raised when + retrieving that particular process information. + """ + valid_names = _as_dict_attrnames + if attrs is not None: + if not isinstance(attrs, (list, tuple, set, frozenset)): + msg = f"invalid attrs type {type(attrs)}" + raise TypeError(msg) + attrs = set(attrs) + invalid_names = attrs - valid_names + if invalid_names: + msg = "invalid attr name{} {}".format( + "s" if len(invalid_names) > 1 else "", + ", ".join(map(repr, invalid_names)), + ) + raise ValueError(msg) + + retdict = {} + ls = attrs or valid_names + with self.oneshot(): + for name in ls: + try: + if name == 'pid': + ret = self.pid + else: + meth = getattr(self, name) + ret = meth() + except (AccessDenied, ZombieProcess): + ret = ad_value + except NotImplementedError: + # in case of not implemented functionality (may happen + # on old or exotic systems) we want to crash only if + # the user explicitly asked for that particular attr + if attrs: + raise + continue + retdict[name] = ret + return retdict + + def parent(self): + """Return the parent process as a Process object pre-emptively + checking whether PID has been reused. + If no parent is known return None. + """ + lowest_pid = _LOWEST_PID if _LOWEST_PID is not None else pids()[0] + if self.pid == lowest_pid: + return None + ppid = self.ppid() + if ppid is not None: + # Get a fresh (non-cached) ctime in case the system clock + # was updated. TODO: use a monotonic ctime on platforms + # where it's supported. + proc_ctime = Process(self.pid).create_time() + try: + parent = Process(ppid) + if parent.create_time() <= proc_ctime: + return parent + # ...else ppid has been reused by another process + except NoSuchProcess: + pass + + def parents(self): + """Return the parents of this process as a list of Process + instances. If no parents are known return an empty list. + """ + parents = [] + proc = self.parent() + while proc is not None: + parents.append(proc) + proc = proc.parent() + return parents + + def is_running(self): + """Return whether this process is running. + + It also checks if PID has been reused by another process, in + which case it will remove the process from `process_iter()` + internal cache and return False. + """ + if self._gone or self._pid_reused: + return False + try: + # Checking if PID is alive is not enough as the PID might + # have been reused by another process. Process identity / + # uniqueness over time is guaranteed by (PID + creation + # time) and that is verified in __eq__. + self._pid_reused = self != Process(self.pid) + if self._pid_reused: + _pids_reused.add(self.pid) + raise NoSuchProcess(self.pid) + return True + except ZombieProcess: + # We should never get here as it's already handled in + # Process.__init__; here just for extra safety. + return True + except NoSuchProcess: + self._gone = True + return False + + # --- actual API + + @memoize_when_activated + def ppid(self): + """The process parent PID. + On Windows the return value is cached after first call. + """ + # On POSIX we don't want to cache the ppid as it may unexpectedly + # change to 1 (init) in case this process turns into a zombie: + # https://github.com/giampaolo/psutil/issues/321 + # http://stackoverflow.com/questions/356722/ + + # XXX should we check creation time here rather than in + # Process.parent()? + self._raise_if_pid_reused() + if POSIX: + return self._proc.ppid() + else: # pragma: no cover + self._ppid = self._ppid or self._proc.ppid() + return self._ppid + + def name(self): + """The process name. The return value is cached after first call.""" + # Process name is only cached on Windows as on POSIX it may + # change, see: + # https://github.com/giampaolo/psutil/issues/692 + if WINDOWS and self._name is not None: + return self._name + name = self._proc.name() + if POSIX and len(name) >= 15: + # On UNIX the name gets truncated to the first 15 characters. + # If it matches the first part of the cmdline we return that + # one instead because it's usually more explicative. + # Examples are "gnome-keyring-d" vs. "gnome-keyring-daemon". + try: + cmdline = self.cmdline() + except (AccessDenied, ZombieProcess): + # Just pass and return the truncated name: it's better + # than nothing. Note: there are actual cases where a + # zombie process can return a name() but not a + # cmdline(), see: + # https://github.com/giampaolo/psutil/issues/2239 + pass + else: + if cmdline: + extended_name = os.path.basename(cmdline[0]) + if extended_name.startswith(name): + name = extended_name + self._name = name + self._proc._name = name + return name + + def exe(self): + """The process executable as an absolute path. + May also be an empty string. + The return value is cached after first call. + """ + + def guess_it(fallback): + # try to guess exe from cmdline[0] in absence of a native + # exe representation + cmdline = self.cmdline() + if cmdline and hasattr(os, 'access') and hasattr(os, 'X_OK'): + exe = cmdline[0] # the possible exe + # Attempt to guess only in case of an absolute path. + # It is not safe otherwise as the process might have + # changed cwd. + if ( + os.path.isabs(exe) + and os.path.isfile(exe) + and os.access(exe, os.X_OK) + ): + return exe + if isinstance(fallback, AccessDenied): + raise fallback + return fallback + + if self._exe is None: + try: + exe = self._proc.exe() + except AccessDenied as err: + return guess_it(fallback=err) + else: + if not exe: + # underlying implementation can legitimately return an + # empty string; if that's the case we don't want to + # raise AD while guessing from the cmdline + try: + exe = guess_it(fallback=exe) + except AccessDenied: + pass + self._exe = exe + return self._exe + + def cmdline(self): + """The command line this process has been called with.""" + return self._proc.cmdline() + + def status(self): + """The process current status as a STATUS_* constant.""" + try: + return self._proc.status() + except ZombieProcess: + return STATUS_ZOMBIE + + def username(self): + """The name of the user that owns the process. + On UNIX this is calculated by using *real* process uid. + """ + if POSIX: + if pwd is None: + # might happen if python was installed from sources + msg = "requires pwd module shipped with standard python" + raise ImportError(msg) + real_uid = self.uids().real + try: + return pwd.getpwuid(real_uid).pw_name + except KeyError: + # the uid can't be resolved by the system + return str(real_uid) + else: + return self._proc.username() + + def create_time(self): + """The process creation time as a floating point number + expressed in seconds since the epoch (seconds since January 1, + 1970, at midnight UTC). The return value, which is cached after + first call, is based on the system clock, which means it may be + affected by changes such as manual adjustments or time + synchronization (e.g. NTP). + """ + if self._create_time is None: + self._create_time = self._proc.create_time() + return self._create_time + + def cwd(self): + """Process current working directory as an absolute path.""" + return self._proc.cwd() + + def nice(self, value=None): + """Get or set process niceness (priority).""" + if value is None: + return self._proc.nice_get() + else: + self._raise_if_pid_reused() + self._proc.nice_set(value) + + if POSIX: + + @memoize_when_activated + def uids(self): + """Return process UIDs as a (real, effective, saved) + namedtuple. + """ + return self._proc.uids() + + def gids(self): + """Return process GIDs as a (real, effective, saved) + namedtuple. + """ + return self._proc.gids() + + def terminal(self): + """The terminal associated with this process, if any, + else None. + """ + return self._proc.terminal() + + def num_fds(self): + """Return the number of file descriptors opened by this + process (POSIX only). + """ + return self._proc.num_fds() + + # Linux, BSD, AIX and Windows only + if hasattr(_psplatform.Process, "io_counters"): + + def io_counters(self): + """Return process I/O statistics as a + (read_count, write_count, read_bytes, write_bytes) + namedtuple. + Those are the number of read/write calls performed and the + amount of bytes read and written by the process. + """ + return self._proc.io_counters() + + # Linux and Windows + if hasattr(_psplatform.Process, "ionice_get"): + + def ionice(self, ioclass=None, value=None): + """Get or set process I/O niceness (priority). + + On Linux *ioclass* is one of the IOPRIO_CLASS_* constants. + *value* is a number which goes from 0 to 7. The higher the + value, the lower the I/O priority of the process. + + On Windows only *ioclass* is used and it can be set to 2 + (normal), 1 (low) or 0 (very low). + + Available on Linux and Windows > Vista only. + """ + if ioclass is None: + if value is not None: + msg = "'ioclass' argument must be specified" + raise ValueError(msg) + return self._proc.ionice_get() + else: + self._raise_if_pid_reused() + return self._proc.ionice_set(ioclass, value) + + # Linux / FreeBSD only + if hasattr(_psplatform.Process, "rlimit"): + + def rlimit(self, resource, limits=None): + """Get or set process resource limits as a (soft, hard) + tuple. + + *resource* is one of the RLIMIT_* constants. + *limits* is supposed to be a (soft, hard) tuple. + + See "man prlimit" for further info. + Available on Linux and FreeBSD only. + """ + if limits is not None: + self._raise_if_pid_reused() + return self._proc.rlimit(resource, limits) + + # Windows, Linux and FreeBSD only + if hasattr(_psplatform.Process, "cpu_affinity_get"): + + def cpu_affinity(self, cpus=None): + """Get or set process CPU affinity. + If specified, *cpus* must be a list of CPUs for which you + want to set the affinity (e.g. [0, 1]). + If an empty list is passed, all egible CPUs are assumed + (and set). + (Windows, Linux and BSD only). + """ + if cpus is None: + return sorted(set(self._proc.cpu_affinity_get())) + else: + self._raise_if_pid_reused() + if not cpus: + if hasattr(self._proc, "_get_eligible_cpus"): + cpus = self._proc._get_eligible_cpus() + else: + cpus = tuple(range(len(cpu_times(percpu=True)))) + self._proc.cpu_affinity_set(list(set(cpus))) + + # Linux, FreeBSD, SunOS + if hasattr(_psplatform.Process, "cpu_num"): + + def cpu_num(self): + """Return what CPU this process is currently running on. + The returned number should be <= psutil.cpu_count() + and <= len(psutil.cpu_percent(percpu=True)). + It may be used in conjunction with + psutil.cpu_percent(percpu=True) to observe the system + workload distributed across CPUs. + """ + return self._proc.cpu_num() + + # All platforms has it, but maybe not in the future. + if hasattr(_psplatform.Process, "environ"): + + def environ(self): + """The environment variables of the process as a dict. Note: this + might not reflect changes made after the process started. + """ + return self._proc.environ() + + if WINDOWS: + + def num_handles(self): + """Return the number of handles opened by this process + (Windows only). + """ + return self._proc.num_handles() + + def num_ctx_switches(self): + """Return the number of voluntary and involuntary context + switches performed by this process. + """ + return self._proc.num_ctx_switches() + + def num_threads(self): + """Return the number of threads used by this process.""" + return self._proc.num_threads() + + if hasattr(_psplatform.Process, "threads"): + + def threads(self): + """Return threads opened by process as a list of + (id, user_time, system_time) namedtuples representing + thread id and thread CPU times (user/system). + On OpenBSD this method requires root access. + """ + return self._proc.threads() + + def children(self, recursive=False): + """Return the children of this process as a list of Process + instances, pre-emptively checking whether PID has been reused. + If *recursive* is True return all the parent descendants. + + Example (A == this process): + + A ─┐ + │ + ├─ B (child) ─┐ + │ └─ X (grandchild) ─┐ + │ └─ Y (great grandchild) + ├─ C (child) + └─ D (child) + + >>> import psutil + >>> p = psutil.Process() + >>> p.children() + B, C, D + >>> p.children(recursive=True) + B, X, Y, C, D + + Note that in the example above if process X disappears + process Y won't be listed as the reference to process A + is lost. + """ + self._raise_if_pid_reused() + ppid_map = _ppid_map() + # Get a fresh (non-cached) ctime in case the system clock was + # updated. TODO: use a monotonic ctime on platforms where it's + # supported. + proc_ctime = Process(self.pid).create_time() + ret = [] + if not recursive: + for pid, ppid in ppid_map.items(): + if ppid == self.pid: + try: + child = Process(pid) + # if child happens to be older than its parent + # (self) it means child's PID has been reused + if proc_ctime <= child.create_time(): + ret.append(child) + except (NoSuchProcess, ZombieProcess): + pass + else: + # Construct a {pid: [child pids]} dict + reverse_ppid_map = collections.defaultdict(list) + for pid, ppid in ppid_map.items(): + reverse_ppid_map[ppid].append(pid) + # Recursively traverse that dict, starting from self.pid, + # such that we only call Process() on actual children + seen = set() + stack = [self.pid] + while stack: + pid = stack.pop() + if pid in seen: + # Since pids can be reused while the ppid_map is + # constructed, there may be rare instances where + # there's a cycle in the recorded process "tree". + continue + seen.add(pid) + for child_pid in reverse_ppid_map[pid]: + try: + child = Process(child_pid) + # if child happens to be older than its parent + # (self) it means child's PID has been reused + intime = proc_ctime <= child.create_time() + if intime: + ret.append(child) + stack.append(child_pid) + except (NoSuchProcess, ZombieProcess): + pass + return ret + + def cpu_percent(self, interval=None): + """Return a float representing the current process CPU + utilization as a percentage. + + When *interval* is 0.0 or None (default) compares process times + to system CPU times elapsed since last call, returning + immediately (non-blocking). That means that the first time + this is called it will return a meaningful 0.0 value. + + When *interval* is > 0.0 compares process times to system CPU + times elapsed before and after the interval (blocking). + + In this case is recommended for accuracy that this function + be called with at least 0.1 seconds between calls. + + A value > 100.0 can be returned in case of processes running + multiple threads on different CPU cores. + + The returned value is explicitly NOT split evenly between + all available logical CPUs. This means that a busy loop process + running on a system with 2 logical CPUs will be reported as + having 100% CPU utilization instead of 50%. + + Examples: + + >>> import psutil + >>> p = psutil.Process(os.getpid()) + >>> # blocking + >>> p.cpu_percent(interval=1) + 2.0 + >>> # non-blocking (percentage since last call) + >>> p.cpu_percent(interval=None) + 2.9 + >>> + """ + blocking = interval is not None and interval > 0.0 + if interval is not None and interval < 0: + msg = f"interval is not positive (got {interval!r})" + raise ValueError(msg) + num_cpus = cpu_count() or 1 + + def timer(): + return _timer() * num_cpus + + if blocking: + st1 = timer() + pt1 = self._proc.cpu_times() + time.sleep(interval) + st2 = timer() + pt2 = self._proc.cpu_times() + else: + st1 = self._last_sys_cpu_times + pt1 = self._last_proc_cpu_times + st2 = timer() + pt2 = self._proc.cpu_times() + if st1 is None or pt1 is None: + self._last_sys_cpu_times = st2 + self._last_proc_cpu_times = pt2 + return 0.0 + + delta_proc = (pt2.user - pt1.user) + (pt2.system - pt1.system) + delta_time = st2 - st1 + # reset values for next call in case of interval == None + self._last_sys_cpu_times = st2 + self._last_proc_cpu_times = pt2 + + try: + # This is the utilization split evenly between all CPUs. + # E.g. a busy loop process on a 2-CPU-cores system at this + # point is reported as 50% instead of 100%. + overall_cpus_percent = (delta_proc / delta_time) * 100 + except ZeroDivisionError: + # interval was too low + return 0.0 + else: + # Note 1: + # in order to emulate "top" we multiply the value for the num + # of CPU cores. This way the busy process will be reported as + # having 100% (or more) usage. + # + # Note 2: + # taskmgr.exe on Windows differs in that it will show 50% + # instead. + # + # Note 3: + # a percentage > 100 is legitimate as it can result from a + # process with multiple threads running on different CPU + # cores (top does the same), see: + # http://stackoverflow.com/questions/1032357 + # https://github.com/giampaolo/psutil/issues/474 + single_cpu_percent = overall_cpus_percent * num_cpus + return round(single_cpu_percent, 1) + + @memoize_when_activated + def cpu_times(self): + """Return a (user, system, children_user, children_system) + namedtuple representing the accumulated process time, in + seconds. + This is similar to os.times() but per-process. + On macOS and Windows children_user and children_system are + always set to 0. + """ + return self._proc.cpu_times() + + @memoize_when_activated + def memory_info(self): + """Return a namedtuple with variable fields depending on the + platform, representing memory information about the process. + + The "portable" fields available on all platforms are `rss` and `vms`. + + All numbers are expressed in bytes. + """ + return self._proc.memory_info() + + def memory_full_info(self): + """This method returns the same information as memory_info(), + plus, on some platform (Linux, macOS, Windows), also provides + additional metrics (USS, PSS and swap). + The additional metrics provide a better representation of actual + process memory usage. + + Namely USS is the memory which is unique to a process and which + would be freed if the process was terminated right now. + + It does so by passing through the whole process address. + As such it usually requires higher user privileges than + memory_info() and is considerably slower. + """ + return self._proc.memory_full_info() + + def memory_percent(self, memtype="rss"): + """Compare process memory to total physical system memory and + calculate process memory utilization as a percentage. + *memtype* argument is a string that dictates what type of + process memory you want to compare against (defaults to "rss"). + The list of available strings can be obtained like this: + + >>> psutil.Process().memory_info()._fields + ('rss', 'vms', 'shared', 'text', 'lib', 'data', 'dirty', 'uss', 'pss') + """ + valid_types = list(_ntp.pfullmem._fields) + if memtype not in valid_types: + msg = ( + f"invalid memtype {memtype!r}; valid types are" + f" {tuple(valid_types)!r}" + ) + raise ValueError(msg) + fun = ( + self.memory_info + if memtype in _ntp.pmem._fields + else self.memory_full_info + ) + metrics = fun() + value = getattr(metrics, memtype) + + # use cached value if available + total_phymem = _TOTAL_PHYMEM or virtual_memory().total + if not total_phymem > 0: + # we should never get here + msg = ( + "can't calculate process memory percent because total physical" + f" system memory is not positive ({total_phymem!r})" + ) + raise ValueError(msg) + return (value / float(total_phymem)) * 100 + + if hasattr(_psplatform.Process, "memory_maps"): + + def memory_maps(self, grouped=True): + """Return process' mapped memory regions as a list of namedtuples + whose fields are variable depending on the platform. + + If *grouped* is True the mapped regions with the same 'path' + are grouped together and the different memory fields are summed. + + If *grouped* is False every mapped region is shown as a single + entity and the namedtuple will also include the mapped region's + address space ('addr') and permission set ('perms'). + """ + it = self._proc.memory_maps() + if grouped: + d = {} + for tupl in it: + path = tupl[2] + nums = tupl[3:] + try: + d[path] = list(map(lambda x, y: x + y, d[path], nums)) + except KeyError: + d[path] = nums + return [_ntp.pmmap_grouped(path, *d[path]) for path in d] + else: + return [_ntp.pmmap_ext(*x) for x in it] + + def open_files(self): + """Return files opened by process as a list of + (path, fd) namedtuples including the absolute file name + and file descriptor number. + """ + return self._proc.open_files() + + def net_connections(self, kind='inet'): + """Return socket connections opened by process as a list of + (fd, family, type, laddr, raddr, status) namedtuples. + The *kind* parameter filters for connections that match the + following criteria: + + +------------+----------------------------------------------------+ + | Kind Value | Connections using | + +------------+----------------------------------------------------+ + | inet | IPv4 and IPv6 | + | inet4 | IPv4 | + | inet6 | IPv6 | + | tcp | TCP | + | tcp4 | TCP over IPv4 | + | tcp6 | TCP over IPv6 | + | udp | UDP | + | udp4 | UDP over IPv4 | + | udp6 | UDP over IPv6 | + | unix | UNIX socket (both UDP and TCP protocols) | + | all | the sum of all the possible families and protocols | + +------------+----------------------------------------------------+ + """ + _check_conn_kind(kind) + return self._proc.net_connections(kind) + + @_common.deprecated_method(replacement="net_connections") + def connections(self, kind="inet"): + return self.net_connections(kind=kind) + + # --- signals + + if POSIX: + + def _send_signal(self, sig): + assert not self.pid < 0, self.pid + self._raise_if_pid_reused() + + pid, ppid, name = self.pid, self._ppid, self._name + if pid == 0: + # see "man 2 kill" + msg = ( + "preventing sending signal to process with PID 0 as it " + "would affect every process in the process group of the " + "calling process (os.getpid()) instead of PID 0" + ) + raise ValueError(msg) + try: + os.kill(pid, sig) + except ProcessLookupError as err: + if OPENBSD and pid_exists(pid): + # We do this because os.kill() lies in case of + # zombie processes. + raise ZombieProcess(pid, name, ppid) from err + self._gone = True + raise NoSuchProcess(pid, name) from err + except PermissionError as err: + raise AccessDenied(pid, name) from err + + def send_signal(self, sig): + """Send a signal *sig* to process pre-emptively checking + whether PID has been reused (see signal module constants) . + On Windows only SIGTERM is valid and is treated as an alias + for kill(). + """ + if POSIX: + self._send_signal(sig) + else: # pragma: no cover + self._raise_if_pid_reused() + if sig != signal.SIGTERM and not self.is_running(): + msg = "process no longer exists" + raise NoSuchProcess(self.pid, self._name, msg=msg) + self._proc.send_signal(sig) + + def suspend(self): + """Suspend process execution with SIGSTOP pre-emptively checking + whether PID has been reused. + On Windows this has the effect of suspending all process threads. + """ + if POSIX: + self._send_signal(signal.SIGSTOP) + else: # pragma: no cover + self._raise_if_pid_reused() + self._proc.suspend() + + def resume(self): + """Resume process execution with SIGCONT pre-emptively checking + whether PID has been reused. + On Windows this has the effect of resuming all process threads. + """ + if POSIX: + self._send_signal(signal.SIGCONT) + else: # pragma: no cover + self._raise_if_pid_reused() + self._proc.resume() + + def terminate(self): + """Terminate the process with SIGTERM pre-emptively checking + whether PID has been reused. + On Windows this is an alias for kill(). + """ + if POSIX: + self._send_signal(signal.SIGTERM) + else: # pragma: no cover + self._raise_if_pid_reused() + self._proc.kill() + + def kill(self): + """Kill the current process with SIGKILL pre-emptively checking + whether PID has been reused. + """ + if POSIX: + self._send_signal(signal.SIGKILL) + else: # pragma: no cover + self._raise_if_pid_reused() + self._proc.kill() + + def wait(self, timeout=None): + """Wait for process to terminate, and if process is a children + of os.getpid(), also return its exit code, else None. + On Windows there's no such limitation (exit code is always + returned). + + If the process is already terminated, immediately return None + instead of raising NoSuchProcess. + + If *timeout* (in seconds) is specified and process is still + alive, raise TimeoutExpired. + + If *timeout=0* either return immediately or raise + TimeoutExpired (non-blocking). + + To wait for multiple Process objects use psutil.wait_procs(). + """ + if self.pid == 0: + msg = "can't wait for PID 0" + raise ValueError(msg) + if timeout is not None: + if not isinstance(timeout, (int, float)): + msg = f"timeout must be an int or float (got {type(timeout)})" + raise TypeError(msg) + if timeout < 0: + msg = f"timeout must be positive or zero (got {timeout})" + raise ValueError(msg) + + if self._exitcode is not _SENTINEL: + return self._exitcode + + try: + self._exitcode = self._proc.wait(timeout) + except TimeoutExpired as err: + exc = TimeoutExpired(timeout, pid=self.pid, name=self._name) + raise exc from err + + return self._exitcode + + +# The valid attr names which can be processed by Process.as_dict(). +# fmt: off +_as_dict_attrnames = { + x for x in dir(Process) if not x.startswith("_") and x not in + {'send_signal', 'suspend', 'resume', 'terminate', 'kill', 'wait', + 'is_running', 'as_dict', 'parent', 'parents', 'children', 'rlimit', + 'connections', 'oneshot'} +} +# fmt: on + + +# ===================================================================== +# --- Popen class +# ===================================================================== + + +class Popen(Process): + """Same as subprocess.Popen, but in addition it provides all + psutil.Process methods in a single class. + For the following methods which are common to both classes, psutil + implementation takes precedence: + + * send_signal() + * terminate() + * kill() + + This is done in order to avoid killing another process in case its + PID has been reused, fixing BPO-6973. + + >>> import psutil + >>> from subprocess import PIPE + >>> p = psutil.Popen(["python", "-c", "print 'hi'"], stdout=PIPE) + >>> p.name() + 'python' + >>> p.uids() + user(real=1000, effective=1000, saved=1000) + >>> p.username() + 'giampaolo' + >>> p.communicate() + ('hi', None) + >>> p.terminate() + >>> p.wait(timeout=2) + 0 + >>> + """ + + def __init__(self, *args, **kwargs): + # Explicitly avoid to raise NoSuchProcess in case the process + # spawned by subprocess.Popen terminates too quickly, see: + # https://github.com/giampaolo/psutil/issues/193 + self.__subproc = subprocess.Popen(*args, **kwargs) + self._init(self.__subproc.pid, _ignore_nsp=True) + + def __dir__(self): + return sorted(set(dir(Popen) + dir(subprocess.Popen))) + + def __enter__(self): + if hasattr(self.__subproc, '__enter__'): + self.__subproc.__enter__() + return self + + def __exit__(self, *args, **kwargs): + if hasattr(self.__subproc, '__exit__'): + return self.__subproc.__exit__(*args, **kwargs) + else: + if self.stdout: + self.stdout.close() + if self.stderr: + self.stderr.close() + try: + # Flushing a BufferedWriter may raise an error. + if self.stdin: + self.stdin.close() + finally: + # Wait for the process to terminate, to avoid zombies. + self.wait() + + def __getattribute__(self, name): + try: + return object.__getattribute__(self, name) + except AttributeError: + try: + return object.__getattribute__(self.__subproc, name) + except AttributeError: + msg = f"{self.__class__!r} has no attribute {name!r}" + raise AttributeError(msg) from None + + def wait(self, timeout=None): + if self.__subproc.returncode is not None: + return self.__subproc.returncode + ret = super().wait(timeout) + self.__subproc.returncode = ret + return ret + + +# ===================================================================== +# --- system processes related functions +# ===================================================================== + + +def pids(): + """Return a list of current running PIDs.""" + global _LOWEST_PID + ret = sorted(_psplatform.pids()) + _LOWEST_PID = ret[0] + return ret + + +def pid_exists(pid): + """Return True if given PID exists in the current process list. + This is faster than doing "pid in psutil.pids()" and + should be preferred. + """ + if pid < 0: + return False + elif pid == 0 and POSIX: + # On POSIX we use os.kill() to determine PID existence. + # According to "man 2 kill" PID 0 has a special meaning + # though: it refers to <> and that is not we want + # to do here. + return pid in pids() + else: + return _psplatform.pid_exists(pid) + + +_pmap = {} +_pids_reused = set() + + +def process_iter(attrs=None, ad_value=None): + """Return a generator yielding a Process instance for all + running processes. + + Every new Process instance is only created once and then cached + into an internal table which is updated every time this is used. + Cache can optionally be cleared via `process_iter.cache_clear()`. + + The sorting order in which processes are yielded is based on + their PIDs. + + *attrs* and *ad_value* have the same meaning as in + Process.as_dict(). If *attrs* is specified as_dict() is called + and the resulting dict is stored as a 'info' attribute attached + to returned Process instance. + If *attrs* is an empty list it will retrieve all process info + (slow). + """ + global _pmap + + def add(pid): + proc = Process(pid) + pmap[proc.pid] = proc + return proc + + def remove(pid): + pmap.pop(pid, None) + + pmap = _pmap.copy() + a = set(pids()) + b = set(pmap.keys()) + new_pids = a - b + gone_pids = b - a + for pid in gone_pids: + remove(pid) + while _pids_reused: + pid = _pids_reused.pop() + debug(f"refreshing Process instance for reused PID {pid}") + remove(pid) + try: + ls = sorted(list(pmap.items()) + list(dict.fromkeys(new_pids).items())) + for pid, proc in ls: + try: + if proc is None: # new process + proc = add(pid) + if attrs is not None: + proc.info = proc.as_dict(attrs=attrs, ad_value=ad_value) + yield proc + except NoSuchProcess: + remove(pid) + finally: + _pmap = pmap + + +process_iter.cache_clear = lambda: _pmap.clear() # noqa: PLW0108 +process_iter.cache_clear.__doc__ = "Clear process_iter() internal cache." + + +def wait_procs(procs, timeout=None, callback=None): + """Convenience function which waits for a list of processes to + terminate. + + Return a (gone, alive) tuple indicating which processes + are gone and which ones are still alive. + + The gone ones will have a new *returncode* attribute indicating + process exit status (may be None). + + *callback* is a function which gets called every time a process + terminates (a Process instance is passed as callback argument). + + Function will return as soon as all processes terminate or when + *timeout* occurs. + Differently from Process.wait() it will not raise TimeoutExpired if + *timeout* occurs. + + Typical use case is: + + - send SIGTERM to a list of processes + - give them some time to terminate + - send SIGKILL to those ones which are still alive + + Example: + + >>> def on_terminate(proc): + ... print("process {} terminated".format(proc)) + ... + >>> for p in procs: + ... p.terminate() + ... + >>> gone, alive = wait_procs(procs, timeout=3, callback=on_terminate) + >>> for p in alive: + ... p.kill() + """ + + def check_gone(proc, timeout): + try: + returncode = proc.wait(timeout=timeout) + except (TimeoutExpired, subprocess.TimeoutExpired): + pass + else: + if returncode is not None or not proc.is_running(): + # Set new Process instance attribute. + proc.returncode = returncode + gone.add(proc) + if callback is not None: + callback(proc) + + if timeout is not None and not timeout >= 0: + msg = f"timeout must be a positive integer, got {timeout}" + raise ValueError(msg) + if callback is not None and not callable(callback): + msg = f"callback {callback!r} is not a callable" + raise TypeError(msg) + + gone = set() + alive = set(procs) + if timeout is not None: + deadline = _timer() + timeout + + while alive: + if timeout is not None and timeout <= 0: + break + for proc in alive: + # Make sure that every complete iteration (all processes) + # will last max 1 sec. + # We do this because we don't want to wait too long on a + # single process: in case it terminates too late other + # processes may disappear in the meantime and their PID + # reused. + max_timeout = 1.0 / len(alive) + if timeout is not None: + timeout = min((deadline - _timer()), max_timeout) + if timeout <= 0: + break + check_gone(proc, timeout) + else: + check_gone(proc, max_timeout) + alive = alive - gone # noqa: PLR6104 + + if alive: + # Last attempt over processes survived so far. + # timeout == 0 won't make this function wait any further. + for proc in alive: + check_gone(proc, 0) + alive = alive - gone # noqa: PLR6104 + + return (list(gone), list(alive)) + + +# ===================================================================== +# --- CPU related functions +# ===================================================================== + + +def cpu_count(logical=True): + """Return the number of logical CPUs in the system (same as + os.cpu_count()). + + If *logical* is False return the number of physical cores only + (e.g. hyper thread CPUs are excluded). + + Return None if undetermined. + + The return value is cached after first call. + If desired cache can be cleared like this: + + >>> psutil.cpu_count.cache_clear() + """ + if logical: + ret = _psplatform.cpu_count_logical() + else: + ret = _psplatform.cpu_count_cores() + if ret is not None and ret < 1: + ret = None + return ret + + +def cpu_times(percpu=False): + """Return system-wide CPU times as a namedtuple. + Every CPU time represents the seconds the CPU has spent in the + given mode. The namedtuple's fields availability varies depending on the + platform: + + - user + - system + - idle + - nice (UNIX) + - iowait (Linux) + - irq (Linux, FreeBSD) + - softirq (Linux) + - steal (Linux >= 2.6.11) + - guest (Linux >= 2.6.24) + - guest_nice (Linux >= 3.2.0) + + When *percpu* is True return a list of namedtuples for each CPU. + First element of the list refers to first CPU, second element + to second CPU and so on. + The order of the list is consistent across calls. + """ + if not percpu: + return _psplatform.cpu_times() + else: + return _psplatform.per_cpu_times() + + +try: + _last_cpu_times = {threading.current_thread().ident: cpu_times()} +except Exception: # noqa: BLE001 + # Don't want to crash at import time. + _last_cpu_times = {} + +try: + _last_per_cpu_times = { + threading.current_thread().ident: cpu_times(percpu=True) + } +except Exception: # noqa: BLE001 + # Don't want to crash at import time. + _last_per_cpu_times = {} + + +def _cpu_tot_time(times): + """Given a cpu_time() ntuple calculates the total CPU time + (including idle time). + """ + tot = sum(times) + if LINUX: + # On Linux guest times are already accounted in "user" or + # "nice" times, so we subtract them from total. + # Htop does the same. References: + # https://github.com/giampaolo/psutil/pull/940 + # http://unix.stackexchange.com/questions/178045 + # https://github.com/torvalds/linux/blob/ + # 447976ef4fd09b1be88b316d1a81553f1aa7cd07/kernel/sched/ + # cputime.c#L158 + tot -= getattr(times, "guest", 0) # Linux 2.6.24+ + tot -= getattr(times, "guest_nice", 0) # Linux 3.2.0+ + return tot + + +def _cpu_busy_time(times): + """Given a cpu_time() ntuple calculates the busy CPU time. + We do so by subtracting all idle CPU times. + """ + busy = _cpu_tot_time(times) + busy -= times.idle + # Linux: "iowait" is time during which the CPU does not do anything + # (waits for IO to complete). On Linux IO wait is *not* accounted + # in "idle" time so we subtract it. Htop does the same. + # References: + # https://github.com/torvalds/linux/blob/ + # 447976ef4fd09b1be88b316d1a81553f1aa7cd07/kernel/sched/cputime.c#L244 + busy -= getattr(times, "iowait", 0) + return busy + + +def _cpu_times_deltas(t1, t2): + assert t1._fields == t2._fields, (t1, t2) + field_deltas = [] + for field in _ntp.scputimes._fields: + field_delta = getattr(t2, field) - getattr(t1, field) + # CPU times are always supposed to increase over time + # or at least remain the same and that's because time + # cannot go backwards. + # Surprisingly sometimes this might not be the case (at + # least on Windows and Linux), see: + # https://github.com/giampaolo/psutil/issues/392 + # https://github.com/giampaolo/psutil/issues/645 + # https://github.com/giampaolo/psutil/issues/1210 + # Trim negative deltas to zero to ignore decreasing fields. + # top does the same. Reference: + # https://gitlab.com/procps-ng/procps/blob/v3.3.12/top/top.c#L5063 + field_delta = max(0, field_delta) + field_deltas.append(field_delta) + return _ntp.scputimes(*field_deltas) + + +def cpu_percent(interval=None, percpu=False): + """Return a float representing the current system-wide CPU + utilization as a percentage. + + When *interval* is > 0.0 compares system CPU times elapsed before + and after the interval (blocking). + + When *interval* is 0.0 or None compares system CPU times elapsed + since last call or module import, returning immediately (non + blocking). That means the first time this is called it will + return a meaningless 0.0 value which you should ignore. + In this case is recommended for accuracy that this function be + called with at least 0.1 seconds between calls. + + When *percpu* is True returns a list of floats representing the + utilization as a percentage for each CPU. + First element of the list refers to first CPU, second element + to second CPU and so on. + The order of the list is consistent across calls. + + Examples: + + >>> # blocking, system-wide + >>> psutil.cpu_percent(interval=1) + 2.0 + >>> + >>> # blocking, per-cpu + >>> psutil.cpu_percent(interval=1, percpu=True) + [2.0, 1.0] + >>> + >>> # non-blocking (percentage since last call) + >>> psutil.cpu_percent(interval=None) + 2.9 + >>> + """ + tid = threading.current_thread().ident + blocking = interval is not None and interval > 0.0 + if interval is not None and interval < 0: + msg = f"interval is not positive (got {interval})" + raise ValueError(msg) + + def calculate(t1, t2): + times_delta = _cpu_times_deltas(t1, t2) + all_delta = _cpu_tot_time(times_delta) + busy_delta = _cpu_busy_time(times_delta) + + try: + busy_perc = (busy_delta / all_delta) * 100 + except ZeroDivisionError: + return 0.0 + else: + return round(busy_perc, 1) + + # system-wide usage + if not percpu: + if blocking: + t1 = cpu_times() + time.sleep(interval) + else: + t1 = _last_cpu_times.get(tid) or cpu_times() + _last_cpu_times[tid] = cpu_times() + return calculate(t1, _last_cpu_times[tid]) + # per-cpu usage + else: + ret = [] + if blocking: + tot1 = cpu_times(percpu=True) + time.sleep(interval) + else: + tot1 = _last_per_cpu_times.get(tid) or cpu_times(percpu=True) + _last_per_cpu_times[tid] = cpu_times(percpu=True) + for t1, t2 in zip(tot1, _last_per_cpu_times[tid]): + ret.append(calculate(t1, t2)) + return ret + + +# Use a separate dict for cpu_times_percent(), so it's independent from +# cpu_percent() and they can both be used within the same program. +_last_cpu_times_2 = _last_cpu_times.copy() +_last_per_cpu_times_2 = _last_per_cpu_times.copy() + + +def cpu_times_percent(interval=None, percpu=False): + """Same as cpu_percent() but provides utilization percentages + for each specific CPU time as is returned by cpu_times(). + For instance, on Linux we'll get: + + >>> cpu_times_percent() + cpupercent(user=4.8, nice=0.0, system=4.8, idle=90.5, iowait=0.0, + irq=0.0, softirq=0.0, steal=0.0, guest=0.0, guest_nice=0.0) + >>> + + *interval* and *percpu* arguments have the same meaning as in + cpu_percent(). + """ + tid = threading.current_thread().ident + blocking = interval is not None and interval > 0.0 + if interval is not None and interval < 0: + msg = f"interval is not positive (got {interval!r})" + raise ValueError(msg) + + def calculate(t1, t2): + nums = [] + times_delta = _cpu_times_deltas(t1, t2) + all_delta = _cpu_tot_time(times_delta) + # "scale" is the value to multiply each delta with to get percentages. + # We use "max" to avoid division by zero (if all_delta is 0, then all + # fields are 0 so percentages will be 0 too. all_delta cannot be a + # fraction because cpu times are integers) + scale = 100.0 / max(1, all_delta) + for field_delta in times_delta: + field_perc = field_delta * scale + field_perc = round(field_perc, 1) + # make sure we don't return negative values or values over 100% + field_perc = min(max(0.0, field_perc), 100.0) + nums.append(field_perc) + return _ntp.scputimes(*nums) + + # system-wide usage + if not percpu: + if blocking: + t1 = cpu_times() + time.sleep(interval) + else: + t1 = _last_cpu_times_2.get(tid) or cpu_times() + _last_cpu_times_2[tid] = cpu_times() + return calculate(t1, _last_cpu_times_2[tid]) + # per-cpu usage + else: + ret = [] + if blocking: + tot1 = cpu_times(percpu=True) + time.sleep(interval) + else: + tot1 = _last_per_cpu_times_2.get(tid) or cpu_times(percpu=True) + _last_per_cpu_times_2[tid] = cpu_times(percpu=True) + for t1, t2 in zip(tot1, _last_per_cpu_times_2[tid]): + ret.append(calculate(t1, t2)) + return ret + + +def cpu_stats(): + """Return CPU statistics.""" + return _psplatform.cpu_stats() + + +if hasattr(_psplatform, "cpu_freq"): + + def cpu_freq(percpu=False): + """Return CPU frequency as a namedtuple including current, + min and max frequency expressed in Mhz. + + If *percpu* is True and the system supports per-cpu frequency + retrieval (Linux only) a list of frequencies is returned for + each CPU. If not a list with one element is returned. + """ + ret = _psplatform.cpu_freq() + if percpu: + return ret + else: + num_cpus = float(len(ret)) + if num_cpus == 0: + return None + elif num_cpus == 1: + return ret[0] + else: + currs, mins, maxs = 0.0, 0.0, 0.0 + set_none = False + for cpu in ret: + currs += cpu.current + # On Linux if /proc/cpuinfo is used min/max are set + # to None. + if LINUX and cpu.min is None: + set_none = True + continue + mins += cpu.min + maxs += cpu.max + + current = currs / num_cpus + + if set_none: + min_ = max_ = None + else: + min_ = mins / num_cpus + max_ = maxs / num_cpus + + return _ntp.scpufreq(current, min_, max_) + + __all__.append("cpu_freq") + + +if hasattr(os, "getloadavg") or hasattr(_psplatform, "getloadavg"): + # Perform this hasattr check once on import time to either use the + # platform based code or proxy straight from the os module. + if hasattr(os, "getloadavg"): + getloadavg = os.getloadavg + else: + getloadavg = _psplatform.getloadavg + + __all__.append("getloadavg") + + +# ===================================================================== +# --- system memory related functions +# ===================================================================== + + +def virtual_memory(): + """Return statistics about system memory usage as a namedtuple + including the following fields, expressed in bytes: + + - total: + total physical memory available. + + - available: + the memory that can be given instantly to processes without the + system going into swap. + This is calculated by summing different memory values depending + on the platform and it is supposed to be used to monitor actual + memory usage in a cross platform fashion. + + - percent: + the percentage usage calculated as (total - available) / total * 100 + + - used: + memory used, calculated differently depending on the platform and + designed for informational purposes only: + macOS: active + wired + BSD: active + wired + cached + Linux: total - free + + - free: + memory not being used at all (zeroed) that is readily available; + note that this doesn't reflect the actual memory available + (use 'available' instead) + + Platform-specific fields: + + - active (UNIX): + memory currently in use or very recently used, and so it is in RAM. + + - inactive (UNIX): + memory that is marked as not used. + + - buffers (BSD, Linux): + cache for things like file system metadata. + + - cached (BSD, macOS): + cache for various things. + + - wired (macOS, BSD): + memory that is marked to always stay in RAM. It is never moved to disk. + + - shared (BSD): + memory that may be simultaneously accessed by multiple processes. + + The sum of 'used' and 'available' does not necessarily equal total. + On Windows 'available' and 'free' are the same. + """ + global _TOTAL_PHYMEM + ret = _psplatform.virtual_memory() + # cached for later use in Process.memory_percent() + _TOTAL_PHYMEM = ret.total + return ret + + +def swap_memory(): + """Return system swap memory statistics as a namedtuple including + the following fields: + + - total: total swap memory in bytes + - used: used swap memory in bytes + - free: free swap memory in bytes + - percent: the percentage usage + - sin: no. of bytes the system has swapped in from disk (cumulative) + - sout: no. of bytes the system has swapped out from disk (cumulative) + + 'sin' and 'sout' on Windows are meaningless and always set to 0. + """ + return _psplatform.swap_memory() + + +# ===================================================================== +# --- disks/partitions related functions +# ===================================================================== + + +def disk_usage(path): + """Return disk usage statistics about the given *path* as a + namedtuple including total, used and free space expressed in bytes + plus the percentage usage. + """ + return _psplatform.disk_usage(path) + + +def disk_partitions(all=False): + """Return mounted partitions as a list of + (device, mountpoint, fstype, opts) namedtuple. + 'opts' field is a raw string separated by commas indicating mount + options which may vary depending on the platform. + + If *all* parameter is False return physical devices only and ignore + all others. + """ + return _psplatform.disk_partitions(all) + + +def disk_io_counters(perdisk=False, nowrap=True): + """Return system disk I/O statistics as a namedtuple including + the following fields: + + - read_count: number of reads + - write_count: number of writes + - read_bytes: number of bytes read + - write_bytes: number of bytes written + - read_time: time spent reading from disk (in ms) + - write_time: time spent writing to disk (in ms) + + Platform specific: + + - busy_time: (Linux, FreeBSD) time spent doing actual I/Os (in ms) + - read_merged_count (Linux): number of merged reads + - write_merged_count (Linux): number of merged writes + + If *perdisk* is True return the same information for every + physical disk installed on the system as a dictionary + with partition names as the keys and the namedtuple + described above as the values. + + If *nowrap* is True it detects and adjust the numbers which overflow + and wrap (restart from 0) and add "old value" to "new value" so that + the returned numbers will always be increasing or remain the same, + but never decrease. + "disk_io_counters.cache_clear()" can be used to invalidate the + cache. + + On recent Windows versions 'diskperf -y' command may need to be + executed first otherwise this function won't find any disk. + """ + kwargs = dict(perdisk=perdisk) if LINUX else {} + rawdict = _psplatform.disk_io_counters(**kwargs) + if not rawdict: + return {} if perdisk else None + if nowrap: + rawdict = _wrap_numbers(rawdict, 'psutil.disk_io_counters') + if perdisk: + for disk, fields in rawdict.items(): + rawdict[disk] = _ntp.sdiskio(*fields) + return rawdict + else: + return _ntp.sdiskio(*(sum(x) for x in zip(*rawdict.values()))) + + +disk_io_counters.cache_clear = functools.partial( + _wrap_numbers.cache_clear, 'psutil.disk_io_counters' +) +disk_io_counters.cache_clear.__doc__ = "Clears nowrap argument cache" + + +# ===================================================================== +# --- network related functions +# ===================================================================== + + +def net_io_counters(pernic=False, nowrap=True): + """Return network I/O statistics as a namedtuple including + the following fields: + + - bytes_sent: number of bytes sent + - bytes_recv: number of bytes received + - packets_sent: number of packets sent + - packets_recv: number of packets received + - errin: total number of errors while receiving + - errout: total number of errors while sending + - dropin: total number of incoming packets which were dropped + - dropout: total number of outgoing packets which were dropped + (always 0 on macOS and BSD) + + If *pernic* is True return the same information for every + network interface installed on the system as a dictionary + with network interface names as the keys and the namedtuple + described above as the values. + + If *nowrap* is True it detects and adjust the numbers which overflow + and wrap (restart from 0) and add "old value" to "new value" so that + the returned numbers will always be increasing or remain the same, + but never decrease. + "net_io_counters.cache_clear()" can be used to invalidate the + cache. + """ + rawdict = _psplatform.net_io_counters() + if not rawdict: + return {} if pernic else None + if nowrap: + rawdict = _wrap_numbers(rawdict, 'psutil.net_io_counters') + if pernic: + for nic, fields in rawdict.items(): + rawdict[nic] = _ntp.snetio(*fields) + return rawdict + else: + return _ntp.snetio(*[sum(x) for x in zip(*rawdict.values())]) + + +net_io_counters.cache_clear = functools.partial( + _wrap_numbers.cache_clear, 'psutil.net_io_counters' +) +net_io_counters.cache_clear.__doc__ = "Clears nowrap argument cache" + + +def net_connections(kind='inet'): + """Return system-wide socket connections as a list of + (fd, family, type, laddr, raddr, status, pid) namedtuples. + In case of limited privileges 'fd' and 'pid' may be set to -1 + and None respectively. + The *kind* parameter filters for connections that fit the + following criteria: + + +------------+----------------------------------------------------+ + | Kind Value | Connections using | + +------------+----------------------------------------------------+ + | inet | IPv4 and IPv6 | + | inet4 | IPv4 | + | inet6 | IPv6 | + | tcp | TCP | + | tcp4 | TCP over IPv4 | + | tcp6 | TCP over IPv6 | + | udp | UDP | + | udp4 | UDP over IPv4 | + | udp6 | UDP over IPv6 | + | unix | UNIX socket (both UDP and TCP protocols) | + | all | the sum of all the possible families and protocols | + +------------+----------------------------------------------------+ + + On macOS this function requires root privileges. + """ + _check_conn_kind(kind) + return _psplatform.net_connections(kind) + + +def net_if_addrs(): + """Return the addresses associated to each NIC (network interface + card) installed on the system as a dictionary whose keys are the + NIC names and value is a list of namedtuples for each address + assigned to the NIC. Each namedtuple includes 5 fields: + + - family: can be either socket.AF_INET, socket.AF_INET6 or + psutil.AF_LINK, which refers to a MAC address. + - address: is the primary address and it is always set. + - netmask: and 'broadcast' and 'ptp' may be None. + - ptp: stands for "point to point" and references the + destination address on a point to point interface + (typically a VPN). + - broadcast: and *ptp* are mutually exclusive. + + Note: you can have more than one address of the same family + associated with each interface. + """ + rawlist = _psplatform.net_if_addrs() + rawlist.sort(key=lambda x: x[1]) # sort by family + ret = collections.defaultdict(list) + for name, fam, addr, mask, broadcast, ptp in rawlist: + try: + fam = socket.AddressFamily(fam) + except ValueError: + if WINDOWS and fam == -1: + fam = _psplatform.AF_LINK + elif ( + hasattr(_psplatform, "AF_LINK") and fam == _psplatform.AF_LINK + ): + # Linux defines AF_LINK as an alias for AF_PACKET. + # We re-set the family here so that repr(family) + # will show AF_LINK rather than AF_PACKET + fam = _psplatform.AF_LINK + + if fam == _psplatform.AF_LINK: + # The underlying C function may return an incomplete MAC + # address in which case we fill it with null bytes, see: + # https://github.com/giampaolo/psutil/issues/786 + separator = ":" if POSIX else "-" + while addr.count(separator) < 5: + addr += f"{separator}00" + + nt = _ntp.snicaddr(fam, addr, mask, broadcast, ptp) + + # On Windows broadcast is None, so we determine it via + # ipaddress module. + if WINDOWS and fam in {socket.AF_INET, socket.AF_INET6}: + try: + broadcast = _common.broadcast_addr(nt) + except Exception as err: # noqa: BLE001 + debug(err) + else: + if broadcast is not None: + nt._replace(broadcast=broadcast) + + ret[name].append(nt) + + return dict(ret) + + +def net_if_stats(): + """Return information about each NIC (network interface card) + installed on the system as a dictionary whose keys are the + NIC names and value is a namedtuple with the following fields: + + - isup: whether the interface is up (bool) + - duplex: can be either NIC_DUPLEX_FULL, NIC_DUPLEX_HALF or + NIC_DUPLEX_UNKNOWN + - speed: the NIC speed expressed in mega bits (MB); if it can't + be determined (e.g. 'localhost') it will be set to 0. + - mtu: the maximum transmission unit expressed in bytes. + """ + return _psplatform.net_if_stats() + + +# ===================================================================== +# --- sensors +# ===================================================================== + + +# Linux, macOS +if hasattr(_psplatform, "sensors_temperatures"): + + def sensors_temperatures(fahrenheit=False): + """Return hardware temperatures. Each entry is a namedtuple + representing a certain hardware sensor (it may be a CPU, an + hard disk or something else, depending on the OS and its + configuration). + All temperatures are expressed in celsius unless *fahrenheit* + is set to True. + """ + + def convert(n): + if n is not None: + return (float(n) * 9 / 5) + 32 if fahrenheit else n + + ret = collections.defaultdict(list) + rawdict = _psplatform.sensors_temperatures() + + for name, values in rawdict.items(): + while values: + label, current, high, critical = values.pop(0) + current = convert(current) + high = convert(high) + critical = convert(critical) + + if high and not critical: + critical = high + elif critical and not high: + high = critical + + ret[name].append(_ntp.shwtemp(label, current, high, critical)) + + return dict(ret) + + __all__.append("sensors_temperatures") + + +# Linux +if hasattr(_psplatform, "sensors_fans"): + + def sensors_fans(): + """Return fans speed. Each entry is a namedtuple + representing a certain hardware sensor. + All speed are expressed in RPM (rounds per minute). + """ + return _psplatform.sensors_fans() + + __all__.append("sensors_fans") + + +# Linux, Windows, FreeBSD, macOS +if hasattr(_psplatform, "sensors_battery"): + + def sensors_battery(): + """Return battery information. If no battery is installed + returns None. + + - percent: battery power left as a percentage. + - secsleft: a rough approximation of how many seconds are left + before the battery runs out of power. May be + POWER_TIME_UNLIMITED or POWER_TIME_UNLIMITED. + - power_plugged: True if the AC power cable is connected. + """ + return _psplatform.sensors_battery() + + __all__.append("sensors_battery") + + +# ===================================================================== +# --- other system related functions +# ===================================================================== + + +def boot_time(): + """Return the system boot time expressed in seconds since the epoch + (seconds since January 1, 1970, at midnight UTC). The returned + value is based on the system clock, which means it may be affected + by changes such as manual adjustments or time synchronization (e.g. + NTP). + """ + return _psplatform.boot_time() + + +def users(): + """Return users currently connected on the system as a list of + namedtuples including the following fields. + + - user: the name of the user + - terminal: the tty or pseudo-tty associated with the user, if any. + - host: the host name associated with the entry, if any. + - started: the creation time as a floating point number expressed in + seconds since the epoch. + """ + return _psplatform.users() + + +# ===================================================================== +# --- Windows services +# ===================================================================== + + +if WINDOWS: + + def win_service_iter(): + """Return a generator yielding a WindowsService instance for all + Windows services installed. + """ + return _psplatform.win_service_iter() + + def win_service_get(name): + """Get a Windows service by *name*. + Raise NoSuchProcess if no service with such name exists. + """ + return _psplatform.win_service_get(name) + + +# ===================================================================== +# --- malloc / heap +# ===================================================================== + + +# Linux + glibc, Windows, macOS, FreeBSD, NetBSD +if hasattr(_psplatform, "heap_info"): + + def heap_info(): + """Return low-level heap statistics from the C heap allocator + (glibc). + + - `heap_used`: the total number of bytes allocated via + malloc/free. These are typically allocations smaller than + MMAP_THRESHOLD. + + - `mmap_used`: the total number of bytes allocated via `mmap()` + or via large ``malloc()`` allocations. + + - `heap_count` (Windows only): number of private heaps created + via `HeapCreate()`. + """ + return _ntp.pheap(*_psplatform.heap_info()) + + def heap_trim(): + """Request that the underlying allocator free any unused memory + it's holding in the heap (typically small `malloc()` + allocations). + + In practice, modern allocators rarely comply, so this is not a + general-purpose memory-reduction tool and won't meaningfully + shrink RSS in real programs. Its primary value is in **leak + detection tools**. + + Calling `heap_trim()` before taking measurements helps reduce + allocator noise, giving you a cleaner baseline so that changes + in `heap_used` come from the code you're testing, not from + internal allocator caching or fragmentation. Its effectiveness + depends on allocator behavior and fragmentation patterns. + """ + _psplatform.heap_trim() + + __all__.append("heap_info") + __all__.append("heap_trim") + + +# ===================================================================== + + +def _set_debug(value): + """Enable or disable PSUTIL_DEBUG option, which prints debugging + messages to stderr. + """ + import psutil._common + + psutil._common.PSUTIL_DEBUG = bool(value) + _psplatform.cext.set_debug(bool(value)) + + +del memoize_when_activated diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/__init__.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5f5e70ced20acf9cf739521b2ff7882e327a7a88 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/__init__.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/_common.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/_common.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..80afdedaa85d50bddd41721575636cca5df53282 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/_common.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/_ntuples.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/_ntuples.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..efeabd1c067be5f08f01c9c1a0322f789e5442f1 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/_ntuples.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/_psaix.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/_psaix.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b38942947a60802a69d71bf9cf5936c0531bef74 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/_psaix.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/_psbsd.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/_psbsd.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3dc1bfae370af0f850969d3dad51ff5c24e5ff42 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/_psbsd.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/_pslinux.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/_pslinux.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0e0132441ae6b5a1b99345133a14495d7b348ba9 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/_pslinux.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/_psosx.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/_psosx.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..068688eb46db0fad08606b4563ad1f0505561bf6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/_psosx.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/_psposix.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/_psposix.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..50af742ca93fd3032f70ded926565fda436fac90 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/_psposix.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/_pssunos.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/_pssunos.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4645f99028f53dfebbe71724c429d372e396d9d4 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/_pssunos.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/_pswindows.cpython-314.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/_pswindows.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c5f3c59acd51c90ef21d233db3c308cec3730a54 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/__pycache__/_pswindows.cpython-314.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_common.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_common.py new file mode 100644 index 0000000000000000000000000000000000000000..33b6282253ac3321193fdd882aaf38185dee9d49 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_common.py @@ -0,0 +1,861 @@ +# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Common objects shared by __init__.py and _ps*.py modules. + +Note: this module is imported by setup.py, so it should not import +psutil or third-party modules. +""" + +import collections +import enum +import functools +import os +import socket +import stat +import sys +import threading +import warnings +from socket import AF_INET +from socket import SOCK_DGRAM +from socket import SOCK_STREAM + +try: + from socket import AF_INET6 +except ImportError: + AF_INET6 = None +try: + from socket import AF_UNIX +except ImportError: + AF_UNIX = None + + +PSUTIL_DEBUG = bool(os.getenv('PSUTIL_DEBUG')) +_DEFAULT = object() + +# fmt: off +__all__ = [ + # OS constants + 'FREEBSD', 'BSD', 'LINUX', 'NETBSD', 'OPENBSD', 'MACOS', 'OSX', 'POSIX', + 'SUNOS', 'WINDOWS', + # connection constants + 'CONN_CLOSE', 'CONN_CLOSE_WAIT', 'CONN_CLOSING', 'CONN_ESTABLISHED', + 'CONN_FIN_WAIT1', 'CONN_FIN_WAIT2', 'CONN_LAST_ACK', 'CONN_LISTEN', + 'CONN_NONE', 'CONN_SYN_RECV', 'CONN_SYN_SENT', 'CONN_TIME_WAIT', + # net constants + 'NIC_DUPLEX_FULL', 'NIC_DUPLEX_HALF', 'NIC_DUPLEX_UNKNOWN', # noqa: F822 + # process status constants + 'STATUS_DEAD', 'STATUS_DISK_SLEEP', 'STATUS_IDLE', 'STATUS_LOCKED', + 'STATUS_RUNNING', 'STATUS_SLEEPING', 'STATUS_STOPPED', 'STATUS_SUSPENDED', + 'STATUS_TRACING_STOP', 'STATUS_WAITING', 'STATUS_WAKE_KILL', + 'STATUS_WAKING', 'STATUS_ZOMBIE', 'STATUS_PARKED', + # other constants + 'ENCODING', 'ENCODING_ERRS', 'AF_INET6', + # utility functions + 'conn_tmap', 'deprecated_method', 'isfile_strict', 'memoize', + 'parse_environ_block', 'path_exists_strict', 'usage_percent', + 'supports_ipv6', 'sockfam_to_enum', 'socktype_to_enum', "wrap_numbers", + 'open_text', 'open_binary', 'cat', 'bcat', + 'bytes2human', 'conn_to_ntuple', 'debug', + # shell utils + 'hilite', 'term_supports_colors', 'print_color', +] +# fmt: on + + +# =================================================================== +# --- OS constants +# =================================================================== + + +POSIX = os.name == "posix" +WINDOWS = os.name == "nt" +LINUX = sys.platform.startswith("linux") +MACOS = sys.platform.startswith("darwin") +OSX = MACOS # deprecated alias +FREEBSD = sys.platform.startswith(("freebsd", "midnightbsd")) +OPENBSD = sys.platform.startswith("openbsd") +NETBSD = sys.platform.startswith("netbsd") +BSD = FREEBSD or OPENBSD or NETBSD +SUNOS = sys.platform.startswith(("sunos", "solaris")) +AIX = sys.platform.startswith("aix") + + +# =================================================================== +# --- API constants +# =================================================================== + + +# Process.status() +STATUS_RUNNING = "running" +STATUS_SLEEPING = "sleeping" +STATUS_DISK_SLEEP = "disk-sleep" +STATUS_STOPPED = "stopped" +STATUS_TRACING_STOP = "tracing-stop" +STATUS_ZOMBIE = "zombie" +STATUS_DEAD = "dead" +STATUS_WAKE_KILL = "wake-kill" +STATUS_WAKING = "waking" +STATUS_IDLE = "idle" # Linux, macOS, FreeBSD +STATUS_LOCKED = "locked" # FreeBSD +STATUS_WAITING = "waiting" # FreeBSD +STATUS_SUSPENDED = "suspended" # NetBSD +STATUS_PARKED = "parked" # Linux + +# Process.net_connections() and psutil.net_connections() +CONN_ESTABLISHED = "ESTABLISHED" +CONN_SYN_SENT = "SYN_SENT" +CONN_SYN_RECV = "SYN_RECV" +CONN_FIN_WAIT1 = "FIN_WAIT1" +CONN_FIN_WAIT2 = "FIN_WAIT2" +CONN_TIME_WAIT = "TIME_WAIT" +CONN_CLOSE = "CLOSE" +CONN_CLOSE_WAIT = "CLOSE_WAIT" +CONN_LAST_ACK = "LAST_ACK" +CONN_LISTEN = "LISTEN" +CONN_CLOSING = "CLOSING" +CONN_NONE = "NONE" + + +# net_if_stats() +class NicDuplex(enum.IntEnum): + NIC_DUPLEX_FULL = 2 + NIC_DUPLEX_HALF = 1 + NIC_DUPLEX_UNKNOWN = 0 + + +globals().update(NicDuplex.__members__) + + +# sensors_battery() +class BatteryTime(enum.IntEnum): + POWER_TIME_UNKNOWN = -1 + POWER_TIME_UNLIMITED = -2 + + +globals().update(BatteryTime.__members__) + +# --- others + +ENCODING = sys.getfilesystemencoding() +ENCODING_ERRS = sys.getfilesystemencodeerrors() + + +# =================================================================== +# --- Process.net_connections() 'kind' parameter mapping +# =================================================================== + + +conn_tmap = { + "all": ([AF_INET, AF_INET6, AF_UNIX], [SOCK_STREAM, SOCK_DGRAM]), + "tcp": ([AF_INET, AF_INET6], [SOCK_STREAM]), + "tcp4": ([AF_INET], [SOCK_STREAM]), + "udp": ([AF_INET, AF_INET6], [SOCK_DGRAM]), + "udp4": ([AF_INET], [SOCK_DGRAM]), + "inet": ([AF_INET, AF_INET6], [SOCK_STREAM, SOCK_DGRAM]), + "inet4": ([AF_INET], [SOCK_STREAM, SOCK_DGRAM]), + "inet6": ([AF_INET6], [SOCK_STREAM, SOCK_DGRAM]), +} + +if AF_INET6 is not None: + conn_tmap.update({ + "tcp6": ([AF_INET6], [SOCK_STREAM]), + "udp6": ([AF_INET6], [SOCK_DGRAM]), + }) + +if AF_UNIX is not None and not SUNOS: + conn_tmap.update({"unix": ([AF_UNIX], [SOCK_STREAM, SOCK_DGRAM])}) + + +# ===================================================================== +# --- Exceptions +# ===================================================================== + + +class Error(Exception): + """Base exception class. All other psutil exceptions inherit + from this one. + """ + + __module__ = 'psutil' + + def _infodict(self, attrs): + info = collections.OrderedDict() + for name in attrs: + value = getattr(self, name, None) + if value or (name == "pid" and value == 0): + info[name] = value + return info + + def __str__(self): + # invoked on `raise Error` + info = self._infodict(("pid", "ppid", "name")) + if info: + details = "({})".format( + ", ".join([f"{k}={v!r}" for k, v in info.items()]) + ) + else: + details = None + return " ".join([x for x in (getattr(self, "msg", ""), details) if x]) + + def __repr__(self): + # invoked on `repr(Error)` + info = self._infodict(("pid", "ppid", "name", "seconds", "msg")) + details = ", ".join([f"{k}={v!r}" for k, v in info.items()]) + return f"psutil.{self.__class__.__name__}({details})" + + +class NoSuchProcess(Error): + """Exception raised when a process with a certain PID doesn't + or no longer exists. + """ + + __module__ = 'psutil' + + def __init__(self, pid, name=None, msg=None): + Error.__init__(self) + self.pid = pid + self.name = name + self.msg = msg or "process no longer exists" + + def __reduce__(self): + return (self.__class__, (self.pid, self.name, self.msg)) + + +class ZombieProcess(NoSuchProcess): + """Exception raised when querying a zombie process. This is + raised on macOS, BSD and Solaris only, and not always: depending + on the query the OS may be able to succeed anyway. + On Linux all zombie processes are querable (hence this is never + raised). Windows doesn't have zombie processes. + """ + + __module__ = 'psutil' + + def __init__(self, pid, name=None, ppid=None, msg=None): + NoSuchProcess.__init__(self, pid, name, msg) + self.ppid = ppid + self.msg = msg or "PID still exists but it's a zombie" + + def __reduce__(self): + return (self.__class__, (self.pid, self.name, self.ppid, self.msg)) + + +class AccessDenied(Error): + """Exception raised when permission to perform an action is denied.""" + + __module__ = 'psutil' + + def __init__(self, pid=None, name=None, msg=None): + Error.__init__(self) + self.pid = pid + self.name = name + self.msg = msg or "" + + def __reduce__(self): + return (self.__class__, (self.pid, self.name, self.msg)) + + +class TimeoutExpired(Error): + """Raised on Process.wait(timeout) if timeout expires and process + is still alive. + """ + + __module__ = 'psutil' + + def __init__(self, seconds, pid=None, name=None): + Error.__init__(self) + self.seconds = seconds + self.pid = pid + self.name = name + self.msg = f"timeout after {seconds} seconds" + + def __reduce__(self): + return (self.__class__, (self.seconds, self.pid, self.name)) + + +# =================================================================== +# --- utils +# =================================================================== + + +def usage_percent(used, total, round_=None): + """Calculate percentage usage of 'used' against 'total'.""" + try: + ret = (float(used) / total) * 100 + except ZeroDivisionError: + return 0.0 + else: + if round_ is not None: + ret = round(ret, round_) + return ret + + +def memoize(fun): + """A simple memoize decorator for functions supporting (hashable) + positional arguments. + It also provides a cache_clear() function for clearing the cache: + + >>> @memoize + ... def foo() + ... return 1 + ... + >>> foo() + 1 + >>> foo.cache_clear() + >>> + + It supports: + - functions + - classes (acts as a @singleton) + - staticmethods + - classmethods + + It does NOT support: + - methods + """ + + @functools.wraps(fun) + def wrapper(*args, **kwargs): + key = (args, frozenset(sorted(kwargs.items()))) + try: + return cache[key] + except KeyError: + try: + ret = cache[key] = fun(*args, **kwargs) + except Exception as err: + raise err from None + return ret + + def cache_clear(): + """Clear cache.""" + cache.clear() + + cache = {} + wrapper.cache_clear = cache_clear + return wrapper + + +def memoize_when_activated(fun): + """A memoize decorator which is disabled by default. It can be + activated and deactivated on request. + For efficiency reasons it can be used only against class methods + accepting no arguments. + + >>> class Foo: + ... @memoize + ... def foo() + ... print(1) + ... + >>> f = Foo() + >>> # deactivated (default) + >>> foo() + 1 + >>> foo() + 1 + >>> + >>> # activated + >>> foo.cache_activate(self) + >>> foo() + 1 + >>> foo() + >>> foo() + >>> + """ + + @functools.wraps(fun) + def wrapper(self): + try: + # case 1: we previously entered oneshot() ctx + ret = self._cache[fun] + except AttributeError: + # case 2: we never entered oneshot() ctx + try: + return fun(self) + except Exception as err: + raise err from None + except KeyError: + # case 3: we entered oneshot() ctx but there's no cache + # for this entry yet + try: + ret = fun(self) + except Exception as err: + raise err from None + try: + self._cache[fun] = ret + except AttributeError: + # multi-threading race condition, see: + # https://github.com/giampaolo/psutil/issues/1948 + pass + return ret + + def cache_activate(proc): + """Activate cache. Expects a Process instance. Cache will be + stored as a "_cache" instance attribute. + """ + proc._cache = {} + + def cache_deactivate(proc): + """Deactivate and clear cache.""" + try: + del proc._cache + except AttributeError: + pass + + wrapper.cache_activate = cache_activate + wrapper.cache_deactivate = cache_deactivate + return wrapper + + +def isfile_strict(path): + """Same as os.path.isfile() but does not swallow EACCES / EPERM + exceptions, see: + http://mail.python.org/pipermail/python-dev/2012-June/120787.html. + """ + try: + st = os.stat(path) + except PermissionError: + raise + except OSError: + return False + else: + return stat.S_ISREG(st.st_mode) + + +def path_exists_strict(path): + """Same as os.path.exists() but does not swallow EACCES / EPERM + exceptions. See: + http://mail.python.org/pipermail/python-dev/2012-June/120787.html. + """ + try: + os.stat(path) + except PermissionError: + raise + except OSError: + return False + else: + return True + + +def supports_ipv6(): + """Return True if IPv6 is supported on this platform.""" + if not socket.has_ipv6 or AF_INET6 is None: + return False + try: + with socket.socket(AF_INET6, socket.SOCK_STREAM) as sock: + sock.bind(("::1", 0)) + return True + except OSError: + return False + + +def parse_environ_block(data): + """Parse a C environ block of environment variables into a dictionary.""" + # The block is usually raw data from the target process. It might contain + # trailing garbage and lines that do not look like assignments. + ret = {} + pos = 0 + + # localize global variable to speed up access. + WINDOWS_ = WINDOWS + while True: + next_pos = data.find("\0", pos) + # nul byte at the beginning or double nul byte means finish + if next_pos <= pos: + break + # there might not be an equals sign + equal_pos = data.find("=", pos, next_pos) + if equal_pos > pos: + key = data[pos:equal_pos] + value = data[equal_pos + 1 : next_pos] + # Windows expects environment variables to be uppercase only + if WINDOWS_: + key = key.upper() + ret[key] = value + pos = next_pos + 1 + + return ret + + +def sockfam_to_enum(num): + """Convert a numeric socket family value to an IntEnum member. + If it's not a known member, return the numeric value itself. + """ + try: + return socket.AddressFamily(num) + except ValueError: + return num + + +def socktype_to_enum(num): + """Convert a numeric socket type value to an IntEnum member. + If it's not a known member, return the numeric value itself. + """ + try: + return socket.SocketKind(num) + except ValueError: + return num + + +def conn_to_ntuple(fd, fam, type_, laddr, raddr, status, status_map, pid=None): + """Convert a raw connection tuple to a proper ntuple.""" + from . import _ntuples as ntp + + if fam in {socket.AF_INET, AF_INET6}: + if laddr: + laddr = ntp.addr(*laddr) + if raddr: + raddr = ntp.addr(*raddr) + if type_ == socket.SOCK_STREAM and fam in {AF_INET, AF_INET6}: + status = status_map.get(status, CONN_NONE) + else: + status = CONN_NONE # ignore whatever C returned to us + fam = sockfam_to_enum(fam) + type_ = socktype_to_enum(type_) + if pid is None: + return ntp.pconn(fd, fam, type_, laddr, raddr, status) + else: + return ntp.sconn(fd, fam, type_, laddr, raddr, status, pid) + + +def broadcast_addr(addr): + """Given the address ntuple returned by ``net_if_addrs()`` + calculates the broadcast address. + """ + import ipaddress + + if not addr.address or not addr.netmask: + return None + if addr.family == socket.AF_INET: + return str( + ipaddress.IPv4Network( + f"{addr.address}/{addr.netmask}", strict=False + ).broadcast_address + ) + if addr.family == socket.AF_INET6: + return str( + ipaddress.IPv6Network( + f"{addr.address}/{addr.netmask}", strict=False + ).broadcast_address + ) + + +def deprecated_method(replacement): + """A decorator which can be used to mark a method as deprecated + 'replcement' is the method name which will be called instead. + """ + + def outer(fun): + msg = ( + f"{fun.__name__}() is deprecated and will be removed; use" + f" {replacement}() instead" + ) + if fun.__doc__ is None: + fun.__doc__ = msg + + @functools.wraps(fun) + def inner(self, *args, **kwargs): + warnings.warn(msg, category=DeprecationWarning, stacklevel=2) + return getattr(self, replacement)(*args, **kwargs) + + return inner + + return outer + + +class _WrapNumbers: + """Watches numbers so that they don't overflow and wrap + (reset to zero). + """ + + def __init__(self): + self.lock = threading.Lock() + self.cache = {} + self.reminders = {} + self.reminder_keys = {} + + def _add_dict(self, input_dict, name): + assert name not in self.cache + assert name not in self.reminders + assert name not in self.reminder_keys + self.cache[name] = input_dict + self.reminders[name] = collections.defaultdict(int) + self.reminder_keys[name] = collections.defaultdict(set) + + def _remove_dead_reminders(self, input_dict, name): + """In case the number of keys changed between calls (e.g. a + disk disappears) this removes the entry from self.reminders. + """ + old_dict = self.cache[name] + gone_keys = set(old_dict.keys()) - set(input_dict.keys()) + for gone_key in gone_keys: + for remkey in self.reminder_keys[name][gone_key]: + del self.reminders[name][remkey] + del self.reminder_keys[name][gone_key] + + def run(self, input_dict, name): + """Cache dict and sum numbers which overflow and wrap. + Return an updated copy of `input_dict`. + """ + if name not in self.cache: + # This was the first call. + self._add_dict(input_dict, name) + return input_dict + + self._remove_dead_reminders(input_dict, name) + + old_dict = self.cache[name] + new_dict = {} + for key in input_dict: + input_tuple = input_dict[key] + try: + old_tuple = old_dict[key] + except KeyError: + # The input dict has a new key (e.g. a new disk or NIC) + # which didn't exist in the previous call. + new_dict[key] = input_tuple + continue + + bits = [] + for i in range(len(input_tuple)): + input_value = input_tuple[i] + old_value = old_tuple[i] + remkey = (key, i) + if input_value < old_value: + # it wrapped! + self.reminders[name][remkey] += old_value + self.reminder_keys[name][key].add(remkey) + bits.append(input_value + self.reminders[name][remkey]) + + new_dict[key] = tuple(bits) + + self.cache[name] = input_dict + return new_dict + + def cache_clear(self, name=None): + """Clear the internal cache, optionally only for function 'name'.""" + with self.lock: + if name is None: + self.cache.clear() + self.reminders.clear() + self.reminder_keys.clear() + else: + self.cache.pop(name, None) + self.reminders.pop(name, None) + self.reminder_keys.pop(name, None) + + def cache_info(self): + """Return internal cache dicts as a tuple of 3 elements.""" + with self.lock: + return (self.cache, self.reminders, self.reminder_keys) + + +def wrap_numbers(input_dict, name): + """Given an `input_dict` and a function `name`, adjust the numbers + which "wrap" (restart from zero) across different calls by adding + "old value" to "new value" and return an updated dict. + """ + with _wn.lock: + return _wn.run(input_dict, name) + + +_wn = _WrapNumbers() +wrap_numbers.cache_clear = _wn.cache_clear +wrap_numbers.cache_info = _wn.cache_info + + +# The read buffer size for open() builtin. This (also) dictates how +# much data we read(2) when iterating over file lines as in: +# >>> with open(file) as f: +# ... for line in f: +# ... ... +# Default per-line buffer size for binary files is 1K. For text files +# is 8K. We use a bigger buffer (32K) in order to have more consistent +# results when reading /proc pseudo files on Linux, see: +# https://github.com/giampaolo/psutil/issues/2050 +# https://github.com/giampaolo/psutil/issues/708 +FILE_READ_BUFFER_SIZE = 32 * 1024 + + +def open_binary(fname): + return open(fname, "rb", buffering=FILE_READ_BUFFER_SIZE) + + +def open_text(fname): + """Open a file in text mode by using the proper FS encoding and + en/decoding error handlers. + """ + # See: + # https://github.com/giampaolo/psutil/issues/675 + # https://github.com/giampaolo/psutil/pull/733 + fobj = open( # noqa: SIM115 + fname, + buffering=FILE_READ_BUFFER_SIZE, + encoding=ENCODING, + errors=ENCODING_ERRS, + ) + try: + # Dictates per-line read(2) buffer size. Defaults is 8k. See: + # https://github.com/giampaolo/psutil/issues/2050#issuecomment-1013387546 + fobj._CHUNK_SIZE = FILE_READ_BUFFER_SIZE + except AttributeError: + pass + except Exception: + fobj.close() + raise + + return fobj + + +def cat(fname, fallback=_DEFAULT, _open=open_text): + """Read entire file content and return it as a string. File is + opened in text mode. If specified, `fallback` is the value + returned in case of error, either if the file does not exist or + it can't be read(). + """ + if fallback is _DEFAULT: + with _open(fname) as f: + return f.read() + else: + try: + with _open(fname) as f: + return f.read() + except OSError: + return fallback + + +def bcat(fname, fallback=_DEFAULT): + """Same as above but opens file in binary mode.""" + return cat(fname, fallback=fallback, _open=open_binary) + + +def bytes2human(n, format="%(value).1f%(symbol)s"): + """Used by various scripts. See: https://code.activestate.com/recipes/578019-bytes-to-human-human-to-bytes-converter/?in=user-4178764. + + >>> bytes2human(10000) + '9.8K' + >>> bytes2human(100001221) + '95.4M' + """ + symbols = ('B', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y') + prefix = {} + for i, s in enumerate(symbols[1:]): + prefix[s] = 1 << (i + 1) * 10 + for symbol in reversed(symbols[1:]): + if abs(n) >= prefix[symbol]: + value = float(n) / prefix[symbol] + return format % locals() + return format % dict(symbol=symbols[0], value=n) + + +def get_procfs_path(): + """Return updated psutil.PROCFS_PATH constant.""" + return sys.modules['psutil'].PROCFS_PATH + + +def decode(s): + return s.decode(encoding=ENCODING, errors=ENCODING_ERRS) + + +# ===================================================================== +# --- shell utils +# ===================================================================== + + +@memoize +def term_supports_colors(file=sys.stdout): # pragma: no cover + if not hasattr(file, "isatty") or not file.isatty(): + return False + try: + file.fileno() + except Exception: # noqa: BLE001 + return False + return True + + +def hilite(s, color=None, bold=False): # pragma: no cover + """Return an highlighted version of 'string'.""" + if not term_supports_colors(): + return s + attr = [] + colors = dict( + blue='34', + brown='33', + darkgrey='30', + green='32', + grey='37', + lightblue='36', + red='91', + violet='35', + yellow='93', + ) + colors[None] = '29' + try: + color = colors[color] + except KeyError: + msg = f"invalid color {color!r}; choose amongst {list(colors.keys())}" + raise ValueError(msg) from None + attr.append(color) + if bold: + attr.append('1') + return f"\x1b[{';'.join(attr)}m{s}\x1b[0m" + + +def print_color( + s, color=None, bold=False, file=sys.stdout +): # pragma: no cover + """Print a colorized version of string.""" + if not term_supports_colors(): + print(s, file=file) + elif POSIX: + print(hilite(s, color, bold), file=file) + else: + import ctypes + + DEFAULT_COLOR = 7 + GetStdHandle = ctypes.windll.Kernel32.GetStdHandle + SetConsoleTextAttribute = ( + ctypes.windll.Kernel32.SetConsoleTextAttribute + ) + + colors = dict(green=2, red=4, brown=6, yellow=6) + colors[None] = DEFAULT_COLOR + try: + color = colors[color] + except KeyError: + msg = ( + f"invalid color {color!r}; choose between" + f" {list(colors.keys())!r}" + ) + raise ValueError(msg) from None + if bold and color <= 7: + color += 8 + + handle_id = -12 if file is sys.stderr else -11 + GetStdHandle.restype = ctypes.c_ulong + handle = GetStdHandle(handle_id) + SetConsoleTextAttribute(handle, color) + try: + print(s, file=file) + finally: + SetConsoleTextAttribute(handle, DEFAULT_COLOR) + + +def debug(msg): + """If PSUTIL_DEBUG env var is set, print a debug message to stderr.""" + if PSUTIL_DEBUG: + import inspect + + fname, lineno, _, _lines, _index = inspect.getframeinfo( + inspect.currentframe().f_back + ) + if isinstance(msg, Exception): + if isinstance(msg, OSError): + # ...because str(exc) may contain info about the file name + msg = f"ignoring {msg}" + else: + msg = f"ignoring {msg!r}" + print( # noqa: T201 + f"psutil-debug [{fname}:{lineno}]> {msg}", file=sys.stderr + ) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_ntuples.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_ntuples.py new file mode 100644 index 0000000000000000000000000000000000000000..f0ab0393763f0969d2f4b4302fa638771c6c0bdb --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_ntuples.py @@ -0,0 +1,429 @@ +# Copyright (c) 2009, Giampaolo Rodola". All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +from collections import namedtuple as nt + +from ._common import AIX +from ._common import BSD +from ._common import FREEBSD +from ._common import LINUX +from ._common import MACOS +from ._common import SUNOS +from ._common import WINDOWS + +# =================================================================== +# --- system functions +# =================================================================== + +# psutil.swap_memory() +sswap = nt("sswap", ("total", "used", "free", "percent", "sin", "sout")) + +# psutil.disk_usage() +sdiskusage = nt("sdiskusage", ("total", "used", "free", "percent")) + +# psutil.disk_io_counters() +sdiskio = nt( + "sdiskio", + ( + "read_count", + "write_count", + "read_bytes", + "write_bytes", + "read_time", + "write_time", + ), +) + +# psutil.disk_partitions() +sdiskpart = nt("sdiskpart", ("device", "mountpoint", "fstype", "opts")) + +# psutil.net_io_counters() +snetio = nt( + "snetio", + ( + "bytes_sent", + "bytes_recv", + "packets_sent", + "packets_recv", + "errin", + "errout", + "dropin", + "dropout", + ), +) + +# psutil.users() +suser = nt("suser", ("name", "terminal", "host", "started", "pid")) + +# psutil.net_connections() +sconn = nt( + "sconn", ("fd", "family", "type", "laddr", "raddr", "status", "pid") +) + +# psutil.net_if_addrs() +snicaddr = nt("snicaddr", ("family", "address", "netmask", "broadcast", "ptp")) + +# psutil.net_if_stats() +snicstats = nt("snicstats", ("isup", "duplex", "speed", "mtu", "flags")) + +# psutil.cpu_stats() +scpustats = nt( + "scpustats", ("ctx_switches", "interrupts", "soft_interrupts", "syscalls") +) + +# psutil.cpu_freq() +scpufreq = nt("scpufreq", ("current", "min", "max")) + +# psutil.sensors_temperatures() +shwtemp = nt("shwtemp", ("label", "current", "high", "critical")) + +# psutil.sensors_battery() +sbattery = nt("sbattery", ("percent", "secsleft", "power_plugged")) + +# psutil.sensors_fans() +sfan = nt("sfan", ("label", "current")) + +# psutil.heap_info() (mallinfo2 Linux struct) +if LINUX or WINDOWS or MACOS or BSD: + pheap = nt( + "pheap", + [ + "heap_used", # uordblks, memory allocated via malloc() + "mmap_used", # hblkhd, memory allocated via mmap() (large blocks) + ], + ) + if WINDOWS: + pheap = nt("pheap", pheap._fields + ("heap_count",)) + +# =================================================================== +# --- Process class +# =================================================================== + +# psutil.Process.cpu_times() +pcputimes = nt( + "pcputimes", ("user", "system", "children_user", "children_system") +) + +# psutil.Process.open_files() +popenfile = nt("popenfile", ("path", "fd")) + +# psutil.Process.threads() +pthread = nt("pthread", ("id", "user_time", "system_time")) + +# psutil.Process.uids() +puids = nt("puids", ("real", "effective", "saved")) + +# psutil.Process.gids() +pgids = nt("pgids", ("real", "effective", "saved")) + +# psutil.Process.io_counters() +pio = nt("pio", ("read_count", "write_count", "read_bytes", "write_bytes")) + +# psutil.Process.ionice() +pionice = nt("pionice", ("ioclass", "value")) + +# psutil.Process.ctx_switches() +pctxsw = nt("pctxsw", ("voluntary", "involuntary")) + +# psutil.Process.net_connections() +pconn = nt("pconn", ("fd", "family", "type", "laddr", "raddr", "status")) + +# psutil.net_connections() and psutil.Process.net_connections() +addr = nt("addr", ("ip", "port")) + +# =================================================================== +# --- Linux +# =================================================================== + +if LINUX: + + # This gets set from _pslinux.py + scputimes = None + + # psutil.virtual_memory() + svmem = nt( + "svmem", + ( + "total", + "available", + "percent", + "used", + "free", + "active", + "inactive", + "buffers", + "cached", + "shared", + "slab", + ), + ) + + # psutil.disk_io_counters() + sdiskio = nt( + "sdiskio", + ( + "read_count", + "write_count", + "read_bytes", + "write_bytes", + "read_time", + "write_time", + "read_merged_count", + "write_merged_count", + "busy_time", + ), + ) + + # psutil.Process().open_files() + popenfile = nt("popenfile", ("path", "fd", "position", "mode", "flags")) + + # psutil.Process().memory_info() + pmem = nt("pmem", ("rss", "vms", "shared", "text", "lib", "data", "dirty")) + + # psutil.Process().memory_full_info() + pfullmem = nt("pfullmem", pmem._fields + ("uss", "pss", "swap")) + + # psutil.Process().memory_maps(grouped=True) + pmmap_grouped = nt( + "pmmap_grouped", + ( + "path", + "rss", + "size", + "pss", + "shared_clean", + "shared_dirty", + "private_clean", + "private_dirty", + "referenced", + "anonymous", + "swap", + ), + ) + + # psutil.Process().memory_maps(grouped=False) + pmmap_ext = nt( + "pmmap_ext", "addr perms " + " ".join(pmmap_grouped._fields) + ) + + # psutil.Process.io_counters() + pio = nt( + "pio", + ( + "read_count", + "write_count", + "read_bytes", + "write_bytes", + "read_chars", + "write_chars", + ), + ) + + # psutil.Process.cpu_times() + pcputimes = nt( + "pcputimes", + ("user", "system", "children_user", "children_system", "iowait"), + ) + +# =================================================================== +# --- Windows +# =================================================================== + +elif WINDOWS: + + # psutil.cpu_times() + scputimes = nt("scputimes", ("user", "system", "idle", "interrupt", "dpc")) + + # psutil.virtual_memory() + svmem = nt("svmem", ("total", "available", "percent", "used", "free")) + + # psutil.Process.memory_info() + pmem = nt( + "pmem", + ( + "rss", + "vms", + "num_page_faults", + "peak_wset", + "wset", + "peak_paged_pool", + "paged_pool", + "peak_nonpaged_pool", + "nonpaged_pool", + "pagefile", + "peak_pagefile", + "private", + ), + ) + + # psutil.Process.memory_full_info() + pfullmem = nt("pfullmem", pmem._fields + ("uss",)) + + # psutil.Process.memory_maps(grouped=True) + pmmap_grouped = nt("pmmap_grouped", ("path", "rss")) + + # psutil.Process.memory_maps(grouped=False) + pmmap_ext = nt( + "pmmap_ext", "addr perms " + " ".join(pmmap_grouped._fields) + ) + + # psutil.Process.io_counters() + pio = nt( + "pio", + ( + "read_count", + "write_count", + "read_bytes", + "write_bytes", + "other_count", + "other_bytes", + ), + ) + +# =================================================================== +# --- macOS +# =================================================================== + +elif MACOS: + + # psutil.cpu_times() + scputimes = nt("scputimes", ("user", "nice", "system", "idle")) + + # psutil.virtual_memory() + svmem = nt( + "svmem", + ( + "total", + "available", + "percent", + "used", + "free", + "active", + "inactive", + "wired", + ), + ) + + # psutil.Process.memory_info() + pmem = nt("pmem", ("rss", "vms", "pfaults", "pageins")) + + # psutil.Process.memory_full_info() + pfullmem = nt("pfullmem", pmem._fields + ("uss",)) + +# =================================================================== +# --- BSD +# =================================================================== + +elif BSD: + + # psutil.virtual_memory() + svmem = nt( + "svmem", + ( + "total", + "available", + "percent", + "used", + "free", + "active", + "inactive", + "buffers", + "cached", + "shared", + "wired", + ), + ) + + # psutil.cpu_times() + scputimes = nt("scputimes", ("user", "nice", "system", "idle", "irq")) + + # psutil.Process.memory_info() + pmem = nt("pmem", ("rss", "vms", "text", "data", "stack")) + + # psutil.Process.memory_full_info() + pfullmem = pmem + + # psutil.Process.cpu_times() + pcputimes = nt( + "pcputimes", ("user", "system", "children_user", "children_system") + ) + + # psutil.Process.memory_maps(grouped=True) + pmmap_grouped = nt( + "pmmap_grouped", "path rss, private, ref_count, shadow_count" + ) + + # psutil.Process.memory_maps(grouped=False) + pmmap_ext = nt( + "pmmap_ext", "addr, perms path rss, private, ref_count, shadow_count" + ) + + # psutil.disk_io_counters() + if FREEBSD: + sdiskio = nt( + "sdiskio", + ( + "read_count", + "write_count", + "read_bytes", + "write_bytes", + "read_time", + "write_time", + "busy_time", + ), + ) + else: + sdiskio = nt( + "sdiskio", + ("read_count", "write_count", "read_bytes", "write_bytes"), + ) + +# =================================================================== +# --- SunOS +# =================================================================== + +elif SUNOS: + + # psutil.cpu_times() + scputimes = nt("scputimes", ("user", "system", "idle", "iowait")) + + # psutil.cpu_times(percpu=True) + pcputimes = nt( + "pcputimes", ("user", "system", "children_user", "children_system") + ) + + # psutil.virtual_memory() + svmem = nt("svmem", ("total", "available", "percent", "used", "free")) + + # psutil.Process.memory_info() + pmem = nt("pmem", ("rss", "vms")) + + # psutil.Process.memory_full_info() + pfullmem = pmem + + # psutil.Process.memory_maps(grouped=True) + pmmap_grouped = nt("pmmap_grouped", ("path", "rss", "anonymous", "locked")) + + # psutil.Process.memory_maps(grouped=False) + pmmap_ext = nt( + "pmmap_ext", "addr perms " + " ".join(pmmap_grouped._fields) + ) + +# =================================================================== +# --- AIX +# =================================================================== + +elif AIX: + + # psutil.Process.memory_info() + pmem = nt("pmem", ("rss", "vms")) + + # psutil.Process.memory_full_info() + pfullmem = pmem + + # psutil.Process.cpu_times() + scputimes = nt("scputimes", ("user", "system", "idle", "iowait")) + + # psutil.virtual_memory() + svmem = nt("svmem", ("total", "available", "percent", "used", "free")) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_psaix.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_psaix.py new file mode 100644 index 0000000000000000000000000000000000000000..1f628ad93c1b1464b16d63daee79fe161204730e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_psaix.py @@ -0,0 +1,546 @@ +# Copyright (c) 2009, Giampaolo Rodola' +# Copyright (c) 2017, Arnon Yaari +# All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""AIX platform implementation.""" + +import functools +import glob +import os +import re +import subprocess +import sys + +from . import _common +from . import _ntuples as ntp +from . import _psposix +from . import _psutil_aix as cext +from ._common import NIC_DUPLEX_FULL +from ._common import NIC_DUPLEX_HALF +from ._common import NIC_DUPLEX_UNKNOWN +from ._common import AccessDenied +from ._common import NoSuchProcess +from ._common import ZombieProcess +from ._common import conn_to_ntuple +from ._common import get_procfs_path +from ._common import memoize_when_activated +from ._common import usage_percent + +__extra__all__ = ["PROCFS_PATH"] + + +# ===================================================================== +# --- globals +# ===================================================================== + + +HAS_THREADS = hasattr(cext, "proc_threads") +HAS_NET_IO_COUNTERS = hasattr(cext, "net_io_counters") +HAS_PROC_IO_COUNTERS = hasattr(cext, "proc_io_counters") + +PAGE_SIZE = cext.getpagesize() +AF_LINK = cext.AF_LINK + +PROC_STATUSES = { + cext.SIDL: _common.STATUS_IDLE, + cext.SZOMB: _common.STATUS_ZOMBIE, + cext.SACTIVE: _common.STATUS_RUNNING, + cext.SSWAP: _common.STATUS_RUNNING, # TODO what status is this? + cext.SSTOP: _common.STATUS_STOPPED, +} + +TCP_STATUSES = { + cext.TCPS_ESTABLISHED: _common.CONN_ESTABLISHED, + cext.TCPS_SYN_SENT: _common.CONN_SYN_SENT, + cext.TCPS_SYN_RCVD: _common.CONN_SYN_RECV, + cext.TCPS_FIN_WAIT_1: _common.CONN_FIN_WAIT1, + cext.TCPS_FIN_WAIT_2: _common.CONN_FIN_WAIT2, + cext.TCPS_TIME_WAIT: _common.CONN_TIME_WAIT, + cext.TCPS_CLOSED: _common.CONN_CLOSE, + cext.TCPS_CLOSE_WAIT: _common.CONN_CLOSE_WAIT, + cext.TCPS_LAST_ACK: _common.CONN_LAST_ACK, + cext.TCPS_LISTEN: _common.CONN_LISTEN, + cext.TCPS_CLOSING: _common.CONN_CLOSING, + cext.PSUTIL_CONN_NONE: _common.CONN_NONE, +} + +proc_info_map = dict( + ppid=0, + rss=1, + vms=2, + create_time=3, + nice=4, + num_threads=5, + status=6, + ttynr=7, +) + + +# ===================================================================== +# --- memory +# ===================================================================== + + +def virtual_memory(): + total, avail, free, _pinned, inuse = cext.virtual_mem() + percent = usage_percent((total - avail), total, round_=1) + return ntp.svmem(total, avail, percent, inuse, free) + + +def swap_memory(): + """Swap system memory as a (total, used, free, sin, sout) tuple.""" + total, free, sin, sout = cext.swap_mem() + used = total - free + percent = usage_percent(used, total, round_=1) + return ntp.sswap(total, used, free, percent, sin, sout) + + +# ===================================================================== +# --- CPU +# ===================================================================== + + +def cpu_times(): + """Return system-wide CPU times as a named tuple.""" + ret = cext.per_cpu_times() + return ntp.scputimes(*[sum(x) for x in zip(*ret)]) + + +def per_cpu_times(): + """Return system per-CPU times as a list of named tuples.""" + ret = cext.per_cpu_times() + return [ntp.scputimes(*x) for x in ret] + + +def cpu_count_logical(): + """Return the number of logical CPUs in the system.""" + try: + return os.sysconf("SC_NPROCESSORS_ONLN") + except ValueError: + # mimic os.cpu_count() behavior + return None + + +def cpu_count_cores(): + cmd = ["lsdev", "-Cc", "processor"] + p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout, stderr = p.communicate() + stdout, stderr = (x.decode(sys.stdout.encoding) for x in (stdout, stderr)) + if p.returncode != 0: + msg = f"{cmd!r} command error\n{stderr}" + raise RuntimeError(msg) + processors = stdout.strip().splitlines() + return len(processors) or None + + +def cpu_stats(): + """Return various CPU stats as a named tuple.""" + ctx_switches, interrupts, soft_interrupts, syscalls = cext.cpu_stats() + return ntp.scpustats(ctx_switches, interrupts, soft_interrupts, syscalls) + + +# ===================================================================== +# --- disks +# ===================================================================== + + +disk_io_counters = cext.disk_io_counters +disk_usage = _psposix.disk_usage + + +def disk_partitions(all=False): + """Return system disk partitions.""" + # TODO - the filtering logic should be better checked so that + # it tries to reflect 'df' as much as possible + retlist = [] + partitions = cext.disk_partitions() + for partition in partitions: + device, mountpoint, fstype, opts = partition + if device == 'none': + device = '' + if not all: + # Differently from, say, Linux, we don't have a list of + # common fs types so the best we can do, AFAIK, is to + # filter by filesystem having a total size > 0. + if not disk_usage(mountpoint).total: + continue + ntuple = ntp.sdiskpart(device, mountpoint, fstype, opts) + retlist.append(ntuple) + return retlist + + +# ===================================================================== +# --- network +# ===================================================================== + + +net_if_addrs = cext.net_if_addrs + +if HAS_NET_IO_COUNTERS: + net_io_counters = cext.net_io_counters + + +def net_connections(kind, _pid=-1): + """Return socket connections. If pid == -1 return system-wide + connections (as opposed to connections opened by one process only). + """ + families, types = _common.conn_tmap[kind] + rawlist = cext.net_connections(_pid) + ret = [] + for item in rawlist: + fd, fam, type_, laddr, raddr, status, pid = item + if fam not in families: + continue + if type_ not in types: + continue + nt = conn_to_ntuple( + fd, + fam, + type_, + laddr, + raddr, + status, + TCP_STATUSES, + pid=pid if _pid == -1 else None, + ) + ret.append(nt) + return ret + + +def net_if_stats(): + """Get NIC stats (isup, duplex, speed, mtu).""" + duplex_map = {"Full": NIC_DUPLEX_FULL, "Half": NIC_DUPLEX_HALF} + names = {x[0] for x in net_if_addrs()} + ret = {} + for name in names: + mtu = cext.net_if_mtu(name) + flags = cext.net_if_flags(name) + + # try to get speed and duplex + # TODO: rewrite this in C (entstat forks, so use truss -f to follow. + # looks like it is using an undocumented ioctl?) + duplex = "" + speed = 0 + p = subprocess.Popen( + ["/usr/bin/entstat", "-d", name], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) + stdout, stderr = p.communicate() + stdout, stderr = ( + x.decode(sys.stdout.encoding) for x in (stdout, stderr) + ) + if p.returncode == 0: + re_result = re.search( + r"Running: (\d+) Mbps.*?(\w+) Duplex", stdout + ) + if re_result is not None: + speed = int(re_result.group(1)) + duplex = re_result.group(2) + + output_flags = ','.join(flags) + isup = 'running' in flags + duplex = duplex_map.get(duplex, NIC_DUPLEX_UNKNOWN) + ret[name] = ntp.snicstats(isup, duplex, speed, mtu, output_flags) + return ret + + +# ===================================================================== +# --- other system functions +# ===================================================================== + + +def boot_time(): + """The system boot time expressed in seconds since the epoch.""" + return cext.boot_time() + + +def users(): + """Return currently connected users as a list of namedtuples.""" + retlist = [] + rawlist = cext.users() + localhost = (':0.0', ':0') + for item in rawlist: + user, tty, hostname, tstamp, user_process, pid = item + # note: the underlying C function includes entries about + # system boot, run level and others. We might want + # to use them in the future. + if not user_process: + continue + if hostname in localhost: + hostname = 'localhost' + nt = ntp.suser(user, tty, hostname, tstamp, pid) + retlist.append(nt) + return retlist + + +# ===================================================================== +# --- processes +# ===================================================================== + + +def pids(): + """Returns a list of PIDs currently running on the system.""" + return [int(x) for x in os.listdir(get_procfs_path()) if x.isdigit()] + + +def pid_exists(pid): + """Check for the existence of a unix pid.""" + return os.path.exists(os.path.join(get_procfs_path(), str(pid), "psinfo")) + + +def wrap_exceptions(fun): + """Call callable into a try/except clause and translate ENOENT, + EACCES and EPERM in NoSuchProcess or AccessDenied exceptions. + """ + + @functools.wraps(fun) + def wrapper(self, *args, **kwargs): + pid, ppid, name = self.pid, self._ppid, self._name + try: + return fun(self, *args, **kwargs) + except (FileNotFoundError, ProcessLookupError) as err: + # ENOENT (no such file or directory) gets raised on open(). + # ESRCH (no such process) can get raised on read() if + # process is gone in meantime. + if not pid_exists(pid): + raise NoSuchProcess(pid, name) from err + raise ZombieProcess(pid, name, ppid) from err + except PermissionError as err: + raise AccessDenied(pid, name) from err + + return wrapper + + +class Process: + """Wrapper class around underlying C implementation.""" + + __slots__ = ["_cache", "_name", "_ppid", "_procfs_path", "pid"] + + def __init__(self, pid): + self.pid = pid + self._name = None + self._ppid = None + self._procfs_path = get_procfs_path() + + def oneshot_enter(self): + self._proc_basic_info.cache_activate(self) + self._proc_cred.cache_activate(self) + + def oneshot_exit(self): + self._proc_basic_info.cache_deactivate(self) + self._proc_cred.cache_deactivate(self) + + @wrap_exceptions + @memoize_when_activated + def _proc_basic_info(self): + return cext.proc_basic_info(self.pid, self._procfs_path) + + @wrap_exceptions + @memoize_when_activated + def _proc_cred(self): + return cext.proc_cred(self.pid, self._procfs_path) + + @wrap_exceptions + def name(self): + if self.pid == 0: + return "swapper" + # note: max 16 characters + return cext.proc_name(self.pid, self._procfs_path).rstrip("\x00") + + @wrap_exceptions + def exe(self): + # there is no way to get executable path in AIX other than to guess, + # and guessing is more complex than what's in the wrapping class + cmdline = self.cmdline() + if not cmdline: + return '' + exe = cmdline[0] + if os.path.sep in exe: + # relative or absolute path + if not os.path.isabs(exe): + # if cwd has changed, we're out of luck - this may be wrong! + exe = os.path.abspath(os.path.join(self.cwd(), exe)) + if ( + os.path.isabs(exe) + and os.path.isfile(exe) + and os.access(exe, os.X_OK) + ): + return exe + # not found, move to search in PATH using basename only + exe = os.path.basename(exe) + # search for exe name PATH + for path in os.environ["PATH"].split(":"): + possible_exe = os.path.abspath(os.path.join(path, exe)) + if os.path.isfile(possible_exe) and os.access( + possible_exe, os.X_OK + ): + return possible_exe + return '' + + @wrap_exceptions + def cmdline(self): + return cext.proc_args(self.pid) + + @wrap_exceptions + def environ(self): + return cext.proc_environ(self.pid) + + @wrap_exceptions + def create_time(self): + return self._proc_basic_info()[proc_info_map['create_time']] + + @wrap_exceptions + def num_threads(self): + return self._proc_basic_info()[proc_info_map['num_threads']] + + if HAS_THREADS: + + @wrap_exceptions + def threads(self): + rawlist = cext.proc_threads(self.pid) + retlist = [] + for thread_id, utime, stime in rawlist: + ntuple = ntp.pthread(thread_id, utime, stime) + retlist.append(ntuple) + # The underlying C implementation retrieves all OS threads + # and filters them by PID. At this point we can't tell whether + # an empty list means there were no connections for process or + # process is no longer active so we force NSP in case the PID + # is no longer there. + if not retlist: + # will raise NSP if process is gone + os.stat(f"{self._procfs_path}/{self.pid}") + return retlist + + @wrap_exceptions + def net_connections(self, kind='inet'): + ret = net_connections(kind, _pid=self.pid) + # The underlying C implementation retrieves all OS connections + # and filters them by PID. At this point we can't tell whether + # an empty list means there were no connections for process or + # process is no longer active so we force NSP in case the PID + # is no longer there. + if not ret: + # will raise NSP if process is gone + os.stat(f"{self._procfs_path}/{self.pid}") + return ret + + @wrap_exceptions + def nice_get(self): + return cext.proc_priority_get(self.pid) + + @wrap_exceptions + def nice_set(self, value): + return cext.proc_priority_set(self.pid, value) + + @wrap_exceptions + def ppid(self): + self._ppid = self._proc_basic_info()[proc_info_map['ppid']] + return self._ppid + + @wrap_exceptions + def uids(self): + real, effective, saved, _, _, _ = self._proc_cred() + return ntp.puids(real, effective, saved) + + @wrap_exceptions + def gids(self): + _, _, _, real, effective, saved = self._proc_cred() + return ntp.puids(real, effective, saved) + + @wrap_exceptions + def cpu_times(self): + t = cext.proc_cpu_times(self.pid, self._procfs_path) + return ntp.pcputimes(*t) + + @wrap_exceptions + def terminal(self): + ttydev = self._proc_basic_info()[proc_info_map['ttynr']] + # convert from 64-bit dev_t to 32-bit dev_t and then map the device + ttydev = ((ttydev & 0x0000FFFF00000000) >> 16) | (ttydev & 0xFFFF) + # try to match rdev of /dev/pts/* files ttydev + for dev in glob.glob("/dev/**/*"): + if os.stat(dev).st_rdev == ttydev: + return dev + return None + + @wrap_exceptions + def cwd(self): + procfs_path = self._procfs_path + try: + result = os.readlink(f"{procfs_path}/{self.pid}/cwd") + return result.rstrip('/') + except FileNotFoundError: + os.stat(f"{procfs_path}/{self.pid}") # raise NSP or AD + return "" + + @wrap_exceptions + def memory_info(self): + ret = self._proc_basic_info() + rss = ret[proc_info_map['rss']] * 1024 + vms = ret[proc_info_map['vms']] * 1024 + return ntp.pmem(rss, vms) + + memory_full_info = memory_info + + @wrap_exceptions + def status(self): + code = self._proc_basic_info()[proc_info_map['status']] + # XXX is '?' legit? (we're not supposed to return it anyway) + return PROC_STATUSES.get(code, '?') + + def open_files(self): + # TODO rewrite without using procfiles (stat /proc/pid/fd/* and then + # find matching name of the inode) + p = subprocess.Popen( + ["/usr/bin/procfiles", "-n", str(self.pid)], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) + stdout, stderr = p.communicate() + stdout, stderr = ( + x.decode(sys.stdout.encoding) for x in (stdout, stderr) + ) + if "no such process" in stderr.lower(): + raise NoSuchProcess(self.pid, self._name) + procfiles = re.findall(r"(\d+): S_IFREG.*name:(.*)\n", stdout) + retlist = [] + for fd, path in procfiles: + path = path.strip() + if path.startswith("//"): + path = path[1:] + if path.lower() == "cannot be retrieved": + continue + retlist.append(ntp.popenfile(path, int(fd))) + return retlist + + @wrap_exceptions + def num_fds(self): + if self.pid == 0: # no /proc/0/fd + return 0 + return len(os.listdir(f"{self._procfs_path}/{self.pid}/fd")) + + @wrap_exceptions + def num_ctx_switches(self): + return ntp.pctxsw(*cext.proc_num_ctx_switches(self.pid)) + + @wrap_exceptions + def wait(self, timeout=None): + return _psposix.wait_pid(self.pid, timeout) + + if HAS_PROC_IO_COUNTERS: + + @wrap_exceptions + def io_counters(self): + try: + rc, wc, rb, wb = cext.proc_io_counters(self.pid) + except OSError as err: + # if process is terminated, proc_io_counters returns OSError + # instead of NSP + if not pid_exists(self.pid): + raise NoSuchProcess(self.pid, self._name) from err + raise + return ntp.pio(rc, wc, rb, wb) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_psbsd.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_psbsd.py new file mode 100644 index 0000000000000000000000000000000000000000..a75cd1af131973c0f78caa65a22c0a7e91645959 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_psbsd.py @@ -0,0 +1,904 @@ +# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""FreeBSD, OpenBSD and NetBSD platforms implementation.""" + +import contextlib +import errno +import functools +import os +from collections import defaultdict +from collections import namedtuple +from xml.etree import ElementTree # noqa: ICN001 + +from . import _common +from . import _ntuples as ntp +from . import _psposix +from . import _psutil_bsd as cext +from ._common import FREEBSD +from ._common import NETBSD +from ._common import OPENBSD +from ._common import AccessDenied +from ._common import NoSuchProcess +from ._common import ZombieProcess +from ._common import conn_tmap +from ._common import conn_to_ntuple +from ._common import debug +from ._common import memoize +from ._common import memoize_when_activated +from ._common import usage_percent + +__extra__all__ = [] + + +# ===================================================================== +# --- globals +# ===================================================================== + + +if FREEBSD: + PROC_STATUSES = { + cext.SIDL: _common.STATUS_IDLE, + cext.SRUN: _common.STATUS_RUNNING, + cext.SSLEEP: _common.STATUS_SLEEPING, + cext.SSTOP: _common.STATUS_STOPPED, + cext.SZOMB: _common.STATUS_ZOMBIE, + cext.SWAIT: _common.STATUS_WAITING, + cext.SLOCK: _common.STATUS_LOCKED, + } +elif OPENBSD: + PROC_STATUSES = { + cext.SIDL: _common.STATUS_IDLE, + cext.SSLEEP: _common.STATUS_SLEEPING, + cext.SSTOP: _common.STATUS_STOPPED, + # According to /usr/include/sys/proc.h SZOMB is unused. + # test_zombie_process() shows that SDEAD is the right + # equivalent. Also it appears there's no equivalent of + # psutil.STATUS_DEAD. SDEAD really means STATUS_ZOMBIE. + # cext.SZOMB: _common.STATUS_ZOMBIE, + cext.SDEAD: _common.STATUS_ZOMBIE, + cext.SZOMB: _common.STATUS_ZOMBIE, + # From http://www.eecs.harvard.edu/~margo/cs161/videos/proc.h.txt + # OpenBSD has SRUN and SONPROC: SRUN indicates that a process + # is runnable but *not* yet running, i.e. is on a run queue. + # SONPROC indicates that the process is actually executing on + # a CPU, i.e. it is no longer on a run queue. + # As such we'll map SRUN to STATUS_WAKING and SONPROC to + # STATUS_RUNNING + cext.SRUN: _common.STATUS_WAKING, + cext.SONPROC: _common.STATUS_RUNNING, + } +elif NETBSD: + PROC_STATUSES = { + cext.SIDL: _common.STATUS_IDLE, + cext.SSLEEP: _common.STATUS_SLEEPING, + cext.SSTOP: _common.STATUS_STOPPED, + cext.SZOMB: _common.STATUS_ZOMBIE, + cext.SRUN: _common.STATUS_WAKING, + cext.SONPROC: _common.STATUS_RUNNING, + } + +TCP_STATUSES = { + cext.TCPS_ESTABLISHED: _common.CONN_ESTABLISHED, + cext.TCPS_SYN_SENT: _common.CONN_SYN_SENT, + cext.TCPS_SYN_RECEIVED: _common.CONN_SYN_RECV, + cext.TCPS_FIN_WAIT_1: _common.CONN_FIN_WAIT1, + cext.TCPS_FIN_WAIT_2: _common.CONN_FIN_WAIT2, + cext.TCPS_TIME_WAIT: _common.CONN_TIME_WAIT, + cext.TCPS_CLOSED: _common.CONN_CLOSE, + cext.TCPS_CLOSE_WAIT: _common.CONN_CLOSE_WAIT, + cext.TCPS_LAST_ACK: _common.CONN_LAST_ACK, + cext.TCPS_LISTEN: _common.CONN_LISTEN, + cext.TCPS_CLOSING: _common.CONN_CLOSING, + cext.PSUTIL_CONN_NONE: _common.CONN_NONE, +} + +PAGESIZE = cext.getpagesize() +AF_LINK = cext.AF_LINK + +HAS_PROC_NUM_THREADS = hasattr(cext, "proc_num_threads") + +kinfo_proc_map = dict( + ppid=0, + status=1, + real_uid=2, + effective_uid=3, + saved_uid=4, + real_gid=5, + effective_gid=6, + saved_gid=7, + ttynr=8, + create_time=9, + ctx_switches_vol=10, + ctx_switches_unvol=11, + read_io_count=12, + write_io_count=13, + user_time=14, + sys_time=15, + ch_user_time=16, + ch_sys_time=17, + rss=18, + vms=19, + memtext=20, + memdata=21, + memstack=22, + cpunum=23, + name=24, +) + + +# ===================================================================== +# --- memory +# ===================================================================== + + +def virtual_memory(): + mem = cext.virtual_mem() + if NETBSD: + total, free, active, inactive, wired, cached = mem + # On NetBSD buffers and shared mem is determined via /proc. + # The C ext set them to 0. + with open('/proc/meminfo', 'rb') as f: + for line in f: + if line.startswith(b'Buffers:'): + buffers = int(line.split()[1]) * 1024 + elif line.startswith(b'MemShared:'): + shared = int(line.split()[1]) * 1024 + # Before avail was calculated as (inactive + cached + free), + # same as zabbix, but it turned out it could exceed total (see + # #2233), so zabbix seems to be wrong. Htop calculates it + # differently, and the used value seem more realistic, so let's + # match htop. + # https://github.com/htop-dev/htop/blob/e7f447b/netbsd/NetBSDProcessList.c#L162 + # https://github.com/zabbix/zabbix/blob/af5e0f8/src/libs/zbxsysinfo/netbsd/memory.c#L135 + used = active + wired + avail = total - used + else: + total, free, active, inactive, wired, cached, buffers, shared = mem + # matches freebsd-memory CLI: + # * https://people.freebsd.org/~rse/dist/freebsd-memory + # * https://www.cyberciti.biz/files/scripts/freebsd-memory.pl.txt + # matches zabbix: + # * https://github.com/zabbix/zabbix/blob/af5e0f8/src/libs/zbxsysinfo/freebsd/memory.c#L143 + avail = inactive + cached + free + used = active + wired + cached + + percent = usage_percent((total - avail), total, round_=1) + return ntp.svmem( + total, + avail, + percent, + used, + free, + active, + inactive, + buffers, + cached, + shared, + wired, + ) + + +def swap_memory(): + """System swap memory as (total, used, free, sin, sout) namedtuple.""" + total, used, free, sin, sout = cext.swap_mem() + percent = usage_percent(used, total, round_=1) + return ntp.sswap(total, used, free, percent, sin, sout) + + +# malloc / heap functions (FreeBSD / NetBSD) +if hasattr(cext, "heap_info"): + heap_info = cext.heap_info + heap_trim = cext.heap_trim + + +# ===================================================================== +# --- CPU +# ===================================================================== + + +def cpu_times(): + """Return system per-CPU times as a namedtuple.""" + user, nice, system, idle, irq = cext.cpu_times() + return ntp.scputimes(user, nice, system, idle, irq) + + +def per_cpu_times(): + """Return system CPU times as a namedtuple.""" + ret = [] + for cpu_t in cext.per_cpu_times(): + user, nice, system, idle, irq = cpu_t + item = ntp.scputimes(user, nice, system, idle, irq) + ret.append(item) + return ret + + +def cpu_count_logical(): + """Return the number of logical CPUs in the system.""" + return cext.cpu_count_logical() + + +if OPENBSD or NETBSD: + + def cpu_count_cores(): + # OpenBSD and NetBSD do not implement this. + return 1 if cpu_count_logical() == 1 else None + +else: + + def cpu_count_cores(): + """Return the number of CPU cores in the system.""" + # From the C module we'll get an XML string similar to this: + # http://manpages.ubuntu.com/manpages/precise/man4/smp.4freebsd.html + # We may get None in case "sysctl kern.sched.topology_spec" + # is not supported on this BSD version, in which case we'll mimic + # os.cpu_count() and return None. + ret = None + s = cext.cpu_topology() + if s is not None: + # get rid of padding chars appended at the end of the string + index = s.rfind("") + if index != -1: + s = s[: index + 9] + root = ElementTree.fromstring(s) + try: + ret = len(root.findall('group/children/group/cpu')) or None + finally: + # needed otherwise it will memleak + root.clear() + if not ret: + # If logical CPUs == 1 it's obvious we' have only 1 core. + if cpu_count_logical() == 1: + return 1 + return ret + + +def cpu_stats(): + """Return various CPU stats as a named tuple.""" + if FREEBSD: + # Note: the C ext is returning some metrics we are not exposing: + # traps. + ctxsw, intrs, soft_intrs, syscalls, _traps = cext.cpu_stats() + elif NETBSD: + # XXX + # Note about intrs: the C extension returns 0. intrs + # can be determined via /proc/stat; it has the same value as + # soft_intrs thought so the kernel is faking it (?). + # + # Note about syscalls: the C extension always sets it to 0 (?). + # + # Note: the C ext is returning some metrics we are not exposing: + # traps, faults and forks. + ctxsw, intrs, soft_intrs, syscalls, _traps, _faults, _forks = ( + cext.cpu_stats() + ) + with open('/proc/stat', 'rb') as f: + for line in f: + if line.startswith(b'intr'): + intrs = int(line.split()[1]) + elif OPENBSD: + # Note: the C ext is returning some metrics we are not exposing: + # traps, faults and forks. + ctxsw, intrs, soft_intrs, syscalls, _traps, _faults, _forks = ( + cext.cpu_stats() + ) + return ntp.scpustats(ctxsw, intrs, soft_intrs, syscalls) + + +if FREEBSD: + + def cpu_freq(): + """Return frequency metrics for CPUs. As of Dec 2018 only + CPU 0 appears to be supported by FreeBSD and all other cores + match the frequency of CPU 0. + """ + ret = [] + num_cpus = cpu_count_logical() + for cpu in range(num_cpus): + try: + current, available_freq = cext.cpu_freq(cpu) + except NotImplementedError: + continue + if available_freq: + try: + min_freq = int(available_freq.split(" ")[-1].split("/")[0]) + except (IndexError, ValueError): + min_freq = None + try: + max_freq = int(available_freq.split(" ")[0].split("/")[0]) + except (IndexError, ValueError): + max_freq = None + ret.append(ntp.scpufreq(current, min_freq, max_freq)) + return ret + +elif OPENBSD: + + def cpu_freq(): + curr = float(cext.cpu_freq()) + return [ntp.scpufreq(curr, 0.0, 0.0)] + + +# ===================================================================== +# --- disks +# ===================================================================== + + +def disk_partitions(all=False): + """Return mounted disk partitions as a list of namedtuples. + 'all' argument is ignored, see: + https://github.com/giampaolo/psutil/issues/906. + """ + retlist = [] + partitions = cext.disk_partitions() + for partition in partitions: + device, mountpoint, fstype, opts = partition + ntuple = ntp.sdiskpart(device, mountpoint, fstype, opts) + retlist.append(ntuple) + return retlist + + +disk_usage = _psposix.disk_usage +disk_io_counters = cext.disk_io_counters + + +# ===================================================================== +# --- network +# ===================================================================== + + +net_io_counters = cext.net_io_counters +net_if_addrs = cext.net_if_addrs + + +def net_if_stats(): + """Get NIC stats (isup, duplex, speed, mtu).""" + names = net_io_counters().keys() + ret = {} + for name in names: + try: + mtu = cext.net_if_mtu(name) + flags = cext.net_if_flags(name) + duplex, speed = cext.net_if_duplex_speed(name) + except OSError as err: + # https://github.com/giampaolo/psutil/issues/1279 + if err.errno != errno.ENODEV: + raise + else: + if hasattr(_common, 'NicDuplex'): + duplex = _common.NicDuplex(duplex) + output_flags = ','.join(flags) + isup = 'running' in flags + ret[name] = ntp.snicstats(isup, duplex, speed, mtu, output_flags) + return ret + + +def net_connections(kind): + """System-wide network connections.""" + families, types = conn_tmap[kind] + ret = set() + if OPENBSD: + rawlist = cext.net_connections(-1, families, types) + elif NETBSD: + rawlist = cext.net_connections(-1, kind) + else: # FreeBSD + rawlist = cext.net_connections(families, types) + + for item in rawlist: + fd, fam, type, laddr, raddr, status, pid = item + nt = conn_to_ntuple( + fd, fam, type, laddr, raddr, status, TCP_STATUSES, pid + ) + ret.add(nt) + return list(ret) + + +# ===================================================================== +# --- sensors +# ===================================================================== + + +if FREEBSD: + + def sensors_battery(): + """Return battery info.""" + try: + percent, minsleft, power_plugged = cext.sensors_battery() + except NotImplementedError: + # See: https://github.com/giampaolo/psutil/issues/1074 + return None + power_plugged = power_plugged == 1 + if power_plugged: + secsleft = _common.POWER_TIME_UNLIMITED + elif minsleft == -1: + secsleft = _common.POWER_TIME_UNKNOWN + else: + secsleft = minsleft * 60 + return ntp.sbattery(percent, secsleft, power_plugged) + + def sensors_temperatures(): + """Return CPU cores temperatures if available, else an empty dict.""" + ret = defaultdict(list) + num_cpus = cpu_count_logical() + for cpu in range(num_cpus): + try: + current, high = cext.sensors_cpu_temperature(cpu) + if high <= 0: + high = None + name = f"Core {cpu}" + ret["coretemp"].append(ntp.shwtemp(name, current, high, high)) + except NotImplementedError: + pass + + return ret + + +# ===================================================================== +# --- other system functions +# ===================================================================== + + +def boot_time(): + """The system boot time expressed in seconds since the epoch.""" + return cext.boot_time() + + +if NETBSD: + + try: + INIT_BOOT_TIME = boot_time() + except Exception as err: # noqa: BLE001 + # Don't want to crash at import time. + debug(f"ignoring exception on import: {err!r}") + INIT_BOOT_TIME = 0 + + def adjust_proc_create_time(ctime): + """Account for system clock updates.""" + if INIT_BOOT_TIME == 0: + return ctime + + diff = INIT_BOOT_TIME - boot_time() + if diff == 0 or abs(diff) < 1: + return ctime + + debug("system clock was updated; adjusting process create_time()") + if diff < 0: + return ctime - diff + return ctime + diff + + +def users(): + """Return currently connected users as a list of namedtuples.""" + retlist = [] + rawlist = cext.users() + for item in rawlist: + user, tty, hostname, tstamp, pid = item + if tty == '~': + continue # reboot or shutdown + nt = ntp.suser(user, tty or None, hostname, tstamp, pid) + retlist.append(nt) + return retlist + + +# ===================================================================== +# --- processes +# ===================================================================== + + +@memoize +def _pid_0_exists(): + try: + Process(0).name() + except NoSuchProcess: + return False + except AccessDenied: + return True + else: + return True + + +def pids(): + """Returns a list of PIDs currently running on the system.""" + ret = cext.pids() + if OPENBSD and (0 not in ret) and _pid_0_exists(): + # On OpenBSD the kernel does not return PID 0 (neither does + # ps) but it's actually querable (Process(0) will succeed). + ret.insert(0, 0) + return ret + + +if NETBSD: + + def pid_exists(pid): + exists = _psposix.pid_exists(pid) + if not exists: + # We do this because _psposix.pid_exists() lies in case of + # zombie processes. + return pid in pids() + else: + return True + +elif OPENBSD: + + def pid_exists(pid): + exists = _psposix.pid_exists(pid) + if not exists: + return False + else: + # OpenBSD seems to be the only BSD platform where + # _psposix.pid_exists() returns True for thread IDs (tids), + # so we can't use it. + return pid in pids() + +else: # FreeBSD + pid_exists = _psposix.pid_exists + + +def wrap_exceptions(fun): + """Decorator which translates bare OSError exceptions into + NoSuchProcess and AccessDenied. + """ + + @functools.wraps(fun) + def wrapper(self, *args, **kwargs): + pid, ppid, name = self.pid, self._ppid, self._name + try: + return fun(self, *args, **kwargs) + except ProcessLookupError as err: + if cext.proc_is_zombie(pid): + raise ZombieProcess(pid, name, ppid) from err + raise NoSuchProcess(pid, name) from err + except PermissionError as err: + raise AccessDenied(pid, name) from err + except cext.ZombieProcessError as err: + raise ZombieProcess(pid, name, ppid) from err + except OSError as err: + if pid == 0 and 0 in pids(): + raise AccessDenied(pid, name) from err + raise err from None + + return wrapper + + +@contextlib.contextmanager +def wrap_exceptions_procfs(inst): + """Same as above, for routines relying on reading /proc fs.""" + pid, name, ppid = inst.pid, inst._name, inst._ppid + try: + yield + except (ProcessLookupError, FileNotFoundError) as err: + # ENOENT (no such file or directory) gets raised on open(). + # ESRCH (no such process) can get raised on read() if + # process is gone in meantime. + if cext.proc_is_zombie(inst.pid): + raise ZombieProcess(pid, name, ppid) from err + else: + raise NoSuchProcess(pid, name) from err + except PermissionError as err: + raise AccessDenied(pid, name) from err + + +class Process: + """Wrapper class around underlying C implementation.""" + + __slots__ = ["_cache", "_name", "_ppid", "pid"] + + def __init__(self, pid): + self.pid = pid + self._name = None + self._ppid = None + + def _assert_alive(self): + """Raise NSP if the process disappeared on us.""" + # For those C function who do not raise NSP, possibly returning + # incorrect or incomplete result. + cext.proc_name(self.pid) + + @wrap_exceptions + @memoize_when_activated + def oneshot(self): + """Retrieves multiple process info in one shot as a raw tuple.""" + ret = cext.proc_oneshot_info(self.pid) + assert len(ret) == len(kinfo_proc_map) + return ret + + def oneshot_enter(self): + self.oneshot.cache_activate(self) + + def oneshot_exit(self): + self.oneshot.cache_deactivate(self) + + @wrap_exceptions + def name(self): + name = self.oneshot()[kinfo_proc_map['name']] + return name if name is not None else cext.proc_name(self.pid) + + @wrap_exceptions + def exe(self): + if FREEBSD: + if self.pid == 0: + return '' # else NSP + return cext.proc_exe(self.pid) + elif NETBSD: + if self.pid == 0: + # /proc/0 dir exists but /proc/0/exe doesn't + return "" + with wrap_exceptions_procfs(self): + return os.readlink(f"/proc/{self.pid}/exe") + else: + # OpenBSD: exe cannot be determined; references: + # https://chromium.googlesource.com/chromium/src/base/+/ + # master/base_paths_posix.cc + # We try our best guess by using which against the first + # cmdline arg (may return None). + import shutil + + cmdline = self.cmdline() + if cmdline: + return shutil.which(cmdline[0]) or "" + else: + return "" + + @wrap_exceptions + def cmdline(self): + if OPENBSD and self.pid == 0: + return [] # ...else it crashes + elif NETBSD: + # XXX - most of the times the underlying sysctl() call on + # NetBSD and OpenBSD returns a truncated string. Also + # /proc/pid/cmdline behaves the same so it looks like this + # is a kernel bug. + try: + return cext.proc_cmdline(self.pid) + except OSError as err: + if err.errno == errno.EINVAL: + pid, name, ppid = self.pid, self._name, self._ppid + if cext.proc_is_zombie(self.pid): + raise ZombieProcess(pid, name, ppid) from err + if not pid_exists(self.pid): + raise NoSuchProcess(pid, name, ppid) from err + # XXX: this happens with unicode tests. It means the C + # routine is unable to decode invalid unicode chars. + debug(f"ignoring {err!r} and returning an empty list") + return [] + else: + raise + else: + return cext.proc_cmdline(self.pid) + + @wrap_exceptions + def environ(self): + return cext.proc_environ(self.pid) + + @wrap_exceptions + def terminal(self): + tty_nr = self.oneshot()[kinfo_proc_map['ttynr']] + tmap = _psposix.get_terminal_map() + try: + return tmap[tty_nr] + except KeyError: + return None + + @wrap_exceptions + def ppid(self): + self._ppid = self.oneshot()[kinfo_proc_map['ppid']] + return self._ppid + + @wrap_exceptions + def uids(self): + rawtuple = self.oneshot() + return ntp.puids( + rawtuple[kinfo_proc_map['real_uid']], + rawtuple[kinfo_proc_map['effective_uid']], + rawtuple[kinfo_proc_map['saved_uid']], + ) + + @wrap_exceptions + def gids(self): + rawtuple = self.oneshot() + return ntp.pgids( + rawtuple[kinfo_proc_map['real_gid']], + rawtuple[kinfo_proc_map['effective_gid']], + rawtuple[kinfo_proc_map['saved_gid']], + ) + + @wrap_exceptions + def cpu_times(self): + rawtuple = self.oneshot() + return ntp.pcputimes( + rawtuple[kinfo_proc_map['user_time']], + rawtuple[kinfo_proc_map['sys_time']], + rawtuple[kinfo_proc_map['ch_user_time']], + rawtuple[kinfo_proc_map['ch_sys_time']], + ) + + if FREEBSD: + + @wrap_exceptions + def cpu_num(self): + return self.oneshot()[kinfo_proc_map['cpunum']] + + @wrap_exceptions + def memory_info(self): + rawtuple = self.oneshot() + return ntp.pmem( + rawtuple[kinfo_proc_map['rss']], + rawtuple[kinfo_proc_map['vms']], + rawtuple[kinfo_proc_map['memtext']], + rawtuple[kinfo_proc_map['memdata']], + rawtuple[kinfo_proc_map['memstack']], + ) + + memory_full_info = memory_info + + @wrap_exceptions + def create_time(self, monotonic=False): + ctime = self.oneshot()[kinfo_proc_map['create_time']] + if NETBSD and not monotonic: + # NetBSD: ctime subject to system clock updates. + ctime = adjust_proc_create_time(ctime) + return ctime + + @wrap_exceptions + def num_threads(self): + if HAS_PROC_NUM_THREADS: + # FreeBSD / NetBSD + return cext.proc_num_threads(self.pid) + else: + return len(self.threads()) + + @wrap_exceptions + def num_ctx_switches(self): + rawtuple = self.oneshot() + return ntp.pctxsw( + rawtuple[kinfo_proc_map['ctx_switches_vol']], + rawtuple[kinfo_proc_map['ctx_switches_unvol']], + ) + + @wrap_exceptions + def threads(self): + # Note: on OpenSBD this (/dev/mem) requires root access. + rawlist = cext.proc_threads(self.pid) + retlist = [] + for thread_id, utime, stime in rawlist: + ntuple = ntp.pthread(thread_id, utime, stime) + retlist.append(ntuple) + if OPENBSD: + self._assert_alive() + return retlist + + @wrap_exceptions + def net_connections(self, kind='inet'): + families, types = conn_tmap[kind] + ret = [] + + if NETBSD: + rawlist = cext.net_connections(self.pid, kind) + elif OPENBSD: + rawlist = cext.net_connections(self.pid, families, types) + else: + rawlist = cext.proc_net_connections(self.pid, families, types) + + for item in rawlist: + fd, fam, type, laddr, raddr, status = item[:6] + if FREEBSD: + if (fam not in families) or (type not in types): + continue + nt = conn_to_ntuple( + fd, fam, type, laddr, raddr, status, TCP_STATUSES + ) + ret.append(nt) + + self._assert_alive() + return ret + + @wrap_exceptions + def wait(self, timeout=None): + return _psposix.wait_pid(self.pid, timeout) + + @wrap_exceptions + def nice_get(self): + return cext.proc_priority_get(self.pid) + + @wrap_exceptions + def nice_set(self, value): + return cext.proc_priority_set(self.pid, value) + + @wrap_exceptions + def status(self): + code = self.oneshot()[kinfo_proc_map['status']] + # XXX is '?' legit? (we're not supposed to return it anyway) + return PROC_STATUSES.get(code, '?') + + @wrap_exceptions + def io_counters(self): + rawtuple = self.oneshot() + return ntp.pio( + rawtuple[kinfo_proc_map['read_io_count']], + rawtuple[kinfo_proc_map['write_io_count']], + -1, + -1, + ) + + @wrap_exceptions + def cwd(self): + """Return process current working directory.""" + # sometimes we get an empty string, in which case we turn + # it into None + if OPENBSD and self.pid == 0: + return "" # ...else it would raise EINVAL + return cext.proc_cwd(self.pid) + + nt_mmap_grouped = namedtuple( + 'mmap', 'path rss, private, ref_count, shadow_count' + ) + nt_mmap_ext = namedtuple( + 'mmap', 'addr, perms path rss, private, ref_count, shadow_count' + ) + + @wrap_exceptions + def open_files(self): + """Return files opened by process as a list of namedtuples.""" + rawlist = cext.proc_open_files(self.pid) + return [ntp.popenfile(path, fd) for path, fd in rawlist] + + @wrap_exceptions + def num_fds(self): + """Return the number of file descriptors opened by this process.""" + ret = cext.proc_num_fds(self.pid) + if NETBSD: + self._assert_alive() + return ret + + # --- FreeBSD only APIs + + if FREEBSD: + + @wrap_exceptions + def cpu_affinity_get(self): + return cext.proc_cpu_affinity_get(self.pid) + + @wrap_exceptions + def cpu_affinity_set(self, cpus): + # Pre-emptively check if CPUs are valid because the C + # function has a weird behavior in case of invalid CPUs, + # see: https://github.com/giampaolo/psutil/issues/586 + allcpus = set(range(len(per_cpu_times()))) + for cpu in cpus: + if cpu not in allcpus: + msg = f"invalid CPU {cpu!r} (choose between {allcpus})" + raise ValueError(msg) + try: + cext.proc_cpu_affinity_set(self.pid, cpus) + except OSError as err: + # 'man cpuset_setaffinity' about EDEADLK: + # <> + if err.errno in {errno.EINVAL, errno.EDEADLK}: + for cpu in cpus: + if cpu not in allcpus: + msg = ( + f"invalid CPU {cpu!r} (choose between" + f" {allcpus})" + ) + raise ValueError(msg) from err + raise + + @wrap_exceptions + def memory_maps(self): + return cext.proc_memory_maps(self.pid) + + @wrap_exceptions + def rlimit(self, resource, limits=None): + if limits is None: + return cext.proc_getrlimit(self.pid, resource) + else: + if len(limits) != 2: + msg = ( + "second argument must be a (soft, hard) tuple, got" + f" {limits!r}" + ) + raise ValueError(msg) + soft, hard = limits + return cext.proc_setrlimit(self.pid, resource, soft, hard) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_pslinux.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_pslinux.py new file mode 100644 index 0000000000000000000000000000000000000000..dc305b59559e9b97f96eacf2a2002d2b02e3fe41 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_pslinux.py @@ -0,0 +1,2269 @@ +# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Linux platform implementation.""" + +import base64 +import collections +import enum +import errno +import functools +import glob +import os +import re +import resource +import socket +import struct +import sys +import warnings +from collections import defaultdict +from collections import namedtuple + +from . import _common +from . import _ntuples as ntp +from . import _psposix +from . import _psutil_linux as cext +from ._common import ENCODING +from ._common import NIC_DUPLEX_FULL +from ._common import NIC_DUPLEX_HALF +from ._common import NIC_DUPLEX_UNKNOWN +from ._common import AccessDenied +from ._common import NoSuchProcess +from ._common import ZombieProcess +from ._common import bcat +from ._common import cat +from ._common import debug +from ._common import decode +from ._common import get_procfs_path +from ._common import isfile_strict +from ._common import memoize +from ._common import memoize_when_activated +from ._common import open_binary +from ._common import open_text +from ._common import parse_environ_block +from ._common import path_exists_strict +from ._common import supports_ipv6 +from ._common import usage_percent + +# fmt: off +__extra__all__ = [ + 'PROCFS_PATH', + # io prio constants + "IOPRIO_CLASS_NONE", "IOPRIO_CLASS_RT", "IOPRIO_CLASS_BE", + "IOPRIO_CLASS_IDLE", + # connection status constants + "CONN_ESTABLISHED", "CONN_SYN_SENT", "CONN_SYN_RECV", "CONN_FIN_WAIT1", + "CONN_FIN_WAIT2", "CONN_TIME_WAIT", "CONN_CLOSE", "CONN_CLOSE_WAIT", + "CONN_LAST_ACK", "CONN_LISTEN", "CONN_CLOSING", +] +# fmt: on + + +# ===================================================================== +# --- globals +# ===================================================================== + + +POWER_SUPPLY_PATH = "/sys/class/power_supply" +HAS_PROC_SMAPS = os.path.exists(f"/proc/{os.getpid()}/smaps") +HAS_PROC_SMAPS_ROLLUP = os.path.exists(f"/proc/{os.getpid()}/smaps_rollup") +HAS_PROC_IO_PRIORITY = hasattr(cext, "proc_ioprio_get") +HAS_CPU_AFFINITY = hasattr(cext, "proc_cpu_affinity_get") + +# Number of clock ticks per second +CLOCK_TICKS = os.sysconf("SC_CLK_TCK") +PAGESIZE = cext.getpagesize() +LITTLE_ENDIAN = sys.byteorder == 'little' +UNSET = object() + +# "man iostat" states that sectors are equivalent with blocks and have +# a size of 512 bytes. Despite this value can be queried at runtime +# via /sys/block/{DISK}/queue/hw_sector_size and results may vary +# between 1k, 2k, or 4k... 512 appears to be a magic constant used +# throughout Linux source code: +# * https://stackoverflow.com/a/38136179/376587 +# * https://lists.gt.net/linux/kernel/2241060 +# * https://github.com/giampaolo/psutil/issues/1305 +# * https://github.com/torvalds/linux/blob/ +# 4f671fe2f9523a1ea206f63fe60a7c7b3a56d5c7/include/linux/bio.h#L99 +# * https://lkml.org/lkml/2015/8/17/234 +DISK_SECTOR_SIZE = 512 + +AddressFamily = enum.IntEnum( + 'AddressFamily', {'AF_LINK': int(socket.AF_PACKET)} +) +AF_LINK = AddressFamily.AF_LINK + + +# ioprio_* constants http://linux.die.net/man/2/ioprio_get +class IOPriority(enum.IntEnum): + IOPRIO_CLASS_NONE = 0 + IOPRIO_CLASS_RT = 1 + IOPRIO_CLASS_BE = 2 + IOPRIO_CLASS_IDLE = 3 + + +globals().update(IOPriority.__members__) + +# See: +# https://github.com/torvalds/linux/blame/master/fs/proc/array.c +# ...and (TASK_* constants): +# https://github.com/torvalds/linux/blob/master/include/linux/sched.h +PROC_STATUSES = { + "R": _common.STATUS_RUNNING, + "S": _common.STATUS_SLEEPING, + "D": _common.STATUS_DISK_SLEEP, + "T": _common.STATUS_STOPPED, + "t": _common.STATUS_TRACING_STOP, + "Z": _common.STATUS_ZOMBIE, + "X": _common.STATUS_DEAD, + "x": _common.STATUS_DEAD, + "K": _common.STATUS_WAKE_KILL, + "W": _common.STATUS_WAKING, + "I": _common.STATUS_IDLE, + "P": _common.STATUS_PARKED, +} + +# https://github.com/torvalds/linux/blob/master/include/net/tcp_states.h +TCP_STATUSES = { + "01": _common.CONN_ESTABLISHED, + "02": _common.CONN_SYN_SENT, + "03": _common.CONN_SYN_RECV, + "04": _common.CONN_FIN_WAIT1, + "05": _common.CONN_FIN_WAIT2, + "06": _common.CONN_TIME_WAIT, + "07": _common.CONN_CLOSE, + "08": _common.CONN_CLOSE_WAIT, + "09": _common.CONN_LAST_ACK, + "0A": _common.CONN_LISTEN, + "0B": _common.CONN_CLOSING, +} + + +# ===================================================================== +# --- utils +# ===================================================================== + + +def readlink(path): + """Wrapper around os.readlink().""" + assert isinstance(path, str), path + path = os.readlink(path) + # readlink() might return paths containing null bytes ('\x00') + # resulting in "TypeError: must be encoded string without NULL + # bytes, not str" errors when the string is passed to other + # fs-related functions (os.*, open(), ...). + # Apparently everything after '\x00' is garbage (we can have + # ' (deleted)', 'new' and possibly others), see: + # https://github.com/giampaolo/psutil/issues/717 + path = path.split('\x00')[0] + # Certain paths have ' (deleted)' appended. Usually this is + # bogus as the file actually exists. Even if it doesn't we + # don't care. + if path.endswith(' (deleted)') and not path_exists_strict(path): + path = path[:-10] + return path + + +def file_flags_to_mode(flags): + """Convert file's open() flags into a readable string. + Used by Process.open_files(). + """ + modes_map = {os.O_RDONLY: 'r', os.O_WRONLY: 'w', os.O_RDWR: 'w+'} + mode = modes_map[flags & (os.O_RDONLY | os.O_WRONLY | os.O_RDWR)] + if flags & os.O_APPEND: + mode = mode.replace('w', 'a', 1) + mode = mode.replace('w+', 'r+') + # possible values: r, w, a, r+, a+ + return mode + + +def is_storage_device(name): + """Return True if the given name refers to a root device (e.g. + "sda", "nvme0n1") as opposed to a logical partition (e.g. "sda1", + "nvme0n1p1"). If name is a virtual device (e.g. "loop1", "ram") + return True. + """ + # Re-adapted from iostat source code, see: + # https://github.com/sysstat/sysstat/blob/ + # 97912938cd476645b267280069e83b1c8dc0e1c7/common.c#L208 + # Some devices may have a slash in their name (e.g. cciss/c0d0...). + name = name.replace('/', '!') + including_virtual = True + if including_virtual: + path = f"/sys/block/{name}" + else: + path = f"/sys/block/{name}/device" + return os.access(path, os.F_OK) + + +@memoize +def _scputimes_ntuple(procfs_path): + """Return a namedtuple of variable fields depending on the CPU times + available on this Linux kernel version which may be: + (user, nice, system, idle, iowait, irq, softirq, [steal, [guest, + [guest_nice]]]) + Used by cpu_times() function. + """ + with open_binary(f"{procfs_path}/stat") as f: + values = f.readline().split()[1:] + fields = ['user', 'nice', 'system', 'idle', 'iowait', 'irq', 'softirq'] + vlen = len(values) + if vlen >= 8: + # Linux >= 2.6.11 + fields.append('steal') + if vlen >= 9: + # Linux >= 2.6.24 + fields.append('guest') + if vlen >= 10: + # Linux >= 3.2.0 + fields.append('guest_nice') + return namedtuple('scputimes', fields) + + +# Set it into _ntuples.py namespace. +try: + ntp.scputimes = _scputimes_ntuple("/proc") +except Exception as err: # noqa: BLE001 + # Don't want to crash at import time. + debug(f"ignoring exception on import: {err!r}") + ntp.scputimes = namedtuple('scputimes', 'user system idle')(0.0, 0.0, 0.0) + +# XXX: must be available also at this module level in order to be +# serialized (tests/test_misc.py::TestMisc::test_serialization). +scputimes = ntp.scputimes + + +# ===================================================================== +# --- system memory +# ===================================================================== + + +def calculate_avail_vmem(mems): + """Fallback for kernels < 3.14 where /proc/meminfo does not provide + "MemAvailable", see: + https://blog.famzah.net/2014/09/24/. + + This code reimplements the algorithm outlined here: + https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/ + commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773 + + We use this function also when "MemAvailable" returns 0 (possibly a + kernel bug, see: https://github.com/giampaolo/psutil/issues/1915). + In that case this routine matches "free" CLI tool result ("available" + column). + + XXX: on recent kernels this calculation may differ by ~1.5% compared + to "MemAvailable:", as it's calculated slightly differently. + It is still way more realistic than doing (free + cached) though. + See: + * https://gitlab.com/procps-ng/procps/issues/42 + * https://github.com/famzah/linux-memavailable-procfs/issues/2 + """ + # Note about "fallback" value. According to: + # https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/ + # commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773 + # ...long ago "available" memory was calculated as (free + cached), + # We use fallback when one of these is missing from /proc/meminfo: + # "Active(file)": introduced in 2.6.28 / Dec 2008 + # "Inactive(file)": introduced in 2.6.28 / Dec 2008 + # "SReclaimable": introduced in 2.6.19 / Nov 2006 + # /proc/zoneinfo: introduced in 2.6.13 / Aug 2005 + free = mems[b'MemFree:'] + fallback = free + mems.get(b"Cached:", 0) + try: + lru_active_file = mems[b'Active(file):'] + lru_inactive_file = mems[b'Inactive(file):'] + slab_reclaimable = mems[b'SReclaimable:'] + except KeyError as err: + debug( + f"{err.args[0]} is missing from /proc/meminfo; using an" + " approximation for calculating available memory" + ) + return fallback + try: + f = open_binary(f"{get_procfs_path()}/zoneinfo") + except OSError: + return fallback # kernel 2.6.13 + + watermark_low = 0 + with f: + for line in f: + line = line.strip() + if line.startswith(b'low'): + watermark_low += int(line.split()[1]) + watermark_low *= PAGESIZE + + avail = free - watermark_low + pagecache = lru_active_file + lru_inactive_file + pagecache -= min(pagecache / 2, watermark_low) + avail += pagecache + avail += slab_reclaimable - min(slab_reclaimable / 2.0, watermark_low) + return int(avail) + + +def virtual_memory(): + """Report virtual memory stats. + This implementation mimics procps-ng-3.3.12, aka "free" CLI tool: + https://gitlab.com/procps-ng/procps/blob/ + 24fd2605c51fccc375ab0287cec33aa767f06718/proc/sysinfo.c#L778-791 + The returned values are supposed to match both "free" and "vmstat -s" + CLI tools. + """ + missing_fields = [] + mems = {} + with open_binary(f"{get_procfs_path()}/meminfo") as f: + for line in f: + fields = line.split() + mems[fields[0]] = int(fields[1]) * 1024 + + # /proc doc states that the available fields in /proc/meminfo vary + # by architecture and compile options, but these 3 values are also + # returned by sysinfo(2); as such we assume they are always there. + total = mems[b'MemTotal:'] + free = mems[b'MemFree:'] + try: + buffers = mems[b'Buffers:'] + except KeyError: + # https://github.com/giampaolo/psutil/issues/1010 + buffers = 0 + missing_fields.append('buffers') + try: + cached = mems[b"Cached:"] + except KeyError: + cached = 0 + missing_fields.append('cached') + else: + # "free" cmdline utility sums reclaimable to cached. + # Older versions of procps used to add slab memory instead. + # This got changed in: + # https://gitlab.com/procps-ng/procps/commit/ + # 05d751c4f076a2f0118b914c5e51cfbb4762ad8e + cached += mems.get(b"SReclaimable:", 0) # since kernel 2.6.19 + + try: + shared = mems[b'Shmem:'] # since kernel 2.6.32 + except KeyError: + try: + shared = mems[b'MemShared:'] # kernels 2.4 + except KeyError: + shared = 0 + missing_fields.append('shared') + + try: + active = mems[b"Active:"] + except KeyError: + active = 0 + missing_fields.append('active') + + try: + inactive = mems[b"Inactive:"] + except KeyError: + try: + inactive = ( + mems[b"Inact_dirty:"] + + mems[b"Inact_clean:"] + + mems[b"Inact_laundry:"] + ) + except KeyError: + inactive = 0 + missing_fields.append('inactive') + + try: + slab = mems[b"Slab:"] + except KeyError: + slab = 0 + + # - starting from 4.4.0 we match free's "available" column. + # Before 4.4.0 we calculated it as (free + buffers + cached) + # which matched htop. + # - free and htop available memory differs as per: + # http://askubuntu.com/a/369589 + # http://unix.stackexchange.com/a/65852/168884 + # - MemAvailable has been introduced in kernel 3.14 + try: + avail = mems[b'MemAvailable:'] + except KeyError: + avail = calculate_avail_vmem(mems) + else: + if avail == 0: + # Yes, it can happen (probably a kernel bug): + # https://github.com/giampaolo/psutil/issues/1915 + # In this case "free" CLI tool makes an estimate. We do the same, + # and it matches "free" CLI tool. + avail = calculate_avail_vmem(mems) + + if avail < 0: + avail = 0 + missing_fields.append('available') + elif avail > total: + # If avail is greater than total or our calculation overflows, + # that's symptomatic of running within a LCX container where such + # values will be dramatically distorted over those of the host. + # https://gitlab.com/procps-ng/procps/blob/ + # 24fd2605c51fccc375ab0287cec33aa767f06718/proc/sysinfo.c#L764 + avail = free + + used = total - avail + + percent = usage_percent((total - avail), total, round_=1) + + # Warn about missing metrics which are set to 0. + if missing_fields: + msg = "{} memory stats couldn't be determined and {} set to 0".format( + ", ".join(missing_fields), + "was" if len(missing_fields) == 1 else "were", + ) + warnings.warn(msg, RuntimeWarning, stacklevel=2) + + return ntp.svmem( + total, + avail, + percent, + used, + free, + active, + inactive, + buffers, + cached, + shared, + slab, + ) + + +def swap_memory(): + """Return swap memory metrics.""" + mems = {} + with open_binary(f"{get_procfs_path()}/meminfo") as f: + for line in f: + fields = line.split() + mems[fields[0]] = int(fields[1]) * 1024 + # We prefer /proc/meminfo over sysinfo() syscall so that + # psutil.PROCFS_PATH can be used in order to allow retrieval + # for linux containers, see: + # https://github.com/giampaolo/psutil/issues/1015 + try: + total = mems[b'SwapTotal:'] + free = mems[b'SwapFree:'] + except KeyError: + _, _, _, _, total, free, unit_multiplier = cext.linux_sysinfo() + total *= unit_multiplier + free *= unit_multiplier + + used = total - free + percent = usage_percent(used, total, round_=1) + # get pgin/pgouts + try: + f = open_binary(f"{get_procfs_path()}/vmstat") + except OSError as err: + # see https://github.com/giampaolo/psutil/issues/722 + msg = ( + "'sin' and 'sout' swap memory stats couldn't " + f"be determined and were set to 0 ({err})" + ) + warnings.warn(msg, RuntimeWarning, stacklevel=2) + sin = sout = 0 + else: + with f: + sin = sout = None + for line in f: + # values are expressed in 4 kilo bytes, we want + # bytes instead + if line.startswith(b'pswpin'): + sin = int(line.split(b' ')[1]) * 4 * 1024 + elif line.startswith(b'pswpout'): + sout = int(line.split(b' ')[1]) * 4 * 1024 + if sin is not None and sout is not None: + break + else: + # we might get here when dealing with exotic Linux + # flavors, see: + # https://github.com/giampaolo/psutil/issues/313 + msg = "'sin' and 'sout' swap memory stats couldn't " + msg += "be determined and were set to 0" + warnings.warn(msg, RuntimeWarning, stacklevel=2) + sin = sout = 0 + return ntp.sswap(total, used, free, percent, sin, sout) + + +# malloc / heap functions; require glibc +if hasattr(cext, "heap_info"): + heap_info = cext.heap_info + heap_trim = cext.heap_trim + + +# ===================================================================== +# --- CPU +# ===================================================================== + + +def cpu_times(): + """Return a named tuple representing the following system-wide + CPU times: + (user, nice, system, idle, iowait, irq, softirq [steal, [guest, + [guest_nice]]]) + Last 3 fields may not be available on all Linux kernel versions. + """ + procfs_path = get_procfs_path() + with open_binary(f"{procfs_path}/stat") as f: + values = f.readline().split() + fields = values[1 : len(ntp.scputimes._fields) + 1] + fields = [float(x) / CLOCK_TICKS for x in fields] + return ntp.scputimes(*fields) + + +def per_cpu_times(): + """Return a list of namedtuple representing the CPU times + for every CPU available on the system. + """ + procfs_path = get_procfs_path() + cpus = [] + with open_binary(f"{procfs_path}/stat") as f: + # get rid of the first line which refers to system wide CPU stats + f.readline() + for line in f: + if line.startswith(b'cpu'): + values = line.split() + fields = values[1 : len(ntp.scputimes._fields) + 1] + fields = [float(x) / CLOCK_TICKS for x in fields] + entry = ntp.scputimes(*fields) + cpus.append(entry) + return cpus + + +def cpu_count_logical(): + """Return the number of logical CPUs in the system.""" + try: + return os.sysconf("SC_NPROCESSORS_ONLN") + except ValueError: + # as a second fallback we try to parse /proc/cpuinfo + num = 0 + with open_binary(f"{get_procfs_path()}/cpuinfo") as f: + for line in f: + if line.lower().startswith(b'processor'): + num += 1 + + # unknown format (e.g. amrel/sparc architectures), see: + # https://github.com/giampaolo/psutil/issues/200 + # try to parse /proc/stat as a last resort + if num == 0: + search = re.compile(r'cpu\d') + with open_text(f"{get_procfs_path()}/stat") as f: + for line in f: + line = line.split(' ')[0] + if search.match(line): + num += 1 + + if num == 0: + # mimic os.cpu_count() + return None + return num + + +def cpu_count_cores(): + """Return the number of CPU cores in the system.""" + # Method #1 + ls = set() + # These 2 files are the same but */core_cpus_list is newer while + # */thread_siblings_list is deprecated and may disappear in the future. + # https://www.kernel.org/doc/Documentation/admin-guide/cputopology.rst + # https://github.com/giampaolo/psutil/pull/1727#issuecomment-707624964 + # https://lkml.org/lkml/2019/2/26/41 + p1 = "/sys/devices/system/cpu/cpu[0-9]*/topology/core_cpus_list" + p2 = "/sys/devices/system/cpu/cpu[0-9]*/topology/thread_siblings_list" + for path in glob.glob(p1) or glob.glob(p2): + with open_binary(path) as f: + ls.add(f.read().strip()) + result = len(ls) + if result != 0: + return result + + # Method #2 + mapping = {} + current_info = {} + with open_binary(f"{get_procfs_path()}/cpuinfo") as f: + for line in f: + line = line.strip().lower() + if not line: + # new section + try: + mapping[current_info[b'physical id']] = current_info[ + b'cpu cores' + ] + except KeyError: + pass + current_info = {} + elif line.startswith((b'physical id', b'cpu cores')): + # ongoing section + key, value = line.split(b'\t:', 1) + current_info[key] = int(value) + + result = sum(mapping.values()) + return result or None # mimic os.cpu_count() + + +def cpu_stats(): + """Return various CPU stats as a named tuple.""" + with open_binary(f"{get_procfs_path()}/stat") as f: + ctx_switches = None + interrupts = None + soft_interrupts = None + for line in f: + if line.startswith(b'ctxt'): + ctx_switches = int(line.split()[1]) + elif line.startswith(b'intr'): + interrupts = int(line.split()[1]) + elif line.startswith(b'softirq'): + soft_interrupts = int(line.split()[1]) + if ( + ctx_switches is not None + and soft_interrupts is not None + and interrupts is not None + ): + break + syscalls = 0 + return ntp.scpustats(ctx_switches, interrupts, soft_interrupts, syscalls) + + +def _cpu_get_cpuinfo_freq(): + """Return current CPU frequency from cpuinfo if available.""" + with open_binary(f"{get_procfs_path()}/cpuinfo") as f: + return [ + float(line.split(b':', 1)[1]) + for line in f + if line.lower().startswith(b'cpu mhz') + ] + + +if os.path.exists("/sys/devices/system/cpu/cpufreq/policy0") or os.path.exists( + "/sys/devices/system/cpu/cpu0/cpufreq" +): + + def cpu_freq(): + """Return frequency metrics for all CPUs. + Contrarily to other OSes, Linux updates these values in + real-time. + """ + cpuinfo_freqs = _cpu_get_cpuinfo_freq() + paths = glob.glob( + "/sys/devices/system/cpu/cpufreq/policy[0-9]*" + ) or glob.glob("/sys/devices/system/cpu/cpu[0-9]*/cpufreq") + paths.sort(key=lambda x: int(re.search(r"[0-9]+", x).group())) + ret = [] + pjoin = os.path.join + for i, path in enumerate(paths): + if len(paths) == len(cpuinfo_freqs): + # take cached value from cpuinfo if available, see: + # https://github.com/giampaolo/psutil/issues/1851 + curr = cpuinfo_freqs[i] * 1000 + else: + curr = bcat(pjoin(path, "scaling_cur_freq"), fallback=None) + if curr is None: + # Likely an old RedHat, see: + # https://github.com/giampaolo/psutil/issues/1071 + curr = bcat(pjoin(path, "cpuinfo_cur_freq"), fallback=None) + if curr is None: + online_path = f"/sys/devices/system/cpu/cpu{i}/online" + # if cpu core is offline, set to all zeroes + if cat(online_path, fallback=None) == "0\n": + ret.append(ntp.scpufreq(0.0, 0.0, 0.0)) + continue + msg = "can't find current frequency file" + raise NotImplementedError(msg) + curr = int(curr) / 1000 + max_ = int(bcat(pjoin(path, "scaling_max_freq"))) / 1000 + min_ = int(bcat(pjoin(path, "scaling_min_freq"))) / 1000 + ret.append(ntp.scpufreq(curr, min_, max_)) + return ret + +else: + + def cpu_freq(): + """Alternate implementation using /proc/cpuinfo. + min and max frequencies are not available and are set to None. + """ + return [ntp.scpufreq(x, 0.0, 0.0) for x in _cpu_get_cpuinfo_freq()] + + +# ===================================================================== +# --- network +# ===================================================================== + + +net_if_addrs = cext.net_if_addrs + + +class _Ipv6UnsupportedError(Exception): + pass + + +class NetConnections: + """A wrapper on top of /proc/net/* files, retrieving per-process + and system-wide open connections (TCP, UDP, UNIX) similarly to + "netstat -an". + + Note: in case of UNIX sockets we're only able to determine the + local endpoint/path, not the one it's connected to. + According to [1] it would be possible but not easily. + + [1] http://serverfault.com/a/417946 + """ + + def __init__(self): + # The string represents the basename of the corresponding + # /proc/net/{proto_name} file. + tcp4 = ("tcp", socket.AF_INET, socket.SOCK_STREAM) + tcp6 = ("tcp6", socket.AF_INET6, socket.SOCK_STREAM) + udp4 = ("udp", socket.AF_INET, socket.SOCK_DGRAM) + udp6 = ("udp6", socket.AF_INET6, socket.SOCK_DGRAM) + unix = ("unix", socket.AF_UNIX, None) + self.tmap = { + "all": (tcp4, tcp6, udp4, udp6, unix), + "tcp": (tcp4, tcp6), + "tcp4": (tcp4,), + "tcp6": (tcp6,), + "udp": (udp4, udp6), + "udp4": (udp4,), + "udp6": (udp6,), + "unix": (unix,), + "inet": (tcp4, tcp6, udp4, udp6), + "inet4": (tcp4, udp4), + "inet6": (tcp6, udp6), + } + self._procfs_path = None + + def get_proc_inodes(self, pid): + inodes = defaultdict(list) + for fd in os.listdir(f"{self._procfs_path}/{pid}/fd"): + try: + inode = readlink(f"{self._procfs_path}/{pid}/fd/{fd}") + except (FileNotFoundError, ProcessLookupError): + # ENOENT == file which is gone in the meantime; + # os.stat(f"/proc/{self.pid}") will be done later + # to force NSP (if it's the case) + continue + except OSError as err: + if err.errno == errno.EINVAL: + # not a link + continue + if err.errno == errno.ENAMETOOLONG: + # file name too long + debug(err) + continue + raise + else: + if inode.startswith('socket:['): + # the process is using a socket + inode = inode[8:][:-1] + inodes[inode].append((pid, int(fd))) + return inodes + + def get_all_inodes(self): + inodes = {} + for pid in pids(): + try: + inodes.update(self.get_proc_inodes(pid)) + except (FileNotFoundError, ProcessLookupError, PermissionError): + # os.listdir() is gonna raise a lot of access denied + # exceptions in case of unprivileged user; that's fine + # as we'll just end up returning a connection with PID + # and fd set to None anyway. + # Both netstat -an and lsof does the same so it's + # unlikely we can do any better. + # ENOENT just means a PID disappeared on us. + continue + return inodes + + @staticmethod + def decode_address(addr, family): + """Accept an "ip:port" address as displayed in /proc/net/* + and convert it into a human readable form, like: + + "0500000A:0016" -> ("10.0.0.5", 22) + "0000000000000000FFFF00000100007F:9E49" -> ("::ffff:127.0.0.1", 40521) + + The IP address portion is a little or big endian four-byte + hexadecimal number; that is, the least significant byte is listed + first, so we need to reverse the order of the bytes to convert it + to an IP address. + The port is represented as a two-byte hexadecimal number. + + Reference: + http://linuxdevcenter.com/pub/a/linux/2000/11/16/LinuxAdmin.html + """ + ip, port = addr.split(':') + port = int(port, 16) + # this usually refers to a local socket in listen mode with + # no end-points connected + if not port: + return () + ip = ip.encode('ascii') + if family == socket.AF_INET: + # see: https://github.com/giampaolo/psutil/issues/201 + if LITTLE_ENDIAN: + ip = socket.inet_ntop(family, base64.b16decode(ip)[::-1]) + else: + ip = socket.inet_ntop(family, base64.b16decode(ip)) + else: # IPv6 + ip = base64.b16decode(ip) + try: + # see: https://github.com/giampaolo/psutil/issues/201 + if LITTLE_ENDIAN: + ip = socket.inet_ntop( + socket.AF_INET6, + struct.pack('>4I', *struct.unpack('<4I', ip)), + ) + else: + ip = socket.inet_ntop( + socket.AF_INET6, + struct.pack('<4I', *struct.unpack('<4I', ip)), + ) + except ValueError: + # see: https://github.com/giampaolo/psutil/issues/623 + if not supports_ipv6(): + raise _Ipv6UnsupportedError from None + raise + return ntp.addr(ip, port) + + @staticmethod + def process_inet(file, family, type_, inodes, filter_pid=None): + """Parse /proc/net/tcp* and /proc/net/udp* files.""" + if file.endswith('6') and not os.path.exists(file): + # IPv6 not supported + return + with open_text(file) as f: + f.readline() # skip the first line + for lineno, line in enumerate(f, 1): + try: + _, laddr, raddr, status, _, _, _, _, _, inode = ( + line.split()[:10] + ) + except ValueError: + msg = ( + f"error while parsing {file}; malformed line" + f" {lineno} {line!r}" + ) + raise RuntimeError(msg) from None + if inode in inodes: + # # We assume inet sockets are unique, so we error + # # out if there are multiple references to the + # # same inode. We won't do this for UNIX sockets. + # if len(inodes[inode]) > 1 and family != socket.AF_UNIX: + # raise ValueError("ambiguous inode with multiple " + # "PIDs references") + pid, fd = inodes[inode][0] + else: + pid, fd = None, -1 + if filter_pid is not None and filter_pid != pid: + continue + else: + if type_ == socket.SOCK_STREAM: + status = TCP_STATUSES[status] + else: + status = _common.CONN_NONE + try: + laddr = NetConnections.decode_address(laddr, family) + raddr = NetConnections.decode_address(raddr, family) + except _Ipv6UnsupportedError: + continue + yield (fd, family, type_, laddr, raddr, status, pid) + + @staticmethod + def process_unix(file, family, inodes, filter_pid=None): + """Parse /proc/net/unix files.""" + with open_text(file) as f: + f.readline() # skip the first line + for line in f: + tokens = line.split() + try: + _, _, _, _, type_, _, inode = tokens[0:7] + except ValueError: + if ' ' not in line: + # see: https://github.com/giampaolo/psutil/issues/766 + continue + msg = ( + f"error while parsing {file}; malformed line {line!r}" + ) + raise RuntimeError(msg) # noqa: B904 + if inode in inodes: # noqa: SIM108 + # With UNIX sockets we can have a single inode + # referencing many file descriptors. + pairs = inodes[inode] + else: + pairs = [(None, -1)] + for pid, fd in pairs: + if filter_pid is not None and filter_pid != pid: + continue + else: + path = tokens[-1] if len(tokens) == 8 else '' + type_ = _common.socktype_to_enum(int(type_)) + # XXX: determining the remote endpoint of a + # UNIX socket on Linux is not possible, see: + # https://serverfault.com/questions/252723/ + raddr = "" + status = _common.CONN_NONE + yield (fd, family, type_, path, raddr, status, pid) + + def retrieve(self, kind, pid=None): + self._procfs_path = get_procfs_path() + if pid is not None: + inodes = self.get_proc_inodes(pid) + if not inodes: + # no connections for this process + return [] + else: + inodes = self.get_all_inodes() + ret = set() + for proto_name, family, type_ in self.tmap[kind]: + path = f"{self._procfs_path}/net/{proto_name}" + if family in {socket.AF_INET, socket.AF_INET6}: + ls = self.process_inet( + path, family, type_, inodes, filter_pid=pid + ) + else: + ls = self.process_unix(path, family, inodes, filter_pid=pid) + for fd, family, type_, laddr, raddr, status, bound_pid in ls: + if pid: + conn = ntp.pconn(fd, family, type_, laddr, raddr, status) + else: + conn = ntp.sconn( + fd, family, type_, laddr, raddr, status, bound_pid + ) + ret.add(conn) + return list(ret) + + +_net_connections = NetConnections() + + +def net_connections(kind='inet'): + """Return system-wide open connections.""" + return _net_connections.retrieve(kind) + + +def net_io_counters(): + """Return network I/O statistics for every network interface + installed on the system as a dict of raw tuples. + """ + with open_text(f"{get_procfs_path()}/net/dev") as f: + lines = f.readlines() + retdict = {} + for line in lines[2:]: + colon = line.rfind(':') + assert colon > 0, repr(line) + name = line[:colon].strip() + fields = line[colon + 1 :].strip().split() + + ( + # in + bytes_recv, + packets_recv, + errin, + dropin, + _fifoin, # unused + _framein, # unused + _compressedin, # unused + _multicastin, # unused + # out + bytes_sent, + packets_sent, + errout, + dropout, + _fifoout, # unused + _collisionsout, # unused + _carrierout, # unused + _compressedout, # unused + ) = map(int, fields) + + retdict[name] = ( + bytes_sent, + bytes_recv, + packets_sent, + packets_recv, + errin, + errout, + dropin, + dropout, + ) + return retdict + + +def net_if_stats(): + """Get NIC stats (isup, duplex, speed, mtu).""" + duplex_map = { + cext.DUPLEX_FULL: NIC_DUPLEX_FULL, + cext.DUPLEX_HALF: NIC_DUPLEX_HALF, + cext.DUPLEX_UNKNOWN: NIC_DUPLEX_UNKNOWN, + } + names = net_io_counters().keys() + ret = {} + for name in names: + try: + mtu = cext.net_if_mtu(name) + flags = cext.net_if_flags(name) + duplex, speed = cext.net_if_duplex_speed(name) + except OSError as err: + # https://github.com/giampaolo/psutil/issues/1279 + if err.errno != errno.ENODEV: + raise + debug(err) + else: + output_flags = ','.join(flags) + isup = 'running' in flags + ret[name] = ntp.snicstats( + isup, duplex_map[duplex], speed, mtu, output_flags + ) + return ret + + +# ===================================================================== +# --- disks +# ===================================================================== + + +disk_usage = _psposix.disk_usage + + +def disk_io_counters(perdisk=False): + """Return disk I/O statistics for every disk installed on the + system as a dict of raw tuples. + """ + + def read_procfs(): + # OK, this is a bit confusing. The format of /proc/diskstats can + # have 3 variations. + # On Linux 2.4 each line has always 15 fields, e.g.: + # "3 0 8 hda 8 8 8 8 8 8 8 8 8 8 8" + # On Linux 2.6+ each line *usually* has 14 fields, and the disk + # name is in another position, like this: + # "3 0 hda 8 8 8 8 8 8 8 8 8 8 8" + # ...unless (Linux 2.6) the line refers to a partition instead + # of a disk, in which case the line has less fields (7): + # "3 1 hda1 8 8 8 8" + # 4.18+ has 4 fields added: + # "3 0 hda 8 8 8 8 8 8 8 8 8 8 8 0 0 0 0" + # 5.5 has 2 more fields. + # See: + # https://www.kernel.org/doc/Documentation/iostats.txt + # https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats + with open_text(f"{get_procfs_path()}/diskstats") as f: + lines = f.readlines() + for line in lines: + fields = line.split() + flen = len(fields) + # fmt: off + if flen == 15: + # Linux 2.4 + name = fields[3] + reads = int(fields[2]) + (reads_merged, rbytes, rtime, writes, writes_merged, + wbytes, wtime, _, busy_time, _) = map(int, fields[4:14]) + elif flen == 14 or flen >= 18: + # Linux 2.6+, line referring to a disk + name = fields[2] + (reads, reads_merged, rbytes, rtime, writes, writes_merged, + wbytes, wtime, _, busy_time, _) = map(int, fields[3:14]) + elif flen == 7: + # Linux 2.6+, line referring to a partition + name = fields[2] + reads, rbytes, writes, wbytes = map(int, fields[3:]) + rtime = wtime = reads_merged = writes_merged = busy_time = 0 + else: + msg = f"not sure how to interpret line {line!r}" + raise ValueError(msg) + yield (name, reads, writes, rbytes, wbytes, rtime, wtime, + reads_merged, writes_merged, busy_time) + # fmt: on + + def read_sysfs(): + for block in os.listdir('/sys/block'): + for root, _, files in os.walk(os.path.join('/sys/block', block)): + if 'stat' not in files: + continue + with open_text(os.path.join(root, 'stat')) as f: + fields = f.read().strip().split() + name = os.path.basename(root) + # fmt: off + (reads, reads_merged, rbytes, rtime, writes, writes_merged, + wbytes, wtime, _, busy_time) = map(int, fields[:10]) + yield (name, reads, writes, rbytes, wbytes, rtime, + wtime, reads_merged, writes_merged, busy_time) + # fmt: on + + if os.path.exists(f"{get_procfs_path()}/diskstats"): + gen = read_procfs() + elif os.path.exists('/sys/block'): + gen = read_sysfs() + else: + msg = ( + f"{get_procfs_path()}/diskstats nor /sys/block are available on" + " this system" + ) + raise NotImplementedError(msg) + + retdict = {} + for entry in gen: + # fmt: off + (name, reads, writes, rbytes, wbytes, rtime, wtime, reads_merged, + writes_merged, busy_time) = entry + if not perdisk and not is_storage_device(name): + # perdisk=False means we want to calculate totals so we skip + # partitions (e.g. 'sda1', 'nvme0n1p1') and only include + # base disk devices (e.g. 'sda', 'nvme0n1'). Base disks + # include a total of all their partitions + some extra size + # of their own: + # $ cat /proc/diskstats + # 259 0 sda 10485760 ... + # 259 1 sda1 5186039 ... + # 259 1 sda2 5082039 ... + # See: + # https://github.com/giampaolo/psutil/pull/1313 + continue + + rbytes *= DISK_SECTOR_SIZE + wbytes *= DISK_SECTOR_SIZE + retdict[name] = (reads, writes, rbytes, wbytes, rtime, wtime, + reads_merged, writes_merged, busy_time) + # fmt: on + + return retdict + + +class RootFsDeviceFinder: + """disk_partitions() may return partitions with device == "/dev/root" + or "rootfs". This container class uses different strategies to try to + obtain the real device path. Resources: + https://bootlin.com/blog/find-root-device/ + https://www.systutorials.com/how-to-find-the-disk-where-root-is-on-in-bash-on-linux/. + """ + + __slots__ = ['major', 'minor'] + + def __init__(self): + dev = os.stat("/").st_dev + self.major = os.major(dev) + self.minor = os.minor(dev) + + def ask_proc_partitions(self): + with open_text(f"{get_procfs_path()}/partitions") as f: + for line in f.readlines()[2:]: + fields = line.split() + if len(fields) < 4: # just for extra safety + continue + major = int(fields[0]) if fields[0].isdigit() else None + minor = int(fields[1]) if fields[1].isdigit() else None + name = fields[3] + if major == self.major and minor == self.minor: + if name: # just for extra safety + return f"/dev/{name}" + + def ask_sys_dev_block(self): + path = f"/sys/dev/block/{self.major}:{self.minor}/uevent" + with open_text(path) as f: + for line in f: + if line.startswith("DEVNAME="): + name = line.strip().rpartition("DEVNAME=")[2] + if name: # just for extra safety + return f"/dev/{name}" + + def ask_sys_class_block(self): + needle = f"{self.major}:{self.minor}" + files = glob.iglob("/sys/class/block/*/dev") + for file in files: + try: + f = open_text(file) + except FileNotFoundError: # race condition + continue + else: + with f: + data = f.read().strip() + if data == needle: + name = os.path.basename(os.path.dirname(file)) + return f"/dev/{name}" + + def find(self): + path = None + if path is None: + try: + path = self.ask_proc_partitions() + except OSError as err: + debug(err) + if path is None: + try: + path = self.ask_sys_dev_block() + except OSError as err: + debug(err) + if path is None: + try: + path = self.ask_sys_class_block() + except OSError as err: + debug(err) + # We use exists() because the "/dev/*" part of the path is hard + # coded, so we want to be sure. + if path is not None and os.path.exists(path): + return path + + +def disk_partitions(all=False): + """Return mounted disk partitions as a list of namedtuples.""" + fstypes = set() + procfs_path = get_procfs_path() + if not all: + with open_text(f"{procfs_path}/filesystems") as f: + for line in f: + line = line.strip() + if not line.startswith("nodev"): + fstypes.add(line.strip()) + else: + # ignore all lines starting with "nodev" except "nodev zfs" + fstype = line.split("\t")[1] + if fstype == "zfs": + fstypes.add("zfs") + + # See: https://github.com/giampaolo/psutil/issues/1307 + if procfs_path == "/proc" and os.path.isfile('/etc/mtab'): + mounts_path = os.path.realpath("/etc/mtab") + else: + mounts_path = os.path.realpath(f"{procfs_path}/self/mounts") + + retlist = [] + partitions = cext.disk_partitions(mounts_path) + for partition in partitions: + device, mountpoint, fstype, opts = partition + if device == 'none': + device = '' + if device in {"/dev/root", "rootfs"}: + device = RootFsDeviceFinder().find() or device + if not all: + if not device or fstype not in fstypes: + continue + ntuple = ntp.sdiskpart(device, mountpoint, fstype, opts) + retlist.append(ntuple) + + return retlist + + +# ===================================================================== +# --- sensors +# ===================================================================== + + +def sensors_temperatures(): + """Return hardware (CPU and others) temperatures as a dict + including hardware name, label, current, max and critical + temperatures. + + Implementation notes: + - /sys/class/hwmon looks like the most recent interface to + retrieve this info, and this implementation relies on it + only (old distros will probably use something else) + - lm-sensors on Ubuntu 16.04 relies on /sys/class/hwmon + - /sys/class/thermal/thermal_zone* is another one but it's more + difficult to parse + """ + ret = collections.defaultdict(list) + basenames = glob.glob('/sys/class/hwmon/hwmon*/temp*_*') + # CentOS has an intermediate /device directory: + # https://github.com/giampaolo/psutil/issues/971 + # https://github.com/nicolargo/glances/issues/1060 + basenames.extend(glob.glob('/sys/class/hwmon/hwmon*/device/temp*_*')) + basenames = sorted({x.split('_')[0] for x in basenames}) + + # Only add the coretemp hwmon entries if they're not already in + # /sys/class/hwmon/ + # https://github.com/giampaolo/psutil/issues/1708 + # https://github.com/giampaolo/psutil/pull/1648 + basenames2 = glob.glob( + '/sys/devices/platform/coretemp.*/hwmon/hwmon*/temp*_*' + ) + repl = re.compile(r"/sys/devices/platform/coretemp.*/hwmon/") + for name in basenames2: + altname = repl.sub('/sys/class/hwmon/', name) + if altname not in basenames: + basenames.append(name) + + for base in basenames: + try: + path = base + '_input' + current = float(bcat(path)) / 1000.0 + path = os.path.join(os.path.dirname(base), 'name') + unit_name = cat(path).strip() + except (OSError, ValueError): + # A lot of things can go wrong here, so let's just skip the + # whole entry. Sure thing is Linux's /sys/class/hwmon really + # is a stinky broken mess. + # https://github.com/giampaolo/psutil/issues/1009 + # https://github.com/giampaolo/psutil/issues/1101 + # https://github.com/giampaolo/psutil/issues/1129 + # https://github.com/giampaolo/psutil/issues/1245 + # https://github.com/giampaolo/psutil/issues/1323 + continue + + high = bcat(base + '_max', fallback=None) + critical = bcat(base + '_crit', fallback=None) + label = cat(base + '_label', fallback='').strip() + + if high is not None: + try: + high = float(high) / 1000.0 + except ValueError: + high = None + if critical is not None: + try: + critical = float(critical) / 1000.0 + except ValueError: + critical = None + + ret[unit_name].append((label, current, high, critical)) + + # Indication that no sensors were detected in /sys/class/hwmon/ + if not basenames: + basenames = glob.glob('/sys/class/thermal/thermal_zone*') + basenames = sorted(set(basenames)) + + for base in basenames: + try: + path = os.path.join(base, 'temp') + current = float(bcat(path)) / 1000.0 + path = os.path.join(base, 'type') + unit_name = cat(path).strip() + except (OSError, ValueError) as err: + debug(err) + continue + + trip_paths = glob.glob(base + '/trip_point*') + trip_points = { + '_'.join(os.path.basename(p).split('_')[0:3]) + for p in trip_paths + } + critical = None + high = None + for trip_point in trip_points: + path = os.path.join(base, trip_point + "_type") + trip_type = cat(path, fallback='').strip() + if trip_type == 'critical': + critical = bcat( + os.path.join(base, trip_point + "_temp"), fallback=None + ) + elif trip_type == 'high': + high = bcat( + os.path.join(base, trip_point + "_temp"), fallback=None + ) + + if high is not None: + try: + high = float(high) / 1000.0 + except ValueError: + high = None + if critical is not None: + try: + critical = float(critical) / 1000.0 + except ValueError: + critical = None + + ret[unit_name].append(('', current, high, critical)) + + return dict(ret) + + +def sensors_fans(): + """Return hardware fans info (for CPU and other peripherals) as a + dict including hardware label and current speed. + + Implementation notes: + - /sys/class/hwmon looks like the most recent interface to + retrieve this info, and this implementation relies on it + only (old distros will probably use something else) + - lm-sensors on Ubuntu 16.04 relies on /sys/class/hwmon + """ + ret = collections.defaultdict(list) + basenames = glob.glob('/sys/class/hwmon/hwmon*/fan*_*') + if not basenames: + # CentOS has an intermediate /device directory: + # https://github.com/giampaolo/psutil/issues/971 + basenames = glob.glob('/sys/class/hwmon/hwmon*/device/fan*_*') + + basenames = sorted({x.split("_")[0] for x in basenames}) + for base in basenames: + try: + current = int(bcat(base + '_input')) + except OSError as err: + debug(err) + continue + unit_name = cat(os.path.join(os.path.dirname(base), 'name')).strip() + label = cat(base + '_label', fallback='').strip() + ret[unit_name].append(ntp.sfan(label, current)) + + return dict(ret) + + +def sensors_battery(): + """Return battery information. + Implementation note: it appears /sys/class/power_supply/BAT0/ + directory structure may vary and provide files with the same + meaning but under different names, see: + https://github.com/giampaolo/psutil/issues/966. + """ + null = object() + + def multi_bcat(*paths): + """Attempt to read the content of multiple files which may + not exist. If none of them exist return None. + """ + for path in paths: + ret = bcat(path, fallback=null) + if ret != null: + try: + return int(ret) + except ValueError: + return ret.strip() + return None + + bats = [ + x + for x in os.listdir(POWER_SUPPLY_PATH) + if x.startswith('BAT') or 'battery' in x.lower() + ] + if not bats: + return None + # Get the first available battery. Usually this is "BAT0", except + # some rare exceptions: + # https://github.com/giampaolo/psutil/issues/1238 + root = os.path.join(POWER_SUPPLY_PATH, min(bats)) + + # Base metrics. + energy_now = multi_bcat(root + "/energy_now", root + "/charge_now") + power_now = multi_bcat(root + "/power_now", root + "/current_now") + energy_full = multi_bcat(root + "/energy_full", root + "/charge_full") + time_to_empty = multi_bcat(root + "/time_to_empty_now") + + # Percent. If we have energy_full the percentage will be more + # accurate compared to reading /capacity file (float vs. int). + if energy_full is not None and energy_now is not None: + try: + percent = 100.0 * energy_now / energy_full + except ZeroDivisionError: + percent = 0.0 + else: + percent = int(cat(root + "/capacity", fallback=-1)) + if percent == -1: + return None + + # Is AC power cable plugged in? + # Note: AC0 is not always available and sometimes (e.g. CentOS7) + # it's called "AC". + power_plugged = None + online = multi_bcat( + os.path.join(POWER_SUPPLY_PATH, "AC0/online"), + os.path.join(POWER_SUPPLY_PATH, "AC/online"), + ) + if online is not None: + power_plugged = online == 1 + else: + status = cat(root + "/status", fallback="").strip().lower() + if status == "discharging": + power_plugged = False + elif status in {"charging", "full"}: + power_plugged = True + + # Seconds left. + # Note to self: we may also calculate the charging ETA as per: + # https://github.com/thialfihar/dotfiles/blob/ + # 013937745fd9050c30146290e8f963d65c0179e6/bin/battery.py#L55 + if power_plugged: + secsleft = _common.POWER_TIME_UNLIMITED + elif energy_now is not None and power_now is not None: + try: + secsleft = int(energy_now / abs(power_now) * 3600) + except ZeroDivisionError: + secsleft = _common.POWER_TIME_UNKNOWN + elif time_to_empty is not None: + secsleft = int(time_to_empty * 60) + if secsleft < 0: + secsleft = _common.POWER_TIME_UNKNOWN + else: + secsleft = _common.POWER_TIME_UNKNOWN + + return ntp.sbattery(percent, secsleft, power_plugged) + + +# ===================================================================== +# --- other system functions +# ===================================================================== + + +def users(): + """Return currently connected users as a list of namedtuples.""" + retlist = [] + rawlist = cext.users() + for item in rawlist: + user, tty, hostname, tstamp, pid = item + nt = ntp.suser(user, tty or None, hostname, tstamp, pid) + retlist.append(nt) + return retlist + + +def boot_time(): + """Return the system boot time expressed in seconds since the epoch.""" + path = f"{get_procfs_path()}/stat" + with open_binary(path) as f: + for line in f: + if line.startswith(b'btime'): + return float(line.strip().split()[1]) + msg = f"line 'btime' not found in {path}" + raise RuntimeError(msg) + + +# ===================================================================== +# --- processes +# ===================================================================== + + +def pids(): + """Returns a list of PIDs currently running on the system.""" + path = get_procfs_path().encode(ENCODING) + return [int(x) for x in os.listdir(path) if x.isdigit()] + + +def pid_exists(pid): + """Check for the existence of a unix PID. Linux TIDs are not + supported (always return False). + """ + if not _psposix.pid_exists(pid): + return False + else: + # Linux's apparently does not distinguish between PIDs and TIDs + # (thread IDs). + # listdir("/proc") won't show any TID (only PIDs) but + # os.stat("/proc/{tid}") will succeed if {tid} exists. + # os.kill() can also be passed a TID. This is quite confusing. + # In here we want to enforce this distinction and support PIDs + # only, see: + # https://github.com/giampaolo/psutil/issues/687 + try: + # Note: already checked that this is faster than using a + # regular expr. Also (a lot) faster than doing + # 'return pid in pids()' + path = f"{get_procfs_path()}/{pid}/status" + with open_binary(path) as f: + for line in f: + if line.startswith(b"Tgid:"): + tgid = int(line.split()[1]) + # If tgid and pid are the same then we're + # dealing with a process PID. + return tgid == pid + msg = f"'Tgid' line not found in {path}" + raise ValueError(msg) + except (OSError, ValueError): + return pid in pids() + + +def ppid_map(): + """Obtain a {pid: ppid, ...} dict for all running processes in + one shot. Used to speed up Process.children(). + """ + ret = {} + procfs_path = get_procfs_path() + for pid in pids(): + try: + with open_binary(f"{procfs_path}/{pid}/stat") as f: + data = f.read() + except (FileNotFoundError, ProcessLookupError): + pass + except PermissionError as err: + raise AccessDenied(pid) from err + else: + rpar = data.rfind(b')') + dset = data[rpar + 2 :].split() + ppid = int(dset[1]) + ret[pid] = ppid + return ret + + +def wrap_exceptions(fun): + """Decorator which translates bare OSError exceptions into + NoSuchProcess and AccessDenied. + """ + + @functools.wraps(fun) + def wrapper(self, *args, **kwargs): + pid, name = self.pid, self._name + try: + return fun(self, *args, **kwargs) + except PermissionError as err: + raise AccessDenied(pid, name) from err + except ProcessLookupError as err: + self._raise_if_zombie() + raise NoSuchProcess(pid, name) from err + except FileNotFoundError as err: + self._raise_if_zombie() + # /proc/PID directory may still exist, but the files within + # it may not, indicating the process is gone, see: + # https://github.com/giampaolo/psutil/issues/2418 + if not os.path.exists(f"{self._procfs_path}/{pid}/stat"): + raise NoSuchProcess(pid, name) from err + raise + + return wrapper + + +class Process: + """Linux process implementation.""" + + __slots__ = [ + "_cache", + "_ctime", + "_name", + "_ppid", + "_procfs_path", + "pid", + ] + + def __init__(self, pid): + self.pid = pid + self._name = None + self._ppid = None + self._ctime = None + self._procfs_path = get_procfs_path() + + def _is_zombie(self): + # Note: most of the times Linux is able to return info about the + # process even if it's a zombie, and /proc/{pid} will exist. + # There are some exceptions though, like exe(), cmdline() and + # memory_maps(). In these cases /proc/{pid}/{file} exists but + # it's empty. Instead of returning a "null" value we'll raise an + # exception. + try: + data = bcat(f"{self._procfs_path}/{self.pid}/stat") + except OSError: + return False + else: + rpar = data.rfind(b')') + status = data[rpar + 2 : rpar + 3] + return status == b"Z" + + def _raise_if_zombie(self): + if self._is_zombie(): + raise ZombieProcess(self.pid, self._name, self._ppid) + + def _raise_if_not_alive(self): + """Raise NSP if the process disappeared on us.""" + # For those C function who do not raise NSP, possibly returning + # incorrect or incomplete result. + os.stat(f"{self._procfs_path}/{self.pid}") + + def _readlink(self, path, fallback=UNSET): + # * https://github.com/giampaolo/psutil/issues/503 + # os.readlink('/proc/pid/exe') may raise ESRCH (ProcessLookupError) + # instead of ENOENT (FileNotFoundError) when it races. + # * ENOENT may occur also if the path actually exists if PID is + # a low PID (~0-20 range). + # * https://github.com/giampaolo/psutil/issues/2514 + try: + return readlink(path) + except (FileNotFoundError, ProcessLookupError): + if os.path.lexists(f"{self._procfs_path}/{self.pid}"): + self._raise_if_zombie() + if fallback is not UNSET: + return fallback + raise + + @wrap_exceptions + @memoize_when_activated + def _parse_stat_file(self): + """Parse /proc/{pid}/stat file and return a dict with various + process info. + Using "man proc" as a reference: where "man proc" refers to + position N always subtract 3 (e.g ppid position 4 in + 'man proc' == position 1 in here). + The return value is cached in case oneshot() ctx manager is + in use. + """ + data = bcat(f"{self._procfs_path}/{self.pid}/stat") + # Process name is between parentheses. It can contain spaces and + # other parentheses. This is taken into account by looking for + # the first occurrence of "(" and the last occurrence of ")". + rpar = data.rfind(b')') + name = data[data.find(b'(') + 1 : rpar] + fields = data[rpar + 2 :].split() + + ret = {} + ret['name'] = name + ret['status'] = fields[0] + ret['ppid'] = fields[1] + ret['ttynr'] = fields[4] + ret['utime'] = fields[11] + ret['stime'] = fields[12] + ret['children_utime'] = fields[13] + ret['children_stime'] = fields[14] + ret['create_time'] = fields[19] + ret['cpu_num'] = fields[36] + try: + ret['blkio_ticks'] = fields[39] # aka 'delayacct_blkio_ticks' + except IndexError: + # https://github.com/giampaolo/psutil/issues/2455 + debug("can't get blkio_ticks, set iowait to 0") + ret['blkio_ticks'] = 0 + + return ret + + @wrap_exceptions + @memoize_when_activated + def _read_status_file(self): + """Read /proc/{pid}/stat file and return its content. + The return value is cached in case oneshot() ctx manager is + in use. + """ + with open_binary(f"{self._procfs_path}/{self.pid}/status") as f: + return f.read() + + @wrap_exceptions + @memoize_when_activated + def _read_smaps_file(self): + with open_binary(f"{self._procfs_path}/{self.pid}/smaps") as f: + return f.read().strip() + + def oneshot_enter(self): + self._parse_stat_file.cache_activate(self) + self._read_status_file.cache_activate(self) + self._read_smaps_file.cache_activate(self) + + def oneshot_exit(self): + self._parse_stat_file.cache_deactivate(self) + self._read_status_file.cache_deactivate(self) + self._read_smaps_file.cache_deactivate(self) + + @wrap_exceptions + def name(self): + # XXX - gets changed later and probably needs refactoring + return decode(self._parse_stat_file()['name']) + + @wrap_exceptions + def exe(self): + return self._readlink( + f"{self._procfs_path}/{self.pid}/exe", fallback="" + ) + + @wrap_exceptions + def cmdline(self): + with open_text(f"{self._procfs_path}/{self.pid}/cmdline") as f: + data = f.read() + if not data: + # may happen in case of zombie process + self._raise_if_zombie() + return [] + # 'man proc' states that args are separated by null bytes '\0' + # and last char is supposed to be a null byte. Nevertheless + # some processes may change their cmdline after being started + # (via setproctitle() or similar), they are usually not + # compliant with this rule and use spaces instead. Google + # Chrome process is an example. See: + # https://github.com/giampaolo/psutil/issues/1179 + sep = '\x00' if data.endswith('\x00') else ' ' + if data.endswith(sep): + data = data[:-1] + cmdline = data.split(sep) + # Sometimes last char is a null byte '\0' but the args are + # separated by spaces, see: https://github.com/giampaolo/psutil/ + # issues/1179#issuecomment-552984549 + if sep == '\x00' and len(cmdline) == 1 and ' ' in data: + cmdline = data.split(' ') + return cmdline + + @wrap_exceptions + def environ(self): + with open_text(f"{self._procfs_path}/{self.pid}/environ") as f: + data = f.read() + return parse_environ_block(data) + + @wrap_exceptions + def terminal(self): + tty_nr = int(self._parse_stat_file()['ttynr']) + tmap = _psposix.get_terminal_map() + try: + return tmap[tty_nr] + except KeyError: + return None + + # May not be available on old kernels. + if os.path.exists(f"/proc/{os.getpid()}/io"): + + @wrap_exceptions + def io_counters(self): + fname = f"{self._procfs_path}/{self.pid}/io" + fields = {} + with open_binary(fname) as f: + for line in f: + # https://github.com/giampaolo/psutil/issues/1004 + line = line.strip() + if line: + try: + name, value = line.split(b': ') + except ValueError: + # https://github.com/giampaolo/psutil/issues/1004 + continue + else: + fields[name] = int(value) + if not fields: + msg = f"{fname} file was empty" + raise RuntimeError(msg) + try: + return ntp.pio( + fields[b'syscr'], # read syscalls + fields[b'syscw'], # write syscalls + fields[b'read_bytes'], # read bytes + fields[b'write_bytes'], # write bytes + fields[b'rchar'], # read chars + fields[b'wchar'], # write chars + ) + except KeyError as err: + msg = ( + f"{err.args[0]!r} field was not found in {fname}; found" + f" fields are {fields!r}" + ) + raise ValueError(msg) from None + + @wrap_exceptions + def cpu_times(self): + values = self._parse_stat_file() + utime = float(values['utime']) / CLOCK_TICKS + stime = float(values['stime']) / CLOCK_TICKS + children_utime = float(values['children_utime']) / CLOCK_TICKS + children_stime = float(values['children_stime']) / CLOCK_TICKS + iowait = float(values['blkio_ticks']) / CLOCK_TICKS + return ntp.pcputimes( + utime, stime, children_utime, children_stime, iowait + ) + + @wrap_exceptions + def cpu_num(self): + """What CPU the process is on.""" + return int(self._parse_stat_file()['cpu_num']) + + @wrap_exceptions + def wait(self, timeout=None): + return _psposix.wait_pid(self.pid, timeout) + + @wrap_exceptions + def create_time(self, monotonic=False): + # The 'starttime' field in /proc/[pid]/stat is expressed in + # jiffies (clock ticks per second), a relative value which + # represents the number of clock ticks that have passed since + # the system booted until the process was created. It never + # changes and is unaffected by system clock updates. + if self._ctime is None: + self._ctime = ( + float(self._parse_stat_file()['create_time']) / CLOCK_TICKS + ) + if monotonic: + return self._ctime + # Add the boot time, returning time expressed in seconds since + # the epoch. This is subject to system clock updates. + return self._ctime + boot_time() + + @wrap_exceptions + def memory_info(self): + # ============================================================ + # | FIELD | DESCRIPTION | AKA | TOP | + # ============================================================ + # | rss | resident set size | | RES | + # | vms | total program size | size | VIRT | + # | shared | shared pages (from shared mappings) | | SHR | + # | text | text ('code') | trs | CODE | + # | lib | library (unused in Linux 2.6) | lrs | | + # | data | data + stack | drs | DATA | + # | dirty | dirty pages (unused in Linux 2.6) | dt | | + # ============================================================ + with open_binary(f"{self._procfs_path}/{self.pid}/statm") as f: + vms, rss, shared, text, lib, data, dirty = ( + int(x) * PAGESIZE for x in f.readline().split()[:7] + ) + return ntp.pmem(rss, vms, shared, text, lib, data, dirty) + + if HAS_PROC_SMAPS_ROLLUP or HAS_PROC_SMAPS: + + def _parse_smaps_rollup(self): + # /proc/pid/smaps_rollup was added to Linux in 2017. Faster + # than /proc/pid/smaps. It reports higher PSS than */smaps + # (from 1k up to 200k higher; tested against all processes). + # IMPORTANT: /proc/pid/smaps_rollup is weird, because it + # raises ESRCH / ENOENT for many PIDs, even if they're alive + # (also as root). In that case we'll use /proc/pid/smaps as + # fallback, which is slower but has a +50% success rate + # compared to /proc/pid/smaps_rollup. + uss = pss = swap = 0 + with open_binary( + f"{self._procfs_path}/{self.pid}/smaps_rollup" + ) as f: + for line in f: + if line.startswith(b"Private_"): + # Private_Clean, Private_Dirty, Private_Hugetlb + uss += int(line.split()[1]) * 1024 + elif line.startswith(b"Pss:"): + pss = int(line.split()[1]) * 1024 + elif line.startswith(b"Swap:"): + swap = int(line.split()[1]) * 1024 + return (uss, pss, swap) + + @wrap_exceptions + def _parse_smaps( + self, + # Gets Private_Clean, Private_Dirty, Private_Hugetlb. + _private_re=re.compile(br"\nPrivate.*:\s+(\d+)"), + _pss_re=re.compile(br"\nPss\:\s+(\d+)"), + _swap_re=re.compile(br"\nSwap\:\s+(\d+)"), + ): + # /proc/pid/smaps does not exist on kernels < 2.6.14 or if + # CONFIG_MMU kernel configuration option is not enabled. + + # Note: using 3 regexes is faster than reading the file + # line by line. + # + # You might be tempted to calculate USS by subtracting + # the "shared" value from the "resident" value in + # /proc//statm. But at least on Linux, statm's "shared" + # value actually counts pages backed by files, which has + # little to do with whether the pages are actually shared. + # /proc/self/smaps on the other hand appears to give us the + # correct information. + smaps_data = self._read_smaps_file() + # Note: smaps file can be empty for certain processes. + # The code below will not crash though and will result to 0. + uss = sum(map(int, _private_re.findall(smaps_data))) * 1024 + pss = sum(map(int, _pss_re.findall(smaps_data))) * 1024 + swap = sum(map(int, _swap_re.findall(smaps_data))) * 1024 + return (uss, pss, swap) + + @wrap_exceptions + def memory_full_info(self): + if HAS_PROC_SMAPS_ROLLUP: # faster + try: + uss, pss, swap = self._parse_smaps_rollup() + except (ProcessLookupError, FileNotFoundError): + uss, pss, swap = self._parse_smaps() + else: + uss, pss, swap = self._parse_smaps() + basic_mem = self.memory_info() + return ntp.pfullmem(*basic_mem + (uss, pss, swap)) + + else: + memory_full_info = memory_info + + if HAS_PROC_SMAPS: + + @wrap_exceptions + def memory_maps(self): + """Return process's mapped memory regions as a list of named + tuples. Fields are explained in 'man proc'; here is an updated + (Apr 2012) version: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/proc.txt?id=b76437579d1344b612cf1851ae610c636cec7db0. + + /proc/{PID}/smaps does not exist on kernels < 2.6.14 or if + CONFIG_MMU kernel configuration option is not enabled. + """ + + def get_blocks(lines, current_block): + data = {} + for line in lines: + fields = line.split(None, 5) + if not fields[0].endswith(b':'): + # new block section + yield (current_block.pop(), data) + current_block.append(line) + else: + try: + data[fields[0]] = int(fields[1]) * 1024 + except (ValueError, IndexError): + if fields[0].startswith(b'VmFlags:'): + # see issue #369 + continue + msg = f"don't know how to interpret line {line!r}" + raise ValueError(msg) from None + yield (current_block.pop(), data) + + data = self._read_smaps_file() + # Note: smaps file can be empty for certain processes or for + # zombies. + if not data: + self._raise_if_zombie() + return [] + lines = data.split(b'\n') + ls = [] + first_line = lines.pop(0) + current_block = [first_line] + for header, data in get_blocks(lines, current_block): + hfields = header.split(None, 5) + try: + addr, perms, _offset, _dev, _inode, path = hfields + except ValueError: + addr, perms, _offset, _dev, _inode, path = hfields + [''] + if not path: + path = '[anon]' + else: + path = decode(path) + path = path.strip() + if path.endswith(' (deleted)') and not path_exists_strict( + path + ): + path = path[:-10] + item = ( + decode(addr), + decode(perms), + path, + data.get(b'Rss:', 0), + data.get(b'Size:', 0), + data.get(b'Pss:', 0), + data.get(b'Shared_Clean:', 0), + data.get(b'Shared_Dirty:', 0), + data.get(b'Private_Clean:', 0), + data.get(b'Private_Dirty:', 0), + data.get(b'Referenced:', 0), + data.get(b'Anonymous:', 0), + data.get(b'Swap:', 0), + ) + ls.append(item) + return ls + + @wrap_exceptions + def cwd(self): + return self._readlink( + f"{self._procfs_path}/{self.pid}/cwd", fallback="" + ) + + @wrap_exceptions + def num_ctx_switches( + self, _ctxsw_re=re.compile(br'ctxt_switches:\t(\d+)') + ): + data = self._read_status_file() + ctxsw = _ctxsw_re.findall(data) + if not ctxsw: + msg = ( + "'voluntary_ctxt_switches' and" + " 'nonvoluntary_ctxt_switches'lines were not found in" + f" {self._procfs_path}/{self.pid}/status; the kernel is" + " probably older than 2.6.23" + ) + raise NotImplementedError(msg) + return ntp.pctxsw(int(ctxsw[0]), int(ctxsw[1])) + + @wrap_exceptions + def num_threads(self, _num_threads_re=re.compile(br'Threads:\t(\d+)')): + # Using a re is faster than iterating over file line by line. + data = self._read_status_file() + return int(_num_threads_re.findall(data)[0]) + + @wrap_exceptions + def threads(self): + thread_ids = os.listdir(f"{self._procfs_path}/{self.pid}/task") + thread_ids.sort() + retlist = [] + hit_enoent = False + for thread_id in thread_ids: + fname = f"{self._procfs_path}/{self.pid}/task/{thread_id}/stat" + try: + with open_binary(fname) as f: + st = f.read().strip() + except (FileNotFoundError, ProcessLookupError): + # no such file or directory or no such process; + # it means thread disappeared on us + hit_enoent = True + continue + # ignore the first two values ("pid (exe)") + st = st[st.find(b')') + 2 :] + values = st.split(b' ') + utime = float(values[11]) / CLOCK_TICKS + stime = float(values[12]) / CLOCK_TICKS + ntuple = ntp.pthread(int(thread_id), utime, stime) + retlist.append(ntuple) + if hit_enoent: + self._raise_if_not_alive() + return retlist + + @wrap_exceptions + def nice_get(self): + # with open_text(f"{self._procfs_path}/{self.pid}/stat") as f: + # data = f.read() + # return int(data.split()[18]) + + # Use C implementation + return cext.proc_priority_get(self.pid) + + @wrap_exceptions + def nice_set(self, value): + return cext.proc_priority_set(self.pid, value) + + # starting from CentOS 6. + if HAS_CPU_AFFINITY: + + @wrap_exceptions + def cpu_affinity_get(self): + return cext.proc_cpu_affinity_get(self.pid) + + def _get_eligible_cpus( + self, _re=re.compile(br"Cpus_allowed_list:\t(\d+)-(\d+)") + ): + # See: https://github.com/giampaolo/psutil/issues/956 + data = self._read_status_file() + match = _re.findall(data) + if match: + return list(range(int(match[0][0]), int(match[0][1]) + 1)) + else: + return list(range(len(per_cpu_times()))) + + @wrap_exceptions + def cpu_affinity_set(self, cpus): + try: + cext.proc_cpu_affinity_set(self.pid, cpus) + except (OSError, ValueError) as err: + if isinstance(err, ValueError) or err.errno == errno.EINVAL: + eligible_cpus = self._get_eligible_cpus() + all_cpus = tuple(range(len(per_cpu_times()))) + for cpu in cpus: + if cpu not in all_cpus: + msg = ( + f"invalid CPU {cpu!r}; choose between" + f" {eligible_cpus!r}" + ) + raise ValueError(msg) from None + if cpu not in eligible_cpus: + msg = ( + f"CPU number {cpu} is not eligible; choose" + f" between {eligible_cpus}" + ) + raise ValueError(msg) from err + raise + + # only starting from kernel 2.6.13 + if HAS_PROC_IO_PRIORITY: + + @wrap_exceptions + def ionice_get(self): + ioclass, value = cext.proc_ioprio_get(self.pid) + ioclass = IOPriority(ioclass) + return ntp.pionice(ioclass, value) + + @wrap_exceptions + def ionice_set(self, ioclass, value): + if value is None: + value = 0 + if value and ioclass in { + IOPriority.IOPRIO_CLASS_IDLE, + IOPriority.IOPRIO_CLASS_NONE, + }: + msg = f"{ioclass!r} ioclass accepts no value" + raise ValueError(msg) + if value < 0 or value > 7: + msg = "value not in 0-7 range" + raise ValueError(msg) + return cext.proc_ioprio_set(self.pid, ioclass, value) + + if hasattr(resource, "prlimit"): + + @wrap_exceptions + def rlimit(self, resource_, limits=None): + # If pid is 0 prlimit() applies to the calling process and + # we don't want that. We should never get here though as + # PID 0 is not supported on Linux. + if self.pid == 0: + msg = "can't use prlimit() against PID 0 process" + raise ValueError(msg) + try: + if limits is None: + # get + return resource.prlimit(self.pid, resource_) + else: + # set + if len(limits) != 2: + msg = ( + "second argument must be a (soft, hard) " + f"tuple, got {limits!r}" + ) + raise ValueError(msg) + resource.prlimit(self.pid, resource_, limits) + except OSError as err: + if err.errno == errno.ENOSYS: + # I saw this happening on Travis: + # https://travis-ci.org/giampaolo/psutil/jobs/51368273 + self._raise_if_zombie() + raise + + @wrap_exceptions + def status(self): + letter = self._parse_stat_file()['status'] + letter = letter.decode() + # XXX is '?' legit? (we're not supposed to return it anyway) + return PROC_STATUSES.get(letter, '?') + + @wrap_exceptions + def open_files(self): + retlist = [] + files = os.listdir(f"{self._procfs_path}/{self.pid}/fd") + hit_enoent = False + for fd in files: + file = f"{self._procfs_path}/{self.pid}/fd/{fd}" + try: + path = readlink(file) + except (FileNotFoundError, ProcessLookupError): + # ENOENT == file which is gone in the meantime + hit_enoent = True + continue + except OSError as err: + if err.errno == errno.EINVAL: + # not a link + continue + if err.errno == errno.ENAMETOOLONG: + # file name too long + debug(err) + continue + raise + else: + # If path is not an absolute there's no way to tell + # whether it's a regular file or not, so we skip it. + # A regular file is always supposed to be have an + # absolute path though. + if path.startswith('/') and isfile_strict(path): + # Get file position and flags. + file = f"{self._procfs_path}/{self.pid}/fdinfo/{fd}" + try: + with open_binary(file) as f: + pos = int(f.readline().split()[1]) + flags = int(f.readline().split()[1], 8) + except (FileNotFoundError, ProcessLookupError): + # fd gone in the meantime; process may + # still be alive + hit_enoent = True + else: + mode = file_flags_to_mode(flags) + ntuple = ntp.popenfile( + path, int(fd), int(pos), mode, flags + ) + retlist.append(ntuple) + if hit_enoent: + self._raise_if_not_alive() + return retlist + + @wrap_exceptions + def net_connections(self, kind='inet'): + ret = _net_connections.retrieve(kind, self.pid) + self._raise_if_not_alive() + return ret + + @wrap_exceptions + def num_fds(self): + return len(os.listdir(f"{self._procfs_path}/{self.pid}/fd")) + + @wrap_exceptions + def ppid(self): + return int(self._parse_stat_file()['ppid']) + + @wrap_exceptions + def uids(self, _uids_re=re.compile(br'Uid:\t(\d+)\t(\d+)\t(\d+)')): + data = self._read_status_file() + real, effective, saved = _uids_re.findall(data)[0] + return ntp.puids(int(real), int(effective), int(saved)) + + @wrap_exceptions + def gids(self, _gids_re=re.compile(br'Gid:\t(\d+)\t(\d+)\t(\d+)')): + data = self._read_status_file() + real, effective, saved = _gids_re.findall(data)[0] + return ntp.pgids(int(real), int(effective), int(saved)) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_psosx.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_psosx.py new file mode 100644 index 0000000000000000000000000000000000000000..b14d5e023bec1f9cb5cb06b4caf7170489f3d4c7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_psosx.py @@ -0,0 +1,549 @@ +# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""macOS platform implementation.""" + +import errno +import functools +import os + +from . import _common +from . import _ntuples as ntp +from . import _psposix +from . import _psutil_osx as cext +from ._common import AccessDenied +from ._common import NoSuchProcess +from ._common import ZombieProcess +from ._common import conn_tmap +from ._common import conn_to_ntuple +from ._common import debug +from ._common import isfile_strict +from ._common import memoize_when_activated +from ._common import parse_environ_block +from ._common import usage_percent + +__extra__all__ = [] + + +# ===================================================================== +# --- globals +# ===================================================================== + + +PAGESIZE = cext.getpagesize() +AF_LINK = cext.AF_LINK + +TCP_STATUSES = { + cext.TCPS_ESTABLISHED: _common.CONN_ESTABLISHED, + cext.TCPS_SYN_SENT: _common.CONN_SYN_SENT, + cext.TCPS_SYN_RECEIVED: _common.CONN_SYN_RECV, + cext.TCPS_FIN_WAIT_1: _common.CONN_FIN_WAIT1, + cext.TCPS_FIN_WAIT_2: _common.CONN_FIN_WAIT2, + cext.TCPS_TIME_WAIT: _common.CONN_TIME_WAIT, + cext.TCPS_CLOSED: _common.CONN_CLOSE, + cext.TCPS_CLOSE_WAIT: _common.CONN_CLOSE_WAIT, + cext.TCPS_LAST_ACK: _common.CONN_LAST_ACK, + cext.TCPS_LISTEN: _common.CONN_LISTEN, + cext.TCPS_CLOSING: _common.CONN_CLOSING, + cext.PSUTIL_CONN_NONE: _common.CONN_NONE, +} + +PROC_STATUSES = { + cext.SIDL: _common.STATUS_IDLE, + cext.SRUN: _common.STATUS_RUNNING, + cext.SSLEEP: _common.STATUS_SLEEPING, + cext.SSTOP: _common.STATUS_STOPPED, + cext.SZOMB: _common.STATUS_ZOMBIE, +} + +kinfo_proc_map = dict( + ppid=0, + ruid=1, + euid=2, + suid=3, + rgid=4, + egid=5, + sgid=6, + ttynr=7, + ctime=8, + status=9, + name=10, +) + +pidtaskinfo_map = dict( + cpuutime=0, + cpustime=1, + rss=2, + vms=3, + pfaults=4, + pageins=5, + numthreads=6, + volctxsw=7, +) + + +# ===================================================================== +# --- memory +# ===================================================================== + + +def virtual_memory(): + """System virtual memory as a namedtuple.""" + total, active, inactive, wired, free, speculative = cext.virtual_mem() + # This is how Zabbix calculate avail and used mem: + # https://github.com/zabbix/zabbix/blob/master/src/libs/zbxsysinfo/osx/memory.c + # Also see: https://github.com/giampaolo/psutil/issues/1277 + avail = inactive + free + used = active + wired + # This is NOT how Zabbix calculates free mem but it matches "free" + # cmdline utility. + free -= speculative + percent = usage_percent((total - avail), total, round_=1) + return ntp.svmem( + total, avail, percent, used, free, active, inactive, wired + ) + + +def swap_memory(): + """Swap system memory as a (total, used, free, sin, sout) tuple.""" + total, used, free, sin, sout = cext.swap_mem() + percent = usage_percent(used, total, round_=1) + return ntp.sswap(total, used, free, percent, sin, sout) + + +# malloc / heap functions +heap_info = cext.heap_info +heap_trim = cext.heap_trim + + +# ===================================================================== +# --- CPU +# ===================================================================== + + +def cpu_times(): + """Return system CPU times as a namedtuple.""" + user, nice, system, idle = cext.cpu_times() + return ntp.scputimes(user, nice, system, idle) + + +def per_cpu_times(): + """Return system CPU times as a named tuple.""" + ret = [] + for cpu_t in cext.per_cpu_times(): + user, nice, system, idle = cpu_t + item = ntp.scputimes(user, nice, system, idle) + ret.append(item) + return ret + + +def cpu_count_logical(): + """Return the number of logical CPUs in the system.""" + return cext.cpu_count_logical() + + +def cpu_count_cores(): + """Return the number of CPU cores in the system.""" + return cext.cpu_count_cores() + + +def cpu_stats(): + ctx_switches, interrupts, soft_interrupts, syscalls, _traps = ( + cext.cpu_stats() + ) + return ntp.scpustats(ctx_switches, interrupts, soft_interrupts, syscalls) + + +if cext.has_cpu_freq(): # not always available on ARM64 + + def cpu_freq(): + """Return CPU frequency. + On macOS per-cpu frequency is not supported. + Also, the returned frequency never changes, see: + https://arstechnica.com/civis/viewtopic.php?f=19&t=465002. + """ + curr, min_, max_ = cext.cpu_freq() + return [ntp.scpufreq(curr, min_, max_)] + + +# ===================================================================== +# --- disks +# ===================================================================== + + +disk_usage = _psposix.disk_usage +disk_io_counters = cext.disk_io_counters + + +def disk_partitions(all=False): + """Return mounted disk partitions as a list of namedtuples.""" + retlist = [] + partitions = cext.disk_partitions() + for partition in partitions: + device, mountpoint, fstype, opts = partition + if device == 'none': + device = '' + if not all: + if not os.path.isabs(device) or not os.path.exists(device): + continue + ntuple = ntp.sdiskpart(device, mountpoint, fstype, opts) + retlist.append(ntuple) + return retlist + + +# ===================================================================== +# --- sensors +# ===================================================================== + + +def sensors_battery(): + """Return battery information.""" + try: + percent, minsleft, power_plugged = cext.sensors_battery() + except NotImplementedError: + # no power source - return None according to interface + return None + power_plugged = power_plugged == 1 + if power_plugged: + secsleft = _common.POWER_TIME_UNLIMITED + elif minsleft == -1: + secsleft = _common.POWER_TIME_UNKNOWN + else: + secsleft = minsleft * 60 + return ntp.sbattery(percent, secsleft, power_plugged) + + +# ===================================================================== +# --- network +# ===================================================================== + + +net_io_counters = cext.net_io_counters +net_if_addrs = cext.net_if_addrs + + +def net_connections(kind='inet'): + """System-wide network connections.""" + # Note: on macOS this will fail with AccessDenied unless + # the process is owned by root. + ret = [] + for pid in pids(): + try: + cons = Process(pid).net_connections(kind) + except NoSuchProcess: + continue + else: + if cons: + for c in cons: + c = list(c) + [pid] + ret.append(ntp.sconn(*c)) + return ret + + +def net_if_stats(): + """Get NIC stats (isup, duplex, speed, mtu).""" + names = net_io_counters().keys() + ret = {} + for name in names: + try: + mtu = cext.net_if_mtu(name) + flags = cext.net_if_flags(name) + duplex, speed = cext.net_if_duplex_speed(name) + except OSError as err: + # https://github.com/giampaolo/psutil/issues/1279 + if err.errno != errno.ENODEV: + raise + else: + if hasattr(_common, 'NicDuplex'): + duplex = _common.NicDuplex(duplex) + output_flags = ','.join(flags) + isup = 'running' in flags + ret[name] = ntp.snicstats(isup, duplex, speed, mtu, output_flags) + return ret + + +# ===================================================================== +# --- other system functions +# ===================================================================== + + +def boot_time(): + """The system boot time expressed in seconds since the epoch.""" + return cext.boot_time() + + +try: + INIT_BOOT_TIME = boot_time() +except Exception as err: # noqa: BLE001 + # Don't want to crash at import time. + debug(f"ignoring exception on import: {err!r}") + INIT_BOOT_TIME = 0 + + +def adjust_proc_create_time(ctime): + """Account for system clock updates.""" + if INIT_BOOT_TIME == 0: + return ctime + + diff = INIT_BOOT_TIME - boot_time() + if diff == 0 or abs(diff) < 1: + return ctime + + debug("system clock was updated; adjusting process create_time()") + if diff < 0: + return ctime - diff + return ctime + diff + + +def users(): + """Return currently connected users as a list of namedtuples.""" + retlist = [] + rawlist = cext.users() + for item in rawlist: + user, tty, hostname, tstamp, pid = item + if tty == '~': + continue # reboot or shutdown + if not tstamp: + continue + nt = ntp.suser(user, tty or None, hostname or None, tstamp, pid) + retlist.append(nt) + return retlist + + +# ===================================================================== +# --- processes +# ===================================================================== + + +def pids(): + ls = cext.pids() + if 0 not in ls: + # On certain macOS versions pids() C doesn't return PID 0 but + # "ps" does and the process is querable via sysctl(): + # https://travis-ci.org/giampaolo/psutil/jobs/309619941 + try: + Process(0).create_time() + ls.insert(0, 0) + except NoSuchProcess: + pass + except AccessDenied: + ls.insert(0, 0) + return ls + + +pid_exists = _psposix.pid_exists + + +def wrap_exceptions(fun): + """Decorator which translates bare OSError exceptions into + NoSuchProcess and AccessDenied. + """ + + @functools.wraps(fun) + def wrapper(self, *args, **kwargs): + pid, ppid, name = self.pid, self._ppid, self._name + try: + return fun(self, *args, **kwargs) + except ProcessLookupError as err: + if cext.proc_is_zombie(pid): + raise ZombieProcess(pid, name, ppid) from err + raise NoSuchProcess(pid, name) from err + except PermissionError as err: + raise AccessDenied(pid, name) from err + except cext.ZombieProcessError as err: + raise ZombieProcess(pid, name, ppid) from err + + return wrapper + + +class Process: + """Wrapper class around underlying C implementation.""" + + __slots__ = ["_cache", "_name", "_ppid", "pid"] + + def __init__(self, pid): + self.pid = pid + self._name = None + self._ppid = None + + @wrap_exceptions + @memoize_when_activated + def _get_kinfo_proc(self): + # Note: should work with all PIDs without permission issues. + ret = cext.proc_kinfo_oneshot(self.pid) + assert len(ret) == len(kinfo_proc_map) + return ret + + @wrap_exceptions + @memoize_when_activated + def _get_pidtaskinfo(self): + # Note: should work for PIDs owned by user only. + ret = cext.proc_pidtaskinfo_oneshot(self.pid) + assert len(ret) == len(pidtaskinfo_map) + return ret + + def oneshot_enter(self): + self._get_kinfo_proc.cache_activate(self) + self._get_pidtaskinfo.cache_activate(self) + + def oneshot_exit(self): + self._get_kinfo_proc.cache_deactivate(self) + self._get_pidtaskinfo.cache_deactivate(self) + + @wrap_exceptions + def name(self): + name = self._get_kinfo_proc()[kinfo_proc_map['name']] + return name if name is not None else cext.proc_name(self.pid) + + @wrap_exceptions + def exe(self): + return cext.proc_exe(self.pid) + + @wrap_exceptions + def cmdline(self): + return cext.proc_cmdline(self.pid) + + @wrap_exceptions + def environ(self): + return parse_environ_block(cext.proc_environ(self.pid)) + + @wrap_exceptions + def ppid(self): + self._ppid = self._get_kinfo_proc()[kinfo_proc_map['ppid']] + return self._ppid + + @wrap_exceptions + def cwd(self): + return cext.proc_cwd(self.pid) + + @wrap_exceptions + def uids(self): + rawtuple = self._get_kinfo_proc() + return ntp.puids( + rawtuple[kinfo_proc_map['ruid']], + rawtuple[kinfo_proc_map['euid']], + rawtuple[kinfo_proc_map['suid']], + ) + + @wrap_exceptions + def gids(self): + rawtuple = self._get_kinfo_proc() + return ntp.puids( + rawtuple[kinfo_proc_map['rgid']], + rawtuple[kinfo_proc_map['egid']], + rawtuple[kinfo_proc_map['sgid']], + ) + + @wrap_exceptions + def terminal(self): + tty_nr = self._get_kinfo_proc()[kinfo_proc_map['ttynr']] + tmap = _psposix.get_terminal_map() + try: + return tmap[tty_nr] + except KeyError: + return None + + @wrap_exceptions + def memory_info(self): + rawtuple = self._get_pidtaskinfo() + return ntp.pmem( + rawtuple[pidtaskinfo_map['rss']], + rawtuple[pidtaskinfo_map['vms']], + rawtuple[pidtaskinfo_map['pfaults']], + rawtuple[pidtaskinfo_map['pageins']], + ) + + @wrap_exceptions + def memory_full_info(self): + basic_mem = self.memory_info() + uss = cext.proc_memory_uss(self.pid) + return ntp.pfullmem(*basic_mem + (uss,)) + + @wrap_exceptions + def cpu_times(self): + rawtuple = self._get_pidtaskinfo() + return ntp.pcputimes( + rawtuple[pidtaskinfo_map['cpuutime']], + rawtuple[pidtaskinfo_map['cpustime']], + # children user / system times are not retrievable (set to 0) + 0.0, + 0.0, + ) + + @wrap_exceptions + def create_time(self, monotonic=False): + ctime = self._get_kinfo_proc()[kinfo_proc_map['ctime']] + if not monotonic: + ctime = adjust_proc_create_time(ctime) + return ctime + + @wrap_exceptions + def num_ctx_switches(self): + # Unvoluntary value seems not to be available; + # getrusage() numbers seems to confirm this theory. + # We set it to 0. + vol = self._get_pidtaskinfo()[pidtaskinfo_map['volctxsw']] + return ntp.pctxsw(vol, 0) + + @wrap_exceptions + def num_threads(self): + return self._get_pidtaskinfo()[pidtaskinfo_map['numthreads']] + + @wrap_exceptions + def open_files(self): + if self.pid == 0: + return [] + files = [] + rawlist = cext.proc_open_files(self.pid) + for path, fd in rawlist: + if isfile_strict(path): + ntuple = ntp.popenfile(path, fd) + files.append(ntuple) + return files + + @wrap_exceptions + def net_connections(self, kind='inet'): + families, types = conn_tmap[kind] + rawlist = cext.proc_net_connections(self.pid, families, types) + ret = [] + for item in rawlist: + fd, fam, type, laddr, raddr, status = item + nt = conn_to_ntuple( + fd, fam, type, laddr, raddr, status, TCP_STATUSES + ) + ret.append(nt) + return ret + + @wrap_exceptions + def num_fds(self): + if self.pid == 0: + return 0 + return cext.proc_num_fds(self.pid) + + @wrap_exceptions + def wait(self, timeout=None): + return _psposix.wait_pid(self.pid, timeout) + + @wrap_exceptions + def nice_get(self): + return cext.proc_priority_get(self.pid) + + @wrap_exceptions + def nice_set(self, value): + return cext.proc_priority_set(self.pid, value) + + @wrap_exceptions + def status(self): + code = self._get_kinfo_proc()[kinfo_proc_map['status']] + # XXX is '?' legit? (we're not supposed to return it anyway) + return PROC_STATUSES.get(code, '?') + + @wrap_exceptions + def threads(self): + rawlist = cext.proc_threads(self.pid) + retlist = [] + for thread_id, utime, stime in rawlist: + ntuple = ntp.pthread(thread_id, utime, stime) + retlist.append(ntuple) + return retlist diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_psposix.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_psposix.py new file mode 100644 index 0000000000000000000000000000000000000000..c7ad2fdabd30ee585642b49e38db9afc489b6ede --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_psposix.py @@ -0,0 +1,363 @@ +# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Routines common to all posix systems.""" + +import enum +import errno +import glob +import os +import select +import signal +import time + +from . import _ntuples as ntp +from ._common import MACOS +from ._common import TimeoutExpired +from ._common import debug +from ._common import memoize +from ._common import usage_percent + +if MACOS: + from . import _psutil_osx + + +__all__ = ['pid_exists', 'wait_pid', 'disk_usage', 'get_terminal_map'] + + +def pid_exists(pid): + """Check whether pid exists in the current process table.""" + if pid == 0: + # According to "man 2 kill" PID 0 has a special meaning: + # it refers to <> so we don't want to go any further. + # If we get here it means this UNIX platform *does* have + # a process with id 0. + return True + try: + os.kill(pid, 0) + except ProcessLookupError: + return False + except PermissionError: + # EPERM clearly means there's a process to deny access to + return True + # According to "man 2 kill" possible error values are + # (EINVAL, EPERM, ESRCH) + else: + return True + + +Negsignal = enum.IntEnum( + 'Negsignal', {x.name: -x.value for x in signal.Signals} +) + + +def negsig_to_enum(num): + """Convert a negative signal value to an enum.""" + try: + return Negsignal(num) + except ValueError: + return num + + +def convert_exit_code(status): + """Convert a os.waitpid() status to an exit code.""" + if os.WIFEXITED(status): + # Process terminated normally by calling exit(3) or _exit(2), + # or by returning from main(). The return value is the + # positive integer passed to *exit(). + return os.WEXITSTATUS(status) + if os.WIFSIGNALED(status): + # Process exited due to a signal. Return the negative value + # of that signal. + return negsig_to_enum(-os.WTERMSIG(status)) + # if os.WIFSTOPPED(status): + # # Process was stopped via SIGSTOP or is being traced, and + # # waitpid() was called with WUNTRACED flag. PID is still + # # alive. From now on waitpid() will keep returning (0, 0) + # # until the process state doesn't change. + # # It may make sense to catch/enable this since stopped PIDs + # # ignore SIGTERM. + # interval = sleep(interval) + # continue + # if os.WIFCONTINUED(status): + # # Process was resumed via SIGCONT and waitpid() was called + # # with WCONTINUED flag. + # interval = sleep(interval) + # continue + + # Should never happen. + msg = f"unknown process exit status {status!r}" + raise ValueError(msg) + + +def wait_pid_posix( + pid, + timeout=None, + _waitpid=os.waitpid, + _timer=getattr(time, 'monotonic', time.time), # noqa: B008 + _min=min, + _sleep=time.sleep, + _pid_exists=pid_exists, +): + """Wait for a process PID to terminate. + + If the process terminated normally by calling exit(3) or _exit(2), + or by returning from main(), the return value is the positive integer + passed to *exit(). + + If it was terminated by a signal it returns the negated value of the + signal which caused the termination (e.g. -SIGTERM). + + If PID is not a children of os.getpid() (current process) just + wait until the process disappears and return None. + + If PID does not exist at all return None immediately. + + If timeout is specified and process is still alive raise + TimeoutExpired. + + If timeout=0 either return immediately or raise TimeoutExpired + (non-blocking). + """ + interval = 0.0001 + max_interval = 0.04 + flags = 0 + stop_at = None + + if timeout is not None: + flags |= os.WNOHANG + if timeout != 0: + stop_at = _timer() + timeout + + def sleep_or_timeout(interval): + # Sleep for some time and return a new increased interval. + if timeout == 0 or (stop_at is not None and _timer() >= stop_at): + raise TimeoutExpired(timeout) + _sleep(interval) + return _min(interval * 2, max_interval) + + # See: https://linux.die.net/man/2/waitpid + while True: + try: + retpid, status = os.waitpid(pid, flags) + except ChildProcessError: + # This has two meanings: + # - PID is not a child of os.getpid() in which case + # we keep polling until it's gone + # - PID never existed in the first place + # In both cases we'll eventually return None as we + # can't determine its exit status code. + while _pid_exists(pid): + interval = sleep_or_timeout(interval) + return None + else: + if retpid == 0: + # WNOHANG flag was used and PID is still running. + interval = sleep_or_timeout(interval) + else: + return convert_exit_code(status) + + +def _waitpid(pid, timeout): + """Wrapper around os.waitpid(). PID is supposed to be gone already, + it just returns the exit code. + """ + try: + retpid, status = os.waitpid(pid, 0) + except ChildProcessError: + # PID is not a child of os.getpid(). + return wait_pid_posix(pid, timeout) + else: + assert retpid != 0 + return convert_exit_code(status) + + +def wait_pid_pidfd_open(pid, timeout=None): + """Wait for PID to terminate using pidfd_open() + poll(). Linux >= + 5.3 + Python >= 3.9 only. + """ + try: + pidfd = os.pidfd_open(pid, 0) + except OSError as err: + if err.errno == errno.ESRCH: + # No such process. os.waitpid() may still be able to return + # the status code. + return wait_pid_posix(pid, timeout) + if err.errno in {errno.EMFILE, errno.ENFILE, errno.ENODEV}: + # EMFILE, ENFILE: too many open files + # ENODEV: anonymous inode filesystem not supported + debug(f"pidfd_open() failed ({err!r}); use fallback") + return wait_pid_posix(pid, timeout) + raise + + try: + # poll() / select() have the advantage of not requiring any + # extra file descriptor, contrary to epoll() / kqueue(). + # select() crashes if process opens > 1024 FDs, so we use + # poll(). + poller = select.poll() + poller.register(pidfd, select.POLLIN) + timeout_ms = None if timeout is None else int(timeout * 1000) + events = poller.poll(timeout_ms) # wait + + if not events: + raise TimeoutExpired(timeout) + return _waitpid(pid, timeout) + finally: + os.close(pidfd) + + +def wait_pid_kqueue(pid, timeout=None): + """Wait for PID to terminate using kqueue(). macOS and BSD only.""" + try: + kq = select.kqueue() + except OSError as err: + if err.errno in {errno.EMFILE, errno.ENFILE}: # too many open files + debug(f"kqueue() failed ({err!r}); use fallback") + return wait_pid_posix(pid, timeout) + raise + + try: + kev = select.kevent( + pid, + filter=select.KQ_FILTER_PROC, + flags=select.KQ_EV_ADD | select.KQ_EV_ONESHOT, + fflags=select.KQ_NOTE_EXIT, + ) + try: + events = kq.control([kev], 1, timeout) # wait + except OSError as err: + if err.errno in {errno.EACCES, errno.EPERM, errno.ESRCH}: + debug(f"kqueue.control() failed ({err!r}); use fallback") + return wait_pid_posix(pid, timeout) + raise + else: + if not events: + raise TimeoutExpired(timeout) + return _waitpid(pid, timeout) + finally: + kq.close() + + +@memoize +def can_use_pidfd_open(): + # Availability: Linux >= 5.3, Python >= 3.9 + if not hasattr(os, "pidfd_open"): + return False + try: + pidfd = os.pidfd_open(os.getpid(), 0) + except OSError as err: + if err.errno in {errno.EMFILE, errno.ENFILE}: # noqa: SIM103 + # transitory 'too many open files' + return True + # likely blocked by security policy like SECCOMP (EPERM, + # EACCES, ENOSYS) + return False + else: + os.close(pidfd) + return True + + +@memoize +def can_use_kqueue(): + # Availability: macOS, BSD + names = ( + "kqueue", + "KQ_EV_ADD", + "KQ_EV_ONESHOT", + "KQ_FILTER_PROC", + "KQ_NOTE_EXIT", + ) + if not all(hasattr(select, x) for x in names): + return False + kq = None + try: + kq = select.kqueue() + kev = select.kevent( + os.getpid(), + filter=select.KQ_FILTER_PROC, + flags=select.KQ_EV_ADD | select.KQ_EV_ONESHOT, + fflags=select.KQ_NOTE_EXIT, + ) + kq.control([kev], 1, 0) + return True + except OSError as err: + if err.errno in {errno.EMFILE, errno.ENFILE}: # noqa: SIM103 + # transitory 'too many open files' + return True + return False + finally: + if kq is not None: + kq.close() + + +def wait_pid(pid, timeout=None): + # PID 0 passed to waitpid() waits for any child of the current + # process to change state. + assert pid > 0 + if timeout is not None: + assert timeout >= 0 + + if can_use_pidfd_open(): + return wait_pid_pidfd_open(pid, timeout) + elif can_use_kqueue(): + return wait_pid_kqueue(pid, timeout) + else: + return wait_pid_posix(pid, timeout) + + +wait_pid.__doc__ = wait_pid_posix.__doc__ + + +def disk_usage(path): + """Return disk usage associated with path. + Note: UNIX usually reserves 5% disk space which is not accessible + by user. In this function "total" and "used" values reflect the + total and used disk space whereas "free" and "percent" represent + the "free" and "used percent" user disk space. + """ + st = os.statvfs(path) + # Total space which is only available to root (unless changed + # at system level). + total = st.f_blocks * st.f_frsize + # Remaining free space usable by root. + avail_to_root = st.f_bfree * st.f_frsize + # Remaining free space usable by user. + avail_to_user = st.f_bavail * st.f_frsize + # Total space being used in general. + used = total - avail_to_root + if MACOS: + # see: https://github.com/giampaolo/psutil/pull/2152 + used = _psutil_osx.disk_usage_used(path, used) + # Total space which is available to user (same as 'total' but + # for the user). + total_user = used + avail_to_user + # User usage percent compared to the total amount of space + # the user can use. This number would be higher if compared + # to root's because the user has less space (usually -5%). + usage_percent_user = usage_percent(used, total_user, round_=1) + + # NB: the percentage is -5% than what shown by df due to + # reserved blocks that we are currently not considering: + # https://github.com/giampaolo/psutil/issues/829#issuecomment-223750462 + return ntp.sdiskusage( + total=total, used=used, free=avail_to_user, percent=usage_percent_user + ) + + +@memoize +def get_terminal_map(): + """Get a map of device-id -> path as a dict. + Used by Process.terminal(). + """ + ret = {} + ls = glob.glob('/dev/tty*') + glob.glob('/dev/pts/*') + for name in ls: + assert name not in ret, name + try: + ret[os.stat(name).st_rdev] = name + except FileNotFoundError: + pass + return ret diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_pssunos.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_pssunos.py new file mode 100644 index 0000000000000000000000000000000000000000..a0e70581f5a02dfbc8e61a9d26e105ee6160a8aa --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_pssunos.py @@ -0,0 +1,704 @@ +# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Sun OS Solaris platform implementation.""" + +import errno +import functools +import os +import socket +import subprocess +import sys +from collections import namedtuple +from socket import AF_INET + +from . import _common +from . import _ntuples as ntp +from . import _psposix +from . import _psutil_sunos as cext +from ._common import AF_INET6 +from ._common import ENCODING +from ._common import AccessDenied +from ._common import NoSuchProcess +from ._common import ZombieProcess +from ._common import debug +from ._common import get_procfs_path +from ._common import isfile_strict +from ._common import memoize_when_activated +from ._common import sockfam_to_enum +from ._common import socktype_to_enum +from ._common import usage_percent + +__extra__all__ = ["CONN_IDLE", "CONN_BOUND", "PROCFS_PATH"] + + +# ===================================================================== +# --- globals +# ===================================================================== + + +PAGE_SIZE = cext.getpagesize() +AF_LINK = cext.AF_LINK +IS_64_BIT = sys.maxsize > 2**32 + +CONN_IDLE = "IDLE" +CONN_BOUND = "BOUND" + +PROC_STATUSES = { + cext.SSLEEP: _common.STATUS_SLEEPING, + cext.SRUN: _common.STATUS_RUNNING, + cext.SZOMB: _common.STATUS_ZOMBIE, + cext.SSTOP: _common.STATUS_STOPPED, + cext.SIDL: _common.STATUS_IDLE, + cext.SONPROC: _common.STATUS_RUNNING, # same as run + cext.SWAIT: _common.STATUS_WAITING, +} + +TCP_STATUSES = { + cext.TCPS_ESTABLISHED: _common.CONN_ESTABLISHED, + cext.TCPS_SYN_SENT: _common.CONN_SYN_SENT, + cext.TCPS_SYN_RCVD: _common.CONN_SYN_RECV, + cext.TCPS_FIN_WAIT_1: _common.CONN_FIN_WAIT1, + cext.TCPS_FIN_WAIT_2: _common.CONN_FIN_WAIT2, + cext.TCPS_TIME_WAIT: _common.CONN_TIME_WAIT, + cext.TCPS_CLOSED: _common.CONN_CLOSE, + cext.TCPS_CLOSE_WAIT: _common.CONN_CLOSE_WAIT, + cext.TCPS_LAST_ACK: _common.CONN_LAST_ACK, + cext.TCPS_LISTEN: _common.CONN_LISTEN, + cext.TCPS_CLOSING: _common.CONN_CLOSING, + cext.PSUTIL_CONN_NONE: _common.CONN_NONE, + cext.TCPS_IDLE: CONN_IDLE, # sunos specific + cext.TCPS_BOUND: CONN_BOUND, # sunos specific +} + +proc_info_map = dict( + ppid=0, + rss=1, + vms=2, + create_time=3, + nice=4, + num_threads=5, + status=6, + ttynr=7, + uid=8, + euid=9, + gid=10, + egid=11, +) + + +# ===================================================================== +# --- memory +# ===================================================================== + + +def virtual_memory(): + """Report virtual memory metrics.""" + # we could have done this with kstat, but IMHO this is good enough + total = os.sysconf('SC_PHYS_PAGES') * PAGE_SIZE + # note: there's no difference on Solaris + free = avail = os.sysconf('SC_AVPHYS_PAGES') * PAGE_SIZE + used = total - free + percent = usage_percent(used, total, round_=1) + return ntp.svmem(total, avail, percent, used, free) + + +def swap_memory(): + """Report swap memory metrics.""" + sin, sout = cext.swap_mem() + # XXX + # we are supposed to get total/free by doing so: + # http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/ + # usr/src/cmd/swap/swap.c + # ...nevertheless I can't manage to obtain the same numbers as 'swap' + # cmdline utility, so let's parse its output (sigh!) + p = subprocess.Popen( + [ + '/usr/bin/env', + f"PATH=/usr/sbin:/sbin:{os.environ['PATH']}", + 'swap', + '-l', + ], + stdout=subprocess.PIPE, + ) + stdout, _ = p.communicate() + stdout = stdout.decode(sys.stdout.encoding) + if p.returncode != 0: + msg = f"'swap -l' failed (retcode={p.returncode})" + raise RuntimeError(msg) + + lines = stdout.strip().split('\n')[1:] + if not lines: + msg = 'no swap device(s) configured' + raise RuntimeError(msg) + total = free = 0 + for line in lines: + line = line.split() + t, f = line[3:5] + total += int(int(t) * 512) + free += int(int(f) * 512) + used = total - free + percent = usage_percent(used, total, round_=1) + return ntp.sswap( + total, used, free, percent, sin * PAGE_SIZE, sout * PAGE_SIZE + ) + + +# ===================================================================== +# --- CPU +# ===================================================================== + + +def cpu_times(): + """Return system-wide CPU times as a named tuple.""" + ret = cext.per_cpu_times() + return ntp.scputimes(*[sum(x) for x in zip(*ret)]) + + +def per_cpu_times(): + """Return system per-CPU times as a list of named tuples.""" + ret = cext.per_cpu_times() + return [ntp.scputimes(*x) for x in ret] + + +def cpu_count_logical(): + """Return the number of logical CPUs in the system.""" + try: + return os.sysconf("SC_NPROCESSORS_ONLN") + except ValueError: + # mimic os.cpu_count() behavior + return None + + +def cpu_count_cores(): + """Return the number of CPU cores in the system.""" + return cext.cpu_count_cores() + + +def cpu_stats(): + """Return various CPU stats as a named tuple.""" + ctx_switches, interrupts, syscalls, _traps = cext.cpu_stats() + soft_interrupts = 0 + return ntp.scpustats(ctx_switches, interrupts, soft_interrupts, syscalls) + + +# ===================================================================== +# --- disks +# ===================================================================== + + +disk_io_counters = cext.disk_io_counters +disk_usage = _psposix.disk_usage + + +def disk_partitions(all=False): + """Return system disk partitions.""" + # TODO - the filtering logic should be better checked so that + # it tries to reflect 'df' as much as possible + retlist = [] + partitions = cext.disk_partitions() + for partition in partitions: + device, mountpoint, fstype, opts = partition + if device == 'none': + device = '' + if not all: + # Differently from, say, Linux, we don't have a list of + # common fs types so the best we can do, AFAIK, is to + # filter by filesystem having a total size > 0. + try: + if not disk_usage(mountpoint).total: + continue + except OSError as err: + # https://github.com/giampaolo/psutil/issues/1674 + debug(f"skipping {mountpoint!r}: {err}") + continue + ntuple = ntp.sdiskpart(device, mountpoint, fstype, opts) + retlist.append(ntuple) + return retlist + + +# ===================================================================== +# --- network +# ===================================================================== + + +net_io_counters = cext.net_io_counters +net_if_addrs = cext.net_if_addrs + + +def net_connections(kind, _pid=-1): + """Return socket connections. If pid == -1 return system-wide + connections (as opposed to connections opened by one process only). + Only INET sockets are returned (UNIX are not). + """ + families, types = _common.conn_tmap[kind] + rawlist = cext.net_connections(_pid) + ret = set() + for item in rawlist: + fd, fam, type_, laddr, raddr, status, pid = item + if fam not in families: + continue + if type_ not in types: + continue + # TODO: refactor and use _common.conn_to_ntuple. + if fam in {AF_INET, AF_INET6}: + if laddr: + laddr = ntp.addr(*laddr) + if raddr: + raddr = ntp.addr(*raddr) + status = TCP_STATUSES[status] + fam = sockfam_to_enum(fam) + type_ = socktype_to_enum(type_) + if _pid == -1: + nt = ntp.sconn(fd, fam, type_, laddr, raddr, status, pid) + else: + nt = ntp.pconn(fd, fam, type_, laddr, raddr, status) + ret.add(nt) + return list(ret) + + +def net_if_stats(): + """Get NIC stats (isup, duplex, speed, mtu).""" + ret = cext.net_if_stats() + for name, items in ret.items(): + isup, duplex, speed, mtu = items + if hasattr(_common, 'NicDuplex'): + duplex = _common.NicDuplex(duplex) + ret[name] = ntp.snicstats(isup, duplex, speed, mtu, '') + return ret + + +# ===================================================================== +# --- other system functions +# ===================================================================== + + +def boot_time(): + """The system boot time expressed in seconds since the epoch.""" + return cext.boot_time() + + +def users(): + """Return currently connected users as a list of namedtuples.""" + retlist = [] + rawlist = cext.users() + localhost = (':0.0', ':0') + for item in rawlist: + user, tty, hostname, tstamp, user_process, pid = item + # note: the underlying C function includes entries about + # system boot, run level and others. We might want + # to use them in the future. + if not user_process: + continue + if hostname in localhost: + hostname = 'localhost' + nt = ntp.suser(user, tty, hostname, tstamp, pid) + retlist.append(nt) + return retlist + + +# ===================================================================== +# --- processes +# ===================================================================== + + +def pids(): + """Returns a list of PIDs currently running on the system.""" + path = get_procfs_path().encode(ENCODING) + return [int(x) for x in os.listdir(path) if x.isdigit()] + + +def pid_exists(pid): + """Check for the existence of a unix pid.""" + return _psposix.pid_exists(pid) + + +def wrap_exceptions(fun): + """Call callable into a try/except clause and translate ENOENT, + EACCES and EPERM in NoSuchProcess or AccessDenied exceptions. + """ + + @functools.wraps(fun) + def wrapper(self, *args, **kwargs): + pid, ppid, name = self.pid, self._ppid, self._name + try: + return fun(self, *args, **kwargs) + except (FileNotFoundError, ProcessLookupError) as err: + # ENOENT (no such file or directory) gets raised on open(). + # ESRCH (no such process) can get raised on read() if + # process is gone in meantime. + if not pid_exists(pid): + raise NoSuchProcess(pid, name) from err + raise ZombieProcess(pid, name, ppid) from err + except PermissionError as err: + raise AccessDenied(pid, name) from err + except OSError as err: + if pid == 0: + if 0 in pids(): + raise AccessDenied(pid, name) from err + raise + raise + + return wrapper + + +class Process: + """Wrapper class around underlying C implementation.""" + + __slots__ = ["_cache", "_name", "_ppid", "_procfs_path", "pid"] + + def __init__(self, pid): + self.pid = pid + self._name = None + self._ppid = None + self._procfs_path = get_procfs_path() + + def _assert_alive(self): + """Raise NSP if the process disappeared on us.""" + # For those C function who do not raise NSP, possibly returning + # incorrect or incomplete result. + os.stat(f"{self._procfs_path}/{self.pid}") + + def oneshot_enter(self): + self._proc_name_and_args.cache_activate(self) + self._proc_basic_info.cache_activate(self) + self._proc_cred.cache_activate(self) + + def oneshot_exit(self): + self._proc_name_and_args.cache_deactivate(self) + self._proc_basic_info.cache_deactivate(self) + self._proc_cred.cache_deactivate(self) + + @wrap_exceptions + @memoize_when_activated + def _proc_name_and_args(self): + return cext.proc_name_and_args(self.pid, self._procfs_path) + + @wrap_exceptions + @memoize_when_activated + def _proc_basic_info(self): + if self.pid == 0 and not os.path.exists( + f"{self._procfs_path}/{self.pid}/psinfo" + ): + raise AccessDenied(self.pid) + ret = cext.proc_basic_info(self.pid, self._procfs_path) + assert len(ret) == len(proc_info_map) + return ret + + @wrap_exceptions + @memoize_when_activated + def _proc_cred(self): + return cext.proc_cred(self.pid, self._procfs_path) + + @wrap_exceptions + def name(self): + # note: max len == 15 + return self._proc_name_and_args()[0] + + @wrap_exceptions + def exe(self): + try: + return os.readlink(f"{self._procfs_path}/{self.pid}/path/a.out") + except OSError: + pass # continue and guess the exe name from the cmdline + # Will be guessed later from cmdline but we want to explicitly + # invoke cmdline here in order to get an AccessDenied + # exception if the user has not enough privileges. + self.cmdline() + return "" + + @wrap_exceptions + def cmdline(self): + return self._proc_name_and_args()[1] + + @wrap_exceptions + def environ(self): + return cext.proc_environ(self.pid, self._procfs_path) + + @wrap_exceptions + def create_time(self): + return self._proc_basic_info()[proc_info_map['create_time']] + + @wrap_exceptions + def num_threads(self): + return self._proc_basic_info()[proc_info_map['num_threads']] + + @wrap_exceptions + def nice_get(self): + # Note #1: getpriority(3) doesn't work for realtime processes. + # Psinfo is what ps uses, see: + # https://github.com/giampaolo/psutil/issues/1194 + return self._proc_basic_info()[proc_info_map['nice']] + + @wrap_exceptions + def nice_set(self, value): + if self.pid in {2, 3}: + # Special case PIDs: internally setpriority(3) return ESRCH + # (no such process), no matter what. + # The process actually exists though, as it has a name, + # creation time, etc. + raise AccessDenied(self.pid, self._name) + return cext.proc_priority_set(self.pid, value) + + @wrap_exceptions + def ppid(self): + self._ppid = self._proc_basic_info()[proc_info_map['ppid']] + return self._ppid + + @wrap_exceptions + def uids(self): + try: + real, effective, saved, _, _, _ = self._proc_cred() + except AccessDenied: + real = self._proc_basic_info()[proc_info_map['uid']] + effective = self._proc_basic_info()[proc_info_map['euid']] + saved = None + return ntp.puids(real, effective, saved) + + @wrap_exceptions + def gids(self): + try: + _, _, _, real, effective, saved = self._proc_cred() + except AccessDenied: + real = self._proc_basic_info()[proc_info_map['gid']] + effective = self._proc_basic_info()[proc_info_map['egid']] + saved = None + return ntp.puids(real, effective, saved) + + @wrap_exceptions + def cpu_times(self): + try: + times = cext.proc_cpu_times(self.pid, self._procfs_path) + except OSError as err: + if err.errno == errno.EOVERFLOW and not IS_64_BIT: + # We may get here if we attempt to query a 64bit process + # with a 32bit python. + # Error originates from read() and also tools like "cat" + # fail in the same way (!). + # Since there simply is no way to determine CPU times we + # return 0.0 as a fallback. See: + # https://github.com/giampaolo/psutil/issues/857 + times = (0.0, 0.0, 0.0, 0.0) + else: + raise + return ntp.pcputimes(*times) + + @wrap_exceptions + def cpu_num(self): + return cext.proc_cpu_num(self.pid, self._procfs_path) + + @wrap_exceptions + def terminal(self): + procfs_path = self._procfs_path + hit_enoent = False + tty = wrap_exceptions(self._proc_basic_info()[proc_info_map['ttynr']]) + if tty != cext.PRNODEV: + for x in (0, 1, 2, 255): + try: + return os.readlink(f"{procfs_path}/{self.pid}/path/{x}") + except FileNotFoundError: + hit_enoent = True + continue + if hit_enoent: + self._assert_alive() + + @wrap_exceptions + def cwd(self): + # /proc/PID/path/cwd may not be resolved by readlink() even if + # it exists (ls shows it). If that's the case and the process + # is still alive return None (we can return None also on BSD). + # Reference: https://groups.google.com/g/comp.unix.solaris/c/tcqvhTNFCAs + procfs_path = self._procfs_path + try: + return os.readlink(f"{procfs_path}/{self.pid}/path/cwd") + except FileNotFoundError: + os.stat(f"{procfs_path}/{self.pid}") # raise NSP or AD + return "" + + @wrap_exceptions + def memory_info(self): + ret = self._proc_basic_info() + rss = ret[proc_info_map['rss']] * 1024 + vms = ret[proc_info_map['vms']] * 1024 + return ntp.pmem(rss, vms) + + memory_full_info = memory_info + + @wrap_exceptions + def status(self): + code = self._proc_basic_info()[proc_info_map['status']] + # XXX is '?' legit? (we're not supposed to return it anyway) + return PROC_STATUSES.get(code, '?') + + @wrap_exceptions + def threads(self): + procfs_path = self._procfs_path + ret = [] + tids = os.listdir(f"{procfs_path}/{self.pid}/lwp") + hit_enoent = False + for tid in tids: + tid = int(tid) + try: + utime, stime = cext.query_process_thread( + self.pid, tid, procfs_path + ) + except OSError as err: + if err.errno == errno.EOVERFLOW and not IS_64_BIT: + # We may get here if we attempt to query a 64bit process + # with a 32bit python. + # Error originates from read() and also tools like "cat" + # fail in the same way (!). + # Since there simply is no way to determine CPU times we + # return 0.0 as a fallback. See: + # https://github.com/giampaolo/psutil/issues/857 + continue + # ENOENT == thread gone in meantime + if err.errno == errno.ENOENT: + hit_enoent = True + continue + raise + else: + nt = ntp.pthread(tid, utime, stime) + ret.append(nt) + if hit_enoent: + self._assert_alive() + return ret + + @wrap_exceptions + def open_files(self): + retlist = [] + hit_enoent = False + procfs_path = self._procfs_path + pathdir = f"{procfs_path}/{self.pid}/path" + for fd in os.listdir(f"{procfs_path}/{self.pid}/fd"): + path = os.path.join(pathdir, fd) + if os.path.islink(path): + try: + file = os.readlink(path) + except FileNotFoundError: + hit_enoent = True + continue + else: + if isfile_strict(file): + retlist.append(ntp.popenfile(file, int(fd))) + if hit_enoent: + self._assert_alive() + return retlist + + def _get_unix_sockets(self, pid): + """Get UNIX sockets used by process by parsing 'pfiles' output.""" + # TODO: rewrite this in C (...but the damn netstat source code + # does not include this part! Argh!!) + cmd = ["pfiles", str(pid)] + p = subprocess.Popen( + cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE + ) + stdout, stderr = p.communicate() + stdout, stderr = ( + x.decode(sys.stdout.encoding) for x in (stdout, stderr) + ) + if p.returncode != 0: + if 'permission denied' in stderr.lower(): + raise AccessDenied(self.pid, self._name) + if 'no such process' in stderr.lower(): + raise NoSuchProcess(self.pid, self._name) + msg = f"{cmd!r} command error\n{stderr}" + raise RuntimeError(msg) + + lines = stdout.split('\n')[2:] + for i, line in enumerate(lines): + line = line.lstrip() + if line.startswith('sockname: AF_UNIX'): + path = line.split(' ', 2)[2] + type = lines[i - 2].strip() + if type == 'SOCK_STREAM': + type = socket.SOCK_STREAM + elif type == 'SOCK_DGRAM': + type = socket.SOCK_DGRAM + else: + type = -1 + yield (-1, socket.AF_UNIX, type, path, "", _common.CONN_NONE) + + @wrap_exceptions + def net_connections(self, kind='inet'): + ret = net_connections(kind, _pid=self.pid) + # The underlying C implementation retrieves all OS connections + # and filters them by PID. At this point we can't tell whether + # an empty list means there were no connections for process or + # process is no longer active so we force NSP in case the PID + # is no longer there. + if not ret: + # will raise NSP if process is gone + os.stat(f"{self._procfs_path}/{self.pid}") + + # UNIX sockets + if kind in {'all', 'unix'}: + ret.extend( + [ntp.pconn(*conn) for conn in self._get_unix_sockets(self.pid)] + ) + return ret + + nt_mmap_grouped = namedtuple('mmap', 'path rss anon locked') + nt_mmap_ext = namedtuple('mmap', 'addr perms path rss anon locked') + + @wrap_exceptions + def memory_maps(self): + def toaddr(start, end): + return "{}-{}".format( + hex(start)[2:].strip('L'), hex(end)[2:].strip('L') + ) + + procfs_path = self._procfs_path + retlist = [] + try: + rawlist = cext.proc_memory_maps(self.pid, procfs_path) + except OSError as err: + if err.errno == errno.EOVERFLOW and not IS_64_BIT: + # We may get here if we attempt to query a 64bit process + # with a 32bit python. + # Error originates from read() and also tools like "cat" + # fail in the same way (!). + # Since there simply is no way to determine CPU times we + # return 0.0 as a fallback. See: + # https://github.com/giampaolo/psutil/issues/857 + return [] + else: + raise + hit_enoent = False + for item in rawlist: + addr, addrsize, perm, name, rss, anon, locked = item + addr = toaddr(addr, addrsize) + if not name.startswith('['): + try: + name = os.readlink(f"{procfs_path}/{self.pid}/path/{name}") + except OSError as err: + if err.errno == errno.ENOENT: + # sometimes the link may not be resolved by + # readlink() even if it exists (ls shows it). + # If that's the case we just return the + # unresolved link path. + # This seems an inconsistency with /proc similar + # to: http://goo.gl/55XgO + name = f"{procfs_path}/{self.pid}/path/{name}" + hit_enoent = True + else: + raise + retlist.append((addr, perm, name, rss, anon, locked)) + if hit_enoent: + self._assert_alive() + return retlist + + @wrap_exceptions + def num_fds(self): + return len(os.listdir(f"{self._procfs_path}/{self.pid}/fd")) + + @wrap_exceptions + def num_ctx_switches(self): + return ntp.pctxsw( + *cext.proc_num_ctx_switches(self.pid, self._procfs_path) + ) + + @wrap_exceptions + def wait(self, timeout=None): + return _psposix.wait_pid(self.pid, timeout) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_psutil_windows.pyd b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_psutil_windows.pyd new file mode 100644 index 0000000000000000000000000000000000000000..3fbc872ec3daa24e65b135c17e7939f9d2ba5a72 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_psutil_windows.pyd differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_pswindows.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_pswindows.py new file mode 100644 index 0000000000000000000000000000000000000000..3ee1eafce0bb08f86df6d08d30a66bb2058c6f7c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/Lib/site-packages/psutil/_pswindows.py @@ -0,0 +1,1096 @@ +# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Windows platform implementation.""" + +import contextlib +import enum +import functools +import os +import signal +import sys +import threading +import time + +from . import _common +from . import _ntuples as ntp +from ._common import ENCODING +from ._common import AccessDenied +from ._common import NoSuchProcess +from ._common import TimeoutExpired +from ._common import conn_tmap +from ._common import conn_to_ntuple +from ._common import debug +from ._common import isfile_strict +from ._common import memoize +from ._common import memoize_when_activated +from ._common import parse_environ_block +from ._common import usage_percent +from ._psutil_windows import ABOVE_NORMAL_PRIORITY_CLASS +from ._psutil_windows import BELOW_NORMAL_PRIORITY_CLASS +from ._psutil_windows import HIGH_PRIORITY_CLASS +from ._psutil_windows import IDLE_PRIORITY_CLASS +from ._psutil_windows import NORMAL_PRIORITY_CLASS +from ._psutil_windows import REALTIME_PRIORITY_CLASS + +try: + from . import _psutil_windows as cext +except ImportError as err: + if ( + str(err).lower().startswith("dll load failed") + and sys.getwindowsversion()[0] < 6 + ): + # We may get here if: + # 1) we are on an old Windows version + # 2) psutil was installed via pip + wheel + # See: https://github.com/giampaolo/psutil/issues/811 + msg = "this Windows version is too old (< Windows Vista); " + msg += "psutil 3.4.2 is the latest version which supports Windows " + msg += "2000, XP and 2003 server" + raise RuntimeError(msg) from err + else: + raise + + +# process priority constants, import from __init__.py: +# http://msdn.microsoft.com/en-us/library/ms686219(v=vs.85).aspx +# fmt: off +__extra__all__ = [ + "win_service_iter", "win_service_get", + # Process priority + "ABOVE_NORMAL_PRIORITY_CLASS", "BELOW_NORMAL_PRIORITY_CLASS", + "HIGH_PRIORITY_CLASS", "IDLE_PRIORITY_CLASS", "NORMAL_PRIORITY_CLASS", + "REALTIME_PRIORITY_CLASS", + # IO priority + "IOPRIO_VERYLOW", "IOPRIO_LOW", "IOPRIO_NORMAL", "IOPRIO_HIGH", + # others + "CONN_DELETE_TCB", "AF_LINK", +] +# fmt: on + + +# ===================================================================== +# --- globals +# ===================================================================== + +CONN_DELETE_TCB = "DELETE_TCB" +ERROR_PARTIAL_COPY = 299 +PYPY = '__pypy__' in sys.builtin_module_names + +AddressFamily = enum.IntEnum('AddressFamily', {'AF_LINK': -1}) +AF_LINK = AddressFamily.AF_LINK + +TCP_STATUSES = { + cext.MIB_TCP_STATE_ESTAB: _common.CONN_ESTABLISHED, + cext.MIB_TCP_STATE_SYN_SENT: _common.CONN_SYN_SENT, + cext.MIB_TCP_STATE_SYN_RCVD: _common.CONN_SYN_RECV, + cext.MIB_TCP_STATE_FIN_WAIT1: _common.CONN_FIN_WAIT1, + cext.MIB_TCP_STATE_FIN_WAIT2: _common.CONN_FIN_WAIT2, + cext.MIB_TCP_STATE_TIME_WAIT: _common.CONN_TIME_WAIT, + cext.MIB_TCP_STATE_CLOSED: _common.CONN_CLOSE, + cext.MIB_TCP_STATE_CLOSE_WAIT: _common.CONN_CLOSE_WAIT, + cext.MIB_TCP_STATE_LAST_ACK: _common.CONN_LAST_ACK, + cext.MIB_TCP_STATE_LISTEN: _common.CONN_LISTEN, + cext.MIB_TCP_STATE_CLOSING: _common.CONN_CLOSING, + cext.MIB_TCP_STATE_DELETE_TCB: CONN_DELETE_TCB, + cext.PSUTIL_CONN_NONE: _common.CONN_NONE, +} + + +class Priority(enum.IntEnum): + ABOVE_NORMAL_PRIORITY_CLASS = ABOVE_NORMAL_PRIORITY_CLASS + BELOW_NORMAL_PRIORITY_CLASS = BELOW_NORMAL_PRIORITY_CLASS + HIGH_PRIORITY_CLASS = HIGH_PRIORITY_CLASS + IDLE_PRIORITY_CLASS = IDLE_PRIORITY_CLASS + NORMAL_PRIORITY_CLASS = NORMAL_PRIORITY_CLASS + REALTIME_PRIORITY_CLASS = REALTIME_PRIORITY_CLASS + + +globals().update(Priority.__members__) + + +class IOPriority(enum.IntEnum): + IOPRIO_VERYLOW = 0 + IOPRIO_LOW = 1 + IOPRIO_NORMAL = 2 + IOPRIO_HIGH = 3 + + +globals().update(IOPriority.__members__) + +pinfo_map = dict( + num_handles=0, + ctx_switches=1, + user_time=2, + kernel_time=3, + create_time=4, + num_threads=5, + io_rcount=6, + io_wcount=7, + io_rbytes=8, + io_wbytes=9, + io_count_others=10, + io_bytes_others=11, + num_page_faults=12, + peak_wset=13, + wset=14, + peak_paged_pool=15, + paged_pool=16, + peak_non_paged_pool=17, + non_paged_pool=18, + pagefile=19, + peak_pagefile=20, + mem_private=21, +) + + +# ===================================================================== +# --- utils +# ===================================================================== + + +@functools.lru_cache(maxsize=512) +def convert_dos_path(s): + r"""Convert paths using native DOS format like: + "\Device\HarddiskVolume1\Windows\systemew\file.txt" or + "\??\C:\Windows\systemew\file.txt" + into: + "C:\Windows\systemew\file.txt". + """ + if s.startswith('\\\\'): + return s + rawdrive = '\\'.join(s.split('\\')[:3]) + if rawdrive in {"\\??\\UNC", "\\Device\\Mup"}: + rawdrive = '\\'.join(s.split('\\')[:5]) + driveletter = '\\\\' + '\\'.join(s.split('\\')[3:5]) + elif rawdrive.startswith('\\??\\'): + driveletter = s.split('\\')[2] + else: + driveletter = cext.QueryDosDevice(rawdrive) + remainder = s[len(rawdrive) :] + return os.path.join(driveletter, remainder) + + +@memoize +def getpagesize(): + return cext.getpagesize() + + +# ===================================================================== +# --- memory +# ===================================================================== + + +def virtual_memory(): + """System virtual memory as a namedtuple.""" + mem = cext.virtual_mem() + totphys, availphys, _totsys, _availsys = mem + total = totphys + avail = availphys + free = availphys + used = total - avail + percent = usage_percent((total - avail), total, round_=1) + return ntp.svmem(total, avail, percent, used, free) + + +def swap_memory(): + """Swap system memory as a (total, used, free, sin, sout) tuple.""" + mem = cext.virtual_mem() + + total_phys = mem[0] + total_system = mem[2] + + # system memory (commit total/limit) is the sum of physical and swap + # thus physical memory values need to be subtracted to get swap values + total = total_system - total_phys + # commit total is incremented immediately (decrementing free_system) + # while the corresponding free physical value is not decremented until + # pages are accessed, so we can't use free system memory for swap. + # instead, we calculate page file usage based on performance counter + if total > 0: + percentswap = cext.swap_percent() + used = int(0.01 * percentswap * total) + else: + percentswap = 0.0 + used = 0 + + free = total - used + percent = round(percentswap, 1) + return ntp.sswap(total, used, free, percent, 0, 0) + + +# malloc / heap functions +heap_info = cext.heap_info +heap_trim = cext.heap_trim + + +# ===================================================================== +# --- disk +# ===================================================================== + + +disk_io_counters = cext.disk_io_counters + + +def disk_usage(path): + """Return disk usage associated with path.""" + if isinstance(path, bytes): + # XXX: do we want to use "strict"? Probably yes, in order + # to fail immediately. After all we are accepting input here... + path = path.decode(ENCODING, errors="strict") + total, used, free = cext.disk_usage(path) + percent = usage_percent(used, total, round_=1) + return ntp.sdiskusage(total, used, free, percent) + + +def disk_partitions(all): + """Return disk partitions.""" + rawlist = cext.disk_partitions(all) + return [ntp.sdiskpart(*x) for x in rawlist] + + +# ===================================================================== +# --- CPU +# ===================================================================== + + +def cpu_times(): + """Return system CPU times as a named tuple.""" + user, system, idle = cext.cpu_times() + # Internally, GetSystemTimes() is used, and it doesn't return + # interrupt and dpc times. cext.per_cpu_times() does, so we + # rely on it to get those only. + percpu_summed = ntp.scputimes( + *[sum(n) for n in zip(*cext.per_cpu_times())] + ) + return ntp.scputimes( + user, system, idle, percpu_summed.interrupt, percpu_summed.dpc + ) + + +def per_cpu_times(): + """Return system per-CPU times as a list of named tuples.""" + ret = [] + for user, system, idle, interrupt, dpc in cext.per_cpu_times(): + item = ntp.scputimes(user, system, idle, interrupt, dpc) + ret.append(item) + return ret + + +def cpu_count_logical(): + """Return the number of logical CPUs in the system.""" + return cext.cpu_count_logical() + + +def cpu_count_cores(): + """Return the number of CPU cores in the system.""" + return cext.cpu_count_cores() + + +def cpu_stats(): + """Return CPU statistics.""" + ctx_switches, interrupts, _dpcs, syscalls = cext.cpu_stats() + soft_interrupts = 0 + return ntp.scpustats(ctx_switches, interrupts, soft_interrupts, syscalls) + + +def cpu_freq(): + """Return CPU frequency. + On Windows per-cpu frequency is not supported. + """ + curr, max_ = cext.cpu_freq() + min_ = 0.0 + return [ntp.scpufreq(float(curr), min_, float(max_))] + + +_loadavg_initialized = False +_lock = threading.Lock() + + +def _getloadavg_impl(): + # Drop to 2 decimal points which is what Linux does + raw_loads = cext.getloadavg() + return tuple(round(load, 2) for load in raw_loads) + + +def getloadavg(): + """Return the number of processes in the system run queue averaged + over the last 1, 5, and 15 minutes respectively as a tuple. + """ + global _loadavg_initialized + + if _loadavg_initialized: + return _getloadavg_impl() + + with _lock: + if not _loadavg_initialized: + cext.init_loadavg_counter() + _loadavg_initialized = True + + return _getloadavg_impl() + + +# ===================================================================== +# --- network +# ===================================================================== + + +def net_connections(kind, _pid=-1): + """Return socket connections. If pid == -1 return system-wide + connections (as opposed to connections opened by one process only). + """ + families, types = conn_tmap[kind] + rawlist = cext.net_connections(_pid, families, types) + ret = set() + for item in rawlist: + fd, fam, type, laddr, raddr, status, pid = item + nt = conn_to_ntuple( + fd, + fam, + type, + laddr, + raddr, + status, + TCP_STATUSES, + pid=pid if _pid == -1 else None, + ) + ret.add(nt) + return list(ret) + + +def net_if_stats(): + """Get NIC stats (isup, duplex, speed, mtu).""" + ret = {} + rawdict = cext.net_if_stats() + for name, items in rawdict.items(): + isup, duplex, speed, mtu = items + if hasattr(_common, 'NicDuplex'): + duplex = _common.NicDuplex(duplex) + ret[name] = ntp.snicstats(isup, duplex, speed, mtu, '') + return ret + + +def net_io_counters(): + """Return network I/O statistics for every network interface + installed on the system as a dict of raw tuples. + """ + return cext.net_io_counters() + + +def net_if_addrs(): + """Return the addresses associated to each NIC.""" + return cext.net_if_addrs() + + +# ===================================================================== +# --- sensors +# ===================================================================== + + +def sensors_battery(): + """Return battery information.""" + # For constants meaning see: + # https://msdn.microsoft.com/en-us/library/windows/desktop/ + # aa373232(v=vs.85).aspx + acline_status, flags, percent, secsleft = cext.sensors_battery() + power_plugged = acline_status == 1 + no_battery = bool(flags & 128) + charging = bool(flags & 8) + + if no_battery: + return None + if power_plugged or charging: + secsleft = _common.POWER_TIME_UNLIMITED + elif secsleft == -1: + secsleft = _common.POWER_TIME_UNKNOWN + + return ntp.sbattery(percent, secsleft, power_plugged) + + +# ===================================================================== +# --- other system functions +# ===================================================================== + + +_last_btime = 0 + + +def boot_time(): + """The system boot time expressed in seconds since the epoch. This + also includes the time spent during hybernate / suspend. + """ + # This dirty hack is to adjust the precision of the returned + # value which may have a 1 second fluctuation, see: + # https://github.com/giampaolo/psutil/issues/1007 + global _last_btime + ret = time.time() - cext.uptime() + if abs(ret - _last_btime) <= 1: + return _last_btime + else: + _last_btime = ret + return ret + + +def users(): + """Return currently connected users as a list of namedtuples.""" + retlist = [] + rawlist = cext.users() + for item in rawlist: + user, hostname, tstamp = item + nt = ntp.suser(user, None, hostname, tstamp, None) + retlist.append(nt) + return retlist + + +# ===================================================================== +# --- Windows services +# ===================================================================== + + +def win_service_iter(): + """Yields a list of WindowsService instances.""" + for name, display_name in cext.winservice_enumerate(): + yield WindowsService(name, display_name) + + +def win_service_get(name): + """Open a Windows service and return it as a WindowsService instance.""" + service = WindowsService(name, None) + service._display_name = service._query_config()['display_name'] + return service + + +class WindowsService: # noqa: PLW1641 + """Represents an installed Windows service.""" + + def __init__(self, name, display_name): + self._name = name + self._display_name = display_name + + def __str__(self): + details = f"(name={self._name!r}, display_name={self._display_name!r})" + return f"{self.__class__.__name__}{details}" + + def __repr__(self): + return f"<{self.__str__()} at {id(self)}>" + + def __eq__(self, other): + # Test for equality with another WindosService object based + # on name. + if not isinstance(other, WindowsService): + return NotImplemented + return self._name == other._name + + def __ne__(self, other): + return not self == other + + def _query_config(self): + with self._wrap_exceptions(): + display_name, binpath, username, start_type = ( + cext.winservice_query_config(self._name) + ) + # XXX - update _self.display_name? + return dict( + display_name=display_name, + binpath=binpath, + username=username, + start_type=start_type, + ) + + def _query_status(self): + with self._wrap_exceptions(): + status, pid = cext.winservice_query_status(self._name) + if pid == 0: + pid = None + return dict(status=status, pid=pid) + + @contextlib.contextmanager + def _wrap_exceptions(self): + """Ctx manager which translates bare OSError and WindowsError + exceptions into NoSuchProcess and AccessDenied. + """ + try: + yield + except OSError as err: + name = self._name + if is_permission_err(err): + msg = ( + f"service {name!r} is not querable (not enough privileges)" + ) + raise AccessDenied(pid=None, name=name, msg=msg) from err + elif err.winerror in { + cext.ERROR_INVALID_NAME, + cext.ERROR_SERVICE_DOES_NOT_EXIST, + }: + msg = f"service {name!r} does not exist" + raise NoSuchProcess(pid=None, name=name, msg=msg) from err + else: + raise + + # config query + + def name(self): + """The service name. This string is how a service is referenced + and can be passed to win_service_get() to get a new + WindowsService instance. + """ + return self._name + + def display_name(self): + """The service display name. The value is cached when this class + is instantiated. + """ + return self._display_name + + def binpath(self): + """The fully qualified path to the service binary/exe file as + a string, including command line arguments. + """ + return self._query_config()['binpath'] + + def username(self): + """The name of the user that owns this service.""" + return self._query_config()['username'] + + def start_type(self): + """A string which can either be "automatic", "manual" or + "disabled". + """ + return self._query_config()['start_type'] + + # status query + + def pid(self): + """The process PID, if any, else None. This can be passed + to Process class to control the service's process. + """ + return self._query_status()['pid'] + + def status(self): + """Service status as a string.""" + return self._query_status()['status'] + + def description(self): + """Service long description.""" + return cext.winservice_query_descr(self.name()) + + # utils + + def as_dict(self): + """Utility method retrieving all the information above as a + dictionary. + """ + d = self._query_config() + d.update(self._query_status()) + d['name'] = self.name() + d['display_name'] = self.display_name() + d['description'] = self.description() + return d + + # actions + # XXX: the necessary C bindings for start() and stop() are + # implemented but for now I prefer not to expose them. + # I may change my mind in the future. Reasons: + # - they require Administrator privileges + # - can't implement a timeout for stop() (unless by using a thread, + # which sucks) + # - would require adding ServiceAlreadyStarted and + # ServiceAlreadyStopped exceptions, adding two new APIs. + # - we might also want to have modify(), which would basically mean + # rewriting win32serviceutil.ChangeServiceConfig, which involves a + # lot of stuff (and API constants which would pollute the API), see: + # http://pyxr.sourceforge.net/PyXR/c/python24/lib/site-packages/ + # win32/lib/win32serviceutil.py.html#0175 + # - psutil is typically about "read only" monitoring stuff; + # win_service_* APIs should only be used to retrieve a service and + # check whether it's running + + # def start(self, timeout=None): + # with self._wrap_exceptions(): + # cext.winservice_start(self.name()) + # if timeout: + # giveup_at = time.time() + timeout + # while True: + # if self.status() == "running": + # return + # else: + # if time.time() > giveup_at: + # raise TimeoutExpired(timeout) + # else: + # time.sleep(.1) + + # def stop(self): + # # Note: timeout is not implemented because it's just not + # # possible, see: + # # http://stackoverflow.com/questions/11973228/ + # with self._wrap_exceptions(): + # return cext.winservice_stop(self.name()) + + +# ===================================================================== +# --- processes +# ===================================================================== + + +pids = cext.pids +pid_exists = cext.pid_exists +ppid_map = cext.ppid_map # used internally by Process.children() + + +def is_permission_err(exc): + """Return True if this is a permission error.""" + assert isinstance(exc, OSError), exc + return isinstance(exc, PermissionError) or exc.winerror in { + cext.ERROR_ACCESS_DENIED, + cext.ERROR_PRIVILEGE_NOT_HELD, + } + + +def convert_oserror(exc, pid=None, name=None): + """Convert OSError into NoSuchProcess or AccessDenied.""" + assert isinstance(exc, OSError), exc + if is_permission_err(exc): + return AccessDenied(pid=pid, name=name) + if isinstance(exc, ProcessLookupError): + return NoSuchProcess(pid=pid, name=name) + raise exc + + +def wrap_exceptions(fun): + """Decorator which converts OSError into NoSuchProcess or AccessDenied.""" + + @functools.wraps(fun) + def wrapper(self, *args, **kwargs): + try: + return fun(self, *args, **kwargs) + except OSError as err: + raise convert_oserror(err, pid=self.pid, name=self._name) from err + + return wrapper + + +def retry_error_partial_copy(fun): + """Workaround for https://github.com/giampaolo/psutil/issues/875. + See: https://stackoverflow.com/questions/4457745#4457745. + """ + + @functools.wraps(fun) + def wrapper(self, *args, **kwargs): + delay = 0.0001 + times = 33 + for _ in range(times): # retries for roughly 1 second + try: + return fun(self, *args, **kwargs) + except OSError as _: + err = _ + if err.winerror == ERROR_PARTIAL_COPY: + time.sleep(delay) + delay = min(delay * 2, 0.04) + continue + raise + msg = ( + f"{fun} retried {times} times, converted to AccessDenied as it's " + f"still returning {err}" + ) + raise AccessDenied(pid=self.pid, name=self._name, msg=msg) + + return wrapper + + +class Process: + """Wrapper class around underlying C implementation.""" + + __slots__ = ["_cache", "_name", "_ppid", "pid"] + + def __init__(self, pid): + self.pid = pid + self._name = None + self._ppid = None + + # --- oneshot() stuff + + def oneshot_enter(self): + self._proc_info.cache_activate(self) + self.exe.cache_activate(self) + + def oneshot_exit(self): + self._proc_info.cache_deactivate(self) + self.exe.cache_deactivate(self) + + @memoize_when_activated + def _proc_info(self): + """Return multiple information about this process as a + raw tuple. + """ + ret = cext.proc_info(self.pid) + assert len(ret) == len(pinfo_map) + return ret + + def name(self): + """Return process name, which on Windows is always the final + part of the executable. + """ + # This is how PIDs 0 and 4 are always represented in taskmgr + # and process-hacker. + if self.pid == 0: + return "System Idle Process" + if self.pid == 4: + return "System" + return os.path.basename(self.exe()) + + @wrap_exceptions + @memoize_when_activated + def exe(self): + if PYPY: + try: + exe = cext.proc_exe(self.pid) + except OSError as err: + # 24 = ERROR_TOO_MANY_OPEN_FILES. Not sure why this happens + # (perhaps PyPy's JIT delaying garbage collection of files?). + if err.errno == 24: + debug(f"{err!r} translated into AccessDenied") + raise AccessDenied(self.pid, self._name) from err + raise + else: + exe = cext.proc_exe(self.pid) + if exe.startswith('\\'): + return convert_dos_path(exe) + return exe # May be "Registry", "MemCompression", ... + + @wrap_exceptions + @retry_error_partial_copy + def cmdline(self): + if cext.WINVER >= cext.WINDOWS_8_1: + # PEB method detects cmdline changes but requires more + # privileges: https://github.com/giampaolo/psutil/pull/1398 + try: + return cext.proc_cmdline(self.pid, use_peb=True) + except OSError as err: + if is_permission_err(err): + return cext.proc_cmdline(self.pid, use_peb=False) + else: + raise + else: + return cext.proc_cmdline(self.pid, use_peb=True) + + @wrap_exceptions + @retry_error_partial_copy + def environ(self): + s = cext.proc_environ(self.pid) + return parse_environ_block(s) + + def ppid(self): + try: + return ppid_map()[self.pid] + except KeyError: + raise NoSuchProcess(self.pid, self._name) from None + + def _get_raw_meminfo(self): + try: + return cext.proc_memory_info(self.pid) + except OSError as err: + if is_permission_err(err): + # TODO: the C ext can probably be refactored in order + # to get this from cext.proc_info() + debug("attempting memory_info() fallback (slower)") + info = self._proc_info() + return ( + info[pinfo_map['num_page_faults']], + info[pinfo_map['peak_wset']], + info[pinfo_map['wset']], + info[pinfo_map['peak_paged_pool']], + info[pinfo_map['paged_pool']], + info[pinfo_map['peak_non_paged_pool']], + info[pinfo_map['non_paged_pool']], + info[pinfo_map['pagefile']], + info[pinfo_map['peak_pagefile']], + info[pinfo_map['mem_private']], + ) + raise + + @wrap_exceptions + def memory_info(self): + # on Windows RSS == WorkingSetSize and VSM == PagefileUsage. + # Underlying C function returns fields of PROCESS_MEMORY_COUNTERS + # struct. + t = self._get_raw_meminfo() + rss = t[2] # wset + vms = t[7] # pagefile + return ntp.pmem(*(rss, vms) + t) + + @wrap_exceptions + def memory_full_info(self): + basic_mem = self.memory_info() + uss = cext.proc_memory_uss(self.pid) + uss *= getpagesize() + return ntp.pfullmem(*basic_mem + (uss,)) + + def memory_maps(self): + try: + raw = cext.proc_memory_maps(self.pid) + except OSError as err: + # XXX - can't use wrap_exceptions decorator as we're + # returning a generator; probably needs refactoring. + raise convert_oserror(err, self.pid, self._name) from err + else: + for addr, perm, path, rss in raw: + path = convert_dos_path(path) + addr = hex(addr) + yield (addr, perm, path, rss) + + @wrap_exceptions + def kill(self): + return cext.proc_kill(self.pid) + + @wrap_exceptions + def send_signal(self, sig): + if sig == signal.SIGTERM: + cext.proc_kill(self.pid) + elif sig in {signal.CTRL_C_EVENT, signal.CTRL_BREAK_EVENT}: + os.kill(self.pid, sig) + else: + msg = ( + "only SIGTERM, CTRL_C_EVENT and CTRL_BREAK_EVENT signals " + "are supported on Windows" + ) + raise ValueError(msg) + + @wrap_exceptions + def wait(self, timeout=None): + if timeout is None: + cext_timeout = cext.INFINITE + else: + # WaitForSingleObject() expects time in milliseconds. + cext_timeout = int(timeout * 1000) + + timer = getattr(time, 'monotonic', time.time) + stop_at = timer() + timeout if timeout is not None else None + + try: + # Exit code is supposed to come from GetExitCodeProcess(). + # May also be None if OpenProcess() failed with + # ERROR_INVALID_PARAMETER, meaning PID is already gone. + exit_code = cext.proc_wait(self.pid, cext_timeout) + except cext.TimeoutExpired as err: + # WaitForSingleObject() returned WAIT_TIMEOUT. Just raise. + raise TimeoutExpired(timeout, self.pid, self._name) from err + except cext.TimeoutAbandoned: + # WaitForSingleObject() returned WAIT_ABANDONED, see: + # https://github.com/giampaolo/psutil/issues/1224 + # We'll just rely on the internal polling and return None + # when the PID disappears. Subprocess module does the same + # (return None): + # https://github.com/python/cpython/blob/ + # be50a7b627d0aa37e08fa8e2d5568891f19903ce/ + # Lib/subprocess.py#L1193-L1194 + exit_code = None + + # At this point WaitForSingleObject() returned WAIT_OBJECT_0, + # meaning the process is gone. Stupidly there are cases where + # its PID may still stick around so we do a further internal + # polling. + delay = 0.0001 + while True: + if not pid_exists(self.pid): + return exit_code + if stop_at and timer() >= stop_at: + raise TimeoutExpired(timeout, pid=self.pid, name=self._name) + time.sleep(delay) + delay = min(delay * 2, 0.04) # incremental delay + + @wrap_exceptions + def username(self): + if self.pid in {0, 4}: + return 'NT AUTHORITY\\SYSTEM' + domain, user = cext.proc_username(self.pid) + return f"{domain}\\{user}" + + @wrap_exceptions + def create_time(self, fast_only=False): + # Note: proc_times() not put under oneshot() 'cause create_time() + # is already cached by the main Process class. + try: + _user, _system, created = cext.proc_times(self.pid) + return created + except OSError as err: + if is_permission_err(err): + if fast_only: + raise + debug("attempting create_time() fallback (slower)") + return self._proc_info()[pinfo_map['create_time']] + raise + + @wrap_exceptions + def num_threads(self): + return self._proc_info()[pinfo_map['num_threads']] + + @wrap_exceptions + def threads(self): + rawlist = cext.proc_threads(self.pid) + retlist = [] + for thread_id, utime, stime in rawlist: + ntuple = ntp.pthread(thread_id, utime, stime) + retlist.append(ntuple) + return retlist + + @wrap_exceptions + def cpu_times(self): + try: + user, system, _created = cext.proc_times(self.pid) + except OSError as err: + if not is_permission_err(err): + raise + debug("attempting cpu_times() fallback (slower)") + info = self._proc_info() + user = info[pinfo_map['user_time']] + system = info[pinfo_map['kernel_time']] + # Children user/system times are not retrievable (set to 0). + return ntp.pcputimes(user, system, 0.0, 0.0) + + @wrap_exceptions + def suspend(self): + cext.proc_suspend_or_resume(self.pid, True) + + @wrap_exceptions + def resume(self): + cext.proc_suspend_or_resume(self.pid, False) + + @wrap_exceptions + @retry_error_partial_copy + def cwd(self): + if self.pid in {0, 4}: + raise AccessDenied(self.pid, self._name) + # return a normalized pathname since the native C function appends + # "\\" at the and of the path + path = cext.proc_cwd(self.pid) + return os.path.normpath(path) + + @wrap_exceptions + def open_files(self): + if self.pid in {0, 4}: + return [] + ret = set() + # Filenames come in in native format like: + # "\Device\HarddiskVolume1\Windows\systemew\file.txt" + # Convert the first part in the corresponding drive letter + # (e.g. "C:\") by using Windows's QueryDosDevice() + raw_file_names = cext.proc_open_files(self.pid) + for file in raw_file_names: + file = convert_dos_path(file) + if isfile_strict(file): + ntuple = ntp.popenfile(file, -1) + ret.add(ntuple) + return list(ret) + + @wrap_exceptions + def net_connections(self, kind='inet'): + return net_connections(kind, _pid=self.pid) + + @wrap_exceptions + def nice_get(self): + value = cext.proc_priority_get(self.pid) + value = Priority(value) + return value + + @wrap_exceptions + def nice_set(self, value): + return cext.proc_priority_set(self.pid, value) + + @wrap_exceptions + def ionice_get(self): + ret = cext.proc_io_priority_get(self.pid) + ret = IOPriority(ret) + return ret + + @wrap_exceptions + def ionice_set(self, ioclass, value): + if value: + msg = "value argument not accepted on Windows" + raise TypeError(msg) + if ioclass not in { + IOPriority.IOPRIO_VERYLOW, + IOPriority.IOPRIO_LOW, + IOPriority.IOPRIO_NORMAL, + IOPriority.IOPRIO_HIGH, + }: + msg = f"{ioclass} is not a valid priority" + raise ValueError(msg) + cext.proc_io_priority_set(self.pid, ioclass) + + @wrap_exceptions + def io_counters(self): + try: + ret = cext.proc_io_counters(self.pid) + except OSError as err: + if not is_permission_err(err): + raise + debug("attempting io_counters() fallback (slower)") + info = self._proc_info() + ret = ( + info[pinfo_map['io_rcount']], + info[pinfo_map['io_wcount']], + info[pinfo_map['io_rbytes']], + info[pinfo_map['io_wbytes']], + info[pinfo_map['io_count_others']], + info[pinfo_map['io_bytes_others']], + ) + return ntp.pio(*ret) + + @wrap_exceptions + def status(self): + suspended = cext.proc_is_suspended(self.pid) + if suspended: + return _common.STATUS_STOPPED + else: + return _common.STATUS_RUNNING + + @wrap_exceptions + def cpu_affinity_get(self): + def from_bitmask(x): + return [i for i in range(64) if (1 << i) & x] + + bitmask = cext.proc_cpu_affinity_get(self.pid) + return from_bitmask(bitmask) + + @wrap_exceptions + def cpu_affinity_set(self, value): + def to_bitmask(ls): + if not ls: + msg = f"invalid argument {ls!r}" + raise ValueError(msg) + out = 0 + for b in ls: + out |= 2**b + return out + + # SetProcessAffinityMask() states that ERROR_INVALID_PARAMETER + # is returned for an invalid CPU but this seems not to be true, + # therefore we check CPUs validy beforehand. + allcpus = list(range(len(per_cpu_times()))) + for cpu in value: + if cpu not in allcpus: + if not isinstance(cpu, int): + msg = f"invalid CPU {cpu!r}; an integer is required" + raise TypeError(msg) + msg = f"invalid CPU {cpu!r}" + raise ValueError(msg) + + bitmask = to_bitmask(value) + cext.proc_cpu_affinity_set(self.pid, bitmask) + + @wrap_exceptions + def num_handles(self): + try: + return cext.proc_num_handles(self.pid) + except OSError as err: + if is_permission_err(err): + debug("attempting num_handles() fallback (slower)") + return self._proc_info()[pinfo_map['num_handles']] + raise + + @wrap_exceptions + def num_ctx_switches(self): + ctx_switches = self._proc_info()[pinfo_map['ctx_switches']] + # only voluntary ctx switches are supported + return ntp.pctxsw(ctx_switches, 0) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/about.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/about.json new file mode 100644 index 0000000000000000000000000000000000000000..fe1f99066b76b29de8050a2ec1937ca9d76c4ec9 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/about.json @@ -0,0 +1,16 @@ +{ + "channels": [ + "https://conda.anaconda.org/conda-forge/" + ], + "description": "psutil (process and system utilities) is a cross-platform library for\nretrieving information on running processes and system utilization (CPU,\nmemory, disks, network) in Python. It is useful mainly for system\nmonitoring, profiling and limiting process resources and management of\nrunning processes.", + "dev_url": "https://github.com/giampaolo/psutil", + "doc_url": "https://psutil.readthedocs.io/", + "extra": { + "flow_run_id": "azure_20260129.4.1", + "remote_url": "https://github.com/conda-forge/psutil-feedstock", + "sha": "bbd3baefd9321a72c980b9419495043d4e44b3a1" + }, + "home": "https://github.com/giampaolo/psutil", + "license": "BSD-3-Clause", + "summary": "A cross-platform process and system utilities module for Python" +} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/hash_input.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/hash_input.json new file mode 100644 index 0000000000000000000000000000000000000000..7ff135c11742d46afbd10b5a8788154d5227f212 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/hash_input.json @@ -0,0 +1 @@ +{"build_platform": "win-64", "c_compiler": "vs2022", "c_stdlib": "vs", "channel_sources": "conda-forge", "channel_targets": "conda-forge main", "python": "3.14.* *_cp314", "target_platform": "win-64"} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/index.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/index.json new file mode 100644 index 0000000000000000000000000000000000000000..27fb6ac61babb318c32bb7960def649de6ace49e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/index.json @@ -0,0 +1,18 @@ +{ + "arch": "x86_64", + "build": "py314hc5dbbe4_0", + "build_number": 0, + "depends": [ + "python", + "vc >=14.3,<15", + "vc14_runtime >=14.44.35208", + "ucrt >=10.0.20348.0", + "python_abi 3.14.* *_cp314" + ], + "license": "BSD-3-Clause", + "name": "psutil", + "platform": "win", + "subdir": "win-64", + "timestamp": 1769678167309, + "version": "7.2.2" +} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/licenses/LICENSE b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..cff5eb74e1badd1c5237ed2654b349530179ad1d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/licenses/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2009, Jay Loden, Dave Daeschler, Giampaolo Rodola +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 psutil authors 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. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/paths.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/paths.json new file mode 100644 index 0000000000000000000000000000000000000000..0b8f5716e1a8c81d9d762f7cb6b930b7a6d09929 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/paths.json @@ -0,0 +1,179 @@ +{ + "paths": [ + { + "_path": "Lib/site-packages/psutil/__init__.py", + "path_type": "hardlink", + "sha256": "1cb305b79117618658c80bc71910524e53724caa6a0bbd2cc1e30c8af8bb64d9", + "size_in_bytes": 89857 + }, + { + "_path": "Lib/site-packages/psutil/__pycache__/__init__.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "9e7183a8fc001ae0e9e62a42777d4f645b9b7f5da69a4f6d0c4d2acbbbc29b4c", + "size_in_bytes": 91738 + }, + { + "_path": "Lib/site-packages/psutil/__pycache__/_common.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "e926e673b4b4267b5b46f4ab8f717c6bbae7d75abc1699177a105cc733249e5c", + "size_in_bytes": 33206 + }, + { + "_path": "Lib/site-packages/psutil/__pycache__/_ntuples.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "2f0136f93cda1ff3aca4b563e2b9b4434057f0a9201931bfd8f81c20cf9a4bf8", + "size_in_bytes": 5778 + }, + { + "_path": "Lib/site-packages/psutil/__pycache__/_psaix.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "39aed584f78d13a69951270b9761124f8fd1e2cbc3f70b136ad9d5e4627436a3", + "size_in_bytes": 25048 + }, + { + "_path": "Lib/site-packages/psutil/__pycache__/_psbsd.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "34f32729a1230f274e53a0ed4205b1e5c680e5f340ca0ee34843c5796e692f21", + "size_in_bytes": 35092 + }, + { + "_path": "Lib/site-packages/psutil/__pycache__/_pslinux.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "42bdd1ff6632cd8f588c30a0d8712659e5ae93de46d92a670a49ffc1d76929c0", + "size_in_bytes": 93480 + }, + { + "_path": "Lib/site-packages/psutil/__pycache__/_psosx.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "8bd0530f83ab18e98c0b8a21c46d7f6a35ea0bfb2cd0da3561e87cbc4c9b411d", + "size_in_bytes": 22678 + }, + { + "_path": "Lib/site-packages/psutil/__pycache__/_psposix.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "f9b7557980a9ea78cbe76c9edd5db2cdbdf297073fdaa94f368e59536d2b3739", + "size_in_bytes": 12410 + }, + { + "_path": "Lib/site-packages/psutil/__pycache__/_pssunos.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "9a66106648e0e3816532c6513a306fd755cf4048339942e80349b6c6311738c0", + "size_in_bytes": 30697 + }, + { + "_path": "Lib/site-packages/psutil/__pycache__/_pswindows.cpython-314.pyc", + "path_type": "hardlink", + "sha256": "e67dcb034459ca7bc0f114470bb8313ff2609c53f1e1ae34fab4d7c8edd1b67d", + "size_in_bytes": 44824 + }, + { + "_path": "Lib/site-packages/psutil/_common.py", + "path_type": "hardlink", + "sha256": "1bbce9fd97e6f5439a0d385f28401f527c5a9d978d9d062593d7ef6fe215fc75", + "size_in_bytes": 25254 + }, + { + "_path": "Lib/site-packages/psutil/_ntuples.py", + "path_type": "hardlink", + "sha256": "9b8e8b938abae2786a515f686f4d8132218be897eb6b459b9324ed17d88a31c7", + "size_in_bytes": 10970 + }, + { + "_path": "Lib/site-packages/psutil/_psaix.py", + "path_type": "hardlink", + "sha256": "afe4038d5e1454559f17dac9e6c2c56ad8cf873d43880f6503e8549cc06a18ec", + "size_in_bytes": 17616 + }, + { + "_path": "Lib/site-packages/psutil/_psbsd.py", + "path_type": "hardlink", + "sha256": "c1a8314a9640649c99197ff261dbeec1f0080175e4a3f6b5cb370a39332deb94", + "size_in_bytes": 29263 + }, + { + "_path": "Lib/site-packages/psutil/_pslinux.py", + "path_type": "hardlink", + "sha256": "a8a09bab87848075b691c46112b00692745785a8c9d5a2c87037ae124b469749", + "size_in_bytes": 84787 + }, + { + "_path": "Lib/site-packages/psutil/_psosx.py", + "path_type": "hardlink", + "sha256": "89f0ea0e9c1fe38f224b612792bf31d07c8880d79281806e5379c00514f6b3f2", + "size_in_bytes": 15913 + }, + { + "_path": "Lib/site-packages/psutil/_psposix.py", + "path_type": "hardlink", + "sha256": "288887b58f5939e3b00e021f6e7b490c2f7f4852804a359918ab7d9c6fb39839", + "size_in_bytes": 11575 + }, + { + "_path": "Lib/site-packages/psutil/_pssunos.py", + "path_type": "hardlink", + "sha256": "cc348442008a54cb6054299b2ecae0d9a123c07bb4ba1f8e14b319487f83cee5", + "size_in_bytes": 23934 + }, + { + "_path": "Lib/site-packages/psutil/_psutil_windows.pyd", + "path_type": "hardlink", + "sha256": "cbf2b00fb07cb0720d13c21d5bdb04d886f04c0f85ce2cf3d040cde8d3d29029", + "size_in_bytes": 71680 + }, + { + "_path": "Lib/site-packages/psutil/_pswindows.py", + "path_type": "hardlink", + "sha256": "580ad391de734c113682200ee9f4245e34737f5e26af0a73a4e8c9b4458de220", + "size_in_bytes": 35370 + }, + { + "_path": "Lib/site-packages/psutil-7.2.2.dist-info/INSTALLER", + "path_type": "hardlink", + "sha256": "bc33022edcb7639ff53355b4e91dade50a0bbf0299efeb6171d1ec0ba5029cfc", + "size_in_bytes": 6 + }, + { + "_path": "Lib/site-packages/psutil-7.2.2.dist-info/METADATA", + "path_type": "hardlink", + "sha256": "eec3ff501da1fc32231bf81399f0a480c0b229a0580ee5298cdbb35ab6552103", + "size_in_bytes": 22973 + }, + { + "_path": "Lib/site-packages/psutil-7.2.2.dist-info/RECORD", + "path_type": "hardlink", + "sha256": "938d83ecb374f796b14a6eb701560ec677272f3ddf70e55b928f5d5596be483d", + "size_in_bytes": 1979 + }, + { + "_path": "Lib/site-packages/psutil-7.2.2.dist-info/REQUESTED", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "Lib/site-packages/psutil-7.2.2.dist-info/WHEEL", + "path_type": "hardlink", + "sha256": "70c7105b1af498f84544f8f044ccd03b83780f025577153d5a3834f02cb3d41e", + "size_in_bytes": 100 + }, + { + "_path": "Lib/site-packages/psutil-7.2.2.dist-info/direct_url.json", + "path_type": "hardlink", + "sha256": "561f04975916eae952aff29fe23c162bccb5a6aa3c9f32933da7832449994957", + "size_in_bytes": 82 + }, + { + "_path": "Lib/site-packages/psutil-7.2.2.dist-info/licenses/LICENSE", + "path_type": "hardlink", + "sha256": "b89c063b3786e28e0c0a38f1931db61fed35e69dd2a2966fbecffee0f46c8d10", + "size_in_bytes": 1548 + }, + { + "_path": "Lib/site-packages/psutil-7.2.2.dist-info/top_level.txt", + "path_type": "hardlink", + "sha256": "8023619f9ef0ce4b038d20084a680c2746a25f342e964d062616f6f81032620c", + "size_in_bytes": 7 + } + ], + "paths_version": 1 +} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/recipe/recipe-scripts-license.txt b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/recipe/recipe-scripts-license.txt new file mode 100644 index 0000000000000000000000000000000000000000..f093e06198e8f9997e31fe9bf3cedf8d12a5c6dd --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/recipe/recipe-scripts-license.txt @@ -0,0 +1,27 @@ +BSD-3-Clause license +Copyright (c) 2015-2022, conda-forge contributors +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 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. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/recipe/recipe.yaml b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/recipe/recipe.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f50f42982f57b817a1233f3b0102027f4b907cdf --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/recipe/recipe.yaml @@ -0,0 +1,73 @@ +schema_version: 1 + +context: + version: "7.2.2" + sha256: 0746f5f8d406af344fd547f1c8daa5f5c33dbc293bb8d6a16d80b4bb88f59372 + +package: + name: psutil + version: ${{ version }} + +source: + url: https://pypi.org/packages/source/p/psutil/psutil-${{ version }}.tar.gz + sha256: ${{ sha256 }} + +build: + number: 0 + script: + # macOS renamed this variable, but it is `NULL` in either case. + # Workaround the missing definition by setting it to `0`. + # + # xref: https://github.com/giampaolo/psutil/issues/2354 + - if: osx + then: export CFLAGS="${CFLAGS} -DkIOMainPortDefault=0" + - ${{ PYTHON }} -m pip install --ignore-installed --no-deps . + +requirements: + build: + - if: build_platform != target_platform + then: + - python + - cross-python_${{ target_platform }} + - ${{ compiler("c") }} + - ${{ stdlib("c") }} + host: + - python + - pip + - setuptools >=43 + - wheel + run: + - python + +tests: + - python: + imports: + - psutil + - if: linux + then: psutil._psutil_linux + - if: osx + then: psutil._psutil_osx + - if: win + then: psutil._psutil_windows + +about: + license: BSD-3-Clause + license_file: LICENSE + summary: A cross-platform process and system utilities module for Python + description: | + psutil (process and system utilities) is a cross-platform library for + retrieving information on running processes and system utilization (CPU, + memory, disks, network) in Python. It is useful mainly for system + monitoring, profiling and limiting process resources and management of + running processes. + homepage: https://github.com/giampaolo/psutil + repository: https://github.com/giampaolo/psutil + documentation: https://psutil.readthedocs.io + +extra: + recipe-maintainers: + - jan-janssen + - gqmelo + - jakirkham + - pelson + - nehaljwani diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/recipe/rendered_recipe.yaml b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/recipe/rendered_recipe.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6155d3b60fbdc12043aa93b9c230e974f250b734 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/recipe/rendered_recipe.yaml @@ -0,0 +1,673 @@ +recipe: + schema_version: 1 + context: + version: 7.2.2 + sha256: 0746f5f8d406af344fd547f1c8daa5f5c33dbc293bb8d6a16d80b4bb88f59372 + package: + name: psutil + version: 7.2.2 + source: + - url: https://pypi.org/packages/source/p/psutil/psutil-7.2.2.tar.gz + sha256: 0746f5f8d406af344fd547f1c8daa5f5c33dbc293bb8d6a16d80b4bb88f59372 + build: + number: 0 + string: py314hc5dbbe4_0 + script: ${{ PYTHON }} -m pip install --ignore-installed --no-deps . + requirements: + build: + - vs2022_win-64 + - vs_win-64 + host: + - python + - pip + - setuptools >=43 + - wheel + run: + - python + tests: + - python: + imports: + - psutil + - psutil._psutil_windows + about: + homepage: https://github.com/giampaolo/psutil + repository: https://github.com/giampaolo/psutil + documentation: https://psutil.readthedocs.io/ + license: BSD-3-Clause + license_file: + - LICENSE + summary: A cross-platform process and system utilities module for Python + description: |- + psutil (process and system utilities) is a cross-platform library for + retrieving information on running processes and system utilization (CPU, + memory, disks, network) in Python. It is useful mainly for system + monitoring, profiling and limiting process resources and management of + running processes. + extra: + recipe-maintainers: + - jan-janssen + - gqmelo + - jakirkham + - pelson + - nehaljwani +build_configuration: + target_platform: win-64 + host_platform: + platform: win-64 + virtual_packages: + - __win=10.0.20348=0 + - __archspec=1=x86_64_v3 + build_platform: + platform: win-64 + virtual_packages: + - __win=10.0.20348=0 + - __archspec=1=x86_64_v3 + variant: + build_platform: win-64 + c_compiler: vs2022 + c_stdlib: vs + channel_sources: conda-forge + channel_targets: conda-forge main + python: 3.14.* *_cp314 + target_platform: win-64 + hash: + hash: c5dbbe4 + prefix: py314 + directories: + host_prefix: D:\bld\bld\rattler-build_psutil_1769678167\h_env + build_prefix: D:\bld\bld\rattler-build_psutil_1769678167\build_env + work_dir: D:\bld\bld\rattler-build_psutil_1769678167\work + build_dir: D:\bld\bld\rattler-build_psutil_1769678167 + channels: + - https://conda.anaconda.org/conda-forge + channel_priority: strict + solve_strategy: highest + timestamp: 2026-01-29T09:16:07.309026800Z + subpackages: + psutil: + name: psutil + version: 7.2.2 + build_string: py314hc5dbbe4_0 + packaging_settings: + archive_type: conda + compression_level: 15 +finalized_dependencies: + build: + specs: + - source: vs2022_win-64 + - source: vs_win-64 + resolved: + - build: ha74f236_34 + build_number: 34 + constrains: + - vs_win-64 2022.14 + depends: + - vswhere + license: BSD-3-Clause + license_family: BSD + md5: 1d699ffd41c140b98e199ddd9787e1e1 + name: vs2022_win-64 + run_exports: + strong: + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + sha256: 05bc657625b58159bcea039a35cc89d1f8baf54bf4060019c2b559a03ba4a45e + size: 23060 + subdir: win-64 + timestamp: 1767320175868 + track_features: vc14 + version: 19.44.35207 + fn: vs2022_win-64-19.44.35207-ha74f236_34.conda + url: https://conda.anaconda.org/conda-forge/win-64/vs2022_win-64-19.44.35207-ha74f236_34.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: ha74f236_34 + build_number: 34 + depends: + - vs2022_win-64 19.44.35207.* + license: BSD-3-Clause + license_family: BSD + md5: b8f1c3f5c2347270f0fa06385ab16c5c + name: vs_win-64 + run_exports: + strong: + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + sha256: b07ba17e1f407eba3e8c714530cce9b111439e3ffecd123e58555308a7304a60 + size: 19606 + subdir: win-64 + timestamp: 1767320221083 + track_features: vc14 + version: '2022.14' + fn: vs_win-64-2022.14-ha74f236_34.conda + url: https://conda.anaconda.org/conda-forge/win-64/vs_win-64-2022.14-ha74f236_34.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h40126e0_1 + build_number: 1 + depends: + - __win + license: MIT + license_family: MIT + md5: f622897afff347b715d046178ad745a5 + name: vswhere + noarch: generic + run_exports: {} + sha256: b72270395326dc56de9bd6ca82f63791b3c8c9e2b98e25242a9869a4ca821895 + size: 238764 + subdir: noarch + timestamp: 1745560912727 + version: 3.1.7 + fn: vswhere-3.1.7-h40126e0_1.conda + url: https://conda.anaconda.org/conda-forge/noarch/vswhere-3.1.7-h40126e0_1.conda + channel: https://conda.anaconda.org/conda-forge/ + host: + specs: + - variant: python + spec: python 3.14.* *_cp314 + - source: pip + - source: setuptools >=43 + - source: wheel + - spec: vc >=14.3,<15 + from: build + run_export: vs2022_win-64 + - spec: vc14_runtime >=14.44.35208 + from: build + run_export: vs2022_win-64 + - spec: ucrt >=10.0.20348.0 + from: build + run_export: vs2022_win-64 + - spec: vc >=14.3,<15 + from: build + run_export: vs_win-64 + - spec: vc14_runtime >=14.44.35208 + from: build + run_export: vs_win-64 + - spec: ucrt >=10.0.20348.0 + from: build + run_export: vs_win-64 + resolved: + - build: h4b44e0e_101_cp314 + build_number: 101 + depends: + - bzip2 >=1.0.8,<2.0a0 + - libexpat >=2.7.3,<3.0a0 + - libffi >=3.5.2,<3.6.0a0 + - liblzma >=5.8.2,<6.0a0 + - libmpdec >=4.0.0,<5.0a0 + - libsqlite >=3.51.2,<4.0a0 + - libzlib >=1.3.1,<2.0a0 + - openssl >=3.5.4,<4.0a0 + - python_abi 3.14.* *_cp314 + - tk >=8.6.13,<8.7.0a0 + - tzdata + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - zstd >=1.5.7,<1.6.0a0 + license: Python-2.0 + md5: 9ac6a99d9cf8a463df54747fd08feedc + name: python + python_site_packages_path: Lib/site-packages + run_exports: + weak: + - python_abi 3.14.* *_cp314 + noarch: + - python + sha256: e9f1aad2a859cc10e58e1c21e379250064bc8703f07464ccfa6cdd942a29a045 + size: 16629248 + subdir: win-64 + timestamp: 1769457277306 + version: 3.14.2 + fn: python-3.14.2-h4b44e0e_101_cp314.conda + url: https://conda.anaconda.org/conda-forge/win-64/python-3.14.2-h4b44e0e_101_cp314.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: 8_cp314 + build_number: 8 + constrains: + - python 3.14.* *_cp314 + depends: [] + license: BSD-3-Clause + license_family: BSD + md5: 0539938c55b6b1a59b560e843ad864a4 + name: python_abi + noarch: generic + run_exports: {} + sha256: ad6d2e9ac39751cc0529dd1566a26751a0bf2542adb0c232533d32e176e21db5 + size: 6989 + subdir: noarch + timestamp: 1752805904792 + version: '3.14' + fn: python_abi-3.14-8_cp314.conda + url: https://conda.anaconda.org/conda-forge/noarch/python_abi-3.14-8_cp314.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: hf5d6505_0 + build_number: 0 + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: blessing + md5: 903979414b47d777d548e5f0165e6cd8 + name: libsqlite + run_exports: + weak: + - libsqlite >=3.51.2,<4.0a0 + sha256: 756478128e3e104bd7e7c3ce6c1b0efad7e08c7320c69fdc726e039323c63fbb + size: 1291616 + subdir: win-64 + timestamp: 1768148278261 + version: 3.51.2 + fn: libsqlite-3.51.2-hf5d6505_0.conda + url: https://conda.anaconda.org/conda-forge/win-64/libsqlite-3.51.2-hf5d6505_0.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: hfd05255_0 + build_number: 0 + constrains: + - xz 5.8.2.* + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: 0BSD + md5: ba0bfd4c3cf73f299ffe46ff0eaeb8e3 + name: liblzma + run_exports: + weak: + - liblzma >=5.8.2,<6.0a0 + sha256: f25bf293f550c8ed2e0c7145eb404324611cfccff37660869d97abf526eb957c + size: 106169 + subdir: win-64 + timestamp: 1768752763559 + version: 5.8.2 + fn: liblzma-5.8.2-hfd05255_0.conda + url: https://conda.anaconda.org/conda-forge/win-64/liblzma-5.8.2-hfd05255_0.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: hac47afa_0 + build_number: 0 + constrains: + - expat 2.7.3.* + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: MIT + license_family: MIT + md5: 8c9e4f1a0e688eef2e95711178061a0f + name: libexpat + run_exports: {} + sha256: 844ab708594bdfbd7b35e1a67c379861bcd180d6efe57b654f482ae2f7f5c21e + size: 70137 + subdir: win-64 + timestamp: 1763550049107 + version: 2.7.3 + fn: libexpat-2.7.3-hac47afa_0.conda + url: https://conda.anaconda.org/conda-forge/win-64/libexpat-2.7.3-hac47afa_0.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: pyh145f28c_0 + build_number: 0 + depends: + - python >=3.13.0a0 + license: MIT + license_family: MIT + md5: bf47878473e5ab9fdb4115735230e191 + name: pip + noarch: python + run_exports: {} + sha256: 4d5e2faca810459724f11f78d19a0feee27a7be2b3fc5f7abbbec4c9fdcae93d + size: 1177084 + subdir: noarch + timestamp: 1762776338614 + version: '25.3' + fn: pip-25.3-pyh145f28c_0.conda + url: https://conda.anaconda.org/conda-forge/noarch/pip-25.3-pyh145f28c_0.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: pyh332efcf_0 + build_number: 0 + depends: + - python >=3.10 + license: MIT + license_family: MIT + md5: 7b446fcbb6779ee479debb4fd7453e6c + name: setuptools + noarch: python + run_exports: {} + sha256: f5fcb7854d2b7639a5b1aca41dd0f2d5a69a60bbc313e7f192e2dc385ca52f86 + size: 678888 + subdir: noarch + timestamp: 1769601206751 + version: 80.10.2 + fn: setuptools-80.10.2-pyh332efcf_0.conda + url: https://conda.anaconda.org/conda-forge/noarch/setuptools-80.10.2-pyh332efcf_0.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: pyhd8ed1ab_0 + build_number: 0 + depends: + - packaging >=24.0 + - python >=3.10 + license: MIT + license_family: MIT + md5: bdbd7385b4a67025ac2dba4ef8cb6a8f + name: wheel + noarch: python + run_exports: {} + sha256: d6cf2f0ebd5e09120c28ecba450556ce553752652d91795442f0e70f837126ae + size: 31858 + subdir: noarch + timestamp: 1769139207397 + version: 0.46.3 + fn: wheel-0.46.3-pyhd8ed1ab_0.conda + url: https://conda.anaconda.org/conda-forge/noarch/wheel-0.46.3-pyhd8ed1ab_0.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h41ae7f8_34 + build_number: 34 + depends: + - vc14_runtime >=14.44.35208 + license: BSD-3-Clause + license_family: BSD + md5: 1e610f2416b6acdd231c5f573d754a0f + name: vc + run_exports: {} + sha256: 9dc40c2610a6e6727d635c62cced5ef30b7b30123f5ef67d6139e23d21744b3a + size: 19356 + subdir: win-64 + timestamp: 1767320221521 + track_features: vc14 + version: '14.3' + fn: vc-14.3-h41ae7f8_34.conda + url: https://conda.anaconda.org/conda-forge/win-64/vc-14.3-h41ae7f8_34.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h818238b_34 + build_number: 34 + constrains: + - vs2015_runtime 14.44.35208.* *_34 + depends: + - ucrt >=10.0.20348.0 + - vcomp14 14.44.35208 h818238b_34 + license: LicenseRef-MicrosoftVisualCpp2015-2022Runtime + license_family: Proprietary + md5: 37eb311485d2d8b2c419449582046a42 + name: vc14_runtime + run_exports: {} + sha256: 02732f953292cce179de9b633e74928037fa3741eb5ef91c3f8bae4f761d32a5 + size: 683233 + subdir: win-64 + timestamp: 1767320219644 + version: 14.44.35208 + fn: vc14_runtime-14.44.35208-h818238b_34.conda + url: https://conda.anaconda.org/conda-forge/win-64/vc14_runtime-14.44.35208-h818238b_34.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h818238b_34 + build_number: 34 + constrains: + - vs2015_runtime 14.44.35208.* *_34 + depends: + - ucrt >=10.0.20348.0 + license: LicenseRef-MicrosoftVisualCpp2015-2022Runtime + license_family: Proprietary + md5: 242d9f25d2ae60c76b38a5e42858e51d + name: vcomp14 + run_exports: + strong: + - vcomp14 >=14.44.35208 + sha256: 878d5d10318b119bd98ed3ed874bd467acbe21996e1d81597a1dbf8030ea0ce6 + size: 115235 + subdir: win-64 + timestamp: 1767320173250 + version: 14.44.35208 + fn: vcomp14-14.44.35208-h818238b_34.conda + url: https://conda.anaconda.org/conda-forge/win-64/vcomp14-14.44.35208-h818238b_34.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h57928b3_0 + build_number: 0 + constrains: + - vc14_runtime >=14.29.30037 + - vs2015_runtime >=14.29.30037 + depends: [] + license: LicenseRef-MicrosoftWindowsSDK10 + md5: 71b24316859acd00bdb8b38f5e2ce328 + name: ucrt + run_exports: {} + sha256: 3005729dce6f3d3f5ec91dfc49fc75a0095f9cd23bab49efb899657297ac91a5 + size: 694692 + subdir: win-64 + timestamp: 1756385147981 + version: 10.0.26100.0 + fn: ucrt-10.0.26100.0-h57928b3_0.conda + url: https://conda.anaconda.org/conda-forge/win-64/ucrt-10.0.26100.0-h57928b3_0.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h0ad9c76_8 + build_number: 8 + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: bzip2-1.0.6 + license_family: BSD + md5: 1077e9333c41ff0be8edd1a5ec0ddace + name: bzip2 + run_exports: + weak: + - bzip2 >=1.0.8,<2.0a0 + sha256: d882712855624641f48aa9dc3f5feea2ed6b4e6004585d3616386a18186fe692 + size: 55977 + subdir: win-64 + timestamp: 1757437738856 + version: 1.0.8 + fn: bzip2-1.0.8-h0ad9c76_8.conda + url: https://conda.anaconda.org/conda-forge/win-64/bzip2-1.0.8-h0ad9c76_8.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h3d046cb_0 + build_number: 0 + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: MIT + license_family: MIT + md5: 720b39f5ec0610457b725eb3f396219a + name: libffi + run_exports: + weak: + - libffi >=3.5.2,<3.6.0a0 + sha256: 59d01f2dfa8b77491b5888a5ab88ff4e1574c9359f7e229da254cdfe27ddc190 + size: 45831 + subdir: win-64 + timestamp: 1769456418774 + version: 3.5.2 + fn: libffi-3.5.2-h3d046cb_0.conda + url: https://conda.anaconda.org/conda-forge/win-64/libffi-3.5.2-h3d046cb_0.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: hfd05255_1 + build_number: 1 + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: BSD-2-Clause + license_family: BSD + md5: e4a9fc2bba3b022dad998c78856afe47 + name: libmpdec + run_exports: {} + sha256: 40dcd0b9522a6e0af72a9db0ced619176e7cfdb114855c7a64f278e73f8a7514 + size: 89411 + subdir: win-64 + timestamp: 1769482314283 + version: 4.0.0 + fn: libmpdec-4.0.0-hfd05255_1.conda + url: https://conda.anaconda.org/conda-forge/win-64/libmpdec-4.0.0-hfd05255_1.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h2466b09_2 + build_number: 2 + constrains: + - zlib 1.3.1 *_2 + depends: + - ucrt >=10.0.20348.0 + - vc >=14.2,<15 + - vc14_runtime >=14.29.30139 + license: Zlib + license_family: Other + md5: 41fbfac52c601159df6c01f875de31b9 + name: libzlib + run_exports: + weak: + - libzlib >=1.3.1,<2.0a0 + sha256: ba945c6493449bed0e6e29883c4943817f7c79cbff52b83360f7b341277c6402 + size: 55476 + subdir: win-64 + timestamp: 1727963768015 + version: 1.3.1 + fn: libzlib-1.3.1-h2466b09_2.conda + url: https://conda.anaconda.org/conda-forge/win-64/libzlib-1.3.1-h2466b09_2.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: hf411b9b_1 + build_number: 1 + depends: + - ca-certificates + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: Apache-2.0 + license_family: Apache + md5: eb585509b815415bc964b2c7e11c7eb3 + name: openssl + run_exports: + weak: + - openssl >=3.6.1,<4.0a0 + sha256: 53a5ad2e5553b8157a91bb8aa375f78c5958f77cb80e9d2ce59471ea8e5c0bd6 + size: 9343023 + subdir: win-64 + timestamp: 1769557547888 + version: 3.6.1 + fn: openssl-3.6.1-hf411b9b_1.conda + url: https://conda.anaconda.org/conda-forge/win-64/openssl-3.6.1-hf411b9b_1.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h6ed50ae_3 + build_number: 3 + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: TCL + license_family: BSD + md5: 0481bfd9814bf525bd4b3ee4b51494c4 + name: tk + run_exports: + weak: + - tk >=8.6.13,<8.7.0a0 + sha256: 0e79810fae28f3b69fe7391b0d43f5474d6bd91d451d5f2bde02f55ae481d5e3 + size: 3526350 + subdir: win-64 + timestamp: 1769460339384 + version: 8.6.13 + fn: tk-8.6.13-h6ed50ae_3.conda + url: https://conda.anaconda.org/conda-forge/win-64/tk-8.6.13-h6ed50ae_3.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: hc9c84f9_1 + build_number: 1 + depends: [] + license: LicenseRef-Public-Domain + md5: ad659d0a2b3e47e38d829aa8cad2d610 + name: tzdata + noarch: generic + run_exports: {} + sha256: 1d30098909076af33a35017eed6f2953af1c769e273a0626a04722ac4acaba3c + size: 119135 + subdir: noarch + timestamp: 1767016325805 + version: 2025c + fn: tzdata-2025c-hc9c84f9_1.conda + url: https://conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h534d264_6 + build_number: 6 + depends: + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - libzlib >=1.3.1,<2.0a0 + license: BSD-3-Clause + license_family: BSD + md5: 053b84beec00b71ea8ff7a4f84b55207 + name: zstd + run_exports: + weak: + - zstd >=1.5.7,<1.6.0a0 + sha256: 368d8628424966fd8f9c8018326a9c779e06913dd39e646cf331226acc90e5b2 + size: 388453 + subdir: win-64 + timestamp: 1764777142545 + version: 1.5.7 + fn: zstd-1.5.7-h534d264_6.conda + url: https://conda.anaconda.org/conda-forge/win-64/zstd-1.5.7-h534d264_6.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: pyhcf101f3_0 + build_number: 0 + depends: + - python >=3.8 + - python + license: Apache-2.0 + license_family: APACHE + md5: b76541e68fea4d511b1ac46a28dcd2c6 + name: packaging + noarch: python + run_exports: {} + sha256: c1fc0f953048f743385d31c468b4a678b3ad20caffdeaa94bed85ba63049fd58 + size: 72010 + subdir: noarch + timestamp: 1769093650580 + version: '26.0' + fn: packaging-26.0-pyhcf101f3_0.conda + url: https://conda.anaconda.org/conda-forge/noarch/packaging-26.0-pyhcf101f3_0.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h4c7d964_0 + build_number: 0 + depends: + - __win + license: ISC + md5: 84d389c9eee640dda3d26fc5335c67d8 + name: ca-certificates + noarch: generic + run_exports: {} + sha256: 4ddcb01be03f85d3db9d881407fb13a673372f1b9fac9c836ea441893390e049 + size: 147139 + subdir: noarch + timestamp: 1767500904211 + version: 2026.1.4 + fn: ca-certificates-2026.1.4-h4c7d964_0.conda + url: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.1.4-h4c7d964_0.conda + channel: https://conda.anaconda.org/conda-forge/ + run: + depends: + - source: python + - spec: vc >=14.3,<15 + from: build + run_export: vs2022_win-64 + - spec: vc14_runtime >=14.44.35208 + from: build + run_export: vs2022_win-64 + - spec: ucrt >=10.0.20348.0 + from: build + run_export: vs2022_win-64 + - spec: vc >=14.3,<15 + from: build + run_export: vs_win-64 + - spec: vc14_runtime >=14.44.35208 + from: build + run_export: vs_win-64 + - spec: ucrt >=10.0.20348.0 + from: build + run_export: vs_win-64 + - spec: python_abi 3.14.* *_cp314 + from: host + run_export: python + constraints: [] +finalized_sources: +- url: https://pypi.org/packages/source/p/psutil/psutil-7.2.2.tar.gz + sha256: 0746f5f8d406af344fd547f1c8daa5f5c33dbc293bb8d6a16d80b4bb88f59372 +system_tools: + rattler-build: 0.55.1 +extra_meta: + flow_run_id: azure_20260129.4.1 + remote_url: https://github.com/conda-forge/psutil-feedstock + sha: bbd3baefd9321a72c980b9419495043d4e44b3a1 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/recipe/variant_config.yaml b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/recipe/variant_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d9a095ccd8ec60cac34bec27f25c28100c588708 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/recipe/variant_config.yaml @@ -0,0 +1,7 @@ +build_platform: win-64 +c_compiler: vs2022 +c_stdlib: vs +channel_sources: conda-forge +channel_targets: conda-forge main +python: 3.14.* *_cp314 +target_platform: win-64 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/repodata_record.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/repodata_record.json new file mode 100644 index 0000000000000000000000000000000000000000..a3fadb8dd4f360dbfa8ee99f17e647b5a7516d82 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/repodata_record.json @@ -0,0 +1,26 @@ +{ + "arch": "x86_64", + "build": "py314hc5dbbe4_0", + "build_number": 0, + "build_string": "py314hc5dbbe4_0", + "channel": "conda-forge", + "constrains": [], + "depends": [ + "python", + "vc >=14.3,<15", + "vc14_runtime >=14.44.35208", + "ucrt >=10.0.20348.0", + "python_abi 3.14.* *_cp314" + ], + "fn": "psutil-7.2.2-py314hc5dbbe4_0.conda", + "license": "BSD-3-Clause", + "md5": "fd539ac231820f64066839251aa9fa48", + "name": "psutil", + "platform": "win", + "sha256": "17c8274ce5a32c9793f73a5a0094bd6188f3a13026a93147655143d4df034214", + "size": 249950, + "subdir": "win-64", + "timestamp": 1769678167, + "url": "https://conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0.conda", + "version": "7.2.2" +} \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/tests/tests.yaml b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/tests/tests.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1ae04b38bbd7d73a827d679d0079ffe9002ac08f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0/info/tests/tests.yaml @@ -0,0 +1,4 @@ +- python: + imports: + - psutil + - psutil._psutil_windows diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f03ee5950de75a1fdb43ce8dc2f5d743d8f340a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/__main__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/__main__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..533f166d66adce56c01589473e06419f70f7ffaf Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/__main__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/base_events.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/base_events.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..30c1316b3935f19ebfe4e7f2257b1d87b1381fba Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/base_events.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/base_futures.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/base_futures.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3ac7709e767e677404dc5b44597a21aba12df5be Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/base_futures.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/base_subprocess.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/base_subprocess.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..24b80f4bf6a7c8fbd6c599baace26ff7b431a4f6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/base_subprocess.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/base_tasks.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/base_tasks.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fecdb5441270d1990cec80fe858e408291c44a5e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/base_tasks.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/constants.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/constants.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5c9803c41c2fb5d295b3252f1c388505c74e67aa Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/constants.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/coroutines.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/coroutines.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0d61d95d25299fecb1fa753ddad6b36b0ccbe854 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/coroutines.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/events.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/events.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5c7ba75a5164ccf54730f1a9aba9937013097360 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/events.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/exceptions.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/exceptions.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8f9a7da107529518ea70c399be415c9a288b5bec Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/exceptions.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/format_helpers.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/format_helpers.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cc5b5767b188c76be0ac533135e01e60825dd10b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/format_helpers.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/futures.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/futures.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8205710b314eaa67ddfda41cccff7bc7eccfa899 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/futures.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/locks.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/locks.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8faba91762bb7f371bbd4cb78d65bc20d5530df3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/locks.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/log.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/log.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cefb9839104d95b4b5b870224571ba122a9141d5 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/log.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/mixins.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/mixins.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a8d87aec8e9dc50836ea0c9d3078eea88186c929 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/mixins.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/proactor_events.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/proactor_events.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..52a5aaad49b0475f99a94523d182069faac68b1f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/proactor_events.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/protocols.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/protocols.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a689f457323fce5f01c2b23095d253aa1ec44632 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/protocols.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/queues.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/queues.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..02ece53c89e5ed45415f12b0e6c469aa10361cc7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/queues.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/runners.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/runners.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..82643e7858c125f35fde71b0697be5f8575d82bc Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/runners.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/selector_events.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/selector_events.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8ed23e7dc1df1016b6063ffb801c9cbd989c444c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/selector_events.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/sslproto.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/sslproto.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..16bea751374ee6c8bd5dd30cd5934f4362ef74c1 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/sslproto.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/staggered.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/staggered.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..51a1a1905803063b22fa7764e9703c1f51109a72 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/staggered.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/streams.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/streams.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..45c671414874916b1275ce3f07859026508b2a44 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/streams.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/subprocess.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/subprocess.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f9a548ee0ea8fb3bc035cf3c2854782f76490d1c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/subprocess.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/taskgroups.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/taskgroups.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0e4980cfad5e532e72cc965fa9e3ef762bbab11b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/taskgroups.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/tasks.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/tasks.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..066a2b4f908b6ddf82f6f51a84ce1e76edeb4f4b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/tasks.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/threads.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/threads.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b0c4b11d25aadfe088cc309e2a33ca949322da32 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/threads.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/timeouts.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/timeouts.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9bbcc69239f699447f5f5bd65aa53d0bb8b0833f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/timeouts.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/transports.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/transports.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..045f425d323b074007d2b1cba331571d1c55254a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/transports.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/trsock.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/trsock.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d2f361429ff21bc620e9d8833febc1b5cc603629 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/trsock.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/unix_events.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/unix_events.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1858aee71e4074765ec2e59c58676024875cef3c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/unix_events.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/windows_events.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/windows_events.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d3899942f4d2ca03034fa1097300732673e67ef2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/windows_events.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/windows_utils.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/windows_utils.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b5cd06ff39abcfe8396f3e9d3158af58a4e1ef88 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/asyncio/__pycache__/windows_utils.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/collections/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/collections/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8bd722ebcff633965d0d890d5060e1218eafed2d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/collections/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/collections/__pycache__/abc.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/collections/__pycache__/abc.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bb21a2b8d877cf8f8e2b1dbf8f5f941ae8c2a94f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/collections/__pycache__/abc.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/concurrent/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/concurrent/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e42a84a69957c3b2e3f070140f42713ea04dbf13 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/concurrent/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/concurrent/futures/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/concurrent/futures/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..292e886d5a88ac90b41f998702c5dbf11e44ce9b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/concurrent/futures/__init__.py @@ -0,0 +1,53 @@ +# Copyright 2009 Brian Quinlan. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Execute computations asynchronously using threads or processes.""" + +__author__ = 'Brian Quinlan (brian@sweetapp.com)' + +from concurrent.futures._base import (FIRST_COMPLETED, + FIRST_EXCEPTION, + ALL_COMPLETED, + CancelledError, + TimeoutError, + InvalidStateError, + BrokenExecutor, + Future, + Executor, + wait, + as_completed) + +__all__ = ( + 'FIRST_COMPLETED', + 'FIRST_EXCEPTION', + 'ALL_COMPLETED', + 'CancelledError', + 'TimeoutError', + 'BrokenExecutor', + 'Future', + 'Executor', + 'wait', + 'as_completed', + 'ProcessPoolExecutor', + 'ThreadPoolExecutor', +) + + +def __dir__(): + return __all__ + ('__author__', '__doc__') + + +def __getattr__(name): + global ProcessPoolExecutor, ThreadPoolExecutor + + if name == 'ProcessPoolExecutor': + from .process import ProcessPoolExecutor as pe + ProcessPoolExecutor = pe + return pe + + if name == 'ThreadPoolExecutor': + from .thread import ThreadPoolExecutor as te + ThreadPoolExecutor = te + return te + + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/concurrent/futures/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/concurrent/futures/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..721f334b1e7a50e354d424f4bfac981f12f3b8cb Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/concurrent/futures/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/concurrent/futures/__pycache__/_base.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/concurrent/futures/__pycache__/_base.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..54c871f3d269313a31ff8aad8066b7edc60487f2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/concurrent/futures/__pycache__/_base.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/concurrent/futures/__pycache__/process.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/concurrent/futures/__pycache__/process.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..99448bf37a7b4fcc019cb1b93a15b60753aa250a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/concurrent/futures/__pycache__/process.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/concurrent/futures/__pycache__/thread.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/concurrent/futures/__pycache__/thread.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a6149fb0dbaef23574bc2a37c1f7b7f0d6b2f5ef Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/concurrent/futures/__pycache__/thread.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/concurrent/futures/_base.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/concurrent/futures/_base.py new file mode 100644 index 0000000000000000000000000000000000000000..6742a07753c9217802f8a267f20e7fe6ffc28fb6 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/concurrent/futures/_base.py @@ -0,0 +1,654 @@ +# Copyright 2009 Brian Quinlan. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +__author__ = 'Brian Quinlan (brian@sweetapp.com)' + +import collections +import logging +import threading +import time +import types + +FIRST_COMPLETED = 'FIRST_COMPLETED' +FIRST_EXCEPTION = 'FIRST_EXCEPTION' +ALL_COMPLETED = 'ALL_COMPLETED' +_AS_COMPLETED = '_AS_COMPLETED' + +# Possible future states (for internal use by the futures package). +PENDING = 'PENDING' +RUNNING = 'RUNNING' +# The future was cancelled by the user... +CANCELLED = 'CANCELLED' +# ...and _Waiter.add_cancelled() was called by a worker. +CANCELLED_AND_NOTIFIED = 'CANCELLED_AND_NOTIFIED' +FINISHED = 'FINISHED' + +_FUTURE_STATES = [ + PENDING, + RUNNING, + CANCELLED, + CANCELLED_AND_NOTIFIED, + FINISHED +] + +_STATE_TO_DESCRIPTION_MAP = { + PENDING: "pending", + RUNNING: "running", + CANCELLED: "cancelled", + CANCELLED_AND_NOTIFIED: "cancelled", + FINISHED: "finished" +} + +# Logger for internal use by the futures package. +LOGGER = logging.getLogger("concurrent.futures") + +class Error(Exception): + """Base class for all future-related exceptions.""" + pass + +class CancelledError(Error): + """The Future was cancelled.""" + pass + +TimeoutError = TimeoutError # make local alias for the standard exception + +class InvalidStateError(Error): + """The operation is not allowed in this state.""" + pass + +class _Waiter(object): + """Provides the event that wait() and as_completed() block on.""" + def __init__(self): + self.event = threading.Event() + self.finished_futures = [] + + def add_result(self, future): + self.finished_futures.append(future) + + def add_exception(self, future): + self.finished_futures.append(future) + + def add_cancelled(self, future): + self.finished_futures.append(future) + +class _AsCompletedWaiter(_Waiter): + """Used by as_completed().""" + + def __init__(self): + super(_AsCompletedWaiter, self).__init__() + self.lock = threading.Lock() + + def add_result(self, future): + with self.lock: + super(_AsCompletedWaiter, self).add_result(future) + self.event.set() + + def add_exception(self, future): + with self.lock: + super(_AsCompletedWaiter, self).add_exception(future) + self.event.set() + + def add_cancelled(self, future): + with self.lock: + super(_AsCompletedWaiter, self).add_cancelled(future) + self.event.set() + +class _FirstCompletedWaiter(_Waiter): + """Used by wait(return_when=FIRST_COMPLETED).""" + + def add_result(self, future): + super().add_result(future) + self.event.set() + + def add_exception(self, future): + super().add_exception(future) + self.event.set() + + def add_cancelled(self, future): + super().add_cancelled(future) + self.event.set() + +class _AllCompletedWaiter(_Waiter): + """Used by wait(return_when=FIRST_EXCEPTION and ALL_COMPLETED).""" + + def __init__(self, num_pending_calls, stop_on_exception): + self.num_pending_calls = num_pending_calls + self.stop_on_exception = stop_on_exception + self.lock = threading.Lock() + super().__init__() + + def _decrement_pending_calls(self): + with self.lock: + self.num_pending_calls -= 1 + if not self.num_pending_calls: + self.event.set() + + def add_result(self, future): + super().add_result(future) + self._decrement_pending_calls() + + def add_exception(self, future): + super().add_exception(future) + if self.stop_on_exception: + self.event.set() + else: + self._decrement_pending_calls() + + def add_cancelled(self, future): + super().add_cancelled(future) + self._decrement_pending_calls() + +class _AcquireFutures(object): + """A context manager that does an ordered acquire of Future conditions.""" + + def __init__(self, futures): + self.futures = sorted(futures, key=id) + + def __enter__(self): + for future in self.futures: + future._condition.acquire() + + def __exit__(self, *args): + for future in self.futures: + future._condition.release() + +def _create_and_install_waiters(fs, return_when): + if return_when == _AS_COMPLETED: + waiter = _AsCompletedWaiter() + elif return_when == FIRST_COMPLETED: + waiter = _FirstCompletedWaiter() + else: + pending_count = sum( + f._state not in [CANCELLED_AND_NOTIFIED, FINISHED] for f in fs) + + if return_when == FIRST_EXCEPTION: + waiter = _AllCompletedWaiter(pending_count, stop_on_exception=True) + elif return_when == ALL_COMPLETED: + waiter = _AllCompletedWaiter(pending_count, stop_on_exception=False) + else: + raise ValueError("Invalid return condition: %r" % return_when) + + for f in fs: + f._waiters.append(waiter) + + return waiter + + +def _yield_finished_futures(fs, waiter, ref_collect): + """ + Iterate on the list *fs*, yielding finished futures one by one in + reverse order. + Before yielding a future, *waiter* is removed from its waiters + and the future is removed from each set in the collection of sets + *ref_collect*. + + The aim of this function is to avoid keeping stale references after + the future is yielded and before the iterator resumes. + """ + while fs: + f = fs[-1] + for futures_set in ref_collect: + futures_set.remove(f) + with f._condition: + f._waiters.remove(waiter) + del f + # Careful not to keep a reference to the popped value + yield fs.pop() + + +def as_completed(fs, timeout=None): + """An iterator over the given futures that yields each as it completes. + + Args: + fs: The sequence of Futures (possibly created by different Executors) to + iterate over. + timeout: The maximum number of seconds to wait. If None, then there + is no limit on the wait time. + + Returns: + An iterator that yields the given Futures as they complete (finished or + cancelled). If any given Futures are duplicated, they will be returned + once. + + Raises: + TimeoutError: If the entire result iterator could not be generated + before the given timeout. + """ + if timeout is not None: + end_time = timeout + time.monotonic() + + fs = set(fs) + total_futures = len(fs) + with _AcquireFutures(fs): + finished = set( + f for f in fs + if f._state in [CANCELLED_AND_NOTIFIED, FINISHED]) + pending = fs - finished + waiter = _create_and_install_waiters(fs, _AS_COMPLETED) + finished = list(finished) + try: + yield from _yield_finished_futures(finished, waiter, + ref_collect=(fs,)) + + while pending: + if timeout is None: + wait_timeout = None + else: + wait_timeout = end_time - time.monotonic() + if wait_timeout < 0: + raise TimeoutError( + '%d (of %d) futures unfinished' % ( + len(pending), total_futures)) + + waiter.event.wait(wait_timeout) + + with waiter.lock: + finished = waiter.finished_futures + waiter.finished_futures = [] + waiter.event.clear() + + # reverse to keep finishing order + finished.reverse() + yield from _yield_finished_futures(finished, waiter, + ref_collect=(fs, pending)) + + finally: + # Remove waiter from unfinished futures + for f in fs: + with f._condition: + f._waiters.remove(waiter) + +DoneAndNotDoneFutures = collections.namedtuple( + 'DoneAndNotDoneFutures', 'done not_done') +def wait(fs, timeout=None, return_when=ALL_COMPLETED): + """Wait for the futures in the given sequence to complete. + + Args: + fs: The sequence of Futures (possibly created by different Executors) to + wait upon. + timeout: The maximum number of seconds to wait. If None, then there + is no limit on the wait time. + return_when: Indicates when this function should return. The options + are: + + FIRST_COMPLETED - Return when any future finishes or is + cancelled. + FIRST_EXCEPTION - Return when any future finishes by raising an + exception. If no future raises an exception + then it is equivalent to ALL_COMPLETED. + ALL_COMPLETED - Return when all futures finish or are cancelled. + + Returns: + A named 2-tuple of sets. The first set, named 'done', contains the + futures that completed (is finished or cancelled) before the wait + completed. The second set, named 'not_done', contains uncompleted + futures. Duplicate futures given to *fs* are removed and will be + returned only once. + """ + fs = set(fs) + with _AcquireFutures(fs): + done = {f for f in fs + if f._state in [CANCELLED_AND_NOTIFIED, FINISHED]} + not_done = fs - done + if (return_when == FIRST_COMPLETED) and done: + return DoneAndNotDoneFutures(done, not_done) + elif (return_when == FIRST_EXCEPTION) and done: + if any(f for f in done + if not f.cancelled() and f.exception() is not None): + return DoneAndNotDoneFutures(done, not_done) + + if len(done) == len(fs): + return DoneAndNotDoneFutures(done, not_done) + + waiter = _create_and_install_waiters(fs, return_when) + + waiter.event.wait(timeout) + for f in fs: + with f._condition: + f._waiters.remove(waiter) + + done.update(waiter.finished_futures) + return DoneAndNotDoneFutures(done, fs - done) + + +def _result_or_cancel(fut, timeout=None): + try: + try: + return fut.result(timeout) + finally: + fut.cancel() + finally: + # Break a reference cycle with the exception in self._exception + del fut + + +class Future(object): + """Represents the result of an asynchronous computation.""" + + def __init__(self): + """Initializes the future. Should not be called by clients.""" + self._condition = threading.Condition() + self._state = PENDING + self._result = None + self._exception = None + self._waiters = [] + self._done_callbacks = [] + + def _invoke_callbacks(self): + for callback in self._done_callbacks: + try: + callback(self) + except Exception: + LOGGER.exception('exception calling callback for %r', self) + + def __repr__(self): + with self._condition: + if self._state == FINISHED: + if self._exception: + return '<%s at %#x state=%s raised %s>' % ( + self.__class__.__name__, + id(self), + _STATE_TO_DESCRIPTION_MAP[self._state], + self._exception.__class__.__name__) + else: + return '<%s at %#x state=%s returned %s>' % ( + self.__class__.__name__, + id(self), + _STATE_TO_DESCRIPTION_MAP[self._state], + self._result.__class__.__name__) + return '<%s at %#x state=%s>' % ( + self.__class__.__name__, + id(self), + _STATE_TO_DESCRIPTION_MAP[self._state]) + + def cancel(self): + """Cancel the future if possible. + + Returns True if the future was cancelled, False otherwise. A future + cannot be cancelled if it is running or has already completed. + """ + with self._condition: + if self._state in [RUNNING, FINISHED]: + return False + + if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: + return True + + self._state = CANCELLED + self._condition.notify_all() + + self._invoke_callbacks() + return True + + def cancelled(self): + """Return True if the future was cancelled.""" + with self._condition: + return self._state in [CANCELLED, CANCELLED_AND_NOTIFIED] + + def running(self): + """Return True if the future is currently executing.""" + with self._condition: + return self._state == RUNNING + + def done(self): + """Return True if the future was cancelled or finished executing.""" + with self._condition: + return self._state in [CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED] + + def __get_result(self): + if self._exception: + try: + raise self._exception + finally: + # Break a reference cycle with the exception in self._exception + self = None + else: + return self._result + + def add_done_callback(self, fn): + """Attaches a callable that will be called when the future finishes. + + Args: + fn: A callable that will be called with this future as its only + argument when the future completes or is cancelled. The callable + will always be called by a thread in the same process in which + it was added. If the future has already completed or been + cancelled then the callable will be called immediately. These + callables are called in the order that they were added. + """ + with self._condition: + if self._state not in [CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED]: + self._done_callbacks.append(fn) + return + try: + fn(self) + except Exception: + LOGGER.exception('exception calling callback for %r', self) + + def result(self, timeout=None): + """Return the result of the call that the future represents. + + Args: + timeout: The number of seconds to wait for the result if the future + isn't done. If None, then there is no limit on the wait time. + + Returns: + The result of the call that the future represents. + + Raises: + CancelledError: If the future was cancelled. + TimeoutError: If the future didn't finish executing before the given + timeout. + Exception: If the call raised then that exception will be raised. + """ + try: + with self._condition: + if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: + raise CancelledError() + elif self._state == FINISHED: + return self.__get_result() + + self._condition.wait(timeout) + + if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: + raise CancelledError() + elif self._state == FINISHED: + return self.__get_result() + else: + raise TimeoutError() + finally: + # Break a reference cycle with the exception in self._exception + self = None + + def exception(self, timeout=None): + """Return the exception raised by the call that the future represents. + + Args: + timeout: The number of seconds to wait for the exception if the + future isn't done. If None, then there is no limit on the wait + time. + + Returns: + The exception raised by the call that the future represents or None + if the call completed without raising. + + Raises: + CancelledError: If the future was cancelled. + TimeoutError: If the future didn't finish executing before the given + timeout. + """ + + with self._condition: + if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: + raise CancelledError() + elif self._state == FINISHED: + return self._exception + + self._condition.wait(timeout) + + if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: + raise CancelledError() + elif self._state == FINISHED: + return self._exception + else: + raise TimeoutError() + + # The following methods should only be used by Executors and in tests. + def set_running_or_notify_cancel(self): + """Mark the future as running or process any cancel notifications. + + Should only be used by Executor implementations and unit tests. + + If the future has been cancelled (cancel() was called and returned + True) then any threads waiting on the future completing (though calls + to as_completed() or wait()) are notified and False is returned. + + If the future was not cancelled then it is put in the running state + (future calls to running() will return True) and True is returned. + + This method should be called by Executor implementations before + executing the work associated with this future. If this method returns + False then the work should not be executed. + + Returns: + False if the Future was cancelled, True otherwise. + + Raises: + RuntimeError: if this method was already called or if set_result() + or set_exception() was called. + """ + with self._condition: + if self._state == CANCELLED: + self._state = CANCELLED_AND_NOTIFIED + for waiter in self._waiters: + waiter.add_cancelled(self) + # self._condition.notify_all() is not necessary because + # self.cancel() triggers a notification. + return False + elif self._state == PENDING: + self._state = RUNNING + return True + else: + LOGGER.critical('Future %s in unexpected state: %s', + id(self), + self._state) + raise RuntimeError('Future in unexpected state') + + def set_result(self, result): + """Sets the return value of work associated with the future. + + Should only be used by Executor implementations and unit tests. + """ + with self._condition: + if self._state in {CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED}: + raise InvalidStateError('{}: {!r}'.format(self._state, self)) + self._result = result + self._state = FINISHED + for waiter in self._waiters: + waiter.add_result(self) + self._condition.notify_all() + self._invoke_callbacks() + + def set_exception(self, exception): + """Sets the result of the future as being the given exception. + + Should only be used by Executor implementations and unit tests. + """ + with self._condition: + if self._state in {CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED}: + raise InvalidStateError('{}: {!r}'.format(self._state, self)) + self._exception = exception + self._state = FINISHED + for waiter in self._waiters: + waiter.add_exception(self) + self._condition.notify_all() + self._invoke_callbacks() + + __class_getitem__ = classmethod(types.GenericAlias) + +class Executor(object): + """This is an abstract base class for concrete asynchronous executors.""" + + def submit(self, fn, /, *args, **kwargs): + """Submits a callable to be executed with the given arguments. + + Schedules the callable to be executed as fn(*args, **kwargs) and returns + a Future instance representing the execution of the callable. + + Returns: + A Future representing the given call. + """ + raise NotImplementedError() + + def map(self, fn, *iterables, timeout=None, chunksize=1): + """Returns an iterator equivalent to map(fn, iter). + + Args: + fn: A callable that will take as many arguments as there are + passed iterables. + timeout: The maximum number of seconds to wait. If None, then there + is no limit on the wait time. + chunksize: The size of the chunks the iterable will be broken into + before being passed to a child process. This argument is only + used by ProcessPoolExecutor; it is ignored by + ThreadPoolExecutor. + + Returns: + An iterator equivalent to: map(func, *iterables) but the calls may + be evaluated out-of-order. + + Raises: + TimeoutError: If the entire result iterator could not be generated + before the given timeout. + Exception: If fn(*args) raises for any values. + """ + if timeout is not None: + end_time = timeout + time.monotonic() + + fs = [self.submit(fn, *args) for args in zip(*iterables)] + + # Yield must be hidden in closure so that the futures are submitted + # before the first iterator value is required. + def result_iterator(): + try: + # reverse to keep finishing order + fs.reverse() + while fs: + # Careful not to keep a reference to the popped future + if timeout is None: + yield _result_or_cancel(fs.pop()) + else: + yield _result_or_cancel(fs.pop(), end_time - time.monotonic()) + finally: + for future in fs: + future.cancel() + return result_iterator() + + def shutdown(self, wait=True, *, cancel_futures=False): + """Clean-up the resources associated with the Executor. + + It is safe to call this method several times. Otherwise, no other + methods can be called after this one. + + Args: + wait: If True then shutdown will not return until all running + futures have finished executing and the resources used by the + executor have been reclaimed. + cancel_futures: If True then shutdown will cancel all pending + futures. Futures that are completed or running will not be + cancelled. + """ + pass + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + self.shutdown(wait=True) + return False + + +class BrokenExecutor(RuntimeError): + """ + Raised when a executor has become non-functional after a severe failure. + """ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/concurrent/futures/process.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/concurrent/futures/process.py new file mode 100644 index 0000000000000000000000000000000000000000..952fa9034574bc1b2566d843a7da3b06fec2836d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/concurrent/futures/process.py @@ -0,0 +1,862 @@ +# Copyright 2009 Brian Quinlan. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Implements ProcessPoolExecutor. + +The following diagram and text describe the data-flow through the system: + +|======================= In-process =====================|== Out-of-process ==| + ++----------+ +----------+ +--------+ +-----------+ +---------+ +| | => | Work Ids | | | | Call Q | | Process | +| | +----------+ | | +-----------+ | Pool | +| | | ... | | | | ... | +---------+ +| | | 6 | => | | => | 5, call() | => | | +| | | 7 | | | | ... | | | +| Process | | ... | | Local | +-----------+ | Process | +| Pool | +----------+ | Worker | | #1..n | +| Executor | | Thread | | | +| | +----------- + | | +-----------+ | | +| | <=> | Work Items | <=> | | <= | Result Q | <= | | +| | +------------+ | | +-----------+ | | +| | | 6: call() | | | | ... | | | +| | | future | | | | 4, result | | | +| | | ... | | | | 3, except | | | ++----------+ +------------+ +--------+ +-----------+ +---------+ + +Executor.submit() called: +- creates a uniquely numbered _WorkItem and adds it to the "Work Items" dict +- adds the id of the _WorkItem to the "Work Ids" queue + +Local worker thread: +- reads work ids from the "Work Ids" queue and looks up the corresponding + WorkItem from the "Work Items" dict: if the work item has been cancelled then + it is simply removed from the dict, otherwise it is repackaged as a + _CallItem and put in the "Call Q". New _CallItems are put in the "Call Q" + until "Call Q" is full. NOTE: the size of the "Call Q" is kept small because + calls placed in the "Call Q" can no longer be cancelled with Future.cancel(). +- reads _ResultItems from "Result Q", updates the future stored in the + "Work Items" dict and deletes the dict entry + +Process #1..n: +- reads _CallItems from "Call Q", executes the calls, and puts the resulting + _ResultItems in "Result Q" +""" + +__author__ = 'Brian Quinlan (brian@sweetapp.com)' + +import os +from concurrent.futures import _base +import queue +import multiprocessing as mp +import multiprocessing.connection +from multiprocessing.queues import Queue +import threading +import weakref +from functools import partial +import itertools +import sys +from traceback import format_exception + + +_threads_wakeups = weakref.WeakKeyDictionary() +_global_shutdown = False + + +class _ThreadWakeup: + def __init__(self): + self._closed = False + self._reader, self._writer = mp.Pipe(duplex=False) + + def close(self): + # Please note that we do not take the shutdown lock when + # calling clear() (to avoid deadlocking) so this method can + # only be called safely from the same thread as all calls to + # clear() even if you hold the shutdown lock. Otherwise we + # might try to read from the closed pipe. + if not self._closed: + self._closed = True + self._writer.close() + self._reader.close() + + def wakeup(self): + if not self._closed: + self._writer.send_bytes(b"") + + def clear(self): + if not self._closed: + while self._reader.poll(): + self._reader.recv_bytes() + + +def _python_exit(): + global _global_shutdown + _global_shutdown = True + items = list(_threads_wakeups.items()) + for _, thread_wakeup in items: + # call not protected by ProcessPoolExecutor._shutdown_lock + thread_wakeup.wakeup() + for t, _ in items: + t.join() + +# Register for `_python_exit()` to be called just before joining all +# non-daemon threads. This is used instead of `atexit.register()` for +# compatibility with subinterpreters, which no longer support daemon threads. +# See bpo-39812 for context. +threading._register_atexit(_python_exit) + +# Controls how many more calls than processes will be queued in the call queue. +# A smaller number will mean that processes spend more time idle waiting for +# work while a larger number will make Future.cancel() succeed less frequently +# (Futures in the call queue cannot be cancelled). +EXTRA_QUEUED_CALLS = 1 + + +# On Windows, WaitForMultipleObjects is used to wait for processes to finish. +# It can wait on, at most, 63 objects. There is an overhead of two objects: +# - the result queue reader +# - the thread wakeup reader +_MAX_WINDOWS_WORKERS = 63 - 2 + +# Hack to embed stringification of remote traceback in local traceback + +class _RemoteTraceback(Exception): + def __init__(self, tb): + self.tb = tb + def __str__(self): + return self.tb + +class _ExceptionWithTraceback: + def __init__(self, exc, tb): + tb = ''.join(format_exception(type(exc), exc, tb)) + self.exc = exc + # Traceback object needs to be garbage-collected as its frames + # contain references to all the objects in the exception scope + self.exc.__traceback__ = None + self.tb = '\n"""\n%s"""' % tb + def __reduce__(self): + return _rebuild_exc, (self.exc, self.tb) + +def _rebuild_exc(exc, tb): + exc.__cause__ = _RemoteTraceback(tb) + return exc + +class _WorkItem(object): + def __init__(self, future, fn, args, kwargs): + self.future = future + self.fn = fn + self.args = args + self.kwargs = kwargs + +class _ResultItem(object): + def __init__(self, work_id, exception=None, result=None, exit_pid=None): + self.work_id = work_id + self.exception = exception + self.result = result + self.exit_pid = exit_pid + +class _CallItem(object): + def __init__(self, work_id, fn, args, kwargs): + self.work_id = work_id + self.fn = fn + self.args = args + self.kwargs = kwargs + + +class _SafeQueue(Queue): + """Safe Queue set exception to the future object linked to a job""" + def __init__(self, max_size=0, *, ctx, pending_work_items, shutdown_lock, + thread_wakeup): + self.pending_work_items = pending_work_items + self.shutdown_lock = shutdown_lock + self.thread_wakeup = thread_wakeup + super().__init__(max_size, ctx=ctx) + + def _on_queue_feeder_error(self, e, obj): + if isinstance(obj, _CallItem): + tb = format_exception(type(e), e, e.__traceback__) + e.__cause__ = _RemoteTraceback('\n"""\n{}"""'.format(''.join(tb))) + work_item = self.pending_work_items.pop(obj.work_id, None) + with self.shutdown_lock: + self.thread_wakeup.wakeup() + # work_item can be None if another process terminated. In this + # case, the executor_manager_thread fails all work_items + # with BrokenProcessPool + if work_item is not None: + work_item.future.set_exception(e) + else: + super()._on_queue_feeder_error(e, obj) + + +def _get_chunks(*iterables, chunksize): + """ Iterates over zip()ed iterables in chunks. """ + it = zip(*iterables) + while True: + chunk = tuple(itertools.islice(it, chunksize)) + if not chunk: + return + yield chunk + + +def _process_chunk(fn, chunk): + """ Processes a chunk of an iterable passed to map. + + Runs the function passed to map() on a chunk of the + iterable passed to map. + + This function is run in a separate process. + + """ + return [fn(*args) for args in chunk] + + +def _sendback_result(result_queue, work_id, result=None, exception=None, + exit_pid=None): + """Safely send back the given result or exception""" + try: + result_queue.put(_ResultItem(work_id, result=result, + exception=exception, exit_pid=exit_pid)) + except BaseException as e: + exc = _ExceptionWithTraceback(e, e.__traceback__) + result_queue.put(_ResultItem(work_id, exception=exc, + exit_pid=exit_pid)) + + +def _process_worker(call_queue, result_queue, initializer, initargs, max_tasks=None): + """Evaluates calls from call_queue and places the results in result_queue. + + This worker is run in a separate process. + + Args: + call_queue: A ctx.Queue of _CallItems that will be read and + evaluated by the worker. + result_queue: A ctx.Queue of _ResultItems that will written + to by the worker. + initializer: A callable initializer, or None + initargs: A tuple of args for the initializer + """ + if initializer is not None: + try: + initializer(*initargs) + except BaseException: + _base.LOGGER.critical('Exception in initializer:', exc_info=True) + # The parent will notice that the process stopped and + # mark the pool broken + return + num_tasks = 0 + exit_pid = None + while True: + call_item = call_queue.get(block=True) + if call_item is None: + # Wake up queue management thread + result_queue.put(os.getpid()) + return + + if max_tasks is not None: + num_tasks += 1 + if num_tasks >= max_tasks: + exit_pid = os.getpid() + + try: + r = call_item.fn(*call_item.args, **call_item.kwargs) + except BaseException as e: + exc = _ExceptionWithTraceback(e, e.__traceback__) + _sendback_result(result_queue, call_item.work_id, exception=exc, + exit_pid=exit_pid) + else: + _sendback_result(result_queue, call_item.work_id, result=r, + exit_pid=exit_pid) + del r + + # Liberate the resource as soon as possible, to avoid holding onto + # open files or shared memory that is not needed anymore + del call_item + + if exit_pid is not None: + return + + +class _ExecutorManagerThread(threading.Thread): + """Manages the communication between this process and the worker processes. + + The manager is run in a local thread. + + Args: + executor: A reference to the ProcessPoolExecutor that owns + this thread. A weakref will be own by the manager as well as + references to internal objects used to introspect the state of + the executor. + """ + + def __init__(self, executor): + # Store references to necessary internals of the executor. + + # A _ThreadWakeup to allow waking up the queue_manager_thread from the + # main Thread and avoid deadlocks caused by permanently locked queues. + self.thread_wakeup = executor._executor_manager_thread_wakeup + self.shutdown_lock = executor._shutdown_lock + + # A weakref.ref to the ProcessPoolExecutor that owns this thread. Used + # to determine if the ProcessPoolExecutor has been garbage collected + # and that the manager can exit. + # When the executor gets garbage collected, the weakref callback + # will wake up the queue management thread so that it can terminate + # if there is no pending work item. + def weakref_cb(_, + thread_wakeup=self.thread_wakeup, + shutdown_lock=self.shutdown_lock): + mp.util.debug('Executor collected: triggering callback for' + ' QueueManager wakeup') + with shutdown_lock: + thread_wakeup.wakeup() + + self.executor_reference = weakref.ref(executor, weakref_cb) + + # A list of the ctx.Process instances used as workers. + self.processes = executor._processes + + # A ctx.Queue that will be filled with _CallItems derived from + # _WorkItems for processing by the process workers. + self.call_queue = executor._call_queue + + # A ctx.SimpleQueue of _ResultItems generated by the process workers. + self.result_queue = executor._result_queue + + # A queue.Queue of work ids e.g. Queue([5, 6, ...]). + self.work_ids_queue = executor._work_ids + + # Maximum number of tasks a worker process can execute before + # exiting safely + self.max_tasks_per_child = executor._max_tasks_per_child + + # A dict mapping work ids to _WorkItems e.g. + # {5: <_WorkItem...>, 6: <_WorkItem...>, ...} + self.pending_work_items = executor._pending_work_items + + super().__init__() + + def run(self): + # Main loop for the executor manager thread. + + while True: + self.add_call_item_to_queue() + + result_item, is_broken, cause = self.wait_result_broken_or_wakeup() + + if is_broken: + self.terminate_broken(cause) + return + if result_item is not None: + self.process_result_item(result_item) + + process_exited = result_item.exit_pid is not None + if process_exited: + p = self.processes.pop(result_item.exit_pid) + p.join() + + # Delete reference to result_item to avoid keeping references + # while waiting on new results. + del result_item + + if executor := self.executor_reference(): + if process_exited: + with self.shutdown_lock: + executor._adjust_process_count() + else: + executor._idle_worker_semaphore.release() + del executor + + if self.is_shutting_down(): + self.flag_executor_shutting_down() + + # When only canceled futures remain in pending_work_items, our + # next call to wait_result_broken_or_wakeup would hang forever. + # This makes sure we have some running futures or none at all. + self.add_call_item_to_queue() + + # Since no new work items can be added, it is safe to shutdown + # this thread if there are no pending work items. + if not self.pending_work_items: + self.join_executor_internals() + return + + def add_call_item_to_queue(self): + # Fills call_queue with _WorkItems from pending_work_items. + # This function never blocks. + while True: + if self.call_queue.full(): + return + try: + work_id = self.work_ids_queue.get(block=False) + except queue.Empty: + return + else: + work_item = self.pending_work_items[work_id] + + if work_item.future.set_running_or_notify_cancel(): + self.call_queue.put(_CallItem(work_id, + work_item.fn, + work_item.args, + work_item.kwargs), + block=True) + else: + del self.pending_work_items[work_id] + continue + + def wait_result_broken_or_wakeup(self): + # Wait for a result to be ready in the result_queue while checking + # that all worker processes are still running, or for a wake up + # signal send. The wake up signals come either from new tasks being + # submitted, from the executor being shutdown/gc-ed, or from the + # shutdown of the python interpreter. + result_reader = self.result_queue._reader + assert not self.thread_wakeup._closed + wakeup_reader = self.thread_wakeup._reader + readers = [result_reader, wakeup_reader] + worker_sentinels = [p.sentinel for p in list(self.processes.values())] + ready = mp.connection.wait(readers + worker_sentinels) + + cause = None + is_broken = True + result_item = None + if result_reader in ready: + try: + result_item = result_reader.recv() + is_broken = False + except BaseException as e: + cause = format_exception(type(e), e, e.__traceback__) + + elif wakeup_reader in ready: + is_broken = False + + # No need to hold the _shutdown_lock here because: + # 1. we're the only thread to use the wakeup reader + # 2. we're also the only thread to call thread_wakeup.close() + # 3. we want to avoid a possible deadlock when both reader and writer + # would block (gh-105829) + self.thread_wakeup.clear() + + return result_item, is_broken, cause + + def process_result_item(self, result_item): + # Process the received a result_item. This can be either the PID of a + # worker that exited gracefully or a _ResultItem + + if isinstance(result_item, int): + # Clean shutdown of a worker using its PID + # (avoids marking the executor broken) + assert self.is_shutting_down() + p = self.processes.pop(result_item) + p.join() + if not self.processes: + self.join_executor_internals() + return + else: + # Received a _ResultItem so mark the future as completed. + work_item = self.pending_work_items.pop(result_item.work_id, None) + # work_item can be None if another process terminated (see above) + if work_item is not None: + if result_item.exception: + work_item.future.set_exception(result_item.exception) + else: + work_item.future.set_result(result_item.result) + + def is_shutting_down(self): + # Check whether we should start shutting down the executor. + executor = self.executor_reference() + # No more work items can be added if: + # - The interpreter is shutting down OR + # - The executor that owns this worker has been collected OR + # - The executor that owns this worker has been shutdown. + return (_global_shutdown or executor is None + or executor._shutdown_thread) + + def terminate_broken(self, cause): + # Terminate the executor because it is in a broken state. The cause + # argument can be used to display more information on the error that + # lead the executor into becoming broken. + + # Mark the process pool broken so that submits fail right now. + executor = self.executor_reference() + if executor is not None: + executor._broken = ('A child process terminated ' + 'abruptly, the process pool is not ' + 'usable anymore') + executor._shutdown_thread = True + executor = None + + # All pending tasks are to be marked failed with the following + # BrokenProcessPool error + bpe = BrokenProcessPool("A process in the process pool was " + "terminated abruptly while the future was " + "running or pending.") + if cause is not None: + bpe.__cause__ = _RemoteTraceback( + f"\n'''\n{''.join(cause)}'''") + + # Mark pending tasks as failed. + for work_id, work_item in self.pending_work_items.items(): + work_item.future.set_exception(bpe) + # Delete references to object. See issue16284 + del work_item + self.pending_work_items.clear() + + # Terminate remaining workers forcibly: the queues or their + # locks may be in a dirty state and block forever. + for p in self.processes.values(): + p.terminate() + + # Prevent queue writing to a pipe which is no longer read. + # https://github.com/python/cpython/issues/94777 + self.call_queue._reader.close() + + # gh-107219: Close the connection writer which can unblock + # Queue._feed() if it was stuck in send_bytes(). + if sys.platform == 'win32': + self.call_queue._writer.close() + + # clean up resources + self.join_executor_internals() + + def flag_executor_shutting_down(self): + # Flag the executor as shutting down and cancel remaining tasks if + # requested as early as possible if it is not gc-ed yet. + executor = self.executor_reference() + if executor is not None: + executor._shutdown_thread = True + # Cancel pending work items if requested. + if executor._cancel_pending_futures: + # Cancel all pending futures and update pending_work_items + # to only have futures that are currently running. + new_pending_work_items = {} + for work_id, work_item in self.pending_work_items.items(): + if not work_item.future.cancel(): + new_pending_work_items[work_id] = work_item + self.pending_work_items = new_pending_work_items + # Drain work_ids_queue since we no longer need to + # add items to the call queue. + while True: + try: + self.work_ids_queue.get_nowait() + except queue.Empty: + break + # Make sure we do this only once to not waste time looping + # on running processes over and over. + executor._cancel_pending_futures = False + + def shutdown_workers(self): + n_children_to_stop = self.get_n_children_alive() + n_sentinels_sent = 0 + # Send the right number of sentinels, to make sure all children are + # properly terminated. + while (n_sentinels_sent < n_children_to_stop + and self.get_n_children_alive() > 0): + for i in range(n_children_to_stop - n_sentinels_sent): + try: + self.call_queue.put_nowait(None) + n_sentinels_sent += 1 + except queue.Full: + break + + def join_executor_internals(self): + self.shutdown_workers() + # Release the queue's resources as soon as possible. + self.call_queue.close() + self.call_queue.join_thread() + with self.shutdown_lock: + self.thread_wakeup.close() + # If .join() is not called on the created processes then + # some ctx.Queue methods may deadlock on Mac OS X. + for p in self.processes.values(): + p.join() + + def get_n_children_alive(self): + # This is an upper bound on the number of children alive. + return sum(p.is_alive() for p in self.processes.values()) + + +_system_limits_checked = False +_system_limited = None + + +def _check_system_limits(): + global _system_limits_checked, _system_limited + if _system_limits_checked: + if _system_limited: + raise NotImplementedError(_system_limited) + _system_limits_checked = True + try: + import multiprocessing.synchronize + except ImportError: + _system_limited = ( + "This Python build lacks multiprocessing.synchronize, usually due " + "to named semaphores being unavailable on this platform." + ) + raise NotImplementedError(_system_limited) + try: + nsems_max = os.sysconf("SC_SEM_NSEMS_MAX") + except (AttributeError, ValueError): + # sysconf not available or setting not available + return + if nsems_max == -1: + # indetermined limit, assume that limit is determined + # by available memory only + return + if nsems_max >= 256: + # minimum number of semaphores available + # according to POSIX + return + _system_limited = ("system provides too few semaphores (%d" + " available, 256 necessary)" % nsems_max) + raise NotImplementedError(_system_limited) + + +def _chain_from_iterable_of_lists(iterable): + """ + Specialized implementation of itertools.chain.from_iterable. + Each item in *iterable* should be a list. This function is + careful not to keep references to yielded objects. + """ + for element in iterable: + element.reverse() + while element: + yield element.pop() + + +class BrokenProcessPool(_base.BrokenExecutor): + """ + Raised when a process in a ProcessPoolExecutor terminated abruptly + while a future was in the running state. + """ + + +class ProcessPoolExecutor(_base.Executor): + def __init__(self, max_workers=None, mp_context=None, + initializer=None, initargs=(), *, max_tasks_per_child=None): + """Initializes a new ProcessPoolExecutor instance. + + Args: + max_workers: The maximum number of processes that can be used to + execute the given calls. If None or not given then as many + worker processes will be created as the machine has processors. + mp_context: A multiprocessing context to launch the workers. This + object should provide SimpleQueue, Queue and Process. Useful + to allow specific multiprocessing start methods. + initializer: A callable used to initialize worker processes. + initargs: A tuple of arguments to pass to the initializer. + max_tasks_per_child: The maximum number of tasks a worker process + can complete before it will exit and be replaced with a fresh + worker process. The default of None means worker process will + live as long as the executor. Requires a non-'fork' mp_context + start method. When given, we default to using 'spawn' if no + mp_context is supplied. + """ + _check_system_limits() + + if max_workers is None: + self._max_workers = os.cpu_count() or 1 + if sys.platform == 'win32': + self._max_workers = min(_MAX_WINDOWS_WORKERS, + self._max_workers) + else: + if max_workers <= 0: + raise ValueError("max_workers must be greater than 0") + elif (sys.platform == 'win32' and + max_workers > _MAX_WINDOWS_WORKERS): + raise ValueError( + f"max_workers must be <= {_MAX_WINDOWS_WORKERS}") + + self._max_workers = max_workers + + if mp_context is None: + if max_tasks_per_child is not None: + mp_context = mp.get_context("spawn") + else: + mp_context = mp.get_context() + self._mp_context = mp_context + + # https://github.com/python/cpython/issues/90622 + self._safe_to_dynamically_spawn_children = ( + self._mp_context.get_start_method(allow_none=False) != "fork") + + if initializer is not None and not callable(initializer): + raise TypeError("initializer must be a callable") + self._initializer = initializer + self._initargs = initargs + + if max_tasks_per_child is not None: + if not isinstance(max_tasks_per_child, int): + raise TypeError("max_tasks_per_child must be an integer") + elif max_tasks_per_child <= 0: + raise ValueError("max_tasks_per_child must be >= 1") + if self._mp_context.get_start_method(allow_none=False) == "fork": + # https://github.com/python/cpython/issues/90622 + raise ValueError("max_tasks_per_child is incompatible with" + " the 'fork' multiprocessing start method;" + " supply a different mp_context.") + self._max_tasks_per_child = max_tasks_per_child + + # Management thread + self._executor_manager_thread = None + + # Map of pids to processes + self._processes = {} + + # Shutdown is a two-step process. + self._shutdown_thread = False + self._shutdown_lock = threading.Lock() + self._idle_worker_semaphore = threading.Semaphore(0) + self._broken = False + self._queue_count = 0 + self._pending_work_items = {} + self._cancel_pending_futures = False + + # _ThreadWakeup is a communication channel used to interrupt the wait + # of the main loop of executor_manager_thread from another thread (e.g. + # when calling executor.submit or executor.shutdown). We do not use the + # _result_queue to send wakeup signals to the executor_manager_thread + # as it could result in a deadlock if a worker process dies with the + # _result_queue write lock still acquired. + # + # _shutdown_lock must be locked to access _ThreadWakeup.close() and + # .wakeup(). Care must also be taken to not call clear or close from + # more than one thread since _ThreadWakeup.clear() is not protected by + # the _shutdown_lock + self._executor_manager_thread_wakeup = _ThreadWakeup() + + # Create communication channels for the executor + # Make the call queue slightly larger than the number of processes to + # prevent the worker processes from idling. But don't make it too big + # because futures in the call queue cannot be cancelled. + queue_size = self._max_workers + EXTRA_QUEUED_CALLS + self._call_queue = _SafeQueue( + max_size=queue_size, ctx=self._mp_context, + pending_work_items=self._pending_work_items, + shutdown_lock=self._shutdown_lock, + thread_wakeup=self._executor_manager_thread_wakeup) + # Killed worker processes can produce spurious "broken pipe" + # tracebacks in the queue's own worker thread. But we detect killed + # processes anyway, so silence the tracebacks. + self._call_queue._ignore_epipe = True + self._result_queue = mp_context.SimpleQueue() + self._work_ids = queue.Queue() + + def _start_executor_manager_thread(self): + if self._executor_manager_thread is None: + # Start the processes so that their sentinels are known. + if not self._safe_to_dynamically_spawn_children: # ie, using fork. + self._launch_processes() + self._executor_manager_thread = _ExecutorManagerThread(self) + self._executor_manager_thread.start() + _threads_wakeups[self._executor_manager_thread] = \ + self._executor_manager_thread_wakeup + + def _adjust_process_count(self): + # if there's an idle process, we don't need to spawn a new one. + if self._idle_worker_semaphore.acquire(blocking=False): + return + + process_count = len(self._processes) + if process_count < self._max_workers: + # Assertion disabled as this codepath is also used to replace a + # worker that unexpectedly dies, even when using the 'fork' start + # method. That means there is still a potential deadlock bug. If a + # 'fork' mp_context worker dies, we'll be forking a new one when + # we know a thread is running (self._executor_manager_thread). + #assert self._safe_to_dynamically_spawn_children or not self._executor_manager_thread, 'https://github.com/python/cpython/issues/90622' + self._spawn_process() + + def _launch_processes(self): + # https://github.com/python/cpython/issues/90622 + assert not self._executor_manager_thread, ( + 'Processes cannot be fork()ed after the thread has started, ' + 'deadlock in the child processes could result.') + for _ in range(len(self._processes), self._max_workers): + self._spawn_process() + + def _spawn_process(self): + p = self._mp_context.Process( + target=_process_worker, + args=(self._call_queue, + self._result_queue, + self._initializer, + self._initargs, + self._max_tasks_per_child)) + p.start() + self._processes[p.pid] = p + + def submit(self, fn, /, *args, **kwargs): + with self._shutdown_lock: + if self._broken: + raise BrokenProcessPool(self._broken) + if self._shutdown_thread: + raise RuntimeError('cannot schedule new futures after shutdown') + if _global_shutdown: + raise RuntimeError('cannot schedule new futures after ' + 'interpreter shutdown') + + f = _base.Future() + w = _WorkItem(f, fn, args, kwargs) + + self._pending_work_items[self._queue_count] = w + self._work_ids.put(self._queue_count) + self._queue_count += 1 + # Wake up queue management thread + self._executor_manager_thread_wakeup.wakeup() + + if self._safe_to_dynamically_spawn_children: + self._adjust_process_count() + self._start_executor_manager_thread() + return f + submit.__doc__ = _base.Executor.submit.__doc__ + + def map(self, fn, *iterables, timeout=None, chunksize=1): + """Returns an iterator equivalent to map(fn, iter). + + Args: + fn: A callable that will take as many arguments as there are + passed iterables. + timeout: The maximum number of seconds to wait. If None, then there + is no limit on the wait time. + chunksize: If greater than one, the iterables will be chopped into + chunks of size chunksize and submitted to the process pool. + If set to one, the items in the list will be sent one at a time. + + Returns: + An iterator equivalent to: map(func, *iterables) but the calls may + be evaluated out-of-order. + + Raises: + TimeoutError: If the entire result iterator could not be generated + before the given timeout. + Exception: If fn(*args) raises for any values. + """ + if chunksize < 1: + raise ValueError("chunksize must be >= 1.") + + results = super().map(partial(_process_chunk, fn), + _get_chunks(*iterables, chunksize=chunksize), + timeout=timeout) + return _chain_from_iterable_of_lists(results) + + def shutdown(self, wait=True, *, cancel_futures=False): + with self._shutdown_lock: + self._cancel_pending_futures = cancel_futures + self._shutdown_thread = True + if self._executor_manager_thread_wakeup is not None: + # Wake up queue management thread + self._executor_manager_thread_wakeup.wakeup() + + if self._executor_manager_thread is not None and wait: + self._executor_manager_thread.join() + # To reduce the risk of opening too many files, remove references to + # objects that use file descriptors. + self._executor_manager_thread = None + self._call_queue = None + if self._result_queue is not None and wait: + self._result_queue.close() + self._result_queue = None + self._processes = None + self._executor_manager_thread_wakeup = None + + shutdown.__doc__ = _base.Executor.shutdown.__doc__ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/concurrent/futures/thread.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/concurrent/futures/thread.py new file mode 100644 index 0000000000000000000000000000000000000000..51c942f51abd371e80ffa07c2b212336afb8eae2 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/concurrent/futures/thread.py @@ -0,0 +1,236 @@ +# Copyright 2009 Brian Quinlan. All Rights Reserved. +# Licensed to PSF under a Contributor Agreement. + +"""Implements ThreadPoolExecutor.""" + +__author__ = 'Brian Quinlan (brian@sweetapp.com)' + +from concurrent.futures import _base +import itertools +import queue +import threading +import types +import weakref +import os + + +_threads_queues = weakref.WeakKeyDictionary() +_shutdown = False +# Lock that ensures that new workers are not created while the interpreter is +# shutting down. Must be held while mutating _threads_queues and _shutdown. +_global_shutdown_lock = threading.Lock() + +def _python_exit(): + global _shutdown + with _global_shutdown_lock: + _shutdown = True + items = list(_threads_queues.items()) + for t, q in items: + q.put(None) + for t, q in items: + t.join() + +# Register for `_python_exit()` to be called just before joining all +# non-daemon threads. This is used instead of `atexit.register()` for +# compatibility with subinterpreters, which no longer support daemon threads. +# See bpo-39812 for context. +threading._register_atexit(_python_exit) + +# At fork, reinitialize the `_global_shutdown_lock` lock in the child process +if hasattr(os, 'register_at_fork'): + os.register_at_fork(before=_global_shutdown_lock.acquire, + after_in_child=_global_shutdown_lock._at_fork_reinit, + after_in_parent=_global_shutdown_lock.release) + + +class _WorkItem(object): + def __init__(self, future, fn, args, kwargs): + self.future = future + self.fn = fn + self.args = args + self.kwargs = kwargs + + def run(self): + if not self.future.set_running_or_notify_cancel(): + return + + try: + result = self.fn(*self.args, **self.kwargs) + except BaseException as exc: + self.future.set_exception(exc) + # Break a reference cycle with the exception 'exc' + self = None + else: + self.future.set_result(result) + + __class_getitem__ = classmethod(types.GenericAlias) + + +def _worker(executor_reference, work_queue, initializer, initargs): + if initializer is not None: + try: + initializer(*initargs) + except BaseException: + _base.LOGGER.critical('Exception in initializer:', exc_info=True) + executor = executor_reference() + if executor is not None: + executor._initializer_failed() + return + try: + while True: + work_item = work_queue.get(block=True) + if work_item is not None: + work_item.run() + # Delete references to object. See issue16284 + del work_item + + # attempt to increment idle count + executor = executor_reference() + if executor is not None: + executor._idle_semaphore.release() + del executor + continue + + executor = executor_reference() + # Exit if: + # - The interpreter is shutting down OR + # - The executor that owns the worker has been collected OR + # - The executor that owns the worker has been shutdown. + if _shutdown or executor is None or executor._shutdown: + # Flag the executor as shutting down as early as possible if it + # is not gc-ed yet. + if executor is not None: + executor._shutdown = True + # Notice other workers + work_queue.put(None) + return + del executor + except BaseException: + _base.LOGGER.critical('Exception in worker', exc_info=True) + + +class BrokenThreadPool(_base.BrokenExecutor): + """ + Raised when a worker thread in a ThreadPoolExecutor failed initializing. + """ + + +class ThreadPoolExecutor(_base.Executor): + + # Used to assign unique thread names when thread_name_prefix is not supplied. + _counter = itertools.count().__next__ + + def __init__(self, max_workers=None, thread_name_prefix='', + initializer=None, initargs=()): + """Initializes a new ThreadPoolExecutor instance. + + Args: + max_workers: The maximum number of threads that can be used to + execute the given calls. + thread_name_prefix: An optional name prefix to give our threads. + initializer: A callable used to initialize worker threads. + initargs: A tuple of arguments to pass to the initializer. + """ + if max_workers is None: + # ThreadPoolExecutor is often used to: + # * CPU bound task which releases GIL + # * I/O bound task (which releases GIL, of course) + # + # We use cpu_count + 4 for both types of tasks. + # But we limit it to 32 to avoid consuming surprisingly large resource + # on many core machine. + max_workers = min(32, (os.cpu_count() or 1) + 4) + if max_workers <= 0: + raise ValueError("max_workers must be greater than 0") + + if initializer is not None and not callable(initializer): + raise TypeError("initializer must be a callable") + + self._max_workers = max_workers + self._work_queue = queue.SimpleQueue() + self._idle_semaphore = threading.Semaphore(0) + self._threads = set() + self._broken = False + self._shutdown = False + self._shutdown_lock = threading.Lock() + self._thread_name_prefix = (thread_name_prefix or + ("ThreadPoolExecutor-%d" % self._counter())) + self._initializer = initializer + self._initargs = initargs + + def submit(self, fn, /, *args, **kwargs): + with self._shutdown_lock, _global_shutdown_lock: + if self._broken: + raise BrokenThreadPool(self._broken) + + if self._shutdown: + raise RuntimeError('cannot schedule new futures after shutdown') + if _shutdown: + raise RuntimeError('cannot schedule new futures after ' + 'interpreter shutdown') + + f = _base.Future() + w = _WorkItem(f, fn, args, kwargs) + + self._work_queue.put(w) + self._adjust_thread_count() + return f + submit.__doc__ = _base.Executor.submit.__doc__ + + def _adjust_thread_count(self): + # if idle threads are available, don't spin new threads + if self._idle_semaphore.acquire(timeout=0): + return + + # When the executor gets lost, the weakref callback will wake up + # the worker threads. + def weakref_cb(_, q=self._work_queue): + q.put(None) + + num_threads = len(self._threads) + if num_threads < self._max_workers: + thread_name = '%s_%d' % (self._thread_name_prefix or self, + num_threads) + t = threading.Thread(name=thread_name, target=_worker, + args=(weakref.ref(self, weakref_cb), + self._work_queue, + self._initializer, + self._initargs)) + t.start() + self._threads.add(t) + _threads_queues[t] = self._work_queue + + def _initializer_failed(self): + with self._shutdown_lock: + self._broken = ('A thread initializer failed, the thread pool ' + 'is not usable anymore') + # Drain work queue and mark pending futures failed + while True: + try: + work_item = self._work_queue.get_nowait() + except queue.Empty: + break + if work_item is not None: + work_item.future.set_exception(BrokenThreadPool(self._broken)) + + def shutdown(self, wait=True, *, cancel_futures=False): + with self._shutdown_lock: + self._shutdown = True + if cancel_futures: + # Drain all work items from the queue, and then cancel their + # associated futures. + while True: + try: + work_item = self._work_queue.get_nowait() + except queue.Empty: + break + if work_item is not None: + work_item.future.cancel() + + # Send a wake-up to prevent threads calling + # _work_queue.get(block=True) from permanently blocking. + self._work_queue.put(None) + if wait: + for t in self._threads: + t.join() + shutdown.__doc__ = _base.Executor.shutdown.__doc__ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..571392778751ceab04e43e88178c99537c5f1534 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/__pycache__/_aix.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/__pycache__/_aix.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..671023368990707e7e6ce9226b8ffaba8a1878c3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/__pycache__/_aix.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/__pycache__/_endian.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/__pycache__/_endian.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f8f47b251d33b342a7a82ac87f3ba5ec1623438 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/__pycache__/_endian.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/__pycache__/util.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/__pycache__/util.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4235a72b9404e466b9edb491e3781a25428be436 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/__pycache__/util.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/__pycache__/wintypes.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/__pycache__/wintypes.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..95d719537c3f8460d38020ae358504369d7ac526 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/__pycache__/wintypes.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/README.ctypes b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/README.ctypes new file mode 100644 index 0000000000000000000000000000000000000000..2866e9f349288a4059e7bacee8f0ad9ed886d068 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/README.ctypes @@ -0,0 +1,7 @@ +Files in this directory come from Bob Ippolito's py2app. + +License: Any components of the py2app suite may be distributed under +the MIT or PSF open source licenses. + +This is version 1.0, SVN revision 789, from 2006/01/25. +The main repository is http://svn.red-bean.com/bob/macholib/trunk/macholib/ \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5621defccd61d1c4b0c64b8e136ef4357052dcb3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/__init__.py @@ -0,0 +1,9 @@ +""" +Enough Mach-O to make your head spin. + +See the relevant header files in /usr/include/mach-o + +And also Apple's documentation. +""" + +__version__ = '1.0' diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2488bce19a8f685854b6c5ca19dada90ea7050e9 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/__pycache__/dyld.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/__pycache__/dyld.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ac7efc445de909b2c23480d88526b5132d32d3e7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/__pycache__/dyld.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/__pycache__/dylib.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/__pycache__/dylib.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..38891bf49e27a13af3d1bef6afdadcb6701a7f8a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/__pycache__/dylib.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/__pycache__/framework.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/__pycache__/framework.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0fd052ecf7e00768d0226e52f35daf27ce4e9791 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/__pycache__/framework.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/dyld.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/dyld.py new file mode 100644 index 0000000000000000000000000000000000000000..ab9b01c87e27d15d7fc02c2b25270f7d17428780 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/dyld.py @@ -0,0 +1,169 @@ +""" +dyld emulation +""" + +import os +from ctypes.macholib.framework import framework_info +from ctypes.macholib.dylib import dylib_info +from itertools import * +try: + from _ctypes import _dyld_shared_cache_contains_path +except ImportError: + def _dyld_shared_cache_contains_path(*args): + raise NotImplementedError + +__all__ = [ + 'dyld_find', 'framework_find', + 'framework_info', 'dylib_info', +] + +# These are the defaults as per man dyld(1) +# +DEFAULT_FRAMEWORK_FALLBACK = [ + os.path.expanduser("~/Library/Frameworks"), + "/Library/Frameworks", + "/Network/Library/Frameworks", + "/System/Library/Frameworks", +] + +DEFAULT_LIBRARY_FALLBACK = [ + os.path.expanduser("~/lib"), + "/usr/local/lib", + "/lib", + "/usr/lib", +] + +def dyld_env(env, var): + if env is None: + env = os.environ + rval = env.get(var) + if rval is None: + return [] + return rval.split(':') + +def dyld_image_suffix(env=None): + if env is None: + env = os.environ + return env.get('DYLD_IMAGE_SUFFIX') + +def dyld_framework_path(env=None): + return dyld_env(env, 'DYLD_FRAMEWORK_PATH') + +def dyld_library_path(env=None): + return dyld_env(env, 'DYLD_LIBRARY_PATH') + +def dyld_fallback_framework_path(env=None): + return dyld_env(env, 'DYLD_FALLBACK_FRAMEWORK_PATH') + +def dyld_fallback_library_path(env=None): + return dyld_env(env, 'DYLD_FALLBACK_LIBRARY_PATH') + +def dyld_image_suffix_search(iterator, env=None): + """For a potential path iterator, add DYLD_IMAGE_SUFFIX semantics""" + suffix = dyld_image_suffix(env) + if suffix is None: + return iterator + def _inject(iterator=iterator, suffix=suffix): + for path in iterator: + if path.endswith('.dylib'): + yield path[:-len('.dylib')] + suffix + '.dylib' + else: + yield path + suffix + yield path + return _inject() + +def dyld_override_search(name, env=None): + # If DYLD_FRAMEWORK_PATH is set and this dylib_name is a + # framework name, use the first file that exists in the framework + # path if any. If there is none go on to search the DYLD_LIBRARY_PATH + # if any. + + framework = framework_info(name) + + if framework is not None: + for path in dyld_framework_path(env): + yield os.path.join(path, framework['name']) + + # If DYLD_LIBRARY_PATH is set then use the first file that exists + # in the path. If none use the original name. + for path in dyld_library_path(env): + yield os.path.join(path, os.path.basename(name)) + +def dyld_executable_path_search(name, executable_path=None): + # If we haven't done any searching and found a library and the + # dylib_name starts with "@executable_path/" then construct the + # library name. + if not executable_path: + import sys + if sys.prefix: + executable_path = os.path.join(sys.prefix, 'bin') + if name.startswith('@executable_path/') and executable_path is not None: + yield os.path.join(executable_path, name[len('@executable_path/'):]) + +def dyld_default_search(name, env=None): + yield name + + framework = framework_info(name) + + if framework is not None: + fallback_framework_path = dyld_fallback_framework_path(env) + for path in fallback_framework_path: + yield os.path.join(path, framework['name']) + + fallback_library_path = dyld_fallback_library_path(env) + for path in fallback_library_path: + yield os.path.join(path, os.path.basename(name)) + + if framework is not None and not fallback_framework_path: + for path in DEFAULT_FRAMEWORK_FALLBACK: + yield os.path.join(path, framework['name']) + + if not fallback_library_path: + for path in DEFAULT_LIBRARY_FALLBACK: + yield os.path.join(path, os.path.basename(name)) + +def dyld_find(name, executable_path=None, env=None): + """ + Find a library or framework using dyld semantics + """ + for path in dyld_image_suffix_search(chain( + dyld_override_search(name, env), + dyld_executable_path_search(name, executable_path), + dyld_default_search(name, env), + ), env): + + if os.path.isfile(path): + return path + try: + if _dyld_shared_cache_contains_path(path): + return path + except NotImplementedError: + pass + + raise ValueError("dylib %s could not be found" % (name,)) + +def framework_find(fn, executable_path=None, env=None): + """ + Find a framework using dyld semantics in a very loose manner. + + Will take input such as: + Python + Python.framework + Python.framework/Versions/Current + """ + error = None + try: + return dyld_find(fn, executable_path=executable_path, env=env) + except ValueError as e: + error = e + fmwk_index = fn.rfind('.framework') + if fmwk_index == -1: + fmwk_index = len(fn) + fn += '.framework' + fn = os.path.join(fn, os.path.basename(fn[:fmwk_index])) + try: + return dyld_find(fn, executable_path=executable_path, env=env) + except ValueError: + raise error + finally: + error = None diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/dylib.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/dylib.py new file mode 100644 index 0000000000000000000000000000000000000000..0ad4cba8da3521756942a18942bd11aaaad95a58 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/dylib.py @@ -0,0 +1,42 @@ +""" +Generic dylib path manipulation +""" + +import re + +__all__ = ['dylib_info'] + +DYLIB_RE = re.compile(r"""(?x) +(?P^.*)(?:^|/) +(?P + (?P\w+?) + (?:\.(?P[^._]+))? + (?:_(?P[^._]+))? + \.dylib$ +) +""") + +def dylib_info(filename): + """ + A dylib name can take one of the following four forms: + Location/Name.SomeVersion_Suffix.dylib + Location/Name.SomeVersion.dylib + Location/Name_Suffix.dylib + Location/Name.dylib + + returns None if not found or a mapping equivalent to: + dict( + location='Location', + name='Name.SomeVersion_Suffix.dylib', + shortname='Name', + version='SomeVersion', + suffix='Suffix', + ) + + Note that SomeVersion and Suffix are optional and may be None + if not present. + """ + is_dylib = DYLIB_RE.match(filename) + if not is_dylib: + return None + return is_dylib.groupdict() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/fetch_macholib b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/fetch_macholib new file mode 100644 index 0000000000000000000000000000000000000000..e6d6a2265956293a8ac5eeb0e0e32309694a4a66 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/fetch_macholib @@ -0,0 +1,2 @@ +#!/bin/sh +svn export --force http://svn.red-bean.com/bob/macholib/trunk/macholib/ . diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/fetch_macholib.bat b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/fetch_macholib.bat new file mode 100644 index 0000000000000000000000000000000000000000..f474d5cd0a26f72be2c53228a4465c8b91a0e649 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/fetch_macholib.bat @@ -0,0 +1 @@ +svn export --force http://svn.red-bean.com/bob/macholib/trunk/macholib/ . diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/framework.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/framework.py new file mode 100644 index 0000000000000000000000000000000000000000..495679fff19d418a8248c492bb5959f52787123c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/macholib/framework.py @@ -0,0 +1,42 @@ +""" +Generic framework path manipulation +""" + +import re + +__all__ = ['framework_info'] + +STRICT_FRAMEWORK_RE = re.compile(r"""(?x) +(?P^.*)(?:^|/) +(?P + (?P\w+).framework/ + (?:Versions/(?P[^/]+)/)? + (?P=shortname) + (?:_(?P[^_]+))? +)$ +""") + +def framework_info(filename): + """ + A framework name can take one of the following four forms: + Location/Name.framework/Versions/SomeVersion/Name_Suffix + Location/Name.framework/Versions/SomeVersion/Name + Location/Name.framework/Name_Suffix + Location/Name.framework/Name + + returns None if not found, or a mapping equivalent to: + dict( + location='Location', + name='Name.framework/Versions/SomeVersion/Name_Suffix', + shortname='Name', + version='SomeVersion', + suffix='Suffix', + ) + + Note that SomeVersion and Suffix are optional and may be None + if not present + """ + is_framework = STRICT_FRAMEWORK_RE.match(filename) + if not is_framework: + return None + return is_framework.groupdict() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6e496fa5a5201bf3d84d421400ff6aec6baa3bee --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__init__.py @@ -0,0 +1,16 @@ +import os +import unittest +from test import support +from test.support import import_helper + + +# skip tests if _ctypes was not built +ctypes = import_helper.import_module('ctypes') +ctypes_symbols = dir(ctypes) + +def need_symbol(name): + return unittest.skipUnless(name in ctypes_symbols, + '{!r} is required'.format(name)) + +def load_tests(*args): + return support.load_package_tests(os.path.dirname(__file__), *args) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__main__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..362a9ec8cff6c048e83ff5e3d90a9b4203136048 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__main__.py @@ -0,0 +1,4 @@ +from ctypes.test import load_tests +import unittest + +unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aa1f43b2a34fce2c9f65da26550612e487091bc3 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/__main__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/__main__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b757f26496ea9534bfe52d55a12c492e31fb320e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/__main__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_anon.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_anon.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d88e01c1c6587e3bad68d8009c35f051268af5ac Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_anon.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_array_in_pointer.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_array_in_pointer.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2f7245ce0a049aed904eaed89c2f16244fd75526 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_array_in_pointer.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_arrays.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_arrays.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..29c901bcf9b220de4198c6a9598a6706503b7482 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_arrays.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_as_parameter.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_as_parameter.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..636c4a89cf9fba4f77dccb1d9a11549dcff8bbac Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_as_parameter.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_bitfields.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_bitfields.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..19fe436508f7b8e687ae102996a4cfd42c4c0019 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_bitfields.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_buffers.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_buffers.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0f20f624e2b90de842ae78c42a417b26c149064f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_buffers.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_bytes.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_bytes.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f8fe1e6a875fbcddb3151b9febf54067f0e00f00 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_bytes.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_byteswap.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_byteswap.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5bc146c305c9f414c330dede02a86186ad72cd24 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_byteswap.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_callbacks.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_callbacks.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f88f68fa06ea7bd324cf357af3c259414bd5601 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_callbacks.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_cast.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_cast.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..da37efc296db7099e810552e6005f06c93715e39 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_cast.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_cfuncs.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_cfuncs.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3ad612e1395d4b24a60a119a675ec93ff69a2d30 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_cfuncs.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_checkretval.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_checkretval.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bdcc0a045c583c219e4948ea53d28df47d9ebfee Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_checkretval.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_delattr.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_delattr.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7c734e0825e290c612d10e1e3196d71cfa5cce7e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_delattr.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_errno.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_errno.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..36bc8d7520d14bd0762cfddd2b86eb4e3d970ade Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_errno.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_find.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_find.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f751f60d063e2fb00ca7a9d92d8cb6d33882efcc Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_find.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_frombuffer.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_frombuffer.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6a1358ea4c885b10335c7dd43e73c14a82e95e7f Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_frombuffer.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_funcptr.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_funcptr.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..71049606b9718b0fb9135e24394d89712179b0f4 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_funcptr.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_functions.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_functions.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..75a1826f4b4fe60c042fd1f06d4acc3fc43a8b0e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_functions.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_incomplete.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_incomplete.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b2e57fe9a90151259fbaf79fce25af4d0c558f86 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_incomplete.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_init.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_init.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..585054217062c67e14f21c4f9b6ed167b567d145 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_init.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_internals.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_internals.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..203f55f68eae0cda33dd8a1592639274e0246cfc Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_internals.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_keeprefs.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_keeprefs.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..180762768116f50f5848ca84040dcb65da81a5e8 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_keeprefs.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_libc.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_libc.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9965f2afe4548b47391f7cd322b93a69a186b983 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_libc.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_loading.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_loading.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cd05688e88cae7adb26d1cd26ded3c6340bd8792 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_loading.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_macholib.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_macholib.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b227c4024ae84302e48918da41b76255aaedf9ea Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_macholib.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_memfunctions.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_memfunctions.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0cae1c340b7071de929c37da24aeed148e25e4ca Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_memfunctions.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_numbers.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_numbers.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dc8e4033230d973198fdb342b1baa25d87c7515b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_numbers.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_objects.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_objects.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9b4a86e6825b80983d37b233758d964753816412 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_objects.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_parameters.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_parameters.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..158d8e5aa57beef0cf33b270e4b8d1c6d5bf40a6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_parameters.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_pep3118.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_pep3118.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b6313bb732b5ab7b7da1c9efa01dbd1779d0d4c0 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_pep3118.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_pickling.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_pickling.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0bbde00ff261b2a8f0dd6f98b976f5806c9385d9 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_pickling.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_pointers.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_pointers.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..98294d6e8bd0c5ac0a35a513954973e431293536 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_pointers.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_prototypes.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_prototypes.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..069d8d76ad357fc24eca728dd4533eb33f126929 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_prototypes.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_python_api.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_python_api.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c887e48fcc147ddd8357ebac5b29b05cc6d040d1 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_python_api.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_random_things.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_random_things.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..766cc98eb479e777e2f5cc9d4052efec97375ccb Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_random_things.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_refcounts.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_refcounts.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8bfbf8a22db6c9d5262bf753315b8f56b8a69a84 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_refcounts.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_repr.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_repr.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3565f7c7317c61f31c2e0577e819081222229246 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_repr.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_returnfuncptrs.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_returnfuncptrs.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..85ec19467869d79f02bc8abe6ba497790fbdb23e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_returnfuncptrs.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_simplesubclasses.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_simplesubclasses.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..03f065d8a311930c3ad1ecb3db608547a09bc63c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_simplesubclasses.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_sizes.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_sizes.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cb2fde1e1371d28855f7d40c891d20926e4ef2dc Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_sizes.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_slicing.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_slicing.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..144b2c621b47d441d2b6113cfc8bd9e0ffad24a7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_slicing.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_stringptr.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_stringptr.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4a4cb9e81199a095fa6727ccd8da4660e7e796f4 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_stringptr.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_strings.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_strings.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a6f0c4fb0a728a589b01d6971d31900d08122932 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_strings.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_struct_fields.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_struct_fields.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aa5784c5635bf91f0bbbc1cadb8d1cc8edeb69ae Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_struct_fields.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_structures.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_structures.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2366fe7fc5e0f079933bc7ea23ed62c95e18fc6b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_structures.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_unaligned_structures.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_unaligned_structures.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..04dce5cf90771c6c0f47a81d0987d15332b07779 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_unaligned_structures.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_unicode.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_unicode.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f8aa80b0f1d6dc21a30272382b179a1328373d45 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_unicode.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_values.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_values.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..832eed346657007f290775294c7ddbe1014a0b0a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_values.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_varsize_struct.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_varsize_struct.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bacfe943b80921bb922cecdac66191ccfb672a7c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_varsize_struct.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_win32.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_win32.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a9aceec5de21d46fd7c83c334e29fe8ba0e2ca80 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_win32.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_wintypes.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_wintypes.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aba0578eb45a7cf1aadac5977e82a7e94c370ebc Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/__pycache__/test_wintypes.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_anon.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_anon.py new file mode 100644 index 0000000000000000000000000000000000000000..d378392ebe28443d36fe6eae9aafad7927b8cc46 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_anon.py @@ -0,0 +1,73 @@ +import unittest +import test.support +from ctypes import * + +class AnonTest(unittest.TestCase): + + def test_anon(self): + class ANON(Union): + _fields_ = [("a", c_int), + ("b", c_int)] + + class Y(Structure): + _fields_ = [("x", c_int), + ("_", ANON), + ("y", c_int)] + _anonymous_ = ["_"] + + self.assertEqual(Y.a.offset, sizeof(c_int)) + self.assertEqual(Y.b.offset, sizeof(c_int)) + + self.assertEqual(ANON.a.offset, 0) + self.assertEqual(ANON.b.offset, 0) + + def test_anon_nonseq(self): + # TypeError: _anonymous_ must be a sequence + self.assertRaises(TypeError, + lambda: type(Structure)("Name", + (Structure,), + {"_fields_": [], "_anonymous_": 42})) + + def test_anon_nonmember(self): + # AttributeError: type object 'Name' has no attribute 'x' + self.assertRaises(AttributeError, + lambda: type(Structure)("Name", + (Structure,), + {"_fields_": [], + "_anonymous_": ["x"]})) + + @test.support.cpython_only + def test_issue31490(self): + # There shouldn't be an assertion failure in case the class has an + # attribute whose name is specified in _anonymous_ but not in _fields_. + + # AttributeError: 'x' is specified in _anonymous_ but not in _fields_ + with self.assertRaises(AttributeError): + class Name(Structure): + _fields_ = [] + _anonymous_ = ["x"] + x = 42 + + def test_nested(self): + class ANON_S(Structure): + _fields_ = [("a", c_int)] + + class ANON_U(Union): + _fields_ = [("_", ANON_S), + ("b", c_int)] + _anonymous_ = ["_"] + + class Y(Structure): + _fields_ = [("x", c_int), + ("_", ANON_U), + ("y", c_int)] + _anonymous_ = ["_"] + + self.assertEqual(Y.x.offset, 0) + self.assertEqual(Y.a.offset, sizeof(c_int)) + self.assertEqual(Y.b.offset, sizeof(c_int)) + self.assertEqual(Y._.offset, sizeof(c_int)) + self.assertEqual(Y.y.offset, sizeof(c_int) * 2) + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_array_in_pointer.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_array_in_pointer.py new file mode 100644 index 0000000000000000000000000000000000000000..ca1edcf6210176ca0f1d1a951527569af209ee1f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_array_in_pointer.py @@ -0,0 +1,64 @@ +import unittest +from ctypes import * +from binascii import hexlify +import re + +def dump(obj): + # helper function to dump memory contents in hex, with a hyphen + # between the bytes. + h = hexlify(memoryview(obj)).decode() + return re.sub(r"(..)", r"\1-", h)[:-1] + + +class Value(Structure): + _fields_ = [("val", c_byte)] + +class Container(Structure): + _fields_ = [("pvalues", POINTER(Value))] + +class Test(unittest.TestCase): + def test(self): + # create an array of 4 values + val_array = (Value * 4)() + + # create a container, which holds a pointer to the pvalues array. + c = Container() + c.pvalues = val_array + + # memory contains 4 NUL bytes now, that's correct + self.assertEqual("00-00-00-00", dump(val_array)) + + # set the values of the array through the pointer: + for i in range(4): + c.pvalues[i].val = i + 1 + + values = [c.pvalues[i].val for i in range(4)] + + # These are the expected results: here s the bug! + self.assertEqual( + (values, dump(val_array)), + ([1, 2, 3, 4], "01-02-03-04") + ) + + def test_2(self): + + val_array = (Value * 4)() + + # memory contains 4 NUL bytes now, that's correct + self.assertEqual("00-00-00-00", dump(val_array)) + + ptr = cast(val_array, POINTER(Value)) + # set the values of the array through the pointer: + for i in range(4): + ptr[i].val = i + 1 + + values = [ptr[i].val for i in range(4)] + + # These are the expected results: here s the bug! + self.assertEqual( + (values, dump(val_array)), + ([1, 2, 3, 4], "01-02-03-04") + ) + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_arrays.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_arrays.py new file mode 100644 index 0000000000000000000000000000000000000000..a6538779611d77aa82d12a042b9e0d86df1b8697 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_arrays.py @@ -0,0 +1,238 @@ +import unittest +from test.support import bigmemtest, _2G +import sys +from ctypes import * + +from ctypes.test import need_symbol + +formats = "bBhHiIlLqQfd" + +formats = c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, \ + c_long, c_ulonglong, c_float, c_double, c_longdouble + +class ArrayTestCase(unittest.TestCase): + def test_simple(self): + # create classes holding simple numeric types, and check + # various properties. + + init = list(range(15, 25)) + + for fmt in formats: + alen = len(init) + int_array = ARRAY(fmt, alen) + + ia = int_array(*init) + # length of instance ok? + self.assertEqual(len(ia), alen) + + # slot values ok? + values = [ia[i] for i in range(alen)] + self.assertEqual(values, init) + + # out-of-bounds accesses should be caught + with self.assertRaises(IndexError): ia[alen] + with self.assertRaises(IndexError): ia[-alen-1] + + # change the items + from operator import setitem + new_values = list(range(42, 42+alen)) + [setitem(ia, n, new_values[n]) for n in range(alen)] + values = [ia[i] for i in range(alen)] + self.assertEqual(values, new_values) + + # are the items initialized to 0? + ia = int_array() + values = [ia[i] for i in range(alen)] + self.assertEqual(values, [0] * alen) + + # Too many initializers should be caught + self.assertRaises(IndexError, int_array, *range(alen*2)) + + CharArray = ARRAY(c_char, 3) + + ca = CharArray(b"a", b"b", b"c") + + # Should this work? It doesn't: + # CharArray("abc") + self.assertRaises(TypeError, CharArray, "abc") + + self.assertEqual(ca[0], b"a") + self.assertEqual(ca[1], b"b") + self.assertEqual(ca[2], b"c") + self.assertEqual(ca[-3], b"a") + self.assertEqual(ca[-2], b"b") + self.assertEqual(ca[-1], b"c") + + self.assertEqual(len(ca), 3) + + # cannot delete items + from operator import delitem + self.assertRaises(TypeError, delitem, ca, 0) + + def test_step_overflow(self): + a = (c_int * 5)() + a[3::sys.maxsize] = (1,) + self.assertListEqual(a[3::sys.maxsize], [1]) + a = (c_char * 5)() + a[3::sys.maxsize] = b"A" + self.assertEqual(a[3::sys.maxsize], b"A") + a = (c_wchar * 5)() + a[3::sys.maxsize] = u"X" + self.assertEqual(a[3::sys.maxsize], u"X") + + def test_numeric_arrays(self): + + alen = 5 + + numarray = ARRAY(c_int, alen) + + na = numarray() + values = [na[i] for i in range(alen)] + self.assertEqual(values, [0] * alen) + + na = numarray(*[c_int()] * alen) + values = [na[i] for i in range(alen)] + self.assertEqual(values, [0]*alen) + + na = numarray(1, 2, 3, 4, 5) + values = [i for i in na] + self.assertEqual(values, [1, 2, 3, 4, 5]) + + na = numarray(*map(c_int, (1, 2, 3, 4, 5))) + values = [i for i in na] + self.assertEqual(values, [1, 2, 3, 4, 5]) + + def test_classcache(self): + self.assertIsNot(ARRAY(c_int, 3), ARRAY(c_int, 4)) + self.assertIs(ARRAY(c_int, 3), ARRAY(c_int, 3)) + + def test_from_address(self): + # Failed with 0.9.8, reported by JUrner + p = create_string_buffer(b"foo") + sz = (c_char * 3).from_address(addressof(p)) + self.assertEqual(sz[:], b"foo") + self.assertEqual(sz[::], b"foo") + self.assertEqual(sz[::-1], b"oof") + self.assertEqual(sz[::3], b"f") + self.assertEqual(sz[1:4:2], b"o") + self.assertEqual(sz.value, b"foo") + + @need_symbol('create_unicode_buffer') + def test_from_addressW(self): + p = create_unicode_buffer("foo") + sz = (c_wchar * 3).from_address(addressof(p)) + self.assertEqual(sz[:], "foo") + self.assertEqual(sz[::], "foo") + self.assertEqual(sz[::-1], "oof") + self.assertEqual(sz[::3], "f") + self.assertEqual(sz[1:4:2], "o") + self.assertEqual(sz.value, "foo") + + def test_cache(self): + # Array types are cached internally in the _ctypes extension, + # in a WeakValueDictionary. Make sure the array type is + # removed from the cache when the itemtype goes away. This + # test will not fail, but will show a leak in the testsuite. + + # Create a new type: + class my_int(c_int): + pass + # Create a new array type based on it: + t1 = my_int * 1 + t2 = my_int * 1 + self.assertIs(t1, t2) + + def test_subclass(self): + class T(Array): + _type_ = c_int + _length_ = 13 + class U(T): + pass + class V(U): + pass + class W(V): + pass + class X(T): + _type_ = c_short + class Y(T): + _length_ = 187 + + for c in [T, U, V, W]: + self.assertEqual(c._type_, c_int) + self.assertEqual(c._length_, 13) + self.assertEqual(c()._type_, c_int) + self.assertEqual(c()._length_, 13) + + self.assertEqual(X._type_, c_short) + self.assertEqual(X._length_, 13) + self.assertEqual(X()._type_, c_short) + self.assertEqual(X()._length_, 13) + + self.assertEqual(Y._type_, c_int) + self.assertEqual(Y._length_, 187) + self.assertEqual(Y()._type_, c_int) + self.assertEqual(Y()._length_, 187) + + def test_bad_subclass(self): + with self.assertRaises(AttributeError): + class T(Array): + pass + with self.assertRaises(AttributeError): + class T2(Array): + _type_ = c_int + with self.assertRaises(AttributeError): + class T3(Array): + _length_ = 13 + + def test_bad_length(self): + with self.assertRaises(ValueError): + class T(Array): + _type_ = c_int + _length_ = - sys.maxsize * 2 + with self.assertRaises(ValueError): + class T2(Array): + _type_ = c_int + _length_ = -1 + with self.assertRaises(TypeError): + class T3(Array): + _type_ = c_int + _length_ = 1.87 + with self.assertRaises(OverflowError): + class T4(Array): + _type_ = c_int + _length_ = sys.maxsize * 2 + + def test_zero_length(self): + # _length_ can be zero. + class T(Array): + _type_ = c_int + _length_ = 0 + + def test_empty_element_struct(self): + class EmptyStruct(Structure): + _fields_ = [] + + obj = (EmptyStruct * 2)() # bpo37188: Floating point exception + self.assertEqual(sizeof(obj), 0) + + def test_empty_element_array(self): + class EmptyArray(Array): + _type_ = c_int + _length_ = 0 + + obj = (EmptyArray * 2)() # bpo37188: Floating point exception + self.assertEqual(sizeof(obj), 0) + + def test_bpo36504_signed_int_overflow(self): + # The overflow check in PyCArrayType_new() could cause signed integer + # overflow. + with self.assertRaises(OverflowError): + c_char * sys.maxsize * 2 + + @unittest.skipUnless(sys.maxsize > 2**32, 'requires 64bit platform') + @bigmemtest(size=_2G, memuse=1, dry_run=False) + def test_large_array(self, size): + c_char * size + +if __name__ == '__main__': + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_as_parameter.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_as_parameter.py new file mode 100644 index 0000000000000000000000000000000000000000..457643f5160d98acde83826dde53ea8c8d0cbddb --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_as_parameter.py @@ -0,0 +1,242 @@ +import unittest +from ctypes import * +from ctypes.test import need_symbol +import _ctypes_test + +dll = CDLL(_ctypes_test.__file__) + +try: + CALLBACK_FUNCTYPE = WINFUNCTYPE +except NameError: + # fake to enable this test on Linux + CALLBACK_FUNCTYPE = CFUNCTYPE + +class POINT(Structure): + _fields_ = [("x", c_int), ("y", c_int)] + +class BasicWrapTestCase(unittest.TestCase): + def wrap(self, param): + return param + + @need_symbol('c_wchar') + def test_wchar_parm(self): + f = dll._testfunc_i_bhilfd + f.argtypes = [c_byte, c_wchar, c_int, c_long, c_float, c_double] + result = f(self.wrap(1), self.wrap("x"), self.wrap(3), self.wrap(4), self.wrap(5.0), self.wrap(6.0)) + self.assertEqual(result, 139) + self.assertIs(type(result), int) + + def test_pointers(self): + f = dll._testfunc_p_p + f.restype = POINTER(c_int) + f.argtypes = [POINTER(c_int)] + + # This only works if the value c_int(42) passed to the + # function is still alive while the pointer (the result) is + # used. + + v = c_int(42) + + self.assertEqual(pointer(v).contents.value, 42) + result = f(self.wrap(pointer(v))) + self.assertEqual(type(result), POINTER(c_int)) + self.assertEqual(result.contents.value, 42) + + # This on works... + result = f(self.wrap(pointer(v))) + self.assertEqual(result.contents.value, v.value) + + p = pointer(c_int(99)) + result = f(self.wrap(p)) + self.assertEqual(result.contents.value, 99) + + def test_shorts(self): + f = dll._testfunc_callback_i_if + + args = [] + expected = [262144, 131072, 65536, 32768, 16384, 8192, 4096, 2048, + 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1] + + def callback(v): + args.append(v) + return v + + CallBack = CFUNCTYPE(c_int, c_int) + + cb = CallBack(callback) + f(self.wrap(2**18), self.wrap(cb)) + self.assertEqual(args, expected) + + ################################################################ + + def test_callbacks(self): + f = dll._testfunc_callback_i_if + f.restype = c_int + f.argtypes = None + + MyCallback = CFUNCTYPE(c_int, c_int) + + def callback(value): + #print "called back with", value + return value + + cb = MyCallback(callback) + + result = f(self.wrap(-10), self.wrap(cb)) + self.assertEqual(result, -18) + + # test with prototype + f.argtypes = [c_int, MyCallback] + cb = MyCallback(callback) + + result = f(self.wrap(-10), self.wrap(cb)) + self.assertEqual(result, -18) + + result = f(self.wrap(-10), self.wrap(cb)) + self.assertEqual(result, -18) + + AnotherCallback = CALLBACK_FUNCTYPE(c_int, c_int, c_int, c_int, c_int) + + # check that the prototype works: we call f with wrong + # argument types + cb = AnotherCallback(callback) + self.assertRaises(ArgumentError, f, self.wrap(-10), self.wrap(cb)) + + def test_callbacks_2(self): + # Can also use simple datatypes as argument type specifiers + # for the callback function. + # In this case the call receives an instance of that type + f = dll._testfunc_callback_i_if + f.restype = c_int + + MyCallback = CFUNCTYPE(c_int, c_int) + + f.argtypes = [c_int, MyCallback] + + def callback(value): + #print "called back with", value + self.assertEqual(type(value), int) + return value + + cb = MyCallback(callback) + result = f(self.wrap(-10), self.wrap(cb)) + self.assertEqual(result, -18) + + @need_symbol('c_longlong') + def test_longlong_callbacks(self): + + f = dll._testfunc_callback_q_qf + f.restype = c_longlong + + MyCallback = CFUNCTYPE(c_longlong, c_longlong) + + f.argtypes = [c_longlong, MyCallback] + + def callback(value): + self.assertIsInstance(value, int) + return value & 0x7FFFFFFF + + cb = MyCallback(callback) + + self.assertEqual(13577625587, int(f(self.wrap(1000000000000), self.wrap(cb)))) + + def test_byval(self): + # without prototype + ptin = POINT(1, 2) + ptout = POINT() + # EXPORT int _testfunc_byval(point in, point *pout) + result = dll._testfunc_byval(ptin, byref(ptout)) + got = result, ptout.x, ptout.y + expected = 3, 1, 2 + self.assertEqual(got, expected) + + # with prototype + ptin = POINT(101, 102) + ptout = POINT() + dll._testfunc_byval.argtypes = (POINT, POINTER(POINT)) + dll._testfunc_byval.restype = c_int + result = dll._testfunc_byval(self.wrap(ptin), byref(ptout)) + got = result, ptout.x, ptout.y + expected = 203, 101, 102 + self.assertEqual(got, expected) + + def test_struct_return_2H(self): + class S2H(Structure): + _fields_ = [("x", c_short), + ("y", c_short)] + dll.ret_2h_func.restype = S2H + dll.ret_2h_func.argtypes = [S2H] + inp = S2H(99, 88) + s2h = dll.ret_2h_func(self.wrap(inp)) + self.assertEqual((s2h.x, s2h.y), (99*2, 88*3)) + + # Test also that the original struct was unmodified (i.e. was passed by + # value) + self.assertEqual((inp.x, inp.y), (99, 88)) + + def test_struct_return_8H(self): + class S8I(Structure): + _fields_ = [("a", c_int), + ("b", c_int), + ("c", c_int), + ("d", c_int), + ("e", c_int), + ("f", c_int), + ("g", c_int), + ("h", c_int)] + dll.ret_8i_func.restype = S8I + dll.ret_8i_func.argtypes = [S8I] + inp = S8I(9, 8, 7, 6, 5, 4, 3, 2) + s8i = dll.ret_8i_func(self.wrap(inp)) + self.assertEqual((s8i.a, s8i.b, s8i.c, s8i.d, s8i.e, s8i.f, s8i.g, s8i.h), + (9*2, 8*3, 7*4, 6*5, 5*6, 4*7, 3*8, 2*9)) + + def test_recursive_as_param(self): + from ctypes import c_int + + class A: + pass + + a = A() + a._as_parameter_ = a + with self.assertRaises(RecursionError): + c_int.from_param(a) + + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class AsParamWrapper: + def __init__(self, param): + self._as_parameter_ = param + +class AsParamWrapperTestCase(BasicWrapTestCase): + wrap = AsParamWrapper + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class AsParamPropertyWrapper: + def __init__(self, param): + self._param = param + + def getParameter(self): + return self._param + _as_parameter_ = property(getParameter) + +class AsParamPropertyWrapperTestCase(BasicWrapTestCase): + wrap = AsParamPropertyWrapper + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class AsParamNestedWrapperTestCase(BasicWrapTestCase): + """Test that _as_parameter_ is evaluated recursively. + + The _as_parameter_ attribute can be another object which + defines its own _as_parameter_ attribute. + """ + + def wrap(self, param): + return AsParamWrapper(AsParamWrapper(AsParamWrapper(param))) + + +if __name__ == '__main__': + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_bitfields.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_bitfields.py new file mode 100644 index 0000000000000000000000000000000000000000..66acd62e6851a12e1a7d4b34f9f3b083e3fa9a0d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_bitfields.py @@ -0,0 +1,297 @@ +from ctypes import * +from ctypes.test import need_symbol +from test import support +import unittest +import os + +import _ctypes_test + +class BITS(Structure): + _fields_ = [("A", c_int, 1), + ("B", c_int, 2), + ("C", c_int, 3), + ("D", c_int, 4), + ("E", c_int, 5), + ("F", c_int, 6), + ("G", c_int, 7), + ("H", c_int, 8), + ("I", c_int, 9), + + ("M", c_short, 1), + ("N", c_short, 2), + ("O", c_short, 3), + ("P", c_short, 4), + ("Q", c_short, 5), + ("R", c_short, 6), + ("S", c_short, 7)] + +func = CDLL(_ctypes_test.__file__).unpack_bitfields +func.argtypes = POINTER(BITS), c_char + +##for n in "ABCDEFGHIMNOPQRS": +## print n, hex(getattr(BITS, n).size), getattr(BITS, n).offset + +class C_Test(unittest.TestCase): + + def test_ints(self): + for i in range(512): + for name in "ABCDEFGHI": + b = BITS() + setattr(b, name, i) + self.assertEqual(getattr(b, name), func(byref(b), name.encode('ascii'))) + + # bpo-46913: _ctypes/cfield.c h_get() has an undefined behavior + @support.skip_if_sanitizer(ub=True) + def test_shorts(self): + b = BITS() + name = "M" + if func(byref(b), name.encode('ascii')) == 999: + self.skipTest("Compiler does not support signed short bitfields") + for i in range(256): + for name in "MNOPQRS": + b = BITS() + setattr(b, name, i) + self.assertEqual(getattr(b, name), func(byref(b), name.encode('ascii'))) + +signed_int_types = (c_byte, c_short, c_int, c_long, c_longlong) +unsigned_int_types = (c_ubyte, c_ushort, c_uint, c_ulong, c_ulonglong) +int_types = unsigned_int_types + signed_int_types + +class BitFieldTest(unittest.TestCase): + + def test_longlong(self): + class X(Structure): + _fields_ = [("a", c_longlong, 1), + ("b", c_longlong, 62), + ("c", c_longlong, 1)] + + self.assertEqual(sizeof(X), sizeof(c_longlong)) + x = X() + x.a, x.b, x.c = -1, 7, -1 + self.assertEqual((x.a, x.b, x.c), (-1, 7, -1)) + + def test_ulonglong(self): + class X(Structure): + _fields_ = [("a", c_ulonglong, 1), + ("b", c_ulonglong, 62), + ("c", c_ulonglong, 1)] + + self.assertEqual(sizeof(X), sizeof(c_longlong)) + x = X() + self.assertEqual((x.a, x.b, x.c), (0, 0, 0)) + x.a, x.b, x.c = 7, 7, 7 + self.assertEqual((x.a, x.b, x.c), (1, 7, 1)) + + def test_signed(self): + for c_typ in signed_int_types: + class X(Structure): + _fields_ = [("dummy", c_typ), + ("a", c_typ, 3), + ("b", c_typ, 3), + ("c", c_typ, 1)] + self.assertEqual(sizeof(X), sizeof(c_typ)*2) + + x = X() + self.assertEqual((c_typ, x.a, x.b, x.c), (c_typ, 0, 0, 0)) + x.a = -1 + self.assertEqual((c_typ, x.a, x.b, x.c), (c_typ, -1, 0, 0)) + x.a, x.b = 0, -1 + self.assertEqual((c_typ, x.a, x.b, x.c), (c_typ, 0, -1, 0)) + + + def test_unsigned(self): + for c_typ in unsigned_int_types: + class X(Structure): + _fields_ = [("a", c_typ, 3), + ("b", c_typ, 3), + ("c", c_typ, 1)] + self.assertEqual(sizeof(X), sizeof(c_typ)) + + x = X() + self.assertEqual((c_typ, x.a, x.b, x.c), (c_typ, 0, 0, 0)) + x.a = -1 + self.assertEqual((c_typ, x.a, x.b, x.c), (c_typ, 7, 0, 0)) + x.a, x.b = 0, -1 + self.assertEqual((c_typ, x.a, x.b, x.c), (c_typ, 0, 7, 0)) + + + def fail_fields(self, *fields): + return self.get_except(type(Structure), "X", (), + {"_fields_": fields}) + + def test_nonint_types(self): + # bit fields are not allowed on non-integer types. + result = self.fail_fields(("a", c_char_p, 1)) + self.assertEqual(result, (TypeError, 'bit fields not allowed for type c_char_p')) + + result = self.fail_fields(("a", c_void_p, 1)) + self.assertEqual(result, (TypeError, 'bit fields not allowed for type c_void_p')) + + if c_int != c_long: + result = self.fail_fields(("a", POINTER(c_int), 1)) + self.assertEqual(result, (TypeError, 'bit fields not allowed for type LP_c_int')) + + result = self.fail_fields(("a", c_char, 1)) + self.assertEqual(result, (TypeError, 'bit fields not allowed for type c_char')) + + class Dummy(Structure): + _fields_ = [] + + result = self.fail_fields(("a", Dummy, 1)) + self.assertEqual(result, (TypeError, 'bit fields not allowed for type Dummy')) + + @need_symbol('c_wchar') + def test_c_wchar(self): + result = self.fail_fields(("a", c_wchar, 1)) + self.assertEqual(result, + (TypeError, 'bit fields not allowed for type c_wchar')) + + def test_single_bitfield_size(self): + for c_typ in int_types: + result = self.fail_fields(("a", c_typ, -1)) + self.assertEqual(result, (ValueError, 'number of bits invalid for bit field')) + + result = self.fail_fields(("a", c_typ, 0)) + self.assertEqual(result, (ValueError, 'number of bits invalid for bit field')) + + class X(Structure): + _fields_ = [("a", c_typ, 1)] + self.assertEqual(sizeof(X), sizeof(c_typ)) + + class X(Structure): + _fields_ = [("a", c_typ, sizeof(c_typ)*8)] + self.assertEqual(sizeof(X), sizeof(c_typ)) + + result = self.fail_fields(("a", c_typ, sizeof(c_typ)*8 + 1)) + self.assertEqual(result, (ValueError, 'number of bits invalid for bit field')) + + def test_multi_bitfields_size(self): + class X(Structure): + _fields_ = [("a", c_short, 1), + ("b", c_short, 14), + ("c", c_short, 1)] + self.assertEqual(sizeof(X), sizeof(c_short)) + + class X(Structure): + _fields_ = [("a", c_short, 1), + ("a1", c_short), + ("b", c_short, 14), + ("c", c_short, 1)] + self.assertEqual(sizeof(X), sizeof(c_short)*3) + self.assertEqual(X.a.offset, 0) + self.assertEqual(X.a1.offset, sizeof(c_short)) + self.assertEqual(X.b.offset, sizeof(c_short)*2) + self.assertEqual(X.c.offset, sizeof(c_short)*2) + + class X(Structure): + _fields_ = [("a", c_short, 3), + ("b", c_short, 14), + ("c", c_short, 14)] + self.assertEqual(sizeof(X), sizeof(c_short)*3) + self.assertEqual(X.a.offset, sizeof(c_short)*0) + self.assertEqual(X.b.offset, sizeof(c_short)*1) + self.assertEqual(X.c.offset, sizeof(c_short)*2) + + + def get_except(self, func, *args, **kw): + try: + func(*args, **kw) + except Exception as detail: + return detail.__class__, str(detail) + + def test_mixed_1(self): + class X(Structure): + _fields_ = [("a", c_byte, 4), + ("b", c_int, 4)] + if os.name == "nt": + self.assertEqual(sizeof(X), sizeof(c_int)*2) + else: + self.assertEqual(sizeof(X), sizeof(c_int)) + + def test_mixed_2(self): + class X(Structure): + _fields_ = [("a", c_byte, 4), + ("b", c_int, 32)] + self.assertEqual(sizeof(X), alignment(c_int)+sizeof(c_int)) + + def test_mixed_3(self): + class X(Structure): + _fields_ = [("a", c_byte, 4), + ("b", c_ubyte, 4)] + self.assertEqual(sizeof(X), sizeof(c_byte)) + + def test_mixed_4(self): + class X(Structure): + _fields_ = [("a", c_short, 4), + ("b", c_short, 4), + ("c", c_int, 24), + ("d", c_short, 4), + ("e", c_short, 4), + ("f", c_int, 24)] + # MSVC does NOT combine c_short and c_int into one field, GCC + # does (unless GCC is run with '-mms-bitfields' which + # produces code compatible with MSVC). + if os.name == "nt": + self.assertEqual(sizeof(X), sizeof(c_int) * 4) + else: + self.assertEqual(sizeof(X), sizeof(c_int) * 2) + + def test_anon_bitfields(self): + # anonymous bit-fields gave a strange error message + class X(Structure): + _fields_ = [("a", c_byte, 4), + ("b", c_ubyte, 4)] + class Y(Structure): + _anonymous_ = ["_"] + _fields_ = [("_", X)] + + @need_symbol('c_uint32') + def test_uint32(self): + class X(Structure): + _fields_ = [("a", c_uint32, 32)] + x = X() + x.a = 10 + self.assertEqual(x.a, 10) + x.a = 0xFDCBA987 + self.assertEqual(x.a, 0xFDCBA987) + + @need_symbol('c_uint64') + def test_uint64(self): + class X(Structure): + _fields_ = [("a", c_uint64, 64)] + x = X() + x.a = 10 + self.assertEqual(x.a, 10) + x.a = 0xFEDCBA9876543211 + self.assertEqual(x.a, 0xFEDCBA9876543211) + + @need_symbol('c_uint32') + def test_uint32_swap_little_endian(self): + # Issue #23319 + class Little(LittleEndianStructure): + _fields_ = [("a", c_uint32, 24), + ("b", c_uint32, 4), + ("c", c_uint32, 4)] + b = bytearray(4) + x = Little.from_buffer(b) + x.a = 0xabcdef + x.b = 1 + x.c = 2 + self.assertEqual(b, b'\xef\xcd\xab\x21') + + @need_symbol('c_uint32') + def test_uint32_swap_big_endian(self): + # Issue #23319 + class Big(BigEndianStructure): + _fields_ = [("a", c_uint32, 24), + ("b", c_uint32, 4), + ("c", c_uint32, 4)] + b = bytearray(4) + x = Big.from_buffer(b) + x.a = 0xabcdef + x.b = 1 + x.c = 2 + self.assertEqual(b, b'\xab\xcd\xef\x12') + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_buffers.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_buffers.py new file mode 100644 index 0000000000000000000000000000000000000000..15782be757c8535db56be2a2036195e54a48dd01 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_buffers.py @@ -0,0 +1,73 @@ +from ctypes import * +from ctypes.test import need_symbol +import unittest + +class StringBufferTestCase(unittest.TestCase): + + def test_buffer(self): + b = create_string_buffer(32) + self.assertEqual(len(b), 32) + self.assertEqual(sizeof(b), 32 * sizeof(c_char)) + self.assertIs(type(b[0]), bytes) + + b = create_string_buffer(b"abc") + self.assertEqual(len(b), 4) # trailing nul char + self.assertEqual(sizeof(b), 4 * sizeof(c_char)) + self.assertIs(type(b[0]), bytes) + self.assertEqual(b[0], b"a") + self.assertEqual(b[:], b"abc\0") + self.assertEqual(b[::], b"abc\0") + self.assertEqual(b[::-1], b"\0cba") + self.assertEqual(b[::2], b"ac") + self.assertEqual(b[::5], b"a") + + self.assertRaises(TypeError, create_string_buffer, "abc") + + def test_buffer_interface(self): + self.assertEqual(len(bytearray(create_string_buffer(0))), 0) + self.assertEqual(len(bytearray(create_string_buffer(1))), 1) + + @need_symbol('c_wchar') + def test_unicode_buffer(self): + b = create_unicode_buffer(32) + self.assertEqual(len(b), 32) + self.assertEqual(sizeof(b), 32 * sizeof(c_wchar)) + self.assertIs(type(b[0]), str) + + b = create_unicode_buffer("abc") + self.assertEqual(len(b), 4) # trailing nul char + self.assertEqual(sizeof(b), 4 * sizeof(c_wchar)) + self.assertIs(type(b[0]), str) + self.assertEqual(b[0], "a") + self.assertEqual(b[:], "abc\0") + self.assertEqual(b[::], "abc\0") + self.assertEqual(b[::-1], "\0cba") + self.assertEqual(b[::2], "ac") + self.assertEqual(b[::5], "a") + + self.assertRaises(TypeError, create_unicode_buffer, b"abc") + + @need_symbol('c_wchar') + def test_unicode_conversion(self): + b = create_unicode_buffer("abc") + self.assertEqual(len(b), 4) # trailing nul char + self.assertEqual(sizeof(b), 4 * sizeof(c_wchar)) + self.assertIs(type(b[0]), str) + self.assertEqual(b[0], "a") + self.assertEqual(b[:], "abc\0") + self.assertEqual(b[::], "abc\0") + self.assertEqual(b[::-1], "\0cba") + self.assertEqual(b[::2], "ac") + self.assertEqual(b[::5], "a") + + @need_symbol('c_wchar') + def test_create_unicode_buffer_non_bmp(self): + expected = 5 if sizeof(c_wchar) == 2 else 3 + for s in '\U00010000\U00100000', '\U00010000\U0010ffff': + b = create_unicode_buffer(s) + self.assertEqual(len(b), expected) + self.assertEqual(b[-1], '\0') + + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_bytes.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_bytes.py new file mode 100644 index 0000000000000000000000000000000000000000..092ec5af0524c408a2e78dbf8fa568db5233bce6 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_bytes.py @@ -0,0 +1,66 @@ +"""Test where byte objects are accepted""" +import unittest +import sys +from ctypes import * + +class BytesTest(unittest.TestCase): + def test_c_char(self): + x = c_char(b"x") + self.assertRaises(TypeError, c_char, "x") + x.value = b"y" + with self.assertRaises(TypeError): + x.value = "y" + c_char.from_param(b"x") + self.assertRaises(TypeError, c_char.from_param, "x") + self.assertIn('xbd', repr(c_char.from_param(b"\xbd"))) + (c_char * 3)(b"a", b"b", b"c") + self.assertRaises(TypeError, c_char * 3, "a", "b", "c") + + def test_c_wchar(self): + x = c_wchar("x") + self.assertRaises(TypeError, c_wchar, b"x") + x.value = "y" + with self.assertRaises(TypeError): + x.value = b"y" + c_wchar.from_param("x") + self.assertRaises(TypeError, c_wchar.from_param, b"x") + (c_wchar * 3)("a", "b", "c") + self.assertRaises(TypeError, c_wchar * 3, b"a", b"b", b"c") + + def test_c_char_p(self): + c_char_p(b"foo bar") + self.assertRaises(TypeError, c_char_p, "foo bar") + + def test_c_wchar_p(self): + c_wchar_p("foo bar") + self.assertRaises(TypeError, c_wchar_p, b"foo bar") + + def test_struct(self): + class X(Structure): + _fields_ = [("a", c_char * 3)] + + x = X(b"abc") + self.assertRaises(TypeError, X, "abc") + self.assertEqual(x.a, b"abc") + self.assertEqual(type(x.a), bytes) + + def test_struct_W(self): + class X(Structure): + _fields_ = [("a", c_wchar * 3)] + + x = X("abc") + self.assertRaises(TypeError, X, b"abc") + self.assertEqual(x.a, "abc") + self.assertEqual(type(x.a), str) + + @unittest.skipUnless(sys.platform == "win32", 'Windows-specific test') + def test_BSTR(self): + from _ctypes import _SimpleCData + class BSTR(_SimpleCData): + _type_ = "X" + + BSTR("abc") + + +if __name__ == '__main__': + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_byteswap.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_byteswap.py new file mode 100644 index 0000000000000000000000000000000000000000..44d32ff27ba9236b4b3b8a96e012b396c2c628ae --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_byteswap.py @@ -0,0 +1,375 @@ +import sys, unittest, struct, math, ctypes +from binascii import hexlify + +from ctypes import * + +def bin(s): + return hexlify(memoryview(s)).decode().upper() + +# Each *simple* type that supports different byte orders has an +# __ctype_be__ attribute that specifies the same type in BIG ENDIAN +# byte order, and a __ctype_le__ attribute that is the same type in +# LITTLE ENDIAN byte order. +# +# For Structures and Unions, these types are created on demand. + +class Test(unittest.TestCase): + def test_slots(self): + class BigPoint(BigEndianStructure): + __slots__ = () + _fields_ = [("x", c_int), ("y", c_int)] + + class LowPoint(LittleEndianStructure): + __slots__ = () + _fields_ = [("x", c_int), ("y", c_int)] + + big = BigPoint() + little = LowPoint() + big.x = 4 + big.y = 2 + little.x = 2 + little.y = 4 + with self.assertRaises(AttributeError): + big.z = 42 + with self.assertRaises(AttributeError): + little.z = 24 + + def test_endian_short(self): + if sys.byteorder == "little": + self.assertIs(c_short.__ctype_le__, c_short) + self.assertIs(c_short.__ctype_be__.__ctype_le__, c_short) + else: + self.assertIs(c_short.__ctype_be__, c_short) + self.assertIs(c_short.__ctype_le__.__ctype_be__, c_short) + s = c_short.__ctype_be__(0x1234) + self.assertEqual(bin(struct.pack(">h", 0x1234)), "1234") + self.assertEqual(bin(s), "1234") + self.assertEqual(s.value, 0x1234) + + s = c_short.__ctype_le__(0x1234) + self.assertEqual(bin(struct.pack("h", 0x1234)), "1234") + self.assertEqual(bin(s), "1234") + self.assertEqual(s.value, 0x1234) + + s = c_ushort.__ctype_le__(0x1234) + self.assertEqual(bin(struct.pack("i", 0x12345678)), "12345678") + self.assertEqual(bin(s), "12345678") + self.assertEqual(s.value, 0x12345678) + + s = c_int.__ctype_le__(0x12345678) + self.assertEqual(bin(struct.pack("I", 0x12345678)), "12345678") + self.assertEqual(bin(s), "12345678") + self.assertEqual(s.value, 0x12345678) + + s = c_uint.__ctype_le__(0x12345678) + self.assertEqual(bin(struct.pack("q", 0x1234567890ABCDEF)), "1234567890ABCDEF") + self.assertEqual(bin(s), "1234567890ABCDEF") + self.assertEqual(s.value, 0x1234567890ABCDEF) + + s = c_longlong.__ctype_le__(0x1234567890ABCDEF) + self.assertEqual(bin(struct.pack("Q", 0x1234567890ABCDEF)), "1234567890ABCDEF") + self.assertEqual(bin(s), "1234567890ABCDEF") + self.assertEqual(s.value, 0x1234567890ABCDEF) + + s = c_ulonglong.__ctype_le__(0x1234567890ABCDEF) + self.assertEqual(bin(struct.pack("f", math.pi)), bin(s)) + + def test_endian_double(self): + if sys.byteorder == "little": + self.assertIs(c_double.__ctype_le__, c_double) + self.assertIs(c_double.__ctype_be__.__ctype_le__, c_double) + else: + self.assertIs(c_double.__ctype_be__, c_double) + self.assertIs(c_double.__ctype_le__.__ctype_be__, c_double) + s = c_double(math.pi) + self.assertEqual(s.value, math.pi) + self.assertEqual(bin(struct.pack("d", math.pi)), bin(s)) + s = c_double.__ctype_le__(math.pi) + self.assertEqual(s.value, math.pi) + self.assertEqual(bin(struct.pack("d", math.pi)), bin(s)) + + def test_endian_other(self): + self.assertIs(c_byte.__ctype_le__, c_byte) + self.assertIs(c_byte.__ctype_be__, c_byte) + + self.assertIs(c_ubyte.__ctype_le__, c_ubyte) + self.assertIs(c_ubyte.__ctype_be__, c_ubyte) + + self.assertIs(c_char.__ctype_le__, c_char) + self.assertIs(c_char.__ctype_be__, c_char) + + def test_struct_fields_unsupported_byte_order(self): + + fields = [ + ("a", c_ubyte), + ("b", c_byte), + ("c", c_short), + ("d", c_ushort), + ("e", c_int), + ("f", c_uint), + ("g", c_long), + ("h", c_ulong), + ("i", c_longlong), + ("k", c_ulonglong), + ("l", c_float), + ("m", c_double), + ("n", c_char), + ("b1", c_byte, 3), + ("b2", c_byte, 3), + ("b3", c_byte, 2), + ("a", c_int * 3 * 3 * 3) + ] + + # these fields do not support different byte order: + for typ in c_wchar, c_void_p, POINTER(c_int): + with self.assertRaises(TypeError): + class T(BigEndianStructure if sys.byteorder == "little" else LittleEndianStructure): + _fields_ = fields + [("x", typ)] + + + def test_struct_struct(self): + # nested structures with different byteorders + + # create nested structures with given byteorders and set memory to data + + for nested, data in ( + (BigEndianStructure, b'\0\0\0\1\0\0\0\2'), + (LittleEndianStructure, b'\1\0\0\0\2\0\0\0'), + ): + for parent in ( + BigEndianStructure, + LittleEndianStructure, + Structure, + ): + class NestedStructure(nested): + _fields_ = [("x", c_uint32), + ("y", c_uint32)] + + class TestStructure(parent): + _fields_ = [("point", NestedStructure)] + + self.assertEqual(len(data), sizeof(TestStructure)) + ptr = POINTER(TestStructure) + s = cast(data, ptr)[0] + del ctypes._pointer_type_cache[TestStructure] + self.assertEqual(s.point.x, 1) + self.assertEqual(s.point.y, 2) + + def test_struct_field_alignment(self): + # standard packing in struct uses no alignment. + # So, we have to align using pad bytes. + # + # Unaligned accesses will crash Python (on those platforms that + # don't allow it, like sparc solaris). + if sys.byteorder == "little": + base = BigEndianStructure + fmt = ">bxhid" + else: + base = LittleEndianStructure + fmt = " float -> double + import math + self.check_type(c_float, math.e) + self.check_type(c_float, -math.e) + + def test_double(self): + self.check_type(c_double, 3.14) + self.check_type(c_double, -3.14) + + @need_symbol('c_longdouble') + def test_longdouble(self): + self.check_type(c_longdouble, 3.14) + self.check_type(c_longdouble, -3.14) + + def test_char(self): + self.check_type(c_char, b"x") + self.check_type(c_char, b"a") + + def test_pyobject(self): + o = () + from sys import getrefcount as grc + for o in (), [], object(): + initial = grc(o) + # This call leaks a reference to 'o'... + self.check_type(py_object, o) + before = grc(o) + # ...but this call doesn't leak any more. Where is the refcount? + self.check_type(py_object, o) + after = grc(o) + self.assertEqual((after, o), (before, o)) + + def test_unsupported_restype_1(self): + # Only "fundamental" result types are supported for callback + # functions, the type must have a non-NULL stgdict->setfunc. + # POINTER(c_double), for example, is not supported. + + prototype = self.functype.__func__(POINTER(c_double)) + # The type is checked when the prototype is called + self.assertRaises(TypeError, prototype, lambda: None) + + def test_unsupported_restype_2(self): + prototype = self.functype.__func__(object) + self.assertRaises(TypeError, prototype, lambda: None) + + def test_issue_7959(self): + proto = self.functype.__func__(None) + + class X: + def func(self): pass + def __init__(self): + self.v = proto(self.func) + + import gc + for i in range(32): + X() + gc.collect() + live = [x for x in gc.get_objects() + if isinstance(x, X)] + self.assertEqual(len(live), 0) + + def test_issue12483(self): + import gc + class Nasty: + def __del__(self): + gc.collect() + CFUNCTYPE(None)(lambda x=Nasty(): None) + + +@need_symbol('WINFUNCTYPE') +class StdcallCallbacks(Callbacks): + try: + functype = WINFUNCTYPE + except NameError: + pass + +################################################################ + +class SampleCallbacksTestCase(unittest.TestCase): + + def test_integrate(self): + # Derived from some then non-working code, posted by David Foster + dll = CDLL(_ctypes_test.__file__) + + # The function prototype called by 'integrate': double func(double); + CALLBACK = CFUNCTYPE(c_double, c_double) + + # The integrate function itself, exposed from the _ctypes_test dll + integrate = dll.integrate + integrate.argtypes = (c_double, c_double, CALLBACK, c_long) + integrate.restype = c_double + + def func(x): + return x**2 + + result = integrate(0.0, 1.0, CALLBACK(func), 10) + diff = abs(result - 1./3.) + + self.assertLess(diff, 0.01, "%s not less than 0.01" % diff) + + def test_issue_8959_a(self): + from ctypes.util import find_library + libc_path = find_library("c") + if not libc_path: + self.skipTest('could not find libc') + libc = CDLL(libc_path) + + @CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int)) + def cmp_func(a, b): + return a[0] - b[0] + + array = (c_int * 5)(5, 1, 99, 7, 33) + + libc.qsort(array, len(array), sizeof(c_int), cmp_func) + self.assertEqual(array[:], [1, 5, 7, 33, 99]) + + @need_symbol('WINFUNCTYPE') + def test_issue_8959_b(self): + from ctypes.wintypes import BOOL, HWND, LPARAM + global windowCount + windowCount = 0 + + @WINFUNCTYPE(BOOL, HWND, LPARAM) + def EnumWindowsCallbackFunc(hwnd, lParam): + global windowCount + windowCount += 1 + return True #Allow windows to keep enumerating + + windll.user32.EnumWindows(EnumWindowsCallbackFunc, 0) + + def test_callback_register_int(self): + # Issue #8275: buggy handling of callback args under Win64 + # NOTE: should be run on release builds as well + dll = CDLL(_ctypes_test.__file__) + CALLBACK = CFUNCTYPE(c_int, c_int, c_int, c_int, c_int, c_int) + # All this function does is call the callback with its args squared + func = dll._testfunc_cbk_reg_int + func.argtypes = (c_int, c_int, c_int, c_int, c_int, CALLBACK) + func.restype = c_int + + def callback(a, b, c, d, e): + return a + b + c + d + e + + result = func(2, 3, 4, 5, 6, CALLBACK(callback)) + self.assertEqual(result, callback(2*2, 3*3, 4*4, 5*5, 6*6)) + + def test_callback_register_double(self): + # Issue #8275: buggy handling of callback args under Win64 + # NOTE: should be run on release builds as well + dll = CDLL(_ctypes_test.__file__) + CALLBACK = CFUNCTYPE(c_double, c_double, c_double, c_double, + c_double, c_double) + # All this function does is call the callback with its args squared + func = dll._testfunc_cbk_reg_double + func.argtypes = (c_double, c_double, c_double, + c_double, c_double, CALLBACK) + func.restype = c_double + + def callback(a, b, c, d, e): + return a + b + c + d + e + + result = func(1.1, 2.2, 3.3, 4.4, 5.5, CALLBACK(callback)) + self.assertEqual(result, + callback(1.1*1.1, 2.2*2.2, 3.3*3.3, 4.4*4.4, 5.5*5.5)) + + def test_callback_large_struct(self): + class Check: pass + + # This should mirror the structure in Modules/_ctypes/_ctypes_test.c + class X(Structure): + _fields_ = [ + ('first', c_ulong), + ('second', c_ulong), + ('third', c_ulong), + ] + + def callback(check, s): + check.first = s.first + check.second = s.second + check.third = s.third + # See issue #29565. + # The structure should be passed by value, so + # any changes to it should not be reflected in + # the value passed + s.first = s.second = s.third = 0x0badf00d + + check = Check() + s = X() + s.first = 0xdeadbeef + s.second = 0xcafebabe + s.third = 0x0bad1dea + + CALLBACK = CFUNCTYPE(None, X) + dll = CDLL(_ctypes_test.__file__) + func = dll._testfunc_cbk_large_struct + func.argtypes = (X, CALLBACK) + func.restype = None + # the function just calls the callback with the passed structure + func(s, CALLBACK(functools.partial(callback, check))) + self.assertEqual(check.first, s.first) + self.assertEqual(check.second, s.second) + self.assertEqual(check.third, s.third) + self.assertEqual(check.first, 0xdeadbeef) + self.assertEqual(check.second, 0xcafebabe) + self.assertEqual(check.third, 0x0bad1dea) + # See issue #29565. + # Ensure that the original struct is unchanged. + self.assertEqual(s.first, check.first) + self.assertEqual(s.second, check.second) + self.assertEqual(s.third, check.third) + + def test_callback_too_many_args(self): + def func(*args): + return len(args) + + # valid call with nargs <= CTYPES_MAX_ARGCOUNT + proto = CFUNCTYPE(c_int, *(c_int,) * CTYPES_MAX_ARGCOUNT) + cb = proto(func) + args1 = (1,) * CTYPES_MAX_ARGCOUNT + self.assertEqual(cb(*args1), CTYPES_MAX_ARGCOUNT) + + # invalid call with nargs > CTYPES_MAX_ARGCOUNT + args2 = (1,) * (CTYPES_MAX_ARGCOUNT + 1) + with self.assertRaises(ArgumentError): + cb(*args2) + + # error when creating the type with too many arguments + with self.assertRaises(ArgumentError): + CFUNCTYPE(c_int, *(c_int,) * (CTYPES_MAX_ARGCOUNT + 1)) + + def test_convert_result_error(self): + def func(): + return ("tuple",) + + proto = CFUNCTYPE(c_int) + ctypes_func = proto(func) + with support.catch_unraisable_exception() as cm: + # don't test the result since it is an uninitialized value + result = ctypes_func() + + self.assertIsInstance(cm.unraisable.exc_value, TypeError) + self.assertEqual(cm.unraisable.err_msg, + "Exception ignored on converting result " + "of ctypes callback function") + self.assertIs(cm.unraisable.object, func) + + +if __name__ == '__main__': + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_cast.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_cast.py new file mode 100644 index 0000000000000000000000000000000000000000..6878f9732826f116f8d6048c78222f54e6749f88 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_cast.py @@ -0,0 +1,99 @@ +from ctypes import * +from ctypes.test import need_symbol +import unittest +import sys + +class Test(unittest.TestCase): + + def test_array2pointer(self): + array = (c_int * 3)(42, 17, 2) + + # casting an array to a pointer works. + ptr = cast(array, POINTER(c_int)) + self.assertEqual([ptr[i] for i in range(3)], [42, 17, 2]) + + if 2*sizeof(c_short) == sizeof(c_int): + ptr = cast(array, POINTER(c_short)) + if sys.byteorder == "little": + self.assertEqual([ptr[i] for i in range(6)], + [42, 0, 17, 0, 2, 0]) + else: + self.assertEqual([ptr[i] for i in range(6)], + [0, 42, 0, 17, 0, 2]) + + def test_address2pointer(self): + array = (c_int * 3)(42, 17, 2) + + address = addressof(array) + ptr = cast(c_void_p(address), POINTER(c_int)) + self.assertEqual([ptr[i] for i in range(3)], [42, 17, 2]) + + ptr = cast(address, POINTER(c_int)) + self.assertEqual([ptr[i] for i in range(3)], [42, 17, 2]) + + def test_p2a_objects(self): + array = (c_char_p * 5)() + self.assertEqual(array._objects, None) + array[0] = b"foo bar" + self.assertEqual(array._objects, {'0': b"foo bar"}) + + p = cast(array, POINTER(c_char_p)) + # array and p share a common _objects attribute + self.assertIs(p._objects, array._objects) + self.assertEqual(array._objects, {'0': b"foo bar", id(array): array}) + p[0] = b"spam spam" + self.assertEqual(p._objects, {'0': b"spam spam", id(array): array}) + self.assertIs(array._objects, p._objects) + p[1] = b"foo bar" + self.assertEqual(p._objects, {'1': b'foo bar', '0': b"spam spam", id(array): array}) + self.assertIs(array._objects, p._objects) + + def test_other(self): + p = cast((c_int * 4)(1, 2, 3, 4), POINTER(c_int)) + self.assertEqual(p[:4], [1,2, 3, 4]) + self.assertEqual(p[:4:], [1, 2, 3, 4]) + self.assertEqual(p[3:-1:-1], [4, 3, 2, 1]) + self.assertEqual(p[:4:3], [1, 4]) + c_int() + self.assertEqual(p[:4], [1, 2, 3, 4]) + self.assertEqual(p[:4:], [1, 2, 3, 4]) + self.assertEqual(p[3:-1:-1], [4, 3, 2, 1]) + self.assertEqual(p[:4:3], [1, 4]) + p[2] = 96 + self.assertEqual(p[:4], [1, 2, 96, 4]) + self.assertEqual(p[:4:], [1, 2, 96, 4]) + self.assertEqual(p[3:-1:-1], [4, 96, 2, 1]) + self.assertEqual(p[:4:3], [1, 4]) + c_int() + self.assertEqual(p[:4], [1, 2, 96, 4]) + self.assertEqual(p[:4:], [1, 2, 96, 4]) + self.assertEqual(p[3:-1:-1], [4, 96, 2, 1]) + self.assertEqual(p[:4:3], [1, 4]) + + def test_char_p(self): + # This didn't work: bad argument to internal function + s = c_char_p(b"hiho") + self.assertEqual(cast(cast(s, c_void_p), c_char_p).value, + b"hiho") + + @need_symbol('c_wchar_p') + def test_wchar_p(self): + s = c_wchar_p("hiho") + self.assertEqual(cast(cast(s, c_void_p), c_wchar_p).value, + "hiho") + + def test_bad_type_arg(self): + # The type argument must be a ctypes pointer type. + array_type = c_byte * sizeof(c_int) + array = array_type() + self.assertRaises(TypeError, cast, array, None) + self.assertRaises(TypeError, cast, array, array_type) + class Struct(Structure): + _fields_ = [("a", c_int)] + self.assertRaises(TypeError, cast, array, Struct) + class MyUnion(Union): + _fields_ = [("a", c_int)] + self.assertRaises(TypeError, cast, array, MyUnion) + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_cfuncs.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_cfuncs.py new file mode 100644 index 0000000000000000000000000000000000000000..09b06840bf57627a9c849e7c08938c3b72c3802a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_cfuncs.py @@ -0,0 +1,218 @@ +# A lot of failures in these tests on Mac OS X. +# Byte order related? + +import unittest +from ctypes import * +from ctypes.test import need_symbol + +import _ctypes_test + +class CFunctions(unittest.TestCase): + _dll = CDLL(_ctypes_test.__file__) + + def S(self): + return c_longlong.in_dll(self._dll, "last_tf_arg_s").value + def U(self): + return c_ulonglong.in_dll(self._dll, "last_tf_arg_u").value + + def test_byte(self): + self._dll.tf_b.restype = c_byte + self._dll.tf_b.argtypes = (c_byte,) + self.assertEqual(self._dll.tf_b(-126), -42) + self.assertEqual(self.S(), -126) + + def test_byte_plus(self): + self._dll.tf_bb.restype = c_byte + self._dll.tf_bb.argtypes = (c_byte, c_byte) + self.assertEqual(self._dll.tf_bb(0, -126), -42) + self.assertEqual(self.S(), -126) + + def test_ubyte(self): + self._dll.tf_B.restype = c_ubyte + self._dll.tf_B.argtypes = (c_ubyte,) + self.assertEqual(self._dll.tf_B(255), 85) + self.assertEqual(self.U(), 255) + + def test_ubyte_plus(self): + self._dll.tf_bB.restype = c_ubyte + self._dll.tf_bB.argtypes = (c_byte, c_ubyte) + self.assertEqual(self._dll.tf_bB(0, 255), 85) + self.assertEqual(self.U(), 255) + + def test_short(self): + self._dll.tf_h.restype = c_short + self._dll.tf_h.argtypes = (c_short,) + self.assertEqual(self._dll.tf_h(-32766), -10922) + self.assertEqual(self.S(), -32766) + + def test_short_plus(self): + self._dll.tf_bh.restype = c_short + self._dll.tf_bh.argtypes = (c_byte, c_short) + self.assertEqual(self._dll.tf_bh(0, -32766), -10922) + self.assertEqual(self.S(), -32766) + + def test_ushort(self): + self._dll.tf_H.restype = c_ushort + self._dll.tf_H.argtypes = (c_ushort,) + self.assertEqual(self._dll.tf_H(65535), 21845) + self.assertEqual(self.U(), 65535) + + def test_ushort_plus(self): + self._dll.tf_bH.restype = c_ushort + self._dll.tf_bH.argtypes = (c_byte, c_ushort) + self.assertEqual(self._dll.tf_bH(0, 65535), 21845) + self.assertEqual(self.U(), 65535) + + def test_int(self): + self._dll.tf_i.restype = c_int + self._dll.tf_i.argtypes = (c_int,) + self.assertEqual(self._dll.tf_i(-2147483646), -715827882) + self.assertEqual(self.S(), -2147483646) + + def test_int_plus(self): + self._dll.tf_bi.restype = c_int + self._dll.tf_bi.argtypes = (c_byte, c_int) + self.assertEqual(self._dll.tf_bi(0, -2147483646), -715827882) + self.assertEqual(self.S(), -2147483646) + + def test_uint(self): + self._dll.tf_I.restype = c_uint + self._dll.tf_I.argtypes = (c_uint,) + self.assertEqual(self._dll.tf_I(4294967295), 1431655765) + self.assertEqual(self.U(), 4294967295) + + def test_uint_plus(self): + self._dll.tf_bI.restype = c_uint + self._dll.tf_bI.argtypes = (c_byte, c_uint) + self.assertEqual(self._dll.tf_bI(0, 4294967295), 1431655765) + self.assertEqual(self.U(), 4294967295) + + def test_long(self): + self._dll.tf_l.restype = c_long + self._dll.tf_l.argtypes = (c_long,) + self.assertEqual(self._dll.tf_l(-2147483646), -715827882) + self.assertEqual(self.S(), -2147483646) + + def test_long_plus(self): + self._dll.tf_bl.restype = c_long + self._dll.tf_bl.argtypes = (c_byte, c_long) + self.assertEqual(self._dll.tf_bl(0, -2147483646), -715827882) + self.assertEqual(self.S(), -2147483646) + + def test_ulong(self): + self._dll.tf_L.restype = c_ulong + self._dll.tf_L.argtypes = (c_ulong,) + self.assertEqual(self._dll.tf_L(4294967295), 1431655765) + self.assertEqual(self.U(), 4294967295) + + def test_ulong_plus(self): + self._dll.tf_bL.restype = c_ulong + self._dll.tf_bL.argtypes = (c_char, c_ulong) + self.assertEqual(self._dll.tf_bL(b' ', 4294967295), 1431655765) + self.assertEqual(self.U(), 4294967295) + + @need_symbol('c_longlong') + def test_longlong(self): + self._dll.tf_q.restype = c_longlong + self._dll.tf_q.argtypes = (c_longlong, ) + self.assertEqual(self._dll.tf_q(-9223372036854775806), -3074457345618258602) + self.assertEqual(self.S(), -9223372036854775806) + + @need_symbol('c_longlong') + def test_longlong_plus(self): + self._dll.tf_bq.restype = c_longlong + self._dll.tf_bq.argtypes = (c_byte, c_longlong) + self.assertEqual(self._dll.tf_bq(0, -9223372036854775806), -3074457345618258602) + self.assertEqual(self.S(), -9223372036854775806) + + @need_symbol('c_ulonglong') + def test_ulonglong(self): + self._dll.tf_Q.restype = c_ulonglong + self._dll.tf_Q.argtypes = (c_ulonglong, ) + self.assertEqual(self._dll.tf_Q(18446744073709551615), 6148914691236517205) + self.assertEqual(self.U(), 18446744073709551615) + + @need_symbol('c_ulonglong') + def test_ulonglong_plus(self): + self._dll.tf_bQ.restype = c_ulonglong + self._dll.tf_bQ.argtypes = (c_byte, c_ulonglong) + self.assertEqual(self._dll.tf_bQ(0, 18446744073709551615), 6148914691236517205) + self.assertEqual(self.U(), 18446744073709551615) + + def test_float(self): + self._dll.tf_f.restype = c_float + self._dll.tf_f.argtypes = (c_float,) + self.assertEqual(self._dll.tf_f(-42.), -14.) + self.assertEqual(self.S(), -42) + + def test_float_plus(self): + self._dll.tf_bf.restype = c_float + self._dll.tf_bf.argtypes = (c_byte, c_float) + self.assertEqual(self._dll.tf_bf(0, -42.), -14.) + self.assertEqual(self.S(), -42) + + def test_double(self): + self._dll.tf_d.restype = c_double + self._dll.tf_d.argtypes = (c_double,) + self.assertEqual(self._dll.tf_d(42.), 14.) + self.assertEqual(self.S(), 42) + + def test_double_plus(self): + self._dll.tf_bd.restype = c_double + self._dll.tf_bd.argtypes = (c_byte, c_double) + self.assertEqual(self._dll.tf_bd(0, 42.), 14.) + self.assertEqual(self.S(), 42) + + @need_symbol('c_longdouble') + def test_longdouble(self): + self._dll.tf_D.restype = c_longdouble + self._dll.tf_D.argtypes = (c_longdouble,) + self.assertEqual(self._dll.tf_D(42.), 14.) + self.assertEqual(self.S(), 42) + + @need_symbol('c_longdouble') + def test_longdouble_plus(self): + self._dll.tf_bD.restype = c_longdouble + self._dll.tf_bD.argtypes = (c_byte, c_longdouble) + self.assertEqual(self._dll.tf_bD(0, 42.), 14.) + self.assertEqual(self.S(), 42) + + def test_callwithresult(self): + def process_result(result): + return result * 2 + self._dll.tf_i.restype = process_result + self._dll.tf_i.argtypes = (c_int,) + self.assertEqual(self._dll.tf_i(42), 28) + self.assertEqual(self.S(), 42) + self.assertEqual(self._dll.tf_i(-42), -28) + self.assertEqual(self.S(), -42) + + def test_void(self): + self._dll.tv_i.restype = None + self._dll.tv_i.argtypes = (c_int,) + self.assertEqual(self._dll.tv_i(42), None) + self.assertEqual(self.S(), 42) + self.assertEqual(self._dll.tv_i(-42), None) + self.assertEqual(self.S(), -42) + +# The following repeats the above tests with stdcall functions (where +# they are available) +try: + WinDLL +except NameError: + def stdcall_dll(*_): pass +else: + class stdcall_dll(WinDLL): + def __getattr__(self, name): + if name[:2] == '__' and name[-2:] == '__': + raise AttributeError(name) + func = self._FuncPtr(("s_" + name, self)) + setattr(self, name, func) + return func + +@need_symbol('WinDLL') +class stdcallCFunctions(CFunctions): + _dll = stdcall_dll(_ctypes_test.__file__) + +if __name__ == '__main__': + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_checkretval.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_checkretval.py new file mode 100644 index 0000000000000000000000000000000000000000..e9567dc3912585a3b2c92308ca61967eed3c6711 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_checkretval.py @@ -0,0 +1,36 @@ +import unittest + +from ctypes import * +from ctypes.test import need_symbol + +class CHECKED(c_int): + def _check_retval_(value): + # Receives a CHECKED instance. + return str(value.value) + _check_retval_ = staticmethod(_check_retval_) + +class Test(unittest.TestCase): + + def test_checkretval(self): + + import _ctypes_test + dll = CDLL(_ctypes_test.__file__) + self.assertEqual(42, dll._testfunc_p_p(42)) + + dll._testfunc_p_p.restype = CHECKED + self.assertEqual("42", dll._testfunc_p_p(42)) + + dll._testfunc_p_p.restype = None + self.assertEqual(None, dll._testfunc_p_p(42)) + + del dll._testfunc_p_p.restype + self.assertEqual(42, dll._testfunc_p_p(42)) + + @need_symbol('oledll') + def test_oledll(self): + self.assertRaises(OSError, + oledll.oleaut32.CreateTypeLib2, + 0, None, None) + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_delattr.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_delattr.py new file mode 100644 index 0000000000000000000000000000000000000000..0f4d58691b55e7dfef3303e2bf15b782363f5ff1 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_delattr.py @@ -0,0 +1,21 @@ +import unittest +from ctypes import * + +class X(Structure): + _fields_ = [("foo", c_int)] + +class TestCase(unittest.TestCase): + def test_simple(self): + self.assertRaises(TypeError, + delattr, c_int(42), "value") + + def test_chararray(self): + self.assertRaises(TypeError, + delattr, (c_char * 5)(), "value") + + def test_struct(self): + self.assertRaises(TypeError, + delattr, X(), "foo") + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_errno.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_errno.py new file mode 100644 index 0000000000000000000000000000000000000000..3685164dde62143a4dea31eef31aac88554c3e07 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_errno.py @@ -0,0 +1,76 @@ +import unittest, os, errno +import threading + +from ctypes import * +from ctypes.util import find_library + +class Test(unittest.TestCase): + def test_open(self): + libc_name = find_library("c") + if libc_name is None: + raise unittest.SkipTest("Unable to find C library") + libc = CDLL(libc_name, use_errno=True) + if os.name == "nt": + libc_open = libc._open + else: + libc_open = libc.open + + libc_open.argtypes = c_char_p, c_int + + self.assertEqual(libc_open(b"", 0), -1) + self.assertEqual(get_errno(), errno.ENOENT) + + self.assertEqual(set_errno(32), errno.ENOENT) + self.assertEqual(get_errno(), 32) + + def _worker(): + set_errno(0) + + libc = CDLL(libc_name, use_errno=False) + if os.name == "nt": + libc_open = libc._open + else: + libc_open = libc.open + libc_open.argtypes = c_char_p, c_int + self.assertEqual(libc_open(b"", 0), -1) + self.assertEqual(get_errno(), 0) + + t = threading.Thread(target=_worker) + t.start() + t.join() + + self.assertEqual(get_errno(), 32) + set_errno(0) + + @unittest.skipUnless(os.name == "nt", 'Test specific to Windows') + def test_GetLastError(self): + dll = WinDLL("kernel32", use_last_error=True) + GetModuleHandle = dll.GetModuleHandleA + GetModuleHandle.argtypes = [c_wchar_p] + + self.assertEqual(0, GetModuleHandle("foo")) + self.assertEqual(get_last_error(), 126) + + self.assertEqual(set_last_error(32), 126) + self.assertEqual(get_last_error(), 32) + + def _worker(): + set_last_error(0) + + dll = WinDLL("kernel32", use_last_error=False) + GetModuleHandle = dll.GetModuleHandleW + GetModuleHandle.argtypes = [c_wchar_p] + GetModuleHandle("bar") + + self.assertEqual(get_last_error(), 0) + + t = threading.Thread(target=_worker) + t.start() + t.join() + + self.assertEqual(get_last_error(), 32) + + set_last_error(0) + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_find.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_find.py new file mode 100644 index 0000000000000000000000000000000000000000..a41e94971dfbab0240ab50bdef4624408675ee2f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_find.py @@ -0,0 +1,130 @@ +import unittest +import unittest.mock +import os.path +import sys +import test.support +from test.support import os_helper +from ctypes import * +from ctypes.util import find_library + +# On some systems, loading the OpenGL libraries needs the RTLD_GLOBAL mode. +class Test_OpenGL_libs(unittest.TestCase): + @classmethod + def setUpClass(cls): + lib_gl = lib_glu = lib_gle = None + if sys.platform == "win32": + lib_gl = find_library("OpenGL32") + lib_glu = find_library("Glu32") + elif sys.platform == "darwin": + lib_gl = lib_glu = find_library("OpenGL") + else: + lib_gl = find_library("GL") + lib_glu = find_library("GLU") + lib_gle = find_library("gle") + + ## print, for debugging + if test.support.verbose: + print("OpenGL libraries:") + for item in (("GL", lib_gl), + ("GLU", lib_glu), + ("gle", lib_gle)): + print("\t", item) + + cls.gl = cls.glu = cls.gle = None + if lib_gl: + try: + cls.gl = CDLL(lib_gl, mode=RTLD_GLOBAL) + except OSError: + pass + if lib_glu: + try: + cls.glu = CDLL(lib_glu, RTLD_GLOBAL) + except OSError: + pass + if lib_gle: + try: + cls.gle = CDLL(lib_gle) + except OSError: + pass + + @classmethod + def tearDownClass(cls): + cls.gl = cls.glu = cls.gle = None + + def test_gl(self): + if self.gl is None: + self.skipTest('lib_gl not available') + self.gl.glClearIndex + + def test_glu(self): + if self.glu is None: + self.skipTest('lib_glu not available') + self.glu.gluBeginCurve + + def test_gle(self): + if self.gle is None: + self.skipTest('lib_gle not available') + self.gle.gleGetJoinStyle + + def test_shell_injection(self): + result = find_library('; echo Hello shell > ' + os_helper.TESTFN) + self.assertFalse(os.path.lexists(os_helper.TESTFN)) + self.assertIsNone(result) + + +@unittest.skipUnless(sys.platform.startswith('linux'), + 'Test only valid for Linux') +class FindLibraryLinux(unittest.TestCase): + def test_find_on_libpath(self): + import subprocess + import tempfile + + try: + p = subprocess.Popen(['gcc', '--version'], stdout=subprocess.PIPE, + stderr=subprocess.DEVNULL) + out, _ = p.communicate() + except OSError: + raise unittest.SkipTest('gcc, needed for test, not available') + with tempfile.TemporaryDirectory() as d: + # create an empty temporary file + srcname = os.path.join(d, 'dummy.c') + libname = 'py_ctypes_test_dummy' + dstname = os.path.join(d, 'lib%s.so' % libname) + with open(srcname, 'wb') as f: + pass + self.assertTrue(os.path.exists(srcname)) + # compile the file to a shared library + cmd = ['gcc', '-o', dstname, '--shared', + '-Wl,-soname,lib%s.so' % libname, srcname] + out = subprocess.check_output(cmd) + self.assertTrue(os.path.exists(dstname)) + # now check that the .so can't be found (since not in + # LD_LIBRARY_PATH) + self.assertIsNone(find_library(libname)) + # now add the location to LD_LIBRARY_PATH + with os_helper.EnvironmentVarGuard() as env: + KEY = 'LD_LIBRARY_PATH' + if KEY not in env: + v = d + else: + v = '%s:%s' % (env[KEY], d) + env.set(KEY, v) + # now check that the .so can be found (since in + # LD_LIBRARY_PATH) + self.assertEqual(find_library(libname), 'lib%s.so' % libname) + + def test_find_library_with_gcc(self): + with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None): + self.assertNotEqual(find_library('c'), None) + + def test_find_library_with_ld(self): + with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None), \ + unittest.mock.patch("ctypes.util._findLib_gcc", lambda *args: None): + self.assertNotEqual(find_library('c'), None) + + def test_gh114257(self): + self.assertIsNone(find_library("libc")) + + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_frombuffer.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_frombuffer.py new file mode 100644 index 0000000000000000000000000000000000000000..55c244356b30d0e2913c31e8f0159ab810a32191 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_frombuffer.py @@ -0,0 +1,141 @@ +from ctypes import * +import array +import gc +import unittest + +class X(Structure): + _fields_ = [("c_int", c_int)] + init_called = False + def __init__(self): + self._init_called = True + +class Test(unittest.TestCase): + def test_from_buffer(self): + a = array.array("i", range(16)) + x = (c_int * 16).from_buffer(a) + + y = X.from_buffer(a) + self.assertEqual(y.c_int, a[0]) + self.assertFalse(y.init_called) + + self.assertEqual(x[:], a.tolist()) + + a[0], a[-1] = 200, -200 + self.assertEqual(x[:], a.tolist()) + + self.assertRaises(BufferError, a.append, 100) + self.assertRaises(BufferError, a.pop) + + del x; del y; gc.collect(); gc.collect(); gc.collect() + a.append(100) + a.pop() + x = (c_int * 16).from_buffer(a) + + self.assertIn(a, [obj.obj if isinstance(obj, memoryview) else obj + for obj in x._objects.values()]) + + expected = x[:] + del a; gc.collect(); gc.collect(); gc.collect() + self.assertEqual(x[:], expected) + + with self.assertRaisesRegex(TypeError, "not writable"): + (c_char * 16).from_buffer(b"a" * 16) + with self.assertRaisesRegex(TypeError, "not writable"): + (c_char * 16).from_buffer(memoryview(b"a" * 16)) + with self.assertRaisesRegex(TypeError, "not C contiguous"): + (c_char * 16).from_buffer(memoryview(bytearray(b"a" * 16))[::-1]) + msg = "bytes-like object is required" + with self.assertRaisesRegex(TypeError, msg): + (c_char * 16).from_buffer("a" * 16) + + def test_fortran_contiguous(self): + try: + import _testbuffer + except ImportError as err: + self.skipTest(str(err)) + flags = _testbuffer.ND_WRITABLE | _testbuffer.ND_FORTRAN + array = _testbuffer.ndarray( + [97] * 16, format="B", shape=[4, 4], flags=flags) + with self.assertRaisesRegex(TypeError, "not C contiguous"): + (c_char * 16).from_buffer(array) + array = memoryview(array) + self.assertTrue(array.f_contiguous) + self.assertFalse(array.c_contiguous) + with self.assertRaisesRegex(TypeError, "not C contiguous"): + (c_char * 16).from_buffer(array) + + def test_from_buffer_with_offset(self): + a = array.array("i", range(16)) + x = (c_int * 15).from_buffer(a, sizeof(c_int)) + + self.assertEqual(x[:], a.tolist()[1:]) + with self.assertRaises(ValueError): + c_int.from_buffer(a, -1) + with self.assertRaises(ValueError): + (c_int * 16).from_buffer(a, sizeof(c_int)) + with self.assertRaises(ValueError): + (c_int * 1).from_buffer(a, 16 * sizeof(c_int)) + + def test_from_buffer_memoryview(self): + a = [c_char.from_buffer(memoryview(bytearray(b'a')))] + a.append(a) + del a + gc.collect() # Should not crash + + def test_from_buffer_copy(self): + a = array.array("i", range(16)) + x = (c_int * 16).from_buffer_copy(a) + + y = X.from_buffer_copy(a) + self.assertEqual(y.c_int, a[0]) + self.assertFalse(y.init_called) + + self.assertEqual(x[:], list(range(16))) + + a[0], a[-1] = 200, -200 + self.assertEqual(x[:], list(range(16))) + + a.append(100) + self.assertEqual(x[:], list(range(16))) + + self.assertEqual(x._objects, None) + + del a; gc.collect(); gc.collect(); gc.collect() + self.assertEqual(x[:], list(range(16))) + + x = (c_char * 16).from_buffer_copy(b"a" * 16) + self.assertEqual(x[:], b"a" * 16) + with self.assertRaises(TypeError): + (c_char * 16).from_buffer_copy("a" * 16) + + def test_from_buffer_copy_with_offset(self): + a = array.array("i", range(16)) + x = (c_int * 15).from_buffer_copy(a, sizeof(c_int)) + + self.assertEqual(x[:], a.tolist()[1:]) + with self.assertRaises(ValueError): + c_int.from_buffer_copy(a, -1) + with self.assertRaises(ValueError): + (c_int * 16).from_buffer_copy(a, sizeof(c_int)) + with self.assertRaises(ValueError): + (c_int * 1).from_buffer_copy(a, 16 * sizeof(c_int)) + + def test_abstract(self): + from ctypes import _Pointer, _SimpleCData, _CFuncPtr + + self.assertRaises(TypeError, Array.from_buffer, bytearray(10)) + self.assertRaises(TypeError, Structure.from_buffer, bytearray(10)) + self.assertRaises(TypeError, Union.from_buffer, bytearray(10)) + self.assertRaises(TypeError, _CFuncPtr.from_buffer, bytearray(10)) + self.assertRaises(TypeError, _Pointer.from_buffer, bytearray(10)) + self.assertRaises(TypeError, _SimpleCData.from_buffer, bytearray(10)) + + self.assertRaises(TypeError, Array.from_buffer_copy, b"123") + self.assertRaises(TypeError, Structure.from_buffer_copy, b"123") + self.assertRaises(TypeError, Union.from_buffer_copy, b"123") + self.assertRaises(TypeError, _CFuncPtr.from_buffer_copy, b"123") + self.assertRaises(TypeError, _Pointer.from_buffer_copy, b"123") + self.assertRaises(TypeError, _SimpleCData.from_buffer_copy, b"123") + +if __name__ == '__main__': + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_funcptr.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_funcptr.py new file mode 100644 index 0000000000000000000000000000000000000000..e0b9b54e97f67346f111dd32f48c8adc8aca290d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_funcptr.py @@ -0,0 +1,132 @@ +import unittest +from ctypes import * + +try: + WINFUNCTYPE +except NameError: + # fake to enable this test on Linux + WINFUNCTYPE = CFUNCTYPE + +import _ctypes_test +lib = CDLL(_ctypes_test.__file__) + +class CFuncPtrTestCase(unittest.TestCase): + def test_basic(self): + X = WINFUNCTYPE(c_int, c_int, c_int) + + def func(*args): + return len(args) + + x = X(func) + self.assertEqual(x.restype, c_int) + self.assertEqual(x.argtypes, (c_int, c_int)) + self.assertEqual(sizeof(x), sizeof(c_voidp)) + self.assertEqual(sizeof(X), sizeof(c_voidp)) + + def test_first(self): + StdCallback = WINFUNCTYPE(c_int, c_int, c_int) + CdeclCallback = CFUNCTYPE(c_int, c_int, c_int) + + def func(a, b): + return a + b + + s = StdCallback(func) + c = CdeclCallback(func) + + self.assertEqual(s(1, 2), 3) + self.assertEqual(c(1, 2), 3) + # The following no longer raises a TypeError - it is now + # possible, as in C, to call cdecl functions with more parameters. + #self.assertRaises(TypeError, c, 1, 2, 3) + self.assertEqual(c(1, 2, 3, 4, 5, 6), 3) + if not WINFUNCTYPE is CFUNCTYPE: + self.assertRaises(TypeError, s, 1, 2, 3) + + def test_structures(self): + WNDPROC = WINFUNCTYPE(c_long, c_int, c_int, c_int, c_int) + + def wndproc(hwnd, msg, wParam, lParam): + return hwnd + msg + wParam + lParam + + HINSTANCE = c_int + HICON = c_int + HCURSOR = c_int + LPCTSTR = c_char_p + + class WNDCLASS(Structure): + _fields_ = [("style", c_uint), + ("lpfnWndProc", WNDPROC), + ("cbClsExtra", c_int), + ("cbWndExtra", c_int), + ("hInstance", HINSTANCE), + ("hIcon", HICON), + ("hCursor", HCURSOR), + ("lpszMenuName", LPCTSTR), + ("lpszClassName", LPCTSTR)] + + wndclass = WNDCLASS() + wndclass.lpfnWndProc = WNDPROC(wndproc) + + WNDPROC_2 = WINFUNCTYPE(c_long, c_int, c_int, c_int, c_int) + + # This is no longer true, now that WINFUNCTYPE caches created types internally. + ## # CFuncPtr subclasses are compared by identity, so this raises a TypeError: + ## self.assertRaises(TypeError, setattr, wndclass, + ## "lpfnWndProc", WNDPROC_2(wndproc)) + # instead: + + self.assertIs(WNDPROC, WNDPROC_2) + # 'wndclass.lpfnWndProc' leaks 94 references. Why? + self.assertEqual(wndclass.lpfnWndProc(1, 2, 3, 4), 10) + + + f = wndclass.lpfnWndProc + + del wndclass + del wndproc + + self.assertEqual(f(10, 11, 12, 13), 46) + + def test_dllfunctions(self): + + def NoNullHandle(value): + if not value: + raise WinError() + return value + + strchr = lib.my_strchr + strchr.restype = c_char_p + strchr.argtypes = (c_char_p, c_char) + self.assertEqual(strchr(b"abcdefghi", b"b"), b"bcdefghi") + self.assertEqual(strchr(b"abcdefghi", b"x"), None) + + + strtok = lib.my_strtok + strtok.restype = c_char_p + # Neither of this does work: strtok changes the buffer it is passed +## strtok.argtypes = (c_char_p, c_char_p) +## strtok.argtypes = (c_string, c_char_p) + + def c_string(init): + size = len(init) + 1 + return (c_char*size)(*init) + + s = b"a\nb\nc" + b = c_string(s) + +## b = (c_char * (len(s)+1))() +## b.value = s + +## b = c_string(s) + self.assertEqual(strtok(b, b"\n"), b"a") + self.assertEqual(strtok(None, b"\n"), b"b") + self.assertEqual(strtok(None, b"\n"), b"c") + self.assertEqual(strtok(None, b"\n"), None) + + def test_abstract(self): + from ctypes import _CFuncPtr + + self.assertRaises(TypeError, _CFuncPtr, 13, "name", 42, "iid") + +if __name__ == '__main__': + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_functions.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_functions.py new file mode 100644 index 0000000000000000000000000000000000000000..d1fbc32a41ea2cde4fa65efdcb51107530782b07 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_functions.py @@ -0,0 +1,384 @@ +""" +Here is probably the place to write the docs, since the test-cases +show how the type behave. + +Later... +""" + +from ctypes import * +from ctypes.test import need_symbol +import sys, unittest + +try: + WINFUNCTYPE +except NameError: + # fake to enable this test on Linux + WINFUNCTYPE = CFUNCTYPE + +import _ctypes_test +dll = CDLL(_ctypes_test.__file__) +if sys.platform == "win32": + windll = WinDLL(_ctypes_test.__file__) + +class POINT(Structure): + _fields_ = [("x", c_int), ("y", c_int)] +class RECT(Structure): + _fields_ = [("left", c_int), ("top", c_int), + ("right", c_int), ("bottom", c_int)] +class FunctionTestCase(unittest.TestCase): + + def test_mro(self): + # in Python 2.3, this raises TypeError: MRO conflict among bases classes, + # in Python 2.2 it works. + # + # But in early versions of _ctypes.c, the result of tp_new + # wasn't checked, and it even crashed Python. + # Found by Greg Chapman. + + with self.assertRaises(TypeError): + class X(object, Array): + _length_ = 5 + _type_ = "i" + + from _ctypes import _Pointer + with self.assertRaises(TypeError): + class X2(object, _Pointer): + pass + + from _ctypes import _SimpleCData + with self.assertRaises(TypeError): + class X3(object, _SimpleCData): + _type_ = "i" + + with self.assertRaises(TypeError): + class X4(object, Structure): + _fields_ = [] + + @need_symbol('c_wchar') + def test_wchar_parm(self): + f = dll._testfunc_i_bhilfd + f.argtypes = [c_byte, c_wchar, c_int, c_long, c_float, c_double] + result = f(1, "x", 3, 4, 5.0, 6.0) + self.assertEqual(result, 139) + self.assertEqual(type(result), int) + + @need_symbol('c_wchar') + def test_wchar_result(self): + f = dll._testfunc_i_bhilfd + f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_double] + f.restype = c_wchar + result = f(0, 0, 0, 0, 0, 0) + self.assertEqual(result, '\x00') + + def test_voidresult(self): + f = dll._testfunc_v + f.restype = None + f.argtypes = [c_int, c_int, POINTER(c_int)] + result = c_int() + self.assertEqual(None, f(1, 2, byref(result))) + self.assertEqual(result.value, 3) + + def test_intresult(self): + f = dll._testfunc_i_bhilfd + f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_double] + f.restype = c_int + result = f(1, 2, 3, 4, 5.0, 6.0) + self.assertEqual(result, 21) + self.assertEqual(type(result), int) + + result = f(-1, -2, -3, -4, -5.0, -6.0) + self.assertEqual(result, -21) + self.assertEqual(type(result), int) + + # If we declare the function to return a short, + # is the high part split off? + f.restype = c_short + result = f(1, 2, 3, 4, 5.0, 6.0) + self.assertEqual(result, 21) + self.assertEqual(type(result), int) + + result = f(1, 2, 3, 0x10004, 5.0, 6.0) + self.assertEqual(result, 21) + self.assertEqual(type(result), int) + + # You cannot assign character format codes as restype any longer + self.assertRaises(TypeError, setattr, f, "restype", "i") + + def test_floatresult(self): + f = dll._testfunc_f_bhilfd + f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_double] + f.restype = c_float + result = f(1, 2, 3, 4, 5.0, 6.0) + self.assertEqual(result, 21) + self.assertEqual(type(result), float) + + result = f(-1, -2, -3, -4, -5.0, -6.0) + self.assertEqual(result, -21) + self.assertEqual(type(result), float) + + def test_doubleresult(self): + f = dll._testfunc_d_bhilfd + f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_double] + f.restype = c_double + result = f(1, 2, 3, 4, 5.0, 6.0) + self.assertEqual(result, 21) + self.assertEqual(type(result), float) + + result = f(-1, -2, -3, -4, -5.0, -6.0) + self.assertEqual(result, -21) + self.assertEqual(type(result), float) + + @need_symbol('c_longdouble') + def test_longdoubleresult(self): + f = dll._testfunc_D_bhilfD + f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_longdouble] + f.restype = c_longdouble + result = f(1, 2, 3, 4, 5.0, 6.0) + self.assertEqual(result, 21) + self.assertEqual(type(result), float) + + result = f(-1, -2, -3, -4, -5.0, -6.0) + self.assertEqual(result, -21) + self.assertEqual(type(result), float) + + @need_symbol('c_longlong') + def test_longlongresult(self): + f = dll._testfunc_q_bhilfd + f.restype = c_longlong + f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_double] + result = f(1, 2, 3, 4, 5.0, 6.0) + self.assertEqual(result, 21) + + f = dll._testfunc_q_bhilfdq + f.restype = c_longlong + f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_double, c_longlong] + result = f(1, 2, 3, 4, 5.0, 6.0, 21) + self.assertEqual(result, 42) + + def test_stringresult(self): + f = dll._testfunc_p_p + f.argtypes = None + f.restype = c_char_p + result = f(b"123") + self.assertEqual(result, b"123") + + result = f(None) + self.assertEqual(result, None) + + def test_pointers(self): + f = dll._testfunc_p_p + f.restype = POINTER(c_int) + f.argtypes = [POINTER(c_int)] + + # This only works if the value c_int(42) passed to the + # function is still alive while the pointer (the result) is + # used. + + v = c_int(42) + + self.assertEqual(pointer(v).contents.value, 42) + result = f(pointer(v)) + self.assertEqual(type(result), POINTER(c_int)) + self.assertEqual(result.contents.value, 42) + + # This on works... + result = f(pointer(v)) + self.assertEqual(result.contents.value, v.value) + + p = pointer(c_int(99)) + result = f(p) + self.assertEqual(result.contents.value, 99) + + arg = byref(v) + result = f(arg) + self.assertNotEqual(result.contents, v.value) + + self.assertRaises(ArgumentError, f, byref(c_short(22))) + + # It is dangerous, however, because you don't control the lifetime + # of the pointer: + result = f(byref(c_int(99))) + self.assertNotEqual(result.contents, 99) + + ################################################################ + def test_shorts(self): + f = dll._testfunc_callback_i_if + + args = [] + expected = [262144, 131072, 65536, 32768, 16384, 8192, 4096, 2048, + 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1] + + def callback(v): + args.append(v) + return v + + CallBack = CFUNCTYPE(c_int, c_int) + + cb = CallBack(callback) + f(2**18, cb) + self.assertEqual(args, expected) + + ################################################################ + + + def test_callbacks(self): + f = dll._testfunc_callback_i_if + f.restype = c_int + f.argtypes = None + + MyCallback = CFUNCTYPE(c_int, c_int) + + def callback(value): + #print "called back with", value + return value + + cb = MyCallback(callback) + result = f(-10, cb) + self.assertEqual(result, -18) + + # test with prototype + f.argtypes = [c_int, MyCallback] + cb = MyCallback(callback) + result = f(-10, cb) + self.assertEqual(result, -18) + + AnotherCallback = WINFUNCTYPE(c_int, c_int, c_int, c_int, c_int) + + # check that the prototype works: we call f with wrong + # argument types + cb = AnotherCallback(callback) + self.assertRaises(ArgumentError, f, -10, cb) + + + def test_callbacks_2(self): + # Can also use simple datatypes as argument type specifiers + # for the callback function. + # In this case the call receives an instance of that type + f = dll._testfunc_callback_i_if + f.restype = c_int + + MyCallback = CFUNCTYPE(c_int, c_int) + + f.argtypes = [c_int, MyCallback] + + def callback(value): + #print "called back with", value + self.assertEqual(type(value), int) + return value + + cb = MyCallback(callback) + result = f(-10, cb) + self.assertEqual(result, -18) + + @need_symbol('c_longlong') + def test_longlong_callbacks(self): + + f = dll._testfunc_callback_q_qf + f.restype = c_longlong + + MyCallback = CFUNCTYPE(c_longlong, c_longlong) + + f.argtypes = [c_longlong, MyCallback] + + def callback(value): + self.assertIsInstance(value, int) + return value & 0x7FFFFFFF + + cb = MyCallback(callback) + + self.assertEqual(13577625587, f(1000000000000, cb)) + + def test_errors(self): + self.assertRaises(AttributeError, getattr, dll, "_xxx_yyy") + self.assertRaises(ValueError, c_int.in_dll, dll, "_xxx_yyy") + + def test_byval(self): + + # without prototype + ptin = POINT(1, 2) + ptout = POINT() + # EXPORT int _testfunc_byval(point in, point *pout) + result = dll._testfunc_byval(ptin, byref(ptout)) + got = result, ptout.x, ptout.y + expected = 3, 1, 2 + self.assertEqual(got, expected) + + # with prototype + ptin = POINT(101, 102) + ptout = POINT() + dll._testfunc_byval.argtypes = (POINT, POINTER(POINT)) + dll._testfunc_byval.restype = c_int + result = dll._testfunc_byval(ptin, byref(ptout)) + got = result, ptout.x, ptout.y + expected = 203, 101, 102 + self.assertEqual(got, expected) + + def test_struct_return_2H(self): + class S2H(Structure): + _fields_ = [("x", c_short), + ("y", c_short)] + dll.ret_2h_func.restype = S2H + dll.ret_2h_func.argtypes = [S2H] + inp = S2H(99, 88) + s2h = dll.ret_2h_func(inp) + self.assertEqual((s2h.x, s2h.y), (99*2, 88*3)) + + @unittest.skipUnless(sys.platform == "win32", 'Windows-specific test') + def test_struct_return_2H_stdcall(self): + class S2H(Structure): + _fields_ = [("x", c_short), + ("y", c_short)] + + windll.s_ret_2h_func.restype = S2H + windll.s_ret_2h_func.argtypes = [S2H] + s2h = windll.s_ret_2h_func(S2H(99, 88)) + self.assertEqual((s2h.x, s2h.y), (99*2, 88*3)) + + def test_struct_return_8H(self): + class S8I(Structure): + _fields_ = [("a", c_int), + ("b", c_int), + ("c", c_int), + ("d", c_int), + ("e", c_int), + ("f", c_int), + ("g", c_int), + ("h", c_int)] + dll.ret_8i_func.restype = S8I + dll.ret_8i_func.argtypes = [S8I] + inp = S8I(9, 8, 7, 6, 5, 4, 3, 2) + s8i = dll.ret_8i_func(inp) + self.assertEqual((s8i.a, s8i.b, s8i.c, s8i.d, s8i.e, s8i.f, s8i.g, s8i.h), + (9*2, 8*3, 7*4, 6*5, 5*6, 4*7, 3*8, 2*9)) + + @unittest.skipUnless(sys.platform == "win32", 'Windows-specific test') + def test_struct_return_8H_stdcall(self): + class S8I(Structure): + _fields_ = [("a", c_int), + ("b", c_int), + ("c", c_int), + ("d", c_int), + ("e", c_int), + ("f", c_int), + ("g", c_int), + ("h", c_int)] + windll.s_ret_8i_func.restype = S8I + windll.s_ret_8i_func.argtypes = [S8I] + inp = S8I(9, 8, 7, 6, 5, 4, 3, 2) + s8i = windll.s_ret_8i_func(inp) + self.assertEqual( + (s8i.a, s8i.b, s8i.c, s8i.d, s8i.e, s8i.f, s8i.g, s8i.h), + (9*2, 8*3, 7*4, 6*5, 5*6, 4*7, 3*8, 2*9)) + + def test_sf1651235(self): + # see https://www.python.org/sf/1651235 + + proto = CFUNCTYPE(c_int, RECT, POINT) + def callback(*args): + return 0 + + callback = proto(callback) + self.assertRaises(ArgumentError, lambda: callback((1, 2, 3, 4), POINT())) + +if __name__ == '__main__': + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_incomplete.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_incomplete.py new file mode 100644 index 0000000000000000000000000000000000000000..00c430ef53cfa8d3c055aed71d01db5f8c310a16 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_incomplete.py @@ -0,0 +1,42 @@ +import unittest +from ctypes import * + +################################################################ +# +# The incomplete pointer example from the tutorial +# + +class MyTestCase(unittest.TestCase): + + def test_incomplete_example(self): + lpcell = POINTER("cell") + class cell(Structure): + _fields_ = [("name", c_char_p), + ("next", lpcell)] + + SetPointerType(lpcell, cell) + + c1 = cell() + c1.name = b"foo" + c2 = cell() + c2.name = b"bar" + + c1.next = pointer(c2) + c2.next = pointer(c1) + + p = c1 + + result = [] + for i in range(8): + result.append(p.name) + p = p.next[0] + self.assertEqual(result, [b"foo", b"bar"] * 4) + + # to not leak references, we must clean _pointer_type_cache + from ctypes import _pointer_type_cache + del _pointer_type_cache[cell] + +################################################################ + +if __name__ == '__main__': + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_init.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_init.py new file mode 100644 index 0000000000000000000000000000000000000000..75fad112a01ffbbe4f069fe872176ba66d2db455 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_init.py @@ -0,0 +1,40 @@ +from ctypes import * +import unittest + +class X(Structure): + _fields_ = [("a", c_int), + ("b", c_int)] + new_was_called = False + + def __new__(cls): + result = super().__new__(cls) + result.new_was_called = True + return result + + def __init__(self): + self.a = 9 + self.b = 12 + +class Y(Structure): + _fields_ = [("x", X)] + + +class InitTest(unittest.TestCase): + def test_get(self): + # make sure the only accessing a nested structure + # doesn't call the structure's __new__ and __init__ + y = Y() + self.assertEqual((y.x.a, y.x.b), (0, 0)) + self.assertEqual(y.x.new_was_called, False) + + # But explicitly creating an X structure calls __new__ and __init__, of course. + x = X() + self.assertEqual((x.a, x.b), (9, 12)) + self.assertEqual(x.new_was_called, True) + + y.x = x + self.assertEqual((y.x.a, y.x.b), (9, 12)) + self.assertEqual(y.x.new_was_called, False) + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_internals.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_internals.py new file mode 100644 index 0000000000000000000000000000000000000000..271e3f57f817430dcd94726051a6a945a119c4de --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_internals.py @@ -0,0 +1,100 @@ +# This tests the internal _objects attribute +import unittest +from ctypes import * +from sys import getrefcount as grc + +# XXX This test must be reviewed for correctness!!! + +# ctypes' types are container types. +# +# They have an internal memory block, which only consists of some bytes, +# but it has to keep references to other objects as well. This is not +# really needed for trivial C types like int or char, but it is important +# for aggregate types like strings or pointers in particular. +# +# What about pointers? + +class ObjectsTestCase(unittest.TestCase): + def assertSame(self, a, b): + self.assertEqual(id(a), id(b)) + + def test_ints(self): + i = 42000123 + refcnt = grc(i) + ci = c_int(i) + self.assertEqual(refcnt, grc(i)) + self.assertEqual(ci._objects, None) + + def test_c_char_p(self): + s = b"Hello, World" + refcnt = grc(s) + cs = c_char_p(s) + self.assertEqual(refcnt + 1, grc(s)) + self.assertSame(cs._objects, s) + + def test_simple_struct(self): + class X(Structure): + _fields_ = [("a", c_int), ("b", c_int)] + + a = 421234 + b = 421235 + x = X() + self.assertEqual(x._objects, None) + x.a = a + x.b = b + self.assertEqual(x._objects, None) + + def test_embedded_structs(self): + class X(Structure): + _fields_ = [("a", c_int), ("b", c_int)] + + class Y(Structure): + _fields_ = [("x", X), ("y", X)] + + y = Y() + self.assertEqual(y._objects, None) + + x1, x2 = X(), X() + y.x, y.y = x1, x2 + self.assertEqual(y._objects, {"0": {}, "1": {}}) + x1.a, x2.b = 42, 93 + self.assertEqual(y._objects, {"0": {}, "1": {}}) + + def test_xxx(self): + class X(Structure): + _fields_ = [("a", c_char_p), ("b", c_char_p)] + + class Y(Structure): + _fields_ = [("x", X), ("y", X)] + + s1 = b"Hello, World" + s2 = b"Hallo, Welt" + + x = X() + x.a = s1 + x.b = s2 + self.assertEqual(x._objects, {"0": s1, "1": s2}) + + y = Y() + y.x = x + self.assertEqual(y._objects, {"0": {"0": s1, "1": s2}}) +## x = y.x +## del y +## print x._b_base_._objects + + def test_ptr_struct(self): + class X(Structure): + _fields_ = [("data", POINTER(c_int))] + + A = c_int*4 + a = A(11, 22, 33, 44) + self.assertEqual(a._objects, None) + + x = X() + x.data = a +##XXX print x._objects +##XXX print x.data[0] +##XXX print x.data._objects + +if __name__ == '__main__': + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_keeprefs.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_keeprefs.py new file mode 100644 index 0000000000000000000000000000000000000000..e20adc7696f501ceab83ea2b6b1337f0ed80071b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_keeprefs.py @@ -0,0 +1,122 @@ +from ctypes import * +import unittest + +class SimpleTestCase(unittest.TestCase): + def test_cint(self): + x = c_int() + self.assertEqual(x._objects, None) + x.value = 42 + self.assertEqual(x._objects, None) + x = c_int(99) + self.assertEqual(x._objects, None) + + def test_ccharp(self): + x = c_char_p() + self.assertEqual(x._objects, None) + x.value = b"abc" + self.assertEqual(x._objects, b"abc") + x = c_char_p(b"spam") + self.assertEqual(x._objects, b"spam") + +class StructureTestCase(unittest.TestCase): + def test_cint_struct(self): + class X(Structure): + _fields_ = [("a", c_int), + ("b", c_int)] + + x = X() + self.assertEqual(x._objects, None) + x.a = 42 + x.b = 99 + self.assertEqual(x._objects, None) + + def test_ccharp_struct(self): + class X(Structure): + _fields_ = [("a", c_char_p), + ("b", c_char_p)] + x = X() + self.assertEqual(x._objects, None) + + x.a = b"spam" + x.b = b"foo" + self.assertEqual(x._objects, {"0": b"spam", "1": b"foo"}) + + def test_struct_struct(self): + class POINT(Structure): + _fields_ = [("x", c_int), ("y", c_int)] + class RECT(Structure): + _fields_ = [("ul", POINT), ("lr", POINT)] + + r = RECT() + r.ul.x = 0 + r.ul.y = 1 + r.lr.x = 2 + r.lr.y = 3 + self.assertEqual(r._objects, None) + + r = RECT() + pt = POINT(1, 2) + r.ul = pt + self.assertEqual(r._objects, {'0': {}}) + r.ul.x = 22 + r.ul.y = 44 + self.assertEqual(r._objects, {'0': {}}) + r.lr = POINT() + self.assertEqual(r._objects, {'0': {}, '1': {}}) + +class ArrayTestCase(unittest.TestCase): + def test_cint_array(self): + INTARR = c_int * 3 + + ia = INTARR() + self.assertEqual(ia._objects, None) + ia[0] = 1 + ia[1] = 2 + ia[2] = 3 + self.assertEqual(ia._objects, None) + + class X(Structure): + _fields_ = [("x", c_int), + ("a", INTARR)] + + x = X() + x.x = 1000 + x.a[0] = 42 + x.a[1] = 96 + self.assertEqual(x._objects, None) + x.a = ia + self.assertEqual(x._objects, {'1': {}}) + +class PointerTestCase(unittest.TestCase): + def test_p_cint(self): + i = c_int(42) + x = pointer(i) + self.assertEqual(x._objects, {'1': i}) + + +class PointerToStructure(unittest.TestCase): + def test(self): + class POINT(Structure): + _fields_ = [("x", c_int), ("y", c_int)] + class RECT(Structure): + _fields_ = [("a", POINTER(POINT)), + ("b", POINTER(POINT))] + r = RECT() + p1 = POINT(1, 2) + + r.a = pointer(p1) + r.b = pointer(p1) +## from pprint import pprint as pp +## pp(p1._objects) +## pp(r._objects) + + r.a[0].x = 42 + r.a[0].y = 99 + + # to avoid leaking when tests are run several times + # clean up the types left in the cache. + from ctypes import _pointer_type_cache + del _pointer_type_cache[POINT] + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_libc.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_libc.py new file mode 100644 index 0000000000000000000000000000000000000000..56285b5ff8151275aba9de5f197d2c385822e849 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_libc.py @@ -0,0 +1,33 @@ +import unittest + +from ctypes import * +import _ctypes_test + +lib = CDLL(_ctypes_test.__file__) + +def three_way_cmp(x, y): + """Return -1 if x < y, 0 if x == y and 1 if x > y""" + return (x > y) - (x < y) + +class LibTest(unittest.TestCase): + def test_sqrt(self): + lib.my_sqrt.argtypes = c_double, + lib.my_sqrt.restype = c_double + self.assertEqual(lib.my_sqrt(4.0), 2.0) + import math + self.assertEqual(lib.my_sqrt(2.0), math.sqrt(2.0)) + + def test_qsort(self): + comparefunc = CFUNCTYPE(c_int, POINTER(c_char), POINTER(c_char)) + lib.my_qsort.argtypes = c_void_p, c_size_t, c_size_t, comparefunc + lib.my_qsort.restype = None + + def sort(a, b): + return three_way_cmp(a[0], b[0]) + + chars = create_string_buffer(b"spam, spam, and spam") + lib.my_qsort(chars, len(chars)-1, sizeof(c_char), comparefunc(sort)) + self.assertEqual(chars.raw, b" ,,aaaadmmmnpppsss\x00") + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_loading.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_loading.py new file mode 100644 index 0000000000000000000000000000000000000000..d24153e3292d145a251cc25b17f5b36d8dba486c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_loading.py @@ -0,0 +1,186 @@ +from ctypes import * +import os +import shutil +import subprocess +import sys +import unittest +import test.support +from test.support import import_helper +from test.support import os_helper +from ctypes.util import find_library + +libc_name = None + +def setUpModule(): + global libc_name + if os.name == "nt": + libc_name = find_library("c") + elif sys.platform == "cygwin": + libc_name = "cygwin1.dll" + else: + libc_name = find_library("c") + + if test.support.verbose: + print("libc_name is", libc_name) + +class LoaderTest(unittest.TestCase): + + unknowndll = "xxrandomnamexx" + + def test_load(self): + if libc_name is None: + self.skipTest('could not find libc') + CDLL(libc_name) + CDLL(os.path.basename(libc_name)) + self.assertRaises(OSError, CDLL, self.unknowndll) + + def test_load_version(self): + if libc_name is None: + self.skipTest('could not find libc') + if os.path.basename(libc_name) != 'libc.so.6': + self.skipTest('wrong libc path for test') + cdll.LoadLibrary("libc.so.6") + # linux uses version, libc 9 should not exist + self.assertRaises(OSError, cdll.LoadLibrary, "libc.so.9") + self.assertRaises(OSError, cdll.LoadLibrary, self.unknowndll) + + def test_find(self): + found = False + for name in ("c", "m"): + lib = find_library(name) + if lib: + found = True + cdll.LoadLibrary(lib) + CDLL(lib) + if not found: + self.skipTest("Could not find c and m libraries") + + @unittest.skipUnless(os.name == "nt", + 'test specific to Windows') + def test_load_library(self): + # CRT is no longer directly loadable. See issue23606 for the + # discussion about alternative approaches. + #self.assertIsNotNone(libc_name) + if test.support.verbose: + print(find_library("kernel32")) + print(find_library("user32")) + + if os.name == "nt": + windll.kernel32.GetModuleHandleW + windll["kernel32"].GetModuleHandleW + windll.LoadLibrary("kernel32").GetModuleHandleW + WinDLL("kernel32").GetModuleHandleW + # embedded null character + self.assertRaises(ValueError, windll.LoadLibrary, "kernel32\0") + + @unittest.skipUnless(os.name == "nt", + 'test specific to Windows') + def test_load_ordinal_functions(self): + import _ctypes_test + dll = WinDLL(_ctypes_test.__file__) + # We load the same function both via ordinal and name + func_ord = dll[2] + func_name = dll.GetString + # addressof gets the address where the function pointer is stored + a_ord = addressof(func_ord) + a_name = addressof(func_name) + f_ord_addr = c_void_p.from_address(a_ord).value + f_name_addr = c_void_p.from_address(a_name).value + self.assertEqual(hex(f_ord_addr), hex(f_name_addr)) + + self.assertRaises(AttributeError, dll.__getitem__, 1234) + + @unittest.skipUnless(os.name == "nt", 'Windows-specific test') + def test_1703286_A(self): + from _ctypes import LoadLibrary, FreeLibrary + # On winXP 64-bit, advapi32 loads at an address that does + # NOT fit into a 32-bit integer. FreeLibrary must be able + # to accept this address. + + # These are tests for https://www.python.org/sf/1703286 + handle = LoadLibrary("advapi32") + FreeLibrary(handle) + + @unittest.skipUnless(os.name == "nt", 'Windows-specific test') + def test_1703286_B(self): + # Since on winXP 64-bit advapi32 loads like described + # above, the (arbitrarily selected) CloseEventLog function + # also has a high address. 'call_function' should accept + # addresses so large. + from _ctypes import call_function + advapi32 = windll.advapi32 + # Calling CloseEventLog with a NULL argument should fail, + # but the call should not segfault or so. + self.assertEqual(0, advapi32.CloseEventLog(None)) + windll.kernel32.GetProcAddress.argtypes = c_void_p, c_char_p + windll.kernel32.GetProcAddress.restype = c_void_p + proc = windll.kernel32.GetProcAddress(advapi32._handle, + b"CloseEventLog") + self.assertTrue(proc) + # This is the real test: call the function via 'call_function' + self.assertEqual(0, call_function(proc, (None,))) + + @unittest.skipUnless(os.name == "nt", + 'test specific to Windows') + def test_load_dll_with_flags(self): + _sqlite3 = import_helper.import_module("_sqlite3") + src = _sqlite3.__file__ + if src.lower().endswith("_d.pyd"): + ext = "_d.dll" + else: + ext = ".dll" + + with os_helper.temp_dir() as tmp: + # We copy two files and load _sqlite3.dll (formerly .pyd), + # which has a dependency on sqlite3.dll. Then we test + # loading it in subprocesses to avoid it starting in memory + # for each test. + target = os.path.join(tmp, "_sqlite3.dll") + shutil.copy(src, target) + shutil.copy(os.path.join(os.path.dirname(src), "sqlite3" + ext), + os.path.join(tmp, "sqlite3" + ext)) + + def should_pass(command): + with self.subTest(command): + subprocess.check_output( + [sys.executable, "-c", + "from ctypes import *; import nt;" + command], + cwd=tmp + ) + + def should_fail(command): + with self.subTest(command): + with self.assertRaises(subprocess.CalledProcessError): + subprocess.check_output( + [sys.executable, "-c", + "from ctypes import *; import nt;" + command], + cwd=tmp, stderr=subprocess.STDOUT, + ) + + # Default load should not find this in CWD + should_fail("WinDLL('_sqlite3.dll')") + + # Relative path (but not just filename) should succeed + should_pass("WinDLL('./_sqlite3.dll')") + + # Insecure load flags should succeed + # Clear the DLL directory to avoid safe search settings propagating + should_pass("windll.kernel32.SetDllDirectoryW(None); WinDLL('_sqlite3.dll', winmode=0)") + + # Full path load without DLL_LOAD_DIR shouldn't find dependency + should_fail("WinDLL(nt._getfullpathname('_sqlite3.dll'), " + + "winmode=nt._LOAD_LIBRARY_SEARCH_SYSTEM32)") + + # Full path load with DLL_LOAD_DIR should succeed + should_pass("WinDLL(nt._getfullpathname('_sqlite3.dll'), " + + "winmode=nt._LOAD_LIBRARY_SEARCH_SYSTEM32|" + + "nt._LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR)") + + # User-specified directory should succeed + should_pass("import os; p = os.add_dll_directory(os.getcwd());" + + "WinDLL('_sqlite3.dll'); p.close()") + + + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_macholib.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_macholib.py new file mode 100644 index 0000000000000000000000000000000000000000..bc75f1a05a8c3725524baf609810fd6ff4cb3764 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_macholib.py @@ -0,0 +1,110 @@ +import os +import sys +import unittest + +# Bob Ippolito: +# +# Ok.. the code to find the filename for __getattr__ should look +# something like: +# +# import os +# from macholib.dyld import dyld_find +# +# def find_lib(name): +# possible = ['lib'+name+'.dylib', name+'.dylib', +# name+'.framework/'+name] +# for dylib in possible: +# try: +# return os.path.realpath(dyld_find(dylib)) +# except ValueError: +# pass +# raise ValueError, "%s not found" % (name,) +# +# It'll have output like this: +# +# >>> find_lib('pthread') +# '/usr/lib/libSystem.B.dylib' +# >>> find_lib('z') +# '/usr/lib/libz.1.dylib' +# >>> find_lib('IOKit') +# '/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit' +# +# -bob + +from ctypes.macholib.dyld import dyld_find +from ctypes.macholib.dylib import dylib_info +from ctypes.macholib.framework import framework_info + +def find_lib(name): + possible = ['lib'+name+'.dylib', name+'.dylib', name+'.framework/'+name] + for dylib in possible: + try: + return os.path.realpath(dyld_find(dylib)) + except ValueError: + pass + raise ValueError("%s not found" % (name,)) + + +def d(location=None, name=None, shortname=None, version=None, suffix=None): + return {'location': location, 'name': name, 'shortname': shortname, + 'version': version, 'suffix': suffix} + + +class MachOTest(unittest.TestCase): + @unittest.skipUnless(sys.platform == "darwin", 'OSX-specific test') + def test_find(self): + self.assertEqual(dyld_find('libSystem.dylib'), + '/usr/lib/libSystem.dylib') + self.assertEqual(dyld_find('System.framework/System'), + '/System/Library/Frameworks/System.framework/System') + + # On Mac OS 11, system dylibs are only present in the shared cache, + # so symlinks like libpthread.dylib -> libSystem.B.dylib will not + # be resolved by dyld_find + self.assertIn(find_lib('pthread'), + ('/usr/lib/libSystem.B.dylib', '/usr/lib/libpthread.dylib')) + + result = find_lib('z') + # Issue #21093: dyld default search path includes $HOME/lib and + # /usr/local/lib before /usr/lib, which caused test failures if + # a local copy of libz exists in one of them. Now ignore the head + # of the path. + self.assertRegex(result, r".*/lib/libz.*\.dylib") + + self.assertIn(find_lib('IOKit'), + ('/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit', + '/System/Library/Frameworks/IOKit.framework/IOKit')) + + @unittest.skipUnless(sys.platform == "darwin", 'OSX-specific test') + def test_info(self): + self.assertIsNone(dylib_info('completely/invalid')) + self.assertIsNone(dylib_info('completely/invalide_debug')) + self.assertEqual(dylib_info('P/Foo.dylib'), d('P', 'Foo.dylib', 'Foo')) + self.assertEqual(dylib_info('P/Foo_debug.dylib'), + d('P', 'Foo_debug.dylib', 'Foo', suffix='debug')) + self.assertEqual(dylib_info('P/Foo.A.dylib'), + d('P', 'Foo.A.dylib', 'Foo', 'A')) + self.assertEqual(dylib_info('P/Foo_debug.A.dylib'), + d('P', 'Foo_debug.A.dylib', 'Foo_debug', 'A')) + self.assertEqual(dylib_info('P/Foo.A_debug.dylib'), + d('P', 'Foo.A_debug.dylib', 'Foo', 'A', 'debug')) + + @unittest.skipUnless(sys.platform == "darwin", 'OSX-specific test') + def test_framework_info(self): + self.assertIsNone(framework_info('completely/invalid')) + self.assertIsNone(framework_info('completely/invalid/_debug')) + self.assertIsNone(framework_info('P/F.framework')) + self.assertIsNone(framework_info('P/F.framework/_debug')) + self.assertEqual(framework_info('P/F.framework/F'), + d('P', 'F.framework/F', 'F')) + self.assertEqual(framework_info('P/F.framework/F_debug'), + d('P', 'F.framework/F_debug', 'F', suffix='debug')) + self.assertIsNone(framework_info('P/F.framework/Versions')) + self.assertIsNone(framework_info('P/F.framework/Versions/A')) + self.assertEqual(framework_info('P/F.framework/Versions/A/F'), + d('P', 'F.framework/Versions/A/F', 'F', 'A')) + self.assertEqual(framework_info('P/F.framework/Versions/A/F_debug'), + d('P', 'F.framework/Versions/A/F_debug', 'F', 'A', 'debug')) + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_memfunctions.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_memfunctions.py new file mode 100644 index 0000000000000000000000000000000000000000..e784b9a7068422bed5dcb5923fab467376aca550 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_memfunctions.py @@ -0,0 +1,79 @@ +import sys +from test import support +import unittest +from ctypes import * +from ctypes.test import need_symbol + +class MemFunctionsTest(unittest.TestCase): + @unittest.skip('test disabled') + def test_overflow(self): + # string_at and wstring_at must use the Python calling + # convention (which acquires the GIL and checks the Python + # error flag). Provoke an error and catch it; see also issue + # #3554: + self.assertRaises((OverflowError, MemoryError, SystemError), + lambda: wstring_at(u"foo", sys.maxint - 1)) + self.assertRaises((OverflowError, MemoryError, SystemError), + lambda: string_at("foo", sys.maxint - 1)) + + def test_memmove(self): + # large buffers apparently increase the chance that the memory + # is allocated in high address space. + a = create_string_buffer(1000000) + p = b"Hello, World" + result = memmove(a, p, len(p)) + self.assertEqual(a.value, b"Hello, World") + + self.assertEqual(string_at(result), b"Hello, World") + self.assertEqual(string_at(result, 5), b"Hello") + self.assertEqual(string_at(result, 16), b"Hello, World\0\0\0\0") + self.assertEqual(string_at(result, 0), b"") + + def test_memset(self): + a = create_string_buffer(1000000) + result = memset(a, ord('x'), 16) + self.assertEqual(a.value, b"xxxxxxxxxxxxxxxx") + + self.assertEqual(string_at(result), b"xxxxxxxxxxxxxxxx") + self.assertEqual(string_at(a), b"xxxxxxxxxxxxxxxx") + self.assertEqual(string_at(a, 20), b"xxxxxxxxxxxxxxxx\0\0\0\0") + + def test_cast(self): + a = (c_ubyte * 32)(*map(ord, "abcdef")) + self.assertEqual(cast(a, c_char_p).value, b"abcdef") + self.assertEqual(cast(a, POINTER(c_byte))[:7], + [97, 98, 99, 100, 101, 102, 0]) + self.assertEqual(cast(a, POINTER(c_byte))[:7:], + [97, 98, 99, 100, 101, 102, 0]) + self.assertEqual(cast(a, POINTER(c_byte))[6:-1:-1], + [0, 102, 101, 100, 99, 98, 97]) + self.assertEqual(cast(a, POINTER(c_byte))[:7:2], + [97, 99, 101, 0]) + self.assertEqual(cast(a, POINTER(c_byte))[:7:7], + [97]) + + @support.refcount_test + def test_string_at(self): + s = string_at(b"foo bar") + # XXX The following may be wrong, depending on how Python + # manages string instances + self.assertEqual(2, sys.getrefcount(s)) + self.assertTrue(s, "foo bar") + + self.assertEqual(string_at(b"foo bar", 7), b"foo bar") + self.assertEqual(string_at(b"foo bar", 3), b"foo") + + @need_symbol('create_unicode_buffer') + def test_wstring_at(self): + p = create_unicode_buffer("Hello, World") + a = create_unicode_buffer(1000000) + result = memmove(a, p, len(p) * sizeof(c_wchar)) + self.assertEqual(a.value, "Hello, World") + + self.assertEqual(wstring_at(a), "Hello, World") + self.assertEqual(wstring_at(a, 5), "Hello") + self.assertEqual(wstring_at(a, 16), "Hello, World\0\0\0\0") + self.assertEqual(wstring_at(a, 0), "") + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_numbers.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_numbers.py new file mode 100644 index 0000000000000000000000000000000000000000..a7696376a5ab056a107bbc49314eee22ee4760f5 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_numbers.py @@ -0,0 +1,218 @@ +from ctypes import * +import unittest +import struct + +def valid_ranges(*types): + # given a sequence of numeric types, collect their _type_ + # attribute, which is a single format character compatible with + # the struct module, use the struct module to calculate the + # minimum and maximum value allowed for this format. + # Returns a list of (min, max) values. + result = [] + for t in types: + fmt = t._type_ + size = struct.calcsize(fmt) + a = struct.unpack(fmt, (b"\x00"*32)[:size])[0] + b = struct.unpack(fmt, (b"\xFF"*32)[:size])[0] + c = struct.unpack(fmt, (b"\x7F"+b"\x00"*32)[:size])[0] + d = struct.unpack(fmt, (b"\x80"+b"\xFF"*32)[:size])[0] + result.append((min(a, b, c, d), max(a, b, c, d))) + return result + +ArgType = type(byref(c_int(0))) + +unsigned_types = [c_ubyte, c_ushort, c_uint, c_ulong] +signed_types = [c_byte, c_short, c_int, c_long, c_longlong] + +bool_types = [] + +float_types = [c_double, c_float] + +try: + c_ulonglong + c_longlong +except NameError: + pass +else: + unsigned_types.append(c_ulonglong) + signed_types.append(c_longlong) + +try: + c_bool +except NameError: + pass +else: + bool_types.append(c_bool) + +unsigned_ranges = valid_ranges(*unsigned_types) +signed_ranges = valid_ranges(*signed_types) +bool_values = [True, False, 0, 1, -1, 5000, 'test', [], [1]] + +################################################################ + +class NumberTestCase(unittest.TestCase): + + def test_default_init(self): + # default values are set to zero + for t in signed_types + unsigned_types + float_types: + self.assertEqual(t().value, 0) + + def test_unsigned_values(self): + # the value given to the constructor is available + # as the 'value' attribute + for t, (l, h) in zip(unsigned_types, unsigned_ranges): + self.assertEqual(t(l).value, l) + self.assertEqual(t(h).value, h) + + def test_signed_values(self): + # see above + for t, (l, h) in zip(signed_types, signed_ranges): + self.assertEqual(t(l).value, l) + self.assertEqual(t(h).value, h) + + def test_bool_values(self): + from operator import truth + for t, v in zip(bool_types, bool_values): + self.assertEqual(t(v).value, truth(v)) + + def test_typeerror(self): + # Only numbers are allowed in the constructor, + # otherwise TypeError is raised + for t in signed_types + unsigned_types + float_types: + self.assertRaises(TypeError, t, "") + self.assertRaises(TypeError, t, None) + + def test_from_param(self): + # the from_param class method attribute always + # returns PyCArgObject instances + for t in signed_types + unsigned_types + float_types: + self.assertEqual(ArgType, type(t.from_param(0))) + + def test_byref(self): + # calling byref returns also a PyCArgObject instance + for t in signed_types + unsigned_types + float_types + bool_types: + parm = byref(t()) + self.assertEqual(ArgType, type(parm)) + + + def test_floats(self): + # c_float and c_double can be created from + # Python int and float + class FloatLike: + def __float__(self): + return 2.0 + f = FloatLike() + for t in float_types: + self.assertEqual(t(2.0).value, 2.0) + self.assertEqual(t(2).value, 2.0) + self.assertEqual(t(2).value, 2.0) + self.assertEqual(t(f).value, 2.0) + + def test_integers(self): + class FloatLike: + def __float__(self): + return 2.0 + f = FloatLike() + class IntLike: + def __int__(self): + return 2 + d = IntLike() + class IndexLike: + def __index__(self): + return 2 + i = IndexLike() + # integers cannot be constructed from floats, + # but from integer-like objects + for t in signed_types + unsigned_types: + self.assertRaises(TypeError, t, 3.14) + self.assertRaises(TypeError, t, f) + self.assertRaises(TypeError, t, d) + self.assertEqual(t(i).value, 2) + + def test_sizes(self): + for t in signed_types + unsigned_types + float_types + bool_types: + try: + size = struct.calcsize(t._type_) + except struct.error: + continue + # sizeof of the type... + self.assertEqual(sizeof(t), size) + # and sizeof of an instance + self.assertEqual(sizeof(t()), size) + + def test_alignments(self): + for t in signed_types + unsigned_types + float_types: + code = t._type_ # the typecode + align = struct.calcsize("c%c" % code) - struct.calcsize(code) + + # alignment of the type... + self.assertEqual((code, alignment(t)), + (code, align)) + # and alignment of an instance + self.assertEqual((code, alignment(t())), + (code, align)) + + def test_int_from_address(self): + from array import array + for t in signed_types + unsigned_types: + # the array module doesn't support all format codes + # (no 'q' or 'Q') + try: + array(t._type_) + except ValueError: + continue + a = array(t._type_, [100]) + + # v now is an integer at an 'external' memory location + v = t.from_address(a.buffer_info()[0]) + self.assertEqual(v.value, a[0]) + self.assertEqual(type(v), t) + + # changing the value at the memory location changes v's value also + a[0] = 42 + self.assertEqual(v.value, a[0]) + + + def test_float_from_address(self): + from array import array + for t in float_types: + a = array(t._type_, [3.14]) + v = t.from_address(a.buffer_info()[0]) + self.assertEqual(v.value, a[0]) + self.assertIs(type(v), t) + a[0] = 2.3456e17 + self.assertEqual(v.value, a[0]) + self.assertIs(type(v), t) + + def test_char_from_address(self): + from ctypes import c_char + from array import array + + a = array('b', [0]) + a[0] = ord('x') + v = c_char.from_address(a.buffer_info()[0]) + self.assertEqual(v.value, b'x') + self.assertIs(type(v), c_char) + + a[0] = ord('?') + self.assertEqual(v.value, b'?') + + def test_init(self): + # c_int() can be initialized from Python's int, and c_int. + # Not from c_long or so, which seems strange, abc should + # probably be changed: + self.assertRaises(TypeError, c_int, c_long(42)) + + def test_float_overflow(self): + import sys + big_int = int(sys.float_info.max) * 2 + for t in float_types + [c_longdouble]: + self.assertRaises(OverflowError, t, big_int) + if (hasattr(t, "__ctype_be__")): + self.assertRaises(OverflowError, t.__ctype_be__, big_int) + if (hasattr(t, "__ctype_le__")): + self.assertRaises(OverflowError, t.__ctype_le__, big_int) + + +if __name__ == '__main__': + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_objects.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_objects.py new file mode 100644 index 0000000000000000000000000000000000000000..19e3dc1f2d7621d687b2c6c126c8bd6d5bdb10da --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_objects.py @@ -0,0 +1,67 @@ +r''' +This tests the '_objects' attribute of ctypes instances. '_objects' +holds references to objects that must be kept alive as long as the +ctypes instance, to make sure that the memory buffer is valid. + +WARNING: The '_objects' attribute is exposed ONLY for debugging ctypes itself, +it MUST NEVER BE MODIFIED! + +'_objects' is initialized to a dictionary on first use, before that it +is None. + +Here is an array of string pointers: + +>>> from ctypes import * +>>> array = (c_char_p * 5)() +>>> print(array._objects) +None +>>> + +The memory block stores pointers to strings, and the strings itself +assigned from Python must be kept. + +>>> array[4] = b'foo bar' +>>> array._objects +{'4': b'foo bar'} +>>> array[4] +b'foo bar' +>>> + +It gets more complicated when the ctypes instance itself is contained +in a 'base' object. + +>>> class X(Structure): +... _fields_ = [("x", c_int), ("y", c_int), ("array", c_char_p * 5)] +... +>>> x = X() +>>> print(x._objects) +None +>>> + +The'array' attribute of the 'x' object shares part of the memory buffer +of 'x' ('_b_base_' is either None, or the root object owning the memory block): + +>>> print(x.array._b_base_) # doctest: +ELLIPSIS + +>>> + +>>> x.array[0] = b'spam spam spam' +>>> x._objects +{'0:2': b'spam spam spam'} +>>> x.array._b_base_._objects +{'0:2': b'spam spam spam'} +>>> + +''' + +import unittest, doctest + +import ctypes.test.test_objects + +class TestCase(unittest.TestCase): + def test(self): + failures, tests = doctest.testmod(ctypes.test.test_objects) + self.assertFalse(failures, 'doctests failed, see output above') + +if __name__ == '__main__': + doctest.testmod(ctypes.test.test_objects) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_parameters.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_parameters.py new file mode 100644 index 0000000000000000000000000000000000000000..59c94e3cc23cb5bd29c34db4c37776efda7f0a6c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_parameters.py @@ -0,0 +1,302 @@ +import unittest +from ctypes.test import need_symbol +import test.support + +class SimpleTypesTestCase(unittest.TestCase): + + def setUp(self): + import ctypes + try: + from _ctypes import set_conversion_mode + except ImportError: + pass + else: + self.prev_conv_mode = set_conversion_mode("ascii", "strict") + + def tearDown(self): + try: + from _ctypes import set_conversion_mode + except ImportError: + pass + else: + set_conversion_mode(*self.prev_conv_mode) + + def test_subclasses(self): + from ctypes import c_void_p, c_char_p + # ctypes 0.9.5 and before did overwrite from_param in SimpleType_new + class CVOIDP(c_void_p): + def from_param(cls, value): + return value * 2 + from_param = classmethod(from_param) + + class CCHARP(c_char_p): + def from_param(cls, value): + return value * 4 + from_param = classmethod(from_param) + + self.assertEqual(CVOIDP.from_param("abc"), "abcabc") + self.assertEqual(CCHARP.from_param("abc"), "abcabcabcabc") + + @need_symbol('c_wchar_p') + def test_subclasses_c_wchar_p(self): + from ctypes import c_wchar_p + + class CWCHARP(c_wchar_p): + def from_param(cls, value): + return value * 3 + from_param = classmethod(from_param) + + self.assertEqual(CWCHARP.from_param("abc"), "abcabcabc") + + # XXX Replace by c_char_p tests + def test_cstrings(self): + from ctypes import c_char_p + + # c_char_p.from_param on a Python String packs the string + # into a cparam object + s = b"123" + self.assertIs(c_char_p.from_param(s)._obj, s) + + # new in 0.9.1: convert (encode) unicode to ascii + self.assertEqual(c_char_p.from_param(b"123")._obj, b"123") + self.assertRaises(TypeError, c_char_p.from_param, "123\377") + self.assertRaises(TypeError, c_char_p.from_param, 42) + + # calling c_char_p.from_param with a c_char_p instance + # returns the argument itself: + a = c_char_p(b"123") + self.assertIs(c_char_p.from_param(a), a) + + @need_symbol('c_wchar_p') + def test_cw_strings(self): + from ctypes import c_wchar_p + + c_wchar_p.from_param("123") + + self.assertRaises(TypeError, c_wchar_p.from_param, 42) + self.assertRaises(TypeError, c_wchar_p.from_param, b"123\377") + + pa = c_wchar_p.from_param(c_wchar_p("123")) + self.assertEqual(type(pa), c_wchar_p) + + def test_int_pointers(self): + from ctypes import c_short, c_uint, c_int, c_long, POINTER, pointer + LPINT = POINTER(c_int) + +## p = pointer(c_int(42)) +## x = LPINT.from_param(p) + x = LPINT.from_param(pointer(c_int(42))) + self.assertEqual(x.contents.value, 42) + self.assertEqual(LPINT(c_int(42)).contents.value, 42) + + self.assertEqual(LPINT.from_param(None), None) + + if c_int != c_long: + self.assertRaises(TypeError, LPINT.from_param, pointer(c_long(42))) + self.assertRaises(TypeError, LPINT.from_param, pointer(c_uint(42))) + self.assertRaises(TypeError, LPINT.from_param, pointer(c_short(42))) + + def test_byref_pointer(self): + # The from_param class method of POINTER(typ) classes accepts what is + # returned by byref(obj), it type(obj) == typ + from ctypes import c_short, c_uint, c_int, c_long, POINTER, byref + LPINT = POINTER(c_int) + + LPINT.from_param(byref(c_int(42))) + + self.assertRaises(TypeError, LPINT.from_param, byref(c_short(22))) + if c_int != c_long: + self.assertRaises(TypeError, LPINT.from_param, byref(c_long(22))) + self.assertRaises(TypeError, LPINT.from_param, byref(c_uint(22))) + + def test_byref_pointerpointer(self): + # See above + from ctypes import c_short, c_uint, c_int, c_long, pointer, POINTER, byref + + LPLPINT = POINTER(POINTER(c_int)) + LPLPINT.from_param(byref(pointer(c_int(42)))) + + self.assertRaises(TypeError, LPLPINT.from_param, byref(pointer(c_short(22)))) + if c_int != c_long: + self.assertRaises(TypeError, LPLPINT.from_param, byref(pointer(c_long(22)))) + self.assertRaises(TypeError, LPLPINT.from_param, byref(pointer(c_uint(22)))) + + def test_array_pointers(self): + from ctypes import c_short, c_uint, c_int, c_long, POINTER + INTARRAY = c_int * 3 + ia = INTARRAY() + self.assertEqual(len(ia), 3) + self.assertEqual([ia[i] for i in range(3)], [0, 0, 0]) + + # Pointers are only compatible with arrays containing items of + # the same type! + LPINT = POINTER(c_int) + LPINT.from_param((c_int*3)()) + self.assertRaises(TypeError, LPINT.from_param, c_short*3) + self.assertRaises(TypeError, LPINT.from_param, c_long*3) + self.assertRaises(TypeError, LPINT.from_param, c_uint*3) + + def test_noctypes_argtype(self): + import _ctypes_test + from ctypes import CDLL, c_void_p, ArgumentError + + func = CDLL(_ctypes_test.__file__)._testfunc_p_p + func.restype = c_void_p + # TypeError: has no from_param method + self.assertRaises(TypeError, setattr, func, "argtypes", (object,)) + + class Adapter: + def from_param(cls, obj): + return None + + func.argtypes = (Adapter(),) + self.assertEqual(func(None), None) + self.assertEqual(func(object()), None) + + class Adapter: + def from_param(cls, obj): + return obj + + func.argtypes = (Adapter(),) + # don't know how to convert parameter 1 + self.assertRaises(ArgumentError, func, object()) + self.assertEqual(func(c_void_p(42)), 42) + + class Adapter: + def from_param(cls, obj): + raise ValueError(obj) + + func.argtypes = (Adapter(),) + # ArgumentError: argument 1: ValueError: 99 + self.assertRaises(ArgumentError, func, 99) + + def test_abstract(self): + from ctypes import (Array, Structure, Union, _Pointer, + _SimpleCData, _CFuncPtr) + + self.assertRaises(TypeError, Array.from_param, 42) + self.assertRaises(TypeError, Structure.from_param, 42) + self.assertRaises(TypeError, Union.from_param, 42) + self.assertRaises(TypeError, _CFuncPtr.from_param, 42) + self.assertRaises(TypeError, _Pointer.from_param, 42) + self.assertRaises(TypeError, _SimpleCData.from_param, 42) + + @test.support.cpython_only + def test_issue31311(self): + # __setstate__ should neither raise a SystemError nor crash in case + # of a bad __dict__. + from ctypes import Structure + + class BadStruct(Structure): + @property + def __dict__(self): + pass + with self.assertRaises(TypeError): + BadStruct().__setstate__({}, b'foo') + + class WorseStruct(Structure): + @property + def __dict__(self): + 1/0 + with self.assertRaises(ZeroDivisionError): + WorseStruct().__setstate__({}, b'foo') + + def test_parameter_repr(self): + from ctypes import ( + c_bool, + c_char, + c_wchar, + c_byte, + c_ubyte, + c_short, + c_ushort, + c_int, + c_uint, + c_long, + c_ulong, + c_longlong, + c_ulonglong, + c_float, + c_double, + c_longdouble, + c_char_p, + c_wchar_p, + c_void_p, + ) + self.assertRegex(repr(c_bool.from_param(True)), r"^$") + self.assertEqual(repr(c_char.from_param(97)), "") + self.assertRegex(repr(c_wchar.from_param('a')), r"^$") + self.assertEqual(repr(c_byte.from_param(98)), "") + self.assertEqual(repr(c_ubyte.from_param(98)), "") + self.assertEqual(repr(c_short.from_param(511)), "") + self.assertEqual(repr(c_ushort.from_param(511)), "") + self.assertRegex(repr(c_int.from_param(20000)), r"^$") + self.assertRegex(repr(c_uint.from_param(20000)), r"^$") + self.assertRegex(repr(c_long.from_param(20000)), r"^$") + self.assertRegex(repr(c_ulong.from_param(20000)), r"^$") + self.assertRegex(repr(c_longlong.from_param(20000)), r"^$") + self.assertRegex(repr(c_ulonglong.from_param(20000)), r"^$") + self.assertEqual(repr(c_float.from_param(1.5)), "") + self.assertEqual(repr(c_double.from_param(1.5)), "") + self.assertEqual(repr(c_double.from_param(1e300)), "") + self.assertRegex(repr(c_longdouble.from_param(1.5)), r"^$") + self.assertRegex(repr(c_char_p.from_param(b'hihi')), r"^$") + self.assertRegex(repr(c_wchar_p.from_param('hihi')), r"^$") + self.assertRegex(repr(c_void_p.from_param(0x12)), r"^$") + + @test.support.cpython_only + def test_from_param_result_refcount(self): + # Issue #99952 + import _ctypes_test + from ctypes import PyDLL, c_int, c_void_p, py_object, Structure + + class X(Structure): + """This struct size is <= sizeof(void*).""" + _fields_ = [("a", c_void_p)] + + def __del__(self): + trace.append(4) + + @classmethod + def from_param(cls, value): + trace.append(2) + return cls() + + PyList_Append = PyDLL(_ctypes_test.__file__)._testfunc_pylist_append + PyList_Append.restype = c_int + PyList_Append.argtypes = [py_object, py_object, X] + + trace = [] + trace.append(1) + PyList_Append(trace, 3, "dummy") + trace.append(5) + + self.assertEqual(trace, [1, 2, 3, 4, 5]) + + class Y(Structure): + """This struct size is > sizeof(void*).""" + _fields_ = [("a", c_void_p), ("b", c_void_p)] + + def __del__(self): + trace.append(4) + + @classmethod + def from_param(cls, value): + trace.append(2) + return cls() + + PyList_Append = PyDLL(_ctypes_test.__file__)._testfunc_pylist_append + PyList_Append.restype = c_int + PyList_Append.argtypes = [py_object, py_object, Y] + + trace = [] + trace.append(1) + PyList_Append(trace, 3, "dummy") + trace.append(5) + + self.assertEqual(trace, [1, 2, 3, 4, 5]) + +################################################################ + +if __name__ == '__main__': + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_pep3118.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_pep3118.py new file mode 100644 index 0000000000000000000000000000000000000000..efffc80a66fcb8c3849d5759f49f3b25657d043a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_pep3118.py @@ -0,0 +1,235 @@ +import unittest +from ctypes import * +import re, sys + +if sys.byteorder == "little": + THIS_ENDIAN = "<" + OTHER_ENDIAN = ">" +else: + THIS_ENDIAN = ">" + OTHER_ENDIAN = "<" + +def normalize(format): + # Remove current endian specifier and white space from a format + # string + if format is None: + return "" + format = format.replace(OTHER_ENDIAN, THIS_ENDIAN) + return re.sub(r"\s", "", format) + +class Test(unittest.TestCase): + + def test_native_types(self): + for tp, fmt, shape, itemtp in native_types: + ob = tp() + v = memoryview(ob) + try: + self.assertEqual(normalize(v.format), normalize(fmt)) + if shape: + self.assertEqual(len(v), shape[0]) + else: + self.assertEqual(len(v) * sizeof(itemtp), sizeof(ob)) + self.assertEqual(v.itemsize, sizeof(itemtp)) + self.assertEqual(v.shape, shape) + # XXX Issue #12851: PyCData_NewGetBuffer() must provide strides + # if requested. memoryview currently reconstructs missing + # stride information, so this assert will fail. + # self.assertEqual(v.strides, ()) + + # they are always read/write + self.assertFalse(v.readonly) + + if v.shape: + n = 1 + for dim in v.shape: + n = n * dim + self.assertEqual(n * v.itemsize, len(v.tobytes())) + except: + # so that we can see the failing type + print(tp) + raise + + def test_endian_types(self): + for tp, fmt, shape, itemtp in endian_types: + ob = tp() + v = memoryview(ob) + try: + self.assertEqual(v.format, fmt) + if shape: + self.assertEqual(len(v), shape[0]) + else: + self.assertEqual(len(v) * sizeof(itemtp), sizeof(ob)) + self.assertEqual(v.itemsize, sizeof(itemtp)) + self.assertEqual(v.shape, shape) + # XXX Issue #12851 + # self.assertEqual(v.strides, ()) + + # they are always read/write + self.assertFalse(v.readonly) + + if v.shape: + n = 1 + for dim in v.shape: + n = n * dim + self.assertEqual(n, len(v)) + except: + # so that we can see the failing type + print(tp) + raise + +# define some structure classes + +class Point(Structure): + _fields_ = [("x", c_long), ("y", c_long)] + +class PackedPoint(Structure): + _pack_ = 2 + _fields_ = [("x", c_long), ("y", c_long)] + +class Point2(Structure): + pass +Point2._fields_ = [("x", c_long), ("y", c_long)] + +class EmptyStruct(Structure): + _fields_ = [] + +class aUnion(Union): + _fields_ = [("a", c_int)] + +class StructWithArrays(Structure): + _fields_ = [("x", c_long * 3 * 2), ("y", Point * 4)] + +class Incomplete(Structure): + pass + +class Complete(Structure): + pass +PComplete = POINTER(Complete) +Complete._fields_ = [("a", c_long)] + +################################################################ +# +# This table contains format strings as they look on little endian +# machines. The test replaces '<' with '>' on big endian machines. +# + +# Platform-specific type codes +s_bool = {1: '?', 2: 'H', 4: 'L', 8: 'Q'}[sizeof(c_bool)] +s_short = {2: 'h', 4: 'l', 8: 'q'}[sizeof(c_short)] +s_ushort = {2: 'H', 4: 'L', 8: 'Q'}[sizeof(c_ushort)] +s_int = {2: 'h', 4: 'i', 8: 'q'}[sizeof(c_int)] +s_uint = {2: 'H', 4: 'I', 8: 'Q'}[sizeof(c_uint)] +s_long = {4: 'l', 8: 'q'}[sizeof(c_long)] +s_ulong = {4: 'L', 8: 'Q'}[sizeof(c_ulong)] +s_longlong = "q" +s_ulonglong = "Q" +s_float = "f" +s_double = "d" +s_longdouble = "g" + +# Alias definitions in ctypes/__init__.py +if c_int is c_long: + s_int = s_long +if c_uint is c_ulong: + s_uint = s_ulong +if c_longlong is c_long: + s_longlong = s_long +if c_ulonglong is c_ulong: + s_ulonglong = s_ulong +if c_longdouble is c_double: + s_longdouble = s_double + + +native_types = [ + # type format shape calc itemsize + + ## simple types + + (c_char, "l:x:>l:y:}".replace('l', s_long), (), BEPoint), + (LEPoint, "T{l:x:>l:y:}".replace('l', s_long), (), POINTER(BEPoint)), + (POINTER(LEPoint), "&T{= 0: + return a + # View the bits in `a` as unsigned instead. + import struct + num_bits = struct.calcsize("P") * 8 # num bits in native machine address + a += 1 << num_bits + assert a >= 0 + return a + +def c_wbuffer(init): + n = len(init) + 1 + return (c_wchar * n)(*init) + +class CharPointersTestCase(unittest.TestCase): + + def setUp(self): + func = testdll._testfunc_p_p + func.restype = c_long + func.argtypes = None + + def test_paramflags(self): + # function returns c_void_p result, + # and has a required parameter named 'input' + prototype = CFUNCTYPE(c_void_p, c_void_p) + func = prototype(("_testfunc_p_p", testdll), + ((1, "input"),)) + + try: + func() + except TypeError as details: + self.assertEqual(str(details), "required argument 'input' missing") + else: + self.fail("TypeError not raised") + + self.assertEqual(func(None), None) + self.assertEqual(func(input=None), None) + + + def test_int_pointer_arg(self): + func = testdll._testfunc_p_p + if sizeof(c_longlong) == sizeof(c_void_p): + func.restype = c_longlong + else: + func.restype = c_long + self.assertEqual(0, func(0)) + + ci = c_int(0) + + func.argtypes = POINTER(c_int), + self.assertEqual(positive_address(addressof(ci)), + positive_address(func(byref(ci)))) + + func.argtypes = c_char_p, + self.assertRaises(ArgumentError, func, byref(ci)) + + func.argtypes = POINTER(c_short), + self.assertRaises(ArgumentError, func, byref(ci)) + + func.argtypes = POINTER(c_double), + self.assertRaises(ArgumentError, func, byref(ci)) + + def test_POINTER_c_char_arg(self): + func = testdll._testfunc_p_p + func.restype = c_char_p + func.argtypes = POINTER(c_char), + + self.assertEqual(None, func(None)) + self.assertEqual(b"123", func(b"123")) + self.assertEqual(None, func(c_char_p(None))) + self.assertEqual(b"123", func(c_char_p(b"123"))) + + self.assertEqual(b"123", func(c_buffer(b"123"))) + ca = c_char(b"a") + self.assertEqual(ord(b"a"), func(pointer(ca))[0]) + self.assertEqual(ord(b"a"), func(byref(ca))[0]) + + def test_c_char_p_arg(self): + func = testdll._testfunc_p_p + func.restype = c_char_p + func.argtypes = c_char_p, + + self.assertEqual(None, func(None)) + self.assertEqual(b"123", func(b"123")) + self.assertEqual(None, func(c_char_p(None))) + self.assertEqual(b"123", func(c_char_p(b"123"))) + + self.assertEqual(b"123", func(c_buffer(b"123"))) + ca = c_char(b"a") + self.assertEqual(ord(b"a"), func(pointer(ca))[0]) + self.assertEqual(ord(b"a"), func(byref(ca))[0]) + + def test_c_void_p_arg(self): + func = testdll._testfunc_p_p + func.restype = c_char_p + func.argtypes = c_void_p, + + self.assertEqual(None, func(None)) + self.assertEqual(b"123", func(b"123")) + self.assertEqual(b"123", func(c_char_p(b"123"))) + self.assertEqual(None, func(c_char_p(None))) + + self.assertEqual(b"123", func(c_buffer(b"123"))) + ca = c_char(b"a") + self.assertEqual(ord(b"a"), func(pointer(ca))[0]) + self.assertEqual(ord(b"a"), func(byref(ca))[0]) + + func(byref(c_int())) + func(pointer(c_int())) + func((c_int * 3)()) + + @need_symbol('c_wchar_p') + def test_c_void_p_arg_with_c_wchar_p(self): + func = testdll._testfunc_p_p + func.restype = c_wchar_p + func.argtypes = c_void_p, + + self.assertEqual(None, func(c_wchar_p(None))) + self.assertEqual("123", func(c_wchar_p("123"))) + + def test_instance(self): + func = testdll._testfunc_p_p + func.restype = c_void_p + + class X: + _as_parameter_ = None + + func.argtypes = c_void_p, + self.assertEqual(None, func(X())) + + func.argtypes = None + self.assertEqual(None, func(X())) + +@need_symbol('c_wchar') +class WCharPointersTestCase(unittest.TestCase): + + def setUp(self): + func = testdll._testfunc_p_p + func.restype = c_int + func.argtypes = None + + + def test_POINTER_c_wchar_arg(self): + func = testdll._testfunc_p_p + func.restype = c_wchar_p + func.argtypes = POINTER(c_wchar), + + self.assertEqual(None, func(None)) + self.assertEqual("123", func("123")) + self.assertEqual(None, func(c_wchar_p(None))) + self.assertEqual("123", func(c_wchar_p("123"))) + + self.assertEqual("123", func(c_wbuffer("123"))) + ca = c_wchar("a") + self.assertEqual("a", func(pointer(ca))[0]) + self.assertEqual("a", func(byref(ca))[0]) + + def test_c_wchar_p_arg(self): + func = testdll._testfunc_p_p + func.restype = c_wchar_p + func.argtypes = c_wchar_p, + + c_wchar_p.from_param("123") + + self.assertEqual(None, func(None)) + self.assertEqual("123", func("123")) + self.assertEqual(None, func(c_wchar_p(None))) + self.assertEqual("123", func(c_wchar_p("123"))) + + # XXX Currently, these raise TypeErrors, although they shouldn't: + self.assertEqual("123", func(c_wbuffer("123"))) + ca = c_wchar("a") + self.assertEqual("a", func(pointer(ca))[0]) + self.assertEqual("a", func(byref(ca))[0]) + +class ArrayTest(unittest.TestCase): + def test(self): + func = testdll._testfunc_ai8 + func.restype = POINTER(c_int) + func.argtypes = c_int * 8, + + func((c_int * 8)(1, 2, 3, 4, 5, 6, 7, 8)) + + # This did crash before: + + def func(): pass + CFUNCTYPE(None, c_int * 3)(func) + +################################################################ + +if __name__ == '__main__': + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_python_api.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_python_api.py new file mode 100644 index 0000000000000000000000000000000000000000..49571f97bbe152675c87af0712d475579a523c92 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_python_api.py @@ -0,0 +1,85 @@ +from ctypes import * +import unittest +from test import support + +################################################################ +# This section should be moved into ctypes\__init__.py, when it's ready. + +from _ctypes import PyObj_FromPtr + +################################################################ + +from sys import getrefcount as grc + +class PythonAPITestCase(unittest.TestCase): + + def test_PyBytes_FromStringAndSize(self): + PyBytes_FromStringAndSize = pythonapi.PyBytes_FromStringAndSize + + PyBytes_FromStringAndSize.restype = py_object + PyBytes_FromStringAndSize.argtypes = c_char_p, c_size_t + + self.assertEqual(PyBytes_FromStringAndSize(b"abcdefghi", 3), b"abc") + + @support.refcount_test + def test_PyString_FromString(self): + pythonapi.PyBytes_FromString.restype = py_object + pythonapi.PyBytes_FromString.argtypes = (c_char_p,) + + s = b"abc" + refcnt = grc(s) + pyob = pythonapi.PyBytes_FromString(s) + self.assertEqual(grc(s), refcnt) + self.assertEqual(s, pyob) + del pyob + self.assertEqual(grc(s), refcnt) + + @support.refcount_test + def test_PyLong_Long(self): + ref42 = grc(42) + pythonapi.PyLong_FromLong.restype = py_object + self.assertEqual(pythonapi.PyLong_FromLong(42), 42) + + self.assertEqual(grc(42), ref42) + + pythonapi.PyLong_AsLong.argtypes = (py_object,) + pythonapi.PyLong_AsLong.restype = c_long + + res = pythonapi.PyLong_AsLong(42) + self.assertEqual(grc(res), ref42 + 1) + del res + self.assertEqual(grc(42), ref42) + + @support.refcount_test + def test_PyObj_FromPtr(self): + s = "abc def ghi jkl" + ref = grc(s) + # id(python-object) is the address + pyobj = PyObj_FromPtr(id(s)) + self.assertIs(s, pyobj) + + self.assertEqual(grc(s), ref + 1) + del pyobj + self.assertEqual(grc(s), ref) + + def test_PyOS_snprintf(self): + PyOS_snprintf = pythonapi.PyOS_snprintf + PyOS_snprintf.argtypes = POINTER(c_char), c_size_t, c_char_p + + buf = c_buffer(256) + PyOS_snprintf(buf, sizeof(buf), b"Hello from %s", b"ctypes") + self.assertEqual(buf.value, b"Hello from ctypes") + + PyOS_snprintf(buf, sizeof(buf), b"Hello from %s (%d, %d, %d)", b"ctypes", 1, 2, 3) + self.assertEqual(buf.value, b"Hello from ctypes (1, 2, 3)") + + # not enough arguments + self.assertRaises(TypeError, PyOS_snprintf, buf) + + def test_pyobject_repr(self): + self.assertEqual(repr(py_object()), "py_object()") + self.assertEqual(repr(py_object(42)), "py_object(42)") + self.assertEqual(repr(py_object(object)), "py_object(%r)" % object) + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_random_things.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_random_things.py new file mode 100644 index 0000000000000000000000000000000000000000..2988e275cf4bbf273c55d17ba231cbb9aeb1c173 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_random_things.py @@ -0,0 +1,77 @@ +from ctypes import * +import contextlib +from test import support +import unittest +import sys + + +def callback_func(arg): + 42 / arg + raise ValueError(arg) + +@unittest.skipUnless(sys.platform == "win32", 'Windows-specific test') +class call_function_TestCase(unittest.TestCase): + # _ctypes.call_function is deprecated and private, but used by + # Gary Bishp's readline module. If we have it, we must test it as well. + + def test(self): + from _ctypes import call_function + windll.kernel32.LoadLibraryA.restype = c_void_p + windll.kernel32.GetProcAddress.argtypes = c_void_p, c_char_p + windll.kernel32.GetProcAddress.restype = c_void_p + + hdll = windll.kernel32.LoadLibraryA(b"kernel32") + funcaddr = windll.kernel32.GetProcAddress(hdll, b"GetModuleHandleA") + + self.assertEqual(call_function(funcaddr, (None,)), + windll.kernel32.GetModuleHandleA(None)) + +class CallbackTracbackTestCase(unittest.TestCase): + # When an exception is raised in a ctypes callback function, the C + # code prints a traceback. + # + # This test makes sure the exception types *and* the exception + # value is printed correctly. + # + # Changed in 0.9.3: No longer is '(in callback)' prepended to the + # error message - instead an additional frame for the C code is + # created, then a full traceback printed. When SystemExit is + # raised in a callback function, the interpreter exits. + + @contextlib.contextmanager + def expect_unraisable(self, exc_type, exc_msg=None): + with support.catch_unraisable_exception() as cm: + yield + + self.assertIsInstance(cm.unraisable.exc_value, exc_type) + if exc_msg is not None: + self.assertEqual(str(cm.unraisable.exc_value), exc_msg) + self.assertEqual(cm.unraisable.err_msg, + "Exception ignored on calling ctypes " + "callback function") + self.assertIs(cm.unraisable.object, callback_func) + + def test_ValueError(self): + cb = CFUNCTYPE(c_int, c_int)(callback_func) + with self.expect_unraisable(ValueError, '42'): + cb(42) + + def test_IntegerDivisionError(self): + cb = CFUNCTYPE(c_int, c_int)(callback_func) + with self.expect_unraisable(ZeroDivisionError): + cb(0) + + def test_FloatDivisionError(self): + cb = CFUNCTYPE(c_int, c_double)(callback_func) + with self.expect_unraisable(ZeroDivisionError): + cb(0.0) + + def test_TypeErrorDivisionError(self): + cb = CFUNCTYPE(c_int, c_char_p)(callback_func) + err_msg = "unsupported operand type(s) for /: 'int' and 'bytes'" + with self.expect_unraisable(TypeError, err_msg): + cb(b"spam") + + +if __name__ == '__main__': + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_refcounts.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_refcounts.py new file mode 100644 index 0000000000000000000000000000000000000000..48958cd2a60196bd1f5e010883fe1e465cbe02d4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_refcounts.py @@ -0,0 +1,116 @@ +import unittest +from test import support +import ctypes +import gc + +MyCallback = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int) +OtherCallback = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, ctypes.c_ulonglong) + +import _ctypes_test +dll = ctypes.CDLL(_ctypes_test.__file__) + +class RefcountTestCase(unittest.TestCase): + + @support.refcount_test + def test_1(self): + from sys import getrefcount as grc + + f = dll._testfunc_callback_i_if + f.restype = ctypes.c_int + f.argtypes = [ctypes.c_int, MyCallback] + + def callback(value): + #print "called back with", value + return value + + self.assertEqual(grc(callback), 2) + cb = MyCallback(callback) + + self.assertGreater(grc(callback), 2) + result = f(-10, cb) + self.assertEqual(result, -18) + cb = None + + gc.collect() + + self.assertEqual(grc(callback), 2) + + + @support.refcount_test + def test_refcount(self): + from sys import getrefcount as grc + def func(*args): + pass + # this is the standard refcount for func + self.assertEqual(grc(func), 2) + + # the CFuncPtr instance holds at least one refcount on func: + f = OtherCallback(func) + self.assertGreater(grc(func), 2) + + # and may release it again + del f + self.assertGreaterEqual(grc(func), 2) + + # but now it must be gone + gc.collect() + self.assertEqual(grc(func), 2) + + class X(ctypes.Structure): + _fields_ = [("a", OtherCallback)] + x = X() + x.a = OtherCallback(func) + + # the CFuncPtr instance holds at least one refcount on func: + self.assertGreater(grc(func), 2) + + # and may release it again + del x + self.assertGreaterEqual(grc(func), 2) + + # and now it must be gone again + gc.collect() + self.assertEqual(grc(func), 2) + + f = OtherCallback(func) + + # the CFuncPtr instance holds at least one refcount on func: + self.assertGreater(grc(func), 2) + + # create a cycle + f.cycle = f + + del f + gc.collect() + self.assertEqual(grc(func), 2) + +class AnotherLeak(unittest.TestCase): + def test_callback(self): + import sys + + proto = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, ctypes.c_int) + def func(a, b): + return a * b * 2 + f = proto(func) + + a = sys.getrefcount(ctypes.c_int) + f(1, 2) + self.assertEqual(sys.getrefcount(ctypes.c_int), a) + + @support.refcount_test + def test_callback_py_object_none_return(self): + # bpo-36880: test that returning None from a py_object callback + # does not decrement the refcount of None. + + for FUNCTYPE in (ctypes.CFUNCTYPE, ctypes.PYFUNCTYPE): + with self.subTest(FUNCTYPE=FUNCTYPE): + @FUNCTYPE(ctypes.py_object) + def func(): + return None + + # Check that calling func does not affect None's refcount. + for _ in range(10000): + func() + +if __name__ == '__main__': + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_repr.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_repr.py new file mode 100644 index 0000000000000000000000000000000000000000..60a2c803453d5330a0d4d5833770f383c61df466 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ctypes/test/test_repr.py @@ -0,0 +1,29 @@ +from ctypes import * +import unittest + +subclasses = [] +for base in [c_byte, c_short, c_int, c_long, c_longlong, + c_ubyte, c_ushort, c_uint, c_ulong, c_ulonglong, + c_float, c_double, c_longdouble, c_bool]: + class X(base): + pass + subclasses.append(X) + +class X(c_char): + pass + +# This test checks if the __repr__ is correct for subclasses of simple types + +class ReprTest(unittest.TestCase): + def test_numbers(self): + for typ in subclasses: + base = typ.__bases__[0] + self.assertTrue(repr(base(42)).startswith(base.__name__)) + self.assertEqual("> 24, (sys.hexversion >> 16) & 0xff)) + # don't extend ext.libraries, it may be shared with other + # extensions, it is a reference to the original list + return ext.libraries + [pythonlib] + else: + # On Android only the main executable and LD_PRELOADs are considered + # to be RTLD_GLOBAL, all the dependencies of the main executable + # remain RTLD_LOCAL and so the shared libraries must be linked with + # libpython when python is built with a shared python library (issue + # bpo-21536). + # On Cygwin (and if required, other POSIX-like platforms based on + # Windows like MinGW) it is simply necessary that all symbols in + # shared libraries are resolved at link time. + from distutils.sysconfig import get_config_var + link_libpython = False + if get_config_var('Py_ENABLE_SHARED'): + # A native build on an Android device or on Cygwin + if hasattr(sys, 'getandroidapilevel'): + link_libpython = True + elif sys.platform == 'cygwin': + link_libpython = True + elif '_PYTHON_HOST_PLATFORM' in os.environ: + # We are cross-compiling for one of the relevant platforms + if get_config_var('ANDROID_API_LEVEL') != 0: + link_libpython = True + elif get_config_var('MACHDEP') == 'cygwin': + link_libpython = True + + if link_libpython: + ldversion = get_config_var('LDVERSION') + return ext.libraries + ['python' + ldversion] + + return ext.libraries diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/build_py.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/build_py.py new file mode 100644 index 0000000000000000000000000000000000000000..edc2171cd122dda26a96a2770d2cfa69ccab417b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/build_py.py @@ -0,0 +1,416 @@ +"""distutils.command.build_py + +Implements the Distutils 'build_py' command.""" + +import os +import importlib.util +import sys +import glob + +from distutils.core import Command +from distutils.errors import * +from distutils.util import convert_path, Mixin2to3 +from distutils import log + +class build_py (Command): + + description = "\"build\" pure Python modules (copy to build directory)" + + user_options = [ + ('build-lib=', 'd', "directory to \"build\" (copy) to"), + ('compile', 'c', "compile .py to .pyc"), + ('no-compile', None, "don't compile .py files [default]"), + ('optimize=', 'O', + "also compile with optimization: -O1 for \"python -O\", " + "-O2 for \"python -OO\", and -O0 to disable [default: -O0]"), + ('force', 'f', "forcibly build everything (ignore file timestamps)"), + ] + + boolean_options = ['compile', 'force'] + negative_opt = {'no-compile' : 'compile'} + + def initialize_options(self): + self.build_lib = None + self.py_modules = None + self.package = None + self.package_data = None + self.package_dir = None + self.compile = 0 + self.optimize = 0 + self.force = None + + def finalize_options(self): + self.set_undefined_options('build', + ('build_lib', 'build_lib'), + ('force', 'force')) + + # Get the distribution options that are aliases for build_py + # options -- list of packages and list of modules. + self.packages = self.distribution.packages + self.py_modules = self.distribution.py_modules + self.package_data = self.distribution.package_data + self.package_dir = {} + if self.distribution.package_dir: + for name, path in self.distribution.package_dir.items(): + self.package_dir[name] = convert_path(path) + self.data_files = self.get_data_files() + + # Ick, copied straight from install_lib.py (fancy_getopt needs a + # type system! Hell, *everything* needs a type system!!!) + if not isinstance(self.optimize, int): + try: + self.optimize = int(self.optimize) + assert 0 <= self.optimize <= 2 + except (ValueError, AssertionError): + raise DistutilsOptionError("optimize must be 0, 1, or 2") + + def run(self): + # XXX copy_file by default preserves atime and mtime. IMHO this is + # the right thing to do, but perhaps it should be an option -- in + # particular, a site administrator might want installed files to + # reflect the time of installation rather than the last + # modification time before the installed release. + + # XXX copy_file by default preserves mode, which appears to be the + # wrong thing to do: if a file is read-only in the working + # directory, we want it to be installed read/write so that the next + # installation of the same module distribution can overwrite it + # without problems. (This might be a Unix-specific issue.) Thus + # we turn off 'preserve_mode' when copying to the build directory, + # since the build directory is supposed to be exactly what the + # installation will look like (ie. we preserve mode when + # installing). + + # Two options control which modules will be installed: 'packages' + # and 'py_modules'. The former lets us work with whole packages, not + # specifying individual modules at all; the latter is for + # specifying modules one-at-a-time. + + if self.py_modules: + self.build_modules() + if self.packages: + self.build_packages() + self.build_package_data() + + self.byte_compile(self.get_outputs(include_bytecode=0)) + + def get_data_files(self): + """Generate list of '(package,src_dir,build_dir,filenames)' tuples""" + data = [] + if not self.packages: + return data + for package in self.packages: + # Locate package source directory + src_dir = self.get_package_dir(package) + + # Compute package build directory + build_dir = os.path.join(*([self.build_lib] + package.split('.'))) + + # Length of path to strip from found files + plen = 0 + if src_dir: + plen = len(src_dir)+1 + + # Strip directory from globbed filenames + filenames = [ + file[plen:] for file in self.find_data_files(package, src_dir) + ] + data.append((package, src_dir, build_dir, filenames)) + return data + + def find_data_files(self, package, src_dir): + """Return filenames for package's data files in 'src_dir'""" + globs = (self.package_data.get('', []) + + self.package_data.get(package, [])) + files = [] + for pattern in globs: + # Each pattern has to be converted to a platform-specific path + filelist = glob.glob(os.path.join(glob.escape(src_dir), convert_path(pattern))) + # Files that match more than one pattern are only added once + files.extend([fn for fn in filelist if fn not in files + and os.path.isfile(fn)]) + return files + + def build_package_data(self): + """Copy data files into build directory""" + lastdir = None + for package, src_dir, build_dir, filenames in self.data_files: + for filename in filenames: + target = os.path.join(build_dir, filename) + self.mkpath(os.path.dirname(target)) + self.copy_file(os.path.join(src_dir, filename), target, + preserve_mode=False) + + def get_package_dir(self, package): + """Return the directory, relative to the top of the source + distribution, where package 'package' should be found + (at least according to the 'package_dir' option, if any).""" + path = package.split('.') + + if not self.package_dir: + if path: + return os.path.join(*path) + else: + return '' + else: + tail = [] + while path: + try: + pdir = self.package_dir['.'.join(path)] + except KeyError: + tail.insert(0, path[-1]) + del path[-1] + else: + tail.insert(0, pdir) + return os.path.join(*tail) + else: + # Oops, got all the way through 'path' without finding a + # match in package_dir. If package_dir defines a directory + # for the root (nameless) package, then fallback on it; + # otherwise, we might as well have not consulted + # package_dir at all, as we just use the directory implied + # by 'tail' (which should be the same as the original value + # of 'path' at this point). + pdir = self.package_dir.get('') + if pdir is not None: + tail.insert(0, pdir) + + if tail: + return os.path.join(*tail) + else: + return '' + + def check_package(self, package, package_dir): + # Empty dir name means current directory, which we can probably + # assume exists. Also, os.path.exists and isdir don't know about + # my "empty string means current dir" convention, so we have to + # circumvent them. + if package_dir != "": + if not os.path.exists(package_dir): + raise DistutilsFileError( + "package directory '%s' does not exist" % package_dir) + if not os.path.isdir(package_dir): + raise DistutilsFileError( + "supposed package directory '%s' exists, " + "but is not a directory" % package_dir) + + # Require __init__.py for all but the "root package" + if package: + init_py = os.path.join(package_dir, "__init__.py") + if os.path.isfile(init_py): + return init_py + else: + log.warn(("package init file '%s' not found " + + "(or not a regular file)"), init_py) + + # Either not in a package at all (__init__.py not expected), or + # __init__.py doesn't exist -- so don't return the filename. + return None + + def check_module(self, module, module_file): + if not os.path.isfile(module_file): + log.warn("file %s (for module %s) not found", module_file, module) + return False + else: + return True + + def find_package_modules(self, package, package_dir): + self.check_package(package, package_dir) + module_files = glob.glob(os.path.join(glob.escape(package_dir), "*.py")) + modules = [] + setup_script = os.path.abspath(self.distribution.script_name) + + for f in module_files: + abs_f = os.path.abspath(f) + if abs_f != setup_script: + module = os.path.splitext(os.path.basename(f))[0] + modules.append((package, module, f)) + else: + self.debug_print("excluding %s" % setup_script) + return modules + + def find_modules(self): + """Finds individually-specified Python modules, ie. those listed by + module name in 'self.py_modules'. Returns a list of tuples (package, + module_base, filename): 'package' is a tuple of the path through + package-space to the module; 'module_base' is the bare (no + packages, no dots) module name, and 'filename' is the path to the + ".py" file (relative to the distribution root) that implements the + module. + """ + # Map package names to tuples of useful info about the package: + # (package_dir, checked) + # package_dir - the directory where we'll find source files for + # this package + # checked - true if we have checked that the package directory + # is valid (exists, contains __init__.py, ... ?) + packages = {} + + # List of (package, module, filename) tuples to return + modules = [] + + # We treat modules-in-packages almost the same as toplevel modules, + # just the "package" for a toplevel is empty (either an empty + # string or empty list, depending on context). Differences: + # - don't check for __init__.py in directory for empty package + for module in self.py_modules: + path = module.split('.') + package = '.'.join(path[0:-1]) + module_base = path[-1] + + try: + (package_dir, checked) = packages[package] + except KeyError: + package_dir = self.get_package_dir(package) + checked = 0 + + if not checked: + init_py = self.check_package(package, package_dir) + packages[package] = (package_dir, 1) + if init_py: + modules.append((package, "__init__", init_py)) + + # XXX perhaps we should also check for just .pyc files + # (so greedy closed-source bastards can distribute Python + # modules too) + module_file = os.path.join(package_dir, module_base + ".py") + if not self.check_module(module, module_file): + continue + + modules.append((package, module_base, module_file)) + + return modules + + def find_all_modules(self): + """Compute the list of all modules that will be built, whether + they are specified one-module-at-a-time ('self.py_modules') or + by whole packages ('self.packages'). Return a list of tuples + (package, module, module_file), just like 'find_modules()' and + 'find_package_modules()' do.""" + modules = [] + if self.py_modules: + modules.extend(self.find_modules()) + if self.packages: + for package in self.packages: + package_dir = self.get_package_dir(package) + m = self.find_package_modules(package, package_dir) + modules.extend(m) + return modules + + def get_source_files(self): + return [module[-1] for module in self.find_all_modules()] + + def get_module_outfile(self, build_dir, package, module): + outfile_path = [build_dir] + list(package) + [module + ".py"] + return os.path.join(*outfile_path) + + def get_outputs(self, include_bytecode=1): + modules = self.find_all_modules() + outputs = [] + for (package, module, module_file) in modules: + package = package.split('.') + filename = self.get_module_outfile(self.build_lib, package, module) + outputs.append(filename) + if include_bytecode: + if self.compile: + outputs.append(importlib.util.cache_from_source( + filename, optimization='')) + if self.optimize > 0: + outputs.append(importlib.util.cache_from_source( + filename, optimization=self.optimize)) + + outputs += [ + os.path.join(build_dir, filename) + for package, src_dir, build_dir, filenames in self.data_files + for filename in filenames + ] + + return outputs + + def build_module(self, module, module_file, package): + if isinstance(package, str): + package = package.split('.') + elif not isinstance(package, (list, tuple)): + raise TypeError( + "'package' must be a string (dot-separated), list, or tuple") + + # Now put the module source file into the "build" area -- this is + # easy, we just copy it somewhere under self.build_lib (the build + # directory for Python source). + outfile = self.get_module_outfile(self.build_lib, package, module) + dir = os.path.dirname(outfile) + self.mkpath(dir) + return self.copy_file(module_file, outfile, preserve_mode=0) + + def build_modules(self): + modules = self.find_modules() + for (package, module, module_file) in modules: + # Now "build" the module -- ie. copy the source file to + # self.build_lib (the build directory for Python source). + # (Actually, it gets copied to the directory for this package + # under self.build_lib.) + self.build_module(module, module_file, package) + + def build_packages(self): + for package in self.packages: + # Get list of (package, module, module_file) tuples based on + # scanning the package directory. 'package' is only included + # in the tuple so that 'find_modules()' and + # 'find_package_tuples()' have a consistent interface; it's + # ignored here (apart from a sanity check). Also, 'module' is + # the *unqualified* module name (ie. no dots, no package -- we + # already know its package!), and 'module_file' is the path to + # the .py file, relative to the current directory + # (ie. including 'package_dir'). + package_dir = self.get_package_dir(package) + modules = self.find_package_modules(package, package_dir) + + # Now loop over the modules we found, "building" each one (just + # copy it to self.build_lib). + for (package_, module, module_file) in modules: + assert package == package_ + self.build_module(module, module_file, package) + + def byte_compile(self, files): + if sys.dont_write_bytecode: + self.warn('byte-compiling is disabled, skipping.') + return + + from distutils.util import byte_compile + prefix = self.build_lib + if prefix[-1] != os.sep: + prefix = prefix + os.sep + + # XXX this code is essentially the same as the 'byte_compile() + # method of the "install_lib" command, except for the determination + # of the 'prefix' string. Hmmm. + if self.compile: + byte_compile(files, optimize=0, + force=self.force, prefix=prefix, dry_run=self.dry_run) + if self.optimize > 0: + byte_compile(files, optimize=self.optimize, + force=self.force, prefix=prefix, dry_run=self.dry_run) + +class build_py_2to3(build_py, Mixin2to3): + def run(self): + self.updated_files = [] + + # Base class code + if self.py_modules: + self.build_modules() + if self.packages: + self.build_packages() + self.build_package_data() + + # 2to3 + self.run_2to3(self.updated_files) + + # Remaining base class code + self.byte_compile(self.get_outputs(include_bytecode=0)) + + def build_module(self, module, module_file, package): + res = build_py.build_module(self, module, module_file, package) + if res[1]: + # file was copied + self.updated_files.append(res[0]) + return res diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/build_scripts.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/build_scripts.py new file mode 100644 index 0000000000000000000000000000000000000000..ccc70e6465016ef2bbde845ea7eb99b6078eb9d8 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/build_scripts.py @@ -0,0 +1,160 @@ +"""distutils.command.build_scripts + +Implements the Distutils 'build_scripts' command.""" + +import os, re +from stat import ST_MODE +from distutils import sysconfig +from distutils.core import Command +from distutils.dep_util import newer +from distutils.util import convert_path, Mixin2to3 +from distutils import log +import tokenize + +# check if Python is called on the first line with this expression +first_line_re = re.compile(b'^#!.*python[0-9.]*([ \t].*)?$') + +class build_scripts(Command): + + description = "\"build\" scripts (copy and fixup #! line)" + + user_options = [ + ('build-dir=', 'd', "directory to \"build\" (copy) to"), + ('force', 'f', "forcibly build everything (ignore file timestamps"), + ('executable=', 'e', "specify final destination interpreter path"), + ] + + boolean_options = ['force'] + + + def initialize_options(self): + self.build_dir = None + self.scripts = None + self.force = None + self.executable = None + self.outfiles = None + + def finalize_options(self): + self.set_undefined_options('build', + ('build_scripts', 'build_dir'), + ('force', 'force'), + ('executable', 'executable')) + self.scripts = self.distribution.scripts + + def get_source_files(self): + return self.scripts + + def run(self): + if not self.scripts: + return + self.copy_scripts() + + + def copy_scripts(self): + r"""Copy each script listed in 'self.scripts'; if it's marked as a + Python script in the Unix way (first line matches 'first_line_re', + ie. starts with "\#!" and contains "python"), then adjust the first + line to refer to the current Python interpreter as we copy. + """ + self.mkpath(self.build_dir) + outfiles = [] + updated_files = [] + for script in self.scripts: + adjust = False + script = convert_path(script) + outfile = os.path.join(self.build_dir, os.path.basename(script)) + outfiles.append(outfile) + + if not self.force and not newer(script, outfile): + log.debug("not copying %s (up-to-date)", script) + continue + + # Always open the file, but ignore failures in dry-run mode -- + # that way, we'll get accurate feedback if we can read the + # script. + try: + f = open(script, "rb") + except OSError: + if not self.dry_run: + raise + f = None + else: + encoding, lines = tokenize.detect_encoding(f.readline) + f.seek(0) + first_line = f.readline() + if not first_line: + self.warn("%s is an empty file (skipping)" % script) + continue + + match = first_line_re.match(first_line) + if match: + adjust = True + post_interp = match.group(1) or b'' + + if adjust: + log.info("copying and adjusting %s -> %s", script, + self.build_dir) + updated_files.append(outfile) + if not self.dry_run: + if not sysconfig.python_build: + executable = self.executable + else: + executable = os.path.join( + sysconfig.get_config_var("BINDIR"), + "python%s%s" % (sysconfig.get_config_var("VERSION"), + sysconfig.get_config_var("EXE"))) + executable = os.fsencode(executable) + shebang = b"#!" + executable + post_interp + b"\n" + # Python parser starts to read a script using UTF-8 until + # it gets a #coding:xxx cookie. The shebang has to be the + # first line of a file, the #coding:xxx cookie cannot be + # written before. So the shebang has to be decodable from + # UTF-8. + try: + shebang.decode('utf-8') + except UnicodeDecodeError: + raise ValueError( + "The shebang ({!r}) is not decodable " + "from utf-8".format(shebang)) + # If the script is encoded to a custom encoding (use a + # #coding:xxx cookie), the shebang has to be decodable from + # the script encoding too. + try: + shebang.decode(encoding) + except UnicodeDecodeError: + raise ValueError( + "The shebang ({!r}) is not decodable " + "from the script encoding ({})" + .format(shebang, encoding)) + with open(outfile, "wb") as outf: + outf.write(shebang) + outf.writelines(f.readlines()) + if f: + f.close() + else: + if f: + f.close() + updated_files.append(outfile) + self.copy_file(script, outfile) + + if os.name == 'posix': + for file in outfiles: + if self.dry_run: + log.info("changing mode of %s", file) + else: + oldmode = os.stat(file)[ST_MODE] & 0o7777 + newmode = (oldmode | 0o555) & 0o7777 + if newmode != oldmode: + log.info("changing mode of %s from %o to %o", + file, oldmode, newmode) + os.chmod(file, newmode) + # XXX should we modify self.outfiles? + return outfiles, updated_files + +class build_scripts_2to3(build_scripts, Mixin2to3): + + def copy_scripts(self): + outfiles, updated_files = build_scripts.copy_scripts(self) + if not self.dry_run: + self.run_2to3(updated_files) + return outfiles, updated_files diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/check.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/check.py new file mode 100644 index 0000000000000000000000000000000000000000..0a5976676a817ded7f97ae312fea43b028733cec --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/check.py @@ -0,0 +1,154 @@ +"""distutils.command.check + +Implements the Distutils 'check' command. +""" +from distutils.core import Command +from distutils.errors import DistutilsSetupError + +try: + # docutils is installed + from docutils.utils import Reporter + from docutils.parsers.rst import Parser + from docutils import frontend + from docutils import nodes + + class SilentReporter(Reporter): + + def __init__(self, source, report_level, halt_level, stream=None, + debug=0, encoding='ascii', error_handler='replace'): + self.messages = [] + Reporter.__init__(self, source, report_level, halt_level, stream, + debug, encoding, error_handler) + + def system_message(self, level, message, *children, **kwargs): + self.messages.append((level, message, children, kwargs)) + return nodes.system_message(message, level=level, + type=self.levels[level], + *children, **kwargs) + + HAS_DOCUTILS = True +except Exception: + # Catch all exceptions because exceptions besides ImportError probably + # indicate that docutils is not ported to Py3k. + HAS_DOCUTILS = False + +class check(Command): + """This command checks the meta-data of the package. + """ + description = ("perform some checks on the package") + user_options = [('metadata', 'm', 'Verify meta-data'), + ('restructuredtext', 'r', + ('Checks if long string meta-data syntax ' + 'are reStructuredText-compliant')), + ('strict', 's', + 'Will exit with an error if a check fails')] + + boolean_options = ['metadata', 'restructuredtext', 'strict'] + + def initialize_options(self): + """Sets default values for options.""" + self.restructuredtext = 0 + self.metadata = 1 + self.strict = 0 + self._warnings = 0 + + def finalize_options(self): + pass + + def warn(self, msg): + """Counts the number of warnings that occurs.""" + self._warnings += 1 + return Command.warn(self, msg) + + def run(self): + """Runs the command.""" + # perform the various tests + if self.metadata: + self.check_metadata() + if self.restructuredtext: + if HAS_DOCUTILS: + self.check_restructuredtext() + elif self.strict: + raise DistutilsSetupError('The docutils package is needed.') + + # let's raise an error in strict mode, if we have at least + # one warning + if self.strict and self._warnings > 0: + raise DistutilsSetupError('Please correct your package.') + + def check_metadata(self): + """Ensures that all required elements of meta-data are supplied. + + Required fields: + name, version, URL + + Recommended fields: + (author and author_email) or (maintainer and maintainer_email) + + Warns if any are missing. + """ + metadata = self.distribution.metadata + + missing = [] + for attr in ('name', 'version', 'url'): + if not (hasattr(metadata, attr) and getattr(metadata, attr)): + missing.append(attr) + + if missing: + self.warn("missing required meta-data: %s" % ', '.join(missing)) + if metadata.author: + if not metadata.author_email: + self.warn("missing meta-data: if 'author' supplied, " + + "'author_email' should be supplied too") + elif metadata.maintainer: + if not metadata.maintainer_email: + self.warn("missing meta-data: if 'maintainer' supplied, " + + "'maintainer_email' should be supplied too") + else: + self.warn("missing meta-data: either (author and author_email) " + + "or (maintainer and maintainer_email) " + + "should be supplied") + + def check_restructuredtext(self): + """Checks if the long string fields are reST-compliant.""" + data = self.distribution.get_long_description() + for warning in self._check_rst_data(data): + line = warning[-1].get('line') + if line is None: + warning = warning[1] + else: + warning = '%s (line %s)' % (warning[1], line) + self.warn(warning) + + def _check_rst_data(self, data): + """Returns warnings when the provided data doesn't compile.""" + # the include and csv_table directives need this to be a path + source_path = self.distribution.script_name or 'setup.py' + parser = Parser() + try: + get_default_settings = frontend.get_default_settings + except AttributeError: + # Deprecated in Docutils 0.19, may be broken in Docutils 0.21. + settings = frontend.OptionParser(components=(Parser,)).get_default_values() + else: + settings = get_default_settings(Parser) + settings.tab_width = 4 + settings.pep_references = None + settings.rfc_references = None + reporter = SilentReporter(source_path, + settings.report_level, + settings.halt_level, + stream=settings.warning_stream, + debug=settings.debug, + encoding=settings.error_encoding, + error_handler=settings.error_encoding_error_handler) + + document = nodes.document(settings, reporter, source=source_path) + document.note_source(source_path, -1) + try: + parser.parse(data, document) + except AttributeError as e: + reporter.messages.append( + (-1, 'Could not finish the parsing: %s.' % e, '', {})) + + return reporter.messages diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/clean.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/clean.py new file mode 100644 index 0000000000000000000000000000000000000000..0cb270166211fe2b24b6ec636f632a77a5ca6b8f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/clean.py @@ -0,0 +1,76 @@ +"""distutils.command.clean + +Implements the Distutils 'clean' command.""" + +# contributed by Bastian Kleineidam , added 2000-03-18 + +import os +from distutils.core import Command +from distutils.dir_util import remove_tree +from distutils import log + +class clean(Command): + + description = "clean up temporary files from 'build' command" + user_options = [ + ('build-base=', 'b', + "base build directory (default: 'build.build-base')"), + ('build-lib=', None, + "build directory for all modules (default: 'build.build-lib')"), + ('build-temp=', 't', + "temporary build directory (default: 'build.build-temp')"), + ('build-scripts=', None, + "build directory for scripts (default: 'build.build-scripts')"), + ('bdist-base=', None, + "temporary directory for built distributions"), + ('all', 'a', + "remove all build output, not just temporary by-products") + ] + + boolean_options = ['all'] + + def initialize_options(self): + self.build_base = None + self.build_lib = None + self.build_temp = None + self.build_scripts = None + self.bdist_base = None + self.all = None + + def finalize_options(self): + self.set_undefined_options('build', + ('build_base', 'build_base'), + ('build_lib', 'build_lib'), + ('build_scripts', 'build_scripts'), + ('build_temp', 'build_temp')) + self.set_undefined_options('bdist', + ('bdist_base', 'bdist_base')) + + def run(self): + # remove the build/temp. directory (unless it's already + # gone) + if os.path.exists(self.build_temp): + remove_tree(self.build_temp, dry_run=self.dry_run) + else: + log.debug("'%s' does not exist -- can't clean it", + self.build_temp) + + if self.all: + # remove build directories + for directory in (self.build_lib, + self.bdist_base, + self.build_scripts): + if os.path.exists(directory): + remove_tree(directory, dry_run=self.dry_run) + else: + log.warn("'%s' does not exist -- can't clean it", + directory) + + # just for the heck of it, try to remove the base build directory: + # we might have emptied it right now, but if not we don't care + if not self.dry_run: + try: + os.rmdir(self.build_base) + log.info("removing '%s'", self.build_base) + except OSError: + pass diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/command_template b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/command_template new file mode 100644 index 0000000000000000000000000000000000000000..6106819db843b5d93e85c4ee6929825d45c2f08a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/command_template @@ -0,0 +1,33 @@ +"""distutils.command.x + +Implements the Distutils 'x' command. +""" + +# created 2000/mm/dd, John Doe + +__revision__ = "$Id$" + +from distutils.core import Command + + +class x(Command): + + # Brief (40-50 characters) description of the command + description = "" + + # List of option tuples: long name, short name (None if no short + # name), and help string. + user_options = [('', '', + ""), + ] + + def initialize_options(self): + self. = None + self. = None + self. = None + + def finalize_options(self): + if self.x is None: + self.x = + + def run(self): diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/config.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/config.py new file mode 100644 index 0000000000000000000000000000000000000000..aeda408e731979bf5884e4830fed142a70bfb25e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/config.py @@ -0,0 +1,344 @@ +"""distutils.command.config + +Implements the Distutils 'config' command, a (mostly) empty command class +that exists mainly to be sub-classed by specific module distributions and +applications. The idea is that while every "config" command is different, +at least they're all named the same, and users always see "config" in the +list of standard commands. Also, this is a good place to put common +configure-like tasks: "try to compile this C code", or "figure out where +this header file lives". +""" + +import os, re + +from distutils.core import Command +from distutils.errors import DistutilsExecError +from distutils.sysconfig import customize_compiler +from distutils import log + +LANG_EXT = {"c": ".c", "c++": ".cxx"} + +class config(Command): + + description = "prepare to build" + + user_options = [ + ('compiler=', None, + "specify the compiler type"), + ('cc=', None, + "specify the compiler executable"), + ('include-dirs=', 'I', + "list of directories to search for header files"), + ('define=', 'D', + "C preprocessor macros to define"), + ('undef=', 'U', + "C preprocessor macros to undefine"), + ('libraries=', 'l', + "external C libraries to link with"), + ('library-dirs=', 'L', + "directories to search for external C libraries"), + + ('noisy', None, + "show every action (compile, link, run, ...) taken"), + ('dump-source', None, + "dump generated source files before attempting to compile them"), + ] + + + # The three standard command methods: since the "config" command + # does nothing by default, these are empty. + + def initialize_options(self): + self.compiler = None + self.cc = None + self.include_dirs = None + self.libraries = None + self.library_dirs = None + + # maximal output for now + self.noisy = 1 + self.dump_source = 1 + + # list of temporary files generated along-the-way that we have + # to clean at some point + self.temp_files = [] + + def finalize_options(self): + if self.include_dirs is None: + self.include_dirs = self.distribution.include_dirs or [] + elif isinstance(self.include_dirs, str): + self.include_dirs = self.include_dirs.split(os.pathsep) + + if self.libraries is None: + self.libraries = [] + elif isinstance(self.libraries, str): + self.libraries = [self.libraries] + + if self.library_dirs is None: + self.library_dirs = [] + elif isinstance(self.library_dirs, str): + self.library_dirs = self.library_dirs.split(os.pathsep) + + def run(self): + pass + + # Utility methods for actual "config" commands. The interfaces are + # loosely based on Autoconf macros of similar names. Sub-classes + # may use these freely. + + def _check_compiler(self): + """Check that 'self.compiler' really is a CCompiler object; + if not, make it one. + """ + # We do this late, and only on-demand, because this is an expensive + # import. + from distutils.ccompiler import CCompiler, new_compiler + if not isinstance(self.compiler, CCompiler): + self.compiler = new_compiler(compiler=self.compiler, + dry_run=self.dry_run, force=1) + customize_compiler(self.compiler) + if self.include_dirs: + self.compiler.set_include_dirs(self.include_dirs) + if self.libraries: + self.compiler.set_libraries(self.libraries) + if self.library_dirs: + self.compiler.set_library_dirs(self.library_dirs) + + def _gen_temp_sourcefile(self, body, headers, lang): + filename = "_configtest" + LANG_EXT[lang] + with open(filename, "w") as file: + if headers: + for header in headers: + file.write("#include <%s>\n" % header) + file.write("\n") + file.write(body) + if body[-1] != "\n": + file.write("\n") + return filename + + def _preprocess(self, body, headers, include_dirs, lang): + src = self._gen_temp_sourcefile(body, headers, lang) + out = "_configtest.i" + self.temp_files.extend([src, out]) + self.compiler.preprocess(src, out, include_dirs=include_dirs) + return (src, out) + + def _compile(self, body, headers, include_dirs, lang): + src = self._gen_temp_sourcefile(body, headers, lang) + if self.dump_source: + dump_file(src, "compiling '%s':" % src) + (obj,) = self.compiler.object_filenames([src]) + self.temp_files.extend([src, obj]) + self.compiler.compile([src], include_dirs=include_dirs) + return (src, obj) + + def _link(self, body, headers, include_dirs, libraries, library_dirs, + lang): + (src, obj) = self._compile(body, headers, include_dirs, lang) + prog = os.path.splitext(os.path.basename(src))[0] + self.compiler.link_executable([obj], prog, + libraries=libraries, + library_dirs=library_dirs, + target_lang=lang) + + if self.compiler.exe_extension is not None: + prog = prog + self.compiler.exe_extension + self.temp_files.append(prog) + + return (src, obj, prog) + + def _clean(self, *filenames): + if not filenames: + filenames = self.temp_files + self.temp_files = [] + log.info("removing: %s", ' '.join(filenames)) + for filename in filenames: + try: + os.remove(filename) + except OSError: + pass + + + # XXX these ignore the dry-run flag: what to do, what to do? even if + # you want a dry-run build, you still need some sort of configuration + # info. My inclination is to make it up to the real config command to + # consult 'dry_run', and assume a default (minimal) configuration if + # true. The problem with trying to do it here is that you'd have to + # return either true or false from all the 'try' methods, neither of + # which is correct. + + # XXX need access to the header search path and maybe default macros. + + def try_cpp(self, body=None, headers=None, include_dirs=None, lang="c"): + """Construct a source file from 'body' (a string containing lines + of C/C++ code) and 'headers' (a list of header files to include) + and run it through the preprocessor. Return true if the + preprocessor succeeded, false if there were any errors. + ('body' probably isn't of much use, but what the heck.) + """ + from distutils.ccompiler import CompileError + self._check_compiler() + ok = True + try: + self._preprocess(body, headers, include_dirs, lang) + except CompileError: + ok = False + + self._clean() + return ok + + def search_cpp(self, pattern, body=None, headers=None, include_dirs=None, + lang="c"): + """Construct a source file (just like 'try_cpp()'), run it through + the preprocessor, and return true if any line of the output matches + 'pattern'. 'pattern' should either be a compiled regex object or a + string containing a regex. If both 'body' and 'headers' are None, + preprocesses an empty file -- which can be useful to determine the + symbols the preprocessor and compiler set by default. + """ + self._check_compiler() + src, out = self._preprocess(body, headers, include_dirs, lang) + + if isinstance(pattern, str): + pattern = re.compile(pattern) + + with open(out) as file: + match = False + while True: + line = file.readline() + if line == '': + break + if pattern.search(line): + match = True + break + + self._clean() + return match + + def try_compile(self, body, headers=None, include_dirs=None, lang="c"): + """Try to compile a source file built from 'body' and 'headers'. + Return true on success, false otherwise. + """ + from distutils.ccompiler import CompileError + self._check_compiler() + try: + self._compile(body, headers, include_dirs, lang) + ok = True + except CompileError: + ok = False + + log.info(ok and "success!" or "failure.") + self._clean() + return ok + + def try_link(self, body, headers=None, include_dirs=None, libraries=None, + library_dirs=None, lang="c"): + """Try to compile and link a source file, built from 'body' and + 'headers', to executable form. Return true on success, false + otherwise. + """ + from distutils.ccompiler import CompileError, LinkError + self._check_compiler() + try: + self._link(body, headers, include_dirs, + libraries, library_dirs, lang) + ok = True + except (CompileError, LinkError): + ok = False + + log.info(ok and "success!" or "failure.") + self._clean() + return ok + + def try_run(self, body, headers=None, include_dirs=None, libraries=None, + library_dirs=None, lang="c"): + """Try to compile, link to an executable, and run a program + built from 'body' and 'headers'. Return true on success, false + otherwise. + """ + from distutils.ccompiler import CompileError, LinkError + self._check_compiler() + try: + src, obj, exe = self._link(body, headers, include_dirs, + libraries, library_dirs, lang) + self.spawn([exe]) + ok = True + except (CompileError, LinkError, DistutilsExecError): + ok = False + + log.info(ok and "success!" or "failure.") + self._clean() + return ok + + + # -- High-level methods -------------------------------------------- + # (these are the ones that are actually likely to be useful + # when implementing a real-world config command!) + + def check_func(self, func, headers=None, include_dirs=None, + libraries=None, library_dirs=None, decl=0, call=0): + """Determine if function 'func' is available by constructing a + source file that refers to 'func', and compiles and links it. + If everything succeeds, returns true; otherwise returns false. + + The constructed source file starts out by including the header + files listed in 'headers'. If 'decl' is true, it then declares + 'func' (as "int func()"); you probably shouldn't supply 'headers' + and set 'decl' true in the same call, or you might get errors about + a conflicting declarations for 'func'. Finally, the constructed + 'main()' function either references 'func' or (if 'call' is true) + calls it. 'libraries' and 'library_dirs' are used when + linking. + """ + self._check_compiler() + body = [] + if decl: + body.append("int %s ();" % func) + body.append("int main () {") + if call: + body.append(" %s();" % func) + else: + body.append(" %s;" % func) + body.append("}") + body = "\n".join(body) + "\n" + + return self.try_link(body, headers, include_dirs, + libraries, library_dirs) + + def check_lib(self, library, library_dirs=None, headers=None, + include_dirs=None, other_libraries=[]): + """Determine if 'library' is available to be linked against, + without actually checking that any particular symbols are provided + by it. 'headers' will be used in constructing the source file to + be compiled, but the only effect of this is to check if all the + header files listed are available. Any libraries listed in + 'other_libraries' will be included in the link, in case 'library' + has symbols that depend on other libraries. + """ + self._check_compiler() + return self.try_link("int main (void) { }", headers, include_dirs, + [library] + other_libraries, library_dirs) + + def check_header(self, header, include_dirs=None, library_dirs=None, + lang="c"): + """Determine if the system header file named by 'header_file' + exists and can be found by the preprocessor; return true if so, + false otherwise. + """ + return self.try_cpp(body="/* No body */", headers=[header], + include_dirs=include_dirs) + +def dump_file(filename, head=None): + """Dumps a file content into log.info. + + If head is not None, will be dumped before the file content. + """ + if head is None: + log.info('%s', filename) + else: + log.info(head) + file = open(filename) + try: + log.info(file.read()) + finally: + file.close() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/install.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/install.py new file mode 100644 index 0000000000000000000000000000000000000000..01d5331a63069b14241c6edad5682bc14f77ca48 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/install.py @@ -0,0 +1,679 @@ +"""distutils.command.install + +Implements the Distutils 'install' command.""" + +import sys +import sysconfig +import os +import re + +from distutils import log +from distutils.core import Command +from distutils.debug import DEBUG +from distutils.sysconfig import get_config_vars +from distutils.errors import DistutilsPlatformError +from distutils.file_util import write_file +from distutils.util import convert_path, subst_vars, change_root +from distutils.util import get_platform +from distutils.errors import DistutilsOptionError + +from site import USER_BASE +from site import USER_SITE + +HAS_USER_SITE = (USER_SITE is not None) + +# The keys to an installation scheme; if any new types of files are to be +# installed, be sure to add an entry to every scheme in +# sysconfig._INSTALL_SCHEMES, and to SCHEME_KEYS here. +SCHEME_KEYS = ('purelib', 'platlib', 'headers', 'scripts', 'data') + +# The following code provides backward-compatible INSTALL_SCHEMES +# while making the sysconfig module the single point of truth. +# This makes it easier for OS distributions where they need to +# alter locations for packages installations in a single place. +# Note that this module is deprecated (PEP 632); all consumers +# of this information should switch to using sysconfig directly. +INSTALL_SCHEMES = {"unix_prefix": {}, "unix_home": {}, "nt": {}} + +# Copy from sysconfig._INSTALL_SCHEMES +for key in SCHEME_KEYS: + for distutils_scheme_name, sys_scheme_name in ( + ("unix_prefix", "posix_prefix"), ("unix_home", "posix_home"), + ("nt", "nt")): + sys_key = key + sys_scheme = sysconfig._INSTALL_SCHEMES[sys_scheme_name] + if key == "headers" and key not in sys_scheme: + # On POSIX-y platforms, Python will: + # - Build from .h files in 'headers' (only there when + # building CPython) + # - Install .h files to 'include' + # When 'headers' is missing, fall back to 'include' + sys_key = 'include' + INSTALL_SCHEMES[distutils_scheme_name][key] = sys_scheme[sys_key] + +# Transformation to different template format +for main_key in INSTALL_SCHEMES: + for key, value in INSTALL_SCHEMES[main_key].items(): + # Change all ocurences of {variable} to $variable + value = re.sub(r"\{(.+?)\}", r"$\g<1>", value) + value = value.replace("$installed_base", "$base") + value = value.replace("$py_version_nodot_plat", "$py_version_nodot") + if key == "headers": + value += "/$dist_name" + if sys.version_info >= (3, 9) and key == "platlib": + # platlibdir is available since 3.9: bpo-1294959 + value = value.replace("/lib/", "/$platlibdir/") + INSTALL_SCHEMES[main_key][key] = value + +# The following part of INSTALL_SCHEMES has a different definition +# than the one in sysconfig, but because both depend on the site module, +# the outcomes should be the same. +if HAS_USER_SITE: + INSTALL_SCHEMES['nt_user'] = { + 'purelib': '$usersite', + 'platlib': '$usersite', + 'headers': '$userbase/Python$py_version_nodot/Include/$dist_name', + 'scripts': '$userbase/Python$py_version_nodot/Scripts', + 'data' : '$userbase', + } + + INSTALL_SCHEMES['unix_user'] = { + 'purelib': '$usersite', + 'platlib': '$usersite', + 'headers': + '$userbase/include/python$py_version_short$abiflags/$dist_name', + 'scripts': '$userbase/bin', + 'data' : '$userbase', + } + + +class install(Command): + + description = "install everything from build directory" + + user_options = [ + # Select installation scheme and set base director(y|ies) + ('prefix=', None, + "installation prefix"), + ('exec-prefix=', None, + "(Unix only) prefix for platform-specific files"), + ('home=', None, + "(Unix only) home directory to install under"), + + # Or, just set the base director(y|ies) + ('install-base=', None, + "base installation directory (instead of --prefix or --home)"), + ('install-platbase=', None, + "base installation directory for platform-specific files " + + "(instead of --exec-prefix or --home)"), + ('root=', None, + "install everything relative to this alternate root directory"), + + # Or, explicitly set the installation scheme + ('install-purelib=', None, + "installation directory for pure Python module distributions"), + ('install-platlib=', None, + "installation directory for non-pure module distributions"), + ('install-lib=', None, + "installation directory for all module distributions " + + "(overrides --install-purelib and --install-platlib)"), + + ('install-headers=', None, + "installation directory for C/C++ headers"), + ('install-scripts=', None, + "installation directory for Python scripts"), + ('install-data=', None, + "installation directory for data files"), + + # Byte-compilation options -- see install_lib.py for details, as + # these are duplicated from there (but only install_lib does + # anything with them). + ('compile', 'c', "compile .py to .pyc [default]"), + ('no-compile', None, "don't compile .py files"), + ('optimize=', 'O', + "also compile with optimization: -O1 for \"python -O\", " + "-O2 for \"python -OO\", and -O0 to disable [default: -O0]"), + + # Miscellaneous control options + ('force', 'f', + "force installation (overwrite any existing files)"), + ('skip-build', None, + "skip rebuilding everything (for testing/debugging)"), + + # Where to install documentation (eventually!) + #('doc-format=', None, "format of documentation to generate"), + #('install-man=', None, "directory for Unix man pages"), + #('install-html=', None, "directory for HTML documentation"), + #('install-info=', None, "directory for GNU info files"), + + ('record=', None, + "filename in which to record list of installed files"), + ] + + boolean_options = ['compile', 'force', 'skip-build'] + + if HAS_USER_SITE: + user_options.append(('user', None, + "install in user site-package '%s'" % USER_SITE)) + boolean_options.append('user') + + negative_opt = {'no-compile' : 'compile'} + + + def initialize_options(self): + """Initializes options.""" + # High-level options: these select both an installation base + # and scheme. + self.prefix = None + self.exec_prefix = None + self.home = None + self.user = 0 + + # These select only the installation base; it's up to the user to + # specify the installation scheme (currently, that means supplying + # the --install-{platlib,purelib,scripts,data} options). + self.install_base = None + self.install_platbase = None + self.root = None + + # These options are the actual installation directories; if not + # supplied by the user, they are filled in using the installation + # scheme implied by prefix/exec-prefix/home and the contents of + # that installation scheme. + self.install_purelib = None # for pure module distributions + self.install_platlib = None # non-pure (dists w/ extensions) + self.install_headers = None # for C/C++ headers + self.install_lib = None # set to either purelib or platlib + self.install_scripts = None + self.install_data = None + if HAS_USER_SITE: + self.install_userbase = USER_BASE + self.install_usersite = USER_SITE + + self.compile = None + self.optimize = None + + # Deprecated + # These two are for putting non-packagized distributions into their + # own directory and creating a .pth file if it makes sense. + # 'extra_path' comes from the setup file; 'install_path_file' can + # be turned off if it makes no sense to install a .pth file. (But + # better to install it uselessly than to guess wrong and not + # install it when it's necessary and would be used!) Currently, + # 'install_path_file' is always true unless some outsider meddles + # with it. + self.extra_path = None + self.install_path_file = 1 + + # 'force' forces installation, even if target files are not + # out-of-date. 'skip_build' skips running the "build" command, + # handy if you know it's not necessary. 'warn_dir' (which is *not* + # a user option, it's just there so the bdist_* commands can turn + # it off) determines whether we warn about installing to a + # directory not in sys.path. + self.force = 0 + self.skip_build = 0 + self.warn_dir = 1 + + # These are only here as a conduit from the 'build' command to the + # 'install_*' commands that do the real work. ('build_base' isn't + # actually used anywhere, but it might be useful in future.) They + # are not user options, because if the user told the install + # command where the build directory is, that wouldn't affect the + # build command. + self.build_base = None + self.build_lib = None + + # Not defined yet because we don't know anything about + # documentation yet. + #self.install_man = None + #self.install_html = None + #self.install_info = None + + self.record = None + + + # -- Option finalizing methods ------------------------------------- + # (This is rather more involved than for most commands, + # because this is where the policy for installing third- + # party Python modules on various platforms given a wide + # array of user input is decided. Yes, it's quite complex!) + + def finalize_options(self): + """Finalizes options.""" + # This method (and its helpers, like 'finalize_unix()', + # 'finalize_other()', and 'select_scheme()') is where the default + # installation directories for modules, extension modules, and + # anything else we care to install from a Python module + # distribution. Thus, this code makes a pretty important policy + # statement about how third-party stuff is added to a Python + # installation! Note that the actual work of installation is done + # by the relatively simple 'install_*' commands; they just take + # their orders from the installation directory options determined + # here. + + # Check for errors/inconsistencies in the options; first, stuff + # that's wrong on any platform. + + if ((self.prefix or self.exec_prefix or self.home) and + (self.install_base or self.install_platbase)): + raise DistutilsOptionError( + "must supply either prefix/exec-prefix/home or " + + "install-base/install-platbase -- not both") + + if self.home and (self.prefix or self.exec_prefix): + raise DistutilsOptionError( + "must supply either home or prefix/exec-prefix -- not both") + + if self.user and (self.prefix or self.exec_prefix or self.home or + self.install_base or self.install_platbase): + raise DistutilsOptionError("can't combine user with prefix, " + "exec_prefix/home, or install_(plat)base") + + # Next, stuff that's wrong (or dubious) only on certain platforms. + if os.name != "posix": + if self.exec_prefix: + self.warn("exec-prefix option ignored on this platform") + self.exec_prefix = None + + # Now the interesting logic -- so interesting that we farm it out + # to other methods. The goal of these methods is to set the final + # values for the install_{lib,scripts,data,...} options, using as + # input a heady brew of prefix, exec_prefix, home, install_base, + # install_platbase, user-supplied versions of + # install_{purelib,platlib,lib,scripts,data,...}, and the + # INSTALL_SCHEME dictionary above. Phew! + + self.dump_dirs("pre-finalize_{unix,other}") + + if os.name == 'posix': + self.finalize_unix() + else: + self.finalize_other() + + self.dump_dirs("post-finalize_{unix,other}()") + + # Expand configuration variables, tilde, etc. in self.install_base + # and self.install_platbase -- that way, we can use $base or + # $platbase in the other installation directories and not worry + # about needing recursive variable expansion (shudder). + + py_version = sys.version.split()[0] + (prefix, exec_prefix) = get_config_vars('prefix', 'exec_prefix') + try: + abiflags = sys.abiflags + except AttributeError: + # sys.abiflags may not be defined on all platforms. + abiflags = '' + self.config_vars = {'dist_name': self.distribution.get_name(), + 'dist_version': self.distribution.get_version(), + 'dist_fullname': self.distribution.get_fullname(), + 'py_version': py_version, + 'py_version_short': '%d.%d' % sys.version_info[:2], + 'py_version_nodot': '%d%d' % sys.version_info[:2], + 'sys_prefix': prefix, + 'prefix': prefix, + 'sys_exec_prefix': exec_prefix, + 'exec_prefix': exec_prefix, + 'abiflags': abiflags, + 'platlibdir': sys.platlibdir, + } + + if HAS_USER_SITE: + self.config_vars['userbase'] = self.install_userbase + self.config_vars['usersite'] = self.install_usersite + + if sysconfig.is_python_build(True): + self.config_vars['srcdir'] = sysconfig.get_config_var('srcdir') + + self.expand_basedirs() + + self.dump_dirs("post-expand_basedirs()") + + # Now define config vars for the base directories so we can expand + # everything else. + self.config_vars['base'] = self.install_base + self.config_vars['platbase'] = self.install_platbase + + if DEBUG: + from pprint import pprint + print("config vars:") + pprint(self.config_vars) + + # Expand "~" and configuration variables in the installation + # directories. + self.expand_dirs() + + self.dump_dirs("post-expand_dirs()") + + # Create directories in the home dir: + if self.user: + self.create_home_path() + + # Pick the actual directory to install all modules to: either + # install_purelib or install_platlib, depending on whether this + # module distribution is pure or not. Of course, if the user + # already specified install_lib, use their selection. + if self.install_lib is None: + if self.distribution.ext_modules: # has extensions: non-pure + self.install_lib = self.install_platlib + else: + self.install_lib = self.install_purelib + + + # Convert directories from Unix /-separated syntax to the local + # convention. + self.convert_paths('lib', 'purelib', 'platlib', + 'scripts', 'data', 'headers') + if HAS_USER_SITE: + self.convert_paths('userbase', 'usersite') + + # Deprecated + # Well, we're not actually fully completely finalized yet: we still + # have to deal with 'extra_path', which is the hack for allowing + # non-packagized module distributions (hello, Numerical Python!) to + # get their own directories. + self.handle_extra_path() + self.install_libbase = self.install_lib # needed for .pth file + self.install_lib = os.path.join(self.install_lib, self.extra_dirs) + + # If a new root directory was supplied, make all the installation + # dirs relative to it. + if self.root is not None: + self.change_roots('libbase', 'lib', 'purelib', 'platlib', + 'scripts', 'data', 'headers') + + self.dump_dirs("after prepending root") + + # Find out the build directories, ie. where to install from. + self.set_undefined_options('build', + ('build_base', 'build_base'), + ('build_lib', 'build_lib')) + + # Punt on doc directories for now -- after all, we're punting on + # documentation completely! + + def dump_dirs(self, msg): + """Dumps the list of user options.""" + if not DEBUG: + return + from distutils.fancy_getopt import longopt_xlate + log.debug(msg + ":") + for opt in self.user_options: + opt_name = opt[0] + if opt_name[-1] == "=": + opt_name = opt_name[0:-1] + if opt_name in self.negative_opt: + opt_name = self.negative_opt[opt_name] + opt_name = opt_name.translate(longopt_xlate) + val = not getattr(self, opt_name) + else: + opt_name = opt_name.translate(longopt_xlate) + val = getattr(self, opt_name) + log.debug(" %s: %s", opt_name, val) + + def finalize_unix(self): + """Finalizes options for posix platforms.""" + if self.install_base is not None or self.install_platbase is not None: + if ((self.install_lib is None and + self.install_purelib is None and + self.install_platlib is None) or + self.install_headers is None or + self.install_scripts is None or + self.install_data is None): + raise DistutilsOptionError( + "install-base or install-platbase supplied, but " + "installation scheme is incomplete") + return + + if self.user: + if self.install_userbase is None: + raise DistutilsPlatformError( + "User base directory is not specified") + self.install_base = self.install_platbase = self.install_userbase + self.select_scheme("unix_user") + elif self.home is not None: + self.install_base = self.install_platbase = self.home + self.select_scheme("unix_home") + else: + if self.prefix is None: + if self.exec_prefix is not None: + raise DistutilsOptionError( + "must not supply exec-prefix without prefix") + + self.prefix = os.path.normpath(sys.prefix) + self.exec_prefix = os.path.normpath(sys.exec_prefix) + + else: + if self.exec_prefix is None: + self.exec_prefix = self.prefix + + self.install_base = self.prefix + self.install_platbase = self.exec_prefix + self.select_scheme("unix_prefix") + + def finalize_other(self): + """Finalizes options for non-posix platforms""" + if self.user: + if self.install_userbase is None: + raise DistutilsPlatformError( + "User base directory is not specified") + self.install_base = self.install_platbase = self.install_userbase + self.select_scheme(os.name + "_user") + elif self.home is not None: + self.install_base = self.install_platbase = self.home + self.select_scheme("unix_home") + else: + if self.prefix is None: + self.prefix = os.path.normpath(sys.prefix) + + self.install_base = self.install_platbase = self.prefix + try: + self.select_scheme(os.name) + except KeyError: + raise DistutilsPlatformError( + "I don't know how to install stuff on '%s'" % os.name) + + def select_scheme(self, name): + """Sets the install directories by applying the install schemes.""" + # it's the caller's problem if they supply a bad name! + scheme = INSTALL_SCHEMES[name] + for key in SCHEME_KEYS: + attrname = 'install_' + key + if getattr(self, attrname) is None: + setattr(self, attrname, scheme[key]) + + def _expand_attrs(self, attrs): + for attr in attrs: + val = getattr(self, attr) + if val is not None: + if os.name == 'posix' or os.name == 'nt': + val = os.path.expanduser(val) + val = subst_vars(val, self.config_vars) + setattr(self, attr, val) + + def expand_basedirs(self): + """Calls `os.path.expanduser` on install_base, install_platbase and + root.""" + self._expand_attrs(['install_base', 'install_platbase', 'root']) + + def expand_dirs(self): + """Calls `os.path.expanduser` on install dirs.""" + self._expand_attrs(['install_purelib', 'install_platlib', + 'install_lib', 'install_headers', + 'install_scripts', 'install_data',]) + + def convert_paths(self, *names): + """Call `convert_path` over `names`.""" + for name in names: + attr = "install_" + name + setattr(self, attr, convert_path(getattr(self, attr))) + + def handle_extra_path(self): + """Set `path_file` and `extra_dirs` using `extra_path`.""" + if self.extra_path is None: + self.extra_path = self.distribution.extra_path + + if self.extra_path is not None: + log.warn( + "Distribution option extra_path is deprecated. " + "See issue27919 for details." + ) + if isinstance(self.extra_path, str): + self.extra_path = self.extra_path.split(',') + + if len(self.extra_path) == 1: + path_file = extra_dirs = self.extra_path[0] + elif len(self.extra_path) == 2: + path_file, extra_dirs = self.extra_path + else: + raise DistutilsOptionError( + "'extra_path' option must be a list, tuple, or " + "comma-separated string with 1 or 2 elements") + + # convert to local form in case Unix notation used (as it + # should be in setup scripts) + extra_dirs = convert_path(extra_dirs) + else: + path_file = None + extra_dirs = '' + + # XXX should we warn if path_file and not extra_dirs? (in which + # case the path file would be harmless but pointless) + self.path_file = path_file + self.extra_dirs = extra_dirs + + def change_roots(self, *names): + """Change the install directories pointed by name using root.""" + for name in names: + attr = "install_" + name + setattr(self, attr, change_root(self.root, getattr(self, attr))) + + def create_home_path(self): + """Create directories under ~.""" + if not self.user: + return + home = convert_path(os.path.expanduser("~")) + for name, path in self.config_vars.items(): + if path.startswith(home) and not os.path.isdir(path): + self.debug_print("os.makedirs('%s', 0o700)" % path) + os.makedirs(path, 0o700) + + # -- Command execution methods ------------------------------------- + + def run(self): + """Runs the command.""" + # Obviously have to build before we can install + if not self.skip_build: + self.run_command('build') + # If we built for any other platform, we can't install. + build_plat = self.distribution.get_command_obj('build').plat_name + # check warn_dir - it is a clue that the 'install' is happening + # internally, and not to sys.path, so we don't check the platform + # matches what we are running. + if self.warn_dir and build_plat != get_platform(): + raise DistutilsPlatformError("Can't install when " + "cross-compiling") + + # Run all sub-commands (at least those that need to be run) + for cmd_name in self.get_sub_commands(): + self.run_command(cmd_name) + + if self.path_file: + self.create_path_file() + + # write list of installed files, if requested. + if self.record: + outputs = self.get_outputs() + if self.root: # strip any package prefix + root_len = len(self.root) + for counter in range(len(outputs)): + outputs[counter] = outputs[counter][root_len:] + self.execute(write_file, + (self.record, outputs), + "writing list of installed files to '%s'" % + self.record) + + sys_path = map(os.path.normpath, sys.path) + sys_path = map(os.path.normcase, sys_path) + install_lib = os.path.normcase(os.path.normpath(self.install_lib)) + if (self.warn_dir and + not (self.path_file and self.install_path_file) and + install_lib not in sys_path): + log.debug(("modules installed to '%s', which is not in " + "Python's module search path (sys.path) -- " + "you'll have to change the search path yourself"), + self.install_lib) + + def create_path_file(self): + """Creates the .pth file""" + filename = os.path.join(self.install_libbase, + self.path_file + ".pth") + if self.install_path_file: + self.execute(write_file, + (filename, [self.extra_dirs]), + "creating %s" % filename) + else: + self.warn("path file '%s' not created" % filename) + + + # -- Reporting methods --------------------------------------------- + + def get_outputs(self): + """Assembles the outputs of all the sub-commands.""" + outputs = [] + for cmd_name in self.get_sub_commands(): + cmd = self.get_finalized_command(cmd_name) + # Add the contents of cmd.get_outputs(), ensuring + # that outputs doesn't contain duplicate entries + for filename in cmd.get_outputs(): + if filename not in outputs: + outputs.append(filename) + + if self.path_file and self.install_path_file: + outputs.append(os.path.join(self.install_libbase, + self.path_file + ".pth")) + + return outputs + + def get_inputs(self): + """Returns the inputs of all the sub-commands""" + # XXX gee, this looks familiar ;-( + inputs = [] + for cmd_name in self.get_sub_commands(): + cmd = self.get_finalized_command(cmd_name) + inputs.extend(cmd.get_inputs()) + + return inputs + + # -- Predicates for sub-command list ------------------------------- + + def has_lib(self): + """Returns true if the current distribution has any Python + modules to install.""" + return (self.distribution.has_pure_modules() or + self.distribution.has_ext_modules()) + + def has_headers(self): + """Returns true if the current distribution has any headers to + install.""" + return self.distribution.has_headers() + + def has_scripts(self): + """Returns true if the current distribution has any scripts to. + install.""" + return self.distribution.has_scripts() + + def has_data(self): + """Returns true if the current distribution has any data to. + install.""" + return self.distribution.has_data_files() + + # 'sub_commands': a list of commands this command might have to run to + # get its work done. See cmd.py for more info. + sub_commands = [('install_lib', has_lib), + ('install_headers', has_headers), + ('install_scripts', has_scripts), + ('install_data', has_data), + ('install_egg_info', lambda self:True), + ] diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/install_data.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/install_data.py new file mode 100644 index 0000000000000000000000000000000000000000..947cd76a99e5fdde049b2b6b713ba273ea4309d5 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/install_data.py @@ -0,0 +1,79 @@ +"""distutils.command.install_data + +Implements the Distutils 'install_data' command, for installing +platform-independent data files.""" + +# contributed by Bastian Kleineidam + +import os +from distutils.core import Command +from distutils.util import change_root, convert_path + +class install_data(Command): + + description = "install data files" + + user_options = [ + ('install-dir=', 'd', + "base directory for installing data files " + "(default: installation base dir)"), + ('root=', None, + "install everything relative to this alternate root directory"), + ('force', 'f', "force installation (overwrite existing files)"), + ] + + boolean_options = ['force'] + + def initialize_options(self): + self.install_dir = None + self.outfiles = [] + self.root = None + self.force = 0 + self.data_files = self.distribution.data_files + self.warn_dir = 1 + + def finalize_options(self): + self.set_undefined_options('install', + ('install_data', 'install_dir'), + ('root', 'root'), + ('force', 'force'), + ) + + def run(self): + self.mkpath(self.install_dir) + for f in self.data_files: + if isinstance(f, str): + # it's a simple file, so copy it + f = convert_path(f) + if self.warn_dir: + self.warn("setup script did not provide a directory for " + "'%s' -- installing right in '%s'" % + (f, self.install_dir)) + (out, _) = self.copy_file(f, self.install_dir) + self.outfiles.append(out) + else: + # it's a tuple with path to install to and a list of files + dir = convert_path(f[0]) + if not os.path.isabs(dir): + dir = os.path.join(self.install_dir, dir) + elif self.root: + dir = change_root(self.root, dir) + self.mkpath(dir) + + if f[1] == []: + # If there are no files listed, the user must be + # trying to create an empty directory, so add the + # directory to the list of output files. + self.outfiles.append(dir) + else: + # Copy files, adding them to the list of output files. + for data in f[1]: + data = convert_path(data) + (out, _) = self.copy_file(data, dir) + self.outfiles.append(out) + + def get_inputs(self): + return self.data_files or [] + + def get_outputs(self): + return self.outfiles diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/install_egg_info.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/install_egg_info.py new file mode 100644 index 0000000000000000000000000000000000000000..0ddc7367cc608dac2cfb408a08c8b442278a8207 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/install_egg_info.py @@ -0,0 +1,77 @@ +"""distutils.command.install_egg_info + +Implements the Distutils 'install_egg_info' command, for installing +a package's PKG-INFO metadata.""" + + +from distutils.cmd import Command +from distutils import log, dir_util +import os, sys, re + +class install_egg_info(Command): + """Install an .egg-info file for the package""" + + description = "Install package's PKG-INFO metadata as an .egg-info file" + user_options = [ + ('install-dir=', 'd', "directory to install to"), + ] + + def initialize_options(self): + self.install_dir = None + + def finalize_options(self): + self.set_undefined_options('install_lib',('install_dir','install_dir')) + basename = "%s-%s-py%d.%d.egg-info" % ( + to_filename(safe_name(self.distribution.get_name())), + to_filename(safe_version(self.distribution.get_version())), + *sys.version_info[:2] + ) + self.target = os.path.join(self.install_dir, basename) + self.outputs = [self.target] + + def run(self): + target = self.target + if os.path.isdir(target) and not os.path.islink(target): + dir_util.remove_tree(target, dry_run=self.dry_run) + elif os.path.exists(target): + self.execute(os.unlink,(self.target,),"Removing "+target) + elif not os.path.isdir(self.install_dir): + self.execute(os.makedirs, (self.install_dir,), + "Creating "+self.install_dir) + log.info("Writing %s", target) + if not self.dry_run: + with open(target, 'w', encoding='UTF-8') as f: + self.distribution.metadata.write_pkg_file(f) + + def get_outputs(self): + return self.outputs + + +# The following routines are taken from setuptools' pkg_resources module and +# can be replaced by importing them from pkg_resources once it is included +# in the stdlib. + +def safe_name(name): + """Convert an arbitrary string to a standard distribution name + + Any runs of non-alphanumeric/. characters are replaced with a single '-'. + """ + return re.sub('[^A-Za-z0-9.]+', '-', name) + + +def safe_version(version): + """Convert an arbitrary string to a standard version string + + Spaces become dots, and all other non-alphanumeric characters become + dashes, with runs of multiple dashes condensed to a single dash. + """ + version = version.replace(' ','.') + return re.sub('[^A-Za-z0-9.]+', '-', version) + + +def to_filename(name): + """Convert a project or version name to its filename-escaped form + + Any '-' characters are currently replaced with '_'. + """ + return name.replace('-','_') diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/install_headers.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/install_headers.py new file mode 100644 index 0000000000000000000000000000000000000000..9bb0b18dc0d809dbc03d9ca355818b3bb0af573b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/install_headers.py @@ -0,0 +1,47 @@ +"""distutils.command.install_headers + +Implements the Distutils 'install_headers' command, to install C/C++ header +files to the Python include directory.""" + +from distutils.core import Command + + +# XXX force is never used +class install_headers(Command): + + description = "install C/C++ header files" + + user_options = [('install-dir=', 'd', + "directory to install header files to"), + ('force', 'f', + "force installation (overwrite existing files)"), + ] + + boolean_options = ['force'] + + def initialize_options(self): + self.install_dir = None + self.force = 0 + self.outfiles = [] + + def finalize_options(self): + self.set_undefined_options('install', + ('install_headers', 'install_dir'), + ('force', 'force')) + + + def run(self): + headers = self.distribution.headers + if not headers: + return + + self.mkpath(self.install_dir) + for header in headers: + (out, _) = self.copy_file(header, self.install_dir) + self.outfiles.append(out) + + def get_inputs(self): + return self.distribution.headers or [] + + def get_outputs(self): + return self.outfiles diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/install_lib.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/install_lib.py new file mode 100644 index 0000000000000000000000000000000000000000..6154cf09431f72258638a927c1e360fd42c31ff3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/install_lib.py @@ -0,0 +1,217 @@ +"""distutils.command.install_lib + +Implements the Distutils 'install_lib' command +(install all Python modules).""" + +import os +import importlib.util +import sys + +from distutils.core import Command +from distutils.errors import DistutilsOptionError + + +# Extension for Python source files. +PYTHON_SOURCE_EXTENSION = ".py" + +class install_lib(Command): + + description = "install all Python modules (extensions and pure Python)" + + # The byte-compilation options are a tad confusing. Here are the + # possible scenarios: + # 1) no compilation at all (--no-compile --no-optimize) + # 2) compile .pyc only (--compile --no-optimize; default) + # 3) compile .pyc and "opt-1" .pyc (--compile --optimize) + # 4) compile "opt-1" .pyc only (--no-compile --optimize) + # 5) compile .pyc and "opt-2" .pyc (--compile --optimize-more) + # 6) compile "opt-2" .pyc only (--no-compile --optimize-more) + # + # The UI for this is two options, 'compile' and 'optimize'. + # 'compile' is strictly boolean, and only decides whether to + # generate .pyc files. 'optimize' is three-way (0, 1, or 2), and + # decides both whether to generate .pyc files and what level of + # optimization to use. + + user_options = [ + ('install-dir=', 'd', "directory to install to"), + ('build-dir=','b', "build directory (where to install from)"), + ('force', 'f', "force installation (overwrite existing files)"), + ('compile', 'c', "compile .py to .pyc [default]"), + ('no-compile', None, "don't compile .py files"), + ('optimize=', 'O', + "also compile with optimization: -O1 for \"python -O\", " + "-O2 for \"python -OO\", and -O0 to disable [default: -O0]"), + ('skip-build', None, "skip the build steps"), + ] + + boolean_options = ['force', 'compile', 'skip-build'] + negative_opt = {'no-compile' : 'compile'} + + def initialize_options(self): + # let the 'install' command dictate our installation directory + self.install_dir = None + self.build_dir = None + self.force = 0 + self.compile = None + self.optimize = None + self.skip_build = None + + def finalize_options(self): + # Get all the information we need to install pure Python modules + # from the umbrella 'install' command -- build (source) directory, + # install (target) directory, and whether to compile .py files. + self.set_undefined_options('install', + ('build_lib', 'build_dir'), + ('install_lib', 'install_dir'), + ('force', 'force'), + ('compile', 'compile'), + ('optimize', 'optimize'), + ('skip_build', 'skip_build'), + ) + + if self.compile is None: + self.compile = True + if self.optimize is None: + self.optimize = False + + if not isinstance(self.optimize, int): + try: + self.optimize = int(self.optimize) + if self.optimize not in (0, 1, 2): + raise AssertionError + except (ValueError, AssertionError): + raise DistutilsOptionError("optimize must be 0, 1, or 2") + + def run(self): + # Make sure we have built everything we need first + self.build() + + # Install everything: simply dump the entire contents of the build + # directory to the installation directory (that's the beauty of + # having a build directory!) + outfiles = self.install() + + # (Optionally) compile .py to .pyc + if outfiles is not None and self.distribution.has_pure_modules(): + self.byte_compile(outfiles) + + # -- Top-level worker functions ------------------------------------ + # (called from 'run()') + + def build(self): + if not self.skip_build: + if self.distribution.has_pure_modules(): + self.run_command('build_py') + if self.distribution.has_ext_modules(): + self.run_command('build_ext') + + def install(self): + if os.path.isdir(self.build_dir): + outfiles = self.copy_tree(self.build_dir, self.install_dir) + else: + self.warn("'%s' does not exist -- no Python modules to install" % + self.build_dir) + return + return outfiles + + def byte_compile(self, files): + if sys.dont_write_bytecode: + self.warn('byte-compiling is disabled, skipping.') + return + + from distutils.util import byte_compile + + # Get the "--root" directory supplied to the "install" command, + # and use it as a prefix to strip off the purported filename + # encoded in bytecode files. This is far from complete, but it + # should at least generate usable bytecode in RPM distributions. + install_root = self.get_finalized_command('install').root + + if self.compile: + byte_compile(files, optimize=0, + force=self.force, prefix=install_root, + dry_run=self.dry_run) + if self.optimize > 0: + byte_compile(files, optimize=self.optimize, + force=self.force, prefix=install_root, + verbose=self.verbose, dry_run=self.dry_run) + + + # -- Utility methods ----------------------------------------------- + + def _mutate_outputs(self, has_any, build_cmd, cmd_option, output_dir): + if not has_any: + return [] + + build_cmd = self.get_finalized_command(build_cmd) + build_files = build_cmd.get_outputs() + build_dir = getattr(build_cmd, cmd_option) + + prefix_len = len(build_dir) + len(os.sep) + outputs = [] + for file in build_files: + outputs.append(os.path.join(output_dir, file[prefix_len:])) + + return outputs + + def _bytecode_filenames(self, py_filenames): + bytecode_files = [] + for py_file in py_filenames: + # Since build_py handles package data installation, the + # list of outputs can contain more than just .py files. + # Make sure we only report bytecode for the .py files. + ext = os.path.splitext(os.path.normcase(py_file))[1] + if ext != PYTHON_SOURCE_EXTENSION: + continue + if self.compile: + bytecode_files.append(importlib.util.cache_from_source( + py_file, optimization='')) + if self.optimize > 0: + bytecode_files.append(importlib.util.cache_from_source( + py_file, optimization=self.optimize)) + + return bytecode_files + + + # -- External interface -------------------------------------------- + # (called by outsiders) + + def get_outputs(self): + """Return the list of files that would be installed if this command + were actually run. Not affected by the "dry-run" flag or whether + modules have actually been built yet. + """ + pure_outputs = \ + self._mutate_outputs(self.distribution.has_pure_modules(), + 'build_py', 'build_lib', + self.install_dir) + if self.compile: + bytecode_outputs = self._bytecode_filenames(pure_outputs) + else: + bytecode_outputs = [] + + ext_outputs = \ + self._mutate_outputs(self.distribution.has_ext_modules(), + 'build_ext', 'build_lib', + self.install_dir) + + return pure_outputs + bytecode_outputs + ext_outputs + + def get_inputs(self): + """Get the list of files that are input to this command, ie. the + files that get installed as they are named in the build tree. + The files in this list correspond one-to-one to the output + filenames returned by 'get_outputs()'. + """ + inputs = [] + + if self.distribution.has_pure_modules(): + build_py = self.get_finalized_command('build_py') + inputs.extend(build_py.get_outputs()) + + if self.distribution.has_ext_modules(): + build_ext = self.get_finalized_command('build_ext') + inputs.extend(build_ext.get_outputs()) + + return inputs diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/install_scripts.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/install_scripts.py new file mode 100644 index 0000000000000000000000000000000000000000..31a1130ee549371dffc668e515d2ae5d91799aac --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/install_scripts.py @@ -0,0 +1,60 @@ +"""distutils.command.install_scripts + +Implements the Distutils 'install_scripts' command, for installing +Python scripts.""" + +# contributed by Bastian Kleineidam + +import os +from distutils.core import Command +from distutils import log +from stat import ST_MODE + + +class install_scripts(Command): + + description = "install scripts (Python or otherwise)" + + user_options = [ + ('install-dir=', 'd', "directory to install scripts to"), + ('build-dir=','b', "build directory (where to install from)"), + ('force', 'f', "force installation (overwrite existing files)"), + ('skip-build', None, "skip the build steps"), + ] + + boolean_options = ['force', 'skip-build'] + + def initialize_options(self): + self.install_dir = None + self.force = 0 + self.build_dir = None + self.skip_build = None + + def finalize_options(self): + self.set_undefined_options('build', ('build_scripts', 'build_dir')) + self.set_undefined_options('install', + ('install_scripts', 'install_dir'), + ('force', 'force'), + ('skip_build', 'skip_build'), + ) + + def run(self): + if not self.skip_build: + self.run_command('build_scripts') + self.outfiles = self.copy_tree(self.build_dir, self.install_dir) + if os.name == 'posix': + # Set the executable bits (owner, group, and world) on + # all the scripts we just installed. + for file in self.get_outputs(): + if self.dry_run: + log.info("changing mode of %s", file) + else: + mode = ((os.stat(file)[ST_MODE]) | 0o555) & 0o7777 + log.info("changing mode of %s to %o", file, mode) + os.chmod(file, mode) + + def get_inputs(self): + return self.distribution.scripts or [] + + def get_outputs(self): + return self.outfiles or [] diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/register.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/register.py new file mode 100644 index 0000000000000000000000000000000000000000..0fac94e9e54905688d0e359fc5a9b96b703afab5 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/register.py @@ -0,0 +1,304 @@ +"""distutils.command.register + +Implements the Distutils 'register' command (register with the repository). +""" + +# created 2002/10/21, Richard Jones + +import getpass +import io +import urllib.parse, urllib.request +from warnings import warn + +from distutils.core import PyPIRCCommand +from distutils.errors import * +from distutils import log + +class register(PyPIRCCommand): + + description = ("register the distribution with the Python package index") + user_options = PyPIRCCommand.user_options + [ + ('list-classifiers', None, + 'list the valid Trove classifiers'), + ('strict', None , + 'Will stop the registering if the meta-data are not fully compliant') + ] + boolean_options = PyPIRCCommand.boolean_options + [ + 'verify', 'list-classifiers', 'strict'] + + sub_commands = [('check', lambda self: True)] + + def initialize_options(self): + PyPIRCCommand.initialize_options(self) + self.list_classifiers = 0 + self.strict = 0 + + def finalize_options(self): + PyPIRCCommand.finalize_options(self) + # setting options for the `check` subcommand + check_options = {'strict': ('register', self.strict), + 'restructuredtext': ('register', 1)} + self.distribution.command_options['check'] = check_options + + def run(self): + self.finalize_options() + self._set_config() + + # Run sub commands + for cmd_name in self.get_sub_commands(): + self.run_command(cmd_name) + + if self.dry_run: + self.verify_metadata() + elif self.list_classifiers: + self.classifiers() + else: + self.send_metadata() + + def check_metadata(self): + """Deprecated API.""" + warn("distutils.command.register.check_metadata is deprecated, \ + use the check command instead", PendingDeprecationWarning) + check = self.distribution.get_command_obj('check') + check.ensure_finalized() + check.strict = self.strict + check.restructuredtext = 1 + check.run() + + def _set_config(self): + ''' Reads the configuration file and set attributes. + ''' + config = self._read_pypirc() + if config != {}: + self.username = config['username'] + self.password = config['password'] + self.repository = config['repository'] + self.realm = config['realm'] + self.has_config = True + else: + if self.repository not in ('pypi', self.DEFAULT_REPOSITORY): + raise ValueError('%s not found in .pypirc' % self.repository) + if self.repository == 'pypi': + self.repository = self.DEFAULT_REPOSITORY + self.has_config = False + + def classifiers(self): + ''' Fetch the list of classifiers from the server. + ''' + url = self.repository+'?:action=list_classifiers' + response = urllib.request.urlopen(url) + log.info(self._read_pypi_response(response)) + + def verify_metadata(self): + ''' Send the metadata to the package index server to be checked. + ''' + # send the info to the server and report the result + (code, result) = self.post_to_server(self.build_post_data('verify')) + log.info('Server response (%s): %s', code, result) + + def send_metadata(self): + ''' Send the metadata to the package index server. + + Well, do the following: + 1. figure who the user is, and then + 2. send the data as a Basic auth'ed POST. + + First we try to read the username/password from $HOME/.pypirc, + which is a ConfigParser-formatted file with a section + [distutils] containing username and password entries (both + in clear text). Eg: + + [distutils] + index-servers = + pypi + + [pypi] + username: fred + password: sekrit + + Otherwise, to figure who the user is, we offer the user three + choices: + + 1. use existing login, + 2. register as a new user, or + 3. set the password to a random string and email the user. + + ''' + # see if we can short-cut and get the username/password from the + # config + if self.has_config: + choice = '1' + username = self.username + password = self.password + else: + choice = 'x' + username = password = '' + + # get the user's login info + choices = '1 2 3 4'.split() + while choice not in choices: + self.announce('''\ +We need to know who you are, so please choose either: + 1. use your existing login, + 2. register as a new user, + 3. have the server generate a new password for you (and email it to you), or + 4. quit +Your selection [default 1]: ''', log.INFO) + choice = input() + if not choice: + choice = '1' + elif choice not in choices: + print('Please choose one of the four options!') + + if choice == '1': + # get the username and password + while not username: + username = input('Username: ') + while not password: + password = getpass.getpass('Password: ') + + # set up the authentication + auth = urllib.request.HTTPPasswordMgr() + host = urllib.parse.urlparse(self.repository)[1] + auth.add_password(self.realm, host, username, password) + # send the info to the server and report the result + code, result = self.post_to_server(self.build_post_data('submit'), + auth) + self.announce('Server response (%s): %s' % (code, result), + log.INFO) + + # possibly save the login + if code == 200: + if self.has_config: + # sharing the password in the distribution instance + # so the upload command can reuse it + self.distribution.password = password + else: + self.announce(('I can store your PyPI login so future ' + 'submissions will be faster.'), log.INFO) + self.announce('(the login will be stored in %s)' % \ + self._get_rc_file(), log.INFO) + choice = 'X' + while choice.lower() not in 'yn': + choice = input('Save your login (y/N)?') + if not choice: + choice = 'n' + if choice.lower() == 'y': + self._store_pypirc(username, password) + + elif choice == '2': + data = {':action': 'user'} + data['name'] = data['password'] = data['email'] = '' + data['confirm'] = None + while not data['name']: + data['name'] = input('Username: ') + while data['password'] != data['confirm']: + while not data['password']: + data['password'] = getpass.getpass('Password: ') + while not data['confirm']: + data['confirm'] = getpass.getpass(' Confirm: ') + if data['password'] != data['confirm']: + data['password'] = '' + data['confirm'] = None + print("Password and confirm don't match!") + while not data['email']: + data['email'] = input(' EMail: ') + code, result = self.post_to_server(data) + if code != 200: + log.info('Server response (%s): %s', code, result) + else: + log.info('You will receive an email shortly.') + log.info(('Follow the instructions in it to ' + 'complete registration.')) + elif choice == '3': + data = {':action': 'password_reset'} + data['email'] = '' + while not data['email']: + data['email'] = input('Your email address: ') + code, result = self.post_to_server(data) + log.info('Server response (%s): %s', code, result) + + def build_post_data(self, action): + # figure the data to send - the metadata plus some additional + # information used by the package server + meta = self.distribution.metadata + data = { + ':action': action, + 'metadata_version' : '1.0', + 'name': meta.get_name(), + 'version': meta.get_version(), + 'summary': meta.get_description(), + 'home_page': meta.get_url(), + 'author': meta.get_contact(), + 'author_email': meta.get_contact_email(), + 'license': meta.get_licence(), + 'description': meta.get_long_description(), + 'keywords': meta.get_keywords(), + 'platform': meta.get_platforms(), + 'classifiers': meta.get_classifiers(), + 'download_url': meta.get_download_url(), + # PEP 314 + 'provides': meta.get_provides(), + 'requires': meta.get_requires(), + 'obsoletes': meta.get_obsoletes(), + } + if data['provides'] or data['requires'] or data['obsoletes']: + data['metadata_version'] = '1.1' + return data + + def post_to_server(self, data, auth=None): + ''' Post a query to the server, and return a string response. + ''' + if 'name' in data: + self.announce('Registering %s to %s' % (data['name'], + self.repository), + log.INFO) + # Build up the MIME payload for the urllib2 POST data + boundary = '--------------GHSKFJDLGDS7543FJKLFHRE75642756743254' + sep_boundary = '\n--' + boundary + end_boundary = sep_boundary + '--' + body = io.StringIO() + for key, value in data.items(): + # handle multiple entries for the same name + if type(value) not in (type([]), type( () )): + value = [value] + for value in value: + value = str(value) + body.write(sep_boundary) + body.write('\nContent-Disposition: form-data; name="%s"'%key) + body.write("\n\n") + body.write(value) + if value and value[-1] == '\r': + body.write('\n') # write an extra newline (lurve Macs) + body.write(end_boundary) + body.write("\n") + body = body.getvalue().encode("utf-8") + + # build the Request + headers = { + 'Content-type': 'multipart/form-data; boundary=%s; charset=utf-8'%boundary, + 'Content-length': str(len(body)) + } + req = urllib.request.Request(self.repository, body, headers) + + # handle HTTP and include the Basic Auth handler + opener = urllib.request.build_opener( + urllib.request.HTTPBasicAuthHandler(password_mgr=auth) + ) + data = '' + try: + result = opener.open(req) + except urllib.error.HTTPError as e: + if self.show_response: + data = e.fp.read() + result = e.code, e.msg + except urllib.error.URLError as e: + result = 500, str(e) + else: + if self.show_response: + data = self._read_pypi_response(result) + result = 200, 'OK' + if self.show_response: + msg = '\n'.join(('-' * 75, data, '-' * 75)) + self.announce(msg, log.INFO) + return result diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/sdist.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/sdist.py new file mode 100644 index 0000000000000000000000000000000000000000..b4996fcb1d276c48ad5637992c313e98a2bd9d99 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/sdist.py @@ -0,0 +1,494 @@ +"""distutils.command.sdist + +Implements the Distutils 'sdist' command (create a source distribution).""" + +import os +import sys +from glob import glob +from warnings import warn + +from distutils.core import Command +from distutils import dir_util +from distutils import file_util +from distutils import archive_util +from distutils.text_file import TextFile +from distutils.filelist import FileList +from distutils import log +from distutils.util import convert_path +from distutils.errors import DistutilsTemplateError, DistutilsOptionError + + +def show_formats(): + """Print all possible values for the 'formats' option (used by + the "--help-formats" command-line option). + """ + from distutils.fancy_getopt import FancyGetopt + from distutils.archive_util import ARCHIVE_FORMATS + formats = [] + for format in ARCHIVE_FORMATS.keys(): + formats.append(("formats=" + format, None, + ARCHIVE_FORMATS[format][2])) + formats.sort() + FancyGetopt(formats).print_help( + "List of available source distribution formats:") + + +class sdist(Command): + + description = "create a source distribution (tarball, zip file, etc.)" + + def checking_metadata(self): + """Callable used for the check sub-command. + + Placed here so user_options can view it""" + return self.metadata_check + + user_options = [ + ('template=', 't', + "name of manifest template file [default: MANIFEST.in]"), + ('manifest=', 'm', + "name of manifest file [default: MANIFEST]"), + ('use-defaults', None, + "include the default file set in the manifest " + "[default; disable with --no-defaults]"), + ('no-defaults', None, + "don't include the default file set"), + ('prune', None, + "specifically exclude files/directories that should not be " + "distributed (build tree, RCS/CVS dirs, etc.) " + "[default; disable with --no-prune]"), + ('no-prune', None, + "don't automatically exclude anything"), + ('manifest-only', 'o', + "just regenerate the manifest and then stop " + "(implies --force-manifest)"), + ('force-manifest', 'f', + "forcibly regenerate the manifest and carry on as usual. " + "Deprecated: now the manifest is always regenerated."), + ('formats=', None, + "formats for source distribution (comma-separated list)"), + ('keep-temp', 'k', + "keep the distribution tree around after creating " + + "archive file(s)"), + ('dist-dir=', 'd', + "directory to put the source distribution archive(s) in " + "[default: dist]"), + ('metadata-check', None, + "Ensure that all required elements of meta-data " + "are supplied. Warn if any missing. [default]"), + ('owner=', 'u', + "Owner name used when creating a tar file [default: current user]"), + ('group=', 'g', + "Group name used when creating a tar file [default: current group]"), + ] + + boolean_options = ['use-defaults', 'prune', + 'manifest-only', 'force-manifest', + 'keep-temp', 'metadata-check'] + + help_options = [ + ('help-formats', None, + "list available distribution formats", show_formats), + ] + + negative_opt = {'no-defaults': 'use-defaults', + 'no-prune': 'prune' } + + sub_commands = [('check', checking_metadata)] + + READMES = ('README', 'README.txt', 'README.rst') + + def initialize_options(self): + # 'template' and 'manifest' are, respectively, the names of + # the manifest template and manifest file. + self.template = None + self.manifest = None + + # 'use_defaults': if true, we will include the default file set + # in the manifest + self.use_defaults = 1 + self.prune = 1 + + self.manifest_only = 0 + self.force_manifest = 0 + + self.formats = ['gztar'] + self.keep_temp = 0 + self.dist_dir = None + + self.archive_files = None + self.metadata_check = 1 + self.owner = None + self.group = None + + def finalize_options(self): + if self.manifest is None: + self.manifest = "MANIFEST" + if self.template is None: + self.template = "MANIFEST.in" + + self.ensure_string_list('formats') + + bad_format = archive_util.check_archive_formats(self.formats) + if bad_format: + raise DistutilsOptionError( + "unknown archive format '%s'" % bad_format) + + if self.dist_dir is None: + self.dist_dir = "dist" + + def run(self): + # 'filelist' contains the list of files that will make up the + # manifest + self.filelist = FileList() + + # Run sub commands + for cmd_name in self.get_sub_commands(): + self.run_command(cmd_name) + + # Do whatever it takes to get the list of files to process + # (process the manifest template, read an existing manifest, + # whatever). File list is accumulated in 'self.filelist'. + self.get_file_list() + + # If user just wanted us to regenerate the manifest, stop now. + if self.manifest_only: + return + + # Otherwise, go ahead and create the source distribution tarball, + # or zipfile, or whatever. + self.make_distribution() + + def check_metadata(self): + """Deprecated API.""" + warn("distutils.command.sdist.check_metadata is deprecated, \ + use the check command instead", PendingDeprecationWarning) + check = self.distribution.get_command_obj('check') + check.ensure_finalized() + check.run() + + def get_file_list(self): + """Figure out the list of files to include in the source + distribution, and put it in 'self.filelist'. This might involve + reading the manifest template (and writing the manifest), or just + reading the manifest, or just using the default file set -- it all + depends on the user's options. + """ + # new behavior when using a template: + # the file list is recalculated every time because + # even if MANIFEST.in or setup.py are not changed + # the user might have added some files in the tree that + # need to be included. + # + # This makes --force the default and only behavior with templates. + template_exists = os.path.isfile(self.template) + if not template_exists and self._manifest_is_not_generated(): + self.read_manifest() + self.filelist.sort() + self.filelist.remove_duplicates() + return + + if not template_exists: + self.warn(("manifest template '%s' does not exist " + + "(using default file list)") % + self.template) + self.filelist.findall() + + if self.use_defaults: + self.add_defaults() + + if template_exists: + self.read_template() + + if self.prune: + self.prune_file_list() + + self.filelist.sort() + self.filelist.remove_duplicates() + self.write_manifest() + + def add_defaults(self): + """Add all the default files to self.filelist: + - README or README.txt + - setup.py + - test/test*.py + - all pure Python modules mentioned in setup script + - all files pointed by package_data (build_py) + - all files defined in data_files. + - all files defined as scripts. + - all C sources listed as part of extensions or C libraries + in the setup script (doesn't catch C headers!) + Warns if (README or README.txt) or setup.py are missing; everything + else is optional. + """ + self._add_defaults_standards() + self._add_defaults_optional() + self._add_defaults_python() + self._add_defaults_data_files() + self._add_defaults_ext() + self._add_defaults_c_libs() + self._add_defaults_scripts() + + @staticmethod + def _cs_path_exists(fspath): + """ + Case-sensitive path existence check + + >>> sdist._cs_path_exists(__file__) + True + >>> sdist._cs_path_exists(__file__.upper()) + False + """ + if not os.path.exists(fspath): + return False + # make absolute so we always have a directory + abspath = os.path.abspath(fspath) + directory, filename = os.path.split(abspath) + return filename in os.listdir(directory) + + def _add_defaults_standards(self): + standards = [self.READMES, self.distribution.script_name] + for fn in standards: + if isinstance(fn, tuple): + alts = fn + got_it = False + for fn in alts: + if self._cs_path_exists(fn): + got_it = True + self.filelist.append(fn) + break + + if not got_it: + self.warn("standard file not found: should have one of " + + ', '.join(alts)) + else: + if self._cs_path_exists(fn): + self.filelist.append(fn) + else: + self.warn("standard file '%s' not found" % fn) + + def _add_defaults_optional(self): + optional = ['test/test*.py', 'setup.cfg'] + for pattern in optional: + files = filter(os.path.isfile, glob(pattern)) + self.filelist.extend(files) + + def _add_defaults_python(self): + # build_py is used to get: + # - python modules + # - files defined in package_data + build_py = self.get_finalized_command('build_py') + + # getting python files + if self.distribution.has_pure_modules(): + self.filelist.extend(build_py.get_source_files()) + + # getting package_data files + # (computed in build_py.data_files by build_py.finalize_options) + for pkg, src_dir, build_dir, filenames in build_py.data_files: + for filename in filenames: + self.filelist.append(os.path.join(src_dir, filename)) + + def _add_defaults_data_files(self): + # getting distribution.data_files + if self.distribution.has_data_files(): + for item in self.distribution.data_files: + if isinstance(item, str): + # plain file + item = convert_path(item) + if os.path.isfile(item): + self.filelist.append(item) + else: + # a (dirname, filenames) tuple + dirname, filenames = item + for f in filenames: + f = convert_path(f) + if os.path.isfile(f): + self.filelist.append(f) + + def _add_defaults_ext(self): + if self.distribution.has_ext_modules(): + build_ext = self.get_finalized_command('build_ext') + self.filelist.extend(build_ext.get_source_files()) + + def _add_defaults_c_libs(self): + if self.distribution.has_c_libraries(): + build_clib = self.get_finalized_command('build_clib') + self.filelist.extend(build_clib.get_source_files()) + + def _add_defaults_scripts(self): + if self.distribution.has_scripts(): + build_scripts = self.get_finalized_command('build_scripts') + self.filelist.extend(build_scripts.get_source_files()) + + def read_template(self): + """Read and parse manifest template file named by self.template. + + (usually "MANIFEST.in") The parsing and processing is done by + 'self.filelist', which updates itself accordingly. + """ + log.info("reading manifest template '%s'", self.template) + template = TextFile(self.template, strip_comments=1, skip_blanks=1, + join_lines=1, lstrip_ws=1, rstrip_ws=1, + collapse_join=1) + + try: + while True: + line = template.readline() + if line is None: # end of file + break + + try: + self.filelist.process_template_line(line) + # the call above can raise a DistutilsTemplateError for + # malformed lines, or a ValueError from the lower-level + # convert_path function + except (DistutilsTemplateError, ValueError) as msg: + self.warn("%s, line %d: %s" % (template.filename, + template.current_line, + msg)) + finally: + template.close() + + def prune_file_list(self): + """Prune off branches that might slip into the file list as created + by 'read_template()', but really don't belong there: + * the build tree (typically "build") + * the release tree itself (only an issue if we ran "sdist" + previously with --keep-temp, or it aborted) + * any RCS, CVS, .svn, .hg, .git, .bzr, _darcs directories + """ + build = self.get_finalized_command('build') + base_dir = self.distribution.get_fullname() + + self.filelist.exclude_pattern(None, prefix=build.build_base) + self.filelist.exclude_pattern(None, prefix=base_dir) + + if sys.platform == 'win32': + seps = r'/|\\' + else: + seps = '/' + + vcs_dirs = ['RCS', 'CVS', r'\.svn', r'\.hg', r'\.git', r'\.bzr', + '_darcs'] + vcs_ptrn = r'(^|%s)(%s)(%s).*' % (seps, '|'.join(vcs_dirs), seps) + self.filelist.exclude_pattern(vcs_ptrn, is_regex=1) + + def write_manifest(self): + """Write the file list in 'self.filelist' (presumably as filled in + by 'add_defaults()' and 'read_template()') to the manifest file + named by 'self.manifest'. + """ + if self._manifest_is_not_generated(): + log.info("not writing to manually maintained " + "manifest file '%s'" % self.manifest) + return + + content = self.filelist.files[:] + content.insert(0, '# file GENERATED by distutils, do NOT edit') + self.execute(file_util.write_file, (self.manifest, content), + "writing manifest file '%s'" % self.manifest) + + def _manifest_is_not_generated(self): + # check for special comment used in 3.1.3 and higher + if not os.path.isfile(self.manifest): + return False + + fp = open(self.manifest) + try: + first_line = fp.readline() + finally: + fp.close() + return first_line != '# file GENERATED by distutils, do NOT edit\n' + + def read_manifest(self): + """Read the manifest file (named by 'self.manifest') and use it to + fill in 'self.filelist', the list of files to include in the source + distribution. + """ + log.info("reading manifest file '%s'", self.manifest) + with open(self.manifest) as manifest: + for line in manifest: + # ignore comments and blank lines + line = line.strip() + if line.startswith('#') or not line: + continue + self.filelist.append(line) + + def make_release_tree(self, base_dir, files): + """Create the directory tree that will become the source + distribution archive. All directories implied by the filenames in + 'files' are created under 'base_dir', and then we hard link or copy + (if hard linking is unavailable) those files into place. + Essentially, this duplicates the developer's source tree, but in a + directory named after the distribution, containing only the files + to be distributed. + """ + # Create all the directories under 'base_dir' necessary to + # put 'files' there; the 'mkpath()' is just so we don't die + # if the manifest happens to be empty. + self.mkpath(base_dir) + dir_util.create_tree(base_dir, files, dry_run=self.dry_run) + + # And walk over the list of files, either making a hard link (if + # os.link exists) to each one that doesn't already exist in its + # corresponding location under 'base_dir', or copying each file + # that's out-of-date in 'base_dir'. (Usually, all files will be + # out-of-date, because by default we blow away 'base_dir' when + # we're done making the distribution archives.) + + if hasattr(os, 'link'): # can make hard links on this system + link = 'hard' + msg = "making hard links in %s..." % base_dir + else: # nope, have to copy + link = None + msg = "copying files to %s..." % base_dir + + if not files: + log.warn("no files to distribute -- empty manifest?") + else: + log.info(msg) + for file in files: + if not os.path.isfile(file): + log.warn("'%s' not a regular file -- skipping", file) + else: + dest = os.path.join(base_dir, file) + self.copy_file(file, dest, link=link) + + self.distribution.metadata.write_pkg_info(base_dir) + + def make_distribution(self): + """Create the source distribution(s). First, we create the release + tree with 'make_release_tree()'; then, we create all required + archive files (according to 'self.formats') from the release tree. + Finally, we clean up by blowing away the release tree (unless + 'self.keep_temp' is true). The list of archive files created is + stored so it can be retrieved later by 'get_archive_files()'. + """ + # Don't warn about missing meta-data here -- should be (and is!) + # done elsewhere. + base_dir = self.distribution.get_fullname() + base_name = os.path.join(self.dist_dir, base_dir) + + self.make_release_tree(base_dir, self.filelist.files) + archive_files = [] # remember names of files we create + # tar archive must be created last to avoid overwrite and remove + if 'tar' in self.formats: + self.formats.append(self.formats.pop(self.formats.index('tar'))) + + for fmt in self.formats: + file = self.make_archive(base_name, fmt, base_dir=base_dir, + owner=self.owner, group=self.group) + archive_files.append(file) + self.distribution.dist_files.append(('sdist', '', file)) + + self.archive_files = archive_files + + if not self.keep_temp: + dir_util.remove_tree(base_dir, dry_run=self.dry_run) + + def get_archive_files(self): + """Return the list of archive files created when the command + was run, or None if the command hasn't run yet. + """ + return self.archive_files diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/upload.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/upload.py new file mode 100644 index 0000000000000000000000000000000000000000..e0ecb655b93fafaeaad82062591e055219921f7d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/command/upload.py @@ -0,0 +1,215 @@ +""" +distutils.command.upload + +Implements the Distutils 'upload' subcommand (upload package to a package +index). +""" + +import os +import io +import hashlib +from base64 import standard_b64encode +from urllib.error import HTTPError +from urllib.request import urlopen, Request +from urllib.parse import urlparse +from distutils.errors import DistutilsError, DistutilsOptionError +from distutils.core import PyPIRCCommand +from distutils.spawn import spawn +from distutils import log + + +# PyPI Warehouse supports MD5, SHA256, and Blake2 (blake2-256) +# https://bugs.python.org/issue40698 +_FILE_CONTENT_DIGESTS = { + "md5_digest": getattr(hashlib, "md5", None), + "sha256_digest": getattr(hashlib, "sha256", None), + "blake2_256_digest": getattr(hashlib, "blake2b", None), +} + + +class upload(PyPIRCCommand): + + description = "upload binary package to PyPI" + + user_options = PyPIRCCommand.user_options + [ + ('sign', 's', + 'sign files to upload using gpg'), + ('identity=', 'i', 'GPG identity used to sign files'), + ] + + boolean_options = PyPIRCCommand.boolean_options + ['sign'] + + def initialize_options(self): + PyPIRCCommand.initialize_options(self) + self.username = '' + self.password = '' + self.show_response = 0 + self.sign = False + self.identity = None + + def finalize_options(self): + PyPIRCCommand.finalize_options(self) + if self.identity and not self.sign: + raise DistutilsOptionError( + "Must use --sign for --identity to have meaning" + ) + config = self._read_pypirc() + if config != {}: + self.username = config['username'] + self.password = config['password'] + self.repository = config['repository'] + self.realm = config['realm'] + + # getting the password from the distribution + # if previously set by the register command + if not self.password and self.distribution.password: + self.password = self.distribution.password + + def run(self): + if not self.distribution.dist_files: + msg = ("Must create and upload files in one command " + "(e.g. setup.py sdist upload)") + raise DistutilsOptionError(msg) + for command, pyversion, filename in self.distribution.dist_files: + self.upload_file(command, pyversion, filename) + + def upload_file(self, command, pyversion, filename): + # Makes sure the repository URL is compliant + schema, netloc, url, params, query, fragments = \ + urlparse(self.repository) + if params or query or fragments: + raise AssertionError("Incompatible url %s" % self.repository) + + if schema not in ('http', 'https'): + raise AssertionError("unsupported schema " + schema) + + # Sign if requested + if self.sign: + gpg_args = ["gpg", "--detach-sign", "-a", filename] + if self.identity: + gpg_args[2:2] = ["--local-user", self.identity] + spawn(gpg_args, + dry_run=self.dry_run) + + # Fill in the data - send all the meta-data in case we need to + # register a new release + f = open(filename,'rb') + try: + content = f.read() + finally: + f.close() + + meta = self.distribution.metadata + data = { + # action + ':action': 'file_upload', + 'protocol_version': '1', + + # identify release + 'name': meta.get_name(), + 'version': meta.get_version(), + + # file content + 'content': (os.path.basename(filename),content), + 'filetype': command, + 'pyversion': pyversion, + + # additional meta-data + 'metadata_version': '1.0', + 'summary': meta.get_description(), + 'home_page': meta.get_url(), + 'author': meta.get_contact(), + 'author_email': meta.get_contact_email(), + 'license': meta.get_licence(), + 'description': meta.get_long_description(), + 'keywords': meta.get_keywords(), + 'platform': meta.get_platforms(), + 'classifiers': meta.get_classifiers(), + 'download_url': meta.get_download_url(), + # PEP 314 + 'provides': meta.get_provides(), + 'requires': meta.get_requires(), + 'obsoletes': meta.get_obsoletes(), + } + + data['comment'] = '' + + # file content digests + for digest_name, digest_cons in _FILE_CONTENT_DIGESTS.items(): + if digest_cons is None: + continue + try: + data[digest_name] = digest_cons(content).hexdigest() + except ValueError: + # hash digest not available or blocked by security policy + pass + + if self.sign: + with open(filename + ".asc", "rb") as f: + data['gpg_signature'] = (os.path.basename(filename) + ".asc", + f.read()) + + # set up the authentication + user_pass = (self.username + ":" + self.password).encode('ascii') + # The exact encoding of the authentication string is debated. + # Anyway PyPI only accepts ascii for both username or password. + auth = "Basic " + standard_b64encode(user_pass).decode('ascii') + + # Build up the MIME payload for the POST data + boundary = '--------------GHSKFJDLGDS7543FJKLFHRE75642756743254' + sep_boundary = b'\r\n--' + boundary.encode('ascii') + end_boundary = sep_boundary + b'--\r\n' + body = io.BytesIO() + for key, value in data.items(): + title = '\r\nContent-Disposition: form-data; name="%s"' % key + # handle multiple entries for the same name + if not isinstance(value, list): + value = [value] + for value in value: + if type(value) is tuple: + title += '; filename="%s"' % value[0] + value = value[1] + else: + value = str(value).encode('utf-8') + body.write(sep_boundary) + body.write(title.encode('utf-8')) + body.write(b"\r\n\r\n") + body.write(value) + body.write(end_boundary) + body = body.getvalue() + + msg = "Submitting %s to %s" % (filename, self.repository) + self.announce(msg, log.INFO) + + # build the Request + headers = { + 'Content-type': 'multipart/form-data; boundary=%s' % boundary, + 'Content-length': str(len(body)), + 'Authorization': auth, + } + + request = Request(self.repository, data=body, + headers=headers) + # send the data + try: + result = urlopen(request) + status = result.getcode() + reason = result.msg + except HTTPError as e: + status = e.code + reason = e.msg + except OSError as e: + self.announce(str(e), log.ERROR) + raise + + if status == 200: + self.announce('Server response (%s): %s' % (status, reason), + log.INFO) + if self.show_response: + text = self._read_pypi_response(result) + msg = '\n'.join(('-' * 75, text, '-' * 75)) + self.announce(msg, log.INFO) + else: + msg = 'Upload failed (%s): %s' % (status, reason) + self.announce(msg, log.ERROR) + raise DistutilsError(msg) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/Setup.sample b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/Setup.sample new file mode 100644 index 0000000000000000000000000000000000000000..36c4290d8ff482240d7d41e0ed8c7157081ff96c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/Setup.sample @@ -0,0 +1,67 @@ +# Setup file from the pygame project + +#--StartConfig +SDL = -I/usr/include/SDL -D_REENTRANT -lSDL +FONT = -lSDL_ttf +IMAGE = -lSDL_image +MIXER = -lSDL_mixer +SMPEG = -lsmpeg +PNG = -lpng +JPEG = -ljpeg +SCRAP = -lX11 +PORTMIDI = -lportmidi +PORTTIME = -lporttime +#--EndConfig + +#DEBUG = -C-W -C-Wall +DEBUG = + +#the following modules are optional. you will want to compile +#everything you can, but you can ignore ones you don't have +#dependencies for, just comment them out + +imageext src/imageext.c $(SDL) $(IMAGE) $(PNG) $(JPEG) $(DEBUG) +font src/font.c $(SDL) $(FONT) $(DEBUG) +mixer src/mixer.c $(SDL) $(MIXER) $(DEBUG) +mixer_music src/music.c $(SDL) $(MIXER) $(DEBUG) +_numericsurfarray src/_numericsurfarray.c $(SDL) $(DEBUG) +_numericsndarray src/_numericsndarray.c $(SDL) $(MIXER) $(DEBUG) +movie src/movie.c $(SDL) $(SMPEG) $(DEBUG) +scrap src/scrap.c $(SDL) $(SCRAP) $(DEBUG) +_camera src/_camera.c src/camera_v4l2.c src/camera_v4l.c $(SDL) $(DEBUG) +pypm src/pypm.c $(SDL) $(PORTMIDI) $(PORTTIME) $(DEBUG) + +GFX = src/SDL_gfx/SDL_gfxPrimitives.c +#GFX = src/SDL_gfx/SDL_gfxBlitFunc.c src/SDL_gfx/SDL_gfxPrimitives.c +gfxdraw src/gfxdraw.c $(SDL) $(GFX) $(DEBUG) + + + +#these modules are required for pygame to run. they only require +#SDL as a dependency. these should not be altered + +base src/base.c $(SDL) $(DEBUG) +cdrom src/cdrom.c $(SDL) $(DEBUG) +color src/color.c $(SDL) $(DEBUG) +constants src/constants.c $(SDL) $(DEBUG) +display src/display.c $(SDL) $(DEBUG) +event src/event.c $(SDL) $(DEBUG) +fastevent src/fastevent.c src/fastevents.c $(SDL) $(DEBUG) +key src/key.c $(SDL) $(DEBUG) +mouse src/mouse.c $(SDL) $(DEBUG) +rect src/rect.c $(SDL) $(DEBUG) +rwobject src/rwobject.c $(SDL) $(DEBUG) +surface src/surface.c src/alphablit.c src/surface_fill.c $(SDL) $(DEBUG) +surflock src/surflock.c $(SDL) $(DEBUG) +time src/time.c $(SDL) $(DEBUG) +joystick src/joystick.c $(SDL) $(DEBUG) +draw src/draw.c $(SDL) $(DEBUG) +image src/image.c $(SDL) $(DEBUG) +overlay src/overlay.c $(SDL) $(DEBUG) +transform src/transform.c src/rotozoom.c src/scale2x.c src/scale_mmx.c $(SDL) $(DEBUG) +mask src/mask.c src/bitmask.c $(SDL) $(DEBUG) +bufferproxy src/bufferproxy.c $(SDL) $(DEBUG) +pixelarray src/pixelarray.c $(SDL) $(DEBUG) +_arraysurfarray src/_arraysurfarray.c $(SDL) $(DEBUG) + + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__init__.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d7922ffa0113939eccc203e5e0d99328d1a5c0bc --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__init__.py @@ -0,0 +1,31 @@ +"""Test suite for distutils. + +This test suite consists of a collection of test modules in the +distutils.tests package. + +Tests for the command classes in the distutils.command package are +included in distutils.tests as well, instead of using a separate +distutils.command.tests package, since command identification is done +by import rather than matching pre-defined names. + +""" + +import os +import unittest +from test.support.warnings_helper import save_restore_warnings_filters +from test.support import warnings_helper +from test.support import load_package_tests + + +def load_tests(*args): + # bpo-40055: Save/restore warnings filters to leave them unchanged. + # Importing tests imports docutils which imports pkg_resources + # which adds a warnings filter. + with (save_restore_warnings_filters(), + warnings_helper.check_warnings( + ("The distutils.sysconfig module is deprecated", DeprecationWarning), + quiet=True)): + return load_package_tests(os.path.dirname(__file__), *args) + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/__init__.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a3afd9eb46f056bf02841002aec948e296f8c3d5 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/__init__.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/support.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/support.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cf2d71cecc87280b8eb8f9b3926e4cfb7ceb5809 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/support.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_archive_util.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_archive_util.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..69aefda20f5e4d35aa40079e9b1cb80b25654a6d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_archive_util.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_bdist.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_bdist.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..986d4f193724c12b9deeafecc0a1addca85942da Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_bdist.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_bdist_dumb.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_bdist_dumb.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..215ea4b8b9c3b17f73bd4be18852368721de2721 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_bdist_dumb.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_bdist_rpm.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_bdist_rpm.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..70037d5f84e99293db9d5e8a32ba37b8845bf42d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_bdist_rpm.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_build.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_build.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4aa9216f73d3fa9268a8804efcdc15a5cfc29e30 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_build.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_build_clib.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_build_clib.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ad23326c3ab12d4609f44a4ad85654e9a3dbc607 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_build_clib.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_build_ext.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_build_ext.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c62fd0dc7ea8baef89ae58f83f46e9c45f54d94b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_build_ext.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_build_py.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_build_py.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2f6aaa0d85ed1ed688ecade4058ee9b921fcee8b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_build_py.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_build_scripts.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_build_scripts.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b40d06619ee5857be9d222e9ee22f7e2a0f2aa24 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_build_scripts.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_check.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_check.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1157d41479b14785562b7f4ebaad344912fc6aed Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_check.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_clean.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_clean.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..76e670c8952df954748e55c7bd87cc0eb789cb59 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_clean.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_cmd.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_cmd.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6eecec71cd6850891628ba8c0c0fda8234913f12 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_cmd.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_config.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_config.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b89b3304bdb60fe78f87d11a93022b2316f9dbeb Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_config.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_config_cmd.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_config_cmd.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..258983872419f213fb5016c98ace9b5474c3b3c7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_config_cmd.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_core.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_core.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..096e6158ce42deedb1c035d5f0e99308486b2755 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_core.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_cygwinccompiler.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_cygwinccompiler.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5508e5e1aa665ed100f596a0efe6a80d6f6fbe03 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_cygwinccompiler.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_dep_util.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_dep_util.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4dd43634fdccdbf7d516b8140603a1752e4636c6 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_dep_util.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_dir_util.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_dir_util.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2c67fcf50a80f84dfe54f1f5d8464393b8b26e78 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_dir_util.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_dist.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_dist.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ead1da917f484c538587ea6ffb78c202d9a3e804 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_dist.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_extension.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_extension.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b634f4c6e9ef4fd38e1c452b3dffed112e8d1435 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_extension.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_file_util.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_file_util.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fa6a0097cf903a64e970b0f7c43d94cd050c1109 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_file_util.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_filelist.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_filelist.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6fbc4816cd29db7c93e7ed7de63c5093dce1af7b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_filelist.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_install.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_install.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2e775fc17fc47e2831aaa3ba0e56abe890d5143b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_install.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_install_data.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_install_data.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0194840e5b6aa3889ffac788a048a3bf5f1a7745 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_install_data.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_install_headers.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_install_headers.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6cad3f757933dfa2bb9c1544e6cba0322a9c6a35 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_install_headers.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_install_lib.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_install_lib.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..89e54120d358b9d8c23b7166c8a181824a138947 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_install_lib.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_install_scripts.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_install_scripts.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3697714a373f8bbf83fa71d50f638d3f29083036 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_install_scripts.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_log.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_log.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b8e60b8b6a3870e8a028488086521fd4f3bf6dc2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_log.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_msvc9compiler.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_msvc9compiler.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bb49b6c342c68736f61ec8b520bf40c301f7497c Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_msvc9compiler.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_msvccompiler.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_msvccompiler.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9b63b01d52041357e5e445c4a3d915ce35a5ae67 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_msvccompiler.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_register.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_register.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bdde4dc066e4f2e18b1b63147bbd88634c6e304e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_register.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_sdist.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_sdist.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bfd5c797a9f5264ae32183f1db7e6e4ab72217da Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_sdist.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_spawn.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_spawn.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..180d05b9e23bec30bb1e0e6e07e8d19d55794bf7 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_spawn.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_sysconfig.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_sysconfig.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..587ef275c404a7bc68159063eba66a149dcdf234 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_sysconfig.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_text_file.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_text_file.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..de7552a1b3912771c69f6b8d03f7301783186b7d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_text_file.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_unixccompiler.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_unixccompiler.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d4d435bc92f073e56b8335a267b6206ff1e83879 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_unixccompiler.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_upload.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_upload.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e9d2ffdd404020f6b815ffd8ece363bd5f147d44 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_upload.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_util.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_util.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..28427fcb2963a0977dbad8318842b1d7033a0557 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_util.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_version.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_version.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ec8afa20439337ceeffd083ae4527f331d235bbe Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_version.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_versionpredicate.cpython-311.pyc b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_versionpredicate.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..16747365157e5f7cb5329e641b58df2e15a84434 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/__pycache__/test_versionpredicate.cpython-311.pyc differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/includetest.rst b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/includetest.rst new file mode 100644 index 0000000000000000000000000000000000000000..d7b4ae38b09d8683ecc356218b4bbeec512d1816 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/includetest.rst @@ -0,0 +1 @@ +This should be included. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/support.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/support.py new file mode 100644 index 0000000000000000000000000000000000000000..23b907b607efad9afa349290a570b3a32f5b29e3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/support.py @@ -0,0 +1,209 @@ +"""Support code for distutils test cases.""" +import os +import sys +import shutil +import tempfile +import unittest +import sysconfig +from copy import deepcopy +from test.support import os_helper + +from distutils import log +from distutils.log import DEBUG, INFO, WARN, ERROR, FATAL +from distutils.core import Distribution + + +class LoggingSilencer(object): + + def setUp(self): + super().setUp() + self.threshold = log.set_threshold(log.FATAL) + # catching warnings + # when log will be replaced by logging + # we won't need such monkey-patch anymore + self._old_log = log.Log._log + log.Log._log = self._log + self.logs = [] + + def tearDown(self): + log.set_threshold(self.threshold) + log.Log._log = self._old_log + super().tearDown() + + def _log(self, level, msg, args): + if level not in (DEBUG, INFO, WARN, ERROR, FATAL): + raise ValueError('%s wrong log level' % str(level)) + if not isinstance(msg, str): + raise TypeError("msg should be str, not '%.200s'" + % (type(msg).__name__)) + self.logs.append((level, msg, args)) + + def get_logs(self, *levels): + return [msg % args for level, msg, args + in self.logs if level in levels] + + def clear_logs(self): + self.logs = [] + + +class TempdirManager(object): + """Mix-in class that handles temporary directories for test cases. + + This is intended to be used with unittest.TestCase. + """ + + def setUp(self): + super().setUp() + self.old_cwd = os.getcwd() + self.tempdirs = [] + + def tearDown(self): + # Restore working dir, for Solaris and derivatives, where rmdir() + # on the current directory fails. + os.chdir(self.old_cwd) + super().tearDown() + while self.tempdirs: + tmpdir = self.tempdirs.pop() + os_helper.rmtree(tmpdir) + + def mkdtemp(self): + """Create a temporary directory that will be cleaned up. + + Returns the path of the directory. + """ + d = tempfile.mkdtemp() + self.tempdirs.append(d) + return d + + def write_file(self, path, content='xxx'): + """Writes a file in the given path. + + + path can be a string or a sequence. + """ + if isinstance(path, (list, tuple)): + path = os.path.join(*path) + f = open(path, 'w') + try: + f.write(content) + finally: + f.close() + + def create_dist(self, pkg_name='foo', **kw): + """Will generate a test environment. + + This function creates: + - a Distribution instance using keywords + - a temporary directory with a package structure + + It returns the package directory and the distribution + instance. + """ + tmp_dir = self.mkdtemp() + pkg_dir = os.path.join(tmp_dir, pkg_name) + os.mkdir(pkg_dir) + dist = Distribution(attrs=kw) + + return pkg_dir, dist + + +class DummyCommand: + """Class to store options for retrieval via set_undefined_options().""" + + def __init__(self, **kwargs): + for kw, val in kwargs.items(): + setattr(self, kw, val) + + def ensure_finalized(self): + pass + + +class EnvironGuard(object): + + def setUp(self): + super(EnvironGuard, self).setUp() + self.old_environ = deepcopy(os.environ) + + def tearDown(self): + for key, value in self.old_environ.items(): + if os.environ.get(key) != value: + os.environ[key] = value + + for key in tuple(os.environ.keys()): + if key not in self.old_environ: + del os.environ[key] + + super(EnvironGuard, self).tearDown() + + +def copy_xxmodule_c(directory): + """Helper for tests that need the xxmodule.c source file. + + Example use: + + def test_compile(self): + copy_xxmodule_c(self.tmpdir) + self.assertIn('xxmodule.c', os.listdir(self.tmpdir)) + + If the source file can be found, it will be copied to *directory*. If not, + the test will be skipped. Errors during copy are not caught. + """ + filename = _get_xxmodule_path() + if filename is None: + raise unittest.SkipTest('cannot find xxmodule.c (test must run in ' + 'the python build dir)') + shutil.copy(filename, directory) + + +def _get_xxmodule_path(): + srcdir = sysconfig.get_config_var('srcdir') + candidates = [ + # use installed copy if available + os.path.join(os.path.dirname(__file__), 'xxmodule.c'), + # otherwise try using copy from build directory + os.path.join(srcdir, 'Modules', 'xxmodule.c'), + # srcdir mysteriously can be $srcdir/Lib/distutils/tests when + # this file is run from its parent directory, so walk up the + # tree to find the real srcdir + os.path.join(srcdir, '..', '..', '..', 'Modules', 'xxmodule.c'), + ] + for path in candidates: + if os.path.exists(path): + return path + + +def fixup_build_ext(cmd): + """Function needed to make build_ext tests pass. + + When Python was built with --enable-shared on Unix, -L. is not enough to + find libpython.so, because regrtest runs in a tempdir, not in the + source directory where the .so lives. + + When Python was built with in debug mode on Windows, build_ext commands + need their debug attribute set, and it is not done automatically for + some reason. + + This function handles both of these things. Example use: + + cmd = build_ext(dist) + support.fixup_build_ext(cmd) + cmd.ensure_finalized() + + Unlike most other Unix platforms, Mac OS X embeds absolute paths + to shared libraries into executables, so the fixup is not needed there. + """ + if os.name == 'nt': + cmd.debug = sys.executable.endswith('_d.exe') + elif sysconfig.get_config_var('Py_ENABLE_SHARED'): + # To further add to the shared builds fun on Unix, we can't just add + # library_dirs to the Extension() instance because that doesn't get + # plumbed through to the final compiler command. + runshared = sysconfig.get_config_var('RUNSHARED') + if runshared is None: + cmd.library_dirs = ['.'] + else: + if sys.platform == 'darwin': + cmd.library_dirs = [] + else: + name, equals, value = runshared.partition('=') + cmd.library_dirs = [d for d in value.split(os.pathsep) if d] diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_archive_util.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_archive_util.py new file mode 100644 index 0000000000000000000000000000000000000000..66aee1b44b2032ebff09d75ee77e41f0bf0de6d7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_archive_util.py @@ -0,0 +1,393 @@ +# -*- coding: utf-8 -*- +"""Tests for distutils.archive_util.""" +import unittest +import os +import sys +import tarfile +from os.path import splitdrive +import warnings + +from distutils import archive_util +from distutils.archive_util import (check_archive_formats, make_tarball, + make_zipfile, make_archive, + ARCHIVE_FORMATS) +from distutils.spawn import find_executable, spawn +from distutils.tests import support +from test.support import patch +from test.support.os_helper import change_cwd +from test.support.warnings_helper import check_warnings + +try: + import grp + import pwd + UID_GID_SUPPORT = True +except ImportError: + UID_GID_SUPPORT = False + +try: + import zipfile + ZIP_SUPPORT = True +except ImportError: + ZIP_SUPPORT = find_executable('zip') + +try: + import zlib + ZLIB_SUPPORT = True +except ImportError: + ZLIB_SUPPORT = False + +try: + import bz2 +except ImportError: + bz2 = None + +try: + import lzma +except ImportError: + lzma = None + +def can_fs_encode(filename): + """ + Return True if the filename can be saved in the file system. + """ + if os.path.supports_unicode_filenames: + return True + try: + filename.encode(sys.getfilesystemencoding()) + except UnicodeEncodeError: + return False + return True + + +class ArchiveUtilTestCase(support.TempdirManager, + support.LoggingSilencer, + unittest.TestCase): + + @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run') + def test_make_tarball(self, name='archive'): + # creating something to tar + tmpdir = self._create_files() + self._make_tarball(tmpdir, name, '.tar.gz') + # trying an uncompressed one + self._make_tarball(tmpdir, name, '.tar', compress=None) + + @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run') + def test_make_tarball_gzip(self): + tmpdir = self._create_files() + self._make_tarball(tmpdir, 'archive', '.tar.gz', compress='gzip') + + @unittest.skipUnless(bz2, 'Need bz2 support to run') + def test_make_tarball_bzip2(self): + tmpdir = self._create_files() + self._make_tarball(tmpdir, 'archive', '.tar.bz2', compress='bzip2') + + @unittest.skipUnless(lzma, 'Need lzma support to run') + def test_make_tarball_xz(self): + tmpdir = self._create_files() + self._make_tarball(tmpdir, 'archive', '.tar.xz', compress='xz') + + @unittest.skipUnless(can_fs_encode('årchiv'), + 'File system cannot handle this filename') + def test_make_tarball_latin1(self): + """ + Mirror test_make_tarball, except filename contains latin characters. + """ + self.test_make_tarball('årchiv') # note this isn't a real word + + @unittest.skipUnless(can_fs_encode('のアーカイブ'), + 'File system cannot handle this filename') + def test_make_tarball_extended(self): + """ + Mirror test_make_tarball, except filename contains extended + characters outside the latin charset. + """ + self.test_make_tarball('のアーカイブ') # japanese for archive + + def _make_tarball(self, tmpdir, target_name, suffix, **kwargs): + tmpdir2 = self.mkdtemp() + unittest.skipUnless(splitdrive(tmpdir)[0] == splitdrive(tmpdir2)[0], + "source and target should be on same drive") + + base_name = os.path.join(tmpdir2, target_name) + + # working with relative paths to avoid tar warnings + with change_cwd(tmpdir): + make_tarball(splitdrive(base_name)[1], 'dist', **kwargs) + + # check if the compressed tarball was created + tarball = base_name + suffix + self.assertTrue(os.path.exists(tarball)) + self.assertEqual(self._tarinfo(tarball), self._created_files) + + def _tarinfo(self, path): + tar = tarfile.open(path) + try: + names = tar.getnames() + names.sort() + return names + finally: + tar.close() + + _zip_created_files = ['dist/', 'dist/file1', 'dist/file2', + 'dist/sub/', 'dist/sub/file3', 'dist/sub2/'] + _created_files = [p.rstrip('/') for p in _zip_created_files] + + def _create_files(self): + # creating something to tar + tmpdir = self.mkdtemp() + dist = os.path.join(tmpdir, 'dist') + os.mkdir(dist) + self.write_file([dist, 'file1'], 'xxx') + self.write_file([dist, 'file2'], 'xxx') + os.mkdir(os.path.join(dist, 'sub')) + self.write_file([dist, 'sub', 'file3'], 'xxx') + os.mkdir(os.path.join(dist, 'sub2')) + return tmpdir + + @unittest.skipUnless(find_executable('tar') and find_executable('gzip') + and ZLIB_SUPPORT, + 'Need the tar, gzip and zlib command to run') + def test_tarfile_vs_tar(self): + tmpdir = self._create_files() + tmpdir2 = self.mkdtemp() + base_name = os.path.join(tmpdir2, 'archive') + old_dir = os.getcwd() + os.chdir(tmpdir) + try: + make_tarball(base_name, 'dist') + finally: + os.chdir(old_dir) + + # check if the compressed tarball was created + tarball = base_name + '.tar.gz' + self.assertTrue(os.path.exists(tarball)) + + # now create another tarball using `tar` + tarball2 = os.path.join(tmpdir, 'archive2.tar.gz') + tar_cmd = ['tar', '-cf', 'archive2.tar', 'dist'] + gzip_cmd = ['gzip', '-f', '-9', 'archive2.tar'] + old_dir = os.getcwd() + os.chdir(tmpdir) + try: + spawn(tar_cmd) + spawn(gzip_cmd) + finally: + os.chdir(old_dir) + + self.assertTrue(os.path.exists(tarball2)) + # let's compare both tarballs + self.assertEqual(self._tarinfo(tarball), self._created_files) + self.assertEqual(self._tarinfo(tarball2), self._created_files) + + # trying an uncompressed one + base_name = os.path.join(tmpdir2, 'archive') + old_dir = os.getcwd() + os.chdir(tmpdir) + try: + make_tarball(base_name, 'dist', compress=None) + finally: + os.chdir(old_dir) + tarball = base_name + '.tar' + self.assertTrue(os.path.exists(tarball)) + + # now for a dry_run + base_name = os.path.join(tmpdir2, 'archive') + old_dir = os.getcwd() + os.chdir(tmpdir) + try: + make_tarball(base_name, 'dist', compress=None, dry_run=True) + finally: + os.chdir(old_dir) + tarball = base_name + '.tar' + self.assertTrue(os.path.exists(tarball)) + + @unittest.skipUnless(find_executable('compress'), + 'The compress program is required') + def test_compress_deprecated(self): + tmpdir = self._create_files() + base_name = os.path.join(self.mkdtemp(), 'archive') + + # using compress and testing the PendingDeprecationWarning + old_dir = os.getcwd() + os.chdir(tmpdir) + try: + with check_warnings() as w: + warnings.simplefilter("always") + make_tarball(base_name, 'dist', compress='compress') + finally: + os.chdir(old_dir) + tarball = base_name + '.tar.Z' + self.assertTrue(os.path.exists(tarball)) + self.assertEqual(len(w.warnings), 1) + + # same test with dry_run + os.remove(tarball) + old_dir = os.getcwd() + os.chdir(tmpdir) + try: + with check_warnings() as w: + warnings.simplefilter("always") + make_tarball(base_name, 'dist', compress='compress', + dry_run=True) + finally: + os.chdir(old_dir) + self.assertFalse(os.path.exists(tarball)) + self.assertEqual(len(w.warnings), 1) + + @unittest.skipUnless(ZIP_SUPPORT and ZLIB_SUPPORT, + 'Need zip and zlib support to run') + def test_make_zipfile(self): + # creating something to tar + tmpdir = self._create_files() + base_name = os.path.join(self.mkdtemp(), 'archive') + with change_cwd(tmpdir): + make_zipfile(base_name, 'dist') + + # check if the compressed tarball was created + tarball = base_name + '.zip' + self.assertTrue(os.path.exists(tarball)) + with zipfile.ZipFile(tarball) as zf: + self.assertEqual(sorted(zf.namelist()), self._zip_created_files) + + @unittest.skipUnless(ZIP_SUPPORT, 'Need zip support to run') + def test_make_zipfile_no_zlib(self): + patch(self, archive_util.zipfile, 'zlib', None) # force zlib ImportError + + called = [] + zipfile_class = zipfile.ZipFile + def fake_zipfile(*a, **kw): + if kw.get('compression', None) == zipfile.ZIP_STORED: + called.append((a, kw)) + return zipfile_class(*a, **kw) + + patch(self, archive_util.zipfile, 'ZipFile', fake_zipfile) + + # create something to tar and compress + tmpdir = self._create_files() + base_name = os.path.join(self.mkdtemp(), 'archive') + with change_cwd(tmpdir): + make_zipfile(base_name, 'dist') + + tarball = base_name + '.zip' + self.assertEqual(called, + [((tarball, "w"), {'compression': zipfile.ZIP_STORED})]) + self.assertTrue(os.path.exists(tarball)) + with zipfile.ZipFile(tarball) as zf: + self.assertEqual(sorted(zf.namelist()), self._zip_created_files) + + def test_check_archive_formats(self): + self.assertEqual(check_archive_formats(['gztar', 'xxx', 'zip']), + 'xxx') + self.assertIsNone(check_archive_formats(['gztar', 'bztar', 'xztar', + 'ztar', 'tar', 'zip'])) + + def test_make_archive(self): + tmpdir = self.mkdtemp() + base_name = os.path.join(tmpdir, 'archive') + self.assertRaises(ValueError, make_archive, base_name, 'xxx') + + def test_make_archive_cwd(self): + current_dir = os.getcwd() + def _breaks(*args, **kw): + raise RuntimeError() + ARCHIVE_FORMATS['xxx'] = (_breaks, [], 'xxx file') + try: + try: + make_archive('xxx', 'xxx', root_dir=self.mkdtemp()) + except: + pass + self.assertEqual(os.getcwd(), current_dir) + finally: + del ARCHIVE_FORMATS['xxx'] + + def test_make_archive_tar(self): + base_dir = self._create_files() + base_name = os.path.join(self.mkdtemp() , 'archive') + res = make_archive(base_name, 'tar', base_dir, 'dist') + self.assertTrue(os.path.exists(res)) + self.assertEqual(os.path.basename(res), 'archive.tar') + self.assertEqual(self._tarinfo(res), self._created_files) + + @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run') + def test_make_archive_gztar(self): + base_dir = self._create_files() + base_name = os.path.join(self.mkdtemp() , 'archive') + res = make_archive(base_name, 'gztar', base_dir, 'dist') + self.assertTrue(os.path.exists(res)) + self.assertEqual(os.path.basename(res), 'archive.tar.gz') + self.assertEqual(self._tarinfo(res), self._created_files) + + @unittest.skipUnless(bz2, 'Need bz2 support to run') + def test_make_archive_bztar(self): + base_dir = self._create_files() + base_name = os.path.join(self.mkdtemp() , 'archive') + res = make_archive(base_name, 'bztar', base_dir, 'dist') + self.assertTrue(os.path.exists(res)) + self.assertEqual(os.path.basename(res), 'archive.tar.bz2') + self.assertEqual(self._tarinfo(res), self._created_files) + + @unittest.skipUnless(lzma, 'Need xz support to run') + def test_make_archive_xztar(self): + base_dir = self._create_files() + base_name = os.path.join(self.mkdtemp() , 'archive') + res = make_archive(base_name, 'xztar', base_dir, 'dist') + self.assertTrue(os.path.exists(res)) + self.assertEqual(os.path.basename(res), 'archive.tar.xz') + self.assertEqual(self._tarinfo(res), self._created_files) + + def test_make_archive_owner_group(self): + # testing make_archive with owner and group, with various combinations + # this works even if there's not gid/uid support + if UID_GID_SUPPORT: + group = grp.getgrgid(0)[0] + owner = pwd.getpwuid(0)[0] + else: + group = owner = 'root' + + base_dir = self._create_files() + root_dir = self.mkdtemp() + base_name = os.path.join(self.mkdtemp() , 'archive') + res = make_archive(base_name, 'zip', root_dir, base_dir, owner=owner, + group=group) + self.assertTrue(os.path.exists(res)) + + res = make_archive(base_name, 'zip', root_dir, base_dir) + self.assertTrue(os.path.exists(res)) + + res = make_archive(base_name, 'tar', root_dir, base_dir, + owner=owner, group=group) + self.assertTrue(os.path.exists(res)) + + res = make_archive(base_name, 'tar', root_dir, base_dir, + owner='kjhkjhkjg', group='oihohoh') + self.assertTrue(os.path.exists(res)) + + @unittest.skipUnless(ZLIB_SUPPORT, "Requires zlib") + @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support") + def test_tarfile_root_owner(self): + tmpdir = self._create_files() + base_name = os.path.join(self.mkdtemp(), 'archive') + old_dir = os.getcwd() + os.chdir(tmpdir) + group = grp.getgrgid(0)[0] + owner = pwd.getpwuid(0)[0] + try: + archive_name = make_tarball(base_name, 'dist', compress=None, + owner=owner, group=group) + finally: + os.chdir(old_dir) + + # check if the compressed tarball was created + self.assertTrue(os.path.exists(archive_name)) + + # now checks the rights + archive = tarfile.open(archive_name) + try: + for member in archive.getmembers(): + self.assertEqual(member.uid, 0) + self.assertEqual(member.gid, 0) + finally: + archive.close() + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_bdist.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_bdist.py new file mode 100644 index 0000000000000000000000000000000000000000..c53f0ccb17239bee9d18b67ace8cf43711a601a8 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_bdist.py @@ -0,0 +1,47 @@ +"""Tests for distutils.command.bdist.""" +import os +import unittest + +import warnings +with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + from distutils.command.bdist import bdist + from distutils.tests import support + + +class BuildTestCase(support.TempdirManager, + unittest.TestCase): + + def test_formats(self): + # let's create a command and make sure + # we can set the format + dist = self.create_dist()[1] + cmd = bdist(dist) + cmd.formats = ['tar'] + cmd.ensure_finalized() + self.assertEqual(cmd.formats, ['tar']) + + # what formats does bdist offer? + formats = ['bztar', 'gztar', 'rpm', 'tar', 'xztar', 'zip', 'ztar'] + found = sorted(cmd.format_command) + self.assertEqual(found, formats) + + def test_skip_build(self): + # bug #10946: bdist --skip-build should trickle down to subcommands + dist = self.create_dist()[1] + cmd = bdist(dist) + cmd.skip_build = 1 + cmd.ensure_finalized() + dist.command_obj['bdist'] = cmd + + for name in ['bdist_dumb']: # bdist_rpm does not support --skip-build + subcmd = cmd.get_finalized_command(name) + if getattr(subcmd, '_unsupported', False): + # command is not supported on this build + continue + self.assertTrue(subcmd.skip_build, + '%s should take --skip-build from bdist' % name) + + +if __name__ == '__main__': + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_bdist_dumb.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_bdist_dumb.py new file mode 100644 index 0000000000000000000000000000000000000000..b41812bccf692a8b8b144686d98e1efb7f5353b5 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_bdist_dumb.py @@ -0,0 +1,93 @@ +"""Tests for distutils.command.bdist_dumb.""" + +import os +import sys +import zipfile +import unittest + +from distutils.core import Distribution +from distutils.command.bdist_dumb import bdist_dumb +from distutils.tests import support + +SETUP_PY = """\ +from distutils.core import setup +import foo + +setup(name='foo', version='0.1', py_modules=['foo'], + url='xxx', author='xxx', author_email='xxx') + +""" + +try: + import zlib + ZLIB_SUPPORT = True +except ImportError: + ZLIB_SUPPORT = False + + +class BuildDumbTestCase(support.TempdirManager, + support.LoggingSilencer, + support.EnvironGuard, + unittest.TestCase): + + def setUp(self): + super(BuildDumbTestCase, self).setUp() + self.old_location = os.getcwd() + self.old_sys_argv = sys.argv, sys.argv[:] + + def tearDown(self): + os.chdir(self.old_location) + sys.argv = self.old_sys_argv[0] + sys.argv[:] = self.old_sys_argv[1] + super(BuildDumbTestCase, self).tearDown() + + @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run') + def test_simple_built(self): + + # let's create a simple package + tmp_dir = self.mkdtemp() + pkg_dir = os.path.join(tmp_dir, 'foo') + os.mkdir(pkg_dir) + self.write_file((pkg_dir, 'setup.py'), SETUP_PY) + self.write_file((pkg_dir, 'foo.py'), '#') + self.write_file((pkg_dir, 'MANIFEST.in'), 'include foo.py') + self.write_file((pkg_dir, 'README'), '') + + dist = Distribution({'name': 'foo', 'version': '0.1', + 'py_modules': ['foo'], + 'url': 'xxx', 'author': 'xxx', + 'author_email': 'xxx'}) + dist.script_name = 'setup.py' + os.chdir(pkg_dir) + + sys.argv = ['setup.py'] + cmd = bdist_dumb(dist) + + # so the output is the same no matter + # what is the platform + cmd.format = 'zip' + + cmd.ensure_finalized() + cmd.run() + + # see what we have + dist_created = os.listdir(os.path.join(pkg_dir, 'dist')) + base = "%s.%s.zip" % (dist.get_fullname(), cmd.plat_name) + + self.assertEqual(dist_created, [base]) + + # now let's check what we have in the zip file + fp = zipfile.ZipFile(os.path.join('dist', base)) + try: + contents = fp.namelist() + finally: + fp.close() + + contents = sorted(filter(None, map(os.path.basename, contents))) + wanted = ['foo-0.1-py%s.%s.egg-info' % sys.version_info[:2], 'foo.py'] + if not sys.dont_write_bytecode: + wanted.append('foo.%s.pyc' % sys.implementation.cache_tag) + self.assertEqual(contents, sorted(wanted)) + +if __name__ == '__main__': + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_bdist_rpm.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_bdist_rpm.py new file mode 100644 index 0000000000000000000000000000000000000000..ea9a0bc33623e8723a206052a12e1ab23d78abde --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_bdist_rpm.py @@ -0,0 +1,138 @@ +"""Tests for distutils.command.bdist_rpm.""" + +import unittest +import sys +import os +from test.support import requires_zlib + +from distutils.core import Distribution +from distutils.command.bdist_rpm import bdist_rpm +from distutils.tests import support +from distutils.spawn import find_executable + +SETUP_PY = """\ +from distutils.core import setup +import foo + +setup(name='foo', version='0.1', py_modules=['foo'], + url='xxx', author='xxx', author_email='xxx') + +""" + +class BuildRpmTestCase(support.TempdirManager, + support.EnvironGuard, + support.LoggingSilencer, + unittest.TestCase): + + def setUp(self): + try: + sys.executable.encode("UTF-8") + except UnicodeEncodeError: + raise unittest.SkipTest("sys.executable is not encodable to UTF-8") + + super(BuildRpmTestCase, self).setUp() + self.old_location = os.getcwd() + self.old_sys_argv = sys.argv, sys.argv[:] + + def tearDown(self): + os.chdir(self.old_location) + sys.argv = self.old_sys_argv[0] + sys.argv[:] = self.old_sys_argv[1] + super(BuildRpmTestCase, self).tearDown() + + # XXX I am unable yet to make this test work without + # spurious sdtout/stderr output under Mac OS X + @unittest.skipUnless(sys.platform.startswith('linux'), + 'spurious sdtout/stderr output under Mac OS X') + @requires_zlib() + @unittest.skipIf(find_executable('rpm') is None, + 'the rpm command is not found') + @unittest.skipIf(find_executable('rpmbuild') is None, + 'the rpmbuild command is not found') + # import foo fails with safe path + @unittest.skipIf(sys.flags.safe_path, + 'PYTHONSAFEPATH changes default sys.path') + def test_quiet(self): + # let's create a package + tmp_dir = self.mkdtemp() + os.environ['HOME'] = tmp_dir # to confine dir '.rpmdb' creation + pkg_dir = os.path.join(tmp_dir, 'foo') + os.mkdir(pkg_dir) + self.write_file((pkg_dir, 'setup.py'), SETUP_PY) + self.write_file((pkg_dir, 'foo.py'), '#') + self.write_file((pkg_dir, 'MANIFEST.in'), 'include foo.py') + self.write_file((pkg_dir, 'README'), '') + + dist = Distribution({'name': 'foo', 'version': '0.1', + 'py_modules': ['foo'], + 'url': 'xxx', 'author': 'xxx', + 'author_email': 'xxx'}) + dist.script_name = 'setup.py' + os.chdir(pkg_dir) + + sys.argv = ['setup.py'] + cmd = bdist_rpm(dist) + cmd.fix_python = True + + # running in quiet mode + cmd.quiet = 1 + cmd.ensure_finalized() + cmd.run() + + dist_created = os.listdir(os.path.join(pkg_dir, 'dist')) + self.assertIn('foo-0.1-1.noarch.rpm', dist_created) + + # bug #2945: upload ignores bdist_rpm files + self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.src.rpm'), dist.dist_files) + self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.noarch.rpm'), dist.dist_files) + + # XXX I am unable yet to make this test work without + # spurious sdtout/stderr output under Mac OS X + @unittest.skipUnless(sys.platform.startswith('linux'), + 'spurious sdtout/stderr output under Mac OS X') + @requires_zlib() + # http://bugs.python.org/issue1533164 + @unittest.skipIf(find_executable('rpm') is None, + 'the rpm command is not found') + @unittest.skipIf(find_executable('rpmbuild') is None, + 'the rpmbuild command is not found') + # import foo fails with safe path + @unittest.skipIf(sys.flags.safe_path, + 'PYTHONSAFEPATH changes default sys.path') + def test_no_optimize_flag(self): + # let's create a package that breaks bdist_rpm + tmp_dir = self.mkdtemp() + os.environ['HOME'] = tmp_dir # to confine dir '.rpmdb' creation + pkg_dir = os.path.join(tmp_dir, 'foo') + os.mkdir(pkg_dir) + self.write_file((pkg_dir, 'setup.py'), SETUP_PY) + self.write_file((pkg_dir, 'foo.py'), '#') + self.write_file((pkg_dir, 'MANIFEST.in'), 'include foo.py') + self.write_file((pkg_dir, 'README'), '') + + dist = Distribution({'name': 'foo', 'version': '0.1', + 'py_modules': ['foo'], + 'url': 'xxx', 'author': 'xxx', + 'author_email': 'xxx'}) + dist.script_name = 'setup.py' + os.chdir(pkg_dir) + + sys.argv = ['setup.py'] + cmd = bdist_rpm(dist) + cmd.fix_python = True + + cmd.quiet = 1 + cmd.ensure_finalized() + cmd.run() + + dist_created = os.listdir(os.path.join(pkg_dir, 'dist')) + self.assertIn('foo-0.1-1.noarch.rpm', dist_created) + + # bug #2945: upload ignores bdist_rpm files + self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.src.rpm'), dist.dist_files) + self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.noarch.rpm'), dist.dist_files) + + os.remove(os.path.join(pkg_dir, 'dist', 'foo-0.1-1.noarch.rpm')) + +if __name__ == '__main__': + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_build.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_build.py new file mode 100644 index 0000000000000000000000000000000000000000..c7c564d04774db59a6ea68daff4834daa2f3efcf --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_build.py @@ -0,0 +1,53 @@ +"""Tests for distutils.command.build.""" +import unittest +import os +import sys + +from distutils.command.build import build +from distutils.tests import support +from sysconfig import get_platform + +class BuildTestCase(support.TempdirManager, + support.LoggingSilencer, + unittest.TestCase): + + @unittest.skipUnless(sys.executable, "test requires sys.executable") + def test_finalize_options(self): + pkg_dir, dist = self.create_dist() + cmd = build(dist) + cmd.finalize_options() + + # if not specified, plat_name gets the current platform + self.assertEqual(cmd.plat_name, get_platform()) + + # build_purelib is build + lib + wanted = os.path.join(cmd.build_base, 'lib') + self.assertEqual(cmd.build_purelib, wanted) + + # build_platlib is 'build/lib.platform-x.x[-pydebug]' + # examples: + # build/lib.macosx-10.3-i386-2.7 + plat_spec = '.%s-%d.%d' % (cmd.plat_name, *sys.version_info[:2]) + if hasattr(sys, 'gettotalrefcount'): + self.assertTrue(cmd.build_platlib.endswith('-pydebug')) + plat_spec += '-pydebug' + wanted = os.path.join(cmd.build_base, 'lib' + plat_spec) + self.assertEqual(cmd.build_platlib, wanted) + + # by default, build_lib = build_purelib + self.assertEqual(cmd.build_lib, cmd.build_purelib) + + # build_temp is build/temp. + wanted = os.path.join(cmd.build_base, 'temp' + plat_spec) + self.assertEqual(cmd.build_temp, wanted) + + # build_scripts is build/scripts-x.x + wanted = os.path.join(cmd.build_base, + 'scripts-%d.%d' % sys.version_info[:2]) + self.assertEqual(cmd.build_scripts, wanted) + + # executable is os.path.normpath(sys.executable) + self.assertEqual(cmd.executable, os.path.normpath(sys.executable)) + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_build_clib.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_build_clib.py new file mode 100644 index 0000000000000000000000000000000000000000..0c3bc49e8e9760a0612aed04a8bfcf42ede9c2fc --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_build_clib.py @@ -0,0 +1,144 @@ +"""Tests for distutils.command.build_clib.""" +import unittest +import os +import sys +import sysconfig + +from test.support import ( + missing_compiler_executable, requires_subprocess +) + +from distutils.command.build_clib import build_clib +from distutils.errors import DistutilsSetupError +from distutils.tests import support + +class BuildCLibTestCase(support.TempdirManager, + support.LoggingSilencer, + unittest.TestCase): + + def setUp(self): + super().setUp() + self._backup_CONFIG_VARS = dict(sysconfig._CONFIG_VARS) + + def tearDown(self): + super().tearDown() + sysconfig._CONFIG_VARS.clear() + sysconfig._CONFIG_VARS.update(self._backup_CONFIG_VARS) + + def test_check_library_dist(self): + pkg_dir, dist = self.create_dist() + cmd = build_clib(dist) + + # 'libraries' option must be a list + self.assertRaises(DistutilsSetupError, cmd.check_library_list, 'foo') + + # each element of 'libraries' must a 2-tuple + self.assertRaises(DistutilsSetupError, cmd.check_library_list, + ['foo1', 'foo2']) + + # first element of each tuple in 'libraries' + # must be a string (the library name) + self.assertRaises(DistutilsSetupError, cmd.check_library_list, + [(1, 'foo1'), ('name', 'foo2')]) + + # library name may not contain directory separators + self.assertRaises(DistutilsSetupError, cmd.check_library_list, + [('name', 'foo1'), + ('another/name', 'foo2')]) + + # second element of each tuple must be a dictionary (build info) + self.assertRaises(DistutilsSetupError, cmd.check_library_list, + [('name', {}), + ('another', 'foo2')]) + + # those work + libs = [('name', {}), ('name', {'ok': 'good'})] + cmd.check_library_list(libs) + + def test_get_source_files(self): + pkg_dir, dist = self.create_dist() + cmd = build_clib(dist) + + # "in 'libraries' option 'sources' must be present and must be + # a list of source filenames + cmd.libraries = [('name', {})] + self.assertRaises(DistutilsSetupError, cmd.get_source_files) + + cmd.libraries = [('name', {'sources': 1})] + self.assertRaises(DistutilsSetupError, cmd.get_source_files) + + cmd.libraries = [('name', {'sources': ['a', 'b']})] + self.assertEqual(cmd.get_source_files(), ['a', 'b']) + + cmd.libraries = [('name', {'sources': ('a', 'b')})] + self.assertEqual(cmd.get_source_files(), ['a', 'b']) + + cmd.libraries = [('name', {'sources': ('a', 'b')}), + ('name2', {'sources': ['c', 'd']})] + self.assertEqual(cmd.get_source_files(), ['a', 'b', 'c', 'd']) + + def test_build_libraries(self): + + pkg_dir, dist = self.create_dist() + cmd = build_clib(dist) + class FakeCompiler: + def compile(*args, **kw): + pass + create_static_lib = compile + + cmd.compiler = FakeCompiler() + + # build_libraries is also doing a bit of typo checking + lib = [('name', {'sources': 'notvalid'})] + self.assertRaises(DistutilsSetupError, cmd.build_libraries, lib) + + lib = [('name', {'sources': list()})] + cmd.build_libraries(lib) + + lib = [('name', {'sources': tuple()})] + cmd.build_libraries(lib) + + def test_finalize_options(self): + pkg_dir, dist = self.create_dist() + cmd = build_clib(dist) + + cmd.include_dirs = 'one-dir' + cmd.finalize_options() + self.assertEqual(cmd.include_dirs, ['one-dir']) + + cmd.include_dirs = None + cmd.finalize_options() + self.assertEqual(cmd.include_dirs, []) + + cmd.distribution.libraries = 'WONTWORK' + self.assertRaises(DistutilsSetupError, cmd.finalize_options) + + @unittest.skipIf(sys.platform == 'win32', "can't test on Windows") + @requires_subprocess() + def test_run(self): + pkg_dir, dist = self.create_dist() + cmd = build_clib(dist) + + foo_c = os.path.join(pkg_dir, 'foo.c') + self.write_file(foo_c, 'int main(void) { return 1;}\n') + cmd.libraries = [('foo', {'sources': [foo_c]})] + + build_temp = os.path.join(pkg_dir, 'build') + os.mkdir(build_temp) + cmd.build_temp = build_temp + cmd.build_clib = build_temp + + # Before we run the command, we want to make sure + # all commands are present on the system. + ccmd = missing_compiler_executable() + if ccmd is not None: + self.skipTest('The %r command is not found' % ccmd) + + # this should work + cmd.run() + + # let's check the result + self.assertIn('libfoo.a', os.listdir(build_temp)) + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_build_ext.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_build_ext.py new file mode 100644 index 0000000000000000000000000000000000000000..e89dc50665be4736b53089d71a6a29b118960942 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_build_ext.py @@ -0,0 +1,549 @@ +import sys +import os +from io import StringIO +import textwrap + +from distutils.core import Distribution +from distutils.command.build_ext import build_ext +from distutils import sysconfig +from distutils.tests.support import (TempdirManager, LoggingSilencer, + copy_xxmodule_c, fixup_build_ext) +from distutils.extension import Extension +from distutils.errors import ( + CompileError, DistutilsPlatformError, DistutilsSetupError, + UnknownFileError) + +import unittest +from test import support +from test.support import os_helper +from test.support.script_helper import assert_python_ok +from test.support import threading_helper + +# http://bugs.python.org/issue4373 +# Don't load the xx module more than once. +ALREADY_TESTED = False + + +class BuildExtTestCase(TempdirManager, + LoggingSilencer, + unittest.TestCase): + def setUp(self): + # Create a simple test environment + super(BuildExtTestCase, self).setUp() + self.tmp_dir = self.mkdtemp() + import site + self.old_user_base = site.USER_BASE + site.USER_BASE = self.mkdtemp() + from distutils.command import build_ext + build_ext.USER_BASE = site.USER_BASE + self.old_config_vars = dict(sysconfig._config_vars) + + # bpo-30132: On Windows, a .pdb file may be created in the current + # working directory. Create a temporary working directory to cleanup + # everything at the end of the test. + self.enterContext(os_helper.change_cwd(self.tmp_dir)) + + def tearDown(self): + import site + site.USER_BASE = self.old_user_base + from distutils.command import build_ext + build_ext.USER_BASE = self.old_user_base + sysconfig._config_vars.clear() + sysconfig._config_vars.update(self.old_config_vars) + super(BuildExtTestCase, self).tearDown() + + def build_ext(self, *args, **kwargs): + return build_ext(*args, **kwargs) + + @support.requires_subprocess() + def test_build_ext(self): + cmd = support.missing_compiler_executable() + if cmd is not None: + self.skipTest('The %r command is not found' % cmd) + global ALREADY_TESTED + copy_xxmodule_c(self.tmp_dir) + xx_c = os.path.join(self.tmp_dir, 'xxmodule.c') + xx_ext = Extension('xx', [xx_c]) + dist = Distribution({'name': 'xx', 'ext_modules': [xx_ext]}) + dist.package_dir = self.tmp_dir + cmd = self.build_ext(dist) + fixup_build_ext(cmd) + cmd.build_lib = self.tmp_dir + cmd.build_temp = self.tmp_dir + + old_stdout = sys.stdout + if not support.verbose: + # silence compiler output + sys.stdout = StringIO() + try: + cmd.ensure_finalized() + cmd.run() + finally: + sys.stdout = old_stdout + + if ALREADY_TESTED: + self.skipTest('Already tested in %s' % ALREADY_TESTED) + else: + ALREADY_TESTED = type(self).__name__ + + code = textwrap.dedent(f""" + tmp_dir = {self.tmp_dir!r} + + import sys + import unittest + from test import support + + sys.path.insert(0, tmp_dir) + import xx + + class Tests(unittest.TestCase): + def test_xx(self): + for attr in ('error', 'foo', 'new', 'roj'): + self.assertTrue(hasattr(xx, attr)) + + self.assertEqual(xx.foo(2, 5), 7) + self.assertEqual(xx.foo(13,15), 28) + self.assertEqual(xx.new().demo(), None) + if support.HAVE_DOCSTRINGS: + doc = 'This is a template module just for instruction.' + self.assertEqual(xx.__doc__, doc) + self.assertIsInstance(xx.Null(), xx.Null) + self.assertIsInstance(xx.Str(), xx.Str) + + + unittest.main() + """) + assert_python_ok('-c', code) + + def test_solaris_enable_shared(self): + dist = Distribution({'name': 'xx'}) + cmd = self.build_ext(dist) + old = sys.platform + + sys.platform = 'sunos' # fooling finalize_options + from distutils.sysconfig import _config_vars + old_var = _config_vars.get('Py_ENABLE_SHARED') + _config_vars['Py_ENABLE_SHARED'] = 1 + try: + cmd.ensure_finalized() + finally: + sys.platform = old + if old_var is None: + del _config_vars['Py_ENABLE_SHARED'] + else: + _config_vars['Py_ENABLE_SHARED'] = old_var + + # make sure we get some library dirs under solaris + self.assertGreater(len(cmd.library_dirs), 0) + + def test_user_site(self): + import site + dist = Distribution({'name': 'xx'}) + cmd = self.build_ext(dist) + + # making sure the user option is there + options = [name for name, short, lable in + cmd.user_options] + self.assertIn('user', options) + + # setting a value + cmd.user = 1 + + # setting user based lib and include + lib = os.path.join(site.USER_BASE, 'lib') + incl = os.path.join(site.USER_BASE, 'include') + os.mkdir(lib) + os.mkdir(incl) + + # let's run finalize + cmd.ensure_finalized() + + # see if include_dirs and library_dirs + # were set + self.assertIn(lib, cmd.library_dirs) + self.assertIn(lib, cmd.rpath) + self.assertIn(incl, cmd.include_dirs) + + @threading_helper.requires_working_threading() + def test_optional_extension(self): + + # this extension will fail, but let's ignore this failure + # with the optional argument. + modules = [Extension('foo', ['xxx'], optional=False)] + dist = Distribution({'name': 'xx', 'ext_modules': modules}) + cmd = self.build_ext(dist) + cmd.ensure_finalized() + self.assertRaises((UnknownFileError, CompileError), + cmd.run) # should raise an error + + modules = [Extension('foo', ['xxx'], optional=True)] + dist = Distribution({'name': 'xx', 'ext_modules': modules}) + cmd = self.build_ext(dist) + cmd.ensure_finalized() + cmd.run() # should pass + + def test_finalize_options(self): + # Make sure Python's include directories (for Python.h, pyconfig.h, + # etc.) are in the include search path. + modules = [Extension('foo', ['xxx'], optional=False)] + dist = Distribution({'name': 'xx', 'ext_modules': modules}) + cmd = self.build_ext(dist) + cmd.finalize_options() + + py_include = sysconfig.get_python_inc() + for p in py_include.split(os.path.pathsep): + self.assertIn(p, cmd.include_dirs) + + plat_py_include = sysconfig.get_python_inc(plat_specific=1) + for p in plat_py_include.split(os.path.pathsep): + self.assertIn(p, cmd.include_dirs) + + # make sure cmd.libraries is turned into a list + # if it's a string + cmd = self.build_ext(dist) + cmd.libraries = 'my_lib, other_lib lastlib' + cmd.finalize_options() + self.assertEqual(cmd.libraries, ['my_lib', 'other_lib', 'lastlib']) + + # make sure cmd.library_dirs is turned into a list + # if it's a string + cmd = self.build_ext(dist) + cmd.library_dirs = 'my_lib_dir%sother_lib_dir' % os.pathsep + cmd.finalize_options() + self.assertIn('my_lib_dir', cmd.library_dirs) + self.assertIn('other_lib_dir', cmd.library_dirs) + + # make sure rpath is turned into a list + # if it's a string + cmd = self.build_ext(dist) + cmd.rpath = 'one%stwo' % os.pathsep + cmd.finalize_options() + self.assertEqual(cmd.rpath, ['one', 'two']) + + # make sure cmd.link_objects is turned into a list + # if it's a string + cmd = build_ext(dist) + cmd.link_objects = 'one two,three' + cmd.finalize_options() + self.assertEqual(cmd.link_objects, ['one', 'two', 'three']) + + # XXX more tests to perform for win32 + + # make sure define is turned into 2-tuples + # strings if they are ','-separated strings + cmd = self.build_ext(dist) + cmd.define = 'one,two' + cmd.finalize_options() + self.assertEqual(cmd.define, [('one', '1'), ('two', '1')]) + + # make sure undef is turned into a list of + # strings if they are ','-separated strings + cmd = self.build_ext(dist) + cmd.undef = 'one,two' + cmd.finalize_options() + self.assertEqual(cmd.undef, ['one', 'two']) + + # make sure swig_opts is turned into a list + cmd = self.build_ext(dist) + cmd.swig_opts = None + cmd.finalize_options() + self.assertEqual(cmd.swig_opts, []) + + cmd = self.build_ext(dist) + cmd.swig_opts = '1 2' + cmd.finalize_options() + self.assertEqual(cmd.swig_opts, ['1', '2']) + + def test_check_extensions_list(self): + dist = Distribution() + cmd = self.build_ext(dist) + cmd.finalize_options() + + #'extensions' option must be a list of Extension instances + self.assertRaises(DistutilsSetupError, + cmd.check_extensions_list, 'foo') + + # each element of 'ext_modules' option must be an + # Extension instance or 2-tuple + exts = [('bar', 'foo', 'bar'), 'foo'] + self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts) + + # first element of each tuple in 'ext_modules' + # must be the extension name (a string) and match + # a python dotted-separated name + exts = [('foo-bar', '')] + self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts) + + # second element of each tuple in 'ext_modules' + # must be a dictionary (build info) + exts = [('foo.bar', '')] + self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts) + + # ok this one should pass + exts = [('foo.bar', {'sources': [''], 'libraries': 'foo', + 'some': 'bar'})] + cmd.check_extensions_list(exts) + ext = exts[0] + self.assertIsInstance(ext, Extension) + + # check_extensions_list adds in ext the values passed + # when they are in ('include_dirs', 'library_dirs', 'libraries' + # 'extra_objects', 'extra_compile_args', 'extra_link_args') + self.assertEqual(ext.libraries, 'foo') + self.assertFalse(hasattr(ext, 'some')) + + # 'macros' element of build info dict must be 1- or 2-tuple + exts = [('foo.bar', {'sources': [''], 'libraries': 'foo', + 'some': 'bar', 'macros': [('1', '2', '3'), 'foo']})] + self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts) + + exts[0][1]['macros'] = [('1', '2'), ('3',)] + cmd.check_extensions_list(exts) + self.assertEqual(exts[0].undef_macros, ['3']) + self.assertEqual(exts[0].define_macros, [('1', '2')]) + + def test_get_source_files(self): + modules = [Extension('foo', ['xxx'], optional=False)] + dist = Distribution({'name': 'xx', 'ext_modules': modules}) + cmd = self.build_ext(dist) + cmd.ensure_finalized() + self.assertEqual(cmd.get_source_files(), ['xxx']) + + def test_unicode_module_names(self): + modules = [ + Extension('foo', ['aaa'], optional=False), + Extension('föö', ['uuu'], optional=False), + ] + dist = Distribution({'name': 'xx', 'ext_modules': modules}) + cmd = self.build_ext(dist) + cmd.ensure_finalized() + self.assertRegex(cmd.get_ext_filename(modules[0].name), r'foo(_d)?\..*') + self.assertRegex(cmd.get_ext_filename(modules[1].name), r'föö(_d)?\..*') + self.assertEqual(cmd.get_export_symbols(modules[0]), ['PyInit_foo']) + self.assertEqual(cmd.get_export_symbols(modules[1]), ['PyInitU_f_gkaa']) + + def test_compiler_option(self): + # cmd.compiler is an option and + # should not be overridden by a compiler instance + # when the command is run + dist = Distribution() + cmd = self.build_ext(dist) + cmd.compiler = 'unix' + cmd.ensure_finalized() + cmd.run() + self.assertEqual(cmd.compiler, 'unix') + + @support.requires_subprocess() + def test_get_outputs(self): + cmd = support.missing_compiler_executable() + if cmd is not None: + self.skipTest('The %r command is not found' % cmd) + tmp_dir = self.mkdtemp() + c_file = os.path.join(tmp_dir, 'foo.c') + self.write_file(c_file, 'void PyInit_foo(void) {}\n') + ext = Extension('foo', [c_file], optional=False) + dist = Distribution({'name': 'xx', + 'ext_modules': [ext]}) + cmd = self.build_ext(dist) + fixup_build_ext(cmd) + cmd.ensure_finalized() + self.assertEqual(len(cmd.get_outputs()), 1) + + cmd.build_lib = os.path.join(self.tmp_dir, 'build') + cmd.build_temp = os.path.join(self.tmp_dir, 'tempt') + + # issue #5977 : distutils build_ext.get_outputs + # returns wrong result with --inplace + other_tmp_dir = os.path.realpath(self.mkdtemp()) + old_wd = os.getcwd() + os.chdir(other_tmp_dir) + try: + cmd.inplace = 1 + cmd.run() + so_file = cmd.get_outputs()[0] + finally: + os.chdir(old_wd) + self.assertTrue(os.path.exists(so_file)) + ext_suffix = sysconfig.get_config_var('EXT_SUFFIX') + self.assertTrue(so_file.endswith(ext_suffix)) + so_dir = os.path.dirname(so_file) + self.assertEqual(so_dir, other_tmp_dir) + + cmd.inplace = 0 + cmd.compiler = None + cmd.run() + so_file = cmd.get_outputs()[0] + self.assertTrue(os.path.exists(so_file)) + self.assertTrue(so_file.endswith(ext_suffix)) + so_dir = os.path.dirname(so_file) + self.assertEqual(so_dir, cmd.build_lib) + + # inplace = 0, cmd.package = 'bar' + build_py = cmd.get_finalized_command('build_py') + build_py.package_dir = {'': 'bar'} + path = cmd.get_ext_fullpath('foo') + # checking that the last directory is the build_dir + path = os.path.split(path)[0] + self.assertEqual(path, cmd.build_lib) + + # inplace = 1, cmd.package = 'bar' + cmd.inplace = 1 + other_tmp_dir = os.path.realpath(self.mkdtemp()) + old_wd = os.getcwd() + os.chdir(other_tmp_dir) + try: + path = cmd.get_ext_fullpath('foo') + finally: + os.chdir(old_wd) + # checking that the last directory is bar + path = os.path.split(path)[0] + lastdir = os.path.split(path)[-1] + self.assertEqual(lastdir, 'bar') + + def test_ext_fullpath(self): + ext = sysconfig.get_config_var('EXT_SUFFIX') + # building lxml.etree inplace + #etree_c = os.path.join(self.tmp_dir, 'lxml.etree.c') + #etree_ext = Extension('lxml.etree', [etree_c]) + #dist = Distribution({'name': 'lxml', 'ext_modules': [etree_ext]}) + dist = Distribution() + cmd = self.build_ext(dist) + cmd.inplace = 1 + cmd.distribution.package_dir = {'': 'src'} + cmd.distribution.packages = ['lxml', 'lxml.html'] + curdir = os.getcwd() + wanted = os.path.join(curdir, 'src', 'lxml', 'etree' + ext) + path = cmd.get_ext_fullpath('lxml.etree') + self.assertEqual(wanted, path) + + # building lxml.etree not inplace + cmd.inplace = 0 + cmd.build_lib = os.path.join(curdir, 'tmpdir') + wanted = os.path.join(curdir, 'tmpdir', 'lxml', 'etree' + ext) + path = cmd.get_ext_fullpath('lxml.etree') + self.assertEqual(wanted, path) + + # building twisted.runner.portmap not inplace + build_py = cmd.get_finalized_command('build_py') + build_py.package_dir = {} + cmd.distribution.packages = ['twisted', 'twisted.runner.portmap'] + path = cmd.get_ext_fullpath('twisted.runner.portmap') + wanted = os.path.join(curdir, 'tmpdir', 'twisted', 'runner', + 'portmap' + ext) + self.assertEqual(wanted, path) + + # building twisted.runner.portmap inplace + cmd.inplace = 1 + path = cmd.get_ext_fullpath('twisted.runner.portmap') + wanted = os.path.join(curdir, 'twisted', 'runner', 'portmap' + ext) + self.assertEqual(wanted, path) + + + @unittest.skipUnless(sys.platform == 'darwin', 'test only relevant for MacOSX') + def test_deployment_target_default(self): + # Issue 9516: Test that, in the absence of the environment variable, + # an extension module is compiled with the same deployment target as + # the interpreter. + self._try_compile_deployment_target('==', None) + + @unittest.skipUnless(sys.platform == 'darwin', 'test only relevant for MacOSX') + def test_deployment_target_too_low(self): + # Issue 9516: Test that an extension module is not allowed to be + # compiled with a deployment target less than that of the interpreter. + self.assertRaises(DistutilsPlatformError, + self._try_compile_deployment_target, '>', '10.1') + + @unittest.skipUnless(sys.platform == 'darwin', 'test only relevant for MacOSX') + def test_deployment_target_higher_ok(self): + # Issue 9516: Test that an extension module can be compiled with a + # deployment target higher than that of the interpreter: the ext + # module may depend on some newer OS feature. + deptarget = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') + if deptarget: + # increment the minor version number (i.e. 10.6 -> 10.7) + deptarget = [int(x) for x in deptarget.split('.')] + deptarget[-1] += 1 + deptarget = '.'.join(str(i) for i in deptarget) + self._try_compile_deployment_target('<', deptarget) + + def _try_compile_deployment_target(self, operator, target): + orig_environ = os.environ + os.environ = orig_environ.copy() + self.addCleanup(setattr, os, 'environ', orig_environ) + + if target is None: + if os.environ.get('MACOSX_DEPLOYMENT_TARGET'): + del os.environ['MACOSX_DEPLOYMENT_TARGET'] + else: + os.environ['MACOSX_DEPLOYMENT_TARGET'] = target + + deptarget_c = os.path.join(self.tmp_dir, 'deptargetmodule.c') + + with open(deptarget_c, 'w') as fp: + fp.write(textwrap.dedent('''\ + #include + + int dummy; + + #if TARGET %s MAC_OS_X_VERSION_MIN_REQUIRED + #else + #error "Unexpected target" + #endif + + ''' % operator)) + + # get the deployment target that the interpreter was built with + target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') + target = tuple(map(int, target.split('.')[0:2])) + # format the target value as defined in the Apple + # Availability Macros. We can't use the macro names since + # at least one value we test with will not exist yet. + if target[:2] < (10, 10): + # for 10.1 through 10.9.x -> "10n0" + target = '%02d%01d0' % target + else: + # for 10.10 and beyond -> "10nn00" + if len(target) >= 2: + target = '%02d%02d00' % target + else: + # 11 and later can have no minor version (11 instead of 11.0) + target = '%02d0000' % target + deptarget_ext = Extension( + 'deptarget', + [deptarget_c], + extra_compile_args=['-DTARGET=%s'%(target,)], + ) + dist = Distribution({ + 'name': 'deptarget', + 'ext_modules': [deptarget_ext] + }) + dist.package_dir = self.tmp_dir + cmd = self.build_ext(dist) + cmd.build_lib = self.tmp_dir + cmd.build_temp = self.tmp_dir + + try: + old_stdout = sys.stdout + if not support.verbose: + # silence compiler output + sys.stdout = StringIO() + try: + cmd.ensure_finalized() + cmd.run() + finally: + sys.stdout = old_stdout + + except CompileError: + self.fail("Wrong deployment target during compilation") + + +class ParallelBuildExtTestCase(BuildExtTestCase): + + def build_ext(self, *args, **kwargs): + build_ext = super().build_ext(*args, **kwargs) + build_ext.parallel = True + return build_ext + + +if __name__ == '__main__': + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_build_py.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_build_py.py new file mode 100644 index 0000000000000000000000000000000000000000..a7035e5a3fd9ddf40cd59104c56d7c362174690c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_build_py.py @@ -0,0 +1,178 @@ +"""Tests for distutils.command.build_py.""" + +import os +import sys +import unittest + +from distutils.command.build_py import build_py +from distutils.core import Distribution +from distutils.errors import DistutilsFileError + +from distutils.tests import support +from test.support import requires_subprocess + + +class BuildPyTestCase(support.TempdirManager, + support.LoggingSilencer, + unittest.TestCase): + + def test_package_data(self): + sources = self.mkdtemp() + f = open(os.path.join(sources, "__init__.py"), "w") + try: + f.write("# Pretend this is a package.") + finally: + f.close() + f = open(os.path.join(sources, "README.txt"), "w") + try: + f.write("Info about this package") + finally: + f.close() + + destination = self.mkdtemp() + + dist = Distribution({"packages": ["pkg"], + "package_dir": {"pkg": sources}}) + # script_name need not exist, it just need to be initialized + dist.script_name = os.path.join(sources, "setup.py") + dist.command_obj["build"] = support.DummyCommand( + force=0, + build_lib=destination) + dist.packages = ["pkg"] + dist.package_data = {"pkg": ["README.txt"]} + dist.package_dir = {"pkg": sources} + + cmd = build_py(dist) + cmd.compile = 1 + cmd.ensure_finalized() + self.assertEqual(cmd.package_data, dist.package_data) + + cmd.run() + + # This makes sure the list of outputs includes byte-compiled + # files for Python modules but not for package data files + # (there shouldn't *be* byte-code files for those!). + self.assertEqual(len(cmd.get_outputs()), 3) + pkgdest = os.path.join(destination, "pkg") + files = os.listdir(pkgdest) + pycache_dir = os.path.join(pkgdest, "__pycache__") + self.assertIn("__init__.py", files) + self.assertIn("README.txt", files) + if sys.dont_write_bytecode: + self.assertFalse(os.path.exists(pycache_dir)) + else: + pyc_files = os.listdir(pycache_dir) + self.assertIn("__init__.%s.pyc" % sys.implementation.cache_tag, + pyc_files) + + def test_empty_package_dir(self): + # See bugs #1668596/#1720897 + sources = self.mkdtemp() + open(os.path.join(sources, "__init__.py"), "w").close() + + testdir = os.path.join(sources, "doc") + os.mkdir(testdir) + open(os.path.join(testdir, "testfile"), "w").close() + + os.chdir(sources) + dist = Distribution({"packages": ["pkg"], + "package_dir": {"pkg": ""}, + "package_data": {"pkg": ["doc/*"]}}) + # script_name need not exist, it just need to be initialized + dist.script_name = os.path.join(sources, "setup.py") + dist.script_args = ["build"] + dist.parse_command_line() + + try: + dist.run_commands() + except DistutilsFileError: + self.fail("failed package_data test when package_dir is ''") + + @unittest.skipIf(sys.dont_write_bytecode, 'byte-compile disabled') + @requires_subprocess() + def test_byte_compile(self): + project_dir, dist = self.create_dist(py_modules=['boiledeggs']) + os.chdir(project_dir) + self.write_file('boiledeggs.py', 'import antigravity') + cmd = build_py(dist) + cmd.compile = 1 + cmd.build_lib = 'here' + cmd.finalize_options() + cmd.run() + + found = os.listdir(cmd.build_lib) + self.assertEqual(sorted(found), ['__pycache__', 'boiledeggs.py']) + found = os.listdir(os.path.join(cmd.build_lib, '__pycache__')) + self.assertEqual(found, + ['boiledeggs.%s.pyc' % sys.implementation.cache_tag]) + + @unittest.skipIf(sys.dont_write_bytecode, 'byte-compile disabled') + @requires_subprocess() + def test_byte_compile_optimized(self): + project_dir, dist = self.create_dist(py_modules=['boiledeggs']) + os.chdir(project_dir) + self.write_file('boiledeggs.py', 'import antigravity') + cmd = build_py(dist) + cmd.compile = 0 + cmd.optimize = 1 + cmd.build_lib = 'here' + cmd.finalize_options() + cmd.run() + + found = os.listdir(cmd.build_lib) + self.assertEqual(sorted(found), ['__pycache__', 'boiledeggs.py']) + found = os.listdir(os.path.join(cmd.build_lib, '__pycache__')) + expect = 'boiledeggs.{}.opt-1.pyc'.format(sys.implementation.cache_tag) + self.assertEqual(sorted(found), [expect]) + + def test_dir_in_package_data(self): + """ + A directory in package_data should not be added to the filelist. + """ + # See bug 19286 + sources = self.mkdtemp() + pkg_dir = os.path.join(sources, "pkg") + + os.mkdir(pkg_dir) + open(os.path.join(pkg_dir, "__init__.py"), "w").close() + + docdir = os.path.join(pkg_dir, "doc") + os.mkdir(docdir) + open(os.path.join(docdir, "testfile"), "w").close() + + # create the directory that could be incorrectly detected as a file + os.mkdir(os.path.join(docdir, 'otherdir')) + + os.chdir(sources) + dist = Distribution({"packages": ["pkg"], + "package_data": {"pkg": ["doc/*"]}}) + # script_name need not exist, it just need to be initialized + dist.script_name = os.path.join(sources, "setup.py") + dist.script_args = ["build"] + dist.parse_command_line() + + try: + dist.run_commands() + except DistutilsFileError: + self.fail("failed package_data when data dir includes a dir") + + def test_dont_write_bytecode(self): + # makes sure byte_compile is not used + dist = self.create_dist()[1] + cmd = build_py(dist) + cmd.compile = 1 + cmd.optimize = 1 + + old_dont_write_bytecode = sys.dont_write_bytecode + sys.dont_write_bytecode = True + try: + cmd.byte_compile([]) + finally: + sys.dont_write_bytecode = old_dont_write_bytecode + + self.assertIn('byte-compiling is disabled', + self.logs[0][1] % self.logs[0][2]) + + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_build_scripts.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_build_scripts.py new file mode 100644 index 0000000000000000000000000000000000000000..485f4f050a5dba488ef2ce8a8301b1949a4757c4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_build_scripts.py @@ -0,0 +1,108 @@ +"""Tests for distutils.command.build_scripts.""" + +import os +import unittest + +from distutils.command.build_scripts import build_scripts +from distutils.core import Distribution +from distutils import sysconfig + +from distutils.tests import support + + +class BuildScriptsTestCase(support.TempdirManager, + support.LoggingSilencer, + unittest.TestCase): + + def test_default_settings(self): + cmd = self.get_build_scripts_cmd("/foo/bar", []) + self.assertFalse(cmd.force) + self.assertIsNone(cmd.build_dir) + + cmd.finalize_options() + + self.assertTrue(cmd.force) + self.assertEqual(cmd.build_dir, "/foo/bar") + + def test_build(self): + source = self.mkdtemp() + target = self.mkdtemp() + expected = self.write_sample_scripts(source) + + cmd = self.get_build_scripts_cmd(target, + [os.path.join(source, fn) + for fn in expected]) + cmd.finalize_options() + cmd.run() + + built = os.listdir(target) + for name in expected: + self.assertIn(name, built) + + def get_build_scripts_cmd(self, target, scripts): + import sys + dist = Distribution() + dist.scripts = scripts + dist.command_obj["build"] = support.DummyCommand( + build_scripts=target, + force=1, + executable=sys.executable + ) + return build_scripts(dist) + + def write_sample_scripts(self, dir): + expected = [] + expected.append("script1.py") + self.write_script(dir, "script1.py", + ("#! /usr/bin/env python2.3\n" + "# bogus script w/ Python sh-bang\n" + "pass\n")) + expected.append("script2.py") + self.write_script(dir, "script2.py", + ("#!/usr/bin/python\n" + "# bogus script w/ Python sh-bang\n" + "pass\n")) + expected.append("shell.sh") + self.write_script(dir, "shell.sh", + ("#!/bin/sh\n" + "# bogus shell script w/ sh-bang\n" + "exit 0\n")) + return expected + + def write_script(self, dir, name, text): + f = open(os.path.join(dir, name), "w") + try: + f.write(text) + finally: + f.close() + + def test_version_int(self): + source = self.mkdtemp() + target = self.mkdtemp() + expected = self.write_sample_scripts(source) + + + cmd = self.get_build_scripts_cmd(target, + [os.path.join(source, fn) + for fn in expected]) + cmd.finalize_options() + + # http://bugs.python.org/issue4524 + # + # On linux-g++-32 with command line `./configure --enable-ipv6 + # --with-suffix=3`, python is compiled okay but the build scripts + # failed when writing the name of the executable + old = sysconfig.get_config_vars().get('VERSION') + sysconfig._config_vars['VERSION'] = 4 + try: + cmd.run() + finally: + if old is not None: + sysconfig._config_vars['VERSION'] = old + + built = os.listdir(target) + for name in expected: + self.assertIn(name, built) + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_check.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_check.py new file mode 100644 index 0000000000000000000000000000000000000000..1e86b948d22449b9b8a984d4ddd28e2840431d44 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_check.py @@ -0,0 +1,159 @@ +"""Tests for distutils.command.check.""" +import os +import textwrap +import unittest + +from distutils.command.check import check, HAS_DOCUTILS +from distutils.tests import support +from distutils.errors import DistutilsSetupError + +try: + import pygments +except ImportError: + pygments = None + + +HERE = os.path.dirname(__file__) + + +class CheckTestCase(support.LoggingSilencer, + support.TempdirManager, + unittest.TestCase): + + def _run(self, metadata=None, cwd=None, **options): + if metadata is None: + metadata = {} + if cwd is not None: + old_dir = os.getcwd() + os.chdir(cwd) + pkg_info, dist = self.create_dist(**metadata) + cmd = check(dist) + cmd.initialize_options() + for name, value in options.items(): + setattr(cmd, name, value) + cmd.ensure_finalized() + cmd.run() + if cwd is not None: + os.chdir(old_dir) + return cmd + + def test_check_metadata(self): + # let's run the command with no metadata at all + # by default, check is checking the metadata + # should have some warnings + cmd = self._run() + self.assertEqual(cmd._warnings, 2) + + # now let's add the required fields + # and run it again, to make sure we don't get + # any warning anymore + metadata = {'url': 'xxx', 'author': 'xxx', + 'author_email': 'xxx', + 'name': 'xxx', 'version': 'xxx'} + cmd = self._run(metadata) + self.assertEqual(cmd._warnings, 0) + + # now with the strict mode, we should + # get an error if there are missing metadata + self.assertRaises(DistutilsSetupError, self._run, {}, **{'strict': 1}) + + # and of course, no error when all metadata are present + cmd = self._run(metadata, strict=1) + self.assertEqual(cmd._warnings, 0) + + # now a test with non-ASCII characters + metadata = {'url': 'xxx', 'author': '\u00c9ric', + 'author_email': 'xxx', 'name': 'xxx', + 'version': 'xxx', + 'description': 'Something about esszet \u00df', + 'long_description': 'More things about esszet \u00df'} + cmd = self._run(metadata) + self.assertEqual(cmd._warnings, 0) + + @unittest.skipUnless(HAS_DOCUTILS, "won't test without docutils") + def test_check_document(self): + pkg_info, dist = self.create_dist() + cmd = check(dist) + + # let's see if it detects broken rest + broken_rest = 'title\n===\n\ntest' + msgs = cmd._check_rst_data(broken_rest) + self.assertEqual(len(msgs), 1) + + # and non-broken rest + rest = 'title\n=====\n\ntest' + msgs = cmd._check_rst_data(rest) + self.assertEqual(len(msgs), 0) + + @unittest.skipUnless(HAS_DOCUTILS, "won't test without docutils") + def test_check_restructuredtext(self): + # let's see if it detects broken rest in long_description + broken_rest = 'title\n===\n\ntest' + pkg_info, dist = self.create_dist(long_description=broken_rest) + cmd = check(dist) + cmd.check_restructuredtext() + self.assertEqual(cmd._warnings, 1) + + # let's see if we have an error with strict=1 + metadata = {'url': 'xxx', 'author': 'xxx', + 'author_email': 'xxx', + 'name': 'xxx', 'version': 'xxx', + 'long_description': broken_rest} + self.assertRaises(DistutilsSetupError, self._run, metadata, + **{'strict': 1, 'restructuredtext': 1}) + + # and non-broken rest, including a non-ASCII character to test #12114 + metadata['long_description'] = 'title\n=====\n\ntest \u00df' + cmd = self._run(metadata, strict=1, restructuredtext=1) + self.assertEqual(cmd._warnings, 0) + + # check that includes work to test #31292 + metadata['long_description'] = 'title\n=====\n\n.. include:: includetest.rst' + cmd = self._run(metadata, cwd=HERE, strict=1, restructuredtext=1) + self.assertEqual(cmd._warnings, 0) + + @unittest.skipUnless(HAS_DOCUTILS, "won't test without docutils") + def test_check_restructuredtext_with_syntax_highlight(self): + # Don't fail if there is a `code` or `code-block` directive + + example_rst_docs = [] + example_rst_docs.append(textwrap.dedent("""\ + Here's some code: + + .. code:: python + + def foo(): + pass + """)) + example_rst_docs.append(textwrap.dedent("""\ + Here's some code: + + .. code-block:: python + + def foo(): + pass + """)) + + for rest_with_code in example_rst_docs: + pkg_info, dist = self.create_dist(long_description=rest_with_code) + cmd = check(dist) + cmd.check_restructuredtext() + msgs = cmd._check_rst_data(rest_with_code) + if pygments is not None: + self.assertEqual(len(msgs), 0) + else: + self.assertEqual(len(msgs), 1) + self.assertEqual( + str(msgs[0][1]), + 'Cannot analyze code. Pygments package not found.' + ) + + def test_check_all(self): + + metadata = {'url': 'xxx', 'author': 'xxx'} + self.assertRaises(DistutilsSetupError, self._run, + {}, **{'strict': 1, + 'restructuredtext': 1}) + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_clean.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_clean.py new file mode 100644 index 0000000000000000000000000000000000000000..ccbb01e167e1cd95ac7a85322c3b8afe1eb946a1 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_clean.py @@ -0,0 +1,45 @@ +"""Tests for distutils.command.clean.""" +import os +import unittest + +from distutils.command.clean import clean +from distutils.tests import support + +class cleanTestCase(support.TempdirManager, + support.LoggingSilencer, + unittest.TestCase): + + def test_simple_run(self): + pkg_dir, dist = self.create_dist() + cmd = clean(dist) + + # let's add some elements clean should remove + dirs = [(d, os.path.join(pkg_dir, d)) + for d in ('build_temp', 'build_lib', 'bdist_base', + 'build_scripts', 'build_base')] + + for name, path in dirs: + os.mkdir(path) + setattr(cmd, name, path) + if name == 'build_base': + continue + for f in ('one', 'two', 'three'): + self.write_file(os.path.join(path, f)) + + # let's run the command + cmd.all = 1 + cmd.ensure_finalized() + cmd.run() + + # make sure the files where removed + for name, path in dirs: + self.assertFalse(os.path.exists(path), + '%s was not removed' % path) + + # let's run the command again (should spit warnings but succeed) + cmd.all = 1 + cmd.ensure_finalized() + cmd.run() + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_cmd.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_cmd.py new file mode 100644 index 0000000000000000000000000000000000000000..90310078b1c29a274ec03fb3259825d7a86a14e1 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_cmd.py @@ -0,0 +1,123 @@ +"""Tests for distutils.cmd.""" +import unittest +import os +from test.support import captured_stdout + +from distutils.cmd import Command +from distutils.dist import Distribution +from distutils.errors import DistutilsOptionError +from distutils import debug + +class MyCmd(Command): + def initialize_options(self): + pass + +class CommandTestCase(unittest.TestCase): + + def setUp(self): + dist = Distribution() + self.cmd = MyCmd(dist) + + def test_ensure_string_list(self): + + cmd = self.cmd + cmd.not_string_list = ['one', 2, 'three'] + cmd.yes_string_list = ['one', 'two', 'three'] + cmd.not_string_list2 = object() + cmd.yes_string_list2 = 'ok' + cmd.ensure_string_list('yes_string_list') + cmd.ensure_string_list('yes_string_list2') + + self.assertRaises(DistutilsOptionError, + cmd.ensure_string_list, 'not_string_list') + + self.assertRaises(DistutilsOptionError, + cmd.ensure_string_list, 'not_string_list2') + + cmd.option1 = 'ok,dok' + cmd.ensure_string_list('option1') + self.assertEqual(cmd.option1, ['ok', 'dok']) + + cmd.option2 = ['xxx', 'www'] + cmd.ensure_string_list('option2') + + cmd.option3 = ['ok', 2] + self.assertRaises(DistutilsOptionError, cmd.ensure_string_list, + 'option3') + + + def test_make_file(self): + + cmd = self.cmd + + # making sure it raises when infiles is not a string or a list/tuple + self.assertRaises(TypeError, cmd.make_file, + infiles=1, outfile='', func='func', args=()) + + # making sure execute gets called properly + def _execute(func, args, exec_msg, level): + self.assertEqual(exec_msg, 'generating out from in') + cmd.force = True + cmd.execute = _execute + cmd.make_file(infiles='in', outfile='out', func='func', args=()) + + def test_dump_options(self): + + msgs = [] + def _announce(msg, level): + msgs.append(msg) + cmd = self.cmd + cmd.announce = _announce + cmd.option1 = 1 + cmd.option2 = 1 + cmd.user_options = [('option1', '', ''), ('option2', '', '')] + cmd.dump_options() + + wanted = ["command options for 'MyCmd':", ' option1 = 1', + ' option2 = 1'] + self.assertEqual(msgs, wanted) + + def test_ensure_string(self): + cmd = self.cmd + cmd.option1 = 'ok' + cmd.ensure_string('option1') + + cmd.option2 = None + cmd.ensure_string('option2', 'xxx') + self.assertTrue(hasattr(cmd, 'option2')) + + cmd.option3 = 1 + self.assertRaises(DistutilsOptionError, cmd.ensure_string, 'option3') + + def test_ensure_filename(self): + cmd = self.cmd + cmd.option1 = __file__ + cmd.ensure_filename('option1') + cmd.option2 = 'xxx' + self.assertRaises(DistutilsOptionError, cmd.ensure_filename, 'option2') + + def test_ensure_dirname(self): + cmd = self.cmd + cmd.option1 = os.path.dirname(__file__) or os.curdir + cmd.ensure_dirname('option1') + cmd.option2 = 'xxx' + self.assertRaises(DistutilsOptionError, cmd.ensure_dirname, 'option2') + + def test_debug_print(self): + cmd = self.cmd + with captured_stdout() as stdout: + cmd.debug_print('xxx') + stdout.seek(0) + self.assertEqual(stdout.read(), '') + + debug.DEBUG = True + try: + with captured_stdout() as stdout: + cmd.debug_print('xxx') + stdout.seek(0) + self.assertEqual(stdout.read(), 'xxx\n') + finally: + debug.DEBUG = False + +if __name__ == '__main__': + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_config.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_config.py new file mode 100644 index 0000000000000000000000000000000000000000..cb8e7237abd9e126a63b3b8216a6de08749544f1 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_config.py @@ -0,0 +1,137 @@ +"""Tests for distutils.pypirc.pypirc.""" +import os +import unittest + +from distutils.core import PyPIRCCommand +from distutils.core import Distribution +from distutils.log import set_threshold +from distutils.log import WARN + +from distutils.tests import support + +PYPIRC = """\ +[distutils] + +index-servers = + server1 + server2 + server3 + +[server1] +username:me +password:secret + +[server2] +username:meagain +password: secret +realm:acme +repository:http://another.pypi/ + +[server3] +username:cbiggles +password:yh^%#rest-of-my-password +""" + +PYPIRC_OLD = """\ +[server-login] +username:tarek +password:secret +""" + +WANTED = """\ +[distutils] +index-servers = + pypi + +[pypi] +username:tarek +password:xxx +""" + + +class BasePyPIRCCommandTestCase(support.TempdirManager, + support.LoggingSilencer, + support.EnvironGuard, + unittest.TestCase): + + def setUp(self): + """Patches the environment.""" + super(BasePyPIRCCommandTestCase, self).setUp() + self.tmp_dir = self.mkdtemp() + os.environ['HOME'] = self.tmp_dir + os.environ['USERPROFILE'] = self.tmp_dir + self.rc = os.path.join(self.tmp_dir, '.pypirc') + self.dist = Distribution() + + class command(PyPIRCCommand): + def __init__(self, dist): + PyPIRCCommand.__init__(self, dist) + def initialize_options(self): + pass + finalize_options = initialize_options + + self._cmd = command + self.old_threshold = set_threshold(WARN) + + def tearDown(self): + """Removes the patch.""" + set_threshold(self.old_threshold) + super(BasePyPIRCCommandTestCase, self).tearDown() + + +class PyPIRCCommandTestCase(BasePyPIRCCommandTestCase): + + def test_server_registration(self): + # This test makes sure PyPIRCCommand knows how to: + # 1. handle several sections in .pypirc + # 2. handle the old format + + # new format + self.write_file(self.rc, PYPIRC) + cmd = self._cmd(self.dist) + config = cmd._read_pypirc() + + config = list(sorted(config.items())) + waited = [('password', 'secret'), ('realm', 'pypi'), + ('repository', 'https://upload.pypi.org/legacy/'), + ('server', 'server1'), ('username', 'me')] + self.assertEqual(config, waited) + + # old format + self.write_file(self.rc, PYPIRC_OLD) + config = cmd._read_pypirc() + config = list(sorted(config.items())) + waited = [('password', 'secret'), ('realm', 'pypi'), + ('repository', 'https://upload.pypi.org/legacy/'), + ('server', 'server-login'), ('username', 'tarek')] + self.assertEqual(config, waited) + + def test_server_empty_registration(self): + cmd = self._cmd(self.dist) + rc = cmd._get_rc_file() + self.assertFalse(os.path.exists(rc)) + cmd._store_pypirc('tarek', 'xxx') + self.assertTrue(os.path.exists(rc)) + f = open(rc) + try: + content = f.read() + self.assertEqual(content, WANTED) + finally: + f.close() + + def test_config_interpolation(self): + # using the % character in .pypirc should not raise an error (#20120) + self.write_file(self.rc, PYPIRC) + cmd = self._cmd(self.dist) + cmd.repository = 'server3' + config = cmd._read_pypirc() + + config = list(sorted(config.items())) + waited = [('password', 'yh^%#rest-of-my-password'), ('realm', 'pypi'), + ('repository', 'https://upload.pypi.org/legacy/'), + ('server', 'server3'), ('username', 'cbiggles')] + self.assertEqual(config, waited) + + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_config_cmd.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_config_cmd.py new file mode 100644 index 0000000000000000000000000000000000000000..4f132ce3d185cce6cc7b49bbf8337857430060fd --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_config_cmd.py @@ -0,0 +1,100 @@ +"""Tests for distutils.command.config.""" +import unittest +import os +import sys +import sysconfig +from test.support import ( + missing_compiler_executable, requires_subprocess +) + +from distutils.command.config import dump_file, config +from distutils.tests import support +from distutils import log + +class ConfigTestCase(support.LoggingSilencer, + support.TempdirManager, + unittest.TestCase): + + def _info(self, msg, *args): + for line in msg.splitlines(): + self._logs.append(line) + + def setUp(self): + super(ConfigTestCase, self).setUp() + self._logs = [] + self.old_log = log.info + log.info = self._info + self.old_config_vars = dict(sysconfig._CONFIG_VARS) + + def tearDown(self): + log.info = self.old_log + sysconfig._CONFIG_VARS.clear() + sysconfig._CONFIG_VARS.update(self.old_config_vars) + super(ConfigTestCase, self).tearDown() + + def test_dump_file(self): + this_file = os.path.splitext(__file__)[0] + '.py' + f = open(this_file) + try: + numlines = len(f.readlines()) + finally: + f.close() + + dump_file(this_file, 'I am the header') + self.assertEqual(len(self._logs), numlines+1) + + @unittest.skipIf(sys.platform == 'win32', "can't test on Windows") + @requires_subprocess() + def test_search_cpp(self): + cmd = missing_compiler_executable(['preprocessor']) + if cmd is not None: + self.skipTest('The %r command is not found' % cmd) + pkg_dir, dist = self.create_dist() + cmd = config(dist) + cmd._check_compiler() + compiler = cmd.compiler + if sys.platform[:3] == "aix" and "xlc" in compiler.preprocessor[0].lower(): + self.skipTest('xlc: The -E option overrides the -P, -o, and -qsyntaxonly options') + + # simple pattern searches + match = cmd.search_cpp(pattern='xxx', body='/* xxx */') + self.assertEqual(match, 0) + + match = cmd.search_cpp(pattern='_configtest', body='/* xxx */') + self.assertEqual(match, 1) + + def test_finalize_options(self): + # finalize_options does a bit of transformation + # on options + pkg_dir, dist = self.create_dist() + cmd = config(dist) + cmd.include_dirs = 'one%stwo' % os.pathsep + cmd.libraries = 'one' + cmd.library_dirs = 'three%sfour' % os.pathsep + cmd.ensure_finalized() + + self.assertEqual(cmd.include_dirs, ['one', 'two']) + self.assertEqual(cmd.libraries, ['one']) + self.assertEqual(cmd.library_dirs, ['three', 'four']) + + def test_clean(self): + # _clean removes files + tmp_dir = self.mkdtemp() + f1 = os.path.join(tmp_dir, 'one') + f2 = os.path.join(tmp_dir, 'two') + + self.write_file(f1, 'xxx') + self.write_file(f2, 'xxx') + + for f in (f1, f2): + self.assertTrue(os.path.exists(f)) + + pkg_dir, dist = self.create_dist() + cmd = config(dist) + cmd._clean(f1, f2) + + for f in (f1, f2): + self.assertFalse(os.path.exists(f)) + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_core.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_core.py new file mode 100644 index 0000000000000000000000000000000000000000..59fb16bdec28cbd6415f986d3ab46dc76cce4a68 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_core.py @@ -0,0 +1,137 @@ +"""Tests for distutils.core.""" + +import io +import distutils.core +import os +import shutil +import sys +from test.support import captured_stdout +from test.support import os_helper +import unittest +from distutils.tests import support +from distutils import log + +# setup script that uses __file__ +setup_using___file__ = """\ + +__file__ + +from distutils.core import setup +setup() +""" + +setup_prints_cwd = """\ + +import os +print(os.getcwd()) + +from distutils.core import setup +setup() +""" + +setup_does_nothing = """\ +from distutils.core import setup +setup() +""" + + +setup_defines_subclass = """\ +from distutils.core import setup +from distutils.command.install import install as _install + +class install(_install): + sub_commands = _install.sub_commands + ['cmd'] + +setup(cmdclass={'install': install}) +""" + +class CoreTestCase(support.EnvironGuard, unittest.TestCase): + + def setUp(self): + super(CoreTestCase, self).setUp() + self.old_stdout = sys.stdout + self.cleanup_testfn() + self.old_argv = sys.argv, sys.argv[:] + self.addCleanup(log.set_threshold, log._global_log.threshold) + + def tearDown(self): + sys.stdout = self.old_stdout + self.cleanup_testfn() + sys.argv = self.old_argv[0] + sys.argv[:] = self.old_argv[1] + super(CoreTestCase, self).tearDown() + + def cleanup_testfn(self): + path = os_helper.TESTFN + if os.path.isfile(path): + os.remove(path) + elif os.path.isdir(path): + shutil.rmtree(path) + + def write_setup(self, text, path=os_helper.TESTFN): + f = open(path, "w") + try: + f.write(text) + finally: + f.close() + return path + + def test_run_setup_provides_file(self): + # Make sure the script can use __file__; if that's missing, the test + # setup.py script will raise NameError. + distutils.core.run_setup( + self.write_setup(setup_using___file__)) + + def test_run_setup_preserves_sys_argv(self): + # Make sure run_setup does not clobber sys.argv + argv_copy = sys.argv.copy() + distutils.core.run_setup( + self.write_setup(setup_does_nothing)) + self.assertEqual(sys.argv, argv_copy) + + def test_run_setup_defines_subclass(self): + # Make sure the script can use __file__; if that's missing, the test + # setup.py script will raise NameError. + dist = distutils.core.run_setup( + self.write_setup(setup_defines_subclass)) + install = dist.get_command_obj('install') + self.assertIn('cmd', install.sub_commands) + + def test_run_setup_uses_current_dir(self): + # This tests that the setup script is run with the current directory + # as its own current directory; this was temporarily broken by a + # previous patch when TESTFN did not use the current directory. + sys.stdout = io.StringIO() + cwd = os.getcwd() + + # Create a directory and write the setup.py file there: + os.mkdir(os_helper.TESTFN) + setup_py = os.path.join(os_helper.TESTFN, "setup.py") + distutils.core.run_setup( + self.write_setup(setup_prints_cwd, path=setup_py)) + + output = sys.stdout.getvalue() + if output.endswith("\n"): + output = output[:-1] + self.assertEqual(cwd, output) + + def test_debug_mode(self): + # this covers the code called when DEBUG is set + sys.argv = ['setup.py', '--name'] + with captured_stdout() as stdout: + distutils.core.setup(name='bar') + stdout.seek(0) + self.assertEqual(stdout.read(), 'bar\n') + + distutils.core.DEBUG = True + try: + with captured_stdout() as stdout: + distutils.core.setup(name='bar') + finally: + distutils.core.DEBUG = False + stdout.seek(0) + wanted = "options (after parsing config files):\n" + self.assertEqual(stdout.readlines()[0], wanted) + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_cygwinccompiler.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_cygwinccompiler.py new file mode 100644 index 0000000000000000000000000000000000000000..633d3041a1bee4c3cad063d8ea61548b6bd85239 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_cygwinccompiler.py @@ -0,0 +1,150 @@ +"""Tests for distutils.cygwinccompiler.""" +import unittest +import sys +import os +from io import BytesIO + +from distutils import cygwinccompiler +from distutils.cygwinccompiler import (check_config_h, + CONFIG_H_OK, CONFIG_H_NOTOK, + CONFIG_H_UNCERTAIN, get_versions, + get_msvcr) +from distutils.tests import support + +class FakePopen(object): + test_class = None + + def __init__(self, cmd, shell, stdout): + self.cmd = cmd.split()[0] + exes = self.test_class._exes + if self.cmd in exes: + # issue #6438 in Python 3.x, Popen returns bytes + self.stdout = BytesIO(exes[self.cmd]) + else: + self.stdout = os.popen(cmd, 'r') + + +class CygwinCCompilerTestCase(support.TempdirManager, + unittest.TestCase): + + def setUp(self): + super(CygwinCCompilerTestCase, self).setUp() + self.version = sys.version + self.python_h = os.path.join(self.mkdtemp(), 'python.h') + from distutils import sysconfig + self.old_get_config_h_filename = sysconfig.get_config_h_filename + sysconfig.get_config_h_filename = self._get_config_h_filename + self.old_find_executable = cygwinccompiler.find_executable + cygwinccompiler.find_executable = self._find_executable + self._exes = {} + self.old_popen = cygwinccompiler.Popen + FakePopen.test_class = self + cygwinccompiler.Popen = FakePopen + + def tearDown(self): + sys.version = self.version + from distutils import sysconfig + sysconfig.get_config_h_filename = self.old_get_config_h_filename + cygwinccompiler.find_executable = self.old_find_executable + cygwinccompiler.Popen = self.old_popen + super(CygwinCCompilerTestCase, self).tearDown() + + def _get_config_h_filename(self): + return self.python_h + + def _find_executable(self, name): + if name in self._exes: + return name + return None + + def test_check_config_h(self): + + # check_config_h looks for "GCC" in sys.version first + # returns CONFIG_H_OK if found + sys.version = ('2.6.1 (r261:67515, Dec 6 2008, 16:42:21) \n[GCC ' + '4.0.1 (Apple Computer, Inc. build 5370)]') + + self.assertEqual(check_config_h()[0], CONFIG_H_OK) + + # then it tries to see if it can find "__GNUC__" in pyconfig.h + sys.version = 'something without the *CC word' + + # if the file doesn't exist it returns CONFIG_H_UNCERTAIN + self.assertEqual(check_config_h()[0], CONFIG_H_UNCERTAIN) + + # if it exists but does not contain __GNUC__, it returns CONFIG_H_NOTOK + self.write_file(self.python_h, 'xxx') + self.assertEqual(check_config_h()[0], CONFIG_H_NOTOK) + + # and CONFIG_H_OK if __GNUC__ is found + self.write_file(self.python_h, 'xxx __GNUC__ xxx') + self.assertEqual(check_config_h()[0], CONFIG_H_OK) + + def test_get_versions(self): + + # get_versions calls distutils.spawn.find_executable on + # 'gcc', 'ld' and 'dllwrap' + self.assertEqual(get_versions(), (None, None, None)) + + # Let's fake we have 'gcc' and it returns '3.4.5' + self._exes['gcc'] = b'gcc (GCC) 3.4.5 (mingw special)\nFSF' + res = get_versions() + self.assertEqual(str(res[0]), '3.4.5') + + # and let's see what happens when the version + # doesn't match the regular expression + # (\d+\.\d+(\.\d+)*) + self._exes['gcc'] = b'very strange output' + res = get_versions() + self.assertEqual(res[0], None) + + # same thing for ld + self._exes['ld'] = b'GNU ld version 2.17.50 20060824' + res = get_versions() + self.assertEqual(str(res[1]), '2.17.50') + self._exes['ld'] = b'@(#)PROGRAM:ld PROJECT:ld64-77' + res = get_versions() + self.assertEqual(res[1], None) + + # and dllwrap + self._exes['dllwrap'] = b'GNU dllwrap 2.17.50 20060824\nFSF' + res = get_versions() + self.assertEqual(str(res[2]), '2.17.50') + self._exes['dllwrap'] = b'Cheese Wrap' + res = get_versions() + self.assertEqual(res[2], None) + + def test_get_msvcr(self): + + # none + sys.version = ('2.6.1 (r261:67515, Dec 6 2008, 16:42:21) ' + '\n[GCC 4.0.1 (Apple Computer, Inc. build 5370)]') + self.assertEqual(get_msvcr(), None) + + # MSVC 7.0 + sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) ' + '[MSC v.1300 32 bits (Intel)]') + self.assertEqual(get_msvcr(), ['msvcr70']) + + # MSVC 7.1 + sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) ' + '[MSC v.1310 32 bits (Intel)]') + self.assertEqual(get_msvcr(), ['msvcr71']) + + # VS2005 / MSVC 8.0 + sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) ' + '[MSC v.1400 32 bits (Intel)]') + self.assertEqual(get_msvcr(), ['msvcr80']) + + # VS2008 / MSVC 9.0 + sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) ' + '[MSC v.1500 32 bits (Intel)]') + self.assertEqual(get_msvcr(), ['msvcr90']) + + # unknown + sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) ' + '[MSC v.1999 32 bits (Intel)]') + self.assertRaises(ValueError, get_msvcr) + +if __name__ == '__main__': + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_dep_util.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_dep_util.py new file mode 100644 index 0000000000000000000000000000000000000000..ef52900b91af370f4dca196be8b1f80c33c286cb --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_dep_util.py @@ -0,0 +1,76 @@ +"""Tests for distutils.dep_util.""" +import unittest +import os + +from distutils.dep_util import newer, newer_pairwise, newer_group +from distutils.errors import DistutilsFileError +from distutils.tests import support + +class DepUtilTestCase(support.TempdirManager, unittest.TestCase): + + def test_newer(self): + + tmpdir = self.mkdtemp() + new_file = os.path.join(tmpdir, 'new') + old_file = os.path.abspath(__file__) + + # Raise DistutilsFileError if 'new_file' does not exist. + self.assertRaises(DistutilsFileError, newer, new_file, old_file) + + # Return true if 'new_file' exists and is more recently modified than + # 'old_file', or if 'new_file' exists and 'old_file' doesn't. + self.write_file(new_file) + self.assertTrue(newer(new_file, 'I_dont_exist')) + self.assertTrue(newer(new_file, old_file)) + + # Return false if both exist and 'old_file' is the same age or younger + # than 'new_file'. + self.assertFalse(newer(old_file, new_file)) + + def test_newer_pairwise(self): + tmpdir = self.mkdtemp() + sources = os.path.join(tmpdir, 'sources') + targets = os.path.join(tmpdir, 'targets') + os.mkdir(sources) + os.mkdir(targets) + one = os.path.join(sources, 'one') + two = os.path.join(sources, 'two') + three = os.path.abspath(__file__) # I am the old file + four = os.path.join(targets, 'four') + self.write_file(one) + self.write_file(two) + self.write_file(four) + + self.assertEqual(newer_pairwise([one, two], [three, four]), + ([one],[three])) + + def test_newer_group(self): + tmpdir = self.mkdtemp() + sources = os.path.join(tmpdir, 'sources') + os.mkdir(sources) + one = os.path.join(sources, 'one') + two = os.path.join(sources, 'two') + three = os.path.join(sources, 'three') + old_file = os.path.abspath(__file__) + + # return true if 'old_file' is out-of-date with respect to any file + # listed in 'sources'. + self.write_file(one) + self.write_file(two) + self.write_file(three) + self.assertTrue(newer_group([one, two, three], old_file)) + self.assertFalse(newer_group([one, two, old_file], three)) + + # missing handling + os.remove(one) + self.assertRaises(OSError, newer_group, [one, two, old_file], three) + + self.assertFalse(newer_group([one, two, old_file], three, + missing='ignore')) + + self.assertTrue(newer_group([one, two, old_file], three, + missing='newer')) + + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_dir_util.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_dir_util.py new file mode 100644 index 0000000000000000000000000000000000000000..bae9c3ed56c83046efe3cf976800d4aa60e675fd --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_dir_util.py @@ -0,0 +1,140 @@ +"""Tests for distutils.dir_util.""" +import unittest +import os +import stat +import sys +from unittest.mock import patch + +from distutils import dir_util, errors +from distutils.dir_util import (mkpath, remove_tree, create_tree, copy_tree, + ensure_relative) + +from distutils import log +from distutils.tests import support +from test.support import is_emscripten, is_wasi + + +class DirUtilTestCase(support.TempdirManager, unittest.TestCase): + + def _log(self, msg, *args): + if len(args) > 0: + self._logs.append(msg % args) + else: + self._logs.append(msg) + + def setUp(self): + super(DirUtilTestCase, self).setUp() + self._logs = [] + tmp_dir = self.mkdtemp() + self.root_target = os.path.join(tmp_dir, 'deep') + self.target = os.path.join(self.root_target, 'here') + self.target2 = os.path.join(tmp_dir, 'deep2') + self.old_log = log.info + log.info = self._log + + def tearDown(self): + log.info = self.old_log + super(DirUtilTestCase, self).tearDown() + + def test_mkpath_remove_tree_verbosity(self): + + mkpath(self.target, verbose=0) + wanted = [] + self.assertEqual(self._logs, wanted) + remove_tree(self.root_target, verbose=0) + + mkpath(self.target, verbose=1) + wanted = ['creating %s' % self.root_target, + 'creating %s' % self.target] + self.assertEqual(self._logs, wanted) + self._logs = [] + + remove_tree(self.root_target, verbose=1) + wanted = ["removing '%s' (and everything under it)" % self.root_target] + self.assertEqual(self._logs, wanted) + + @unittest.skipIf(sys.platform.startswith('win'), + "This test is only appropriate for POSIX-like systems.") + @unittest.skipIf( + is_emscripten or is_wasi, + "Emscripten's/WASI's umask is a stub." + ) + def test_mkpath_with_custom_mode(self): + # Get and set the current umask value for testing mode bits. + umask = os.umask(0o002) + os.umask(umask) + mkpath(self.target, 0o700) + self.assertEqual( + stat.S_IMODE(os.stat(self.target).st_mode), 0o700 & ~umask) + mkpath(self.target2, 0o555) + self.assertEqual( + stat.S_IMODE(os.stat(self.target2).st_mode), 0o555 & ~umask) + + def test_create_tree_verbosity(self): + + create_tree(self.root_target, ['one', 'two', 'three'], verbose=0) + self.assertEqual(self._logs, []) + remove_tree(self.root_target, verbose=0) + + wanted = ['creating %s' % self.root_target] + create_tree(self.root_target, ['one', 'two', 'three'], verbose=1) + self.assertEqual(self._logs, wanted) + + remove_tree(self.root_target, verbose=0) + + def test_copy_tree_verbosity(self): + + mkpath(self.target, verbose=0) + + copy_tree(self.target, self.target2, verbose=0) + self.assertEqual(self._logs, []) + + remove_tree(self.root_target, verbose=0) + + mkpath(self.target, verbose=0) + a_file = os.path.join(self.target, 'ok.txt') + with open(a_file, 'w') as f: + f.write('some content') + + wanted = ['copying %s -> %s' % (a_file, self.target2)] + copy_tree(self.target, self.target2, verbose=1) + self.assertEqual(self._logs, wanted) + + remove_tree(self.root_target, verbose=0) + remove_tree(self.target2, verbose=0) + + def test_copy_tree_skips_nfs_temp_files(self): + mkpath(self.target, verbose=0) + + a_file = os.path.join(self.target, 'ok.txt') + nfs_file = os.path.join(self.target, '.nfs123abc') + for f in a_file, nfs_file: + with open(f, 'w') as fh: + fh.write('some content') + + copy_tree(self.target, self.target2) + self.assertEqual(os.listdir(self.target2), ['ok.txt']) + + remove_tree(self.root_target, verbose=0) + remove_tree(self.target2, verbose=0) + + def test_ensure_relative(self): + if os.sep == '/': + self.assertEqual(ensure_relative('/home/foo'), 'home/foo') + self.assertEqual(ensure_relative('some/path'), 'some/path') + else: # \\ + self.assertEqual(ensure_relative('c:\\home\\foo'), 'c:home\\foo') + self.assertEqual(ensure_relative('home\\foo'), 'home\\foo') + + def test_copy_tree_exception_in_listdir(self): + """ + An exception in listdir should raise a DistutilsFileError + """ + with patch("os.listdir", side_effect=OSError()), \ + self.assertRaises(errors.DistutilsFileError): + src = self.tempdirs[-1] + dir_util.copy_tree(src, None) + + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_dist.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_dist.py new file mode 100644 index 0000000000000000000000000000000000000000..8ab24516e7073a06f5b67823e9f014704fd1c75a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_dist.py @@ -0,0 +1,523 @@ +"""Tests for distutils.dist.""" +import os +import io +import sys +import unittest +import warnings +import textwrap + +from unittest import mock + +from distutils.dist import Distribution, fix_help_options +from distutils.cmd import Command + +from test.support import ( + captured_stdout, captured_stderr +) +from test.support.os_helper import TESTFN +from distutils.tests import support +from distutils import log + + +class test_dist(Command): + """Sample distutils extension command.""" + + user_options = [ + ("sample-option=", "S", "help text"), + ] + + def initialize_options(self): + self.sample_option = None + + +class TestDistribution(Distribution): + """Distribution subclasses that avoids the default search for + configuration files. + + The ._config_files attribute must be set before + .parse_config_files() is called. + """ + + def find_config_files(self): + return self._config_files + + +class DistributionTestCase(support.LoggingSilencer, + support.TempdirManager, + support.EnvironGuard, + unittest.TestCase): + + def setUp(self): + super(DistributionTestCase, self).setUp() + self.argv = sys.argv, sys.argv[:] + del sys.argv[1:] + + def tearDown(self): + sys.argv = self.argv[0] + sys.argv[:] = self.argv[1] + super(DistributionTestCase, self).tearDown() + + def create_distribution(self, configfiles=()): + d = TestDistribution() + d._config_files = configfiles + d.parse_config_files() + d.parse_command_line() + return d + + def test_command_packages_unspecified(self): + sys.argv.append("build") + d = self.create_distribution() + self.assertEqual(d.get_command_packages(), ["distutils.command"]) + + def test_command_packages_cmdline(self): + from distutils.tests.test_dist import test_dist + sys.argv.extend(["--command-packages", + "foo.bar,distutils.tests", + "test_dist", + "-Ssometext", + ]) + d = self.create_distribution() + # let's actually try to load our test command: + self.assertEqual(d.get_command_packages(), + ["distutils.command", "foo.bar", "distutils.tests"]) + cmd = d.get_command_obj("test_dist") + self.assertIsInstance(cmd, test_dist) + self.assertEqual(cmd.sample_option, "sometext") + + def test_venv_install_options(self): + sys.argv.append("install") + self.addCleanup(os.unlink, TESTFN) + + fakepath = '/somedir' + + with open(TESTFN, "w") as f: + print(("[install]\n" + "install-base = {0}\n" + "install-platbase = {0}\n" + "install-lib = {0}\n" + "install-platlib = {0}\n" + "install-purelib = {0}\n" + "install-headers = {0}\n" + "install-scripts = {0}\n" + "install-data = {0}\n" + "prefix = {0}\n" + "exec-prefix = {0}\n" + "home = {0}\n" + "user = {0}\n" + "root = {0}").format(fakepath), file=f) + + # Base case: Not in a Virtual Environment + with mock.patch.multiple(sys, prefix='/a', base_prefix='/a') as values: + d = self.create_distribution([TESTFN]) + + option_tuple = (TESTFN, fakepath) + + result_dict = { + 'install_base': option_tuple, + 'install_platbase': option_tuple, + 'install_lib': option_tuple, + 'install_platlib': option_tuple, + 'install_purelib': option_tuple, + 'install_headers': option_tuple, + 'install_scripts': option_tuple, + 'install_data': option_tuple, + 'prefix': option_tuple, + 'exec_prefix': option_tuple, + 'home': option_tuple, + 'user': option_tuple, + 'root': option_tuple, + } + + self.assertEqual( + sorted(d.command_options.get('install').keys()), + sorted(result_dict.keys())) + + for (key, value) in d.command_options.get('install').items(): + self.assertEqual(value, result_dict[key]) + + # Test case: In a Virtual Environment + with mock.patch.multiple(sys, prefix='/a', base_prefix='/b') as values: + d = self.create_distribution([TESTFN]) + + for key in result_dict.keys(): + self.assertNotIn(key, d.command_options.get('install', {})) + + def test_command_packages_configfile(self): + sys.argv.append("build") + self.addCleanup(os.unlink, TESTFN) + f = open(TESTFN, "w") + try: + print("[global]", file=f) + print("command_packages = foo.bar, splat", file=f) + finally: + f.close() + + d = self.create_distribution([TESTFN]) + self.assertEqual(d.get_command_packages(), + ["distutils.command", "foo.bar", "splat"]) + + # ensure command line overrides config: + sys.argv[1:] = ["--command-packages", "spork", "build"] + d = self.create_distribution([TESTFN]) + self.assertEqual(d.get_command_packages(), + ["distutils.command", "spork"]) + + # Setting --command-packages to '' should cause the default to + # be used even if a config file specified something else: + sys.argv[1:] = ["--command-packages", "", "build"] + d = self.create_distribution([TESTFN]) + self.assertEqual(d.get_command_packages(), ["distutils.command"]) + + def test_empty_options(self): + # an empty options dictionary should not stay in the + # list of attributes + + # catching warnings + warns = [] + + def _warn(msg): + warns.append(msg) + + self.addCleanup(setattr, warnings, 'warn', warnings.warn) + warnings.warn = _warn + dist = Distribution(attrs={'author': 'xxx', 'name': 'xxx', + 'version': 'xxx', 'url': 'xxxx', + 'options': {}}) + + self.assertEqual(len(warns), 0) + self.assertNotIn('options', dir(dist)) + + def test_finalize_options(self): + attrs = {'keywords': 'one,two', + 'platforms': 'one,two'} + + dist = Distribution(attrs=attrs) + dist.finalize_options() + + # finalize_option splits platforms and keywords + self.assertEqual(dist.metadata.platforms, ['one', 'two']) + self.assertEqual(dist.metadata.keywords, ['one', 'two']) + + attrs = {'keywords': 'foo bar', + 'platforms': 'foo bar'} + dist = Distribution(attrs=attrs) + dist.finalize_options() + self.assertEqual(dist.metadata.platforms, ['foo bar']) + self.assertEqual(dist.metadata.keywords, ['foo bar']) + + def test_get_command_packages(self): + dist = Distribution() + self.assertEqual(dist.command_packages, None) + cmds = dist.get_command_packages() + self.assertEqual(cmds, ['distutils.command']) + self.assertEqual(dist.command_packages, + ['distutils.command']) + + dist.command_packages = 'one,two' + cmds = dist.get_command_packages() + self.assertEqual(cmds, ['distutils.command', 'one', 'two']) + + def test_announce(self): + # make sure the level is known + dist = Distribution() + args = ('ok',) + kwargs = {'level': 'ok2'} + self.assertRaises(ValueError, dist.announce, args, kwargs) + + + def test_find_config_files_disable(self): + # Ticket #1180: Allow user to disable their home config file. + temp_home = self.mkdtemp() + if os.name == 'posix': + user_filename = os.path.join(temp_home, ".pydistutils.cfg") + else: + user_filename = os.path.join(temp_home, "pydistutils.cfg") + + with open(user_filename, 'w') as f: + f.write('[distutils]\n') + + def _expander(path): + return temp_home + + old_expander = os.path.expanduser + os.path.expanduser = _expander + try: + d = Distribution() + all_files = d.find_config_files() + + d = Distribution(attrs={'script_args': ['--no-user-cfg']}) + files = d.find_config_files() + finally: + os.path.expanduser = old_expander + + # make sure --no-user-cfg disables the user cfg file + self.assertEqual(len(all_files)-1, len(files)) + +class MetadataTestCase(support.TempdirManager, support.EnvironGuard, + unittest.TestCase): + + def setUp(self): + super(MetadataTestCase, self).setUp() + self.argv = sys.argv, sys.argv[:] + + def tearDown(self): + sys.argv = self.argv[0] + sys.argv[:] = self.argv[1] + super(MetadataTestCase, self).tearDown() + + def format_metadata(self, dist): + sio = io.StringIO() + dist.metadata.write_pkg_file(sio) + return sio.getvalue() + + def test_simple_metadata(self): + attrs = {"name": "package", + "version": "1.0"} + dist = Distribution(attrs) + meta = self.format_metadata(dist) + self.assertIn("Metadata-Version: 1.0", meta) + self.assertNotIn("provides:", meta.lower()) + self.assertNotIn("requires:", meta.lower()) + self.assertNotIn("obsoletes:", meta.lower()) + + def test_provides(self): + attrs = {"name": "package", + "version": "1.0", + "provides": ["package", "package.sub"]} + dist = Distribution(attrs) + self.assertEqual(dist.metadata.get_provides(), + ["package", "package.sub"]) + self.assertEqual(dist.get_provides(), + ["package", "package.sub"]) + meta = self.format_metadata(dist) + self.assertIn("Metadata-Version: 1.1", meta) + self.assertNotIn("requires:", meta.lower()) + self.assertNotIn("obsoletes:", meta.lower()) + + def test_provides_illegal(self): + self.assertRaises(ValueError, Distribution, + {"name": "package", + "version": "1.0", + "provides": ["my.pkg (splat)"]}) + + def test_requires(self): + attrs = {"name": "package", + "version": "1.0", + "requires": ["other", "another (==1.0)"]} + dist = Distribution(attrs) + self.assertEqual(dist.metadata.get_requires(), + ["other", "another (==1.0)"]) + self.assertEqual(dist.get_requires(), + ["other", "another (==1.0)"]) + meta = self.format_metadata(dist) + self.assertIn("Metadata-Version: 1.1", meta) + self.assertNotIn("provides:", meta.lower()) + self.assertIn("Requires: other", meta) + self.assertIn("Requires: another (==1.0)", meta) + self.assertNotIn("obsoletes:", meta.lower()) + + def test_requires_illegal(self): + self.assertRaises(ValueError, Distribution, + {"name": "package", + "version": "1.0", + "requires": ["my.pkg (splat)"]}) + + def test_requires_to_list(self): + attrs = {"name": "package", + "requires": iter(["other"])} + dist = Distribution(attrs) + self.assertIsInstance(dist.metadata.requires, list) + + + def test_obsoletes(self): + attrs = {"name": "package", + "version": "1.0", + "obsoletes": ["other", "another (<1.0)"]} + dist = Distribution(attrs) + self.assertEqual(dist.metadata.get_obsoletes(), + ["other", "another (<1.0)"]) + self.assertEqual(dist.get_obsoletes(), + ["other", "another (<1.0)"]) + meta = self.format_metadata(dist) + self.assertIn("Metadata-Version: 1.1", meta) + self.assertNotIn("provides:", meta.lower()) + self.assertNotIn("requires:", meta.lower()) + self.assertIn("Obsoletes: other", meta) + self.assertIn("Obsoletes: another (<1.0)", meta) + + def test_obsoletes_illegal(self): + self.assertRaises(ValueError, Distribution, + {"name": "package", + "version": "1.0", + "obsoletes": ["my.pkg (splat)"]}) + + def test_obsoletes_to_list(self): + attrs = {"name": "package", + "obsoletes": iter(["other"])} + dist = Distribution(attrs) + self.assertIsInstance(dist.metadata.obsoletes, list) + + def test_classifier(self): + attrs = {'name': 'Boa', 'version': '3.0', + 'classifiers': ['Programming Language :: Python :: 3']} + dist = Distribution(attrs) + self.assertEqual(dist.get_classifiers(), + ['Programming Language :: Python :: 3']) + meta = self.format_metadata(dist) + self.assertIn('Metadata-Version: 1.1', meta) + + def test_classifier_invalid_type(self): + attrs = {'name': 'Boa', 'version': '3.0', + 'classifiers': ('Programming Language :: Python :: 3',)} + with captured_stderr() as error: + d = Distribution(attrs) + # should have warning about passing a non-list + self.assertIn('should be a list', error.getvalue()) + # should be converted to a list + self.assertIsInstance(d.metadata.classifiers, list) + self.assertEqual(d.metadata.classifiers, + list(attrs['classifiers'])) + + def test_keywords(self): + attrs = {'name': 'Monty', 'version': '1.0', + 'keywords': ['spam', 'eggs', 'life of brian']} + dist = Distribution(attrs) + self.assertEqual(dist.get_keywords(), + ['spam', 'eggs', 'life of brian']) + + def test_keywords_invalid_type(self): + attrs = {'name': 'Monty', 'version': '1.0', + 'keywords': ('spam', 'eggs', 'life of brian')} + with captured_stderr() as error: + d = Distribution(attrs) + # should have warning about passing a non-list + self.assertIn('should be a list', error.getvalue()) + # should be converted to a list + self.assertIsInstance(d.metadata.keywords, list) + self.assertEqual(d.metadata.keywords, list(attrs['keywords'])) + + def test_platforms(self): + attrs = {'name': 'Monty', 'version': '1.0', + 'platforms': ['GNU/Linux', 'Some Evil Platform']} + dist = Distribution(attrs) + self.assertEqual(dist.get_platforms(), + ['GNU/Linux', 'Some Evil Platform']) + + def test_platforms_invalid_types(self): + attrs = {'name': 'Monty', 'version': '1.0', + 'platforms': ('GNU/Linux', 'Some Evil Platform')} + with captured_stderr() as error: + d = Distribution(attrs) + # should have warning about passing a non-list + self.assertIn('should be a list', error.getvalue()) + # should be converted to a list + self.assertIsInstance(d.metadata.platforms, list) + self.assertEqual(d.metadata.platforms, list(attrs['platforms'])) + + def test_download_url(self): + attrs = {'name': 'Boa', 'version': '3.0', + 'download_url': 'http://example.org/boa'} + dist = Distribution(attrs) + meta = self.format_metadata(dist) + self.assertIn('Metadata-Version: 1.1', meta) + + def test_long_description(self): + long_desc = textwrap.dedent("""\ + example:: + We start here + and continue here + and end here.""") + attrs = {"name": "package", + "version": "1.0", + "long_description": long_desc} + + dist = Distribution(attrs) + meta = self.format_metadata(dist) + meta = meta.replace('\n' + 8 * ' ', '\n') + self.assertIn(long_desc, meta) + + def test_custom_pydistutils(self): + # fixes #2166 + # make sure pydistutils.cfg is found + if os.name == 'posix': + user_filename = ".pydistutils.cfg" + else: + user_filename = "pydistutils.cfg" + + temp_dir = self.mkdtemp() + user_filename = os.path.join(temp_dir, user_filename) + f = open(user_filename, 'w') + try: + f.write('.') + finally: + f.close() + + try: + dist = Distribution() + + # linux-style + if sys.platform in ('linux', 'darwin'): + os.environ['HOME'] = temp_dir + files = dist.find_config_files() + self.assertIn(user_filename, files) + + # win32-style + if sys.platform == 'win32': + # home drive should be found + os.environ['USERPROFILE'] = temp_dir + files = dist.find_config_files() + self.assertIn(user_filename, files, + '%r not found in %r' % (user_filename, files)) + finally: + os.remove(user_filename) + + def test_fix_help_options(self): + help_tuples = [('a', 'b', 'c', 'd'), (1, 2, 3, 4)] + fancy_options = fix_help_options(help_tuples) + self.assertEqual(fancy_options[0], ('a', 'b', 'c')) + self.assertEqual(fancy_options[1], (1, 2, 3)) + + def test_show_help(self): + # smoke test, just makes sure some help is displayed + self.addCleanup(log.set_threshold, log._global_log.threshold) + dist = Distribution() + sys.argv = [] + dist.help = 1 + dist.script_name = 'setup.py' + with captured_stdout() as s: + dist.parse_command_line() + + output = [line for line in s.getvalue().split('\n') + if line.strip() != ''] + self.assertTrue(output) + + + def test_read_metadata(self): + attrs = {"name": "package", + "version": "1.0", + "long_description": "desc", + "description": "xxx", + "download_url": "http://example.com", + "keywords": ['one', 'two'], + "requires": ['foo']} + + dist = Distribution(attrs) + metadata = dist.metadata + + # write it then reloads it + PKG_INFO = io.StringIO() + metadata.write_pkg_file(PKG_INFO) + PKG_INFO.seek(0) + metadata.read_pkg_file(PKG_INFO) + + self.assertEqual(metadata.name, "package") + self.assertEqual(metadata.version, "1.0") + self.assertEqual(metadata.description, "xxx") + self.assertEqual(metadata.download_url, 'http://example.com') + self.assertEqual(metadata.keywords, ['one', 'two']) + self.assertEqual(metadata.platforms, ['UNKNOWN']) + self.assertEqual(metadata.obsoletes, None) + self.assertEqual(metadata.requires, ['foo']) + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_extension.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_extension.py new file mode 100644 index 0000000000000000000000000000000000000000..f9cdef254165495766187aead0ffb0f41e53f410 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_extension.py @@ -0,0 +1,66 @@ +"""Tests for distutils.extension.""" +import unittest +import os +import warnings + +from test.support.warnings_helper import check_warnings +from distutils.extension import read_setup_file, Extension + +class ExtensionTestCase(unittest.TestCase): + + def test_read_setup_file(self): + # trying to read a Setup file + # (sample extracted from the PyGame project) + setup = os.path.join(os.path.dirname(__file__), 'Setup.sample') + + exts = read_setup_file(setup) + names = [ext.name for ext in exts] + names.sort() + + # here are the extensions read_setup_file should have created + # out of the file + wanted = ['_arraysurfarray', '_camera', '_numericsndarray', + '_numericsurfarray', 'base', 'bufferproxy', 'cdrom', + 'color', 'constants', 'display', 'draw', 'event', + 'fastevent', 'font', 'gfxdraw', 'image', 'imageext', + 'joystick', 'key', 'mask', 'mixer', 'mixer_music', + 'mouse', 'movie', 'overlay', 'pixelarray', 'pypm', + 'rect', 'rwobject', 'scrap', 'surface', 'surflock', + 'time', 'transform'] + + self.assertEqual(names, wanted) + + def test_extension_init(self): + # the first argument, which is the name, must be a string + self.assertRaises(AssertionError, Extension, 1, []) + ext = Extension('name', []) + self.assertEqual(ext.name, 'name') + + # the second argument, which is the list of files, must + # be a list of strings + self.assertRaises(AssertionError, Extension, 'name', 'file') + self.assertRaises(AssertionError, Extension, 'name', ['file', 1]) + ext = Extension('name', ['file1', 'file2']) + self.assertEqual(ext.sources, ['file1', 'file2']) + + # others arguments have defaults + for attr in ('include_dirs', 'define_macros', 'undef_macros', + 'library_dirs', 'libraries', 'runtime_library_dirs', + 'extra_objects', 'extra_compile_args', 'extra_link_args', + 'export_symbols', 'swig_opts', 'depends'): + self.assertEqual(getattr(ext, attr), []) + + self.assertEqual(ext.language, None) + self.assertEqual(ext.optional, None) + + # if there are unknown keyword options, warn about them + with check_warnings() as w: + warnings.simplefilter('always') + ext = Extension('name', ['file1', 'file2'], chic=True) + + self.assertEqual(len(w.warnings), 1) + self.assertEqual(str(w.warnings[0].message), + "Unknown Extension options: 'chic'") + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_file_util.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_file_util.py new file mode 100644 index 0000000000000000000000000000000000000000..76ef6e9743d381c6566872e5652b37af8182fbfd --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_file_util.py @@ -0,0 +1,122 @@ +"""Tests for distutils.file_util.""" +import unittest +import os +import errno +from unittest.mock import patch + +from distutils.file_util import move_file, copy_file +from distutils import log +from distutils.tests import support +from distutils.errors import DistutilsFileError +from test.support.os_helper import unlink + + +class FileUtilTestCase(support.TempdirManager, unittest.TestCase): + + def _log(self, msg, *args): + if len(args) > 0: + self._logs.append(msg % args) + else: + self._logs.append(msg) + + def setUp(self): + super(FileUtilTestCase, self).setUp() + self._logs = [] + self.old_log = log.info + log.info = self._log + tmp_dir = self.mkdtemp() + self.source = os.path.join(tmp_dir, 'f1') + self.target = os.path.join(tmp_dir, 'f2') + self.target_dir = os.path.join(tmp_dir, 'd1') + + def tearDown(self): + log.info = self.old_log + super(FileUtilTestCase, self).tearDown() + + def test_move_file_verbosity(self): + f = open(self.source, 'w') + try: + f.write('some content') + finally: + f.close() + + move_file(self.source, self.target, verbose=0) + wanted = [] + self.assertEqual(self._logs, wanted) + + # back to original state + move_file(self.target, self.source, verbose=0) + + move_file(self.source, self.target, verbose=1) + wanted = ['moving %s -> %s' % (self.source, self.target)] + self.assertEqual(self._logs, wanted) + + # back to original state + move_file(self.target, self.source, verbose=0) + + self._logs = [] + # now the target is a dir + os.mkdir(self.target_dir) + move_file(self.source, self.target_dir, verbose=1) + wanted = ['moving %s -> %s' % (self.source, self.target_dir)] + self.assertEqual(self._logs, wanted) + + def test_move_file_exception_unpacking_rename(self): + # see issue 22182 + with patch("os.rename", side_effect=OSError("wrong", 1)), \ + self.assertRaises(DistutilsFileError): + with open(self.source, 'w') as fobj: + fobj.write('spam eggs') + move_file(self.source, self.target, verbose=0) + + def test_move_file_exception_unpacking_unlink(self): + # see issue 22182 + with patch("os.rename", side_effect=OSError(errno.EXDEV, "wrong")), \ + patch("os.unlink", side_effect=OSError("wrong", 1)), \ + self.assertRaises(DistutilsFileError): + with open(self.source, 'w') as fobj: + fobj.write('spam eggs') + move_file(self.source, self.target, verbose=0) + + @unittest.skipUnless(hasattr(os, 'link'), 'requires os.link') + def test_copy_file_hard_link(self): + with open(self.source, 'w') as f: + f.write('some content') + # Check first that copy_file() will not fall back on copying the file + # instead of creating the hard link. + try: + os.link(self.source, self.target) + except OSError as e: + self.skipTest('os.link: %s' % e) + else: + unlink(self.target) + st = os.stat(self.source) + copy_file(self.source, self.target, link='hard') + st2 = os.stat(self.source) + st3 = os.stat(self.target) + self.assertTrue(os.path.samestat(st, st2), (st, st2)) + self.assertTrue(os.path.samestat(st2, st3), (st2, st3)) + with open(self.source, 'r') as f: + self.assertEqual(f.read(), 'some content') + + @unittest.skipUnless(hasattr(os, 'link'), 'requires os.link') + def test_copy_file_hard_link_failure(self): + # If hard linking fails, copy_file() falls back on copying file + # (some special filesystems don't support hard linking even under + # Unix, see issue #8876). + with open(self.source, 'w') as f: + f.write('some content') + st = os.stat(self.source) + with patch("os.link", side_effect=OSError(0, "linking unsupported")): + copy_file(self.source, self.target, link='hard') + st2 = os.stat(self.source) + st3 = os.stat(self.target) + self.assertTrue(os.path.samestat(st, st2), (st, st2)) + self.assertFalse(os.path.samestat(st2, st3), (st2, st3)) + for fn in (self.source, self.target): + with open(fn, 'r') as f: + self.assertEqual(f.read(), 'some content') + + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_filelist.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_filelist.py new file mode 100644 index 0000000000000000000000000000000000000000..216cf27f493e028d90a3894942a02ed75fdc6707 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_filelist.py @@ -0,0 +1,333 @@ +"""Tests for distutils.filelist.""" +import os +import re +import unittest +from distutils import debug +from distutils.log import WARN +from distutils.errors import DistutilsTemplateError +from distutils.filelist import glob_to_re, translate_pattern, FileList +from distutils import filelist + +from test.support import os_helper +from test.support import captured_stdout +from distutils.tests import support + +MANIFEST_IN = """\ +include ok +include xo +exclude xo +include foo.tmp +include buildout.cfg +global-include *.x +global-include *.txt +global-exclude *.tmp +recursive-include f *.oo +recursive-exclude global *.x +graft dir +prune dir3 +""" + + +def make_local_path(s): + """Converts '/' in a string to os.sep""" + return s.replace('/', os.sep) + + +class FileListTestCase(support.LoggingSilencer, + unittest.TestCase): + + def assertNoWarnings(self): + self.assertEqual(self.get_logs(WARN), []) + self.clear_logs() + + def assertWarnings(self): + self.assertGreater(len(self.get_logs(WARN)), 0) + self.clear_logs() + + def test_glob_to_re(self): + sep = os.sep + if os.sep == '\\': + sep = re.escape(os.sep) + + for glob, regex in ( + # simple cases + ('foo*', r'(?s:foo[^%(sep)s]*)\Z'), + ('foo?', r'(?s:foo[^%(sep)s])\Z'), + ('foo??', r'(?s:foo[^%(sep)s][^%(sep)s])\Z'), + # special cases + (r'foo\\*', r'(?s:foo\\\\[^%(sep)s]*)\Z'), + (r'foo\\\*', r'(?s:foo\\\\\\[^%(sep)s]*)\Z'), + ('foo????', r'(?s:foo[^%(sep)s][^%(sep)s][^%(sep)s][^%(sep)s])\Z'), + (r'foo\\??', r'(?s:foo\\\\[^%(sep)s][^%(sep)s])\Z')): + regex = regex % {'sep': sep} + self.assertEqual(glob_to_re(glob), regex) + + def test_process_template_line(self): + # testing all MANIFEST.in template patterns + file_list = FileList() + l = make_local_path + + # simulated file list + file_list.allfiles = ['foo.tmp', 'ok', 'xo', 'four.txt', + 'buildout.cfg', + # filelist does not filter out VCS directories, + # it's sdist that does + l('.hg/last-message.txt'), + l('global/one.txt'), + l('global/two.txt'), + l('global/files.x'), + l('global/here.tmp'), + l('f/o/f.oo'), + l('dir/graft-one'), + l('dir/dir2/graft2'), + l('dir3/ok'), + l('dir3/sub/ok.txt'), + ] + + for line in MANIFEST_IN.split('\n'): + if line.strip() == '': + continue + file_list.process_template_line(line) + + wanted = ['ok', + 'buildout.cfg', + 'four.txt', + l('.hg/last-message.txt'), + l('global/one.txt'), + l('global/two.txt'), + l('f/o/f.oo'), + l('dir/graft-one'), + l('dir/dir2/graft2'), + ] + + self.assertEqual(file_list.files, wanted) + + def test_debug_print(self): + file_list = FileList() + with captured_stdout() as stdout: + file_list.debug_print('xxx') + self.assertEqual(stdout.getvalue(), '') + + debug.DEBUG = True + try: + with captured_stdout() as stdout: + file_list.debug_print('xxx') + self.assertEqual(stdout.getvalue(), 'xxx\n') + finally: + debug.DEBUG = False + + def test_set_allfiles(self): + file_list = FileList() + files = ['a', 'b', 'c'] + file_list.set_allfiles(files) + self.assertEqual(file_list.allfiles, files) + + def test_remove_duplicates(self): + file_list = FileList() + file_list.files = ['a', 'b', 'a', 'g', 'c', 'g'] + # files must be sorted beforehand (sdist does it) + file_list.sort() + file_list.remove_duplicates() + self.assertEqual(file_list.files, ['a', 'b', 'c', 'g']) + + def test_translate_pattern(self): + # not regex + self.assertTrue(hasattr( + translate_pattern('a', anchor=True, is_regex=False), + 'search')) + + # is a regex + regex = re.compile('a') + self.assertEqual( + translate_pattern(regex, anchor=True, is_regex=True), + regex) + + # plain string flagged as regex + self.assertTrue(hasattr( + translate_pattern('a', anchor=True, is_regex=True), + 'search')) + + # glob support + self.assertTrue(translate_pattern( + '*.py', anchor=True, is_regex=False).search('filelist.py')) + + def test_exclude_pattern(self): + # return False if no match + file_list = FileList() + self.assertFalse(file_list.exclude_pattern('*.py')) + + # return True if files match + file_list = FileList() + file_list.files = ['a.py', 'b.py'] + self.assertTrue(file_list.exclude_pattern('*.py')) + + # test excludes + file_list = FileList() + file_list.files = ['a.py', 'a.txt'] + file_list.exclude_pattern('*.py') + self.assertEqual(file_list.files, ['a.txt']) + + def test_include_pattern(self): + # return False if no match + file_list = FileList() + file_list.set_allfiles([]) + self.assertFalse(file_list.include_pattern('*.py')) + + # return True if files match + file_list = FileList() + file_list.set_allfiles(['a.py', 'b.txt']) + self.assertTrue(file_list.include_pattern('*.py')) + + # test * matches all files + file_list = FileList() + self.assertIsNone(file_list.allfiles) + file_list.set_allfiles(['a.py', 'b.txt']) + file_list.include_pattern('*') + self.assertEqual(file_list.allfiles, ['a.py', 'b.txt']) + + def test_process_template(self): + l = make_local_path + # invalid lines + file_list = FileList() + for action in ('include', 'exclude', 'global-include', + 'global-exclude', 'recursive-include', + 'recursive-exclude', 'graft', 'prune', 'blarg'): + self.assertRaises(DistutilsTemplateError, + file_list.process_template_line, action) + + # include + file_list = FileList() + file_list.set_allfiles(['a.py', 'b.txt', l('d/c.py')]) + + file_list.process_template_line('include *.py') + self.assertEqual(file_list.files, ['a.py']) + self.assertNoWarnings() + + file_list.process_template_line('include *.rb') + self.assertEqual(file_list.files, ['a.py']) + self.assertWarnings() + + # exclude + file_list = FileList() + file_list.files = ['a.py', 'b.txt', l('d/c.py')] + + file_list.process_template_line('exclude *.py') + self.assertEqual(file_list.files, ['b.txt', l('d/c.py')]) + self.assertNoWarnings() + + file_list.process_template_line('exclude *.rb') + self.assertEqual(file_list.files, ['b.txt', l('d/c.py')]) + self.assertWarnings() + + # global-include + file_list = FileList() + file_list.set_allfiles(['a.py', 'b.txt', l('d/c.py')]) + + file_list.process_template_line('global-include *.py') + self.assertEqual(file_list.files, ['a.py', l('d/c.py')]) + self.assertNoWarnings() + + file_list.process_template_line('global-include *.rb') + self.assertEqual(file_list.files, ['a.py', l('d/c.py')]) + self.assertWarnings() + + # global-exclude + file_list = FileList() + file_list.files = ['a.py', 'b.txt', l('d/c.py')] + + file_list.process_template_line('global-exclude *.py') + self.assertEqual(file_list.files, ['b.txt']) + self.assertNoWarnings() + + file_list.process_template_line('global-exclude *.rb') + self.assertEqual(file_list.files, ['b.txt']) + self.assertWarnings() + + # recursive-include + file_list = FileList() + file_list.set_allfiles(['a.py', l('d/b.py'), l('d/c.txt'), + l('d/d/e.py')]) + + file_list.process_template_line('recursive-include d *.py') + self.assertEqual(file_list.files, [l('d/b.py'), l('d/d/e.py')]) + self.assertNoWarnings() + + file_list.process_template_line('recursive-include e *.py') + self.assertEqual(file_list.files, [l('d/b.py'), l('d/d/e.py')]) + self.assertWarnings() + + # recursive-exclude + file_list = FileList() + file_list.files = ['a.py', l('d/b.py'), l('d/c.txt'), l('d/d/e.py')] + + file_list.process_template_line('recursive-exclude d *.py') + self.assertEqual(file_list.files, ['a.py', l('d/c.txt')]) + self.assertNoWarnings() + + file_list.process_template_line('recursive-exclude e *.py') + self.assertEqual(file_list.files, ['a.py', l('d/c.txt')]) + self.assertWarnings() + + # graft + file_list = FileList() + file_list.set_allfiles(['a.py', l('d/b.py'), l('d/d/e.py'), + l('f/f.py')]) + + file_list.process_template_line('graft d') + self.assertEqual(file_list.files, [l('d/b.py'), l('d/d/e.py')]) + self.assertNoWarnings() + + file_list.process_template_line('graft e') + self.assertEqual(file_list.files, [l('d/b.py'), l('d/d/e.py')]) + self.assertWarnings() + + # prune + file_list = FileList() + file_list.files = ['a.py', l('d/b.py'), l('d/d/e.py'), l('f/f.py')] + + file_list.process_template_line('prune d') + self.assertEqual(file_list.files, ['a.py', l('f/f.py')]) + self.assertNoWarnings() + + file_list.process_template_line('prune e') + self.assertEqual(file_list.files, ['a.py', l('f/f.py')]) + self.assertWarnings() + + +class FindAllTestCase(unittest.TestCase): + @os_helper.skip_unless_symlink + def test_missing_symlink(self): + with os_helper.temp_cwd(): + os.symlink('foo', 'bar') + self.assertEqual(filelist.findall(), []) + + def test_basic_discovery(self): + """ + When findall is called with no parameters or with + '.' as the parameter, the dot should be omitted from + the results. + """ + with os_helper.temp_cwd(): + os.mkdir('foo') + file1 = os.path.join('foo', 'file1.txt') + os_helper.create_empty_file(file1) + os.mkdir('bar') + file2 = os.path.join('bar', 'file2.txt') + os_helper.create_empty_file(file2) + expected = [file2, file1] + self.assertEqual(sorted(filelist.findall()), expected) + + def test_non_local_discovery(self): + """ + When findall is called with another path, the full + path name should be returned. + """ + with os_helper.temp_dir() as temp_dir: + file1 = os.path.join(temp_dir, 'file1.txt') + os_helper.create_empty_file(file1) + expected = [file1] + self.assertEqual(filelist.findall(temp_dir), expected) + + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_install.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_install.py new file mode 100644 index 0000000000000000000000000000000000000000..c30414d5cb24fa2e6494181713260d9faa855f00 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_install.py @@ -0,0 +1,258 @@ +"""Tests for distutils.command.install.""" + +import os +import sys +import unittest +import site + +from test.support import captured_stdout, requires_subprocess + +from distutils import sysconfig +from distutils.command.install import install, HAS_USER_SITE +from distutils.command import install as install_module +from distutils.command.build_ext import build_ext +from distutils.command.install import INSTALL_SCHEMES +from distutils.core import Distribution +from distutils.errors import DistutilsOptionError +from distutils.extension import Extension + +from distutils.tests import support +from test import support as test_support + + +def _make_ext_name(modname): + return modname + sysconfig.get_config_var('EXT_SUFFIX') + + +class InstallTestCase(support.TempdirManager, + support.EnvironGuard, + support.LoggingSilencer, + unittest.TestCase): + + def setUp(self): + super().setUp() + self._backup_config_vars = dict(sysconfig._config_vars) + + def tearDown(self): + super().tearDown() + sysconfig._config_vars.clear() + sysconfig._config_vars.update(self._backup_config_vars) + + def test_home_installation_scheme(self): + # This ensure two things: + # - that --home generates the desired set of directory names + # - test --home is supported on all platforms + builddir = self.mkdtemp() + destination = os.path.join(builddir, "installation") + + dist = Distribution({"name": "foopkg"}) + # script_name need not exist, it just need to be initialized + dist.script_name = os.path.join(builddir, "setup.py") + dist.command_obj["build"] = support.DummyCommand( + build_base=builddir, + build_lib=os.path.join(builddir, "lib"), + ) + + cmd = install(dist) + cmd.home = destination + cmd.ensure_finalized() + + self.assertEqual(cmd.install_base, destination) + self.assertEqual(cmd.install_platbase, destination) + + def check_path(got, expected): + got = os.path.normpath(got) + expected = os.path.normpath(expected) + self.assertEqual(got, expected) + + libdir = os.path.join(destination, "lib", "python") + check_path(cmd.install_lib, libdir) + platlibdir = os.path.join(destination, sys.platlibdir, "python") + check_path(cmd.install_platlib, platlibdir) + check_path(cmd.install_purelib, libdir) + check_path(cmd.install_headers, + os.path.join(destination, "include", "python", "foopkg")) + check_path(cmd.install_scripts, os.path.join(destination, "bin")) + check_path(cmd.install_data, destination) + + @unittest.skipUnless(HAS_USER_SITE, 'need user site') + def test_user_site(self): + # test install with --user + # preparing the environment for the test + self.old_user_base = site.USER_BASE + self.old_user_site = site.USER_SITE + self.tmpdir = self.mkdtemp() + self.user_base = os.path.join(self.tmpdir, 'B') + self.user_site = os.path.join(self.tmpdir, 'S') + site.USER_BASE = self.user_base + site.USER_SITE = self.user_site + install_module.USER_BASE = self.user_base + install_module.USER_SITE = self.user_site + + def _expanduser(path): + return self.tmpdir + self.old_expand = os.path.expanduser + os.path.expanduser = _expanduser + + def cleanup(): + site.USER_BASE = self.old_user_base + site.USER_SITE = self.old_user_site + install_module.USER_BASE = self.old_user_base + install_module.USER_SITE = self.old_user_site + os.path.expanduser = self.old_expand + + self.addCleanup(cleanup) + + if HAS_USER_SITE: + for key in ('nt_user', 'unix_user'): + self.assertIn(key, INSTALL_SCHEMES) + + dist = Distribution({'name': 'xx'}) + cmd = install(dist) + + # making sure the user option is there + options = [name for name, short, lable in + cmd.user_options] + self.assertIn('user', options) + + # setting a value + cmd.user = 1 + + # user base and site shouldn't be created yet + self.assertFalse(os.path.exists(self.user_base)) + self.assertFalse(os.path.exists(self.user_site)) + + # let's run finalize + cmd.ensure_finalized() + + # now they should + self.assertTrue(os.path.exists(self.user_base)) + self.assertTrue(os.path.exists(self.user_site)) + + self.assertIn('userbase', cmd.config_vars) + self.assertIn('usersite', cmd.config_vars) + + def test_handle_extra_path(self): + dist = Distribution({'name': 'xx', 'extra_path': 'path,dirs'}) + cmd = install(dist) + + # two elements + cmd.handle_extra_path() + self.assertEqual(cmd.extra_path, ['path', 'dirs']) + self.assertEqual(cmd.extra_dirs, 'dirs') + self.assertEqual(cmd.path_file, 'path') + + # one element + cmd.extra_path = ['path'] + cmd.handle_extra_path() + self.assertEqual(cmd.extra_path, ['path']) + self.assertEqual(cmd.extra_dirs, 'path') + self.assertEqual(cmd.path_file, 'path') + + # none + dist.extra_path = cmd.extra_path = None + cmd.handle_extra_path() + self.assertEqual(cmd.extra_path, None) + self.assertEqual(cmd.extra_dirs, '') + self.assertEqual(cmd.path_file, None) + + # three elements (no way !) + cmd.extra_path = 'path,dirs,again' + self.assertRaises(DistutilsOptionError, cmd.handle_extra_path) + + def test_finalize_options(self): + dist = Distribution({'name': 'xx'}) + cmd = install(dist) + + # must supply either prefix/exec-prefix/home or + # install-base/install-platbase -- not both + cmd.prefix = 'prefix' + cmd.install_base = 'base' + self.assertRaises(DistutilsOptionError, cmd.finalize_options) + + # must supply either home or prefix/exec-prefix -- not both + cmd.install_base = None + cmd.home = 'home' + self.assertRaises(DistutilsOptionError, cmd.finalize_options) + + # can't combine user with prefix/exec_prefix/home or + # install_(plat)base + cmd.prefix = None + cmd.user = 'user' + self.assertRaises(DistutilsOptionError, cmd.finalize_options) + + def test_record(self): + install_dir = self.mkdtemp() + project_dir, dist = self.create_dist(py_modules=['hello'], + scripts=['sayhi']) + os.chdir(project_dir) + self.write_file('hello.py', "def main(): print('o hai')") + self.write_file('sayhi', 'from hello import main; main()') + + cmd = install(dist) + dist.command_obj['install'] = cmd + cmd.root = install_dir + cmd.record = os.path.join(project_dir, 'filelist') + cmd.ensure_finalized() + cmd.run() + + f = open(cmd.record) + try: + content = f.read() + finally: + f.close() + + found = [os.path.basename(line) for line in content.splitlines()] + expected = ['hello.py', 'hello.%s.pyc' % sys.implementation.cache_tag, + 'sayhi', + 'UNKNOWN-0.0.0-py%s.%s.egg-info' % sys.version_info[:2]] + self.assertEqual(found, expected) + + @requires_subprocess() + def test_record_extensions(self): + cmd = test_support.missing_compiler_executable() + if cmd is not None: + self.skipTest('The %r command is not found' % cmd) + install_dir = self.mkdtemp() + project_dir, dist = self.create_dist(ext_modules=[ + Extension('xx', ['xxmodule.c'])]) + os.chdir(project_dir) + support.copy_xxmodule_c(project_dir) + + buildextcmd = build_ext(dist) + support.fixup_build_ext(buildextcmd) + buildextcmd.ensure_finalized() + + cmd = install(dist) + dist.command_obj['install'] = cmd + dist.command_obj['build_ext'] = buildextcmd + cmd.root = install_dir + cmd.record = os.path.join(project_dir, 'filelist') + cmd.ensure_finalized() + cmd.run() + + f = open(cmd.record) + try: + content = f.read() + finally: + f.close() + + found = [os.path.basename(line) for line in content.splitlines()] + expected = [_make_ext_name('xx'), + 'UNKNOWN-0.0.0-py%s.%s.egg-info' % sys.version_info[:2]] + self.assertEqual(found, expected) + + def test_debug_mode(self): + # this covers the code called when DEBUG is set + old_logs_len = len(self.logs) + install_module.DEBUG = True + try: + with captured_stdout(): + self.test_record() + finally: + install_module.DEBUG = False + self.assertGreater(len(self.logs), old_logs_len) + + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_install_data.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_install_data.py new file mode 100644 index 0000000000000000000000000000000000000000..c5c04a36e124011754fff37e56660ea91296ef44 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_install_data.py @@ -0,0 +1,71 @@ +"""Tests for distutils.command.install_data.""" +import os +import unittest + +from distutils.command.install_data import install_data +from distutils.tests import support + +class InstallDataTestCase(support.TempdirManager, + support.LoggingSilencer, + support.EnvironGuard, + unittest.TestCase): + + def test_simple_run(self): + pkg_dir, dist = self.create_dist() + cmd = install_data(dist) + cmd.install_dir = inst = os.path.join(pkg_dir, 'inst') + + # data_files can contain + # - simple files + # - a tuple with a path, and a list of file + one = os.path.join(pkg_dir, 'one') + self.write_file(one, 'xxx') + inst2 = os.path.join(pkg_dir, 'inst2') + two = os.path.join(pkg_dir, 'two') + self.write_file(two, 'xxx') + + cmd.data_files = [one, (inst2, [two])] + self.assertEqual(cmd.get_inputs(), [one, (inst2, [two])]) + + # let's run the command + cmd.ensure_finalized() + cmd.run() + + # let's check the result + self.assertEqual(len(cmd.get_outputs()), 2) + rtwo = os.path.split(two)[-1] + self.assertTrue(os.path.exists(os.path.join(inst2, rtwo))) + rone = os.path.split(one)[-1] + self.assertTrue(os.path.exists(os.path.join(inst, rone))) + cmd.outfiles = [] + + # let's try with warn_dir one + cmd.warn_dir = 1 + cmd.ensure_finalized() + cmd.run() + + # let's check the result + self.assertEqual(len(cmd.get_outputs()), 2) + self.assertTrue(os.path.exists(os.path.join(inst2, rtwo))) + self.assertTrue(os.path.exists(os.path.join(inst, rone))) + cmd.outfiles = [] + + # now using root and empty dir + cmd.root = os.path.join(pkg_dir, 'root') + inst3 = os.path.join(cmd.install_dir, 'inst3') + inst4 = os.path.join(pkg_dir, 'inst4') + three = os.path.join(cmd.install_dir, 'three') + self.write_file(three, 'xx') + cmd.data_files = [one, (inst2, [two]), + ('inst3', [three]), + (inst4, [])] + cmd.ensure_finalized() + cmd.run() + + # let's check the result + self.assertEqual(len(cmd.get_outputs()), 4) + self.assertTrue(os.path.exists(os.path.join(inst2, rtwo))) + self.assertTrue(os.path.exists(os.path.join(inst, rone))) + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_install_headers.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_install_headers.py new file mode 100644 index 0000000000000000000000000000000000000000..f8f513217fc6a97713a5855a21dce8039dc9ec06 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_install_headers.py @@ -0,0 +1,35 @@ +"""Tests for distutils.command.install_headers.""" +import os +import unittest + +from distutils.command.install_headers import install_headers +from distutils.tests import support + +class InstallHeadersTestCase(support.TempdirManager, + support.LoggingSilencer, + support.EnvironGuard, + unittest.TestCase): + + def test_simple_run(self): + # we have two headers + header_list = self.mkdtemp() + header1 = os.path.join(header_list, 'header1') + header2 = os.path.join(header_list, 'header2') + self.write_file(header1) + self.write_file(header2) + headers = [header1, header2] + + pkg_dir, dist = self.create_dist(headers=headers) + cmd = install_headers(dist) + self.assertEqual(cmd.get_inputs(), headers) + + # let's run the command + cmd.install_dir = os.path.join(pkg_dir, 'inst') + cmd.ensure_finalized() + cmd.run() + + # let's check the results + self.assertEqual(len(cmd.get_outputs()), 2) + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_install_lib.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_install_lib.py new file mode 100644 index 0000000000000000000000000000000000000000..08bc9c842693765b4c3d34b36ce264c8c9bf1622 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_install_lib.py @@ -0,0 +1,114 @@ +"""Tests for distutils.command.install_data.""" +import sys +import os +import importlib.util +import unittest + +from distutils.command.install_lib import install_lib +from distutils.extension import Extension +from distutils.tests import support +from distutils.errors import DistutilsOptionError +from test.support import requires_subprocess + + +class InstallLibTestCase(support.TempdirManager, + support.LoggingSilencer, + support.EnvironGuard, + unittest.TestCase): + + def test_finalize_options(self): + dist = self.create_dist()[1] + cmd = install_lib(dist) + + cmd.finalize_options() + self.assertEqual(cmd.compile, 1) + self.assertEqual(cmd.optimize, 0) + + # optimize must be 0, 1, or 2 + cmd.optimize = 'foo' + self.assertRaises(DistutilsOptionError, cmd.finalize_options) + cmd.optimize = '4' + self.assertRaises(DistutilsOptionError, cmd.finalize_options) + + cmd.optimize = '2' + cmd.finalize_options() + self.assertEqual(cmd.optimize, 2) + + @unittest.skipIf(sys.dont_write_bytecode, 'byte-compile disabled') + @requires_subprocess() + def test_byte_compile(self): + project_dir, dist = self.create_dist() + os.chdir(project_dir) + cmd = install_lib(dist) + cmd.compile = cmd.optimize = 1 + + f = os.path.join(project_dir, 'foo.py') + self.write_file(f, '# python file') + cmd.byte_compile([f]) + pyc_file = importlib.util.cache_from_source('foo.py', optimization='') + pyc_opt_file = importlib.util.cache_from_source('foo.py', + optimization=cmd.optimize) + self.assertTrue(os.path.exists(pyc_file)) + self.assertTrue(os.path.exists(pyc_opt_file)) + + def test_get_outputs(self): + project_dir, dist = self.create_dist() + os.chdir(project_dir) + os.mkdir('spam') + cmd = install_lib(dist) + + # setting up a dist environment + cmd.compile = cmd.optimize = 1 + cmd.install_dir = self.mkdtemp() + f = os.path.join(project_dir, 'spam', '__init__.py') + self.write_file(f, '# python package') + cmd.distribution.ext_modules = [Extension('foo', ['xxx'])] + cmd.distribution.packages = ['spam'] + cmd.distribution.script_name = 'setup.py' + + # get_outputs should return 4 elements: spam/__init__.py and .pyc, + # foo.import-tag-abiflags.so / foo.pyd + outputs = cmd.get_outputs() + self.assertEqual(len(outputs), 4, outputs) + + def test_get_inputs(self): + project_dir, dist = self.create_dist() + os.chdir(project_dir) + os.mkdir('spam') + cmd = install_lib(dist) + + # setting up a dist environment + cmd.compile = cmd.optimize = 1 + cmd.install_dir = self.mkdtemp() + f = os.path.join(project_dir, 'spam', '__init__.py') + self.write_file(f, '# python package') + cmd.distribution.ext_modules = [Extension('foo', ['xxx'])] + cmd.distribution.packages = ['spam'] + cmd.distribution.script_name = 'setup.py' + + # get_inputs should return 2 elements: spam/__init__.py and + # foo.import-tag-abiflags.so / foo.pyd + inputs = cmd.get_inputs() + self.assertEqual(len(inputs), 2, inputs) + + @requires_subprocess() + def test_dont_write_bytecode(self): + # makes sure byte_compile is not used + dist = self.create_dist()[1] + cmd = install_lib(dist) + cmd.compile = 1 + cmd.optimize = 1 + + old_dont_write_bytecode = sys.dont_write_bytecode + sys.dont_write_bytecode = True + try: + cmd.byte_compile([]) + finally: + sys.dont_write_bytecode = old_dont_write_bytecode + + self.assertIn('byte-compiling is disabled', + self.logs[0][1] % self.logs[0][2]) + + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_install_scripts.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_install_scripts.py new file mode 100644 index 0000000000000000000000000000000000000000..b4272d6f90faea67023195928edfb76e114f672a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_install_scripts.py @@ -0,0 +1,78 @@ +"""Tests for distutils.command.install_scripts.""" + +import os +import unittest + +from distutils.command.install_scripts import install_scripts +from distutils.core import Distribution + +from distutils.tests import support + + +class InstallScriptsTestCase(support.TempdirManager, + support.LoggingSilencer, + unittest.TestCase): + + def test_default_settings(self): + dist = Distribution() + dist.command_obj["build"] = support.DummyCommand( + build_scripts="/foo/bar") + dist.command_obj["install"] = support.DummyCommand( + install_scripts="/splat/funk", + force=1, + skip_build=1, + ) + cmd = install_scripts(dist) + self.assertFalse(cmd.force) + self.assertFalse(cmd.skip_build) + self.assertIsNone(cmd.build_dir) + self.assertIsNone(cmd.install_dir) + + cmd.finalize_options() + + self.assertTrue(cmd.force) + self.assertTrue(cmd.skip_build) + self.assertEqual(cmd.build_dir, "/foo/bar") + self.assertEqual(cmd.install_dir, "/splat/funk") + + def test_installation(self): + source = self.mkdtemp() + expected = [] + + def write_script(name, text): + expected.append(name) + f = open(os.path.join(source, name), "w") + try: + f.write(text) + finally: + f.close() + + write_script("script1.py", ("#! /usr/bin/env python2.3\n" + "# bogus script w/ Python sh-bang\n" + "pass\n")) + write_script("script2.py", ("#!/usr/bin/python\n" + "# bogus script w/ Python sh-bang\n" + "pass\n")) + write_script("shell.sh", ("#!/bin/sh\n" + "# bogus shell script w/ sh-bang\n" + "exit 0\n")) + + target = self.mkdtemp() + dist = Distribution() + dist.command_obj["build"] = support.DummyCommand(build_scripts=source) + dist.command_obj["install"] = support.DummyCommand( + install_scripts=target, + force=1, + skip_build=1, + ) + cmd = install_scripts(dist) + cmd.finalize_options() + cmd.run() + + installed = os.listdir(target) + for name in expected: + self.assertIn(name, installed) + + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_log.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_log.py new file mode 100644 index 0000000000000000000000000000000000000000..0f3250313fdeadae4a7e86282bc6378e84951530 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_log.py @@ -0,0 +1,43 @@ +"""Tests for distutils.log""" + +import io +import sys +import unittest +from test.support import swap_attr + +from distutils import log + +class TestLog(unittest.TestCase): + def test_non_ascii(self): + # Issues #8663, #34421: test that non-encodable text is escaped with + # backslashreplace error handler and encodable non-ASCII text is + # output as is. + for errors in ('strict', 'backslashreplace', 'surrogateescape', + 'replace', 'ignore'): + with self.subTest(errors=errors): + stdout = io.TextIOWrapper(io.BytesIO(), + encoding='cp437', errors=errors) + stderr = io.TextIOWrapper(io.BytesIO(), + encoding='cp437', errors=errors) + old_threshold = log.set_threshold(log.DEBUG) + try: + with swap_attr(sys, 'stdout', stdout), \ + swap_attr(sys, 'stderr', stderr): + log.debug('Dεbug\tMėssãge') + log.fatal('Fαtal\tÈrrōr') + finally: + log.set_threshold(old_threshold) + + stdout.seek(0) + self.assertEqual(stdout.read().rstrip(), + 'Dεbug\tM?ss?ge' if errors == 'replace' else + 'Dεbug\tMssge' if errors == 'ignore' else + 'Dεbug\tM\\u0117ss\\xe3ge') + stderr.seek(0) + self.assertEqual(stderr.read().rstrip(), + 'Fαtal\t?rr?r' if errors == 'replace' else + 'Fαtal\trrr' if errors == 'ignore' else + 'Fαtal\t\\xc8rr\\u014dr') + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_msvc9compiler.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_msvc9compiler.py new file mode 100644 index 0000000000000000000000000000000000000000..60b99e25f8a02ce7cf36dbb4d15e5bbf1be91722 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_msvc9compiler.py @@ -0,0 +1,180 @@ +"""Tests for distutils.msvc9compiler.""" +import sys +import unittest +import os + +from distutils.errors import DistutilsPlatformError +from distutils.tests import support + +# A manifest with the only assembly reference being the msvcrt assembly, so +# should have the assembly completely stripped. Note that although the +# assembly has a reference the assembly is removed - that is +# currently a "feature", not a bug :) +_MANIFEST_WITH_ONLY_MSVC_REFERENCE = """\ + + + + + + + + + + + + + + + + + +""" + +# A manifest with references to assemblies other than msvcrt. When processed, +# this assembly should be returned with just the msvcrt part removed. +_MANIFEST_WITH_MULTIPLE_REFERENCES = """\ + + + + + + + + + + + + + + + + + + + + + + +""" + +_CLEANED_MANIFEST = """\ + + + + + + + + + + + + + + + + + + +""" + +if sys.platform=="win32": + from distutils.msvccompiler import get_build_version + if get_build_version()>=8.0: + SKIP_MESSAGE = None + else: + SKIP_MESSAGE = "These tests are only for MSVC8.0 or above" +else: + SKIP_MESSAGE = "These tests are only for win32" + +@unittest.skipUnless(SKIP_MESSAGE is None, SKIP_MESSAGE) +class msvc9compilerTestCase(support.TempdirManager, + unittest.TestCase): + + def test_no_compiler(self): + # makes sure query_vcvarsall raises + # a DistutilsPlatformError if the compiler + # is not found + from distutils.msvc9compiler import query_vcvarsall + def _find_vcvarsall(version): + return None + + from distutils import msvc9compiler + old_find_vcvarsall = msvc9compiler.find_vcvarsall + msvc9compiler.find_vcvarsall = _find_vcvarsall + try: + self.assertRaises(DistutilsPlatformError, query_vcvarsall, + 'wont find this version') + finally: + msvc9compiler.find_vcvarsall = old_find_vcvarsall + + def test_reg_class(self): + from distutils.msvc9compiler import Reg + self.assertRaises(KeyError, Reg.get_value, 'xxx', 'xxx') + + # looking for values that should exist on all + # windows registry versions. + path = r'Control Panel\Desktop' + v = Reg.get_value(path, 'dragfullwindows') + self.assertIn(v, ('0', '1', '2')) + + import winreg + HKCU = winreg.HKEY_CURRENT_USER + keys = Reg.read_keys(HKCU, 'xxxx') + self.assertEqual(keys, None) + + keys = Reg.read_keys(HKCU, r'Control Panel') + self.assertIn('Desktop', keys) + + def test_remove_visual_c_ref(self): + from distutils.msvc9compiler import MSVCCompiler + tempdir = self.mkdtemp() + manifest = os.path.join(tempdir, 'manifest') + f = open(manifest, 'w') + try: + f.write(_MANIFEST_WITH_MULTIPLE_REFERENCES) + finally: + f.close() + + compiler = MSVCCompiler() + compiler._remove_visual_c_ref(manifest) + + # see what we got + f = open(manifest) + try: + # removing trailing spaces + content = '\n'.join([line.rstrip() for line in f.readlines()]) + finally: + f.close() + + # makes sure the manifest was properly cleaned + self.assertEqual(content, _CLEANED_MANIFEST) + + def test_remove_entire_manifest(self): + from distutils.msvc9compiler import MSVCCompiler + tempdir = self.mkdtemp() + manifest = os.path.join(tempdir, 'manifest') + f = open(manifest, 'w') + try: + f.write(_MANIFEST_WITH_ONLY_MSVC_REFERENCE) + finally: + f.close() + + compiler = MSVCCompiler() + got = compiler._remove_visual_c_ref(manifest) + self.assertIsNone(got) + + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_msvccompiler.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_msvccompiler.py new file mode 100644 index 0000000000000000000000000000000000000000..7b3a6bbe7fda9d7d227761dcb8b41836f60019d6 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_msvccompiler.py @@ -0,0 +1,77 @@ +"""Tests for distutils._msvccompiler.""" +import sys +import unittest +import os + +from distutils.errors import DistutilsPlatformError +from distutils.tests import support + + +SKIP_MESSAGE = (None if sys.platform == "win32" else + "These tests are only for win32") + +@unittest.skipUnless(SKIP_MESSAGE is None, SKIP_MESSAGE) +class msvccompilerTestCase(support.TempdirManager, + unittest.TestCase): + + def test_no_compiler(self): + import distutils._msvccompiler as _msvccompiler + # makes sure query_vcvarsall raises + # a DistutilsPlatformError if the compiler + # is not found + def _find_vcvarsall(plat_spec): + return None, None + + old_find_vcvarsall = _msvccompiler._find_vcvarsall + _msvccompiler._find_vcvarsall = _find_vcvarsall + try: + self.assertRaises(DistutilsPlatformError, + _msvccompiler._get_vc_env, + 'wont find this version') + finally: + _msvccompiler._find_vcvarsall = old_find_vcvarsall + + def test_get_vc_env_unicode(self): + import distutils._msvccompiler as _msvccompiler + + test_var = 'ṰḖṤṪ┅ṼẨṜ' + test_value = '₃⁴₅' + + # Ensure we don't early exit from _get_vc_env + old_distutils_use_sdk = os.environ.pop('DISTUTILS_USE_SDK', None) + os.environ[test_var] = test_value + try: + env = _msvccompiler._get_vc_env('x86') + self.assertIn(test_var.lower(), env) + self.assertEqual(test_value, env[test_var.lower()]) + finally: + os.environ.pop(test_var) + if old_distutils_use_sdk: + os.environ['DISTUTILS_USE_SDK'] = old_distutils_use_sdk + + def test_get_vc2017(self): + import distutils._msvccompiler as _msvccompiler + + # This function cannot be mocked, so pass it if we find VS 2017 + # and mark it skipped if we do not. + version, path = _msvccompiler._find_vc2017() + if version: + self.assertGreaterEqual(version, 15) + self.assertTrue(os.path.isdir(path)) + else: + raise unittest.SkipTest("VS 2017 is not installed") + + def test_get_vc2015(self): + import distutils._msvccompiler as _msvccompiler + + # This function cannot be mocked, so pass it if we find VS 2015 + # and mark it skipped if we do not. + version, path = _msvccompiler._find_vc2015() + if version: + self.assertGreaterEqual(version, 14) + self.assertTrue(os.path.isdir(path)) + else: + raise unittest.SkipTest("VS 2015 is not installed") + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_register.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_register.py new file mode 100644 index 0000000000000000000000000000000000000000..986392cf92037d24805754ca15333329427a4eec --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_register.py @@ -0,0 +1,322 @@ +"""Tests for distutils.command.register.""" +import os +import unittest +import getpass +import urllib +import warnings + +from test.support.warnings_helper import check_warnings + +from distutils.command import register as register_module +from distutils.command.register import register +from distutils.errors import DistutilsSetupError +from distutils.log import INFO + +from distutils.tests.test_config import BasePyPIRCCommandTestCase + +try: + import docutils +except ImportError: + docutils = None + +PYPIRC_NOPASSWORD = """\ +[distutils] + +index-servers = + server1 + +[server1] +username:me +""" + +WANTED_PYPIRC = """\ +[distutils] +index-servers = + pypi + +[pypi] +username:tarek +password:password +""" + +class Inputs(object): + """Fakes user inputs.""" + def __init__(self, *answers): + self.answers = answers + self.index = 0 + + def __call__(self, prompt=''): + try: + return self.answers[self.index] + finally: + self.index += 1 + +class FakeOpener(object): + """Fakes a PyPI server""" + def __init__(self): + self.reqs = [] + + def __call__(self, *args): + return self + + def open(self, req, data=None, timeout=None): + self.reqs.append(req) + return self + + def read(self): + return b'xxx' + + def getheader(self, name, default=None): + return { + 'content-type': 'text/plain; charset=utf-8', + }.get(name.lower(), default) + + +class RegisterTestCase(BasePyPIRCCommandTestCase): + + def setUp(self): + super(RegisterTestCase, self).setUp() + # patching the password prompt + self._old_getpass = getpass.getpass + def _getpass(prompt): + return 'password' + getpass.getpass = _getpass + urllib.request._opener = None + self.old_opener = urllib.request.build_opener + self.conn = urllib.request.build_opener = FakeOpener() + + def tearDown(self): + getpass.getpass = self._old_getpass + urllib.request._opener = None + urllib.request.build_opener = self.old_opener + super(RegisterTestCase, self).tearDown() + + def _get_cmd(self, metadata=None): + if metadata is None: + metadata = {'url': 'xxx', 'author': 'xxx', + 'author_email': 'xxx', + 'name': 'xxx', 'version': 'xxx'} + pkg_info, dist = self.create_dist(**metadata) + return register(dist) + + def test_create_pypirc(self): + # this test makes sure a .pypirc file + # is created when requested. + + # let's create a register instance + cmd = self._get_cmd() + + # we shouldn't have a .pypirc file yet + self.assertFalse(os.path.exists(self.rc)) + + # patching input and getpass.getpass + # so register gets happy + # + # Here's what we are faking : + # use your existing login (choice 1.) + # Username : 'tarek' + # Password : 'password' + # Save your login (y/N)? : 'y' + inputs = Inputs('1', 'tarek', 'y') + register_module.input = inputs.__call__ + # let's run the command + try: + cmd.run() + finally: + del register_module.input + + # we should have a brand new .pypirc file + self.assertTrue(os.path.exists(self.rc)) + + # with the content similar to WANTED_PYPIRC + f = open(self.rc) + try: + content = f.read() + self.assertEqual(content, WANTED_PYPIRC) + finally: + f.close() + + # now let's make sure the .pypirc file generated + # really works : we shouldn't be asked anything + # if we run the command again + def _no_way(prompt=''): + raise AssertionError(prompt) + register_module.input = _no_way + + cmd.show_response = 1 + cmd.run() + + # let's see what the server received : we should + # have 2 similar requests + self.assertEqual(len(self.conn.reqs), 2) + req1 = dict(self.conn.reqs[0].headers) + req2 = dict(self.conn.reqs[1].headers) + + self.assertEqual(req1['Content-length'], '1374') + self.assertEqual(req2['Content-length'], '1374') + self.assertIn(b'xxx', self.conn.reqs[1].data) + + def test_password_not_in_file(self): + + self.write_file(self.rc, PYPIRC_NOPASSWORD) + cmd = self._get_cmd() + cmd._set_config() + cmd.finalize_options() + cmd.send_metadata() + + # dist.password should be set + # therefore used afterwards by other commands + self.assertEqual(cmd.distribution.password, 'password') + + def test_registering(self): + # this test runs choice 2 + cmd = self._get_cmd() + inputs = Inputs('2', 'tarek', 'tarek@ziade.org') + register_module.input = inputs.__call__ + try: + # let's run the command + cmd.run() + finally: + del register_module.input + + # we should have send a request + self.assertEqual(len(self.conn.reqs), 1) + req = self.conn.reqs[0] + headers = dict(req.headers) + self.assertEqual(headers['Content-length'], '608') + self.assertIn(b'tarek', req.data) + + def test_password_reset(self): + # this test runs choice 3 + cmd = self._get_cmd() + inputs = Inputs('3', 'tarek@ziade.org') + register_module.input = inputs.__call__ + try: + # let's run the command + cmd.run() + finally: + del register_module.input + + # we should have send a request + self.assertEqual(len(self.conn.reqs), 1) + req = self.conn.reqs[0] + headers = dict(req.headers) + self.assertEqual(headers['Content-length'], '290') + self.assertIn(b'tarek', req.data) + + @unittest.skipUnless(docutils is not None, 'needs docutils') + def test_strict(self): + # testing the script option + # when on, the register command stops if + # the metadata is incomplete or if + # long_description is not reSt compliant + + # empty metadata + cmd = self._get_cmd({}) + cmd.ensure_finalized() + cmd.strict = 1 + self.assertRaises(DistutilsSetupError, cmd.run) + + # metadata are OK but long_description is broken + metadata = {'url': 'xxx', 'author': 'xxx', + 'author_email': 'éxéxé', + 'name': 'xxx', 'version': 'xxx', + 'long_description': 'title\n==\n\ntext'} + + cmd = self._get_cmd(metadata) + cmd.ensure_finalized() + cmd.strict = 1 + self.assertRaises(DistutilsSetupError, cmd.run) + + # now something that works + metadata['long_description'] = 'title\n=====\n\ntext' + cmd = self._get_cmd(metadata) + cmd.ensure_finalized() + cmd.strict = 1 + inputs = Inputs('1', 'tarek', 'y') + register_module.input = inputs.__call__ + # let's run the command + try: + cmd.run() + finally: + del register_module.input + + # strict is not by default + cmd = self._get_cmd() + cmd.ensure_finalized() + inputs = Inputs('1', 'tarek', 'y') + register_module.input = inputs.__call__ + # let's run the command + try: + cmd.run() + finally: + del register_module.input + + # and finally a Unicode test (bug #12114) + metadata = {'url': 'xxx', 'author': '\u00c9ric', + 'author_email': 'xxx', 'name': 'xxx', + 'version': 'xxx', + 'description': 'Something about esszet \u00df', + 'long_description': 'More things about esszet \u00df'} + + cmd = self._get_cmd(metadata) + cmd.ensure_finalized() + cmd.strict = 1 + inputs = Inputs('1', 'tarek', 'y') + register_module.input = inputs.__call__ + # let's run the command + try: + cmd.run() + finally: + del register_module.input + + @unittest.skipUnless(docutils is not None, 'needs docutils') + def test_register_invalid_long_description(self): + description = ':funkie:`str`' # mimic Sphinx-specific markup + metadata = {'url': 'xxx', 'author': 'xxx', + 'author_email': 'xxx', + 'name': 'xxx', 'version': 'xxx', + 'long_description': description} + cmd = self._get_cmd(metadata) + cmd.ensure_finalized() + cmd.strict = True + inputs = Inputs('2', 'tarek', 'tarek@ziade.org') + register_module.input = inputs + self.addCleanup(delattr, register_module, 'input') + + self.assertRaises(DistutilsSetupError, cmd.run) + + def test_check_metadata_deprecated(self): + # makes sure make_metadata is deprecated + cmd = self._get_cmd() + with check_warnings() as w: + warnings.simplefilter("always") + warnings.filterwarnings("ignore", ".*OptionParser class will be replaced.*") + warnings.filterwarnings("ignore", ".*Option class will be removed.*") + cmd.check_metadata() + self.assertEqual(len(w.warnings), 1) + + def test_list_classifiers(self): + cmd = self._get_cmd() + cmd.list_classifiers = 1 + cmd.run() + results = self.get_logs(INFO) + self.assertEqual(results, ['running check', 'xxx']) + + def test_show_response(self): + # test that the --show-response option return a well formatted response + cmd = self._get_cmd() + inputs = Inputs('1', 'tarek', 'y') + register_module.input = inputs.__call__ + cmd.show_response = 1 + try: + cmd.run() + finally: + del register_module.input + + results = self.get_logs(INFO) + self.assertEqual(results[3], 75 * '-' + '\nxxx\n' + 75 * '-') + + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_sdist.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_sdist.py new file mode 100644 index 0000000000000000000000000000000000000000..58497fe087567275b5ef59dedc9a053a5df1b06f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_sdist.py @@ -0,0 +1,490 @@ +"""Tests for distutils.command.sdist.""" +import os +import tarfile +import unittest +import warnings +import zipfile +from os.path import join +from textwrap import dedent +from test.support import captured_stdout +from test.support.warnings_helper import check_warnings + +try: + import zlib + ZLIB_SUPPORT = True +except ImportError: + ZLIB_SUPPORT = False + +try: + import grp + import pwd + UID_GID_SUPPORT = True +except ImportError: + UID_GID_SUPPORT = False + +from distutils.command.sdist import sdist, show_formats +from distutils.core import Distribution +from distutils.tests.test_config import BasePyPIRCCommandTestCase +from distutils.errors import DistutilsOptionError +from distutils.spawn import find_executable +from distutils.log import WARN +from distutils.filelist import FileList +from distutils.archive_util import ARCHIVE_FORMATS + +SETUP_PY = """ +from distutils.core import setup +import somecode + +setup(name='fake') +""" + +MANIFEST = """\ +# file GENERATED by distutils, do NOT edit +README +buildout.cfg +inroot.txt +setup.py +data%(sep)sdata.dt +scripts%(sep)sscript.py +some%(sep)sfile.txt +some%(sep)sother_file.txt +somecode%(sep)s__init__.py +somecode%(sep)sdoc.dat +somecode%(sep)sdoc.txt +""" + +class SDistTestCase(BasePyPIRCCommandTestCase): + + def setUp(self): + # PyPIRCCommandTestCase creates a temp dir already + # and put it in self.tmp_dir + super(SDistTestCase, self).setUp() + # setting up an environment + self.old_path = os.getcwd() + os.mkdir(join(self.tmp_dir, 'somecode')) + os.mkdir(join(self.tmp_dir, 'dist')) + # a package, and a README + self.write_file((self.tmp_dir, 'README'), 'xxx') + self.write_file((self.tmp_dir, 'somecode', '__init__.py'), '#') + self.write_file((self.tmp_dir, 'setup.py'), SETUP_PY) + os.chdir(self.tmp_dir) + + def tearDown(self): + # back to normal + os.chdir(self.old_path) + super(SDistTestCase, self).tearDown() + + def get_cmd(self, metadata=None): + """Returns a cmd""" + if metadata is None: + metadata = {'name': 'fake', 'version': '1.0', + 'url': 'xxx', 'author': 'xxx', + 'author_email': 'xxx'} + dist = Distribution(metadata) + dist.script_name = 'setup.py' + dist.packages = ['somecode'] + dist.include_package_data = True + cmd = sdist(dist) + cmd.dist_dir = 'dist' + return dist, cmd + + @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run') + def test_prune_file_list(self): + # this test creates a project with some VCS dirs and an NFS rename + # file, then launches sdist to check they get pruned on all systems + + # creating VCS directories with some files in them + os.mkdir(join(self.tmp_dir, 'somecode', '.svn')) + self.write_file((self.tmp_dir, 'somecode', '.svn', 'ok.py'), 'xxx') + + os.mkdir(join(self.tmp_dir, 'somecode', '.hg')) + self.write_file((self.tmp_dir, 'somecode', '.hg', + 'ok'), 'xxx') + + os.mkdir(join(self.tmp_dir, 'somecode', '.git')) + self.write_file((self.tmp_dir, 'somecode', '.git', + 'ok'), 'xxx') + + self.write_file((self.tmp_dir, 'somecode', '.nfs0001'), 'xxx') + + # now building a sdist + dist, cmd = self.get_cmd() + + # zip is available universally + # (tar might not be installed under win32) + cmd.formats = ['zip'] + + cmd.ensure_finalized() + cmd.run() + + # now let's check what we have + dist_folder = join(self.tmp_dir, 'dist') + files = os.listdir(dist_folder) + self.assertEqual(files, ['fake-1.0.zip']) + + zip_file = zipfile.ZipFile(join(dist_folder, 'fake-1.0.zip')) + try: + content = zip_file.namelist() + finally: + zip_file.close() + + # making sure everything has been pruned correctly + expected = ['', 'PKG-INFO', 'README', 'setup.py', + 'somecode/', 'somecode/__init__.py'] + self.assertEqual(sorted(content), ['fake-1.0/' + x for x in expected]) + + @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run') + @unittest.skipIf(find_executable('tar') is None, + "The tar command is not found") + @unittest.skipIf(find_executable('gzip') is None, + "The gzip command is not found") + def test_make_distribution(self): + # now building a sdist + dist, cmd = self.get_cmd() + + # creating a gztar then a tar + cmd.formats = ['gztar', 'tar'] + cmd.ensure_finalized() + cmd.run() + + # making sure we have two files + dist_folder = join(self.tmp_dir, 'dist') + result = os.listdir(dist_folder) + result.sort() + self.assertEqual(result, ['fake-1.0.tar', 'fake-1.0.tar.gz']) + + os.remove(join(dist_folder, 'fake-1.0.tar')) + os.remove(join(dist_folder, 'fake-1.0.tar.gz')) + + # now trying a tar then a gztar + cmd.formats = ['tar', 'gztar'] + + cmd.ensure_finalized() + cmd.run() + + result = os.listdir(dist_folder) + result.sort() + self.assertEqual(result, ['fake-1.0.tar', 'fake-1.0.tar.gz']) + + @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run') + def test_add_defaults(self): + + # http://bugs.python.org/issue2279 + + # add_default should also include + # data_files and package_data + dist, cmd = self.get_cmd() + + # filling data_files by pointing files + # in package_data + dist.package_data = {'': ['*.cfg', '*.dat'], + 'somecode': ['*.txt']} + self.write_file((self.tmp_dir, 'somecode', 'doc.txt'), '#') + self.write_file((self.tmp_dir, 'somecode', 'doc.dat'), '#') + + # adding some data in data_files + data_dir = join(self.tmp_dir, 'data') + os.mkdir(data_dir) + self.write_file((data_dir, 'data.dt'), '#') + some_dir = join(self.tmp_dir, 'some') + os.mkdir(some_dir) + # make sure VCS directories are pruned (#14004) + hg_dir = join(self.tmp_dir, '.hg') + os.mkdir(hg_dir) + self.write_file((hg_dir, 'last-message.txt'), '#') + # a buggy regex used to prevent this from working on windows (#6884) + self.write_file((self.tmp_dir, 'buildout.cfg'), '#') + self.write_file((self.tmp_dir, 'inroot.txt'), '#') + self.write_file((some_dir, 'file.txt'), '#') + self.write_file((some_dir, 'other_file.txt'), '#') + + dist.data_files = [('data', ['data/data.dt', + 'buildout.cfg', + 'inroot.txt', + 'notexisting']), + 'some/file.txt', + 'some/other_file.txt'] + + # adding a script + script_dir = join(self.tmp_dir, 'scripts') + os.mkdir(script_dir) + self.write_file((script_dir, 'script.py'), '#') + dist.scripts = [join('scripts', 'script.py')] + + cmd.formats = ['zip'] + cmd.use_defaults = True + + cmd.ensure_finalized() + cmd.run() + + # now let's check what we have + dist_folder = join(self.tmp_dir, 'dist') + files = os.listdir(dist_folder) + self.assertEqual(files, ['fake-1.0.zip']) + + zip_file = zipfile.ZipFile(join(dist_folder, 'fake-1.0.zip')) + try: + content = zip_file.namelist() + finally: + zip_file.close() + + # making sure everything was added + expected = ['', 'PKG-INFO', 'README', 'buildout.cfg', + 'data/', 'data/data.dt', 'inroot.txt', + 'scripts/', 'scripts/script.py', 'setup.py', + 'some/', 'some/file.txt', 'some/other_file.txt', + 'somecode/', 'somecode/__init__.py', 'somecode/doc.dat', + 'somecode/doc.txt'] + self.assertEqual(sorted(content), ['fake-1.0/' + x for x in expected]) + + # checking the MANIFEST + f = open(join(self.tmp_dir, 'MANIFEST')) + try: + manifest = f.read() + finally: + f.close() + self.assertEqual(manifest, MANIFEST % {'sep': os.sep}) + + @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run') + def test_metadata_check_option(self): + # testing the `medata-check` option + dist, cmd = self.get_cmd(metadata={}) + + # this should raise some warnings ! + # with the `check` subcommand + cmd.ensure_finalized() + cmd.run() + warnings = [msg for msg in self.get_logs(WARN) if + msg.startswith('warning: check:')] + self.assertEqual(len(warnings), 2) + + # trying with a complete set of metadata + self.clear_logs() + dist, cmd = self.get_cmd() + cmd.ensure_finalized() + cmd.metadata_check = 0 + cmd.run() + warnings = [msg for msg in self.get_logs(WARN) if + msg.startswith('warning: check:')] + self.assertEqual(len(warnings), 0) + + def test_check_metadata_deprecated(self): + # makes sure make_metadata is deprecated + dist, cmd = self.get_cmd() + with check_warnings() as w: + warnings.simplefilter("always") + cmd.check_metadata() + self.assertEqual(len(w.warnings), 1) + + def test_show_formats(self): + with captured_stdout() as stdout: + show_formats() + + # the output should be a header line + one line per format + num_formats = len(ARCHIVE_FORMATS.keys()) + output = [line for line in stdout.getvalue().split('\n') + if line.strip().startswith('--formats=')] + self.assertEqual(len(output), num_formats) + + def test_finalize_options(self): + dist, cmd = self.get_cmd() + cmd.finalize_options() + + # default options set by finalize + self.assertEqual(cmd.manifest, 'MANIFEST') + self.assertEqual(cmd.template, 'MANIFEST.in') + self.assertEqual(cmd.dist_dir, 'dist') + + # formats has to be a string splitable on (' ', ',') or + # a stringlist + cmd.formats = 1 + self.assertRaises(DistutilsOptionError, cmd.finalize_options) + cmd.formats = ['zip'] + cmd.finalize_options() + + # formats has to be known + cmd.formats = 'supazipa' + self.assertRaises(DistutilsOptionError, cmd.finalize_options) + + # the following tests make sure there is a nice error message instead + # of a traceback when parsing an invalid manifest template + + def _check_template(self, content): + dist, cmd = self.get_cmd() + os.chdir(self.tmp_dir) + self.write_file('MANIFEST.in', content) + cmd.ensure_finalized() + cmd.filelist = FileList() + cmd.read_template() + warnings = self.get_logs(WARN) + self.assertEqual(len(warnings), 1) + + def test_invalid_template_unknown_command(self): + self._check_template('taunt knights *') + + def test_invalid_template_wrong_arguments(self): + # this manifest command takes one argument + self._check_template('prune') + + @unittest.skipIf(os.name != 'nt', 'test relevant for Windows only') + def test_invalid_template_wrong_path(self): + # on Windows, trailing slashes are not allowed + # this used to crash instead of raising a warning: #8286 + self._check_template('include examples/') + + @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run') + def test_get_file_list(self): + # make sure MANIFEST is recalculated + dist, cmd = self.get_cmd() + + # filling data_files by pointing files in package_data + dist.package_data = {'somecode': ['*.txt']} + self.write_file((self.tmp_dir, 'somecode', 'doc.txt'), '#') + cmd.formats = ['gztar'] + cmd.ensure_finalized() + cmd.run() + + f = open(cmd.manifest) + try: + manifest = [line.strip() for line in f.read().split('\n') + if line.strip() != ''] + finally: + f.close() + + self.assertEqual(len(manifest), 5) + + # adding a file + self.write_file((self.tmp_dir, 'somecode', 'doc2.txt'), '#') + + # make sure build_py is reinitialized, like a fresh run + build_py = dist.get_command_obj('build_py') + build_py.finalized = False + build_py.ensure_finalized() + + cmd.run() + + f = open(cmd.manifest) + try: + manifest2 = [line.strip() for line in f.read().split('\n') + if line.strip() != ''] + finally: + f.close() + + # do we have the new file in MANIFEST ? + self.assertEqual(len(manifest2), 6) + self.assertIn('doc2.txt', manifest2[-1]) + + @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run') + def test_manifest_marker(self): + # check that autogenerated MANIFESTs have a marker + dist, cmd = self.get_cmd() + cmd.ensure_finalized() + cmd.run() + + f = open(cmd.manifest) + try: + manifest = [line.strip() for line in f.read().split('\n') + if line.strip() != ''] + finally: + f.close() + + self.assertEqual(manifest[0], + '# file GENERATED by distutils, do NOT edit') + + @unittest.skipUnless(ZLIB_SUPPORT, "Need zlib support to run") + def test_manifest_comments(self): + # make sure comments don't cause exceptions or wrong includes + contents = dedent("""\ + # bad.py + #bad.py + good.py + """) + dist, cmd = self.get_cmd() + cmd.ensure_finalized() + self.write_file((self.tmp_dir, cmd.manifest), contents) + self.write_file((self.tmp_dir, 'good.py'), '# pick me!') + self.write_file((self.tmp_dir, 'bad.py'), "# don't pick me!") + self.write_file((self.tmp_dir, '#bad.py'), "# don't pick me!") + cmd.run() + self.assertEqual(cmd.filelist.files, ['good.py']) + + @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run') + def test_manual_manifest(self): + # check that a MANIFEST without a marker is left alone + dist, cmd = self.get_cmd() + cmd.formats = ['gztar'] + cmd.ensure_finalized() + self.write_file((self.tmp_dir, cmd.manifest), 'README.manual') + self.write_file((self.tmp_dir, 'README.manual'), + 'This project maintains its MANIFEST file itself.') + cmd.run() + self.assertEqual(cmd.filelist.files, ['README.manual']) + + f = open(cmd.manifest) + try: + manifest = [line.strip() for line in f.read().split('\n') + if line.strip() != ''] + finally: + f.close() + + self.assertEqual(manifest, ['README.manual']) + + archive_name = join(self.tmp_dir, 'dist', 'fake-1.0.tar.gz') + archive = tarfile.open(archive_name) + try: + filenames = [tarinfo.name for tarinfo in archive] + finally: + archive.close() + self.assertEqual(sorted(filenames), ['fake-1.0', 'fake-1.0/PKG-INFO', + 'fake-1.0/README.manual']) + + @unittest.skipUnless(ZLIB_SUPPORT, "requires zlib") + @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support") + @unittest.skipIf(find_executable('tar') is None, + "The tar command is not found") + @unittest.skipIf(find_executable('gzip') is None, + "The gzip command is not found") + def test_make_distribution_owner_group(self): + # now building a sdist + dist, cmd = self.get_cmd() + + # creating a gztar and specifying the owner+group + cmd.formats = ['gztar'] + cmd.owner = pwd.getpwuid(0)[0] + cmd.group = grp.getgrgid(0)[0] + cmd.ensure_finalized() + cmd.run() + + # making sure we have the good rights + archive_name = join(self.tmp_dir, 'dist', 'fake-1.0.tar.gz') + archive = tarfile.open(archive_name) + try: + for member in archive.getmembers(): + self.assertEqual(member.uid, 0) + self.assertEqual(member.gid, 0) + finally: + archive.close() + + # building a sdist again + dist, cmd = self.get_cmd() + + # creating a gztar + cmd.formats = ['gztar'] + cmd.ensure_finalized() + cmd.run() + + # making sure we have the good rights + archive_name = join(self.tmp_dir, 'dist', 'fake-1.0.tar.gz') + archive = tarfile.open(archive_name) + + # note that we are not testing the group ownership here + # because, depending on the platforms and the container + # rights (see #7408) + try: + for member in archive.getmembers(): + self.assertEqual(member.uid, os.getuid()) + finally: + archive.close() + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_spawn.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_spawn.py new file mode 100644 index 0000000000000000000000000000000000000000..30bbe2a283ba20cebe09c67111858bce04282c17 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_spawn.py @@ -0,0 +1,136 @@ +"""Tests for distutils.spawn.""" +import os +import stat +import sys +import unittest.mock +from test.support import unix_shell, requires_subprocess +from test.support import os_helper + +from distutils.spawn import find_executable +from distutils.spawn import spawn +from distutils.errors import DistutilsExecError +from distutils.tests import support + + +@requires_subprocess() +class SpawnTestCase(support.TempdirManager, + support.LoggingSilencer, + unittest.TestCase): + + @unittest.skipUnless(os.name in ('nt', 'posix'), + 'Runs only under posix or nt') + def test_spawn(self): + tmpdir = self.mkdtemp() + + # creating something executable + # through the shell that returns 1 + if sys.platform != 'win32': + exe = os.path.join(tmpdir, 'foo.sh') + self.write_file(exe, '#!%s\nexit 1' % unix_shell) + else: + exe = os.path.join(tmpdir, 'foo.bat') + self.write_file(exe, 'exit 1') + + os.chmod(exe, 0o777) + self.assertRaises(DistutilsExecError, spawn, [exe]) + + # now something that works + if sys.platform != 'win32': + exe = os.path.join(tmpdir, 'foo.sh') + self.write_file(exe, '#!%s\nexit 0' % unix_shell) + else: + exe = os.path.join(tmpdir, 'foo.bat') + self.write_file(exe, 'exit 0') + + os.chmod(exe, 0o777) + spawn([exe]) # should work without any error + + def test_find_executable(self): + with os_helper.temp_dir() as tmp_dir: + # use TESTFN to get a pseudo-unique filename + program_noeext = os_helper.TESTFN + # Give the temporary program an ".exe" suffix for all. + # It's needed on Windows and not harmful on other platforms. + program = program_noeext + ".exe" + + filename = os.path.join(tmp_dir, program) + with open(filename, "wb"): + pass + os.chmod(filename, stat.S_IXUSR) + + # test path parameter + rv = find_executable(program, path=tmp_dir) + self.assertEqual(rv, filename) + + if sys.platform == 'win32': + # test without ".exe" extension + rv = find_executable(program_noeext, path=tmp_dir) + self.assertEqual(rv, filename) + + # test find in the current directory + with os_helper.change_cwd(tmp_dir): + rv = find_executable(program) + self.assertEqual(rv, program) + + # test non-existent program + dont_exist_program = "dontexist_" + program + rv = find_executable(dont_exist_program , path=tmp_dir) + self.assertIsNone(rv) + + # PATH='': no match, except in the current directory + with os_helper.EnvironmentVarGuard() as env: + env['PATH'] = '' + with unittest.mock.patch('distutils.spawn.os.confstr', + return_value=tmp_dir, create=True), \ + unittest.mock.patch('distutils.spawn.os.defpath', + tmp_dir): + rv = find_executable(program) + self.assertIsNone(rv) + + # look in current directory + with os_helper.change_cwd(tmp_dir): + rv = find_executable(program) + self.assertEqual(rv, program) + + # PATH=':': explicitly looks in the current directory + with os_helper.EnvironmentVarGuard() as env: + env['PATH'] = os.pathsep + with unittest.mock.patch('distutils.spawn.os.confstr', + return_value='', create=True), \ + unittest.mock.patch('distutils.spawn.os.defpath', ''): + rv = find_executable(program) + self.assertIsNone(rv) + + # look in current directory + with os_helper.change_cwd(tmp_dir): + rv = find_executable(program) + self.assertEqual(rv, program) + + # missing PATH: test os.confstr("CS_PATH") and os.defpath + with os_helper.EnvironmentVarGuard() as env: + env.pop('PATH', None) + + # without confstr + with unittest.mock.patch('distutils.spawn.os.confstr', + side_effect=ValueError, + create=True), \ + unittest.mock.patch('distutils.spawn.os.defpath', + tmp_dir): + rv = find_executable(program) + self.assertEqual(rv, filename) + + # with confstr + with unittest.mock.patch('distutils.spawn.os.confstr', + return_value=tmp_dir, create=True), \ + unittest.mock.patch('distutils.spawn.os.defpath', ''): + rv = find_executable(program) + self.assertEqual(rv, filename) + + def test_spawn_missing_exe(self): + with self.assertRaises(DistutilsExecError) as ctx: + spawn(['does-not-exist']) + self.assertIn("command 'does-not-exist' failed", str(ctx.exception)) + + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_sysconfig.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_sysconfig.py new file mode 100644 index 0000000000000000000000000000000000000000..363834fe8b3a347e7791c577d79ee4f40c2616a8 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_sysconfig.py @@ -0,0 +1,258 @@ +"""Tests for distutils.sysconfig.""" +import contextlib +import os +import shutil +import subprocess +import sys +import textwrap +import unittest + +from distutils import sysconfig +from distutils.ccompiler import get_default_compiler +from distutils.tests import support +from test.support import swap_item, requires_subprocess, is_wasi +from test.support.os_helper import TESTFN +from test.support.warnings_helper import check_warnings + + +class SysconfigTestCase(support.EnvironGuard, unittest.TestCase): + def setUp(self): + super(SysconfigTestCase, self).setUp() + self.makefile = None + + def tearDown(self): + if self.makefile is not None: + os.unlink(self.makefile) + self.cleanup_testfn() + super(SysconfigTestCase, self).tearDown() + + def cleanup_testfn(self): + if os.path.isfile(TESTFN): + os.remove(TESTFN) + elif os.path.isdir(TESTFN): + shutil.rmtree(TESTFN) + + @unittest.skipIf(is_wasi, "Incompatible with WASI mapdir and OOT builds") + def test_get_config_h_filename(self): + config_h = sysconfig.get_config_h_filename() + self.assertTrue(os.path.isfile(config_h), config_h) + + def test_get_python_lib(self): + # XXX doesn't work on Linux when Python was never installed before + #self.assertTrue(os.path.isdir(lib_dir), lib_dir) + # test for pythonxx.lib? + self.assertNotEqual(sysconfig.get_python_lib(), + sysconfig.get_python_lib(prefix=TESTFN)) + + def test_get_config_vars(self): + cvars = sysconfig.get_config_vars() + self.assertIsInstance(cvars, dict) + self.assertTrue(cvars) + + @unittest.skipIf(is_wasi, "Incompatible with WASI mapdir and OOT builds") + def test_srcdir(self): + # See Issues #15322, #15364. + srcdir = sysconfig.get_config_var('srcdir') + + self.assertTrue(os.path.isabs(srcdir), srcdir) + self.assertTrue(os.path.isdir(srcdir), srcdir) + + if sysconfig.python_build: + # The python executable has not been installed so srcdir + # should be a full source checkout. + Python_h = os.path.join(srcdir, 'Include', 'Python.h') + self.assertTrue(os.path.exists(Python_h), Python_h) + # /PC/pyconfig.h always exists even if unused on POSIX. + pyconfig_h = os.path.join(srcdir, 'PC', 'pyconfig.h') + self.assertTrue(os.path.exists(pyconfig_h), pyconfig_h) + pyconfig_h_in = os.path.join(srcdir, 'pyconfig.h.in') + self.assertTrue(os.path.exists(pyconfig_h_in), pyconfig_h_in) + elif os.name == 'posix': + self.assertEqual( + os.path.dirname(sysconfig.get_makefile_filename()), + srcdir) + + def test_srcdir_independent_of_cwd(self): + # srcdir should be independent of the current working directory + # See Issues #15322, #15364. + srcdir = sysconfig.get_config_var('srcdir') + cwd = os.getcwd() + try: + os.chdir('..') + srcdir2 = sysconfig.get_config_var('srcdir') + finally: + os.chdir(cwd) + self.assertEqual(srcdir, srcdir2) + + def customize_compiler(self): + # make sure AR gets caught + class compiler: + compiler_type = 'unix' + + def set_executables(self, **kw): + self.exes = kw + + sysconfig_vars = { + 'AR': 'sc_ar', + 'CC': 'sc_cc', + 'CXX': 'sc_cxx', + 'ARFLAGS': '--sc-arflags', + 'CFLAGS': '--sc-cflags', + 'CCSHARED': '--sc-ccshared', + 'LDSHARED': 'sc_ldshared', + 'SHLIB_SUFFIX': 'sc_shutil_suffix', + + # On macOS, disable _osx_support.customize_compiler() + 'CUSTOMIZED_OSX_COMPILER': 'True', + } + + comp = compiler() + with contextlib.ExitStack() as cm: + for key, value in sysconfig_vars.items(): + cm.enter_context(swap_item(sysconfig._config_vars, key, value)) + sysconfig.customize_compiler(comp) + + return comp + + @unittest.skipUnless(get_default_compiler() == 'unix', + 'not testing if default compiler is not unix') + def test_customize_compiler(self): + # Make sure that sysconfig._config_vars is initialized + sysconfig.get_config_vars() + + os.environ['AR'] = 'env_ar' + os.environ['CC'] = 'env_cc' + os.environ['CPP'] = 'env_cpp' + os.environ['CXX'] = 'env_cxx --env-cxx-flags' + os.environ['LDSHARED'] = 'env_ldshared' + os.environ['LDFLAGS'] = '--env-ldflags' + os.environ['ARFLAGS'] = '--env-arflags' + os.environ['CFLAGS'] = '--env-cflags' + os.environ['CPPFLAGS'] = '--env-cppflags' + + comp = self.customize_compiler() + self.assertEqual(comp.exes['archiver'], + 'env_ar --env-arflags') + self.assertEqual(comp.exes['preprocessor'], + 'env_cpp --env-cppflags') + self.assertEqual(comp.exes['compiler'], + 'env_cc --sc-cflags --env-cflags --env-cppflags') + self.assertEqual(comp.exes['compiler_so'], + ('env_cc --sc-cflags ' + '--env-cflags ''--env-cppflags --sc-ccshared')) + self.assertEqual(comp.exes['compiler_cxx'], + 'env_cxx --env-cxx-flags') + self.assertEqual(comp.exes['linker_exe'], + 'env_cc') + self.assertEqual(comp.exes['linker_so'], + ('env_ldshared --env-ldflags --env-cflags' + ' --env-cppflags')) + self.assertEqual(comp.shared_lib_extension, 'sc_shutil_suffix') + + del os.environ['AR'] + del os.environ['CC'] + del os.environ['CPP'] + del os.environ['CXX'] + del os.environ['LDSHARED'] + del os.environ['LDFLAGS'] + del os.environ['ARFLAGS'] + del os.environ['CFLAGS'] + del os.environ['CPPFLAGS'] + + comp = self.customize_compiler() + self.assertEqual(comp.exes['archiver'], + 'sc_ar --sc-arflags') + self.assertEqual(comp.exes['preprocessor'], + 'sc_cc -E') + self.assertEqual(comp.exes['compiler'], + 'sc_cc --sc-cflags') + self.assertEqual(comp.exes['compiler_so'], + 'sc_cc --sc-cflags --sc-ccshared') + self.assertEqual(comp.exes['compiler_cxx'], + 'sc_cxx') + self.assertEqual(comp.exes['linker_exe'], + 'sc_cc') + self.assertEqual(comp.exes['linker_so'], + 'sc_ldshared') + self.assertEqual(comp.shared_lib_extension, 'sc_shutil_suffix') + + def test_parse_makefile_base(self): + self.makefile = TESTFN + fd = open(self.makefile, 'w') + try: + fd.write(r"CONFIG_ARGS= '--arg1=optarg1' 'ENV=LIB'" '\n') + fd.write('VAR=$OTHER\nOTHER=foo') + finally: + fd.close() + d = sysconfig.parse_makefile(self.makefile) + self.assertEqual(d, {'CONFIG_ARGS': "'--arg1=optarg1' 'ENV=LIB'", + 'OTHER': 'foo'}) + + def test_parse_makefile_literal_dollar(self): + self.makefile = TESTFN + fd = open(self.makefile, 'w') + try: + fd.write(r"CONFIG_ARGS= '--arg1=optarg1' 'ENV=\$$LIB'" '\n') + fd.write('VAR=$OTHER\nOTHER=foo') + finally: + fd.close() + d = sysconfig.parse_makefile(self.makefile) + self.assertEqual(d, {'CONFIG_ARGS': r"'--arg1=optarg1' 'ENV=\$LIB'", + 'OTHER': 'foo'}) + + + def test_sysconfig_module(self): + import sysconfig as global_sysconfig + self.assertEqual(global_sysconfig.get_config_var('CFLAGS'), + sysconfig.get_config_var('CFLAGS')) + self.assertEqual(global_sysconfig.get_config_var('LDFLAGS'), + sysconfig.get_config_var('LDFLAGS')) + + @unittest.skipIf(sysconfig.get_config_var('CUSTOMIZED_OSX_COMPILER'), + 'compiler flags customized') + def test_sysconfig_compiler_vars(self): + # On OS X, binary installers support extension module building on + # various levels of the operating system with differing Xcode + # configurations. This requires customization of some of the + # compiler configuration directives to suit the environment on + # the installed machine. Some of these customizations may require + # running external programs and, so, are deferred until needed by + # the first extension module build. With Python 3.3, only + # the Distutils version of sysconfig is used for extension module + # builds, which happens earlier in the Distutils tests. This may + # cause the following tests to fail since no tests have caused + # the global version of sysconfig to call the customization yet. + # The solution for now is to simply skip this test in this case. + # The longer-term solution is to only have one version of sysconfig. + + import sysconfig as global_sysconfig + if sysconfig.get_config_var('CUSTOMIZED_OSX_COMPILER'): + self.skipTest('compiler flags customized') + self.assertEqual(global_sysconfig.get_config_var('LDSHARED'), + sysconfig.get_config_var('LDSHARED')) + self.assertEqual(global_sysconfig.get_config_var('CC'), + sysconfig.get_config_var('CC')) + + @requires_subprocess() + def test_customize_compiler_before_get_config_vars(self): + # Issue #21923: test that a Distribution compiler + # instance can be called without an explicit call to + # get_config_vars(). + with open(TESTFN, 'w') as f: + f.writelines(textwrap.dedent('''\ + from distutils.core import Distribution + config = Distribution().get_command_obj('config') + # try_compile may pass or it may fail if no compiler + # is found but it should not raise an exception. + rc = config.try_compile('int x;') + ''')) + p = subprocess.Popen([str(sys.executable), TESTFN], + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + universal_newlines=True) + outs, errs = p.communicate() + self.assertEqual(0, p.returncode, "Subprocess failed: " + outs) + + +if __name__ == '__main__': + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_text_file.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_text_file.py new file mode 100644 index 0000000000000000000000000000000000000000..fbf48515a1da70deba93b7c0563cba62bede44d3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_text_file.py @@ -0,0 +1,103 @@ +"""Tests for distutils.text_file.""" +import os +import unittest +from distutils.text_file import TextFile +from distutils.tests import support + +TEST_DATA = """# test file + +line 3 \\ +# intervening comment + continues on next line +""" + +class TextFileTestCase(support.TempdirManager, unittest.TestCase): + + def test_class(self): + # old tests moved from text_file.__main__ + # so they are really called by the buildbots + + # result 1: no fancy options + result1 = ['# test file\n', '\n', 'line 3 \\\n', + '# intervening comment\n', + ' continues on next line\n'] + + # result 2: just strip comments + result2 = ["\n", + "line 3 \\\n", + " continues on next line\n"] + + # result 3: just strip blank lines + result3 = ["# test file\n", + "line 3 \\\n", + "# intervening comment\n", + " continues on next line\n"] + + # result 4: default, strip comments, blank lines, + # and trailing whitespace + result4 = ["line 3 \\", + " continues on next line"] + + # result 5: strip comments and blanks, plus join lines (but don't + # "collapse" joined lines + result5 = ["line 3 continues on next line"] + + # result 6: strip comments and blanks, plus join lines (and + # "collapse" joined lines + result6 = ["line 3 continues on next line"] + + def test_input(count, description, file, expected_result): + result = file.readlines() + self.assertEqual(result, expected_result) + + tmpdir = self.mkdtemp() + filename = os.path.join(tmpdir, "test.txt") + out_file = open(filename, "w") + try: + out_file.write(TEST_DATA) + finally: + out_file.close() + + in_file = TextFile(filename, strip_comments=0, skip_blanks=0, + lstrip_ws=0, rstrip_ws=0) + try: + test_input(1, "no processing", in_file, result1) + finally: + in_file.close() + + in_file = TextFile(filename, strip_comments=1, skip_blanks=0, + lstrip_ws=0, rstrip_ws=0) + try: + test_input(2, "strip comments", in_file, result2) + finally: + in_file.close() + + in_file = TextFile(filename, strip_comments=0, skip_blanks=1, + lstrip_ws=0, rstrip_ws=0) + try: + test_input(3, "strip blanks", in_file, result3) + finally: + in_file.close() + + in_file = TextFile(filename) + try: + test_input(4, "default processing", in_file, result4) + finally: + in_file.close() + + in_file = TextFile(filename, strip_comments=1, skip_blanks=1, + join_lines=1, rstrip_ws=1) + try: + test_input(5, "join lines without collapsing", in_file, result5) + finally: + in_file.close() + + in_file = TextFile(filename, strip_comments=1, skip_blanks=1, + join_lines=1, rstrip_ws=1, collapse_join=1) + try: + test_input(6, "join lines with collapsing", in_file, result6) + finally: + in_file.close() + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_unixccompiler.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_unixccompiler.py new file mode 100644 index 0000000000000000000000000000000000000000..6a6592527c7659853e9a78494d9029f7c1800ba5 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_unixccompiler.py @@ -0,0 +1,141 @@ +"""Tests for distutils.unixccompiler.""" +import sys +import unittest +from test.support.os_helper import EnvironmentVarGuard + +from distutils import sysconfig +from distutils.unixccompiler import UnixCCompiler + +class UnixCCompilerTestCase(unittest.TestCase): + + def setUp(self): + self._backup_platform = sys.platform + self._backup_get_config_var = sysconfig.get_config_var + self._backup_config_vars = dict(sysconfig._config_vars) + class CompilerWrapper(UnixCCompiler): + def rpath_foo(self): + return self.runtime_library_dir_option('/foo') + self.cc = CompilerWrapper() + + def tearDown(self): + sys.platform = self._backup_platform + sysconfig.get_config_var = self._backup_get_config_var + sysconfig._config_vars.clear() + sysconfig._config_vars.update(self._backup_config_vars) + + @unittest.skipIf(sys.platform == 'win32', "can't test on Windows") + def test_runtime_libdir_option(self): + # Issue#5900 + # + # Ensure RUNPATH is added to extension modules with RPATH if + # GNU ld is used + + # darwin + sys.platform = 'darwin' + self.assertEqual(self.cc.rpath_foo(), '-L/foo') + + # hp-ux + sys.platform = 'hp-ux' + old_gcv = sysconfig.get_config_var + def gcv(v): + return 'xxx' + sysconfig.get_config_var = gcv + self.assertEqual(self.cc.rpath_foo(), ['+s', '-L/foo']) + + def gcv(v): + return 'gcc' + sysconfig.get_config_var = gcv + self.assertEqual(self.cc.rpath_foo(), ['-Wl,+s', '-L/foo']) + + def gcv(v): + return 'g++' + sysconfig.get_config_var = gcv + self.assertEqual(self.cc.rpath_foo(), ['-Wl,+s', '-L/foo']) + + sysconfig.get_config_var = old_gcv + + # GCC GNULD + sys.platform = 'bar' + def gcv(v): + if v == 'CC': + return 'gcc' + elif v == 'GNULD': + return 'yes' + sysconfig.get_config_var = gcv + self.assertEqual(self.cc.rpath_foo(), '-Wl,--enable-new-dtags,-R/foo') + + # GCC non-GNULD + sys.platform = 'bar' + def gcv(v): + if v == 'CC': + return 'gcc' + elif v == 'GNULD': + return 'no' + sysconfig.get_config_var = gcv + self.assertEqual(self.cc.rpath_foo(), '-Wl,-R/foo') + + # GCC GNULD with fully qualified configuration prefix + # see #7617 + sys.platform = 'bar' + def gcv(v): + if v == 'CC': + return 'x86_64-pc-linux-gnu-gcc-4.4.2' + elif v == 'GNULD': + return 'yes' + sysconfig.get_config_var = gcv + self.assertEqual(self.cc.rpath_foo(), '-Wl,--enable-new-dtags,-R/foo') + + # non-GCC GNULD + sys.platform = 'bar' + def gcv(v): + if v == 'CC': + return 'cc' + elif v == 'GNULD': + return 'yes' + sysconfig.get_config_var = gcv + self.assertEqual(self.cc.rpath_foo(), '-R/foo') + + # non-GCC non-GNULD + sys.platform = 'bar' + def gcv(v): + if v == 'CC': + return 'cc' + elif v == 'GNULD': + return 'no' + sysconfig.get_config_var = gcv + self.assertEqual(self.cc.rpath_foo(), '-R/foo') + + @unittest.skipUnless(sys.platform == 'darwin', 'test only relevant for OS X') + def test_osx_cc_overrides_ldshared(self): + # Issue #18080: + # ensure that setting CC env variable also changes default linker + def gcv(v): + if v == 'LDSHARED': + return 'gcc-4.2 -bundle -undefined dynamic_lookup ' + return 'gcc-4.2' + sysconfig.get_config_var = gcv + with EnvironmentVarGuard() as env: + env['CC'] = 'my_cc' + del env['LDSHARED'] + sysconfig.customize_compiler(self.cc) + self.assertEqual(self.cc.linker_so[0], 'my_cc') + + @unittest.skipUnless(sys.platform == 'darwin', 'test only relevant for OS X') + def test_osx_explicit_ldshared(self): + # Issue #18080: + # ensure that setting CC env variable does not change + # explicit LDSHARED setting for linker + def gcv(v): + if v == 'LDSHARED': + return 'gcc-4.2 -bundle -undefined dynamic_lookup ' + return 'gcc-4.2' + sysconfig.get_config_var = gcv + with EnvironmentVarGuard() as env: + env['CC'] = 'my_cc' + env['LDSHARED'] = 'my_ld -bundle -dynamic' + sysconfig.customize_compiler(self.cc) + self.assertEqual(self.cc.linker_so[0], 'my_ld') + + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_upload.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_upload.py new file mode 100644 index 0000000000000000000000000000000000000000..9aae88bed582da3679004d207bf580a31fef2699 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_upload.py @@ -0,0 +1,219 @@ +"""Tests for distutils.command.upload.""" +import os +import unittest +import unittest.mock as mock +from urllib.error import HTTPError + + +from distutils.command import upload as upload_mod +from distutils.command.upload import upload +from distutils.core import Distribution +from distutils.errors import DistutilsError +from distutils.log import ERROR, INFO + +from distutils.tests.test_config import PYPIRC, BasePyPIRCCommandTestCase + +PYPIRC_LONG_PASSWORD = """\ +[distutils] + +index-servers = + server1 + server2 + +[server1] +username:me +password:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + +[server2] +username:meagain +password: secret +realm:acme +repository:http://another.pypi/ +""" + + +PYPIRC_NOPASSWORD = """\ +[distutils] + +index-servers = + server1 + +[server1] +username:me +""" + +class FakeOpen(object): + + def __init__(self, url, msg=None, code=None): + self.url = url + if not isinstance(url, str): + self.req = url + else: + self.req = None + self.msg = msg or 'OK' + self.code = code or 200 + + def getheader(self, name, default=None): + return { + 'content-type': 'text/plain; charset=utf-8', + }.get(name.lower(), default) + + def read(self): + return b'xyzzy' + + def getcode(self): + return self.code + + +class uploadTestCase(BasePyPIRCCommandTestCase): + + def setUp(self): + super(uploadTestCase, self).setUp() + self.old_open = upload_mod.urlopen + upload_mod.urlopen = self._urlopen + self.last_open = None + self.next_msg = None + self.next_code = None + + def tearDown(self): + upload_mod.urlopen = self.old_open + super(uploadTestCase, self).tearDown() + + def _urlopen(self, url): + self.last_open = FakeOpen(url, msg=self.next_msg, code=self.next_code) + return self.last_open + + def test_finalize_options(self): + + # new format + self.write_file(self.rc, PYPIRC) + dist = Distribution() + cmd = upload(dist) + cmd.finalize_options() + for attr, waited in (('username', 'me'), ('password', 'secret'), + ('realm', 'pypi'), + ('repository', 'https://upload.pypi.org/legacy/')): + self.assertEqual(getattr(cmd, attr), waited) + + def test_saved_password(self): + # file with no password + self.write_file(self.rc, PYPIRC_NOPASSWORD) + + # make sure it passes + dist = Distribution() + cmd = upload(dist) + cmd.finalize_options() + self.assertEqual(cmd.password, None) + + # make sure we get it as well, if another command + # initialized it at the dist level + dist.password = 'xxx' + cmd = upload(dist) + cmd.finalize_options() + self.assertEqual(cmd.password, 'xxx') + + def test_upload(self): + tmp = self.mkdtemp() + path = os.path.join(tmp, 'xxx') + self.write_file(path) + command, pyversion, filename = 'xxx', '2.6', path + dist_files = [(command, pyversion, filename)] + self.write_file(self.rc, PYPIRC_LONG_PASSWORD) + + # lets run it + pkg_dir, dist = self.create_dist(dist_files=dist_files) + cmd = upload(dist) + cmd.show_response = 1 + cmd.ensure_finalized() + cmd.run() + + # what did we send ? + headers = dict(self.last_open.req.headers) + self.assertGreaterEqual(int(headers['Content-length']), 2162) + content_type = headers['Content-type'] + self.assertTrue(content_type.startswith('multipart/form-data')) + self.assertEqual(self.last_open.req.get_method(), 'POST') + expected_url = 'https://upload.pypi.org/legacy/' + self.assertEqual(self.last_open.req.get_full_url(), expected_url) + data = self.last_open.req.data + self.assertIn(b'xxx',data) + self.assertIn(b'protocol_version', data) + self.assertIn(b'sha256_digest', data) + self.assertIn( + b'cd2eb0837c9b4c962c22d2ff8b5441b7b45805887f051d39bf133b583baf' + b'6860', + data + ) + if b'md5_digest' in data: + self.assertIn(b'f561aaf6ef0bf14d4208bb46a4ccb3ad', data) + if b'blake2_256_digest' in data: + self.assertIn( + b'b6f289a27d4fe90da63c503bfe0a9b761a8f76bb86148565065f040be' + b'6d1c3044cf7ded78ef800509bccb4b648e507d88dc6383d67642aadcc' + b'ce443f1534330a', + data + ) + + # The PyPI response body was echoed + results = self.get_logs(INFO) + self.assertEqual(results[-1], 75 * '-' + '\nxyzzy\n' + 75 * '-') + + # bpo-32304: archives whose last byte was b'\r' were corrupted due to + # normalization intended for Mac OS 9. + def test_upload_correct_cr(self): + # content that ends with \r should not be modified. + tmp = self.mkdtemp() + path = os.path.join(tmp, 'xxx') + self.write_file(path, content='yy\r') + command, pyversion, filename = 'xxx', '2.6', path + dist_files = [(command, pyversion, filename)] + self.write_file(self.rc, PYPIRC_LONG_PASSWORD) + + # other fields that ended with \r used to be modified, now are + # preserved. + pkg_dir, dist = self.create_dist( + dist_files=dist_files, + description='long description\r' + ) + cmd = upload(dist) + cmd.show_response = 1 + cmd.ensure_finalized() + cmd.run() + + headers = dict(self.last_open.req.headers) + self.assertGreaterEqual(int(headers['Content-length']), 2172) + self.assertIn(b'long description\r', self.last_open.req.data) + + def test_upload_fails(self): + self.next_msg = "Not Found" + self.next_code = 404 + self.assertRaises(DistutilsError, self.test_upload) + + def test_wrong_exception_order(self): + tmp = self.mkdtemp() + path = os.path.join(tmp, 'xxx') + self.write_file(path) + dist_files = [('xxx', '2.6', path)] # command, pyversion, filename + self.write_file(self.rc, PYPIRC_LONG_PASSWORD) + + pkg_dir, dist = self.create_dist(dist_files=dist_files) + tests = [ + (OSError('oserror'), 'oserror', OSError), + (HTTPError('url', 400, 'httperror', {}, None), + 'Upload failed (400): httperror', DistutilsError), + ] + for exception, expected, raised_exception in tests: + with self.subTest(exception=type(exception).__name__): + with mock.patch('distutils.command.upload.urlopen', + new=mock.Mock(side_effect=exception)): + with self.assertRaises(raised_exception): + cmd = upload(dist) + cmd.ensure_finalized() + cmd.run() + results = self.get_logs(ERROR) + self.assertIn(expected, results[-1]) + self.clear_logs() + + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_util.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_util.py new file mode 100644 index 0000000000000000000000000000000000000000..1b002cb35be1d05900e8818e647c147d819dafcb --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_util.py @@ -0,0 +1,309 @@ +"""Tests for distutils.util.""" +import os +import sys +import unittest +from copy import copy +from unittest import mock + +from distutils.errors import DistutilsPlatformError, DistutilsByteCompileError +from distutils.util import (get_platform, convert_path, change_root, + check_environ, split_quoted, strtobool, + rfc822_escape, byte_compile, + grok_environment_error) +from distutils import util # used to patch _environ_checked +from distutils.sysconfig import get_config_vars +from distutils import sysconfig +from distutils.tests import support +import _osx_support + +class UtilTestCase(support.EnvironGuard, unittest.TestCase): + + def setUp(self): + super(UtilTestCase, self).setUp() + # saving the environment + self.name = os.name + self.platform = sys.platform + self.version = sys.version + self.sep = os.sep + self.join = os.path.join + self.isabs = os.path.isabs + self.splitdrive = os.path.splitdrive + self._config_vars = copy(sysconfig._config_vars) + + # patching os.uname + if hasattr(os, 'uname'): + self.uname = os.uname + self._uname = os.uname() + else: + self.uname = None + self._uname = None + + os.uname = self._get_uname + + def tearDown(self): + # getting back the environment + os.name = self.name + sys.platform = self.platform + sys.version = self.version + os.sep = self.sep + os.path.join = self.join + os.path.isabs = self.isabs + os.path.splitdrive = self.splitdrive + if self.uname is not None: + os.uname = self.uname + else: + del os.uname + sysconfig._config_vars.clear() + sysconfig._config_vars.update(self._config_vars) + super(UtilTestCase, self).tearDown() + + def _set_uname(self, uname): + self._uname = uname + + def _get_uname(self): + return self._uname + + def test_get_platform(self): + + # windows XP, 32bits + os.name = 'nt' + sys.version = ('2.4.4 (#71, Oct 18 2006, 08:34:43) ' + '[MSC v.1310 32 bit (Intel)]') + sys.platform = 'win32' + self.assertEqual(get_platform(), 'win32') + + # windows XP, amd64 + os.name = 'nt' + sys.version = ('2.4.4 (#71, Oct 18 2006, 08:34:43) ' + '[MSC v.1310 32 bit (Amd64)]') + sys.platform = 'win32' + self.assertEqual(get_platform(), 'win-amd64') + + # macbook + os.name = 'posix' + sys.version = ('2.5 (r25:51918, Sep 19 2006, 08:49:13) ' + '\n[GCC 4.0.1 (Apple Computer, Inc. build 5341)]') + sys.platform = 'darwin' + self._set_uname(('Darwin', 'macziade', '8.11.1', + ('Darwin Kernel Version 8.11.1: ' + 'Wed Oct 10 18:23:28 PDT 2007; ' + 'root:xnu-792.25.20~1/RELEASE_I386'), 'i386')) + _osx_support._remove_original_values(get_config_vars()) + get_config_vars()['MACOSX_DEPLOYMENT_TARGET'] = '10.3' + + get_config_vars()['CFLAGS'] = ('-fno-strict-aliasing -DNDEBUG -g ' + '-fwrapv -O3 -Wall -Wstrict-prototypes') + + cursize = sys.maxsize + sys.maxsize = (2 ** 31)-1 + try: + self.assertEqual(get_platform(), 'macosx-10.3-i386') + finally: + sys.maxsize = cursize + + # macbook with fat binaries (fat, universal or fat64) + _osx_support._remove_original_values(get_config_vars()) + get_config_vars()['MACOSX_DEPLOYMENT_TARGET'] = '10.4' + get_config_vars()['CFLAGS'] = ('-arch ppc -arch i386 -isysroot ' + '/Developer/SDKs/MacOSX10.4u.sdk ' + '-fno-strict-aliasing -fno-common ' + '-dynamic -DNDEBUG -g -O3') + + self.assertEqual(get_platform(), 'macosx-10.4-fat') + + _osx_support._remove_original_values(get_config_vars()) + os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.1' + self.assertEqual(get_platform(), 'macosx-10.4-fat') + + + _osx_support._remove_original_values(get_config_vars()) + get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch i386 -isysroot ' + '/Developer/SDKs/MacOSX10.4u.sdk ' + '-fno-strict-aliasing -fno-common ' + '-dynamic -DNDEBUG -g -O3') + + self.assertEqual(get_platform(), 'macosx-10.4-intel') + + _osx_support._remove_original_values(get_config_vars()) + get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch ppc -arch i386 -isysroot ' + '/Developer/SDKs/MacOSX10.4u.sdk ' + '-fno-strict-aliasing -fno-common ' + '-dynamic -DNDEBUG -g -O3') + self.assertEqual(get_platform(), 'macosx-10.4-fat3') + + _osx_support._remove_original_values(get_config_vars()) + get_config_vars()['CFLAGS'] = ('-arch ppc64 -arch x86_64 -arch ppc -arch i386 -isysroot ' + '/Developer/SDKs/MacOSX10.4u.sdk ' + '-fno-strict-aliasing -fno-common ' + '-dynamic -DNDEBUG -g -O3') + self.assertEqual(get_platform(), 'macosx-10.4-universal') + + _osx_support._remove_original_values(get_config_vars()) + get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch ppc64 -isysroot ' + '/Developer/SDKs/MacOSX10.4u.sdk ' + '-fno-strict-aliasing -fno-common ' + '-dynamic -DNDEBUG -g -O3') + + self.assertEqual(get_platform(), 'macosx-10.4-fat64') + + for arch in ('ppc', 'i386', 'x86_64', 'ppc64'): + _osx_support._remove_original_values(get_config_vars()) + get_config_vars()['CFLAGS'] = ('-arch %s -isysroot ' + '/Developer/SDKs/MacOSX10.4u.sdk ' + '-fno-strict-aliasing -fno-common ' + '-dynamic -DNDEBUG -g -O3'%(arch,)) + + self.assertEqual(get_platform(), 'macosx-10.4-%s'%(arch,)) + + + # linux debian sarge + os.name = 'posix' + sys.version = ('2.3.5 (#1, Jul 4 2007, 17:28:59) ' + '\n[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)]') + sys.platform = 'linux2' + self._set_uname(('Linux', 'aglae', '2.6.21.1dedibox-r7', + '#1 Mon Apr 30 17:25:38 CEST 2007', 'i686')) + + self.assertEqual(get_platform(), 'linux-i686') + + # XXX more platforms to tests here + + def test_convert_path(self): + # linux/mac + os.sep = '/' + def _join(path): + return '/'.join(path) + os.path.join = _join + + self.assertEqual(convert_path('/home/to/my/stuff'), + '/home/to/my/stuff') + + # win + os.sep = '\\' + def _join(*path): + return '\\'.join(path) + os.path.join = _join + + self.assertRaises(ValueError, convert_path, '/home/to/my/stuff') + self.assertRaises(ValueError, convert_path, 'home/to/my/stuff/') + + self.assertEqual(convert_path('home/to/my/stuff'), + 'home\\to\\my\\stuff') + self.assertEqual(convert_path('.'), + os.curdir) + + def test_change_root(self): + # linux/mac + os.name = 'posix' + def _isabs(path): + return path[0] == '/' + os.path.isabs = _isabs + def _join(*path): + return '/'.join(path) + os.path.join = _join + + self.assertEqual(change_root('/root', '/old/its/here'), + '/root/old/its/here') + self.assertEqual(change_root('/root', 'its/here'), + '/root/its/here') + + # windows + os.name = 'nt' + def _isabs(path): + return path.startswith('c:\\') + os.path.isabs = _isabs + def _splitdrive(path): + if path.startswith('c:'): + return ('', path.replace('c:', '')) + return ('', path) + os.path.splitdrive = _splitdrive + def _join(*path): + return '\\'.join(path) + os.path.join = _join + + self.assertEqual(change_root('c:\\root', 'c:\\old\\its\\here'), + 'c:\\root\\old\\its\\here') + self.assertEqual(change_root('c:\\root', 'its\\here'), + 'c:\\root\\its\\here') + + # BugsBunny os (it's a great os) + os.name = 'BugsBunny' + self.assertRaises(DistutilsPlatformError, + change_root, 'c:\\root', 'its\\here') + + # XXX platforms to be covered: mac + + def test_check_environ(self): + util._environ_checked = 0 + os.environ.pop('HOME', None) + + check_environ() + + self.assertEqual(os.environ['PLAT'], get_platform()) + self.assertEqual(util._environ_checked, 1) + + @unittest.skipUnless(os.name == 'posix', 'specific to posix') + def test_check_environ_getpwuid(self): + util._environ_checked = 0 + os.environ.pop('HOME', None) + + try: + import pwd + except ImportError: + raise unittest.SkipTest("Test requires pwd module.") + + # only set pw_dir field, other fields are not used + result = pwd.struct_passwd((None, None, None, None, None, + '/home/distutils', None)) + with mock.patch.object(pwd, 'getpwuid', return_value=result): + check_environ() + self.assertEqual(os.environ['HOME'], '/home/distutils') + + util._environ_checked = 0 + os.environ.pop('HOME', None) + + # bpo-10496: Catch pwd.getpwuid() error + with mock.patch.object(pwd, 'getpwuid', side_effect=KeyError): + check_environ() + self.assertNotIn('HOME', os.environ) + + def test_split_quoted(self): + self.assertEqual(split_quoted('""one"" "two" \'three\' \\four'), + ['one', 'two', 'three', 'four']) + + def test_strtobool(self): + yes = ('y', 'Y', 'yes', 'True', 't', 'true', 'True', 'On', 'on', '1') + no = ('n', 'no', 'f', 'false', 'off', '0', 'Off', 'No', 'N') + + for y in yes: + self.assertTrue(strtobool(y)) + + for n in no: + self.assertFalse(strtobool(n)) + + def test_rfc822_escape(self): + header = 'I am a\npoor\nlonesome\nheader\n' + res = rfc822_escape(header) + wanted = ('I am a%(8s)spoor%(8s)slonesome%(8s)s' + 'header%(8s)s') % {'8s': '\n'+8*' '} + self.assertEqual(res, wanted) + + def test_dont_write_bytecode(self): + # makes sure byte_compile raise a DistutilsError + # if sys.dont_write_bytecode is True + old_dont_write_bytecode = sys.dont_write_bytecode + sys.dont_write_bytecode = True + try: + self.assertRaises(DistutilsByteCompileError, byte_compile, []) + finally: + sys.dont_write_bytecode = old_dont_write_bytecode + + def test_grok_environment_error(self): + # test obsolete function to ensure backward compat (#4931) + exc = IOError("Unable to find batch file") + msg = grok_environment_error(exc) + self.assertEqual(msg, "error: Unable to find batch file") + + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_version.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_version.py new file mode 100644 index 0000000000000000000000000000000000000000..f102f2953ff50f0867fe6a7f287ac502e82ec329 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_version.py @@ -0,0 +1,83 @@ +"""Tests for distutils.version.""" +import unittest +from distutils.version import LooseVersion +from distutils.version import StrictVersion + +class VersionTestCase(unittest.TestCase): + + def test_prerelease(self): + version = StrictVersion('1.2.3a1') + self.assertEqual(version.version, (1, 2, 3)) + self.assertEqual(version.prerelease, ('a', 1)) + self.assertEqual(str(version), '1.2.3a1') + + version = StrictVersion('1.2.0') + self.assertEqual(str(version), '1.2') + + def test_cmp_strict(self): + versions = (('1.5.1', '1.5.2b2', -1), + ('161', '3.10a', ValueError), + ('8.02', '8.02', 0), + ('3.4j', '1996.07.12', ValueError), + ('3.2.pl0', '3.1.1.6', ValueError), + ('2g6', '11g', ValueError), + ('0.9', '2.2', -1), + ('1.2.1', '1.2', 1), + ('1.1', '1.2.2', -1), + ('1.2', '1.1', 1), + ('1.2.1', '1.2.2', -1), + ('1.2.2', '1.2', 1), + ('1.2', '1.2.2', -1), + ('0.4.0', '0.4', 0), + ('1.13++', '5.5.kw', ValueError)) + + for v1, v2, wanted in versions: + try: + res = StrictVersion(v1)._cmp(StrictVersion(v2)) + except ValueError: + if wanted is ValueError: + continue + else: + raise AssertionError(("cmp(%s, %s) " + "shouldn't raise ValueError") + % (v1, v2)) + self.assertEqual(res, wanted, + 'cmp(%s, %s) should be %s, got %s' % + (v1, v2, wanted, res)) + res = StrictVersion(v1)._cmp(v2) + self.assertEqual(res, wanted, + 'cmp(%s, %s) should be %s, got %s' % + (v1, v2, wanted, res)) + res = StrictVersion(v1)._cmp(object()) + self.assertIs(res, NotImplemented, + 'cmp(%s, %s) should be NotImplemented, got %s' % + (v1, v2, res)) + + + def test_cmp(self): + versions = (('1.5.1', '1.5.2b2', -1), + ('161', '3.10a', 1), + ('8.02', '8.02', 0), + ('3.4j', '1996.07.12', -1), + ('3.2.pl0', '3.1.1.6', 1), + ('2g6', '11g', -1), + ('0.960923', '2.2beta29', -1), + ('1.13++', '5.5.kw', -1)) + + + for v1, v2, wanted in versions: + res = LooseVersion(v1)._cmp(LooseVersion(v2)) + self.assertEqual(res, wanted, + 'cmp(%s, %s) should be %s, got %s' % + (v1, v2, wanted, res)) + res = LooseVersion(v1)._cmp(v2) + self.assertEqual(res, wanted, + 'cmp(%s, %s) should be %s, got %s' % + (v1, v2, wanted, res)) + res = LooseVersion(v1)._cmp(object()) + self.assertIs(res, NotImplemented, + 'cmp(%s, %s) should be NotImplemented, got %s' % + (v1, v2, res)) + +if __name__ == "__main__": + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_versionpredicate.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_versionpredicate.py new file mode 100644 index 0000000000000000000000000000000000000000..b0e9ab2cf59b59523db8956e573953e32bd171cf --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/distutils/tests/test_versionpredicate.py @@ -0,0 +1,13 @@ +"""Tests harness for distutils.versionpredicate. + +""" + +import distutils.versionpredicate +import doctest + +def load_tests(loader, tests, pattern): + tests.addTest(doctest.DocTestSuite(distutils.versionpredicate)) + return tests + +if __name__ == '__main__': + unittest.main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/abstract.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/abstract.h new file mode 100644 index 0000000000000000000000000000000000000000..d276669312ee2f864035bfbc091a402c21e067f4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/abstract.h @@ -0,0 +1,219 @@ +#ifndef Py_CPYTHON_ABSTRACTOBJECT_H +# error "this header file must not be included directly" +#endif + +/* === Object Protocol ================================================== */ + +#ifdef PY_SSIZE_T_CLEAN +# define _PyObject_CallMethodId _PyObject_CallMethodId_SizeT +#endif + +/* Convert keyword arguments from the FASTCALL (stack: C array, kwnames: tuple) + format to a Python dictionary ("kwargs" dict). + + The type of kwnames keys is not checked. The final function getting + arguments is responsible to check if all keys are strings, for example using + PyArg_ParseTupleAndKeywords() or PyArg_ValidateKeywordArguments(). + + Duplicate keys are merged using the last value. If duplicate keys must raise + an exception, the caller is responsible to implement an explicit keys on + kwnames. */ +PyAPI_FUNC(PyObject *) _PyStack_AsDict( + PyObject *const *values, + PyObject *kwnames); + +/* Suggested size (number of positional arguments) for arrays of PyObject* + allocated on a C stack to avoid allocating memory on the heap memory. Such + array is used to pass positional arguments to call functions of the + PyObject_Vectorcall() family. + + The size is chosen to not abuse the C stack and so limit the risk of stack + overflow. The size is also chosen to allow using the small stack for most + function calls of the Python standard library. On 64-bit CPU, it allocates + 40 bytes on the stack. */ +#define _PY_FASTCALL_SMALL_STACK 5 + +PyAPI_FUNC(PyObject *) _Py_CheckFunctionResult( + PyThreadState *tstate, + PyObject *callable, + PyObject *result, + const char *where); + +/* === Vectorcall protocol (PEP 590) ============================= */ + +/* Call callable using tp_call. Arguments are like PyObject_Vectorcall() + or PyObject_FastCallDict() (both forms are supported), + except that nargs is plainly the number of arguments without flags. */ +PyAPI_FUNC(PyObject *) _PyObject_MakeTpCall( + PyThreadState *tstate, + PyObject *callable, + PyObject *const *args, Py_ssize_t nargs, + PyObject *keywords); + +#define PY_VECTORCALL_ARGUMENTS_OFFSET \ + (_Py_STATIC_CAST(size_t, 1) << (8 * sizeof(size_t) - 1)) + +static inline Py_ssize_t +PyVectorcall_NARGS(size_t n) +{ + return n & ~PY_VECTORCALL_ARGUMENTS_OFFSET; +} + +PyAPI_FUNC(vectorcallfunc) PyVectorcall_Function(PyObject *callable); + +PyAPI_FUNC(PyObject *) PyObject_Vectorcall( + PyObject *callable, + PyObject *const *args, + size_t nargsf, + PyObject *kwnames); + +// Backwards compatibility aliases for API that was provisional in Python 3.8 +#define _PyObject_Vectorcall PyObject_Vectorcall +#define _PyObject_VectorcallMethod PyObject_VectorcallMethod +#define _PyObject_FastCallDict PyObject_VectorcallDict +#define _PyVectorcall_Function PyVectorcall_Function +#define _PyObject_CallOneArg PyObject_CallOneArg +#define _PyObject_CallMethodNoArgs PyObject_CallMethodNoArgs +#define _PyObject_CallMethodOneArg PyObject_CallMethodOneArg + +/* Same as PyObject_Vectorcall except that keyword arguments are passed as + dict, which may be NULL if there are no keyword arguments. */ +PyAPI_FUNC(PyObject *) PyObject_VectorcallDict( + PyObject *callable, + PyObject *const *args, + size_t nargsf, + PyObject *kwargs); + +/* Call "callable" (which must support vectorcall) with positional arguments + "tuple" and keyword arguments "dict". "dict" may also be NULL */ +PyAPI_FUNC(PyObject *) PyVectorcall_Call(PyObject *callable, PyObject *tuple, PyObject *dict); + +// Same as PyObject_Vectorcall(), except without keyword arguments +PyAPI_FUNC(PyObject *) _PyObject_FastCall( + PyObject *func, + PyObject *const *args, + Py_ssize_t nargs); + +PyAPI_FUNC(PyObject *) PyObject_CallOneArg(PyObject *func, PyObject *arg); + +PyAPI_FUNC(PyObject *) PyObject_VectorcallMethod( + PyObject *name, PyObject *const *args, + size_t nargsf, PyObject *kwnames); + +static inline PyObject * +PyObject_CallMethodNoArgs(PyObject *self, PyObject *name) +{ + size_t nargsf = 1 | PY_VECTORCALL_ARGUMENTS_OFFSET; + return PyObject_VectorcallMethod(name, &self, nargsf, _Py_NULL); +} + +static inline PyObject * +PyObject_CallMethodOneArg(PyObject *self, PyObject *name, PyObject *arg) +{ + PyObject *args[2] = {self, arg}; + size_t nargsf = 2 | PY_VECTORCALL_ARGUMENTS_OFFSET; + assert(arg != NULL); + return PyObject_VectorcallMethod(name, args, nargsf, _Py_NULL); +} + +PyAPI_FUNC(PyObject *) _PyObject_CallMethod(PyObject *obj, + PyObject *name, + const char *format, ...); + +/* Like PyObject_CallMethod(), but expect a _Py_Identifier* + as the method name. */ +PyAPI_FUNC(PyObject *) _PyObject_CallMethodId(PyObject *obj, + _Py_Identifier *name, + const char *format, ...); + +PyAPI_FUNC(PyObject *) _PyObject_CallMethodId_SizeT(PyObject *obj, + _Py_Identifier *name, + const char *format, + ...); + +PyAPI_FUNC(PyObject *) _PyObject_CallMethodIdObjArgs( + PyObject *obj, + _Py_Identifier *name, + ...); + +static inline PyObject * +_PyObject_VectorcallMethodId( + _Py_Identifier *name, PyObject *const *args, + size_t nargsf, PyObject *kwnames) +{ + PyObject *oname = _PyUnicode_FromId(name); /* borrowed */ + if (!oname) { + return _Py_NULL; + } + return PyObject_VectorcallMethod(oname, args, nargsf, kwnames); +} + +static inline PyObject * +_PyObject_CallMethodIdNoArgs(PyObject *self, _Py_Identifier *name) +{ + size_t nargsf = 1 | PY_VECTORCALL_ARGUMENTS_OFFSET; + return _PyObject_VectorcallMethodId(name, &self, nargsf, _Py_NULL); +} + +static inline PyObject * +_PyObject_CallMethodIdOneArg(PyObject *self, _Py_Identifier *name, PyObject *arg) +{ + PyObject *args[2] = {self, arg}; + size_t nargsf = 2 | PY_VECTORCALL_ARGUMENTS_OFFSET; + assert(arg != NULL); + return _PyObject_VectorcallMethodId(name, args, nargsf, _Py_NULL); +} + +PyAPI_FUNC(int) _PyObject_HasLen(PyObject *o); + +/* Guess the size of object 'o' using len(o) or o.__length_hint__(). + If neither of those return a non-negative value, then return the default + value. If one of the calls fails, this function returns -1. */ +PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t); + +/* === Sequence protocol ================================================ */ + +/* Assume tp_as_sequence and sq_item exist and that 'i' does not + need to be corrected for a negative index. */ +#define PySequence_ITEM(o, i)\ + ( Py_TYPE(o)->tp_as_sequence->sq_item(o, i) ) + +#define PY_ITERSEARCH_COUNT 1 +#define PY_ITERSEARCH_INDEX 2 +#define PY_ITERSEARCH_CONTAINS 3 + +/* Iterate over seq. + + Result depends on the operation: + + PY_ITERSEARCH_COUNT: return # of times obj appears in seq; -1 if + error. + PY_ITERSEARCH_INDEX: return 0-based index of first occurrence of + obj in seq; set ValueError and return -1 if none found; + also return -1 on error. + PY_ITERSEARCH_CONTAINS: return 1 if obj in seq, else 0; -1 on + error. */ +PyAPI_FUNC(Py_ssize_t) _PySequence_IterSearch(PyObject *seq, + PyObject *obj, int operation); + +/* === Mapping protocol ================================================= */ + +PyAPI_FUNC(int) _PyObject_RealIsInstance(PyObject *inst, PyObject *cls); + +PyAPI_FUNC(int) _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls); + +PyAPI_FUNC(char *const *) _PySequence_BytesToCharpArray(PyObject* self); + +PyAPI_FUNC(void) _Py_FreeCharPArray(char *const array[]); + +/* For internal use by buffer API functions */ +PyAPI_FUNC(void) _Py_add_one_to_index_F(int nd, Py_ssize_t *index, + const Py_ssize_t *shape); +PyAPI_FUNC(void) _Py_add_one_to_index_C(int nd, Py_ssize_t *index, + const Py_ssize_t *shape); + +/* Convert Python int to Py_ssize_t. Do nothing if the argument is None. */ +PyAPI_FUNC(int) _Py_convert_optional_to_ssize_t(PyObject *, void *); + +/* Same as PyNumber_Index but can return an instance of a subclass of int. */ +PyAPI_FUNC(PyObject *) _PyNumber_Index(PyObject *o); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/bytearrayobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/bytearrayobject.h new file mode 100644 index 0000000000000000000000000000000000000000..5114169c280915329b9801f6461f4047091a58bb --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/bytearrayobject.h @@ -0,0 +1,38 @@ +#ifndef Py_CPYTHON_BYTEARRAYOBJECT_H +# error "this header file must not be included directly" +#endif + +/* Object layout */ +typedef struct { + PyObject_VAR_HEAD + Py_ssize_t ob_alloc; /* How many bytes allocated in ob_bytes */ + char *ob_bytes; /* Physical backing buffer */ + char *ob_start; /* Logical start inside ob_bytes */ + Py_ssize_t ob_exports; /* How many buffer exports */ +} PyByteArrayObject; + +PyAPI_DATA(char) _PyByteArray_empty_string[]; + +/* Macros and static inline functions, trading safety for speed */ +#define _PyByteArray_CAST(op) \ + (assert(PyByteArray_Check(op)), _Py_CAST(PyByteArrayObject*, op)) + +static inline char* PyByteArray_AS_STRING(PyObject *op) +{ + PyByteArrayObject *self = _PyByteArray_CAST(op); + if (Py_SIZE(self)) { + return self->ob_start; + } + return _PyByteArray_empty_string; +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +# define PyByteArray_AS_STRING(self) PyByteArray_AS_STRING(_PyObject_CAST(self)) +#endif + +static inline Py_ssize_t PyByteArray_GET_SIZE(PyObject *op) { + PyByteArrayObject *self = _PyByteArray_CAST(op); + return Py_SIZE(self); +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +# define PyByteArray_GET_SIZE(self) PyByteArray_GET_SIZE(_PyObject_CAST(self)) +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/bytesobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/bytesobject.h new file mode 100644 index 0000000000000000000000000000000000000000..0899bf62615ef6ced7b62dd4a137a6042b0bbe37 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/bytesobject.h @@ -0,0 +1,137 @@ +#ifndef Py_CPYTHON_BYTESOBJECT_H +# error "this header file must not be included directly" +#endif + +typedef struct { + PyObject_VAR_HEAD + Py_DEPRECATED(3.11) Py_hash_t ob_shash; + char ob_sval[1]; + + /* Invariants: + * ob_sval contains space for 'ob_size+1' elements. + * ob_sval[ob_size] == 0. + * ob_shash is the hash of the byte string or -1 if not computed yet. + */ +} PyBytesObject; + +PyAPI_FUNC(int) _PyBytes_Resize(PyObject **, Py_ssize_t); +PyAPI_FUNC(PyObject*) _PyBytes_FormatEx( + const char *format, + Py_ssize_t format_len, + PyObject *args, + int use_bytearray); +PyAPI_FUNC(PyObject*) _PyBytes_FromHex( + PyObject *string, + int use_bytearray); + +/* Helper for PyBytes_DecodeEscape that detects invalid escape chars. */ +PyAPI_FUNC(PyObject*) _PyBytes_DecodeEscape2(const char *, Py_ssize_t, + const char *, + int *, const char **); +// Export for binary compatibility. +PyAPI_FUNC(PyObject *) _PyBytes_DecodeEscape(const char *, Py_ssize_t, + const char *, const char **); + +/* Macros and static inline functions, trading safety for speed */ +#define _PyBytes_CAST(op) \ + (assert(PyBytes_Check(op)), _Py_CAST(PyBytesObject*, op)) + +static inline char* PyBytes_AS_STRING(PyObject *op) +{ + return _PyBytes_CAST(op)->ob_sval; +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +# define PyBytes_AS_STRING(op) PyBytes_AS_STRING(_PyObject_CAST(op)) +#endif + +static inline Py_ssize_t PyBytes_GET_SIZE(PyObject *op) { + PyBytesObject *self = _PyBytes_CAST(op); + return Py_SIZE(self); +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +# define PyBytes_GET_SIZE(self) PyBytes_GET_SIZE(_PyObject_CAST(self)) +#endif + +/* _PyBytes_Join(sep, x) is like sep.join(x). sep must be PyBytesObject*, + x must be an iterable object. */ +PyAPI_FUNC(PyObject *) _PyBytes_Join(PyObject *sep, PyObject *x); + + +/* The _PyBytesWriter structure is big: it contains an embedded "stack buffer". + A _PyBytesWriter variable must be declared at the end of variables in a + function to optimize the memory allocation on the stack. */ +typedef struct { + /* bytes, bytearray or NULL (when the small buffer is used) */ + PyObject *buffer; + + /* Number of allocated size. */ + Py_ssize_t allocated; + + /* Minimum number of allocated bytes, + incremented by _PyBytesWriter_Prepare() */ + Py_ssize_t min_size; + + /* If non-zero, use a bytearray instead of a bytes object for buffer. */ + int use_bytearray; + + /* If non-zero, overallocate the buffer (default: 0). + This flag must be zero if use_bytearray is non-zero. */ + int overallocate; + + /* Stack buffer */ + int use_small_buffer; + char small_buffer[512]; +} _PyBytesWriter; + +/* Initialize a bytes writer + + By default, the overallocation is disabled. Set the overallocate attribute + to control the allocation of the buffer. */ +PyAPI_FUNC(void) _PyBytesWriter_Init(_PyBytesWriter *writer); + +/* Get the buffer content and reset the writer. + Return a bytes object, or a bytearray object if use_bytearray is non-zero. + Raise an exception and return NULL on error. */ +PyAPI_FUNC(PyObject *) _PyBytesWriter_Finish(_PyBytesWriter *writer, + void *str); + +/* Deallocate memory of a writer (clear its internal buffer). */ +PyAPI_FUNC(void) _PyBytesWriter_Dealloc(_PyBytesWriter *writer); + +/* Allocate the buffer to write size bytes. + Return the pointer to the beginning of buffer data. + Raise an exception and return NULL on error. */ +PyAPI_FUNC(void*) _PyBytesWriter_Alloc(_PyBytesWriter *writer, + Py_ssize_t size); + +/* Ensure that the buffer is large enough to write *size* bytes. + Add size to the writer minimum size (min_size attribute). + + str is the current pointer inside the buffer. + Return the updated current pointer inside the buffer. + Raise an exception and return NULL on error. */ +PyAPI_FUNC(void*) _PyBytesWriter_Prepare(_PyBytesWriter *writer, + void *str, + Py_ssize_t size); + +/* Resize the buffer to make it larger. + The new buffer may be larger than size bytes because of overallocation. + Return the updated current pointer inside the buffer. + Raise an exception and return NULL on error. + + Note: size must be greater than the number of allocated bytes in the writer. + + This function doesn't use the writer minimum size (min_size attribute). + + See also _PyBytesWriter_Prepare(). + */ +PyAPI_FUNC(void*) _PyBytesWriter_Resize(_PyBytesWriter *writer, + void *str, + Py_ssize_t size); + +/* Write bytes. + Raise an exception and return NULL on error. */ +PyAPI_FUNC(void*) _PyBytesWriter_WriteBytes(_PyBytesWriter *writer, + void *str, + const void *bytes, + Py_ssize_t size); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/cellobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/cellobject.h new file mode 100644 index 0000000000000000000000000000000000000000..e07f9d1de79423cf8f9a67580d434a486a8b7f96 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/cellobject.h @@ -0,0 +1,31 @@ +/* Cell object interface */ + +#ifndef Py_LIMITED_API +#ifndef Py_CELLOBJECT_H +#define Py_CELLOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + PyObject_HEAD + /* Content of the cell or NULL when empty */ + PyObject *ob_ref; +} PyCellObject; + +PyAPI_DATA(PyTypeObject) PyCell_Type; + +#define PyCell_Check(op) Py_IS_TYPE(op, &PyCell_Type) + +PyAPI_FUNC(PyObject *) PyCell_New(PyObject *); +PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *); +PyAPI_FUNC(int) PyCell_Set(PyObject *, PyObject *); + +#define PyCell_GET(op) (((PyCellObject *)(op))->ob_ref) +#define PyCell_SET(op, v) _Py_RVALUE(((PyCellObject *)(op))->ob_ref = (v)) + +#ifdef __cplusplus +} +#endif +#endif /* !Py_TUPLEOBJECT_H */ +#endif /* Py_LIMITED_API */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/ceval.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/ceval.h new file mode 100644 index 0000000000000000000000000000000000000000..9d4eeafb427eb28b376bc7116b4d56dfff16b9d9 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/ceval.h @@ -0,0 +1,26 @@ +#ifndef Py_CPYTHON_CEVAL_H +# error "this header file must not be included directly" +#endif + +PyAPI_FUNC(void) PyEval_SetProfile(Py_tracefunc, PyObject *); +PyAPI_DATA(int) _PyEval_SetProfile(PyThreadState *tstate, Py_tracefunc func, PyObject *arg); +PyAPI_FUNC(void) PyEval_SetTrace(Py_tracefunc, PyObject *); +PyAPI_FUNC(int) _PyEval_SetTrace(PyThreadState *tstate, Py_tracefunc func, PyObject *arg); + +/* Helper to look up a builtin object */ +PyAPI_FUNC(PyObject *) _PyEval_GetBuiltin(PyObject *); +PyAPI_FUNC(PyObject *) _PyEval_GetBuiltinId(_Py_Identifier *); +/* Look at the current frame's (if any) code's co_flags, and turn on + the corresponding compiler flags in cf->cf_flags. Return 1 if any + flag was set, else return 0. */ +PyAPI_FUNC(int) PyEval_MergeCompilerFlags(PyCompilerFlags *cf); + +PyAPI_FUNC(PyObject *) _PyEval_EvalFrameDefault(PyThreadState *tstate, struct _PyInterpreterFrame *f, int exc); + +PyAPI_FUNC(void) _PyEval_SetSwitchInterval(unsigned long microseconds); +PyAPI_FUNC(unsigned long) _PyEval_GetSwitchInterval(void); + +PyAPI_FUNC(Py_ssize_t) _PyEval_RequestCodeExtraIndex(freefunc); + +PyAPI_FUNC(int) _PyEval_SliceIndex(PyObject *, Py_ssize_t *); +PyAPI_FUNC(int) _PyEval_SliceIndexNotNone(PyObject *, Py_ssize_t *); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/classobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/classobject.h new file mode 100644 index 0000000000000000000000000000000000000000..80df8842eb4f784144983a6a213b80389a801456 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/classobject.h @@ -0,0 +1,57 @@ +/* Former class object interface -- now only bound methods are here */ + +/* Revealing some structures (not for general use) */ + +#ifndef Py_LIMITED_API +#ifndef Py_CLASSOBJECT_H +#define Py_CLASSOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + PyObject_HEAD + PyObject *im_func; /* The callable object implementing the method */ + PyObject *im_self; /* The instance it is bound to */ + PyObject *im_weakreflist; /* List of weak references */ + vectorcallfunc vectorcall; +} PyMethodObject; + +PyAPI_DATA(PyTypeObject) PyMethod_Type; + +#define PyMethod_Check(op) Py_IS_TYPE(op, &PyMethod_Type) + +PyAPI_FUNC(PyObject *) PyMethod_New(PyObject *, PyObject *); + +PyAPI_FUNC(PyObject *) PyMethod_Function(PyObject *); +PyAPI_FUNC(PyObject *) PyMethod_Self(PyObject *); + +/* Macros for direct access to these values. Type checks are *not* + done, so use with care. */ +#define PyMethod_GET_FUNCTION(meth) \ + (((PyMethodObject *)meth) -> im_func) +#define PyMethod_GET_SELF(meth) \ + (((PyMethodObject *)meth) -> im_self) + +typedef struct { + PyObject_HEAD + PyObject *func; +} PyInstanceMethodObject; + +PyAPI_DATA(PyTypeObject) PyInstanceMethod_Type; + +#define PyInstanceMethod_Check(op) Py_IS_TYPE(op, &PyInstanceMethod_Type) + +PyAPI_FUNC(PyObject *) PyInstanceMethod_New(PyObject *); +PyAPI_FUNC(PyObject *) PyInstanceMethod_Function(PyObject *); + +/* Macros for direct access to these values. Type checks are *not* + done, so use with care. */ +#define PyInstanceMethod_GET_FUNCTION(meth) \ + (((PyInstanceMethodObject *)meth) -> func) + +#ifdef __cplusplus +} +#endif +#endif // !Py_CLASSOBJECT_H +#endif // !Py_LIMITED_API diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/code.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/code.h new file mode 100644 index 0000000000000000000000000000000000000000..7006060cc760e5ca1468965cb1fc1252d5be9ae0 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/code.h @@ -0,0 +1,236 @@ +/* Definitions for bytecode */ + +#ifndef Py_LIMITED_API +#ifndef Py_CODE_H +#define Py_CODE_H +#ifdef __cplusplus +extern "C" { +#endif + +/* Each instruction in a code object is a fixed-width value, + * currently 2 bytes: 1-byte opcode + 1-byte oparg. The EXTENDED_ARG + * opcode allows for larger values but the current limit is 3 uses + * of EXTENDED_ARG (see Python/compile.c), for a maximum + * 32-bit value. This aligns with the note in Python/compile.c + * (compiler_addop_i_line) indicating that the max oparg value is + * 2**32 - 1, rather than INT_MAX. + */ + +typedef uint16_t _Py_CODEUNIT; + +#ifdef WORDS_BIGENDIAN +# define _Py_OPCODE(word) ((word) >> 8) +# define _Py_OPARG(word) ((word) & 255) +# define _Py_MAKECODEUNIT(opcode, oparg) (((opcode)<<8)|(oparg)) +#else +# define _Py_OPCODE(word) ((word) & 255) +# define _Py_OPARG(word) ((word) >> 8) +# define _Py_MAKECODEUNIT(opcode, oparg) ((opcode)|((oparg)<<8)) +#endif + +// Use "unsigned char" instead of "uint8_t" here to avoid illegal aliasing: +#define _Py_SET_OPCODE(word, opcode) (((unsigned char *)&(word))[0] = (opcode)) + +// To avoid repeating ourselves in deepfreeze.py, all PyCodeObject members are +// defined in this macro: +#define _PyCode_DEF(SIZE) { \ + PyObject_VAR_HEAD \ + \ + /* Note only the following fields are used in hash and/or comparisons \ + * \ + * - co_name \ + * - co_argcount \ + * - co_posonlyargcount \ + * - co_kwonlyargcount \ + * - co_nlocals \ + * - co_stacksize \ + * - co_flags \ + * - co_firstlineno \ + * - co_consts \ + * - co_names \ + * - co_localsplusnames \ + * This is done to preserve the name and line number for tracebacks \ + * and debuggers; otherwise, constant de-duplication would collapse \ + * identical functions/lambdas defined on different lines. \ + */ \ + \ + /* These fields are set with provided values on new code objects. */ \ + \ + /* The hottest fields (in the eval loop) are grouped here at the top. */ \ + PyObject *co_consts; /* list (constants used) */ \ + PyObject *co_names; /* list of strings (names used) */ \ + PyObject *co_exceptiontable; /* Byte string encoding exception handling \ + table */ \ + int co_flags; /* CO_..., see below */ \ + short co_warmup; /* Warmup counter for quickening */ \ + short _co_linearray_entry_size; /* Size of each entry in _co_linearray */ \ + \ + /* The rest are not so impactful on performance. */ \ + int co_argcount; /* #arguments, except *args */ \ + int co_posonlyargcount; /* #positional only arguments */ \ + int co_kwonlyargcount; /* #keyword only arguments */ \ + int co_stacksize; /* #entries needed for evaluation stack */ \ + int co_firstlineno; /* first source line number */ \ + \ + /* redundant values (derived from co_localsplusnames and \ + co_localspluskinds) */ \ + int co_nlocalsplus; /* number of local + cell + free variables \ + */ \ + int co_nlocals; /* number of local variables */ \ + int co_nplaincellvars; /* number of non-arg cell variables */ \ + int co_ncellvars; /* total number of cell variables */ \ + int co_nfreevars; /* number of free variables */ \ + \ + PyObject *co_localsplusnames; /* tuple mapping offsets to names */ \ + PyObject *co_localspluskinds; /* Bytes mapping to local kinds (one byte \ + per variable) */ \ + PyObject *co_filename; /* unicode (where it was loaded from) */ \ + PyObject *co_name; /* unicode (name, for reference) */ \ + PyObject *co_qualname; /* unicode (qualname, for reference) */ \ + PyObject *co_linetable; /* bytes object that holds location info */ \ + PyObject *co_weakreflist; /* to support weakrefs to code objects */ \ + PyObject *_co_code; /* cached co_code object/attribute */ \ + char *_co_linearray; /* array of line offsets */ \ + int _co_firsttraceable; /* index of first traceable instruction */ \ + /* Scratch space for extra data relating to the code object. \ + Type is a void* to keep the format private in codeobject.c to force \ + people to go through the proper APIs. */ \ + void *co_extra; \ + char co_code_adaptive[(SIZE)]; \ +} + +/* Bytecode object */ +struct PyCodeObject _PyCode_DEF(1); + +/* Masks for co_flags above */ +#define CO_OPTIMIZED 0x0001 +#define CO_NEWLOCALS 0x0002 +#define CO_VARARGS 0x0004 +#define CO_VARKEYWORDS 0x0008 +#define CO_NESTED 0x0010 +#define CO_GENERATOR 0x0020 + +/* The CO_COROUTINE flag is set for coroutine functions (defined with + ``async def`` keywords) */ +#define CO_COROUTINE 0x0080 +#define CO_ITERABLE_COROUTINE 0x0100 +#define CO_ASYNC_GENERATOR 0x0200 + +/* bpo-39562: These constant values are changed in Python 3.9 + to prevent collision with compiler flags. CO_FUTURE_ and PyCF_ + constants must be kept unique. PyCF_ constants can use bits from + 0x0100 to 0x10000. CO_FUTURE_ constants use bits starting at 0x20000. */ +#define CO_FUTURE_DIVISION 0x20000 +#define CO_FUTURE_ABSOLUTE_IMPORT 0x40000 /* do absolute imports by default */ +#define CO_FUTURE_WITH_STATEMENT 0x80000 +#define CO_FUTURE_PRINT_FUNCTION 0x100000 +#define CO_FUTURE_UNICODE_LITERALS 0x200000 + +#define CO_FUTURE_BARRY_AS_BDFL 0x400000 +#define CO_FUTURE_GENERATOR_STOP 0x800000 +#define CO_FUTURE_ANNOTATIONS 0x1000000 + +/* This should be defined if a future statement modifies the syntax. + For example, when a keyword is added. +*/ +#define PY_PARSER_REQUIRES_FUTURE_KEYWORD + +#define CO_MAXBLOCKS 20 /* Max static block nesting within a function */ + +PyAPI_DATA(PyTypeObject) PyCode_Type; + +#define PyCode_Check(op) Py_IS_TYPE(op, &PyCode_Type) +#define PyCode_GetNumFree(op) ((op)->co_nfreevars) +#define _PyCode_CODE(CO) ((_Py_CODEUNIT *)(CO)->co_code_adaptive) +#define _PyCode_NBYTES(CO) (Py_SIZE(CO) * (Py_ssize_t)sizeof(_Py_CODEUNIT)) + +/* Public interface */ +PyAPI_FUNC(PyCodeObject *) PyCode_New( + int, int, int, int, int, PyObject *, PyObject *, + PyObject *, PyObject *, PyObject *, PyObject *, + PyObject *, PyObject *, PyObject *, int, PyObject *, + PyObject *); + +PyAPI_FUNC(PyCodeObject *) PyCode_NewWithPosOnlyArgs( + int, int, int, int, int, int, PyObject *, PyObject *, + PyObject *, PyObject *, PyObject *, PyObject *, + PyObject *, PyObject *, PyObject *, int, PyObject *, + PyObject *); + /* same as struct above */ + +/* Creates a new empty code object with the specified source location. */ +PyAPI_FUNC(PyCodeObject *) +PyCode_NewEmpty(const char *filename, const char *funcname, int firstlineno); + +/* Return the line number associated with the specified bytecode index + in this code object. If you just need the line number of a frame, + use PyFrame_GetLineNumber() instead. */ +PyAPI_FUNC(int) PyCode_Addr2Line(PyCodeObject *, int); + +PyAPI_FUNC(int) PyCode_Addr2Location(PyCodeObject *, int, int *, int *, int *, int *); + +/* for internal use only */ +struct _opaque { + int computed_line; + const uint8_t *lo_next; + const uint8_t *limit; +}; + +typedef struct _line_offsets { + int ar_start; + int ar_end; + int ar_line; + struct _opaque opaque; +} PyCodeAddressRange; + +/* Update *bounds to describe the first and one-past-the-last instructions in the + same line as lasti. Return the number of that line. +*/ +PyAPI_FUNC(int) _PyCode_CheckLineNumber(int lasti, PyCodeAddressRange *bounds); + +/* Create a comparable key used to compare constants taking in account the + * object type. It is used to make sure types are not coerced (e.g., float and + * complex) _and_ to distinguish 0.0 from -0.0 e.g. on IEEE platforms + * + * Return (type(obj), obj, ...): a tuple with variable size (at least 2 items) + * depending on the type and the value. The type is the first item to not + * compare bytes and str which can raise a BytesWarning exception. */ +PyAPI_FUNC(PyObject*) _PyCode_ConstantKey(PyObject *obj); + +PyAPI_FUNC(PyObject*) PyCode_Optimize(PyObject *code, PyObject* consts, + PyObject *names, PyObject *lnotab); + + +PyAPI_FUNC(int) _PyCode_GetExtra(PyObject *code, Py_ssize_t index, + void **extra); +PyAPI_FUNC(int) _PyCode_SetExtra(PyObject *code, Py_ssize_t index, + void *extra); + +/* Equivalent to getattr(code, 'co_code') in Python. + Returns a strong reference to a bytes object. */ +PyAPI_FUNC(PyObject *) PyCode_GetCode(PyCodeObject *code); +/* Equivalent to getattr(code, 'co_varnames') in Python. */ +PyAPI_FUNC(PyObject *) PyCode_GetVarnames(PyCodeObject *code); +/* Equivalent to getattr(code, 'co_cellvars') in Python. */ +PyAPI_FUNC(PyObject *) PyCode_GetCellvars(PyCodeObject *code); +/* Equivalent to getattr(code, 'co_freevars') in Python. */ +PyAPI_FUNC(PyObject *) PyCode_GetFreevars(PyCodeObject *code); + +typedef enum _PyCodeLocationInfoKind { + /* short forms are 0 to 9 */ + PY_CODE_LOCATION_INFO_SHORT0 = 0, + /* one lineforms are 10 to 12 */ + PY_CODE_LOCATION_INFO_ONE_LINE0 = 10, + PY_CODE_LOCATION_INFO_ONE_LINE1 = 11, + PY_CODE_LOCATION_INFO_ONE_LINE2 = 12, + + PY_CODE_LOCATION_INFO_NO_COLUMNS = 13, + PY_CODE_LOCATION_INFO_LONG = 14, + PY_CODE_LOCATION_INFO_NONE = 15 +} _PyCodeLocationInfoKind; + +#ifdef __cplusplus +} +#endif +#endif // !Py_CODE_H +#endif // !Py_LIMITED_API diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/compile.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/compile.h new file mode 100644 index 0000000000000000000000000000000000000000..518a3764992954f0a7d46274ea0a45d6e91a161e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/compile.h @@ -0,0 +1,54 @@ +#ifndef Py_CPYTHON_COMPILE_H +# error "this header file must not be included directly" +#endif + +/* Public interface */ +#define PyCF_MASK (CO_FUTURE_DIVISION | CO_FUTURE_ABSOLUTE_IMPORT | \ + CO_FUTURE_WITH_STATEMENT | CO_FUTURE_PRINT_FUNCTION | \ + CO_FUTURE_UNICODE_LITERALS | CO_FUTURE_BARRY_AS_BDFL | \ + CO_FUTURE_GENERATOR_STOP | CO_FUTURE_ANNOTATIONS) +#define PyCF_MASK_OBSOLETE (CO_NESTED) + +/* bpo-39562: CO_FUTURE_ and PyCF_ constants must be kept unique. + PyCF_ constants can use bits from 0x0100 to 0x10000. + CO_FUTURE_ constants use bits starting at 0x20000. */ +#define PyCF_SOURCE_IS_UTF8 0x0100 +#define PyCF_DONT_IMPLY_DEDENT 0x0200 +#define PyCF_ONLY_AST 0x0400 +#define PyCF_IGNORE_COOKIE 0x0800 +#define PyCF_TYPE_COMMENTS 0x1000 +#define PyCF_ALLOW_TOP_LEVEL_AWAIT 0x2000 +#define PyCF_ALLOW_INCOMPLETE_INPUT 0x4000 +#define PyCF_COMPILE_MASK (PyCF_ONLY_AST | PyCF_ALLOW_TOP_LEVEL_AWAIT | \ + PyCF_TYPE_COMMENTS | PyCF_DONT_IMPLY_DEDENT | \ + PyCF_ALLOW_INCOMPLETE_INPUT) + +typedef struct { + int cf_flags; /* bitmask of CO_xxx flags relevant to future */ + int cf_feature_version; /* minor Python version (PyCF_ONLY_AST) */ +} PyCompilerFlags; + +#define _PyCompilerFlags_INIT \ + (PyCompilerFlags){.cf_flags = 0, .cf_feature_version = PY_MINOR_VERSION} + +/* Future feature support */ + +typedef struct { + int ff_features; /* flags set by future statements */ + int ff_lineno; /* line number of last future statement */ +} PyFutureFeatures; + +#define FUTURE_NESTED_SCOPES "nested_scopes" +#define FUTURE_GENERATORS "generators" +#define FUTURE_DIVISION "division" +#define FUTURE_ABSOLUTE_IMPORT "absolute_import" +#define FUTURE_WITH_STATEMENT "with_statement" +#define FUTURE_PRINT_FUNCTION "print_function" +#define FUTURE_UNICODE_LITERALS "unicode_literals" +#define FUTURE_BARRY_AS_BDFL "barry_as_FLUFL" +#define FUTURE_GENERATOR_STOP "generator_stop" +#define FUTURE_ANNOTATIONS "annotations" + +#define PY_INVALID_STACK_EFFECT INT_MAX +PyAPI_FUNC(int) PyCompile_OpcodeStackEffect(int opcode, int oparg); +PyAPI_FUNC(int) PyCompile_OpcodeStackEffectWithJump(int opcode, int oparg, int jump); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/complexobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/complexobject.h new file mode 100644 index 0000000000000000000000000000000000000000..b7d7283ae8896503defd94ee9a4798b426ca0e3e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/complexobject.h @@ -0,0 +1,44 @@ +#ifndef Py_CPYTHON_COMPLEXOBJECT_H +# error "this header file must not be included directly" +#endif + +typedef struct { + double real; + double imag; +} Py_complex; + +/* Operations on complex numbers from complexmodule.c */ + +PyAPI_FUNC(Py_complex) _Py_c_sum(Py_complex, Py_complex); +PyAPI_FUNC(Py_complex) _Py_c_diff(Py_complex, Py_complex); +PyAPI_FUNC(Py_complex) _Py_c_neg(Py_complex); +PyAPI_FUNC(Py_complex) _Py_c_prod(Py_complex, Py_complex); +PyAPI_FUNC(Py_complex) _Py_c_quot(Py_complex, Py_complex); +PyAPI_FUNC(Py_complex) _Py_c_pow(Py_complex, Py_complex); +PyAPI_FUNC(double) _Py_c_abs(Py_complex); + +/* Complex object interface */ + +/* +PyComplexObject represents a complex number with double-precision +real and imaginary parts. +*/ +typedef struct { + PyObject_HEAD + Py_complex cval; +} PyComplexObject; + +PyAPI_FUNC(PyObject *) PyComplex_FromCComplex(Py_complex); + +PyAPI_FUNC(Py_complex) PyComplex_AsCComplex(PyObject *op); + +#ifdef Py_BUILD_CORE +/* Format the object based on the format_spec, as defined in PEP 3101 + (Advanced String Formatting). */ +extern int _PyComplex_FormatAdvancedWriter( + _PyUnicodeWriter *writer, + PyObject *obj, + PyObject *format_spec, + Py_ssize_t start, + Py_ssize_t end); +#endif // Py_BUILD_CORE diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/context.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/context.h new file mode 100644 index 0000000000000000000000000000000000000000..4db079f7633f48b2bb4d51339c795886b5734902 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/context.h @@ -0,0 +1,78 @@ +#ifndef Py_LIMITED_API +#ifndef Py_CONTEXT_H +#define Py_CONTEXT_H +#ifdef __cplusplus +extern "C" { +#endif + +PyAPI_DATA(PyTypeObject) PyContext_Type; +typedef struct _pycontextobject PyContext; + +PyAPI_DATA(PyTypeObject) PyContextVar_Type; +typedef struct _pycontextvarobject PyContextVar; + +PyAPI_DATA(PyTypeObject) PyContextToken_Type; +typedef struct _pycontexttokenobject PyContextToken; + + +#define PyContext_CheckExact(o) Py_IS_TYPE(o, &PyContext_Type) +#define PyContextVar_CheckExact(o) Py_IS_TYPE(o, &PyContextVar_Type) +#define PyContextToken_CheckExact(o) Py_IS_TYPE(o, &PyContextToken_Type) + + +PyAPI_FUNC(PyObject *) PyContext_New(void); +PyAPI_FUNC(PyObject *) PyContext_Copy(PyObject *); +PyAPI_FUNC(PyObject *) PyContext_CopyCurrent(void); + +PyAPI_FUNC(int) PyContext_Enter(PyObject *); +PyAPI_FUNC(int) PyContext_Exit(PyObject *); + + +/* Create a new context variable. + + default_value can be NULL. +*/ +PyAPI_FUNC(PyObject *) PyContextVar_New( + const char *name, PyObject *default_value); + + +/* Get a value for the variable. + + Returns -1 if an error occurred during lookup. + + Returns 0 if value either was or was not found. + + If value was found, *value will point to it. + If not, it will point to: + + - default_value, if not NULL; + - the default value of "var", if not NULL; + - NULL. + + '*value' will be a new ref, if not NULL. +*/ +PyAPI_FUNC(int) PyContextVar_Get( + PyObject *var, PyObject *default_value, PyObject **value); + + +/* Set a new value for the variable. + Returns NULL if an error occurs. +*/ +PyAPI_FUNC(PyObject *) PyContextVar_Set(PyObject *var, PyObject *value); + + +/* Reset a variable to its previous value. + Returns 0 on success, -1 on error. +*/ +PyAPI_FUNC(int) PyContextVar_Reset(PyObject *var, PyObject *token); + + +/* This method is exposed only for CPython tests. Don not use it. */ +PyAPI_FUNC(PyObject *) _PyContext_NewHamtForTests(void); + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_CONTEXT_H */ +#endif /* !Py_LIMITED_API */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/descrobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/descrobject.h new file mode 100644 index 0000000000000000000000000000000000000000..e2ea1b9a2d305803e11f6fab6ceb06d607fc089c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/descrobject.h @@ -0,0 +1,64 @@ +#ifndef Py_CPYTHON_DESCROBJECT_H +# error "this header file must not be included directly" +#endif + +typedef PyObject *(*wrapperfunc)(PyObject *self, PyObject *args, + void *wrapped); + +typedef PyObject *(*wrapperfunc_kwds)(PyObject *self, PyObject *args, + void *wrapped, PyObject *kwds); + +struct wrapperbase { + const char *name; + int offset; + void *function; + wrapperfunc wrapper; + const char *doc; + int flags; + PyObject *name_strobj; +}; + +/* Flags for above struct */ +#define PyWrapperFlag_KEYWORDS 1 /* wrapper function takes keyword args */ + +/* Various kinds of descriptor objects */ + +typedef struct { + PyObject_HEAD + PyTypeObject *d_type; + PyObject *d_name; + PyObject *d_qualname; +} PyDescrObject; + +#define PyDescr_COMMON PyDescrObject d_common + +#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type) +#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name) + +typedef struct { + PyDescr_COMMON; + PyMethodDef *d_method; + vectorcallfunc vectorcall; +} PyMethodDescrObject; + +typedef struct { + PyDescr_COMMON; + PyMemberDef *d_member; +} PyMemberDescrObject; + +typedef struct { + PyDescr_COMMON; + PyGetSetDef *d_getset; +} PyGetSetDescrObject; + +typedef struct { + PyDescr_COMMON; + struct wrapperbase *d_base; + void *d_wrapped; /* This can be any function pointer */ +} PyWrapperDescrObject; + +PyAPI_DATA(PyTypeObject) _PyMethodWrapper_Type; + +PyAPI_FUNC(PyObject *) PyDescr_NewWrapper(PyTypeObject *, + struct wrapperbase *, void *); +PyAPI_FUNC(int) PyDescr_IsData(PyObject *); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/dictobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/dictobject.h new file mode 100644 index 0000000000000000000000000000000000000000..033eaeb4c9751c0b57991f3fe036706266a8cddc --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/dictobject.h @@ -0,0 +1,78 @@ +#ifndef Py_CPYTHON_DICTOBJECT_H +# error "this header file must not be included directly" +#endif + +typedef struct _dictkeysobject PyDictKeysObject; +typedef struct _dictvalues PyDictValues; + +/* The ma_values pointer is NULL for a combined table + * or points to an array of PyObject* for a split table + */ +typedef struct { + PyObject_HEAD + + /* Number of items in the dictionary */ + Py_ssize_t ma_used; + + /* Dictionary version: globally unique, value change each time + the dictionary is modified */ + uint64_t ma_version_tag; + + PyDictKeysObject *ma_keys; + + /* If ma_values is NULL, the table is "combined": keys and values + are stored in ma_keys. + + If ma_values is not NULL, the table is split: + keys are stored in ma_keys and values are stored in ma_values */ + PyDictValues *ma_values; +} PyDictObject; + +PyAPI_FUNC(PyObject *) _PyDict_GetItem_KnownHash(PyObject *mp, PyObject *key, + Py_hash_t hash); +PyAPI_FUNC(PyObject *) _PyDict_GetItemWithError(PyObject *dp, PyObject *key); +PyAPI_FUNC(PyObject *) _PyDict_GetItemIdWithError(PyObject *dp, + _Py_Identifier *key); +PyAPI_FUNC(PyObject *) _PyDict_GetItemStringWithError(PyObject *, const char *); +PyAPI_FUNC(PyObject *) PyDict_SetDefault( + PyObject *mp, PyObject *key, PyObject *defaultobj); +PyAPI_FUNC(int) _PyDict_SetItem_KnownHash(PyObject *mp, PyObject *key, + PyObject *item, Py_hash_t hash); +PyAPI_FUNC(int) _PyDict_DelItem_KnownHash(PyObject *mp, PyObject *key, + Py_hash_t hash); +PyAPI_FUNC(int) _PyDict_DelItemIf(PyObject *mp, PyObject *key, + int (*predicate)(PyObject *value)); +PyAPI_FUNC(int) _PyDict_Next( + PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value, Py_hash_t *hash); + +/* Get the number of items of a dictionary. */ +#define PyDict_GET_SIZE(mp) (assert(PyDict_Check(mp)),((PyDictObject *)mp)->ma_used) +PyAPI_FUNC(int) _PyDict_Contains_KnownHash(PyObject *, PyObject *, Py_hash_t); +PyAPI_FUNC(int) _PyDict_ContainsId(PyObject *, _Py_Identifier *); +PyAPI_FUNC(PyObject *) _PyDict_NewPresized(Py_ssize_t minused); +PyAPI_FUNC(void) _PyDict_MaybeUntrack(PyObject *mp); +PyAPI_FUNC(int) _PyDict_HasOnlyStringKeys(PyObject *mp); +PyAPI_FUNC(Py_ssize_t) _PyDict_SizeOf(PyDictObject *); +PyAPI_FUNC(PyObject *) _PyDict_Pop(PyObject *, PyObject *, PyObject *); +#define _PyDict_HasSplitTable(d) ((d)->ma_values != NULL) + +/* Like PyDict_Merge, but override can be 0, 1 or 2. If override is 0, + the first occurrence of a key wins, if override is 1, the last occurrence + of a key wins, if override is 2, a KeyError with conflicting key as + argument is raised. +*/ +PyAPI_FUNC(int) _PyDict_MergeEx(PyObject *mp, PyObject *other, int override); +PyAPI_FUNC(int) _PyDict_SetItemId(PyObject *dp, _Py_Identifier *key, PyObject *item); + +PyAPI_FUNC(int) _PyDict_DelItemId(PyObject *mp, _Py_Identifier *key); +PyAPI_FUNC(void) _PyDict_DebugMallocStats(FILE *out); + +/* _PyDictView */ + +typedef struct { + PyObject_HEAD + PyDictObject *dv_dict; +} _PyDictViewObject; + +PyAPI_FUNC(PyObject *) _PyDictView_New(PyObject *, PyTypeObject *); +PyAPI_FUNC(PyObject *) _PyDictView_Intersect(PyObject* self, PyObject *other); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/fileobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/fileobject.h new file mode 100644 index 0000000000000000000000000000000000000000..b70ec318986d821580c9c76a6de0ec42fab25256 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/fileobject.h @@ -0,0 +1,19 @@ +#ifndef Py_CPYTHON_FILEOBJECT_H +# error "this header file must not be included directly" +#endif + +PyAPI_FUNC(char *) Py_UniversalNewlineFgets(char *, int, FILE*, PyObject *); +PyAPI_FUNC(char *) _Py_UniversalNewlineFgetsWithSize(char *, int, FILE*, PyObject *, size_t*); + +/* The std printer acts as a preliminary sys.stderr until the new io + infrastructure is in place. */ +PyAPI_FUNC(PyObject *) PyFile_NewStdPrinter(int); +PyAPI_DATA(PyTypeObject) PyStdPrinter_Type; + +typedef PyObject * (*Py_OpenCodeHookFunction)(PyObject *, void *); + +PyAPI_FUNC(PyObject *) PyFile_OpenCode(const char *utf8path); +PyAPI_FUNC(PyObject *) PyFile_OpenCodeObject(PyObject *path); +PyAPI_FUNC(int) PyFile_SetOpenCodeHook(Py_OpenCodeHookFunction hook, void *userData); + +PyAPI_FUNC(int) _PyLong_FileDescriptor_Converter(PyObject *, void *); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/fileutils.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/fileutils.h new file mode 100644 index 0000000000000000000000000000000000000000..b386ad107bde1ff9f522137167c10868766d2f30 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/fileutils.h @@ -0,0 +1,8 @@ +#ifndef Py_CPYTHON_FILEUTILS_H +# error "this header file must not be included directly" +#endif + +// Used by _testcapi which must not use the internal C API +PyAPI_FUNC(FILE*) _Py_fopen_obj( + PyObject *path, + const char *mode); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/floatobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/floatobject.h new file mode 100644 index 0000000000000000000000000000000000000000..7795d9f83f05cb88ede1a2db0903bb1df76ab5b7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/floatobject.h @@ -0,0 +1,21 @@ +#ifndef Py_CPYTHON_FLOATOBJECT_H +# error "this header file must not be included directly" +#endif + +typedef struct { + PyObject_HEAD + double ob_fval; +} PyFloatObject; + +// Macro version of PyFloat_AsDouble() trading safety for speed. +// It doesn't check if op is a double object. +#define PyFloat_AS_DOUBLE(op) (((PyFloatObject *)(op))->ob_fval) + + +PyAPI_FUNC(int) PyFloat_Pack2(double x, char *p, int le); +PyAPI_FUNC(int) PyFloat_Pack4(double x, char *p, int le); +PyAPI_FUNC(int) PyFloat_Pack8(double x, char *p, int le); + +PyAPI_FUNC(double) PyFloat_Unpack2(const char *p, int le); +PyAPI_FUNC(double) PyFloat_Unpack4(const char *p, int le); +PyAPI_FUNC(double) PyFloat_Unpack8(const char *p, int le); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/frameobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/frameobject.h new file mode 100644 index 0000000000000000000000000000000000000000..4e19535c656f2cbef34238143c61aa120d6c9c5e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/frameobject.h @@ -0,0 +1,29 @@ +/* Frame object interface */ + +#ifndef Py_CPYTHON_FRAMEOBJECT_H +# error "this header file must not be included directly" +#endif + +/* Standard object interface */ + +PyAPI_FUNC(PyFrameObject *) PyFrame_New(PyThreadState *, PyCodeObject *, + PyObject *, PyObject *); + +/* The rest of the interface is specific for frame objects */ + +/* Conversions between "fast locals" and locals in dictionary */ + +PyAPI_FUNC(void) PyFrame_LocalsToFast(PyFrameObject *, int); + +/* -- Caveat emptor -- + * The concept of entry frames is an implementation detail of the CPython + * interpreter. This API is considered unstable and is provided for the + * convenience of debuggers, profilers and state-inspecting tools. Notice that + * this API can be changed in future minor versions if the underlying frame + * mechanism change or the concept of an 'entry frame' or its semantics becomes + * obsolete or outdated. */ + +PyAPI_FUNC(int) _PyFrame_IsEntryFrame(PyFrameObject *frame); + +PyAPI_FUNC(int) PyFrame_FastToLocalsWithError(PyFrameObject *f); +PyAPI_FUNC(void) PyFrame_FastToLocals(PyFrameObject *); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/funcobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/funcobject.h new file mode 100644 index 0000000000000000000000000000000000000000..99ac6008f8b611f83724f18097702e0661455aa5 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/funcobject.h @@ -0,0 +1,113 @@ +/* Function object interface */ + +#ifndef Py_LIMITED_API +#ifndef Py_FUNCOBJECT_H +#define Py_FUNCOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + + +#define COMMON_FIELDS(PREFIX) \ + PyObject *PREFIX ## globals; \ + PyObject *PREFIX ## builtins; \ + PyObject *PREFIX ## name; \ + PyObject *PREFIX ## qualname; \ + PyObject *PREFIX ## code; /* A code object, the __code__ attribute */ \ + PyObject *PREFIX ## defaults; /* NULL or a tuple */ \ + PyObject *PREFIX ## kwdefaults; /* NULL or a dict */ \ + PyObject *PREFIX ## closure; /* NULL or a tuple of cell objects */ + +typedef struct { + COMMON_FIELDS(fc_) +} PyFrameConstructor; + +/* Function objects and code objects should not be confused with each other: + * + * Function objects are created by the execution of the 'def' statement. + * They reference a code object in their __code__ attribute, which is a + * purely syntactic object, i.e. nothing more than a compiled version of some + * source code lines. There is one code object per source code "fragment", + * but each code object can be referenced by zero or many function objects + * depending only on how many times the 'def' statement in the source was + * executed so far. + */ + +typedef struct { + PyObject_HEAD + COMMON_FIELDS(func_) + PyObject *func_doc; /* The __doc__ attribute, can be anything */ + PyObject *func_dict; /* The __dict__ attribute, a dict or NULL */ + PyObject *func_weakreflist; /* List of weak references */ + PyObject *func_module; /* The __module__ attribute, can be anything */ + PyObject *func_annotations; /* Annotations, a dict or NULL */ + vectorcallfunc vectorcall; + /* Version number for use by specializer. + * Can set to non-zero when we want to specialize. + * Will be set to zero if any of these change: + * defaults + * kwdefaults (only if the object changes, not the contents of the dict) + * code + * annotations */ + uint32_t func_version; + + /* Invariant: + * func_closure contains the bindings for func_code->co_freevars, so + * PyTuple_Size(func_closure) == PyCode_GetNumFree(func_code) + * (func_closure may be NULL if PyCode_GetNumFree(func_code) == 0). + */ +} PyFunctionObject; + +PyAPI_DATA(PyTypeObject) PyFunction_Type; + +#define PyFunction_Check(op) Py_IS_TYPE(op, &PyFunction_Type) + +PyAPI_FUNC(PyObject *) PyFunction_New(PyObject *, PyObject *); +PyAPI_FUNC(PyObject *) PyFunction_NewWithQualName(PyObject *, PyObject *, PyObject *); +PyAPI_FUNC(PyObject *) PyFunction_GetCode(PyObject *); +PyAPI_FUNC(PyObject *) PyFunction_GetGlobals(PyObject *); +PyAPI_FUNC(PyObject *) PyFunction_GetModule(PyObject *); +PyAPI_FUNC(PyObject *) PyFunction_GetDefaults(PyObject *); +PyAPI_FUNC(int) PyFunction_SetDefaults(PyObject *, PyObject *); +PyAPI_FUNC(PyObject *) PyFunction_GetKwDefaults(PyObject *); +PyAPI_FUNC(int) PyFunction_SetKwDefaults(PyObject *, PyObject *); +PyAPI_FUNC(PyObject *) PyFunction_GetClosure(PyObject *); +PyAPI_FUNC(int) PyFunction_SetClosure(PyObject *, PyObject *); +PyAPI_FUNC(PyObject *) PyFunction_GetAnnotations(PyObject *); +PyAPI_FUNC(int) PyFunction_SetAnnotations(PyObject *, PyObject *); + +PyAPI_FUNC(PyObject *) _PyFunction_Vectorcall( + PyObject *func, + PyObject *const *stack, + size_t nargsf, + PyObject *kwnames); + +/* Macros for direct access to these values. Type checks are *not* + done, so use with care. */ +#define PyFunction_GET_CODE(func) \ + (((PyFunctionObject *)func) -> func_code) +#define PyFunction_GET_GLOBALS(func) \ + (((PyFunctionObject *)func) -> func_globals) +#define PyFunction_GET_MODULE(func) \ + (((PyFunctionObject *)func) -> func_module) +#define PyFunction_GET_DEFAULTS(func) \ + (((PyFunctionObject *)func) -> func_defaults) +#define PyFunction_GET_KW_DEFAULTS(func) \ + (((PyFunctionObject *)func) -> func_kwdefaults) +#define PyFunction_GET_CLOSURE(func) \ + (((PyFunctionObject *)func) -> func_closure) +#define PyFunction_GET_ANNOTATIONS(func) \ + (((PyFunctionObject *)func) -> func_annotations) + +/* The classmethod and staticmethod types lives here, too */ +PyAPI_DATA(PyTypeObject) PyClassMethod_Type; +PyAPI_DATA(PyTypeObject) PyStaticMethod_Type; + +PyAPI_FUNC(PyObject *) PyClassMethod_New(PyObject *); +PyAPI_FUNC(PyObject *) PyStaticMethod_New(PyObject *); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_FUNCOBJECT_H */ +#endif /* Py_LIMITED_API */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/genobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/genobject.h new file mode 100644 index 0000000000000000000000000000000000000000..40eaa19d3fad94066d56de7287af9a347f9d1c37 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/genobject.h @@ -0,0 +1,88 @@ +/* Generator object interface */ + +#ifndef Py_LIMITED_API +#ifndef Py_GENOBJECT_H +#define Py_GENOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +/* --- Generators --------------------------------------------------------- */ + +/* _PyGenObject_HEAD defines the initial segment of generator + and coroutine objects. */ +#define _PyGenObject_HEAD(prefix) \ + PyObject_HEAD \ + /* The code object backing the generator */ \ + PyCodeObject *prefix##_code; \ + /* List of weak reference. */ \ + PyObject *prefix##_weakreflist; \ + /* Name of the generator. */ \ + PyObject *prefix##_name; \ + /* Qualified name of the generator. */ \ + PyObject *prefix##_qualname; \ + _PyErr_StackItem prefix##_exc_state; \ + PyObject *prefix##_origin_or_finalizer; \ + char prefix##_hooks_inited; \ + char prefix##_closed; \ + char prefix##_running_async; \ + /* The frame */ \ + int8_t prefix##_frame_state; \ + PyObject *prefix##_iframe[1]; + +typedef struct { + /* The gi_ prefix is intended to remind of generator-iterator. */ + _PyGenObject_HEAD(gi) +} PyGenObject; + +PyAPI_DATA(PyTypeObject) PyGen_Type; + +#define PyGen_Check(op) PyObject_TypeCheck(op, &PyGen_Type) +#define PyGen_CheckExact(op) Py_IS_TYPE(op, &PyGen_Type) + +PyAPI_FUNC(PyObject *) PyGen_New(PyFrameObject *); +PyAPI_FUNC(PyObject *) PyGen_NewWithQualName(PyFrameObject *, + PyObject *name, PyObject *qualname); +PyAPI_FUNC(int) _PyGen_SetStopIterationValue(PyObject *); +PyAPI_FUNC(int) _PyGen_FetchStopIterationValue(PyObject **); +PyAPI_FUNC(void) _PyGen_Finalize(PyObject *self); + + +/* --- PyCoroObject ------------------------------------------------------- */ + +typedef struct { + _PyGenObject_HEAD(cr) +} PyCoroObject; + +PyAPI_DATA(PyTypeObject) PyCoro_Type; +PyAPI_DATA(PyTypeObject) _PyCoroWrapper_Type; + +#define PyCoro_CheckExact(op) Py_IS_TYPE(op, &PyCoro_Type) +PyAPI_FUNC(PyObject *) PyCoro_New(PyFrameObject *, + PyObject *name, PyObject *qualname); + + +/* --- Asynchronous Generators -------------------------------------------- */ + +typedef struct { + _PyGenObject_HEAD(ag) +} PyAsyncGenObject; + +PyAPI_DATA(PyTypeObject) PyAsyncGen_Type; +PyAPI_DATA(PyTypeObject) _PyAsyncGenASend_Type; +PyAPI_DATA(PyTypeObject) _PyAsyncGenWrappedValue_Type; +PyAPI_DATA(PyTypeObject) _PyAsyncGenAThrow_Type; + +PyAPI_FUNC(PyObject *) PyAsyncGen_New(PyFrameObject *, + PyObject *name, PyObject *qualname); + +#define PyAsyncGen_CheckExact(op) Py_IS_TYPE(op, &PyAsyncGen_Type) + + +#undef _PyGenObject_HEAD + +#ifdef __cplusplus +} +#endif +#endif /* !Py_GENOBJECT_H */ +#endif /* Py_LIMITED_API */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/import.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/import.h new file mode 100644 index 0000000000000000000000000000000000000000..a69b4f34def342adbb3f23a3a727a350737bff54 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/import.h @@ -0,0 +1,45 @@ +#ifndef Py_CPYTHON_IMPORT_H +# error "this header file must not be included directly" +#endif + +PyMODINIT_FUNC PyInit__imp(void); + +PyAPI_FUNC(int) _PyImport_IsInitialized(PyInterpreterState *); + +PyAPI_FUNC(PyObject *) _PyImport_GetModuleId(_Py_Identifier *name); +PyAPI_FUNC(int) _PyImport_SetModule(PyObject *name, PyObject *module); +PyAPI_FUNC(int) _PyImport_SetModuleString(const char *name, PyObject* module); + +PyAPI_FUNC(void) _PyImport_AcquireLock(void); +PyAPI_FUNC(int) _PyImport_ReleaseLock(void); + +PyAPI_FUNC(int) _PyImport_FixupBuiltin( + PyObject *mod, + const char *name, /* UTF-8 encoded string */ + PyObject *modules + ); +PyAPI_FUNC(int) _PyImport_FixupExtensionObject(PyObject*, PyObject *, + PyObject *, PyObject *); + +struct _inittab { + const char *name; /* ASCII encoded string */ + PyObject* (*initfunc)(void); +}; +PyAPI_DATA(struct _inittab *) PyImport_Inittab; +PyAPI_FUNC(int) PyImport_ExtendInittab(struct _inittab *newtab); + +struct _frozen { + const char *name; /* ASCII encoded string */ + const unsigned char *code; + int size; + int is_package; + PyObject *(*get_code)(void); +}; + +/* Embedding apps may change this pointer to point to their favorite + collection of frozen modules: */ + +PyAPI_DATA(const struct _frozen *) PyImport_FrozenModules; + +PyAPI_DATA(PyObject *) _PyImport_GetModuleAttr(PyObject *, PyObject *); +PyAPI_DATA(PyObject *) _PyImport_GetModuleAttrString(const char *, const char *); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/initconfig.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/initconfig.h new file mode 100644 index 0000000000000000000000000000000000000000..3b6d59389f26b9dcea2f1bbe9ad1116fae4b9588 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/initconfig.h @@ -0,0 +1,257 @@ +#ifndef Py_PYCORECONFIG_H +#define Py_PYCORECONFIG_H +#ifndef Py_LIMITED_API +#ifdef __cplusplus +extern "C" { +#endif + +/* --- PyStatus ----------------------------------------------- */ + +typedef struct { + enum { + _PyStatus_TYPE_OK=0, + _PyStatus_TYPE_ERROR=1, + _PyStatus_TYPE_EXIT=2 + } _type; + const char *func; + const char *err_msg; + int exitcode; +} PyStatus; + +PyAPI_FUNC(PyStatus) PyStatus_Ok(void); +PyAPI_FUNC(PyStatus) PyStatus_Error(const char *err_msg); +PyAPI_FUNC(PyStatus) PyStatus_NoMemory(void); +PyAPI_FUNC(PyStatus) PyStatus_Exit(int exitcode); +PyAPI_FUNC(int) PyStatus_IsError(PyStatus err); +PyAPI_FUNC(int) PyStatus_IsExit(PyStatus err); +PyAPI_FUNC(int) PyStatus_Exception(PyStatus err); + +/* --- PyWideStringList ------------------------------------------------ */ + +typedef struct { + /* If length is greater than zero, items must be non-NULL + and all items strings must be non-NULL */ + Py_ssize_t length; + wchar_t **items; +} PyWideStringList; + +PyAPI_FUNC(PyStatus) PyWideStringList_Append(PyWideStringList *list, + const wchar_t *item); +PyAPI_FUNC(PyStatus) PyWideStringList_Insert(PyWideStringList *list, + Py_ssize_t index, + const wchar_t *item); + + +/* --- PyPreConfig ----------------------------------------------- */ + +typedef struct PyPreConfig { + int _config_init; /* _PyConfigInitEnum value */ + + /* Parse Py_PreInitializeFromBytesArgs() arguments? + See PyConfig.parse_argv */ + int parse_argv; + + /* If greater than 0, enable isolated mode: sys.path contains + neither the script's directory nor the user's site-packages directory. + + Set to 1 by the -I command line option. If set to -1 (default), inherit + Py_IsolatedFlag value. */ + int isolated; + + /* If greater than 0: use environment variables. + Set to 0 by -E command line option. If set to -1 (default), it is + set to !Py_IgnoreEnvironmentFlag. */ + int use_environment; + + /* Set the LC_CTYPE locale to the user preferred locale? If equals to 0, + set coerce_c_locale and coerce_c_locale_warn to 0. */ + int configure_locale; + + /* Coerce the LC_CTYPE locale if it's equal to "C"? (PEP 538) + + Set to 0 by PYTHONCOERCECLOCALE=0. Set to 1 by PYTHONCOERCECLOCALE=1. + Set to 2 if the user preferred LC_CTYPE locale is "C". + + If it is equal to 1, LC_CTYPE locale is read to decide if it should be + coerced or not (ex: PYTHONCOERCECLOCALE=1). Internally, it is set to 2 + if the LC_CTYPE locale must be coerced. + + Disable by default (set to 0). Set it to -1 to let Python decide if it + should be enabled or not. */ + int coerce_c_locale; + + /* Emit a warning if the LC_CTYPE locale is coerced? + + Set to 1 by PYTHONCOERCECLOCALE=warn. + + Disable by default (set to 0). Set it to -1 to let Python decide if it + should be enabled or not. */ + int coerce_c_locale_warn; + +#ifdef MS_WINDOWS + /* If greater than 1, use the "mbcs" encoding instead of the UTF-8 + encoding for the filesystem encoding. + + Set to 1 if the PYTHONLEGACYWINDOWSFSENCODING environment variable is + set to a non-empty string. If set to -1 (default), inherit + Py_LegacyWindowsFSEncodingFlag value. + + See PEP 529 for more details. */ + int legacy_windows_fs_encoding; +#endif + + /* Enable UTF-8 mode? (PEP 540) + + Disabled by default (equals to 0). + + Set to 1 by "-X utf8" and "-X utf8=1" command line options. + Set to 1 by PYTHONUTF8=1 environment variable. + + Set to 0 by "-X utf8=0" and PYTHONUTF8=0. + + If equals to -1, it is set to 1 if the LC_CTYPE locale is "C" or + "POSIX", otherwise it is set to 0. Inherit Py_UTF8Mode value value. */ + int utf8_mode; + + /* If non-zero, enable the Python Development Mode. + + Set to 1 by the -X dev command line option. Set by the PYTHONDEVMODE + environment variable. */ + int dev_mode; + + /* Memory allocator: PYTHONMALLOC env var. + See PyMemAllocatorName for valid values. */ + int allocator; +} PyPreConfig; + +PyAPI_FUNC(void) PyPreConfig_InitPythonConfig(PyPreConfig *config); +PyAPI_FUNC(void) PyPreConfig_InitIsolatedConfig(PyPreConfig *config); + + +/* --- PyConfig ---------------------------------------------- */ + +/* This structure is best documented in the Doc/c-api/init_config.rst file. */ +typedef struct PyConfig { + int _config_init; /* _PyConfigInitEnum value */ + + int isolated; + int use_environment; + int dev_mode; + int install_signal_handlers; + int use_hash_seed; + unsigned long hash_seed; + int faulthandler; + int tracemalloc; + int import_time; + int code_debug_ranges; + int show_ref_count; + int dump_refs; + wchar_t *dump_refs_file; + int malloc_stats; + wchar_t *filesystem_encoding; + wchar_t *filesystem_errors; + wchar_t *pycache_prefix; + int parse_argv; + PyWideStringList orig_argv; + PyWideStringList argv; + PyWideStringList xoptions; + PyWideStringList warnoptions; + int site_import; + int bytes_warning; + int warn_default_encoding; + int inspect; + int interactive; + int optimization_level; + int parser_debug; + int write_bytecode; + int verbose; + int quiet; + int user_site_directory; + int configure_c_stdio; + int buffered_stdio; + wchar_t *stdio_encoding; + wchar_t *stdio_errors; +#ifdef MS_WINDOWS + int legacy_windows_stdio; +#endif + wchar_t *check_hash_pycs_mode; + int use_frozen_modules; + int safe_path; + + /* --- Path configuration inputs ------------ */ + int pathconfig_warnings; + wchar_t *program_name; + wchar_t *pythonpath_env; + wchar_t *home; + wchar_t *platlibdir; + + /* --- Path configuration outputs ----------- */ + int module_search_paths_set; + PyWideStringList module_search_paths; + wchar_t *stdlib_dir; + wchar_t *executable; + wchar_t *base_executable; + wchar_t *prefix; + wchar_t *base_prefix; + wchar_t *exec_prefix; + wchar_t *base_exec_prefix; + + /* --- Parameter only used by Py_Main() ---------- */ + int skip_source_first_line; + wchar_t *run_command; + wchar_t *run_module; + wchar_t *run_filename; + + /* --- Private fields ---------------------------- */ + + // Install importlib? If equals to 0, importlib is not initialized at all. + // Needed by freeze_importlib. + int _install_importlib; + + // If equal to 0, stop Python initialization before the "main" phase. + int _init_main; + + // If non-zero, disallow threads, subprocesses, and fork. + // Default: 0. + int _isolated_interpreter; + + // If non-zero, we believe we're running from a source tree. + int _is_python_build; +} PyConfig; + +PyAPI_FUNC(void) PyConfig_InitPythonConfig(PyConfig *config); +PyAPI_FUNC(void) PyConfig_InitIsolatedConfig(PyConfig *config); +PyAPI_FUNC(void) PyConfig_Clear(PyConfig *); +PyAPI_FUNC(PyStatus) PyConfig_SetString( + PyConfig *config, + wchar_t **config_str, + const wchar_t *str); +PyAPI_FUNC(PyStatus) PyConfig_SetBytesString( + PyConfig *config, + wchar_t **config_str, + const char *str); +PyAPI_FUNC(PyStatus) PyConfig_Read(PyConfig *config); +PyAPI_FUNC(PyStatus) PyConfig_SetBytesArgv( + PyConfig *config, + Py_ssize_t argc, + char * const *argv); +PyAPI_FUNC(PyStatus) PyConfig_SetArgv(PyConfig *config, + Py_ssize_t argc, + wchar_t * const *argv); +PyAPI_FUNC(PyStatus) PyConfig_SetWideStringList(PyConfig *config, + PyWideStringList *list, + Py_ssize_t length, wchar_t **items); + + +/* --- Helper functions --------------------------------------- */ + +/* Get the original command line arguments, before Python modified them. + + See also PyConfig.orig_argv. */ +PyAPI_FUNC(void) Py_GetArgcArgv(int *argc, wchar_t ***argv); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_LIMITED_API */ +#endif /* !Py_PYCORECONFIG_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/listobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/listobject.h new file mode 100644 index 0000000000000000000000000000000000000000..1add8213e0c092fbd63514ef96cf75a26a21ea08 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/listobject.h @@ -0,0 +1,51 @@ +#ifndef Py_CPYTHON_LISTOBJECT_H +# error "this header file must not be included directly" +#endif + +typedef struct { + PyObject_VAR_HEAD + /* Vector of pointers to list elements. list[0] is ob_item[0], etc. */ + PyObject **ob_item; + + /* ob_item contains space for 'allocated' elements. The number + * currently in use is ob_size. + * Invariants: + * 0 <= ob_size <= allocated + * len(list) == ob_size + * ob_item == NULL implies ob_size == allocated == 0 + * list.sort() temporarily sets allocated to -1 to detect mutations. + * + * Items must normally not be NULL, except during construction when + * the list is not yet visible outside the function that builds it. + */ + Py_ssize_t allocated; +} PyListObject; + +PyAPI_FUNC(PyObject *) _PyList_Extend(PyListObject *, PyObject *); +PyAPI_FUNC(void) _PyList_DebugMallocStats(FILE *out); + +/* Cast argument to PyListObject* type. */ +#define _PyList_CAST(op) \ + (assert(PyList_Check(op)), _Py_CAST(PyListObject*, (op))) + +// Macros and static inline functions, trading safety for speed + +static inline Py_ssize_t PyList_GET_SIZE(PyObject *op) { + PyListObject *list = _PyList_CAST(op); + return Py_SIZE(list); +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +# define PyList_GET_SIZE(op) PyList_GET_SIZE(_PyObject_CAST(op)) +#endif + +#define PyList_GET_ITEM(op, index) (_PyList_CAST(op)->ob_item[index]) + +static inline void +PyList_SET_ITEM(PyObject *op, Py_ssize_t index, PyObject *value) { + PyListObject *list = _PyList_CAST(op); + list->ob_item[index] = value; +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +#define PyList_SET_ITEM(op, index, value) \ + PyList_SET_ITEM(_PyObject_CAST(op), index, _PyObject_CAST(value)) +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/longintrepr.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/longintrepr.h new file mode 100644 index 0000000000000000000000000000000000000000..6d52427508b5fe4fc5414673d273a4ecfd587dcf --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/longintrepr.h @@ -0,0 +1,96 @@ +#ifndef Py_LIMITED_API +#ifndef Py_LONGINTREPR_H +#define Py_LONGINTREPR_H +#ifdef __cplusplus +extern "C" { +#endif + + +/* This is published for the benefit of "friends" marshal.c and _decimal.c. */ + +/* Parameters of the integer representation. There are two different + sets of parameters: one set for 30-bit digits, stored in an unsigned 32-bit + integer type, and one set for 15-bit digits with each digit stored in an + unsigned short. The value of PYLONG_BITS_IN_DIGIT, defined either at + configure time or in pyport.h, is used to decide which digit size to use. + + Type 'digit' should be able to hold 2*PyLong_BASE-1, and type 'twodigits' + should be an unsigned integer type able to hold all integers up to + PyLong_BASE*PyLong_BASE-1. x_sub assumes that 'digit' is an unsigned type, + and that overflow is handled by taking the result modulo 2**N for some N > + PyLong_SHIFT. The majority of the code doesn't care about the precise + value of PyLong_SHIFT, but there are some notable exceptions: + + - PyLong_{As,From}ByteArray require that PyLong_SHIFT be at least 8 + + - long_hash() requires that PyLong_SHIFT is *strictly* less than the number + of bits in an unsigned long, as do the PyLong <-> long (or unsigned long) + conversion functions + + - the Python int <-> size_t/Py_ssize_t conversion functions expect that + PyLong_SHIFT is strictly less than the number of bits in a size_t + + - the marshal code currently expects that PyLong_SHIFT is a multiple of 15 + + - NSMALLNEGINTS and NSMALLPOSINTS should be small enough to fit in a single + digit; with the current values this forces PyLong_SHIFT >= 9 + + The values 15 and 30 should fit all of the above requirements, on any + platform. +*/ + +#if PYLONG_BITS_IN_DIGIT == 30 +typedef uint32_t digit; +typedef int32_t sdigit; /* signed variant of digit */ +typedef uint64_t twodigits; +typedef int64_t stwodigits; /* signed variant of twodigits */ +#define PyLong_SHIFT 30 +#define _PyLong_DECIMAL_SHIFT 9 /* max(e such that 10**e fits in a digit) */ +#define _PyLong_DECIMAL_BASE ((digit)1000000000) /* 10 ** DECIMAL_SHIFT */ +#elif PYLONG_BITS_IN_DIGIT == 15 +typedef unsigned short digit; +typedef short sdigit; /* signed variant of digit */ +typedef unsigned long twodigits; +typedef long stwodigits; /* signed variant of twodigits */ +#define PyLong_SHIFT 15 +#define _PyLong_DECIMAL_SHIFT 4 /* max(e such that 10**e fits in a digit) */ +#define _PyLong_DECIMAL_BASE ((digit)10000) /* 10 ** DECIMAL_SHIFT */ +#else +#error "PYLONG_BITS_IN_DIGIT should be 15 or 30" +#endif +#define PyLong_BASE ((digit)1 << PyLong_SHIFT) +#define PyLong_MASK ((digit)(PyLong_BASE - 1)) + +/* Long integer representation. + The absolute value of a number is equal to + SUM(for i=0 through abs(ob_size)-1) ob_digit[i] * 2**(SHIFT*i) + Negative numbers are represented with ob_size < 0; + zero is represented by ob_size == 0. + In a normalized number, ob_digit[abs(ob_size)-1] (the most significant + digit) is never zero. Also, in all cases, for all valid i, + 0 <= ob_digit[i] <= MASK. + The allocation function takes care of allocating extra memory + so that ob_digit[0] ... ob_digit[abs(ob_size)-1] are actually available. + We always allocate memory for at least one digit, so accessing ob_digit[0] + is always safe. However, in the case ob_size == 0, the contents of + ob_digit[0] may be undefined. + + CAUTION: Generic code manipulating subtypes of PyVarObject has to + aware that ints abuse ob_size's sign bit. +*/ + +struct _longobject { + PyObject_VAR_HEAD + digit ob_digit[1]; +}; + +PyAPI_FUNC(PyLongObject *) _PyLong_New(Py_ssize_t); + +/* Return a copy of src. */ +PyAPI_FUNC(PyObject *) _PyLong_Copy(PyLongObject *src); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_LONGINTREPR_H */ +#endif /* Py_LIMITED_API */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/longobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/longobject.h new file mode 100644 index 0000000000000000000000000000000000000000..1a73799d658fe02d62afb7a62171601fbe644d7f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/longobject.h @@ -0,0 +1,95 @@ +#ifndef Py_CPYTHON_LONGOBJECT_H +# error "this header file must not be included directly" +#endif + +PyAPI_FUNC(int) _PyLong_AsInt(PyObject *); + +PyAPI_FUNC(int) _PyLong_UnsignedShort_Converter(PyObject *, void *); +PyAPI_FUNC(int) _PyLong_UnsignedInt_Converter(PyObject *, void *); +PyAPI_FUNC(int) _PyLong_UnsignedLong_Converter(PyObject *, void *); +PyAPI_FUNC(int) _PyLong_UnsignedLongLong_Converter(PyObject *, void *); +PyAPI_FUNC(int) _PyLong_Size_t_Converter(PyObject *, void *); + +/* _PyLong_Frexp returns a double x and an exponent e such that the + true value is approximately equal to x * 2**e. e is >= 0. x is + 0.0 if and only if the input is 0 (in which case, e and x are both + zeroes); otherwise, 0.5 <= abs(x) < 1.0. On overflow, which is + possible if the number of bits doesn't fit into a Py_ssize_t, sets + OverflowError and returns -1.0 for x, 0 for e. */ +PyAPI_FUNC(double) _PyLong_Frexp(PyLongObject *a, Py_ssize_t *e); + +PyAPI_FUNC(PyObject *) PyLong_FromUnicodeObject(PyObject *u, int base); +PyAPI_FUNC(PyObject *) _PyLong_FromBytes(const char *, Py_ssize_t, int); + +/* _PyLong_Sign. Return 0 if v is 0, -1 if v < 0, +1 if v > 0. + v must not be NULL, and must be a normalized long. + There are no error cases. +*/ +PyAPI_FUNC(int) _PyLong_Sign(PyObject *v); + +/* _PyLong_NumBits. Return the number of bits needed to represent the + absolute value of a long. For example, this returns 1 for 1 and -1, 2 + for 2 and -2, and 2 for 3 and -3. It returns 0 for 0. + v must not be NULL, and must be a normalized long. + (size_t)-1 is returned and OverflowError set if the true result doesn't + fit in a size_t. +*/ +PyAPI_FUNC(size_t) _PyLong_NumBits(PyObject *v); + +/* _PyLong_DivmodNear. Given integers a and b, compute the nearest + integer q to the exact quotient a / b, rounding to the nearest even integer + in the case of a tie. Return (q, r), where r = a - q*b. The remainder r + will satisfy abs(r) <= abs(b)/2, with equality possible only if q is + even. +*/ +PyAPI_FUNC(PyObject *) _PyLong_DivmodNear(PyObject *, PyObject *); + +/* _PyLong_FromByteArray: View the n unsigned bytes as a binary integer in + base 256, and return a Python int with the same numeric value. + If n is 0, the integer is 0. Else: + If little_endian is 1/true, bytes[n-1] is the MSB and bytes[0] the LSB; + else (little_endian is 0/false) bytes[0] is the MSB and bytes[n-1] the + LSB. + If is_signed is 0/false, view the bytes as a non-negative integer. + If is_signed is 1/true, view the bytes as a 2's-complement integer, + non-negative if bit 0x80 of the MSB is clear, negative if set. + Error returns: + + Return NULL with the appropriate exception set if there's not + enough memory to create the Python int. +*/ +PyAPI_FUNC(PyObject *) _PyLong_FromByteArray( + const unsigned char* bytes, size_t n, + int little_endian, int is_signed); + +/* _PyLong_AsByteArray: Convert the least-significant 8*n bits of long + v to a base-256 integer, stored in array bytes. Normally return 0, + return -1 on error. + If little_endian is 1/true, store the MSB at bytes[n-1] and the LSB at + bytes[0]; else (little_endian is 0/false) store the MSB at bytes[0] and + the LSB at bytes[n-1]. + If is_signed is 0/false, it's an error if v < 0; else (v >= 0) n bytes + are filled and there's nothing special about bit 0x80 of the MSB. + If is_signed is 1/true, bytes is filled with the 2's-complement + representation of v's value. Bit 0x80 of the MSB is the sign bit. + Error returns (-1): + + is_signed is 0 and v < 0. TypeError is set in this case, and bytes + isn't altered. + + n isn't big enough to hold the full mathematical value of v. For + example, if is_signed is 0 and there are more digits in the v than + fit in n; or if is_signed is 1, v < 0, and n is just 1 bit shy of + being large enough to hold a sign bit. OverflowError is set in this + case, but bytes holds the least-significant n bytes of the true value. +*/ +PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v, + unsigned char* bytes, size_t n, + int little_endian, int is_signed); + +/* _PyLong_Format: Convert the long to a string object with given base, + appending a base prefix of 0[box] if base is 2, 8 or 16. */ +PyAPI_FUNC(PyObject *) _PyLong_Format(PyObject *obj, int base); + +/* For use by the gcd function in mathmodule.c */ +PyAPI_FUNC(PyObject *) _PyLong_GCD(PyObject *, PyObject *); + +PyAPI_FUNC(PyObject *) _PyLong_Rshift(PyObject *, size_t); +PyAPI_FUNC(PyObject *) _PyLong_Lshift(PyObject *, size_t); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/methodobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/methodobject.h new file mode 100644 index 0000000000000000000000000000000000000000..54a61cfd077be9aa29e233a7971a3393f9f3293a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/methodobject.h @@ -0,0 +1,74 @@ +#ifndef Py_CPYTHON_METHODOBJECT_H +# error "this header file must not be included directly" +#endif + +// PyCFunctionObject structure + +typedef struct { + PyObject_HEAD + PyMethodDef *m_ml; /* Description of the C function to call */ + PyObject *m_self; /* Passed as 'self' arg to the C func, can be NULL */ + PyObject *m_module; /* The __module__ attribute, can be anything */ + PyObject *m_weakreflist; /* List of weak references */ + vectorcallfunc vectorcall; +} PyCFunctionObject; + +#define _PyCFunctionObject_CAST(func) \ + (assert(PyCFunction_Check(func)), \ + _Py_CAST(PyCFunctionObject*, (func))) + + +// PyCMethodObject structure + +typedef struct { + PyCFunctionObject func; + PyTypeObject *mm_class; /* Class that defines this method */ +} PyCMethodObject; + +#define _PyCMethodObject_CAST(func) \ + (assert(PyCMethod_Check(func)), \ + _Py_CAST(PyCMethodObject*, (func))) + +PyAPI_DATA(PyTypeObject) PyCMethod_Type; + +#define PyCMethod_CheckExact(op) Py_IS_TYPE(op, &PyCMethod_Type) +#define PyCMethod_Check(op) PyObject_TypeCheck(op, &PyCMethod_Type) + + +/* Static inline functions for direct access to these values. + Type checks are *not* done, so use with care. */ +static inline PyCFunction PyCFunction_GET_FUNCTION(PyObject *func) { + return _PyCFunctionObject_CAST(func)->m_ml->ml_meth; +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +# define PyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(_PyObject_CAST(func)) +#endif + +static inline PyObject* PyCFunction_GET_SELF(PyObject *func_obj) { + PyCFunctionObject *func = _PyCFunctionObject_CAST(func_obj); + if (func->m_ml->ml_flags & METH_STATIC) { + return _Py_NULL; + } + return func->m_self; +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +# define PyCFunction_GET_SELF(func) PyCFunction_GET_SELF(_PyObject_CAST(func)) +#endif + +static inline int PyCFunction_GET_FLAGS(PyObject *func) { + return _PyCFunctionObject_CAST(func)->m_ml->ml_flags; +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +# define PyCFunction_GET_FLAGS(func) PyCFunction_GET_FLAGS(_PyObject_CAST(func)) +#endif + +static inline PyTypeObject* PyCFunction_GET_CLASS(PyObject *func_obj) { + PyCFunctionObject *func = _PyCFunctionObject_CAST(func_obj); + if (func->m_ml->ml_flags & METH_METHOD) { + return _PyCMethodObject_CAST(func)->mm_class; + } + return _Py_NULL; +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +# define PyCFunction_GET_CLASS(func) PyCFunction_GET_CLASS(_PyObject_CAST(func)) +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/modsupport.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/modsupport.h new file mode 100644 index 0000000000000000000000000000000000000000..205e174243987ed01b1aa81043eba11c41d551de --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/modsupport.h @@ -0,0 +1,108 @@ +#ifndef Py_CPYTHON_MODSUPPORT_H +# error "this header file must not be included directly" +#endif + +/* If PY_SSIZE_T_CLEAN is defined, each functions treats #-specifier + to mean Py_ssize_t */ +#ifdef PY_SSIZE_T_CLEAN +#define _Py_VaBuildStack _Py_VaBuildStack_SizeT +#else +PyAPI_FUNC(PyObject *) _Py_VaBuildValue_SizeT(const char *, va_list); +PyAPI_FUNC(PyObject **) _Py_VaBuildStack_SizeT( + PyObject **small_stack, + Py_ssize_t small_stack_len, + const char *format, + va_list va, + Py_ssize_t *p_nargs); +#endif + +PyAPI_FUNC(int) _PyArg_UnpackStack( + PyObject *const *args, + Py_ssize_t nargs, + const char *name, + Py_ssize_t min, + Py_ssize_t max, + ...); + +PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kwargs); +PyAPI_FUNC(int) _PyArg_NoKwnames(const char *funcname, PyObject *kwnames); +PyAPI_FUNC(int) _PyArg_NoPositional(const char *funcname, PyObject *args); +#define _PyArg_NoKeywords(funcname, kwargs) \ + ((kwargs) == NULL || _PyArg_NoKeywords((funcname), (kwargs))) +#define _PyArg_NoKwnames(funcname, kwnames) \ + ((kwnames) == NULL || _PyArg_NoKwnames((funcname), (kwnames))) +#define _PyArg_NoPositional(funcname, args) \ + ((args) == NULL || _PyArg_NoPositional((funcname), (args))) + +PyAPI_FUNC(void) _PyArg_BadArgument(const char *, const char *, const char *, PyObject *); +PyAPI_FUNC(int) _PyArg_CheckPositional(const char *, Py_ssize_t, + Py_ssize_t, Py_ssize_t); +#define _PyArg_CheckPositional(funcname, nargs, min, max) \ + ((!ANY_VARARGS(max) && (min) <= (nargs) && (nargs) <= (max)) \ + || _PyArg_CheckPositional((funcname), (nargs), (min), (max))) + +PyAPI_FUNC(PyObject **) _Py_VaBuildStack( + PyObject **small_stack, + Py_ssize_t small_stack_len, + const char *format, + va_list va, + Py_ssize_t *p_nargs); + +typedef struct _PyArg_Parser { + const char *format; + const char * const *keywords; + const char *fname; + const char *custom_msg; + int pos; /* number of positional-only arguments */ + int min; /* minimal number of arguments */ + int max; /* maximal number of positional arguments */ + PyObject *kwtuple; /* tuple of keyword parameter names */ + struct _PyArg_Parser *next; +} _PyArg_Parser; + +#ifdef PY_SSIZE_T_CLEAN +#define _PyArg_ParseTupleAndKeywordsFast _PyArg_ParseTupleAndKeywordsFast_SizeT +#define _PyArg_ParseStack _PyArg_ParseStack_SizeT +#define _PyArg_ParseStackAndKeywords _PyArg_ParseStackAndKeywords_SizeT +#define _PyArg_VaParseTupleAndKeywordsFast _PyArg_VaParseTupleAndKeywordsFast_SizeT +#endif + +PyAPI_FUNC(int) _PyArg_ParseTupleAndKeywordsFast(PyObject *, PyObject *, + struct _PyArg_Parser *, ...); +PyAPI_FUNC(int) _PyArg_ParseStack( + PyObject *const *args, + Py_ssize_t nargs, + const char *format, + ...); +PyAPI_FUNC(int) _PyArg_ParseStackAndKeywords( + PyObject *const *args, + Py_ssize_t nargs, + PyObject *kwnames, + struct _PyArg_Parser *, + ...); +PyAPI_FUNC(int) _PyArg_VaParseTupleAndKeywordsFast(PyObject *, PyObject *, + struct _PyArg_Parser *, va_list); +PyAPI_FUNC(PyObject * const *) _PyArg_UnpackKeywords( + PyObject *const *args, Py_ssize_t nargs, + PyObject *kwargs, PyObject *kwnames, + struct _PyArg_Parser *parser, + int minpos, int maxpos, int minkw, + PyObject **buf); + +PyAPI_FUNC(PyObject * const *) _PyArg_UnpackKeywordsWithVararg( + PyObject *const *args, Py_ssize_t nargs, + PyObject *kwargs, PyObject *kwnames, + struct _PyArg_Parser *parser, + int minpos, int maxpos, int minkw, + int vararg, PyObject **buf); + +#define _PyArg_UnpackKeywords(args, nargs, kwargs, kwnames, parser, minpos, maxpos, minkw, buf) \ + (((minkw) == 0 && (kwargs) == NULL && (kwnames) == NULL && \ + (minpos) <= (nargs) && (nargs) <= (maxpos) && args != NULL) ? (args) : \ + _PyArg_UnpackKeywords((args), (nargs), (kwargs), (kwnames), (parser), \ + (minpos), (maxpos), (minkw), (buf))) + +PyAPI_FUNC(PyObject *) _PyModule_CreateInitialized(PyModuleDef*, int apiver); +PyAPI_FUNC(int) _PyModule_Add(PyObject *, const char *, PyObject *); + +PyAPI_DATA(const char *) _Py_PackageContext; diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/object.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/object.h new file mode 100644 index 0000000000000000000000000000000000000000..b018dabf9d862ff501eae15a8d0e0e58fba4697a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/object.h @@ -0,0 +1,511 @@ +#ifndef Py_CPYTHON_OBJECT_H +# error "this header file must not be included directly" +#endif + +PyAPI_FUNC(void) _Py_NewReference(PyObject *op); + +#ifdef Py_TRACE_REFS +/* Py_TRACE_REFS is such major surgery that we call external routines. */ +PyAPI_FUNC(void) _Py_ForgetReference(PyObject *); +#endif + +#ifdef Py_REF_DEBUG +PyAPI_FUNC(Py_ssize_t) _Py_GetRefTotal(void); +#endif + + +/********************* String Literals ****************************************/ +/* This structure helps managing static strings. The basic usage goes like this: + Instead of doing + + r = PyObject_CallMethod(o, "foo", "args", ...); + + do + + _Py_IDENTIFIER(foo); + ... + r = _PyObject_CallMethodId(o, &PyId_foo, "args", ...); + + PyId_foo is a static variable, either on block level or file level. On first + usage, the string "foo" is interned, and the structures are linked. On interpreter + shutdown, all strings are released. + + Alternatively, _Py_static_string allows choosing the variable name. + _PyUnicode_FromId returns a borrowed reference to the interned string. + _PyObject_{Get,Set,Has}AttrId are __getattr__ versions using _Py_Identifier*. +*/ +typedef struct _Py_Identifier { + const char* string; + // Index in PyInterpreterState.unicode.ids.array. It is process-wide + // unique and must be initialized to -1. + Py_ssize_t index; +} _Py_Identifier; + +#if defined(NEEDS_PY_IDENTIFIER) || !defined(Py_BUILD_CORE) +// For now we are keeping _Py_IDENTIFIER for continued use +// in non-builtin extensions (and naughty PyPI modules). + +#define _Py_static_string_init(value) { .string = value, .index = -1 } +#define _Py_static_string(varname, value) static _Py_Identifier varname = _Py_static_string_init(value) +#define _Py_IDENTIFIER(varname) _Py_static_string(PyId_##varname, #varname) + +#endif /* NEEDS_PY_IDENTIFIER */ + +typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); +typedef void (*releasebufferproc)(PyObject *, Py_buffer *); + +typedef PyObject *(*vectorcallfunc)(PyObject *callable, PyObject *const *args, + size_t nargsf, PyObject *kwnames); + + +typedef struct { + /* Number implementations must check *both* + arguments for proper type and implement the necessary conversions + in the slot functions themselves. */ + + binaryfunc nb_add; + binaryfunc nb_subtract; + binaryfunc nb_multiply; + binaryfunc nb_remainder; + binaryfunc nb_divmod; + ternaryfunc nb_power; + unaryfunc nb_negative; + unaryfunc nb_positive; + unaryfunc nb_absolute; + inquiry nb_bool; + unaryfunc nb_invert; + binaryfunc nb_lshift; + binaryfunc nb_rshift; + binaryfunc nb_and; + binaryfunc nb_xor; + binaryfunc nb_or; + unaryfunc nb_int; + void *nb_reserved; /* the slot formerly known as nb_long */ + unaryfunc nb_float; + + binaryfunc nb_inplace_add; + binaryfunc nb_inplace_subtract; + binaryfunc nb_inplace_multiply; + binaryfunc nb_inplace_remainder; + ternaryfunc nb_inplace_power; + binaryfunc nb_inplace_lshift; + binaryfunc nb_inplace_rshift; + binaryfunc nb_inplace_and; + binaryfunc nb_inplace_xor; + binaryfunc nb_inplace_or; + + binaryfunc nb_floor_divide; + binaryfunc nb_true_divide; + binaryfunc nb_inplace_floor_divide; + binaryfunc nb_inplace_true_divide; + + unaryfunc nb_index; + + binaryfunc nb_matrix_multiply; + binaryfunc nb_inplace_matrix_multiply; +} PyNumberMethods; + +typedef struct { + lenfunc sq_length; + binaryfunc sq_concat; + ssizeargfunc sq_repeat; + ssizeargfunc sq_item; + void *was_sq_slice; + ssizeobjargproc sq_ass_item; + void *was_sq_ass_slice; + objobjproc sq_contains; + + binaryfunc sq_inplace_concat; + ssizeargfunc sq_inplace_repeat; +} PySequenceMethods; + +typedef struct { + lenfunc mp_length; + binaryfunc mp_subscript; + objobjargproc mp_ass_subscript; +} PyMappingMethods; + +typedef PySendResult (*sendfunc)(PyObject *iter, PyObject *value, PyObject **result); + +typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + sendfunc am_send; +} PyAsyncMethods; + +typedef struct { + getbufferproc bf_getbuffer; + releasebufferproc bf_releasebuffer; +} PyBufferProcs; + +/* Allow printfunc in the tp_vectorcall_offset slot for + * backwards-compatibility */ +typedef Py_ssize_t printfunc; + +// If this structure is modified, Doc/includes/typestruct.h should be updated +// as well. +struct _typeobject { + PyObject_VAR_HEAD + const char *tp_name; /* For printing, in format "." */ + Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */ + + /* Methods to implement standard operations */ + + destructor tp_dealloc; + Py_ssize_t tp_vectorcall_offset; + getattrfunc tp_getattr; + setattrfunc tp_setattr; + PyAsyncMethods *tp_as_async; /* formerly known as tp_compare (Python 2) + or tp_reserved (Python 3) */ + reprfunc tp_repr; + + /* Method suites for standard classes */ + + PyNumberMethods *tp_as_number; + PySequenceMethods *tp_as_sequence; + PyMappingMethods *tp_as_mapping; + + /* More standard operations (here for binary compatibility) */ + + hashfunc tp_hash; + ternaryfunc tp_call; + reprfunc tp_str; + getattrofunc tp_getattro; + setattrofunc tp_setattro; + + /* Functions to access object as input/output buffer */ + PyBufferProcs *tp_as_buffer; + + /* Flags to define presence of optional/expanded features */ + unsigned long tp_flags; + + const char *tp_doc; /* Documentation string */ + + /* Assigned meaning in release 2.0 */ + /* call function for all accessible objects */ + traverseproc tp_traverse; + + /* delete references to contained objects */ + inquiry tp_clear; + + /* Assigned meaning in release 2.1 */ + /* rich comparisons */ + richcmpfunc tp_richcompare; + + /* weak reference enabler */ + Py_ssize_t tp_weaklistoffset; + + /* Iterators */ + getiterfunc tp_iter; + iternextfunc tp_iternext; + + /* Attribute descriptor and subclassing stuff */ + PyMethodDef *tp_methods; + PyMemberDef *tp_members; + PyGetSetDef *tp_getset; + // Strong reference on a heap type, borrowed reference on a static type + PyTypeObject *tp_base; + PyObject *tp_dict; + descrgetfunc tp_descr_get; + descrsetfunc tp_descr_set; + Py_ssize_t tp_dictoffset; + initproc tp_init; + allocfunc tp_alloc; + newfunc tp_new; + freefunc tp_free; /* Low-level free-memory routine */ + inquiry tp_is_gc; /* For PyObject_IS_GC */ + PyObject *tp_bases; + PyObject *tp_mro; /* method resolution order */ + PyObject *tp_cache; + PyObject *tp_subclasses; + PyObject *tp_weaklist; + destructor tp_del; + + /* Type attribute cache version tag. Added in version 2.6 */ + unsigned int tp_version_tag; + + destructor tp_finalize; + vectorcallfunc tp_vectorcall; +}; + +/* This struct is used by the specializer + * It should should be treated as an opaque blob + * by code other than the specializer and interpreter. */ +struct _specialization_cache { + PyObject *getitem; +}; + +/* The *real* layout of a type object when allocated on the heap */ +typedef struct _heaptypeobject { + /* Note: there's a dependency on the order of these members + in slotptr() in typeobject.c . */ + PyTypeObject ht_type; + PyAsyncMethods as_async; + PyNumberMethods as_number; + PyMappingMethods as_mapping; + PySequenceMethods as_sequence; /* as_sequence comes after as_mapping, + so that the mapping wins when both + the mapping and the sequence define + a given operator (e.g. __getitem__). + see add_operators() in typeobject.c . */ + PyBufferProcs as_buffer; + PyObject *ht_name, *ht_slots, *ht_qualname; + struct _dictkeysobject *ht_cached_keys; + PyObject *ht_module; + char *_ht_tpname; // Storage for "tp_name"; see PyType_FromModuleAndSpec + struct _specialization_cache _spec_cache; // For use by the specializer. + /* here are optional user slots, followed by the members. */ +} PyHeapTypeObject; + +PyAPI_FUNC(const char *) _PyType_Name(PyTypeObject *); +PyAPI_FUNC(PyObject *) _PyType_Lookup(PyTypeObject *, PyObject *); +PyAPI_FUNC(PyObject *) _PyType_LookupId(PyTypeObject *, _Py_Identifier *); +PyAPI_FUNC(PyObject *) _PyObject_LookupSpecialId(PyObject *, _Py_Identifier *); +#ifndef Py_BUILD_CORE +// Backward compatibility for 3rd-party extensions +// that may be using the old name. +#define _PyObject_LookupSpecial _PyObject_LookupSpecialId +#endif +PyAPI_FUNC(PyTypeObject *) _PyType_CalculateMetaclass(PyTypeObject *, PyObject *); +PyAPI_FUNC(PyObject *) _PyType_GetDocFromInternalDoc(const char *, const char *); +PyAPI_FUNC(PyObject *) _PyType_GetTextSignatureFromInternalDoc(const char *, const char *); +PyAPI_FUNC(PyObject *) PyType_GetModuleByDef(PyTypeObject *, PyModuleDef *); + +PyAPI_FUNC(int) PyObject_Print(PyObject *, FILE *, int); +PyAPI_FUNC(void) _Py_BreakPoint(void); +PyAPI_FUNC(void) _PyObject_Dump(PyObject *); +PyAPI_FUNC(int) _PyObject_IsFreed(PyObject *); + +PyAPI_FUNC(int) _PyObject_IsAbstract(PyObject *); +PyAPI_FUNC(PyObject *) _PyObject_GetAttrId(PyObject *, _Py_Identifier *); +PyAPI_FUNC(int) _PyObject_SetAttrId(PyObject *, _Py_Identifier *, PyObject *); +/* Replacements of PyObject_GetAttr() and _PyObject_GetAttrId() which + don't raise AttributeError. + + Return 1 and set *result != NULL if an attribute is found. + Return 0 and set *result == NULL if an attribute is not found; + an AttributeError is silenced. + Return -1 and set *result == NULL if an error other than AttributeError + is raised. +*/ +PyAPI_FUNC(int) _PyObject_LookupAttr(PyObject *, PyObject *, PyObject **); +PyAPI_FUNC(int) _PyObject_LookupAttrId(PyObject *, _Py_Identifier *, PyObject **); + +PyAPI_FUNC(int) _PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); + +PyAPI_FUNC(PyObject **) _PyObject_GetDictPtr(PyObject *); +PyAPI_FUNC(PyObject *) _PyObject_NextNotImplemented(PyObject *); +PyAPI_FUNC(void) PyObject_CallFinalizer(PyObject *); +PyAPI_FUNC(int) PyObject_CallFinalizerFromDealloc(PyObject *); + +/* Same as PyObject_Generic{Get,Set}Attr, but passing the attributes + dict as the last parameter. */ +PyAPI_FUNC(PyObject *) +_PyObject_GenericGetAttrWithDict(PyObject *, PyObject *, PyObject *, int); +PyAPI_FUNC(int) +_PyObject_GenericSetAttrWithDict(PyObject *, PyObject *, + PyObject *, PyObject *); + +PyAPI_FUNC(PyObject *) _PyObject_FunctionStr(PyObject *); + +/* Safely decref `op` and set `op` to `op2`. + * + * As in case of Py_CLEAR "the obvious" code can be deadly: + * + * Py_DECREF(op); + * op = op2; + * + * The safe way is: + * + * Py_SETREF(op, op2); + * + * That arranges to set `op` to `op2` _before_ decref'ing, so that any code + * triggered as a side-effect of `op` getting torn down no longer believes + * `op` points to a valid object. + * + * Py_XSETREF is a variant of Py_SETREF that uses Py_XDECREF instead of + * Py_DECREF. + */ + +#define Py_SETREF(op, op2) \ + do { \ + PyObject *_py_tmp = _PyObject_CAST(op); \ + (op) = (op2); \ + Py_DECREF(_py_tmp); \ + } while (0) + +#define Py_XSETREF(op, op2) \ + do { \ + PyObject *_py_tmp = _PyObject_CAST(op); \ + (op) = (op2); \ + Py_XDECREF(_py_tmp); \ + } while (0) + + +PyAPI_DATA(PyTypeObject) _PyNone_Type; +PyAPI_DATA(PyTypeObject) _PyNotImplemented_Type; + +/* Maps Py_LT to Py_GT, ..., Py_GE to Py_LE. + * Defined in object.c. + */ +PyAPI_DATA(int) _Py_SwappedOp[]; + +PyAPI_FUNC(void) +_PyDebugAllocatorStats(FILE *out, const char *block_name, int num_blocks, + size_t sizeof_block); +PyAPI_FUNC(void) +_PyObject_DebugTypeStats(FILE *out); + +/* Define a pair of assertion macros: + _PyObject_ASSERT_FROM(), _PyObject_ASSERT_WITH_MSG() and _PyObject_ASSERT(). + + These work like the regular C assert(), in that they will abort the + process with a message on stderr if the given condition fails to hold, + but compile away to nothing if NDEBUG is defined. + + However, before aborting, Python will also try to call _PyObject_Dump() on + the given object. This may be of use when investigating bugs in which a + particular object is corrupt (e.g. buggy a tp_visit method in an extension + module breaking the garbage collector), to help locate the broken objects. + + The WITH_MSG variant allows you to supply an additional message that Python + will attempt to print to stderr, after the object dump. */ +#ifdef NDEBUG + /* No debugging: compile away the assertions: */ +# define _PyObject_ASSERT_FROM(obj, expr, msg, filename, lineno, func) \ + ((void)0) +#else + /* With debugging: generate checks: */ +# define _PyObject_ASSERT_FROM(obj, expr, msg, filename, lineno, func) \ + ((expr) \ + ? (void)(0) \ + : _PyObject_AssertFailed((obj), Py_STRINGIFY(expr), \ + (msg), (filename), (lineno), (func))) +#endif + +#define _PyObject_ASSERT_WITH_MSG(obj, expr, msg) \ + _PyObject_ASSERT_FROM(obj, expr, msg, __FILE__, __LINE__, __func__) +#define _PyObject_ASSERT(obj, expr) \ + _PyObject_ASSERT_WITH_MSG(obj, expr, NULL) + +#define _PyObject_ASSERT_FAILED_MSG(obj, msg) \ + _PyObject_AssertFailed((obj), NULL, (msg), __FILE__, __LINE__, __func__) + +/* Declare and define _PyObject_AssertFailed() even when NDEBUG is defined, + to avoid causing compiler/linker errors when building extensions without + NDEBUG against a Python built with NDEBUG defined. + + msg, expr and function can be NULL. */ +PyAPI_FUNC(void) _Py_NO_RETURN _PyObject_AssertFailed( + PyObject *obj, + const char *expr, + const char *msg, + const char *file, + int line, + const char *function); + +/* Check if an object is consistent. For example, ensure that the reference + counter is greater than or equal to 1, and ensure that ob_type is not NULL. + + Call _PyObject_AssertFailed() if the object is inconsistent. + + If check_content is zero, only check header fields: reduce the overhead. + + The function always return 1. The return value is just here to be able to + write: + + assert(_PyObject_CheckConsistency(obj, 1)); */ +PyAPI_FUNC(int) _PyObject_CheckConsistency( + PyObject *op, + int check_content); + + +/* Trashcan mechanism, thanks to Christian Tismer. + +When deallocating a container object, it's possible to trigger an unbounded +chain of deallocations, as each Py_DECREF in turn drops the refcount on "the +next" object in the chain to 0. This can easily lead to stack overflows, +especially in threads (which typically have less stack space to work with). + +A container object can avoid this by bracketing the body of its tp_dealloc +function with a pair of macros: + +static void +mytype_dealloc(mytype *p) +{ + ... declarations go here ... + + PyObject_GC_UnTrack(p); // must untrack first + Py_TRASHCAN_BEGIN(p, mytype_dealloc) + ... The body of the deallocator goes here, including all calls ... + ... to Py_DECREF on contained objects. ... + Py_TRASHCAN_END // there should be no code after this +} + +CAUTION: Never return from the middle of the body! If the body needs to +"get out early", put a label immediately before the Py_TRASHCAN_END +call, and goto it. Else the call-depth counter (see below) will stay +above 0 forever, and the trashcan will never get emptied. + +How it works: The BEGIN macro increments a call-depth counter. So long +as this counter is small, the body of the deallocator is run directly without +further ado. But if the counter gets large, it instead adds p to a list of +objects to be deallocated later, skips the body of the deallocator, and +resumes execution after the END macro. The tp_dealloc routine then returns +without deallocating anything (and so unbounded call-stack depth is avoided). + +When the call stack finishes unwinding again, code generated by the END macro +notices this, and calls another routine to deallocate all the objects that +may have been added to the list of deferred deallocations. In effect, a +chain of N deallocations is broken into (N-1)/(_PyTrash_UNWIND_LEVEL-1) pieces, +with the call stack never exceeding a depth of _PyTrash_UNWIND_LEVEL. + +Since the tp_dealloc of a subclass typically calls the tp_dealloc of the base +class, we need to ensure that the trashcan is only triggered on the tp_dealloc +of the actual class being deallocated. Otherwise we might end up with a +partially-deallocated object. To check this, the tp_dealloc function must be +passed as second argument to Py_TRASHCAN_BEGIN(). +*/ + +/* Python 3.9 private API, invoked by the macros below. */ +PyAPI_FUNC(int) _PyTrash_begin(PyThreadState *tstate, PyObject *op); +PyAPI_FUNC(void) _PyTrash_end(PyThreadState *tstate); +/* Python 3.10 private API, invoked by the Py_TRASHCAN_BEGIN(). */ +PyAPI_FUNC(int) _PyTrash_cond(PyObject *op, destructor dealloc); + +#define Py_TRASHCAN_BEGIN_CONDITION(op, cond) \ + do { \ + PyThreadState *_tstate = NULL; \ + /* If "cond" is false, then _tstate remains NULL and the deallocator \ + * is run normally without involving the trashcan */ \ + if (cond) { \ + _tstate = PyThreadState_Get(); \ + if (_PyTrash_begin(_tstate, _PyObject_CAST(op))) { \ + break; \ + } \ + } + /* The body of the deallocator is here. */ +#define Py_TRASHCAN_END \ + if (_tstate) { \ + _PyTrash_end(_tstate); \ + } \ + } while (0); + +#define Py_TRASHCAN_BEGIN(op, dealloc) \ + Py_TRASHCAN_BEGIN_CONDITION(op, \ + _PyTrash_cond(_PyObject_CAST(op), (destructor)dealloc)) + +/* The following two macros, Py_TRASHCAN_SAFE_BEGIN and + * Py_TRASHCAN_SAFE_END, are deprecated since version 3.11 and + * will be removed in the future. + * Use Py_TRASHCAN_BEGIN and Py_TRASHCAN_END instead. + */ +Py_DEPRECATED(3.11) typedef int UsingDeprecatedTrashcanMacro; +#define Py_TRASHCAN_SAFE_BEGIN(op) \ + do { \ + UsingDeprecatedTrashcanMacro cond=1; \ + Py_TRASHCAN_BEGIN_CONDITION(op, cond); +#define Py_TRASHCAN_SAFE_END(op) \ + Py_TRASHCAN_END; \ + } while(0); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/objimpl.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/objimpl.h new file mode 100644 index 0000000000000000000000000000000000000000..d7c76eab5c7312e4126af6ef5e773dc7cdaaf887 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/objimpl.h @@ -0,0 +1,89 @@ +#ifndef Py_CPYTHON_OBJIMPL_H +# error "this header file must not be included directly" +#endif + +#define _PyObject_SIZE(typeobj) ( (typeobj)->tp_basicsize ) + +/* _PyObject_VAR_SIZE returns the number of bytes (as size_t) allocated for a + vrbl-size object with nitems items, exclusive of gc overhead (if any). The + value is rounded up to the closest multiple of sizeof(void *), in order to + ensure that pointer fields at the end of the object are correctly aligned + for the platform (this is of special importance for subclasses of, e.g., + str or int, so that pointers can be stored after the embedded data). + + Note that there's no memory wastage in doing this, as malloc has to + return (at worst) pointer-aligned memory anyway. +*/ +#if ((SIZEOF_VOID_P - 1) & SIZEOF_VOID_P) != 0 +# error "_PyObject_VAR_SIZE requires SIZEOF_VOID_P be a power of 2" +#endif + +#define _PyObject_VAR_SIZE(typeobj, nitems) \ + _Py_SIZE_ROUND_UP((typeobj)->tp_basicsize + \ + (nitems)*(typeobj)->tp_itemsize, \ + SIZEOF_VOID_P) + + +/* This example code implements an object constructor with a custom + allocator, where PyObject_New is inlined, and shows the important + distinction between two steps (at least): + 1) the actual allocation of the object storage; + 2) the initialization of the Python specific fields + in this storage with PyObject_{Init, InitVar}. + + PyObject * + YourObject_New(...) + { + PyObject *op; + + op = (PyObject *) Your_Allocator(_PyObject_SIZE(YourTypeStruct)); + if (op == NULL) { + return PyErr_NoMemory(); + } + + PyObject_Init(op, &YourTypeStruct); + + op->ob_field = value; + ... + return op; + } + + Note that in C++, the use of the new operator usually implies that + the 1st step is performed automatically for you, so in a C++ class + constructor you would start directly with PyObject_Init/InitVar. */ + + +typedef struct { + /* user context passed as the first argument to the 2 functions */ + void *ctx; + + /* allocate an arena of size bytes */ + void* (*alloc) (void *ctx, size_t size); + + /* free an arena */ + void (*free) (void *ctx, void *ptr, size_t size); +} PyObjectArenaAllocator; + +/* Get the arena allocator. */ +PyAPI_FUNC(void) PyObject_GetArenaAllocator(PyObjectArenaAllocator *allocator); + +/* Set the arena allocator. */ +PyAPI_FUNC(void) PyObject_SetArenaAllocator(PyObjectArenaAllocator *allocator); + + +/* Test if an object implements the garbage collector protocol */ +PyAPI_FUNC(int) PyObject_IS_GC(PyObject *obj); + + +/* Code built with Py_BUILD_CORE must include pycore_gc.h instead which + defines a different _PyGC_FINALIZED() macro. */ +#ifndef Py_BUILD_CORE + // Kept for backward compatibility with Python 3.8 +# define _PyGC_FINALIZED(o) PyObject_GC_IsFinalized(o) +#endif + + +// Test if a type supports weak references +PyAPI_FUNC(int) PyType_SUPPORTS_WEAKREFS(PyTypeObject *type); + +PyAPI_FUNC(PyObject **) PyObject_GET_WEAKREFS_LISTPTR(PyObject *op); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/odictobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/odictobject.h new file mode 100644 index 0000000000000000000000000000000000000000..e070413017d801c8c41d430cfb8431371987bf45 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/odictobject.h @@ -0,0 +1,43 @@ +#ifndef Py_ODICTOBJECT_H +#define Py_ODICTOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + + +/* OrderedDict */ +/* This API is optional and mostly redundant. */ + +#ifndef Py_LIMITED_API + +typedef struct _odictobject PyODictObject; + +PyAPI_DATA(PyTypeObject) PyODict_Type; +PyAPI_DATA(PyTypeObject) PyODictIter_Type; +PyAPI_DATA(PyTypeObject) PyODictKeys_Type; +PyAPI_DATA(PyTypeObject) PyODictItems_Type; +PyAPI_DATA(PyTypeObject) PyODictValues_Type; + +#define PyODict_Check(op) PyObject_TypeCheck(op, &PyODict_Type) +#define PyODict_CheckExact(op) Py_IS_TYPE(op, &PyODict_Type) +#define PyODict_SIZE(op) PyDict_GET_SIZE((op)) + +PyAPI_FUNC(PyObject *) PyODict_New(void); +PyAPI_FUNC(int) PyODict_SetItem(PyObject *od, PyObject *key, PyObject *item); +PyAPI_FUNC(int) PyODict_DelItem(PyObject *od, PyObject *key); + +/* wrappers around PyDict* functions */ +#define PyODict_GetItem(od, key) PyDict_GetItem(_PyObject_CAST(od), key) +#define PyODict_GetItemWithError(od, key) \ + PyDict_GetItemWithError(_PyObject_CAST(od), key) +#define PyODict_Contains(od, key) PyDict_Contains(_PyObject_CAST(od), key) +#define PyODict_Size(od) PyDict_Size(_PyObject_CAST(od)) +#define PyODict_GetItemString(od, key) \ + PyDict_GetItemString(_PyObject_CAST(od), key) + +#endif + +#ifdef __cplusplus +} +#endif +#endif /* !Py_ODICTOBJECT_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/picklebufobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/picklebufobject.h new file mode 100644 index 0000000000000000000000000000000000000000..0df2561dceaea04a9942b2aae18762dfc2fe806d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/picklebufobject.h @@ -0,0 +1,31 @@ +/* PickleBuffer object. This is built-in for ease of use from third-party + * C extensions. + */ + +#ifndef Py_PICKLEBUFOBJECT_H +#define Py_PICKLEBUFOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_LIMITED_API + +PyAPI_DATA(PyTypeObject) PyPickleBuffer_Type; + +#define PyPickleBuffer_Check(op) Py_IS_TYPE(op, &PyPickleBuffer_Type) + +/* Create a PickleBuffer redirecting to the given buffer-enabled object */ +PyAPI_FUNC(PyObject *) PyPickleBuffer_FromObject(PyObject *); +/* Get the PickleBuffer's underlying view to the original object + * (NULL if released) + */ +PyAPI_FUNC(const Py_buffer *) PyPickleBuffer_GetBuffer(PyObject *); +/* Release the PickleBuffer. Returns 0 on success, -1 on error. */ +PyAPI_FUNC(int) PyPickleBuffer_Release(PyObject *); + +#endif /* !Py_LIMITED_API */ + +#ifdef __cplusplus +} +#endif +#endif /* !Py_PICKLEBUFOBJECT_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pthread_stubs.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pthread_stubs.h new file mode 100644 index 0000000000000000000000000000000000000000..d95ee03d8308ce47a63c8f424bd71b0316b7f889 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pthread_stubs.h @@ -0,0 +1,88 @@ +#ifndef Py_CPYTHON_PTRHEAD_STUBS_H +#define Py_CPYTHON_PTRHEAD_STUBS_H + +#if !defined(HAVE_PTHREAD_STUBS) +# error "this header file requires stubbed pthreads." +#endif + +#ifndef _POSIX_THREADS +# define _POSIX_THREADS 1 +#endif + +/* Minimal pthread stubs for CPython. + * + * The stubs implement the minimum pthread API for CPython. + * - pthread_create() fails. + * - pthread_exit() calls exit(0). + * - pthread_key_*() functions implement minimal TSS without destructor. + * - all other functions do nothing and return 0. + */ + +#ifdef __wasi__ +// WASI's bits/alltypes.h provides type definitions when __NEED_ is set. +// The header file can be included multiple times. +# define __NEED_pthread_cond_t 1 +# define __NEED_pthread_condattr_t 1 +# define __NEED_pthread_mutex_t 1 +# define __NEED_pthread_mutexattr_t 1 +# define __NEED_pthread_key_t 1 +# define __NEED_pthread_t 1 +# define __NEED_pthread_attr_t 1 +# include +#else +typedef struct { void *__x; } pthread_cond_t; +typedef struct { unsigned __attr; } pthread_condattr_t; +typedef struct { void *__x; } pthread_mutex_t; +typedef struct { unsigned __attr; } pthread_mutexattr_t; +typedef unsigned pthread_key_t; +typedef unsigned pthread_t; +typedef struct { unsigned __attr; } pthread_attr_t; +#endif + +// mutex +PyAPI_FUNC(int) pthread_mutex_init(pthread_mutex_t *restrict mutex, + const pthread_mutexattr_t *restrict attr); +PyAPI_FUNC(int) pthread_mutex_destroy(pthread_mutex_t *mutex); +PyAPI_FUNC(int) pthread_mutex_trylock(pthread_mutex_t *mutex); +PyAPI_FUNC(int) pthread_mutex_lock(pthread_mutex_t *mutex); +PyAPI_FUNC(int) pthread_mutex_unlock(pthread_mutex_t *mutex); + +// condition +PyAPI_FUNC(int) pthread_cond_init(pthread_cond_t *restrict cond, + const pthread_condattr_t *restrict attr); +PyAPI_FUNC(int) pthread_cond_destroy(pthread_cond_t *cond); +PyAPI_FUNC(int) pthread_cond_wait(pthread_cond_t *restrict cond, + pthread_mutex_t *restrict mutex); +PyAPI_FUNC(int) pthread_cond_timedwait(pthread_cond_t *restrict cond, + pthread_mutex_t *restrict mutex, + const struct timespec *restrict abstime); +PyAPI_FUNC(int) pthread_cond_signal(pthread_cond_t *cond); +PyAPI_FUNC(int) pthread_condattr_init(pthread_condattr_t *attr); +PyAPI_FUNC(int) pthread_condattr_setclock( + pthread_condattr_t *attr, clockid_t clock_id); + +// pthread +PyAPI_FUNC(int) pthread_create(pthread_t *restrict thread, + const pthread_attr_t *restrict attr, + void *(*start_routine)(void *), + void *restrict arg); +PyAPI_FUNC(int) pthread_detach(pthread_t thread); +PyAPI_FUNC(pthread_t) pthread_self(void); +PyAPI_FUNC(int) pthread_exit(void *retval) __attribute__ ((__noreturn__)); +PyAPI_FUNC(int) pthread_attr_init(pthread_attr_t *attr); +PyAPI_FUNC(int) pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize); +PyAPI_FUNC(int) pthread_attr_destroy(pthread_attr_t *attr); + + +// pthread_key +#ifndef PTHREAD_KEYS_MAX +# define PTHREAD_KEYS_MAX 128 +#endif + +PyAPI_FUNC(int) pthread_key_create(pthread_key_t *key, + void (*destr_function)(void *)); +PyAPI_FUNC(int) pthread_key_delete(pthread_key_t key); +PyAPI_FUNC(void *) pthread_getspecific(pthread_key_t key); +PyAPI_FUNC(int) pthread_setspecific(pthread_key_t key, const void *value); + +#endif // Py_CPYTHON_PTRHEAD_STUBS_H diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pyctype.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pyctype.h new file mode 100644 index 0000000000000000000000000000000000000000..729d93275e6c5365fb26fd521b1ff58de22b5fdb --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pyctype.h @@ -0,0 +1,39 @@ +#ifndef Py_LIMITED_API +#ifndef PYCTYPE_H +#define PYCTYPE_H +#ifdef __cplusplus +extern "C" { +#endif + +#define PY_CTF_LOWER 0x01 +#define PY_CTF_UPPER 0x02 +#define PY_CTF_ALPHA (PY_CTF_LOWER|PY_CTF_UPPER) +#define PY_CTF_DIGIT 0x04 +#define PY_CTF_ALNUM (PY_CTF_ALPHA|PY_CTF_DIGIT) +#define PY_CTF_SPACE 0x08 +#define PY_CTF_XDIGIT 0x10 + +PyAPI_DATA(const unsigned int) _Py_ctype_table[256]; + +/* Unlike their C counterparts, the following macros are not meant to + * handle an int with any of the values [EOF, 0-UCHAR_MAX]. The argument + * must be a signed/unsigned char. */ +#define Py_ISLOWER(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_LOWER) +#define Py_ISUPPER(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_UPPER) +#define Py_ISALPHA(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_ALPHA) +#define Py_ISDIGIT(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_DIGIT) +#define Py_ISXDIGIT(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_XDIGIT) +#define Py_ISALNUM(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_ALNUM) +#define Py_ISSPACE(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_SPACE) + +PyAPI_DATA(const unsigned char) _Py_ctype_tolower[256]; +PyAPI_DATA(const unsigned char) _Py_ctype_toupper[256]; + +#define Py_TOLOWER(c) (_Py_ctype_tolower[Py_CHARMASK(c)]) +#define Py_TOUPPER(c) (_Py_ctype_toupper[Py_CHARMASK(c)]) + +#ifdef __cplusplus +} +#endif +#endif /* !PYCTYPE_H */ +#endif /* !Py_LIMITED_API */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pydebug.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pydebug.h new file mode 100644 index 0000000000000000000000000000000000000000..cab799f0b38e0c42f2fb2896c02b05d866b2d50a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pydebug.h @@ -0,0 +1,38 @@ +#ifndef Py_LIMITED_API +#ifndef Py_PYDEBUG_H +#define Py_PYDEBUG_H +#ifdef __cplusplus +extern "C" { +#endif + +PyAPI_DATA(int) Py_DebugFlag; +PyAPI_DATA(int) Py_VerboseFlag; +PyAPI_DATA(int) Py_QuietFlag; +PyAPI_DATA(int) Py_InteractiveFlag; +PyAPI_DATA(int) Py_InspectFlag; +PyAPI_DATA(int) Py_OptimizeFlag; +PyAPI_DATA(int) Py_NoSiteFlag; +PyAPI_DATA(int) Py_BytesWarningFlag; +PyAPI_DATA(int) Py_FrozenFlag; +PyAPI_DATA(int) Py_IgnoreEnvironmentFlag; +PyAPI_DATA(int) Py_DontWriteBytecodeFlag; +PyAPI_DATA(int) Py_NoUserSiteDirectory; +PyAPI_DATA(int) Py_UnbufferedStdioFlag; +PyAPI_DATA(int) Py_HashRandomizationFlag; +PyAPI_DATA(int) Py_IsolatedFlag; + +#ifdef MS_WINDOWS +PyAPI_DATA(int) Py_LegacyWindowsFSEncodingFlag; +PyAPI_DATA(int) Py_LegacyWindowsStdioFlag; +#endif + +/* this is a wrapper around getenv() that pays attention to + Py_IgnoreEnvironmentFlag. It should be used for getting variables like + PYTHONPATH and PYTHONHOME from the environment */ +PyAPI_DATA(char*) Py_GETENV(const char *name); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_PYDEBUG_H */ +#endif /* Py_LIMITED_API */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pyerrors.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pyerrors.h new file mode 100644 index 0000000000000000000000000000000000000000..47d80e3242302d4b55e7d0673c07ba09efd8d836 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pyerrors.h @@ -0,0 +1,179 @@ +#ifndef Py_CPYTHON_ERRORS_H +# error "this header file must not be included directly" +#endif + +/* Error objects */ + +/* PyException_HEAD defines the initial segment of every exception class. */ +#define PyException_HEAD PyObject_HEAD PyObject *dict;\ + PyObject *args; PyObject *notes; PyObject *traceback;\ + PyObject *context; PyObject *cause;\ + char suppress_context; + +typedef struct { + PyException_HEAD +} PyBaseExceptionObject; + +typedef struct { + PyException_HEAD + PyObject *msg; + PyObject *excs; +} PyBaseExceptionGroupObject; + +typedef struct { + PyException_HEAD + PyObject *msg; + PyObject *filename; + PyObject *lineno; + PyObject *offset; + PyObject *end_lineno; + PyObject *end_offset; + PyObject *text; + PyObject *print_file_and_line; +} PySyntaxErrorObject; + +typedef struct { + PyException_HEAD + PyObject *msg; + PyObject *name; + PyObject *path; +} PyImportErrorObject; + +typedef struct { + PyException_HEAD + PyObject *encoding; + PyObject *object; + Py_ssize_t start; + Py_ssize_t end; + PyObject *reason; +} PyUnicodeErrorObject; + +typedef struct { + PyException_HEAD + PyObject *code; +} PySystemExitObject; + +typedef struct { + PyException_HEAD + PyObject *myerrno; + PyObject *strerror; + PyObject *filename; + PyObject *filename2; +#ifdef MS_WINDOWS + PyObject *winerror; +#endif + Py_ssize_t written; /* only for BlockingIOError, -1 otherwise */ +} PyOSErrorObject; + +typedef struct { + PyException_HEAD + PyObject *value; +} PyStopIterationObject; + +typedef struct { + PyException_HEAD + PyObject *name; +} PyNameErrorObject; + +typedef struct { + PyException_HEAD + PyObject *obj; + PyObject *name; +} PyAttributeErrorObject; + +/* Compatibility typedefs */ +typedef PyOSErrorObject PyEnvironmentErrorObject; +#ifdef MS_WINDOWS +typedef PyOSErrorObject PyWindowsErrorObject; +#endif + +/* Error handling definitions */ + +PyAPI_FUNC(void) _PyErr_SetKeyError(PyObject *); +PyAPI_FUNC(_PyErr_StackItem*) _PyErr_GetTopmostException(PyThreadState *tstate); +PyAPI_FUNC(PyObject*) _PyErr_GetHandledException(PyThreadState *); +PyAPI_FUNC(void) _PyErr_SetHandledException(PyThreadState *, PyObject *); +PyAPI_FUNC(void) _PyErr_GetExcInfo(PyThreadState *, PyObject **, PyObject **, PyObject **); + +/* Context manipulation (PEP 3134) */ + +PyAPI_FUNC(void) _PyErr_ChainExceptions(PyObject *, PyObject *, PyObject *); + +/* Like PyErr_Format(), but saves current exception as __context__ and + __cause__. + */ +PyAPI_FUNC(PyObject *) _PyErr_FormatFromCause( + PyObject *exception, + const char *format, /* ASCII-encoded string */ + ... + ); + +/* In exceptions.c */ + +/* Helper that attempts to replace the current exception with one of the + * same type but with a prefix added to the exception text. The resulting + * exception description looks like: + * + * prefix (exc_type: original_exc_str) + * + * Only some exceptions can be safely replaced. If the function determines + * it isn't safe to perform the replacement, it will leave the original + * unmodified exception in place. + * + * Returns a borrowed reference to the new exception (if any), NULL if the + * existing exception was left in place. + */ +PyAPI_FUNC(PyObject *) _PyErr_TrySetFromCause( + const char *prefix_format, /* ASCII-encoded string */ + ... + ); + +/* In signalmodule.c */ + +int PySignal_SetWakeupFd(int fd); +PyAPI_FUNC(int) _PyErr_CheckSignals(void); + +/* Support for adding program text to SyntaxErrors */ + +PyAPI_FUNC(void) PyErr_SyntaxLocationObject( + PyObject *filename, + int lineno, + int col_offset); + +PyAPI_FUNC(void) PyErr_RangedSyntaxLocationObject( + PyObject *filename, + int lineno, + int col_offset, + int end_lineno, + int end_col_offset); + +PyAPI_FUNC(PyObject *) PyErr_ProgramTextObject( + PyObject *filename, + int lineno); + +PyAPI_FUNC(PyObject *) _PyErr_ProgramDecodedTextObject( + PyObject *filename, + int lineno, + const char* encoding); + +PyAPI_FUNC(PyObject *) _PyUnicodeTranslateError_Create( + PyObject *object, + Py_ssize_t start, + Py_ssize_t end, + const char *reason /* UTF-8 encoded string */ + ); + +PyAPI_FUNC(void) _PyErr_WriteUnraisableMsg( + const char *err_msg, + PyObject *obj); + +PyAPI_FUNC(void) _Py_NO_RETURN _Py_FatalErrorFunc( + const char *func, + const char *message); + +PyAPI_FUNC(void) _Py_NO_RETURN _Py_FatalErrorFormat( + const char *func, + const char *format, + ...); + +#define Py_FatalError(message) _Py_FatalErrorFunc(__func__, message) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pyfpe.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pyfpe.h new file mode 100644 index 0000000000000000000000000000000000000000..cc2def63aa5527f4ac192aa663a14353a88e1774 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pyfpe.h @@ -0,0 +1,15 @@ +#ifndef Py_PYFPE_H +#define Py_PYFPE_H +/* Header excluded from the stable API */ +#ifndef Py_LIMITED_API + +/* These macros used to do something when Python was built with --with-fpectl, + * but support for that was dropped in 3.7. We continue to define them though, + * to avoid breaking API users. + */ + +#define PyFPE_START_PROTECT(err_string, leave_stmt) +#define PyFPE_END_PROTECT(v) + +#endif /* !defined(Py_LIMITED_API) */ +#endif /* !Py_PYFPE_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pyframe.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pyframe.h new file mode 100644 index 0000000000000000000000000000000000000000..1dc634ccee9a27afd1bd038370f50c867f8fef81 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pyframe.h @@ -0,0 +1,17 @@ +#ifndef Py_CPYTHON_PYFRAME_H +# error "this header file must not be included directly" +#endif + +PyAPI_DATA(PyTypeObject) PyFrame_Type; + +#define PyFrame_Check(op) Py_IS_TYPE((op), &PyFrame_Type) + +PyAPI_FUNC(PyFrameObject *) PyFrame_GetBack(PyFrameObject *frame); +PyAPI_FUNC(PyObject *) PyFrame_GetLocals(PyFrameObject *frame); + +PyAPI_FUNC(PyObject *) PyFrame_GetGlobals(PyFrameObject *frame); +PyAPI_FUNC(PyObject *) PyFrame_GetBuiltins(PyFrameObject *frame); + +PyAPI_FUNC(PyObject *) PyFrame_GetGenerator(PyFrameObject *frame); +PyAPI_FUNC(int) PyFrame_GetLasti(PyFrameObject *frame); + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pylifecycle.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pylifecycle.h new file mode 100644 index 0000000000000000000000000000000000000000..bb5b07ef5901c82c2df0e5c965166b6fe56609b1 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pylifecycle.h @@ -0,0 +1,65 @@ +#ifndef Py_CPYTHON_PYLIFECYCLE_H +# error "this header file must not be included directly" +#endif + +/* Py_FrozenMain is kept out of the Limited API until documented and present + in all builds of Python */ +PyAPI_FUNC(int) Py_FrozenMain(int argc, char **argv); + +/* Only used by applications that embed the interpreter and need to + * override the standard encoding determination mechanism + */ +Py_DEPRECATED(3.11) PyAPI_FUNC(int) Py_SetStandardStreamEncoding( + const char *encoding, + const char *errors); + +/* PEP 432 Multi-phase initialization API (Private while provisional!) */ + +PyAPI_FUNC(PyStatus) Py_PreInitialize( + const PyPreConfig *src_config); +PyAPI_FUNC(PyStatus) Py_PreInitializeFromBytesArgs( + const PyPreConfig *src_config, + Py_ssize_t argc, + char **argv); +PyAPI_FUNC(PyStatus) Py_PreInitializeFromArgs( + const PyPreConfig *src_config, + Py_ssize_t argc, + wchar_t **argv); + +PyAPI_FUNC(int) _Py_IsCoreInitialized(void); + + +/* Initialization and finalization */ + +PyAPI_FUNC(PyStatus) Py_InitializeFromConfig( + const PyConfig *config); +PyAPI_FUNC(PyStatus) _Py_InitializeMain(void); + +PyAPI_FUNC(int) Py_RunMain(void); + + +PyAPI_FUNC(void) _Py_NO_RETURN Py_ExitStatusException(PyStatus err); + +/* Restore signals that the interpreter has called SIG_IGN on to SIG_DFL. */ +PyAPI_FUNC(void) _Py_RestoreSignals(void); + +PyAPI_FUNC(int) Py_FdIsInteractive(FILE *, const char *); +PyAPI_FUNC(int) _Py_FdIsInteractive(FILE *fp, PyObject *filename); + +Py_DEPRECATED(3.11) PyAPI_FUNC(void) _Py_SetProgramFullPath(const wchar_t *); + +PyAPI_FUNC(const char *) _Py_gitidentifier(void); +PyAPI_FUNC(const char *) _Py_gitversion(void); + +PyAPI_FUNC(int) _Py_IsFinalizing(void); + +/* Random */ +PyAPI_FUNC(int) _PyOS_URandom(void *buffer, Py_ssize_t size); +PyAPI_FUNC(int) _PyOS_URandomNonblock(void *buffer, Py_ssize_t size); + +/* Legacy locale support */ +PyAPI_FUNC(int) _Py_CoerceLegacyLocale(int warn); +PyAPI_FUNC(int) _Py_LegacyLocaleDetected(int warn); +PyAPI_FUNC(char *) _Py_SetLocaleFromEnv(int category); + +PyAPI_FUNC(PyThreadState *) _Py_NewInterpreter(int isolated_subinterpreter); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pymem.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pymem.h new file mode 100644 index 0000000000000000000000000000000000000000..d1054d76520b9aab0f9c312340cf7dd2d5bed9be --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pymem.h @@ -0,0 +1,98 @@ +#ifndef Py_CPYTHON_PYMEM_H +# error "this header file must not be included directly" +#endif + +PyAPI_FUNC(void *) PyMem_RawMalloc(size_t size); +PyAPI_FUNC(void *) PyMem_RawCalloc(size_t nelem, size_t elsize); +PyAPI_FUNC(void *) PyMem_RawRealloc(void *ptr, size_t new_size); +PyAPI_FUNC(void) PyMem_RawFree(void *ptr); + +/* Try to get the allocators name set by _PyMem_SetupAllocators(). */ +PyAPI_FUNC(const char*) _PyMem_GetCurrentAllocatorName(void); + +/* strdup() using PyMem_RawMalloc() */ +PyAPI_FUNC(char *) _PyMem_RawStrdup(const char *str); + +/* strdup() using PyMem_Malloc() */ +PyAPI_FUNC(char *) _PyMem_Strdup(const char *str); + +/* wcsdup() using PyMem_RawMalloc() */ +PyAPI_FUNC(wchar_t*) _PyMem_RawWcsdup(const wchar_t *str); + + +typedef enum { + /* PyMem_RawMalloc(), PyMem_RawRealloc() and PyMem_RawFree() */ + PYMEM_DOMAIN_RAW, + + /* PyMem_Malloc(), PyMem_Realloc() and PyMem_Free() */ + PYMEM_DOMAIN_MEM, + + /* PyObject_Malloc(), PyObject_Realloc() and PyObject_Free() */ + PYMEM_DOMAIN_OBJ +} PyMemAllocatorDomain; + +typedef enum { + PYMEM_ALLOCATOR_NOT_SET = 0, + PYMEM_ALLOCATOR_DEFAULT = 1, + PYMEM_ALLOCATOR_DEBUG = 2, + PYMEM_ALLOCATOR_MALLOC = 3, + PYMEM_ALLOCATOR_MALLOC_DEBUG = 4, +#ifdef WITH_PYMALLOC + PYMEM_ALLOCATOR_PYMALLOC = 5, + PYMEM_ALLOCATOR_PYMALLOC_DEBUG = 6, +#endif +} PyMemAllocatorName; + + +typedef struct { + /* user context passed as the first argument to the 4 functions */ + void *ctx; + + /* allocate a memory block */ + void* (*malloc) (void *ctx, size_t size); + + /* allocate a memory block initialized by zeros */ + void* (*calloc) (void *ctx, size_t nelem, size_t elsize); + + /* allocate or resize a memory block */ + void* (*realloc) (void *ctx, void *ptr, size_t new_size); + + /* release a memory block */ + void (*free) (void *ctx, void *ptr); +} PyMemAllocatorEx; + +/* Get the memory block allocator of the specified domain. */ +PyAPI_FUNC(void) PyMem_GetAllocator(PyMemAllocatorDomain domain, + PyMemAllocatorEx *allocator); + +/* Set the memory block allocator of the specified domain. + + The new allocator must return a distinct non-NULL pointer when requesting + zero bytes. + + For the PYMEM_DOMAIN_RAW domain, the allocator must be thread-safe: the GIL + is not held when the allocator is called. + + If the new allocator is not a hook (don't call the previous allocator), the + PyMem_SetupDebugHooks() function must be called to reinstall the debug hooks + on top on the new allocator. */ +PyAPI_FUNC(void) PyMem_SetAllocator(PyMemAllocatorDomain domain, + PyMemAllocatorEx *allocator); + +/* Setup hooks to detect bugs in the following Python memory allocator + functions: + + - PyMem_RawMalloc(), PyMem_RawRealloc(), PyMem_RawFree() + - PyMem_Malloc(), PyMem_Realloc(), PyMem_Free() + - PyObject_Malloc(), PyObject_Realloc() and PyObject_Free() + + Newly allocated memory is filled with the byte 0xCB, freed memory is filled + with the byte 0xDB. Additional checks: + + - detect API violations, ex: PyObject_Free() called on a buffer allocated + by PyMem_Malloc() + - detect write before the start of the buffer (buffer underflow) + - detect write after the end of the buffer (buffer overflow) + + The function does nothing if Python is not compiled is debug mode. */ +PyAPI_FUNC(void) PyMem_SetupDebugHooks(void); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pystate.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pystate.h new file mode 100644 index 0000000000000000000000000000000000000000..2bd46067cbbe18717f01d2a9f5f87d631dc32f5d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pystate.h @@ -0,0 +1,366 @@ +#ifndef Py_CPYTHON_PYSTATE_H +# error "this header file must not be included directly" +#endif + + +PyAPI_FUNC(int) _PyInterpreterState_RequiresIDRef(PyInterpreterState *); +PyAPI_FUNC(void) _PyInterpreterState_RequireIDRef(PyInterpreterState *, int); + +PyAPI_FUNC(PyObject *) _PyInterpreterState_GetMainModule(PyInterpreterState *); + +/* State unique per thread */ + +/* Py_tracefunc return -1 when raising an exception, or 0 for success. */ +typedef int (*Py_tracefunc)(PyObject *, PyFrameObject *, int, PyObject *); + +/* The following values are used for 'what' for tracefunc functions + * + * To add a new kind of trace event, also update "trace_init" in + * Python/sysmodule.c to define the Python level event name + */ +#define PyTrace_CALL 0 +#define PyTrace_EXCEPTION 1 +#define PyTrace_LINE 2 +#define PyTrace_RETURN 3 +#define PyTrace_C_CALL 4 +#define PyTrace_C_EXCEPTION 5 +#define PyTrace_C_RETURN 6 +#define PyTrace_OPCODE 7 + + +typedef struct { + PyCodeObject *code; // The code object for the bounds. May be NULL. + PyCodeAddressRange bounds; // Only valid if code != NULL. +} PyTraceInfo; + +// Internal structure: you should not use it directly, but use public functions +// like PyThreadState_EnterTracing() and PyThreadState_LeaveTracing(). +typedef struct _PyCFrame { + /* This struct will be threaded through the C stack + * allowing fast access to per-thread state that needs + * to be accessed quickly by the interpreter, but can + * be modified outside of the interpreter. + * + * WARNING: This makes data on the C stack accessible from + * heap objects. Care must be taken to maintain stack + * discipline and make sure that instances of this struct cannot + * accessed outside of their lifetime. + */ + uint8_t use_tracing; // 0 or 255 (or'ed into opcode, hence 8-bit type) + /* Pointer to the currently executing frame (it can be NULL) */ + struct _PyInterpreterFrame *current_frame; + struct _PyCFrame *previous; +} _PyCFrame; + +typedef struct _err_stackitem { + /* This struct represents a single execution context where we might + * be currently handling an exception. It is a per-coroutine state + * (coroutine in the computer science sense, including the thread + * and generators). + * + * This is used as an entry on the exception stack, where each + * entry indicates if it is currently handling an exception. + * This ensures that the exception state is not impacted + * by "yields" from an except handler. The thread + * always has an entry (the bottom-most one). + */ + + /* The exception currently being handled in this context, if any. */ + PyObject *exc_value; + + struct _err_stackitem *previous_item; + +} _PyErr_StackItem; + +typedef struct _stack_chunk { + struct _stack_chunk *previous; + size_t size; + size_t top; + PyObject * data[1]; /* Variable sized */ +} _PyStackChunk; + +struct _ts { + /* See Python/ceval.c for comments explaining most fields */ + + PyThreadState *prev; + PyThreadState *next; + PyInterpreterState *interp; + + /* Has been initialized to a safe state. + + In order to be effective, this must be set to 0 during or right + after allocation. */ + int _initialized; + + /* Was this thread state statically allocated? */ + int _static; + + int recursion_remaining; + int recursion_limit; + int recursion_headroom; /* Allow 50 more calls to handle any errors. */ + + /* 'tracing' keeps track of the execution depth when tracing/profiling. + This is to prevent the actual trace/profile code from being recorded in + the trace/profile. */ + int tracing; + int tracing_what; /* The event currently being traced, if any. */ + + /* Pointer to current _PyCFrame in the C stack frame of the currently, + * or most recently, executing _PyEval_EvalFrameDefault. */ + _PyCFrame *cframe; + + Py_tracefunc c_profilefunc; + Py_tracefunc c_tracefunc; + PyObject *c_profileobj; + PyObject *c_traceobj; + + /* The exception currently being raised */ + PyObject *curexc_type; + PyObject *curexc_value; + PyObject *curexc_traceback; + + /* Pointer to the top of the exception stack for the exceptions + * we may be currently handling. (See _PyErr_StackItem above.) + * This is never NULL. */ + _PyErr_StackItem *exc_info; + + PyObject *dict; /* Stores per-thread state */ + + int gilstate_counter; + + PyObject *async_exc; /* Asynchronous exception to raise */ + unsigned long thread_id; /* Thread id where this tstate was created */ + + /* Native thread id where this tstate was created. This will be 0 except on + * those platforms that have the notion of native thread id, for which the + * macro PY_HAVE_THREAD_NATIVE_ID is then defined. + */ + unsigned long native_thread_id; + + int trash_delete_nesting; + PyObject *trash_delete_later; + + /* Called when a thread state is deleted normally, but not when it + * is destroyed after fork(). + * Pain: to prevent rare but fatal shutdown errors (issue 18808), + * Thread.join() must wait for the join'ed thread's tstate to be unlinked + * from the tstate chain. That happens at the end of a thread's life, + * in pystate.c. + * The obvious way doesn't quite work: create a lock which the tstate + * unlinking code releases, and have Thread.join() wait to acquire that + * lock. The problem is that we _are_ at the end of the thread's life: + * if the thread holds the last reference to the lock, decref'ing the + * lock will delete the lock, and that may trigger arbitrary Python code + * if there's a weakref, with a callback, to the lock. But by this time + * _PyRuntime.gilstate.tstate_current is already NULL, so only the simplest + * of C code can be allowed to run (in particular it must not be possible to + * release the GIL). + * So instead of holding the lock directly, the tstate holds a weakref to + * the lock: that's the value of on_delete_data below. Decref'ing a + * weakref is harmless. + * on_delete points to _threadmodule.c's static release_sentinel() function. + * After the tstate is unlinked, release_sentinel is called with the + * weakref-to-lock (on_delete_data) argument, and release_sentinel releases + * the indirectly held lock. + */ + void (*on_delete)(void *); + void *on_delete_data; + + int coroutine_origin_tracking_depth; + + PyObject *async_gen_firstiter; + PyObject *async_gen_finalizer; + + PyObject *context; + uint64_t context_ver; + + /* Unique thread state id. */ + uint64_t id; + + PyTraceInfo trace_info; + + _PyStackChunk *datastack_chunk; + PyObject **datastack_top; + PyObject **datastack_limit; + /* XXX signal handlers should also be here */ + + /* The following fields are here to avoid allocation during init. + The data is exposed through PyThreadState pointer fields. + These fields should not be accessed directly outside of init. + This is indicated by an underscore prefix on the field names. + + All other PyInterpreterState pointer fields are populated when + needed and default to NULL. + */ + // Note some fields do not have a leading underscore for backward + // compatibility. See https://bugs.python.org/issue45953#msg412046. + + /* The thread's exception stack entry. (Always the last entry.) */ + _PyErr_StackItem exc_state; + + /* The bottom-most frame on the stack. */ + _PyCFrame root_cframe; +}; + + +/* other API */ + +// Alias for backward compatibility with Python 3.8 +#define _PyInterpreterState_Get PyInterpreterState_Get + +PyAPI_FUNC(PyThreadState *) _PyThreadState_Prealloc(PyInterpreterState *); + +/* Similar to PyThreadState_Get(), but don't issue a fatal error + * if it is NULL. */ +PyAPI_FUNC(PyThreadState *) _PyThreadState_UncheckedGet(void); + +PyAPI_FUNC(PyObject *) _PyThreadState_GetDict(PyThreadState *tstate); + +// Disable tracing and profiling. +PyAPI_FUNC(void) PyThreadState_EnterTracing(PyThreadState *tstate); + +// Reset tracing and profiling: enable them if a trace function or a profile +// function is set, otherwise disable them. +PyAPI_FUNC(void) PyThreadState_LeaveTracing(PyThreadState *tstate); + +/* PyGILState */ + +/* Helper/diagnostic function - return 1 if the current thread + currently holds the GIL, 0 otherwise. + + The function returns 1 if _PyGILState_check_enabled is non-zero. */ +PyAPI_FUNC(int) PyGILState_Check(void); + +/* Get the single PyInterpreterState used by this process' GILState + implementation. + + This function doesn't check for error. Return NULL before _PyGILState_Init() + is called and after _PyGILState_Fini() is called. + + See also _PyInterpreterState_Get() and _PyInterpreterState_GET(). */ +PyAPI_FUNC(PyInterpreterState *) _PyGILState_GetInterpreterStateUnsafe(void); + +/* The implementation of sys._current_frames() Returns a dict mapping + thread id to that thread's current frame. +*/ +PyAPI_FUNC(PyObject *) _PyThread_CurrentFrames(void); + +/* The implementation of sys._current_exceptions() Returns a dict mapping + thread id to that thread's current exception. +*/ +PyAPI_FUNC(PyObject *) _PyThread_CurrentExceptions(void); + +/* Routines for advanced debuggers, requested by David Beazley. + Don't use unless you know what you are doing! */ +PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Main(void); +PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Head(void); +PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Next(PyInterpreterState *); +PyAPI_FUNC(PyThreadState *) PyInterpreterState_ThreadHead(PyInterpreterState *); +PyAPI_FUNC(PyThreadState *) PyThreadState_Next(PyThreadState *); +PyAPI_FUNC(void) PyThreadState_DeleteCurrent(void); + +/* Frame evaluation API */ + +typedef PyObject* (*_PyFrameEvalFunction)(PyThreadState *tstate, struct _PyInterpreterFrame *, int); + +PyAPI_FUNC(_PyFrameEvalFunction) _PyInterpreterState_GetEvalFrameFunc( + PyInterpreterState *interp); +PyAPI_FUNC(void) _PyInterpreterState_SetEvalFrameFunc( + PyInterpreterState *interp, + _PyFrameEvalFunction eval_frame); + +PyAPI_FUNC(const PyConfig*) _PyInterpreterState_GetConfig(PyInterpreterState *interp); + +/* Get a copy of the current interpreter configuration. + + Return 0 on success. Raise an exception and return -1 on error. + + The caller must initialize 'config', using PyConfig_InitPythonConfig() + for example. + + Python must be preinitialized to call this method. + The caller must hold the GIL. */ +PyAPI_FUNC(int) _PyInterpreterState_GetConfigCopy( + struct PyConfig *config); + +/* Set the configuration of the current interpreter. + + This function should be called during or just after the Python + initialization. + + Update the sys module with the new configuration. If the sys module was + modified directly after the Python initialization, these changes are lost. + + Some configuration like faulthandler or warnoptions can be updated in the + configuration, but don't reconfigure Python (don't enable/disable + faulthandler and don't reconfigure warnings filters). + + Return 0 on success. Raise an exception and return -1 on error. + + The configuration should come from _PyInterpreterState_GetConfigCopy(). */ +PyAPI_FUNC(int) _PyInterpreterState_SetConfig( + const struct PyConfig *config); + +// Get the configuration of the current interpreter. +// The caller must hold the GIL. +PyAPI_FUNC(const PyConfig*) _Py_GetConfig(void); + + +/* cross-interpreter data */ + +// _PyCrossInterpreterData is similar to Py_buffer as an effectively +// opaque struct that holds data outside the object machinery. This +// is necessary to pass safely between interpreters in the same process. +typedef struct _xid _PyCrossInterpreterData; + +struct _xid { + // data is the cross-interpreter-safe derivation of a Python object + // (see _PyObject_GetCrossInterpreterData). It will be NULL if the + // new_object func (below) encodes the data. + void *data; + // obj is the Python object from which the data was derived. This + // is non-NULL only if the data remains bound to the object in some + // way, such that the object must be "released" (via a decref) when + // the data is released. In that case the code that sets the field, + // likely a registered "crossinterpdatafunc", is responsible for + // ensuring it owns the reference (i.e. incref). + PyObject *obj; + // interp is the ID of the owning interpreter of the original + // object. It corresponds to the active interpreter when + // _PyObject_GetCrossInterpreterData() was called. This should only + // be set by the cross-interpreter machinery. + // + // We use the ID rather than the PyInterpreterState to avoid issues + // with deleted interpreters. Note that IDs are never re-used, so + // each one will always correspond to a specific interpreter + // (whether still alive or not). + int64_t interp; + // new_object is a function that returns a new object in the current + // interpreter given the data. The resulting object (a new + // reference) will be equivalent to the original object. This field + // is required. + PyObject *(*new_object)(_PyCrossInterpreterData *); + // free is called when the data is released. If it is NULL then + // nothing will be done to free the data. For some types this is + // okay (e.g. bytes) and for those types this field should be set + // to NULL. However, for most the data was allocated just for + // cross-interpreter use, so it must be freed when + // _PyCrossInterpreterData_Release is called or the memory will + // leak. In that case, at the very least this field should be set + // to PyMem_RawFree (the default if not explicitly set to NULL). + // The call will happen with the original interpreter activated. + void (*free)(void *); +}; + +PyAPI_FUNC(int) _PyObject_GetCrossInterpreterData(PyObject *, _PyCrossInterpreterData *); +PyAPI_FUNC(PyObject *) _PyCrossInterpreterData_NewObject(_PyCrossInterpreterData *); +PyAPI_FUNC(void) _PyCrossInterpreterData_Release(_PyCrossInterpreterData *); + +PyAPI_FUNC(int) _PyObject_CheckCrossInterpreterData(PyObject *); + +/* cross-interpreter data registry */ + +typedef int (*crossinterpdatafunc)(PyObject *, _PyCrossInterpreterData *); + +PyAPI_FUNC(int) _PyCrossInterpreterData_RegisterClass(PyTypeObject *, crossinterpdatafunc); +PyAPI_FUNC(crossinterpdatafunc) _PyCrossInterpreterData_Lookup(PyObject *); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pythonrun.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pythonrun.h new file mode 100644 index 0000000000000000000000000000000000000000..2e72d0820d34f549f89ab0116e53c30cf8cc5635 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pythonrun.h @@ -0,0 +1,121 @@ +#ifndef Py_CPYTHON_PYTHONRUN_H +# error "this header file must not be included directly" +#endif + +PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *); +PyAPI_FUNC(int) _PyRun_SimpleFileObject( + FILE *fp, + PyObject *filename, + int closeit, + PyCompilerFlags *flags); +PyAPI_FUNC(int) PyRun_AnyFileExFlags( + FILE *fp, + const char *filename, /* decoded from the filesystem encoding */ + int closeit, + PyCompilerFlags *flags); +PyAPI_FUNC(int) _PyRun_AnyFileObject( + FILE *fp, + PyObject *filename, + int closeit, + PyCompilerFlags *flags); +PyAPI_FUNC(int) PyRun_SimpleFileExFlags( + FILE *fp, + const char *filename, /* decoded from the filesystem encoding */ + int closeit, + PyCompilerFlags *flags); +PyAPI_FUNC(int) PyRun_InteractiveOneFlags( + FILE *fp, + const char *filename, /* decoded from the filesystem encoding */ + PyCompilerFlags *flags); +PyAPI_FUNC(int) PyRun_InteractiveOneObject( + FILE *fp, + PyObject *filename, + PyCompilerFlags *flags); +PyAPI_FUNC(int) PyRun_InteractiveLoopFlags( + FILE *fp, + const char *filename, /* decoded from the filesystem encoding */ + PyCompilerFlags *flags); +PyAPI_FUNC(int) _PyRun_InteractiveLoopObject( + FILE *fp, + PyObject *filename, + PyCompilerFlags *flags); + + +PyAPI_FUNC(PyObject *) PyRun_StringFlags(const char *, int, PyObject *, + PyObject *, PyCompilerFlags *); + +PyAPI_FUNC(PyObject *) PyRun_FileExFlags( + FILE *fp, + const char *filename, /* decoded from the filesystem encoding */ + int start, + PyObject *globals, + PyObject *locals, + int closeit, + PyCompilerFlags *flags); + + +PyAPI_FUNC(PyObject *) Py_CompileStringExFlags( + const char *str, + const char *filename, /* decoded from the filesystem encoding */ + int start, + PyCompilerFlags *flags, + int optimize); +PyAPI_FUNC(PyObject *) Py_CompileStringObject( + const char *str, + PyObject *filename, int start, + PyCompilerFlags *flags, + int optimize); + +#define Py_CompileString(str, p, s) Py_CompileStringExFlags(str, p, s, NULL, -1) +#define Py_CompileStringFlags(str, p, s, f) Py_CompileStringExFlags(str, p, s, f, -1) + + +PyAPI_FUNC(const char *) _Py_SourceAsString( + PyObject *cmd, + const char *funcname, + const char *what, + PyCompilerFlags *cf, + PyObject **cmd_copy); + + +/* A function flavor is also exported by libpython. It is required when + libpython is accessed directly rather than using header files which defines + macros below. On Windows, for example, PyAPI_FUNC() uses dllexport to + export functions in pythonXX.dll. */ +PyAPI_FUNC(PyObject *) PyRun_String(const char *str, int s, PyObject *g, PyObject *l); +PyAPI_FUNC(int) PyRun_AnyFile(FILE *fp, const char *name); +PyAPI_FUNC(int) PyRun_AnyFileEx(FILE *fp, const char *name, int closeit); +PyAPI_FUNC(int) PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *); +PyAPI_FUNC(int) PyRun_SimpleString(const char *s); +PyAPI_FUNC(int) PyRun_SimpleFile(FILE *f, const char *p); +PyAPI_FUNC(int) PyRun_SimpleFileEx(FILE *f, const char *p, int c); +PyAPI_FUNC(int) PyRun_InteractiveOne(FILE *f, const char *p); +PyAPI_FUNC(int) PyRun_InteractiveLoop(FILE *f, const char *p); +PyAPI_FUNC(PyObject *) PyRun_File(FILE *fp, const char *p, int s, PyObject *g, PyObject *l); +PyAPI_FUNC(PyObject *) PyRun_FileEx(FILE *fp, const char *p, int s, PyObject *g, PyObject *l, int c); +PyAPI_FUNC(PyObject *) PyRun_FileFlags(FILE *fp, const char *p, int s, PyObject *g, PyObject *l, PyCompilerFlags *flags); + +/* Use macros for a bunch of old variants */ +#define PyRun_String(str, s, g, l) PyRun_StringFlags(str, s, g, l, NULL) +#define PyRun_AnyFile(fp, name) PyRun_AnyFileExFlags(fp, name, 0, NULL) +#define PyRun_AnyFileEx(fp, name, closeit) \ + PyRun_AnyFileExFlags(fp, name, closeit, NULL) +#define PyRun_AnyFileFlags(fp, name, flags) \ + PyRun_AnyFileExFlags(fp, name, 0, flags) +#define PyRun_SimpleString(s) PyRun_SimpleStringFlags(s, NULL) +#define PyRun_SimpleFile(f, p) PyRun_SimpleFileExFlags(f, p, 0, NULL) +#define PyRun_SimpleFileEx(f, p, c) PyRun_SimpleFileExFlags(f, p, c, NULL) +#define PyRun_InteractiveOne(f, p) PyRun_InteractiveOneFlags(f, p, NULL) +#define PyRun_InteractiveLoop(f, p) PyRun_InteractiveLoopFlags(f, p, NULL) +#define PyRun_File(fp, p, s, g, l) \ + PyRun_FileExFlags(fp, p, s, g, l, 0, NULL) +#define PyRun_FileEx(fp, p, s, g, l, c) \ + PyRun_FileExFlags(fp, p, s, g, l, c, NULL) +#define PyRun_FileFlags(fp, p, s, g, l, flags) \ + PyRun_FileExFlags(fp, p, s, g, l, 0, flags) + + +/* Stuff with no proper home (yet) */ +PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, const char *); +PyAPI_DATA(PyThreadState*) _PyOS_ReadlineTState; +PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pythread.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pythread.h new file mode 100644 index 0000000000000000000000000000000000000000..ce4ec8f65b15ea016a86c6e2452560e3b6ecb47b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pythread.h @@ -0,0 +1,42 @@ +#ifndef Py_CPYTHON_PYTHREAD_H +# error "this header file must not be included directly" +#endif + +#define PYTHREAD_INVALID_THREAD_ID ((unsigned long)-1) + +#ifdef HAVE_FORK +/* Private function to reinitialize a lock at fork in the child process. + Reset the lock to the unlocked state. + Return 0 on success, return -1 on error. */ +PyAPI_FUNC(int) _PyThread_at_fork_reinit(PyThread_type_lock *lock); +#endif /* HAVE_FORK */ + +#ifdef HAVE_PTHREAD_H + /* Darwin needs pthread.h to know type name the pthread_key_t. */ +# include +# define NATIVE_TSS_KEY_T pthread_key_t +#elif defined(NT_THREADS) + /* In Windows, native TSS key type is DWORD, + but hardcode the unsigned long to avoid errors for include directive. + */ +# define NATIVE_TSS_KEY_T unsigned long +#elif defined(HAVE_PTHREAD_STUBS) +# include "cpython/pthread_stubs.h" +# define NATIVE_TSS_KEY_T pthread_key_t +#else +# error "Require native threads. See https://bugs.python.org/issue31370" +#endif + +/* When Py_LIMITED_API is not defined, the type layout of Py_tss_t is + exposed to allow static allocation in the API clients. Even in this case, + you must handle TSS keys through API functions due to compatibility. +*/ +struct _Py_tss_t { + int _is_initialized; + NATIVE_TSS_KEY_T _key; +}; + +#undef NATIVE_TSS_KEY_T + +/* When static allocation, you must initialize with Py_tss_NEEDS_INIT. */ +#define Py_tss_NEEDS_INIT {0} diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pytime.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pytime.h new file mode 100644 index 0000000000000000000000000000000000000000..23d4f16a8fd8472018590277ca920742afa9393c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/pytime.h @@ -0,0 +1,323 @@ +// The _PyTime_t API is written to use timestamp and timeout values stored in +// various formats and to read clocks. +// +// The _PyTime_t type is an integer to support directly common arithmetic +// operations like t1 + t2. +// +// The _PyTime_t API supports a resolution of 1 nanosecond. The _PyTime_t type +// is signed to support negative timestamps. The supported range is around +// [-292.3 years; +292.3 years]. Using the Unix epoch (January 1st, 1970), the +// supported date range is around [1677-09-21; 2262-04-11]. +// +// Formats: +// +// * seconds +// * seconds as a floating pointer number (C double) +// * milliseconds (10^-3 seconds) +// * microseconds (10^-6 seconds) +// * 100 nanoseconds (10^-7 seconds) +// * nanoseconds (10^-9 seconds) +// * timeval structure, 1 microsecond resolution (10^-6 seconds) +// * timespec structure, 1 nanosecond resolution (10^-9 seconds) +// +// Integer overflows are detected and raise OverflowError. Conversion to a +// resolution worse than 1 nanosecond is rounded correctly with the requested +// rounding mode. There are 4 rounding modes: floor (towards -inf), ceiling +// (towards +inf), half even and up (away from zero). +// +// Some functions clamp the result in the range [_PyTime_MIN; _PyTime_MAX], so +// the caller doesn't have to handle errors and doesn't need to hold the GIL. +// For example, _PyTime_Add(t1, t2) computes t1+t2 and clamp the result on +// overflow. +// +// Clocks: +// +// * System clock +// * Monotonic clock +// * Performance counter +// +// Operations like (t * k / q) with integers are implemented in a way to reduce +// the risk of integer overflow. Such operation is used to convert a clock +// value expressed in ticks with a frequency to _PyTime_t, like +// QueryPerformanceCounter() with QueryPerformanceFrequency(). + +#ifndef Py_LIMITED_API +#ifndef Py_PYTIME_H +#define Py_PYTIME_H + +/************************************************************************** +Symbols and macros to supply platform-independent interfaces to time related +functions and constants +**************************************************************************/ +#ifdef __cplusplus +extern "C" { +#endif + +/* _PyTime_t: Python timestamp with subsecond precision. It can be used to + store a duration, and so indirectly a date (related to another date, like + UNIX epoch). */ +typedef int64_t _PyTime_t; +// _PyTime_MIN nanoseconds is around -292.3 years +#define _PyTime_MIN INT64_MIN +// _PyTime_MAX nanoseconds is around +292.3 years +#define _PyTime_MAX INT64_MAX +#define _SIZEOF_PYTIME_T 8 + +typedef enum { + /* Round towards minus infinity (-inf). + For example, used to read a clock. */ + _PyTime_ROUND_FLOOR=0, + /* Round towards infinity (+inf). + For example, used for timeout to wait "at least" N seconds. */ + _PyTime_ROUND_CEILING=1, + /* Round to nearest with ties going to nearest even integer. + For example, used to round from a Python float. */ + _PyTime_ROUND_HALF_EVEN=2, + /* Round away from zero + For example, used for timeout. _PyTime_ROUND_CEILING rounds + -1e-9 to 0 milliseconds which causes bpo-31786 issue. + _PyTime_ROUND_UP rounds -1e-9 to -1 millisecond which keeps + the timeout sign as expected. select.poll(timeout) must block + for negative values." */ + _PyTime_ROUND_UP=3, + /* _PyTime_ROUND_TIMEOUT (an alias for _PyTime_ROUND_UP) should be + used for timeouts. */ + _PyTime_ROUND_TIMEOUT = _PyTime_ROUND_UP +} _PyTime_round_t; + + +/* Convert a time_t to a PyLong. */ +PyAPI_FUNC(PyObject *) _PyLong_FromTime_t( + time_t sec); + +/* Convert a PyLong to a time_t. */ +PyAPI_FUNC(time_t) _PyLong_AsTime_t( + PyObject *obj); + +/* Convert a number of seconds, int or float, to time_t. */ +PyAPI_FUNC(int) _PyTime_ObjectToTime_t( + PyObject *obj, + time_t *sec, + _PyTime_round_t); + +/* Convert a number of seconds, int or float, to a timeval structure. + usec is in the range [0; 999999] and rounded towards zero. + For example, -1.2 is converted to (-2, 800000). */ +PyAPI_FUNC(int) _PyTime_ObjectToTimeval( + PyObject *obj, + time_t *sec, + long *usec, + _PyTime_round_t); + +/* Convert a number of seconds, int or float, to a timespec structure. + nsec is in the range [0; 999999999] and rounded towards zero. + For example, -1.2 is converted to (-2, 800000000). */ +PyAPI_FUNC(int) _PyTime_ObjectToTimespec( + PyObject *obj, + time_t *sec, + long *nsec, + _PyTime_round_t); + + +/* Create a timestamp from a number of seconds. */ +PyAPI_FUNC(_PyTime_t) _PyTime_FromSeconds(int seconds); + +/* Macro to create a timestamp from a number of seconds, no integer overflow. + Only use the macro for small values, prefer _PyTime_FromSeconds(). */ +#define _PYTIME_FROMSECONDS(seconds) \ + ((_PyTime_t)(seconds) * (1000 * 1000 * 1000)) + +/* Create a timestamp from a number of nanoseconds. */ +PyAPI_FUNC(_PyTime_t) _PyTime_FromNanoseconds(_PyTime_t ns); + +/* Create a timestamp from nanoseconds (Python int). */ +PyAPI_FUNC(int) _PyTime_FromNanosecondsObject(_PyTime_t *t, + PyObject *obj); + +/* Convert a number of seconds (Python float or int) to a timestamp. + Raise an exception and return -1 on error, return 0 on success. */ +PyAPI_FUNC(int) _PyTime_FromSecondsObject(_PyTime_t *t, + PyObject *obj, + _PyTime_round_t round); + +/* Convert a number of milliseconds (Python float or int, 10^-3) to a timestamp. + Raise an exception and return -1 on error, return 0 on success. */ +PyAPI_FUNC(int) _PyTime_FromMillisecondsObject(_PyTime_t *t, + PyObject *obj, + _PyTime_round_t round); + +/* Convert a timestamp to a number of seconds as a C double. */ +PyAPI_FUNC(double) _PyTime_AsSecondsDouble(_PyTime_t t); + +/* Convert timestamp to a number of milliseconds (10^-3 seconds). */ +PyAPI_FUNC(_PyTime_t) _PyTime_AsMilliseconds(_PyTime_t t, + _PyTime_round_t round); + +/* Convert timestamp to a number of microseconds (10^-6 seconds). */ +PyAPI_FUNC(_PyTime_t) _PyTime_AsMicroseconds(_PyTime_t t, + _PyTime_round_t round); + +/* Convert timestamp to a number of nanoseconds (10^-9 seconds). */ +PyAPI_FUNC(_PyTime_t) _PyTime_AsNanoseconds(_PyTime_t t); + +#ifdef MS_WINDOWS +// Convert timestamp to a number of 100 nanoseconds (10^-7 seconds). +PyAPI_FUNC(_PyTime_t) _PyTime_As100Nanoseconds(_PyTime_t t, + _PyTime_round_t round); +#endif + +/* Convert timestamp to a number of nanoseconds (10^-9 seconds) as a Python int + object. */ +PyAPI_FUNC(PyObject *) _PyTime_AsNanosecondsObject(_PyTime_t t); + +#ifndef MS_WINDOWS +/* Create a timestamp from a timeval structure. + Raise an exception and return -1 on overflow, return 0 on success. */ +PyAPI_FUNC(int) _PyTime_FromTimeval(_PyTime_t *tp, struct timeval *tv); +#endif + +/* Convert a timestamp to a timeval structure (microsecond resolution). + tv_usec is always positive. + Raise an exception and return -1 if the conversion overflowed, + return 0 on success. */ +PyAPI_FUNC(int) _PyTime_AsTimeval(_PyTime_t t, + struct timeval *tv, + _PyTime_round_t round); + +/* Similar to _PyTime_AsTimeval() but don't raise an exception on overflow. + On overflow, clamp tv_sec to _PyTime_t min/max. */ +PyAPI_FUNC(void) _PyTime_AsTimeval_clamp(_PyTime_t t, + struct timeval *tv, + _PyTime_round_t round); + +/* Convert a timestamp to a number of seconds (secs) and microseconds (us). + us is always positive. This function is similar to _PyTime_AsTimeval() + except that secs is always a time_t type, whereas the timeval structure + uses a C long for tv_sec on Windows. + Raise an exception and return -1 if the conversion overflowed, + return 0 on success. */ +PyAPI_FUNC(int) _PyTime_AsTimevalTime_t( + _PyTime_t t, + time_t *secs, + int *us, + _PyTime_round_t round); + +#if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_KQUEUE) +/* Create a timestamp from a timespec structure. + Raise an exception and return -1 on overflow, return 0 on success. */ +PyAPI_FUNC(int) _PyTime_FromTimespec(_PyTime_t *tp, struct timespec *ts); + +/* Convert a timestamp to a timespec structure (nanosecond resolution). + tv_nsec is always positive. + Raise an exception and return -1 on error, return 0 on success. */ +PyAPI_FUNC(int) _PyTime_AsTimespec(_PyTime_t t, struct timespec *ts); + +/* Similar to _PyTime_AsTimespec() but don't raise an exception on overflow. + On overflow, clamp tv_sec to _PyTime_t min/max. */ +PyAPI_FUNC(void) _PyTime_AsTimespec_clamp(_PyTime_t t, struct timespec *ts); +#endif + + +// Compute t1 + t2. Clamp to [_PyTime_MIN; _PyTime_MAX] on overflow. +PyAPI_FUNC(_PyTime_t) _PyTime_Add(_PyTime_t t1, _PyTime_t t2); + +/* Compute ticks * mul / div. + Clamp to [_PyTime_MIN; _PyTime_MAX] on overflow. + The caller must ensure that ((div - 1) * mul) cannot overflow. */ +PyAPI_FUNC(_PyTime_t) _PyTime_MulDiv(_PyTime_t ticks, + _PyTime_t mul, + _PyTime_t div); + +/* Structure used by time.get_clock_info() */ +typedef struct { + const char *implementation; + int monotonic; + int adjustable; + double resolution; +} _Py_clock_info_t; + +/* Get the current time from the system clock. + + If the internal clock fails, silently ignore the error and return 0. + On integer overflow, silently ignore the overflow and clamp the clock to + [_PyTime_MIN; _PyTime_MAX]. + + Use _PyTime_GetSystemClockWithInfo() to check for failure. */ +PyAPI_FUNC(_PyTime_t) _PyTime_GetSystemClock(void); + +/* Get the current time from the system clock. + * On success, set *t and *info (if not NULL), and return 0. + * On error, raise an exception and return -1. + */ +PyAPI_FUNC(int) _PyTime_GetSystemClockWithInfo( + _PyTime_t *t, + _Py_clock_info_t *info); + +/* Get the time of a monotonic clock, i.e. a clock that cannot go backwards. + The clock is not affected by system clock updates. The reference point of + the returned value is undefined, so that only the difference between the + results of consecutive calls is valid. + + If the internal clock fails, silently ignore the error and return 0. + On integer overflow, silently ignore the overflow and clamp the clock to + [_PyTime_MIN; _PyTime_MAX]. + + Use _PyTime_GetMonotonicClockWithInfo() to check for failure. */ +PyAPI_FUNC(_PyTime_t) _PyTime_GetMonotonicClock(void); + +/* Get the time of a monotonic clock, i.e. a clock that cannot go backwards. + The clock is not affected by system clock updates. The reference point of + the returned value is undefined, so that only the difference between the + results of consecutive calls is valid. + + Fill info (if set) with information of the function used to get the time. + + Return 0 on success, raise an exception and return -1 on error. */ +PyAPI_FUNC(int) _PyTime_GetMonotonicClockWithInfo( + _PyTime_t *t, + _Py_clock_info_t *info); + + +/* Converts a timestamp to the Gregorian time, using the local time zone. + Return 0 on success, raise an exception and return -1 on error. */ +PyAPI_FUNC(int) _PyTime_localtime(time_t t, struct tm *tm); + +/* Converts a timestamp to the Gregorian time, assuming UTC. + Return 0 on success, raise an exception and return -1 on error. */ +PyAPI_FUNC(int) _PyTime_gmtime(time_t t, struct tm *tm); + +/* Get the performance counter: clock with the highest available resolution to + measure a short duration. + + If the internal clock fails, silently ignore the error and return 0. + On integer overflow, silently ignore the overflow and clamp the clock to + [_PyTime_MIN; _PyTime_MAX]. + + Use _PyTime_GetPerfCounterWithInfo() to check for failure. */ +PyAPI_FUNC(_PyTime_t) _PyTime_GetPerfCounter(void); + +/* Get the performance counter: clock with the highest available resolution to + measure a short duration. + + Fill info (if set) with information of the function used to get the time. + + Return 0 on success, raise an exception and return -1 on error. */ +PyAPI_FUNC(int) _PyTime_GetPerfCounterWithInfo( + _PyTime_t *t, + _Py_clock_info_t *info); + + +// Create a deadline. +// Pseudo code: _PyTime_GetMonotonicClock() + timeout. +PyAPI_FUNC(_PyTime_t) _PyDeadline_Init(_PyTime_t timeout); + +// Get remaining time from a deadline. +// Pseudo code: deadline - _PyTime_GetMonotonicClock(). +PyAPI_FUNC(_PyTime_t) _PyDeadline_Get(_PyTime_t deadline); + +#ifdef __cplusplus +} +#endif + +#endif /* Py_PYTIME_H */ +#endif /* Py_LIMITED_API */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/setobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/setobject.h new file mode 100644 index 0000000000000000000000000000000000000000..b4443a678b7e771052fb61e91a2faf90f04ae743 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/setobject.h @@ -0,0 +1,67 @@ +#ifndef Py_CPYTHON_SETOBJECT_H +# error "this header file must not be included directly" +#endif + +/* There are three kinds of entries in the table: + +1. Unused: key == NULL and hash == 0 +2. Dummy: key == dummy and hash == -1 +3. Active: key != NULL and key != dummy and hash != -1 + +The hash field of Unused slots is always zero. + +The hash field of Dummy slots are set to -1 +meaning that dummy entries can be detected by +either entry->key==dummy or by entry->hash==-1. +*/ + +#define PySet_MINSIZE 8 + +typedef struct { + PyObject *key; + Py_hash_t hash; /* Cached hash code of the key */ +} setentry; + +/* The SetObject data structure is shared by set and frozenset objects. + +Invariant for sets: + - hash is -1 + +Invariants for frozensets: + - data is immutable. + - hash is the hash of the frozenset or -1 if not computed yet. + +*/ + +typedef struct { + PyObject_HEAD + + Py_ssize_t fill; /* Number active and dummy entries*/ + Py_ssize_t used; /* Number active entries */ + + /* The table contains mask + 1 slots, and that's a power of 2. + * We store the mask instead of the size because the mask is more + * frequently needed. + */ + Py_ssize_t mask; + + /* The table points to a fixed-size smalltable for small tables + * or to additional malloc'ed memory for bigger tables. + * The table pointer is never NULL which saves us from repeated + * runtime null-tests. + */ + setentry *table; + Py_hash_t hash; /* Only used by frozenset objects */ + Py_ssize_t finger; /* Search finger for pop() */ + + setentry smalltable[PySet_MINSIZE]; + PyObject *weakreflist; /* List of weak references */ +} PySetObject; + +#define PySet_GET_SIZE(so) \ + (assert(PyAnySet_Check(so)), (((PySetObject *)(so))->used)) + +PyAPI_DATA(PyObject *) _PySet_Dummy; + +PyAPI_FUNC(int) _PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key, Py_hash_t *hash); +PyAPI_FUNC(int) _PySet_Update(PyObject *set, PyObject *iterable); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/sysmodule.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/sysmodule.h new file mode 100644 index 0000000000000000000000000000000000000000..19d9dddc344a4f0ee4fb0d849b82f280e3000ca3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/sysmodule.h @@ -0,0 +1,16 @@ +#ifndef Py_CPYTHON_SYSMODULE_H +# error "this header file must not be included directly" +#endif + +PyAPI_FUNC(PyObject *) _PySys_GetAttr(PyThreadState *tstate, + PyObject *name); + +PyAPI_FUNC(size_t) _PySys_GetSizeOf(PyObject *); + +typedef int(*Py_AuditHookFunction)(const char *, PyObject *, void *); + +PyAPI_FUNC(int) PySys_Audit( + const char *event, + const char *argFormat, + ...); +PyAPI_FUNC(int) PySys_AddAuditHook(Py_AuditHookFunction, void*); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/traceback.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/traceback.h new file mode 100644 index 0000000000000000000000000000000000000000..a4e087b2b4ecedb6ad08545c9be6d0f08e50bfac --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/traceback.h @@ -0,0 +1,16 @@ +#ifndef Py_CPYTHON_TRACEBACK_H +# error "this header file must not be included directly" +#endif + +typedef struct _traceback PyTracebackObject; + +struct _traceback { + PyObject_HEAD + PyTracebackObject *tb_next; + PyFrameObject *tb_frame; + int tb_lasti; + int tb_lineno; +}; + +PyAPI_FUNC(int) _Py_DisplaySourceLine(PyObject *, PyObject *, int, int, int *, PyObject **); +PyAPI_FUNC(void) _PyTraceback_Add(const char *, const char *, int); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/tupleobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/tupleobject.h new file mode 100644 index 0000000000000000000000000000000000000000..3d9c1aff588634e9b1ab1d215131cd65272cc96f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/tupleobject.h @@ -0,0 +1,43 @@ +#ifndef Py_CPYTHON_TUPLEOBJECT_H +# error "this header file must not be included directly" +#endif + +typedef struct { + PyObject_VAR_HEAD + /* ob_item contains space for 'ob_size' elements. + Items must normally not be NULL, except during construction when + the tuple is not yet visible outside the function that builds it. */ + PyObject *ob_item[1]; +} PyTupleObject; + +PyAPI_FUNC(int) _PyTuple_Resize(PyObject **, Py_ssize_t); +PyAPI_FUNC(void) _PyTuple_MaybeUntrack(PyObject *); + +/* Cast argument to PyTupleObject* type. */ +#define _PyTuple_CAST(op) \ + (assert(PyTuple_Check(op)), _Py_CAST(PyTupleObject*, (op))) + +// Macros and static inline functions, trading safety for speed + +static inline Py_ssize_t PyTuple_GET_SIZE(PyObject *op) { + PyTupleObject *tuple = _PyTuple_CAST(op); + return Py_SIZE(tuple); +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +# define PyTuple_GET_SIZE(op) PyTuple_GET_SIZE(_PyObject_CAST(op)) +#endif + +#define PyTuple_GET_ITEM(op, index) (_PyTuple_CAST(op)->ob_item[index]) + +/* Function *only* to be used to fill in brand new tuples */ +static inline void +PyTuple_SET_ITEM(PyObject *op, Py_ssize_t index, PyObject *value) { + PyTupleObject *tuple = _PyTuple_CAST(op); + tuple->ob_item[index] = value; +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +#define PyTuple_SET_ITEM(op, index, value) \ + PyTuple_SET_ITEM(_PyObject_CAST(op), index, _PyObject_CAST(value)) +#endif + +PyAPI_FUNC(void) _PyTuple_DebugMallocStats(FILE *out); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/unicodeobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/unicodeobject.h new file mode 100644 index 0000000000000000000000000000000000000000..41debcbc06af69b7b173fa375182b6427a84f4db --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/unicodeobject.h @@ -0,0 +1,1166 @@ +#ifndef Py_CPYTHON_UNICODEOBJECT_H +# error "this header file must not be included directly" +#endif + +/* Py_UNICODE was the native Unicode storage format (code unit) used by + Python and represents a single Unicode element in the Unicode type. + With PEP 393, Py_UNICODE is deprecated and replaced with a + typedef to wchar_t. */ +#define PY_UNICODE_TYPE wchar_t +/* Py_DEPRECATED(3.3) */ typedef wchar_t Py_UNICODE; + +/* --- Internal Unicode Operations ---------------------------------------- */ + +#ifndef USE_UNICODE_WCHAR_CACHE +# define USE_UNICODE_WCHAR_CACHE 1 +#endif /* USE_UNICODE_WCHAR_CACHE */ + +/* Since splitting on whitespace is an important use case, and + whitespace in most situations is solely ASCII whitespace, we + optimize for the common case by using a quick look-up table + _Py_ascii_whitespace (see below) with an inlined check. + + */ +#define Py_UNICODE_ISSPACE(ch) \ + ((Py_UCS4)(ch) < 128U ? _Py_ascii_whitespace[(ch)] : _PyUnicode_IsWhitespace(ch)) + +#define Py_UNICODE_ISLOWER(ch) _PyUnicode_IsLowercase(ch) +#define Py_UNICODE_ISUPPER(ch) _PyUnicode_IsUppercase(ch) +#define Py_UNICODE_ISTITLE(ch) _PyUnicode_IsTitlecase(ch) +#define Py_UNICODE_ISLINEBREAK(ch) _PyUnicode_IsLinebreak(ch) + +#define Py_UNICODE_TOLOWER(ch) _PyUnicode_ToLowercase(ch) +#define Py_UNICODE_TOUPPER(ch) _PyUnicode_ToUppercase(ch) +#define Py_UNICODE_TOTITLE(ch) _PyUnicode_ToTitlecase(ch) + +#define Py_UNICODE_ISDECIMAL(ch) _PyUnicode_IsDecimalDigit(ch) +#define Py_UNICODE_ISDIGIT(ch) _PyUnicode_IsDigit(ch) +#define Py_UNICODE_ISNUMERIC(ch) _PyUnicode_IsNumeric(ch) +#define Py_UNICODE_ISPRINTABLE(ch) _PyUnicode_IsPrintable(ch) + +#define Py_UNICODE_TODECIMAL(ch) _PyUnicode_ToDecimalDigit(ch) +#define Py_UNICODE_TODIGIT(ch) _PyUnicode_ToDigit(ch) +#define Py_UNICODE_TONUMERIC(ch) _PyUnicode_ToNumeric(ch) + +#define Py_UNICODE_ISALPHA(ch) _PyUnicode_IsAlpha(ch) + +#define Py_UNICODE_ISALNUM(ch) \ + (Py_UNICODE_ISALPHA(ch) || \ + Py_UNICODE_ISDECIMAL(ch) || \ + Py_UNICODE_ISDIGIT(ch) || \ + Py_UNICODE_ISNUMERIC(ch)) + +/* macros to work with surrogates */ +#define Py_UNICODE_IS_SURROGATE(ch) (0xD800 <= (ch) && (ch) <= 0xDFFF) +#define Py_UNICODE_IS_HIGH_SURROGATE(ch) (0xD800 <= (ch) && (ch) <= 0xDBFF) +#define Py_UNICODE_IS_LOW_SURROGATE(ch) (0xDC00 <= (ch) && (ch) <= 0xDFFF) +/* Join two surrogate characters and return a single Py_UCS4 value. */ +#define Py_UNICODE_JOIN_SURROGATES(high, low) \ + (((((Py_UCS4)(high) & 0x03FF) << 10) | \ + ((Py_UCS4)(low) & 0x03FF)) + 0x10000) +/* high surrogate = top 10 bits added to D800 */ +#define Py_UNICODE_HIGH_SURROGATE(ch) (0xD800 - (0x10000 >> 10) + ((ch) >> 10)) +/* low surrogate = bottom 10 bits added to DC00 */ +#define Py_UNICODE_LOW_SURROGATE(ch) (0xDC00 + ((ch) & 0x3FF)) + +/* --- Unicode Type ------------------------------------------------------- */ + +/* ASCII-only strings created through PyUnicode_New use the PyASCIIObject + structure. state.ascii and state.compact are set, and the data + immediately follow the structure. utf8_length and wstr_length can be found + in the length field; the utf8 pointer is equal to the data pointer. */ +typedef struct { + /* There are 4 forms of Unicode strings: + + - compact ascii: + + * structure = PyASCIIObject + * test: PyUnicode_IS_COMPACT_ASCII(op) + * kind = PyUnicode_1BYTE_KIND + * compact = 1 + * ascii = 1 + * ready = 1 + * (length is the length of the utf8 and wstr strings) + * (data starts just after the structure) + * (since ASCII is decoded from UTF-8, the utf8 string are the data) + + - compact: + + * structure = PyCompactUnicodeObject + * test: PyUnicode_IS_COMPACT(op) && !PyUnicode_IS_ASCII(op) + * kind = PyUnicode_1BYTE_KIND, PyUnicode_2BYTE_KIND or + PyUnicode_4BYTE_KIND + * compact = 1 + * ready = 1 + * ascii = 0 + * utf8 is not shared with data + * utf8_length = 0 if utf8 is NULL + * wstr is shared with data and wstr_length=length + if kind=PyUnicode_2BYTE_KIND and sizeof(wchar_t)=2 + or if kind=PyUnicode_4BYTE_KIND and sizeof(wchar_t)=4 + * wstr_length = 0 if wstr is NULL + * (data starts just after the structure) + + - legacy string, not ready: + + * structure = PyUnicodeObject + * test: kind == PyUnicode_WCHAR_KIND + * length = 0 (use wstr_length) + * hash = -1 + * kind = PyUnicode_WCHAR_KIND + * compact = 0 + * ascii = 0 + * ready = 0 + * interned = SSTATE_NOT_INTERNED + * wstr is not NULL + * data.any is NULL + * utf8 is NULL + * utf8_length = 0 + + - legacy string, ready: + + * structure = PyUnicodeObject structure + * test: !PyUnicode_IS_COMPACT(op) && kind != PyUnicode_WCHAR_KIND + * kind = PyUnicode_1BYTE_KIND, PyUnicode_2BYTE_KIND or + PyUnicode_4BYTE_KIND + * compact = 0 + * ready = 1 + * data.any is not NULL + * utf8 is shared and utf8_length = length with data.any if ascii = 1 + * utf8_length = 0 if utf8 is NULL + * wstr is shared with data.any and wstr_length = length + if kind=PyUnicode_2BYTE_KIND and sizeof(wchar_t)=2 + or if kind=PyUnicode_4BYTE_KIND and sizeof(wchar_4)=4 + * wstr_length = 0 if wstr is NULL + + Compact strings use only one memory block (structure + characters), + whereas legacy strings use one block for the structure and one block + for characters. + + Legacy strings are created by PyUnicode_FromUnicode() and + PyUnicode_FromStringAndSize(NULL, size) functions. They become ready + when PyUnicode_READY() is called. + + See also _PyUnicode_CheckConsistency(). + */ + PyObject_HEAD + Py_ssize_t length; /* Number of code points in the string */ + Py_hash_t hash; /* Hash value; -1 if not set */ + struct { + /* + SSTATE_NOT_INTERNED (0) + SSTATE_INTERNED_MORTAL (1) + SSTATE_INTERNED_IMMORTAL (2) + + If interned != SSTATE_NOT_INTERNED, the two references from the + dictionary to this object are *not* counted in ob_refcnt. + */ + unsigned int interned:2; + /* Character size: + + - PyUnicode_WCHAR_KIND (0): + + * character type = wchar_t (16 or 32 bits, depending on the + platform) + + - PyUnicode_1BYTE_KIND (1): + + * character type = Py_UCS1 (8 bits, unsigned) + * all characters are in the range U+0000-U+00FF (latin1) + * if ascii is set, all characters are in the range U+0000-U+007F + (ASCII), otherwise at least one character is in the range + U+0080-U+00FF + + - PyUnicode_2BYTE_KIND (2): + + * character type = Py_UCS2 (16 bits, unsigned) + * all characters are in the range U+0000-U+FFFF (BMP) + * at least one character is in the range U+0100-U+FFFF + + - PyUnicode_4BYTE_KIND (4): + + * character type = Py_UCS4 (32 bits, unsigned) + * all characters are in the range U+0000-U+10FFFF + * at least one character is in the range U+10000-U+10FFFF + */ + unsigned int kind:3; + /* Compact is with respect to the allocation scheme. Compact unicode + objects only require one memory block while non-compact objects use + one block for the PyUnicodeObject struct and another for its data + buffer. */ + unsigned int compact:1; + /* The string only contains characters in the range U+0000-U+007F (ASCII) + and the kind is PyUnicode_1BYTE_KIND. If ascii is set and compact is + set, use the PyASCIIObject structure. */ + unsigned int ascii:1; + /* The ready flag indicates whether the object layout is initialized + completely. This means that this is either a compact object, or + the data pointer is filled out. The bit is redundant, and helps + to minimize the test in PyUnicode_IS_READY(). */ + unsigned int ready:1; + /* Padding to ensure that PyUnicode_DATA() is always aligned to + 4 bytes (see issue #19537 on m68k). */ + unsigned int :24; + } state; + wchar_t *wstr; /* wchar_t representation (null-terminated) */ +} PyASCIIObject; + +/* Non-ASCII strings allocated through PyUnicode_New use the + PyCompactUnicodeObject structure. state.compact is set, and the data + immediately follow the structure. */ +typedef struct { + PyASCIIObject _base; + Py_ssize_t utf8_length; /* Number of bytes in utf8, excluding the + * terminating \0. */ + char *utf8; /* UTF-8 representation (null-terminated) */ + Py_ssize_t wstr_length; /* Number of code points in wstr, possible + * surrogates count as two code points. */ +} PyCompactUnicodeObject; + +/* Strings allocated through PyUnicode_FromUnicode(NULL, len) use the + PyUnicodeObject structure. The actual string data is initially in the wstr + block, and copied into the data block using _PyUnicode_Ready. */ +typedef struct { + PyCompactUnicodeObject _base; + union { + void *any; + Py_UCS1 *latin1; + Py_UCS2 *ucs2; + Py_UCS4 *ucs4; + } data; /* Canonical, smallest-form Unicode buffer */ +} PyUnicodeObject; + +PyAPI_FUNC(int) _PyUnicode_CheckConsistency( + PyObject *op, + int check_content); + + +#define _PyASCIIObject_CAST(op) \ + (assert(PyUnicode_Check(op)), \ + _Py_CAST(PyASCIIObject*, (op))) +#define _PyCompactUnicodeObject_CAST(op) \ + (assert(PyUnicode_Check(op)), \ + _Py_CAST(PyCompactUnicodeObject*, (op))) +#define _PyUnicodeObject_CAST(op) \ + (assert(PyUnicode_Check(op)), \ + _Py_CAST(PyUnicodeObject*, (op))) + + +/* --- Flexible String Representation Helper Macros (PEP 393) -------------- */ + +/* Values for PyASCIIObject.state: */ + +/* Interning state. */ +#define SSTATE_NOT_INTERNED 0 +#define SSTATE_INTERNED_MORTAL 1 +#define SSTATE_INTERNED_IMMORTAL 2 + +/* Use only if you know it's a string */ +static inline unsigned int PyUnicode_CHECK_INTERNED(PyObject *op) { + return _PyASCIIObject_CAST(op)->state.interned; +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +# define PyUnicode_CHECK_INTERNED(op) PyUnicode_CHECK_INTERNED(_PyObject_CAST(op)) +#endif + +/* Fast check to determine whether an object is ready. Equivalent to: + PyUnicode_IS_COMPACT(op) || _PyUnicodeObject_CAST(op)->data.any */ +static inline unsigned int PyUnicode_IS_READY(PyObject *op) { + return _PyASCIIObject_CAST(op)->state.ready; +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +# define PyUnicode_IS_READY(op) PyUnicode_IS_READY(_PyObject_CAST(op)) +#endif + +/* Return true if the string contains only ASCII characters, or 0 if not. The + string may be compact (PyUnicode_IS_COMPACT_ASCII) or not, but must be + ready. */ +static inline unsigned int PyUnicode_IS_ASCII(PyObject *op) { + assert(PyUnicode_IS_READY(op)); + return _PyASCIIObject_CAST(op)->state.ascii; +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +# define PyUnicode_IS_ASCII(op) PyUnicode_IS_ASCII(_PyObject_CAST(op)) +#endif + +/* Return true if the string is compact or 0 if not. + No type checks or Ready calls are performed. */ +static inline unsigned int PyUnicode_IS_COMPACT(PyObject *op) { + return _PyASCIIObject_CAST(op)->state.compact; +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +# define PyUnicode_IS_COMPACT(op) PyUnicode_IS_COMPACT(_PyObject_CAST(op)) +#endif + +/* Return true if the string is a compact ASCII string (use PyASCIIObject + structure), or 0 if not. No type checks or Ready calls are performed. */ +static inline int PyUnicode_IS_COMPACT_ASCII(PyObject *op) { + return (_PyASCIIObject_CAST(op)->state.ascii && PyUnicode_IS_COMPACT(op)); +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +# define PyUnicode_IS_COMPACT_ASCII(op) PyUnicode_IS_COMPACT_ASCII(_PyObject_CAST(op)) +#endif + +enum PyUnicode_Kind { +/* String contains only wstr byte characters. This is only possible + when the string was created with a legacy API and _PyUnicode_Ready() + has not been called yet. */ + PyUnicode_WCHAR_KIND = 0, +/* Return values of the PyUnicode_KIND() function: */ + PyUnicode_1BYTE_KIND = 1, + PyUnicode_2BYTE_KIND = 2, + PyUnicode_4BYTE_KIND = 4 +}; + +/* Return one of the PyUnicode_*_KIND values defined above. */ +#define PyUnicode_KIND(op) \ + (assert(PyUnicode_IS_READY(op)), \ + _PyASCIIObject_CAST(op)->state.kind) + +/* Return a void pointer to the raw unicode buffer. */ +static inline void* _PyUnicode_COMPACT_DATA(PyObject *op) { + if (PyUnicode_IS_ASCII(op)) { + return _Py_STATIC_CAST(void*, (_PyASCIIObject_CAST(op) + 1)); + } + return _Py_STATIC_CAST(void*, (_PyCompactUnicodeObject_CAST(op) + 1)); +} + +static inline void* _PyUnicode_NONCOMPACT_DATA(PyObject *op) { + void *data; + assert(!PyUnicode_IS_COMPACT(op)); + data = _PyUnicodeObject_CAST(op)->data.any; + assert(data != NULL); + return data; +} + +static inline void* PyUnicode_DATA(PyObject *op) { + if (PyUnicode_IS_COMPACT(op)) { + return _PyUnicode_COMPACT_DATA(op); + } + return _PyUnicode_NONCOMPACT_DATA(op); +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +# define PyUnicode_DATA(op) PyUnicode_DATA(_PyObject_CAST(op)) +#endif + +/* Return pointers to the canonical representation cast to unsigned char, + Py_UCS2, or Py_UCS4 for direct character access. + No checks are performed, use PyUnicode_KIND() before to ensure + these will work correctly. */ + +#define PyUnicode_1BYTE_DATA(op) _Py_STATIC_CAST(Py_UCS1*, PyUnicode_DATA(op)) +#define PyUnicode_2BYTE_DATA(op) _Py_STATIC_CAST(Py_UCS2*, PyUnicode_DATA(op)) +#define PyUnicode_4BYTE_DATA(op) _Py_STATIC_CAST(Py_UCS4*, PyUnicode_DATA(op)) + +/* Returns the length of the unicode string. The caller has to make sure that + the string has it's canonical representation set before calling + this function. Call PyUnicode_(FAST_)Ready to ensure that. */ +static inline Py_ssize_t PyUnicode_GET_LENGTH(PyObject *op) { + assert(PyUnicode_IS_READY(op)); + return _PyASCIIObject_CAST(op)->length; +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +# define PyUnicode_GET_LENGTH(op) PyUnicode_GET_LENGTH(_PyObject_CAST(op)) +#endif + +/* Write into the canonical representation, this function does not do any sanity + checks and is intended for usage in loops. The caller should cache the + kind and data pointers obtained from other function calls. + index is the index in the string (starts at 0) and value is the new + code point value which should be written to that location. */ +static inline void PyUnicode_WRITE(int kind, void *data, + Py_ssize_t index, Py_UCS4 value) +{ + if (kind == PyUnicode_1BYTE_KIND) { + assert(value <= 0xffU); + _Py_STATIC_CAST(Py_UCS1*, data)[index] = _Py_STATIC_CAST(Py_UCS1, value); + } + else if (kind == PyUnicode_2BYTE_KIND) { + assert(value <= 0xffffU); + _Py_STATIC_CAST(Py_UCS2*, data)[index] = _Py_STATIC_CAST(Py_UCS2, value); + } + else { + assert(kind == PyUnicode_4BYTE_KIND); + assert(value <= 0x10ffffU); + _Py_STATIC_CAST(Py_UCS4*, data)[index] = value; + } +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +#define PyUnicode_WRITE(kind, data, index, value) \ + PyUnicode_WRITE(_Py_STATIC_CAST(int, kind), _Py_CAST(void*, data), \ + (index), _Py_STATIC_CAST(Py_UCS4, value)) +#endif + +/* Read a code point from the string's canonical representation. No checks + or ready calls are performed. */ +static inline Py_UCS4 PyUnicode_READ(int kind, + const void *data, Py_ssize_t index) +{ + if (kind == PyUnicode_1BYTE_KIND) { + return _Py_STATIC_CAST(const Py_UCS1*, data)[index]; + } + if (kind == PyUnicode_2BYTE_KIND) { + return _Py_STATIC_CAST(const Py_UCS2*, data)[index]; + } + assert(kind == PyUnicode_4BYTE_KIND); + return _Py_STATIC_CAST(const Py_UCS4*, data)[index]; +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +#define PyUnicode_READ(kind, data, index) \ + PyUnicode_READ(_Py_STATIC_CAST(int, kind), \ + _Py_STATIC_CAST(const void*, data), \ + (index)) +#endif + +/* PyUnicode_READ_CHAR() is less efficient than PyUnicode_READ() because it + calls PyUnicode_KIND() and might call it twice. For single reads, use + PyUnicode_READ_CHAR, for multiple consecutive reads callers should + cache kind and use PyUnicode_READ instead. */ +static inline Py_UCS4 PyUnicode_READ_CHAR(PyObject *unicode, Py_ssize_t index) +{ + int kind; + assert(PyUnicode_IS_READY(unicode)); + kind = PyUnicode_KIND(unicode); + if (kind == PyUnicode_1BYTE_KIND) { + return PyUnicode_1BYTE_DATA(unicode)[index]; + } + if (kind == PyUnicode_2BYTE_KIND) { + return PyUnicode_2BYTE_DATA(unicode)[index]; + } + assert(kind == PyUnicode_4BYTE_KIND); + return PyUnicode_4BYTE_DATA(unicode)[index]; +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +# define PyUnicode_READ_CHAR(unicode, index) \ + PyUnicode_READ_CHAR(_PyObject_CAST(unicode), (index)) +#endif + +/* Return a maximum character value which is suitable for creating another + string based on op. This is always an approximation but more efficient + than iterating over the string. */ +static inline Py_UCS4 PyUnicode_MAX_CHAR_VALUE(PyObject *op) +{ + int kind; + + assert(PyUnicode_IS_READY(op)); + if (PyUnicode_IS_ASCII(op)) { + return 0x7fU; + } + + kind = PyUnicode_KIND(op); + if (kind == PyUnicode_1BYTE_KIND) { + return 0xffU; + } + if (kind == PyUnicode_2BYTE_KIND) { + return 0xffffU; + } + assert(kind == PyUnicode_4BYTE_KIND); + return 0x10ffffU; +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +# define PyUnicode_MAX_CHAR_VALUE(op) \ + PyUnicode_MAX_CHAR_VALUE(_PyObject_CAST(op)) +#endif + +/* === Public API ========================================================= */ + +/* --- Plain Py_UNICODE --------------------------------------------------- */ + +/* With PEP 393, this is the recommended way to allocate a new unicode object. + This function will allocate the object and its buffer in a single memory + block. Objects created using this function are not resizable. */ +PyAPI_FUNC(PyObject*) PyUnicode_New( + Py_ssize_t size, /* Number of code points in the new string */ + Py_UCS4 maxchar /* maximum code point value in the string */ + ); + +/* Initializes the canonical string representation from the deprecated + wstr/Py_UNICODE representation. This function is used to convert Unicode + objects which were created using the old API to the new flexible format + introduced with PEP 393. + + Don't call this function directly, use the public PyUnicode_READY() function + instead. */ +PyAPI_FUNC(int) _PyUnicode_Ready( + PyObject *unicode /* Unicode object */ + ); + +/* PyUnicode_READY() does less work than _PyUnicode_Ready() in the best + case. If the canonical representation is not yet set, it will still call + _PyUnicode_Ready(). + Returns 0 on success and -1 on errors. */ +static inline int PyUnicode_READY(PyObject *op) +{ + if (PyUnicode_IS_READY(op)) { + return 0; + } + return _PyUnicode_Ready(op); +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +# define PyUnicode_READY(op) PyUnicode_READY(_PyObject_CAST(op)) +#endif + +/* Get a copy of a Unicode string. */ +PyAPI_FUNC(PyObject*) _PyUnicode_Copy( + PyObject *unicode + ); + +/* Copy character from one unicode object into another, this function performs + character conversion when necessary and falls back to memcpy() if possible. + + Fail if to is too small (smaller than *how_many* or smaller than + len(from)-from_start), or if kind(from[from_start:from_start+how_many]) > + kind(to), or if *to* has more than 1 reference. + + Return the number of written character, or return -1 and raise an exception + on error. + + Pseudo-code: + + how_many = min(how_many, len(from) - from_start) + to[to_start:to_start+how_many] = from[from_start:from_start+how_many] + return how_many + + Note: The function doesn't write a terminating null character. + */ +PyAPI_FUNC(Py_ssize_t) PyUnicode_CopyCharacters( + PyObject *to, + Py_ssize_t to_start, + PyObject *from, + Py_ssize_t from_start, + Py_ssize_t how_many + ); + +/* Unsafe version of PyUnicode_CopyCharacters(): don't check arguments and so + may crash if parameters are invalid (e.g. if the output string + is too short). */ +PyAPI_FUNC(void) _PyUnicode_FastCopyCharacters( + PyObject *to, + Py_ssize_t to_start, + PyObject *from, + Py_ssize_t from_start, + Py_ssize_t how_many + ); + +/* Fill a string with a character: write fill_char into + unicode[start:start+length]. + + Fail if fill_char is bigger than the string maximum character, or if the + string has more than 1 reference. + + Return the number of written character, or return -1 and raise an exception + on error. */ +PyAPI_FUNC(Py_ssize_t) PyUnicode_Fill( + PyObject *unicode, + Py_ssize_t start, + Py_ssize_t length, + Py_UCS4 fill_char + ); + +/* Unsafe version of PyUnicode_Fill(): don't check arguments and so may crash + if parameters are invalid (e.g. if length is longer than the string). */ +PyAPI_FUNC(void) _PyUnicode_FastFill( + PyObject *unicode, + Py_ssize_t start, + Py_ssize_t length, + Py_UCS4 fill_char + ); + +/* Create a new string from a buffer of Py_UCS1, Py_UCS2 or Py_UCS4 characters. + Scan the string to find the maximum character. */ +PyAPI_FUNC(PyObject*) PyUnicode_FromKindAndData( + int kind, + const void *buffer, + Py_ssize_t size); + +/* Create a new string from a buffer of ASCII characters. + WARNING: Don't check if the string contains any non-ASCII character. */ +PyAPI_FUNC(PyObject*) _PyUnicode_FromASCII( + const char *buffer, + Py_ssize_t size); + +/* Compute the maximum character of the substring unicode[start:end]. + Return 127 for an empty string. */ +PyAPI_FUNC(Py_UCS4) _PyUnicode_FindMaxChar ( + PyObject *unicode, + Py_ssize_t start, + Py_ssize_t end); + +/* --- Legacy deprecated API ---------------------------------------------- */ + +/* Create a Unicode Object from the Py_UNICODE buffer u of the given + size. + + u may be NULL which causes the contents to be undefined. It is the + user's responsibility to fill in the needed data afterwards. Note + that modifying the Unicode object contents after construction is + only allowed if u was set to NULL. + + The buffer is copied into the new object. */ +Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode( + const Py_UNICODE *u, /* Unicode buffer */ + Py_ssize_t size /* size of buffer */ + ); + +/* Return a read-only pointer to the Unicode object's internal + Py_UNICODE buffer. + If the wchar_t/Py_UNICODE representation is not yet available, this + function will calculate it. */ +Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode( + PyObject *unicode /* Unicode object */ + ); + +/* Similar to PyUnicode_AsUnicode(), but raises a ValueError if the string + contains null characters. */ +PyAPI_FUNC(const Py_UNICODE *) _PyUnicode_AsUnicode( + PyObject *unicode /* Unicode object */ + ); + +/* Return a read-only pointer to the Unicode object's internal + Py_UNICODE buffer and save the length at size. + If the wchar_t/Py_UNICODE representation is not yet available, this + function will calculate it. */ + +Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicodeAndSize( + PyObject *unicode, /* Unicode object */ + Py_ssize_t *size /* location where to save the length */ + ); + + +/* Fast access macros */ + +Py_DEPRECATED(3.3) +static inline Py_ssize_t PyUnicode_WSTR_LENGTH(PyObject *op) +{ + if (PyUnicode_IS_COMPACT_ASCII(op)) { + return _PyASCIIObject_CAST(op)->length; + } + else { + return _PyCompactUnicodeObject_CAST(op)->wstr_length; + } +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +# define PyUnicode_WSTR_LENGTH(op) PyUnicode_WSTR_LENGTH(_PyObject_CAST(op)) +#endif + +/* Returns the deprecated Py_UNICODE representation's size in code units + (this includes surrogate pairs as 2 units). + If the Py_UNICODE representation is not available, it will be computed + on request. Use PyUnicode_GET_LENGTH() for the length in code points. */ + +Py_DEPRECATED(3.3) +static inline Py_ssize_t PyUnicode_GET_SIZE(PyObject *op) +{ + _Py_COMP_DIAG_PUSH + _Py_COMP_DIAG_IGNORE_DEPR_DECLS + if (_PyASCIIObject_CAST(op)->wstr == _Py_NULL) { + (void)PyUnicode_AsUnicode(op); + assert(_PyASCIIObject_CAST(op)->wstr != _Py_NULL); + } + return PyUnicode_WSTR_LENGTH(op); + _Py_COMP_DIAG_POP +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +# define PyUnicode_GET_SIZE(op) PyUnicode_GET_SIZE(_PyObject_CAST(op)) +#endif + +Py_DEPRECATED(3.3) +static inline Py_ssize_t PyUnicode_GET_DATA_SIZE(PyObject *op) +{ + _Py_COMP_DIAG_PUSH + _Py_COMP_DIAG_IGNORE_DEPR_DECLS + return PyUnicode_GET_SIZE(op) * Py_UNICODE_SIZE; + _Py_COMP_DIAG_POP +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +# define PyUnicode_GET_DATA_SIZE(op) PyUnicode_GET_DATA_SIZE(_PyObject_CAST(op)) +#endif + +/* Alias for PyUnicode_AsUnicode(). This will create a wchar_t/Py_UNICODE + representation on demand. Using this macro is very inefficient now, + try to port your code to use the new PyUnicode_*BYTE_DATA() macros or + use PyUnicode_WRITE() and PyUnicode_READ(). */ + +Py_DEPRECATED(3.3) +static inline Py_UNICODE* PyUnicode_AS_UNICODE(PyObject *op) +{ + wchar_t *wstr = _PyASCIIObject_CAST(op)->wstr; + if (wstr != _Py_NULL) { + return wstr; + } + + _Py_COMP_DIAG_PUSH + _Py_COMP_DIAG_IGNORE_DEPR_DECLS + return PyUnicode_AsUnicode(op); + _Py_COMP_DIAG_POP +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +# define PyUnicode_AS_UNICODE(op) PyUnicode_AS_UNICODE(_PyObject_CAST(op)) +#endif + +Py_DEPRECATED(3.3) +static inline const char* PyUnicode_AS_DATA(PyObject *op) +{ + _Py_COMP_DIAG_PUSH + _Py_COMP_DIAG_IGNORE_DEPR_DECLS + Py_UNICODE *data = PyUnicode_AS_UNICODE(op); + // In C++, casting directly PyUnicode* to const char* is not valid + return _Py_STATIC_CAST(const char*, _Py_STATIC_CAST(const void*, data)); + _Py_COMP_DIAG_POP +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +# define PyUnicode_AS_DATA(op) PyUnicode_AS_DATA(_PyObject_CAST(op)) +#endif + + +/* --- _PyUnicodeWriter API ----------------------------------------------- */ + +typedef struct { + PyObject *buffer; + void *data; + enum PyUnicode_Kind kind; + Py_UCS4 maxchar; + Py_ssize_t size; + Py_ssize_t pos; + + /* minimum number of allocated characters (default: 0) */ + Py_ssize_t min_length; + + /* minimum character (default: 127, ASCII) */ + Py_UCS4 min_char; + + /* If non-zero, overallocate the buffer (default: 0). */ + unsigned char overallocate; + + /* If readonly is 1, buffer is a shared string (cannot be modified) + and size is set to 0. */ + unsigned char readonly; +} _PyUnicodeWriter ; + +/* Initialize a Unicode writer. + * + * By default, the minimum buffer size is 0 character and overallocation is + * disabled. Set min_length, min_char and overallocate attributes to control + * the allocation of the buffer. */ +PyAPI_FUNC(void) +_PyUnicodeWriter_Init(_PyUnicodeWriter *writer); + +/* Prepare the buffer to write 'length' characters + with the specified maximum character. + + Return 0 on success, raise an exception and return -1 on error. */ +#define _PyUnicodeWriter_Prepare(WRITER, LENGTH, MAXCHAR) \ + (((MAXCHAR) <= (WRITER)->maxchar \ + && (LENGTH) <= (WRITER)->size - (WRITER)->pos) \ + ? 0 \ + : (((LENGTH) == 0) \ + ? 0 \ + : _PyUnicodeWriter_PrepareInternal((WRITER), (LENGTH), (MAXCHAR)))) + +/* Don't call this function directly, use the _PyUnicodeWriter_Prepare() macro + instead. */ +PyAPI_FUNC(int) +_PyUnicodeWriter_PrepareInternal(_PyUnicodeWriter *writer, + Py_ssize_t length, Py_UCS4 maxchar); + +/* Prepare the buffer to have at least the kind KIND. + For example, kind=PyUnicode_2BYTE_KIND ensures that the writer will + support characters in range U+000-U+FFFF. + + Return 0 on success, raise an exception and return -1 on error. */ +#define _PyUnicodeWriter_PrepareKind(WRITER, KIND) \ + (assert((KIND) != PyUnicode_WCHAR_KIND), \ + (KIND) <= (WRITER)->kind \ + ? 0 \ + : _PyUnicodeWriter_PrepareKindInternal((WRITER), (KIND))) + +/* Don't call this function directly, use the _PyUnicodeWriter_PrepareKind() + macro instead. */ +PyAPI_FUNC(int) +_PyUnicodeWriter_PrepareKindInternal(_PyUnicodeWriter *writer, + enum PyUnicode_Kind kind); + +/* Append a Unicode character. + Return 0 on success, raise an exception and return -1 on error. */ +PyAPI_FUNC(int) +_PyUnicodeWriter_WriteChar(_PyUnicodeWriter *writer, + Py_UCS4 ch + ); + +/* Append a Unicode string. + Return 0 on success, raise an exception and return -1 on error. */ +PyAPI_FUNC(int) +_PyUnicodeWriter_WriteStr(_PyUnicodeWriter *writer, + PyObject *str /* Unicode string */ + ); + +/* Append a substring of a Unicode string. + Return 0 on success, raise an exception and return -1 on error. */ +PyAPI_FUNC(int) +_PyUnicodeWriter_WriteSubstring(_PyUnicodeWriter *writer, + PyObject *str, /* Unicode string */ + Py_ssize_t start, + Py_ssize_t end + ); + +/* Append an ASCII-encoded byte string. + Return 0 on success, raise an exception and return -1 on error. */ +PyAPI_FUNC(int) +_PyUnicodeWriter_WriteASCIIString(_PyUnicodeWriter *writer, + const char *str, /* ASCII-encoded byte string */ + Py_ssize_t len /* number of bytes, or -1 if unknown */ + ); + +/* Append a latin1-encoded byte string. + Return 0 on success, raise an exception and return -1 on error. */ +PyAPI_FUNC(int) +_PyUnicodeWriter_WriteLatin1String(_PyUnicodeWriter *writer, + const char *str, /* latin1-encoded byte string */ + Py_ssize_t len /* length in bytes */ + ); + +/* Get the value of the writer as a Unicode string. Clear the + buffer of the writer. Raise an exception and return NULL + on error. */ +PyAPI_FUNC(PyObject *) +_PyUnicodeWriter_Finish(_PyUnicodeWriter *writer); + +/* Deallocate memory of a writer (clear its internal buffer). */ +PyAPI_FUNC(void) +_PyUnicodeWriter_Dealloc(_PyUnicodeWriter *writer); + + +/* Format the object based on the format_spec, as defined in PEP 3101 + (Advanced String Formatting). */ +PyAPI_FUNC(int) _PyUnicode_FormatAdvancedWriter( + _PyUnicodeWriter *writer, + PyObject *obj, + PyObject *format_spec, + Py_ssize_t start, + Py_ssize_t end); + +/* --- Manage the default encoding ---------------------------------------- */ + +/* Returns a pointer to the default encoding (UTF-8) of the + Unicode object unicode. + + Like PyUnicode_AsUTF8AndSize(), this also caches the UTF-8 representation + in the unicodeobject. + + _PyUnicode_AsString is a #define for PyUnicode_AsUTF8 to + support the previous internal function with the same behaviour. + + Use of this API is DEPRECATED since no size information can be + extracted from the returned data. +*/ + +PyAPI_FUNC(const char *) PyUnicode_AsUTF8(PyObject *unicode); + +#define _PyUnicode_AsString PyUnicode_AsUTF8 + +/* --- UTF-7 Codecs ------------------------------------------------------- */ + +PyAPI_FUNC(PyObject*) _PyUnicode_EncodeUTF7( + PyObject *unicode, /* Unicode object */ + int base64SetO, /* Encode RFC2152 Set O characters in base64 */ + int base64WhiteSpace, /* Encode whitespace (sp, ht, nl, cr) in base64 */ + const char *errors /* error handling */ + ); + +/* --- UTF-8 Codecs ------------------------------------------------------- */ + +PyAPI_FUNC(PyObject*) _PyUnicode_AsUTF8String( + PyObject *unicode, + const char *errors); + +/* --- UTF-32 Codecs ------------------------------------------------------ */ + +PyAPI_FUNC(PyObject*) _PyUnicode_EncodeUTF32( + PyObject *object, /* Unicode object */ + const char *errors, /* error handling */ + int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */ + ); + +/* --- UTF-16 Codecs ------------------------------------------------------ */ + +/* Returns a Python string object holding the UTF-16 encoded value of + the Unicode data. + + If byteorder is not 0, output is written according to the following + byte order: + + byteorder == -1: little endian + byteorder == 0: native byte order (writes a BOM mark) + byteorder == 1: big endian + + If byteorder is 0, the output string will always start with the + Unicode BOM mark (U+FEFF). In the other two modes, no BOM mark is + prepended. +*/ +PyAPI_FUNC(PyObject*) _PyUnicode_EncodeUTF16( + PyObject* unicode, /* Unicode object */ + const char *errors, /* error handling */ + int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */ + ); + +/* --- Unicode-Escape Codecs ---------------------------------------------- */ + +/* Variant of PyUnicode_DecodeUnicodeEscape that supports partial decoding. */ +PyAPI_FUNC(PyObject*) _PyUnicode_DecodeUnicodeEscapeStateful( + const char *string, /* Unicode-Escape encoded string */ + Py_ssize_t length, /* size of string */ + const char *errors, /* error handling */ + Py_ssize_t *consumed /* bytes consumed */ +); +/* Helper for PyUnicode_DecodeUnicodeEscape that detects invalid escape + chars. */ +PyAPI_FUNC(PyObject*) _PyUnicode_DecodeUnicodeEscapeInternal2( + const char *string, /* Unicode-Escape encoded string */ + Py_ssize_t length, /* size of string */ + const char *errors, /* error handling */ + Py_ssize_t *consumed, /* bytes consumed */ + int *first_invalid_escape_char, /* on return, if not -1, contain the first + invalid escaped char (<= 0xff) or invalid + octal escape (> 0xff) in string. */ + const char **first_invalid_escape_ptr); /* on return, if not NULL, may + point to the first invalid escaped + char in string. + May be NULL if errors is not NULL. */ +// Export for binary compatibility. +PyAPI_FUNC(PyObject*) _PyUnicode_DecodeUnicodeEscapeInternal( + const char *string, /* Unicode-Escape encoded string */ + Py_ssize_t length, /* size of string */ + const char *errors, /* error handling */ + Py_ssize_t *consumed, /* bytes consumed */ + const char **first_invalid_escape /* on return, points to first + invalid escaped char in + string. */ +); + +/* --- Raw-Unicode-Escape Codecs ---------------------------------------------- */ + +/* Variant of PyUnicode_DecodeRawUnicodeEscape that supports partial decoding. */ +PyAPI_FUNC(PyObject*) _PyUnicode_DecodeRawUnicodeEscapeStateful( + const char *string, /* Unicode-Escape encoded string */ + Py_ssize_t length, /* size of string */ + const char *errors, /* error handling */ + Py_ssize_t *consumed /* bytes consumed */ +); + +/* --- Latin-1 Codecs ----------------------------------------------------- */ + +PyAPI_FUNC(PyObject*) _PyUnicode_AsLatin1String( + PyObject* unicode, + const char* errors); + +/* --- ASCII Codecs ------------------------------------------------------- */ + +PyAPI_FUNC(PyObject*) _PyUnicode_AsASCIIString( + PyObject* unicode, + const char* errors); + +/* --- Character Map Codecs ----------------------------------------------- */ + +/* Translate an Unicode object by applying a character mapping table to + it and return the resulting Unicode object. + + The mapping table must map Unicode ordinal integers to Unicode strings, + Unicode ordinal integers or None (causing deletion of the character). + + Mapping tables may be dictionaries or sequences. Unmapped character + ordinals (ones which cause a LookupError) are left untouched and + are copied as-is. +*/ +PyAPI_FUNC(PyObject*) _PyUnicode_EncodeCharmap( + PyObject *unicode, /* Unicode object */ + PyObject *mapping, /* encoding mapping */ + const char *errors /* error handling */ + ); + +/* --- Decimal Encoder ---------------------------------------------------- */ + +/* Coverts a Unicode object holding a decimal value to an ASCII string + for using in int, float and complex parsers. + Transforms code points that have decimal digit property to the + corresponding ASCII digit code points. Transforms spaces to ASCII. + Transforms code points starting from the first non-ASCII code point that + is neither a decimal digit nor a space to the end into '?'. */ + +PyAPI_FUNC(PyObject*) _PyUnicode_TransformDecimalAndSpaceToASCII( + PyObject *unicode /* Unicode object */ + ); + +/* --- Methods & Slots ---------------------------------------------------- */ + +PyAPI_FUNC(PyObject *) _PyUnicode_JoinArray( + PyObject *separator, + PyObject *const *items, + Py_ssize_t seqlen + ); + +/* Test whether a unicode is equal to ASCII identifier. Return 1 if true, + 0 otherwise. The right argument must be ASCII identifier. + Any error occurs inside will be cleared before return. */ +PyAPI_FUNC(int) _PyUnicode_EqualToASCIIId( + PyObject *left, /* Left string */ + _Py_Identifier *right /* Right identifier */ + ); + +/* Test whether a unicode is equal to ASCII string. Return 1 if true, + 0 otherwise. The right argument must be ASCII-encoded string. + Any error occurs inside will be cleared before return. */ +PyAPI_FUNC(int) _PyUnicode_EqualToASCIIString( + PyObject *left, + const char *right /* ASCII-encoded string */ + ); + +/* Externally visible for str.strip(unicode) */ +PyAPI_FUNC(PyObject *) _PyUnicode_XStrip( + PyObject *self, + int striptype, + PyObject *sepobj + ); + +/* Using explicit passed-in values, insert the thousands grouping + into the string pointed to by buffer. For the argument descriptions, + see Objects/stringlib/localeutil.h */ +PyAPI_FUNC(Py_ssize_t) _PyUnicode_InsertThousandsGrouping( + _PyUnicodeWriter *writer, + Py_ssize_t n_buffer, + PyObject *digits, + Py_ssize_t d_pos, + Py_ssize_t n_digits, + Py_ssize_t min_width, + const char *grouping, + PyObject *thousands_sep, + Py_UCS4 *maxchar); + +/* === Characters Type APIs =============================================== */ + +/* Helper array used by Py_UNICODE_ISSPACE(). */ + +PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[]; + +/* These should not be used directly. Use the Py_UNICODE_IS* and + Py_UNICODE_TO* macros instead. + + These APIs are implemented in Objects/unicodectype.c. + +*/ + +PyAPI_FUNC(int) _PyUnicode_IsLowercase( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsUppercase( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsTitlecase( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsXidStart( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsXidContinue( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsWhitespace( + const Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsLinebreak( + const Py_UCS4 ch /* Unicode character */ + ); + +/* Py_DEPRECATED(3.3) */ PyAPI_FUNC(Py_UCS4) _PyUnicode_ToLowercase( + Py_UCS4 ch /* Unicode character */ + ); + +/* Py_DEPRECATED(3.3) */ PyAPI_FUNC(Py_UCS4) _PyUnicode_ToUppercase( + Py_UCS4 ch /* Unicode character */ + ); + +Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UCS4) _PyUnicode_ToTitlecase( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_ToLowerFull( + Py_UCS4 ch, /* Unicode character */ + Py_UCS4 *res + ); + +PyAPI_FUNC(int) _PyUnicode_ToTitleFull( + Py_UCS4 ch, /* Unicode character */ + Py_UCS4 *res + ); + +PyAPI_FUNC(int) _PyUnicode_ToUpperFull( + Py_UCS4 ch, /* Unicode character */ + Py_UCS4 *res + ); + +PyAPI_FUNC(int) _PyUnicode_ToFoldedFull( + Py_UCS4 ch, /* Unicode character */ + Py_UCS4 *res + ); + +PyAPI_FUNC(int) _PyUnicode_IsCaseIgnorable( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsCased( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_ToDecimalDigit( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_ToDigit( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(double) _PyUnicode_ToNumeric( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsDecimalDigit( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsDigit( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsNumeric( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsPrintable( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(int) _PyUnicode_IsAlpha( + Py_UCS4 ch /* Unicode character */ + ); + +PyAPI_FUNC(PyObject*) _PyUnicode_FormatLong(PyObject *, int, int, int); + +/* Return an interned Unicode object for an Identifier; may fail if there is no memory.*/ +PyAPI_FUNC(PyObject*) _PyUnicode_FromId(_Py_Identifier*); + +/* Fast equality check when the inputs are known to be exact unicode types + and where the hash values are equal (i.e. a very probable match) */ +PyAPI_FUNC(int) _PyUnicode_EQ(PyObject *, PyObject *); + +/* Equality check. Returns -1 on failure. */ +PyAPI_FUNC(int) _PyUnicode_Equal(PyObject *, PyObject *); + +PyAPI_FUNC(int) _PyUnicode_WideCharString_Converter(PyObject *, void *); +PyAPI_FUNC(int) _PyUnicode_WideCharString_Opt_Converter(PyObject *, void *); + +PyAPI_FUNC(Py_ssize_t) _PyUnicode_ScanIdentifier(PyObject *); diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/warnings.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/warnings.h new file mode 100644 index 0000000000000000000000000000000000000000..2ef8e3ce9435f4053d096b403e0434e4fe874ccb --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/warnings.h @@ -0,0 +1,20 @@ +#ifndef Py_CPYTHON_WARNINGS_H +# error "this header file must not be included directly" +#endif + +PyAPI_FUNC(int) PyErr_WarnExplicitObject( + PyObject *category, + PyObject *message, + PyObject *filename, + int lineno, + PyObject *module, + PyObject *registry); + +PyAPI_FUNC(int) PyErr_WarnExplicitFormat( + PyObject *category, + const char *filename, int lineno, + const char *module, PyObject *registry, + const char *format, ...); + +// DEPRECATED: Use PyErr_WarnEx() instead. +#define PyErr_Warn(category, msg) PyErr_WarnEx(category, msg, 1) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/weakrefobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/weakrefobject.h new file mode 100644 index 0000000000000000000000000000000000000000..26b364f41d4d7e7e9e3824fb450770d338955a8c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/cpython/weakrefobject.h @@ -0,0 +1,58 @@ +#ifndef Py_CPYTHON_WEAKREFOBJECT_H +# error "this header file must not be included directly" +#endif + +/* PyWeakReference is the base struct for the Python ReferenceType, ProxyType, + * and CallableProxyType. + */ +struct _PyWeakReference { + PyObject_HEAD + + /* The object to which this is a weak reference, or Py_None if none. + * Note that this is a stealth reference: wr_object's refcount is + * not incremented to reflect this pointer. + */ + PyObject *wr_object; + + /* A callable to invoke when wr_object dies, or NULL if none. */ + PyObject *wr_callback; + + /* A cache for wr_object's hash code. As usual for hashes, this is -1 + * if the hash code isn't known yet. + */ + Py_hash_t hash; + + /* If wr_object is weakly referenced, wr_object has a doubly-linked NULL- + * terminated list of weak references to it. These are the list pointers. + * If wr_object goes away, wr_object is set to Py_None, and these pointers + * have no meaning then. + */ + PyWeakReference *wr_prev; + PyWeakReference *wr_next; + vectorcallfunc vectorcall; +}; + +PyAPI_FUNC(Py_ssize_t) _PyWeakref_GetWeakrefCount(PyWeakReference *head); + +PyAPI_FUNC(void) _PyWeakref_ClearRef(PyWeakReference *self); + +static inline PyObject* PyWeakref_GET_OBJECT(PyObject *ref_obj) { + PyWeakReference *ref; + PyObject *obj; + assert(PyWeakref_Check(ref_obj)); + ref = _Py_CAST(PyWeakReference*, ref_obj); + obj = ref->wr_object; + // Explanation for the Py_REFCNT() check: when a weakref's target is part + // of a long chain of deallocations which triggers the trashcan mechanism, + // clearing the weakrefs can be delayed long after the target's refcount + // has dropped to zero. In the meantime, code accessing the weakref will + // be able to "see" the target object even though it is supposed to be + // unreachable. See issue gh-60806. + if (Py_REFCNT(obj) > 0) { + return obj; + } + return Py_None; +} +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +# define PyWeakref_GET_OBJECT(ref) PyWeakref_GET_OBJECT(_PyObject_CAST(ref)) +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_abstract.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_abstract.h new file mode 100644 index 0000000000000000000000000000000000000000..b1afb2dc7be65e6442da153b051689f5b7e96ad8 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_abstract.h @@ -0,0 +1,25 @@ +#ifndef Py_INTERNAL_ABSTRACT_H +#define Py_INTERNAL_ABSTRACT_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +// Fast inlined version of PyIndex_Check() +static inline int +_PyIndex_Check(PyObject *obj) +{ + PyNumberMethods *tp_as_number = Py_TYPE(obj)->tp_as_number; + return (tp_as_number != NULL && tp_as_number->nb_index != NULL); +} + +PyObject *_PyNumber_PowerNoMod(PyObject *lhs, PyObject *rhs); +PyObject *_PyNumber_InPlacePowerNoMod(PyObject *lhs, PyObject *rhs); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_ABSTRACT_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_accu.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_accu.h new file mode 100644 index 0000000000000000000000000000000000000000..d346222e4dd0c9789f01ca1b97c96124bc01abae --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_accu.h @@ -0,0 +1,39 @@ +#ifndef Py_LIMITED_API +#ifndef Py_INTERNAL_ACCU_H +#define Py_INTERNAL_ACCU_H +#ifdef __cplusplus +extern "C" { +#endif + +/*** This is a private API for use by the interpreter and the stdlib. + *** Its definition may be changed or removed at any moment. + ***/ + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +/* + * A two-level accumulator of unicode objects that avoids both the overhead + * of keeping a huge number of small separate objects, and the quadratic + * behaviour of using a naive repeated concatenation scheme. + */ + +#undef small /* defined by some Windows headers */ + +typedef struct { + PyObject *large; /* A list of previously accumulated large strings */ + PyObject *small; /* Pending small strings */ +} _PyAccu; + +PyAPI_FUNC(int) _PyAccu_Init(_PyAccu *acc); +PyAPI_FUNC(int) _PyAccu_Accumulate(_PyAccu *acc, PyObject *unicode); +PyAPI_FUNC(PyObject *) _PyAccu_FinishAsList(_PyAccu *acc); +PyAPI_FUNC(PyObject *) _PyAccu_Finish(_PyAccu *acc); +PyAPI_FUNC(void) _PyAccu_Destroy(_PyAccu *acc); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_ACCU_H */ +#endif /* !Py_LIMITED_API */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_asdl.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_asdl.h new file mode 100644 index 0000000000000000000000000000000000000000..5b01c7a66599e916f25fe5a7859d149db4a87fdc --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_asdl.h @@ -0,0 +1,112 @@ +#ifndef Py_INTERNAL_ASDL_H +#define Py_INTERNAL_ASDL_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_pyarena.h" // _PyArena_Malloc() + +typedef PyObject * identifier; +typedef PyObject * string; +typedef PyObject * object; +typedef PyObject * constant; + +/* It would be nice if the code generated by asdl_c.py was completely + independent of Python, but it is a goal the requires too much work + at this stage. So, for example, I'll represent identifiers as + interned Python strings. +*/ + +#define _ASDL_SEQ_HEAD \ + Py_ssize_t size; \ + void **elements; + +typedef struct { + _ASDL_SEQ_HEAD +} asdl_seq; + +typedef struct { + _ASDL_SEQ_HEAD + void *typed_elements[1]; +} asdl_generic_seq; + +typedef struct { + _ASDL_SEQ_HEAD + PyObject *typed_elements[1]; +} asdl_identifier_seq; + +typedef struct { + _ASDL_SEQ_HEAD + int typed_elements[1]; +} asdl_int_seq; + +asdl_generic_seq *_Py_asdl_generic_seq_new(Py_ssize_t size, PyArena *arena); +asdl_identifier_seq *_Py_asdl_identifier_seq_new(Py_ssize_t size, PyArena *arena); +asdl_int_seq *_Py_asdl_int_seq_new(Py_ssize_t size, PyArena *arena); + + +#define GENERATE_ASDL_SEQ_CONSTRUCTOR(NAME, TYPE) \ +asdl_ ## NAME ## _seq *_Py_asdl_ ## NAME ## _seq_new(Py_ssize_t size, PyArena *arena) \ +{ \ + asdl_ ## NAME ## _seq *seq = NULL; \ + size_t n; \ + /* check size is sane */ \ + if (size < 0 || \ + (size && (((size_t)size - 1) > (SIZE_MAX / sizeof(void *))))) { \ + PyErr_NoMemory(); \ + return NULL; \ + } \ + n = (size ? (sizeof(TYPE *) * (size - 1)) : 0); \ + /* check if size can be added safely */ \ + if (n > SIZE_MAX - sizeof(asdl_ ## NAME ## _seq)) { \ + PyErr_NoMemory(); \ + return NULL; \ + } \ + n += sizeof(asdl_ ## NAME ## _seq); \ + seq = (asdl_ ## NAME ## _seq *)_PyArena_Malloc(arena, n); \ + if (!seq) { \ + PyErr_NoMemory(); \ + return NULL; \ + } \ + memset(seq, 0, n); \ + seq->size = size; \ + seq->elements = (void**)seq->typed_elements; \ + return seq; \ +} + +#define asdl_seq_GET_UNTYPED(S, I) _Py_RVALUE((S)->elements[(I)]) +#define asdl_seq_GET(S, I) _Py_RVALUE((S)->typed_elements[(I)]) +#define asdl_seq_LEN(S) _Py_RVALUE(((S) == NULL ? 0 : (S)->size)) + +#ifdef Py_DEBUG +# define asdl_seq_SET(S, I, V) \ + do { \ + Py_ssize_t _asdl_i = (I); \ + assert((S) != NULL); \ + assert(0 <= _asdl_i && _asdl_i < (S)->size); \ + (S)->typed_elements[_asdl_i] = (V); \ + } while (0) +#else +# define asdl_seq_SET(S, I, V) _Py_RVALUE((S)->typed_elements[I] = (V)) +#endif + +#ifdef Py_DEBUG +# define asdl_seq_SET_UNTYPED(S, I, V) \ + do { \ + Py_ssize_t _asdl_i = (I); \ + assert((S) != NULL); \ + assert(0 <= _asdl_i && _asdl_i < (S)->size); \ + (S)->elements[_asdl_i] = (V); \ + } while (0) +#else +# define asdl_seq_SET_UNTYPED(S, I, V) _Py_RVALUE((S)->elements[I] = (V)) +#endif + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_ASDL_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_ast.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_ast.h new file mode 100644 index 0000000000000000000000000000000000000000..36277efe9c5ca53bcf2e6dd82354b066af8aa012 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_ast.h @@ -0,0 +1,866 @@ +// File automatically generated by Parser/asdl_c.py. + +#ifndef Py_INTERNAL_AST_H +#define Py_INTERNAL_AST_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_asdl.h" + +typedef struct _mod *mod_ty; + +typedef struct _stmt *stmt_ty; + +typedef struct _expr *expr_ty; + +typedef enum _expr_context { Load=1, Store=2, Del=3 } expr_context_ty; + +typedef enum _boolop { And=1, Or=2 } boolop_ty; + +typedef enum _operator { Add=1, Sub=2, Mult=3, MatMult=4, Div=5, Mod=6, Pow=7, + LShift=8, RShift=9, BitOr=10, BitXor=11, BitAnd=12, + FloorDiv=13 } operator_ty; + +typedef enum _unaryop { Invert=1, Not=2, UAdd=3, USub=4 } unaryop_ty; + +typedef enum _cmpop { Eq=1, NotEq=2, Lt=3, LtE=4, Gt=5, GtE=6, Is=7, IsNot=8, + In=9, NotIn=10 } cmpop_ty; + +typedef struct _comprehension *comprehension_ty; + +typedef struct _excepthandler *excepthandler_ty; + +typedef struct _arguments *arguments_ty; + +typedef struct _arg *arg_ty; + +typedef struct _keyword *keyword_ty; + +typedef struct _alias *alias_ty; + +typedef struct _withitem *withitem_ty; + +typedef struct _match_case *match_case_ty; + +typedef struct _pattern *pattern_ty; + +typedef struct _type_ignore *type_ignore_ty; + + +typedef struct { + _ASDL_SEQ_HEAD + mod_ty typed_elements[1]; +} asdl_mod_seq; + +asdl_mod_seq *_Py_asdl_mod_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + stmt_ty typed_elements[1]; +} asdl_stmt_seq; + +asdl_stmt_seq *_Py_asdl_stmt_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + expr_ty typed_elements[1]; +} asdl_expr_seq; + +asdl_expr_seq *_Py_asdl_expr_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + comprehension_ty typed_elements[1]; +} asdl_comprehension_seq; + +asdl_comprehension_seq *_Py_asdl_comprehension_seq_new(Py_ssize_t size, PyArena + *arena); + +typedef struct { + _ASDL_SEQ_HEAD + excepthandler_ty typed_elements[1]; +} asdl_excepthandler_seq; + +asdl_excepthandler_seq *_Py_asdl_excepthandler_seq_new(Py_ssize_t size, PyArena + *arena); + +typedef struct { + _ASDL_SEQ_HEAD + arguments_ty typed_elements[1]; +} asdl_arguments_seq; + +asdl_arguments_seq *_Py_asdl_arguments_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + arg_ty typed_elements[1]; +} asdl_arg_seq; + +asdl_arg_seq *_Py_asdl_arg_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + keyword_ty typed_elements[1]; +} asdl_keyword_seq; + +asdl_keyword_seq *_Py_asdl_keyword_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + alias_ty typed_elements[1]; +} asdl_alias_seq; + +asdl_alias_seq *_Py_asdl_alias_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + withitem_ty typed_elements[1]; +} asdl_withitem_seq; + +asdl_withitem_seq *_Py_asdl_withitem_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + match_case_ty typed_elements[1]; +} asdl_match_case_seq; + +asdl_match_case_seq *_Py_asdl_match_case_seq_new(Py_ssize_t size, PyArena + *arena); + +typedef struct { + _ASDL_SEQ_HEAD + pattern_ty typed_elements[1]; +} asdl_pattern_seq; + +asdl_pattern_seq *_Py_asdl_pattern_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + type_ignore_ty typed_elements[1]; +} asdl_type_ignore_seq; + +asdl_type_ignore_seq *_Py_asdl_type_ignore_seq_new(Py_ssize_t size, PyArena + *arena); + + +enum _mod_kind {Module_kind=1, Interactive_kind=2, Expression_kind=3, + FunctionType_kind=4}; +struct _mod { + enum _mod_kind kind; + union { + struct { + asdl_stmt_seq *body; + asdl_type_ignore_seq *type_ignores; + } Module; + + struct { + asdl_stmt_seq *body; + } Interactive; + + struct { + expr_ty body; + } Expression; + + struct { + asdl_expr_seq *argtypes; + expr_ty returns; + } FunctionType; + + } v; +}; + +enum _stmt_kind {FunctionDef_kind=1, AsyncFunctionDef_kind=2, ClassDef_kind=3, + Return_kind=4, Delete_kind=5, Assign_kind=6, + AugAssign_kind=7, AnnAssign_kind=8, For_kind=9, + AsyncFor_kind=10, While_kind=11, If_kind=12, With_kind=13, + AsyncWith_kind=14, Match_kind=15, Raise_kind=16, Try_kind=17, + TryStar_kind=18, Assert_kind=19, Import_kind=20, + ImportFrom_kind=21, Global_kind=22, Nonlocal_kind=23, + Expr_kind=24, Pass_kind=25, Break_kind=26, Continue_kind=27}; +struct _stmt { + enum _stmt_kind kind; + union { + struct { + identifier name; + arguments_ty args; + asdl_stmt_seq *body; + asdl_expr_seq *decorator_list; + expr_ty returns; + string type_comment; + } FunctionDef; + + struct { + identifier name; + arguments_ty args; + asdl_stmt_seq *body; + asdl_expr_seq *decorator_list; + expr_ty returns; + string type_comment; + } AsyncFunctionDef; + + struct { + identifier name; + asdl_expr_seq *bases; + asdl_keyword_seq *keywords; + asdl_stmt_seq *body; + asdl_expr_seq *decorator_list; + } ClassDef; + + struct { + expr_ty value; + } Return; + + struct { + asdl_expr_seq *targets; + } Delete; + + struct { + asdl_expr_seq *targets; + expr_ty value; + string type_comment; + } Assign; + + struct { + expr_ty target; + operator_ty op; + expr_ty value; + } AugAssign; + + struct { + expr_ty target; + expr_ty annotation; + expr_ty value; + int simple; + } AnnAssign; + + struct { + expr_ty target; + expr_ty iter; + asdl_stmt_seq *body; + asdl_stmt_seq *orelse; + string type_comment; + } For; + + struct { + expr_ty target; + expr_ty iter; + asdl_stmt_seq *body; + asdl_stmt_seq *orelse; + string type_comment; + } AsyncFor; + + struct { + expr_ty test; + asdl_stmt_seq *body; + asdl_stmt_seq *orelse; + } While; + + struct { + expr_ty test; + asdl_stmt_seq *body; + asdl_stmt_seq *orelse; + } If; + + struct { + asdl_withitem_seq *items; + asdl_stmt_seq *body; + string type_comment; + } With; + + struct { + asdl_withitem_seq *items; + asdl_stmt_seq *body; + string type_comment; + } AsyncWith; + + struct { + expr_ty subject; + asdl_match_case_seq *cases; + } Match; + + struct { + expr_ty exc; + expr_ty cause; + } Raise; + + struct { + asdl_stmt_seq *body; + asdl_excepthandler_seq *handlers; + asdl_stmt_seq *orelse; + asdl_stmt_seq *finalbody; + } Try; + + struct { + asdl_stmt_seq *body; + asdl_excepthandler_seq *handlers; + asdl_stmt_seq *orelse; + asdl_stmt_seq *finalbody; + } TryStar; + + struct { + expr_ty test; + expr_ty msg; + } Assert; + + struct { + asdl_alias_seq *names; + } Import; + + struct { + identifier module; + asdl_alias_seq *names; + int level; + } ImportFrom; + + struct { + asdl_identifier_seq *names; + } Global; + + struct { + asdl_identifier_seq *names; + } Nonlocal; + + struct { + expr_ty value; + } Expr; + + } v; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; +}; + +enum _expr_kind {BoolOp_kind=1, NamedExpr_kind=2, BinOp_kind=3, UnaryOp_kind=4, + Lambda_kind=5, IfExp_kind=6, Dict_kind=7, Set_kind=8, + ListComp_kind=9, SetComp_kind=10, DictComp_kind=11, + GeneratorExp_kind=12, Await_kind=13, Yield_kind=14, + YieldFrom_kind=15, Compare_kind=16, Call_kind=17, + FormattedValue_kind=18, JoinedStr_kind=19, Constant_kind=20, + Attribute_kind=21, Subscript_kind=22, Starred_kind=23, + Name_kind=24, List_kind=25, Tuple_kind=26, Slice_kind=27}; +struct _expr { + enum _expr_kind kind; + union { + struct { + boolop_ty op; + asdl_expr_seq *values; + } BoolOp; + + struct { + expr_ty target; + expr_ty value; + } NamedExpr; + + struct { + expr_ty left; + operator_ty op; + expr_ty right; + } BinOp; + + struct { + unaryop_ty op; + expr_ty operand; + } UnaryOp; + + struct { + arguments_ty args; + expr_ty body; + } Lambda; + + struct { + expr_ty test; + expr_ty body; + expr_ty orelse; + } IfExp; + + struct { + asdl_expr_seq *keys; + asdl_expr_seq *values; + } Dict; + + struct { + asdl_expr_seq *elts; + } Set; + + struct { + expr_ty elt; + asdl_comprehension_seq *generators; + } ListComp; + + struct { + expr_ty elt; + asdl_comprehension_seq *generators; + } SetComp; + + struct { + expr_ty key; + expr_ty value; + asdl_comprehension_seq *generators; + } DictComp; + + struct { + expr_ty elt; + asdl_comprehension_seq *generators; + } GeneratorExp; + + struct { + expr_ty value; + } Await; + + struct { + expr_ty value; + } Yield; + + struct { + expr_ty value; + } YieldFrom; + + struct { + expr_ty left; + asdl_int_seq *ops; + asdl_expr_seq *comparators; + } Compare; + + struct { + expr_ty func; + asdl_expr_seq *args; + asdl_keyword_seq *keywords; + } Call; + + struct { + expr_ty value; + int conversion; + expr_ty format_spec; + } FormattedValue; + + struct { + asdl_expr_seq *values; + } JoinedStr; + + struct { + constant value; + string kind; + } Constant; + + struct { + expr_ty value; + identifier attr; + expr_context_ty ctx; + } Attribute; + + struct { + expr_ty value; + expr_ty slice; + expr_context_ty ctx; + } Subscript; + + struct { + expr_ty value; + expr_context_ty ctx; + } Starred; + + struct { + identifier id; + expr_context_ty ctx; + } Name; + + struct { + asdl_expr_seq *elts; + expr_context_ty ctx; + } List; + + struct { + asdl_expr_seq *elts; + expr_context_ty ctx; + } Tuple; + + struct { + expr_ty lower; + expr_ty upper; + expr_ty step; + } Slice; + + } v; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; +}; + +struct _comprehension { + expr_ty target; + expr_ty iter; + asdl_expr_seq *ifs; + int is_async; +}; + +enum _excepthandler_kind {ExceptHandler_kind=1}; +struct _excepthandler { + enum _excepthandler_kind kind; + union { + struct { + expr_ty type; + identifier name; + asdl_stmt_seq *body; + } ExceptHandler; + + } v; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; +}; + +struct _arguments { + asdl_arg_seq *posonlyargs; + asdl_arg_seq *args; + arg_ty vararg; + asdl_arg_seq *kwonlyargs; + asdl_expr_seq *kw_defaults; + arg_ty kwarg; + asdl_expr_seq *defaults; +}; + +struct _arg { + identifier arg; + expr_ty annotation; + string type_comment; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; +}; + +struct _keyword { + identifier arg; + expr_ty value; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; +}; + +struct _alias { + identifier name; + identifier asname; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; +}; + +struct _withitem { + expr_ty context_expr; + expr_ty optional_vars; +}; + +struct _match_case { + pattern_ty pattern; + expr_ty guard; + asdl_stmt_seq *body; +}; + +enum _pattern_kind {MatchValue_kind=1, MatchSingleton_kind=2, + MatchSequence_kind=3, MatchMapping_kind=4, + MatchClass_kind=5, MatchStar_kind=6, MatchAs_kind=7, + MatchOr_kind=8}; +struct _pattern { + enum _pattern_kind kind; + union { + struct { + expr_ty value; + } MatchValue; + + struct { + constant value; + } MatchSingleton; + + struct { + asdl_pattern_seq *patterns; + } MatchSequence; + + struct { + asdl_expr_seq *keys; + asdl_pattern_seq *patterns; + identifier rest; + } MatchMapping; + + struct { + expr_ty cls; + asdl_pattern_seq *patterns; + asdl_identifier_seq *kwd_attrs; + asdl_pattern_seq *kwd_patterns; + } MatchClass; + + struct { + identifier name; + } MatchStar; + + struct { + pattern_ty pattern; + identifier name; + } MatchAs; + + struct { + asdl_pattern_seq *patterns; + } MatchOr; + + } v; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; +}; + +enum _type_ignore_kind {TypeIgnore_kind=1}; +struct _type_ignore { + enum _type_ignore_kind kind; + union { + struct { + int lineno; + string tag; + } TypeIgnore; + + } v; +}; + + +// Note: these macros affect function definitions, not only call sites. +mod_ty _PyAST_Module(asdl_stmt_seq * body, asdl_type_ignore_seq * type_ignores, + PyArena *arena); +mod_ty _PyAST_Interactive(asdl_stmt_seq * body, PyArena *arena); +mod_ty _PyAST_Expression(expr_ty body, PyArena *arena); +mod_ty _PyAST_FunctionType(asdl_expr_seq * argtypes, expr_ty returns, PyArena + *arena); +stmt_ty _PyAST_FunctionDef(identifier name, arguments_ty args, asdl_stmt_seq * + body, asdl_expr_seq * decorator_list, expr_ty + returns, string type_comment, int lineno, int + col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +stmt_ty _PyAST_AsyncFunctionDef(identifier name, arguments_ty args, + asdl_stmt_seq * body, asdl_expr_seq * + decorator_list, expr_ty returns, string + type_comment, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +stmt_ty _PyAST_ClassDef(identifier name, asdl_expr_seq * bases, + asdl_keyword_seq * keywords, asdl_stmt_seq * body, + asdl_expr_seq * decorator_list, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +stmt_ty _PyAST_Return(expr_ty value, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +stmt_ty _PyAST_Delete(asdl_expr_seq * targets, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +stmt_ty _PyAST_Assign(asdl_expr_seq * targets, expr_ty value, string + type_comment, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +stmt_ty _PyAST_AugAssign(expr_ty target, operator_ty op, expr_ty value, int + lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +stmt_ty _PyAST_AnnAssign(expr_ty target, expr_ty annotation, expr_ty value, int + simple, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +stmt_ty _PyAST_For(expr_ty target, expr_ty iter, asdl_stmt_seq * body, + asdl_stmt_seq * orelse, string type_comment, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +stmt_ty _PyAST_AsyncFor(expr_ty target, expr_ty iter, asdl_stmt_seq * body, + asdl_stmt_seq * orelse, string type_comment, int + lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +stmt_ty _PyAST_While(expr_ty test, asdl_stmt_seq * body, asdl_stmt_seq * + orelse, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +stmt_ty _PyAST_If(expr_ty test, asdl_stmt_seq * body, asdl_stmt_seq * orelse, + int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +stmt_ty _PyAST_With(asdl_withitem_seq * items, asdl_stmt_seq * body, string + type_comment, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +stmt_ty _PyAST_AsyncWith(asdl_withitem_seq * items, asdl_stmt_seq * body, + string type_comment, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +stmt_ty _PyAST_Match(expr_ty subject, asdl_match_case_seq * cases, int lineno, + int col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +stmt_ty _PyAST_Raise(expr_ty exc, expr_ty cause, int lineno, int col_offset, + int end_lineno, int end_col_offset, PyArena *arena); +stmt_ty _PyAST_Try(asdl_stmt_seq * body, asdl_excepthandler_seq * handlers, + asdl_stmt_seq * orelse, asdl_stmt_seq * finalbody, int + lineno, int col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +stmt_ty _PyAST_TryStar(asdl_stmt_seq * body, asdl_excepthandler_seq * handlers, + asdl_stmt_seq * orelse, asdl_stmt_seq * finalbody, int + lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +stmt_ty _PyAST_Assert(expr_ty test, expr_ty msg, int lineno, int col_offset, + int end_lineno, int end_col_offset, PyArena *arena); +stmt_ty _PyAST_Import(asdl_alias_seq * names, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +stmt_ty _PyAST_ImportFrom(identifier module, asdl_alias_seq * names, int level, + int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +stmt_ty _PyAST_Global(asdl_identifier_seq * names, int lineno, int col_offset, + int end_lineno, int end_col_offset, PyArena *arena); +stmt_ty _PyAST_Nonlocal(asdl_identifier_seq * names, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +stmt_ty _PyAST_Expr(expr_ty value, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +stmt_ty _PyAST_Pass(int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +stmt_ty _PyAST_Break(int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +stmt_ty _PyAST_Continue(int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +expr_ty _PyAST_BoolOp(boolop_ty op, asdl_expr_seq * values, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_NamedExpr(expr_ty target, expr_ty value, int lineno, int + col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +expr_ty _PyAST_BinOp(expr_ty left, operator_ty op, expr_ty right, int lineno, + int col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +expr_ty _PyAST_UnaryOp(unaryop_ty op, expr_ty operand, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_Lambda(arguments_ty args, expr_ty body, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_IfExp(expr_ty test, expr_ty body, expr_ty orelse, int lineno, + int col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +expr_ty _PyAST_Dict(asdl_expr_seq * keys, asdl_expr_seq * values, int lineno, + int col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_Set(asdl_expr_seq * elts, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +expr_ty _PyAST_ListComp(expr_ty elt, asdl_comprehension_seq * generators, int + lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +expr_ty _PyAST_SetComp(expr_ty elt, asdl_comprehension_seq * generators, int + lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +expr_ty _PyAST_DictComp(expr_ty key, expr_ty value, asdl_comprehension_seq * + generators, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +expr_ty _PyAST_GeneratorExp(expr_ty elt, asdl_comprehension_seq * generators, + int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +expr_ty _PyAST_Await(expr_ty value, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +expr_ty _PyAST_Yield(expr_ty value, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +expr_ty _PyAST_YieldFrom(expr_ty value, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +expr_ty _PyAST_Compare(expr_ty left, asdl_int_seq * ops, asdl_expr_seq * + comparators, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +expr_ty _PyAST_Call(expr_ty func, asdl_expr_seq * args, asdl_keyword_seq * + keywords, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +expr_ty _PyAST_FormattedValue(expr_ty value, int conversion, expr_ty + format_spec, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +expr_ty _PyAST_JoinedStr(asdl_expr_seq * values, int lineno, int col_offset, + int end_lineno, int end_col_offset, PyArena *arena); +expr_ty _PyAST_Constant(constant value, string kind, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_Attribute(expr_ty value, identifier attr, expr_context_ty ctx, + int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +expr_ty _PyAST_Subscript(expr_ty value, expr_ty slice, expr_context_ty ctx, int + lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +expr_ty _PyAST_Starred(expr_ty value, expr_context_ty ctx, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_Name(identifier id, expr_context_ty ctx, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_List(asdl_expr_seq * elts, expr_context_ty ctx, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_Tuple(asdl_expr_seq * elts, expr_context_ty ctx, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_Slice(expr_ty lower, expr_ty upper, expr_ty step, int lineno, + int col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +comprehension_ty _PyAST_comprehension(expr_ty target, expr_ty iter, + asdl_expr_seq * ifs, int is_async, + PyArena *arena); +excepthandler_ty _PyAST_ExceptHandler(expr_ty type, identifier name, + asdl_stmt_seq * body, int lineno, int + col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +arguments_ty _PyAST_arguments(asdl_arg_seq * posonlyargs, asdl_arg_seq * args, + arg_ty vararg, asdl_arg_seq * kwonlyargs, + asdl_expr_seq * kw_defaults, arg_ty kwarg, + asdl_expr_seq * defaults, PyArena *arena); +arg_ty _PyAST_arg(identifier arg, expr_ty annotation, string type_comment, int + lineno, int col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +keyword_ty _PyAST_keyword(identifier arg, expr_ty value, int lineno, int + col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +alias_ty _PyAST_alias(identifier name, identifier asname, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +withitem_ty _PyAST_withitem(expr_ty context_expr, expr_ty optional_vars, + PyArena *arena); +match_case_ty _PyAST_match_case(pattern_ty pattern, expr_ty guard, + asdl_stmt_seq * body, PyArena *arena); +pattern_ty _PyAST_MatchValue(expr_ty value, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +pattern_ty _PyAST_MatchSingleton(constant value, int lineno, int col_offset, + int end_lineno, int end_col_offset, PyArena + *arena); +pattern_ty _PyAST_MatchSequence(asdl_pattern_seq * patterns, int lineno, int + col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +pattern_ty _PyAST_MatchMapping(asdl_expr_seq * keys, asdl_pattern_seq * + patterns, identifier rest, int lineno, int + col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +pattern_ty _PyAST_MatchClass(expr_ty cls, asdl_pattern_seq * patterns, + asdl_identifier_seq * kwd_attrs, asdl_pattern_seq + * kwd_patterns, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +pattern_ty _PyAST_MatchStar(identifier name, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +pattern_ty _PyAST_MatchAs(pattern_ty pattern, identifier name, int lineno, int + col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +pattern_ty _PyAST_MatchOr(asdl_pattern_seq * patterns, int lineno, int + col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +type_ignore_ty _PyAST_TypeIgnore(int lineno, string tag, PyArena *arena); + + +PyObject* PyAST_mod2obj(mod_ty t); +mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode); +int PyAST_Check(PyObject* obj); + +extern int _PyAST_Validate(mod_ty); + +/* _PyAST_ExprAsUnicode is defined in ast_unparse.c */ +extern PyObject* _PyAST_ExprAsUnicode(expr_ty); + +/* Return the borrowed reference to the first literal string in the + sequence of statements or NULL if it doesn't start from a literal string. + Doesn't set exception. */ +extern PyObject* _PyAST_GetDocString(asdl_stmt_seq *); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_AST_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_ast_state.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_ast_state.h new file mode 100644 index 0000000000000000000000000000000000000000..d354822e1d1df1600d4340d781da97a0d5e1d474 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_ast_state.h @@ -0,0 +1,258 @@ +// File automatically generated by Parser/asdl_c.py. + +#ifndef Py_INTERNAL_AST_STATE_H +#define Py_INTERNAL_AST_STATE_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +struct ast_state { + int initialized; + int unused_recursion_depth; + int unused_recursion_limit; + PyObject *AST_type; + PyObject *Add_singleton; + PyObject *Add_type; + PyObject *And_singleton; + PyObject *And_type; + PyObject *AnnAssign_type; + PyObject *Assert_type; + PyObject *Assign_type; + PyObject *AsyncFor_type; + PyObject *AsyncFunctionDef_type; + PyObject *AsyncWith_type; + PyObject *Attribute_type; + PyObject *AugAssign_type; + PyObject *Await_type; + PyObject *BinOp_type; + PyObject *BitAnd_singleton; + PyObject *BitAnd_type; + PyObject *BitOr_singleton; + PyObject *BitOr_type; + PyObject *BitXor_singleton; + PyObject *BitXor_type; + PyObject *BoolOp_type; + PyObject *Break_type; + PyObject *Call_type; + PyObject *ClassDef_type; + PyObject *Compare_type; + PyObject *Constant_type; + PyObject *Continue_type; + PyObject *Del_singleton; + PyObject *Del_type; + PyObject *Delete_type; + PyObject *DictComp_type; + PyObject *Dict_type; + PyObject *Div_singleton; + PyObject *Div_type; + PyObject *Eq_singleton; + PyObject *Eq_type; + PyObject *ExceptHandler_type; + PyObject *Expr_type; + PyObject *Expression_type; + PyObject *FloorDiv_singleton; + PyObject *FloorDiv_type; + PyObject *For_type; + PyObject *FormattedValue_type; + PyObject *FunctionDef_type; + PyObject *FunctionType_type; + PyObject *GeneratorExp_type; + PyObject *Global_type; + PyObject *GtE_singleton; + PyObject *GtE_type; + PyObject *Gt_singleton; + PyObject *Gt_type; + PyObject *IfExp_type; + PyObject *If_type; + PyObject *ImportFrom_type; + PyObject *Import_type; + PyObject *In_singleton; + PyObject *In_type; + PyObject *Interactive_type; + PyObject *Invert_singleton; + PyObject *Invert_type; + PyObject *IsNot_singleton; + PyObject *IsNot_type; + PyObject *Is_singleton; + PyObject *Is_type; + PyObject *JoinedStr_type; + PyObject *LShift_singleton; + PyObject *LShift_type; + PyObject *Lambda_type; + PyObject *ListComp_type; + PyObject *List_type; + PyObject *Load_singleton; + PyObject *Load_type; + PyObject *LtE_singleton; + PyObject *LtE_type; + PyObject *Lt_singleton; + PyObject *Lt_type; + PyObject *MatMult_singleton; + PyObject *MatMult_type; + PyObject *MatchAs_type; + PyObject *MatchClass_type; + PyObject *MatchMapping_type; + PyObject *MatchOr_type; + PyObject *MatchSequence_type; + PyObject *MatchSingleton_type; + PyObject *MatchStar_type; + PyObject *MatchValue_type; + PyObject *Match_type; + PyObject *Mod_singleton; + PyObject *Mod_type; + PyObject *Module_type; + PyObject *Mult_singleton; + PyObject *Mult_type; + PyObject *Name_type; + PyObject *NamedExpr_type; + PyObject *Nonlocal_type; + PyObject *NotEq_singleton; + PyObject *NotEq_type; + PyObject *NotIn_singleton; + PyObject *NotIn_type; + PyObject *Not_singleton; + PyObject *Not_type; + PyObject *Or_singleton; + PyObject *Or_type; + PyObject *Pass_type; + PyObject *Pow_singleton; + PyObject *Pow_type; + PyObject *RShift_singleton; + PyObject *RShift_type; + PyObject *Raise_type; + PyObject *Return_type; + PyObject *SetComp_type; + PyObject *Set_type; + PyObject *Slice_type; + PyObject *Starred_type; + PyObject *Store_singleton; + PyObject *Store_type; + PyObject *Sub_singleton; + PyObject *Sub_type; + PyObject *Subscript_type; + PyObject *TryStar_type; + PyObject *Try_type; + PyObject *Tuple_type; + PyObject *TypeIgnore_type; + PyObject *UAdd_singleton; + PyObject *UAdd_type; + PyObject *USub_singleton; + PyObject *USub_type; + PyObject *UnaryOp_type; + PyObject *While_type; + PyObject *With_type; + PyObject *YieldFrom_type; + PyObject *Yield_type; + PyObject *__dict__; + PyObject *__doc__; + PyObject *__match_args__; + PyObject *__module__; + PyObject *_attributes; + PyObject *_fields; + PyObject *alias_type; + PyObject *annotation; + PyObject *arg; + PyObject *arg_type; + PyObject *args; + PyObject *argtypes; + PyObject *arguments_type; + PyObject *asname; + PyObject *ast; + PyObject *attr; + PyObject *bases; + PyObject *body; + PyObject *boolop_type; + PyObject *cases; + PyObject *cause; + PyObject *cls; + PyObject *cmpop_type; + PyObject *col_offset; + PyObject *comparators; + PyObject *comprehension_type; + PyObject *context_expr; + PyObject *conversion; + PyObject *ctx; + PyObject *decorator_list; + PyObject *defaults; + PyObject *elt; + PyObject *elts; + PyObject *end_col_offset; + PyObject *end_lineno; + PyObject *exc; + PyObject *excepthandler_type; + PyObject *expr_context_type; + PyObject *expr_type; + PyObject *finalbody; + PyObject *format_spec; + PyObject *func; + PyObject *generators; + PyObject *guard; + PyObject *handlers; + PyObject *id; + PyObject *ifs; + PyObject *is_async; + PyObject *items; + PyObject *iter; + PyObject *key; + PyObject *keys; + PyObject *keyword_type; + PyObject *keywords; + PyObject *kind; + PyObject *kw_defaults; + PyObject *kwarg; + PyObject *kwd_attrs; + PyObject *kwd_patterns; + PyObject *kwonlyargs; + PyObject *left; + PyObject *level; + PyObject *lineno; + PyObject *lower; + PyObject *match_case_type; + PyObject *mod_type; + PyObject *module; + PyObject *msg; + PyObject *name; + PyObject *names; + PyObject *op; + PyObject *operand; + PyObject *operator_type; + PyObject *ops; + PyObject *optional_vars; + PyObject *orelse; + PyObject *pattern; + PyObject *pattern_type; + PyObject *patterns; + PyObject *posonlyargs; + PyObject *rest; + PyObject *returns; + PyObject *right; + PyObject *simple; + PyObject *slice; + PyObject *step; + PyObject *stmt_type; + PyObject *subject; + PyObject *tag; + PyObject *target; + PyObject *targets; + PyObject *test; + PyObject *type; + PyObject *type_comment; + PyObject *type_ignore_type; + PyObject *type_ignores; + PyObject *unaryop_type; + PyObject *upper; + PyObject *value; + PyObject *values; + PyObject *vararg; + PyObject *withitem_type; +}; + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_AST_STATE_H */ + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_atomic.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_atomic.h new file mode 100644 index 0000000000000000000000000000000000000000..425d69f868b52b26ad34bbf724ad7671012404d0 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_atomic.h @@ -0,0 +1,557 @@ +#ifndef Py_ATOMIC_H +#define Py_ATOMIC_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "dynamic_annotations.h" /* _Py_ANNOTATE_MEMORY_ORDER */ +#include "pyconfig.h" + +#ifdef HAVE_STD_ATOMIC +# include +#endif + + +#if defined(_MSC_VER) +#include +#if defined(_M_IX86) || defined(_M_X64) +# include +#endif +#endif + +/* This is modeled after the atomics interface from C1x, according to + * the draft at + * http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1425.pdf. + * Operations and types are named the same except with a _Py_ prefix + * and have the same semantics. + * + * Beware, the implementations here are deep magic. + */ + +#if defined(HAVE_STD_ATOMIC) + +typedef enum _Py_memory_order { + _Py_memory_order_relaxed = memory_order_relaxed, + _Py_memory_order_acquire = memory_order_acquire, + _Py_memory_order_release = memory_order_release, + _Py_memory_order_acq_rel = memory_order_acq_rel, + _Py_memory_order_seq_cst = memory_order_seq_cst +} _Py_memory_order; + +typedef struct _Py_atomic_address { + atomic_uintptr_t _value; +} _Py_atomic_address; + +typedef struct _Py_atomic_int { + atomic_int _value; +} _Py_atomic_int; + +#define _Py_atomic_signal_fence(/*memory_order*/ ORDER) \ + atomic_signal_fence(ORDER) + +#define _Py_atomic_thread_fence(/*memory_order*/ ORDER) \ + atomic_thread_fence(ORDER) + +#define _Py_atomic_store_explicit(ATOMIC_VAL, NEW_VAL, ORDER) \ + atomic_store_explicit(&((ATOMIC_VAL)->_value), NEW_VAL, ORDER) + +#define _Py_atomic_load_explicit(ATOMIC_VAL, ORDER) \ + atomic_load_explicit(&((ATOMIC_VAL)->_value), ORDER) + +// Use builtin atomic operations in GCC >= 4.7 and clang +#elif defined(HAVE_BUILTIN_ATOMIC) + +typedef enum _Py_memory_order { + _Py_memory_order_relaxed = __ATOMIC_RELAXED, + _Py_memory_order_acquire = __ATOMIC_ACQUIRE, + _Py_memory_order_release = __ATOMIC_RELEASE, + _Py_memory_order_acq_rel = __ATOMIC_ACQ_REL, + _Py_memory_order_seq_cst = __ATOMIC_SEQ_CST +} _Py_memory_order; + +typedef struct _Py_atomic_address { + uintptr_t _value; +} _Py_atomic_address; + +typedef struct _Py_atomic_int { + int _value; +} _Py_atomic_int; + +#define _Py_atomic_signal_fence(/*memory_order*/ ORDER) \ + __atomic_signal_fence(ORDER) + +#define _Py_atomic_thread_fence(/*memory_order*/ ORDER) \ + __atomic_thread_fence(ORDER) + +#define _Py_atomic_store_explicit(ATOMIC_VAL, NEW_VAL, ORDER) \ + (assert((ORDER) == __ATOMIC_RELAXED \ + || (ORDER) == __ATOMIC_SEQ_CST \ + || (ORDER) == __ATOMIC_RELEASE), \ + __atomic_store_n(&((ATOMIC_VAL)->_value), NEW_VAL, ORDER)) + +#define _Py_atomic_load_explicit(ATOMIC_VAL, ORDER) \ + (assert((ORDER) == __ATOMIC_RELAXED \ + || (ORDER) == __ATOMIC_SEQ_CST \ + || (ORDER) == __ATOMIC_ACQUIRE \ + || (ORDER) == __ATOMIC_CONSUME), \ + __atomic_load_n(&((ATOMIC_VAL)->_value), ORDER)) + +/* Only support GCC (for expression statements) and x86 (for simple + * atomic semantics) and MSVC x86/x64/ARM */ +#elif defined(__GNUC__) && (defined(__i386__) || defined(__amd64)) +typedef enum _Py_memory_order { + _Py_memory_order_relaxed, + _Py_memory_order_acquire, + _Py_memory_order_release, + _Py_memory_order_acq_rel, + _Py_memory_order_seq_cst +} _Py_memory_order; + +typedef struct _Py_atomic_address { + uintptr_t _value; +} _Py_atomic_address; + +typedef struct _Py_atomic_int { + int _value; +} _Py_atomic_int; + + +static __inline__ void +_Py_atomic_signal_fence(_Py_memory_order order) +{ + if (order != _Py_memory_order_relaxed) + __asm__ volatile("":::"memory"); +} + +static __inline__ void +_Py_atomic_thread_fence(_Py_memory_order order) +{ + if (order != _Py_memory_order_relaxed) + __asm__ volatile("mfence":::"memory"); +} + +/* Tell the race checker about this operation's effects. */ +static __inline__ void +_Py_ANNOTATE_MEMORY_ORDER(const volatile void *address, _Py_memory_order order) +{ + (void)address; /* shut up -Wunused-parameter */ + switch(order) { + case _Py_memory_order_release: + case _Py_memory_order_acq_rel: + case _Py_memory_order_seq_cst: + _Py_ANNOTATE_HAPPENS_BEFORE(address); + break; + case _Py_memory_order_relaxed: + case _Py_memory_order_acquire: + break; + } + switch(order) { + case _Py_memory_order_acquire: + case _Py_memory_order_acq_rel: + case _Py_memory_order_seq_cst: + _Py_ANNOTATE_HAPPENS_AFTER(address); + break; + case _Py_memory_order_relaxed: + case _Py_memory_order_release: + break; + } +} + +#define _Py_atomic_store_explicit(ATOMIC_VAL, NEW_VAL, ORDER) \ + __extension__ ({ \ + __typeof__(ATOMIC_VAL) atomic_val = ATOMIC_VAL; \ + __typeof__(atomic_val->_value) new_val = NEW_VAL;\ + volatile __typeof__(new_val) *volatile_data = &atomic_val->_value; \ + _Py_memory_order order = ORDER; \ + _Py_ANNOTATE_MEMORY_ORDER(atomic_val, order); \ + \ + /* Perform the operation. */ \ + _Py_ANNOTATE_IGNORE_WRITES_BEGIN(); \ + switch(order) { \ + case _Py_memory_order_release: \ + _Py_atomic_signal_fence(_Py_memory_order_release); \ + /* fallthrough */ \ + case _Py_memory_order_relaxed: \ + *volatile_data = new_val; \ + break; \ + \ + case _Py_memory_order_acquire: \ + case _Py_memory_order_acq_rel: \ + case _Py_memory_order_seq_cst: \ + __asm__ volatile("xchg %0, %1" \ + : "+r"(new_val) \ + : "m"(atomic_val->_value) \ + : "memory"); \ + break; \ + } \ + _Py_ANNOTATE_IGNORE_WRITES_END(); \ + }) + +#define _Py_atomic_load_explicit(ATOMIC_VAL, ORDER) \ + __extension__ ({ \ + __typeof__(ATOMIC_VAL) atomic_val = ATOMIC_VAL; \ + __typeof__(atomic_val->_value) result; \ + volatile __typeof__(result) *volatile_data = &atomic_val->_value; \ + _Py_memory_order order = ORDER; \ + _Py_ANNOTATE_MEMORY_ORDER(atomic_val, order); \ + \ + /* Perform the operation. */ \ + _Py_ANNOTATE_IGNORE_READS_BEGIN(); \ + switch(order) { \ + case _Py_memory_order_release: \ + case _Py_memory_order_acq_rel: \ + case _Py_memory_order_seq_cst: \ + /* Loads on x86 are not releases by default, so need a */ \ + /* thread fence. */ \ + _Py_atomic_thread_fence(_Py_memory_order_release); \ + break; \ + default: \ + /* No fence */ \ + break; \ + } \ + result = *volatile_data; \ + switch(order) { \ + case _Py_memory_order_acquire: \ + case _Py_memory_order_acq_rel: \ + case _Py_memory_order_seq_cst: \ + /* Loads on x86 are automatically acquire operations so */ \ + /* can get by with just a compiler fence. */ \ + _Py_atomic_signal_fence(_Py_memory_order_acquire); \ + break; \ + default: \ + /* No fence */ \ + break; \ + } \ + _Py_ANNOTATE_IGNORE_READS_END(); \ + result; \ + }) + +#elif defined(_MSC_VER) +/* _Interlocked* functions provide a full memory barrier and are therefore + enough for acq_rel and seq_cst. If the HLE variants aren't available + in hardware they will fall back to a full memory barrier as well. + + This might affect performance but likely only in some very specific and + hard to measure scenario. +*/ +#if defined(_M_IX86) || defined(_M_X64) +typedef enum _Py_memory_order { + _Py_memory_order_relaxed, + _Py_memory_order_acquire, + _Py_memory_order_release, + _Py_memory_order_acq_rel, + _Py_memory_order_seq_cst +} _Py_memory_order; + +typedef struct _Py_atomic_address { + volatile uintptr_t _value; +} _Py_atomic_address; + +typedef struct _Py_atomic_int { + volatile int _value; +} _Py_atomic_int; + + +#if defined(_M_X64) +#define _Py_atomic_store_64bit(ATOMIC_VAL, NEW_VAL, ORDER) \ + switch (ORDER) { \ + case _Py_memory_order_acquire: \ + _InterlockedExchange64_HLEAcquire((__int64 volatile*)&((ATOMIC_VAL)->_value), (__int64)(NEW_VAL)); \ + break; \ + case _Py_memory_order_release: \ + _InterlockedExchange64_HLERelease((__int64 volatile*)&((ATOMIC_VAL)->_value), (__int64)(NEW_VAL)); \ + break; \ + default: \ + _InterlockedExchange64((__int64 volatile*)&((ATOMIC_VAL)->_value), (__int64)(NEW_VAL)); \ + break; \ + } +#else +#define _Py_atomic_store_64bit(ATOMIC_VAL, NEW_VAL, ORDER) ((void)0); +#endif + +#define _Py_atomic_store_32bit(ATOMIC_VAL, NEW_VAL, ORDER) \ + switch (ORDER) { \ + case _Py_memory_order_acquire: \ + _InterlockedExchange_HLEAcquire((volatile long*)&((ATOMIC_VAL)->_value), (int)(NEW_VAL)); \ + break; \ + case _Py_memory_order_release: \ + _InterlockedExchange_HLERelease((volatile long*)&((ATOMIC_VAL)->_value), (int)(NEW_VAL)); \ + break; \ + default: \ + _InterlockedExchange((volatile long*)&((ATOMIC_VAL)->_value), (int)(NEW_VAL)); \ + break; \ + } + +#if defined(_M_X64) +/* This has to be an intptr_t for now. + gil_created() uses -1 as a sentinel value, if this returns + a uintptr_t it will do an unsigned compare and crash +*/ +inline intptr_t _Py_atomic_load_64bit_impl(volatile uintptr_t* value, int order) { + __int64 old; + switch (order) { + case _Py_memory_order_acquire: + { + do { + old = *value; + } while(_InterlockedCompareExchange64_HLEAcquire((volatile __int64*)value, old, old) != old); + break; + } + case _Py_memory_order_release: + { + do { + old = *value; + } while(_InterlockedCompareExchange64_HLERelease((volatile __int64*)value, old, old) != old); + break; + } + case _Py_memory_order_relaxed: + old = *value; + break; + default: + { + do { + old = *value; + } while(_InterlockedCompareExchange64((volatile __int64*)value, old, old) != old); + break; + } + } + return old; +} + +#define _Py_atomic_load_64bit(ATOMIC_VAL, ORDER) \ + _Py_atomic_load_64bit_impl((volatile uintptr_t*)&((ATOMIC_VAL)->_value), (ORDER)) + +#else +#define _Py_atomic_load_64bit(ATOMIC_VAL, ORDER) ((ATOMIC_VAL)->_value) +#endif + +inline int _Py_atomic_load_32bit_impl(volatile int* value, int order) { + long old; + switch (order) { + case _Py_memory_order_acquire: + { + do { + old = *value; + } while(_InterlockedCompareExchange_HLEAcquire((volatile long*)value, old, old) != old); + break; + } + case _Py_memory_order_release: + { + do { + old = *value; + } while(_InterlockedCompareExchange_HLERelease((volatile long*)value, old, old) != old); + break; + } + case _Py_memory_order_relaxed: + old = *value; + break; + default: + { + do { + old = *value; + } while(_InterlockedCompareExchange((volatile long*)value, old, old) != old); + break; + } + } + return old; +} + +#define _Py_atomic_load_32bit(ATOMIC_VAL, ORDER) \ + _Py_atomic_load_32bit_impl((volatile int*)&((ATOMIC_VAL)->_value), (ORDER)) + +#define _Py_atomic_store_explicit(ATOMIC_VAL, NEW_VAL, ORDER) \ + if (sizeof((ATOMIC_VAL)->_value) == 8) { \ + _Py_atomic_store_64bit((ATOMIC_VAL), NEW_VAL, ORDER) } else { \ + _Py_atomic_store_32bit((ATOMIC_VAL), NEW_VAL, ORDER) } + +#define _Py_atomic_load_explicit(ATOMIC_VAL, ORDER) \ + ( \ + sizeof((ATOMIC_VAL)->_value) == 8 ? \ + _Py_atomic_load_64bit((ATOMIC_VAL), ORDER) : \ + _Py_atomic_load_32bit((ATOMIC_VAL), ORDER) \ + ) +#elif defined(_M_ARM) || defined(_M_ARM64) +typedef enum _Py_memory_order { + _Py_memory_order_relaxed, + _Py_memory_order_acquire, + _Py_memory_order_release, + _Py_memory_order_acq_rel, + _Py_memory_order_seq_cst +} _Py_memory_order; + +typedef struct _Py_atomic_address { + volatile uintptr_t _value; +} _Py_atomic_address; + +typedef struct _Py_atomic_int { + volatile int _value; +} _Py_atomic_int; + + +#if defined(_M_ARM64) +#define _Py_atomic_store_64bit(ATOMIC_VAL, NEW_VAL, ORDER) \ + switch (ORDER) { \ + case _Py_memory_order_acquire: \ + _InterlockedExchange64_acq((__int64 volatile*)&((ATOMIC_VAL)->_value), (__int64)NEW_VAL); \ + break; \ + case _Py_memory_order_release: \ + _InterlockedExchange64_rel((__int64 volatile*)&((ATOMIC_VAL)->_value), (__int64)NEW_VAL); \ + break; \ + default: \ + _InterlockedExchange64((__int64 volatile*)&((ATOMIC_VAL)->_value), (__int64)NEW_VAL); \ + break; \ + } +#else +#define _Py_atomic_store_64bit(ATOMIC_VAL, NEW_VAL, ORDER) ((void)0); +#endif + +#define _Py_atomic_store_32bit(ATOMIC_VAL, NEW_VAL, ORDER) \ + switch (ORDER) { \ + case _Py_memory_order_acquire: \ + _InterlockedExchange_acq((volatile long*)&((ATOMIC_VAL)->_value), (int)NEW_VAL); \ + break; \ + case _Py_memory_order_release: \ + _InterlockedExchange_rel((volatile long*)&((ATOMIC_VAL)->_value), (int)NEW_VAL); \ + break; \ + default: \ + _InterlockedExchange((volatile long*)&((ATOMIC_VAL)->_value), (int)NEW_VAL); \ + break; \ + } + +#if defined(_M_ARM64) +/* This has to be an intptr_t for now. + gil_created() uses -1 as a sentinel value, if this returns + a uintptr_t it will do an unsigned compare and crash +*/ +inline intptr_t _Py_atomic_load_64bit_impl(volatile uintptr_t* value, int order) { + uintptr_t old; + switch (order) { + case _Py_memory_order_acquire: + { + do { + old = *value; + } while(_InterlockedCompareExchange64_acq(value, old, old) != old); + break; + } + case _Py_memory_order_release: + { + do { + old = *value; + } while(_InterlockedCompareExchange64_rel(value, old, old) != old); + break; + } + case _Py_memory_order_relaxed: + old = *value; + break; + default: + { + do { + old = *value; + } while(_InterlockedCompareExchange64(value, old, old) != old); + break; + } + } + return old; +} + +#define _Py_atomic_load_64bit(ATOMIC_VAL, ORDER) \ + _Py_atomic_load_64bit_impl((volatile uintptr_t*)&((ATOMIC_VAL)->_value), (ORDER)) + +#else +#define _Py_atomic_load_64bit(ATOMIC_VAL, ORDER) ((ATOMIC_VAL)->_value) +#endif + +inline int _Py_atomic_load_32bit_impl(volatile int* value, int order) { + int old; + switch (order) { + case _Py_memory_order_acquire: + { + do { + old = *value; + } while(_InterlockedCompareExchange_acq(value, old, old) != old); + break; + } + case _Py_memory_order_release: + { + do { + old = *value; + } while(_InterlockedCompareExchange_rel(value, old, old) != old); + break; + } + case _Py_memory_order_relaxed: + old = *value; + break; + default: + { + do { + old = *value; + } while(_InterlockedCompareExchange(value, old, old) != old); + break; + } + } + return old; +} + +#define _Py_atomic_load_32bit(ATOMIC_VAL, ORDER) \ + _Py_atomic_load_32bit_impl((volatile int*)&((ATOMIC_VAL)->_value), (ORDER)) + +#define _Py_atomic_store_explicit(ATOMIC_VAL, NEW_VAL, ORDER) \ + if (sizeof((ATOMIC_VAL)->_value) == 8) { \ + _Py_atomic_store_64bit((ATOMIC_VAL), (NEW_VAL), (ORDER)) } else { \ + _Py_atomic_store_32bit((ATOMIC_VAL), (NEW_VAL), (ORDER)) } + +#define _Py_atomic_load_explicit(ATOMIC_VAL, ORDER) \ + ( \ + sizeof((ATOMIC_VAL)->_value) == 8 ? \ + _Py_atomic_load_64bit((ATOMIC_VAL), (ORDER)) : \ + _Py_atomic_load_32bit((ATOMIC_VAL), (ORDER)) \ + ) +#endif +#else /* !gcc x86 !_msc_ver */ +typedef enum _Py_memory_order { + _Py_memory_order_relaxed, + _Py_memory_order_acquire, + _Py_memory_order_release, + _Py_memory_order_acq_rel, + _Py_memory_order_seq_cst +} _Py_memory_order; + +typedef struct _Py_atomic_address { + uintptr_t _value; +} _Py_atomic_address; + +typedef struct _Py_atomic_int { + int _value; +} _Py_atomic_int; +/* Fall back to other compilers and processors by assuming that simple + volatile accesses are atomic. This is false, so people should port + this. */ +#define _Py_atomic_signal_fence(/*memory_order*/ ORDER) ((void)0) +#define _Py_atomic_thread_fence(/*memory_order*/ ORDER) ((void)0) +#define _Py_atomic_store_explicit(ATOMIC_VAL, NEW_VAL, ORDER) \ + ((ATOMIC_VAL)->_value = NEW_VAL) +#define _Py_atomic_load_explicit(ATOMIC_VAL, ORDER) \ + ((ATOMIC_VAL)->_value) +#endif + +/* Standardized shortcuts. */ +#define _Py_atomic_store(ATOMIC_VAL, NEW_VAL) \ + _Py_atomic_store_explicit((ATOMIC_VAL), (NEW_VAL), _Py_memory_order_seq_cst) +#define _Py_atomic_load(ATOMIC_VAL) \ + _Py_atomic_load_explicit((ATOMIC_VAL), _Py_memory_order_seq_cst) + +/* Python-local extensions */ + +#define _Py_atomic_store_relaxed(ATOMIC_VAL, NEW_VAL) \ + _Py_atomic_store_explicit((ATOMIC_VAL), (NEW_VAL), _Py_memory_order_relaxed) +#define _Py_atomic_load_relaxed(ATOMIC_VAL) \ + _Py_atomic_load_explicit((ATOMIC_VAL), _Py_memory_order_relaxed) + +#ifdef __cplusplus +} +#endif +#endif /* Py_ATOMIC_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_atomic_funcs.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_atomic_funcs.h new file mode 100644 index 0000000000000000000000000000000000000000..a708789cea733bbc56cc3c3271a280a413a8ce4f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_atomic_funcs.h @@ -0,0 +1,94 @@ +/* Atomic functions: similar to pycore_atomic.h, but don't need + to declare variables as atomic. + + Py_ssize_t type: + + * value = _Py_atomic_size_get(&var) + * _Py_atomic_size_set(&var, value) + + Use sequentially-consistent ordering (__ATOMIC_SEQ_CST memory order): + enforce total ordering with all other atomic functions. +*/ +#ifndef Py_ATOMIC_FUNC_H +#define Py_ATOMIC_FUNC_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#if defined(_MSC_VER) +# include // _InterlockedExchange() +#endif + + +// Use builtin atomic operations in GCC >= 4.7 and clang +#ifdef HAVE_BUILTIN_ATOMIC + +static inline Py_ssize_t _Py_atomic_size_get(Py_ssize_t *var) +{ + return __atomic_load_n(var, __ATOMIC_SEQ_CST); +} + +static inline void _Py_atomic_size_set(Py_ssize_t *var, Py_ssize_t value) +{ + __atomic_store_n(var, value, __ATOMIC_SEQ_CST); +} + +#elif defined(_MSC_VER) + +static inline Py_ssize_t _Py_atomic_size_get(Py_ssize_t *var) +{ +#if SIZEOF_VOID_P == 8 + Py_BUILD_ASSERT(sizeof(__int64) == sizeof(*var)); + volatile __int64 *volatile_var = (volatile __int64 *)var; + __int64 old; + do { + old = *volatile_var; + } while(_InterlockedCompareExchange64(volatile_var, old, old) != old); +#else + Py_BUILD_ASSERT(sizeof(long) == sizeof(*var)); + volatile long *volatile_var = (volatile long *)var; + long old; + do { + old = *volatile_var; + } while(_InterlockedCompareExchange(volatile_var, old, old) != old); +#endif + return old; +} + +static inline void _Py_atomic_size_set(Py_ssize_t *var, Py_ssize_t value) +{ +#if SIZEOF_VOID_P == 8 + Py_BUILD_ASSERT(sizeof(__int64) == sizeof(*var)); + volatile __int64 *volatile_var = (volatile __int64 *)var; + _InterlockedExchange64(volatile_var, value); +#else + Py_BUILD_ASSERT(sizeof(long) == sizeof(*var)); + volatile long *volatile_var = (volatile long *)var; + _InterlockedExchange(volatile_var, value); +#endif +} + +#else +// Fallback implementation using volatile + +static inline Py_ssize_t _Py_atomic_size_get(Py_ssize_t *var) +{ + volatile Py_ssize_t *volatile_var = (volatile Py_ssize_t *)var; + return *volatile_var; +} + +static inline void _Py_atomic_size_set(Py_ssize_t *var, Py_ssize_t value) +{ + volatile Py_ssize_t *volatile_var = (volatile Py_ssize_t *)var; + *volatile_var = value; +} +#endif + +#ifdef __cplusplus +} +#endif +#endif /* Py_ATOMIC_FUNC_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_bitutils.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_bitutils.h new file mode 100644 index 0000000000000000000000000000000000000000..e6bf61ef425bd8121a2c4b423a0467989c776027 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_bitutils.h @@ -0,0 +1,186 @@ +/* Bit and bytes utilities. + + Bytes swap functions, reverse order of bytes: + + - _Py_bswap16(uint16_t) + - _Py_bswap32(uint32_t) + - _Py_bswap64(uint64_t) +*/ + +#ifndef Py_INTERNAL_BITUTILS_H +#define Py_INTERNAL_BITUTILS_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#if defined(__GNUC__) \ + && ((__GNUC__ >= 5) || (__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) + /* __builtin_bswap16() is available since GCC 4.8, + __builtin_bswap32() is available since GCC 4.3, + __builtin_bswap64() is available since GCC 4.3. */ +# define _PY_HAVE_BUILTIN_BSWAP +#endif + +#ifdef _MSC_VER + /* Get _byteswap_ushort(), _byteswap_ulong(), _byteswap_uint64() */ +# include +#endif + +static inline uint16_t +_Py_bswap16(uint16_t word) +{ +#if defined(_PY_HAVE_BUILTIN_BSWAP) || _Py__has_builtin(__builtin_bswap16) + return __builtin_bswap16(word); +#elif defined(_MSC_VER) + Py_BUILD_ASSERT(sizeof(word) == sizeof(unsigned short)); + return _byteswap_ushort(word); +#else + // Portable implementation which doesn't rely on circular bit shift + return ( ((word & UINT16_C(0x00FF)) << 8) + | ((word & UINT16_C(0xFF00)) >> 8)); +#endif +} + +static inline uint32_t +_Py_bswap32(uint32_t word) +{ +#if defined(_PY_HAVE_BUILTIN_BSWAP) || _Py__has_builtin(__builtin_bswap32) + return __builtin_bswap32(word); +#elif defined(_MSC_VER) + Py_BUILD_ASSERT(sizeof(word) == sizeof(unsigned long)); + return _byteswap_ulong(word); +#else + // Portable implementation which doesn't rely on circular bit shift + return ( ((word & UINT32_C(0x000000FF)) << 24) + | ((word & UINT32_C(0x0000FF00)) << 8) + | ((word & UINT32_C(0x00FF0000)) >> 8) + | ((word & UINT32_C(0xFF000000)) >> 24)); +#endif +} + +static inline uint64_t +_Py_bswap64(uint64_t word) +{ +#if defined(_PY_HAVE_BUILTIN_BSWAP) || _Py__has_builtin(__builtin_bswap64) + return __builtin_bswap64(word); +#elif defined(_MSC_VER) + return _byteswap_uint64(word); +#else + // Portable implementation which doesn't rely on circular bit shift + return ( ((word & UINT64_C(0x00000000000000FF)) << 56) + | ((word & UINT64_C(0x000000000000FF00)) << 40) + | ((word & UINT64_C(0x0000000000FF0000)) << 24) + | ((word & UINT64_C(0x00000000FF000000)) << 8) + | ((word & UINT64_C(0x000000FF00000000)) >> 8) + | ((word & UINT64_C(0x0000FF0000000000)) >> 24) + | ((word & UINT64_C(0x00FF000000000000)) >> 40) + | ((word & UINT64_C(0xFF00000000000000)) >> 56)); +#endif +} + + +// Population count: count the number of 1's in 'x' +// (number of bits set to 1), also known as the hamming weight. +// +// Implementation note. CPUID is not used, to test if x86 POPCNT instruction +// can be used, to keep the implementation simple. For example, Visual Studio +// __popcnt() is not used this reason. The clang and GCC builtin function can +// use the x86 POPCNT instruction if the target architecture has SSE4a or +// newer. +static inline int +_Py_popcount32(uint32_t x) +{ +#if (defined(__clang__) || defined(__GNUC__)) + +#if SIZEOF_INT >= 4 + Py_BUILD_ASSERT(sizeof(x) <= sizeof(unsigned int)); + return __builtin_popcount(x); +#else + // The C standard guarantees that unsigned long will always be big enough + // to hold a uint32_t value without losing information. + Py_BUILD_ASSERT(sizeof(x) <= sizeof(unsigned long)); + return __builtin_popcountl(x); +#endif + +#else + // 32-bit SWAR (SIMD Within A Register) popcount + + // Binary: 0 1 0 1 ... + const uint32_t M1 = 0x55555555; + // Binary: 00 11 00 11. .. + const uint32_t M2 = 0x33333333; + // Binary: 0000 1111 0000 1111 ... + const uint32_t M4 = 0x0F0F0F0F; + + // Put count of each 2 bits into those 2 bits + x = x - ((x >> 1) & M1); + // Put count of each 4 bits into those 4 bits + x = (x & M2) + ((x >> 2) & M2); + // Put count of each 8 bits into those 8 bits + x = (x + (x >> 4)) & M4; + // Sum of the 4 byte counts. + // Take care when considering changes to the next line. Portability and + // correctness are delicate here, thanks to C's "integer promotions" (C99 + // §6.3.1.1p2). On machines where the `int` type has width greater than 32 + // bits, `x` will be promoted to an `int`, and following C's "usual + // arithmetic conversions" (C99 §6.3.1.8), the multiplication will be + // performed as a multiplication of two `unsigned int` operands. In this + // case it's critical that we cast back to `uint32_t` in order to keep only + // the least significant 32 bits. On machines where the `int` type has + // width no greater than 32, the multiplication is of two 32-bit unsigned + // integer types, and the (uint32_t) cast is a no-op. In both cases, we + // avoid the risk of undefined behaviour due to overflow of a + // multiplication of signed integer types. + return (uint32_t)(x * 0x01010101U) >> 24; +#endif +} + + +// Return the index of the most significant 1 bit in 'x'. This is the smallest +// integer k such that x < 2**k. Equivalent to floor(log2(x)) + 1 for x != 0. +static inline int +_Py_bit_length(unsigned long x) +{ +#if (defined(__clang__) || defined(__GNUC__)) + if (x != 0) { + // __builtin_clzl() is available since GCC 3.4. + // Undefined behavior for x == 0. + return (int)sizeof(unsigned long) * 8 - __builtin_clzl(x); + } + else { + return 0; + } +#elif defined(_MSC_VER) + // _BitScanReverse() is documented to search 32 bits. + Py_BUILD_ASSERT(sizeof(unsigned long) <= 4); + unsigned long msb; + if (_BitScanReverse(&msb, x)) { + return (int)msb + 1; + } + else { + return 0; + } +#else + const int BIT_LENGTH_TABLE[32] = { + 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 + }; + int msb = 0; + while (x >= 32) { + msb += 6; + x >>= 6; + } + msb += BIT_LENGTH_TABLE[x]; + return msb; +#endif +} + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_BITUTILS_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_blocks_output_buffer.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_blocks_output_buffer.h new file mode 100644 index 0000000000000000000000000000000000000000..28cf6fba4eeba2e68d7cde88b676589befae4c48 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_blocks_output_buffer.h @@ -0,0 +1,317 @@ +/* + _BlocksOutputBuffer is used to maintain an output buffer + that has unpredictable size. Suitable for compression/decompression + API (bz2/lzma/zlib) that has stream->next_out and stream->avail_out: + + stream->next_out: point to the next output position. + stream->avail_out: the number of available bytes left in the buffer. + + It maintains a list of bytes object, so there is no overhead of resizing + the buffer. + + Usage: + + 1, Initialize the struct instance like this: + _BlocksOutputBuffer buffer = {.list = NULL}; + Set .list to NULL for _BlocksOutputBuffer_OnError() + + 2, Initialize the buffer use one of these functions: + _BlocksOutputBuffer_InitAndGrow() + _BlocksOutputBuffer_InitWithSize() + + 3, If (avail_out == 0), grow the buffer: + _BlocksOutputBuffer_Grow() + + 4, Get the current outputted data size: + _BlocksOutputBuffer_GetDataSize() + + 5, Finish the buffer, and return a bytes object: + _BlocksOutputBuffer_Finish() + + 6, Clean up the buffer when an error occurred: + _BlocksOutputBuffer_OnError() +*/ + +#ifndef Py_INTERNAL_BLOCKS_OUTPUT_BUFFER_H +#define Py_INTERNAL_BLOCKS_OUTPUT_BUFFER_H +#ifdef __cplusplus +extern "C" { +#endif + +#include "Python.h" + +typedef struct { + // List of bytes objects + PyObject *list; + // Number of whole allocated size + Py_ssize_t allocated; + // Max length of the buffer, negative number means unlimited length. + Py_ssize_t max_length; +} _BlocksOutputBuffer; + +static const char unable_allocate_msg[] = "Unable to allocate output buffer."; + +/* In 32-bit build, the max block size should <= INT32_MAX. */ +#define OUTPUT_BUFFER_MAX_BLOCK_SIZE (256*1024*1024) + +/* Block size sequence */ +#define KB (1024) +#define MB (1024*1024) +static const Py_ssize_t BUFFER_BLOCK_SIZE[] = + { 32*KB, 64*KB, 256*KB, 1*MB, 4*MB, 8*MB, 16*MB, 16*MB, + 32*MB, 32*MB, 32*MB, 32*MB, 64*MB, 64*MB, 128*MB, 128*MB, + OUTPUT_BUFFER_MAX_BLOCK_SIZE }; +#undef KB +#undef MB + +/* According to the block sizes defined by BUFFER_BLOCK_SIZE, the whole + allocated size growth step is: + 1 32 KB +32 KB + 2 96 KB +64 KB + 3 352 KB +256 KB + 4 1.34 MB +1 MB + 5 5.34 MB +4 MB + 6 13.34 MB +8 MB + 7 29.34 MB +16 MB + 8 45.34 MB +16 MB + 9 77.34 MB +32 MB + 10 109.34 MB +32 MB + 11 141.34 MB +32 MB + 12 173.34 MB +32 MB + 13 237.34 MB +64 MB + 14 301.34 MB +64 MB + 15 429.34 MB +128 MB + 16 557.34 MB +128 MB + 17 813.34 MB +256 MB + 18 1069.34 MB +256 MB + 19 1325.34 MB +256 MB + 20 1581.34 MB +256 MB + 21 1837.34 MB +256 MB + 22 2093.34 MB +256 MB + ... +*/ + +/* Initialize the buffer, and grow the buffer. + + max_length: Max length of the buffer, -1 for unlimited length. + + On success, return allocated size (>=0) + On failure, return -1 +*/ +static inline Py_ssize_t +_BlocksOutputBuffer_InitAndGrow(_BlocksOutputBuffer *buffer, + const Py_ssize_t max_length, + void **next_out) +{ + PyObject *b; + Py_ssize_t block_size; + + // ensure .list was set to NULL + assert(buffer->list == NULL); + + // get block size + if (0 <= max_length && max_length < BUFFER_BLOCK_SIZE[0]) { + block_size = max_length; + } else { + block_size = BUFFER_BLOCK_SIZE[0]; + } + + // the first block + b = PyBytes_FromStringAndSize(NULL, block_size); + if (b == NULL) { + return -1; + } + + // create the list + buffer->list = PyList_New(1); + if (buffer->list == NULL) { + Py_DECREF(b); + return -1; + } + PyList_SET_ITEM(buffer->list, 0, b); + + // set variables + buffer->allocated = block_size; + buffer->max_length = max_length; + + *next_out = PyBytes_AS_STRING(b); + return block_size; +} + +/* Initialize the buffer, with an initial size. + + Check block size limit in the outer wrapper function. For example, some libs + accept UINT32_MAX as the maximum block size, then init_size should <= it. + + On success, return allocated size (>=0) + On failure, return -1 +*/ +static inline Py_ssize_t +_BlocksOutputBuffer_InitWithSize(_BlocksOutputBuffer *buffer, + const Py_ssize_t init_size, + void **next_out) +{ + PyObject *b; + + // ensure .list was set to NULL + assert(buffer->list == NULL); + + // the first block + b = PyBytes_FromStringAndSize(NULL, init_size); + if (b == NULL) { + PyErr_SetString(PyExc_MemoryError, unable_allocate_msg); + return -1; + } + + // create the list + buffer->list = PyList_New(1); + if (buffer->list == NULL) { + Py_DECREF(b); + return -1; + } + PyList_SET_ITEM(buffer->list, 0, b); + + // set variables + buffer->allocated = init_size; + buffer->max_length = -1; + + *next_out = PyBytes_AS_STRING(b); + return init_size; +} + +/* Grow the buffer. The avail_out must be 0, please check it before calling. + + On success, return allocated size (>=0) + On failure, return -1 +*/ +static inline Py_ssize_t +_BlocksOutputBuffer_Grow(_BlocksOutputBuffer *buffer, + void **next_out, + const Py_ssize_t avail_out) +{ + PyObject *b; + const Py_ssize_t list_len = Py_SIZE(buffer->list); + Py_ssize_t block_size; + + // ensure no gaps in the data + if (avail_out != 0) { + PyErr_SetString(PyExc_SystemError, + "avail_out is non-zero in _BlocksOutputBuffer_Grow()."); + return -1; + } + + // get block size + if (list_len < (Py_ssize_t) Py_ARRAY_LENGTH(BUFFER_BLOCK_SIZE)) { + block_size = BUFFER_BLOCK_SIZE[list_len]; + } else { + block_size = BUFFER_BLOCK_SIZE[Py_ARRAY_LENGTH(BUFFER_BLOCK_SIZE) - 1]; + } + + // check max_length + if (buffer->max_length >= 0) { + // if (rest == 0), should not grow the buffer. + Py_ssize_t rest = buffer->max_length - buffer->allocated; + assert(rest > 0); + + // block_size of the last block + if (block_size > rest) { + block_size = rest; + } + } + + // check buffer->allocated overflow + if (block_size > PY_SSIZE_T_MAX - buffer->allocated) { + PyErr_SetString(PyExc_MemoryError, unable_allocate_msg); + return -1; + } + + // create the block + b = PyBytes_FromStringAndSize(NULL, block_size); + if (b == NULL) { + PyErr_SetString(PyExc_MemoryError, unable_allocate_msg); + return -1; + } + if (PyList_Append(buffer->list, b) < 0) { + Py_DECREF(b); + return -1; + } + Py_DECREF(b); + + // set variables + buffer->allocated += block_size; + + *next_out = PyBytes_AS_STRING(b); + return block_size; +} + +/* Return the current outputted data size. */ +static inline Py_ssize_t +_BlocksOutputBuffer_GetDataSize(_BlocksOutputBuffer *buffer, + const Py_ssize_t avail_out) +{ + return buffer->allocated - avail_out; +} + +/* Finish the buffer. + + Return a bytes object on success + Return NULL on failure +*/ +static inline PyObject * +_BlocksOutputBuffer_Finish(_BlocksOutputBuffer *buffer, + const Py_ssize_t avail_out) +{ + PyObject *result, *block; + const Py_ssize_t list_len = Py_SIZE(buffer->list); + + // fast path for single block + if ((list_len == 1 && avail_out == 0) || + (list_len == 2 && Py_SIZE(PyList_GET_ITEM(buffer->list, 1)) == avail_out)) + { + block = PyList_GET_ITEM(buffer->list, 0); + Py_INCREF(block); + + Py_CLEAR(buffer->list); + return block; + } + + // final bytes object + result = PyBytes_FromStringAndSize(NULL, buffer->allocated - avail_out); + if (result == NULL) { + PyErr_SetString(PyExc_MemoryError, unable_allocate_msg); + return NULL; + } + + // memory copy + if (list_len > 0) { + char *posi = PyBytes_AS_STRING(result); + + // blocks except the last one + Py_ssize_t i = 0; + for (; i < list_len-1; i++) { + block = PyList_GET_ITEM(buffer->list, i); + memcpy(posi, PyBytes_AS_STRING(block), Py_SIZE(block)); + posi += Py_SIZE(block); + } + // the last block + block = PyList_GET_ITEM(buffer->list, i); + memcpy(posi, PyBytes_AS_STRING(block), Py_SIZE(block) - avail_out); + } else { + assert(Py_SIZE(result) == 0); + } + + Py_CLEAR(buffer->list); + return result; +} + +/* Clean up the buffer when an error occurred. */ +static inline void +_BlocksOutputBuffer_OnError(_BlocksOutputBuffer *buffer) +{ + Py_CLEAR(buffer->list); +} + +#ifdef __cplusplus +} +#endif +#endif /* Py_INTERNAL_BLOCKS_OUTPUT_BUFFER_H */ \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_bytes_methods.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_bytes_methods.h new file mode 100644 index 0000000000000000000000000000000000000000..11e8ab20e91367ced72b6c7660201f77a0230cd1 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_bytes_methods.h @@ -0,0 +1,73 @@ +#ifndef Py_LIMITED_API +#ifndef Py_BYTES_CTYPE_H +#define Py_BYTES_CTYPE_H + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +/* + * The internal implementation behind PyBytes (bytes) and PyByteArray (bytearray) + * methods of the given names, they operate on ASCII byte strings. + */ +extern PyObject* _Py_bytes_isspace(const char *cptr, Py_ssize_t len); +extern PyObject* _Py_bytes_isalpha(const char *cptr, Py_ssize_t len); +extern PyObject* _Py_bytes_isalnum(const char *cptr, Py_ssize_t len); +extern PyObject* _Py_bytes_isascii(const char *cptr, Py_ssize_t len); +extern PyObject* _Py_bytes_isdigit(const char *cptr, Py_ssize_t len); +extern PyObject* _Py_bytes_islower(const char *cptr, Py_ssize_t len); +extern PyObject* _Py_bytes_isupper(const char *cptr, Py_ssize_t len); +extern PyObject* _Py_bytes_istitle(const char *cptr, Py_ssize_t len); + +/* These store their len sized answer in the given preallocated *result arg. */ +extern void _Py_bytes_lower(char *result, const char *cptr, Py_ssize_t len); +extern void _Py_bytes_upper(char *result, const char *cptr, Py_ssize_t len); +extern void _Py_bytes_title(char *result, const char *s, Py_ssize_t len); +extern void _Py_bytes_capitalize(char *result, const char *s, Py_ssize_t len); +extern void _Py_bytes_swapcase(char *result, const char *s, Py_ssize_t len); + +extern PyObject *_Py_bytes_find(const char *str, Py_ssize_t len, PyObject *args); +extern PyObject *_Py_bytes_index(const char *str, Py_ssize_t len, PyObject *args); +extern PyObject *_Py_bytes_rfind(const char *str, Py_ssize_t len, PyObject *args); +extern PyObject *_Py_bytes_rindex(const char *str, Py_ssize_t len, PyObject *args); +extern PyObject *_Py_bytes_count(const char *str, Py_ssize_t len, PyObject *args); +extern int _Py_bytes_contains(const char *str, Py_ssize_t len, PyObject *arg); +extern PyObject *_Py_bytes_startswith(const char *str, Py_ssize_t len, PyObject *args); +extern PyObject *_Py_bytes_endswith(const char *str, Py_ssize_t len, PyObject *args); + +/* The maketrans() static method. */ +extern PyObject* _Py_bytes_maketrans(Py_buffer *frm, Py_buffer *to); + +/* Shared __doc__ strings. */ +extern const char _Py_isspace__doc__[]; +extern const char _Py_isalpha__doc__[]; +extern const char _Py_isalnum__doc__[]; +extern const char _Py_isascii__doc__[]; +extern const char _Py_isdigit__doc__[]; +extern const char _Py_islower__doc__[]; +extern const char _Py_isupper__doc__[]; +extern const char _Py_istitle__doc__[]; +extern const char _Py_lower__doc__[]; +extern const char _Py_upper__doc__[]; +extern const char _Py_title__doc__[]; +extern const char _Py_capitalize__doc__[]; +extern const char _Py_swapcase__doc__[]; +extern const char _Py_count__doc__[]; +extern const char _Py_find__doc__[]; +extern const char _Py_index__doc__[]; +extern const char _Py_rfind__doc__[]; +extern const char _Py_rindex__doc__[]; +extern const char _Py_startswith__doc__[]; +extern const char _Py_endswith__doc__[]; +extern const char _Py_maketrans__doc__[]; +extern const char _Py_expandtabs__doc__[]; +extern const char _Py_ljust__doc__[]; +extern const char _Py_rjust__doc__[]; +extern const char _Py_center__doc__[]; +extern const char _Py_zfill__doc__[]; + +/* this is needed because some docs are shared from the .o, not static */ +#define PyDoc_STRVAR_shared(name,str) const char name[] = PyDoc_STR(str) + +#endif /* !Py_BYTES_CTYPE_H */ +#endif /* !Py_LIMITED_API */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_bytesobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_bytesobject.h new file mode 100644 index 0000000000000000000000000000000000000000..9173a4f105f80084d3b8572d2277a7a44c1c3a5e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_bytesobject.h @@ -0,0 +1,52 @@ +#ifndef Py_INTERNAL_BYTESOBJECT_H +#define Py_INTERNAL_BYTESOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + + +/* runtime lifecycle */ + +extern PyStatus _PyBytes_InitTypes(PyInterpreterState *); + + +/* Substring Search. + + Returns the index of the first occurrence of + a substring ("needle") in a larger text ("haystack"). + If the needle is not found, return -1. + If the needle is found, add offset to the index. +*/ + +PyAPI_FUNC(Py_ssize_t) +_PyBytes_Find(const char *haystack, Py_ssize_t len_haystack, + const char *needle, Py_ssize_t len_needle, + Py_ssize_t offset); + +/* Same as above, but search right-to-left */ +PyAPI_FUNC(Py_ssize_t) +_PyBytes_ReverseFind(const char *haystack, Py_ssize_t len_haystack, + const char *needle, Py_ssize_t len_needle, + Py_ssize_t offset); + + +/** Helper function to implement the repeat and inplace repeat methods on a buffer + * + * len_dest is assumed to be an integer multiple of len_src. + * If src equals dest, then assume the operation is inplace. + * + * This method repeately doubles the number of bytes copied to reduce + * the number of invocations of memcpy. + */ +PyAPI_FUNC(void) +_PyBytes_Repeat(char* dest, Py_ssize_t len_dest, + const char* src, Py_ssize_t len_src); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_BYTESOBJECT_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_call.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_call.h new file mode 100644 index 0000000000000000000000000000000000000000..3ccacfa0b8b0387a2aa83608e1f424741b3553cf --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_call.h @@ -0,0 +1,121 @@ +#ifndef Py_INTERNAL_CALL_H +#define Py_INTERNAL_CALL_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_pystate.h" // _PyThreadState_GET() + +PyAPI_FUNC(PyObject *) _PyObject_Call_Prepend( + PyThreadState *tstate, + PyObject *callable, + PyObject *obj, + PyObject *args, + PyObject *kwargs); + +PyAPI_FUNC(PyObject *) _PyObject_FastCallDictTstate( + PyThreadState *tstate, + PyObject *callable, + PyObject *const *args, + size_t nargsf, + PyObject *kwargs); + +PyAPI_FUNC(PyObject *) _PyObject_Call( + PyThreadState *tstate, + PyObject *callable, + PyObject *args, + PyObject *kwargs); + +extern PyObject * _PyObject_CallMethodFormat( + PyThreadState *tstate, PyObject *callable, const char *format, ...); + + +// Static inline variant of public PyVectorcall_Function(). +static inline vectorcallfunc +_PyVectorcall_FunctionInline(PyObject *callable) +{ + assert(callable != NULL); + + PyTypeObject *tp = Py_TYPE(callable); + if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) { + return NULL; + } + assert(PyCallable_Check(callable)); + + Py_ssize_t offset = tp->tp_vectorcall_offset; + assert(offset > 0); + + vectorcallfunc ptr; + memcpy(&ptr, (char *) callable + offset, sizeof(ptr)); + return ptr; +} + + +/* Call the callable object 'callable' with the "vectorcall" calling + convention. + + args is a C array for positional arguments. + + nargsf is the number of positional arguments plus optionally the flag + PY_VECTORCALL_ARGUMENTS_OFFSET which means that the caller is allowed to + modify args[-1]. + + kwnames is a tuple of keyword names. The values of the keyword arguments + are stored in "args" after the positional arguments (note that the number + of keyword arguments does not change nargsf). kwnames can also be NULL if + there are no keyword arguments. + + keywords must only contain strings and all keys must be unique. + + Return the result on success. Raise an exception and return NULL on + error. */ +static inline PyObject * +_PyObject_VectorcallTstate(PyThreadState *tstate, PyObject *callable, + PyObject *const *args, size_t nargsf, + PyObject *kwnames) +{ + vectorcallfunc func; + PyObject *res; + + assert(kwnames == NULL || PyTuple_Check(kwnames)); + assert(args != NULL || PyVectorcall_NARGS(nargsf) == 0); + + func = _PyVectorcall_FunctionInline(callable); + if (func == NULL) { + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); + return _PyObject_MakeTpCall(tstate, callable, args, nargs, kwnames); + } + res = func(callable, args, nargsf, kwnames); + return _Py_CheckFunctionResult(tstate, callable, res, NULL); +} + + +static inline PyObject * +_PyObject_CallNoArgsTstate(PyThreadState *tstate, PyObject *func) { + return _PyObject_VectorcallTstate(tstate, func, NULL, 0, NULL); +} + + +// Private static inline function variant of public PyObject_CallNoArgs() +static inline PyObject * +_PyObject_CallNoArgs(PyObject *func) { + PyThreadState *tstate = _PyThreadState_GET(); + return _PyObject_VectorcallTstate(tstate, func, NULL, 0, NULL); +} + + +static inline PyObject * +_PyObject_FastCallTstate(PyThreadState *tstate, PyObject *func, PyObject *const *args, Py_ssize_t nargs) +{ + return _PyObject_VectorcallTstate(tstate, func, args, (size_t)nargs, NULL); +} + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_CALL_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_ceval.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_ceval.h new file mode 100644 index 0000000000000000000000000000000000000000..8d18d200aa4bf06c1209b2b8557ff11f98af3c79 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_ceval.h @@ -0,0 +1,138 @@ +#ifndef Py_INTERNAL_CEVAL_H +#define Py_INTERNAL_CEVAL_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +/* Forward declarations */ +struct pyruntimestate; +struct _ceval_runtime_state; + +/* WASI has limited call stack. Python's recursion limit depends on code + layout, optimization, and WASI runtime. Wasmtime can handle about 700-750 + recursions, sometimes less. 600 is a more conservative limit. */ +#ifndef Py_DEFAULT_RECURSION_LIMIT +# ifdef __wasi__ +# define Py_DEFAULT_RECURSION_LIMIT 600 +# else +# define Py_DEFAULT_RECURSION_LIMIT 1000 +# endif +#endif + +#include "pycore_interp.h" // PyInterpreterState.eval_frame +#include "pycore_pystate.h" // _PyThreadState_GET() + + +extern void _Py_FinishPendingCalls(PyThreadState *tstate); +extern void _PyEval_InitRuntimeState(struct _ceval_runtime_state *); +extern void _PyEval_InitState(struct _ceval_state *, PyThread_type_lock); +extern void _PyEval_FiniState(struct _ceval_state *ceval); +PyAPI_FUNC(void) _PyEval_SignalReceived(PyInterpreterState *interp); +PyAPI_FUNC(int) _PyEval_AddPendingCall( + PyInterpreterState *interp, + int (*func)(void *), + void *arg); +PyAPI_FUNC(void) _PyEval_SignalAsyncExc(PyInterpreterState *interp); +#ifdef HAVE_FORK +extern PyStatus _PyEval_ReInitThreads(PyThreadState *tstate); +#endif + +// Used by sys.call_tracing() +extern PyObject* _PyEval_CallTracing(PyObject *func, PyObject *args); + +// Used by sys.get_asyncgen_hooks() +extern PyObject* _PyEval_GetAsyncGenFirstiter(void); +extern PyObject* _PyEval_GetAsyncGenFinalizer(void); + +// Used by sys.set_asyncgen_hooks() +extern int _PyEval_SetAsyncGenFirstiter(PyObject *); +extern int _PyEval_SetAsyncGenFinalizer(PyObject *); + +// Used by sys.get_coroutine_origin_tracking_depth() +// and sys.set_coroutine_origin_tracking_depth() +extern int _PyEval_GetCoroutineOriginTrackingDepth(void); +extern int _PyEval_SetCoroutineOriginTrackingDepth(int depth); + +extern void _PyEval_Fini(void); + + +extern PyObject* _PyEval_GetBuiltins(PyThreadState *tstate); +extern PyObject* _PyEval_BuiltinsFromGlobals( + PyThreadState *tstate, + PyObject *globals); + + +static inline PyObject* +_PyEval_EvalFrame(PyThreadState *tstate, struct _PyInterpreterFrame *frame, int throwflag) +{ + if (tstate->interp->eval_frame == NULL) { + return _PyEval_EvalFrameDefault(tstate, frame, throwflag); + } + return tstate->interp->eval_frame(tstate, frame, throwflag); +} + +extern PyObject* +_PyEval_Vector(PyThreadState *tstate, + PyFunctionObject *func, PyObject *locals, + PyObject* const* args, size_t argcount, + PyObject *kwnames); + +extern int _PyEval_ThreadsInitialized(struct pyruntimestate *runtime); +extern PyStatus _PyEval_InitGIL(PyThreadState *tstate); +extern void _PyEval_FiniGIL(PyInterpreterState *interp); + +extern void _PyEval_ReleaseLock(PyThreadState *tstate); + +extern void _PyEval_DeactivateOpCache(void); + + +/* --- _Py_EnterRecursiveCall() ----------------------------------------- */ + +#ifdef USE_STACKCHECK +/* With USE_STACKCHECK macro defined, trigger stack checks in + _Py_CheckRecursiveCall() on every 64th call to _Py_EnterRecursiveCall. */ +static inline int _Py_MakeRecCheck(PyThreadState *tstate) { + return (tstate->recursion_remaining-- <= 0 + || (tstate->recursion_remaining & 63) == 0); +} +#else +static inline int _Py_MakeRecCheck(PyThreadState *tstate) { + return tstate->recursion_remaining-- <= 0; +} +#endif + +PyAPI_FUNC(int) _Py_CheckRecursiveCall( + PyThreadState *tstate, + const char *where); + +static inline int _Py_EnterRecursiveCallTstate(PyThreadState *tstate, + const char *where) { + return (_Py_MakeRecCheck(tstate) && _Py_CheckRecursiveCall(tstate, where)); +} + +static inline int _Py_EnterRecursiveCall(const char *where) { + PyThreadState *tstate = _PyThreadState_GET(); + return _Py_EnterRecursiveCallTstate(tstate, where); +} + +static inline void _Py_LeaveRecursiveCallTstate(PyThreadState *tstate) { + tstate->recursion_remaining++; +} + +static inline void _Py_LeaveRecursiveCall(void) { + PyThreadState *tstate = _PyThreadState_GET(); + _Py_LeaveRecursiveCallTstate(tstate); +} + +extern struct _PyInterpreterFrame* _PyEval_GetFrame(void); + +extern PyObject* _Py_MakeCoro(PyFunctionObject *func); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_CEVAL_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_code.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_code.h new file mode 100644 index 0000000000000000000000000000000000000000..3a24a65426985e67afd2a0affddb16e0a564af8a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_code.h @@ -0,0 +1,564 @@ +#ifndef Py_INTERNAL_CODE_H +#define Py_INTERNAL_CODE_H +#ifdef __cplusplus +extern "C" { +#endif + +/* PEP 659 + * Specialization and quickening structs and helper functions + */ + + +// Inline caches. If you change the number of cache entries for an instruction, +// you must *also* update the number of cache entries in Lib/opcode.py and bump +// the magic number in Lib/importlib/_bootstrap_external.py! + +#define CACHE_ENTRIES(cache) (sizeof(cache)/sizeof(_Py_CODEUNIT)) + +typedef struct { + _Py_CODEUNIT counter; + _Py_CODEUNIT index; + _Py_CODEUNIT module_keys_version[2]; + _Py_CODEUNIT builtin_keys_version; +} _PyLoadGlobalCache; + +#define INLINE_CACHE_ENTRIES_LOAD_GLOBAL CACHE_ENTRIES(_PyLoadGlobalCache) + +typedef struct { + _Py_CODEUNIT counter; +} _PyBinaryOpCache; + +#define INLINE_CACHE_ENTRIES_BINARY_OP CACHE_ENTRIES(_PyBinaryOpCache) + +typedef struct { + _Py_CODEUNIT counter; +} _PyUnpackSequenceCache; + +#define INLINE_CACHE_ENTRIES_UNPACK_SEQUENCE \ + CACHE_ENTRIES(_PyUnpackSequenceCache) + +typedef struct { + _Py_CODEUNIT counter; + _Py_CODEUNIT mask; +} _PyCompareOpCache; + +#define INLINE_CACHE_ENTRIES_COMPARE_OP CACHE_ENTRIES(_PyCompareOpCache) + +typedef struct { + _Py_CODEUNIT counter; + _Py_CODEUNIT type_version[2]; + _Py_CODEUNIT func_version; +} _PyBinarySubscrCache; + +#define INLINE_CACHE_ENTRIES_BINARY_SUBSCR CACHE_ENTRIES(_PyBinarySubscrCache) + +typedef struct { + _Py_CODEUNIT counter; + _Py_CODEUNIT version[2]; + _Py_CODEUNIT index; +} _PyAttrCache; + +#define INLINE_CACHE_ENTRIES_LOAD_ATTR CACHE_ENTRIES(_PyAttrCache) + +#define INLINE_CACHE_ENTRIES_STORE_ATTR CACHE_ENTRIES(_PyAttrCache) + +typedef struct { + _Py_CODEUNIT counter; + _Py_CODEUNIT type_version[2]; + _Py_CODEUNIT dict_offset; + _Py_CODEUNIT keys_version[2]; + _Py_CODEUNIT descr[4]; +} _PyLoadMethodCache; + +#define INLINE_CACHE_ENTRIES_LOAD_METHOD CACHE_ENTRIES(_PyLoadMethodCache) + +typedef struct { + _Py_CODEUNIT counter; + _Py_CODEUNIT func_version[2]; + _Py_CODEUNIT min_args; +} _PyCallCache; + +#define INLINE_CACHE_ENTRIES_CALL CACHE_ENTRIES(_PyCallCache) + +typedef struct { + _Py_CODEUNIT counter; +} _PyPrecallCache; + +#define INLINE_CACHE_ENTRIES_PRECALL CACHE_ENTRIES(_PyPrecallCache) + +typedef struct { + _Py_CODEUNIT counter; +} _PyStoreSubscrCache; + +#define INLINE_CACHE_ENTRIES_STORE_SUBSCR CACHE_ENTRIES(_PyStoreSubscrCache) + +#define QUICKENING_WARMUP_DELAY 8 + +/* We want to compare to zero for efficiency, so we offset values accordingly */ +#define QUICKENING_INITIAL_WARMUP_VALUE (-QUICKENING_WARMUP_DELAY) + +void _PyCode_Quicken(PyCodeObject *code); + +static inline void +_PyCode_Warmup(PyCodeObject *code) +{ + if (code->co_warmup != 0) { + code->co_warmup++; + if (code->co_warmup == 0) { + _PyCode_Quicken(code); + } + } +} + +extern uint8_t _PyOpcode_Adaptive[256]; + +extern Py_ssize_t _Py_QuickenedCount; + +// Borrowed references to common callables: +struct callable_cache { + PyObject *isinstance; + PyObject *len; + PyObject *list_append; +}; + +/* "Locals plus" for a code object is the set of locals + cell vars + + * free vars. This relates to variable names as well as offsets into + * the "fast locals" storage array of execution frames. The compiler + * builds the list of names, their offsets, and the corresponding + * kind of local. + * + * Those kinds represent the source of the initial value and the + * variable's scope (as related to closures). A "local" is an + * argument or other variable defined in the current scope. A "free" + * variable is one that is defined in an outer scope and comes from + * the function's closure. A "cell" variable is a local that escapes + * into an inner function as part of a closure, and thus must be + * wrapped in a cell. Any "local" can also be a "cell", but the + * "free" kind is mutually exclusive with both. + */ + +// Note that these all fit within a byte, as do combinations. +// Later, we will use the smaller numbers to differentiate the different +// kinds of locals (e.g. pos-only arg, varkwargs, local-only). +#define CO_FAST_LOCAL 0x20 +#define CO_FAST_CELL 0x40 +#define CO_FAST_FREE 0x80 + +typedef unsigned char _PyLocals_Kind; + +static inline _PyLocals_Kind +_PyLocals_GetKind(PyObject *kinds, int i) +{ + assert(PyBytes_Check(kinds)); + assert(0 <= i && i < PyBytes_GET_SIZE(kinds)); + char *ptr = PyBytes_AS_STRING(kinds); + return (_PyLocals_Kind)(ptr[i]); +} + +static inline void +_PyLocals_SetKind(PyObject *kinds, int i, _PyLocals_Kind kind) +{ + assert(PyBytes_Check(kinds)); + assert(0 <= i && i < PyBytes_GET_SIZE(kinds)); + char *ptr = PyBytes_AS_STRING(kinds); + ptr[i] = (char) kind; +} + + +struct _PyCodeConstructor { + /* metadata */ + PyObject *filename; + PyObject *name; + PyObject *qualname; + int flags; + + /* the code */ + PyObject *code; + int firstlineno; + PyObject *linetable; + + /* used by the code */ + PyObject *consts; + PyObject *names; + + /* mapping frame offsets to information */ + PyObject *localsplusnames; // Tuple of strings + PyObject *localspluskinds; // Bytes object, one byte per variable + + /* args (within varnames) */ + int argcount; + int posonlyargcount; + // XXX Replace argcount with posorkwargcount (argcount - posonlyargcount). + int kwonlyargcount; + + /* needed to create the frame */ + int stacksize; + + /* used by the eval loop */ + PyObject *exceptiontable; +}; + +// Using an "arguments struct" like this is helpful for maintainability +// in a case such as this with many parameters. It does bear a risk: +// if the struct changes and callers are not updated properly then the +// compiler will not catch problems (like a missing argument). This can +// cause hard-to-debug problems. The risk is mitigated by the use of +// check_code() in codeobject.c. However, we may decide to switch +// back to a regular function signature. Regardless, this approach +// wouldn't be appropriate if this weren't a strictly internal API. +// (See the comments in https://github.com/python/cpython/pull/26258.) +PyAPI_FUNC(int) _PyCode_Validate(struct _PyCodeConstructor *); +PyAPI_FUNC(PyCodeObject *) _PyCode_New(struct _PyCodeConstructor *); + + +/* Private API */ + +/* Getters for internal PyCodeObject data. */ +extern PyObject* _PyCode_GetVarnames(PyCodeObject *); +extern PyObject* _PyCode_GetCellvars(PyCodeObject *); +extern PyObject* _PyCode_GetFreevars(PyCodeObject *); +extern PyObject* _PyCode_GetCode(PyCodeObject *); + +/** API for initializing the line number tables. */ +extern int _PyCode_InitAddressRange(PyCodeObject* co, PyCodeAddressRange *bounds); + +/** Out of process API for initializing the location table. */ +extern void _PyLineTable_InitAddressRange( + const char *linetable, + Py_ssize_t length, + int firstlineno, + PyCodeAddressRange *range); + +/** API for traversing the line number table. */ +extern int _PyLineTable_NextAddressRange(PyCodeAddressRange *range); +extern int _PyLineTable_PreviousAddressRange(PyCodeAddressRange *range); + +/* Specialization functions */ + +extern int _Py_Specialize_LoadAttr(PyObject *owner, _Py_CODEUNIT *instr, + PyObject *name); +extern int _Py_Specialize_StoreAttr(PyObject *owner, _Py_CODEUNIT *instr, + PyObject *name); +extern int _Py_Specialize_LoadGlobal(PyObject *globals, PyObject *builtins, _Py_CODEUNIT *instr, PyObject *name); +extern int _Py_Specialize_LoadMethod(PyObject *owner, _Py_CODEUNIT *instr, + PyObject *name); +extern int _Py_Specialize_BinarySubscr(PyObject *sub, PyObject *container, _Py_CODEUNIT *instr); +extern int _Py_Specialize_StoreSubscr(PyObject *container, PyObject *sub, _Py_CODEUNIT *instr); +extern int _Py_Specialize_Call(PyObject *callable, _Py_CODEUNIT *instr, + int nargs, PyObject *kwnames); +extern int _Py_Specialize_Precall(PyObject *callable, _Py_CODEUNIT *instr, + int nargs, PyObject *kwnames, int oparg); +extern void _Py_Specialize_BinaryOp(PyObject *lhs, PyObject *rhs, _Py_CODEUNIT *instr, + int oparg, PyObject **locals); +extern void _Py_Specialize_CompareOp(PyObject *lhs, PyObject *rhs, + _Py_CODEUNIT *instr, int oparg); +extern void _Py_Specialize_UnpackSequence(PyObject *seq, _Py_CODEUNIT *instr, + int oparg); + +/* Deallocator function for static codeobjects used in deepfreeze.py */ +extern void _PyStaticCode_Dealloc(PyCodeObject *co); +/* Function to intern strings of codeobjects */ +extern int _PyStaticCode_InternStrings(PyCodeObject *co); + +#ifdef Py_STATS + +#define SPECIALIZATION_FAILURE_KINDS 30 + +typedef struct _specialization_stats { + uint64_t success; + uint64_t failure; + uint64_t hit; + uint64_t deferred; + uint64_t miss; + uint64_t deopt; + uint64_t failure_kinds[SPECIALIZATION_FAILURE_KINDS]; +} SpecializationStats; + +typedef struct _opcode_stats { + SpecializationStats specialization; + uint64_t execution_count; + uint64_t pair_count[256]; +} OpcodeStats; + +typedef struct _call_stats { + uint64_t inlined_py_calls; + uint64_t pyeval_calls; + uint64_t frames_pushed; + uint64_t frame_objects_created; +} CallStats; + +typedef struct _object_stats { + uint64_t allocations; + uint64_t allocations512; + uint64_t allocations4k; + uint64_t allocations_big; + uint64_t frees; + uint64_t to_freelist; + uint64_t from_freelist; + uint64_t new_values; + uint64_t dict_materialized_on_request; + uint64_t dict_materialized_new_key; + uint64_t dict_materialized_too_big; + uint64_t dict_materialized_str_subclass; +} ObjectStats; + +typedef struct _stats { + OpcodeStats opcode_stats[256]; + CallStats call_stats; + ObjectStats object_stats; +} PyStats; + +extern PyStats _py_stats; + +#define STAT_INC(opname, name) _py_stats.opcode_stats[opname].specialization.name++ +#define STAT_DEC(opname, name) _py_stats.opcode_stats[opname].specialization.name-- +#define OPCODE_EXE_INC(opname) _py_stats.opcode_stats[opname].execution_count++ +#define CALL_STAT_INC(name) _py_stats.call_stats.name++ +#define OBJECT_STAT_INC(name) _py_stats.object_stats.name++ +#define OBJECT_STAT_INC_COND(name, cond) \ + do { if (cond) _py_stats.object_stats.name++; } while (0) + +extern void _Py_PrintSpecializationStats(int to_file); + +// Used by the _opcode extension which is built as a shared library +PyAPI_FUNC(PyObject*) _Py_GetSpecializationStats(void); + +#else +#define STAT_INC(opname, name) ((void)0) +#define STAT_DEC(opname, name) ((void)0) +#define OPCODE_EXE_INC(opname) ((void)0) +#define CALL_STAT_INC(name) ((void)0) +#define OBJECT_STAT_INC(name) ((void)0) +#define OBJECT_STAT_INC_COND(name, cond) ((void)0) +#endif // !Py_STATS + +// Cache values are only valid in memory, so use native endianness. +#ifdef WORDS_BIGENDIAN + +static inline void +write_u32(uint16_t *p, uint32_t val) +{ + p[0] = (uint16_t)(val >> 16); + p[1] = (uint16_t)(val >> 0); +} + +static inline void +write_u64(uint16_t *p, uint64_t val) +{ + p[0] = (uint16_t)(val >> 48); + p[1] = (uint16_t)(val >> 32); + p[2] = (uint16_t)(val >> 16); + p[3] = (uint16_t)(val >> 0); +} + +static inline uint32_t +read_u32(uint16_t *p) +{ + uint32_t val = 0; + val |= (uint32_t)p[0] << 16; + val |= (uint32_t)p[1] << 0; + return val; +} + +static inline uint64_t +read_u64(uint16_t *p) +{ + uint64_t val = 0; + val |= (uint64_t)p[0] << 48; + val |= (uint64_t)p[1] << 32; + val |= (uint64_t)p[2] << 16; + val |= (uint64_t)p[3] << 0; + return val; +} + +#else + +static inline void +write_u32(uint16_t *p, uint32_t val) +{ + p[0] = (uint16_t)(val >> 0); + p[1] = (uint16_t)(val >> 16); +} + +static inline void +write_u64(uint16_t *p, uint64_t val) +{ + p[0] = (uint16_t)(val >> 0); + p[1] = (uint16_t)(val >> 16); + p[2] = (uint16_t)(val >> 32); + p[3] = (uint16_t)(val >> 48); +} + +static inline uint32_t +read_u32(uint16_t *p) +{ + uint32_t val = 0; + val |= (uint32_t)p[0] << 0; + val |= (uint32_t)p[1] << 16; + return val; +} + +static inline uint64_t +read_u64(uint16_t *p) +{ + uint64_t val = 0; + val |= (uint64_t)p[0] << 0; + val |= (uint64_t)p[1] << 16; + val |= (uint64_t)p[2] << 32; + val |= (uint64_t)p[3] << 48; + return val; +} + +#endif + +static inline void +write_obj(uint16_t *p, PyObject *obj) +{ + uintptr_t val = (uintptr_t)obj; +#if SIZEOF_VOID_P == 8 + write_u64(p, val); +#elif SIZEOF_VOID_P == 4 + write_u32(p, val); +#else + #error "SIZEOF_VOID_P must be 4 or 8" +#endif +} + +static inline PyObject * +read_obj(uint16_t *p) +{ + uintptr_t val; +#if SIZEOF_VOID_P == 8 + val = read_u64(p); +#elif SIZEOF_VOID_P == 4 + val = read_u32(p); +#else + #error "SIZEOF_VOID_P must be 4 or 8" +#endif + return (PyObject *)val; +} + +/* See Objects/exception_handling_notes.txt for details. + */ +static inline unsigned char * +parse_varint(unsigned char *p, int *result) { + int val = p[0] & 63; + while (p[0] & 64) { + p++; + val = (val << 6) | (p[0] & 63); + } + *result = val; + return p+1; +} + +static inline int +write_varint(uint8_t *ptr, unsigned int val) +{ + int written = 1; + while (val >= 64) { + *ptr++ = 64 | (val & 63); + val >>= 6; + written++; + } + *ptr = val; + return written; +} + +static inline int +write_signed_varint(uint8_t *ptr, int val) +{ + if (val < 0) { + val = ((-val)<<1) | 1; + } + else { + val = val << 1; + } + return write_varint(ptr, val); +} + +static inline int +write_location_entry_start(uint8_t *ptr, int code, int length) +{ + assert((code & 15) == code); + *ptr = 128 | (code << 3) | (length - 1); + return 1; +} + + +/** Counters + * The first 16-bit value in each inline cache is a counter. + * When counting misses, the counter is treated as a simple unsigned value. + * + * When counting executions until the next specialization attempt, + * exponential backoff is used to reduce the number of specialization failures. + * The high 12 bits store the counter, the low 4 bits store the backoff exponent. + * On a specialization failure, the backoff exponent is incremented and the + * counter set to (2**backoff - 1). + * Backoff == 6 -> starting counter == 63, backoff == 10 -> starting counter == 1023. + */ + +/* With a 16-bit counter, we have 12 bits for the counter value, and 4 bits for the backoff */ +#define ADAPTIVE_BACKOFF_BITS 4 +/* The initial counter value is 31 == 2**ADAPTIVE_BACKOFF_START - 1 */ +#define ADAPTIVE_BACKOFF_START 5 + +#define MAX_BACKOFF_VALUE (16 - ADAPTIVE_BACKOFF_BITS) + + +static inline uint16_t +adaptive_counter_bits(int value, int backoff) { + return (value << ADAPTIVE_BACKOFF_BITS) | + (backoff & ((1< MAX_BACKOFF_VALUE) { + backoff = MAX_BACKOFF_VALUE; + } + unsigned int value = (1 << backoff) - 1; + return adaptive_counter_bits(value, backoff); +} + + +/* Line array cache for tracing */ + +extern int _PyCode_CreateLineArray(PyCodeObject *co); + +static inline int +_PyCode_InitLineArray(PyCodeObject *co) +{ + if (co->_co_linearray) { + return 0; + } + return _PyCode_CreateLineArray(co); +} + +static inline int +_PyCode_LineNumberFromArray(PyCodeObject *co, int index) +{ + assert(co->_co_linearray != NULL); + assert(index >= 0); + assert(index < Py_SIZE(co)); + if (co->_co_linearray_entry_size == 2) { + return ((int16_t *)co->_co_linearray)[index]; + } + else { + assert(co->_co_linearray_entry_size == 4); + return ((int32_t *)co->_co_linearray)[index]; + } +} + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_CODE_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_compile.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_compile.h new file mode 100644 index 0000000000000000000000000000000000000000..06a6082cddae6a3e01836988de9baa0463ed28ca --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_compile.h @@ -0,0 +1,44 @@ +#ifndef Py_INTERNAL_COMPILE_H +#define Py_INTERNAL_COMPILE_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +struct _arena; // Type defined in pycore_pyarena.h +struct _mod; // Type defined in pycore_ast.h + +// Export the symbol for test_peg_generator (built as a library) +PyAPI_FUNC(PyCodeObject*) _PyAST_Compile( + struct _mod *mod, + PyObject *filename, + PyCompilerFlags *flags, + int optimize, + struct _arena *arena); +extern PyFutureFeatures* _PyFuture_FromAST( + struct _mod * mod, + PyObject *filename + ); + +extern PyObject* _Py_Mangle(PyObject *p, PyObject *name); + +typedef struct { + int optimize; + int ff_features; + + int recursion_depth; /* current recursion depth */ + int recursion_limit; /* recursion limit */ +} _PyASTOptimizeState; + +extern int _PyAST_Optimize( + struct _mod *, + struct _arena *arena, + _PyASTOptimizeState *state); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_COMPILE_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_condvar.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_condvar.h new file mode 100644 index 0000000000000000000000000000000000000000..981c962bf7dfdfa31fd774550394efc5702d74dc --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_condvar.h @@ -0,0 +1,97 @@ +#ifndef Py_INTERNAL_CONDVAR_H +#define Py_INTERNAL_CONDVAR_H + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#ifndef _POSIX_THREADS +/* This means pthreads are not implemented in libc headers, hence the macro + not present in unistd.h. But they still can be implemented as an external + library (e.g. gnu pth in pthread emulation) */ +# ifdef HAVE_PTHREAD_H +# include /* _POSIX_THREADS */ +# endif +#endif + +#ifdef _POSIX_THREADS +/* + * POSIX support + */ +#define Py_HAVE_CONDVAR + +#ifdef HAVE_PTHREAD_H +# include +#endif + +#define PyMUTEX_T pthread_mutex_t +#define PyCOND_T pthread_cond_t + +#elif defined(NT_THREADS) +/* + * Windows (XP, 2003 server and later, as well as (hopefully) CE) support + * + * Emulated condition variables ones that work with XP and later, plus + * example native support on VISTA and onwards. + */ +#define Py_HAVE_CONDVAR + +/* include windows if it hasn't been done before */ +#define WIN32_LEAN_AND_MEAN +#include + +/* options */ +/* non-emulated condition variables are provided for those that want + * to target Windows Vista. Modify this macro to enable them. + */ +#ifndef _PY_EMULATED_WIN_CV +#define _PY_EMULATED_WIN_CV 1 /* use emulated condition variables */ +#endif + +/* fall back to emulation if not targeting Vista */ +#if !defined NTDDI_VISTA || NTDDI_VERSION < NTDDI_VISTA +#undef _PY_EMULATED_WIN_CV +#define _PY_EMULATED_WIN_CV 1 +#endif + +#if _PY_EMULATED_WIN_CV + +typedef CRITICAL_SECTION PyMUTEX_T; + +/* The ConditionVariable object. From XP onwards it is easily emulated + with a Semaphore. + Semaphores are available on Windows XP (2003 server) and later. + We use a Semaphore rather than an auto-reset event, because although + an auto-reset event might appear to solve the lost-wakeup bug (race + condition between releasing the outer lock and waiting) because it + maintains state even though a wait hasn't happened, there is still + a lost wakeup problem if more than one thread are interrupted in the + critical place. A semaphore solves that, because its state is + counted, not Boolean. + Because it is ok to signal a condition variable with no one + waiting, we need to keep track of the number of + waiting threads. Otherwise, the semaphore's state could rise + without bound. This also helps reduce the number of "spurious wakeups" + that would otherwise happen. + */ + +typedef struct _PyCOND_T +{ + HANDLE sem; + int waiting; /* to allow PyCOND_SIGNAL to be a no-op */ +} PyCOND_T; + +#else /* !_PY_EMULATED_WIN_CV */ + +/* Use native Win7 primitives if build target is Win7 or higher */ + +/* SRWLOCK is faster and better than CriticalSection */ +typedef SRWLOCK PyMUTEX_T; + +typedef CONDITION_VARIABLE PyCOND_T; + +#endif /* _PY_EMULATED_WIN_CV */ + +#endif /* _POSIX_THREADS, NT_THREADS */ + +#endif /* Py_INTERNAL_CONDVAR_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_context.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_context.h new file mode 100644 index 0000000000000000000000000000000000000000..1bf4e8f3ee532e450a3b2a3919f894fa314620ed --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_context.h @@ -0,0 +1,67 @@ +#ifndef Py_INTERNAL_CONTEXT_H +#define Py_INTERNAL_CONTEXT_H + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_hamt.h" /* PyHamtObject */ + + +extern PyTypeObject _PyContextTokenMissing_Type; + +/* runtime lifecycle */ + +PyStatus _PyContext_Init(PyInterpreterState *); +void _PyContext_Fini(PyInterpreterState *); + + +/* other API */ + +#ifndef WITH_FREELISTS +// without freelists +# define PyContext_MAXFREELIST 0 +#endif + +#ifndef PyContext_MAXFREELIST +# define PyContext_MAXFREELIST 255 +#endif + +struct _Py_context_state { +#if PyContext_MAXFREELIST > 0 + // List of free PyContext objects + PyContext *freelist; + int numfree; +#endif +}; + +struct _pycontextobject { + PyObject_HEAD + PyContext *ctx_prev; + PyHamtObject *ctx_vars; + PyObject *ctx_weakreflist; + int ctx_entered; +}; + + +struct _pycontextvarobject { + PyObject_HEAD + PyObject *var_name; + PyObject *var_default; + PyObject *var_cached; + uint64_t var_cached_tsid; + uint64_t var_cached_tsver; + Py_hash_t var_hash; +}; + + +struct _pycontexttokenobject { + PyObject_HEAD + PyContext *tok_ctx; + PyContextVar *tok_var; + PyObject *tok_oldval; + int tok_used; +}; + + +#endif /* !Py_INTERNAL_CONTEXT_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_dict.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_dict.h new file mode 100644 index 0000000000000000000000000000000000000000..dc308fe5e2184a90a1c496a500635f1c07f3b66c --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_dict.h @@ -0,0 +1,178 @@ + +#ifndef Py_INTERNAL_DICT_H +#define Py_INTERNAL_DICT_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + + +/* runtime lifecycle */ + +extern void _PyDict_Fini(PyInterpreterState *interp); + + +/* other API */ + +#ifndef WITH_FREELISTS +// without freelists +# define PyDict_MAXFREELIST 0 +#endif + +#ifndef PyDict_MAXFREELIST +# define PyDict_MAXFREELIST 80 +#endif + +struct _Py_dict_state { +#if PyDict_MAXFREELIST > 0 + /* Dictionary reuse scheme to save calls to malloc and free */ + PyDictObject *free_list[PyDict_MAXFREELIST]; + int numfree; + PyDictKeysObject *keys_free_list[PyDict_MAXFREELIST]; + int keys_numfree; +#endif +}; + +typedef struct { + /* Cached hash code of me_key. */ + Py_hash_t me_hash; + PyObject *me_key; + PyObject *me_value; /* This field is only meaningful for combined tables */ +} PyDictKeyEntry; + +typedef struct { + PyObject *me_key; /* The key must be Unicode and have hash. */ + PyObject *me_value; /* This field is only meaningful for combined tables */ +} PyDictUnicodeEntry; + +extern PyDictKeysObject *_PyDict_NewKeysForClass(void); +extern PyObject *_PyDict_FromKeys(PyObject *, PyObject *, PyObject *); + +/* Gets a version number unique to the current state of the keys of dict, if possible. + * Returns the version number, or zero if it was not possible to get a version number. */ +extern uint32_t _PyDictKeys_GetVersionForCurrentState(PyDictKeysObject *dictkeys); + +extern Py_ssize_t _PyDict_KeysSize(PyDictKeysObject *keys); + +/* _Py_dict_lookup() returns index of entry which can be used like DK_ENTRIES(dk)[index]. + * -1 when no entry found, -3 when compare raises error. + */ +extern Py_ssize_t _Py_dict_lookup(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject **value_addr); + +extern Py_ssize_t _PyDict_GetItemHint(PyDictObject *, PyObject *, Py_ssize_t, PyObject **); +extern Py_ssize_t _PyDictKeys_StringLookup(PyDictKeysObject* dictkeys, PyObject *key); +extern PyObject *_PyDict_LoadGlobal(PyDictObject *, PyDictObject *, PyObject *); + +/* Consumes references to key and value */ +extern int _PyDict_SetItem_Take2(PyDictObject *op, PyObject *key, PyObject *value); +extern int _PyObjectDict_SetItem(PyTypeObject *tp, PyObject **dictptr, PyObject *name, PyObject *value); + +extern PyObject *_PyDict_Pop_KnownHash(PyObject *, PyObject *, Py_hash_t, PyObject *); + +#define DKIX_EMPTY (-1) +#define DKIX_DUMMY (-2) /* Used internally */ +#define DKIX_ERROR (-3) +#define DKIX_KEY_CHANGED (-4) /* Used internally */ + +typedef enum { + DICT_KEYS_GENERAL = 0, + DICT_KEYS_UNICODE = 1, + DICT_KEYS_SPLIT = 2 +} DictKeysKind; + +/* See dictobject.c for actual layout of DictKeysObject */ +struct _dictkeysobject { + Py_ssize_t dk_refcnt; + + /* Size of the hash table (dk_indices). It must be a power of 2. */ + uint8_t dk_log2_size; + + /* Size of the hash table (dk_indices) by bytes. */ + uint8_t dk_log2_index_bytes; + + /* Kind of keys */ + uint8_t dk_kind; + + /* Version number -- Reset to 0 by any modification to keys */ + uint32_t dk_version; + + /* Number of usable entries in dk_entries. */ + Py_ssize_t dk_usable; + + /* Number of used entries in dk_entries. */ + Py_ssize_t dk_nentries; + + /* Actual hash table of dk_size entries. It holds indices in dk_entries, + or DKIX_EMPTY(-1) or DKIX_DUMMY(-2). + + Indices must be: 0 <= indice < USABLE_FRACTION(dk_size). + + The size in bytes of an indice depends on dk_size: + + - 1 byte if dk_size <= 0xff (char*) + - 2 bytes if dk_size <= 0xffff (int16_t*) + - 4 bytes if dk_size <= 0xffffffff (int32_t*) + - 8 bytes otherwise (int64_t*) + + Dynamically sized, SIZEOF_VOID_P is minimum. */ + char dk_indices[]; /* char is required to avoid strict aliasing. */ + + /* "PyDictKeyEntry or PyDictUnicodeEntry dk_entries[USABLE_FRACTION(DK_SIZE(dk))];" array follows: + see the DK_ENTRIES() macro */ +}; + +/* This must be no more than 250, for the prefix size to fit in one byte. */ +#define SHARED_KEYS_MAX_SIZE 30 +#define NEXT_LOG2_SHARED_KEYS_MAX_SIZE 6 + +/* Layout of dict values: + * + * The PyObject *values are preceded by an array of bytes holding + * the insertion order and size. + * [-1] = prefix size. [-2] = used size. size[-2-n...] = insertion order. + */ +struct _dictvalues { + PyObject *values[1]; +}; + +#define DK_LOG_SIZE(dk) ((dk)->dk_log2_size) +#if SIZEOF_VOID_P > 4 +#define DK_SIZE(dk) (((int64_t)1)<dk_kind == DICT_KEYS_GENERAL), (PyDictKeyEntry*)(&((int8_t*)((dk)->dk_indices))[(size_t)1 << (dk)->dk_log2_index_bytes])) +#define DK_UNICODE_ENTRIES(dk) \ + (assert(dk->dk_kind != DICT_KEYS_GENERAL), (PyDictUnicodeEntry*)(&((int8_t*)((dk)->dk_indices))[(size_t)1 << (dk)->dk_log2_index_bytes])) +#define DK_IS_UNICODE(dk) ((dk)->dk_kind != DICT_KEYS_GENERAL) + +extern uint64_t _pydict_global_version; + +#define DICT_NEXT_VERSION() (++_pydict_global_version) + +extern PyObject *_PyObject_MakeDictFromInstanceAttributes(PyObject *obj, PyDictValues *values); +extern PyObject *_PyDict_FromItems( + PyObject *const *keys, Py_ssize_t keys_offset, + PyObject *const *values, Py_ssize_t values_offset, + Py_ssize_t length); + +static inline void +_PyDictValues_AddToInsertionOrder(PyDictValues *values, Py_ssize_t ix) +{ + assert(ix < SHARED_KEYS_MAX_SIZE); + uint8_t *size_ptr = ((uint8_t *)values)-2; + int size = *size_ptr; + assert(size+2 < ((uint8_t *)values)[-1]); + size++; + size_ptr[-size] = (uint8_t)ix; + *size_ptr = size; +} + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_DICT_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_dtoa.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_dtoa.h new file mode 100644 index 0000000000000000000000000000000000000000..c77cf6e46cc3c369c8df96104fd1d860b970dff3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_dtoa.h @@ -0,0 +1,28 @@ +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_pymath.h" // _PY_SHORT_FLOAT_REPR + + +#if _PY_SHORT_FLOAT_REPR == 1 + +/* These functions are used by modules compiled as C extension like math: + they must be exported. */ + +PyAPI_FUNC(double) _Py_dg_strtod(const char *str, char **ptr); +PyAPI_FUNC(char *) _Py_dg_dtoa(double d, int mode, int ndigits, + int *decpt, int *sign, char **rve); +PyAPI_FUNC(void) _Py_dg_freedtoa(char *s); +PyAPI_FUNC(double) _Py_dg_stdnan(int sign); +PyAPI_FUNC(double) _Py_dg_infinity(int sign); + +#endif // _PY_SHORT_FLOAT_REPR == 1 + +#ifdef __cplusplus +} +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_emscripten_signal.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_emscripten_signal.h new file mode 100644 index 0000000000000000000000000000000000000000..8b3287d85da4b2e313b7bed953953f1eb0743ecb --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_emscripten_signal.h @@ -0,0 +1,25 @@ +#ifndef Py_EMSCRIPTEN_SIGNAL_H +#define Py_EMSCRIPTEN_SIGNAL_H + +#if defined(__EMSCRIPTEN__) + +void +_Py_CheckEmscriptenSignals(void); + +void +_Py_CheckEmscriptenSignalsPeriodically(void); + +#define _Py_CHECK_EMSCRIPTEN_SIGNALS() _Py_CheckEmscriptenSignals() + +#define _Py_CHECK_EMSCRIPTEN_SIGNALS_PERIODICALLY() _Py_CheckEmscriptenSignalsPeriodically() + +extern int Py_EMSCRIPTEN_SIGNAL_HANDLING; + +#else + +#define _Py_CHECK_EMSCRIPTEN_SIGNALS() +#define _Py_CHECK_EMSCRIPTEN_SIGNALS_PERIODICALLY() + +#endif // defined(__EMSCRIPTEN__) + +#endif // ndef Py_EMSCRIPTEN_SIGNAL_H diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_exceptions.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_exceptions.h new file mode 100644 index 0000000000000000000000000000000000000000..4a9df709131998a1a74cb433626c391426a43efd --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_exceptions.h @@ -0,0 +1,37 @@ +#ifndef Py_INTERNAL_EXCEPTIONS_H +#define Py_INTERNAL_EXCEPTIONS_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + + +/* runtime lifecycle */ + +extern PyStatus _PyExc_InitState(PyInterpreterState *); +extern PyStatus _PyExc_InitGlobalObjects(PyInterpreterState *); +extern int _PyExc_InitTypes(PyInterpreterState *); +extern void _PyExc_Fini(PyInterpreterState *); + + +/* other API */ + +struct _Py_exc_state { + // The dict mapping from errno codes to OSError subclasses + PyObject *errnomap; + PyBaseExceptionObject *memerrors_freelist; + int memerrors_numfree; + // The ExceptionGroup type + PyObject *PyExc_ExceptionGroup; +}; + +extern void _PyExc_ClearExceptionGroupType(PyInterpreterState *); + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_EXCEPTIONS_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_fileutils.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_fileutils.h new file mode 100644 index 0000000000000000000000000000000000000000..332cc30365b9e2f9086e724a62f4e78d4be98c62 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_fileutils.h @@ -0,0 +1,276 @@ +#ifndef Py_INTERNAL_FILEUTILS_H +#define Py_INTERNAL_FILEUTILS_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "Py_BUILD_CORE must be defined to include this header" +#endif + +#include /* struct lconv */ + +typedef enum { + _Py_ERROR_UNKNOWN=0, + _Py_ERROR_STRICT, + _Py_ERROR_SURROGATEESCAPE, + _Py_ERROR_REPLACE, + _Py_ERROR_IGNORE, + _Py_ERROR_BACKSLASHREPLACE, + _Py_ERROR_SURROGATEPASS, + _Py_ERROR_XMLCHARREFREPLACE, + _Py_ERROR_OTHER +} _Py_error_handler; + +PyAPI_FUNC(_Py_error_handler) _Py_GetErrorHandler(const char *errors); + +PyAPI_FUNC(int) _Py_DecodeLocaleEx( + const char *arg, + wchar_t **wstr, + size_t *wlen, + const char **reason, + int current_locale, + _Py_error_handler errors); + +PyAPI_FUNC(int) _Py_EncodeLocaleEx( + const wchar_t *text, + char **str, + size_t *error_pos, + const char **reason, + int current_locale, + _Py_error_handler errors); + +PyAPI_FUNC(char*) _Py_EncodeLocaleRaw( + const wchar_t *text, + size_t *error_pos); + +PyAPI_FUNC(PyObject *) _Py_device_encoding(int); + +#if defined(MS_WINDOWS) || defined(__APPLE__) + /* On Windows, the count parameter of read() is an int (bpo-9015, bpo-9611). + On macOS 10.13, read() and write() with more than INT_MAX bytes + fail with EINVAL (bpo-24658). */ +# define _PY_READ_MAX INT_MAX +# define _PY_WRITE_MAX INT_MAX +#else + /* write() should truncate the input to PY_SSIZE_T_MAX bytes, + but it's safer to do it ourself to have a portable behaviour */ +# define _PY_READ_MAX PY_SSIZE_T_MAX +# define _PY_WRITE_MAX PY_SSIZE_T_MAX +#endif + +#ifdef MS_WINDOWS +struct _Py_stat_struct { + unsigned long st_dev; + uint64_t st_ino; + unsigned short st_mode; + int st_nlink; + int st_uid; + int st_gid; + unsigned long st_rdev; + __int64 st_size; + time_t st_atime; + int st_atime_nsec; + time_t st_mtime; + int st_mtime_nsec; + time_t st_ctime; + int st_ctime_nsec; + unsigned long st_file_attributes; + unsigned long st_reparse_tag; +}; +#else +# define _Py_stat_struct stat +#endif + +PyAPI_FUNC(int) _Py_fstat( + int fd, + struct _Py_stat_struct *status); + +PyAPI_FUNC(int) _Py_fstat_noraise( + int fd, + struct _Py_stat_struct *status); + +PyAPI_FUNC(int) _Py_stat( + PyObject *path, + struct stat *status); + +PyAPI_FUNC(int) _Py_open( + const char *pathname, + int flags); + +PyAPI_FUNC(int) _Py_open_noraise( + const char *pathname, + int flags); + +PyAPI_FUNC(FILE *) _Py_wfopen( + const wchar_t *path, + const wchar_t *mode); + +PyAPI_FUNC(Py_ssize_t) _Py_read( + int fd, + void *buf, + size_t count); + +PyAPI_FUNC(Py_ssize_t) _Py_write( + int fd, + const void *buf, + size_t count); + +PyAPI_FUNC(Py_ssize_t) _Py_write_noraise( + int fd, + const void *buf, + size_t count); + +#ifdef HAVE_READLINK +PyAPI_FUNC(int) _Py_wreadlink( + const wchar_t *path, + wchar_t *buf, + /* Number of characters of 'buf' buffer + including the trailing NUL character */ + size_t buflen); +#endif + +#ifdef HAVE_REALPATH +PyAPI_FUNC(wchar_t*) _Py_wrealpath( + const wchar_t *path, + wchar_t *resolved_path, + /* Number of characters of 'resolved_path' buffer + including the trailing NUL character */ + size_t resolved_path_len); +#endif + +PyAPI_FUNC(wchar_t*) _Py_wgetcwd( + wchar_t *buf, + /* Number of characters of 'buf' buffer + including the trailing NUL character */ + size_t buflen); + +PyAPI_FUNC(int) _Py_get_inheritable(int fd); + +PyAPI_FUNC(int) _Py_set_inheritable(int fd, int inheritable, + int *atomic_flag_works); + +PyAPI_FUNC(int) _Py_set_inheritable_async_safe(int fd, int inheritable, + int *atomic_flag_works); + +PyAPI_FUNC(int) _Py_dup(int fd); + +#ifndef MS_WINDOWS +PyAPI_FUNC(int) _Py_get_blocking(int fd); + +PyAPI_FUNC(int) _Py_set_blocking(int fd, int blocking); +#else /* MS_WINDOWS */ +PyAPI_FUNC(void*) _Py_get_osfhandle_noraise(int fd); + +PyAPI_FUNC(void*) _Py_get_osfhandle(int fd); + +PyAPI_FUNC(int) _Py_open_osfhandle_noraise(void *handle, int flags); + +PyAPI_FUNC(int) _Py_open_osfhandle(void *handle, int flags); +#endif /* MS_WINDOWS */ + +// This is used after getting NULL back from Py_DecodeLocale(). +#define DECODE_LOCALE_ERR(NAME, LEN) \ + ((LEN) == (size_t)-2) \ + ? _PyStatus_ERR("cannot decode " NAME) \ + : _PyStatus_NO_MEMORY() + +PyAPI_DATA(int) _Py_HasFileSystemDefaultEncodeErrors; + +PyAPI_FUNC(int) _Py_DecodeUTF8Ex( + const char *arg, + Py_ssize_t arglen, + wchar_t **wstr, + size_t *wlen, + const char **reason, + _Py_error_handler errors); + +PyAPI_FUNC(int) _Py_EncodeUTF8Ex( + const wchar_t *text, + char **str, + size_t *error_pos, + const char **reason, + int raw_malloc, + _Py_error_handler errors); + +PyAPI_FUNC(wchar_t*) _Py_DecodeUTF8_surrogateescape( + const char *arg, + Py_ssize_t arglen, + size_t *wlen); + +extern int +_Py_wstat(const wchar_t *, struct stat *); + +PyAPI_FUNC(int) _Py_GetForceASCII(void); + +/* Reset "force ASCII" mode (if it was initialized). + + This function should be called when Python changes the LC_CTYPE locale, + so the "force ASCII" mode can be detected again on the new locale + encoding. */ +PyAPI_FUNC(void) _Py_ResetForceASCII(void); + + +PyAPI_FUNC(int) _Py_GetLocaleconvNumeric( + struct lconv *lc, + PyObject **decimal_point, + PyObject **thousands_sep); + +PyAPI_FUNC(void) _Py_closerange(int first, int last); + +PyAPI_FUNC(wchar_t*) _Py_GetLocaleEncoding(void); +PyAPI_FUNC(PyObject*) _Py_GetLocaleEncodingObject(void); + +#ifdef HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION +extern int _Py_LocaleUsesNonUnicodeWchar(void); + +extern wchar_t* _Py_DecodeNonUnicodeWchar( + const wchar_t* native, + Py_ssize_t size); + +extern int _Py_EncodeNonUnicodeWchar_InPlace( + wchar_t* unicode, + Py_ssize_t size); +#endif + +extern int _Py_isabs(const wchar_t *path); +extern int _Py_abspath(const wchar_t *path, wchar_t **abspath_p); +#ifdef MS_WINDOWS +extern int _PyOS_getfullpathname(const wchar_t *path, wchar_t **abspath_p); +#endif +extern wchar_t * _Py_join_relfile(const wchar_t *dirname, + const wchar_t *relfile); +extern int _Py_add_relfile(wchar_t *dirname, + const wchar_t *relfile, + size_t bufsize); +extern size_t _Py_find_basename(const wchar_t *filename); +PyAPI_FUNC(wchar_t*) _Py_normpath(wchar_t *path, Py_ssize_t size); +extern wchar_t *_Py_normpath_and_size(wchar_t *path, Py_ssize_t size, Py_ssize_t *length); + + +// Macros to protect CRT calls against instant termination when passed an +// invalid parameter (bpo-23524). IPH stands for Invalid Parameter Handler. +// Usage: +// +// _Py_BEGIN_SUPPRESS_IPH +// ... +// _Py_END_SUPPRESS_IPH +#if defined _MSC_VER && _MSC_VER >= 1900 + +# include // _set_thread_local_invalid_parameter_handler() + + extern _invalid_parameter_handler _Py_silent_invalid_parameter_handler; +# define _Py_BEGIN_SUPPRESS_IPH \ + { _invalid_parameter_handler _Py_old_handler = \ + _set_thread_local_invalid_parameter_handler(_Py_silent_invalid_parameter_handler); +# define _Py_END_SUPPRESS_IPH \ + _set_thread_local_invalid_parameter_handler(_Py_old_handler); } +#else +# define _Py_BEGIN_SUPPRESS_IPH +# define _Py_END_SUPPRESS_IPH +#endif /* _MSC_VER >= 1900 */ + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_FILEUTILS_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_floatobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_floatobject.h new file mode 100644 index 0000000000000000000000000000000000000000..8a655543329f33546cd7c8b30d4728c45e086c8b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_floatobject.h @@ -0,0 +1,59 @@ +#ifndef Py_INTERNAL_FLOATOBJECT_H +#define Py_INTERNAL_FLOATOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + + +/* runtime lifecycle */ + +extern void _PyFloat_InitState(PyInterpreterState *); +extern PyStatus _PyFloat_InitTypes(PyInterpreterState *); +extern void _PyFloat_Fini(PyInterpreterState *); +extern void _PyFloat_FiniType(PyInterpreterState *); + + +/* other API */ + +#ifndef WITH_FREELISTS +// without freelists +# define PyFloat_MAXFREELIST 0 +#endif + +#ifndef PyFloat_MAXFREELIST +# define PyFloat_MAXFREELIST 100 +#endif + +struct _Py_float_state { +#if PyFloat_MAXFREELIST > 0 + /* Special free list + free_list is a singly-linked list of available PyFloatObjects, + linked via abuse of their ob_type members. */ + int numfree; + PyFloatObject *free_list; +#endif +}; + +void _PyFloat_ExactDealloc(PyObject *op); + + +PyAPI_FUNC(void) _PyFloat_DebugMallocStats(FILE* out); + + +/* Format the object based on the format_spec, as defined in PEP 3101 + (Advanced String Formatting). */ +PyAPI_FUNC(int) _PyFloat_FormatAdvancedWriter( + _PyUnicodeWriter *writer, + PyObject *obj, + PyObject *format_spec, + Py_ssize_t start, + Py_ssize_t end); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_FLOATOBJECT_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_format.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_format.h new file mode 100644 index 0000000000000000000000000000000000000000..1b8d57539ca505fbc56ecb2245785a8b37b85c9f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_format.h @@ -0,0 +1,27 @@ +#ifndef Py_INTERNAL_FORMAT_H +#define Py_INTERNAL_FORMAT_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +/* Format codes + * F_LJUST '-' + * F_SIGN '+' + * F_BLANK ' ' + * F_ALT '#' + * F_ZERO '0' + */ +#define F_LJUST (1<<0) +#define F_SIGN (1<<1) +#define F_BLANK (1<<2) +#define F_ALT (1<<3) +#define F_ZERO (1<<4) + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_FORMAT_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_frame.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_frame.h new file mode 100644 index 0000000000000000000000000000000000000000..4866ea21b9989ca7a03059f8fae83cdd874679d9 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_frame.h @@ -0,0 +1,240 @@ +#ifndef Py_INTERNAL_FRAME_H +#define Py_INTERNAL_FRAME_H +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +/* See Objects/frame_layout.md for an explanation of the frame stack + * including explanation of the PyFrameObject and _PyInterpreterFrame + * structs. */ + + +struct _frame { + PyObject_HEAD + PyFrameObject *f_back; /* previous frame, or NULL */ + struct _PyInterpreterFrame *f_frame; /* points to the frame data */ + PyObject *f_trace; /* Trace function */ + int f_lineno; /* Current line number. Only valid if non-zero */ + char f_trace_lines; /* Emit per-line trace events? */ + char f_trace_opcodes; /* Emit per-opcode trace events? */ + char f_fast_as_locals; /* Have the fast locals of this frame been converted to a dict? */ + /* The frame data, if this frame object owns the frame */ + PyObject *_f_frame_data[1]; +}; + +extern PyFrameObject* _PyFrame_New_NoTrack(PyCodeObject *code); + + +/* other API */ + +typedef enum _framestate { + FRAME_CREATED = -2, + FRAME_SUSPENDED = -1, + FRAME_EXECUTING = 0, + FRAME_COMPLETED = 1, + FRAME_CLEARED = 4 +} PyFrameState; + +enum _frameowner { + FRAME_OWNED_BY_THREAD = 0, + FRAME_OWNED_BY_GENERATOR = 1, + FRAME_OWNED_BY_FRAME_OBJECT = 2 +}; + +typedef struct _PyInterpreterFrame { + /* "Specials" section */ + PyFunctionObject *f_func; /* Strong reference */ + PyObject *f_globals; /* Borrowed reference */ + PyObject *f_builtins; /* Borrowed reference */ + PyObject *f_locals; /* Strong reference, may be NULL */ + PyCodeObject *f_code; /* Strong reference */ + PyFrameObject *frame_obj; /* Strong reference, may be NULL */ + /* Linkage section */ + struct _PyInterpreterFrame *previous; + // NOTE: This is not necessarily the last instruction started in the given + // frame. Rather, it is the code unit *prior to* the *next* instruction. For + // example, it may be an inline CACHE entry, an instruction we just jumped + // over, or (in the case of a newly-created frame) a totally invalid value: + _Py_CODEUNIT *prev_instr; + int stacktop; /* Offset of TOS from localsplus */ + bool is_entry; // Whether this is the "root" frame for the current _PyCFrame. + char owner; + /* Locals and stack */ + PyObject *localsplus[1]; +} _PyInterpreterFrame; + +#define _PyInterpreterFrame_LASTI(IF) \ + ((int)((IF)->prev_instr - _PyCode_CODE((IF)->f_code))) + +static inline PyObject **_PyFrame_Stackbase(_PyInterpreterFrame *f) { + return f->localsplus + f->f_code->co_nlocalsplus; +} + +static inline PyObject *_PyFrame_StackPeek(_PyInterpreterFrame *f) { + assert(f->stacktop > f->f_code->co_nlocalsplus); + assert(f->localsplus[f->stacktop-1] != NULL); + return f->localsplus[f->stacktop-1]; +} + +static inline PyObject *_PyFrame_StackPop(_PyInterpreterFrame *f) { + assert(f->stacktop > f->f_code->co_nlocalsplus); + f->stacktop--; + return f->localsplus[f->stacktop]; +} + +static inline void _PyFrame_StackPush(_PyInterpreterFrame *f, PyObject *value) { + f->localsplus[f->stacktop] = value; + f->stacktop++; +} + +#define FRAME_SPECIALS_SIZE ((sizeof(_PyInterpreterFrame)-1)/sizeof(PyObject *)) + +void _PyFrame_Copy(_PyInterpreterFrame *src, _PyInterpreterFrame *dest); + +/* Consumes reference to func and locals. + Does not initialize frame->previous, which happens + when frame is linked into the frame stack. + */ +static inline void +_PyFrame_InitializeSpecials( + _PyInterpreterFrame *frame, PyFunctionObject *func, + PyObject *locals, int nlocalsplus) +{ + frame->f_func = func; + frame->f_code = (PyCodeObject *)Py_NewRef(func->func_code); + frame->f_builtins = func->func_builtins; + frame->f_globals = func->func_globals; + frame->f_locals = Py_XNewRef(locals); + frame->stacktop = nlocalsplus; + frame->frame_obj = NULL; + frame->prev_instr = _PyCode_CODE(frame->f_code) - 1; + frame->is_entry = false; + frame->owner = FRAME_OWNED_BY_THREAD; +} + +/* Gets the pointer to the locals array + * that precedes this frame. + */ +static inline PyObject** +_PyFrame_GetLocalsArray(_PyInterpreterFrame *frame) +{ + return frame->localsplus; +} + +static inline PyObject** +_PyFrame_GetStackPointer(_PyInterpreterFrame *frame) +{ + return frame->localsplus+frame->stacktop; +} + +static inline void +_PyFrame_SetStackPointer(_PyInterpreterFrame *frame, PyObject **stack_pointer) +{ + frame->stacktop = (int)(stack_pointer - frame->localsplus); +} + +/* Determine whether a frame is incomplete. + * A frame is incomplete if it is part way through + * creating cell objects or a generator or coroutine. + * + * Frames on the frame stack are incomplete until the + * first RESUME instruction. + * Frames owned by a generator are always complete. + */ +static inline bool +_PyFrame_IsIncomplete(_PyInterpreterFrame *frame) +{ + return frame->owner != FRAME_OWNED_BY_GENERATOR && + frame->prev_instr < _PyCode_CODE(frame->f_code) + frame->f_code->_co_firsttraceable; +} + +/* For use by _PyFrame_GetFrameObject + Do not call directly. */ +PyFrameObject * +_PyFrame_MakeAndSetFrameObject(_PyInterpreterFrame *frame); + +/* Gets the PyFrameObject for this frame, lazily + * creating it if necessary. + * Returns a borrowed referennce */ +static inline PyFrameObject * +_PyFrame_GetFrameObject(_PyInterpreterFrame *frame) +{ + + assert(!_PyFrame_IsIncomplete(frame)); + PyFrameObject *res = frame->frame_obj; + if (res != NULL) { + return res; + } + return _PyFrame_MakeAndSetFrameObject(frame); +} + +/* Clears all references in the frame. + * If take is non-zero, then the _PyInterpreterFrame frame + * may be transferred to the frame object it references + * instead of being cleared. Either way + * the caller no longer owns the references + * in the frame. + * take should be set to 1 for heap allocated + * frames like the ones in generators and coroutines. + */ +void +_PyFrame_Clear(_PyInterpreterFrame * frame); + +int +_PyFrame_Traverse(_PyInterpreterFrame *frame, visitproc visit, void *arg); + +int +_PyFrame_FastToLocalsWithError(_PyInterpreterFrame *frame); + +void +_PyFrame_LocalsToFast(_PyInterpreterFrame *frame, int clear); + +extern _PyInterpreterFrame * +_PyThreadState_BumpFramePointerSlow(PyThreadState *tstate, size_t size); + +static inline bool +_PyThreadState_HasStackSpace(PyThreadState *tstate, size_t size) +{ + assert( + (tstate->datastack_top == NULL && tstate->datastack_limit == NULL) + || + (tstate->datastack_top != NULL && tstate->datastack_limit != NULL) + ); + return tstate->datastack_top != NULL && + size < (size_t)(tstate->datastack_limit - tstate->datastack_top); +} + +static inline _PyInterpreterFrame * +_PyThreadState_BumpFramePointer(PyThreadState *tstate, size_t size) +{ + if (_PyThreadState_HasStackSpace(tstate, size)) { + _PyInterpreterFrame *res = (_PyInterpreterFrame *)tstate->datastack_top; + tstate->datastack_top += size; + return res; + } + return _PyThreadState_BumpFramePointerSlow(tstate, size); +} + +void _PyThreadState_PopFrame(PyThreadState *tstate, _PyInterpreterFrame *frame); + +/* Consume reference to func */ +_PyInterpreterFrame * +_PyFrame_Push(PyThreadState *tstate, PyFunctionObject *func); + +int _PyInterpreterFrame_GetLine(_PyInterpreterFrame *frame); + +static inline +PyGenObject *_PyFrame_GetGenerator(_PyInterpreterFrame *frame) +{ + assert(frame->owner == FRAME_OWNED_BY_GENERATOR); + size_t offset_in_gen = offsetof(PyGenObject, gi_iframe); + return (PyGenObject *)(((char *)frame) - offset_in_gen); +} + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_FRAME_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_function.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_function.h new file mode 100644 index 0000000000000000000000000000000000000000..1c87aa31ddb611e82faf8b2fd0e5708298c1e940 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_function.h @@ -0,0 +1,18 @@ +#ifndef Py_INTERNAL_FUNCTION_H +#define Py_INTERNAL_FUNCTION_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +extern PyFunctionObject* _PyFunction_FromConstructor(PyFrameConstructor *constr); + +extern uint32_t _PyFunction_GetVersionForCurrentState(PyFunctionObject *func); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_FUNCTION_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_gc.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_gc.h new file mode 100644 index 0000000000000000000000000000000000000000..16c1893639f3542bff4285d81b737cae09c4a948 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_gc.h @@ -0,0 +1,183 @@ +#ifndef Py_INTERNAL_GC_H +#define Py_INTERNAL_GC_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +/* GC information is stored BEFORE the object structure. */ +typedef struct { + // Pointer to next object in the list. + // 0 means the object is not tracked + uintptr_t _gc_next; + + // Pointer to previous object in the list. + // Lowest two bits are used for flags documented later. + uintptr_t _gc_prev; +} PyGC_Head; + +#define _Py_AS_GC(o) ((PyGC_Head *)(o)-1) +#define _PyGC_Head_UNUSED PyGC_Head + +/* True if the object is currently tracked by the GC. */ +#define _PyObject_GC_IS_TRACKED(o) (_Py_AS_GC(o)->_gc_next != 0) + +/* True if the object may be tracked by the GC in the future, or already is. + This can be useful to implement some optimizations. */ +#define _PyObject_GC_MAY_BE_TRACKED(obj) \ + (PyObject_IS_GC(obj) && \ + (!PyTuple_CheckExact(obj) || _PyObject_GC_IS_TRACKED(obj))) + + +/* Bit flags for _gc_prev */ +/* Bit 0 is set when tp_finalize is called */ +#define _PyGC_PREV_MASK_FINALIZED (1) +/* Bit 1 is set when the object is in generation which is GCed currently. */ +#define _PyGC_PREV_MASK_COLLECTING (2) +/* The (N-2) most significant bits contain the real address. */ +#define _PyGC_PREV_SHIFT (2) +#define _PyGC_PREV_MASK (((uintptr_t) -1) << _PyGC_PREV_SHIFT) + +// Lowest bit of _gc_next is used for flags only in GC. +// But it is always 0 for normal code. +#define _PyGCHead_NEXT(g) ((PyGC_Head*)(g)->_gc_next) +#define _PyGCHead_SET_NEXT(g, p) _Py_RVALUE((g)->_gc_next = (uintptr_t)(p)) + +// Lowest two bits of _gc_prev is used for _PyGC_PREV_MASK_* flags. +#define _PyGCHead_PREV(g) ((PyGC_Head*)((g)->_gc_prev & _PyGC_PREV_MASK)) +#define _PyGCHead_SET_PREV(g, p) do { \ + assert(((uintptr_t)p & ~_PyGC_PREV_MASK) == 0); \ + (g)->_gc_prev = ((g)->_gc_prev & ~_PyGC_PREV_MASK) \ + | ((uintptr_t)(p)); \ + } while (0) + +#define _PyGCHead_FINALIZED(g) \ + (((g)->_gc_prev & _PyGC_PREV_MASK_FINALIZED) != 0) +#define _PyGCHead_SET_FINALIZED(g) \ + _Py_RVALUE((g)->_gc_prev |= _PyGC_PREV_MASK_FINALIZED) + +#define _PyGC_FINALIZED(o) \ + _PyGCHead_FINALIZED(_Py_AS_GC(o)) +#define _PyGC_SET_FINALIZED(o) \ + _PyGCHead_SET_FINALIZED(_Py_AS_GC(o)) + + +/* GC runtime state */ + +/* If we change this, we need to change the default value in the + signature of gc.collect. */ +#define NUM_GENERATIONS 3 +/* + NOTE: about untracking of mutable objects. + + Certain types of container cannot participate in a reference cycle, and + so do not need to be tracked by the garbage collector. Untracking these + objects reduces the cost of garbage collections. However, determining + which objects may be untracked is not free, and the costs must be + weighed against the benefits for garbage collection. + + There are two possible strategies for when to untrack a container: + + i) When the container is created. + ii) When the container is examined by the garbage collector. + + Tuples containing only immutable objects (integers, strings etc, and + recursively, tuples of immutable objects) do not need to be tracked. + The interpreter creates a large number of tuples, many of which will + not survive until garbage collection. It is therefore not worthwhile + to untrack eligible tuples at creation time. + + Instead, all tuples except the empty tuple are tracked when created. + During garbage collection it is determined whether any surviving tuples + can be untracked. A tuple can be untracked if all of its contents are + already not tracked. Tuples are examined for untracking in all garbage + collection cycles. It may take more than one cycle to untrack a tuple. + + Dictionaries containing only immutable objects also do not need to be + tracked. Dictionaries are untracked when created. If a tracked item is + inserted into a dictionary (either as a key or value), the dictionary + becomes tracked. During a full garbage collection (all generations), + the collector will untrack any dictionaries whose contents are not + tracked. + + The module provides the python function is_tracked(obj), which returns + the CURRENT tracking status of the object. Subsequent garbage + collections may change the tracking status of the object. + + Untracking of certain containers was introduced in issue #4688, and + the algorithm was refined in response to issue #14775. +*/ + +struct gc_generation { + PyGC_Head head; + int threshold; /* collection threshold */ + int count; /* count of allocations or collections of younger + generations */ +}; + +/* Running stats per generation */ +struct gc_generation_stats { + /* total number of collections */ + Py_ssize_t collections; + /* total number of collected objects */ + Py_ssize_t collected; + /* total number of uncollectable objects (put into gc.garbage) */ + Py_ssize_t uncollectable; +}; + +struct _gc_runtime_state { + /* List of objects that still need to be cleaned up, singly linked + * via their gc headers' gc_prev pointers. */ + PyObject *trash_delete_later; + /* Current call-stack depth of tp_dealloc calls. */ + int trash_delete_nesting; + + /* Is automatic collection enabled? */ + int enabled; + int debug; + /* linked lists of container objects */ + struct gc_generation generations[NUM_GENERATIONS]; + PyGC_Head *generation0; + /* a permanent generation which won't be collected */ + struct gc_generation permanent_generation; + struct gc_generation_stats generation_stats[NUM_GENERATIONS]; + /* true if we are currently running the collector */ + int collecting; + /* list of uncollectable objects */ + PyObject *garbage; + /* a list of callbacks to be invoked when collection is performed */ + PyObject *callbacks; + /* This is the number of objects that survived the last full + collection. It approximates the number of long lived objects + tracked by the GC. + + (by "full collection", we mean a collection of the oldest + generation). */ + Py_ssize_t long_lived_total; + /* This is the number of objects that survived all "non-full" + collections, and are awaiting to undergo a full collection for + the first time. */ + Py_ssize_t long_lived_pending; +}; + + +extern void _PyGC_InitState(struct _gc_runtime_state *); + +extern Py_ssize_t _PyGC_CollectNoFail(PyThreadState *tstate); + + +// Functions to clear types free lists +extern void _PyTuple_ClearFreeList(PyInterpreterState *interp); +extern void _PyFloat_ClearFreeList(PyInterpreterState *interp); +extern void _PyList_ClearFreeList(PyInterpreterState *interp); +extern void _PyDict_ClearFreeList(PyInterpreterState *interp); +extern void _PyAsyncGen_ClearFreeLists(PyInterpreterState *interp); +extern void _PyContext_ClearFreeList(PyInterpreterState *interp); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_GC_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_genobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_genobject.h new file mode 100644 index 0000000000000000000000000000000000000000..42db0d87d1f40a0abe4d965473fabf9354f332a0 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_genobject.h @@ -0,0 +1,49 @@ +#ifndef Py_INTERNAL_GENOBJECT_H +#define Py_INTERNAL_GENOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +extern PyObject *_PyGen_yf(PyGenObject *); +extern PyObject *_PyCoro_GetAwaitableIter(PyObject *o); +extern PyObject *_PyAsyncGenValueWrapperNew(PyObject *); + +/* runtime lifecycle */ + +extern void _PyAsyncGen_Fini(PyInterpreterState *); + + +/* other API */ + +#ifndef WITH_FREELISTS +// without freelists +# define _PyAsyncGen_MAXFREELIST 0 +#endif + +#ifndef _PyAsyncGen_MAXFREELIST +# define _PyAsyncGen_MAXFREELIST 80 +#endif + +struct _Py_async_gen_state { +#if _PyAsyncGen_MAXFREELIST > 0 + /* Freelists boost performance 6-10%; they also reduce memory + fragmentation, as _PyAsyncGenWrappedValue and PyAsyncGenASend + are short-living objects that are instantiated for every + __anext__() call. */ + struct _PyAsyncGenWrappedValue* value_freelist[_PyAsyncGen_MAXFREELIST]; + int value_numfree; + + struct PyAsyncGenASend* asend_freelist[_PyAsyncGen_MAXFREELIST]; + int asend_numfree; +#endif +}; + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_GENOBJECT_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_getopt.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_getopt.h new file mode 100644 index 0000000000000000000000000000000000000000..7f0dd13ae577f78491f19b7e8fa3ac8c5042bb11 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_getopt.h @@ -0,0 +1,22 @@ +#ifndef Py_INTERNAL_PYGETOPT_H +#define Py_INTERNAL_PYGETOPT_H + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +extern int _PyOS_opterr; +extern Py_ssize_t _PyOS_optind; +extern const wchar_t *_PyOS_optarg; + +extern void _PyOS_ResetGetOpt(void); + +typedef struct { + const wchar_t *name; + int has_arg; + int val; +} _PyOS_LongOption; + +extern int _PyOS_GetOpt(Py_ssize_t argc, wchar_t * const *argv, int *longindex); + +#endif /* !Py_INTERNAL_PYGETOPT_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_gil.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_gil.h new file mode 100644 index 0000000000000000000000000000000000000000..8ebad37b686cd4c9cdfd4236b2bd9387497f489e --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_gil.h @@ -0,0 +1,50 @@ +#ifndef Py_INTERNAL_GIL_H +#define Py_INTERNAL_GIL_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_atomic.h" /* _Py_atomic_address */ +#include "pycore_condvar.h" /* PyCOND_T */ + +#ifndef Py_HAVE_CONDVAR +# error You need either a POSIX-compatible or a Windows system! +#endif + +/* Enable if you want to force the switching of threads at least + every `interval`. */ +#undef FORCE_SWITCHING +#define FORCE_SWITCHING + +struct _gil_runtime_state { + /* microseconds (the Python API uses seconds, though) */ + unsigned long interval; + /* Last PyThreadState holding / having held the GIL. This helps us + know whether anyone else was scheduled after we dropped the GIL. */ + _Py_atomic_address last_holder; + /* Whether the GIL is already taken (-1 if uninitialized). This is + atomic because it can be read without any lock taken in ceval.c. */ + _Py_atomic_int locked; + /* Number of GIL switches since the beginning. */ + unsigned long switch_number; + /* This condition variable allows one or several threads to wait + until the GIL is released. In addition, the mutex also protects + the above variables. */ + PyCOND_T cond; + PyMUTEX_T mutex; +#ifdef FORCE_SWITCHING + /* This condition variable helps the GIL-releasing thread wait for + a GIL-awaiting thread to be scheduled and take the GIL. */ + PyCOND_T switch_cond; + PyMUTEX_T switch_mutex; +#endif +}; + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_GIL_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_global_objects.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_global_objects.h new file mode 100644 index 0000000000000000000000000000000000000000..98673d4efcedcc3c1227dd2a5b79569ebe3a3d36 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_global_objects.h @@ -0,0 +1,54 @@ +#ifndef Py_INTERNAL_GLOBAL_OBJECTS_H +#define Py_INTERNAL_GLOBAL_OBJECTS_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_gc.h" // PyGC_Head +#include "pycore_global_strings.h" // struct _Py_global_strings + + +// These would be in pycore_long.h if it weren't for an include cycle. +#define _PY_NSMALLPOSINTS 257 +#define _PY_NSMALLNEGINTS 5 + + +// Only immutable objects should be considered runtime-global. +// All others must be per-interpreter. + +#define _Py_GLOBAL_OBJECT(NAME) \ + _PyRuntime.global_objects.NAME +#define _Py_SINGLETON(NAME) \ + _Py_GLOBAL_OBJECT(singletons.NAME) + +struct _Py_global_objects { + struct { + /* Small integers are preallocated in this array so that they + * can be shared. + * The integers that are preallocated are those in the range + * -_PY_NSMALLNEGINTS (inclusive) to _PY_NSMALLPOSINTS (exclusive). + */ + PyLongObject small_ints[_PY_NSMALLNEGINTS + _PY_NSMALLPOSINTS]; + + PyBytesObject bytes_empty; + struct { + PyBytesObject ob; + char eos; + } bytes_characters[256]; + + struct _Py_global_strings strings; + + _PyGC_Head_UNUSED _tuple_empty_gc_not_used; + PyTupleObject tuple_empty; + } singletons; +}; + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_GLOBAL_OBJECTS_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_global_strings.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_global_strings.h new file mode 100644 index 0000000000000000000000000000000000000000..ca970627cb2e17080efb262472bc2e5ffdb45933 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_global_strings.h @@ -0,0 +1,395 @@ +#ifndef Py_INTERNAL_GLOBAL_STRINGS_H +#define Py_INTERNAL_GLOBAL_STRINGS_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +// The data structure & init here are inspired by Tools/scripts/deepfreeze.py. + +// All field names generated by ASCII_STR() have a common prefix, +// to help avoid collisions with keywords, etc. + +#define STRUCT_FOR_ASCII_STR(LITERAL) \ + struct { \ + PyASCIIObject _ascii; \ + uint8_t _data[sizeof(LITERAL)]; \ + } +#define STRUCT_FOR_STR(NAME, LITERAL) \ + STRUCT_FOR_ASCII_STR(LITERAL) _ ## NAME; +#define STRUCT_FOR_ID(NAME) \ + STRUCT_FOR_ASCII_STR(#NAME) _ ## NAME; + +// XXX Order by frequency of use? + +/* The following is auto-generated by Tools/scripts/generate_global_objects.py. */ +struct _Py_global_strings { + struct { + STRUCT_FOR_STR(anon_dictcomp, "") + STRUCT_FOR_STR(anon_genexpr, "") + STRUCT_FOR_STR(anon_lambda, "") + STRUCT_FOR_STR(anon_listcomp, "") + STRUCT_FOR_STR(anon_module, "") + STRUCT_FOR_STR(anon_setcomp, "") + STRUCT_FOR_STR(anon_string, "") + STRUCT_FOR_STR(anon_unknown, "") + STRUCT_FOR_STR(close_br, "}") + STRUCT_FOR_STR(comma_sep, ", ") + STRUCT_FOR_STR(dbl_close_br, "}}") + STRUCT_FOR_STR(dbl_open_br, "{{") + STRUCT_FOR_STR(dbl_percent, "%%") + STRUCT_FOR_STR(dot, ".") + STRUCT_FOR_STR(dot_locals, ".") + STRUCT_FOR_STR(empty, "") + STRUCT_FOR_STR(list_err, "list index out of range") + STRUCT_FOR_STR(newline, "\n") + STRUCT_FOR_STR(open_br, "{") + STRUCT_FOR_STR(percent, "%") + STRUCT_FOR_STR(utf_8, "utf-8") + } literals; + + struct { + STRUCT_FOR_ID(False) + STRUCT_FOR_ID(Py_Repr) + STRUCT_FOR_ID(TextIOWrapper) + STRUCT_FOR_ID(True) + STRUCT_FOR_ID(WarningMessage) + STRUCT_FOR_ID(_) + STRUCT_FOR_ID(__IOBase_closed) + STRUCT_FOR_ID(__abc_tpflags__) + STRUCT_FOR_ID(__abs__) + STRUCT_FOR_ID(__abstractmethods__) + STRUCT_FOR_ID(__add__) + STRUCT_FOR_ID(__aenter__) + STRUCT_FOR_ID(__aexit__) + STRUCT_FOR_ID(__aiter__) + STRUCT_FOR_ID(__all__) + STRUCT_FOR_ID(__and__) + STRUCT_FOR_ID(__anext__) + STRUCT_FOR_ID(__annotations__) + STRUCT_FOR_ID(__args__) + STRUCT_FOR_ID(__await__) + STRUCT_FOR_ID(__bases__) + STRUCT_FOR_ID(__bool__) + STRUCT_FOR_ID(__build_class__) + STRUCT_FOR_ID(__builtins__) + STRUCT_FOR_ID(__bytes__) + STRUCT_FOR_ID(__call__) + STRUCT_FOR_ID(__cantrace__) + STRUCT_FOR_ID(__class__) + STRUCT_FOR_ID(__class_getitem__) + STRUCT_FOR_ID(__classcell__) + STRUCT_FOR_ID(__complex__) + STRUCT_FOR_ID(__contains__) + STRUCT_FOR_ID(__copy__) + STRUCT_FOR_ID(__del__) + STRUCT_FOR_ID(__delattr__) + STRUCT_FOR_ID(__delete__) + STRUCT_FOR_ID(__delitem__) + STRUCT_FOR_ID(__dict__) + STRUCT_FOR_ID(__dir__) + STRUCT_FOR_ID(__divmod__) + STRUCT_FOR_ID(__doc__) + STRUCT_FOR_ID(__enter__) + STRUCT_FOR_ID(__eq__) + STRUCT_FOR_ID(__exit__) + STRUCT_FOR_ID(__file__) + STRUCT_FOR_ID(__float__) + STRUCT_FOR_ID(__floordiv__) + STRUCT_FOR_ID(__format__) + STRUCT_FOR_ID(__fspath__) + STRUCT_FOR_ID(__ge__) + STRUCT_FOR_ID(__get__) + STRUCT_FOR_ID(__getattr__) + STRUCT_FOR_ID(__getattribute__) + STRUCT_FOR_ID(__getinitargs__) + STRUCT_FOR_ID(__getitem__) + STRUCT_FOR_ID(__getnewargs__) + STRUCT_FOR_ID(__getnewargs_ex__) + STRUCT_FOR_ID(__getstate__) + STRUCT_FOR_ID(__gt__) + STRUCT_FOR_ID(__hash__) + STRUCT_FOR_ID(__iadd__) + STRUCT_FOR_ID(__iand__) + STRUCT_FOR_ID(__ifloordiv__) + STRUCT_FOR_ID(__ilshift__) + STRUCT_FOR_ID(__imatmul__) + STRUCT_FOR_ID(__imod__) + STRUCT_FOR_ID(__import__) + STRUCT_FOR_ID(__imul__) + STRUCT_FOR_ID(__index__) + STRUCT_FOR_ID(__init__) + STRUCT_FOR_ID(__init_subclass__) + STRUCT_FOR_ID(__instancecheck__) + STRUCT_FOR_ID(__int__) + STRUCT_FOR_ID(__invert__) + STRUCT_FOR_ID(__ior__) + STRUCT_FOR_ID(__ipow__) + STRUCT_FOR_ID(__irshift__) + STRUCT_FOR_ID(__isabstractmethod__) + STRUCT_FOR_ID(__isub__) + STRUCT_FOR_ID(__iter__) + STRUCT_FOR_ID(__itruediv__) + STRUCT_FOR_ID(__ixor__) + STRUCT_FOR_ID(__le__) + STRUCT_FOR_ID(__len__) + STRUCT_FOR_ID(__length_hint__) + STRUCT_FOR_ID(__lltrace__) + STRUCT_FOR_ID(__loader__) + STRUCT_FOR_ID(__lshift__) + STRUCT_FOR_ID(__lt__) + STRUCT_FOR_ID(__main__) + STRUCT_FOR_ID(__matmul__) + STRUCT_FOR_ID(__missing__) + STRUCT_FOR_ID(__mod__) + STRUCT_FOR_ID(__module__) + STRUCT_FOR_ID(__mro_entries__) + STRUCT_FOR_ID(__mul__) + STRUCT_FOR_ID(__name__) + STRUCT_FOR_ID(__ne__) + STRUCT_FOR_ID(__neg__) + STRUCT_FOR_ID(__new__) + STRUCT_FOR_ID(__newobj__) + STRUCT_FOR_ID(__newobj_ex__) + STRUCT_FOR_ID(__next__) + STRUCT_FOR_ID(__notes__) + STRUCT_FOR_ID(__or__) + STRUCT_FOR_ID(__orig_class__) + STRUCT_FOR_ID(__origin__) + STRUCT_FOR_ID(__package__) + STRUCT_FOR_ID(__parameters__) + STRUCT_FOR_ID(__path__) + STRUCT_FOR_ID(__pos__) + STRUCT_FOR_ID(__pow__) + STRUCT_FOR_ID(__prepare__) + STRUCT_FOR_ID(__qualname__) + STRUCT_FOR_ID(__radd__) + STRUCT_FOR_ID(__rand__) + STRUCT_FOR_ID(__rdivmod__) + STRUCT_FOR_ID(__reduce__) + STRUCT_FOR_ID(__reduce_ex__) + STRUCT_FOR_ID(__repr__) + STRUCT_FOR_ID(__reversed__) + STRUCT_FOR_ID(__rfloordiv__) + STRUCT_FOR_ID(__rlshift__) + STRUCT_FOR_ID(__rmatmul__) + STRUCT_FOR_ID(__rmod__) + STRUCT_FOR_ID(__rmul__) + STRUCT_FOR_ID(__ror__) + STRUCT_FOR_ID(__round__) + STRUCT_FOR_ID(__rpow__) + STRUCT_FOR_ID(__rrshift__) + STRUCT_FOR_ID(__rshift__) + STRUCT_FOR_ID(__rsub__) + STRUCT_FOR_ID(__rtruediv__) + STRUCT_FOR_ID(__rxor__) + STRUCT_FOR_ID(__set__) + STRUCT_FOR_ID(__set_name__) + STRUCT_FOR_ID(__setattr__) + STRUCT_FOR_ID(__setitem__) + STRUCT_FOR_ID(__setstate__) + STRUCT_FOR_ID(__sizeof__) + STRUCT_FOR_ID(__slotnames__) + STRUCT_FOR_ID(__slots__) + STRUCT_FOR_ID(__spec__) + STRUCT_FOR_ID(__str__) + STRUCT_FOR_ID(__sub__) + STRUCT_FOR_ID(__subclasscheck__) + STRUCT_FOR_ID(__subclasshook__) + STRUCT_FOR_ID(__truediv__) + STRUCT_FOR_ID(__trunc__) + STRUCT_FOR_ID(__typing_is_unpacked_typevartuple__) + STRUCT_FOR_ID(__typing_prepare_subst__) + STRUCT_FOR_ID(__typing_subst__) + STRUCT_FOR_ID(__typing_unpacked_tuple_args__) + STRUCT_FOR_ID(__warningregistry__) + STRUCT_FOR_ID(__weakref__) + STRUCT_FOR_ID(__xor__) + STRUCT_FOR_ID(_abc_impl) + STRUCT_FOR_ID(_annotation) + STRUCT_FOR_ID(_blksize) + STRUCT_FOR_ID(_bootstrap) + STRUCT_FOR_ID(_dealloc_warn) + STRUCT_FOR_ID(_finalizing) + STRUCT_FOR_ID(_find_and_load) + STRUCT_FOR_ID(_fix_up_module) + STRUCT_FOR_ID(_get_sourcefile) + STRUCT_FOR_ID(_handle_fromlist) + STRUCT_FOR_ID(_initializing) + STRUCT_FOR_ID(_is_text_encoding) + STRUCT_FOR_ID(_lock_unlock_module) + STRUCT_FOR_ID(_showwarnmsg) + STRUCT_FOR_ID(_shutdown) + STRUCT_FOR_ID(_slotnames) + STRUCT_FOR_ID(_strptime_time) + STRUCT_FOR_ID(_uninitialized_submodules) + STRUCT_FOR_ID(_warn_unawaited_coroutine) + STRUCT_FOR_ID(_xoptions) + STRUCT_FOR_ID(add) + STRUCT_FOR_ID(append) + STRUCT_FOR_ID(big) + STRUCT_FOR_ID(buffer) + STRUCT_FOR_ID(builtins) + STRUCT_FOR_ID(c_call) + STRUCT_FOR_ID(c_exception) + STRUCT_FOR_ID(c_return) + STRUCT_FOR_ID(call) + STRUCT_FOR_ID(clear) + STRUCT_FOR_ID(close) + STRUCT_FOR_ID(closed) + STRUCT_FOR_ID(code) + STRUCT_FOR_ID(copy) + STRUCT_FOR_ID(copyreg) + STRUCT_FOR_ID(decode) + STRUCT_FOR_ID(default) + STRUCT_FOR_ID(defaultaction) + STRUCT_FOR_ID(dictcomp) + STRUCT_FOR_ID(difference_update) + STRUCT_FOR_ID(dispatch_table) + STRUCT_FOR_ID(displayhook) + STRUCT_FOR_ID(enable) + STRUCT_FOR_ID(encode) + STRUCT_FOR_ID(encoding) + STRUCT_FOR_ID(end_lineno) + STRUCT_FOR_ID(end_offset) + STRUCT_FOR_ID(errors) + STRUCT_FOR_ID(excepthook) + STRUCT_FOR_ID(exception) + STRUCT_FOR_ID(extend) + STRUCT_FOR_ID(filename) + STRUCT_FOR_ID(fileno) + STRUCT_FOR_ID(fillvalue) + STRUCT_FOR_ID(filters) + STRUCT_FOR_ID(find_class) + STRUCT_FOR_ID(flush) + STRUCT_FOR_ID(genexpr) + STRUCT_FOR_ID(get) + STRUCT_FOR_ID(get_source) + STRUCT_FOR_ID(getattr) + STRUCT_FOR_ID(getstate) + STRUCT_FOR_ID(ignore) + STRUCT_FOR_ID(importlib) + STRUCT_FOR_ID(inf) + STRUCT_FOR_ID(intersection) + STRUCT_FOR_ID(isatty) + STRUCT_FOR_ID(isinstance) + STRUCT_FOR_ID(items) + STRUCT_FOR_ID(iter) + STRUCT_FOR_ID(join) + STRUCT_FOR_ID(keys) + STRUCT_FOR_ID(lambda) + STRUCT_FOR_ID(last_traceback) + STRUCT_FOR_ID(last_type) + STRUCT_FOR_ID(last_value) + STRUCT_FOR_ID(latin1) + STRUCT_FOR_ID(len) + STRUCT_FOR_ID(line) + STRUCT_FOR_ID(lineno) + STRUCT_FOR_ID(listcomp) + STRUCT_FOR_ID(little) + STRUCT_FOR_ID(locale) + STRUCT_FOR_ID(match) + STRUCT_FOR_ID(metaclass) + STRUCT_FOR_ID(mode) + STRUCT_FOR_ID(modules) + STRUCT_FOR_ID(mro) + STRUCT_FOR_ID(msg) + STRUCT_FOR_ID(n_fields) + STRUCT_FOR_ID(n_sequence_fields) + STRUCT_FOR_ID(n_unnamed_fields) + STRUCT_FOR_ID(name) + STRUCT_FOR_ID(newlines) + STRUCT_FOR_ID(next) + STRUCT_FOR_ID(obj) + STRUCT_FOR_ID(offset) + STRUCT_FOR_ID(onceregistry) + STRUCT_FOR_ID(opcode) + STRUCT_FOR_ID(open) + STRUCT_FOR_ID(parent) + STRUCT_FOR_ID(partial) + STRUCT_FOR_ID(path) + STRUCT_FOR_ID(peek) + STRUCT_FOR_ID(persistent_id) + STRUCT_FOR_ID(persistent_load) + STRUCT_FOR_ID(print_file_and_line) + STRUCT_FOR_ID(ps1) + STRUCT_FOR_ID(ps2) + STRUCT_FOR_ID(raw) + STRUCT_FOR_ID(read) + STRUCT_FOR_ID(read1) + STRUCT_FOR_ID(readable) + STRUCT_FOR_ID(readall) + STRUCT_FOR_ID(readinto) + STRUCT_FOR_ID(readinto1) + STRUCT_FOR_ID(readline) + STRUCT_FOR_ID(reducer_override) + STRUCT_FOR_ID(reload) + STRUCT_FOR_ID(replace) + STRUCT_FOR_ID(reset) + STRUCT_FOR_ID(return) + STRUCT_FOR_ID(reversed) + STRUCT_FOR_ID(seek) + STRUCT_FOR_ID(seekable) + STRUCT_FOR_ID(send) + STRUCT_FOR_ID(setcomp) + STRUCT_FOR_ID(setstate) + STRUCT_FOR_ID(sort) + STRUCT_FOR_ID(stderr) + STRUCT_FOR_ID(stdin) + STRUCT_FOR_ID(stdout) + STRUCT_FOR_ID(strict) + STRUCT_FOR_ID(symmetric_difference_update) + STRUCT_FOR_ID(tell) + STRUCT_FOR_ID(text) + STRUCT_FOR_ID(threading) + STRUCT_FOR_ID(throw) + STRUCT_FOR_ID(top) + STRUCT_FOR_ID(truncate) + STRUCT_FOR_ID(unraisablehook) + STRUCT_FOR_ID(values) + STRUCT_FOR_ID(version) + STRUCT_FOR_ID(warnings) + STRUCT_FOR_ID(warnoptions) + STRUCT_FOR_ID(writable) + STRUCT_FOR_ID(write) + STRUCT_FOR_ID(zipimporter) + } identifiers; + struct { + PyASCIIObject _ascii; + uint8_t _data[2]; + } ascii[128]; + struct { + PyCompactUnicodeObject _latin1; + uint8_t _data[2]; + } latin1[128]; +}; +/* End auto-generated code */ + +#undef ID +#undef STR + + +#define _Py_ID(NAME) \ + (_Py_SINGLETON(strings.identifiers._ ## NAME._ascii.ob_base)) +#define _Py_STR(NAME) \ + (_Py_SINGLETON(strings.literals._ ## NAME._ascii.ob_base)) + +/* _Py_DECLARE_STR() should precede all uses of _Py_STR() in a function. + + This is true even if the same string has already been declared + elsewhere, even in the same file. Mismatched duplicates are detected + by Tools/scripts/generate-global-objects.py. + + Pairing _Py_DECLARE_STR() with every use of _Py_STR() makes sure the + string keeps working even if the declaration is removed somewhere + else. It also makes it clear what the actual string is at every + place it is being used. */ +#define _Py_DECLARE_STR(name, str) + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_GLOBAL_STRINGS_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_hamt.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_hamt.h new file mode 100644 index 0000000000000000000000000000000000000000..4d64288bbab494687ca37a74690f80251f0b7c72 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_hamt.h @@ -0,0 +1,131 @@ +#ifndef Py_INTERNAL_HAMT_H +#define Py_INTERNAL_HAMT_H + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + + +/* +HAMT tree is shaped by hashes of keys. Every group of 5 bits of a hash denotes +the exact position of the key in one level of the tree. Since we're using +32 bit hashes, we can have at most 7 such levels. Although if there are +two distinct keys with equal hashes, they will have to occupy the same +cell in the 7th level of the tree -- so we'd put them in a "collision" node. +Which brings the total possible tree depth to 8. Read more about the actual +layout of the HAMT tree in `hamt.c`. + +This constant is used to define a datastucture for storing iteration state. +*/ +#define _Py_HAMT_MAX_TREE_DEPTH 8 + + +extern PyTypeObject _PyHamt_Type; +extern PyTypeObject _PyHamt_ArrayNode_Type; +extern PyTypeObject _PyHamt_BitmapNode_Type; +extern PyTypeObject _PyHamt_CollisionNode_Type; +extern PyTypeObject _PyHamtKeys_Type; +extern PyTypeObject _PyHamtValues_Type; +extern PyTypeObject _PyHamtItems_Type; + +/* runtime lifecycle */ + +void _PyHamt_Fini(PyInterpreterState *); + + +/* other API */ + +#define PyHamt_Check(o) Py_IS_TYPE(o, &_PyHamt_Type) + + +/* Abstract tree node. */ +typedef struct { + PyObject_HEAD +} PyHamtNode; + + +/* An HAMT immutable mapping collection. */ +typedef struct { + PyObject_HEAD + PyHamtNode *h_root; + PyObject *h_weakreflist; + Py_ssize_t h_count; +} PyHamtObject; + + +/* A struct to hold the state of depth-first traverse of the tree. + + HAMT is an immutable collection. Iterators will hold a strong reference + to it, and every node in the HAMT has strong references to its children. + + So for iterators, we can implement zero allocations and zero reference + inc/dec depth-first iteration. + + - i_nodes: an array of seven pointers to tree nodes + - i_level: the current node in i_nodes + - i_pos: an array of positions within nodes in i_nodes. +*/ +typedef struct { + PyHamtNode *i_nodes[_Py_HAMT_MAX_TREE_DEPTH]; + Py_ssize_t i_pos[_Py_HAMT_MAX_TREE_DEPTH]; + int8_t i_level; +} PyHamtIteratorState; + + +/* Base iterator object. + + Contains the iteration state, a pointer to the HAMT tree, + and a pointer to the 'yield function'. The latter is a simple + function that returns a key/value tuple for the 'Items' iterator, + just a key for the 'Keys' iterator, and a value for the 'Values' + iterator. +*/ +typedef struct { + PyObject_HEAD + PyHamtObject *hi_obj; + PyHamtIteratorState hi_iter; + binaryfunc hi_yield; +} PyHamtIterator; + + +/* Create a new HAMT immutable mapping. */ +PyHamtObject * _PyHamt_New(void); + +/* Return a new collection based on "o", but with an additional + key/val pair. */ +PyHamtObject * _PyHamt_Assoc(PyHamtObject *o, PyObject *key, PyObject *val); + +/* Return a new collection based on "o", but without "key". */ +PyHamtObject * _PyHamt_Without(PyHamtObject *o, PyObject *key); + +/* Find "key" in the "o" collection. + + Return: + - -1: An error occurred. + - 0: "key" wasn't found in "o". + - 1: "key" is in "o"; "*val" is set to its value (a borrowed ref). +*/ +int _PyHamt_Find(PyHamtObject *o, PyObject *key, PyObject **val); + +/* Check if "v" is equal to "w". + + Return: + - 0: v != w + - 1: v == w + - -1: An error occurred. +*/ +int _PyHamt_Eq(PyHamtObject *v, PyHamtObject *w); + +/* Return the size of "o"; equivalent of "len(o)". */ +Py_ssize_t _PyHamt_Len(PyHamtObject *o); + +/* Return a Keys iterator over "o". */ +PyObject * _PyHamt_NewIterKeys(PyHamtObject *o); + +/* Return a Values iterator over "o". */ +PyObject * _PyHamt_NewIterValues(PyHamtObject *o); + +/* Return a Items iterator over "o". */ +PyObject * _PyHamt_NewIterItems(PyHamtObject *o); + +#endif /* !Py_INTERNAL_HAMT_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_hashtable.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_hashtable.h new file mode 100644 index 0000000000000000000000000000000000000000..18757abc28c195883b6e3e1cd39e501a85e45381 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_hashtable.h @@ -0,0 +1,148 @@ +#ifndef Py_INTERNAL_HASHTABLE_H +#define Py_INTERNAL_HASHTABLE_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +/* Single linked list */ + +typedef struct _Py_slist_item_s { + struct _Py_slist_item_s *next; +} _Py_slist_item_t; + +typedef struct { + _Py_slist_item_t *head; +} _Py_slist_t; + +#define _Py_SLIST_ITEM_NEXT(ITEM) (((_Py_slist_item_t *)ITEM)->next) + +#define _Py_SLIST_HEAD(SLIST) (((_Py_slist_t *)SLIST)->head) + + +/* _Py_hashtable: table entry */ + +typedef struct { + /* used by _Py_hashtable_t.buckets to link entries */ + _Py_slist_item_t _Py_slist_item; + + Py_uhash_t key_hash; + void *key; + void *value; +} _Py_hashtable_entry_t; + + +/* _Py_hashtable: prototypes */ + +/* Forward declaration */ +struct _Py_hashtable_t; +typedef struct _Py_hashtable_t _Py_hashtable_t; + +typedef Py_uhash_t (*_Py_hashtable_hash_func) (const void *key); +typedef int (*_Py_hashtable_compare_func) (const void *key1, const void *key2); +typedef void (*_Py_hashtable_destroy_func) (void *key); +typedef _Py_hashtable_entry_t* (*_Py_hashtable_get_entry_func)(_Py_hashtable_t *ht, + const void *key); + +typedef struct { + // Allocate a memory block + void* (*malloc) (size_t size); + + // Release a memory block + void (*free) (void *ptr); +} _Py_hashtable_allocator_t; + + +/* _Py_hashtable: table */ +struct _Py_hashtable_t { + size_t nentries; // Total number of entries in the table + size_t nbuckets; + _Py_slist_t *buckets; + + _Py_hashtable_get_entry_func get_entry_func; + _Py_hashtable_hash_func hash_func; + _Py_hashtable_compare_func compare_func; + _Py_hashtable_destroy_func key_destroy_func; + _Py_hashtable_destroy_func value_destroy_func; + _Py_hashtable_allocator_t alloc; +}; + +/* Hash a pointer (void*) */ +PyAPI_FUNC(Py_uhash_t) _Py_hashtable_hash_ptr(const void *key); + +/* Comparison using memcmp() */ +PyAPI_FUNC(int) _Py_hashtable_compare_direct( + const void *key1, + const void *key2); + +PyAPI_FUNC(_Py_hashtable_t *) _Py_hashtable_new( + _Py_hashtable_hash_func hash_func, + _Py_hashtable_compare_func compare_func); + +PyAPI_FUNC(_Py_hashtable_t *) _Py_hashtable_new_full( + _Py_hashtable_hash_func hash_func, + _Py_hashtable_compare_func compare_func, + _Py_hashtable_destroy_func key_destroy_func, + _Py_hashtable_destroy_func value_destroy_func, + _Py_hashtable_allocator_t *allocator); + +PyAPI_FUNC(void) _Py_hashtable_destroy(_Py_hashtable_t *ht); + +PyAPI_FUNC(void) _Py_hashtable_clear(_Py_hashtable_t *ht); + +typedef int (*_Py_hashtable_foreach_func) (_Py_hashtable_t *ht, + const void *key, const void *value, + void *user_data); + +/* Call func() on each entry of the hashtable. + Iteration stops if func() result is non-zero, in this case it's the result + of the call. Otherwise, the function returns 0. */ +PyAPI_FUNC(int) _Py_hashtable_foreach( + _Py_hashtable_t *ht, + _Py_hashtable_foreach_func func, + void *user_data); + +PyAPI_FUNC(size_t) _Py_hashtable_size(const _Py_hashtable_t *ht); + +/* Add a new entry to the hash. The key must not be present in the hash table. + Return 0 on success, -1 on memory error. */ +PyAPI_FUNC(int) _Py_hashtable_set( + _Py_hashtable_t *ht, + const void *key, + void *value); + + +/* Get an entry. + Return NULL if the key does not exist. */ +static inline _Py_hashtable_entry_t * +_Py_hashtable_get_entry(_Py_hashtable_t *ht, const void *key) +{ + return ht->get_entry_func(ht, key); +} + + +/* Get value from an entry. + Return NULL if the entry is not found. + + Use _Py_hashtable_get_entry() to distinguish entry value equal to NULL + and entry not found. */ +PyAPI_FUNC(void*) _Py_hashtable_get(_Py_hashtable_t *ht, const void *key); + + +/* Remove a key and its associated value without calling key and value destroy + functions. + + Return the removed value if the key was found. + Return NULL if the key was not found. */ +PyAPI_FUNC(void*) _Py_hashtable_steal( + _Py_hashtable_t *ht, + const void *key); + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_HASHTABLE_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_import.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_import.h new file mode 100644 index 0000000000000000000000000000000000000000..aee1f66a3ea171866018d2b54323f036717409bb --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_import.h @@ -0,0 +1,27 @@ +#ifndef Py_LIMITED_API +#ifndef Py_INTERNAL_IMPORT_H +#define Py_INTERNAL_IMPORT_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef HAVE_FORK +extern PyStatus _PyImport_ReInitLock(void); +#endif +extern PyObject* _PyImport_BootstrapImp(PyThreadState *tstate); + +struct _module_alias { + const char *name; /* ASCII encoded string */ + const char *orig; /* ASCII encoded string */ +}; + +PyAPI_DATA(const struct _frozen *) _PyImport_FrozenBootstrap; +PyAPI_DATA(const struct _frozen *) _PyImport_FrozenStdlib; +PyAPI_DATA(const struct _frozen *) _PyImport_FrozenTest; +extern const struct _module_alias * _PyImport_FrozenAliases; + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_IMPORT_H */ +#endif /* !Py_LIMITED_API */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_initconfig.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_initconfig.h new file mode 100644 index 0000000000000000000000000000000000000000..d765600fecf4e8207903f084e19a16af1b6a3c91 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_initconfig.h @@ -0,0 +1,183 @@ +#ifndef Py_INTERNAL_CORECONFIG_H +#define Py_INTERNAL_CORECONFIG_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +/* Forward declaration */ +struct pyruntimestate; + +/* --- PyStatus ----------------------------------------------- */ + +/* Almost all errors causing Python initialization to fail */ +#ifdef _MSC_VER + /* Visual Studio 2015 doesn't implement C99 __func__ in C */ +# define _PyStatus_GET_FUNC() __FUNCTION__ +#else +# define _PyStatus_GET_FUNC() __func__ +#endif + +#define _PyStatus_OK() \ + (PyStatus){._type = _PyStatus_TYPE_OK,} + /* other fields are set to 0 */ +#define _PyStatus_ERR(ERR_MSG) \ + (PyStatus){ \ + ._type = _PyStatus_TYPE_ERROR, \ + .func = _PyStatus_GET_FUNC(), \ + .err_msg = (ERR_MSG)} + /* other fields are set to 0 */ +#define _PyStatus_NO_MEMORY() _PyStatus_ERR("memory allocation failed") +#define _PyStatus_EXIT(EXITCODE) \ + (PyStatus){ \ + ._type = _PyStatus_TYPE_EXIT, \ + .exitcode = (EXITCODE)} +#define _PyStatus_IS_ERROR(err) \ + (err._type == _PyStatus_TYPE_ERROR) +#define _PyStatus_IS_EXIT(err) \ + (err._type == _PyStatus_TYPE_EXIT) +#define _PyStatus_EXCEPTION(err) \ + (err._type != _PyStatus_TYPE_OK) +#define _PyStatus_UPDATE_FUNC(err) \ + do { err.func = _PyStatus_GET_FUNC(); } while (0) + +PyObject* _PyErr_SetFromPyStatus(PyStatus status); + +/* --- PyWideStringList ------------------------------------------------ */ + +#define _PyWideStringList_INIT (PyWideStringList){.length = 0, .items = NULL} + +#ifndef NDEBUG +PyAPI_FUNC(int) _PyWideStringList_CheckConsistency(const PyWideStringList *list); +#endif +PyAPI_FUNC(void) _PyWideStringList_Clear(PyWideStringList *list); +PyAPI_FUNC(int) _PyWideStringList_Copy(PyWideStringList *list, + const PyWideStringList *list2); +PyAPI_FUNC(PyStatus) _PyWideStringList_Extend(PyWideStringList *list, + const PyWideStringList *list2); +PyAPI_FUNC(PyObject*) _PyWideStringList_AsList(const PyWideStringList *list); + + +/* --- _PyArgv ---------------------------------------------------- */ + +typedef struct _PyArgv { + Py_ssize_t argc; + int use_bytes_argv; + char * const *bytes_argv; + wchar_t * const *wchar_argv; +} _PyArgv; + +PyAPI_FUNC(PyStatus) _PyArgv_AsWstrList(const _PyArgv *args, + PyWideStringList *list); + + +/* --- Helper functions ------------------------------------------- */ + +PyAPI_FUNC(int) _Py_str_to_int( + const char *str, + int *result); +PyAPI_FUNC(const wchar_t*) _Py_get_xoption( + const PyWideStringList *xoptions, + const wchar_t *name); +PyAPI_FUNC(const char*) _Py_GetEnv( + int use_environment, + const char *name); +PyAPI_FUNC(void) _Py_get_env_flag( + int use_environment, + int *flag, + const char *name); + +/* Py_GetArgcArgv() helper */ +PyAPI_FUNC(void) _Py_ClearArgcArgv(void); + + +/* --- _PyPreCmdline ------------------------------------------------- */ + +typedef struct { + PyWideStringList argv; + PyWideStringList xoptions; /* "-X value" option */ + int isolated; /* -I option */ + int use_environment; /* -E option */ + int dev_mode; /* -X dev and PYTHONDEVMODE */ + int warn_default_encoding; /* -X warn_default_encoding and PYTHONWARNDEFAULTENCODING */ +} _PyPreCmdline; + +#define _PyPreCmdline_INIT \ + (_PyPreCmdline){ \ + .use_environment = -1, \ + .isolated = -1, \ + .dev_mode = -1} +/* Note: _PyPreCmdline_INIT sets other fields to 0/NULL */ + +extern void _PyPreCmdline_Clear(_PyPreCmdline *cmdline); +extern PyStatus _PyPreCmdline_SetArgv(_PyPreCmdline *cmdline, + const _PyArgv *args); +extern PyStatus _PyPreCmdline_SetConfig( + const _PyPreCmdline *cmdline, + PyConfig *config); +extern PyStatus _PyPreCmdline_Read(_PyPreCmdline *cmdline, + const PyPreConfig *preconfig); + + +/* --- PyPreConfig ----------------------------------------------- */ + +PyAPI_FUNC(void) _PyPreConfig_InitCompatConfig(PyPreConfig *preconfig); +extern void _PyPreConfig_InitFromConfig( + PyPreConfig *preconfig, + const PyConfig *config); +extern PyStatus _PyPreConfig_InitFromPreConfig( + PyPreConfig *preconfig, + const PyPreConfig *config2); +extern PyObject* _PyPreConfig_AsDict(const PyPreConfig *preconfig); +extern void _PyPreConfig_GetConfig(PyPreConfig *preconfig, + const PyConfig *config); +extern PyStatus _PyPreConfig_Read(PyPreConfig *preconfig, + const _PyArgv *args); +extern PyStatus _PyPreConfig_Write(const PyPreConfig *preconfig); + + +/* --- PyConfig ---------------------------------------------- */ + +typedef enum { + /* Py_Initialize() API: backward compatibility with Python 3.6 and 3.7 */ + _PyConfig_INIT_COMPAT = 1, + _PyConfig_INIT_PYTHON = 2, + _PyConfig_INIT_ISOLATED = 3 +} _PyConfigInitEnum; + +PyAPI_FUNC(void) _PyConfig_InitCompatConfig(PyConfig *config); +extern PyStatus _PyConfig_Copy( + PyConfig *config, + const PyConfig *config2); +extern PyStatus _PyConfig_InitPathConfig( + PyConfig *config, + int compute_path_config); +extern PyStatus _PyConfig_InitImportConfig(PyConfig *config); +extern PyStatus _PyConfig_Read(PyConfig *config, int compute_path_config); +extern PyStatus _PyConfig_Write(const PyConfig *config, + struct pyruntimestate *runtime); +extern PyStatus _PyConfig_SetPyArgv( + PyConfig *config, + const _PyArgv *args); + +PyAPI_FUNC(PyObject*) _PyConfig_AsDict(const PyConfig *config); +PyAPI_FUNC(int) _PyConfig_FromDict(PyConfig *config, PyObject *dict); + +extern void _Py_DumpPathConfig(PyThreadState *tstate); + +PyAPI_FUNC(PyObject*) _Py_Get_Getpath_CodeObject(void); + +extern int _Py_global_config_int_max_str_digits; + + +/* --- Function used for testing ---------------------------------- */ + +PyAPI_FUNC(PyObject*) _Py_GetConfigsAsDict(void); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_CORECONFIG_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_interp.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_interp.h new file mode 100644 index 0000000000000000000000000000000000000000..02d25d67c742954ce264296f101b32856e024e14 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_interp.h @@ -0,0 +1,227 @@ +#ifndef Py_INTERNAL_INTERP_H +#define Py_INTERNAL_INTERP_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include + +#include "pycore_atomic.h" // _Py_atomic_address +#include "pycore_ast_state.h" // struct ast_state +#include "pycore_code.h" // struct callable_cache +#include "pycore_context.h" // struct _Py_context_state +#include "pycore_dict.h" // struct _Py_dict_state +#include "pycore_exceptions.h" // struct _Py_exc_state +#include "pycore_floatobject.h" // struct _Py_float_state +#include "pycore_genobject.h" // struct _Py_async_gen_state +#include "pycore_gil.h" // struct _gil_runtime_state +#include "pycore_gc.h" // struct _gc_runtime_state +#include "pycore_list.h" // struct _Py_list_state +#include "pycore_tuple.h" // struct _Py_tuple_state +#include "pycore_typeobject.h" // struct type_cache +#include "pycore_unicodeobject.h" // struct _Py_unicode_state +#include "pycore_warnings.h" // struct _warnings_runtime_state + +struct _pending_calls { + PyThread_type_lock lock; + /* Request for running pending calls. */ + _Py_atomic_int calls_to_do; + /* Request for looking at the `async_exc` field of the current + thread state. + Guarded by the GIL. */ + int async_exc; +#define NPENDINGCALLS 32 + struct { + int (*func)(void *); + void *arg; + } calls[NPENDINGCALLS]; + int first; + int last; +}; + +struct _ceval_state { + int recursion_limit; + /* This single variable consolidates all requests to break out of + the fast path in the eval loop. */ + _Py_atomic_int eval_breaker; + /* Request for dropping the GIL */ + _Py_atomic_int gil_drop_request; + struct _pending_calls pending; +}; + + +// atexit state +typedef struct { + PyObject *func; + PyObject *args; + PyObject *kwargs; +} atexit_callback; + +struct atexit_state { + atexit_callback **callbacks; + int ncallbacks; + int callback_len; +}; + + +/* interpreter state */ + +/* PyInterpreterState holds the global state for one of the runtime's + interpreters. Typically the initial (main) interpreter is the only one. + + The PyInterpreterState typedef is in Include/pystate.h. + */ +struct _is { + + PyInterpreterState *next; + + struct pythreads { + uint64_t next_unique_id; + /* The linked list of threads, newest first. */ + PyThreadState *head; + /* Used in Modules/_threadmodule.c. */ + long count; + /* Support for runtime thread stack size tuning. + A value of 0 means using the platform's default stack size + or the size specified by the THREAD_STACK_SIZE macro. */ + /* Used in Python/thread.c. */ + size_t stacksize; + } threads; + + /* Reference to the _PyRuntime global variable. This field exists + to not have to pass runtime in addition to tstate to a function. + Get runtime from tstate: tstate->interp->runtime. */ + struct pyruntimestate *runtime; + + int64_t id; + int64_t id_refcount; + int requires_idref; + PyThread_type_lock id_mutex; + + /* Has been initialized to a safe state. + + In order to be effective, this must be set to 0 during or right + after allocation. */ + int _initialized; + int finalizing; + + /* Was this interpreter statically allocated? */ + bool _static; + + struct _ceval_state ceval; + struct _gc_runtime_state gc; + + // sys.modules dictionary + PyObject *modules; + PyObject *modules_by_index; + // Dictionary of the sys module + PyObject *sysdict; + // Dictionary of the builtins module + PyObject *builtins; + // importlib module + PyObject *importlib; + // override for config->use_frozen_modules (for tests) + // (-1: "off", 1: "on", 0: no override) + int override_frozen_modules; + + PyObject *codec_search_path; + PyObject *codec_search_cache; + PyObject *codec_error_registry; + int codecs_initialized; + + PyConfig config; +#ifdef HAVE_DLOPEN + int dlopenflags; +#endif + + PyObject *dict; /* Stores per-interpreter state */ + + PyObject *builtins_copy; + PyObject *import_func; + // Initialized to _PyEval_EvalFrameDefault(). + _PyFrameEvalFunction eval_frame; + + Py_ssize_t co_extra_user_count; + freefunc co_extra_freefuncs[MAX_CO_EXTRA_USERS]; + +#ifdef HAVE_FORK + PyObject *before_forkers; + PyObject *after_forkers_parent; + PyObject *after_forkers_child; +#endif + + struct _warnings_runtime_state warnings; + struct atexit_state atexit; + + PyObject *audit_hooks; + + struct _Py_unicode_state unicode; + struct _Py_float_state float_state; + /* Using a cache is very effective since typically only a single slice is + created and then deleted again. */ + PySliceObject *slice_cache; + + struct _Py_tuple_state tuple; + struct _Py_list_state list; + struct _Py_dict_state dict_state; + struct _Py_async_gen_state async_gen; + struct _Py_context_state context; + struct _Py_exc_state exc_state; + + struct ast_state ast; + struct type_cache type_cache; + struct callable_cache callable_cache; + + int int_max_str_digits; + + /* The following fields are here to avoid allocation during init. + The data is exposed through PyInterpreterState pointer fields. + These fields should not be accessed directly outside of init. + + All other PyInterpreterState pointer fields are populated when + needed and default to NULL. + + For now there are some exceptions to that rule, which require + allocation during init. These will be addressed on a case-by-case + basis. Also see _PyRuntimeState regarding the various mutex fields. + */ + + /* the initial PyInterpreterState.threads.head */ + PyThreadState _initial_thread; +}; + + +/* other API */ + +extern void _PyInterpreterState_ClearModules(PyInterpreterState *interp); +extern void _PyInterpreterState_Clear(PyThreadState *tstate); + + +/* cross-interpreter data registry */ + +/* For now we use a global registry of shareable classes. An + alternative would be to add a tp_* slot for a class's + crossinterpdatafunc. It would be simpler and more efficient. */ + +struct _xidregitem; + +struct _xidregitem { + PyTypeObject *cls; + crossinterpdatafunc getdata; + struct _xidregitem *next; +}; + +PyAPI_FUNC(PyInterpreterState*) _PyInterpreterState_LookUpID(int64_t); + +PyAPI_FUNC(int) _PyInterpreterState_IDInitref(PyInterpreterState *); +PyAPI_FUNC(int) _PyInterpreterState_IDIncref(PyInterpreterState *); +PyAPI_FUNC(void) _PyInterpreterState_IDDecref(PyInterpreterState *); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_INTERP_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_interpreteridobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_interpreteridobject.h new file mode 100644 index 0000000000000000000000000000000000000000..804831e76deaeac213e122f6373bc1812d5af8ff --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_interpreteridobject.h @@ -0,0 +1,22 @@ +/* Interpreter ID Object */ + +#ifndef Py_INTERNAL_INTERPRETERIDOBJECT_H +#define Py_INTERNAL_INTERPRETERIDOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +PyAPI_DATA(PyTypeObject) _PyInterpreterID_Type; + +PyAPI_FUNC(PyObject *) _PyInterpreterID_New(int64_t); +PyAPI_FUNC(PyObject *) _PyInterpreterState_GetIDObject(PyInterpreterState *); +PyAPI_FUNC(PyInterpreterState *) _PyInterpreterID_LookUp(PyObject *); + +#ifdef __cplusplus +} +#endif +#endif // !Py_INTERNAL_INTERPRETERIDOBJECT_H diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_list.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_list.h new file mode 100644 index 0000000000000000000000000000000000000000..860dce1fd5d3938fcf6f146bb7705eb1e1835940 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_list.h @@ -0,0 +1,62 @@ +#ifndef Py_INTERNAL_LIST_H +#define Py_INTERNAL_LIST_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "listobject.h" // _PyList_CAST() + + +/* runtime lifecycle */ + +extern void _PyList_Fini(PyInterpreterState *); + + +/* other API */ + +#ifndef WITH_FREELISTS +// without freelists +# define PyList_MAXFREELIST 0 +#endif + +/* Empty list reuse scheme to save calls to malloc and free */ +#ifndef PyList_MAXFREELIST +# define PyList_MAXFREELIST 80 +#endif + +struct _Py_list_state { +#if PyList_MAXFREELIST > 0 + PyListObject *free_list[PyList_MAXFREELIST]; + int numfree; +#endif +}; + +#define _PyList_ITEMS(op) (_PyList_CAST(op)->ob_item) + +extern int +_PyList_AppendTakeRefListResize(PyListObject *self, PyObject *newitem); + +static inline int +_PyList_AppendTakeRef(PyListObject *self, PyObject *newitem) +{ + assert(self != NULL && newitem != NULL); + assert(PyList_Check(self)); + Py_ssize_t len = PyList_GET_SIZE(self); + Py_ssize_t allocated = self->allocated; + assert((size_t)len + 1 < PY_SSIZE_T_MAX); + if (allocated > len) { + PyList_SET_ITEM(self, len, newitem); + Py_SET_SIZE(self, len + 1); + return 0; + } + return _PyList_AppendTakeRefListResize(self, newitem); +} + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_LIST_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_long.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_long.h new file mode 100644 index 0000000000000000000000000000000000000000..0f466eb60feadb50f3e5ba8ddfdf6264fabf0216 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_long.h @@ -0,0 +1,114 @@ +#ifndef Py_INTERNAL_LONG_H +#define Py_INTERNAL_LONG_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_global_objects.h" // _PY_NSMALLNEGINTS +#include "pycore_runtime.h" // _PyRuntime + +/* + * Default int base conversion size limitation: Denial of Service prevention. + * + * Chosen such that this isn't wildly slow on modern hardware and so that + * everyone's existing deployed numpy test suite passes before + * https://github.com/numpy/numpy/issues/22098 is widely available. + * + * $ python -m timeit -s 's = "1"*4300' 'int(s)' + * 2000 loops, best of 5: 125 usec per loop + * $ python -m timeit -s 's = "1"*4300; v = int(s)' 'str(v)' + * 1000 loops, best of 5: 311 usec per loop + * (zen2 cloud VM) + * + * 4300 decimal digits fits a ~14284 bit number. + */ +#define _PY_LONG_DEFAULT_MAX_STR_DIGITS 4300 +/* + * Threshold for max digits check. For performance reasons int() and + * int.__str__() don't checks values that are smaller than this + * threshold. Acts as a guaranteed minimum size limit for bignums that + * applications can expect from CPython. + * + * % python -m timeit -s 's = "1"*640; v = int(s)' 'str(int(s))' + * 20000 loops, best of 5: 12 usec per loop + * + * "640 digits should be enough for anyone." - gps + * fits a ~2126 bit decimal number. + */ +#define _PY_LONG_MAX_STR_DIGITS_THRESHOLD 640 + +#if ((_PY_LONG_DEFAULT_MAX_STR_DIGITS != 0) && \ + (_PY_LONG_DEFAULT_MAX_STR_DIGITS < _PY_LONG_MAX_STR_DIGITS_THRESHOLD)) +# error "_PY_LONG_DEFAULT_MAX_STR_DIGITS smaller than threshold." +#endif + + +/* runtime lifecycle */ + +extern PyStatus _PyLong_InitTypes(PyInterpreterState *); +extern void _PyLong_FiniTypes(PyInterpreterState *interp); + + +/* other API */ + +#define _PyLong_SMALL_INTS _Py_SINGLETON(small_ints) + +// _PyLong_GetZero() and _PyLong_GetOne() must always be available +// _PyLong_FromUnsignedChar must always be available +#if _PY_NSMALLPOSINTS < 257 +# error "_PY_NSMALLPOSINTS must be greater than or equal to 257" +#endif + +// Return a borrowed reference to the zero singleton. +// The function cannot return NULL. +static inline PyObject* _PyLong_GetZero(void) +{ return (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS]; } + +// Return a borrowed reference to the one singleton. +// The function cannot return NULL. +static inline PyObject* _PyLong_GetOne(void) +{ return (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS+1]; } + +static inline PyObject* _PyLong_FromUnsignedChar(unsigned char i) +{ + return Py_NewRef((PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS+i]); +} + +PyObject *_PyLong_Add(PyLongObject *left, PyLongObject *right); +PyObject *_PyLong_Multiply(PyLongObject *left, PyLongObject *right); +PyObject *_PyLong_Subtract(PyLongObject *left, PyLongObject *right); + +/* Used by Python/mystrtoul.c, _PyBytes_FromHex(), + _PyBytes_DecodeEscape(), etc. */ +PyAPI_DATA(unsigned char) _PyLong_DigitValue[256]; + +/* Format the object based on the format_spec, as defined in PEP 3101 + (Advanced String Formatting). */ +PyAPI_FUNC(int) _PyLong_FormatAdvancedWriter( + _PyUnicodeWriter *writer, + PyObject *obj, + PyObject *format_spec, + Py_ssize_t start, + Py_ssize_t end); + +PyAPI_FUNC(int) _PyLong_FormatWriter( + _PyUnicodeWriter *writer, + PyObject *obj, + int base, + int alternate); + +PyAPI_FUNC(char*) _PyLong_FormatBytesWriter( + _PyBytesWriter *writer, + char *str, + PyObject *obj, + int base, + int alternate); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_LONG_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_moduleobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_moduleobject.h new file mode 100644 index 0000000000000000000000000000000000000000..76361b8dff113a03da060772f178182e2d0fd274 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_moduleobject.h @@ -0,0 +1,42 @@ +#ifndef Py_INTERNAL_MODULEOBJECT_H +#define Py_INTERNAL_MODULEOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +typedef struct { + PyObject_HEAD + PyObject *md_dict; + PyModuleDef *md_def; + void *md_state; + PyObject *md_weaklist; + // for logging purposes after md_dict is cleared + PyObject *md_name; +} PyModuleObject; + +static inline PyModuleDef* _PyModule_GetDef(PyObject *mod) { + assert(PyModule_Check(mod)); + return ((PyModuleObject *)mod)->md_def; +} + +static inline void* _PyModule_GetState(PyObject* mod) { + assert(PyModule_Check(mod)); + return ((PyModuleObject *)mod)->md_state; +} + +static inline PyObject* _PyModule_GetDict(PyObject *mod) { + assert(PyModule_Check(mod)); + PyObject *dict = ((PyModuleObject *)mod) -> md_dict; + // _PyModule_GetDict(mod) must not be used after calling module_clear(mod) + assert(dict != NULL); + return dict; +} + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_MODULEOBJECT_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_namespace.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_namespace.h new file mode 100644 index 0000000000000000000000000000000000000000..cb76f040693d10b4fe8a7f19cbf195831f3044f5 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_namespace.h @@ -0,0 +1,20 @@ +// Simple namespace object interface + +#ifndef Py_INTERNAL_NAMESPACE_H +#define Py_INTERNAL_NAMESPACE_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +PyAPI_DATA(PyTypeObject) _PyNamespace_Type; + +PyAPI_FUNC(PyObject *) _PyNamespace_New(PyObject *kwds); + +#ifdef __cplusplus +} +#endif +#endif // !Py_INTERNAL_NAMESPACE_H diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_object.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_object.h new file mode 100644 index 0000000000000000000000000000000000000000..f022f8246989d1509a00a343a841752fdcf320f0 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_object.h @@ -0,0 +1,310 @@ +#ifndef Py_INTERNAL_OBJECT_H +#define Py_INTERNAL_OBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include +#include "pycore_gc.h" // _PyObject_GC_IS_TRACKED() +#include "pycore_interp.h" // PyInterpreterState.gc +#include "pycore_pystate.h" // _PyInterpreterState_GET() +#include "pycore_runtime.h" // _PyRuntime + +#define _PyObject_IMMORTAL_INIT(type) \ + { \ + .ob_refcnt = 999999999, \ + .ob_type = type, \ + } +#define _PyVarObject_IMMORTAL_INIT(type, size) \ + { \ + .ob_base = _PyObject_IMMORTAL_INIT(type), \ + .ob_size = size, \ + } + +PyAPI_FUNC(void) _Py_NO_RETURN _Py_FatalRefcountErrorFunc( + const char *func, + const char *message); + +#define _Py_FatalRefcountError(message) _Py_FatalRefcountErrorFunc(__func__, message) + +static inline void +_Py_DECREF_SPECIALIZED(PyObject *op, const destructor destruct) +{ +#ifdef Py_REF_DEBUG + _Py_RefTotal--; +#endif + if (--op->ob_refcnt != 0) { + assert(op->ob_refcnt > 0); + } + else { +#ifdef Py_TRACE_REFS + _Py_ForgetReference(op); +#endif + destruct(op); + } +} + +static inline void +_Py_DECREF_NO_DEALLOC(PyObject *op) +{ +#ifdef Py_REF_DEBUG + _Py_RefTotal--; +#endif + op->ob_refcnt--; +#ifdef Py_DEBUG + if (op->ob_refcnt <= 0) { + _Py_FatalRefcountError("Expected a positive remaining refcount"); + } +#endif +} + +PyAPI_FUNC(int) _PyType_CheckConsistency(PyTypeObject *type); +PyAPI_FUNC(int) _PyDict_CheckConsistency(PyObject *mp, int check_content); + +/* Update the Python traceback of an object. This function must be called + when a memory block is reused from a free list. + + Internal function called by _Py_NewReference(). */ +extern int _PyTraceMalloc_NewReference(PyObject *op); + +// Fast inlined version of PyType_HasFeature() +static inline int +_PyType_HasFeature(PyTypeObject *type, unsigned long feature) { + return ((type->tp_flags & feature) != 0); +} + +extern void _PyType_InitCache(PyInterpreterState *interp); + + +/* Inline functions trading binary compatibility for speed: + _PyObject_Init() is the fast version of PyObject_Init(), and + _PyObject_InitVar() is the fast version of PyObject_InitVar(). + + These inline functions must not be called with op=NULL. */ +static inline void +_PyObject_Init(PyObject *op, PyTypeObject *typeobj) +{ + assert(op != NULL); + Py_SET_TYPE(op, typeobj); + if (_PyType_HasFeature(typeobj, Py_TPFLAGS_HEAPTYPE)) { + Py_INCREF(typeobj); + } + _Py_NewReference(op); +} + +static inline void +_PyObject_InitVar(PyVarObject *op, PyTypeObject *typeobj, Py_ssize_t size) +{ + assert(op != NULL); + Py_SET_SIZE(op, size); + _PyObject_Init((PyObject *)op, typeobj); +} + + +/* Tell the GC to track this object. + * + * The object must not be tracked by the GC. + * + * NB: While the object is tracked by the collector, it must be safe to call the + * ob_traverse method. + * + * Internal note: interp->gc.generation0->_gc_prev doesn't have any bit flags + * because it's not object header. So we don't use _PyGCHead_PREV() and + * _PyGCHead_SET_PREV() for it to avoid unnecessary bitwise operations. + * + * See also the public PyObject_GC_Track() function. + */ +static inline void _PyObject_GC_TRACK( +// The preprocessor removes _PyObject_ASSERT_FROM() calls if NDEBUG is defined +#ifndef NDEBUG + const char *filename, int lineno, +#endif + PyObject *op) +{ + _PyObject_ASSERT_FROM(op, !_PyObject_GC_IS_TRACKED(op), + "object already tracked by the garbage collector", + filename, lineno, __func__); + + PyGC_Head *gc = _Py_AS_GC(op); + _PyObject_ASSERT_FROM(op, + (gc->_gc_prev & _PyGC_PREV_MASK_COLLECTING) == 0, + "object is in generation which is garbage collected", + filename, lineno, __func__); + + PyInterpreterState *interp = _PyInterpreterState_GET(); + PyGC_Head *generation0 = interp->gc.generation0; + PyGC_Head *last = (PyGC_Head*)(generation0->_gc_prev); + _PyGCHead_SET_NEXT(last, gc); + _PyGCHead_SET_PREV(gc, last); + _PyGCHead_SET_NEXT(gc, generation0); + generation0->_gc_prev = (uintptr_t)gc; +} + +/* Tell the GC to stop tracking this object. + * + * Internal note: This may be called while GC. So _PyGC_PREV_MASK_COLLECTING + * must be cleared. But _PyGC_PREV_MASK_FINALIZED bit is kept. + * + * The object must be tracked by the GC. + * + * See also the public PyObject_GC_UnTrack() which accept an object which is + * not tracked. + */ +static inline void _PyObject_GC_UNTRACK( +// The preprocessor removes _PyObject_ASSERT_FROM() calls if NDEBUG is defined +#ifndef NDEBUG + const char *filename, int lineno, +#endif + PyObject *op) +{ + _PyObject_ASSERT_FROM(op, _PyObject_GC_IS_TRACKED(op), + "object not tracked by the garbage collector", + filename, lineno, __func__); + + PyGC_Head *gc = _Py_AS_GC(op); + PyGC_Head *prev = _PyGCHead_PREV(gc); + PyGC_Head *next = _PyGCHead_NEXT(gc); + _PyGCHead_SET_NEXT(prev, next); + _PyGCHead_SET_PREV(next, prev); + gc->_gc_next = 0; + gc->_gc_prev &= _PyGC_PREV_MASK_FINALIZED; +} + +// Macros to accept any type for the parameter, and to automatically pass +// the filename and the filename (if NDEBUG is not defined) where the macro +// is called. +#ifdef NDEBUG +# define _PyObject_GC_TRACK(op) \ + _PyObject_GC_TRACK(_PyObject_CAST(op)) +# define _PyObject_GC_UNTRACK(op) \ + _PyObject_GC_UNTRACK(_PyObject_CAST(op)) +#else +# define _PyObject_GC_TRACK(op) \ + _PyObject_GC_TRACK(__FILE__, __LINE__, _PyObject_CAST(op)) +# define _PyObject_GC_UNTRACK(op) \ + _PyObject_GC_UNTRACK(__FILE__, __LINE__, _PyObject_CAST(op)) +#endif + +#ifdef Py_REF_DEBUG +extern void _PyDebug_PrintTotalRefs(void); +#endif + +#ifdef Py_TRACE_REFS +extern void _Py_AddToAllObjects(PyObject *op, int force); +extern void _Py_PrintReferences(FILE *); +extern void _Py_PrintReferenceAddresses(FILE *); +#endif + +static inline PyObject ** +_PyObject_GET_WEAKREFS_LISTPTR(PyObject *op) +{ + Py_ssize_t offset = Py_TYPE(op)->tp_weaklistoffset; + return (PyObject **)((char *)op + offset); +} + +// Fast inlined version of PyObject_IS_GC() +static inline int +_PyObject_IS_GC(PyObject *obj) +{ + return (PyType_IS_GC(Py_TYPE(obj)) + && (Py_TYPE(obj)->tp_is_gc == NULL + || Py_TYPE(obj)->tp_is_gc(obj))); +} + +// Fast inlined version of PyType_IS_GC() +#define _PyType_IS_GC(t) _PyType_HasFeature((t), Py_TPFLAGS_HAVE_GC) + +static inline size_t +_PyType_PreHeaderSize(PyTypeObject *tp) +{ + return _PyType_IS_GC(tp) * sizeof(PyGC_Head) + + _PyType_HasFeature(tp, Py_TPFLAGS_MANAGED_DICT) * 2 * sizeof(PyObject *); +} + +void _PyObject_GC_Link(PyObject *op); + +// Usage: assert(_Py_CheckSlotResult(obj, "__getitem__", result != NULL)); +extern int _Py_CheckSlotResult( + PyObject *obj, + const char *slot_name, + int success); + +// PyType_Ready() must be called if _PyType_IsReady() is false. +// See also the Py_TPFLAGS_READY flag. +#define _PyType_IsReady(type) ((type)->tp_dict != NULL) + +// Test if a type supports weak references +static inline int _PyType_SUPPORTS_WEAKREFS(PyTypeObject *type) { + return (type->tp_weaklistoffset > 0); +} + +extern PyObject* _PyType_AllocNoTrack(PyTypeObject *type, Py_ssize_t nitems); + +extern int _PyObject_InitializeDict(PyObject *obj); +extern int _PyObject_StoreInstanceAttribute(PyObject *obj, PyDictValues *values, + PyObject *name, PyObject *value); +PyObject * _PyObject_GetInstanceAttribute(PyObject *obj, PyDictValues *values, + PyObject *name); + +static inline PyDictValues **_PyObject_ValuesPointer(PyObject *obj) +{ + assert(Py_TYPE(obj)->tp_flags & Py_TPFLAGS_MANAGED_DICT); + return ((PyDictValues **)obj)-4; +} + +static inline PyObject **_PyObject_ManagedDictPointer(PyObject *obj) +{ + assert(Py_TYPE(obj)->tp_flags & Py_TPFLAGS_MANAGED_DICT); + return ((PyObject **)obj)-3; +} + +#define MANAGED_DICT_OFFSET (((int)sizeof(PyObject *))*-3) + +extern PyObject ** _PyObject_DictPointer(PyObject *); +extern int _PyObject_VisitInstanceAttributes(PyObject *self, visitproc visit, void *arg); +extern void _PyObject_ClearInstanceAttributes(PyObject *self); +extern void _PyObject_FreeInstanceAttributes(PyObject *self); +extern int _PyObject_IsInstanceDictEmpty(PyObject *); +extern PyObject* _PyType_GetSubclasses(PyTypeObject *); + +// Access macro to the members which are floating "behind" the object +#define _PyHeapType_GET_MEMBERS(etype) \ + ((PyMemberDef *)(((char *)etype) + Py_TYPE(etype)->tp_basicsize)) + +PyAPI_FUNC(PyObject *) _PyObject_LookupSpecial(PyObject *, PyObject *); + +/* C function call trampolines to mitigate bad function pointer casts. + * + * Typical native ABIs ignore additional arguments or fill in missing + * values with 0/NULL in function pointer cast. Compilers do not show + * warnings when a function pointer is explicitly casted to an + * incompatible type. + * + * Bad fpcasts are an issue in WebAssembly. WASM's indirect_call has strict + * function signature checks. Argument count, types, and return type must + * match. + * + * Third party code unintentionally rely on problematic fpcasts. The call + * trampoline mitigates common occurences of bad fpcasts on Emscripten. + */ +#if defined(__EMSCRIPTEN__) && defined(PY_CALL_TRAMPOLINE) +#define _PyCFunction_TrampolineCall(meth, self, args) \ + _PyCFunctionWithKeywords_TrampolineCall( \ + (*(PyCFunctionWithKeywords)(void(*)(void))meth), self, args, NULL) +extern PyObject* _PyCFunctionWithKeywords_TrampolineCall( + PyCFunctionWithKeywords meth, PyObject *, PyObject *, PyObject *); +#else +#define _PyCFunction_TrampolineCall(meth, self, args) \ + (meth)((self), (args)) +#define _PyCFunctionWithKeywords_TrampolineCall(meth, self, args, kw) \ + (meth)((self), (args), (kw)) +#endif // __EMSCRIPTEN__ && PY_CALL_TRAMPOLINE + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_OBJECT_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_opcode.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_opcode.h new file mode 100644 index 0000000000000000000000000000000000000000..eadcba1add0aefc79a204865105a11ab5a56799b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_opcode.h @@ -0,0 +1,581 @@ +// Auto-generated by Tools/scripts/generate_opcode_h.py from Lib/opcode.py + +#ifndef Py_INTERNAL_OPCODE_H +#define Py_INTERNAL_OPCODE_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "opcode.h" + +extern const uint8_t _PyOpcode_Caches[256]; + +extern const uint8_t _PyOpcode_Deopt[256]; + +#ifdef NEED_OPCODE_TABLES +static const uint32_t _PyOpcode_RelativeJump[8] = { + 0U, + 0U, + 536870912U, + 135118848U, + 4163U, + 122880U, + 0U, + 0U, +}; +static const uint32_t _PyOpcode_Jump[8] = { + 0U, + 0U, + 536870912U, + 135118848U, + 4163U, + 122880U, + 0U, + 0U, +}; + +const uint8_t _PyOpcode_Caches[256] = { + [BINARY_SUBSCR] = 4, + [STORE_SUBSCR] = 1, + [UNPACK_SEQUENCE] = 1, + [STORE_ATTR] = 4, + [LOAD_ATTR] = 4, + [COMPARE_OP] = 2, + [LOAD_GLOBAL] = 5, + [BINARY_OP] = 1, + [LOAD_METHOD] = 10, + [PRECALL] = 1, + [CALL] = 4, +}; + +const uint8_t _PyOpcode_Deopt[256] = { + [ASYNC_GEN_WRAP] = ASYNC_GEN_WRAP, + [BEFORE_ASYNC_WITH] = BEFORE_ASYNC_WITH, + [BEFORE_WITH] = BEFORE_WITH, + [BINARY_OP] = BINARY_OP, + [BINARY_OP_ADAPTIVE] = BINARY_OP, + [BINARY_OP_ADD_FLOAT] = BINARY_OP, + [BINARY_OP_ADD_INT] = BINARY_OP, + [BINARY_OP_ADD_UNICODE] = BINARY_OP, + [BINARY_OP_INPLACE_ADD_UNICODE] = BINARY_OP, + [BINARY_OP_MULTIPLY_FLOAT] = BINARY_OP, + [BINARY_OP_MULTIPLY_INT] = BINARY_OP, + [BINARY_OP_SUBTRACT_FLOAT] = BINARY_OP, + [BINARY_OP_SUBTRACT_INT] = BINARY_OP, + [BINARY_SUBSCR] = BINARY_SUBSCR, + [BINARY_SUBSCR_ADAPTIVE] = BINARY_SUBSCR, + [BINARY_SUBSCR_DICT] = BINARY_SUBSCR, + [BINARY_SUBSCR_GETITEM] = BINARY_SUBSCR, + [BINARY_SUBSCR_LIST_INT] = BINARY_SUBSCR, + [BINARY_SUBSCR_TUPLE_INT] = BINARY_SUBSCR, + [BUILD_CONST_KEY_MAP] = BUILD_CONST_KEY_MAP, + [BUILD_LIST] = BUILD_LIST, + [BUILD_MAP] = BUILD_MAP, + [BUILD_SET] = BUILD_SET, + [BUILD_SLICE] = BUILD_SLICE, + [BUILD_STRING] = BUILD_STRING, + [BUILD_TUPLE] = BUILD_TUPLE, + [CACHE] = CACHE, + [CALL] = CALL, + [CALL_ADAPTIVE] = CALL, + [CALL_FUNCTION_EX] = CALL_FUNCTION_EX, + [CALL_PY_EXACT_ARGS] = CALL, + [CALL_PY_WITH_DEFAULTS] = CALL, + [CHECK_EG_MATCH] = CHECK_EG_MATCH, + [CHECK_EXC_MATCH] = CHECK_EXC_MATCH, + [COMPARE_OP] = COMPARE_OP, + [COMPARE_OP_ADAPTIVE] = COMPARE_OP, + [COMPARE_OP_FLOAT_JUMP] = COMPARE_OP, + [COMPARE_OP_INT_JUMP] = COMPARE_OP, + [COMPARE_OP_STR_JUMP] = COMPARE_OP, + [CONTAINS_OP] = CONTAINS_OP, + [COPY] = COPY, + [COPY_FREE_VARS] = COPY_FREE_VARS, + [DELETE_ATTR] = DELETE_ATTR, + [DELETE_DEREF] = DELETE_DEREF, + [DELETE_FAST] = DELETE_FAST, + [DELETE_GLOBAL] = DELETE_GLOBAL, + [DELETE_NAME] = DELETE_NAME, + [DELETE_SUBSCR] = DELETE_SUBSCR, + [DICT_MERGE] = DICT_MERGE, + [DICT_UPDATE] = DICT_UPDATE, + [END_ASYNC_FOR] = END_ASYNC_FOR, + [EXTENDED_ARG] = EXTENDED_ARG, + [EXTENDED_ARG_QUICK] = EXTENDED_ARG, + [FORMAT_VALUE] = FORMAT_VALUE, + [FOR_ITER] = FOR_ITER, + [GET_AITER] = GET_AITER, + [GET_ANEXT] = GET_ANEXT, + [GET_AWAITABLE] = GET_AWAITABLE, + [GET_ITER] = GET_ITER, + [GET_LEN] = GET_LEN, + [GET_YIELD_FROM_ITER] = GET_YIELD_FROM_ITER, + [IMPORT_FROM] = IMPORT_FROM, + [IMPORT_NAME] = IMPORT_NAME, + [IMPORT_STAR] = IMPORT_STAR, + [IS_OP] = IS_OP, + [JUMP_BACKWARD] = JUMP_BACKWARD, + [JUMP_BACKWARD_NO_INTERRUPT] = JUMP_BACKWARD_NO_INTERRUPT, + [JUMP_BACKWARD_QUICK] = JUMP_BACKWARD, + [JUMP_FORWARD] = JUMP_FORWARD, + [JUMP_IF_FALSE_OR_POP] = JUMP_IF_FALSE_OR_POP, + [JUMP_IF_TRUE_OR_POP] = JUMP_IF_TRUE_OR_POP, + [KW_NAMES] = KW_NAMES, + [LIST_APPEND] = LIST_APPEND, + [LIST_EXTEND] = LIST_EXTEND, + [LIST_TO_TUPLE] = LIST_TO_TUPLE, + [LOAD_ASSERTION_ERROR] = LOAD_ASSERTION_ERROR, + [LOAD_ATTR] = LOAD_ATTR, + [LOAD_ATTR_ADAPTIVE] = LOAD_ATTR, + [LOAD_ATTR_INSTANCE_VALUE] = LOAD_ATTR, + [LOAD_ATTR_MODULE] = LOAD_ATTR, + [LOAD_ATTR_SLOT] = LOAD_ATTR, + [LOAD_ATTR_WITH_HINT] = LOAD_ATTR, + [LOAD_BUILD_CLASS] = LOAD_BUILD_CLASS, + [LOAD_CLASSDEREF] = LOAD_CLASSDEREF, + [LOAD_CLOSURE] = LOAD_CLOSURE, + [LOAD_CONST] = LOAD_CONST, + [LOAD_CONST__LOAD_FAST] = LOAD_CONST, + [LOAD_DEREF] = LOAD_DEREF, + [LOAD_FAST] = LOAD_FAST, + [LOAD_FAST__LOAD_CONST] = LOAD_FAST, + [LOAD_FAST__LOAD_FAST] = LOAD_FAST, + [LOAD_GLOBAL] = LOAD_GLOBAL, + [LOAD_GLOBAL_ADAPTIVE] = LOAD_GLOBAL, + [LOAD_GLOBAL_BUILTIN] = LOAD_GLOBAL, + [LOAD_GLOBAL_MODULE] = LOAD_GLOBAL, + [LOAD_METHOD] = LOAD_METHOD, + [LOAD_METHOD_ADAPTIVE] = LOAD_METHOD, + [LOAD_METHOD_CLASS] = LOAD_METHOD, + [LOAD_METHOD_MODULE] = LOAD_METHOD, + [LOAD_METHOD_NO_DICT] = LOAD_METHOD, + [LOAD_METHOD_WITH_DICT] = LOAD_METHOD, + [LOAD_METHOD_WITH_VALUES] = LOAD_METHOD, + [LOAD_NAME] = LOAD_NAME, + [MAKE_CELL] = MAKE_CELL, + [MAKE_FUNCTION] = MAKE_FUNCTION, + [MAP_ADD] = MAP_ADD, + [MATCH_CLASS] = MATCH_CLASS, + [MATCH_KEYS] = MATCH_KEYS, + [MATCH_MAPPING] = MATCH_MAPPING, + [MATCH_SEQUENCE] = MATCH_SEQUENCE, + [NOP] = NOP, + [POP_EXCEPT] = POP_EXCEPT, + [POP_JUMP_BACKWARD_IF_FALSE] = POP_JUMP_BACKWARD_IF_FALSE, + [POP_JUMP_BACKWARD_IF_NONE] = POP_JUMP_BACKWARD_IF_NONE, + [POP_JUMP_BACKWARD_IF_NOT_NONE] = POP_JUMP_BACKWARD_IF_NOT_NONE, + [POP_JUMP_BACKWARD_IF_TRUE] = POP_JUMP_BACKWARD_IF_TRUE, + [POP_JUMP_FORWARD_IF_FALSE] = POP_JUMP_FORWARD_IF_FALSE, + [POP_JUMP_FORWARD_IF_NONE] = POP_JUMP_FORWARD_IF_NONE, + [POP_JUMP_FORWARD_IF_NOT_NONE] = POP_JUMP_FORWARD_IF_NOT_NONE, + [POP_JUMP_FORWARD_IF_TRUE] = POP_JUMP_FORWARD_IF_TRUE, + [POP_TOP] = POP_TOP, + [PRECALL] = PRECALL, + [PRECALL_ADAPTIVE] = PRECALL, + [PRECALL_BOUND_METHOD] = PRECALL, + [PRECALL_BUILTIN_CLASS] = PRECALL, + [PRECALL_BUILTIN_FAST_WITH_KEYWORDS] = PRECALL, + [PRECALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS] = PRECALL, + [PRECALL_NO_KW_BUILTIN_FAST] = PRECALL, + [PRECALL_NO_KW_BUILTIN_O] = PRECALL, + [PRECALL_NO_KW_ISINSTANCE] = PRECALL, + [PRECALL_NO_KW_LEN] = PRECALL, + [PRECALL_NO_KW_LIST_APPEND] = PRECALL, + [PRECALL_NO_KW_METHOD_DESCRIPTOR_FAST] = PRECALL, + [PRECALL_NO_KW_METHOD_DESCRIPTOR_NOARGS] = PRECALL, + [PRECALL_NO_KW_METHOD_DESCRIPTOR_O] = PRECALL, + [PRECALL_NO_KW_STR_1] = PRECALL, + [PRECALL_NO_KW_TUPLE_1] = PRECALL, + [PRECALL_NO_KW_TYPE_1] = PRECALL, + [PRECALL_PYFUNC] = PRECALL, + [PREP_RERAISE_STAR] = PREP_RERAISE_STAR, + [PRINT_EXPR] = PRINT_EXPR, + [PUSH_EXC_INFO] = PUSH_EXC_INFO, + [PUSH_NULL] = PUSH_NULL, + [RAISE_VARARGS] = RAISE_VARARGS, + [RERAISE] = RERAISE, + [RESUME] = RESUME, + [RESUME_QUICK] = RESUME, + [RETURN_GENERATOR] = RETURN_GENERATOR, + [RETURN_VALUE] = RETURN_VALUE, + [SEND] = SEND, + [SETUP_ANNOTATIONS] = SETUP_ANNOTATIONS, + [SET_ADD] = SET_ADD, + [SET_UPDATE] = SET_UPDATE, + [STORE_ATTR] = STORE_ATTR, + [STORE_ATTR_ADAPTIVE] = STORE_ATTR, + [STORE_ATTR_INSTANCE_VALUE] = STORE_ATTR, + [STORE_ATTR_SLOT] = STORE_ATTR, + [STORE_ATTR_WITH_HINT] = STORE_ATTR, + [STORE_DEREF] = STORE_DEREF, + [STORE_FAST] = STORE_FAST, + [STORE_FAST__LOAD_FAST] = STORE_FAST, + [STORE_FAST__STORE_FAST] = STORE_FAST, + [STORE_GLOBAL] = STORE_GLOBAL, + [STORE_NAME] = STORE_NAME, + [STORE_SUBSCR] = STORE_SUBSCR, + [STORE_SUBSCR_ADAPTIVE] = STORE_SUBSCR, + [STORE_SUBSCR_DICT] = STORE_SUBSCR, + [STORE_SUBSCR_LIST_INT] = STORE_SUBSCR, + [SWAP] = SWAP, + [UNARY_INVERT] = UNARY_INVERT, + [UNARY_NEGATIVE] = UNARY_NEGATIVE, + [UNARY_NOT] = UNARY_NOT, + [UNARY_POSITIVE] = UNARY_POSITIVE, + [UNPACK_EX] = UNPACK_EX, + [UNPACK_SEQUENCE] = UNPACK_SEQUENCE, + [UNPACK_SEQUENCE_ADAPTIVE] = UNPACK_SEQUENCE, + [UNPACK_SEQUENCE_LIST] = UNPACK_SEQUENCE, + [UNPACK_SEQUENCE_TUPLE] = UNPACK_SEQUENCE, + [UNPACK_SEQUENCE_TWO_TUPLE] = UNPACK_SEQUENCE, + [WITH_EXCEPT_START] = WITH_EXCEPT_START, + [YIELD_VALUE] = YIELD_VALUE, +}; +#endif // NEED_OPCODE_TABLES + +#ifdef Py_DEBUG +static const char *const _PyOpcode_OpName[256] = { + [CACHE] = "CACHE", + [POP_TOP] = "POP_TOP", + [PUSH_NULL] = "PUSH_NULL", + [BINARY_OP_ADAPTIVE] = "BINARY_OP_ADAPTIVE", + [BINARY_OP_ADD_FLOAT] = "BINARY_OP_ADD_FLOAT", + [BINARY_OP_ADD_INT] = "BINARY_OP_ADD_INT", + [BINARY_OP_ADD_UNICODE] = "BINARY_OP_ADD_UNICODE", + [BINARY_OP_INPLACE_ADD_UNICODE] = "BINARY_OP_INPLACE_ADD_UNICODE", + [BINARY_OP_MULTIPLY_FLOAT] = "BINARY_OP_MULTIPLY_FLOAT", + [NOP] = "NOP", + [UNARY_POSITIVE] = "UNARY_POSITIVE", + [UNARY_NEGATIVE] = "UNARY_NEGATIVE", + [UNARY_NOT] = "UNARY_NOT", + [BINARY_OP_MULTIPLY_INT] = "BINARY_OP_MULTIPLY_INT", + [BINARY_OP_SUBTRACT_FLOAT] = "BINARY_OP_SUBTRACT_FLOAT", + [UNARY_INVERT] = "UNARY_INVERT", + [BINARY_OP_SUBTRACT_INT] = "BINARY_OP_SUBTRACT_INT", + [BINARY_SUBSCR_ADAPTIVE] = "BINARY_SUBSCR_ADAPTIVE", + [BINARY_SUBSCR_DICT] = "BINARY_SUBSCR_DICT", + [BINARY_SUBSCR_GETITEM] = "BINARY_SUBSCR_GETITEM", + [BINARY_SUBSCR_LIST_INT] = "BINARY_SUBSCR_LIST_INT", + [BINARY_SUBSCR_TUPLE_INT] = "BINARY_SUBSCR_TUPLE_INT", + [CALL_ADAPTIVE] = "CALL_ADAPTIVE", + [CALL_PY_EXACT_ARGS] = "CALL_PY_EXACT_ARGS", + [CALL_PY_WITH_DEFAULTS] = "CALL_PY_WITH_DEFAULTS", + [BINARY_SUBSCR] = "BINARY_SUBSCR", + [COMPARE_OP_ADAPTIVE] = "COMPARE_OP_ADAPTIVE", + [COMPARE_OP_FLOAT_JUMP] = "COMPARE_OP_FLOAT_JUMP", + [COMPARE_OP_INT_JUMP] = "COMPARE_OP_INT_JUMP", + [COMPARE_OP_STR_JUMP] = "COMPARE_OP_STR_JUMP", + [GET_LEN] = "GET_LEN", + [MATCH_MAPPING] = "MATCH_MAPPING", + [MATCH_SEQUENCE] = "MATCH_SEQUENCE", + [MATCH_KEYS] = "MATCH_KEYS", + [EXTENDED_ARG_QUICK] = "EXTENDED_ARG_QUICK", + [PUSH_EXC_INFO] = "PUSH_EXC_INFO", + [CHECK_EXC_MATCH] = "CHECK_EXC_MATCH", + [CHECK_EG_MATCH] = "CHECK_EG_MATCH", + [JUMP_BACKWARD_QUICK] = "JUMP_BACKWARD_QUICK", + [LOAD_ATTR_ADAPTIVE] = "LOAD_ATTR_ADAPTIVE", + [LOAD_ATTR_INSTANCE_VALUE] = "LOAD_ATTR_INSTANCE_VALUE", + [LOAD_ATTR_MODULE] = "LOAD_ATTR_MODULE", + [LOAD_ATTR_SLOT] = "LOAD_ATTR_SLOT", + [LOAD_ATTR_WITH_HINT] = "LOAD_ATTR_WITH_HINT", + [LOAD_CONST__LOAD_FAST] = "LOAD_CONST__LOAD_FAST", + [LOAD_FAST__LOAD_CONST] = "LOAD_FAST__LOAD_CONST", + [LOAD_FAST__LOAD_FAST] = "LOAD_FAST__LOAD_FAST", + [LOAD_GLOBAL_ADAPTIVE] = "LOAD_GLOBAL_ADAPTIVE", + [LOAD_GLOBAL_BUILTIN] = "LOAD_GLOBAL_BUILTIN", + [WITH_EXCEPT_START] = "WITH_EXCEPT_START", + [GET_AITER] = "GET_AITER", + [GET_ANEXT] = "GET_ANEXT", + [BEFORE_ASYNC_WITH] = "BEFORE_ASYNC_WITH", + [BEFORE_WITH] = "BEFORE_WITH", + [END_ASYNC_FOR] = "END_ASYNC_FOR", + [LOAD_GLOBAL_MODULE] = "LOAD_GLOBAL_MODULE", + [LOAD_METHOD_ADAPTIVE] = "LOAD_METHOD_ADAPTIVE", + [LOAD_METHOD_CLASS] = "LOAD_METHOD_CLASS", + [LOAD_METHOD_MODULE] = "LOAD_METHOD_MODULE", + [LOAD_METHOD_NO_DICT] = "LOAD_METHOD_NO_DICT", + [STORE_SUBSCR] = "STORE_SUBSCR", + [DELETE_SUBSCR] = "DELETE_SUBSCR", + [LOAD_METHOD_WITH_DICT] = "LOAD_METHOD_WITH_DICT", + [LOAD_METHOD_WITH_VALUES] = "LOAD_METHOD_WITH_VALUES", + [PRECALL_ADAPTIVE] = "PRECALL_ADAPTIVE", + [PRECALL_BOUND_METHOD] = "PRECALL_BOUND_METHOD", + [PRECALL_BUILTIN_CLASS] = "PRECALL_BUILTIN_CLASS", + [PRECALL_BUILTIN_FAST_WITH_KEYWORDS] = "PRECALL_BUILTIN_FAST_WITH_KEYWORDS", + [GET_ITER] = "GET_ITER", + [GET_YIELD_FROM_ITER] = "GET_YIELD_FROM_ITER", + [PRINT_EXPR] = "PRINT_EXPR", + [LOAD_BUILD_CLASS] = "LOAD_BUILD_CLASS", + [PRECALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS] = "PRECALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS", + [PRECALL_NO_KW_BUILTIN_FAST] = "PRECALL_NO_KW_BUILTIN_FAST", + [LOAD_ASSERTION_ERROR] = "LOAD_ASSERTION_ERROR", + [RETURN_GENERATOR] = "RETURN_GENERATOR", + [PRECALL_NO_KW_BUILTIN_O] = "PRECALL_NO_KW_BUILTIN_O", + [PRECALL_NO_KW_ISINSTANCE] = "PRECALL_NO_KW_ISINSTANCE", + [PRECALL_NO_KW_LEN] = "PRECALL_NO_KW_LEN", + [PRECALL_NO_KW_LIST_APPEND] = "PRECALL_NO_KW_LIST_APPEND", + [PRECALL_NO_KW_METHOD_DESCRIPTOR_FAST] = "PRECALL_NO_KW_METHOD_DESCRIPTOR_FAST", + [PRECALL_NO_KW_METHOD_DESCRIPTOR_NOARGS] = "PRECALL_NO_KW_METHOD_DESCRIPTOR_NOARGS", + [LIST_TO_TUPLE] = "LIST_TO_TUPLE", + [RETURN_VALUE] = "RETURN_VALUE", + [IMPORT_STAR] = "IMPORT_STAR", + [SETUP_ANNOTATIONS] = "SETUP_ANNOTATIONS", + [YIELD_VALUE] = "YIELD_VALUE", + [ASYNC_GEN_WRAP] = "ASYNC_GEN_WRAP", + [PREP_RERAISE_STAR] = "PREP_RERAISE_STAR", + [POP_EXCEPT] = "POP_EXCEPT", + [STORE_NAME] = "STORE_NAME", + [DELETE_NAME] = "DELETE_NAME", + [UNPACK_SEQUENCE] = "UNPACK_SEQUENCE", + [FOR_ITER] = "FOR_ITER", + [UNPACK_EX] = "UNPACK_EX", + [STORE_ATTR] = "STORE_ATTR", + [DELETE_ATTR] = "DELETE_ATTR", + [STORE_GLOBAL] = "STORE_GLOBAL", + [DELETE_GLOBAL] = "DELETE_GLOBAL", + [SWAP] = "SWAP", + [LOAD_CONST] = "LOAD_CONST", + [LOAD_NAME] = "LOAD_NAME", + [BUILD_TUPLE] = "BUILD_TUPLE", + [BUILD_LIST] = "BUILD_LIST", + [BUILD_SET] = "BUILD_SET", + [BUILD_MAP] = "BUILD_MAP", + [LOAD_ATTR] = "LOAD_ATTR", + [COMPARE_OP] = "COMPARE_OP", + [IMPORT_NAME] = "IMPORT_NAME", + [IMPORT_FROM] = "IMPORT_FROM", + [JUMP_FORWARD] = "JUMP_FORWARD", + [JUMP_IF_FALSE_OR_POP] = "JUMP_IF_FALSE_OR_POP", + [JUMP_IF_TRUE_OR_POP] = "JUMP_IF_TRUE_OR_POP", + [PRECALL_NO_KW_METHOD_DESCRIPTOR_O] = "PRECALL_NO_KW_METHOD_DESCRIPTOR_O", + [POP_JUMP_FORWARD_IF_FALSE] = "POP_JUMP_FORWARD_IF_FALSE", + [POP_JUMP_FORWARD_IF_TRUE] = "POP_JUMP_FORWARD_IF_TRUE", + [LOAD_GLOBAL] = "LOAD_GLOBAL", + [IS_OP] = "IS_OP", + [CONTAINS_OP] = "CONTAINS_OP", + [RERAISE] = "RERAISE", + [COPY] = "COPY", + [PRECALL_NO_KW_STR_1] = "PRECALL_NO_KW_STR_1", + [BINARY_OP] = "BINARY_OP", + [SEND] = "SEND", + [LOAD_FAST] = "LOAD_FAST", + [STORE_FAST] = "STORE_FAST", + [DELETE_FAST] = "DELETE_FAST", + [PRECALL_NO_KW_TUPLE_1] = "PRECALL_NO_KW_TUPLE_1", + [POP_JUMP_FORWARD_IF_NOT_NONE] = "POP_JUMP_FORWARD_IF_NOT_NONE", + [POP_JUMP_FORWARD_IF_NONE] = "POP_JUMP_FORWARD_IF_NONE", + [RAISE_VARARGS] = "RAISE_VARARGS", + [GET_AWAITABLE] = "GET_AWAITABLE", + [MAKE_FUNCTION] = "MAKE_FUNCTION", + [BUILD_SLICE] = "BUILD_SLICE", + [JUMP_BACKWARD_NO_INTERRUPT] = "JUMP_BACKWARD_NO_INTERRUPT", + [MAKE_CELL] = "MAKE_CELL", + [LOAD_CLOSURE] = "LOAD_CLOSURE", + [LOAD_DEREF] = "LOAD_DEREF", + [STORE_DEREF] = "STORE_DEREF", + [DELETE_DEREF] = "DELETE_DEREF", + [JUMP_BACKWARD] = "JUMP_BACKWARD", + [PRECALL_NO_KW_TYPE_1] = "PRECALL_NO_KW_TYPE_1", + [CALL_FUNCTION_EX] = "CALL_FUNCTION_EX", + [PRECALL_PYFUNC] = "PRECALL_PYFUNC", + [EXTENDED_ARG] = "EXTENDED_ARG", + [LIST_APPEND] = "LIST_APPEND", + [SET_ADD] = "SET_ADD", + [MAP_ADD] = "MAP_ADD", + [LOAD_CLASSDEREF] = "LOAD_CLASSDEREF", + [COPY_FREE_VARS] = "COPY_FREE_VARS", + [RESUME_QUICK] = "RESUME_QUICK", + [RESUME] = "RESUME", + [MATCH_CLASS] = "MATCH_CLASS", + [STORE_ATTR_ADAPTIVE] = "STORE_ATTR_ADAPTIVE", + [STORE_ATTR_INSTANCE_VALUE] = "STORE_ATTR_INSTANCE_VALUE", + [FORMAT_VALUE] = "FORMAT_VALUE", + [BUILD_CONST_KEY_MAP] = "BUILD_CONST_KEY_MAP", + [BUILD_STRING] = "BUILD_STRING", + [STORE_ATTR_SLOT] = "STORE_ATTR_SLOT", + [STORE_ATTR_WITH_HINT] = "STORE_ATTR_WITH_HINT", + [LOAD_METHOD] = "LOAD_METHOD", + [STORE_FAST__LOAD_FAST] = "STORE_FAST__LOAD_FAST", + [LIST_EXTEND] = "LIST_EXTEND", + [SET_UPDATE] = "SET_UPDATE", + [DICT_MERGE] = "DICT_MERGE", + [DICT_UPDATE] = "DICT_UPDATE", + [PRECALL] = "PRECALL", + [STORE_FAST__STORE_FAST] = "STORE_FAST__STORE_FAST", + [STORE_SUBSCR_ADAPTIVE] = "STORE_SUBSCR_ADAPTIVE", + [STORE_SUBSCR_DICT] = "STORE_SUBSCR_DICT", + [STORE_SUBSCR_LIST_INT] = "STORE_SUBSCR_LIST_INT", + [CALL] = "CALL", + [KW_NAMES] = "KW_NAMES", + [POP_JUMP_BACKWARD_IF_NOT_NONE] = "POP_JUMP_BACKWARD_IF_NOT_NONE", + [POP_JUMP_BACKWARD_IF_NONE] = "POP_JUMP_BACKWARD_IF_NONE", + [POP_JUMP_BACKWARD_IF_FALSE] = "POP_JUMP_BACKWARD_IF_FALSE", + [POP_JUMP_BACKWARD_IF_TRUE] = "POP_JUMP_BACKWARD_IF_TRUE", + [UNPACK_SEQUENCE_ADAPTIVE] = "UNPACK_SEQUENCE_ADAPTIVE", + [UNPACK_SEQUENCE_LIST] = "UNPACK_SEQUENCE_LIST", + [UNPACK_SEQUENCE_TUPLE] = "UNPACK_SEQUENCE_TUPLE", + [UNPACK_SEQUENCE_TWO_TUPLE] = "UNPACK_SEQUENCE_TWO_TUPLE", + [181] = "<181>", + [182] = "<182>", + [183] = "<183>", + [184] = "<184>", + [185] = "<185>", + [186] = "<186>", + [187] = "<187>", + [188] = "<188>", + [189] = "<189>", + [190] = "<190>", + [191] = "<191>", + [192] = "<192>", + [193] = "<193>", + [194] = "<194>", + [195] = "<195>", + [196] = "<196>", + [197] = "<197>", + [198] = "<198>", + [199] = "<199>", + [200] = "<200>", + [201] = "<201>", + [202] = "<202>", + [203] = "<203>", + [204] = "<204>", + [205] = "<205>", + [206] = "<206>", + [207] = "<207>", + [208] = "<208>", + [209] = "<209>", + [210] = "<210>", + [211] = "<211>", + [212] = "<212>", + [213] = "<213>", + [214] = "<214>", + [215] = "<215>", + [216] = "<216>", + [217] = "<217>", + [218] = "<218>", + [219] = "<219>", + [220] = "<220>", + [221] = "<221>", + [222] = "<222>", + [223] = "<223>", + [224] = "<224>", + [225] = "<225>", + [226] = "<226>", + [227] = "<227>", + [228] = "<228>", + [229] = "<229>", + [230] = "<230>", + [231] = "<231>", + [232] = "<232>", + [233] = "<233>", + [234] = "<234>", + [235] = "<235>", + [236] = "<236>", + [237] = "<237>", + [238] = "<238>", + [239] = "<239>", + [240] = "<240>", + [241] = "<241>", + [242] = "<242>", + [243] = "<243>", + [244] = "<244>", + [245] = "<245>", + [246] = "<246>", + [247] = "<247>", + [248] = "<248>", + [249] = "<249>", + [250] = "<250>", + [251] = "<251>", + [252] = "<252>", + [253] = "<253>", + [254] = "<254>", + [DO_TRACING] = "DO_TRACING", +}; +#endif + +#define EXTRA_CASES \ + case 181: \ + case 182: \ + case 183: \ + case 184: \ + case 185: \ + case 186: \ + case 187: \ + case 188: \ + case 189: \ + case 190: \ + case 191: \ + case 192: \ + case 193: \ + case 194: \ + case 195: \ + case 196: \ + case 197: \ + case 198: \ + case 199: \ + case 200: \ + case 201: \ + case 202: \ + case 203: \ + case 204: \ + case 205: \ + case 206: \ + case 207: \ + case 208: \ + case 209: \ + case 210: \ + case 211: \ + case 212: \ + case 213: \ + case 214: \ + case 215: \ + case 216: \ + case 217: \ + case 218: \ + case 219: \ + case 220: \ + case 221: \ + case 222: \ + case 223: \ + case 224: \ + case 225: \ + case 226: \ + case 227: \ + case 228: \ + case 229: \ + case 230: \ + case 231: \ + case 232: \ + case 233: \ + case 234: \ + case 235: \ + case 236: \ + case 237: \ + case 238: \ + case 239: \ + case 240: \ + case 241: \ + case 242: \ + case 243: \ + case 244: \ + case 245: \ + case 246: \ + case 247: \ + case 248: \ + case 249: \ + case 250: \ + case 251: \ + case 252: \ + case 253: \ + case 254: \ + ; + +#ifdef __cplusplus +} +#endif +#endif // !Py_INTERNAL_OPCODE_H diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_parser.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_parser.h new file mode 100644 index 0000000000000000000000000000000000000000..e2de24e2ca973411fca1692ffe8abc30a0ff7615 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_parser.h @@ -0,0 +1,31 @@ +#ifndef Py_INTERNAL_PARSER_H +#define Py_INTERNAL_PARSER_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +extern struct _mod* _PyParser_ASTFromString( + const char *str, + PyObject* filename, + int mode, + PyCompilerFlags *flags, + PyArena *arena); +extern struct _mod* _PyParser_ASTFromFile( + FILE *fp, + PyObject *filename_ob, + const char *enc, + int mode, + const char *ps1, + const char *ps2, + PyCompilerFlags *flags, + int *errcode, + PyArena *arena); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_PARSER_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_pathconfig.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_pathconfig.h new file mode 100644 index 0000000000000000000000000000000000000000..b8deaa0c3eb067b14f2bb2bcca40f5fd960feb06 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_pathconfig.h @@ -0,0 +1,24 @@ +#ifndef Py_INTERNAL_PATHCONFIG_H +#define Py_INTERNAL_PATHCONFIG_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +PyAPI_FUNC(void) _PyPathConfig_ClearGlobal(void); +extern PyStatus _PyPathConfig_ReadGlobal(PyConfig *config); +extern PyStatus _PyPathConfig_UpdateGlobal(const PyConfig *config); +extern const wchar_t * _PyPathConfig_GetGlobalModuleSearchPath(void); + +extern int _PyPathConfig_ComputeSysPath0( + const PyWideStringList *argv, + PyObject **path0); + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_PATHCONFIG_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_pyarena.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_pyarena.h new file mode 100644 index 0000000000000000000000000000000000000000..d78972a88ca238de67de2835762f9f5a851ab53a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_pyarena.h @@ -0,0 +1,64 @@ +/* An arena-like memory interface for the compiler. + */ + +#ifndef Py_INTERNAL_PYARENA_H +#define Py_INTERNAL_PYARENA_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +typedef struct _arena PyArena; + +/* _PyArena_New() and _PyArena_Free() create a new arena and free it, + respectively. Once an arena has been created, it can be used + to allocate memory via _PyArena_Malloc(). Pointers to PyObject can + also be registered with the arena via _PyArena_AddPyObject(), and the + arena will ensure that the PyObjects stay alive at least until + _PyArena_Free() is called. When an arena is freed, all the memory it + allocated is freed, the arena releases internal references to registered + PyObject*, and none of its pointers are valid. + XXX (tim) What does "none of its pointers are valid" mean? Does it + XXX mean that pointers previously obtained via _PyArena_Malloc() are + XXX no longer valid? (That's clearly true, but not sure that's what + XXX the text is trying to say.) + + _PyArena_New() returns an arena pointer. On error, it + returns a negative number and sets an exception. + XXX (tim): Not true. On error, _PyArena_New() actually returns NULL, + XXX and looks like it may or may not set an exception (e.g., if the + XXX internal PyList_New(0) returns NULL, _PyArena_New() passes that on + XXX and an exception is set; OTOH, if the internal + XXX block_new(DEFAULT_BLOCK_SIZE) returns NULL, that's passed on but + XXX an exception is not set in that case). +*/ +PyAPI_FUNC(PyArena*) _PyArena_New(void); +PyAPI_FUNC(void) _PyArena_Free(PyArena *); + +/* Mostly like malloc(), return the address of a block of memory spanning + * `size` bytes, or return NULL (without setting an exception) if enough + * new memory can't be obtained. Unlike malloc(0), _PyArena_Malloc() with + * size=0 does not guarantee to return a unique pointer (the pointer + * returned may equal one or more other pointers obtained from + * _PyArena_Malloc()). + * Note that pointers obtained via _PyArena_Malloc() must never be passed to + * the system free() or realloc(), or to any of Python's similar memory- + * management functions. _PyArena_Malloc()-obtained pointers remain valid + * until _PyArena_Free(ar) is called, at which point all pointers obtained + * from the arena `ar` become invalid simultaneously. + */ +PyAPI_FUNC(void*) _PyArena_Malloc(PyArena *, size_t size); + +/* This routine isn't a proper arena allocation routine. It takes + * a PyObject* and records it so that it can be DECREFed when the + * arena is freed. + */ +PyAPI_FUNC(int) _PyArena_AddPyObject(PyArena *, PyObject *); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_PYARENA_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_pyerrors.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_pyerrors.h new file mode 100644 index 0000000000000000000000000000000000000000..66f37942ef916afed58499e7593fb0338e281fa2 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_pyerrors.h @@ -0,0 +1,106 @@ +#ifndef Py_INTERNAL_PYERRORS_H +#define Py_INTERNAL_PYERRORS_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + + +/* runtime lifecycle */ + +extern PyStatus _PyErr_InitTypes(PyInterpreterState *); +extern void _PyErr_FiniTypes(PyInterpreterState *); + + +/* other API */ + +static inline PyObject* _PyErr_Occurred(PyThreadState *tstate) +{ + assert(tstate != NULL); + return tstate->curexc_type; +} + +static inline void _PyErr_ClearExcState(_PyErr_StackItem *exc_state) +{ + Py_CLEAR(exc_state->exc_value); +} + +PyAPI_FUNC(PyObject*) _PyErr_StackItemToExcInfoTuple( + _PyErr_StackItem *err_info); + +PyAPI_FUNC(void) _PyErr_Fetch( + PyThreadState *tstate, + PyObject **type, + PyObject **value, + PyObject **traceback); + +PyAPI_FUNC(int) _PyErr_ExceptionMatches( + PyThreadState *tstate, + PyObject *exc); + +PyAPI_FUNC(void) _PyErr_Restore( + PyThreadState *tstate, + PyObject *type, + PyObject *value, + PyObject *traceback); + +PyAPI_FUNC(void) _PyErr_SetObject( + PyThreadState *tstate, + PyObject *type, + PyObject *value); + +PyAPI_FUNC(void) _PyErr_ChainStackItem( + _PyErr_StackItem *exc_info); + +PyAPI_FUNC(void) _PyErr_Clear(PyThreadState *tstate); + +PyAPI_FUNC(void) _PyErr_SetNone(PyThreadState *tstate, PyObject *exception); + +PyAPI_FUNC(PyObject *) _PyErr_NoMemory(PyThreadState *tstate); + +PyAPI_FUNC(void) _PyErr_SetString( + PyThreadState *tstate, + PyObject *exception, + const char *string); + +PyAPI_FUNC(PyObject *) _PyErr_Format( + PyThreadState *tstate, + PyObject *exception, + const char *format, + ...); + +PyAPI_FUNC(void) _PyErr_NormalizeException( + PyThreadState *tstate, + PyObject **exc, + PyObject **val, + PyObject **tb); + +PyAPI_FUNC(PyObject *) _PyErr_FormatFromCauseTstate( + PyThreadState *tstate, + PyObject *exception, + const char *format, + ...); + +PyAPI_FUNC(PyObject *) _PyExc_CreateExceptionGroup( + const char *msg, + PyObject *excs); + +PyAPI_FUNC(PyObject *) _PyExc_PrepReraiseStar( + PyObject *orig, + PyObject *excs); + +PyAPI_FUNC(int) _PyErr_CheckSignalsTstate(PyThreadState *tstate); + +PyAPI_FUNC(void) _Py_DumpExtensionModules(int fd, PyInterpreterState *interp); + +extern PyObject* _Py_Offer_Suggestions(PyObject* exception); +PyAPI_FUNC(Py_ssize_t) _Py_UTF8_Edit_Cost(PyObject *str_a, PyObject *str_b, + Py_ssize_t max_cost); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_PYERRORS_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_pyhash.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_pyhash.h new file mode 100644 index 0000000000000000000000000000000000000000..a229f8d8b7f0a2ab0bf9120fcc301cc5c74594c8 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_pyhash.h @@ -0,0 +1,10 @@ +#ifndef Py_INTERNAL_HASH_H +#define Py_INTERNAL_HASH_H + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +uint64_t _Py_KeyedHash(uint64_t, const char *, Py_ssize_t); + +#endif diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_pylifecycle.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_pylifecycle.h new file mode 100644 index 0000000000000000000000000000000000000000..b4718b8ade2354aabad2ee075a4ccb9fe4cb47b2 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_pylifecycle.h @@ -0,0 +1,103 @@ +#ifndef Py_INTERNAL_LIFECYCLE_H +#define Py_INTERNAL_LIFECYCLE_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_runtime.h" // _PyRuntimeState + +/* Forward declarations */ +struct _PyArgv; +struct pyruntimestate; + +/* True if the main interpreter thread exited due to an unhandled + * KeyboardInterrupt exception, suggesting the user pressed ^C. */ +PyAPI_DATA(int) _Py_UnhandledKeyboardInterrupt; + +extern int _Py_SetFileSystemEncoding( + const char *encoding, + const char *errors); +extern void _Py_ClearFileSystemEncoding(void); +extern PyStatus _PyUnicode_InitEncodings(PyThreadState *tstate); +#ifdef MS_WINDOWS +extern int _PyUnicode_EnableLegacyWindowsFSEncoding(void); +#endif + +PyAPI_FUNC(void) _Py_ClearStandardStreamEncoding(void); + +PyAPI_FUNC(int) _Py_IsLocaleCoercionTarget(const char *ctype_loc); + +/* Various one-time initializers */ + +extern PyStatus _PyFaulthandler_Init(int enable); +extern int _PyTraceMalloc_Init(int enable); +extern PyObject * _PyBuiltin_Init(PyInterpreterState *interp); +extern PyStatus _PySys_Create( + PyThreadState *tstate, + PyObject **sysmod_p); +extern PyStatus _PySys_ReadPreinitWarnOptions(PyWideStringList *options); +extern PyStatus _PySys_ReadPreinitXOptions(PyConfig *config); +extern int _PySys_UpdateConfig(PyThreadState *tstate); +extern void _PySys_Fini(PyInterpreterState *interp); +extern int _PyBuiltins_AddExceptions(PyObject * bltinmod); +extern PyStatus _Py_HashRandomization_Init(const PyConfig *); + +extern PyStatus _PyImportZip_Init(PyThreadState *tstate); +extern PyStatus _PyGC_Init(PyInterpreterState *interp); +extern PyStatus _PyAtExit_Init(PyInterpreterState *interp); +extern int _Py_Deepfreeze_Init(void); + +/* Various internal finalizers */ + +extern int _PySignal_Init(int install_signal_handlers); +extern void _PySignal_Fini(void); + +extern void _PyImport_Fini(void); +extern void _PyImport_Fini2(void); +extern void _PyGC_Fini(PyInterpreterState *interp); +extern void _Py_HashRandomization_Fini(void); +extern void _PyFaulthandler_Fini(void); +extern void _PyHash_Fini(void); +extern void _PyTraceMalloc_Fini(void); +extern void _PyWarnings_Fini(PyInterpreterState *interp); +extern void _PyAST_Fini(PyInterpreterState *interp); +extern void _PyAtExit_Fini(PyInterpreterState *interp); +extern void _PyThread_FiniType(PyInterpreterState *interp); +extern void _Py_Deepfreeze_Fini(void); +extern void _PyArg_Fini(void); + +extern PyStatus _PyGILState_Init(_PyRuntimeState *runtime); +extern PyStatus _PyGILState_SetTstate(PyThreadState *tstate); +extern void _PyGILState_Fini(PyInterpreterState *interp); + +PyAPI_FUNC(void) _PyGC_DumpShutdownStats(PyInterpreterState *interp); + +PyAPI_FUNC(PyStatus) _Py_PreInitializeFromPyArgv( + const PyPreConfig *src_config, + const struct _PyArgv *args); +PyAPI_FUNC(PyStatus) _Py_PreInitializeFromConfig( + const PyConfig *config, + const struct _PyArgv *args); + +PyAPI_FUNC(wchar_t *) _Py_GetStdlibDir(void); + +PyAPI_FUNC(int) _Py_HandleSystemExit(int *exitcode_p); + +PyAPI_FUNC(PyObject*) _PyErr_WriteUnraisableDefaultHook(PyObject *unraisable); + +PyAPI_FUNC(void) _PyErr_Print(PyThreadState *tstate); +PyAPI_FUNC(void) _PyErr_Display(PyObject *file, PyObject *exception, + PyObject *value, PyObject *tb); + +PyAPI_FUNC(void) _PyThreadState_DeleteCurrent(PyThreadState *tstate); + +extern void _PyAtExit_Call(PyInterpreterState *interp); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_LIFECYCLE_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_pymath.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_pymath.h new file mode 100644 index 0000000000000000000000000000000000000000..5c6aee2a23890b5bbc73afb281f06f2eb5a68191 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_pymath.h @@ -0,0 +1,224 @@ +#ifndef Py_INTERNAL_PYMATH_H +#define Py_INTERNAL_PYMATH_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + + +/* _Py_ADJUST_ERANGE1(x) + * _Py_ADJUST_ERANGE2(x, y) + * Set errno to 0 before calling a libm function, and invoke one of these + * macros after, passing the function result(s) (_Py_ADJUST_ERANGE2 is useful + * for functions returning complex results). This makes two kinds of + * adjustments to errno: (A) If it looks like the platform libm set + * errno=ERANGE due to underflow, clear errno. (B) If it looks like the + * platform libm overflowed but didn't set errno, force errno to ERANGE. In + * effect, we're trying to force a useful implementation of C89 errno + * behavior. + * Caution: + * This isn't reliable. C99 no longer requires libm to set errno under + * any exceptional condition, but does require +- HUGE_VAL return + * values on overflow. A 754 box *probably* maps HUGE_VAL to a + * double infinity, and we're cool if that's so, unless the input + * was an infinity and an infinity is the expected result. A C89 + * system sets errno to ERANGE, so we check for that too. We're + * out of luck if a C99 754 box doesn't map HUGE_VAL to +Inf, or + * if the returned result is a NaN, or if a C89 box returns HUGE_VAL + * in non-overflow cases. + */ +static inline void _Py_ADJUST_ERANGE1(double x) +{ + if (errno == 0) { + if (x == Py_HUGE_VAL || x == -Py_HUGE_VAL) { + errno = ERANGE; + } + } + else if (errno == ERANGE && x == 0.0) { + errno = 0; + } +} + +static inline void _Py_ADJUST_ERANGE2(double x, double y) +{ + if (x == Py_HUGE_VAL || x == -Py_HUGE_VAL || + y == Py_HUGE_VAL || y == -Py_HUGE_VAL) + { + if (errno == 0) { + errno = ERANGE; + } + } + else if (errno == ERANGE) { + errno = 0; + } +} + +// Return whether integral type *type* is signed or not. +#define _Py_IntegralTypeSigned(type) \ + ((type)(-1) < 0) + +// Return the maximum value of integral type *type*. +#define _Py_IntegralTypeMax(type) \ + ((_Py_IntegralTypeSigned(type)) ? (((((type)1 << (sizeof(type)*CHAR_BIT - 2)) - 1) << 1) + 1) : ~(type)0) + +// Return the minimum value of integral type *type*. +#define _Py_IntegralTypeMin(type) \ + ((_Py_IntegralTypeSigned(type)) ? -_Py_IntegralTypeMax(type) - 1 : 0) + +// Check whether *v* is in the range of integral type *type*. This is most +// useful if *v* is floating-point, since demoting a floating-point *v* to an +// integral type that cannot represent *v*'s integral part is undefined +// behavior. +#define _Py_InIntegralTypeRange(type, v) \ + (_Py_IntegralTypeMin(type) <= v && v <= _Py_IntegralTypeMax(type)) + + +//--- HAVE_PY_SET_53BIT_PRECISION macro ------------------------------------ +// +// The functions _Py_dg_strtod() and _Py_dg_dtoa() in Python/dtoa.c (which are +// required to support the short float repr introduced in Python 3.1) require +// that the floating-point unit that's being used for arithmetic operations on +// C doubles is set to use 53-bit precision. It also requires that the FPU +// rounding mode is round-half-to-even, but that's less often an issue. +// +// If your FPU isn't already set to 53-bit precision/round-half-to-even, and +// you want to make use of _Py_dg_strtod() and _Py_dg_dtoa(), then you should: +// +// #define HAVE_PY_SET_53BIT_PRECISION 1 +// +// and also give appropriate definitions for the following three macros: +// +// * _Py_SET_53BIT_PRECISION_HEADER: any variable declarations needed to +// use the two macros below. +// * _Py_SET_53BIT_PRECISION_START: store original FPU settings, and +// set FPU to 53-bit precision/round-half-to-even +// * _Py_SET_53BIT_PRECISION_END: restore original FPU settings +// +// The macros are designed to be used within a single C function: see +// Python/pystrtod.c for an example of their use. + + +// Get and set x87 control word for gcc/x86 +#ifdef HAVE_GCC_ASM_FOR_X87 +#define HAVE_PY_SET_53BIT_PRECISION 1 + +// Functions defined in Python/pymath.c +extern unsigned short _Py_get_387controlword(void); +extern void _Py_set_387controlword(unsigned short); + +#define _Py_SET_53BIT_PRECISION_HEADER \ + unsigned short old_387controlword, new_387controlword +#define _Py_SET_53BIT_PRECISION_START \ + do { \ + old_387controlword = _Py_get_387controlword(); \ + new_387controlword = (old_387controlword & ~0x0f00) | 0x0200; \ + if (new_387controlword != old_387controlword) { \ + _Py_set_387controlword(new_387controlword); \ + } \ + } while (0) +#define _Py_SET_53BIT_PRECISION_END \ + do { \ + if (new_387controlword != old_387controlword) { \ + _Py_set_387controlword(old_387controlword); \ + } \ + } while (0) +#endif + +// Get and set x87 control word for VisualStudio/x86. +// x87 is not supported in 64-bit or ARM. +#if defined(_MSC_VER) && !defined(_WIN64) && !defined(_M_ARM) +#define HAVE_PY_SET_53BIT_PRECISION 1 + +#include // __control87_2() + +#define _Py_SET_53BIT_PRECISION_HEADER \ + unsigned int old_387controlword, new_387controlword, out_387controlword + // We use the __control87_2 function to set only the x87 control word. + // The SSE control word is unaffected. +#define _Py_SET_53BIT_PRECISION_START \ + do { \ + __control87_2(0, 0, &old_387controlword, NULL); \ + new_387controlword = \ + (old_387controlword & ~(_MCW_PC | _MCW_RC)) | (_PC_53 | _RC_NEAR); \ + if (new_387controlword != old_387controlword) { \ + __control87_2(new_387controlword, _MCW_PC | _MCW_RC, \ + &out_387controlword, NULL); \ + } \ + } while (0) +#define _Py_SET_53BIT_PRECISION_END \ + do { \ + if (new_387controlword != old_387controlword) { \ + __control87_2(old_387controlword, _MCW_PC | _MCW_RC, \ + &out_387controlword, NULL); \ + } \ + } while (0) +#endif + + +// MC68881 +#ifdef HAVE_GCC_ASM_FOR_MC68881 +#define HAVE_PY_SET_53BIT_PRECISION 1 +#define _Py_SET_53BIT_PRECISION_HEADER \ + unsigned int old_fpcr, new_fpcr +#define _Py_SET_53BIT_PRECISION_START \ + do { \ + __asm__ ("fmove.l %%fpcr,%0" : "=g" (old_fpcr)); \ + /* Set double precision / round to nearest. */ \ + new_fpcr = (old_fpcr & ~0xf0) | 0x80; \ + if (new_fpcr != old_fpcr) { \ + __asm__ volatile ("fmove.l %0,%%fpcr" : : "g" (new_fpcr));\ + } \ + } while (0) +#define _Py_SET_53BIT_PRECISION_END \ + do { \ + if (new_fpcr != old_fpcr) { \ + __asm__ volatile ("fmove.l %0,%%fpcr" : : "g" (old_fpcr)); \ + } \ + } while (0) +#endif + +// Default definitions are empty +#ifndef _Py_SET_53BIT_PRECISION_HEADER +# define _Py_SET_53BIT_PRECISION_HEADER +# define _Py_SET_53BIT_PRECISION_START +# define _Py_SET_53BIT_PRECISION_END +#endif + + +//--- _PY_SHORT_FLOAT_REPR macro ------------------------------------------- + +// If we can't guarantee 53-bit precision, don't use the code +// in Python/dtoa.c, but fall back to standard code. This +// means that repr of a float will be long (17 significant digits). +// +// Realistically, there are two things that could go wrong: +// +// (1) doubles aren't IEEE 754 doubles, or +// (2) we're on x86 with the rounding precision set to 64-bits +// (extended precision), and we don't know how to change +// the rounding precision. +#if !defined(DOUBLE_IS_LITTLE_ENDIAN_IEEE754) && \ + !defined(DOUBLE_IS_BIG_ENDIAN_IEEE754) && \ + !defined(DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754) +# define _PY_SHORT_FLOAT_REPR 0 +#endif + +// Double rounding is symptomatic of use of extended precision on x86. +// If we're seeing double rounding, and we don't have any mechanism available +// for changing the FPU rounding precision, then don't use Python/dtoa.c. +#if defined(X87_DOUBLE_ROUNDING) && !defined(HAVE_PY_SET_53BIT_PRECISION) +# define _PY_SHORT_FLOAT_REPR 0 +#endif + +#ifndef _PY_SHORT_FLOAT_REPR +# define _PY_SHORT_FLOAT_REPR 1 +#endif + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_PYMATH_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_pymem.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_pymem.h new file mode 100644 index 0000000000000000000000000000000000000000..b9eea9d4b30ad16463c22afb97bafe0e12fd29cc --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_pymem.h @@ -0,0 +1,114 @@ +#ifndef Py_INTERNAL_PYMEM_H +#define Py_INTERNAL_PYMEM_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pymem.h" // PyMemAllocatorName + + +/* Set the memory allocator of the specified domain to the default. + Save the old allocator into *old_alloc if it's non-NULL. + Return on success, or return -1 if the domain is unknown. */ +PyAPI_FUNC(int) _PyMem_SetDefaultAllocator( + PyMemAllocatorDomain domain, + PyMemAllocatorEx *old_alloc); + +/* Special bytes broadcast into debug memory blocks at appropriate times. + Strings of these are unlikely to be valid addresses, floats, ints or + 7-bit ASCII. + + - PYMEM_CLEANBYTE: clean (newly allocated) memory + - PYMEM_DEADBYTE dead (newly freed) memory + - PYMEM_FORBIDDENBYTE: untouchable bytes at each end of a block + + Byte patterns 0xCB, 0xDB and 0xFB have been replaced with 0xCD, 0xDD and + 0xFD to use the same values than Windows CRT debug malloc() and free(). + If modified, _PyMem_IsPtrFreed() should be updated as well. */ +#define PYMEM_CLEANBYTE 0xCD +#define PYMEM_DEADBYTE 0xDD +#define PYMEM_FORBIDDENBYTE 0xFD + +/* Heuristic checking if a pointer value is newly allocated + (uninitialized), newly freed or NULL (is equal to zero). + + The pointer is not dereferenced, only the pointer value is checked. + + The heuristic relies on the debug hooks on Python memory allocators which + fills newly allocated memory with CLEANBYTE (0xCD) and newly freed memory + with DEADBYTE (0xDD). Detect also "untouchable bytes" marked + with FORBIDDENBYTE (0xFD). */ +static inline int _PyMem_IsPtrFreed(const void *ptr) +{ + uintptr_t value = (uintptr_t)ptr; +#if SIZEOF_VOID_P == 8 + return (value == 0 + || value == (uintptr_t)0xCDCDCDCDCDCDCDCD + || value == (uintptr_t)0xDDDDDDDDDDDDDDDD + || value == (uintptr_t)0xFDFDFDFDFDFDFDFD); +#elif SIZEOF_VOID_P == 4 + return (value == 0 + || value == (uintptr_t)0xCDCDCDCD + || value == (uintptr_t)0xDDDDDDDD + || value == (uintptr_t)0xFDFDFDFD); +#else +# error "unknown pointer size" +#endif +} + +PyAPI_FUNC(int) _PyMem_GetAllocatorName( + const char *name, + PyMemAllocatorName *allocator); + +/* Configure the Python memory allocators. + Pass PYMEM_ALLOCATOR_DEFAULT to use default allocators. + PYMEM_ALLOCATOR_NOT_SET does nothing. */ +PyAPI_FUNC(int) _PyMem_SetupAllocators(PyMemAllocatorName allocator); + +struct _PyTraceMalloc_Config { + /* Module initialized? + Variable protected by the GIL */ + enum { + TRACEMALLOC_NOT_INITIALIZED, + TRACEMALLOC_INITIALIZED, + TRACEMALLOC_FINALIZED + } initialized; + + /* Is tracemalloc tracing memory allocations? + Variable protected by the GIL */ + int tracing; + + /* limit of the number of frames in a traceback, 1 by default. + Variable protected by the GIL. */ + int max_nframe; +}; + +#define _PyTraceMalloc_Config_INIT \ + {.initialized = TRACEMALLOC_NOT_INITIALIZED, \ + .tracing = 0, \ + .max_nframe = 1} + +PyAPI_DATA(struct _PyTraceMalloc_Config) _Py_tracemalloc_config; + +/* Allocate memory directly from the O/S virtual memory system, + * where supported. Otherwise fallback on malloc */ +void *_PyObject_VirtualAlloc(size_t size); +void _PyObject_VirtualFree(void *, size_t size); + +/* This function returns the number of allocated memory blocks, regardless of size */ +PyAPI_FUNC(Py_ssize_t) _Py_GetAllocatedBlocks(void); + +/* Macros */ +#ifdef WITH_PYMALLOC +// Export the symbol for the 3rd party guppy3 project +PyAPI_FUNC(int) _PyObject_DebugMallocStats(FILE *out); +#endif + +#ifdef __cplusplus +} +#endif +#endif // !Py_INTERNAL_PYMEM_H diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_pystate.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_pystate.h new file mode 100644 index 0000000000000000000000000000000000000000..7c5aba12d5295e0cf34b4aafbc9742d98b981149 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_pystate.h @@ -0,0 +1,173 @@ +#ifndef Py_INTERNAL_PYSTATE_H +#define Py_INTERNAL_PYSTATE_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_runtime.h" /* PyRuntimeState */ + + +/* Check if the current thread is the main thread. + Use _Py_IsMainInterpreter() to check if it's the main interpreter. */ +static inline int +_Py_IsMainThread(void) +{ + unsigned long thread = PyThread_get_thread_ident(); + return (thread == _PyRuntime.main_thread); +} + + +static inline PyInterpreterState * +_PyInterpreterState_Main(void) +{ + return _PyRuntime.interpreters.main; +} + +static inline int +_Py_IsMainInterpreter(PyInterpreterState *interp) +{ + return (interp == _PyInterpreterState_Main()); +} + + +static inline const PyConfig * +_Py_GetMainConfig(void) +{ + PyInterpreterState *interp = _PyInterpreterState_Main(); + if (interp == NULL) { + return NULL; + } + return _PyInterpreterState_GetConfig(interp); +} + + +/* Only handle signals on the main thread of the main interpreter. */ +static inline int +_Py_ThreadCanHandleSignals(PyInterpreterState *interp) +{ + return (_Py_IsMainThread() && _Py_IsMainInterpreter(interp)); +} + + +/* Only execute pending calls on the main thread. */ +static inline int +_Py_ThreadCanHandlePendingCalls(void) +{ + return _Py_IsMainThread(); +} + + +#ifndef NDEBUG +extern int _PyThreadState_CheckConsistency(PyThreadState *tstate); +#endif + +int _PyThreadState_MustExit(PyThreadState *tstate); + +/* Variable and macro for in-line access to current thread + and interpreter state */ + +static inline PyThreadState* +_PyRuntimeState_GetThreadState(_PyRuntimeState *runtime) +{ + return (PyThreadState*)_Py_atomic_load_relaxed(&runtime->gilstate.tstate_current); +} + +/* Get the current Python thread state. + + Efficient macro reading directly the 'gilstate.tstate_current' atomic + variable. The macro is unsafe: it does not check for error and it can + return NULL. + + The caller must hold the GIL. + + See also PyThreadState_Get() and _PyThreadState_UncheckedGet(). */ +static inline PyThreadState* +_PyThreadState_GET(void) +{ + return _PyRuntimeState_GetThreadState(&_PyRuntime); +} + +PyAPI_FUNC(void) _Py_NO_RETURN _Py_FatalError_TstateNULL(const char *func); + +static inline void +_Py_EnsureFuncTstateNotNULL(const char *func, PyThreadState *tstate) +{ + if (tstate == NULL) { + _Py_FatalError_TstateNULL(func); + } +} + +// Call Py_FatalError() if tstate is NULL +#define _Py_EnsureTstateNotNULL(tstate) \ + _Py_EnsureFuncTstateNotNULL(__func__, tstate) + + +/* Get the current interpreter state. + + The macro is unsafe: it does not check for error and it can return NULL. + + The caller must hold the GIL. + + See also _PyInterpreterState_Get() + and _PyGILState_GetInterpreterStateUnsafe(). */ +static inline PyInterpreterState* _PyInterpreterState_GET(void) { + PyThreadState *tstate = _PyThreadState_GET(); +#ifdef Py_DEBUG + _Py_EnsureTstateNotNULL(tstate); +#endif + return tstate->interp; +} + + +// PyThreadState functions + +PyAPI_FUNC(void) _PyThreadState_SetCurrent(PyThreadState *tstate); +// We keep this around exclusively for stable ABI compatibility. +PyAPI_FUNC(void) _PyThreadState_Init( + PyThreadState *tstate); +PyAPI_FUNC(void) _PyThreadState_DeleteExcept( + _PyRuntimeState *runtime, + PyThreadState *tstate); + + +static inline void +_PyThreadState_UpdateTracingState(PyThreadState *tstate) +{ + bool use_tracing = + (tstate->tracing == 0) && + (tstate->c_tracefunc != NULL || tstate->c_profilefunc != NULL); + tstate->cframe->use_tracing = (use_tracing ? 255 : 0); +} + + +/* Other */ + +PyAPI_FUNC(PyThreadState *) _PyThreadState_Swap( + struct _gilstate_runtime_state *gilstate, + PyThreadState *newts); + +PyAPI_FUNC(PyStatus) _PyInterpreterState_Enable(_PyRuntimeState *runtime); + +#ifdef HAVE_FORK +extern PyStatus _PyInterpreterState_DeleteExceptMain(_PyRuntimeState *runtime); +extern PyStatus _PyGILState_Reinit(_PyRuntimeState *runtime); +extern void _PySignal_AfterFork(void); +#endif + + +PyAPI_FUNC(int) _PyState_AddModule( + PyThreadState *tstate, + PyObject* module, + PyModuleDef* def); + + +PyAPI_FUNC(int) _PyOS_InterruptOccurred(PyThreadState *tstate); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_PYSTATE_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_runtime.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_runtime.h new file mode 100644 index 0000000000000000000000000000000000000000..ae63ae74afa5fe2b580b1abcbaae25f814e406a4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_runtime.h @@ -0,0 +1,181 @@ +#ifndef Py_INTERNAL_RUNTIME_H +#define Py_INTERNAL_RUNTIME_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_atomic.h" /* _Py_atomic_address */ +#include "pycore_gil.h" // struct _gil_runtime_state +#include "pycore_global_objects.h" // struct _Py_global_objects +#include "pycore_interp.h" // PyInterpreterState +#include "pycore_unicodeobject.h" // struct _Py_unicode_runtime_ids + + +/* ceval state */ + +struct _ceval_runtime_state { + /* Request for checking signals. It is shared by all interpreters (see + bpo-40513). Any thread of any interpreter can receive a signal, but only + the main thread of the main interpreter can handle signals: see + _Py_ThreadCanHandleSignals(). */ + _Py_atomic_int signals_pending; + struct _gil_runtime_state gil; +}; + +/* GIL state */ + +struct _gilstate_runtime_state { + /* bpo-26558: Flag to disable PyGILState_Check(). + If set to non-zero, PyGILState_Check() always return 1. */ + int check_enabled; + /* Assuming the current thread holds the GIL, this is the + PyThreadState for the current thread. */ + _Py_atomic_address tstate_current; + /* The single PyInterpreterState used by this process' + GILState implementation + */ + /* TODO: Given interp_main, it may be possible to kill this ref */ + PyInterpreterState *autoInterpreterState; + Py_tss_t autoTSSkey; +}; + +/* Runtime audit hook state */ + +typedef struct _Py_AuditHookEntry { + struct _Py_AuditHookEntry *next; + Py_AuditHookFunction hookCFunction; + void *userData; +} _Py_AuditHookEntry; + +/* Full Python runtime state */ + +/* _PyRuntimeState holds the global state for the CPython runtime. + That data is exposed in the internal API as a static variable (_PyRuntime). + */ +typedef struct pyruntimestate { + /* Has been initialized to a safe state. + + In order to be effective, this must be set to 0 during or right + after allocation. */ + int _initialized; + + /* Is running Py_PreInitialize()? */ + int preinitializing; + + /* Is Python preinitialized? Set to 1 by Py_PreInitialize() */ + int preinitialized; + + /* Is Python core initialized? Set to 1 by _Py_InitializeCore() */ + int core_initialized; + + /* Is Python fully initialized? Set to 1 by Py_Initialize() */ + int initialized; + + /* Set by Py_FinalizeEx(). Only reset to NULL if Py_Initialize() + is called again. + + Use _PyRuntimeState_GetFinalizing() and _PyRuntimeState_SetFinalizing() + to access it, don't access it directly. */ + _Py_atomic_address _finalizing; + + struct pyinterpreters { + PyThread_type_lock mutex; + /* The linked list of interpreters, newest first. */ + PyInterpreterState *head; + /* The runtime's initial interpreter, which has a special role + in the operation of the runtime. It is also often the only + interpreter. */ + PyInterpreterState *main; + /* _next_interp_id is an auto-numbered sequence of small + integers. It gets initialized in _PyInterpreterState_Init(), + which is called in Py_Initialize(), and used in + PyInterpreterState_New(). A negative interpreter ID + indicates an error occurred. The main interpreter will + always have an ID of 0. Overflow results in a RuntimeError. + If that becomes a problem later then we can adjust, e.g. by + using a Python int. */ + int64_t next_id; + } interpreters; + // XXX Remove this field once we have a tp_* slot. + struct _xidregistry { + PyThread_type_lock mutex; + struct _xidregitem *head; + } xidregistry; + + unsigned long main_thread; + +#define NEXITFUNCS 32 + void (*exitfuncs[NEXITFUNCS])(void); + int nexitfuncs; + + struct _ceval_runtime_state ceval; + struct _gilstate_runtime_state gilstate; + + PyPreConfig preconfig; + + // Audit values must be preserved when Py_Initialize()/Py_Finalize() + // is called multiple times. + Py_OpenCodeHookFunction open_code_hook; + void *open_code_userdata; + _Py_AuditHookEntry *audit_hook_head; + + struct _Py_unicode_runtime_ids unicode_ids; + + /* All the objects that are shared by the runtime's interpreters. */ + struct _Py_global_objects global_objects; + + /* The following fields are here to avoid allocation during init. + The data is exposed through _PyRuntimeState pointer fields. + These fields should not be accessed directly outside of init. + + All other _PyRuntimeState pointer fields are populated when + needed and default to NULL. + + For now there are some exceptions to that rule, which require + allocation during init. These will be addressed on a case-by-case + basis. Most notably, we don't pre-allocated the several mutex + (PyThread_type_lock) fields, because on Windows we only ever get + a pointer type. + */ + + /* PyInterpreterState.interpreters.main */ + PyInterpreterState _main_interpreter; +} _PyRuntimeState; + + +/* other API */ + +PyAPI_DATA(_PyRuntimeState) _PyRuntime; + +PyAPI_FUNC(PyStatus) _PyRuntimeState_Init(_PyRuntimeState *runtime); +PyAPI_FUNC(void) _PyRuntimeState_Fini(_PyRuntimeState *runtime); + +#ifdef HAVE_FORK +extern PyStatus _PyRuntimeState_ReInitThreads(_PyRuntimeState *runtime); +#endif + +/* Initialize _PyRuntimeState. + Return NULL on success, or return an error message on failure. */ +PyAPI_FUNC(PyStatus) _PyRuntime_Initialize(void); + +PyAPI_FUNC(void) _PyRuntime_Finalize(void); + + +static inline PyThreadState* +_PyRuntimeState_GetFinalizing(_PyRuntimeState *runtime) { + return (PyThreadState*)_Py_atomic_load_relaxed(&runtime->_finalizing); +} + +static inline void +_PyRuntimeState_SetFinalizing(_PyRuntimeState *runtime, PyThreadState *tstate) { + _Py_atomic_store_relaxed(&runtime->_finalizing, (uintptr_t)tstate); +} + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_RUNTIME_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_runtime_init.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_runtime_init.h new file mode 100644 index 0000000000000000000000000000000000000000..13eae1e4c88d8fe4f73938a5e96e275f8e5febea --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_runtime_init.h @@ -0,0 +1,1256 @@ +#ifndef Py_INTERNAL_RUNTIME_INIT_H +#define Py_INTERNAL_RUNTIME_INIT_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_object.h" + + +/* The static initializers defined here should only be used + in the runtime init code (in pystate.c and pylifecycle.c). */ + + +#define _PyRuntimeState_INIT \ + { \ + .gilstate = { \ + .check_enabled = 1, \ + /* A TSS key must be initialized with Py_tss_NEEDS_INIT \ + in accordance with the specification. */ \ + .autoTSSkey = Py_tss_NEEDS_INIT, \ + }, \ + .interpreters = { \ + /* This prevents interpreters from getting created \ + until _PyInterpreterState_Enable() is called. */ \ + .next_id = -1, \ + }, \ + .global_objects = _Py_global_objects_INIT, \ + ._main_interpreter = _PyInterpreterState_INIT, \ + } + +#ifdef HAVE_DLOPEN +# include +# if HAVE_DECL_RTLD_NOW +# define _Py_DLOPEN_FLAGS RTLD_NOW +# else +# define _Py_DLOPEN_FLAGS RTLD_LAZY +# endif +# define DLOPENFLAGS_INIT .dlopenflags = _Py_DLOPEN_FLAGS, +#else +# define _Py_DLOPEN_FLAGS 0 +# define DLOPENFLAGS_INIT +#endif + +#define _PyInterpreterState_INIT \ + { \ + ._static = 1, \ + .id_refcount = -1, \ + DLOPENFLAGS_INIT \ + .ceval = { \ + .recursion_limit = Py_DEFAULT_RECURSION_LIMIT, \ + }, \ + .gc = { \ + .enabled = 1, \ + .generations = { \ + /* .head is set in _PyGC_InitState(). */ \ + { .threshold = 700, }, \ + { .threshold = 10, }, \ + { .threshold = 10, }, \ + }, \ + }, \ + ._initial_thread = _PyThreadState_INIT, \ + } + +#define _PyThreadState_INIT \ + { \ + ._static = 1, \ + .recursion_limit = Py_DEFAULT_RECURSION_LIMIT, \ + .context_ver = 1, \ + } + + +// global objects + +#define _PyLong_DIGIT_INIT(val) \ + { \ + _PyVarObject_IMMORTAL_INIT(&PyLong_Type, \ + ((val) == 0 ? 0 : ((val) > 0 ? 1 : -1))), \ + .ob_digit = { ((val) >= 0 ? (val) : -(val)) }, \ + } + +#define _PyBytes_SIMPLE_INIT(CH, LEN) \ + { \ + _PyVarObject_IMMORTAL_INIT(&PyBytes_Type, LEN), \ + .ob_shash = -1, \ + .ob_sval = { CH }, \ + } +#define _PyBytes_CHAR_INIT(CH) \ + { \ + _PyBytes_SIMPLE_INIT(CH, 1) \ + } + +#define _PyUnicode_ASCII_BASE_INIT(LITERAL, ASCII) \ + { \ + .ob_base = _PyObject_IMMORTAL_INIT(&PyUnicode_Type), \ + .length = sizeof(LITERAL) - 1, \ + .hash = -1, \ + .state = { \ + .kind = 1, \ + .compact = 1, \ + .ascii = ASCII, \ + .ready = 1, \ + }, \ + } +#define _PyASCIIObject_INIT(LITERAL) \ + { \ + ._ascii = _PyUnicode_ASCII_BASE_INIT(LITERAL, 1), \ + ._data = LITERAL \ + } +#define INIT_STR(NAME, LITERAL) \ + ._ ## NAME = _PyASCIIObject_INIT(LITERAL) +#define INIT_ID(NAME) \ + ._ ## NAME = _PyASCIIObject_INIT(#NAME) +#define _PyUnicode_LATIN1_INIT(LITERAL) \ + { \ + ._latin1 = { \ + ._base = _PyUnicode_ASCII_BASE_INIT(LITERAL, 0), \ + }, \ + ._data = LITERAL, \ + } + +/* The following is auto-generated by Tools/scripts/generate_global_objects.py. */ +#define _Py_global_objects_INIT { \ + .singletons = { \ + .small_ints = { \ + _PyLong_DIGIT_INIT(-5), \ + _PyLong_DIGIT_INIT(-4), \ + _PyLong_DIGIT_INIT(-3), \ + _PyLong_DIGIT_INIT(-2), \ + _PyLong_DIGIT_INIT(-1), \ + _PyLong_DIGIT_INIT(0), \ + _PyLong_DIGIT_INIT(1), \ + _PyLong_DIGIT_INIT(2), \ + _PyLong_DIGIT_INIT(3), \ + _PyLong_DIGIT_INIT(4), \ + _PyLong_DIGIT_INIT(5), \ + _PyLong_DIGIT_INIT(6), \ + _PyLong_DIGIT_INIT(7), \ + _PyLong_DIGIT_INIT(8), \ + _PyLong_DIGIT_INIT(9), \ + _PyLong_DIGIT_INIT(10), \ + _PyLong_DIGIT_INIT(11), \ + _PyLong_DIGIT_INIT(12), \ + _PyLong_DIGIT_INIT(13), \ + _PyLong_DIGIT_INIT(14), \ + _PyLong_DIGIT_INIT(15), \ + _PyLong_DIGIT_INIT(16), \ + _PyLong_DIGIT_INIT(17), \ + _PyLong_DIGIT_INIT(18), \ + _PyLong_DIGIT_INIT(19), \ + _PyLong_DIGIT_INIT(20), \ + _PyLong_DIGIT_INIT(21), \ + _PyLong_DIGIT_INIT(22), \ + _PyLong_DIGIT_INIT(23), \ + _PyLong_DIGIT_INIT(24), \ + _PyLong_DIGIT_INIT(25), \ + _PyLong_DIGIT_INIT(26), \ + _PyLong_DIGIT_INIT(27), \ + _PyLong_DIGIT_INIT(28), \ + _PyLong_DIGIT_INIT(29), \ + _PyLong_DIGIT_INIT(30), \ + _PyLong_DIGIT_INIT(31), \ + _PyLong_DIGIT_INIT(32), \ + _PyLong_DIGIT_INIT(33), \ + _PyLong_DIGIT_INIT(34), \ + _PyLong_DIGIT_INIT(35), \ + _PyLong_DIGIT_INIT(36), \ + _PyLong_DIGIT_INIT(37), \ + _PyLong_DIGIT_INIT(38), \ + _PyLong_DIGIT_INIT(39), \ + _PyLong_DIGIT_INIT(40), \ + _PyLong_DIGIT_INIT(41), \ + _PyLong_DIGIT_INIT(42), \ + _PyLong_DIGIT_INIT(43), \ + _PyLong_DIGIT_INIT(44), \ + _PyLong_DIGIT_INIT(45), \ + _PyLong_DIGIT_INIT(46), \ + _PyLong_DIGIT_INIT(47), \ + _PyLong_DIGIT_INIT(48), \ + _PyLong_DIGIT_INIT(49), \ + _PyLong_DIGIT_INIT(50), \ + _PyLong_DIGIT_INIT(51), \ + _PyLong_DIGIT_INIT(52), \ + _PyLong_DIGIT_INIT(53), \ + _PyLong_DIGIT_INIT(54), \ + _PyLong_DIGIT_INIT(55), \ + _PyLong_DIGIT_INIT(56), \ + _PyLong_DIGIT_INIT(57), \ + _PyLong_DIGIT_INIT(58), \ + _PyLong_DIGIT_INIT(59), \ + _PyLong_DIGIT_INIT(60), \ + _PyLong_DIGIT_INIT(61), \ + _PyLong_DIGIT_INIT(62), \ + _PyLong_DIGIT_INIT(63), \ + _PyLong_DIGIT_INIT(64), \ + _PyLong_DIGIT_INIT(65), \ + _PyLong_DIGIT_INIT(66), \ + _PyLong_DIGIT_INIT(67), \ + _PyLong_DIGIT_INIT(68), \ + _PyLong_DIGIT_INIT(69), \ + _PyLong_DIGIT_INIT(70), \ + _PyLong_DIGIT_INIT(71), \ + _PyLong_DIGIT_INIT(72), \ + _PyLong_DIGIT_INIT(73), \ + _PyLong_DIGIT_INIT(74), \ + _PyLong_DIGIT_INIT(75), \ + _PyLong_DIGIT_INIT(76), \ + _PyLong_DIGIT_INIT(77), \ + _PyLong_DIGIT_INIT(78), \ + _PyLong_DIGIT_INIT(79), \ + _PyLong_DIGIT_INIT(80), \ + _PyLong_DIGIT_INIT(81), \ + _PyLong_DIGIT_INIT(82), \ + _PyLong_DIGIT_INIT(83), \ + _PyLong_DIGIT_INIT(84), \ + _PyLong_DIGIT_INIT(85), \ + _PyLong_DIGIT_INIT(86), \ + _PyLong_DIGIT_INIT(87), \ + _PyLong_DIGIT_INIT(88), \ + _PyLong_DIGIT_INIT(89), \ + _PyLong_DIGIT_INIT(90), \ + _PyLong_DIGIT_INIT(91), \ + _PyLong_DIGIT_INIT(92), \ + _PyLong_DIGIT_INIT(93), \ + _PyLong_DIGIT_INIT(94), \ + _PyLong_DIGIT_INIT(95), \ + _PyLong_DIGIT_INIT(96), \ + _PyLong_DIGIT_INIT(97), \ + _PyLong_DIGIT_INIT(98), \ + _PyLong_DIGIT_INIT(99), \ + _PyLong_DIGIT_INIT(100), \ + _PyLong_DIGIT_INIT(101), \ + _PyLong_DIGIT_INIT(102), \ + _PyLong_DIGIT_INIT(103), \ + _PyLong_DIGIT_INIT(104), \ + _PyLong_DIGIT_INIT(105), \ + _PyLong_DIGIT_INIT(106), \ + _PyLong_DIGIT_INIT(107), \ + _PyLong_DIGIT_INIT(108), \ + _PyLong_DIGIT_INIT(109), \ + _PyLong_DIGIT_INIT(110), \ + _PyLong_DIGIT_INIT(111), \ + _PyLong_DIGIT_INIT(112), \ + _PyLong_DIGIT_INIT(113), \ + _PyLong_DIGIT_INIT(114), \ + _PyLong_DIGIT_INIT(115), \ + _PyLong_DIGIT_INIT(116), \ + _PyLong_DIGIT_INIT(117), \ + _PyLong_DIGIT_INIT(118), \ + _PyLong_DIGIT_INIT(119), \ + _PyLong_DIGIT_INIT(120), \ + _PyLong_DIGIT_INIT(121), \ + _PyLong_DIGIT_INIT(122), \ + _PyLong_DIGIT_INIT(123), \ + _PyLong_DIGIT_INIT(124), \ + _PyLong_DIGIT_INIT(125), \ + _PyLong_DIGIT_INIT(126), \ + _PyLong_DIGIT_INIT(127), \ + _PyLong_DIGIT_INIT(128), \ + _PyLong_DIGIT_INIT(129), \ + _PyLong_DIGIT_INIT(130), \ + _PyLong_DIGIT_INIT(131), \ + _PyLong_DIGIT_INIT(132), \ + _PyLong_DIGIT_INIT(133), \ + _PyLong_DIGIT_INIT(134), \ + _PyLong_DIGIT_INIT(135), \ + _PyLong_DIGIT_INIT(136), \ + _PyLong_DIGIT_INIT(137), \ + _PyLong_DIGIT_INIT(138), \ + _PyLong_DIGIT_INIT(139), \ + _PyLong_DIGIT_INIT(140), \ + _PyLong_DIGIT_INIT(141), \ + _PyLong_DIGIT_INIT(142), \ + _PyLong_DIGIT_INIT(143), \ + _PyLong_DIGIT_INIT(144), \ + _PyLong_DIGIT_INIT(145), \ + _PyLong_DIGIT_INIT(146), \ + _PyLong_DIGIT_INIT(147), \ + _PyLong_DIGIT_INIT(148), \ + _PyLong_DIGIT_INIT(149), \ + _PyLong_DIGIT_INIT(150), \ + _PyLong_DIGIT_INIT(151), \ + _PyLong_DIGIT_INIT(152), \ + _PyLong_DIGIT_INIT(153), \ + _PyLong_DIGIT_INIT(154), \ + _PyLong_DIGIT_INIT(155), \ + _PyLong_DIGIT_INIT(156), \ + _PyLong_DIGIT_INIT(157), \ + _PyLong_DIGIT_INIT(158), \ + _PyLong_DIGIT_INIT(159), \ + _PyLong_DIGIT_INIT(160), \ + _PyLong_DIGIT_INIT(161), \ + _PyLong_DIGIT_INIT(162), \ + _PyLong_DIGIT_INIT(163), \ + _PyLong_DIGIT_INIT(164), \ + _PyLong_DIGIT_INIT(165), \ + _PyLong_DIGIT_INIT(166), \ + _PyLong_DIGIT_INIT(167), \ + _PyLong_DIGIT_INIT(168), \ + _PyLong_DIGIT_INIT(169), \ + _PyLong_DIGIT_INIT(170), \ + _PyLong_DIGIT_INIT(171), \ + _PyLong_DIGIT_INIT(172), \ + _PyLong_DIGIT_INIT(173), \ + _PyLong_DIGIT_INIT(174), \ + _PyLong_DIGIT_INIT(175), \ + _PyLong_DIGIT_INIT(176), \ + _PyLong_DIGIT_INIT(177), \ + _PyLong_DIGIT_INIT(178), \ + _PyLong_DIGIT_INIT(179), \ + _PyLong_DIGIT_INIT(180), \ + _PyLong_DIGIT_INIT(181), \ + _PyLong_DIGIT_INIT(182), \ + _PyLong_DIGIT_INIT(183), \ + _PyLong_DIGIT_INIT(184), \ + _PyLong_DIGIT_INIT(185), \ + _PyLong_DIGIT_INIT(186), \ + _PyLong_DIGIT_INIT(187), \ + _PyLong_DIGIT_INIT(188), \ + _PyLong_DIGIT_INIT(189), \ + _PyLong_DIGIT_INIT(190), \ + _PyLong_DIGIT_INIT(191), \ + _PyLong_DIGIT_INIT(192), \ + _PyLong_DIGIT_INIT(193), \ + _PyLong_DIGIT_INIT(194), \ + _PyLong_DIGIT_INIT(195), \ + _PyLong_DIGIT_INIT(196), \ + _PyLong_DIGIT_INIT(197), \ + _PyLong_DIGIT_INIT(198), \ + _PyLong_DIGIT_INIT(199), \ + _PyLong_DIGIT_INIT(200), \ + _PyLong_DIGIT_INIT(201), \ + _PyLong_DIGIT_INIT(202), \ + _PyLong_DIGIT_INIT(203), \ + _PyLong_DIGIT_INIT(204), \ + _PyLong_DIGIT_INIT(205), \ + _PyLong_DIGIT_INIT(206), \ + _PyLong_DIGIT_INIT(207), \ + _PyLong_DIGIT_INIT(208), \ + _PyLong_DIGIT_INIT(209), \ + _PyLong_DIGIT_INIT(210), \ + _PyLong_DIGIT_INIT(211), \ + _PyLong_DIGIT_INIT(212), \ + _PyLong_DIGIT_INIT(213), \ + _PyLong_DIGIT_INIT(214), \ + _PyLong_DIGIT_INIT(215), \ + _PyLong_DIGIT_INIT(216), \ + _PyLong_DIGIT_INIT(217), \ + _PyLong_DIGIT_INIT(218), \ + _PyLong_DIGIT_INIT(219), \ + _PyLong_DIGIT_INIT(220), \ + _PyLong_DIGIT_INIT(221), \ + _PyLong_DIGIT_INIT(222), \ + _PyLong_DIGIT_INIT(223), \ + _PyLong_DIGIT_INIT(224), \ + _PyLong_DIGIT_INIT(225), \ + _PyLong_DIGIT_INIT(226), \ + _PyLong_DIGIT_INIT(227), \ + _PyLong_DIGIT_INIT(228), \ + _PyLong_DIGIT_INIT(229), \ + _PyLong_DIGIT_INIT(230), \ + _PyLong_DIGIT_INIT(231), \ + _PyLong_DIGIT_INIT(232), \ + _PyLong_DIGIT_INIT(233), \ + _PyLong_DIGIT_INIT(234), \ + _PyLong_DIGIT_INIT(235), \ + _PyLong_DIGIT_INIT(236), \ + _PyLong_DIGIT_INIT(237), \ + _PyLong_DIGIT_INIT(238), \ + _PyLong_DIGIT_INIT(239), \ + _PyLong_DIGIT_INIT(240), \ + _PyLong_DIGIT_INIT(241), \ + _PyLong_DIGIT_INIT(242), \ + _PyLong_DIGIT_INIT(243), \ + _PyLong_DIGIT_INIT(244), \ + _PyLong_DIGIT_INIT(245), \ + _PyLong_DIGIT_INIT(246), \ + _PyLong_DIGIT_INIT(247), \ + _PyLong_DIGIT_INIT(248), \ + _PyLong_DIGIT_INIT(249), \ + _PyLong_DIGIT_INIT(250), \ + _PyLong_DIGIT_INIT(251), \ + _PyLong_DIGIT_INIT(252), \ + _PyLong_DIGIT_INIT(253), \ + _PyLong_DIGIT_INIT(254), \ + _PyLong_DIGIT_INIT(255), \ + _PyLong_DIGIT_INIT(256), \ + }, \ + \ + .bytes_empty = _PyBytes_SIMPLE_INIT(0, 0), \ + .bytes_characters = { \ + _PyBytes_CHAR_INIT(0), \ + _PyBytes_CHAR_INIT(1), \ + _PyBytes_CHAR_INIT(2), \ + _PyBytes_CHAR_INIT(3), \ + _PyBytes_CHAR_INIT(4), \ + _PyBytes_CHAR_INIT(5), \ + _PyBytes_CHAR_INIT(6), \ + _PyBytes_CHAR_INIT(7), \ + _PyBytes_CHAR_INIT(8), \ + _PyBytes_CHAR_INIT(9), \ + _PyBytes_CHAR_INIT(10), \ + _PyBytes_CHAR_INIT(11), \ + _PyBytes_CHAR_INIT(12), \ + _PyBytes_CHAR_INIT(13), \ + _PyBytes_CHAR_INIT(14), \ + _PyBytes_CHAR_INIT(15), \ + _PyBytes_CHAR_INIT(16), \ + _PyBytes_CHAR_INIT(17), \ + _PyBytes_CHAR_INIT(18), \ + _PyBytes_CHAR_INIT(19), \ + _PyBytes_CHAR_INIT(20), \ + _PyBytes_CHAR_INIT(21), \ + _PyBytes_CHAR_INIT(22), \ + _PyBytes_CHAR_INIT(23), \ + _PyBytes_CHAR_INIT(24), \ + _PyBytes_CHAR_INIT(25), \ + _PyBytes_CHAR_INIT(26), \ + _PyBytes_CHAR_INIT(27), \ + _PyBytes_CHAR_INIT(28), \ + _PyBytes_CHAR_INIT(29), \ + _PyBytes_CHAR_INIT(30), \ + _PyBytes_CHAR_INIT(31), \ + _PyBytes_CHAR_INIT(32), \ + _PyBytes_CHAR_INIT(33), \ + _PyBytes_CHAR_INIT(34), \ + _PyBytes_CHAR_INIT(35), \ + _PyBytes_CHAR_INIT(36), \ + _PyBytes_CHAR_INIT(37), \ + _PyBytes_CHAR_INIT(38), \ + _PyBytes_CHAR_INIT(39), \ + _PyBytes_CHAR_INIT(40), \ + _PyBytes_CHAR_INIT(41), \ + _PyBytes_CHAR_INIT(42), \ + _PyBytes_CHAR_INIT(43), \ + _PyBytes_CHAR_INIT(44), \ + _PyBytes_CHAR_INIT(45), \ + _PyBytes_CHAR_INIT(46), \ + _PyBytes_CHAR_INIT(47), \ + _PyBytes_CHAR_INIT(48), \ + _PyBytes_CHAR_INIT(49), \ + _PyBytes_CHAR_INIT(50), \ + _PyBytes_CHAR_INIT(51), \ + _PyBytes_CHAR_INIT(52), \ + _PyBytes_CHAR_INIT(53), \ + _PyBytes_CHAR_INIT(54), \ + _PyBytes_CHAR_INIT(55), \ + _PyBytes_CHAR_INIT(56), \ + _PyBytes_CHAR_INIT(57), \ + _PyBytes_CHAR_INIT(58), \ + _PyBytes_CHAR_INIT(59), \ + _PyBytes_CHAR_INIT(60), \ + _PyBytes_CHAR_INIT(61), \ + _PyBytes_CHAR_INIT(62), \ + _PyBytes_CHAR_INIT(63), \ + _PyBytes_CHAR_INIT(64), \ + _PyBytes_CHAR_INIT(65), \ + _PyBytes_CHAR_INIT(66), \ + _PyBytes_CHAR_INIT(67), \ + _PyBytes_CHAR_INIT(68), \ + _PyBytes_CHAR_INIT(69), \ + _PyBytes_CHAR_INIT(70), \ + _PyBytes_CHAR_INIT(71), \ + _PyBytes_CHAR_INIT(72), \ + _PyBytes_CHAR_INIT(73), \ + _PyBytes_CHAR_INIT(74), \ + _PyBytes_CHAR_INIT(75), \ + _PyBytes_CHAR_INIT(76), \ + _PyBytes_CHAR_INIT(77), \ + _PyBytes_CHAR_INIT(78), \ + _PyBytes_CHAR_INIT(79), \ + _PyBytes_CHAR_INIT(80), \ + _PyBytes_CHAR_INIT(81), \ + _PyBytes_CHAR_INIT(82), \ + _PyBytes_CHAR_INIT(83), \ + _PyBytes_CHAR_INIT(84), \ + _PyBytes_CHAR_INIT(85), \ + _PyBytes_CHAR_INIT(86), \ + _PyBytes_CHAR_INIT(87), \ + _PyBytes_CHAR_INIT(88), \ + _PyBytes_CHAR_INIT(89), \ + _PyBytes_CHAR_INIT(90), \ + _PyBytes_CHAR_INIT(91), \ + _PyBytes_CHAR_INIT(92), \ + _PyBytes_CHAR_INIT(93), \ + _PyBytes_CHAR_INIT(94), \ + _PyBytes_CHAR_INIT(95), \ + _PyBytes_CHAR_INIT(96), \ + _PyBytes_CHAR_INIT(97), \ + _PyBytes_CHAR_INIT(98), \ + _PyBytes_CHAR_INIT(99), \ + _PyBytes_CHAR_INIT(100), \ + _PyBytes_CHAR_INIT(101), \ + _PyBytes_CHAR_INIT(102), \ + _PyBytes_CHAR_INIT(103), \ + _PyBytes_CHAR_INIT(104), \ + _PyBytes_CHAR_INIT(105), \ + _PyBytes_CHAR_INIT(106), \ + _PyBytes_CHAR_INIT(107), \ + _PyBytes_CHAR_INIT(108), \ + _PyBytes_CHAR_INIT(109), \ + _PyBytes_CHAR_INIT(110), \ + _PyBytes_CHAR_INIT(111), \ + _PyBytes_CHAR_INIT(112), \ + _PyBytes_CHAR_INIT(113), \ + _PyBytes_CHAR_INIT(114), \ + _PyBytes_CHAR_INIT(115), \ + _PyBytes_CHAR_INIT(116), \ + _PyBytes_CHAR_INIT(117), \ + _PyBytes_CHAR_INIT(118), \ + _PyBytes_CHAR_INIT(119), \ + _PyBytes_CHAR_INIT(120), \ + _PyBytes_CHAR_INIT(121), \ + _PyBytes_CHAR_INIT(122), \ + _PyBytes_CHAR_INIT(123), \ + _PyBytes_CHAR_INIT(124), \ + _PyBytes_CHAR_INIT(125), \ + _PyBytes_CHAR_INIT(126), \ + _PyBytes_CHAR_INIT(127), \ + _PyBytes_CHAR_INIT(128), \ + _PyBytes_CHAR_INIT(129), \ + _PyBytes_CHAR_INIT(130), \ + _PyBytes_CHAR_INIT(131), \ + _PyBytes_CHAR_INIT(132), \ + _PyBytes_CHAR_INIT(133), \ + _PyBytes_CHAR_INIT(134), \ + _PyBytes_CHAR_INIT(135), \ + _PyBytes_CHAR_INIT(136), \ + _PyBytes_CHAR_INIT(137), \ + _PyBytes_CHAR_INIT(138), \ + _PyBytes_CHAR_INIT(139), \ + _PyBytes_CHAR_INIT(140), \ + _PyBytes_CHAR_INIT(141), \ + _PyBytes_CHAR_INIT(142), \ + _PyBytes_CHAR_INIT(143), \ + _PyBytes_CHAR_INIT(144), \ + _PyBytes_CHAR_INIT(145), \ + _PyBytes_CHAR_INIT(146), \ + _PyBytes_CHAR_INIT(147), \ + _PyBytes_CHAR_INIT(148), \ + _PyBytes_CHAR_INIT(149), \ + _PyBytes_CHAR_INIT(150), \ + _PyBytes_CHAR_INIT(151), \ + _PyBytes_CHAR_INIT(152), \ + _PyBytes_CHAR_INIT(153), \ + _PyBytes_CHAR_INIT(154), \ + _PyBytes_CHAR_INIT(155), \ + _PyBytes_CHAR_INIT(156), \ + _PyBytes_CHAR_INIT(157), \ + _PyBytes_CHAR_INIT(158), \ + _PyBytes_CHAR_INIT(159), \ + _PyBytes_CHAR_INIT(160), \ + _PyBytes_CHAR_INIT(161), \ + _PyBytes_CHAR_INIT(162), \ + _PyBytes_CHAR_INIT(163), \ + _PyBytes_CHAR_INIT(164), \ + _PyBytes_CHAR_INIT(165), \ + _PyBytes_CHAR_INIT(166), \ + _PyBytes_CHAR_INIT(167), \ + _PyBytes_CHAR_INIT(168), \ + _PyBytes_CHAR_INIT(169), \ + _PyBytes_CHAR_INIT(170), \ + _PyBytes_CHAR_INIT(171), \ + _PyBytes_CHAR_INIT(172), \ + _PyBytes_CHAR_INIT(173), \ + _PyBytes_CHAR_INIT(174), \ + _PyBytes_CHAR_INIT(175), \ + _PyBytes_CHAR_INIT(176), \ + _PyBytes_CHAR_INIT(177), \ + _PyBytes_CHAR_INIT(178), \ + _PyBytes_CHAR_INIT(179), \ + _PyBytes_CHAR_INIT(180), \ + _PyBytes_CHAR_INIT(181), \ + _PyBytes_CHAR_INIT(182), \ + _PyBytes_CHAR_INIT(183), \ + _PyBytes_CHAR_INIT(184), \ + _PyBytes_CHAR_INIT(185), \ + _PyBytes_CHAR_INIT(186), \ + _PyBytes_CHAR_INIT(187), \ + _PyBytes_CHAR_INIT(188), \ + _PyBytes_CHAR_INIT(189), \ + _PyBytes_CHAR_INIT(190), \ + _PyBytes_CHAR_INIT(191), \ + _PyBytes_CHAR_INIT(192), \ + _PyBytes_CHAR_INIT(193), \ + _PyBytes_CHAR_INIT(194), \ + _PyBytes_CHAR_INIT(195), \ + _PyBytes_CHAR_INIT(196), \ + _PyBytes_CHAR_INIT(197), \ + _PyBytes_CHAR_INIT(198), \ + _PyBytes_CHAR_INIT(199), \ + _PyBytes_CHAR_INIT(200), \ + _PyBytes_CHAR_INIT(201), \ + _PyBytes_CHAR_INIT(202), \ + _PyBytes_CHAR_INIT(203), \ + _PyBytes_CHAR_INIT(204), \ + _PyBytes_CHAR_INIT(205), \ + _PyBytes_CHAR_INIT(206), \ + _PyBytes_CHAR_INIT(207), \ + _PyBytes_CHAR_INIT(208), \ + _PyBytes_CHAR_INIT(209), \ + _PyBytes_CHAR_INIT(210), \ + _PyBytes_CHAR_INIT(211), \ + _PyBytes_CHAR_INIT(212), \ + _PyBytes_CHAR_INIT(213), \ + _PyBytes_CHAR_INIT(214), \ + _PyBytes_CHAR_INIT(215), \ + _PyBytes_CHAR_INIT(216), \ + _PyBytes_CHAR_INIT(217), \ + _PyBytes_CHAR_INIT(218), \ + _PyBytes_CHAR_INIT(219), \ + _PyBytes_CHAR_INIT(220), \ + _PyBytes_CHAR_INIT(221), \ + _PyBytes_CHAR_INIT(222), \ + _PyBytes_CHAR_INIT(223), \ + _PyBytes_CHAR_INIT(224), \ + _PyBytes_CHAR_INIT(225), \ + _PyBytes_CHAR_INIT(226), \ + _PyBytes_CHAR_INIT(227), \ + _PyBytes_CHAR_INIT(228), \ + _PyBytes_CHAR_INIT(229), \ + _PyBytes_CHAR_INIT(230), \ + _PyBytes_CHAR_INIT(231), \ + _PyBytes_CHAR_INIT(232), \ + _PyBytes_CHAR_INIT(233), \ + _PyBytes_CHAR_INIT(234), \ + _PyBytes_CHAR_INIT(235), \ + _PyBytes_CHAR_INIT(236), \ + _PyBytes_CHAR_INIT(237), \ + _PyBytes_CHAR_INIT(238), \ + _PyBytes_CHAR_INIT(239), \ + _PyBytes_CHAR_INIT(240), \ + _PyBytes_CHAR_INIT(241), \ + _PyBytes_CHAR_INIT(242), \ + _PyBytes_CHAR_INIT(243), \ + _PyBytes_CHAR_INIT(244), \ + _PyBytes_CHAR_INIT(245), \ + _PyBytes_CHAR_INIT(246), \ + _PyBytes_CHAR_INIT(247), \ + _PyBytes_CHAR_INIT(248), \ + _PyBytes_CHAR_INIT(249), \ + _PyBytes_CHAR_INIT(250), \ + _PyBytes_CHAR_INIT(251), \ + _PyBytes_CHAR_INIT(252), \ + _PyBytes_CHAR_INIT(253), \ + _PyBytes_CHAR_INIT(254), \ + _PyBytes_CHAR_INIT(255), \ + }, \ + \ + .strings = { \ + .literals = { \ + INIT_STR(anon_dictcomp, ""), \ + INIT_STR(anon_genexpr, ""), \ + INIT_STR(anon_lambda, ""), \ + INIT_STR(anon_listcomp, ""), \ + INIT_STR(anon_module, ""), \ + INIT_STR(anon_setcomp, ""), \ + INIT_STR(anon_string, ""), \ + INIT_STR(anon_unknown, ""), \ + INIT_STR(close_br, "}"), \ + INIT_STR(comma_sep, ", "), \ + INIT_STR(dbl_close_br, "}}"), \ + INIT_STR(dbl_open_br, "{{"), \ + INIT_STR(dbl_percent, "%%"), \ + INIT_STR(dot, "."), \ + INIT_STR(dot_locals, "."), \ + INIT_STR(empty, ""), \ + INIT_STR(list_err, "list index out of range"), \ + INIT_STR(newline, "\n"), \ + INIT_STR(open_br, "{"), \ + INIT_STR(percent, "%"), \ + INIT_STR(utf_8, "utf-8"), \ + }, \ + .identifiers = { \ + INIT_ID(False), \ + INIT_ID(Py_Repr), \ + INIT_ID(TextIOWrapper), \ + INIT_ID(True), \ + INIT_ID(WarningMessage), \ + INIT_ID(_), \ + INIT_ID(__IOBase_closed), \ + INIT_ID(__abc_tpflags__), \ + INIT_ID(__abs__), \ + INIT_ID(__abstractmethods__), \ + INIT_ID(__add__), \ + INIT_ID(__aenter__), \ + INIT_ID(__aexit__), \ + INIT_ID(__aiter__), \ + INIT_ID(__all__), \ + INIT_ID(__and__), \ + INIT_ID(__anext__), \ + INIT_ID(__annotations__), \ + INIT_ID(__args__), \ + INIT_ID(__await__), \ + INIT_ID(__bases__), \ + INIT_ID(__bool__), \ + INIT_ID(__build_class__), \ + INIT_ID(__builtins__), \ + INIT_ID(__bytes__), \ + INIT_ID(__call__), \ + INIT_ID(__cantrace__), \ + INIT_ID(__class__), \ + INIT_ID(__class_getitem__), \ + INIT_ID(__classcell__), \ + INIT_ID(__complex__), \ + INIT_ID(__contains__), \ + INIT_ID(__copy__), \ + INIT_ID(__del__), \ + INIT_ID(__delattr__), \ + INIT_ID(__delete__), \ + INIT_ID(__delitem__), \ + INIT_ID(__dict__), \ + INIT_ID(__dir__), \ + INIT_ID(__divmod__), \ + INIT_ID(__doc__), \ + INIT_ID(__enter__), \ + INIT_ID(__eq__), \ + INIT_ID(__exit__), \ + INIT_ID(__file__), \ + INIT_ID(__float__), \ + INIT_ID(__floordiv__), \ + INIT_ID(__format__), \ + INIT_ID(__fspath__), \ + INIT_ID(__ge__), \ + INIT_ID(__get__), \ + INIT_ID(__getattr__), \ + INIT_ID(__getattribute__), \ + INIT_ID(__getinitargs__), \ + INIT_ID(__getitem__), \ + INIT_ID(__getnewargs__), \ + INIT_ID(__getnewargs_ex__), \ + INIT_ID(__getstate__), \ + INIT_ID(__gt__), \ + INIT_ID(__hash__), \ + INIT_ID(__iadd__), \ + INIT_ID(__iand__), \ + INIT_ID(__ifloordiv__), \ + INIT_ID(__ilshift__), \ + INIT_ID(__imatmul__), \ + INIT_ID(__imod__), \ + INIT_ID(__import__), \ + INIT_ID(__imul__), \ + INIT_ID(__index__), \ + INIT_ID(__init__), \ + INIT_ID(__init_subclass__), \ + INIT_ID(__instancecheck__), \ + INIT_ID(__int__), \ + INIT_ID(__invert__), \ + INIT_ID(__ior__), \ + INIT_ID(__ipow__), \ + INIT_ID(__irshift__), \ + INIT_ID(__isabstractmethod__), \ + INIT_ID(__isub__), \ + INIT_ID(__iter__), \ + INIT_ID(__itruediv__), \ + INIT_ID(__ixor__), \ + INIT_ID(__le__), \ + INIT_ID(__len__), \ + INIT_ID(__length_hint__), \ + INIT_ID(__lltrace__), \ + INIT_ID(__loader__), \ + INIT_ID(__lshift__), \ + INIT_ID(__lt__), \ + INIT_ID(__main__), \ + INIT_ID(__matmul__), \ + INIT_ID(__missing__), \ + INIT_ID(__mod__), \ + INIT_ID(__module__), \ + INIT_ID(__mro_entries__), \ + INIT_ID(__mul__), \ + INIT_ID(__name__), \ + INIT_ID(__ne__), \ + INIT_ID(__neg__), \ + INIT_ID(__new__), \ + INIT_ID(__newobj__), \ + INIT_ID(__newobj_ex__), \ + INIT_ID(__next__), \ + INIT_ID(__notes__), \ + INIT_ID(__or__), \ + INIT_ID(__orig_class__), \ + INIT_ID(__origin__), \ + INIT_ID(__package__), \ + INIT_ID(__parameters__), \ + INIT_ID(__path__), \ + INIT_ID(__pos__), \ + INIT_ID(__pow__), \ + INIT_ID(__prepare__), \ + INIT_ID(__qualname__), \ + INIT_ID(__radd__), \ + INIT_ID(__rand__), \ + INIT_ID(__rdivmod__), \ + INIT_ID(__reduce__), \ + INIT_ID(__reduce_ex__), \ + INIT_ID(__repr__), \ + INIT_ID(__reversed__), \ + INIT_ID(__rfloordiv__), \ + INIT_ID(__rlshift__), \ + INIT_ID(__rmatmul__), \ + INIT_ID(__rmod__), \ + INIT_ID(__rmul__), \ + INIT_ID(__ror__), \ + INIT_ID(__round__), \ + INIT_ID(__rpow__), \ + INIT_ID(__rrshift__), \ + INIT_ID(__rshift__), \ + INIT_ID(__rsub__), \ + INIT_ID(__rtruediv__), \ + INIT_ID(__rxor__), \ + INIT_ID(__set__), \ + INIT_ID(__set_name__), \ + INIT_ID(__setattr__), \ + INIT_ID(__setitem__), \ + INIT_ID(__setstate__), \ + INIT_ID(__sizeof__), \ + INIT_ID(__slotnames__), \ + INIT_ID(__slots__), \ + INIT_ID(__spec__), \ + INIT_ID(__str__), \ + INIT_ID(__sub__), \ + INIT_ID(__subclasscheck__), \ + INIT_ID(__subclasshook__), \ + INIT_ID(__truediv__), \ + INIT_ID(__trunc__), \ + INIT_ID(__typing_is_unpacked_typevartuple__), \ + INIT_ID(__typing_prepare_subst__), \ + INIT_ID(__typing_subst__), \ + INIT_ID(__typing_unpacked_tuple_args__), \ + INIT_ID(__warningregistry__), \ + INIT_ID(__weakref__), \ + INIT_ID(__xor__), \ + INIT_ID(_abc_impl), \ + INIT_ID(_annotation), \ + INIT_ID(_blksize), \ + INIT_ID(_bootstrap), \ + INIT_ID(_dealloc_warn), \ + INIT_ID(_finalizing), \ + INIT_ID(_find_and_load), \ + INIT_ID(_fix_up_module), \ + INIT_ID(_get_sourcefile), \ + INIT_ID(_handle_fromlist), \ + INIT_ID(_initializing), \ + INIT_ID(_is_text_encoding), \ + INIT_ID(_lock_unlock_module), \ + INIT_ID(_showwarnmsg), \ + INIT_ID(_shutdown), \ + INIT_ID(_slotnames), \ + INIT_ID(_strptime_time), \ + INIT_ID(_uninitialized_submodules), \ + INIT_ID(_warn_unawaited_coroutine), \ + INIT_ID(_xoptions), \ + INIT_ID(add), \ + INIT_ID(append), \ + INIT_ID(big), \ + INIT_ID(buffer), \ + INIT_ID(builtins), \ + INIT_ID(c_call), \ + INIT_ID(c_exception), \ + INIT_ID(c_return), \ + INIT_ID(call), \ + INIT_ID(clear), \ + INIT_ID(close), \ + INIT_ID(closed), \ + INIT_ID(code), \ + INIT_ID(copy), \ + INIT_ID(copyreg), \ + INIT_ID(decode), \ + INIT_ID(default), \ + INIT_ID(defaultaction), \ + INIT_ID(dictcomp), \ + INIT_ID(difference_update), \ + INIT_ID(dispatch_table), \ + INIT_ID(displayhook), \ + INIT_ID(enable), \ + INIT_ID(encode), \ + INIT_ID(encoding), \ + INIT_ID(end_lineno), \ + INIT_ID(end_offset), \ + INIT_ID(errors), \ + INIT_ID(excepthook), \ + INIT_ID(exception), \ + INIT_ID(extend), \ + INIT_ID(filename), \ + INIT_ID(fileno), \ + INIT_ID(fillvalue), \ + INIT_ID(filters), \ + INIT_ID(find_class), \ + INIT_ID(flush), \ + INIT_ID(genexpr), \ + INIT_ID(get), \ + INIT_ID(get_source), \ + INIT_ID(getattr), \ + INIT_ID(getstate), \ + INIT_ID(ignore), \ + INIT_ID(importlib), \ + INIT_ID(inf), \ + INIT_ID(intersection), \ + INIT_ID(isatty), \ + INIT_ID(isinstance), \ + INIT_ID(items), \ + INIT_ID(iter), \ + INIT_ID(join), \ + INIT_ID(keys), \ + INIT_ID(lambda), \ + INIT_ID(last_traceback), \ + INIT_ID(last_type), \ + INIT_ID(last_value), \ + INIT_ID(latin1), \ + INIT_ID(len), \ + INIT_ID(line), \ + INIT_ID(lineno), \ + INIT_ID(listcomp), \ + INIT_ID(little), \ + INIT_ID(locale), \ + INIT_ID(match), \ + INIT_ID(metaclass), \ + INIT_ID(mode), \ + INIT_ID(modules), \ + INIT_ID(mro), \ + INIT_ID(msg), \ + INIT_ID(n_fields), \ + INIT_ID(n_sequence_fields), \ + INIT_ID(n_unnamed_fields), \ + INIT_ID(name), \ + INIT_ID(newlines), \ + INIT_ID(next), \ + INIT_ID(obj), \ + INIT_ID(offset), \ + INIT_ID(onceregistry), \ + INIT_ID(opcode), \ + INIT_ID(open), \ + INIT_ID(parent), \ + INIT_ID(partial), \ + INIT_ID(path), \ + INIT_ID(peek), \ + INIT_ID(persistent_id), \ + INIT_ID(persistent_load), \ + INIT_ID(print_file_and_line), \ + INIT_ID(ps1), \ + INIT_ID(ps2), \ + INIT_ID(raw), \ + INIT_ID(read), \ + INIT_ID(read1), \ + INIT_ID(readable), \ + INIT_ID(readall), \ + INIT_ID(readinto), \ + INIT_ID(readinto1), \ + INIT_ID(readline), \ + INIT_ID(reducer_override), \ + INIT_ID(reload), \ + INIT_ID(replace), \ + INIT_ID(reset), \ + INIT_ID(return), \ + INIT_ID(reversed), \ + INIT_ID(seek), \ + INIT_ID(seekable), \ + INIT_ID(send), \ + INIT_ID(setcomp), \ + INIT_ID(setstate), \ + INIT_ID(sort), \ + INIT_ID(stderr), \ + INIT_ID(stdin), \ + INIT_ID(stdout), \ + INIT_ID(strict), \ + INIT_ID(symmetric_difference_update), \ + INIT_ID(tell), \ + INIT_ID(text), \ + INIT_ID(threading), \ + INIT_ID(throw), \ + INIT_ID(top), \ + INIT_ID(truncate), \ + INIT_ID(unraisablehook), \ + INIT_ID(values), \ + INIT_ID(version), \ + INIT_ID(warnings), \ + INIT_ID(warnoptions), \ + INIT_ID(writable), \ + INIT_ID(write), \ + INIT_ID(zipimporter), \ + }, \ + .ascii = { \ + _PyASCIIObject_INIT("\x00"), \ + _PyASCIIObject_INIT("\x01"), \ + _PyASCIIObject_INIT("\x02"), \ + _PyASCIIObject_INIT("\x03"), \ + _PyASCIIObject_INIT("\x04"), \ + _PyASCIIObject_INIT("\x05"), \ + _PyASCIIObject_INIT("\x06"), \ + _PyASCIIObject_INIT("\x07"), \ + _PyASCIIObject_INIT("\x08"), \ + _PyASCIIObject_INIT("\x09"), \ + _PyASCIIObject_INIT("\x0a"), \ + _PyASCIIObject_INIT("\x0b"), \ + _PyASCIIObject_INIT("\x0c"), \ + _PyASCIIObject_INIT("\x0d"), \ + _PyASCIIObject_INIT("\x0e"), \ + _PyASCIIObject_INIT("\x0f"), \ + _PyASCIIObject_INIT("\x10"), \ + _PyASCIIObject_INIT("\x11"), \ + _PyASCIIObject_INIT("\x12"), \ + _PyASCIIObject_INIT("\x13"), \ + _PyASCIIObject_INIT("\x14"), \ + _PyASCIIObject_INIT("\x15"), \ + _PyASCIIObject_INIT("\x16"), \ + _PyASCIIObject_INIT("\x17"), \ + _PyASCIIObject_INIT("\x18"), \ + _PyASCIIObject_INIT("\x19"), \ + _PyASCIIObject_INIT("\x1a"), \ + _PyASCIIObject_INIT("\x1b"), \ + _PyASCIIObject_INIT("\x1c"), \ + _PyASCIIObject_INIT("\x1d"), \ + _PyASCIIObject_INIT("\x1e"), \ + _PyASCIIObject_INIT("\x1f"), \ + _PyASCIIObject_INIT("\x20"), \ + _PyASCIIObject_INIT("\x21"), \ + _PyASCIIObject_INIT("\x22"), \ + _PyASCIIObject_INIT("\x23"), \ + _PyASCIIObject_INIT("\x24"), \ + _PyASCIIObject_INIT("\x25"), \ + _PyASCIIObject_INIT("\x26"), \ + _PyASCIIObject_INIT("\x27"), \ + _PyASCIIObject_INIT("\x28"), \ + _PyASCIIObject_INIT("\x29"), \ + _PyASCIIObject_INIT("\x2a"), \ + _PyASCIIObject_INIT("\x2b"), \ + _PyASCIIObject_INIT("\x2c"), \ + _PyASCIIObject_INIT("\x2d"), \ + _PyASCIIObject_INIT("\x2e"), \ + _PyASCIIObject_INIT("\x2f"), \ + _PyASCIIObject_INIT("\x30"), \ + _PyASCIIObject_INIT("\x31"), \ + _PyASCIIObject_INIT("\x32"), \ + _PyASCIIObject_INIT("\x33"), \ + _PyASCIIObject_INIT("\x34"), \ + _PyASCIIObject_INIT("\x35"), \ + _PyASCIIObject_INIT("\x36"), \ + _PyASCIIObject_INIT("\x37"), \ + _PyASCIIObject_INIT("\x38"), \ + _PyASCIIObject_INIT("\x39"), \ + _PyASCIIObject_INIT("\x3a"), \ + _PyASCIIObject_INIT("\x3b"), \ + _PyASCIIObject_INIT("\x3c"), \ + _PyASCIIObject_INIT("\x3d"), \ + _PyASCIIObject_INIT("\x3e"), \ + _PyASCIIObject_INIT("\x3f"), \ + _PyASCIIObject_INIT("\x40"), \ + _PyASCIIObject_INIT("\x41"), \ + _PyASCIIObject_INIT("\x42"), \ + _PyASCIIObject_INIT("\x43"), \ + _PyASCIIObject_INIT("\x44"), \ + _PyASCIIObject_INIT("\x45"), \ + _PyASCIIObject_INIT("\x46"), \ + _PyASCIIObject_INIT("\x47"), \ + _PyASCIIObject_INIT("\x48"), \ + _PyASCIIObject_INIT("\x49"), \ + _PyASCIIObject_INIT("\x4a"), \ + _PyASCIIObject_INIT("\x4b"), \ + _PyASCIIObject_INIT("\x4c"), \ + _PyASCIIObject_INIT("\x4d"), \ + _PyASCIIObject_INIT("\x4e"), \ + _PyASCIIObject_INIT("\x4f"), \ + _PyASCIIObject_INIT("\x50"), \ + _PyASCIIObject_INIT("\x51"), \ + _PyASCIIObject_INIT("\x52"), \ + _PyASCIIObject_INIT("\x53"), \ + _PyASCIIObject_INIT("\x54"), \ + _PyASCIIObject_INIT("\x55"), \ + _PyASCIIObject_INIT("\x56"), \ + _PyASCIIObject_INIT("\x57"), \ + _PyASCIIObject_INIT("\x58"), \ + _PyASCIIObject_INIT("\x59"), \ + _PyASCIIObject_INIT("\x5a"), \ + _PyASCIIObject_INIT("\x5b"), \ + _PyASCIIObject_INIT("\x5c"), \ + _PyASCIIObject_INIT("\x5d"), \ + _PyASCIIObject_INIT("\x5e"), \ + _PyASCIIObject_INIT("\x5f"), \ + _PyASCIIObject_INIT("\x60"), \ + _PyASCIIObject_INIT("\x61"), \ + _PyASCIIObject_INIT("\x62"), \ + _PyASCIIObject_INIT("\x63"), \ + _PyASCIIObject_INIT("\x64"), \ + _PyASCIIObject_INIT("\x65"), \ + _PyASCIIObject_INIT("\x66"), \ + _PyASCIIObject_INIT("\x67"), \ + _PyASCIIObject_INIT("\x68"), \ + _PyASCIIObject_INIT("\x69"), \ + _PyASCIIObject_INIT("\x6a"), \ + _PyASCIIObject_INIT("\x6b"), \ + _PyASCIIObject_INIT("\x6c"), \ + _PyASCIIObject_INIT("\x6d"), \ + _PyASCIIObject_INIT("\x6e"), \ + _PyASCIIObject_INIT("\x6f"), \ + _PyASCIIObject_INIT("\x70"), \ + _PyASCIIObject_INIT("\x71"), \ + _PyASCIIObject_INIT("\x72"), \ + _PyASCIIObject_INIT("\x73"), \ + _PyASCIIObject_INIT("\x74"), \ + _PyASCIIObject_INIT("\x75"), \ + _PyASCIIObject_INIT("\x76"), \ + _PyASCIIObject_INIT("\x77"), \ + _PyASCIIObject_INIT("\x78"), \ + _PyASCIIObject_INIT("\x79"), \ + _PyASCIIObject_INIT("\x7a"), \ + _PyASCIIObject_INIT("\x7b"), \ + _PyASCIIObject_INIT("\x7c"), \ + _PyASCIIObject_INIT("\x7d"), \ + _PyASCIIObject_INIT("\x7e"), \ + _PyASCIIObject_INIT("\x7f"), \ + }, \ + .latin1 = { \ + _PyUnicode_LATIN1_INIT("\x80"), \ + _PyUnicode_LATIN1_INIT("\x81"), \ + _PyUnicode_LATIN1_INIT("\x82"), \ + _PyUnicode_LATIN1_INIT("\x83"), \ + _PyUnicode_LATIN1_INIT("\x84"), \ + _PyUnicode_LATIN1_INIT("\x85"), \ + _PyUnicode_LATIN1_INIT("\x86"), \ + _PyUnicode_LATIN1_INIT("\x87"), \ + _PyUnicode_LATIN1_INIT("\x88"), \ + _PyUnicode_LATIN1_INIT("\x89"), \ + _PyUnicode_LATIN1_INIT("\x8a"), \ + _PyUnicode_LATIN1_INIT("\x8b"), \ + _PyUnicode_LATIN1_INIT("\x8c"), \ + _PyUnicode_LATIN1_INIT("\x8d"), \ + _PyUnicode_LATIN1_INIT("\x8e"), \ + _PyUnicode_LATIN1_INIT("\x8f"), \ + _PyUnicode_LATIN1_INIT("\x90"), \ + _PyUnicode_LATIN1_INIT("\x91"), \ + _PyUnicode_LATIN1_INIT("\x92"), \ + _PyUnicode_LATIN1_INIT("\x93"), \ + _PyUnicode_LATIN1_INIT("\x94"), \ + _PyUnicode_LATIN1_INIT("\x95"), \ + _PyUnicode_LATIN1_INIT("\x96"), \ + _PyUnicode_LATIN1_INIT("\x97"), \ + _PyUnicode_LATIN1_INIT("\x98"), \ + _PyUnicode_LATIN1_INIT("\x99"), \ + _PyUnicode_LATIN1_INIT("\x9a"), \ + _PyUnicode_LATIN1_INIT("\x9b"), \ + _PyUnicode_LATIN1_INIT("\x9c"), \ + _PyUnicode_LATIN1_INIT("\x9d"), \ + _PyUnicode_LATIN1_INIT("\x9e"), \ + _PyUnicode_LATIN1_INIT("\x9f"), \ + _PyUnicode_LATIN1_INIT("\xa0"), \ + _PyUnicode_LATIN1_INIT("\xa1"), \ + _PyUnicode_LATIN1_INIT("\xa2"), \ + _PyUnicode_LATIN1_INIT("\xa3"), \ + _PyUnicode_LATIN1_INIT("\xa4"), \ + _PyUnicode_LATIN1_INIT("\xa5"), \ + _PyUnicode_LATIN1_INIT("\xa6"), \ + _PyUnicode_LATIN1_INIT("\xa7"), \ + _PyUnicode_LATIN1_INIT("\xa8"), \ + _PyUnicode_LATIN1_INIT("\xa9"), \ + _PyUnicode_LATIN1_INIT("\xaa"), \ + _PyUnicode_LATIN1_INIT("\xab"), \ + _PyUnicode_LATIN1_INIT("\xac"), \ + _PyUnicode_LATIN1_INIT("\xad"), \ + _PyUnicode_LATIN1_INIT("\xae"), \ + _PyUnicode_LATIN1_INIT("\xaf"), \ + _PyUnicode_LATIN1_INIT("\xb0"), \ + _PyUnicode_LATIN1_INIT("\xb1"), \ + _PyUnicode_LATIN1_INIT("\xb2"), \ + _PyUnicode_LATIN1_INIT("\xb3"), \ + _PyUnicode_LATIN1_INIT("\xb4"), \ + _PyUnicode_LATIN1_INIT("\xb5"), \ + _PyUnicode_LATIN1_INIT("\xb6"), \ + _PyUnicode_LATIN1_INIT("\xb7"), \ + _PyUnicode_LATIN1_INIT("\xb8"), \ + _PyUnicode_LATIN1_INIT("\xb9"), \ + _PyUnicode_LATIN1_INIT("\xba"), \ + _PyUnicode_LATIN1_INIT("\xbb"), \ + _PyUnicode_LATIN1_INIT("\xbc"), \ + _PyUnicode_LATIN1_INIT("\xbd"), \ + _PyUnicode_LATIN1_INIT("\xbe"), \ + _PyUnicode_LATIN1_INIT("\xbf"), \ + _PyUnicode_LATIN1_INIT("\xc0"), \ + _PyUnicode_LATIN1_INIT("\xc1"), \ + _PyUnicode_LATIN1_INIT("\xc2"), \ + _PyUnicode_LATIN1_INIT("\xc3"), \ + _PyUnicode_LATIN1_INIT("\xc4"), \ + _PyUnicode_LATIN1_INIT("\xc5"), \ + _PyUnicode_LATIN1_INIT("\xc6"), \ + _PyUnicode_LATIN1_INIT("\xc7"), \ + _PyUnicode_LATIN1_INIT("\xc8"), \ + _PyUnicode_LATIN1_INIT("\xc9"), \ + _PyUnicode_LATIN1_INIT("\xca"), \ + _PyUnicode_LATIN1_INIT("\xcb"), \ + _PyUnicode_LATIN1_INIT("\xcc"), \ + _PyUnicode_LATIN1_INIT("\xcd"), \ + _PyUnicode_LATIN1_INIT("\xce"), \ + _PyUnicode_LATIN1_INIT("\xcf"), \ + _PyUnicode_LATIN1_INIT("\xd0"), \ + _PyUnicode_LATIN1_INIT("\xd1"), \ + _PyUnicode_LATIN1_INIT("\xd2"), \ + _PyUnicode_LATIN1_INIT("\xd3"), \ + _PyUnicode_LATIN1_INIT("\xd4"), \ + _PyUnicode_LATIN1_INIT("\xd5"), \ + _PyUnicode_LATIN1_INIT("\xd6"), \ + _PyUnicode_LATIN1_INIT("\xd7"), \ + _PyUnicode_LATIN1_INIT("\xd8"), \ + _PyUnicode_LATIN1_INIT("\xd9"), \ + _PyUnicode_LATIN1_INIT("\xda"), \ + _PyUnicode_LATIN1_INIT("\xdb"), \ + _PyUnicode_LATIN1_INIT("\xdc"), \ + _PyUnicode_LATIN1_INIT("\xdd"), \ + _PyUnicode_LATIN1_INIT("\xde"), \ + _PyUnicode_LATIN1_INIT("\xdf"), \ + _PyUnicode_LATIN1_INIT("\xe0"), \ + _PyUnicode_LATIN1_INIT("\xe1"), \ + _PyUnicode_LATIN1_INIT("\xe2"), \ + _PyUnicode_LATIN1_INIT("\xe3"), \ + _PyUnicode_LATIN1_INIT("\xe4"), \ + _PyUnicode_LATIN1_INIT("\xe5"), \ + _PyUnicode_LATIN1_INIT("\xe6"), \ + _PyUnicode_LATIN1_INIT("\xe7"), \ + _PyUnicode_LATIN1_INIT("\xe8"), \ + _PyUnicode_LATIN1_INIT("\xe9"), \ + _PyUnicode_LATIN1_INIT("\xea"), \ + _PyUnicode_LATIN1_INIT("\xeb"), \ + _PyUnicode_LATIN1_INIT("\xec"), \ + _PyUnicode_LATIN1_INIT("\xed"), \ + _PyUnicode_LATIN1_INIT("\xee"), \ + _PyUnicode_LATIN1_INIT("\xef"), \ + _PyUnicode_LATIN1_INIT("\xf0"), \ + _PyUnicode_LATIN1_INIT("\xf1"), \ + _PyUnicode_LATIN1_INIT("\xf2"), \ + _PyUnicode_LATIN1_INIT("\xf3"), \ + _PyUnicode_LATIN1_INIT("\xf4"), \ + _PyUnicode_LATIN1_INIT("\xf5"), \ + _PyUnicode_LATIN1_INIT("\xf6"), \ + _PyUnicode_LATIN1_INIT("\xf7"), \ + _PyUnicode_LATIN1_INIT("\xf8"), \ + _PyUnicode_LATIN1_INIT("\xf9"), \ + _PyUnicode_LATIN1_INIT("\xfa"), \ + _PyUnicode_LATIN1_INIT("\xfb"), \ + _PyUnicode_LATIN1_INIT("\xfc"), \ + _PyUnicode_LATIN1_INIT("\xfd"), \ + _PyUnicode_LATIN1_INIT("\xfe"), \ + _PyUnicode_LATIN1_INIT("\xff"), \ + }, \ + }, \ + \ + .tuple_empty = { \ + .ob_base = _PyVarObject_IMMORTAL_INIT(&PyTuple_Type, 0) \ + }, \ + }, \ +} +/* End auto-generated code */ + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_RUNTIME_INIT_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_signal.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_signal.h new file mode 100644 index 0000000000000000000000000000000000000000..b921dd170e9f6fe726599557e7d0f4212aaa2f34 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_signal.h @@ -0,0 +1,35 @@ +// Define Py_NSIG constant for signal handling. + +#ifndef Py_INTERNAL_SIGNAL_H +#define Py_INTERNAL_SIGNAL_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include // NSIG + +#ifdef _SIG_MAXSIG + // gh-91145: On FreeBSD, defines NSIG as 32: it doesn't include + // realtime signals: [SIGRTMIN,SIGRTMAX]. Use _SIG_MAXSIG instead. For + // example on x86-64 FreeBSD 13, SIGRTMAX is 126 and _SIG_MAXSIG is 128. +# define Py_NSIG _SIG_MAXSIG +#elif defined(NSIG) +# define Py_NSIG NSIG +#elif defined(_NSIG) +# define Py_NSIG _NSIG // BSD/SysV +#elif defined(_SIGMAX) +# define Py_NSIG (_SIGMAX + 1) // QNX +#elif defined(SIGMAX) +# define Py_NSIG (SIGMAX + 1) // djgpp +#else +# define Py_NSIG 64 // Use a reasonable default value +#endif + +#ifdef __cplusplus +} +#endif +#endif // !Py_INTERNAL_SIGNAL_H diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_sliceobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_sliceobject.h new file mode 100644 index 0000000000000000000000000000000000000000..e81834c041e4155b4d5065f965ce9c351168b6f2 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_sliceobject.h @@ -0,0 +1,20 @@ +#ifndef Py_INTERNAL_SLICEOBJECT_H +#define Py_INTERNAL_SLICEOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + + +/* runtime lifecycle */ + +extern void _PySlice_Fini(PyInterpreterState *); + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_SLICEOBJECT_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_strhex.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_strhex.h new file mode 100644 index 0000000000000000000000000000000000000000..f427b4d695bd299b753be99cecc7f9ab280c91e0 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_strhex.h @@ -0,0 +1,36 @@ +#ifndef Py_INTERNAL_STRHEX_H +#define Py_INTERNAL_STRHEX_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +// Returns a str() containing the hex representation of argbuf. +PyAPI_FUNC(PyObject*) _Py_strhex(const + char* argbuf, + const Py_ssize_t arglen); + +// Returns a bytes() containing the ASCII hex representation of argbuf. +PyAPI_FUNC(PyObject*) _Py_strhex_bytes( + const char* argbuf, + const Py_ssize_t arglen); + +// These variants include support for a separator between every N bytes: +PyAPI_FUNC(PyObject*) _Py_strhex_with_sep( + const char* argbuf, + const Py_ssize_t arglen, + PyObject* sep, + const int bytes_per_group); +PyAPI_FUNC(PyObject*) _Py_strhex_bytes_with_sep( + const char* argbuf, + const Py_ssize_t arglen, + PyObject* sep, + const int bytes_per_group); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_STRHEX_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_structseq.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_structseq.h new file mode 100644 index 0000000000000000000000000000000000000000..0199c790e24cecfcfbceac226e15c3b353c9b731 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_structseq.h @@ -0,0 +1,28 @@ +#ifndef Py_INTERNAL_STRUCTSEQ_H +#define Py_INTERNAL_STRUCTSEQ_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + + +/* other API */ + +PyAPI_FUNC(PyTypeObject *) _PyStructSequence_NewType( + PyStructSequence_Desc *desc, + unsigned long tp_flags); + +PyAPI_FUNC(int) _PyStructSequence_InitType( + PyTypeObject *type, + PyStructSequence_Desc *desc, + unsigned long tp_flags); + +extern void _PyStructSequence_FiniType(PyTypeObject *type); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_STRUCTSEQ_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_symtable.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_symtable.h new file mode 100644 index 0000000000000000000000000000000000000000..28935f4ed55012aa226783e495067605b102c3b1 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_symtable.h @@ -0,0 +1,134 @@ +#ifndef Py_INTERNAL_SYMTABLE_H +#define Py_INTERNAL_SYMTABLE_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +struct _mod; // Type defined in pycore_ast.h + +typedef enum _block_type { FunctionBlock, ClassBlock, ModuleBlock, AnnotationBlock } + _Py_block_ty; + +typedef enum _comprehension_type { + NoComprehension = 0, + ListComprehension = 1, + DictComprehension = 2, + SetComprehension = 3, + GeneratorExpression = 4 } _Py_comprehension_ty; + +struct _symtable_entry; + +struct symtable { + PyObject *st_filename; /* name of file being compiled, + decoded from the filesystem encoding */ + struct _symtable_entry *st_cur; /* current symbol table entry */ + struct _symtable_entry *st_top; /* symbol table entry for module */ + PyObject *st_blocks; /* dict: map AST node addresses + * to symbol table entries */ + PyObject *st_stack; /* list: stack of namespace info */ + PyObject *st_global; /* borrowed ref to st_top->ste_symbols */ + int st_nblocks; /* number of blocks used. kept for + consistency with the corresponding + compiler structure */ + PyObject *st_private; /* name of current class or NULL */ + PyFutureFeatures *st_future; /* module's future features that affect + the symbol table */ + int recursion_depth; /* current recursion depth */ + int recursion_limit; /* recursion limit */ +}; + +typedef struct _symtable_entry { + PyObject_HEAD + PyObject *ste_id; /* int: key in ste_table->st_blocks */ + PyObject *ste_symbols; /* dict: variable names to flags */ + PyObject *ste_name; /* string: name of current block */ + PyObject *ste_varnames; /* list of function parameters */ + PyObject *ste_children; /* list of child blocks */ + PyObject *ste_directives;/* locations of global and nonlocal statements */ + _Py_block_ty ste_type; /* module, class or function */ + int ste_nested; /* true if block is nested */ + unsigned ste_free : 1; /* true if block has free variables */ + unsigned ste_child_free : 1; /* true if a child block has free vars, + including free refs to globals */ + unsigned ste_generator : 1; /* true if namespace is a generator */ + unsigned ste_coroutine : 1; /* true if namespace is a coroutine */ + _Py_comprehension_ty ste_comprehension; /* Kind of comprehension (if any) */ + unsigned ste_varargs : 1; /* true if block has varargs */ + unsigned ste_varkeywords : 1; /* true if block has varkeywords */ + unsigned ste_returns_value : 1; /* true if namespace uses return with + an argument */ + unsigned ste_needs_class_closure : 1; /* for class scopes, true if a + closure over __class__ + should be created */ + unsigned ste_comp_iter_target : 1; /* true if visiting comprehension target */ + int ste_comp_iter_expr; /* non-zero if visiting a comprehension range expression */ + int ste_lineno; /* first line of block */ + int ste_col_offset; /* offset of first line of block */ + int ste_end_lineno; /* end line of block */ + int ste_end_col_offset; /* end offset of first line of block */ + int ste_opt_lineno; /* lineno of last exec or import * */ + int ste_opt_col_offset; /* offset of last exec or import * */ + struct symtable *ste_table; +} PySTEntryObject; + +extern PyTypeObject PySTEntry_Type; + +#define PySTEntry_Check(op) Py_IS_TYPE(op, &PySTEntry_Type) + +extern long _PyST_GetSymbol(PySTEntryObject *, PyObject *); +extern int _PyST_GetScope(PySTEntryObject *, PyObject *); + +extern struct symtable* _PySymtable_Build( + struct _mod *mod, + PyObject *filename, + PyFutureFeatures *future); +PyAPI_FUNC(PySTEntryObject *) PySymtable_Lookup(struct symtable *, void *); + +extern void _PySymtable_Free(struct symtable *); + +/* Flags for def-use information */ + +#define DEF_GLOBAL 1 /* global stmt */ +#define DEF_LOCAL 2 /* assignment in code block */ +#define DEF_PARAM 2<<1 /* formal parameter */ +#define DEF_NONLOCAL 2<<2 /* nonlocal stmt */ +#define USE 2<<3 /* name is used */ +#define DEF_FREE 2<<4 /* name used but not defined in nested block */ +#define DEF_FREE_CLASS 2<<5 /* free variable from class's method */ +#define DEF_IMPORT 2<<6 /* assignment occurred via import */ +#define DEF_ANNOT 2<<7 /* this name is annotated */ +#define DEF_COMP_ITER 2<<8 /* this name is a comprehension iteration variable */ + +#define DEF_BOUND (DEF_LOCAL | DEF_PARAM | DEF_IMPORT) + +/* GLOBAL_EXPLICIT and GLOBAL_IMPLICIT are used internally by the symbol + table. GLOBAL is returned from PyST_GetScope() for either of them. + It is stored in ste_symbols at bits 12-15. +*/ +#define SCOPE_OFFSET 11 +#define SCOPE_MASK (DEF_GLOBAL | DEF_LOCAL | DEF_PARAM | DEF_NONLOCAL) + +#define LOCAL 1 +#define GLOBAL_EXPLICIT 2 +#define GLOBAL_IMPLICIT 3 +#define FREE 4 +#define CELL 5 + +#define GENERATOR 1 +#define GENERATOR_EXPRESSION 2 + +// Used by symtablemodule.c +extern struct symtable* _Py_SymtableStringObjectFlags( + const char *str, + PyObject *filename, + int start, + PyCompilerFlags *flags); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_SYMTABLE_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_sysmodule.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_sysmodule.h new file mode 100644 index 0000000000000000000000000000000000000000..10d092cdc30a2c5a931de77b2ab44801672d4383 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_sysmodule.h @@ -0,0 +1,26 @@ +#ifndef Py_INTERNAL_SYSMODULE_H +#define Py_INTERNAL_SYSMODULE_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +PyAPI_FUNC(int) _PySys_Audit( + PyThreadState *tstate, + const char *event, + const char *argFormat, + ...); + +/* We want minimal exposure of this function, so use extern rather than + PyAPI_FUNC() to not export the symbol. */ +extern void _PySys_ClearAuditHooks(PyThreadState *tstate); + +PyAPI_FUNC(int) _PySys_SetAttr(PyObject *, PyObject *); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_SYSMODULE_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_traceback.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_traceback.h new file mode 100644 index 0000000000000000000000000000000000000000..c393b2c136f2de1b600000046326aaa40b31e2a7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_traceback.h @@ -0,0 +1,101 @@ +#ifndef Py_INTERNAL_TRACEBACK_H +#define Py_INTERNAL_TRACEBACK_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +/* Write the Python traceback into the file 'fd'. For example: + + Traceback (most recent call first): + File "xxx", line xxx in + File "xxx", line xxx in + ... + File "xxx", line xxx in + + This function is written for debug purpose only, to dump the traceback in + the worst case: after a segmentation fault, at fatal error, etc. That's why, + it is very limited. Strings are truncated to 100 characters and encoded to + ASCII with backslashreplace. It doesn't write the source code, only the + function name, filename and line number of each frame. Write only the first + 100 frames: if the traceback is truncated, write the line " ...". + + This function is signal safe. */ + +PyAPI_FUNC(void) _Py_DumpTraceback( + int fd, + PyThreadState *tstate); + +/* Write the traceback of all threads into the file 'fd'. current_thread can be + NULL. + + Return NULL on success, or an error message on error. + + This function is written for debug purpose only. It calls + _Py_DumpTraceback() for each thread, and so has the same limitations. It + only write the traceback of the first 100 threads: write "..." if there are + more threads. + + If current_tstate is NULL, the function tries to get the Python thread state + of the current thread. It is not an error if the function is unable to get + the current Python thread state. + + If interp is NULL, the function tries to get the interpreter state from + the current Python thread state, or from + _PyGILState_GetInterpreterStateUnsafe() in last resort. + + It is better to pass NULL to interp and current_tstate, the function tries + different options to retrieve this information. + + This function is signal safe. */ + +PyAPI_FUNC(const char*) _Py_DumpTracebackThreads( + int fd, + PyInterpreterState *interp, + PyThreadState *current_tstate); + +/* Write a Unicode object into the file descriptor fd. Encode the string to + ASCII using the backslashreplace error handler. + + Do nothing if text is not a Unicode object. The function accepts Unicode + string which is not ready (PyUnicode_WCHAR_KIND). + + This function is signal safe. */ +PyAPI_FUNC(void) _Py_DumpASCII(int fd, PyObject *text); + +/* Format an integer as decimal into the file descriptor fd. + + This function is signal safe. */ +PyAPI_FUNC(void) _Py_DumpDecimal( + int fd, + size_t value); + +/* Format an integer as hexadecimal with width digits into fd file descriptor. + The function is signal safe. */ +PyAPI_FUNC(void) _Py_DumpHexadecimal( + int fd, + uintptr_t value, + Py_ssize_t width); + +PyAPI_FUNC(PyObject*) _PyTraceBack_FromFrame( + PyObject *tb_next, + PyFrameObject *frame); + +#define EXCEPTION_TB_HEADER "Traceback (most recent call last):\n" +#define EXCEPTION_GROUP_TB_HEADER "Exception Group Traceback (most recent call last):\n" + +/* Write the traceback tb to file f. Prefix each line with + indent spaces followed by the margin (if it is not NULL). */ +PyAPI_FUNC(int) _PyTraceBack_Print_Indented( + PyObject *tb, int indent, const char* margin, + const char *header_margin, const char *header, PyObject *f); +PyAPI_FUNC(int) _Py_WriteIndentedMargin(int, const char*, PyObject *); +PyAPI_FUNC(int) _Py_WriteIndent(int, PyObject *); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_TRACEBACK_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_tuple.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_tuple.h new file mode 100644 index 0000000000000000000000000000000000000000..1efe4fa2bdef943e407e127c8c202748f380bc82 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_tuple.h @@ -0,0 +1,73 @@ +#ifndef Py_INTERNAL_TUPLE_H +#define Py_INTERNAL_TUPLE_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "tupleobject.h" /* _PyTuple_CAST() */ + + +/* runtime lifecycle */ + +extern PyStatus _PyTuple_InitGlobalObjects(PyInterpreterState *); +extern PyStatus _PyTuple_InitTypes(PyInterpreterState *); +extern void _PyTuple_Fini(PyInterpreterState *); + + +/* other API */ + +// PyTuple_MAXSAVESIZE - largest tuple to save on free list +// PyTuple_MAXFREELIST - maximum number of tuples of each size to save + +#if defined(PyTuple_MAXSAVESIZE) && PyTuple_MAXSAVESIZE <= 0 + // A build indicated that tuple freelists should not be used. +# define PyTuple_NFREELISTS 0 +# undef PyTuple_MAXSAVESIZE +# undef PyTuple_MAXFREELIST + +#elif !defined(WITH_FREELISTS) +# define PyTuple_NFREELISTS 0 +# undef PyTuple_MAXSAVESIZE +# undef PyTuple_MAXFREELIST + +#else + // We are using a freelist for tuples. +# ifndef PyTuple_MAXSAVESIZE +# define PyTuple_MAXSAVESIZE 20 +# endif +# define PyTuple_NFREELISTS PyTuple_MAXSAVESIZE +# ifndef PyTuple_MAXFREELIST +# define PyTuple_MAXFREELIST 2000 +# endif +#endif + +struct _Py_tuple_state { +#if PyTuple_NFREELISTS > 0 + /* There is one freelist for each size from 1 to PyTuple_MAXSAVESIZE. + The empty tuple is handled separately. + + Each tuple stored in the array is the head of the linked list + (and the next available tuple) for that size. The actual tuple + object is used as the linked list node, with its first item + (ob_item[0]) pointing to the next node (i.e. the previous head). + Each linked list is initially NULL. */ + PyTupleObject *free_list[PyTuple_NFREELISTS]; + int numfree[PyTuple_NFREELISTS]; +#else + char _unused; // Empty structs are not allowed. +#endif +}; + +#define _PyTuple_ITEMS(op) (_PyTuple_CAST(op)->ob_item) + +extern PyObject *_PyTuple_FromArray(PyObject *const *, Py_ssize_t); +extern PyObject *_PyTuple_FromArraySteal(PyObject *const *, Py_ssize_t); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_TUPLE_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_typeobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_typeobject.h new file mode 100644 index 0000000000000000000000000000000000000000..c480a3a57b436c958f7db7c2a0b1cb2acfa7cda7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_typeobject.h @@ -0,0 +1,50 @@ +#ifndef Py_INTERNAL_TYPEOBJECT_H +#define Py_INTERNAL_TYPEOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + + +/* runtime lifecycle */ + +extern PyStatus _PyTypes_InitState(PyInterpreterState *); +extern PyStatus _PyTypes_InitTypes(PyInterpreterState *); +extern void _PyTypes_FiniTypes(PyInterpreterState *); +extern void _PyTypes_Fini(PyInterpreterState *); + + +/* other API */ + +// Type attribute lookup cache: speed up attribute and method lookups, +// see _PyType_Lookup(). +struct type_cache_entry { + unsigned int version; // initialized from type->tp_version_tag + PyObject *name; // reference to exactly a str or None + PyObject *value; // borrowed reference or NULL +}; + +#define MCACHE_SIZE_EXP 12 +#define MCACHE_STATS 0 + +struct type_cache { + struct type_cache_entry hashtable[1 << MCACHE_SIZE_EXP]; +#if MCACHE_STATS + size_t hits; + size_t misses; + size_t collisions; +#endif +}; + +extern PyStatus _PyTypes_InitSlotDefs(void); + +extern void _PyStaticType_Dealloc(PyTypeObject *type); + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_TYPEOBJECT_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_ucnhash.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_ucnhash.h new file mode 100644 index 0000000000000000000000000000000000000000..187dd68e7347ff3fc90371de01d367dc9b5f0338 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_ucnhash.h @@ -0,0 +1,34 @@ +/* Unicode name database interface */ +#ifndef Py_INTERNAL_UCNHASH_H +#define Py_INTERNAL_UCNHASH_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +/* revised ucnhash CAPI interface (exported through a "wrapper") */ + +#define PyUnicodeData_CAPSULE_NAME "unicodedata._ucnhash_CAPI" + +typedef struct { + + /* Get name for a given character code. + Returns non-zero if success, zero if not. + Does not set Python exceptions. */ + int (*getname)(Py_UCS4 code, char* buffer, int buflen, + int with_alias_and_seq); + + /* Get character code for a given name. + Same error handling as for getname(). */ + int (*getcode)(const char* name, int namelen, Py_UCS4* code, + int with_named_seq); + +} _PyUnicode_Name_CAPI; + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_UCNHASH_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_unicodeobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_unicodeobject.h new file mode 100644 index 0000000000000000000000000000000000000000..4bee2419fbd98acd5f43d20f32435028da19823b --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_unicodeobject.h @@ -0,0 +1,62 @@ +#ifndef Py_INTERNAL_UNICODEOBJECT_H +#define Py_INTERNAL_UNICODEOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_fileutils.h" // _Py_error_handler + +void _PyUnicode_ExactDealloc(PyObject *op); + +/* runtime lifecycle */ + +extern void _PyUnicode_InitState(PyInterpreterState *); +extern PyStatus _PyUnicode_InitGlobalObjects(PyInterpreterState *); +extern PyStatus _PyUnicode_InitTypes(PyInterpreterState *); +extern void _PyUnicode_Fini(PyInterpreterState *); +extern void _PyUnicode_FiniTypes(PyInterpreterState *); +extern void _PyStaticUnicode_Dealloc(PyObject *); + +extern PyTypeObject _PyUnicodeASCIIIter_Type; + +/* other API */ + +struct _Py_unicode_runtime_ids { + PyThread_type_lock lock; + // next_index value must be preserved when Py_Initialize()/Py_Finalize() + // is called multiple times: see _PyUnicode_FromId() implementation. + Py_ssize_t next_index; +}; + +/* fs_codec.encoding is initialized to NULL. + Later, it is set to a non-NULL string by _PyUnicode_InitEncodings(). */ +struct _Py_unicode_fs_codec { + char *encoding; // Filesystem encoding (encoded to UTF-8) + int utf8; // encoding=="utf-8"? + char *errors; // Filesystem errors (encoded to UTF-8) + _Py_error_handler error_handler; +}; + +struct _Py_unicode_ids { + Py_ssize_t size; + PyObject **array; +}; + +struct _Py_unicode_state { + struct _Py_unicode_fs_codec fs_codec; + + // Unicode identifiers (_Py_Identifier): see _PyUnicode_FromId() + struct _Py_unicode_ids ids; +}; + +extern void _PyUnicode_ClearInterned(PyInterpreterState *interp); + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_UNICODEOBJECT_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_unionobject.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_unionobject.h new file mode 100644 index 0000000000000000000000000000000000000000..a9ed5651a410e87c6ded94de37af2d1af3d559f0 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_unionobject.h @@ -0,0 +1,23 @@ +#ifndef Py_INTERNAL_UNIONOBJECT_H +#define Py_INTERNAL_UNIONOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +extern PyTypeObject _PyUnion_Type; +#define _PyUnion_Check(op) Py_IS_TYPE(op, &_PyUnion_Type) +extern PyObject *_Py_union_type_or(PyObject *, PyObject *); + +#define _PyGenericAlias_Check(op) PyObject_TypeCheck(op, &Py_GenericAliasType) +extern PyObject *_Py_subs_parameters(PyObject *, PyObject *, PyObject *, PyObject *); +extern PyObject *_Py_make_parameters(PyObject *); +extern PyObject *_Py_union_args(PyObject *self); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_UNIONOBJECT_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_warnings.h b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_warnings.h new file mode 100644 index 0000000000000000000000000000000000000000..efb4f1cd7eac80ad20c2b15a33bb7f4dc8746725 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/include/internal/pycore_warnings.h @@ -0,0 +1,29 @@ +#ifndef Py_INTERNAL_WARNINGS_H +#define Py_INTERNAL_WARNINGS_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +struct _warnings_runtime_state { + /* Both 'filters' and 'onceregistry' can be set in warnings.py; + get_warnings_attr() will reset these variables accordingly. */ + PyObject *filters; /* List */ + PyObject *once_registry; /* Dict */ + PyObject *default_action; /* String */ + long filters_version; +}; + +extern int _PyWarnings_InitState(PyInterpreterState *interp); + +PyAPI_FUNC(PyObject*) _PyWarnings_Init(void); + +extern void _PyErr_WarnUnawaitedCoroutine(PyObject *coro); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_WARNINGS_H */ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/licenses/LICENSE b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..f26bcf4d2de6eb136e31006ca3ab447d5e488adf --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/licenses/LICENSE @@ -0,0 +1,279 @@ +A. HISTORY OF THE SOFTWARE +========================== + +Python was created in the early 1990s by Guido van Rossum at Stichting +Mathematisch Centrum (CWI, see https://www.cwi.nl) in the Netherlands +as a successor of a language called ABC. Guido remains Python's +principal author, although it includes many contributions from others. + +In 1995, Guido continued his work on Python at the Corporation for +National Research Initiatives (CNRI, see https://www.cnri.reston.va.us) +in Reston, Virginia where he released several versions of the +software. + +In May 2000, Guido and the Python core development team moved to +BeOpen.com to form the BeOpen PythonLabs team. In October of the same +year, the PythonLabs team moved to Digital Creations, which became +Zope Corporation. In 2001, the Python Software Foundation (PSF, see +https://www.python.org/psf/) was formed, a non-profit organization +created specifically to own Python-related Intellectual Property. +Zope Corporation was a sponsoring member of the PSF. + +All Python releases are Open Source (see https://opensource.org for +the Open Source Definition). Historically, most, but not all, Python +releases have also been GPL-compatible; the table below summarizes +the various releases. + + Release Derived Year Owner GPL- + from compatible? (1) + + 0.9.0 thru 1.2 1991-1995 CWI yes + 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes + 1.6 1.5.2 2000 CNRI no + 2.0 1.6 2000 BeOpen.com no + 1.6.1 1.6 2001 CNRI yes (2) + 2.1 2.0+1.6.1 2001 PSF no + 2.0.1 2.0+1.6.1 2001 PSF yes + 2.1.1 2.1+2.0.1 2001 PSF yes + 2.1.2 2.1.1 2002 PSF yes + 2.1.3 2.1.2 2002 PSF yes + 2.2 and above 2.1.1 2001-now PSF yes + +Footnotes: + +(1) GPL-compatible doesn't mean that we're distributing Python under + the GPL. All Python licenses, unlike the GPL, let you distribute + a modified version without making your changes open source. The + GPL-compatible licenses make it possible to combine Python with + other software that is released under the GPL; the others don't. + +(2) According to Richard Stallman, 1.6.1 is not GPL-compatible, + because its license has a choice of law clause. According to + CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1 + is "not incompatible" with the GPL. + +Thanks to the many outside volunteers who have worked under Guido's +direction to make these releases possible. + + +B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON +=============================================================== + +Python software and documentation are licensed under the +Python Software Foundation License Version 2. + +Starting with Python 3.8.6, examples, recipes, and other code in +the documentation are dual licensed under the PSF License Version 2 +and the Zero-Clause BSD license. + +Some software incorporated into Python is under different licenses. +The licenses are listed with code falling under that license. + + +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +-------------------------------------------- + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +otherwise using this software ("Python") in source or binary form and +its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Python Software Foundation; +All Rights Reserved" are retained in Python alone or in any derivative version +prepared by Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python. + +4. PSF is making Python available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 +------------------------------------------- + +BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 + +1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an +office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the +Individual or Organization ("Licensee") accessing and otherwise using +this software in source or binary form and its associated +documentation ("the Software"). + +2. Subject to the terms and conditions of this BeOpen Python License +Agreement, BeOpen hereby grants Licensee a non-exclusive, +royalty-free, world-wide license to reproduce, analyze, test, perform +and/or display publicly, prepare derivative works, distribute, and +otherwise use the Software alone or in any derivative version, +provided, however, that the BeOpen Python License is retained in the +Software, alone or in any derivative version prepared by Licensee. + +3. BeOpen is making the Software available to Licensee on an "AS IS" +basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE +SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS +AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY +DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +5. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +6. This License Agreement shall be governed by and interpreted in all +respects by the law of the State of California, excluding conflict of +law provisions. Nothing in this License Agreement shall be deemed to +create any relationship of agency, partnership, or joint venture +between BeOpen and Licensee. This License Agreement does not grant +permission to use BeOpen trademarks or trade names in a trademark +sense to endorse or promote products or services of Licensee, or any +third party. As an exception, the "BeOpen Python" logos available at +http://www.pythonlabs.com/logos.html may be used according to the +permissions granted on that web page. + +7. By copying, installing or otherwise using the software, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 +--------------------------------------- + +1. This LICENSE AGREEMENT is between the Corporation for National +Research Initiatives, having an office at 1895 Preston White Drive, +Reston, VA 20191 ("CNRI"), and the Individual or Organization +("Licensee") accessing and otherwise using Python 1.6.1 software in +source or binary form and its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, CNRI +hereby grants Licensee a nonexclusive, royalty-free, world-wide +license to reproduce, analyze, test, perform and/or display publicly, +prepare derivative works, distribute, and otherwise use Python 1.6.1 +alone or in any derivative version, provided, however, that CNRI's +License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) +1995-2001 Corporation for National Research Initiatives; All Rights +Reserved" are retained in Python 1.6.1 alone or in any derivative +version prepared by Licensee. Alternately, in lieu of CNRI's License +Agreement, Licensee may substitute the following text (omitting the +quotes): "Python 1.6.1 is made available subject to the terms and +conditions in CNRI's License Agreement. This Agreement together with +Python 1.6.1 may be located on the internet using the following +unique, persistent identifier (known as a handle): 1895.22/1013. This +Agreement may also be obtained from a proxy server on the internet +using the following URL: http://hdl.handle.net/1895.22/1013". + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python 1.6.1 or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python 1.6.1. + +4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" +basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. This License Agreement shall be governed by the federal +intellectual property law of the United States, including without +limitation the federal copyright law, and, to the extent such +U.S. federal law does not apply, by the law of the Commonwealth of +Virginia, excluding Virginia's conflict of law provisions. +Notwithstanding the foregoing, with regard to derivative works based +on Python 1.6.1 that incorporate non-separable material that was +previously distributed under the GNU General Public License (GPL), the +law of the Commonwealth of Virginia shall govern this License +Agreement only as to issues arising under or with respect to +Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this +License Agreement shall be deemed to create any relationship of +agency, partnership, or joint venture between CNRI and Licensee. This +License Agreement does not grant permission to use CNRI trademarks or +trade name in a trademark sense to endorse or promote products or +services of Licensee, or any third party. + +8. By clicking on the "ACCEPT" button where indicated, or by copying, +installing or otherwise using Python 1.6.1, Licensee agrees to be +bound by the terms and conditions of this License Agreement. + + ACCEPT + + +CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 +-------------------------------------------------- + +Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, +The Netherlands. 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 Stichting Mathematisch +Centrum or CWI not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM 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. + +ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON DOCUMENTATION +---------------------------------------------------------------------- + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +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. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/build_base.bat b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/build_base.bat new file mode 100644 index 0000000000000000000000000000000000000000..d32d8c596210072974fb564f04ce5d415d990933 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/build_base.bat @@ -0,0 +1,212 @@ +setlocal EnableDelayedExpansion +echo on + +:: brand Python with conda-forge startup message +%SYS_PYTHON% %RECIPE_DIR%\brand_python.py +if errorlevel 1 exit 1 + +:: Compile python, extensions and external libraries +if "%ARCH%"=="64" ( + set PLATFORM=x64 + set VC_PATH=x64 + set BUILD_PATH=amd64 +) else ( + set PLATFORM=Win32 + set VC_PATH=x86 + set BUILD_PATH=win32 +) + +for /F "tokens=1,2 delims=." %%i in ("%PKG_VERSION%") do ( + set "VERNODOTS=%%i%%j" +) + +:: Make sure the "python" value in conda_build_config.yaml is up to date. +for /F "tokens=1,2 delims=." %%i in ("%PKG_VERSION%") do ( + if NOT "%PY_VER%"=="%%i.%%j" exit 1 +) + +for /f "usebackq delims=" %%i in (`conda list -p %PREFIX% sqlite --no-show-channel-urls --json ^| findstr "version"`) do set SQLITE3_VERSION_LINE=%%i +for /f "tokens=2 delims==/ " %%i IN ('echo %SQLITE3_VERSION_LINE%') do (set SQLITE3_VERSION=%%~i) +echo SQLITE3_VERSION detected as %SQLITE3_VERSION% + +if "%PY_INTERP_DEBUG%"=="yes" ( + set CONFIG=-d + set _D=_d +) else ( + set CONFIG= + set _D= +) + + +if "%DEBUG_C%"=="yes" ( + set PGO= +) else ( + set PGO=--pgo +) + +:: AP doesn't support PGO atm? +set PGO= + +cd PCbuild + +:: Twice because: +:: error : importlib_zipimport.h updated. You will need to rebuild pythoncore to see the changes. +call build.bat %PGO% %CONFIG% -m -e -v -p %PLATFORM% +call build.bat %PGO% %CONFIG% -m -e -v -p %PLATFORM% +if errorlevel 1 exit 1 +cd .. + +:: Populate the root package directory +for %%x in (python%VERNODOTS%%_D%.dll python3%_D%.dll python%_D%.exe pythonw%_D%.exe) do ( + if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\%%x ( + copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\%%x %PREFIX% + ) else ( + echo "WARNING :: %SRC_DIR%\PCbuild\%BUILD_PATH%\%%x does not exist" + ) +) + +for %%x in (python%_D%.pdb python%VERNODOTS%%_D%.pdb pythonw%_D%.pdb) do ( + if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\%%x ( + copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\%%x %PREFIX% + ) else ( + echo "WARNING :: %SRC_DIR%\PCbuild\%BUILD_PATH%\%%x does not exist" + ) +) + +copy %SRC_DIR%\LICENSE %PREFIX%\LICENSE_PYTHON.txt +if errorlevel 1 exit 1 + +:: Populate the DLLs directory +mkdir %PREFIX%\DLLs +xcopy /s /y %SRC_DIR%\PCBuild\%BUILD_PATH%\*.pyd %PREFIX%\DLLs\ +if errorlevel 1 exit 1 + +copy /Y %SRC_DIR%\PC\icons\py.ico %PREFIX%\DLLs\ +if errorlevel 1 exit 1 +copy /Y %SRC_DIR%\PC\icons\pyc.ico %PREFIX%\DLLs\ +if errorlevel 1 exit 1 + + +:: Populate the Tools directory +mkdir %PREFIX%\Tools +xcopy /s /y /i %SRC_DIR%\Tools\demo %PREFIX%\Tools\demo +if errorlevel 1 exit 1 +xcopy /s /y /i %SRC_DIR%\Tools\i18n %PREFIX%\Tools\i18n +if errorlevel 1 exit 1 +xcopy /s /y /i %SRC_DIR%\Tools\scripts %PREFIX%\Tools\scripts +if errorlevel 1 exit 1 + +del %PREFIX%\Tools\demo\README +if errorlevel 1 exit 1 +del %PREFIX%\Tools\scripts\README +if errorlevel 1 exit 1 +del %PREFIX%\Tools\scripts\dutree.doc +if errorlevel 1 exit 1 +del %PREFIX%\Tools\scripts\idle3 +if errorlevel 1 exit 1 + +move /y %PREFIX%\Tools\scripts\2to3 %PREFIX%\Tools\scripts\2to3.py +if errorlevel 1 exit 1 +move /y %PREFIX%\Tools\scripts\pydoc3 %PREFIX%\Tools\scripts\pydoc3.py +if errorlevel 1 exit 1 + +:: Populate the include directory +xcopy /s /y %SRC_DIR%\Include %PREFIX%\include\ +if errorlevel 1 exit 1 + +copy /Y %SRC_DIR%\PC\pyconfig.h %PREFIX%\include\ +if errorlevel 1 exit 1 + +:: Populate the Scripts directory +if not exist %SCRIPTS% (mkdir %SCRIPTS%) +if errorlevel 1 exit 1 + +for %%x in (idle pydoc) do ( + copy /Y %SRC_DIR%\Tools\scripts\%%x3 %SCRIPTS%\%%x + if errorlevel 1 exit 1 +) + +copy /Y %SRC_DIR%\Tools\scripts\2to3 %SCRIPTS% +if errorlevel 1 exit 1 + +:: Populate the libs directory +if not exist %PREFIX%\libs mkdir %PREFIX%\libs +if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\python%VERNODOTS%%_D%.lib copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\python%VERNODOTS%%_D%.lib %PREFIX%\libs\ +if errorlevel 1 exit 1 +if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\python3%_D%.lib copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\python3%_D%.lib %PREFIX%\libs\ +if errorlevel 1 exit 1 +if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\_tkinter%_D%.lib copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\_tkinter%_D%.lib %PREFIX%\libs\ +if errorlevel 1 exit 1 + + +:: Populate the Lib directory +del %PREFIX%\libs\libpython*.a +xcopy /s /y %SRC_DIR%\Lib %PREFIX%\Lib\ +if errorlevel 1 exit 1 + +:: Copy venv[w]launcher scripts to venv\srcipts\nt +if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\venvlauncher%_D%.exe ( + copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\venvlauncher%_D%.exe %PREFIX%\Lib\venv\scripts\nt\python.exe +) else ( + echo "WARNING :: %SRC_DIR%\PCbuild\%BUILD_PATH%\venvlauncher%_D%.exe does not exist" +) + +if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\venvwlauncher%_D%.exe ( + copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\venvwlauncher%_D%.exe %PREFIX%\Lib\venv\scripts\nt\pythonw.exe +) else ( + echo "WARNING :: %SRC_DIR%\PCbuild\%BUILD_PATH%\venvwlauncher%_D%.exe does not exist" +) + + +:: Remove test data to save space. +:: Though keep `support` as some things use that. +mkdir %PREFIX%\Lib\test_keep +if errorlevel 1 exit 1 +move %PREFIX%\Lib\test\__init__.py %PREFIX%\Lib\test_keep\ +if errorlevel 1 exit 1 +move %PREFIX%\Lib\test\support %PREFIX%\Lib\test_keep\ +if errorlevel 1 exit 1 +rd /s /q %PREFIX%\Lib\test +if errorlevel 1 exit 1 +move %PREFIX%\Lib\test_keep %PREFIX%\Lib\test +if errorlevel 1 exit 1 +rd /s /q %PREFIX%\Lib\lib2to3\tests\ +if errorlevel 1 exit 1 + +:: bytecode compile the standard library + +rd /s /q %PREFIX%\Lib\lib2to3\tests\ +if errorlevel 1 exit 1 + +:: We need our Python to be found! +if "%_D%" neq "" copy %PREFIX%\python%_D%.exe %PREFIX%\python.exe + +%PREFIX%\python.exe -Wi %PREFIX%\Lib\compileall.py -f -q -x "bad_coding|badsyntax|py2_" %PREFIX%\Lib +if errorlevel 1 exit 1 + +:: Pickle lib2to3 Grammar +%PREFIX%\python.exe -m lib2to3 --help + +:: Ensure that scripts are generated +:: https://github.com/conda-forge/python-feedstock/issues/384 +%PREFIX%\python.exe %RECIPE_DIR%\fix_staged_scripts.py +if errorlevel 1 exit 1 + +:: Some quick tests for common failures +echo "Testing print() does not print: Hello" +%CONDA_EXE% run -p %PREFIX% cd %PREFIX% & %PREFIX%\python.exe -c "print()" 2>&1 | findstr /r /c:"Hello" +if %errorlevel% neq 1 exit /b 1 + +echo "Testing print('Hello') prints: Hello" +%CONDA_EXE% run -p %PREFIX% cd %PREFIX% & %PREFIX%\python.exe "print('Hello')" 2>&1 | findstr /r /c:"Hello" +if %errorlevel% neq 0 exit /b 1 + +echo "Testing import of os (no DLL needed) does not print: The specified module could not be found" +%CONDA_EXE% run -p %PREFIX% cd %PREFIX% & %PREFIX%\python.exe -v -c "import os" 2>&1 +%CONDA_EXE% run -p %PREFIX% cd %PREFIX% & %PREFIX%\python.exe -v -c "import os" 2>&1 | findstr /r /c:"The specified module could not be found" +if %errorlevel% neq 1 exit /b 1 + +echo "Testing import of _sqlite3 (DLL located via PATH needed) does not print: The specified module could not be found" +%CONDA_EXE% run -p %PREFIX% cd %PREFIX% & %PREFIX%\python.exe -v -c "import _sqlite3" 2>&1 +%CONDA_EXE% run -p %PREFIX% cd %PREFIX% & %PREFIX%\python.exe -v -c "import _sqlite3" 2>&1 | findstr /r /c:"The specified module could not be found" +if %errorlevel% neq 1 exit /b 1 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/conda_build_config.yaml b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5e67a39e6903cd458080c7158ed309d38eeb2519 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/conda_build_config.yaml @@ -0,0 +1,46 @@ +CI: azure +CONDA_BUILD_SKIP_TESTS: '0' +build_type: release +bzip2: '1' +c_compiler: vs2022 +c_stdlib: vs +channel_sources: conda-forge +channel_targets: conda-forge main +cpu_optimization_target: nocona +cran_mirror: https://cran.r-project.org +cxx_compiler: vs2022 +expat: '2' +extend_keys: +- extend_keys +- pin_run_as_build +- ignore_build_only_deps +- ignore_version +fortran_compiler: gfortran +ignore_build_only_deps: +- python +- numpy +is_python_min: 'no' +libffi: '3.5' +liblzma_devel: '5' +lua: '5' +numpy: '1.16' +openssl: '3.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 +python: '3.11' +python_impl: cpython +r_base: '3.4' +sqlite: '3' +target_platform: win-64 +tk: '8.6' +vc: '14' +zip_keys: +- - build_type + - channel_targets +zlib: '1' diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/meta.yaml b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..06cfc5ea4e38410c9ba8d583f53e81486e1b9be6 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/meta.yaml @@ -0,0 +1,191 @@ +# This file created by conda-build 26.1.0 +# ------------------------------------------------ + +package: + name: python + version: 3.11.15 +source: + - url: https://www.python.org/ftp/python/3.11.15/Python-3.11.15.tar.xz + sha256: 272179ddd9a2e41a0fc8e42e33dfbdca0b3711aa5abf372d3f2d51543d09b625 + patches: + - patches/0001-Win32-Change-FD_SETSIZE-from-512-to-2048.patch + - patches/0002-Win32-distutils-Add-support-to-cygwinccompiler-for-V.patch + - patches/0003-bpo-45258-search-for-isysroot-in-addition-to-sysroot.patch + - patches/0004-runtime_library_dir_option-Use-1st-word-of-CC-as-com.patch + - patches/0005-Win32-Do-not-download-externals.patch + - patches/0006-Fix-find_library-so-that-it-looks-in-sys.prefix-lib-.patch + - patches/0007-bpo-22699-Allow-compiling-on-debian-ubuntu-with-a-di.patch + - patches/0008-Disable-registry-lookup-unless-CONDA_PY_ALLOW_REG_PA.patch + - patches/0009-Unvendor-openssl.patch + - patches/0010-Unvendor-sqlite3.patch + - patches/0011-Use-ranlib-from-env-if-env-variable-is-set.patch + - patches/0012-Add-CondaEcosystemModifyDllSearchPath.patch + - patches/0013-Add-d1trimfile-SRC_DIR-to-make-pdbs-more-relocatable.patch + - patches/0014-Doing-d1trimfile.patch + - patches/0015-cross-compile-darwin.patch + - patches/0016-Fix-TZPATH-on-windows.patch + - patches/0017-Make-dyld-search-work-with-SYSTEM_VERSION_COMPAT-1.patch + - patches/0018-Fix-LDSHARED-when-CC-is-overriden-on-Linux-too.patch + - patches/0019-Unvendor-bzip2.patch + - patches/0020-Unvendor-libffi.patch + - patches/0021-Unvendor-tcltk.patch + - patches/0022-unvendor-xz.patch + - patches/0023-unvendor-zlib.patch + - patches/0024-Do-not-pass-g-to-GCC-when-not-Py_DEBUG.patch + - patches/0025-Unvendor-expat.patch + - patches/0026-Do-not-define-pid_t-as-it-might-conflict-with-the-ac.patch +build: + number: 0 + activate_in_script: true + no_link: + - DLLs/_ctypes.pyd + ignore_run_exports_from: null + detect_binary_files_with_prefix: true + skip_compile_pyc: null + string: h0159041_0_cpython + run_exports: + noarch: + - python + weak: + - python_abi 3.11.* *_cp311 + script_env: + - CONDA_FORGE=yes + - PY_INTERP_DEBUG=no + - PY_INTERP_LINKAGE_NATURE=static + missing_dso_whitelist: + - '**/MSVCR71.dll' + - '**/MSVCR80.dll' + - '**/api-ms-win-core-path-l1-1-0.dll' +requirements: + build: + - vs2022_win-64 19.44.35207 ha74f236_34 + - vs_win-64 2022.14 ha74f236_34 + - vswhere 3.1.7 h40126e0_1 + host: + - bzip2 1.0.8 h0ad9c76_9 + - ca-certificates 2026.2.25 h4c7d964_0 + - expat 2.7.4 hac47afa_0 + - libexpat 2.7.4 hac47afa_0 + - libffi 3.5.2 h3d046cb_0 + - liblzma 5.8.2 hfd05255_0 + - liblzma-devel 5.8.2 hfd05255_0 + - libsqlite 3.51.2 hf5d6505_0 + - libzlib 1.3.1 h2466b09_2 + - openssl 3.5.5 hf411b9b_1 + - sqlite 3.51.2 hdb435a2_0 + - tk 8.6.13 h6ed50ae_3 + - ucrt 10.0.26100.0 h57928b3_0 + - vc 14.3 h41ae7f8_34 + - vc14_runtime 14.44.35208 h818238b_34 + - vcomp14 14.44.35208 h818238b_34 + - zlib 1.3.1 h2466b09_2 + run: + - bzip2 >=1.0.8,<2.0a0 + - libexpat >=2.7.4,<3.0a0 + - libffi >=3.5.2,<3.6.0a0 + - liblzma >=5.8.2,<6.0a0 + - libsqlite >=3.51.2,<4.0a0 + - libzlib >=1.3.1,<2.0a0 + - openssl >=3.5.5,<4.0a0 + - tk >=8.6.13,<8.7.0a0 + - tzdata + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + run_constrained: + - python_abi 3.11.* *_cp311 +test: + downstreams: + - cython + - setuptools + requires: + - cmake + - ninja + - ripgrep + - vs2022_win-64 + - vs_win-64 + files: + - run_test.py + - tests/cmake/* + - tests/cython/* + - tests/distutils/* + - tests/prefix-replacement/* + commands: + - echo on + - set + - python -V + - 2to3 -h + - pydoc -h + - set "PIP_NO_BUILD_ISOLATION=False" + - set "PIP_NO_DEPENDENCIES=True" + - set "PIP_IGNORE_INSTALLED=True" + - set "PIP_NO_INDEX=True" + - set "PIP_CACHE_DIR=%CONDA_PREFIX%/pip_cache" + - set "TEMP=%CONDA_PREFIX%/tmp" + - mkdir "%TEMP%" + - python -Im ensurepip --upgrade --default-pip + - python -c "from zoneinfo import ZoneInfo; from datetime import datetime; dt + = datetime(2020, 10, 31, 12, tzinfo=ZoneInfo('America/Los_Angeles')); print(dt.tzname())" + - python -m venv test-venv + - test-venv\\Scripts\\python.exe -c "import ctypes" + - if exist %PREFIX%\\Scripts\\pydoc exit 1 + - if exist %PREFIX%\\Scripts\\idle exit 1 + - if exist %PREFIX%\\Scripts\\2to3 exit 1 + - if not exist %PREFIX%\\Scripts\\pydoc-script.py exit 1 + - if not exist %PREFIX%\\Scripts\\idle-script.py exit 1 + - if not exist %PREFIX%\\Scripts\\2to3-script.py exit 1 + - if not exist %PREFIX%\\Scripts\\idle.exe exit 1 + - if not exist %PREFIX%\\Scripts\\2to3.exe exit 1 + - if not exist %PREFIX%\\Scripts\\pydoc.exe exit 1 + - pushd tests + - pushd distutils + - python setup.py install -v -v + - python -c "import foobar" + - popd + - pushd cmake + - cmake -GNinja -DPY_VER=3.11.15 + - popd + - popd + - python run_test.py + - python -c "from ctypes import CFUNCTYPE; CFUNCTYPE(None)(id)" +about: + home: https://www.python.org/ + license: Python-2.0 + license_file: LICENSE + summary: General purpose programming language + description: 'Python is a widely used high-level, general-purpose, interpreted, + dynamic + + programming language. Its design philosophy emphasizes code + + readability, and its syntax allows programmers to express concepts in + + fewer lines of code than would be possible in languages such as C++ or + + Java. The language provides constructs intended to enable clear programs + + on both a small and large scale. + + ' + doc_url: https://www.python.org/doc/versions/ + doc_source_url: https://github.com/python/pythondotorg/blob/master/docs/source/index.rst + dev_url: https://docs.python.org/devguide/ +extra: + feedstock-name: python + recipe-maintainers: + - chrisburr + - isuruf + - jakirkham + - katietz + - mbargull + - mingwandroid + - msarahan + - ocefpaf + - pelson + - scopatz + - xhochy + final: true + copy_test_source_files: true + flow_run_id: azure_20260305.2.1 + remote_url: https://github.com/conda-forge/python-feedstock + sha: a2cdf39f64e5f9a058b2741a7d840d5cac2fbed8 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/.gitattributes b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..b224c6d8fc9cd715d608f89d0e5c307d8154bf2f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/.gitattributes @@ -0,0 +1,24 @@ +* text=auto + +*.patch binary +*.diff binary +meta.yaml text eol=lf +build.sh text eol=lf +bld.bat text eol=crlf + +# github helper pieces to make some files not show up in diffs automatically +.azure-pipelines/* linguist-generated=true +.circleci/* linguist-generated=true +.drone/* linguist-generated=true +.drone.yml linguist-generated=true +.github/* linguist-generated=true +.travis/* linguist-generated=true +.appveyor.yml linguist-generated=true +.gitattributes linguist-generated=true +.gitignore linguist-generated=true +.travis.yml linguist-generated=true +LICENSE.txt linguist-generated=true +README.md linguist-generated=true +azure-pipelines.yml linguist-generated=true +build-locally.py linguist-generated=true +shippable.yml linguist-generated=true diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/.gitignore b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..8393e98dce5219cda7ea2f7f1360a9936d19f078 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/.gitignore @@ -0,0 +1,3 @@ +*.pyc + +build_artifacts diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/LICENSE.txt b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..f6c152a191ca636ae911804d8abf3ae8e642c7d7 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/LICENSE.txt @@ -0,0 +1,13 @@ +BSD 3-clause license +Copyright (c) 2015-2017, 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/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/brand_python.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/brand_python.py new file mode 100644 index 0000000000000000000000000000000000000000..4b1c5d75ccaf6a21b822758190e018dbe561baee --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/brand_python.py @@ -0,0 +1,41 @@ +import argparse +import os +import re + + +platform_file = os.path.join('Lib', 'platform.py') +get_version_file = os.path.join('Python', 'getversion.c') + + +def patch_platform(msg): + with open(platform_file, 'r') as fh: + lines = list(fh) + + lines_it = iter(lines) + with open(platform_file, 'w') as fh: + for line in lines_it: + fh.write(line) + if line.startswith('_sys_version_parser'): + next_line = next(lines_it) + fh.write(" r'([\w.+]+)\s*" + '(?:' + re.escape(' ' + msg) + ')?' + "\s*'\n") + +def patch_get_version(msg): + with open(get_version_file, 'r') as fh: + content = list(fh) + + lines = iter(content) + with open(get_version_file, 'w') as fh: + for line in lines: + if line.strip().startswith('PyOS_snprintf(version, sizeof(version)'): + fh.write(' PyOS_snprintf(version, sizeof(version),\n') + fh.write(' "%.80s ' + msg.replace('"', '\\"') + ' (%.80s) %.80s",\n') + else: + fh.write(line) + + +msg = os.environ.get('python_branding', '') +if msg == '': + msg = "| packaged by conda-forge |" + +patch_platform(msg) +patch_get_version(msg) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/build-locally.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/build-locally.py new file mode 100644 index 0000000000000000000000000000000000000000..689e3373ddffd4af20236f8d34ae74a45dc43fcb --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/build-locally.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python3 +# +# This file has been generated by conda-smithy in order to build the recipe +# locally. +# +import os +import glob +import subprocess +from argparse import ArgumentParser + + +def setup_environment(ns): + os.environ["CONFIG"] = ns.config + os.environ["UPLOAD_PACKAGES"] = "False" + + +def run_docker_build(ns): + script = ".scripts/run_docker_build.sh" + subprocess.check_call([script]) + + +def verify_config(ns): + valid_configs = { + os.path.basename(f)[:-5] for f in glob.glob(".ci_support/*.yaml") + } + print(f"valid configs are {valid_configs}") + if ns.config in valid_configs: + print("Using " + ns.config + " configuration") + return + elif len(valid_configs) == 1: + ns.config = valid_configs.pop() + print("Found " + ns.config + " configuration") + elif ns.config is None: + print("config not selected, please choose from the following:\n") + selections = list(enumerate(sorted(valid_configs), 1)) + for i, c in selections: + print(f"{i}. {c}") + s = input("\n> ") + idx = int(s) - 1 + ns.config = selections[idx][1] + print(f"selected {ns.config}") + else: + raise ValueError("config " + ns.config + " is not valid") + # Remove the following, as implemented + if not ns.config.startswith("linux"): + raise ValueError( + f"only Linux configs currently supported, got {ns.config}" + ) + + +def main(args=None): + p = ArgumentParser("build-locally") + p.add_argument("config", default=None, nargs="?") + + ns = p.parse_args(args=args) + verify_config(ns) + setup_environment(ns) + + run_docker_build(ns) + + +if __name__ == "__main__": + main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/build_base.bat b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/build_base.bat new file mode 100644 index 0000000000000000000000000000000000000000..d32d8c596210072974fb564f04ce5d415d990933 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/build_base.bat @@ -0,0 +1,212 @@ +setlocal EnableDelayedExpansion +echo on + +:: brand Python with conda-forge startup message +%SYS_PYTHON% %RECIPE_DIR%\brand_python.py +if errorlevel 1 exit 1 + +:: Compile python, extensions and external libraries +if "%ARCH%"=="64" ( + set PLATFORM=x64 + set VC_PATH=x64 + set BUILD_PATH=amd64 +) else ( + set PLATFORM=Win32 + set VC_PATH=x86 + set BUILD_PATH=win32 +) + +for /F "tokens=1,2 delims=." %%i in ("%PKG_VERSION%") do ( + set "VERNODOTS=%%i%%j" +) + +:: Make sure the "python" value in conda_build_config.yaml is up to date. +for /F "tokens=1,2 delims=." %%i in ("%PKG_VERSION%") do ( + if NOT "%PY_VER%"=="%%i.%%j" exit 1 +) + +for /f "usebackq delims=" %%i in (`conda list -p %PREFIX% sqlite --no-show-channel-urls --json ^| findstr "version"`) do set SQLITE3_VERSION_LINE=%%i +for /f "tokens=2 delims==/ " %%i IN ('echo %SQLITE3_VERSION_LINE%') do (set SQLITE3_VERSION=%%~i) +echo SQLITE3_VERSION detected as %SQLITE3_VERSION% + +if "%PY_INTERP_DEBUG%"=="yes" ( + set CONFIG=-d + set _D=_d +) else ( + set CONFIG= + set _D= +) + + +if "%DEBUG_C%"=="yes" ( + set PGO= +) else ( + set PGO=--pgo +) + +:: AP doesn't support PGO atm? +set PGO= + +cd PCbuild + +:: Twice because: +:: error : importlib_zipimport.h updated. You will need to rebuild pythoncore to see the changes. +call build.bat %PGO% %CONFIG% -m -e -v -p %PLATFORM% +call build.bat %PGO% %CONFIG% -m -e -v -p %PLATFORM% +if errorlevel 1 exit 1 +cd .. + +:: Populate the root package directory +for %%x in (python%VERNODOTS%%_D%.dll python3%_D%.dll python%_D%.exe pythonw%_D%.exe) do ( + if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\%%x ( + copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\%%x %PREFIX% + ) else ( + echo "WARNING :: %SRC_DIR%\PCbuild\%BUILD_PATH%\%%x does not exist" + ) +) + +for %%x in (python%_D%.pdb python%VERNODOTS%%_D%.pdb pythonw%_D%.pdb) do ( + if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\%%x ( + copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\%%x %PREFIX% + ) else ( + echo "WARNING :: %SRC_DIR%\PCbuild\%BUILD_PATH%\%%x does not exist" + ) +) + +copy %SRC_DIR%\LICENSE %PREFIX%\LICENSE_PYTHON.txt +if errorlevel 1 exit 1 + +:: Populate the DLLs directory +mkdir %PREFIX%\DLLs +xcopy /s /y %SRC_DIR%\PCBuild\%BUILD_PATH%\*.pyd %PREFIX%\DLLs\ +if errorlevel 1 exit 1 + +copy /Y %SRC_DIR%\PC\icons\py.ico %PREFIX%\DLLs\ +if errorlevel 1 exit 1 +copy /Y %SRC_DIR%\PC\icons\pyc.ico %PREFIX%\DLLs\ +if errorlevel 1 exit 1 + + +:: Populate the Tools directory +mkdir %PREFIX%\Tools +xcopy /s /y /i %SRC_DIR%\Tools\demo %PREFIX%\Tools\demo +if errorlevel 1 exit 1 +xcopy /s /y /i %SRC_DIR%\Tools\i18n %PREFIX%\Tools\i18n +if errorlevel 1 exit 1 +xcopy /s /y /i %SRC_DIR%\Tools\scripts %PREFIX%\Tools\scripts +if errorlevel 1 exit 1 + +del %PREFIX%\Tools\demo\README +if errorlevel 1 exit 1 +del %PREFIX%\Tools\scripts\README +if errorlevel 1 exit 1 +del %PREFIX%\Tools\scripts\dutree.doc +if errorlevel 1 exit 1 +del %PREFIX%\Tools\scripts\idle3 +if errorlevel 1 exit 1 + +move /y %PREFIX%\Tools\scripts\2to3 %PREFIX%\Tools\scripts\2to3.py +if errorlevel 1 exit 1 +move /y %PREFIX%\Tools\scripts\pydoc3 %PREFIX%\Tools\scripts\pydoc3.py +if errorlevel 1 exit 1 + +:: Populate the include directory +xcopy /s /y %SRC_DIR%\Include %PREFIX%\include\ +if errorlevel 1 exit 1 + +copy /Y %SRC_DIR%\PC\pyconfig.h %PREFIX%\include\ +if errorlevel 1 exit 1 + +:: Populate the Scripts directory +if not exist %SCRIPTS% (mkdir %SCRIPTS%) +if errorlevel 1 exit 1 + +for %%x in (idle pydoc) do ( + copy /Y %SRC_DIR%\Tools\scripts\%%x3 %SCRIPTS%\%%x + if errorlevel 1 exit 1 +) + +copy /Y %SRC_DIR%\Tools\scripts\2to3 %SCRIPTS% +if errorlevel 1 exit 1 + +:: Populate the libs directory +if not exist %PREFIX%\libs mkdir %PREFIX%\libs +if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\python%VERNODOTS%%_D%.lib copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\python%VERNODOTS%%_D%.lib %PREFIX%\libs\ +if errorlevel 1 exit 1 +if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\python3%_D%.lib copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\python3%_D%.lib %PREFIX%\libs\ +if errorlevel 1 exit 1 +if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\_tkinter%_D%.lib copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\_tkinter%_D%.lib %PREFIX%\libs\ +if errorlevel 1 exit 1 + + +:: Populate the Lib directory +del %PREFIX%\libs\libpython*.a +xcopy /s /y %SRC_DIR%\Lib %PREFIX%\Lib\ +if errorlevel 1 exit 1 + +:: Copy venv[w]launcher scripts to venv\srcipts\nt +if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\venvlauncher%_D%.exe ( + copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\venvlauncher%_D%.exe %PREFIX%\Lib\venv\scripts\nt\python.exe +) else ( + echo "WARNING :: %SRC_DIR%\PCbuild\%BUILD_PATH%\venvlauncher%_D%.exe does not exist" +) + +if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\venvwlauncher%_D%.exe ( + copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\venvwlauncher%_D%.exe %PREFIX%\Lib\venv\scripts\nt\pythonw.exe +) else ( + echo "WARNING :: %SRC_DIR%\PCbuild\%BUILD_PATH%\venvwlauncher%_D%.exe does not exist" +) + + +:: Remove test data to save space. +:: Though keep `support` as some things use that. +mkdir %PREFIX%\Lib\test_keep +if errorlevel 1 exit 1 +move %PREFIX%\Lib\test\__init__.py %PREFIX%\Lib\test_keep\ +if errorlevel 1 exit 1 +move %PREFIX%\Lib\test\support %PREFIX%\Lib\test_keep\ +if errorlevel 1 exit 1 +rd /s /q %PREFIX%\Lib\test +if errorlevel 1 exit 1 +move %PREFIX%\Lib\test_keep %PREFIX%\Lib\test +if errorlevel 1 exit 1 +rd /s /q %PREFIX%\Lib\lib2to3\tests\ +if errorlevel 1 exit 1 + +:: bytecode compile the standard library + +rd /s /q %PREFIX%\Lib\lib2to3\tests\ +if errorlevel 1 exit 1 + +:: We need our Python to be found! +if "%_D%" neq "" copy %PREFIX%\python%_D%.exe %PREFIX%\python.exe + +%PREFIX%\python.exe -Wi %PREFIX%\Lib\compileall.py -f -q -x "bad_coding|badsyntax|py2_" %PREFIX%\Lib +if errorlevel 1 exit 1 + +:: Pickle lib2to3 Grammar +%PREFIX%\python.exe -m lib2to3 --help + +:: Ensure that scripts are generated +:: https://github.com/conda-forge/python-feedstock/issues/384 +%PREFIX%\python.exe %RECIPE_DIR%\fix_staged_scripts.py +if errorlevel 1 exit 1 + +:: Some quick tests for common failures +echo "Testing print() does not print: Hello" +%CONDA_EXE% run -p %PREFIX% cd %PREFIX% & %PREFIX%\python.exe -c "print()" 2>&1 | findstr /r /c:"Hello" +if %errorlevel% neq 1 exit /b 1 + +echo "Testing print('Hello') prints: Hello" +%CONDA_EXE% run -p %PREFIX% cd %PREFIX% & %PREFIX%\python.exe "print('Hello')" 2>&1 | findstr /r /c:"Hello" +if %errorlevel% neq 0 exit /b 1 + +echo "Testing import of os (no DLL needed) does not print: The specified module could not be found" +%CONDA_EXE% run -p %PREFIX% cd %PREFIX% & %PREFIX%\python.exe -v -c "import os" 2>&1 +%CONDA_EXE% run -p %PREFIX% cd %PREFIX% & %PREFIX%\python.exe -v -c "import os" 2>&1 | findstr /r /c:"The specified module could not be found" +if %errorlevel% neq 1 exit /b 1 + +echo "Testing import of _sqlite3 (DLL located via PATH needed) does not print: The specified module could not be found" +%CONDA_EXE% run -p %PREFIX% cd %PREFIX% & %PREFIX%\python.exe -v -c "import _sqlite3" 2>&1 +%CONDA_EXE% run -p %PREFIX% cd %PREFIX% & %PREFIX%\python.exe -v -c "import _sqlite3" 2>&1 | findstr /r /c:"The specified module could not be found" +if %errorlevel% neq 1 exit /b 1 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/build_base.sh b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/build_base.sh new file mode 100644 index 0000000000000000000000000000000000000000..033903f373b148f14ba381ba31655274ddbcff15 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/build_base.sh @@ -0,0 +1,520 @@ +#!/bin/bash +set -ex + +# Get an updated config.sub and config.guess +cp $BUILD_PREFIX/share/libtool/build-aux/config.* . + +# The LTO/PGO information was sourced from @pitrou and the Debian rules file in: +# http://http.debian.net/debian/pool/main/p/python3.6/python3.6_3.6.2-2.debian.tar.xz +# https://packages.debian.org/source/sid/python3.6 +# or: +# http://bazaar.launchpad.net/~doko/python/pkg3.5-debian/view/head:/rules#L255 +# .. but upstream regrtest.py now has --pgo (since >= 3.6) and skips tests that are: +# "not helpful for PGO". + +VERFULL=${PKG_VERSION} +VER=${PKG_VERSION%.*} +VERNODOTS=${VER//./} +TCLTK_VER=${tk} +# Disables some PGO/LTO +QUICK_BUILD=no + +_buildd_static=build-static +_buildd_shared=build-shared +_ENABLE_SHARED=--enable-shared +# We *still* build a shared lib here for non-static embedded use cases +_DISABLE_SHARED=--disable-shared +# Hack to allow easily comparing static vs shared interpreter performance +# .. hack because we just build it shared in both the build-static and +# build-shared directories. +# Yes this hack is a bit confusing, sorry about that. +if [[ ${PY_INTERP_LINKAGE_NATURE} == shared ]]; then + _DISABLE_SHARED=--enable-shared + _ENABLE_SHARED=--enable-shared +fi + +# For debugging builds, set this to no to disable profile-guided optimization +if [[ ${PY_INTERP_DEBUG} == yes ]]; then + _OPTIMIZED=no +else + _OPTIMIZED=yes +fi + +if [[ ${PY_INTERP_DEBUG} == yes ]]; then + # check that the rerendering is correct + if [[ "$CI" != "" && "$channel_targets" == "conda-forge main" ]]; then + exit 1 + fi +fi + +# Since these take very long to build in our emulated ci, disable for now +if [[ ${target_platform} == linux-aarch64 ]]; then + _OPTIMIZED=no +fi +if [[ ${target_platform} == linux-ppc64le ]]; then + _OPTIMIZED=no +fi + +declare -a _dbg_opts +if [[ ${PY_INTERP_DEBUG} == yes ]]; then + # This Python will not be usable with non-debug Python modules. + _dbg_opts+=(--with-pydebug) + DBG=d +else + DBG= +fi + +ABIFLAGS=${DBG} +VERABI=${VER}${DBG} + +# Make sure the "python" value in conda_build_config.yaml is up to date. +test "${PY_VER}" = "${VER}" + +# This is the mechanism by which we fall back to default gcc, but having it defined here +# would probably break the build by using incorrect settings and/or importing files that +# do not yet exist. +unset _PYTHON_SYSCONFIGDATA_NAME +unset _CONDA_PYTHON_SYSCONFIGDATA_NAME + +# Prevent lib/python${VER}/_sysconfigdata_*.py from ending up with full paths to these things +# in _build_env because _build_env will not get found during prefix replacement, only _h_env_placeh ... +AR=$(basename "${AR}") + +# CC must contain the string 'gcc' or else distutils thinks it is on macOS and uses '-R' to set rpaths. +if [[ ${target_platform} == osx-* ]]; then + CC=$(basename "${CC}") +else + CC=$(basename "${GCC}") +fi +CXX=$(basename "${CXX}") +RANLIB=$(basename "${RANLIB}") +READELF=$(basename "${READELF}") + +if [[ ${HOST} =~ .*darwin.* ]] && [[ -n ${CONDA_BUILD_SYSROOT} ]]; then + # Python's setup.py will figure out that this is a macOS sysroot. + CFLAGS="-isysroot ${CONDA_BUILD_SYSROOT} "${CFLAGS} + LDFLAGS="-isysroot ${CONDA_BUILD_SYSROOT} "${LDFLAGS} + CPPFLAGS="-isysroot ${CONDA_BUILD_SYSROOT} "${CPPFLAGS} +fi + +# Debian uses -O3 then resets it at the end to -O2 in _sysconfigdata.py +if [[ ${_OPTIMIZED} = yes ]]; then + CPPFLAGS=$(echo "${CPPFLAGS}" | sed "s/-O2/-O3/g") + CFLAGS=$(echo "${CFLAGS}" | sed "s/-O2/-O3/g") + CXXFLAGS=$(echo "${CXXFLAGS}" | sed "s/-O2/-O3/g") +fi + +if [[ ${PY_INTERP_DEBUG} == yes ]]; then + CPPFLAGS=$(echo "${CPPFLAGS}" | sed "s/-O2/-O0/g") + CFLAGS=$(echo "${CFLAGS}" | sed "s/-O2/-O0/g") + CXXFLAGS=$(echo "${CXXFLAGS}" | sed "s/-O2/-O0/g") +fi + +if [[ ${CONDA_FORGE} == yes ]]; then + ${SYS_PYTHON} ${RECIPE_DIR}/brand_python.py +fi + +if [[ "$target_platform" == linux-* ]]; then + cp ${PREFIX}/include/uuid/uuid.h ${PREFIX}/include/uuid.h +fi + +declare -a LTO_CFLAGS=() + +# Following is needed for building extensions like zlib +CPPFLAGS=${CPPFLAGS}" -I${PREFIX}/include" + +re='^(.*)(-I[^ ]*)(.*)$' +if [[ ${CFLAGS} =~ $re ]]; then + CFLAGS="${BASH_REMATCH[1]}${BASH_REMATCH[3]}" +fi + +# Force rebuild to avoid: +# ../work/Modules/unicodename_db.h:24118:30: note: (near initialization for 'code_hash') +# ../work/Modules/unicodename_db.h:24118:33: warning: excess elements in scalar initializer +# 0, 0, 12018, 0, 0, 0, 0, 0, 4422, 4708, 3799, 119358, 119357, 0, 120510, +# ^~~~ +# This should have been fixed by https://github.com/python/cpython/commit/7c69c1c0fba8c1c8ff3969bce4c1135736a4cc58 +# .. but that appears incomplete. In particular, the generated files contain: +# /* this file was generated by Tools/unicode/makeunicodedata.py 3.2 */ +# .. yet the PR updated to version of makeunicodedata.py to 3.3 +# rm -f Modules/unicodedata_db.h Modules/unicodename_db.h +# ${SYS_PYTHON} ${SRC_DIR}/Tools/unicode/makeunicodedata.py +# .. instead we revert this commit for now. + +export CPPFLAGS CFLAGS CXXFLAGS LDFLAGS + +declare -a _common_configure_args + +if [[ ${target_platform} == osx-* ]]; then + sed -i -e "s/@OSX_ARCH@/$ARCH/g" Lib/distutils/unixccompiler.py +fi + +if [[ "${CONDA_BUILD_CROSS_COMPILATION}" == "1" ]]; then + # Build the exact same Python for the build machine. It would be nice (and might be + # possible already?) to be able to make this just an 'exact' pinned build dependency + # of a split-package? + BUILD_PYTHON_PREFIX=${PWD}/build-python-install + mkdir build-python-build + pushd build-python-build + (unset CPPFLAGS LDFLAGS; + export CC=${CC_FOR_BUILD} \ + CXX=${CXX_FOR_BUILD} \ + CPP="${CC_FOR_BUILD} -E" \ + CFLAGS="-O2" \ + AR="$(${CC_FOR_BUILD} --print-prog-name=ar)" \ + RANLIB="$(${CC_FOR_BUILD} --print-prog-name=ranlib)" \ + LD="$(${CC_FOR_BUILD} --print-prog-name=ld)" && \ + ${SRC_DIR}/configure --build=${BUILD} \ + --host=${BUILD} \ + --prefix=${BUILD_PYTHON_PREFIX} \ + --with-ensurepip=no \ + --with-tzpath=${PREFIX}/share/zoneinfo \ + --with-platlibdir=lib && \ + make -j${CPU_COUNT} && \ + make install) + export PATH=${BUILD_PYTHON_PREFIX}/bin:${PATH} + ln -s ${BUILD_PYTHON_PREFIX}/bin/python${VER} ${BUILD_PYTHON_PREFIX}/bin/python + popd + echo "ac_cv_file__dev_ptmx=yes" > config.site + echo "ac_cv_file__dev_ptc=yes" >> config.site + echo "ac_cv_pthread=yes" >> config.site + echo "ac_cv_little_endian_double=yes" >> config.site + echo "ac_cv_aligned_required=no" >> config.site + if [[ ${target_platform} == osx-arm64 ]]; then + echo "ac_cv_file__dev_ptc=no" >> config.site + echo "ac_cv_pthread_is_default=yes" >> config.site + echo "ac_cv_working_tzset=yes" >> config.site + echo "ac_cv_pthread_system_supported=yes" >> config.site + fi + export CONFIG_SITE=${PWD}/config.site + # This is needed for libffi: + export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig + _common_configure_args+=(--with-build-python=${BUILD_PYTHON_PREFIX}/bin/python) +fi + +# This causes setup.py to query the sysroot directories from the compiler, something which +# IMHO should be done by default anyway with a flag to disable it to workaround broken ones. +# Technically, setting _PYTHON_HOST_PLATFORM causes setup.py to consider it cross_compiling +if [[ -n ${HOST} ]]; then + if [[ ${HOST} =~ .*darwin.* ]]; then + # Even if BUILD is .*darwin.* you get better isolation by cross_compiling (no /usr/local) + IFS='-' read -r host_arch host_os host_kernel <<<"${HOST}" + export _PYTHON_HOST_PLATFORM=darwin-${host_arch} + else + IFS='-' read -r host_arch host_vendor host_os host_libc <<<"${HOST}" + export _PYTHON_HOST_PLATFORM=${host_os}-${host_arch} + fi +fi + +if [[ ${target_platform} == osx-64 ]]; then + export MACHDEP=darwin + export ac_sys_system=Darwin + export ac_sys_release=13.4.0 + export MACOSX_DEFAULT_ARCH=x86_64 + # TODO: check with LLVM 12 if the following hack is needed. + # https://reviews.llvm.org/D76461 may have fixed the need for the following hack. + echo '#!/bin/bash' > $BUILD_PREFIX/bin/$HOST-llvm-ar + echo "$BUILD_PREFIX/bin/llvm-ar --format=darwin" '"$@"' >> $BUILD_PREFIX/bin/$HOST-llvm-ar + chmod +x $BUILD_PREFIX/bin/$HOST-llvm-ar + export ARCHFLAGS="-arch x86_64" +elif [[ ${target_platform} == osx-arm64 ]]; then + export MACHDEP=darwin + export ac_sys_system=Darwin + export ac_sys_release=20.0.0 + export MACOSX_DEFAULT_ARCH=arm64 + echo '#!/bin/bash' > $BUILD_PREFIX/bin/$HOST-llvm-ar + echo "$BUILD_PREFIX/bin/llvm-ar --format=darwin" '"$@"' >> $BUILD_PREFIX/bin/$HOST-llvm-ar + chmod +x $BUILD_PREFIX/bin/$HOST-llvm-ar + export ARCHFLAGS="-arch arm64" + export CFLAGS="$CFLAGS $ARCHFLAGS" +elif [[ ${target_platform} == linux-* ]]; then + export MACHDEP=linux + export ac_sys_system=Linux + export ac_sys_release= +fi + +# Not used at present but we should run 'make test' and finish up TESTOPTS (see debians rules). +declare -a TEST_EXCLUDES +TEST_EXCLUDES+=(test_ensurepip test_venv) +TEST_EXCLUDES+=(test_tcl test_codecmaps_cn test_codecmaps_hk + test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw + test_normalization test_ossaudiodev test_socket) +if [[ ! -f /dev/dsp ]]; then + TEST_EXCLUDES+=(test_linuxaudiodev test_ossaudiodev) +fi +# hangs on Aarch64, see LP: #1264354 +if [[ ${CC} =~ .*-aarch64.* ]]; then + TEST_EXCLUDES+=(test_faulthandler) +fi +if [[ ${CC} =~ .*-arm.* ]]; then + TEST_EXCLUDES+=(test_ctypes) + TEST_EXCLUDES+=(test_compiler) +fi + +_common_configure_args+=(--prefix=${PREFIX}) +_common_configure_args+=(--build=${BUILD}) +_common_configure_args+=(--host=${HOST}) +_common_configure_args+=(--enable-ipv6) +_common_configure_args+=(--with-ensurepip=no) +_common_configure_args+=(--with-tzpath=${PREFIX}/share/zoneinfo) +_common_configure_args+=(--with-computed-gotos) +_common_configure_args+=(--with-system-ffi) +_common_configure_args+=(--with-system-expat) +_common_configure_args+=(--enable-loadable-sqlite-extensions) +_common_configure_args+=(--with-tcltk-includes="-I${PREFIX}/include") +_common_configure_args+=("--with-tcltk-libs=-L${PREFIX}/lib -ltcl8.6 -ltk8.6") +_common_configure_args+=(--with-platlibdir=lib) + +# Add more optimization flags for the static Python interpreter: +declare -a PROFILE_TASK=() +if [[ ${_OPTIMIZED} == yes ]]; then + _common_configure_args+=(--with-lto) + if [[ "$CONDA_BUILD_CROSS_COMPILATION" != "1" ]]; then + _common_configure_args+=(--enable-optimizations) + _MAKE_TARGET=profile-opt + # To speed up build times during testing (1): + if [[ ${QUICK_BUILD} == yes ]]; then + # TODO :: It seems this is just profiling everything, on Windows, only 40 odd tests are + # run while on Unix, all 400+ are run, making this slower and less well curated + _PROFILE_TASK+=(PROFILE_TASK="-m test --pgo") + else + # From talking to Steve Dower, who implemented pgo/pgo-extended, it is really not worth + # it to run pgo-extended (which runs the whole test-suite). The --pgo set of tests are + # curated specifically to be useful/appropriate for pgo instrumentation. + # _PROFILE_TASK+=(PROFILE_TASK="-m test --pgo-extended") + _PROFILE_TASK+=(PROFILE_TASK="-m test --pgo") + fi + fi + if [[ ${CC} =~ .*gcc.* ]]; then + LTO_CFLAGS+=(-fuse-linker-plugin) + LTO_CFLAGS+=(-ffat-lto-objects) + # -flto must come after -flto-partition due to the replacement code + # TODO :: Replace the replacement code using conda-build's in-build regex replacement. + LTO_CFLAGS+=(-flto-partition=none) + LTO_CFLAGS+=(-flto) + else + # TODO :: Check if -flto=thin gives better results. It is about faster + # compilation rather than faster execution so probably not: + # http://clang.llvm.org/docs/ThinLTO.html + # http://blog.llvm.org/2016/06/thinlto-scalable-and-incremental-lto.html + LTO_CFLAGS+=(-flto) + # -flto breaks the check to determine whether float word ordering is bigendian + # see: + # https://bugs.python.org/issue28015 + # https://bugs.python.org/issue38527 + # manually specify this setting + export ax_cv_c_float_words_bigendian=no + fi + export CFLAGS="${CFLAGS} ${LTO_CFLAGS[@]}" +else + _MAKE_TARGET= +fi + +mkdir -p ${_buildd_shared} +pushd ${_buildd_shared} + ${SRC_DIR}/configure "${_common_configure_args[@]}" \ + "${_dbg_opts[@]}" \ + --oldincludedir=${BUILD_PREFIX}/${HOST}/sysroot/usr/include \ + --enable-shared +popd + +mkdir -p ${_buildd_static} +pushd ${_buildd_static} + ${SRC_DIR}/configure "${_common_configure_args[@]}" \ + "${_dbg_opts[@]}" \ + -oldincludedir=${BUILD_PREFIX}/${HOST}/sysroot/usr/include \ + ${_DISABLE_SHARED} "${_PROFILE_TASK[@]}" +popd + +if [[ "${CI}" == "travis" ]]; then + # Travis has issues with long logs + make -j${CPU_COUNT} -C ${_buildd_static} \ + EXTRA_CFLAGS="${EXTRA_CFLAGS}" \ + ${_MAKE_TARGET} "${_PROFILE_TASK[@]}" 2>&1 >make-static.log +else + make -j${CPU_COUNT} -C ${_buildd_static} \ + EXTRA_CFLAGS="${EXTRA_CFLAGS}" \ + ${_MAKE_TARGET} "${_PROFILE_TASK[@]}" 2>&1 | tee make-static.log +fi +if rg "Failed to build these modules" make-static.log; then + echo "(static) :: Failed to build some modules, check the log" + exit 1 +fi + +if [[ "${CI}" == "travis" ]]; then + # Travis has issues with long logs + make -j${CPU_COUNT} -C ${_buildd_shared} \ + EXTRA_CFLAGS="${EXTRA_CFLAGS}" 2>&1 >make-shared.log +else + make -j${CPU_COUNT} -C ${_buildd_shared} \ + EXTRA_CFLAGS="${EXTRA_CFLAGS}" 2>&1 | tee make-shared.log +fi +if rg "Failed to build these modules" make-shared.log; then + echo "(shared) :: Failed to build some modules, check the log" + exit 1 +fi + +# build a static library with PIC objects and without LTO/PGO +make -j${CPU_COUNT} -C ${_buildd_shared} \ + EXTRA_CFLAGS="${EXTRA_CFLAGS}" \ + LIBRARY=libpython${VERABI}-pic.a libpython${VERABI}-pic.a + +make -C ${_buildd_static} install + +declare -a _FLAGS_REPLACE=() +if [[ ${_OPTIMIZED} == yes ]]; then + _FLAGS_REPLACE+=(-O3) + _FLAGS_REPLACE+=(-O2) + _FLAGS_REPLACE+=("-fprofile-use") + _FLAGS_REPLACE+=("") + _FLAGS_REPLACE+=("-fprofile-correction") + _FLAGS_REPLACE+=("") + _FLAGS_REPLACE+=("-L.") + _FLAGS_REPLACE+=("") + for _LTO_CFLAG in "${LTO_CFLAGS[@]}"; do + _FLAGS_REPLACE+=(${_LTO_CFLAG}) + _FLAGS_REPLACE+=("") + done +fi +# Install the shared library (for people who embed Python only, e.g. GDB). +# Linking module extensions to this on Linux is redundant (but harmless). +# Linking module extensions to this on Darwin is harmful (multiply defined symbols). +cp -pf ${_buildd_shared}/libpython*${SHLIB_EXT}* ${PREFIX}/lib/ +if [[ ${target_platform} =~ .*linux.* ]]; then + ln -sf ${PREFIX}/lib/libpython${VERABI}${SHLIB_EXT}.1.0 ${PREFIX}/lib/libpython${VERABI}${SHLIB_EXT} +fi + +SYSCONFIG=$(find ${_buildd_static}/$(cat ${_buildd_static}/pybuilddir.txt) -name "_sysconfigdata*.py" -print0) +cat ${SYSCONFIG} | ${SYS_PYTHON} "${RECIPE_DIR}"/replace-word-pairs.py \ + "${_FLAGS_REPLACE[@]}" \ + > ${PREFIX}/lib/python${VER}/$(basename ${SYSCONFIG}) +MAKEFILE=$(find ${PREFIX}/lib/python${VER}/ -path "*config-*/Makefile" -print0) +cp ${MAKEFILE} /tmp/Makefile-$$ +cat /tmp/Makefile-$$ | ${SYS_PYTHON} "${RECIPE_DIR}"/replace-word-pairs.py \ + "${_FLAGS_REPLACE[@]}" \ + > ${MAKEFILE} +# Check to see that our differences took. +# echo diff -urN ${SYSCONFIG} ${PREFIX}/lib/python${VER}/$(basename ${SYSCONFIG}) +# diff -urN ${SYSCONFIG} ${PREFIX}/lib/python${VER}/$(basename ${SYSCONFIG}) + +# Python installs python${VER}m and python${VER}, one as a hardlink to the other. conda-build breaks these +# by copying. Since the executable may be static it may be very large so change one to be a symlink +# of the other. In this case, python${VER}m will be the symlink. +if [[ -f ${PREFIX}/bin/python${VER}m ]]; then + rm -f ${PREFIX}/bin/python${VER}m + ln -s ${PREFIX}/bin/python${VER} ${PREFIX}/bin/python${VER}m +fi +ln -s ${PREFIX}/bin/python${VER} ${PREFIX}/bin/python +ln -s ${PREFIX}/bin/pydoc${VER} ${PREFIX}/bin/pydoc +# Workaround for https://github.com/conda/conda/issues/10969 +ln -s ${PREFIX}/bin/python3.11 ${PREFIX}/bin/python3.1 + +# Remove test data to save space +# Though keep `support` as some things use that. +# TODO :: Make a subpackage for this once we implement multi-level testing. +pushd ${PREFIX}/lib/python${VER} + mkdir test_keep + mv test/__init__.py test/support test/test_support* test/test_script_helper* test_keep/ + rm -rf test */test + mv test_keep test +popd + +# Size reductions: +pushd ${PREFIX} + if [[ -f lib/libpython${VERABI}.a ]]; then + chmod +w lib/libpython${VERABI}.a + ${STRIP} -S lib/libpython${VERABI}.a + fi + CONFIG_LIBPYTHON=$(find lib/python${VER}/config-${VERABI}* -name "libpython${VERABI}.a") + if [[ -f lib/libpython${VERABI}.a ]] && [[ -f ${CONFIG_LIBPYTHON} ]]; then + chmod +w ${CONFIG_LIBPYTHON} + rm ${CONFIG_LIBPYTHON} + fi +popd + +# Copy sysconfig that gets recorded to a non-default name +# using the new compilers with python will require setting _PYTHON_SYSCONFIGDATA_NAME +# to the name of this file (minus the .py extension) +pushd "${PREFIX}"/lib/python${VER} + # On Python 3.5 _sysconfigdata.py was getting copied in here and compiled for some reason. + # This breaks our attempt to find the right one as recorded_name. + find lib-dynload -name "_sysconfigdata*.py*" -exec rm {} \; + recorded_name=$(find . -name "_sysconfigdata*.py") + our_compilers_name=_sysconfigdata_$(echo ${HOST} | sed -e 's/[.-]/_/g').py + # So we can see if anything has significantly diverged by looking in a built package. + cp ${recorded_name} ${recorded_name}.orig + cp ${recorded_name} sysconfigfile + # fdebug-prefix-map for python work dir is useless for extensions + sed -i.bak "s@-fdebug-prefix-map=$SRC_DIR=/usr/local/src/conda/python-$PKG_VERSION@@g" sysconfigfile + sed -i.bak "s@-fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix@@g" sysconfigfile + # Append the conda-forge zoneinfo to the end + sed -i.bak "s@zoneinfo'@zoneinfo:$PREFIX/share/tzinfo'@g" sysconfigfile + # Remove osx sysroot as it depends on the build machine + # be sure CONDA_BUILD_SYSROOT has value, as other we will remove here instead spaces + if [[ "${target_platform}" == osx-* ]] && [[ -n ${CONDA_BUILD_SYSROOT} ]]; then + sed -i.bak "s@-isysroot @@g" sysconfigfile + sed -i.bak "s@$CONDA_BUILD_SYSROOT @@g" sysconfigfile + fi + # Remove unfilled config option + sed -i.bak "s/@SGI_ABI@//g" sysconfigfile + sed -i.bak "s@$BUILD_PREFIX/bin/${HOST}-llvm-ar@${HOST}-ar@g" sysconfigfile + # Remove GNULD=yes to make sure new-dtags are not used + sed -i.bak "s/'GNULD': 'yes'/'GNULD': 'no'/g" sysconfigfile + cp sysconfigfile ${our_compilers_name} + + # For system gcc remove the triple + sed -i.bak "s@$HOST-c++@g++@g" sysconfigfile + sed -i.bak "s@$HOST-@@g" sysconfigfile + if [[ "$target_platform" == linux* ]]; then + # For linux, make sure the system gcc uses our linker + sed -i.bak "s@-pthread@-pthread -B $PREFIX/compiler_compat@g" sysconfigfile + fi + # Don't set -march and -mtune for system gcc + sed -i.bak "s@-march=[^( |\\\"|\\\')]*@@g" sysconfigfile + sed -i.bak "s@-mtune=[^( |\\\"|\\\')]*@@g" sysconfigfile + # Remove these flags that older compilers and linkers may not know + for flag in "-fstack-protector-strong" "-ffunction-sections" "-pipe" "-fno-plt" \ + "-ftree-vectorize" "-Wl,--sort-common" "-Wl,--as-needed" "-Wl,-z,relro" \ + "-Wl,-z,now" "-Wl,--disable-new-dtags" "-Wl,--gc-sections" "-Wl,-O2" \ + "-fPIE" "-ftree-vectorize" "-mssse3" "-Wl,-pie" "-Wl,-dead_strip_dylibs" \ + "-Wl,-headerpad_max_install_names"; do + sed -i.bak "s@$flag@@g" sysconfigfile + done + # Cleanup some extra spaces from above + sed -i.bak "s@' [ ]*@'@g" sysconfigfile + cp sysconfigfile $recorded_name + echo "========================sysconfig===========================" + cat $recorded_name + echo "============================================================" + + rm sysconfigfile + rm sysconfigfile.bak +popd + +if [[ ${HOST} =~ .*linux.* ]]; then + mkdir -p ${PREFIX}/compiler_compat + ln -s ${PREFIX}/bin/${HOST}-ld ${PREFIX}/compiler_compat/ld + echo "Files in this folder are to enhance backwards compatibility of anaconda software with older compilers." > ${PREFIX}/compiler_compat/README + echo "See: https://github.com/conda/conda/issues/6030 for more information." >> ${PREFIX}/compiler_compat/README +fi + +# There are some strange distutils files around. Delete them +rm -rf ${PREFIX}/lib/python${VER}/distutils/command/*.exe + +python -c "import compileall,os;compileall.compile_dir(os.environ['PREFIX'])" +rm ${PREFIX}/lib/libpython${VERABI}.a + +if [[ ${PY_INTERP_DEBUG} == yes ]]; then + rm ${PREFIX}/bin/python${VER} + ln -s ${PREFIX}/bin/python${VERABI} ${PREFIX}/bin/python${VER} + ln -s ${PREFIX}/lib/libpython${VERABI}.so ${PREFIX}/lib/libpython${VER}.so + ln -s ${PREFIX}/include/python${VERABI} ${PREFIX}/include/python${VER} +fi + +if [[ "$target_platform" == linux-* ]]; then + rm ${PREFIX}/include/uuid.h +fi + +# Workaround for old conda versions which fail to install noarch packages for Python 3.10+ +# https://github.com/conda/conda/issues/10969 +ln -s "${PREFIX}/lib/python3.11" "${PREFIX}/lib/python3.1" diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/build_static.bat b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/build_static.bat new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/build_static.sh b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/build_static.sh new file mode 100644 index 0000000000000000000000000000000000000000..ced5802c9f297f3302782f8dabaab65c252f9456 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/build_static.sh @@ -0,0 +1,25 @@ +#!/bin/bash +set -ex + +_buildd_static=build-static +_buildd_shared=build-shared +if [[ ${PY_INTERP_DEBUG} == yes ]]; then + DBG=d +else + DBG= +fi +VER=${PKG_VERSION%.*} +VERABI=${VER}${DBG} + + +cp -pf ${_buildd_static}/libpython${VERABI}.a ${PREFIX}/lib/libpython${VERABI}.a +if [[ ${HOST} =~ .*linux.* ]]; then + pushd ${PREFIX}/lib/python${VER}/config-${VERABI}-${HOST/-conda/} +elif [[ ${HOST} =~ .*darwin.* ]]; then + pushd ${PREFIX}/lib/python${VER}/config-${VERABI}-darwin +fi +ln -s ../../libpython${VERABI}.a libpython${VERABI}.a +popd +# If the LTO info in the normal lib is problematic (using different compilers for example +# we also provide a 'nolto' version). +cp -pf ${_buildd_shared}/libpython${VERABI}-pic.a ${PREFIX}/lib/libpython${VERABI}.nolto.a diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/conda_build_config.yaml b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c48b4895abe3e68aa06e8d63213a3f9a6a905b5d --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/conda_build_config.yaml @@ -0,0 +1,19 @@ +python: + - 3.11 +python_impl: + - cpython +is_python_min: + - no +numpy: + - 1.16 +MACOSX_SDK_VERSION: # [osx and x86_64] + - 11.0 # [osx and x86_64] +build_type: + - release + - debug # [not win] +channel_targets: + - conda-forge main + - conda-forge python_debug # [not win] +zip_keys: + - build_type + - channel_targets diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/fix_staged_scripts.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/fix_staged_scripts.py new file mode 100644 index 0000000000000000000000000000000000000000..29489b30db4f6d422168675a864233d036832b42 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/fix_staged_scripts.py @@ -0,0 +1,41 @@ +from os.path import isdir, isfile, dirname, join + +import os +import shutil + + +# Taken and adapted from conda_build/windows.py +def fix_staged_scripts(scripts_dir): + """ + Fixes scripts which have been installed unix-style to have a .bat + helper + """ + if not isdir(scripts_dir): + return + for fn in os.listdir(scripts_dir): + # process all the extensionless files + if not isfile(join(scripts_dir, fn)) or '.' in fn: + continue + + # read as binary file to ensure we don't run into encoding errors, see #1632 + with open(join(scripts_dir, fn), 'rb') as f: + line = f.readline() + # If it's a #!python script + if not (line.startswith(b'#!') and b'python' in line.lower()): + continue + print('Adjusting unix-style #! script %s, ' + 'and adding a .bat file for it' % fn) + # copy it with a .py extension (skipping that first #! line) + with open(join(scripts_dir, fn + '-script.py'), 'wb') as fo: + fo.write(f.read()) + # now create the .exe file + # This is hardcoded that conda and conda-build are in the same environment + base_env = dirname(dirname(os.environ['CONDA_EXE'])) + exe = join(base_env, 'lib', 'site-packages', 'conda_build', 'cli-64.exe') + shutil.copyfile(exe, join(scripts_dir, fn + '.exe')) + + # remove the original script + os.remove(join(scripts_dir, fn)) + + +fix_staged_scripts(os.environ['SCRIPTS']) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/meta.yaml b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e42a81ab4787ad8cd5347cec17b8f40a6cbec1f2 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/meta.yaml @@ -0,0 +1,366 @@ +{% set version = "3.11.15" %} +{% set dev = "" %} +{% set dev_ = "" %} +{% set ver2 = '.'.join(version.split('.')[0:2]) %} +{% set ver2nd = ''.join(version.split('.')[0:2]) %} +{% set ver3nd = ''.join(version.split('.')[0:3]) %} +{% set build_number = 0 %} + +# this makes the linter happy +{% set channel_targets = channel_targets or 'conda-forge main' %} + +# Sanitize build system env. var tweak parameters +# (passed to the build scripts via script_env). +{% set from_source_control = os.environ.get('CONDA_BUILD_FROM_SOURCE_CONTROL', '') %} +{% if from_source_control == '' or from_source_control == 'no' %} + {% set from_source_control = 'no' %} +{% else %} + {% set from_source_control = 'yes' %} +{% endif %} +{% set linkage_nature = os.environ.get('PY_INTERP_LINKAGE_NATURE', '') %} +{% if linkage_nature != '' %} + {% set linkage_nature = "_" ~ linkage_nature %} +{% endif %} +{% if linkage_nature == 'shared' %} + {% set linkage_nature_env = 'shared' %} +{% else %} + {% set linkage_nature_env = 'static' %} +{% endif %} +{% set dbg_abi = "" %} +{% if build_type == "debug" %} + {% set py_interp_debug = "yes" %} + {% set debug = "_debug" %} +{% else %} + {% set py_interp_debug = "no" %} + {% set debug = "" %} +{% endif %} + +package: + name: python-split + version: {{ version }}{{ dev }} + +source: +{% if from_source_control == 'yes' %} + - git_url: https://github.com/python/CPython.git + git_tag: v{{ version }}{{ dev }} +{% else %} + - url: https://www.python.org/ftp/python/{{ version }}/Python-{{ version }}{{ dev }}.tar.xz + # sha256 from: https://www.python.org/downloads/release/python-{{ ver3nd }}/ + sha256: 272179ddd9a2e41a0fc8e42e33dfbdca0b3711aa5abf372d3f2d51543d09b625 +{% endif %} + patches: + - patches/0001-Win32-Change-FD_SETSIZE-from-512-to-2048.patch + - patches/0002-Win32-distutils-Add-support-to-cygwinccompiler-for-V.patch + # https://github.com/python/cpython/pull/28501 + - patches/0003-bpo-45258-search-for-isysroot-in-addition-to-sysroot.patch + # https://github.com/pypa/distutils/pull/54 + - patches/0004-runtime_library_dir_option-Use-1st-word-of-CC-as-com.patch + - patches/0005-Win32-Do-not-download-externals.patch + - patches/0006-Fix-find_library-so-that-it-looks-in-sys.prefix-lib-.patch + # https://github.com/python/cpython/pull/28397 + - patches/0007-bpo-22699-Allow-compiling-on-debian-ubuntu-with-a-di.patch + - patches/0008-Disable-registry-lookup-unless-CONDA_PY_ALLOW_REG_PA.patch + - patches/0009-Unvendor-openssl.patch + - patches/0010-Unvendor-sqlite3.patch + # https://github.com/pypa/distutils/pull/53 + - patches/0011-Use-ranlib-from-env-if-env-variable-is-set.patch + - patches/0012-Add-CondaEcosystemModifyDllSearchPath.patch + - patches/0013-Add-d1trimfile-SRC_DIR-to-make-pdbs-more-relocatable.patch + - patches/0014-Doing-d1trimfile.patch + # https://github.com/python/cpython/pull/23523 + - patches/0015-cross-compile-darwin.patch + - patches/0016-Fix-TZPATH-on-windows.patch + # https://github.com/python/cpython/pull/24324 + - patches/0017-Make-dyld-search-work-with-SYSTEM_VERSION_COMPAT-1.patch + # https://github.com/pypa/distutils/pull/53 + - patches/0018-Fix-LDSHARED-when-CC-is-overriden-on-Linux-too.patch + - patches/0019-Unvendor-bzip2.patch + - patches/0020-Unvendor-libffi.patch + - patches/0021-Unvendor-tcltk.patch + - patches/0022-unvendor-xz.patch + - patches/0023-unvendor-zlib.patch + - patches/0024-Do-not-pass-g-to-GCC-when-not-Py_DEBUG.patch + - patches/0025-Unvendor-expat.patch + - patches/0026-Do-not-define-pid_t-as-it-might-conflict-with-the-ac.patch + +build: + number: {{ build_number }} + +requirements: + build: +{% if from_source_control == 'yes' %} + - git +{% else %} + - patch # [not win] + - m2-patch # [win] + - m2-gcc-libs # [win] +{% endif %} + +outputs: + - name: python + script: build_base.sh # [unix] + script: build_base.bat # [win] + build: + number: {{ build_number }} + activate_in_script: true + # Windows has issues updating python if conda is using files itself. + # Copy rather than link. + no_link: + - DLLs/_ctypes.pyd # [win] + ignore_run_exports_from: + # C++ only installed so CXX is defined for distutils/sysconfig. + - {{ compiler('cxx') }} # [unix] + # These two are just to get the headers needed for tk.h, but is unused + - xorg-libx11 # [unix] + - xorg-xorgproto # [unix] + # Disabled until verified to work correctly + detect_binary_files_with_prefix: true + # detect_binary_files_with_prefix: False + # binary_has_prefix_files: + # - lib/libpython{{ ver2 }}.*.1.0 + # - bin/python{{ ver2 }} # [linux] + # - lib/libpython{{ ver2 }}.a # [linux] + # - lib/libpython{{ ver2 }}.nolto.a # [linux] + # - lib/libpython3.so # [linux] + # - lib/python{{ ver2 }}/lib-dynload/_hashlib.cpython-{{ ver2nd }}-x86_64-linux-gnu.so # [linux] + # - lib/libpython3.dylib # [osx] + # match python.org compiler standard + skip: true # [win and int(float(vc)) < 14] + skip_compile_pyc: + - '*.py' # [build_platform != target_platform] + string: {{ dev_ }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }}_cpython # ["conda-forge" in (channel_targets or "")] + string: h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }} # ["conda-forge" not in (channel_targets or "")] +{% if 'conda-forge' in channel_targets %} + run_exports: + noarch: + - python + weak: + - python_abi {{ ver2 }}.* *_cp{{ ver2nd }} +{% if py_interp_debug == "yes" %} + - python {{ ver2 }}.* *_debug_cpython +{% endif %} +{% endif %} + script_env: + - PY_INTERP_LINKAGE_NATURE={{ linkage_nature_env }} + - PY_INTERP_DEBUG={{ py_interp_debug }} + # Putting these here means they get emitted to build_env_setup.{sh,bat} meaning we can launch IDEs + # after sourcing or calling that script without examine the contents of conda_build.{sh,bat} for + # important env. vars. +{% if 'conda-forge' in channel_targets %} + - CONDA_FORGE=yes +{% else %} + - CONDA_FORGE=no +{% endif %} + missing_dso_whitelist: # [win] + - '**/MSVCR71.dll' # [win] + - '**/MSVCR80.dll' # [win] + # I have no idea why this is not in C:\Windows\System32\downlevel + - '**/api-ms-win-core-path-l1-1-0.dll' # [win] + requirements: + build: + - {{ compiler('c') }} + - {{ stdlib('c') }} + - {{ compiler('cxx') }} + - make # [not win] + - libtool # [unix] + - pkg-config # [not win] + # configure script looks for llvm-ar for lto + - llvm-tools # [osx] + - ld_impl_{{ target_platform }} # [linux] +{% if 'conda-forge' in channel_targets %} + - binutils_impl_{{ target_platform }} # [linux] +{% endif %} + host: + - bzip2 + - sqlite + - liblzma-devel + - zlib + - openssl + - readline # [not win] + - tk + # These two are just to get the headers needed for tk.h, but is unused + - xorg-libx11 # [unix] + - xorg-xorgproto # [unix] + - ncurses # [unix] + - libffi + - ld_impl_{{ target_platform }} >=2.36.1 # [linux] + - libnsl # [linux] + - libuuid # [linux] + - libxcrypt # [linux] + - expat + run: + - ld_impl_{{ target_platform }} >=2.36.1 # [linux] + - tzdata +{% if 'conda-forge' in channel_targets %} + run_constrained: + - python_abi {{ ver2 }}.* *_cp{{ ver2nd }} +{% endif %} + test: + downstreams: + - cython + - setuptools + requires: + - ripgrep + - cmake + - ninja + - {{ stdlib('c') }} + - {{ compiler('c') }} + # Tried to use enable_language(C) to avoid needing this. It does not work. + - {{ compiler('cxx') }} + # For tkinter, but we expect from system + - xorg-libx11 # [unix] + files: + - tests/distutils/* + - tests/cmake/* + - tests/cython/* + - tests/prefix-replacement/* + - run_test.py + commands: + - echo on # [win] + - set # [win] + - python -V + - python3 -V # [not win] + - 2to3 -h + - pydoc -h + - python3-config --help # [not win] + - set "PIP_NO_BUILD_ISOLATION=False" # [win] + - set "PIP_NO_DEPENDENCIES=True" # [win] + - set "PIP_IGNORE_INSTALLED=True" # [win] + - set "PIP_NO_INDEX=True" # [win] + - set "PIP_CACHE_DIR=%CONDA_PREFIX%/pip_cache" # [win] + - set "TEMP=%CONDA_PREFIX%/tmp" # [win] + - mkdir "%TEMP%" # [win] + - python -Im ensurepip --upgrade --default-pip # [win] + # tzdata/zoneinfo test that will need the tzdata package to pass + - python -c "from zoneinfo import ZoneInfo; from datetime import datetime; dt = datetime(2020, 10, 31, 12, tzinfo=ZoneInfo('America/Los_Angeles')); print(dt.tzname())" + - python -m venv test-venv + - test-venv\\Scripts\\python.exe -c "import ctypes" # [win] + - test-venv/bin/python -c "import ctypes" # [unix] + - python -c "import sysconfig; print(sysconfig.get_config_var('CC'))" # [not win] + - _CONDA_PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_x86_64_conda_linux_gnu python -c "import sysconfig; print(sysconfig.get_config_var('CC'))" # [linux64] + - for f in ${CONDA_PREFIX}/lib/python*/_sysconfig*.py; do echo "Checking $f:"; if [[ `rg @ $f` ]]; then echo "FAILED ON $f"; cat $f; exit 1; fi; done # [linux64 or osx] + - test ! -f ${PREFIX}/lib/libpython${PKG_VERSION%.*}.a # [unix] + - test ! -f ${PREFIX}/lib/libpython${PKG_VERSION%.*}.nolto.a # [unix] + # https://github.com/conda-forge/python-feedstock/issues/384 + - if exist %PREFIX%\\Scripts\\pydoc exit 1 # [win] + - if exist %PREFIX%\\Scripts\\idle exit 1 # [win] + - if exist %PREFIX%\\Scripts\\2to3 exit 1 # [win] + - if not exist %PREFIX%\\Scripts\\pydoc-script.py exit 1 # [win] + - if not exist %PREFIX%\\Scripts\\idle-script.py exit 1 # [win] + - if not exist %PREFIX%\\Scripts\\2to3-script.py exit 1 # [win] + - if not exist %PREFIX%\\Scripts\\idle.exe exit 1 # [win] + - if not exist %PREFIX%\\Scripts\\2to3.exe exit 1 # [win] + - if not exist %PREFIX%\\Scripts\\pydoc.exe exit 1 # [win] + - pushd tests + - pushd distutils + - python setup.py install -v -v + - python -c "import foobar" + - popd + - pushd prefix-replacement # [unix] + - bash build-and-test.sh # [unix] + - popd # [unix] + - pushd cmake + - cmake -GNinja -DPY_VER={{ version }} + # --trace --debug-output --debug-trycompile . + - popd + - popd + - python run_test.py + - test ! -f default.profraw # [osx] + # Test workaround for https://github.com/conda/conda/issues/10969 + - test -d "$PREFIX/lib/python3.1/site-packages" # [unix] + - python3.1 --version # [unix] + # Test for segfault on osx-64 with libffi=3.4, see https://bugs.python.org/issue44556 + - python -c "from ctypes import CFUNCTYPE; CFUNCTYPE(None)(id)" + # Test for wide character supported via ncursesw + - TERM=xterm >/dev/null python -c "import curses; scr = curses.initscr(); curses.unget_wch('x'); assert 'x' == scr.get_wch()" # [unix] + # crypt module will be removed in 3.13 => this failing is a reminder to remove the libxcrypt dependency + - python -c "import crypt" # [unix] + + - name: libpython-static + script: build_static.sh # [unix] + script: build_static.bat # [win] + build: + number: {{ build_number }} + activate_in_script: true + ignore_run_exports: + - python_abi + script_env: + - PY_INTERP_DEBUG={{ py_interp_debug }} + string: h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }}_cpython # ["conda-forge" in (channel_targets or "")] + string: h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }} # ["conda-forge" not in (channel_targets or "")] + requirements: + build: + - {{ compiler('c') }} + - {{ stdlib('c') }} + - {{ compiler('cxx') }} +{% if from_source_control == 'yes' %} + - git +{% endif %} + host: + - {{ pin_subpackage('python', exact=True) }} + run: + - {{ pin_subpackage('python', exact=True) }} + test: + files: + - tests/prefix-replacement/* + requires: + - {{ stdlib('c') }} + - {{ compiler('c') }} + commands: + - VER=${PKG_VERSION%.*} # [not win] +{% if py_interp_debug == "yes" %} + - VERABI=${VER}d # [not win] +{% else %} + - VERABI=${VER} # [not win] +{% endif %} + - test -f ${PREFIX}/lib/libpython${VERABI}.a # [unix] + - test -f ${PREFIX}/lib/libpython${VERABI}.nolto.a # [unix] + - test -f ${PREFIX}/lib/python${VER}/config-${VERABI}-darwin/libpython${VERABI}.a # [osx] + - pushd tests/prefix-replacement # [unix] + - bash build-and-test.sh # [unix] + - popd # [unix] + + - name: cpython + build: + noarch: generic + requirements: + - python {{ version }}.* + - python_abi * *_cp{{ ver2nd }} + + - name: python-gil + build: + noarch: generic + requirements: + - cpython {{ version }}.* + - python_abi * *_cp{{ ver2nd }} + +about: + home: https://www.python.org/ + license: Python-2.0 + license_file: LICENSE + summary: General purpose programming language + description: | + Python is a widely used high-level, general-purpose, interpreted, dynamic + programming language. Its design philosophy emphasizes code + readability, and its syntax allows programmers to express concepts in + fewer lines of code than would be possible in languages such as C++ or + Java. The language provides constructs intended to enable clear programs + on both a small and large scale. + doc_url: https://www.python.org/doc/versions/ + doc_source_url: https://github.com/python/pythondotorg/blob/master/docs/source/index.rst + dev_url: https://docs.python.org/devguide/ + +extra: + feedstock-name: python + recipe-maintainers: + - chrisburr + - isuruf + - jakirkham + - mbargull + - mingwandroid + - msarahan + - pelson + - ocefpaf + - scopatz + - katietz + - xhochy diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0001-Win32-Change-FD_SETSIZE-from-512-to-2048.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0001-Win32-Change-FD_SETSIZE-from-512-to-2048.patch new file mode 100644 index 0000000000000000000000000000000000000000..7b648f9f7d85ee531ef52eead0664ddda8cd3a31 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0001-Win32-Change-FD_SETSIZE-from-512-to-2048.patch differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0002-Win32-distutils-Add-support-to-cygwinccompiler-for-V.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0002-Win32-distutils-Add-support-to-cygwinccompiler-for-V.patch new file mode 100644 index 0000000000000000000000000000000000000000..28005913723b9a9b7acd643f990e8e07ad5f506e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0002-Win32-distutils-Add-support-to-cygwinccompiler-for-V.patch differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0003-bpo-45258-search-for-isysroot-in-addition-to-sysroot.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0003-bpo-45258-search-for-isysroot-in-addition-to-sysroot.patch new file mode 100644 index 0000000000000000000000000000000000000000..dde08c72eb8287cebef0796058684a524aedb5b2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0003-bpo-45258-search-for-isysroot-in-addition-to-sysroot.patch differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0004-runtime_library_dir_option-Use-1st-word-of-CC-as-com.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0004-runtime_library_dir_option-Use-1st-word-of-CC-as-com.patch new file mode 100644 index 0000000000000000000000000000000000000000..13a4c9abc5b04859eef7fa3a50a009d890a03386 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0004-runtime_library_dir_option-Use-1st-word-of-CC-as-com.patch differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0005-Win32-Do-not-download-externals.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0005-Win32-Do-not-download-externals.patch new file mode 100644 index 0000000000000000000000000000000000000000..9ba3c55ab55efad21f834202fee0867e96fb80cb Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0005-Win32-Do-not-download-externals.patch differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0006-Fix-find_library-so-that-it-looks-in-sys.prefix-lib-.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0006-Fix-find_library-so-that-it-looks-in-sys.prefix-lib-.patch new file mode 100644 index 0000000000000000000000000000000000000000..87eae554ae942471d259146ae16f7e1863d45bd1 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0006-Fix-find_library-so-that-it-looks-in-sys.prefix-lib-.patch differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0007-bpo-22699-Allow-compiling-on-debian-ubuntu-with-a-di.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0007-bpo-22699-Allow-compiling-on-debian-ubuntu-with-a-di.patch new file mode 100644 index 0000000000000000000000000000000000000000..c5b37796ceb225290a87eb7b009b98478d43ed05 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0007-bpo-22699-Allow-compiling-on-debian-ubuntu-with-a-di.patch differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0008-Disable-registry-lookup-unless-CONDA_PY_ALLOW_REG_PA.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0008-Disable-registry-lookup-unless-CONDA_PY_ALLOW_REG_PA.patch new file mode 100644 index 0000000000000000000000000000000000000000..6465d247493d6f2e023058350437da32fca5f70b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0008-Disable-registry-lookup-unless-CONDA_PY_ALLOW_REG_PA.patch differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0009-Unvendor-openssl.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0009-Unvendor-openssl.patch new file mode 100644 index 0000000000000000000000000000000000000000..4cb22f4b3be6227d0ecbc913c8754a012cbdc140 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0009-Unvendor-openssl.patch differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0010-Unvendor-sqlite3.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0010-Unvendor-sqlite3.patch new file mode 100644 index 0000000000000000000000000000000000000000..23dc633ccca5de02ce2cdb68efb1968bb599951b Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0010-Unvendor-sqlite3.patch differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0011-Use-ranlib-from-env-if-env-variable-is-set.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0011-Use-ranlib-from-env-if-env-variable-is-set.patch new file mode 100644 index 0000000000000000000000000000000000000000..41b2a142b0457cb6eba0427738a953c90f46ec6e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0011-Use-ranlib-from-env-if-env-variable-is-set.patch differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0012-Add-CondaEcosystemModifyDllSearchPath.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0012-Add-CondaEcosystemModifyDllSearchPath.patch new file mode 100644 index 0000000000000000000000000000000000000000..81d5e8578b3d77ceea60880ebb1ddef2e8409126 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0012-Add-CondaEcosystemModifyDllSearchPath.patch differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0013-Add-d1trimfile-SRC_DIR-to-make-pdbs-more-relocatable.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0013-Add-d1trimfile-SRC_DIR-to-make-pdbs-more-relocatable.patch new file mode 100644 index 0000000000000000000000000000000000000000..003d8cfcbecce628e254480b0045c59e2a936a7d Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0013-Add-d1trimfile-SRC_DIR-to-make-pdbs-more-relocatable.patch differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0014-Doing-d1trimfile.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0014-Doing-d1trimfile.patch new file mode 100644 index 0000000000000000000000000000000000000000..15cae26982e009eee02a8013816bd32d93733eb9 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0014-Doing-d1trimfile.patch differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0015-cross-compile-darwin.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0015-cross-compile-darwin.patch new file mode 100644 index 0000000000000000000000000000000000000000..384e5ee27ee1390d8ddc058adebb0a0c1ea4d77e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0015-cross-compile-darwin.patch differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0016-Fix-TZPATH-on-windows.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0016-Fix-TZPATH-on-windows.patch new file mode 100644 index 0000000000000000000000000000000000000000..66eb7afb92306142ee924078c5da96247f515c7e Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0016-Fix-TZPATH-on-windows.patch differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0017-Make-dyld-search-work-with-SYSTEM_VERSION_COMPAT-1.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0017-Make-dyld-search-work-with-SYSTEM_VERSION_COMPAT-1.patch new file mode 100644 index 0000000000000000000000000000000000000000..c390d021db544c0f8640db02837ecee28301e900 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0017-Make-dyld-search-work-with-SYSTEM_VERSION_COMPAT-1.patch differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0018-Fix-LDSHARED-when-CC-is-overriden-on-Linux-too.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0018-Fix-LDSHARED-when-CC-is-overriden-on-Linux-too.patch new file mode 100644 index 0000000000000000000000000000000000000000..400a3c8ff3cb4d5d156d4338febefc20c30abee4 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0018-Fix-LDSHARED-when-CC-is-overriden-on-Linux-too.patch differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0019-Unvendor-bzip2.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0019-Unvendor-bzip2.patch new file mode 100644 index 0000000000000000000000000000000000000000..3bfdf33f0c0eb40f6f35c16890e7c0bacd272912 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0019-Unvendor-bzip2.patch differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0020-Unvendor-libffi.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0020-Unvendor-libffi.patch new file mode 100644 index 0000000000000000000000000000000000000000..0084da3b89615da2f360850797624a27ce1c24e2 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0020-Unvendor-libffi.patch differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0021-Unvendor-tcltk.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0021-Unvendor-tcltk.patch new file mode 100644 index 0000000000000000000000000000000000000000..008bdc3b8678e64c1ab3c059a20f549835ff9b06 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0021-Unvendor-tcltk.patch differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0022-unvendor-xz.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0022-unvendor-xz.patch new file mode 100644 index 0000000000000000000000000000000000000000..389adbe3fc8e85de46c4eda7a388e1a474afa310 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0022-unvendor-xz.patch differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0023-unvendor-zlib.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0023-unvendor-zlib.patch new file mode 100644 index 0000000000000000000000000000000000000000..6a7b0d76ec4e3468ebb7c67f4f80a6684b313d89 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0023-unvendor-zlib.patch differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0024-Do-not-pass-g-to-GCC-when-not-Py_DEBUG.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0024-Do-not-pass-g-to-GCC-when-not-Py_DEBUG.patch new file mode 100644 index 0000000000000000000000000000000000000000..19ffb1e37f42721c1ca5ce6a395abc8b1ba01c97 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0024-Do-not-pass-g-to-GCC-when-not-Py_DEBUG.patch differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0025-Unvendor-expat.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0025-Unvendor-expat.patch new file mode 100644 index 0000000000000000000000000000000000000000..2f0b3ffc21b7fe45411b600f0115fcac5e59a004 Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0025-Unvendor-expat.patch differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0026-Do-not-define-pid_t-as-it-might-conflict-with-the-ac.patch b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0026-Do-not-define-pid_t-as-it-might-conflict-with-the-ac.patch new file mode 100644 index 0000000000000000000000000000000000000000..48cf04f23c9a5bd2486734e0aeedd43ff797636a Binary files /dev/null and b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/0026-Do-not-define-pid_t-as-it-might-conflict-with-the-ac.patch differ diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/README.md b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a2c097418c7b57d97f9511a18dcc35cafeafb534 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/README.md @@ -0,0 +1,17 @@ +### How to re-generate patches +```bash +old=v3.9.6 +new=v3.10.0 +git clone git@github.com:python/cpython && cd cpython +git reset --hard $old +for f in ../recipe/patches/*.patch; do + git am $f; +done +head=$(git rev-parse HEAD) +git reset --hard $new +git cherry-pick $old...$head # fix conflicts and make sure the editor doesn't add end of file line ending +git format-patch --no-signature $new +for f in *.patch; do + python ../recipe/patches/make-mixed-crlf-patch.py $f; +done +``` diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/make-mixed-crlf-patch.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/make-mixed-crlf-patch.py new file mode 100644 index 0000000000000000000000000000000000000000..d52b6be27282cbad8e8358afb2ac80f01760b417 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/patches/make-mixed-crlf-patch.py @@ -0,0 +1,52 @@ +import sys +import re +import tempfile +import shutil + + +# Reads from argv[1] line-by-line, writes to same file. The patch +# header lines are given LF line endings and the rest CRLF line endings. +# Does not currently deal with the prelude (up to the -- in git patches). + +def main(argv): + filename = argv[1] + lines = [] + with open(filename, 'rb') as fi: + try: + for line in fi: + line = line.decode('utf-8').strip('\n').strip('\r\n') + lines.append(line) + except: + pass + is_git_diff = False + for line in lines: + if line.startswith('diff --git'): + is_git_diff = True + in_real_patch = False if is_git_diff else True + + text = "\n".join(lines) + + if ".bat" not in text and ".vcxproj" not in text and ".props" not in text: + return + + with open(filename, 'wb') as fo: + for i, line in enumerate(lines): + if not in_real_patch: + fo.write((line + '\n').encode('utf-8')) + if line.startswith('diff --git'): + in_real_patch = True + else: + if line.startswith('diff ') or \ + line.startswith('diff --git') or \ + line.startswith('--- ') or \ + line.startswith('+++ ') or \ + line.startswith('@@ ') or \ + line.startswith('index ') or \ + (i < len(lines) - 1 and lines[i+1].startswith(r"\ No newline at end of file")): + fo.write((line + '\n').encode('utf-8')) + else: + fo.write((line + '\r\n').encode('utf-8')) + + +if __name__ == '__main__': + main(sys.argv) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/recipe-license.txt b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/recipe-license.txt new file mode 100644 index 0000000000000000000000000000000000000000..0490acc59477931de4af397ddbbe87ea7ddf8af0 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/recipe-license.txt @@ -0,0 +1,28 @@ +This recipe is based upon the python-3.5 recipe from +https://github.com/ContinuumIO/anaconda-recipes +which is released under the following BSD license: + +(c) 2016 Continuum Analytics, Inc. / http://continuum.io +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 Continuum Analytics, 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 CONTINUUM ANALYTICS 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/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/recipe-scripts-license.txt b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/recipe-scripts-license.txt new file mode 100644 index 0000000000000000000000000000000000000000..37f86184003c2b95ccdf45542a54b3629fb46a3f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/recipe-scripts-license.txt @@ -0,0 +1,26 @@ +BSD-3-Clause license +Copyright (c) 2015-2026, conda-forge contributors + +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 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. diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/replace-word-pairs.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/replace-word-pairs.py new file mode 100644 index 0000000000000000000000000000000000000000..9093d79f5fe377c9b05f34079f711ecab74d03fd --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/replace-word-pairs.py @@ -0,0 +1,29 @@ +import sys +import re + +# Reads from stdin line by line, writes to stdout line by line replacing +# each odd argument with the subsequent even argument. + +def pairs(it): + it = iter(it) + try: + while True: + yield next(it), next(it) + except StopIteration: + return + +def main(): + rep_dict = dict() + for fro, to in pairs(sys.argv[1:]): + rep_dict[fro] = to + if len(rep_dict): + regex = re.compile("(%s)" % "|".join(map(re.escape, rep_dict.keys()))) + for line in iter(sys.stdin.readline, ''): + sys.stdout.write(regex.sub(lambda mo: rep_dict[mo.string[mo.start():mo.end()]], line)) + else: + for line in iter(sys.stdin.readline, ''): + sys.stdout.write(line) + + +if __name__ == '__main__': + main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/run_test.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/run_test.py new file mode 100644 index 0000000000000000000000000000000000000000..818f4d928bc00a7c6c116c0c669e54def11b0f45 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/run_test.py @@ -0,0 +1,109 @@ +import os +import platform +import sys +import subprocess + +armv6l = bool(platform.machine() == 'armv6l') +armv7l = bool(platform.machine() == 'armv7l') +ppc64le = bool(platform.machine() == 'ppc64le') +if sys.platform == 'darwin': + osx105 = b'10.5.' in subprocess.check_output('sw_vers') +else: + osx105 = False + +print('sys.version:', sys.version) +print('sys.platform:', sys.platform) +print('tuple.__itemsize__:', tuple.__itemsize__) +if sys.platform == 'win32': + assert 'MSC v.19' in sys.version +print('sys.maxunicode:', sys.maxunicode) +print('platform.architecture:', platform.architecture()) +print('platform.python_version:', platform.python_version()) + +import _bisect +import _codecs_cn +import _codecs_hk +import _codecs_iso2022 +import _codecs_jp +import _codecs_kr +import _codecs_tw +import _collections +import _csv +import _ctypes +import _ctypes_test +import _decimal +import _elementtree +import _functools +import _hashlib +import _heapq +import _io +import _json +import _locale +import _lsprof +import _lzma +import _multibytecodec +import _multiprocessing +import _random +import _socket +import _sqlite3 +import _ssl +import _struct +import _testcapi +import array +import audioop +import binascii +import bz2 +import cmath +import datetime +import itertools +import lzma +import math +import mmap +import operator +import pyexpat +import select +import time +import test +import test.support +import unicodedata +import zlib +from os import urandom +import os + +t = 100 * b'Foo ' +assert lzma.decompress(lzma.compress(t)) == t + +if sys.platform != 'win32': + if not (ppc64le or armv7l): + import _curses + import _curses_panel + import crypt + import fcntl + import grp + import nis + import readline + import resource + import syslog + import termios + +if os.getenv('PY_INTERP_DEBUG') == 'yes': + if sys.platform != 'win32': + assert 'd' in sys.abiflags + assert 'gettotalrefcount' in dir(sys) + +if not (armv6l or armv7l or ppc64le or osx105): + import tkinter + import turtle + import _tkinter + print('TK_VERSION: %s' % _tkinter.TK_VERSION) + print('TCL_VERSION: %s' % _tkinter.TCL_VERSION) + TCLTK_VER = os.getenv('tk') + assert _tkinter.TK_VERSION == _tkinter.TCL_VERSION == TCLTK_VER + +import ssl +print('OPENSSL_VERSION:', ssl.OPENSSL_VERSION) +CONDA_OPENSSL_VERSION = os.getenv('openssl').split(".")[0] +assert CONDA_OPENSSL_VERSION in ssl.OPENSSL_VERSION + +# See https://github.com/conda-forge/python-feedstock/issues/718 for context: +assert sys.hash_info.algorithm.startswith("siphash") diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/tests/cmake/CMakeLists.txt b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/tests/cmake/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..6acf308527499136444198477edf824b788868a3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/tests/cmake/CMakeLists.txt @@ -0,0 +1,16 @@ +# https://martinopilia.com/posts/2018/09/15/building-python-extension.html +# FindPythonInterp and FindPythonLibs are deprecated since cmake 3.12 +# These can be replaced by find_package(Python ${PY_VER} REQUIRED) +# But these are still used by other packages, so we keep them. + +cmake_minimum_required(VERSION 3.10) +enable_language(C) +project(mymath) + +option(PY_VER, "Python version to use") + +find_package(PythonInterp ${PY_VER} REQUIRED) +# PATHS $ENV{CONDA_PREFIX} + +# This goes after, since it uses PythonInterp as hint +find_package(PythonLibs ${PY_VER} REQUIRED) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/tests/distutils.cext/foo.c b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/tests/distutils.cext/foo.c new file mode 100644 index 0000000000000000000000000000000000000000..b9c9b180a4aa814039aafa2d63a981954be18c18 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/tests/distutils.cext/foo.c @@ -0,0 +1,36 @@ +#include + +static PyObject * +greet_name(PyObject *self, PyObject *args) +{ + const char *name; + + if (!PyArg_ParseTuple(args, "s", &name)) + { + return NULL; + } + + printf("Hello %s!\n", name); + + Py_RETURN_NONE; +} + +static PyMethodDef GreetMethods[] = { + {"greet", greet_name, METH_VARARGS, "Greet an entity."}, + {NULL, NULL, 0, NULL} +}; + +static struct PyModuleDef greet = +{ + PyModuleDef_HEAD_INIT, + "greet", /* name of module */ + "", /* module documentation, may be NULL */ + -1, /* size of per-interpreter state of the module, or -1 if the module keeps state in global variables. */ + GreetMethods +}; + +PyMODINIT_FUNC PyInit_greet(void) +{ + return PyModule_Create(&greet); +} + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/tests/distutils.cext/foo.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/tests/distutils.cext/foo.py new file mode 100644 index 0000000000000000000000000000000000000000..913de8f4ada0b6b40311bda55879081553cf9b66 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/tests/distutils.cext/foo.py @@ -0,0 +1,7 @@ +import greet + +def main(): + greet.greet('World') + +if __name__ == "__main__": + main() diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/tests/distutils.cext/setup.py.do_not_run_me_on_0_releases b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/tests/distutils.cext/setup.py.do_not_run_me_on_0_releases new file mode 100644 index 0000000000000000000000000000000000000000..3135045d3ed913300238e51382c6fbdb5ef3ab2f --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/tests/distutils.cext/setup.py.do_not_run_me_on_0_releases @@ -0,0 +1,14 @@ +from setuptools import setup, Extension + + +setup( + name='greet', + version='1.0', + description='Python Package with Hello World C Extension', + ext_modules=[ + Extension( + 'greet', + sources=['foo.c'], + py_limited_api=True) + ], +) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/tests/distutils/foobar.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/tests/distutils/foobar.py new file mode 100644 index 0000000000000000000000000000000000000000..6cd9d15e9dd066a0caf5fbd290d5d943774a41a4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/tests/distutils/foobar.py @@ -0,0 +1,3 @@ +if __name__ == '__main__': + print('foo') + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/tests/distutils/setup.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/tests/distutils/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..383d4862faeb7a235b6a54e60f85d8e17e3b5c8a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/tests/distutils/setup.py @@ -0,0 +1,6 @@ +from distutils.core import setup + +setup(name='foobar', + version='1.0', + py_modules=['foobar'], + ) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/tests/prefix-replacement/a.c b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/tests/prefix-replacement/a.c new file mode 100644 index 0000000000000000000000000000000000000000..b113829a2ba50a536ab93c23aa991c41c1e39362 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/tests/prefix-replacement/a.c @@ -0,0 +1,22 @@ +#define PY_SSIZE_T_CLEAN +#include + +int +main(int argc, char *argv[]) +{ + wchar_t *program = Py_DecodeLocale(argv[0], NULL); + if (program == NULL) { + fprintf(stderr, "Fatal error: cannot decode argv[0]\n"); + exit(1); + } + Py_SetProgramName(program); /* optional but recommended */ + Py_Initialize(); + PyRun_SimpleString("from time import time,ctime\n" + "print('Today is', ctime(time()))\n"); + if (Py_FinalizeEx() < 0) { + exit(120); + } + PyMem_RawFree(program); + return 0; +} + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/tests/prefix-replacement/build-and-test.sh b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/tests/prefix-replacement/build-and-test.sh new file mode 100644 index 0000000000000000000000000000000000000000..acd3bf8bbd9ed797968040ba50ea0f0da703c845 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/recipe/parent/tests/prefix-replacement/build-and-test.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash + +set -ex + +if [[ "$PKG_NAME" == "libpython-static" ]]; then + # see bpo44182 for why -L${CONDA_PREFIX}/lib is added + ${CC} a.c $(python3-config --cflags) $(python3-config --embed --ldflags) -L${CONDA_PREFIX}/lib -o ${CONDA_PREFIX}/bin/embedded-python-static + if [[ "$target_platform" == linux-* ]]; then + if ${READELF} -d ${CONDA_PREFIX}/bin/embedded-python-static | rg libpython; then + echo "ERROR :: Embedded python linked to shared python library. It is expected to link to the static library." + fi + elif [[ "$target_platform" == osx-* ]]; then + if ${OTOOL} -l ${CONDA_PREFIX}/bin/embedded-python-static | rg libpython; then + echo "ERROR :: Embedded python linked to shared python library. It is expected to link to the static library." + fi + fi + ${CONDA_PREFIX}/bin/embedded-python-static + + # I thought this would prefer the shared library for Python. I was wrong: + # EMBED_LDFLAGS=$(python3-config --ldflags) + # re='^(.*)(-lpython[^ ]*)(.*)$' + # if [[ ${EMBED_LDFLAGS} =~ $re ]]; then + # EMBED_LDFLAGS="${BASH_REMATCH[1]} ${BASH_REMATCH[3]} -Wl,-Bdynamic ${BASH_REMATCH[2]}" + # fi + # ${CC} a.c $(python3-config --cflags) ${EMBED_LDFLAGS} -o ${CONDA_PREFIX}/bin/embedded-python-shared + + # Brute-force way of linking to the shared library, sorry! + rm -rf ${CONDA_PREFIX}/lib/libpython*.a +fi + +${CC} a.c $(python3-config --cflags) \ + $(python3-config --embed --ldflags) \ + -L${CONDA_PREFIX}/lib -Wl,-rpath,${CONDA_PREFIX}/lib \ + -o ${CONDA_PREFIX}/bin/embedded-python-shared + +if [[ "$target_platform" == linux-* ]]; then + if ! ${READELF} -d ${CONDA_PREFIX}/bin/embedded-python-shared | rg libpython; then + echo "ERROR :: Embedded python linked to static python library. We tried to force it to use the shared library." + fi +elif [[ "$target_platform" == osx-* ]]; then + if ! ${OTOOL} -l ${CONDA_PREFIX}/bin/embedded-python-shared | rg libpython; then + echo "ERROR :: Embedded python linked to static python library. We tried to force it to use the shared library." + fi +fi +${CONDA_PREFIX}/bin/embedded-python-shared + +set +x diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/test/run_test.bat b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/test/run_test.bat new file mode 100644 index 0000000000000000000000000000000000000000..6e81904e8fd873c0d5c780cdef7cc708e0d88027 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/test/run_test.bat @@ -0,0 +1,77 @@ + + +@echo on + +echo on +IF %ERRORLEVEL% NEQ 0 exit /B 1 +set +IF %ERRORLEVEL% NEQ 0 exit /B 1 +python -V +IF %ERRORLEVEL% NEQ 0 exit /B 1 +2to3 -h +IF %ERRORLEVEL% NEQ 0 exit /B 1 +pydoc -h +IF %ERRORLEVEL% NEQ 0 exit /B 1 +set "PIP_NO_BUILD_ISOLATION=False" +IF %ERRORLEVEL% NEQ 0 exit /B 1 +set "PIP_NO_DEPENDENCIES=True" +IF %ERRORLEVEL% NEQ 0 exit /B 1 +set "PIP_IGNORE_INSTALLED=True" +IF %ERRORLEVEL% NEQ 0 exit /B 1 +set "PIP_NO_INDEX=True" +IF %ERRORLEVEL% NEQ 0 exit /B 1 +set "PIP_CACHE_DIR=%CONDA_PREFIX%/pip_cache" +IF %ERRORLEVEL% NEQ 0 exit /B 1 +set "TEMP=%CONDA_PREFIX%/tmp" +IF %ERRORLEVEL% NEQ 0 exit /B 1 +mkdir "%TEMP%" +IF %ERRORLEVEL% NEQ 0 exit /B 1 +python -Im ensurepip --upgrade --default-pip +IF %ERRORLEVEL% NEQ 0 exit /B 1 +python -c "from zoneinfo import ZoneInfo; from datetime import datetime; dt = datetime(2020, 10, 31, 12, tzinfo=ZoneInfo('America/Los_Angeles')); print(dt.tzname())" +IF %ERRORLEVEL% NEQ 0 exit /B 1 +python -m venv test-venv +IF %ERRORLEVEL% NEQ 0 exit /B 1 +test-venv\\Scripts\\python.exe -c "import ctypes" +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if exist %PREFIX%\\Scripts\\pydoc exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if exist %PREFIX%\\Scripts\\idle exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if exist %PREFIX%\\Scripts\\2to3 exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if not exist %PREFIX%\\Scripts\\pydoc-script.py exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if not exist %PREFIX%\\Scripts\\idle-script.py exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if not exist %PREFIX%\\Scripts\\2to3-script.py exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if not exist %PREFIX%\\Scripts\\idle.exe exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if not exist %PREFIX%\\Scripts\\2to3.exe exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +if not exist %PREFIX%\\Scripts\\pydoc.exe exit 1 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +pushd tests +IF %ERRORLEVEL% NEQ 0 exit /B 1 +pushd distutils +IF %ERRORLEVEL% NEQ 0 exit /B 1 +python setup.py install -v -v +IF %ERRORLEVEL% NEQ 0 exit /B 1 +python -c "import foobar" +IF %ERRORLEVEL% NEQ 0 exit /B 1 +popd +IF %ERRORLEVEL% NEQ 0 exit /B 1 +pushd cmake +IF %ERRORLEVEL% NEQ 0 exit /B 1 +cmake -GNinja -DPY_VER=3.11.15 +IF %ERRORLEVEL% NEQ 0 exit /B 1 +popd +IF %ERRORLEVEL% NEQ 0 exit /B 1 +popd +IF %ERRORLEVEL% NEQ 0 exit /B 1 +python run_test.py +IF %ERRORLEVEL% NEQ 0 exit /B 1 +python -c "from ctypes import CFUNCTYPE; CFUNCTYPE(None)(id)" +IF %ERRORLEVEL% NEQ 0 exit /B 1 +exit /B 0 diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/test/run_test.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/test/run_test.py new file mode 100644 index 0000000000000000000000000000000000000000..818f4d928bc00a7c6c116c0c669e54def11b0f45 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/test/run_test.py @@ -0,0 +1,109 @@ +import os +import platform +import sys +import subprocess + +armv6l = bool(platform.machine() == 'armv6l') +armv7l = bool(platform.machine() == 'armv7l') +ppc64le = bool(platform.machine() == 'ppc64le') +if sys.platform == 'darwin': + osx105 = b'10.5.' in subprocess.check_output('sw_vers') +else: + osx105 = False + +print('sys.version:', sys.version) +print('sys.platform:', sys.platform) +print('tuple.__itemsize__:', tuple.__itemsize__) +if sys.platform == 'win32': + assert 'MSC v.19' in sys.version +print('sys.maxunicode:', sys.maxunicode) +print('platform.architecture:', platform.architecture()) +print('platform.python_version:', platform.python_version()) + +import _bisect +import _codecs_cn +import _codecs_hk +import _codecs_iso2022 +import _codecs_jp +import _codecs_kr +import _codecs_tw +import _collections +import _csv +import _ctypes +import _ctypes_test +import _decimal +import _elementtree +import _functools +import _hashlib +import _heapq +import _io +import _json +import _locale +import _lsprof +import _lzma +import _multibytecodec +import _multiprocessing +import _random +import _socket +import _sqlite3 +import _ssl +import _struct +import _testcapi +import array +import audioop +import binascii +import bz2 +import cmath +import datetime +import itertools +import lzma +import math +import mmap +import operator +import pyexpat +import select +import time +import test +import test.support +import unicodedata +import zlib +from os import urandom +import os + +t = 100 * b'Foo ' +assert lzma.decompress(lzma.compress(t)) == t + +if sys.platform != 'win32': + if not (ppc64le or armv7l): + import _curses + import _curses_panel + import crypt + import fcntl + import grp + import nis + import readline + import resource + import syslog + import termios + +if os.getenv('PY_INTERP_DEBUG') == 'yes': + if sys.platform != 'win32': + assert 'd' in sys.abiflags + assert 'gettotalrefcount' in dir(sys) + +if not (armv6l or armv7l or ppc64le or osx105): + import tkinter + import turtle + import _tkinter + print('TK_VERSION: %s' % _tkinter.TK_VERSION) + print('TCL_VERSION: %s' % _tkinter.TCL_VERSION) + TCLTK_VER = os.getenv('tk') + assert _tkinter.TK_VERSION == _tkinter.TCL_VERSION == TCLTK_VER + +import ssl +print('OPENSSL_VERSION:', ssl.OPENSSL_VERSION) +CONDA_OPENSSL_VERSION = os.getenv('openssl').split(".")[0] +assert CONDA_OPENSSL_VERSION in ssl.OPENSSL_VERSION + +# See https://github.com/conda-forge/python-feedstock/issues/718 for context: +assert sys.hash_info.algorithm.startswith("siphash") diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/test/test_time_dependencies.json b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/test/test_time_dependencies.json new file mode 100644 index 0000000000000000000000000000000000000000..5a053a7022f69024a13e7318a220e231715bde92 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/test/test_time_dependencies.json @@ -0,0 +1 @@ +["ripgrep", "vs2022_win-64", "vs_win-64", "cmake", "ninja"] \ No newline at end of file diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/test/tests/cmake/CMakeLists.txt b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/test/tests/cmake/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..6acf308527499136444198477edf824b788868a3 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/test/tests/cmake/CMakeLists.txt @@ -0,0 +1,16 @@ +# https://martinopilia.com/posts/2018/09/15/building-python-extension.html +# FindPythonInterp and FindPythonLibs are deprecated since cmake 3.12 +# These can be replaced by find_package(Python ${PY_VER} REQUIRED) +# But these are still used by other packages, so we keep them. + +cmake_minimum_required(VERSION 3.10) +enable_language(C) +project(mymath) + +option(PY_VER, "Python version to use") + +find_package(PythonInterp ${PY_VER} REQUIRED) +# PATHS $ENV{CONDA_PREFIX} + +# This goes after, since it uses PythonInterp as hint +find_package(PythonLibs ${PY_VER} REQUIRED) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/test/tests/distutils/foobar.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/test/tests/distutils/foobar.py new file mode 100644 index 0000000000000000000000000000000000000000..6cd9d15e9dd066a0caf5fbd290d5d943774a41a4 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/test/tests/distutils/foobar.py @@ -0,0 +1,3 @@ +if __name__ == '__main__': + print('foo') + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/test/tests/distutils/setup.py b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/test/tests/distutils/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..383d4862faeb7a235b6a54e60f85d8e17e3b5c8a --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/test/tests/distutils/setup.py @@ -0,0 +1,6 @@ +from distutils.core import setup + +setup(name='foobar', + version='1.0', + py_modules=['foobar'], + ) diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/test/tests/prefix-replacement/a.c b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/test/tests/prefix-replacement/a.c new file mode 100644 index 0000000000000000000000000000000000000000..b113829a2ba50a536ab93c23aa991c41c1e39362 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/test/tests/prefix-replacement/a.c @@ -0,0 +1,22 @@ +#define PY_SSIZE_T_CLEAN +#include + +int +main(int argc, char *argv[]) +{ + wchar_t *program = Py_DecodeLocale(argv[0], NULL); + if (program == NULL) { + fprintf(stderr, "Fatal error: cannot decode argv[0]\n"); + exit(1); + } + Py_SetProgramName(program); /* optional but recommended */ + Py_Initialize(); + PyRun_SimpleString("from time import time,ctime\n" + "print('Today is', ctime(time()))\n"); + if (Py_FinalizeEx() < 0) { + exit(120); + } + PyMem_RawFree(program); + return 0; +} + diff --git a/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/test/tests/prefix-replacement/build-and-test.sh b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/test/tests/prefix-replacement/build-and-test.sh new file mode 100644 index 0000000000000000000000000000000000000000..acd3bf8bbd9ed797968040ba50ea0f0da703c845 --- /dev/null +++ b/micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/info/test/tests/prefix-replacement/build-and-test.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash + +set -ex + +if [[ "$PKG_NAME" == "libpython-static" ]]; then + # see bpo44182 for why -L${CONDA_PREFIX}/lib is added + ${CC} a.c $(python3-config --cflags) $(python3-config --embed --ldflags) -L${CONDA_PREFIX}/lib -o ${CONDA_PREFIX}/bin/embedded-python-static + if [[ "$target_platform" == linux-* ]]; then + if ${READELF} -d ${CONDA_PREFIX}/bin/embedded-python-static | rg libpython; then + echo "ERROR :: Embedded python linked to shared python library. It is expected to link to the static library." + fi + elif [[ "$target_platform" == osx-* ]]; then + if ${OTOOL} -l ${CONDA_PREFIX}/bin/embedded-python-static | rg libpython; then + echo "ERROR :: Embedded python linked to shared python library. It is expected to link to the static library." + fi + fi + ${CONDA_PREFIX}/bin/embedded-python-static + + # I thought this would prefer the shared library for Python. I was wrong: + # EMBED_LDFLAGS=$(python3-config --ldflags) + # re='^(.*)(-lpython[^ ]*)(.*)$' + # if [[ ${EMBED_LDFLAGS} =~ $re ]]; then + # EMBED_LDFLAGS="${BASH_REMATCH[1]} ${BASH_REMATCH[3]} -Wl,-Bdynamic ${BASH_REMATCH[2]}" + # fi + # ${CC} a.c $(python3-config --cflags) ${EMBED_LDFLAGS} -o ${CONDA_PREFIX}/bin/embedded-python-shared + + # Brute-force way of linking to the shared library, sorry! + rm -rf ${CONDA_PREFIX}/lib/libpython*.a +fi + +${CC} a.c $(python3-config --cflags) \ + $(python3-config --embed --ldflags) \ + -L${CONDA_PREFIX}/lib -Wl,-rpath,${CONDA_PREFIX}/lib \ + -o ${CONDA_PREFIX}/bin/embedded-python-shared + +if [[ "$target_platform" == linux-* ]]; then + if ! ${READELF} -d ${CONDA_PREFIX}/bin/embedded-python-shared | rg libpython; then + echo "ERROR :: Embedded python linked to static python library. We tried to force it to use the shared library." + fi +elif [[ "$target_platform" == osx-* ]]; then + if ! ${OTOOL} -l ${CONDA_PREFIX}/bin/embedded-python-shared | rg libpython; then + echo "ERROR :: Embedded python linked to static python library. We tried to force it to use the shared library." + fi +fi +${CONDA_PREFIX}/bin/embedded-python-shared + +set +x