Skip to content

Commit 89a0647

Browse files
Merge branch 'main' into release
Release 0.1.2
2 parents 5adbe55 + 8bd2b5f commit 89a0647

10 files changed

+103
-25
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# general
22
build*
3-
docs/
3+
docs/*
4+
5+
!docs/index.md
6+
!docs/_config.yml
47

58
# editor files
69

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.13.4 FATAL_ERROR)
44
# ======================================================================================================================
55

66
# project
7-
project(write_shm LANGUAGES CXX VERSION 0.1.1)
7+
project(write_shm LANGUAGES CXX VERSION 0.1.2)
88

99
# settings
1010
set(Target "write_shm") # Executable name (without file extension!)

docs/_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
theme: jekyll-theme-cayman

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Shared Memory Writer

src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33

44
target_sources(${Target} PRIVATE main.cpp)
55
target_sources(${Target} PRIVATE SHM.cpp)
6+
target_sources(${Target} PRIVATE license.cpp)
67

78
# ---------------------------------------- header files (*.jpp, *.h, ...) ----------------------------------------------
89
# ======================================================================================================================
910

1011
target_sources(${Target} PRIVATE SHM.hpp)
12+
target_sources(${Target} PRIVATE license.hpp)
1113

1214
# ---------------------------------------- subdirectories --------------------------------------------------------------
1315
# ======================================================================================================================

src/SHM.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* Copyright (C) 2021-2022 Nikolas Koesling <nikolas@koesling.info>.
3+
* This program is free software. You can redistribute it and/or modify it under the terms of the MIT License.
4+
*/
5+
16
#include "SHM.hpp"
27

38
#include <fcntl.h>

src/SHM.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* Copyright (C) 2021-2022 Nikolas Koesling <nikolas@koesling.info>.
3+
* This program is free software. You can redistribute it and/or modify it under the terms of the MIT License.
4+
*/
5+
16
#pragma once
27

38
#include <string>

src/license.cpp

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* Copyright (C) 2022 Nikolas Koesling <nikolas@koesling.info>.
3+
* This program is free software. You can redistribute it and/or modify it under the terms of the MIT License.
4+
*/
5+
6+
#include "license.hpp"
7+
8+
void print_licenses(std::ostream &o) {
9+
o << "This Application (" << PROJECT_NAME << ' ' << PROJECT_VERSION "): " << std::endl;
10+
o << std::endl;
11+
o << " MIT License" << std::endl;
12+
o << std::endl;
13+
o << " Copyright (c) 2021-2022 Nikolas Koesling" << std::endl;
14+
o << std::endl;
15+
o << " Permission is hereby granted, free of charge, to any person obtaining a copy" << std::endl;
16+
o << " of this software and associated documentation files (the \"Software\"), to deal" << std::endl;
17+
o << " in the Software without restriction, including without limitation the rights" << std::endl;
18+
o << " to use, copy, modify, merge, publish, distribute, sublicense, and/or sell" << std::endl;
19+
o << " copies of the Software, and to permit persons to whom the Software is" << std::endl;
20+
o << " furnished to do so, subject to the following conditions:" << std::endl;
21+
o << std::endl;
22+
o << " The above copyright notice and this permission notice shall be included in all" << std::endl;
23+
o << " copies or substantial portions of the Software." << std::endl;
24+
o << std::endl;
25+
o << " THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR" << std::endl;
26+
o << " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY," << std::endl;
27+
o << " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE" << std::endl;
28+
o << " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER" << std::endl;
29+
o << " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM," << std::endl;
30+
o << " OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE" << std::endl;
31+
o << " SOFTWARE." << std::endl;
32+
o << std::endl;
33+
o << std::endl;
34+
o << "cxxopts Library (https://github.com/jarro2783/cxxopts)" << std::endl;
35+
o << std::endl;
36+
o << " MIT License" << std::endl;
37+
o << std::endl;
38+
o << " Copyright (c) 2014 Jarryd Beck" << std::endl;
39+
o << std::endl;
40+
o << " Permission is hereby granted, free of charge, to any person obtaining a copy" << std::endl;
41+
o << " of this software and associated documentation files (the \"Software\"), to deal" << std::endl;
42+
o << " in the Software without restriction, including without limitation the rights" << std::endl;
43+
o << " to use, copy, modify, merge, publish, distribute, sublicense, and/or sell" << std::endl;
44+
o << " copies of the Software, and to permit persons to whom the Software is" << std::endl;
45+
o << " furnished to do so, subject to the following conditions:" << std::endl;
46+
o << std::endl;
47+
o << " The above copyright notice and this permission notice shall be included in" << std::endl;
48+
o << " all copies or substantial portions of the Software." << std::endl;
49+
o << std::endl;
50+
o << " THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR" << std::endl;
51+
o << " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY," << std::endl;
52+
o << " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE" << std::endl;
53+
o << " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER" << std::endl;
54+
o << " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM," << std::endl;
55+
o << " OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN" << std::endl;
56+
o << " THE SOFTWARE." << std::endl;
57+
}

src/license.hpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright (C) 2022 Nikolas Koesling <nikolas@koesling.info>.
3+
* This program is free software. You can redistribute it and/or modify it under the terms of the MIT License.
4+
*/
5+
6+
#pragma once
7+
8+
#include <ostream>
9+
10+
/**
11+
* \brief print licences
12+
* @param o output stream used to print licenses
13+
*/
14+
void print_licenses(std::ostream &o);

src/main.cpp

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1+
/*
2+
* Copyright (C) 2021-2022 Nikolas Koesling <nikolas@koesling.info>.
3+
* This program is free software. You can redistribute it and/or modify it under the terms of the MIT License.
4+
*/
5+
16
#include "SHM.hpp"
7+
#include "license.hpp"
28

39
#include <cxxopts.hpp>
410
#include <filesystem>
@@ -25,6 +31,7 @@ int main(int argc, char **argv) {
2531
cxxopts::value<bool>()->default_value("false"));
2632
options.add_options()("h,help", "print usage");
2733
options.add_options()("version", "print version information");
34+
options.add_options()("license", "show licenses");
2835

2936
// parse arguments
3037
cxxopts::ParseResult args;
@@ -43,29 +50,6 @@ int main(int argc, char **argv) {
4350
std::cout << options.help() << std::endl;
4451
std::cout << "This application uses the following libraries:" << std::endl;
4552
std::cout << " - cxxopts by jarro2783 (https://github.com/jarro2783/cxxopts)" << std::endl;
46-
std::cout << std::endl;
47-
std::cout << std::endl;
48-
std::cout << "MIT License:" << std::endl;
49-
std::cout << std::endl;
50-
std::cout << "Copyright (c) 2022 Nikolas Koesling" << std::endl;
51-
std::cout << std::endl;
52-
std::cout << "Permission is hereby granted, free of charge, to any person obtaining a copy" << std::endl;
53-
std::cout << "of this software and associated documentation files (the \"Software\"), to deal" << std::endl;
54-
std::cout << "in the Software without restriction, including without limitation the rights" << std::endl;
55-
std::cout << "to use, copy, modify, merge, publish, distribute, sublicense, and/or sell" << std::endl;
56-
std::cout << "copies of the Software, and to permit persons to whom the Software is" << std::endl;
57-
std::cout << "furnished to do so, subject to the following conditions:" << std::endl;
58-
std::cout << std::endl;
59-
std::cout << "The above copyright notice and this permission notice shall be included in all" << std::endl;
60-
std::cout << "copies or substantial portions of the Software." << std::endl;
61-
std::cout << std::endl;
62-
std::cout << "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR" << std::endl;
63-
std::cout << "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY," << std::endl;
64-
std::cout << "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE" << std::endl;
65-
std::cout << "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER" << std::endl;
66-
std::cout << "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM," << std::endl;
67-
std::cout << "OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE" << std::endl;
68-
std::cout << "SOFTWARE." << std::endl;
6953
exit(EX_OK);
7054
}
7155

@@ -75,6 +59,12 @@ int main(int argc, char **argv) {
7559
exit(EX_OK);
7660
}
7761

62+
// print licenses
63+
if (args.count("license")) {
64+
print_licenses(std::cout);
65+
exit(EX_OK);
66+
}
67+
7868
// open shm
7969
std::unique_ptr<SHM> shm;
8070
try {

0 commit comments

Comments
 (0)