From e745c1d1d9e268b3ac2af1b680e1fe28bfaa8080 Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Wed, 26 May 2021 02:09:03 +0200 Subject: Move "Hamcore.h" into "include", to clarify that it's the only public header --- CMakeLists.txt | 4 ++-- Hamcore.h | 39 --------------------------------------- include/Hamcore.h | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 41 deletions(-) delete mode 100644 Hamcore.h create mode 100644 include/Hamcore.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a9a3f0..4017ff2 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,7 @@ if(MSVC) target_compile_definitions(libhamcore PRIVATE "_CRT_SECURE_NO_WARNINGS") endif() -target_include_directories(libhamcore PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(libhamcore PUBLIC "include") target_sources(libhamcore PRIVATE @@ -31,7 +31,7 @@ target_sources(libhamcore Memory.c Memory.h PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/Hamcore.h + "${CMAKE_CURRENT_SOURCE_DIR}/include/Hamcore.h" ) find_package(ZLIB REQUIRED) diff --git a/Hamcore.h b/Hamcore.h deleted file mode 100644 index 7db79e9..0000000 --- a/Hamcore.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef HAMCORE_H -#define HAMCORE_H - -#include -#include -#include - -#define HAMCORE_HEADER_DATA "HamCore" -#define HAMCORE_HEADER_SIZE 7 - -typedef struct HAMCORE_FILE -{ - char *Path; - size_t Offset; - size_t Size; - size_t OriginalSize; -} HAMCORE_FILE; - -typedef struct HAMCORE_FILES -{ - size_t Num; - HAMCORE_FILE *List; -} HAMCORE_FILES; - -typedef struct HAMCORE -{ - FILE *File; - HAMCORE_FILES Files; -} HAMCORE; - -HAMCORE *HamcoreOpen(const char *path); -void HamcoreClose(HAMCORE *hamcore); - -const HAMCORE_FILE *HamcoreFind(const HAMCORE *hamcore, const char *path); -bool HamcoreRead(HAMCORE *hamcore, void *dst, const HAMCORE_FILE *file); - -bool HamcoreBuild(const char *dst_path, const char *base_path, const char **src_paths, const size_t num); - -#endif diff --git a/include/Hamcore.h b/include/Hamcore.h new file mode 100644 index 0000000..7db79e9 --- /dev/null +++ b/include/Hamcore.h @@ -0,0 +1,39 @@ +#ifndef HAMCORE_H +#define HAMCORE_H + +#include +#include +#include + +#define HAMCORE_HEADER_DATA "HamCore" +#define HAMCORE_HEADER_SIZE 7 + +typedef struct HAMCORE_FILE +{ + char *Path; + size_t Offset; + size_t Size; + size_t OriginalSize; +} HAMCORE_FILE; + +typedef struct HAMCORE_FILES +{ + size_t Num; + HAMCORE_FILE *List; +} HAMCORE_FILES; + +typedef struct HAMCORE +{ + FILE *File; + HAMCORE_FILES Files; +} HAMCORE; + +HAMCORE *HamcoreOpen(const char *path); +void HamcoreClose(HAMCORE *hamcore); + +const HAMCORE_FILE *HamcoreFind(const HAMCORE *hamcore, const char *path); +bool HamcoreRead(HAMCORE *hamcore, void *dst, const HAMCORE_FILE *file); + +bool HamcoreBuild(const char *dst_path, const char *base_path, const char **src_paths, const size_t num); + +#endif -- cgit v1.2.3