diff --git a/.LICENSE b/.LICENSE new file mode 100644 index 0000000..15867e3 --- /dev/null +++ b/.LICENSE @@ -0,0 +1,6 @@ +Khaos +C/C++ library for writing cross-platform codes. + +SPDX-FileCopyrightText: 2019-2024 flagarde + +SPDX-License-Identifier: MIT diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 740cfff..727804d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -50,6 +50,9 @@ repos: - id: remove-tabs name: tabs remover args: [--whitespaces-count, '2'] + - id: insert-license + files: \.(h(pp)|h(pp.in)|c(pp)|h.in|c?)$ + args: [--license-filepath, .LICENSE, --comment-style, /*|*|*/, --use-current-year, --fuzzy-match-generates-todo, --fuzzy-ratio-cut-off, '85', --fuzzy-match-todo-instructions, ' TODO: Delete the inconsistent license and above line and rerun pre-commit to insert a good license. If this is the desired behavior add "// insert-license=off" at the beginning to the file.', --skip-license-insertion-comment, '// insert-license=off' ] - repo: https://github.com/codespell-project/codespell rev: v2.2.2 diff --git a/include/khaos/C.h b/include/khaos/C.h index d88e15a..6d561e6 100644 --- a/include/khaos/C.h +++ b/include/khaos/C.h @@ -1,8 +1,16 @@ +/* +* Khaos +* C/C++ library for writing cross-platform codes. +* +* SPDX-FileCopyrightText: 2020-2024 flagarde +* +* SPDX-License-Identifier: MIT +*/ + #ifndef KHAOS_C_H_ #define KHAOS_C_H_ /** \file C.h - * \copyright 2022 flagarde * \brief Detect the C standard and define some useful macros. */ diff --git a/include/khaos/CStandards.h b/include/khaos/CStandards.h index afff84b..d71e21d 100644 --- a/include/khaos/CStandards.h +++ b/include/khaos/CStandards.h @@ -1,8 +1,16 @@ +/* +* Khaos +* C/C++ library for writing cross-platform codes. +* +* SPDX-FileCopyrightText: 2020-2024 flagarde +* +* SPDX-License-Identifier: MIT +*/ + #ifndef KHAOS_CSTANDARDS_H_ #define KHAOS_CSTANDARDS_H_ /*! \file CStandards.h - * \copyright 2022 flagarde * \brief Define the values of the official C standard. * Define macros that expand to the integer constant of type \b long whose value are the version of the C standard. * Official values for the \b __STDC_VERSION__ macro. @@ -13,5 +21,6 @@ #define KHAOS_STANDARD_C99_PRIVATE() (199901L) /*!< Value for the C99 standard */ #define KHAOS_STANDARD_C11_PRIVATE() (201112L) /*!< Value for the C11 standard */ #define KHAOS_STANDARD_C17_PRIVATE() (201710L) /*!< Value for the C17 standard */ +#define KHAOS_STANDARD_C23_PRIVATE() (202311L) /*!< Value for the C23 standard */ #endif /* KHAOS_CSTANDARDS_H_ */ diff --git a/include/khaos/CXX.h b/include/khaos/CXX.h index 892e447..93482ec 100644 --- a/include/khaos/CXX.h +++ b/include/khaos/CXX.h @@ -1,8 +1,16 @@ +/* +* Khaos +* C/C++ library for writing cross-platform codes. +* +* SPDX-FileCopyrightText: 2020-2024 flagarde +* +* SPDX-License-Identifier: MIT +*/ + #ifndef KHAOS_CXX_H_ #define KHAOS_CXX_H_ /*! \file CXX.h - * \copyright 2022 flagarde * \brief Detect the C++ standard and define some useful macros. * \warning \b CXX11 is always false for \b MSVC only c++14 and upper are considered. */ diff --git a/include/khaos/CXXStandards.h b/include/khaos/CXXStandards.h index e80b048..5c79d55 100644 --- a/include/khaos/CXXStandards.h +++ b/include/khaos/CXXStandards.h @@ -1,8 +1,16 @@ +/* +* Khaos +* C/C++ library for writing cross-platform codes. +* +* SPDX-FileCopyrightText: 2020-2024 flagarde +* +* SPDX-License-Identifier: MIT +*/ + #ifndef KHAOS_CXXSTANDARDS_H_ #define KHAOS_CXXSTANDARDS_H_ /*! \file CXXStandards.h - * \copyright 2022 flagarde * \brief Define the version of the C++ standard. * Define macros that expand to the integer constant of type \b long whose value are the version of the C++ standard. * Official values for the \b __cplusplus macro. @@ -13,5 +21,6 @@ #define KHAOS_STANDARD_CXX14_PRIVATE() (201402L) /*!< Value for the C++14 standard */ #define KHAOS_STANDARD_CXX17_PRIVATE() (201703L) /*!< Value for the C++17 standard */ #define KHAOS_STANDARD_CXX20_PRIVATE() (202002L) /*!< Value for the C++20 standard */ +#define KHAOS_STANDARD_CXX23_PRIVATE() (202302L) /*!< Value for the C++23 standard */ #endif /* KHAOS_CXXSTANDARDS_H_ */ diff --git a/include/khaos/CompareVersionMacros.h b/include/khaos/CompareVersionMacros.h index b5c6540..d05e57c 100644 --- a/include/khaos/CompareVersionMacros.h +++ b/include/khaos/CompareVersionMacros.h @@ -1,3 +1,12 @@ +/* +* Khaos +* C/C++ library for writing cross-platform codes. +* +* SPDX-FileCopyrightText: 2020-2024 flagarde +* +* SPDX-License-Identifier: MIT +*/ + #ifndef KHAOS_COMPAREVERSIONMACROS_H_ #define KHAOS_COMPAREVERSIONMACROS_H_ @@ -5,7 +14,6 @@ #include "khaos/VersionMacros.h" /** \file CompareVersionMacros.h - * \copyright 2022 flagarde * \brief Define macros to compare versions. * \note Use these macros only if you need preprocessor version checking. * \note For example : diff --git a/include/khaos/KhaosVersion.h.in b/include/khaos/KhaosVersion.h.in index d06b583..1c17c9e 100644 --- a/include/khaos/KhaosVersion.h.in +++ b/include/khaos/KhaosVersion.h.in @@ -1,5 +1,13 @@ +/* +* Khaos +* C/C++ library for writing cross-platform codes. +* +* SPDX-FileCopyrightText: 2020-2024 flagarde +* +* SPDX-License-Identifier: MIT +*/ + /** \file KhaosVersion.h - * \copyright 2022 flagarde * * \brief Macros providing the Khaos version. * diff --git a/include/khaos/Language.h b/include/khaos/Language.h index a30412b..33f045c 100644 --- a/include/khaos/Language.h +++ b/include/khaos/Language.h @@ -1,8 +1,16 @@ +/* +* Khaos +* C/C++ library for writing cross-platform codes. +* +* SPDX-FileCopyrightText: 2020-2024 flagarde +* +* SPDX-License-Identifier: MIT +*/ + #ifndef KHAOS_LANGUAGE_H_ #define KHAOS_LANGUAGE_H_ /*! \file Languages.h - * \copyright 2022 flagarde * \brief Detect the languages and define some useful macros. */ diff --git a/include/khaos/VersionMacros.h b/include/khaos/VersionMacros.h index e29b50d..9142029 100644 --- a/include/khaos/VersionMacros.h +++ b/include/khaos/VersionMacros.h @@ -1,8 +1,16 @@ +/* +* Khaos +* C/C++ library for writing cross-platform codes. +* +* SPDX-FileCopyrightText: 2020-2024 flagarde +* +* SPDX-License-Identifier: MIT +*/ + #ifndef KHAOS_VERSIONMACROS_H_ #define KHAOS_VERSIONMACROS_H_ /** \file VersionMacros.h - * \copyright 2022 flagarde * \brief Define macros to set, get versions. * \note Use these macros only if you need preprocessor version checking. * \note For example : diff --git a/tests/CStandards.test.cpp b/tests/CStandards.test.cpp index 6931119..2b7bf80 100644 --- a/tests/CStandards.test.cpp +++ b/tests/CStandards.test.cpp @@ -1,3 +1,12 @@ +/* +* Khaos +* C/C++ library for writing cross-platform codes. +* +* SPDX-FileCopyrightText: 2020-2024 flagarde +* +* SPDX-License-Identifier: MIT +*/ + /* Copyright 2022 flagarde */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/tests/CXXStandards.test.cpp b/tests/CXXStandards.test.cpp index 09fc8aa..a976824 100644 --- a/tests/CXXStandards.test.cpp +++ b/tests/CXXStandards.test.cpp @@ -1,3 +1,12 @@ +/* +* Khaos +* C/C++ library for writing cross-platform codes. +* +* SPDX-FileCopyrightText: 2020-2024 flagarde +* +* SPDX-License-Identifier: MIT +*/ + /* Copyright 2022 flagarde */ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN diff --git a/tests/CompareVersionMacros.test.cpp b/tests/CompareVersionMacros.test.cpp index 905828e..2586015 100644 --- a/tests/CompareVersionMacros.test.cpp +++ b/tests/CompareVersionMacros.test.cpp @@ -1,3 +1,12 @@ +/* +* Khaos +* C/C++ library for writing cross-platform codes. +* +* SPDX-FileCopyrightText: 2020-2024 flagarde +* +* SPDX-License-Identifier: MIT +*/ + /* Copyright 2022 flagarde */ #include "khaos/CompareVersionMacros.h" diff --git a/tests/KhaosVersion.test.cpp b/tests/KhaosVersion.test.cpp index 0f88b73..f433811 100644 --- a/tests/KhaosVersion.test.cpp +++ b/tests/KhaosVersion.test.cpp @@ -1,3 +1,12 @@ +/* +* Khaos +* C/C++ library for writing cross-platform codes. +* +* SPDX-FileCopyrightText: 2020-2024 flagarde +* +* SPDX-License-Identifier: MIT +*/ + /* Copyright 2022 flagarde */ #include "khaos/KhaosVersion.h" diff --git a/tests/LanguageC.test.c b/tests/LanguageC.test.c index 0441d6b..77fbd92 100644 --- a/tests/LanguageC.test.c +++ b/tests/LanguageC.test.c @@ -1,3 +1,12 @@ +/* +* Khaos +* C/C++ library for writing cross-platform codes. +* +* SPDX-FileCopyrightText: 2024-2024 flagarde +* +* SPDX-License-Identifier: MIT +*/ + /* Copyright 2022 flagarde */ #include "khaos/Language.h" diff --git a/tests/LanguageCXX.test.cpp b/tests/LanguageCXX.test.cpp index 9c370b3..d41fb63 100644 --- a/tests/LanguageCXX.test.cpp +++ b/tests/LanguageCXX.test.cpp @@ -1,3 +1,12 @@ +/* +* Khaos +* C/C++ library for writing cross-platform codes. +* +* SPDX-FileCopyrightText: 2020-2024 flagarde +* +* SPDX-License-Identifier: MIT +*/ + /* Copyright 2022 flagarde */ /* doctest need c++11 so disable it to test C++98 */ diff --git a/tests/VersionMacros.test.cpp b/tests/VersionMacros.test.cpp index 0293463..3691860 100644 --- a/tests/VersionMacros.test.cpp +++ b/tests/VersionMacros.test.cpp @@ -1,3 +1,12 @@ +/* +* Khaos +* C/C++ library for writing cross-platform codes. +* +* SPDX-FileCopyrightText: 2020-2024 flagarde +* +* SPDX-License-Identifier: MIT +*/ + /* Copyright 2022 flagarde */ #include "khaos/VersionMacros.h"