-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
167 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
add_library(Zip_minizip STATIC | ||
src/Zip_minizip.c) | ||
|
||
target_include_directories(Zip_minizip PUBLIC | ||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> | ||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> | ||
) | ||
|
||
find_package(MINIZIP REQUIRED) | ||
target_link_libraries(Zip_minizip PRIVATE MINIZIP::minizip) | ||
|
||
set(Zip_minizip_PUBLIC_INCLUDE_PATH ${CoDeLib_PUBLIC_INCLUDE_PATH}/Zip_minizip) | ||
set(Zip_minizip_PUBLIC_HEADERS | ||
${Zip_minizip_PUBLIC_INCLUDE_PATH}/Zip_minizip.h | ||
) | ||
install(FILES ${Zip_minizip_PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/CoDeLib/Zip_minizip) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include <CoDeLib/Zip_minizip/Zip_minizip.h> | ||
|
||
#include <zip.h> // minizip | ||
|
||
ZIP_RETURN_CODES Zip(FILE *inputs[] __attribute__((unused)), | ||
FILE *output __attribute__((unused)), | ||
void *options __attribute__((unused))) { | ||
|
||
// TODO: Dummy code to test if it compiles and links | ||
if (ZIP_OK) { | ||
return ZIP_SUCCESS; | ||
} | ||
return ZIP_ERROR; | ||
} | ||
|
||
const struct IZip zip_minizip = { | ||
.Zip = Zip, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#pragma once | ||
|
||
#include <stdio.h> | ||
|
||
typedef enum { ZIP_SUCCESS, ZIP_ERROR } ZIP_RETURN_CODES; | ||
|
||
struct IZip { | ||
/*! | ||
* @brief Zips the input file(s) and write the output to the output file. | ||
* | ||
* @param inputs The input files. | ||
* @param output The output file. | ||
* @param options The options for the zipping. | ||
* | ||
* @return ZIP_SUCCESS if the zipping was successful, ZIP_ERROR | ||
* otherwise. | ||
*/ | ||
ZIP_RETURN_CODES (*Zip)(FILE *inputs[], FILE *output, void *options); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#pragma once | ||
|
||
#include <CoDeLib/IZip.h> | ||
|
||
extern const struct IZip zip_minizip; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters