From 7a81449148003500ca914916ead298f49796159d Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Fri, 24 Jun 2016 18:27:46 -0500 Subject: [PATCH] Renamed project Ox and restructured it to allow it to become a baremetal unikernel/stdlib. --- CMakeLists.txt | 6 +----- src/CMakeLists.txt | 16 +--------------- src/ox/CMakeLists.txt | 4 ++++ src/ox/fs/CMakeLists.txt | 17 +++++++++++++++++ src/{ => ox/fs}/filestore.cpp | 6 ------ src/{ => ox/fs}/filestore.hpp | 8 +++++--- src/{ => ox/fs}/filesystem.cpp | 6 ------ src/{ => ox/fs}/filesystem.hpp | 8 ++++---- src/ox/fs/test/CMakeLists.txt | 17 +++++++++++++++++ {test => src/ox/fs/test}/filestoreio.cpp | 6 +++--- {test => src/ox/fs/test}/format.cpp | 6 +++--- src/ox/std/CMakeLists.txt | 15 +++++++++++++++ src/{ => ox/std}/_memops.cpp | 4 ++-- src/{ => ox/std}/_memops.hpp | 4 ++-- src/{ => ox/std}/_strops.cpp | 4 ++-- src/{ => ox/std}/_strops.hpp | 4 ++-- src/{ => ox/std}/_types.hpp | 4 ++-- test/CMakeLists.txt | 14 -------------- 18 files changed, 80 insertions(+), 69 deletions(-) create mode 100644 src/ox/CMakeLists.txt create mode 100644 src/ox/fs/CMakeLists.txt rename src/{ => ox/fs}/filestore.cpp (81%) rename src/{ => ox/fs}/filestore.hpp (98%) rename src/{ => ox/fs}/filesystem.cpp (87%) rename src/{ => ox/fs}/filesystem.hpp (91%) create mode 100644 src/ox/fs/test/CMakeLists.txt rename {test => src/ox/fs/test}/filestoreio.cpp (91%) rename {test => src/ox/fs/test}/format.cpp (83%) create mode 100644 src/ox/std/CMakeLists.txt rename src/{ => ox/std}/_memops.cpp (94%) rename src/{ => ox/std}/_memops.hpp (91%) rename src/{ => ox/std}/_strops.cpp (93%) rename src/{ => ox/std}/_strops.hpp (90%) rename src/{ => ox/std}/_types.hpp (96%) delete mode 100644 test/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index f689445dd..0d935c7dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 2.8) -project(WombatFS) +project(Ox) list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) include(address_sanitizer) @@ -24,7 +24,3 @@ enable_testing() include_directories("src") add_subdirectory(src) -add_subdirectory(test) - -add_test("Format" test/Format) -add_test("FileStoreIO" test/FileStoreIO) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 10064a693..81ecf2438 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,17 +1,3 @@ cmake_minimum_required(VERSION 2.8) -add_library( - WFS - filestore.cpp - filesystem.cpp - _memops.cpp - _strops.cpp -) - -install( - FILES - filestore.hpp - _memops.hpp - DESTINATION - include/WFS -) +add_subdirectory(ox) diff --git a/src/ox/CMakeLists.txt b/src/ox/CMakeLists.txt new file mode 100644 index 000000000..dea24e700 --- /dev/null +++ b/src/ox/CMakeLists.txt @@ -0,0 +1,4 @@ +cmake_minimum_required(VERSION 2.8) + +add_subdirectory(fs) +add_subdirectory(std) diff --git a/src/ox/fs/CMakeLists.txt b/src/ox/fs/CMakeLists.txt new file mode 100644 index 000000000..5c057a356 --- /dev/null +++ b/src/ox/fs/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 2.8) + +add_library( + OxFS + filestore.cpp + filesystem.cpp +) + +install( + FILES + filestore.hpp + filesystem.hpp + DESTINATION + include/ox/fs +) + +add_subdirectory(test) diff --git a/src/filestore.cpp b/src/ox/fs/filestore.cpp similarity index 81% rename from src/filestore.cpp rename to src/ox/fs/filestore.cpp index ad429e611..c924f2d1a 100644 --- a/src/filestore.cpp +++ b/src/ox/fs/filestore.cpp @@ -5,10 +5,4 @@ * 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/. */ -#include "_memops.hpp" #include "filestore.hpp" - -namespace wombat { -namespace fs { -} -} diff --git a/src/filestore.hpp b/src/ox/fs/filestore.hpp similarity index 98% rename from src/filestore.hpp rename to src/ox/fs/filestore.hpp index 95c344a16..8f87622a2 100644 --- a/src/filestore.hpp +++ b/src/ox/fs/filestore.hpp @@ -7,12 +7,14 @@ */ #pragma once -#include "_memops.hpp" -#include "_types.hpp" +#include +#include -namespace wombat { +namespace ox { namespace fs { +using namespace ox::std; + template class FileStore { diff --git a/src/filesystem.cpp b/src/ox/fs/filesystem.cpp similarity index 87% rename from src/filesystem.cpp rename to src/ox/fs/filesystem.cpp index c336991a8..2b1aef861 100644 --- a/src/filesystem.cpp +++ b/src/ox/fs/filesystem.cpp @@ -6,9 +6,3 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "filesystem.hpp" - -namespace wombat { -namespace fs { - -} -} diff --git a/src/filesystem.hpp b/src/ox/fs/filesystem.hpp similarity index 91% rename from src/filesystem.hpp rename to src/ox/fs/filesystem.hpp index bd27b7706..b505868ff 100644 --- a/src/filesystem.hpp +++ b/src/ox/fs/filesystem.hpp @@ -7,12 +7,12 @@ */ #pragma once -#include "_memops.hpp" -#include "_strops.hpp" -#include "_types.hpp" +#include +#include +#include #include "filestore.hpp" -namespace wombat { +namespace ox { namespace fs { struct FileStat { diff --git a/src/ox/fs/test/CMakeLists.txt b/src/ox/fs/test/CMakeLists.txt new file mode 100644 index 000000000..c6a2a18e1 --- /dev/null +++ b/src/ox/fs/test/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 2.8) + +add_executable( + Format + format.cpp +) + +add_executable( + FileStoreIO + filestoreio.cpp +) + +target_link_libraries(Format OxFS OxStd) +target_link_libraries(FileStoreIO OxFS OxStd) + +add_test("Format" Format) +add_test("FileStoreIO" FileStoreIO) diff --git a/test/filestoreio.cpp b/src/ox/fs/test/filestoreio.cpp similarity index 91% rename from test/filestoreio.cpp rename to src/ox/fs/test/filestoreio.cpp index 343947a40..60f3c2dab 100644 --- a/test/filestoreio.cpp +++ b/src/ox/fs/test/filestoreio.cpp @@ -5,10 +5,10 @@ * 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/. */ -#include <_strops.hpp> -#include +#include +#include -using namespace wombat::fs; +using namespace ox::fs; template int test() { diff --git a/test/format.cpp b/src/ox/fs/test/format.cpp similarity index 83% rename from test/format.cpp rename to src/ox/fs/test/format.cpp index 9b623dadf..f14915627 100644 --- a/test/format.cpp +++ b/src/ox/fs/test/format.cpp @@ -5,12 +5,12 @@ * 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/. */ -#include +#include -using namespace wombat::fs; +using namespace ox::fs; int main() { - const auto size = 1 << 16; + const auto size = 65535; uint8_t volume[size]; uint32_t err; FileStore32::format(volume, size); diff --git a/src/ox/std/CMakeLists.txt b/src/ox/std/CMakeLists.txt new file mode 100644 index 000000000..7ca6648eb --- /dev/null +++ b/src/ox/std/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 2.8) + +add_library( + OxStd + _memops.cpp + _strops.cpp +) + +install( + FILES + _memops.hpp + _strops.hpp + DESTINATION + include/ox/std +) diff --git a/src/_memops.cpp b/src/ox/std/_memops.cpp similarity index 94% rename from src/_memops.cpp rename to src/ox/std/_memops.cpp index b81383370..97b109a43 100644 --- a/src/_memops.cpp +++ b/src/ox/std/_memops.cpp @@ -7,8 +7,8 @@ */ #include "_memops.hpp" -namespace wombat { -namespace fs { +namespace ox { +namespace std { void memcpy(void *dest, void *src, int size) { char *srcBuf = (char*) src; diff --git a/src/_memops.hpp b/src/ox/std/_memops.hpp similarity index 91% rename from src/_memops.hpp rename to src/ox/std/_memops.hpp index 08b9994f7..46b8724d4 100644 --- a/src/_memops.hpp +++ b/src/ox/std/_memops.hpp @@ -7,8 +7,8 @@ */ #pragma once -namespace wombat { -namespace fs { +namespace ox { +namespace std { void memcpy(void *src, void *dest, int size); diff --git a/src/_strops.cpp b/src/ox/std/_strops.cpp similarity index 93% rename from src/_strops.cpp rename to src/ox/std/_strops.cpp index c953b0994..dab00329c 100644 --- a/src/_strops.cpp +++ b/src/ox/std/_strops.cpp @@ -5,8 +5,8 @@ * 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/. */ -namespace wombat { -namespace fs { +namespace ox { +namespace std { int strcmp(const char *str1, const char *str2) { auto retval = 0; diff --git a/src/_strops.hpp b/src/ox/std/_strops.hpp similarity index 90% rename from src/_strops.hpp rename to src/ox/std/_strops.hpp index f2ba703c3..9e564e070 100644 --- a/src/_strops.hpp +++ b/src/ox/std/_strops.hpp @@ -7,8 +7,8 @@ */ #pragma once -namespace wombat { -namespace fs { +namespace ox { +namespace std { int strcmp(const char *str1, const char *str2); diff --git a/src/_types.hpp b/src/ox/std/_types.hpp similarity index 96% rename from src/_types.hpp rename to src/ox/std/_types.hpp index 67d3d74eb..ead0a20cc 100644 --- a/src/_types.hpp +++ b/src/ox/std/_types.hpp @@ -7,8 +7,8 @@ */ #pragma once -namespace wombat { -namespace fs { +namespace ox { +namespace std { typedef char int8_t; typedef unsigned char uint8_t; diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt deleted file mode 100644 index d1e216d8b..000000000 --- a/test/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -add_executable( - Format - format.cpp -) - -add_executable( - FileStoreIO - filestoreio.cpp -) - -target_link_libraries(Format WFS) -target_link_libraries(FileStoreIO WFS)