Skip to content

Commit 42d5efe

Browse files
Rename main() to pdf2htmlEX_main. Expose it in public pdf2htmlEX.h header
1 parent ac7675d commit 42d5efe

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ configure_file (${CMAKE_SOURCE_DIR}/share/pdf2htmlEX.js.in ${CMAKE_SOURCE_DIR}/s
121121
set(PDF2HTMLEX_SRC ${PDF2HTMLEX_SRC}
122122
src/Param.h
123123
src/pdf2htmlEX.cc
124+
src/public/pdf2htmlEX.h
124125
src/pdf2htmlEX-config.h
125126
src/HTMLRenderer/HTMLRenderer.h
126127
src/HTMLRenderer/draw.cc
@@ -211,6 +212,9 @@ add_custom_command(OUTPUT
211212

212213
install (TARGETS pdf2htmlEX DESTINATION bin)
213214

215+
SET(PUBLIC_HEADERS src/public/pdf2htmlEX.h)
216+
INSTALL(FILES ${PUBLIC_HEADERS} DESTINATION include)
217+
214218
set(PDF2HTMLEX_RESOURCE
215219
${CMAKE_SOURCE_DIR}/3rdparty/PDF.js/compatibility.js
216220
${CMAKE_SOURCE_DIR}/3rdparty/PDF.js/compatibility.min.js
@@ -247,3 +251,4 @@ configure_file(${CMAKE_SOURCE_DIR}/test/test.py.in ${CMAKE_SOURCE_DIR}/test/test
247251
include(CTest)
248252
add_test(test_basic python ${CMAKE_SOURCE_DIR}/test/test_output.py)
249253
add_test(test_browser python ${CMAKE_SOURCE_DIR}/test/test_local_browser.py)
254+

src/pdf2htmlEX.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
#include "util/mingw.h"
4242
#endif
4343

44+
#include "public/pdf2htmlEX.h"
45+
4446
using namespace std;
4547
using namespace pdf2htmlEX;
4648

@@ -347,7 +349,7 @@ void check_param()
347349
}
348350
}
349351

350-
int main(int argc, char **argv)
352+
int pdf2htmlEX_main(int argc, char **argv)
351353
{
352354
// We need to adjust these directories before parsing the options.
353355
#if defined(__MINGW32__)
@@ -444,7 +446,5 @@ int main(int argc, char **argv)
444446
// Object::memCheck(stderr);
445447
// gMemReport(stderr);
446448

447-
exit(finished ? (EXIT_SUCCESS) : (EXIT_FAILURE));
448-
449-
return 0;
449+
return finished ? EXIT_SUCCESS : EXIT_FAILURE;
450450
}

src/public/pdf2htmlEX.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#pragma once
2+
3+
extern "C" int pdf2htmlEX_main(int argc, char **argv);
4+

0 commit comments

Comments
 (0)