diff --git a/benchmarks/benchmark_gmio/main.c b/benchmarks/benchmark_gmio/main.c index 109dfd9..ab87e49 100644 --- a/benchmarks/benchmark_gmio/main.c +++ b/benchmarks/benchmark_gmio/main.c @@ -105,7 +105,7 @@ static void readwrite_begin_solid( * procedure (in gmio_stl_mesh_creator::func_end_solid() callback) */ const enum gmio_endianness byte_order = to_byte_order(rw_conv->out_format); - gmio_stlb_write_header(stream, byte_order, NULL, 0); + gmio_stlb_header_write(stream, byte_order, NULL, 0); } } else { @@ -113,7 +113,7 @@ static void readwrite_begin_solid( stream->func_write(stream->cookie, "solid\n", 1, 6); } else { - gmio_stlb_write_header( + gmio_stlb_header_write( stream, to_byte_order(rw_conv->out_format), infos->stlb_header, @@ -172,7 +172,7 @@ static void readwrite_end_solid(void* cookie) /* The total facet count has to be written because it wasn't known at * the beginning of the read procedure */ stream->func_set_pos(stream->cookie, &rw_conv->out_stream_pos_begin); - gmio_stlb_write_header( + gmio_stlb_header_write( stream, byte_order, NULL, rw_conv->total_triangle_count); } } @@ -191,7 +191,7 @@ static void bmk_gmio_stl_readwrite_conv(const void* filepath) if (infile != NULL) { instream = gmio_stream_stdio(infile); - rw_conv.in_format = gmio_stl_get_format(&instream); + rw_conv.in_format = gmio_stl_format_probe(&instream); } if (outfile != NULL) { rw_conv.stream = gmio_stream_stdio(outfile); diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7a222b0..529f404 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -30,8 +30,8 @@ include_directories(${CMAKE_BINARY_DIR}/src/gmio_core) # For cmake generated hea # Enable DLL generation (export symbols) if(GMIO_BUILD_SHARED_LIBS) - add_definitions(-DGMIO_LIB_DLL - -DGMIO_LIB_MAKE_DLL) + add_definitions(-DGMIO_DLL + -DGMIO_MAKING_DLL) if(MSVC) configure_file(gmio_core/gmio.rc.cmake gmio_core/gmio.rc @ONLY) set(GMIO_SRC_FILES ${GMIO_SRC_FILES} ${CMAKE_BINARY_DIR}/src/gmio_core/gmio.rc) @@ -46,10 +46,10 @@ file(GLOB GMIO_CORE_HEADERS gmio_core/*.h) install(FILES ${GMIO_CORE_HEADERS} DESTINATION include/gmio_core) # Module libSTL -if(GMIO_BUILD_SHARED_LIBS) - add_definitions(-DGMIO_LIBSTL_DLL - -DGMIO_LIBSTL_MAKE_DLL) -endif() +#if(GMIO_BUILD_SHARED_LIBS) +# add_definitions(-DGMIO_STL_DLL +# -DGMIO_STL_MAKING_DLL) +#endif() file(GLOB GMIO_LIBSTL_SRC_FILES gmio_stl/* gmio_stl/internal/*) set(GMIO_SRC_FILES ${GMIO_SRC_FILES} ${GMIO_LIBSTL_SRC_FILES}) diff --git a/src/gmio_core/endian.h b/src/gmio_core/endian.h index 7d7fb6c..276f819 100644 --- a/src/gmio_core/endian.h +++ b/src/gmio_core/endian.h @@ -55,7 +55,7 @@ enum gmio_endianness GMIO_C_LINKAGE_BEGIN /*! Returns endianness (byte order) of the host's CPU architecture */ -GMIO_LIB_EXPORT enum gmio_endianness gmio_host_endianness(); +GMIO_API enum gmio_endianness gmio_host_endianness(); GMIO_C_LINKAGE_END diff --git a/src/gmio_core/global.h b/src/gmio_core/global.h index e2d717f..a107ee3 100644 --- a/src/gmio_core/global.h +++ b/src/gmio_core/global.h @@ -63,17 +63,17 @@ # define GMIO_DECL_IMPORT #endif -/* GMIO_LIB_EXPORT */ -#ifdef GMIO_LIB_DLL -# ifdef GMIO_LIB_MAKE_DLL -# define GMIO_LIB_EXPORT GMIO_DECL_EXPORT +/* GMIO_API */ +#ifdef GMIO_DLL +# ifdef GMIO_MAKING_DLL +# define GMIO_API GMIO_DECL_EXPORT # else -# define GMIO_LIB_EXPORT GMIO_DECL_IMPORT -# endif /* GMIO_LIB_MAKE_DLL */ +# define GMIO_API GMIO_DECL_IMPORT +# endif /* GMIO_MAKING_DLL */ #else /*! Expands either to GMIO_DECL_EXPORT or GMIO_DECL_IMPORT when respectively * compiling/using the DLL */ -# define GMIO_LIB_EXPORT +# define GMIO_API #endif /* Typedefs for specific width integers */ diff --git a/src/gmio_core/memblock.h b/src/gmio_core/memblock.h index 9637b41..ef9b4df 100644 --- a/src/gmio_core/memblock.h +++ b/src/gmio_core/memblock.h @@ -44,32 +44,26 @@ struct gmio_memblock GMIO_C_LINKAGE_BEGIN /*! Returns true if \p mblock is NULL or points to null/void memory */ -GMIO_LIB_EXPORT -bool gmio_memblock_isnull(const struct gmio_memblock* mblock); +GMIO_API bool gmio_memblock_isnull(const struct gmio_memblock* mblock); /*! Returns an initialized gmio_memblock object * * If \p ptr is NULL then gmio_memblock::size is forced to \c 0 */ -GMIO_LIB_EXPORT -struct gmio_memblock gmio_memblock( +GMIO_API struct gmio_memblock gmio_memblock( void* ptr, size_t size, void (*func_deallocate)(void*)); /*! Returns a gmio_memblock object allocated with standard \c malloc() */ -GMIO_LIB_EXPORT -struct gmio_memblock gmio_memblock_malloc(size_t size); +GMIO_API struct gmio_memblock gmio_memblock_malloc(size_t size); /*! Returns a gmio_memblock object allocated with standard \c calloc() */ -GMIO_LIB_EXPORT -struct gmio_memblock gmio_memblock_calloc(size_t num, size_t size); +GMIO_API struct gmio_memblock gmio_memblock_calloc(size_t num, size_t size); /*! Returns a gmio_memblock object allocated with standard \c realloc() */ -GMIO_LIB_EXPORT -struct gmio_memblock gmio_memblock_realloc(void* ptr, size_t size); +GMIO_API struct gmio_memblock gmio_memblock_realloc(void* ptr, size_t size); /*! Safe and convenient call to gmio_memblock::func_deallocate() */ -GMIO_LIB_EXPORT -void gmio_memblock_deallocate(struct gmio_memblock* mblock); +GMIO_API void gmio_memblock_deallocate(struct gmio_memblock* mblock); /*! Typedef for a pointer to a function that creates an allocated mblock * @@ -85,21 +79,18 @@ typedef struct gmio_memblock (*gmio_memblock_constructor_func_t)(); * * This function is not thread-safe. */ -GMIO_LIB_EXPORT -void gmio_memblock_set_default_constructor( +GMIO_API void gmio_memblock_set_default_constructor( gmio_memblock_constructor_func_t ctor); /*! Returns the currently installed function to construct gmio_memblock objects * * It is initialized to gmio_memblock_malloc(128KB) */ -GMIO_LIB_EXPORT -gmio_memblock_constructor_func_t gmio_memblock_default_constructor(); +GMIO_API gmio_memblock_constructor_func_t gmio_memblock_default_constructor(); /*! Returns a gmio_memblock object created using the function * gmio_memblock_default_constructor() */ -GMIO_LIB_EXPORT -struct gmio_memblock gmio_memblock_default(); +GMIO_API struct gmio_memblock gmio_memblock_default(); GMIO_C_LINKAGE_END diff --git a/src/gmio_core/stream.h b/src/gmio_core/stream.h index fbed5b2..425364b 100644 --- a/src/gmio_core/stream.h +++ b/src/gmio_core/stream.h @@ -28,12 +28,25 @@ #include "streampos.h" #include -#ifdef GMIO_HAVE_INT64_TYPE +#ifndef DOXYGEN +# ifdef GMIO_HAVE_INT64_TYPE typedef int64_t gmio_streamsize_t; typedef int64_t gmio_streamoffset_t; -#else +# else typedef long gmio_streamsize_t; typedef long gmio_streamoffset_t; +# endif +#else +/*! Type able to represent the size(in bytes) of a stream + * + * It can be int64_t or long depending on the compiler support + */ +typedef int64_or_long gmio_streamsize_t; +/*! Type able to represent the offset position within a stream + * + * It can be int64_t or long depending on the compiler support + */ +typedef int64_or_long gmio_streamoffset_t; #endif /*! Stream that can get input from an arbitrary data source or can write @@ -126,10 +139,10 @@ GMIO_C_LINKAGE_BEGIN /* Initialization */ /*! Returns a null stream */ -GMIO_LIB_EXPORT struct gmio_stream gmio_stream_null(); +GMIO_API struct gmio_stream gmio_stream_null(); /*! Returns a stream for standard FILE* (cookie will hold \p file) */ -GMIO_LIB_EXPORT struct gmio_stream gmio_stream_stdio(FILE* file); +GMIO_API struct gmio_stream gmio_stream_stdio(FILE* file); GMIO_C_LINKAGE_END diff --git a/src/gmio_core/streampos.h b/src/gmio_core/streampos.h index bdc5a9b..8fe1670 100644 --- a/src/gmio_core/streampos.h +++ b/src/gmio_core/streampos.h @@ -25,7 +25,8 @@ #include "global.h" -/*! Size of the byte array gmio_streampos::cookie */ +/*! \c GMIO_STREAMPOS_COOKIE_SIZE + * Size of the byte array gmio_streampos::cookie */ enum { GMIO_STREAMPOS_COOKIE_SIZE = 32 /* bytes */ }; /*! Specifies a position within a stream diff --git a/src/gmio_core/task_iface.h b/src/gmio_core/task_iface.h index 2050001..0d55b67 100644 --- a/src/gmio_core/task_iface.h +++ b/src/gmio_core/task_iface.h @@ -25,7 +25,7 @@ #include "global.h" -/*! Defines an interface through which any task can be controlled */ +/*! Defines an interface through which a task can be controlled */ struct gmio_task_iface { /*! Optional opaque pointer on a user task object, passed as first diff --git a/src/gmio_stl/internal/stlb_write.c b/src/gmio_stl/internal/stlb_write.c index f31b4be..16b83c3 100644 --- a/src/gmio_stl/internal/stlb_write.c +++ b/src/gmio_stl/internal/stlb_write.c @@ -122,7 +122,7 @@ int gmio_stlb_write( goto label_end; if (!write_triangles_only) { - error = gmio_stlb_write_header(stream, byte_order, header, facet_count); + error = gmio_stlb_header_write(stream, byte_order, header, facet_count); if (gmio_error(error)) goto label_end; } diff --git a/src/gmio_stl/stl_error.h b/src/gmio_stl/stl_error.h index 26d38b6..fdaa753 100644 --- a/src/gmio_stl/stl_error.h +++ b/src/gmio_stl/stl_error.h @@ -23,7 +23,8 @@ #ifndef GMIO_STL_ERROR_H #define GMIO_STL_ERROR_H -/*! A byte-mask to tag(identify) STL-specific error codes */ +/*! \c GMIO_STL_ERROR_TAG + * Byte-mask to tag(identify) STL-specific error codes */ enum { GMIO_STL_ERROR_TAG = 0x11000000 }; /*! This enum defines the various error codes reported by STL read/write diff --git a/src/gmio_stl/stl_format.c b/src/gmio_stl/stl_format.c index ebcf7a6..825f72e 100644 --- a/src/gmio_stl/stl_format.c +++ b/src/gmio_stl/stl_format.c @@ -116,7 +116,7 @@ static bool gmio_is_stl_ascii(const char* buff, size_t buff_len) return false; } -enum gmio_stl_format gmio_stl_get_format(struct gmio_stream *stream) +enum gmio_stl_format gmio_stl_format_probe(struct gmio_stream *stream) { char buff[GMIO_FIXED_BUFFER_SIZE] = {0}; size_t read_size = 0; @@ -155,14 +155,14 @@ enum gmio_stl_format gmio_stl_get_format(struct gmio_stream *stream) return GMIO_STL_FORMAT_UNKNOWN; } -enum gmio_stl_format gmio_stl_get_format_file(const char* filepath) +enum gmio_stl_format gmio_stl_format_probe_file(const char* filepath) { enum gmio_stl_format format = GMIO_STL_FORMAT_UNKNOWN; FILE* file = fopen(filepath, "rb"); if (file != NULL) { struct gmio_stream stream = gmio_stream_stdio(file); - format = gmio_stl_get_format(&stream); + format = gmio_stl_format_probe(&stream); fclose(file); } return format; diff --git a/src/gmio_stl/stl_format.h b/src/gmio_stl/stl_format.h index 9ee869d..755d572 100644 --- a/src/gmio_stl/stl_format.h +++ b/src/gmio_stl/stl_format.h @@ -26,7 +26,8 @@ #include "stl_global.h" #include "../gmio_core/stream.h" -/*! A byte-mask to tag(identify) STL binary formats */ +/*! \c GMIO_STL_FORMAT_TAG_BINARY + * Byte-mask to tag(identify) STL binary formats */ enum { GMIO_STL_FORMAT_TAG_BINARY = 0x10 }; /*! This enums defines the various STL formats */ @@ -53,19 +54,17 @@ GMIO_C_LINKAGE_BEGIN * * \retval GMIO_STL_FORMAT_UNKNOWN in case of error. */ -GMIO_LIBSTL_EXPORT -enum gmio_stl_format gmio_stl_get_format(struct gmio_stream* stream); +GMIO_API enum gmio_stl_format gmio_stl_format_probe(struct gmio_stream* stream); /*! Returns the format of the STL data in file at location \p filepath * - * This function is a wrapper around gmio_stl_get_format() + * This function is a wrapper around gmio_stl_format_probe() * - * \param filepath Path to the STL file. A stream is opened with fopen() so + * \param filepath Path to the STL file. A stream is opened with \c fopen() so * the string shall follow the file name specifications of the running * environment */ -GMIO_LIBSTL_EXPORT -enum gmio_stl_format gmio_stl_get_format_file(const char* filepath); +GMIO_API enum gmio_stl_format gmio_stl_format_probe_file(const char* filepath); GMIO_C_LINKAGE_END diff --git a/src/gmio_stl/stl_global.h b/src/gmio_stl/stl_global.h index 1e4958d..9a9036e 100644 --- a/src/gmio_stl/stl_global.h +++ b/src/gmio_stl/stl_global.h @@ -28,17 +28,5 @@ #include "../gmio_core/global.h" -#ifdef GMIO_LIBSTL_DLL -# ifdef GMIO_LIBSTL_MAKE_DLL -# define GMIO_LIBSTL_EXPORT GMIO_DECL_EXPORT -# else -# define GMIO_LIBSTL_EXPORT GMIO_DECL_IMPORT -# endif /* GMIO_DATAX_LIBSTL_MAKE_DLL */ -#else -/*! Expands either to GMIO_DECL_EXPORT or GMIO_DECL_IMPORT when respectively - * compiling/using the DLL */ -# define GMIO_LIBSTL_EXPORT -#endif /* GMIO_LIBSTL_DLL */ - #endif /* GMIO_STL_GLOBAL_H */ /*! @} */ diff --git a/src/gmio_stl/stl_infos.c b/src/gmio_stl/stl_infos.c index f82b485..576428f 100644 --- a/src/gmio_stl/stl_infos.c +++ b/src/gmio_stl/stl_infos.c @@ -43,7 +43,7 @@ int gmio_stl_infos_get( /* Guess format when left unspecified */ if (format == GMIO_STL_FORMAT_UNKNOWN) { - format = gmio_stl_get_format(stream); + format = gmio_stl_format_probe(stream); if (format == GMIO_STL_FORMAT_UNKNOWN) { error = GMIO_STL_ERROR_UNKNOWN_FORMAT; goto label_end; diff --git a/src/gmio_stl/stl_infos.h b/src/gmio_stl/stl_infos.h index 4e4d7ef..75bcaf3 100644 --- a/src/gmio_stl/stl_infos.h +++ b/src/gmio_stl/stl_infos.h @@ -87,7 +87,7 @@ enum gmio_stl_info_flag GMIO_STL_INFO_FLAG_ALL = 0xFFFF }; -/*! Optional parameters of gmio_stl_infos_get() */ +/*! Options of function gmio_stl_infos_get() */ struct gmio_stl_infos_get_options { /*! See gmio_core_readwrite_options::stream_memblock */ @@ -97,9 +97,9 @@ struct gmio_stl_infos_get_options * automatically guessed */ enum gmio_stl_format format_hint; - /*! Restrict gmio_stl_infos_get() to not read further this limit + /*! Restrict gmio_stl_infos_get() to not read further this limit(in bytes) * - * Not yet supported + * \warning Not yet supported */ gmio_streamsize_t size_limit; }; @@ -107,22 +107,30 @@ struct gmio_stl_infos_get_options GMIO_C_LINKAGE_BEGIN /*! Finds informations about STL contents + * + * \p infos is an output parameter that will hold the retrieved infos + * + * \p flags is a bitor combination of \c gmio_stl_info_flag values and is used + * to select the infos to retrieve. * * \return Error code (see gmio_core/error.h and stl_error.h) */ -GMIO_LIBSTL_EXPORT -int gmio_stl_infos_get( +GMIO_API int gmio_stl_infos_get( struct gmio_stl_infos* infos, struct gmio_stream* stream, - unsigned flags, /*!< Bitor combination of gmio_stl_info_flag values */ + unsigned flags, const struct gmio_stl_infos_get_options* options); -/*! Returns the size(in bytes) of next STL ascii solid in \p stream +/*! Returns the size(in bytes) of the next STL ascii solid in \p stream * * It is a facade over gmio_stl_infos_get() for gmio_stl_infos::size only + * + * Pointer to this function can be given to + * gmio_stl_read_options::func_stla_get_streamsize() and is useful when + * reading in sequence multi solids in STL ascii. The stream can be cleanly + * advanced solid by solid after each call to gmio_stl_read() */ -GMIO_LIBSTL_EXPORT -gmio_streamsize_t gmio_stla_infos_get_streamsize( +GMIO_API gmio_streamsize_t gmio_stla_infos_get_streamsize( struct gmio_stream* stream, struct gmio_memblock* stream_memblock); diff --git a/src/gmio_stl/stl_io.c b/src/gmio_stl/stl_io.c index 72871de..548807b 100644 --- a/src/gmio_stl/stl_io.c +++ b/src/gmio_stl/stl_io.c @@ -28,7 +28,7 @@ int gmio_stl_read( struct gmio_stl_mesh_creator* mesh_creator, const struct gmio_stl_read_options* options) { - const enum gmio_stl_format format = gmio_stl_get_format(stream); + const enum gmio_stl_format format = gmio_stl_format_probe(stream); switch (format) { case GMIO_STL_FORMAT_ASCII: return gmio_stla_read(stream, mesh_creator, options); @@ -96,7 +96,7 @@ int gmio_stl_write_file( static const struct gmio_stlb_header internal_stlb_zero_header = {0}; -int gmio_stlb_write_header( +int gmio_stlb_header_write( struct gmio_stream *stream, enum gmio_endianness byte_order, const struct gmio_stlb_header *header, diff --git a/src/gmio_stl/stl_io.h b/src/gmio_stl/stl_io.h index 335af20..94a6038 100644 --- a/src/gmio_stl/stl_io.h +++ b/src/gmio_stl/stl_io.h @@ -38,8 +38,7 @@ GMIO_C_LINKAGE_BEGIN * * \return Error code (see gmio_core/error.h and stl_error.h) */ -GMIO_LIBSTL_EXPORT -int gmio_stl_read( +GMIO_API int gmio_stl_read( struct gmio_stream* stream, struct gmio_stl_mesh_creator* mesh_creator, const struct gmio_stl_read_options* options); @@ -49,33 +48,30 @@ int gmio_stl_read( * This is just a facility function over gmio_stl_read(). The internal stream * object is created to read file at \p filepath (see gmio_stream_stdio(FILE*)) * - * The file is opened with fopen() so \p filepath shall follow the file name + * The file is opened with \c fopen() so \p filepath shall follow the file name * specifications of the running environment */ -GMIO_LIBSTL_EXPORT -int gmio_stl_read_file( +GMIO_API int gmio_stl_read_file( const char* filepath, struct gmio_stl_mesh_creator* mesh_creator, const struct gmio_stl_read_options* options); -/*! Reads geometry from STL ascii stream +/*! Reads mesh from STL ascii stream * * \return Error code (see gmio_core/error.h and stl_error.h) */ -GMIO_LIBSTL_EXPORT -int gmio_stla_read( +GMIO_API int gmio_stla_read( struct gmio_stream* stream, struct gmio_stl_mesh_creator* mesh_creator, const struct gmio_stl_read_options* options); -/*! Reads geometry from STL binary stream +/*! Reads mesh from STL binary stream * * \return Error code (see gmio_core/error.h and stl_error.h) * \retval GMIO_ERROR_INVALID_MEMBLOCK_SIZE * if options->stream_memblock.size < GMIO_STLB_MIN_CONTENTS_SIZE */ -GMIO_LIBSTL_EXPORT -int gmio_stlb_read( +GMIO_API int gmio_stlb_read( struct gmio_stream* stream, struct gmio_stl_mesh_creator* mesh_creator, enum gmio_endianness byte_order, @@ -85,8 +81,7 @@ int gmio_stlb_read( * * \return Error code (see gmio_core/error.h and stl_error.h) */ -GMIO_LIBSTL_EXPORT -int gmio_stl_write( +GMIO_API int gmio_stl_write( enum gmio_stl_format format, struct gmio_stream* stream, const struct gmio_stl_mesh* mesh, @@ -97,13 +92,12 @@ int gmio_stl_write( * This is just a facility function over gmio_stl_write(). The internal stream * object is created to read file at \p filepath (see gmio_stream_stdio(FILE*)) * - * The file is opened with fopen() so \p filepath shall follow the file name + * The file is opened with \c fopen() so \p filepath shall follow the file name * specifications of the running environment * \return Error code (see gmio_core/error.h and stl_error.h) */ -GMIO_LIBSTL_EXPORT -int gmio_stl_write_file( +GMIO_API int gmio_stl_write_file( enum gmio_stl_format format, const char* filepath, const struct gmio_stl_mesh* mesh, @@ -114,21 +108,14 @@ int gmio_stl_write_file( * This functions only writes the 80-bytes header array and the count of facets * in the mesh(with respect of the specified byte order). * + * \p header Can be safely set to \c NULL to generate an array of zeroes + * * \return Error code (see error.h and stl_error.h) */ -GMIO_LIBSTL_EXPORT -int gmio_stlb_write_header( - /*! Output stream where is written the header data */ +GMIO_API int gmio_stlb_header_write( struct gmio_stream* stream, - - /*! Byte order of the output STL data */ enum gmio_endianness byte_order, - - /*! 80-bytes array of header data, can be safely set to NULL to generate - * an array of zeroes */ const struct gmio_stlb_header* header, - - /*! Total count of facets (triangles) in the mesh to be written */ uint32_t facet_count ); diff --git a/src/gmio_stl/stl_io_options.h b/src/gmio_stl/stl_io_options.h index c4cd29d..639a8ae 100644 --- a/src/gmio_stl/stl_io_options.h +++ b/src/gmio_stl/stl_io_options.h @@ -30,6 +30,7 @@ #include "../gmio_core/task_iface.h" #include "../gmio_core/text_format.h" +/*! Options of function gmio_stl_read() */ struct gmio_stl_read_options { /*! Used by the stream to bufferize I/O operations @@ -50,13 +51,15 @@ struct gmio_stl_read_options * * The resulting stream size is passed to * gmio_task_iface::func_handle_progress() as the \p max_value argument. + * + * \sa gmio_stla_infos_get_streamsize() */ gmio_streamsize_t (*func_stla_get_streamsize)( struct gmio_stream* stream, struct gmio_memblock* stream_memblock); }; -/*! Options for gmio_stl_write() */ +/*! Options of function gmio_stl_write() */ struct gmio_stl_write_options { /*! See gmio_stl_read_options::stream_memblock */ diff --git a/src/gmio_stl/stl_mesh_creator.h b/src/gmio_stl/stl_mesh_creator.h index 16733ec..0d4c74d 100644 --- a/src/gmio_stl/stl_mesh_creator.h +++ b/src/gmio_stl/stl_mesh_creator.h @@ -32,7 +32,7 @@ #include /*! Informations about the STL stream, used in - * gmio_stl_mesh_creator::begin_solid() */ + * gmio_stl_mesh_creator::func_begin_solid() */ struct gmio_stl_mesh_creator_infos { /*! Format of the input STL mesh */ diff --git a/src/gmio_stl/stl_triangle.h b/src/gmio_stl/stl_triangle.h index 90a7617..5dea380 100644 --- a/src/gmio_stl/stl_triangle.h +++ b/src/gmio_stl/stl_triangle.h @@ -39,8 +39,7 @@ struct gmio_stl_triangle GMIO_C_LINKAGE_BEGIN /*! Computes the normal vector of triangle \p tri */ -GMIO_LIBSTL_EXPORT -void gmio_stl_triangle_compute_normal(struct gmio_stl_triangle* tri); +GMIO_API void gmio_stl_triangle_compute_normal(struct gmio_stl_triangle* tri); GMIO_C_LINKAGE_END diff --git a/src/gmio_stl/stlb_header.h b/src/gmio_stl/stlb_header.h index ee3cc3d..6f1737d 100644 --- a/src/gmio_stl/stlb_header.h +++ b/src/gmio_stl/stlb_header.h @@ -41,8 +41,7 @@ GMIO_C_LINKAGE_BEGIN * If the length of \p str is less than \c GMIO_STLB_HEADER_SIZE then the * remaining bytes are filled with zeroes. */ -GMIO_LIBSTL_EXPORT -struct gmio_stlb_header gmio_stlb_header_str(const char* str); +GMIO_API struct gmio_stlb_header gmio_stlb_header_str(const char* str); /*! Copies \p header into C string \p str * @@ -50,8 +49,7 @@ struct gmio_stlb_header gmio_stlb_header_str(const char* str); * \p str must be at least \c GMIO_STLB_HEADER_SIZE+1 long, a terminating null * character ('\0') is copied at position \c GMIO_STLB_HEADER_SIZE */ -GMIO_LIBSTL_EXPORT -void gmio_stlb_header_to_printable_str( +GMIO_API void gmio_stlb_header_to_printable_str( const struct gmio_stlb_header* header, char* str, char replacement); GMIO_C_LINKAGE_END diff --git a/src/gmio_support/stl_occ.h b/src/gmio_support/stl_occ.h index d3a93ac..cccc9e7 100644 --- a/src/gmio_support/stl_occ.h +++ b/src/gmio_support/stl_occ.h @@ -45,7 +45,7 @@ class TColgp_SequenceOfXYZ; * * You don't have to use API of this class, it's intended to gmio_stl_mesh() */ -struct GMIO_LIBSUPPORT_EXPORT gmio_stl_occmesh_iterator +struct gmio_stl_occmesh_iterator { gmio_stl_occmesh_iterator(); explicit gmio_stl_occmesh_iterator(const StlMesh_Mesh* mesh); @@ -81,7 +81,6 @@ private: * gmio_stl_write_file(stl_format, filepath, &mesh, &options); * \endcode */ -GMIO_LIBSUPPORT_EXPORT gmio_stl_mesh gmio_stl_occmesh(const gmio_stl_occmesh_iterator& it); /*! Returns a gmio_stl_mesh_creator that will build a new domain in a @@ -89,7 +88,6 @@ gmio_stl_mesh gmio_stl_occmesh(const gmio_stl_occmesh_iterator& it); * * The creator's cookie will point \p mesh */ -GMIO_LIBSUPPORT_EXPORT gmio_stl_mesh_creator gmio_stl_occmesh_creator(StlMesh_Mesh* mesh); /*! Same as gmio_stl_occmesh_creator(StlMesh_Mesh*) but takes a handle @@ -97,7 +95,6 @@ gmio_stl_mesh_creator gmio_stl_occmesh_creator(StlMesh_Mesh* mesh); * The creator's cookie will point to the internal data(ie StlMesh_Mesh*) of * handle \p hnd */ -GMIO_LIBSUPPORT_EXPORT gmio_stl_mesh_creator gmio_stl_occmesh_creator(const Handle_StlMesh_Mesh& hnd); diff --git a/src/gmio_support/stream_qt.h b/src/gmio_support/stream_qt.h index 71c409f..37da384 100644 --- a/src/gmio_support/stream_qt.h +++ b/src/gmio_support/stream_qt.h @@ -36,7 +36,6 @@ class QIODevice; QT_END_NAMESPACE /*! Returns a gmio_stream for \c QIODevice* (cookie will hold \p device) */ -GMIO_LIBSUPPORT_EXPORT struct gmio_stream gmio_stream_qiodevice( #ifndef DOXYGEN QT_PREPEND_NAMESPACE(QIODevice)* device diff --git a/src/gmio_support/support_global.h b/src/gmio_support/support_global.h index 1485845..b1f8846 100644 --- a/src/gmio_support/support_global.h +++ b/src/gmio_support/support_global.h @@ -28,15 +28,5 @@ #include "../gmio_core/global.h" -#ifdef GMIO_LIBSUPPORT_DLL -# ifdef GMIO_LIBSUPPORT_MAKE_DLL -# define GMIO_LIBSUPPORT_EXPORT GMIO_DECL_EXPORT -# else -# define GMIO_LIBSUPPORT_EXPORT GMIO_DECL_IMPORT -# endif /* GMIO_LIBSUPPORT_MAKE_DLL */ -#else -# define GMIO_LIBSUPPORT_EXPORT -#endif /* GMIO_LIBSUPPORT_DLL */ - #endif /* GMIO_SUPPORT_GLOBAL_H */ /*! @} */ diff --git a/tests/main_test_stl.c b/tests/main_test_stl.c index 8b939a1..5a3c4b1 100644 --- a/tests/main_test_stl.c +++ b/tests/main_test_stl.c @@ -30,7 +30,7 @@ const char* test_stl_read_multi_solid(); const char* test_stla_write(); const char* test_stlb_read(); const char* test_stlb_write(); -const char* test_stlb_write_header(); +const char* test_stlb_header_write(); const char* test_stlb_header_str(); const char* test_stlb_header_to_printable_str(); @@ -63,7 +63,7 @@ const char* all_tests() UTEST_RUN(test_stla_write); UTEST_RUN(test_stlb_read); UTEST_RUN(test_stlb_write); - UTEST_RUN(test_stlb_write_header); + UTEST_RUN(test_stlb_header_write); UTEST_RUN(test_stlb_header_str); UTEST_RUN(test_stlb_header_to_printable_str); diff --git a/tests/test_stl_io.c b/tests/test_stl_io.c index 887ed01..f5e27a0 100644 --- a/tests/test_stl_io.c +++ b/tests/test_stl_io.c @@ -64,7 +64,7 @@ const char* test_stl_read() while (testcase != stl_read_testcases_ptr_end()) { const enum gmio_stl_format format = - gmio_stl_get_format_file(testcase->filepath); + gmio_stl_format_probe_file(testcase->filepath); const int err = gmio_stl_read_file(testcase->filepath, &mesh_creator, NULL); @@ -128,7 +128,7 @@ const char* test_stlb_read() return NULL; } -const char* test_stlb_write_header() +const char* test_stlb_header_write() { const char* filepath = "temp/solid.stlb"; struct gmio_stlb_header header = {0}; @@ -141,7 +141,7 @@ const char* test_stlb_write_header() memcpy(&header, header_str, GMIO_MIN(GMIO_STLB_HEADER_SIZE, strlen(header_str))); - error = gmio_stlb_write_header( + error = gmio_stlb_header_write( &stream, GMIO_ENDIANNESS_LITTLE, &header, 0); fclose(outfile); UTEST_COMPARE_INT(GMIO_ERROR_OK, error); @@ -346,7 +346,7 @@ void generate_stlb_tests_models() { FILE* outfile = fopen(filepath_stlb_empty, "wb"); struct gmio_stream stream = gmio_stream_stdio(outfile); - gmio_stlb_write_header(&stream, GMIO_ENDIANNESS_LITTLE, NULL, 0); + gmio_stlb_header_write(&stream, GMIO_ENDIANNESS_LITTLE, NULL, 0); fclose(outfile); } @@ -400,7 +400,7 @@ void generate_stlb_tests_models() FILE* outfile = fopen(filepath_stlb_header_nofacets, "wb"); struct gmio_stream ostream = gmio_stream_stdio(outfile); const struct gmio_stlb_header header = {0}; - gmio_stlb_write_header(&ostream, GMIO_ENDIANNESS_LITTLE, &header, 100); + gmio_stlb_header_write(&ostream, GMIO_ENDIANNESS_LITTLE, &header, 100); fclose(outfile); } }