coreutils

General Software Utilities
git clone http://git.omkov.net/coreutils
Log | Tree | Refs | README | LICENCE | Download

AuthorJamozed <[email protected]>
Date2020-07-06 09:16:45
Commitd980a30d3f4c0597653b720264f2999eeea9a9a8
Parentd8fa0c9bc6ec57ff061780b4354b54eb66237776

meta: Add libokv submodule

Diffstat

A .gitmodules | 3 +++
M CMakeLists.txt | 5 +++++
D ext/error.h | 48 ------------------------------------------------

3 files changed, 8 insertions, 48 deletions

diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..dc1733b
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "ext/libokv"]
+	path = ext/libokv
+	url = https://git.omkov.net/Jamozed/libokv
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 917be3b..fd09b6d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,7 +8,12 @@ SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
 SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
 SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
 
+ADD_SUBDIRECTORY(ext/libokv)
+
 INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/ext)
+INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/ext/libokv/include)
+
+LINK_LIBRARIES(libokv.a)
 
 ADD_EXECUTABLE(basename ${PROJECT_SOURCE_DIR}/src/basename.c)
 ADD_EXECUTABLE(cat      ${PROJECT_SOURCE_DIR}/src/cat.c)
diff --git a/ext/error.h b/ext/error.h
deleted file mode 100644
index 91c0796..0000000
--- a/ext/error.h
+++ /dev/null
@@ -1,48 +0,0 @@
-// error.h, version 1.0.0
-// OMKOV error library
-// Copyright (C) 2020, Jakob Wakeling
-// All rights reserved.
-
-/*
-OMKOV Public Domain Licence, version 1.0
-
-Permission is hereby granted to deal with this software and its associated
-documentation files without restriction.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT
-HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
-*/
-
-#ifndef OMKOV_ERROR_H_38W06M3W
-#define OMKOV_ERROR_H_38W06M3W
-
-#ifdef __cplusplus
-extern "C" {
-#endif // __cplusplus
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#define serrno strerror(errno)
-
-static void error(int status, const char *format, ...) {
-	va_list ap; va_start(ap, format); fflush(stdout);
-	vfprintf(stderr, format, ap); fputc('\n', stderr);
-	va_end(ap); exit(status);
-}
-
-static void warn(const char *format, ...) {
-	va_list ap; va_start(ap, format); fflush(stdout);
-	vfprintf(stderr, format, ap); fputc('\n', stderr);
-	va_end(ap); return;
-}
-
-#ifdef __cplusplus
-}
-#endif // __cplusplus
-#endif // OMKOV_ERROR_H_38W06M3W
diff --git a/ext/libokv b/ext/libokv
new file mode 160000
index 0000000..239f4af
--- /dev/null
+++ b/ext/libokv
@@ -0,0 +1 @@
+Subproject commit 239f4af50464f31a739bc81ea3de2f9fd0de3688