Skip to content

Commit

Permalink
Split off lodepng functionality in a separate library
Browse files Browse the repository at this point in the history
  • Loading branch information
doxygen committed Jun 22, 2019
1 parent 5a3c3cb commit 2af0885
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 31 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ endif()


add_subdirectory(libmd5)
add_subdirectory(liblodepng)
add_subdirectory(qtools)
add_subdirectory(vhdlparser)
add_subdirectory(src)
Expand Down
1 change: 1 addition & 0 deletions addon/doxyapp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ target_link_libraries(doxyapp
_doxygen
qtools
md5
lodepng
doxycfg
vhdlparser
${ICONV_LIBRARIES}
Expand Down
1 change: 1 addition & 0 deletions addon/doxyparse/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ target_link_libraries(doxyparse
_doxygen
qtools
md5
lodepng
doxycfg
vhdlparser
${ICONV_LIBRARIES}
Expand Down
3 changes: 3 additions & 0 deletions liblodepng/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
add_library(lodepng STATIC
lodepng.cpp
)
7 changes: 5 additions & 2 deletions src/lodepng.cpp → liblodepng/lodepng.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ You are free to name this file lodepng.cpp or lodepng.c depending on your usage.
*/

#include "lodepng.h"
#include "portable.h"

#define USE_BRUTE_FORCE_ENCODING 1

Expand Down Expand Up @@ -2436,7 +2435,11 @@ void LodePNG_Encoder_copy(LodePNG_Encoder* dest, const LodePNG_Encoder* source)
unsigned LodePNG_saveFile(const unsigned char* buffer, size_t buffersize, const char* filename)
{
FILE* file;
file = portable_fopen(filename, "wb" );
#if defined(_WIN32) && !defined(__CYGWIN__)
file = _fopen(filename,"wb");
#else
file = fopen(filename,"wb");
#endif
if(!file) return 79;
fwrite((char*)buffer , 1 , buffersize, file);
fclose(file);
Expand Down
8 changes: 8 additions & 0 deletions src/lodepng.h → liblodepng/lodepng.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ freely, subject to the following restrictions:
#include <stdlib.h>
#include <string.h>

#ifdef __cplusplus
extern "C" {
#endif

/* ////////////////////////////////////////////////////////////////////////// */
/* LodeFlate & LodeZlib Setting structs */
/* ////////////////////////////////////////////////////////////////////////// */
Expand Down Expand Up @@ -115,5 +119,9 @@ void LodePNG_encode(LodePNG_Encoder* encoder, unsigned char** out, size_t* outsi
//unsigned LodePNG_loadFile(unsigned char** out, size_t* outsize, const char* filename);
unsigned LodePNG_saveFile(const unsigned char* buffer, size_t buffersize, const char* filename);

#ifdef __cplusplus
}
#endif

#endif

18 changes: 0 additions & 18 deletions libmd5/Makefile.in

This file was deleted.

10 changes: 0 additions & 10 deletions libmd5/libmd5.pro.in

This file was deleted.

3 changes: 2 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
include_directories(
${CMAKE_SOURCE_DIR}/qtools
${CMAKE_SOURCE_DIR}/libmd5
${CMAKE_SOURCE_DIR}/liblodepng
${CMAKE_SOURCE_DIR}/vhdlparser/
${CMAKE_SOURCE_DIR}/src
${CLANG_INCLUDEDIR}
Expand Down Expand Up @@ -217,7 +218,6 @@ add_library(_doxygen STATIC
latexdocvisitor.cpp
latexgen.cpp
layout.cpp
lodepng.cpp
mandocvisitor.cpp
mangen.cpp
sqlite3gen.cpp
Expand Down Expand Up @@ -282,6 +282,7 @@ target_link_libraries(doxygen
doxycfg
qtools
md5
lodepng
vhdlparser
${SQLITE3_LIBRARIES}
${ICONV_LIBRARIES}
Expand Down

0 comments on commit 2af0885

Please sign in to comment.