Rename pointer on functions members
xxx_func -> func_xxx
This commit is contained in:
parent
b10da55577
commit
13b1d32a9a
@ -24,12 +24,12 @@ GMIO_INLINE gmio_buffer_t gmio_buffer_null()
|
||||
}
|
||||
|
||||
gmio_buffer_t gmio_buffer(
|
||||
void* ptr, size_t size, void (*deallocate_func)(void*))
|
||||
void* ptr, size_t size, void (*func_deallocate)(void*))
|
||||
{
|
||||
gmio_buffer_t buff;
|
||||
buff.ptr = ptr;
|
||||
buff.size = ptr != NULL ? size : 0;
|
||||
buff.deallocate_func = deallocate_func;
|
||||
buff.func_deallocate = func_deallocate;
|
||||
return buff;
|
||||
}
|
||||
|
||||
@ -50,8 +50,8 @@ gmio_buffer_t gmio_buffer_realloc(void* ptr, size_t size)
|
||||
|
||||
void gmio_buffer_deallocate(gmio_buffer_t *buffer)
|
||||
{
|
||||
if (buffer != NULL && buffer->deallocate_func != NULL)
|
||||
buffer->deallocate_func(buffer->ptr);
|
||||
if (buffer != NULL && buffer->func_deallocate != NULL)
|
||||
buffer->func_deallocate(buffer->ptr);
|
||||
}
|
||||
|
||||
static gmio_buffer_t gmio_buffer_default_internal_ctor()
|
||||
|
@ -35,7 +35,7 @@ struct gmio_buffer
|
||||
|
||||
/*! Optional pointer on a function that deallocates the memory block
|
||||
* beginning at \p ptr */
|
||||
void (*deallocate_func)(void* ptr);
|
||||
void (*func_deallocate)(void* ptr);
|
||||
};
|
||||
typedef struct gmio_buffer gmio_buffer_t;
|
||||
|
||||
@ -46,7 +46,7 @@ GMIO_C_LINKAGE_BEGIN
|
||||
* If \p ptr is NULL then gmio_buffer::size is forced to \c 0
|
||||
*/
|
||||
GMIO_LIB_EXPORT gmio_buffer_t gmio_buffer(
|
||||
void* ptr, size_t size, void (*deallocate_func)(void*));
|
||||
void* ptr, size_t size, void (*func_deallocate)(void*));
|
||||
|
||||
/*! Returns a gmio_buffer object allocated with standard \c malloc() */
|
||||
GMIO_LIB_EXPORT gmio_buffer_t gmio_buffer_malloc(size_t size);
|
||||
@ -57,7 +57,7 @@ GMIO_LIB_EXPORT gmio_buffer_t gmio_buffer_calloc(size_t num, size_t size);
|
||||
/*! Returns a gmio_buffer object allocated with standard \c realloc() */
|
||||
GMIO_LIB_EXPORT gmio_buffer_t gmio_buffer_realloc(void* ptr, size_t size);
|
||||
|
||||
/*! Safe and convenient call to gmio_buffer::deallocate_func() */
|
||||
/*! Safe and convenient call to gmio_buffer::func_deallocate() */
|
||||
GMIO_LIB_EXPORT void gmio_buffer_deallocate(gmio_buffer_t* buffer);
|
||||
|
||||
/*! Typedef for a pointer to a function that creates an allocated buffer
|
||||
|
@ -41,7 +41,7 @@ enum gmio_error
|
||||
GMIO_ERROR_STREAM,
|
||||
|
||||
/*! Transfer was stopped by user, that is to say
|
||||
* gmio_transfer::is_stop_requested_func() returned GMIO_TRUE */
|
||||
* gmio_transfer::func_is_stop_requested() returned GMIO_TRUE */
|
||||
GMIO_ERROR_TRANSFER_STOPPED,
|
||||
|
||||
/*! An error occured after a call to a <stdio.h> function
|
||||
|
@ -18,53 +18,53 @@
|
||||
|
||||
#include "../stream.h"
|
||||
|
||||
/*! Safe and convenient function for gmio_stream::at_end_func() */
|
||||
/*! Safe and convenient function for gmio_stream::func_at_end() */
|
||||
GMIO_INLINE gmio_bool_t gmio_stream_at_end(gmio_stream_t* stream)
|
||||
{
|
||||
if (stream != NULL && stream->at_end_func != NULL)
|
||||
return stream->at_end_func(stream->cookie);
|
||||
if (stream != NULL && stream->func_at_end != NULL)
|
||||
return stream->func_at_end(stream->cookie);
|
||||
return GMIO_FALSE;
|
||||
}
|
||||
|
||||
/*! Safe and convenient function for gmio_stream::error_func() */
|
||||
/*! Safe and convenient function for gmio_stream::func_error() */
|
||||
GMIO_INLINE int gmio_stream_error(gmio_stream_t* stream)
|
||||
{
|
||||
if (stream != NULL && stream->error_func != NULL)
|
||||
return stream->error_func(stream->cookie);
|
||||
if (stream != NULL && stream->func_error != NULL)
|
||||
return stream->func_error(stream->cookie);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*! Safe and convenient function for gmio_stream::read_func() */
|
||||
/*! Safe and convenient function for gmio_stream::func_read() */
|
||||
GMIO_INLINE size_t gmio_stream_read(
|
||||
gmio_stream_t* stream, void *ptr, size_t size, size_t count)
|
||||
{
|
||||
if (stream != NULL && stream->read_func != NULL)
|
||||
return stream->read_func(stream->cookie, ptr, size, count);
|
||||
if (stream != NULL && stream->func_read != NULL)
|
||||
return stream->func_read(stream->cookie, ptr, size, count);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*! Safe and convenient function for gmio_stream::write_func() */
|
||||
/*! Safe and convenient function for gmio_stream::func_write() */
|
||||
GMIO_INLINE size_t gmio_stream_write(
|
||||
gmio_stream_t* stream, const void *ptr, size_t size, size_t count)
|
||||
{
|
||||
if (stream != NULL && stream->write_func != NULL)
|
||||
return stream->write_func(stream->cookie, ptr, size, count);
|
||||
if (stream != NULL && stream->func_write != NULL)
|
||||
return stream->func_write(stream->cookie, ptr, size, count);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*! Safe and convenient function for gmio_stream::size_func() */
|
||||
/*! Safe and convenient function for gmio_stream::func_size() */
|
||||
GMIO_INLINE size_t gmio_stream_size(gmio_stream_t* stream)
|
||||
{
|
||||
if (stream != NULL && stream->size_func != NULL)
|
||||
return stream->size_func(stream->cookie);
|
||||
if (stream != NULL && stream->func_size != NULL)
|
||||
return stream->func_size(stream->cookie);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*! Safe and convenient function for gmio_stream::rewind_func() */
|
||||
/*! Safe and convenient function for gmio_stream::func_rewind() */
|
||||
GMIO_INLINE void gmio_stream_rewind(gmio_stream_t* stream)
|
||||
{
|
||||
if (stream != NULL && stream->rewind_func != NULL)
|
||||
stream->rewind_func(stream->cookie);
|
||||
if (stream != NULL && stream->func_rewind != NULL)
|
||||
stream->func_rewind(stream->cookie);
|
||||
}
|
||||
|
||||
#endif /* GMIO_INTERNAL_HELPER_STREAM_H */
|
||||
|
@ -20,21 +20,21 @@
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
/*! Safe and convenient function for gmio_task_iface::is_stop_requested_func() */
|
||||
/*! Safe and convenient function for gmio_task_iface::func_is_stop_requested() */
|
||||
GMIO_INLINE gmio_bool_t gmio_task_iface_is_stop_requested(
|
||||
const gmio_task_iface_t* itask)
|
||||
{
|
||||
if (itask != NULL && itask->is_stop_requested_func != NULL)
|
||||
return itask->is_stop_requested_func(itask->cookie);
|
||||
if (itask != NULL && itask->func_is_stop_requested != NULL)
|
||||
return itask->func_is_stop_requested(itask->cookie);
|
||||
return GMIO_FALSE;
|
||||
}
|
||||
|
||||
/*! Safe and convenient function for gmio_task_iface::handle_progress_func() */
|
||||
/*! Safe and convenient function for gmio_task_iface::func_handle_progress() */
|
||||
GMIO_INLINE void gmio_task_iface_handle_progress(
|
||||
const gmio_task_iface_t* itask, size_t value, size_t max_value)
|
||||
{
|
||||
if (itask != NULL && itask->handle_progress_func != NULL)
|
||||
itask->handle_progress_func(itask->cookie, value, max_value);
|
||||
if (itask != NULL && itask->func_handle_progress != NULL)
|
||||
itask->func_handle_progress(itask->cookie, value, max_value);
|
||||
}
|
||||
|
||||
#endif /* GMIO_INTERNAL_HELPER_TASK_IFACE_H */
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "../transfer.h"
|
||||
#include "helper_task_iface.h"
|
||||
|
||||
/*! Safe and convenient function for gmio_task_iface::is_stop_requested_func()
|
||||
/*! Safe and convenient function for gmio_task_iface::func_is_stop_requested()
|
||||
* through gmio_transfer::task_iface
|
||||
*/
|
||||
GMIO_INLINE gmio_bool_t gmio_transfer_is_stop_requested(
|
||||
@ -30,7 +30,7 @@ GMIO_INLINE gmio_bool_t gmio_transfer_is_stop_requested(
|
||||
return GMIO_FALSE;
|
||||
}
|
||||
|
||||
/*! Safe and convenient function for gmio_task_iface::handle_progress_func()
|
||||
/*! Safe and convenient function for gmio_task_iface::func_handle_progress()
|
||||
* through gmio_transfer::task_iface
|
||||
*/
|
||||
GMIO_INLINE void gmio_transfer_handle_progress(
|
||||
|
@ -138,11 +138,11 @@ gmio_stream_t gmio_stream_stdio(FILE* file)
|
||||
{
|
||||
gmio_stream_t stream = { 0 };
|
||||
stream.cookie = file;
|
||||
stream.at_end_func = gmio_stream_stdio_at_end;
|
||||
stream.error_func = gmio_stream_stdio_error;
|
||||
stream.read_func = gmio_stream_stdio_read;
|
||||
stream.write_func = gmio_stream_stdio_write;
|
||||
stream.size_func = gmio_stream_stdio_size;
|
||||
stream.rewind_func = gmio_stream_stdio_rewind;
|
||||
stream.func_at_end = gmio_stream_stdio_at_end;
|
||||
stream.func_error = gmio_stream_stdio_error;
|
||||
stream.func_read = gmio_stream_stdio_read;
|
||||
stream.func_write = gmio_stream_stdio_write;
|
||||
stream.func_size = gmio_stream_stdio_size;
|
||||
stream.func_rewind = gmio_stream_stdio_rewind;
|
||||
return stream;
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ struct gmio_stream
|
||||
* The function should behaves like C standard [feof()]
|
||||
* (http://pubs.opengroup.org/onlinepubs/007904975/functions/feof.html)
|
||||
*/
|
||||
gmio_bool_t (*at_end_func)(void* cookie);
|
||||
gmio_bool_t (*func_at_end)(void* cookie);
|
||||
|
||||
/*! Pointer on a function that checks error indicator
|
||||
*
|
||||
@ -60,7 +60,7 @@ struct gmio_stream
|
||||
* The function should behaves like C standard [ferror()]
|
||||
* (http://pubs.opengroup.org/onlinepubs/007904975/functions/ferror.html)
|
||||
*/
|
||||
int (*error_func)(void* cookie);
|
||||
int (*func_error)(void* cookie);
|
||||
|
||||
/*! Pointer on a function that reads block of data from stream
|
||||
*
|
||||
@ -73,7 +73,7 @@ struct gmio_stream
|
||||
*
|
||||
* \returns The total number of elements successfully read
|
||||
*/
|
||||
size_t (*read_func)(void* cookie, void* ptr, size_t size, size_t count);
|
||||
size_t (*func_read)(void* cookie, void* ptr, size_t size, size_t count);
|
||||
|
||||
/*! Pointer on a function that writes block of data to stream
|
||||
*
|
||||
@ -86,10 +86,10 @@ struct gmio_stream
|
||||
*
|
||||
* \returns The total number of elements successfully written
|
||||
*/
|
||||
size_t (*write_func)(void* cookie, const void* ptr, size_t size, size_t count);
|
||||
size_t (*func_write)(void* cookie, const void* ptr, size_t size, size_t count);
|
||||
|
||||
/*! Pointer on a function that returns the size(in bytes) of the stream */
|
||||
size_t (*size_func)(void* cookie);
|
||||
size_t (*func_size)(void* cookie);
|
||||
|
||||
/*! Pointer on a function that moves the position indicator within the
|
||||
* stream to the beginning
|
||||
@ -97,7 +97,7 @@ struct gmio_stream
|
||||
* The function should behaves like C standard [rewind()]
|
||||
* (http://pubs.opengroup.org/onlinepubs/007904975/functions/rewind.html)
|
||||
*/
|
||||
void (*rewind_func)(void* cookie);
|
||||
void (*func_rewind)(void* cookie);
|
||||
};
|
||||
|
||||
typedef struct gmio_stream gmio_stream_t;
|
||||
|
@ -35,7 +35,7 @@ struct gmio_task_iface
|
||||
* If \c GMIO_TRUE is returned then the current task should abort as
|
||||
* soon as possible, otherwise it can continue execution.
|
||||
*/
|
||||
gmio_bool_t (*is_stop_requested_func)(void* cookie);
|
||||
gmio_bool_t (*func_is_stop_requested)(void* cookie);
|
||||
|
||||
/*! Optional pointer on a function that is called anytime some new progress
|
||||
* was done
|
||||
@ -44,7 +44,7 @@ struct gmio_task_iface
|
||||
* \param value Current value of the task progress (<= \p max_value )
|
||||
* \param max_value Maximum value of the task progress
|
||||
*/
|
||||
void (*handle_progress_func)(void* cookie, size_t value, size_t max_value);
|
||||
void (*func_handle_progress)(void* cookie, size_t value, size_t max_value);
|
||||
};
|
||||
|
||||
typedef struct gmio_task_iface gmio_task_iface_t;
|
||||
|
@ -19,47 +19,47 @@
|
||||
#include "../stl_mesh_creator.h"
|
||||
|
||||
/*! Safe and convenient function for
|
||||
* gmio_stl_mesh_creator::ascii_begin_solid_func() */
|
||||
* gmio_stl_mesh_creator::func_ascii_begin_solid() */
|
||||
GMIO_INLINE void gmio_stl_mesh_creator_ascii_begin_solid(
|
||||
gmio_stl_mesh_creator_t* creator,
|
||||
size_t stream_size,
|
||||
const char* solid_name)
|
||||
{
|
||||
if (creator != NULL && creator->ascii_begin_solid_func != NULL) {
|
||||
creator->ascii_begin_solid_func(
|
||||
if (creator != NULL && creator->func_ascii_begin_solid != NULL) {
|
||||
creator->func_ascii_begin_solid(
|
||||
creator->cookie, stream_size, solid_name);
|
||||
}
|
||||
}
|
||||
|
||||
/*! Safe and convenient function for
|
||||
* gmio_stl_mesh_creator::binary_begin_solid_func() */
|
||||
* gmio_stl_mesh_creator::func_binary_begin_solid() */
|
||||
GMIO_INLINE void gmio_stl_mesh_creator_binary_begin_solid(
|
||||
gmio_stl_mesh_creator_t* creator,
|
||||
uint32_t tri_count,
|
||||
const gmio_stlb_header_t* header)
|
||||
{
|
||||
if (creator != NULL && creator->binary_begin_solid_func != NULL)
|
||||
creator->binary_begin_solid_func(creator->cookie, tri_count, header);
|
||||
if (creator != NULL && creator->func_binary_begin_solid != NULL)
|
||||
creator->func_binary_begin_solid(creator->cookie, tri_count, header);
|
||||
}
|
||||
|
||||
/*! Safe and convenient function for
|
||||
* gmio_stl_mesh_creator::add_triangle_func() */
|
||||
* gmio_stl_mesh_creator::func_add_triangle() */
|
||||
GMIO_INLINE void gmio_stl_mesh_creator_add_triangle(
|
||||
gmio_stl_mesh_creator_t* creator,
|
||||
uint32_t tri_id,
|
||||
const gmio_stl_triangle_t* triangle)
|
||||
{
|
||||
if (creator != NULL && creator->add_triangle_func != NULL)
|
||||
creator->add_triangle_func(creator->cookie, tri_id, triangle);
|
||||
if (creator != NULL && creator->func_add_triangle != NULL)
|
||||
creator->func_add_triangle(creator->cookie, tri_id, triangle);
|
||||
}
|
||||
|
||||
/*! Safe and convenient function for
|
||||
* gmio_stl_mesh_creator::end_solid_func() */
|
||||
* gmio_stl_mesh_creator::func_end_solid() */
|
||||
GMIO_INLINE void gmio_stl_mesh_creator_end_solid(
|
||||
gmio_stl_mesh_creator_t* creator)
|
||||
{
|
||||
if (creator != NULL && creator->end_solid_func != NULL)
|
||||
creator->end_solid_func(creator->cookie);
|
||||
if (creator != NULL && creator->func_end_solid != NULL)
|
||||
creator->func_end_solid(creator->cookie);
|
||||
}
|
||||
|
||||
#endif /* GMIO_INTERNAL_HELPER_STL_MESH_CREATOR_H */
|
||||
|
@ -37,7 +37,7 @@ gmio_bool_t gmio_check_transfer(int *error, const gmio_transfer_t* trsf)
|
||||
gmio_bool_t gmio_stl_check_mesh(int *error, const gmio_stl_mesh_t* mesh)
|
||||
{
|
||||
if (mesh == NULL
|
||||
|| (mesh->triangle_count > 0 && mesh->get_triangle_func == NULL))
|
||||
|| (mesh->triangle_count > 0 && mesh->func_get_triangle == NULL))
|
||||
{
|
||||
*error = GMIO_STL_ERROR_NULL_GET_TRIANGLE_FUNC;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ struct gmio_stlb_readwrite_helper
|
||||
{
|
||||
uint32_t facet_count;
|
||||
uint32_t i_facet_offset;
|
||||
void (*fix_endian_func)(gmio_stl_triangle_t* tri);
|
||||
void (*func_fix_endian)(gmio_stl_triangle_t* tri);
|
||||
};
|
||||
typedef struct gmio_stlb_readwrite_helper gmio_stlb_readwrite_helper_t;
|
||||
|
||||
|
@ -203,7 +203,7 @@ int gmio_stla_write(
|
||||
ibuffer_facet < clamped_facet_count;
|
||||
++ibuffer_facet)
|
||||
{
|
||||
mesh->get_triangle_func(mesh->cookie, ibuffer_facet, &tri);
|
||||
mesh->func_get_triangle(mesh->cookie, ibuffer_facet, &tri);
|
||||
buffc = gmio_write_string(buffc, "facet normal ");
|
||||
buffc = gmio_write_coords(buffc, coords_format, &tri.normal);
|
||||
buffc = gmio_write_eol(buffc);
|
||||
|
@ -46,7 +46,7 @@ static void gmio_stlb_write_facets(
|
||||
uint32_t buffer_offset = 0;
|
||||
uint32_t i_facet = 0;
|
||||
|
||||
if (mesh == NULL || mesh->get_triangle_func == NULL)
|
||||
if (mesh == NULL || mesh->func_get_triangle == NULL)
|
||||
return;
|
||||
|
||||
triangle.attribute_byte_count = 0;
|
||||
@ -54,10 +54,10 @@ static void gmio_stlb_write_facets(
|
||||
i_facet < (i_facet_offset + facet_count);
|
||||
++i_facet)
|
||||
{
|
||||
mesh->get_triangle_func(mesh->cookie, i_facet, &triangle);
|
||||
mesh->func_get_triangle(mesh->cookie, i_facet, &triangle);
|
||||
|
||||
if (wparams->fix_endian_func != NULL)
|
||||
wparams->fix_endian_func(&triangle);
|
||||
if (wparams->func_fix_endian != NULL)
|
||||
wparams->func_fix_endian(&triangle);
|
||||
|
||||
write_triangle_memcpy(&triangle, buffer + buffer_offset);
|
||||
|
||||
@ -90,7 +90,7 @@ int gmio_stlb_write(
|
||||
|
||||
/* Initialize wparams */
|
||||
if (byte_order != GMIO_ENDIANNESS_HOST)
|
||||
wparams.fix_endian_func = gmio_stl_triangle_bswap;
|
||||
wparams.func_fix_endian = gmio_stl_triangle_bswap;
|
||||
wparams.facet_count = gmio_size_to_uint32(
|
||||
trsf->buffer.size / GMIO_STLB_TRIANGLE_RAWSIZE);
|
||||
|
||||
|
@ -30,7 +30,7 @@ enum gmio_stl_error
|
||||
/*! STL format could not be guessed in read function */
|
||||
GMIO_STL_ERROR_UNKNOWN_FORMAT = GMIO_STL_ERROR_TAG + 0x01,
|
||||
|
||||
/*! Common STL write error indicating gmio_stl_mesh::get_triangle_func()
|
||||
/*! Common STL write error indicating gmio_stl_mesh::func_get_triangle()
|
||||
* pointer is NULL */
|
||||
GMIO_STL_ERROR_NULL_GET_TRIANGLE_FUNC = GMIO_STL_ERROR_TAG + 0x02,
|
||||
|
||||
|
@ -113,7 +113,7 @@ int gmio_stl_write(
|
||||
* \param trsf Defines needed objects for the read operation
|
||||
* \param creator Defines the callbacks for the mesh creation
|
||||
*
|
||||
* Stream size is passed to gmio_task_iface::handle_progress_func() as the
|
||||
* Stream size is passed to gmio_task_iface::func_handle_progress() as the
|
||||
* \p max_value argument.
|
||||
*
|
||||
* Possible options in a future version could be:
|
||||
|
@ -35,7 +35,7 @@ struct gmio_stl_mesh
|
||||
|
||||
/*! Pointer on a function that stores the mesh triangle of index \p tri_id
|
||||
* into \p triangle */
|
||||
void (*get_triangle_func)(
|
||||
void (*func_get_triangle)(
|
||||
const void* cookie, uint32_t tri_id, gmio_stl_triangle_t* triangle);
|
||||
};
|
||||
|
||||
|
@ -44,7 +44,7 @@ struct gmio_stl_mesh_creator
|
||||
* The argument \p stream_size is the total size (in bytes) of the input
|
||||
* stream
|
||||
*/
|
||||
void (*ascii_begin_solid_func)(
|
||||
void (*func_ascii_begin_solid)(
|
||||
void* cookie, size_t stream_size, const char* solid_name);
|
||||
|
||||
/*! Pointer on a function that handles declaration of a mesh with
|
||||
@ -54,7 +54,7 @@ struct gmio_stl_mesh_creator
|
||||
*
|
||||
* The argument \p header contains the header data(80 bytes)
|
||||
*/
|
||||
void (*binary_begin_solid_func)(
|
||||
void (*func_binary_begin_solid)(
|
||||
void* cookie, uint32_t tri_count, const gmio_stlb_header_t* header);
|
||||
|
||||
/*! Pointer on a function that adds a triangle to the user mesh
|
||||
@ -64,7 +64,7 @@ struct gmio_stl_mesh_creator
|
||||
*
|
||||
* The argument \p tri_id is the index of the mesh triangle
|
||||
*/
|
||||
void (*add_triangle_func)(
|
||||
void (*func_add_triangle)(
|
||||
void* cookie, uint32_t tri_id, const gmio_stl_triangle_t* triangle);
|
||||
|
||||
/*! Pointer on a function that finalizes creation of the user mesh
|
||||
@ -72,7 +72,7 @@ struct gmio_stl_mesh_creator
|
||||
* Optional function called at the end of the read process, ie. after all
|
||||
* triangles have been added
|
||||
*/
|
||||
void (*end_solid_func)(void* cookie);
|
||||
void (*func_end_solid)(void* cookie);
|
||||
};
|
||||
|
||||
typedef struct gmio_stl_mesh_creator gmio_stl_mesh_creator_t;
|
||||
|
@ -90,7 +90,7 @@ typedef struct
|
||||
size_t stream_size;
|
||||
/* Offset (in bytes) from beginning of stream : current position */
|
||||
size_t stream_offset;
|
||||
/* Cache for gmio_transfer::is_stop_requested_func() */
|
||||
/* Cache for gmio_transfer::func_is_stop_requested() */
|
||||
gmio_bool_t is_stop_requested;
|
||||
} gmio_string_stream_fwd_iterator_cookie_t;
|
||||
|
||||
|
@ -48,7 +48,7 @@ static void gmio_stlb_read_facets(
|
||||
uint32_t buffer_offset = 0;
|
||||
uint32_t i_facet = 0;
|
||||
|
||||
if (creator == NULL || creator->add_triangle_func == NULL)
|
||||
if (creator == NULL || creator->func_add_triangle == NULL)
|
||||
return;
|
||||
|
||||
for (i_facet = 0; i_facet < facet_count; ++i_facet) {
|
||||
@ -56,11 +56,11 @@ static void gmio_stlb_read_facets(
|
||||
read_triangle_memcpy(buffer + buffer_offset, &triangle);
|
||||
buffer_offset += GMIO_STLB_TRIANGLE_RAWSIZE;
|
||||
|
||||
if (rparams->fix_endian_func != NULL)
|
||||
rparams->fix_endian_func(&triangle);
|
||||
if (rparams->func_fix_endian != NULL)
|
||||
rparams->func_fix_endian(&triangle);
|
||||
|
||||
/* Declare triangle */
|
||||
creator->add_triangle_func(
|
||||
creator->func_add_triangle(
|
||||
creator->cookie, i_facet_offset + i_facet, &triangle);
|
||||
}
|
||||
}
|
||||
@ -89,7 +89,7 @@ int gmio_stlb_read(
|
||||
|
||||
/* Initialize rparams */
|
||||
if (byte_order != GMIO_ENDIANNESS_HOST)
|
||||
rparams.fix_endian_func = gmio_stl_triangle_bswap;
|
||||
rparams.func_fix_endian = gmio_stl_triangle_bswap;
|
||||
|
||||
/* Read header */
|
||||
if (gmio_stream_read(&trsf->stream, &header, GMIO_STLB_HEADER_SIZE, 1)
|
||||
|
@ -93,10 +93,10 @@ static void gmio_stream_buffer_rewind(void* cookie)
|
||||
void gmio_stream_set_buffer(gmio_stream_t *stream, gmio_stream_buffer_t* buff)
|
||||
{
|
||||
stream->cookie = buff;
|
||||
stream->at_end_func = gmio_stream_buffer_at_end;
|
||||
stream->error_func = gmio_stream_buffer_error;
|
||||
stream->read_func = gmio_stream_buffer_read;
|
||||
stream->write_func = gmio_stream_buffer_write;
|
||||
stream->size_func = gmio_stream_buffer_size;
|
||||
stream->rewind_func = gmio_stream_buffer_rewind;
|
||||
stream->func_at_end = gmio_stream_buffer_at_end;
|
||||
stream->func_error = gmio_stream_buffer_error;
|
||||
stream->func_read = gmio_stream_buffer_read;
|
||||
stream->func_write = gmio_stream_buffer_write;
|
||||
stream->func_size = gmio_stream_buffer_size;
|
||||
stream->func_rewind = gmio_stream_buffer_rewind;
|
||||
}
|
||||
|
@ -123,8 +123,8 @@ const char* test_stl_read()
|
||||
stl_testcase_result_t result = {0};
|
||||
|
||||
meshc.cookie = &result;
|
||||
meshc.ascii_begin_solid_func = &ascii_begin_solid;
|
||||
meshc.add_triangle_func = &add_triangle;
|
||||
meshc.func_ascii_begin_solid = &ascii_begin_solid;
|
||||
meshc.func_add_triangle = &add_triangle;
|
||||
|
||||
for (i = 0; i < expected_count; ++i) {
|
||||
const gmio_stl_format_t format =
|
||||
@ -212,7 +212,7 @@ void generate_stlb_tests_models()
|
||||
|
||||
mesh.cookie = &tri_array;
|
||||
mesh.triangle_count = tri_array.count;
|
||||
mesh.get_triangle_func = &stl_triangle_array_get_triangle;
|
||||
mesh.func_get_triangle = &stl_triangle_array_get_triangle;
|
||||
|
||||
gmio_stl_write_file(
|
||||
GMIO_STL_FORMAT_BINARY_LE,
|
||||
|
Loading…
Reference in New Issue
Block a user