From ab794ded78e2b7a65e330959748010683771c40f Mon Sep 17 00:00:00 2001 From: Hugues Delorme Date: Thu, 13 Mar 2014 17:49:39 +0100 Subject: [PATCH] Major reorganization of source files into a better source tree --- CMakeLists.txt | 129 +++--------------- qmake/config.pri | 2 +- qmake/fougdatax.pro | 109 ++++++--------- src/{ => datax_core}/config.h.cmake | 0 src/{ => datax_core}/endian.c | 0 src/{ => datax_core}/endian.h | 0 src/{ => datax_core}/error.c | 0 src/{ => datax_core}/error.h | 0 src/{ => datax_core}/global.h | 0 src/{ => datax_core}/internal/ascii_parse.c | 0 src/{ => datax_core}/internal/ascii_parse.h | 0 src/{ => datax_core}/internal/byte_codec.h | 0 src/{ => datax_core}/internal/byte_swap.h | 0 src/{ => datax_core}/internal/convert.c | 0 src/{ => datax_core}/internal/convert.h | 0 src/{ => datax_core}/memory.h | 0 src/{ => datax_core}/stream.c | 0 src/{ => datax_core}/stream.h | 0 src/{ => datax_core}/task_control.c | 0 src/{ => datax_core}/task_control.h | 0 src/{ => datax_core}/transfer.h | 0 .../internal}/stl_rw_common.c | 4 +- .../internal}/stl_rw_common.h | 10 +- .../internal}/stlb_byte_swap.c | 2 +- .../internal}/stlb_byte_swap.h | 4 +- src/{libstl => datax_stl}/stl_error.h | 0 src/{libstl => datax_stl}/stl_format.c | 7 +- src/{libstl => datax_stl}/stl_format.h | 2 +- src/{libstl => datax_stl}/stl_geom.h | 0 src/{libstl => datax_stl}/stl_geom_creator.h | 0 src/{libstl => datax_stl}/stl_global.h | 2 +- src/{libstl => datax_stl}/stl_io.h | 4 +- src/{libstl => datax_stl}/stl_triangle.h | 0 src/{libstl => datax_stl}/stla_read.c | 7 +- src/{libstl => datax_stl}/stla_write.c | 5 +- src/{libstl => datax_stl}/stlb_read.c | 12 +- src/{libstl => datax_stl}/stlb_write.c | 10 +- src/{support => datax_support}/occ_libstl.cpp | 5 +- src/{support => datax_support}/occ_libstl.h | 9 +- src/{support => datax_support}/qt_stream.cpp | 4 +- src/{support => datax_support}/qt_stream.h | 6 +- .../support_global.h | 2 +- 42 files changed, 115 insertions(+), 220 deletions(-) rename src/{ => datax_core}/config.h.cmake (100%) rename src/{ => datax_core}/endian.c (100%) rename src/{ => datax_core}/endian.h (100%) rename src/{ => datax_core}/error.c (100%) rename src/{ => datax_core}/error.h (100%) rename src/{ => datax_core}/global.h (100%) rename src/{ => datax_core}/internal/ascii_parse.c (100%) rename src/{ => datax_core}/internal/ascii_parse.h (100%) rename src/{ => datax_core}/internal/byte_codec.h (100%) rename src/{ => datax_core}/internal/byte_swap.h (100%) rename src/{ => datax_core}/internal/convert.c (100%) rename src/{ => datax_core}/internal/convert.h (100%) rename src/{ => datax_core}/memory.h (100%) rename src/{ => datax_core}/stream.c (100%) rename src/{ => datax_core}/stream.h (100%) rename src/{ => datax_core}/task_control.c (100%) rename src/{ => datax_core}/task_control.h (100%) rename src/{ => datax_core}/transfer.h (100%) rename src/{internal/libstl => datax_stl/internal}/stl_rw_common.c (95%) rename src/{internal/libstl => datax_stl/internal}/stl_rw_common.h (78%) rename src/{internal/libstl => datax_stl/internal}/stlb_byte_swap.c (88%) rename src/{internal/libstl => datax_stl/internal}/stlb_byte_swap.h (73%) rename src/{libstl => datax_stl}/stl_error.h (100%) rename src/{libstl => datax_stl}/stl_format.c (93%) rename src/{libstl => datax_stl}/stl_format.h (94%) rename src/{libstl => datax_stl}/stl_geom.h (100%) rename src/{libstl => datax_stl}/stl_geom_creator.h (100%) rename src/{libstl => datax_stl}/stl_global.h (93%) rename src/{libstl => datax_stl}/stl_io.h (95%) rename src/{libstl => datax_stl}/stl_triangle.h (100%) rename src/{libstl => datax_stl}/stla_read.c (98%) rename src/{libstl => datax_stl}/stla_write.c (99%) rename src/{libstl => datax_stl}/stlb_read.c (95%) rename src/{libstl => datax_stl}/stlb_write.c (95%) rename src/{support => datax_support}/occ_libstl.cpp (96%) rename src/{support => datax_support}/occ_libstl.h (80%) rename src/{support => datax_support}/qt_stream.cpp (95%) rename src/{support => datax_support}/qt_stream.h (60%) rename src/{support => datax_support}/support_global.h (92%) diff --git a/CMakeLists.txt b/CMakeLists.txt index ebc8e03..39645bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,18 +6,15 @@ include(CheckCSourceCompiles) project(fougdatax) -set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) +#set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) # Options option(BUILD_SHARED_LIBS "Build shared libraries (DLL)" ON) option(BUILD_STRICT_C90 "Build with strict conformance to C90 standard, if disabled FougDataX can use C99 features (eg. fabsf(), strtof(), ...)" ON) option(BUILD_WITH_LIBSTL "Build the libSTL module" ON) -option(BUILD_WITH_QT_SUPPORT "Build with Qt support" OFF) -option(BUILD_WITH_QT_SUPPORT_FORCE_QT4 "Build the Qt support with Qt4 instead of Qt5. No effect if option BUILD_WITH_QT_SUPPORT is disabled" OFF) -option(BUILD_WITH_OCC_SUPPORT "Build with OpenCascade support" OFF) # Add core source files -file(GLOB ALL_SRC_FILES src/* src/internal/*) +file(GLOB ALL_SRC_FILES src/datax_core/* src/datax_core/internal/*) set(ALL_SRC_FILES ${ALL_SRC_FILES}) # Have ? @@ -42,7 +39,7 @@ elseif(MSVC) FOUG_HAVE_MSVC_BUILTIN_BSWAP_FUNC) endif() -configure_file(src/config.h.cmake config.h @ONLY) +configure_file(src/datax_core/config.h.cmake config.h @ONLY) include_directories(${CMAKE_BINARY_DIR}) # For generated "config.h" # Specific flags for GCC @@ -52,6 +49,7 @@ if(CMAKE_COMPILER_IS_GNUCC) endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic-errors -fstrict-aliasing") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Winline -Wextra -Wstrict-aliasing -Wcast-align -Wlogical-op -Wfloat-equal") + set(CMAKE_POSITION_INDEPENDENT_CODE ON) endif() # Specific flags for Visual C++ @@ -66,105 +64,36 @@ if(BUILD_SHARED_LIBS) endif() # Declare installs -install(FILES ${CMAKE_BINARY_DIR}/config.h DESTINATION include/datax) +install(FILES ${CMAKE_BINARY_DIR}/config.h DESTINATION include/datax_core) -file(GLOB C_GLOBAL_HEADERS src/*.h) -install(FILES ${C_GLOBAL_HEADERS} DESTINATION include/datax) +file(GLOB C_CORE_HEADERS src/datax_core/*.h) +install(FILES ${C_CORE_HEADERS} DESTINATION include/datax_core) # Module libSTL if(BUILD_WITH_LIBSTL) - add_definitions(-DFOUG_DATAX_LIBSTL_DLL - -DFOUG_DATAX_LIBSTL_MAKE_DLL) + if(BUILD_SHARED_LIBS) + add_definitions(-DFOUG_DATAX_LIBSTL_DLL + -DFOUG_DATAX_LIBSTL_MAKE_DLL) + endif() - file(GLOB ALL_LIBSTL_SRC_FILES src/libstl/* src/internal/libstl/*) + file(GLOB ALL_LIBSTL_SRC_FILES src/datax_stl/* src/datax_stl/internal/*) set(ALL_SRC_FILES ${ALL_SRC_FILES} ${ALL_LIBSTL_SRC_FILES}) endif() -file(GLOB C_LIBSTL_HEADERS src/libstl/*.h) -install(FILES ${C_LIBSTL_HEADERS} DESTINATION include/datax/libstl) +file(GLOB C_LIBSTL_HEADERS src/datax_stl/*.h) +install(FILES ${C_LIBSTL_HEADERS} DESTINATION include/datax_stl) # Common for support modules -if(BUILD_WITH_QT_SUPPORT OR BUILD_WITH_OCC_SUPPORT) - if(BUILD_SHARED_LIBS) - add_definitions(-DFOUG_LIBSUPPORT_DLL - -DFOUG_LIBSUPPORT_MAKE_DLL) - endif() -endif() -install(FILES src/support/support_global.h DESTINATION include/datax/support) +install(FILES src/datax_support/support_global.h DESTINATION include/datax_support) # Qt support -if(BUILD_WITH_QT_SUPPORT) - if(BUILD_WITH_QT_SUPPORT_FORCE_QT4) - find_package(Qt4 REQUIRED) - set(QT_USE_QTCORE TRUE) - set(QT_USE_QTGUI FALSE) - include(${QT_USE_FILE}) - add_definitions(${QT_DEFINITIONS}) - else() - if ("${CMAKE_VERSION}" VERSION_GREATER 2.8.11) - cmake_policy(SET CMP0020 NEW) - endif() - find_package(Qt5Core REQUIRED) - endif() - - file(GLOB ALL_QT_SUPPORT_SRC_FILES src/support/qt_*) - set(ALL_SRC_FILES ${ALL_SRC_FILES} ${ALL_QT_SUPPORT_SRC_FILES}) -else() - install(FILES src/support/qt_stream.h DESTINATION src/support) - install(FILES src/support/qt_stream.cpp DESTINATION src/support) -endif() -install(FILES src/support/qt_stream.h DESTINATION include/datax/support) +install(FILES src/datax_support/qt_stream.h DESTINATION include/datax_support) +install(FILES src/datax_support/qt_stream.cpp DESTINATION src/datax_support) # OpenCASCADE support -if(BUILD_WITH_OCC_SUPPORT) - set(CASCADE_ROOT "" CACHE PATH "Root directory of OpenCascade, useful only when option BUILD_WITH_OCC_SUPPORT is enabled") - - file(GLOB ALL_OCC_SUPPORT_SRC_FILES src/support/occ_*) - set(ALL_SRC_FILES ${ALL_SRC_FILES} ${ALL_OCC_SUPPORT_SRC_FILES}) - include_directories(${CASCADE_ROOT}/inc) - - # Defines - if(WIN32) - add_definitions(-DWNT) - elseif("${CMAKE_SYSTEM}" MATCHES "Linux") - add_definitions(-DLIN - -DLININTEL - -DOCC_CONVERT_SIGNALS) - endif() - - if(CMAKE_SIZEOF_VOID_P EQUAL 8) # 64b ? - add_definitions(-D_OCC64) - endif() - - if(NOT WIN32) - add_definitions(-DHAVE_CONFIG_H - -DHAVE_FSTREAM - -DHAVE_IOSTREAM - -DHAVE_IOMANIP - -DHAVE_LIMITS_H) - endif() - - # Libraries - - #set(CASCADE_TOOLKITS TKSTL TKernel TKMath) - #foreach(occToolKit ${CASCADE_TOOLKITS}) - # find_library(${occToolKit}_OCCLIB ${occToolKit} ${CASCADE_ROOT}/lib NO_DEFAULT_PATH) - # set(foundOccLib ${${occToolKit}_OCCLIB}) - # if(foundOccLib STREQUAL ${occToolKit}_OCCLIB-NOTFOUND) - # message(FATAL_ERROR "Cannot find ${occToolKit} in ${CASCADE_ROOT}/lib") - # endif() - # set(CASCADE_LIBRARIES ${CASCADE_LIBRARIES} ${foundOccLib}) - # mark_as_advanced(${occToolKit}_OCCLIB) - #endforeach() - - link_directories(${CASCADE_ROOT}/lib) -else() - install(FILES src/support/occ_libstl.h DESTINATION src/support) - install(FILES src/support/occ_libstl.cpp DESTINATION src/support) -endif() -install(FILES src/support/occ_libstl.h DESTINATION include/datax/support) - +install(FILES src/datax_support/occ_libstl.h DESTINATION include/datax_support) +install(FILES src/datax_support/occ_libstl.cpp DESTINATION src/datax_support) # Installs for target add_library(fougdatax ${ALL_SRC_FILES}) @@ -174,22 +103,6 @@ install(TARGETS fougdatax ARCHIVE DESTINATION lib) -# Qt support link -if(BUILD_WITH_QT_SUPPORT) - if(BUILD_WITH_QT_SUPPORT_FORCE_QT4) - target_link_libraries(fougdatax ${QT_LIBRARIES}) - else() - qt5_use_modules(fougdatax Core) - endif() -endif() - -# OpenCascade support link -if(BUILD_WITH_OCC_SUPPORT) - #target_link_libraries(fougdatax ${CASCADE_LIBRARIES}) - target_link_libraries(fougdatax TKSTL TKernel TKMath) -endif() - - # Examples: # cmake ../.. -DCMAKE_INSTALL_PREFIX=../../gcc-linux64 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_DEBUG_POSTFIX=.debug # cmake ../.. -DCMAKE_INSTALL_PREFIX=../../gcc-linux64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_RELEASE_POSTFIX=.release @@ -204,8 +117,8 @@ add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) add_executable(test_internal EXCLUDE_FROM_ALL tests/stream_buffer.c tests/test_internal.c - src/stream.c - src/internal/ascii_parse.c) + src/datax_core/stream.c + src/datax_core/internal/ascii_parse.c) add_executable(test_platform EXCLUDE_FROM_ALL tests/test_platform.c) add_test(test_internal test_internal) add_test(test_platform test_platform) diff --git a/qmake/config.pri b/qmake/config.pri index 8ef547f..3c614b1 100644 --- a/qmake/config.pri +++ b/qmake/config.pri @@ -4,4 +4,4 @@ CONFIG(debug, debug|release) { } else { TARGET_SUFFIX = } -CONFIG *= build_all debug_and_release +CONFIG += build_all debug_and_release diff --git a/qmake/fougdatax.pro b/qmake/fougdatax.pro index be2d2a3..b5aba06 100644 --- a/qmake/fougdatax.pro +++ b/qmake/fougdatax.pro @@ -17,32 +17,34 @@ DATAX += stl dll:DEFINES += FOUG_LIB_DLL \ FOUG_LIB_MAKE_DLL +INCLUDEPATH += $$PWD/../src + #*g++*:QMAKE_CXXFLAGS_RELEASE -= -O2 #*g++*:QMAKE_CXXFLAGS_RELEASE += -O3 HEADERS += \ config.h \ - ../src/endian.h \ - ../src/error.h \ - ../src/global.h \ - ../src/memory.h \ - ../src/stream.h \ - ../src/task_control.h \ - ../src/transfer.h \ + ../src/datax_core/endian.h \ + ../src/datax_core/error.h \ + ../src/datax_core/global.h \ + ../src/datax_core/memory.h \ + ../src/datax_core/stream.h \ + ../src/datax_core/task_control.h \ + ../src/datax_core/transfer.h \ \ - ../src/internal/convert.h \ - ../src/internal/ascii_parse.h \ - ../src/internal/byte_swap.h \ - ../src/internal/byte_codec.h + ../src/datax_core/internal/convert.h \ + ../src/datax_core/internal/ascii_parse.h \ + ../src/datax_core/internal/byte_swap.h \ + ../src/datax_core/internal/byte_codec.h SOURCES += \ - ../src/endian.c \ - ../src/error.c \ - ../src/stream.c \ - ../src/task_control.c \ + ../src/datax_core/endian.c \ + ../src/datax_core/error.c \ + ../src/datax_core/stream.c \ + ../src/datax_core/task_control.c \ \ - ../src/internal/convert.c \ - ../src/internal/ascii_parse.c + ../src/datax_core/internal/convert.c \ + ../src/datax_core/internal/ascii_parse.c *-g++*:QMAKE_CFLAGS += -ansi -pedantic-errors *-msvc*:QMAKE_CFLAGS += -TC @@ -58,29 +60,29 @@ contains(DATAX, stl) { #DEFINES += FOUG_STLB_READWRITE_ALIGNSAFE HEADERS += \ - ../src/libstl/stl_error.h \ - ../src/libstl/stl_format.h \ - ../src/libstl/stl_geom.h \ - ../src/libstl/stl_geom_creator.h \ - ../src/libstl/stl_global.h \ - ../src/libstl/stl_io.h \ - ../src/libstl/stl_triangle.h \ + ../src/datax_stl/stl_error.h \ + ../src/datax_stl/stl_format.h \ + ../src/datax_stl/stl_geom.h \ + ../src/datax_stl/stl_geom_creator.h \ + ../src/datax_stl/stl_global.h \ + ../src/datax_stl/stl_io.h \ + ../src/datax_stl/stl_triangle.h \ \ - ../src/internal/libstl/stlb_byte_swap.h \ - ../src/internal/libstl/stl_rw_common.h + ../src/datax_stl/internal/stlb_byte_swap.h \ + ../src/datax_stl/internal/stl_rw_common.h SOURCES += \ - ../src/libstl/stl_format.c \ - ../src/libstl/stla_read.c \ - ../src/libstl/stla_write.c \ - ../src/libstl/stlb_read.c \ - ../src/libstl/stlb_write.c \ + ../src/datax_stl/stl_format.c \ + ../src/datax_stl/stla_read.c \ + ../src/datax_stl/stla_write.c \ + ../src/datax_stl/stlb_read.c \ + ../src/datax_stl/stlb_write.c \ \ - ../src/internal/libstl/stlb_byte_swap.c \ - ../src/internal/libstl/stl_rw_common.c + ../src/datax_stl/internal/stlb_byte_swap.c \ + ../src/datax_stl/internal/stl_rw_common.c - libstl_inc.path = $$PREFIX_DIR/include/datax/libstl - libstl_inc.files = ../src/libstl/*.h + libstl_inc.path = $$PREFIX_DIR/include/datax_stl + libstl_inc.files = ../src/datax_stl/*.h INSTALLS += libstl_inc } # contains(DATAX, stl) @@ -91,46 +93,21 @@ HAS_SUPPORT = $$find(DATAX, support) dll:DEFINES += FOUG_LIBSUPPORT_DLL \ FOUG_LIBSUPPORT_MAKE_DLL support_inc.path = $$PREFIX_DIR/include/datax/support - support_inc.files = ../src/support/support_global.h + support_inc.files = ../src/datax_support/support_global.h INSTALLS += support_inc } # !isEmpty(HAS_SUPPORT) # qt_support contains(DATAX, qt_support) { - HEADERS += ../src/support/qt_stream.h - SOURCES += ../src/support/qt_stream.cpp - - QT = core - - qt_support_inc.path = $$PREFIX_DIR/include/datax/support - qt_support_inc.files = ../src/support/qt_stream.h + qt_support_inc.path = $$PREFIX_DIR/include/datax_support + qt_support_inc.files = ../src/datax_support/qt_stream.h INSTALLS += qt_support_inc } # contains(DATAX, qt_support) # occ_support contains(DATAX, occ_support) { - isEmpty(CASCADE_ROOT):error(Variable CASCADE_ROOT is not defined) - - INCLUDEPATH += $$CASCADE_ROOT/inc - - win32-*:DEFINES += WNT - linux-*:DEFINES += LIN LININTEL OCC_CONVERT_SIGNALS - *-64:DEFINES += _OCC64 - !win32:DEFINES += HAVE_CONFIG_H \ - HAVE_FSTREAM \ - HAVE_IOSTREAM \ - HAVE_IOMANIP \ - HAVE_LIMITS_H - - HEADERS += ../src/support/occ_libstl.h - SOURCES += ../src/support/occ_libstl.cpp - - CASCADE_LIBPATH = $$CASCADE_ROOT/lib - LIBS += -L$$CASCADE_LIBPATH -lTKSTL -lTKernel -lTKMath - QMAKE_RPATHDIR += $$CASCADE_LIBPATH - - occ_support_inc.path = $$PREFIX_DIR/include/datax/support - occ_support_inc.files = ../src/support/occ_libstl.h + occ_support_inc.path = $$PREFIX_DIR/include/datax_support + occ_support_inc.files = ../src/datax_support/occ_libstl.h INSTALLS += occ_support_inc } # contains(DATAX, occ_support) @@ -142,4 +119,4 @@ OTHER_FILES += \ ../doc/main_page.cpp \ ../doc/Doxyfile \ \ - ../src/config.h.cmake + ../src/datax_core/config.h.cmake diff --git a/src/config.h.cmake b/src/datax_core/config.h.cmake similarity index 100% rename from src/config.h.cmake rename to src/datax_core/config.h.cmake diff --git a/src/endian.c b/src/datax_core/endian.c similarity index 100% rename from src/endian.c rename to src/datax_core/endian.c diff --git a/src/endian.h b/src/datax_core/endian.h similarity index 100% rename from src/endian.h rename to src/datax_core/endian.h diff --git a/src/error.c b/src/datax_core/error.c similarity index 100% rename from src/error.c rename to src/datax_core/error.c diff --git a/src/error.h b/src/datax_core/error.h similarity index 100% rename from src/error.h rename to src/datax_core/error.h diff --git a/src/global.h b/src/datax_core/global.h similarity index 100% rename from src/global.h rename to src/datax_core/global.h diff --git a/src/internal/ascii_parse.c b/src/datax_core/internal/ascii_parse.c similarity index 100% rename from src/internal/ascii_parse.c rename to src/datax_core/internal/ascii_parse.c diff --git a/src/internal/ascii_parse.h b/src/datax_core/internal/ascii_parse.h similarity index 100% rename from src/internal/ascii_parse.h rename to src/datax_core/internal/ascii_parse.h diff --git a/src/internal/byte_codec.h b/src/datax_core/internal/byte_codec.h similarity index 100% rename from src/internal/byte_codec.h rename to src/datax_core/internal/byte_codec.h diff --git a/src/internal/byte_swap.h b/src/datax_core/internal/byte_swap.h similarity index 100% rename from src/internal/byte_swap.h rename to src/datax_core/internal/byte_swap.h diff --git a/src/internal/convert.c b/src/datax_core/internal/convert.c similarity index 100% rename from src/internal/convert.c rename to src/datax_core/internal/convert.c diff --git a/src/internal/convert.h b/src/datax_core/internal/convert.h similarity index 100% rename from src/internal/convert.h rename to src/datax_core/internal/convert.h diff --git a/src/memory.h b/src/datax_core/memory.h similarity index 100% rename from src/memory.h rename to src/datax_core/memory.h diff --git a/src/stream.c b/src/datax_core/stream.c similarity index 100% rename from src/stream.c rename to src/datax_core/stream.c diff --git a/src/stream.h b/src/datax_core/stream.h similarity index 100% rename from src/stream.h rename to src/datax_core/stream.h diff --git a/src/task_control.c b/src/datax_core/task_control.c similarity index 100% rename from src/task_control.c rename to src/datax_core/task_control.c diff --git a/src/task_control.h b/src/datax_core/task_control.h similarity index 100% rename from src/task_control.h rename to src/datax_core/task_control.h diff --git a/src/transfer.h b/src/datax_core/transfer.h similarity index 100% rename from src/transfer.h rename to src/datax_core/transfer.h diff --git a/src/internal/libstl/stl_rw_common.c b/src/datax_stl/internal/stl_rw_common.c similarity index 95% rename from src/internal/libstl/stl_rw_common.c rename to src/datax_stl/internal/stl_rw_common.c index d6a81dd..b0ab0ad 100644 --- a/src/internal/libstl/stl_rw_common.c +++ b/src/datax_stl/internal/stl_rw_common.c @@ -1,7 +1,7 @@ #include "stl_rw_common.h" -#include "../../error.h" -#include "../../libstl/stl_error.h" +#include "../../datax_core/error.h" +#include "../stl_error.h" foug_bool_t foug_check_transfer(int *error, const foug_transfer_t* trsf) { diff --git a/src/internal/libstl/stl_rw_common.h b/src/datax_stl/internal/stl_rw_common.h similarity index 78% rename from src/internal/libstl/stl_rw_common.h rename to src/datax_stl/internal/stl_rw_common.h index 384066d..2c4682a 100644 --- a/src/internal/libstl/stl_rw_common.h +++ b/src/datax_stl/internal/stl_rw_common.h @@ -1,11 +1,11 @@ #ifndef FOUG_INTERNAL_STL_RW_COMMON_H #define FOUG_INTERNAL_STL_RW_COMMON_H -#include "../../global.h" -#include "../../endian.h" -#include "../../transfer.h" -#include "../../libstl/stl_geom.h" -#include "../../libstl/stl_triangle.h" +#include "../../datax_core/global.h" +#include "../../datax_core/endian.h" +#include "../../datax_core/transfer.h" +#include "../stl_geom.h" +#include "../stl_triangle.h" typedef struct { diff --git a/src/internal/libstl/stlb_byte_swap.c b/src/datax_stl/internal/stlb_byte_swap.c similarity index 88% rename from src/internal/libstl/stlb_byte_swap.c rename to src/datax_stl/internal/stlb_byte_swap.c index 81a9fa8..a9a8ae6 100644 --- a/src/internal/libstl/stlb_byte_swap.c +++ b/src/datax_stl/internal/stlb_byte_swap.c @@ -1,6 +1,6 @@ #include "stlb_byte_swap.h" -#include "../byte_swap.h" +#include "../../datax_core/internal/byte_swap.h" void foug_stl_triangle_bswap(foug_stl_triangle_t* triangle) { diff --git a/src/internal/libstl/stlb_byte_swap.h b/src/datax_stl/internal/stlb_byte_swap.h similarity index 73% rename from src/internal/libstl/stlb_byte_swap.h rename to src/datax_stl/internal/stlb_byte_swap.h index 3b9758d..8b55a34 100644 --- a/src/internal/libstl/stlb_byte_swap.h +++ b/src/datax_stl/internal/stlb_byte_swap.h @@ -1,8 +1,8 @@ #ifndef FOUG_INTERNAL_STLB_BYTE_SWAP_H #define FOUG_INTERNAL_STLB_BYTE_SWAP_H -#include "../../global.h" -#include "../../libstl/stl_triangle.h" +#include "../../datax_core/global.h" +#include "../stl_triangle.h" void foug_stl_triangle_bswap(foug_stl_triangle_t* triangle); diff --git a/src/libstl/stl_error.h b/src/datax_stl/stl_error.h similarity index 100% rename from src/libstl/stl_error.h rename to src/datax_stl/stl_error.h diff --git a/src/libstl/stl_format.c b/src/datax_stl/stl_format.c similarity index 93% rename from src/libstl/stl_format.c rename to src/datax_stl/stl_format.c index d7fac89..11cbf28 100644 --- a/src/libstl/stl_format.c +++ b/src/datax_stl/stl_format.c @@ -1,10 +1,11 @@ #include "stl_format.h" -#include "../endian.h" -#include "../internal/byte_codec.h" -#include "../internal/byte_swap.h" #include "stl_triangle.h" +#include "../datax_core/endian.h" +#include "../datax_core/internal/byte_codec.h" +#include "../datax_core/internal/byte_swap.h" + #include #include diff --git a/src/libstl/stl_format.h b/src/datax_stl/stl_format.h similarity index 94% rename from src/libstl/stl_format.h rename to src/datax_stl/stl_format.h index b100f95..b74bdc4 100644 --- a/src/libstl/stl_format.h +++ b/src/datax_stl/stl_format.h @@ -2,7 +2,7 @@ #define FOUG_LIBSTL_FORMAT_H #include "stl_global.h" -#include "../stream.h" +#include "../datax_core/stream.h" FOUG_C_LINKAGE_BEGIN diff --git a/src/libstl/stl_geom.h b/src/datax_stl/stl_geom.h similarity index 100% rename from src/libstl/stl_geom.h rename to src/datax_stl/stl_geom.h diff --git a/src/libstl/stl_geom_creator.h b/src/datax_stl/stl_geom_creator.h similarity index 100% rename from src/libstl/stl_geom_creator.h rename to src/datax_stl/stl_geom_creator.h diff --git a/src/libstl/stl_global.h b/src/datax_stl/stl_global.h similarity index 93% rename from src/libstl/stl_global.h rename to src/datax_stl/stl_global.h index 53d815b..44bba7f 100644 --- a/src/libstl/stl_global.h +++ b/src/datax_stl/stl_global.h @@ -1,7 +1,7 @@ #ifndef FOUG_DATAX_C_LIBSTL_STLB_GLOBAL_H #define FOUG_DATAX_C_LIBSTL_STLB_GLOBAL_H -#include "../global.h" +#include "../datax_core/global.h" #ifdef FOUG_DATAX_LIBSTL_DLL # ifdef FOUG_DATAX_LIBSTL_MAKE_DLL diff --git a/src/libstl/stl_io.h b/src/datax_stl/stl_io.h similarity index 95% rename from src/libstl/stl_io.h rename to src/datax_stl/stl_io.h index 3885faf..ff0dbda 100644 --- a/src/libstl/stl_io.h +++ b/src/datax_stl/stl_io.h @@ -4,8 +4,8 @@ #include "stl_global.h" #include "stl_geom.h" #include "stl_geom_creator.h" -#include "../endian.h" -#include "../transfer.h" +#include "../datax_core/endian.h" +#include "../datax_core/transfer.h" FOUG_C_LINKAGE_BEGIN diff --git a/src/libstl/stl_triangle.h b/src/datax_stl/stl_triangle.h similarity index 100% rename from src/libstl/stl_triangle.h rename to src/datax_stl/stl_triangle.h diff --git a/src/libstl/stla_read.c b/src/datax_stl/stla_read.c similarity index 98% rename from src/libstl/stla_read.c rename to src/datax_stl/stla_read.c index 49bc314..dd268d0 100644 --- a/src/libstl/stla_read.c +++ b/src/datax_stl/stla_read.c @@ -1,9 +1,10 @@ #include "stl_io.h" -#include "../internal/ascii_parse.h" -#include "../internal/libstl/stl_rw_common.h" -#include "../error.h" #include "stl_error.h" +#include "internal/stl_rw_common.h" + +#include "../datax_core/error.h" +#include "../datax_core/internal/ascii_parse.h" #include #include diff --git a/src/libstl/stla_write.c b/src/datax_stl/stla_write.c similarity index 99% rename from src/libstl/stla_write.c rename to src/datax_stl/stla_write.c index 47ef30c..936163e 100644 --- a/src/libstl/stla_write.c +++ b/src/datax_stl/stla_write.c @@ -1,9 +1,10 @@ #include "stl_io.h" -#include "../error.h" -#include "../internal/libstl/stl_rw_common.h" +#include "internal/stl_rw_common.h" #include "stl_error.h" +#include "../datax_core/error.h" + #include #include diff --git a/src/libstl/stlb_read.c b/src/datax_stl/stlb_read.c similarity index 95% rename from src/libstl/stlb_read.c rename to src/datax_stl/stlb_read.c index 58a5d14..d7fc8f8 100644 --- a/src/libstl/stlb_read.c +++ b/src/datax_stl/stlb_read.c @@ -1,13 +1,13 @@ #include "stl_io.h" -#include "../endian.h" -#include "../error.h" #include "stl_error.h" +#include "internal/stl_rw_common.h" +#include "internal/stlb_byte_swap.h" -#include "../internal/convert.h" -#include "../internal/byte_swap.h" -#include "../internal/libstl/stl_rw_common.h" -#include "../internal/libstl/stlb_byte_swap.h" +#include "../datax_core/endian.h" +#include "../datax_core/error.h" +#include "../datax_core/internal/convert.h" +#include "../datax_core/internal/byte_swap.h" #include diff --git a/src/libstl/stlb_write.c b/src/datax_stl/stlb_write.c similarity index 95% rename from src/libstl/stlb_write.c rename to src/datax_stl/stlb_write.c index dabc33e..0155a24 100644 --- a/src/libstl/stlb_write.c +++ b/src/datax_stl/stlb_write.c @@ -1,12 +1,12 @@ #include "stl_io.h" -#include "../endian.h" -#include "../error.h" #include "stl_error.h" +#include "internal/stl_rw_common.h" +#include "internal/stlb_byte_swap.h" -#include "../internal/byte_codec.h" -#include "../internal/libstl/stl_rw_common.h" -#include "../internal/libstl/stlb_byte_swap.h" +#include "../datax_core/endian.h" +#include "../datax_core/error.h" +#include "../datax_core/internal/byte_codec.h" #include diff --git a/src/support/occ_libstl.cpp b/src/datax_support/occ_libstl.cpp similarity index 96% rename from src/support/occ_libstl.cpp rename to src/datax_support/occ_libstl.cpp index 3d853ba..4eb6828 100644 --- a/src/support/occ_libstl.cpp +++ b/src/datax_support/occ_libstl.cpp @@ -1,4 +1,7 @@ -#include "occ_libstl.h" +#include + +#include +#include #include #include diff --git a/src/support/occ_libstl.h b/src/datax_support/occ_libstl.h similarity index 80% rename from src/support/occ_libstl.h rename to src/datax_support/occ_libstl.h index 5e8f41f..0d864fd 100644 --- a/src/support/occ_libstl.h +++ b/src/datax_support/occ_libstl.h @@ -1,11 +1,10 @@ #ifndef FOUG_SUPPORT_OCC_LIBSTL_H #define FOUG_SUPPORT_OCC_LIBSTL_H -extern "C" { #include "support_global.h" -#include "../libstl/stl_io.h" -} #include +struct foug_stl_geom; +struct foug_stl_geom_creator; class FOUG_LIBSUPPORT_EXPORT foug_OccStlMeshDomain { @@ -24,11 +23,11 @@ private: }; FOUG_LIBSUPPORT_EXPORT -void foug_stl_occmesh_geom(foug_stl_geom_t* geom, +void foug_stl_occmesh_geom(foug_stl_geom* geom, const foug_OccStlMeshDomain& meshCookie); FOUG_LIBSUPPORT_EXPORT -void foug_stl_occmesh_geom_creator(foug_stl_geom_creator_t* creator, +void foug_stl_occmesh_geom_creator(foug_stl_geom_creator* creator, const Handle_StlMesh_Mesh& mesh); #endif /* FOUG_SUPPORT_OCC_LIBSTL_H */ diff --git a/src/support/qt_stream.cpp b/src/datax_support/qt_stream.cpp similarity index 95% rename from src/support/qt_stream.cpp rename to src/datax_support/qt_stream.cpp index dc0ebb0..47ad1dd 100644 --- a/src/support/qt_stream.cpp +++ b/src/datax_support/qt_stream.cpp @@ -1,4 +1,6 @@ -#include "qt_stream.h" +#include + +#include #include #include diff --git a/src/support/qt_stream.h b/src/datax_support/qt_stream.h similarity index 60% rename from src/support/qt_stream.h rename to src/datax_support/qt_stream.h index 5f350ad..7dd87a6 100644 --- a/src/support/qt_stream.h +++ b/src/datax_support/qt_stream.h @@ -1,13 +1,11 @@ #ifndef FOUG_SUPPORT_QT_STREAM_H #define FOUG_SUPPORT_QT_STREAM_H -extern "C" { #include "support_global.h" -#include "../stream.h" -} +struct foug_stream; class QIODevice; FOUG_LIBSUPPORT_EXPORT -void foug_stream_set_qiodevice(foug_stream_t* stream, QIODevice* device); +void foug_stream_set_qiodevice(struct foug_stream* stream, QIODevice* device); #endif /* FOUG_SUPPORT_QT_STREAM_H */ diff --git a/src/support/support_global.h b/src/datax_support/support_global.h similarity index 92% rename from src/support/support_global.h rename to src/datax_support/support_global.h index c180bb3..37378f8 100644 --- a/src/support/support_global.h +++ b/src/datax_support/support_global.h @@ -1,7 +1,7 @@ #ifndef FOUG_C_SUPPORT_GLOBAL_H #define FOUG_C_SUPPORT_GLOBAL_H -#include "../global.h" +#include #ifdef FOUG_LIBSUPPORT_DLL # ifdef FOUG_LIBSUPPORT_MAKE_DLL