Update copyrights to 2025

This commit is contained in:
2025-08-24 09:01:59 +02:00
parent 6072bfab68
commit 1857d59375
43 changed files with 909 additions and 909 deletions

View File

@@ -9,7 +9,7 @@
* It contains different algorithms for iterating, searching and modifying * It contains different algorithms for iterating, searching and modifying
* template arguments. * template arguments.
* *
* Copyright: Eugene Wissner 2017-2020. * Copyright: Eugene Wissner 2017-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)
@@ -34,7 +34,7 @@ import tanya.meta.transform;
* $(D_INLINECODE Args[0] < Args[1]), a positive number that * $(D_INLINECODE Args[0] < Args[1]), a positive number that
* $(D_INLINECODE Args[0] > Args[1]), `0` if they equal.) * $(D_INLINECODE Args[0] > Args[1]), `0` if they equal.)
* ) * )
* *
* Params: * Params:
* pred = Template predicate. * pred = Template predicate.
* Args = Elements for which you want to find the minimum value. * Args = Elements for which you want to find the minimum value.
@@ -81,7 +81,7 @@ if (Args.length > 0 && __traits(isTemplate, pred))
* $(D_INLINECODE Args[0] < Args[1]), a positive number that * $(D_INLINECODE Args[0] < Args[1]), a positive number that
* $(D_INLINECODE Args[0] > Args[1]), `0` if they equal.) * $(D_INLINECODE Args[0] > Args[1]), `0` if they equal.)
* ) * )
* *
* Params: * Params:
* pred = Template predicate. * pred = Template predicate.
* Args = Elements for which you want to find the maximum value. * Args = Elements for which you want to find the maximum value.
@@ -792,7 +792,7 @@ alias AliasSeq(Args...) = Args;
* so $(D_INLINECODE F!([0]) && F!([1])) and so on, can be called. * so $(D_INLINECODE F!([0]) && F!([1])) and so on, can be called.
* *
* Params: * Params:
* F = Template predicate. * F = Template predicate.
* L = List of items to test. * L = List of items to test.
* *
* Returns: $(D_KEYWORD true) if all the items of $(D_PARAM L) satisfy * Returns: $(D_KEYWORD true) if all the items of $(D_PARAM L) satisfy
@@ -815,7 +815,7 @@ enum bool allSatisfy(alias F, L...) = Filter!(templateNot!F, L).length == 0;
* so $(D_INLINECODE F!([0]) && F!([1])) and so on, can be called. * so $(D_INLINECODE F!([0]) && F!([1])) and so on, can be called.
* *
* Params: * Params:
* F = Template predicate. * F = Template predicate.
* L = List of items to test. * L = List of items to test.
* *
* Returns: $(D_KEYWORD true) if any of the items of $(D_PARAM L) satisfy * Returns: $(D_KEYWORD true) if any of the items of $(D_PARAM L) satisfy

View File

@@ -9,7 +9,7 @@
* to transform from one type to another. It has also different algorithms for * to transform from one type to another. It has also different algorithms for
* iterating, searching and modifying template arguments. * iterating, searching and modifying template arguments.
* *
* Copyright: Eugene Wissner 2017-2020. * Copyright: Eugene Wissner 2017-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -8,7 +8,7 @@
* Templates in this module are used to obtain type information at compile * Templates in this module are used to obtain type information at compile
* time. * time.
* *
* Copyright: Eugene Wissner 2017-2020. * Copyright: Eugene Wissner 2017-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -9,7 +9,7 @@
* types. They take some type as argument and return a different type after * types. They take some type as argument and return a different type after
* perfoming the specified transformation. * perfoming the specified transformation.
* *
* Copyright: Eugene Wissner 2017-2020. * Copyright: Eugene Wissner 2017-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

Binary file not shown.

View File

@@ -6,9 +6,9 @@
* This module contains the interface for implementing custom allocators. * This module contains the interface for implementing custom allocators.
* *
* Allocators are classes encapsulating memory allocation strategy. This allows * Allocators are classes encapsulating memory allocation strategy. This allows
* to decouple memory management from the algorithms and the data. * to decouple memory management from the algorithms and the data.
* *
* Copyright: Eugene Wissner 2016-2020. * Copyright: Eugene Wissner 2016-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -5,7 +5,7 @@
/** /**
* Lifetime management functions, types and related exceptions. * Lifetime management functions, types and related exceptions.
* *
* Copyright: Eugene Wissner 2019-2020. * Copyright: Eugene Wissner 2019-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -6,7 +6,7 @@
* Allocator based on $(D_PSYMBOL malloc), $(D_PSYMBOL realloc) and * Allocator based on $(D_PSYMBOL malloc), $(D_PSYMBOL realloc) and
* $(D_PSYMBOL free). * $(D_PSYMBOL free).
* *
* Copyright: Eugene Wissner 2017-2020. * Copyright: Eugene Wissner 2017-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -5,7 +5,7 @@
/* /*
* Native allocator. * Native allocator.
* *
* Copyright: Eugene Wissner 2016-2020. * Copyright: Eugene Wissner 2016-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -1,11 +1,11 @@
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/** /**
* Set of operations on memory blocks. * Set of operations on memory blocks.
* *
* Copyright: Eugene Wissner 2017-2020. * Copyright: Eugene Wissner 2017-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -5,7 +5,7 @@
/** /**
* Dynamic memory management. * Dynamic memory management.
* *
* Copyright: Eugene Wissner 2016-2020. * Copyright: Eugene Wissner 2016-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -14,7 +14,7 @@
* $(LI Unique ownership) * $(LI Unique ownership)
* ) * )
* *
* Copyright: Eugene Wissner 2016-2020. * Copyright: Eugene Wissner 2016-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -5,7 +5,7 @@
/** /**
* This module provides a portable way of using operating system error codes. * This module provides a portable way of using operating system error codes.
* *
* Copyright: Eugene Wissner 2017-2020. * Copyright: Eugene Wissner 2017-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -6,7 +6,7 @@
* This package provides platform-independent interfaces to operating system * This package provides platform-independent interfaces to operating system
* functionality. * functionality.
* *
* Copyright: Eugene Wissner 2017-2020. * Copyright: Eugene Wissner 2017-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -11,7 +11,7 @@
* All algorithms in this module are lazy, they request the next element of the * All algorithms in this module are lazy, they request the next element of the
* original range on demand. * original range on demand.
* *
* Copyright: Eugene Wissner 2018-2021. * Copyright: Eugene Wissner 2018-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -5,7 +5,7 @@
/** /**
* Algorithms that modify its arguments. * Algorithms that modify its arguments.
* *
* Copyright: Eugene Wissner 2017-2020. * Copyright: Eugene Wissner 2017-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -5,7 +5,7 @@
/** /**
* Collection of generic algorithms. * Collection of generic algorithms.
* *
* Copyright: Eugene Wissner 2017-2021. * Copyright: Eugene Wissner 2017-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -5,7 +5,7 @@
/** /**
* Single-dimensioned array. * Single-dimensioned array.
* *
* Copyright: Eugene Wissner 2016-2021. * Copyright: Eugene Wissner 2016-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,7 @@
/* /*
* Internal package used by containers that rely on entries/nodes. * Internal package used by containers that rely on entries/nodes.
* *
* Copyright: Eugene Wissner 2016-2022. * Copyright: Eugene Wissner 2016-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -5,7 +5,7 @@
/** /**
* Hash table. * Hash table.
* *
* Copyright: Eugene Wissner 2018-2021. * Copyright: Eugene Wissner 2018-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)
@@ -210,7 +210,7 @@ struct ByKey(T)
assert(!empty); assert(!empty);
assert(this.dataRange.back.status == BucketStatus.used); assert(this.dataRange.back.status == BucketStatus.used);
} }
out out
{ {
assert(empty || this.dataRange.back.status == BucketStatus.used); assert(empty || this.dataRange.back.status == BucketStatus.used);
} }

View File

@@ -6,7 +6,7 @@
* This module contains singly-linked ($(D_PSYMBOL SList)) and doubly-linked * This module contains singly-linked ($(D_PSYMBOL SList)) and doubly-linked
* ($(D_PSYMBOL DList)) lists. * ($(D_PSYMBOL DList)) lists.
* *
* Copyright: Eugene Wissner 2016-2021. * Copyright: Eugene Wissner 2016-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -5,7 +5,7 @@
/** /**
* Abstract data types whose instances are collections of other objects. * Abstract data types whose instances are collections of other objects.
* *
* Copyright: Eugene Wissner 2016-2020. * Copyright: Eugene Wissner 2016-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -6,7 +6,7 @@
* This module implements a $(D_PSYMBOL Set) container that stores unique * This module implements a $(D_PSYMBOL Set) container that stores unique
* values without any particular order. * values without any particular order.
* *
* Copyright: Eugene Wissner 2017-2020. * Copyright: Eugene Wissner 2017-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -17,7 +17,7 @@
* Internally $(D_PSYMBOL String) is represented by a sequence of * Internally $(D_PSYMBOL String) is represented by a sequence of
* $(D_KEYWORD char)s. * $(D_KEYWORD char)s.
* *
* Copyright: Eugene Wissner 2017-2020. * Copyright: Eugene Wissner 2017-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -5,7 +5,7 @@
/** /**
* This module provides functions for converting between different types. * This module provides functions for converting between different types.
* *
* Copyright: Eugene Wissner 2017-2020. * Copyright: Eugene Wissner 2017-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -38,7 +38,7 @@
* *
* More advanced formatting is currently not implemented. * More advanced formatting is currently not implemented.
* *
* Copyright: Eugene Wissner 2017-2022. * Copyright: Eugene Wissner 2017-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -5,7 +5,7 @@
/** /**
* Non-cryptographic, lookup hash functions. * Non-cryptographic, lookup hash functions.
* *
* Copyright: Eugene Wissner 2018-2020. * Copyright: Eugene Wissner 2018-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/** /**
* Copyright: Eugene Wissner 2018-2020. * Copyright: Eugene Wissner 2018-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -12,7 +12,7 @@
* be found in its submodules. $(D_PSYMBOL tanya.math) doesn't import any * be found in its submodules. $(D_PSYMBOL tanya.math) doesn't import any
* submodules publically, they should be imported explicitly. * submodules publically, they should be imported explicitly.
* *
* Copyright: Eugene Wissner 2016-2022. * Copyright: Eugene Wissner 2016-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -5,7 +5,7 @@
/** /**
* Random number generator. * Random number generator.
* *
* Copyright: Eugene Wissner 2016-2022. * Copyright: Eugene Wissner 2016-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -1,178 +1,178 @@
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/** /**
* Network interfaces. * Network interfaces.
* *
* Copyright: Eugene Wissner 2018-2020. * Copyright: Eugene Wissner 2018-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)
* Source: $(LINK2 https://github.com/caraus-ecms/tanya/blob/master/source/tanya/net/iface.d, * Source: $(LINK2 https://github.com/caraus-ecms/tanya/blob/master/source/tanya/net/iface.d,
* tanya/net/iface.d) * tanya/net/iface.d)
*/ */
module tanya.net.iface; module tanya.net.iface;
import tanya.algorithm.mutation; import tanya.algorithm.mutation;
import tanya.container.string; import tanya.container.string;
import tanya.meta.trait; import tanya.meta.trait;
import tanya.meta.transform; import tanya.meta.transform;
import tanya.range; import tanya.range;
version (Windows) version (Windows)
{ {
private union NET_LUID_LH { ulong Value, Info; } private union NET_LUID_LH { ulong Value, Info; }
private alias NET_LUID = NET_LUID_LH; private alias NET_LUID = NET_LUID_LH;
private alias NET_IFINDEX = uint; private alias NET_IFINDEX = uint;
private enum IF_MAX_STRING_SIZE = 256; private enum IF_MAX_STRING_SIZE = 256;
extern(Windows) @nogc nothrow private @system extern(Windows) @nogc nothrow private @system
{ {
uint ConvertInterfaceNameToLuidA(const(char)* InterfaceName, uint ConvertInterfaceNameToLuidA(const(char)* InterfaceName,
NET_LUID* InterfaceLuid); NET_LUID* InterfaceLuid);
uint ConvertInterfaceLuidToIndex(const(NET_LUID)* InterfaceLuid, uint ConvertInterfaceLuidToIndex(const(NET_LUID)* InterfaceLuid,
NET_IFINDEX* InterfaceIndex); NET_IFINDEX* InterfaceIndex);
uint ConvertInterfaceIndexToLuid(NET_IFINDEX InterfaceIndex, uint ConvertInterfaceIndexToLuid(NET_IFINDEX InterfaceIndex,
NET_LUID* InterfaceLuid); NET_LUID* InterfaceLuid);
uint ConvertInterfaceLuidToNameA(const(NET_LUID)* InterfaceLuid, uint ConvertInterfaceLuidToNameA(const(NET_LUID)* InterfaceLuid,
char* InterfaceName, char* InterfaceName,
size_t Length); size_t Length);
} }
} }
else version (Posix) else version (Posix)
{ {
import core.sys.posix.net.if_; import core.sys.posix.net.if_;
} }
/** /**
* Converts the name of a network interface to its index. * Converts the name of a network interface to its index.
* *
* If an interface with the name $(D_PARAM name) cannot be found or another * If an interface with the name $(D_PARAM name) cannot be found or another
* error occurres, returns 0. * error occurres, returns 0.
* *
* Params: * Params:
* name = Interface name. * name = Interface name.
* *
* Returns: Returns interface index or 0. * Returns: Returns interface index or 0.
*/ */
uint nameToIndex(R)(R name) @trusted uint nameToIndex(R)(R name) @trusted
if (isInputRange!R && is(Unqual!(ElementType!R) == char) && hasLength!R) if (isInputRange!R && is(Unqual!(ElementType!R) == char) && hasLength!R)
{ {
version (Windows) version (Windows)
{ {
if (name.length > IF_MAX_STRING_SIZE) if (name.length > IF_MAX_STRING_SIZE)
{ {
return 0; return 0;
} }
char[IF_MAX_STRING_SIZE + 1] buffer; char[IF_MAX_STRING_SIZE + 1] buffer;
NET_LUID luid; NET_LUID luid;
copy(name, buffer[]); copy(name, buffer[]);
buffer[name.length] = '\0'; buffer[name.length] = '\0';
if (ConvertInterfaceNameToLuidA(buffer.ptr, &luid) != 0) if (ConvertInterfaceNameToLuidA(buffer.ptr, &luid) != 0)
{ {
return 0; return 0;
} }
NET_IFINDEX index; NET_IFINDEX index;
if (ConvertInterfaceLuidToIndex(&luid, &index) == 0) if (ConvertInterfaceLuidToIndex(&luid, &index) == 0)
{ {
return index; return index;
} }
return 0; return 0;
} }
else version (Posix) else version (Posix)
{ {
if (name.length >= IF_NAMESIZE) if (name.length >= IF_NAMESIZE)
{ {
return 0; return 0;
} }
char[IF_NAMESIZE] buffer; char[IF_NAMESIZE] buffer;
copy(name, buffer[]); copy(name, buffer[]);
buffer[name.length] = '\0'; buffer[name.length] = '\0';
return if_nametoindex(buffer.ptr); return if_nametoindex(buffer.ptr);
} }
} }
/// ///
@nogc nothrow @safe unittest @nogc nothrow @safe unittest
{ {
version (linux) version (linux)
{ {
assert(nameToIndex("lo") == 1); assert(nameToIndex("lo") == 1);
} }
else version (Windows) else version (Windows)
{ {
assert(nameToIndex("loopback_0") == 1); assert(nameToIndex("loopback_0") == 1);
} }
else else
{ {
assert(nameToIndex("lo0") == 1); assert(nameToIndex("lo0") == 1);
} }
assert(nameToIndex("ecafretni") == 0); assert(nameToIndex("ecafretni") == 0);
} }
/** /**
* Converts the index of a network interface to its name. * Converts the index of a network interface to its name.
* *
* If an interface with the $(D_PARAM index) cannot be found or another * If an interface with the $(D_PARAM index) cannot be found or another
* error occurres, returns an empty $(D_PSYMBOL String). * error occurres, returns an empty $(D_PSYMBOL String).
* *
* Params: * Params:
* index = Interface index. * index = Interface index.
* *
* Returns: Returns interface name or an empty $(D_PSYMBOL String). * Returns: Returns interface name or an empty $(D_PSYMBOL String).
*/ */
String indexToName(uint index) @nogc nothrow @trusted String indexToName(uint index) @nogc nothrow @trusted
{ {
import tanya.memory.op : findNullTerminated; import tanya.memory.op : findNullTerminated;
version (Windows) version (Windows)
{ {
NET_LUID luid; NET_LUID luid;
if (ConvertInterfaceIndexToLuid(index, &luid) != 0) if (ConvertInterfaceIndexToLuid(index, &luid) != 0)
{ {
return String(); return String();
} }
char[IF_MAX_STRING_SIZE + 1] buffer; char[IF_MAX_STRING_SIZE + 1] buffer;
if (ConvertInterfaceLuidToNameA(&luid, if (ConvertInterfaceLuidToNameA(&luid,
buffer.ptr, buffer.ptr,
IF_MAX_STRING_SIZE + 1) != 0) IF_MAX_STRING_SIZE + 1) != 0)
{ {
return String(); return String();
} }
return String(findNullTerminated(buffer)); return String(findNullTerminated(buffer));
} }
else version (Posix) else version (Posix)
{ {
char[IF_NAMESIZE] buffer; char[IF_NAMESIZE] buffer;
if (if_indextoname(index, buffer.ptr) is null) if (if_indextoname(index, buffer.ptr) is null)
{ {
return String(); return String();
} }
return String(findNullTerminated(buffer)); return String(findNullTerminated(buffer));
} }
} }
/** /**
* $(D_PSYMBOL AddressFamily) specifies a communication domain; this selects * $(D_PSYMBOL AddressFamily) specifies a communication domain; this selects
* the protocol family which will be used for communication. * the protocol family which will be used for communication.
*/ */
enum AddressFamily : int enum AddressFamily : int
{ {
unspec = 0, /// Unspecified. unspec = 0, /// Unspecified.
local = 1, /// Local to host (pipes and file-domain). local = 1, /// Local to host (pipes and file-domain).
unix = local, /// POSIX name for PF_LOCAL. unix = local, /// POSIX name for PF_LOCAL.
inet = 2, /// IP protocol family. inet = 2, /// IP protocol family.
ax25 = 3, /// Amateur Radio AX.25. ax25 = 3, /// Amateur Radio AX.25.
ipx = 4, /// Novell Internet Protocol. ipx = 4, /// Novell Internet Protocol.
appletalk = 5, /// Appletalk DDP. appletalk = 5, /// Appletalk DDP.
netrom = 6, /// Amateur radio NetROM. netrom = 6, /// Amateur radio NetROM.
bridge = 7, /// Multiprotocol bridge. bridge = 7, /// Multiprotocol bridge.
atmpvc = 8, /// ATM PVCs. atmpvc = 8, /// ATM PVCs.
x25 = 9, /// Reserved for X.25 project. x25 = 9, /// Reserved for X.25 project.
inet6 = 10, /// IP version 6. inet6 = 10, /// IP version 6.
} }

View File

@@ -5,7 +5,7 @@
/** /**
* Internet utilities. * Internet utilities.
* *
* Copyright: Eugene Wissner 2016-2020. * Copyright: Eugene Wissner 2016-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -5,7 +5,7 @@
/** /**
* Internet Protocol implementation. * Internet Protocol implementation.
* *
* Copyright: Eugene Wissner 2018-2020. * Copyright: Eugene Wissner 2018-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -5,7 +5,7 @@
/** /**
* Network programming. * Network programming.
* *
* Copyright: Eugene Wissner 2017-2022. * Copyright: Eugene Wissner 2017-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -5,7 +5,7 @@
/** /**
* URL parser. * URL parser.
* *
* Copyright: Eugene Wissner 2017-2020. * Copyright: Eugene Wissner 2017-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)
@@ -193,7 +193,7 @@ struct URL
if (this.user is null) if (this.user is null)
{ {
this.user = source[start .. start + i]; this.user = source[start .. start + i];
this.pass = source[start + i + 1 .. pos]; this.pass = source[start + i + 1 .. pos];
} }
} }
else if (!c.isAlpha() && else if (!c.isAlpha() &&
@@ -315,10 +315,10 @@ struct URL
@nogc pure @system unittest @nogc pure @system unittest
{ {
auto u = URL("example.org"); auto u = URL("example.org");
assert(u.path == "example.org"); assert(u.path == "example.org");
u = URL("relative/path"); u = URL("relative/path");
assert(u.path == "relative/path"); assert(u.path == "relative/path");
// Host and scheme // Host and scheme
u = URL("https://example.org"); u = URL("https://example.org");

View File

@@ -5,7 +5,7 @@
/** /**
* Range adapters transform some data structures into ranges. * Range adapters transform some data structures into ranges.
* *
* Copyright: Eugene Wissner 2018-2020. * Copyright: Eugene Wissner 2018-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -31,7 +31,7 @@
* (D_INLINECODE dchar[])) are treated as any other normal array, they aren't * (D_INLINECODE dchar[])) are treated as any other normal array, they aren't
* auto-decoded. * auto-decoded.
* *
* Copyright: Eugene Wissner 2017-2020. * Copyright: Eugene Wissner 2017-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -6,7 +6,7 @@
* This package contains generic functions and templates to be used with D * This package contains generic functions and templates to be used with D
* ranges. * ranges.
* *
* Copyright: Eugene Wissner 2017-2020. * Copyright: Eugene Wissner 2017-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -5,7 +5,7 @@
/** /**
* This module defines primitives for working with ranges. * This module defines primitives for working with ranges.
* *
* Copyright: Eugene Wissner 2017-2020. * Copyright: Eugene Wissner 2017-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -13,7 +13,7 @@
* The functions can cause segmentation fault if the module is compiled * The functions can cause segmentation fault if the module is compiled
* in production mode and the condition fails. * in production mode and the condition fails.
* *
* Copyright: Eugene Wissner 2017-2020. * Copyright: Eugene Wissner 2017-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -5,7 +5,7 @@
/** /**
* Test suite for $(D_KEYWORD unittest)-blocks. * Test suite for $(D_KEYWORD unittest)-blocks.
* *
* Copyright: Eugene Wissner 2017-2020. * Copyright: Eugene Wissner 2017-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@@ -5,7 +5,7 @@
/** /**
* Range and generic type generators. * Range and generic type generators.
* *
* Copyright: Eugene Wissner 2018-2020. * Copyright: Eugene Wissner 2018-2025.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0). * Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)