Rename pointer on functions members

xxx_func -> func_xxx
This commit is contained in:
Hugues Delorme 2015-07-10 11:33:05 +02:00
parent b10da55577
commit 13b1d32a9a
22 changed files with 90 additions and 90 deletions

View File

@ -24,12 +24,12 @@ GMIO_INLINE gmio_buffer_t gmio_buffer_null()
} }
gmio_buffer_t gmio_buffer( 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; gmio_buffer_t buff;
buff.ptr = ptr; buff.ptr = ptr;
buff.size = ptr != NULL ? size : 0; buff.size = ptr != NULL ? size : 0;
buff.deallocate_func = deallocate_func; buff.func_deallocate = func_deallocate;
return buff; 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) void gmio_buffer_deallocate(gmio_buffer_t *buffer)
{ {
if (buffer != NULL && buffer->deallocate_func != NULL) if (buffer != NULL && buffer->func_deallocate != NULL)
buffer->deallocate_func(buffer->ptr); buffer->func_deallocate(buffer->ptr);
} }
static gmio_buffer_t gmio_buffer_default_internal_ctor() static gmio_buffer_t gmio_buffer_default_internal_ctor()

View File

@ -35,7 +35,7 @@ struct gmio_buffer
/*! Optional pointer on a function that deallocates the memory block /*! Optional pointer on a function that deallocates the memory block
* beginning at \p ptr */ * beginning at \p ptr */
void (*deallocate_func)(void* ptr); void (*func_deallocate)(void* ptr);
}; };
typedef struct gmio_buffer gmio_buffer_t; 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 * If \p ptr is NULL then gmio_buffer::size is forced to \c 0
*/ */
GMIO_LIB_EXPORT gmio_buffer_t gmio_buffer( 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() */ /*! Returns a gmio_buffer object allocated with standard \c malloc() */
GMIO_LIB_EXPORT gmio_buffer_t gmio_buffer_malloc(size_t size); 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() */ /*! Returns a gmio_buffer object allocated with standard \c realloc() */
GMIO_LIB_EXPORT gmio_buffer_t gmio_buffer_realloc(void* ptr, size_t size); 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); GMIO_LIB_EXPORT void gmio_buffer_deallocate(gmio_buffer_t* buffer);
/*! Typedef for a pointer to a function that creates an allocated buffer /*! Typedef for a pointer to a function that creates an allocated buffer

View File

@ -41,7 +41,7 @@ enum gmio_error
GMIO_ERROR_STREAM, GMIO_ERROR_STREAM,
/*! Transfer was stopped by user, that is to say /*! 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, GMIO_ERROR_TRANSFER_STOPPED,
/*! An error occured after a call to a <stdio.h> function /*! An error occured after a call to a <stdio.h> function

View File

@ -18,53 +18,53 @@
#include "../stream.h" #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) GMIO_INLINE gmio_bool_t gmio_stream_at_end(gmio_stream_t* stream)
{ {
if (stream != NULL && stream->at_end_func != NULL) if (stream != NULL && stream->func_at_end != NULL)
return stream->at_end_func(stream->cookie); return stream->func_at_end(stream->cookie);
return GMIO_FALSE; 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) GMIO_INLINE int gmio_stream_error(gmio_stream_t* stream)
{ {
if (stream != NULL && stream->error_func != NULL) if (stream != NULL && stream->func_error != NULL)
return stream->error_func(stream->cookie); return stream->func_error(stream->cookie);
return 0; 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_INLINE size_t gmio_stream_read(
gmio_stream_t* stream, void *ptr, size_t size, size_t count) gmio_stream_t* stream, void *ptr, size_t size, size_t count)
{ {
if (stream != NULL && stream->read_func != NULL) if (stream != NULL && stream->func_read != NULL)
return stream->read_func(stream->cookie, ptr, size, count); return stream->func_read(stream->cookie, ptr, size, count);
return 0; 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_INLINE size_t gmio_stream_write(
gmio_stream_t* stream, const void *ptr, size_t size, size_t count) gmio_stream_t* stream, const void *ptr, size_t size, size_t count)
{ {
if (stream != NULL && stream->write_func != NULL) if (stream != NULL && stream->func_write != NULL)
return stream->write_func(stream->cookie, ptr, size, count); return stream->func_write(stream->cookie, ptr, size, count);
return 0; 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) GMIO_INLINE size_t gmio_stream_size(gmio_stream_t* stream)
{ {
if (stream != NULL && stream->size_func != NULL) if (stream != NULL && stream->func_size != NULL)
return stream->size_func(stream->cookie); return stream->func_size(stream->cookie);
return 0; 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) GMIO_INLINE void gmio_stream_rewind(gmio_stream_t* stream)
{ {
if (stream != NULL && stream->rewind_func != NULL) if (stream != NULL && stream->func_rewind != NULL)
stream->rewind_func(stream->cookie); stream->func_rewind(stream->cookie);
} }
#endif /* GMIO_INTERNAL_HELPER_STREAM_H */ #endif /* GMIO_INTERNAL_HELPER_STREAM_H */

View File

@ -20,21 +20,21 @@
#include <stddef.h> #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( GMIO_INLINE gmio_bool_t gmio_task_iface_is_stop_requested(
const gmio_task_iface_t* itask) const gmio_task_iface_t* itask)
{ {
if (itask != NULL && itask->is_stop_requested_func != NULL) if (itask != NULL && itask->func_is_stop_requested != NULL)
return itask->is_stop_requested_func(itask->cookie); return itask->func_is_stop_requested(itask->cookie);
return GMIO_FALSE; 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( GMIO_INLINE void gmio_task_iface_handle_progress(
const gmio_task_iface_t* itask, size_t value, size_t max_value) const gmio_task_iface_t* itask, size_t value, size_t max_value)
{ {
if (itask != NULL && itask->handle_progress_func != NULL) if (itask != NULL && itask->func_handle_progress != NULL)
itask->handle_progress_func(itask->cookie, value, max_value); itask->func_handle_progress(itask->cookie, value, max_value);
} }
#endif /* GMIO_INTERNAL_HELPER_TASK_IFACE_H */ #endif /* GMIO_INTERNAL_HELPER_TASK_IFACE_H */

View File

@ -19,7 +19,7 @@
#include "../transfer.h" #include "../transfer.h"
#include "helper_task_iface.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 * through gmio_transfer::task_iface
*/ */
GMIO_INLINE gmio_bool_t gmio_transfer_is_stop_requested( 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; 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 * through gmio_transfer::task_iface
*/ */
GMIO_INLINE void gmio_transfer_handle_progress( GMIO_INLINE void gmio_transfer_handle_progress(

View File

@ -138,11 +138,11 @@ gmio_stream_t gmio_stream_stdio(FILE* file)
{ {
gmio_stream_t stream = { 0 }; gmio_stream_t stream = { 0 };
stream.cookie = file; stream.cookie = file;
stream.at_end_func = gmio_stream_stdio_at_end; stream.func_at_end = gmio_stream_stdio_at_end;
stream.error_func = gmio_stream_stdio_error; stream.func_error = gmio_stream_stdio_error;
stream.read_func = gmio_stream_stdio_read; stream.func_read = gmio_stream_stdio_read;
stream.write_func = gmio_stream_stdio_write; stream.func_write = gmio_stream_stdio_write;
stream.size_func = gmio_stream_stdio_size; stream.func_size = gmio_stream_stdio_size;
stream.rewind_func = gmio_stream_stdio_rewind; stream.func_rewind = gmio_stream_stdio_rewind;
return stream; return stream;
} }

View File

@ -50,7 +50,7 @@ struct gmio_stream
* The function should behaves like C standard [feof()] * The function should behaves like C standard [feof()]
* (http://pubs.opengroup.org/onlinepubs/007904975/functions/feof.html) * (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 /*! Pointer on a function that checks error indicator
* *
@ -60,7 +60,7 @@ struct gmio_stream
* The function should behaves like C standard [ferror()] * The function should behaves like C standard [ferror()]
* (http://pubs.opengroup.org/onlinepubs/007904975/functions/ferror.html) * (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 /*! 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 * \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 /*! 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 * \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 */ /*! 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 /*! Pointer on a function that moves the position indicator within the
* stream to the beginning * stream to the beginning
@ -97,7 +97,7 @@ struct gmio_stream
* The function should behaves like C standard [rewind()] * The function should behaves like C standard [rewind()]
* (http://pubs.opengroup.org/onlinepubs/007904975/functions/rewind.html) * (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; typedef struct gmio_stream gmio_stream_t;

View File

@ -35,7 +35,7 @@ struct gmio_task_iface
* If \c GMIO_TRUE is returned then the current task should abort as * If \c GMIO_TRUE is returned then the current task should abort as
* soon as possible, otherwise it can continue execution. * 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 /*! Optional pointer on a function that is called anytime some new progress
* was done * was done
@ -44,7 +44,7 @@ struct gmio_task_iface
* \param value Current value of the task progress (<= \p max_value ) * \param value Current value of the task progress (<= \p max_value )
* \param max_value Maximum value of the task progress * \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; typedef struct gmio_task_iface gmio_task_iface_t;

View File

@ -19,47 +19,47 @@
#include "../stl_mesh_creator.h" #include "../stl_mesh_creator.h"
/*! Safe and convenient function for /*! 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_INLINE void gmio_stl_mesh_creator_ascii_begin_solid(
gmio_stl_mesh_creator_t* creator, gmio_stl_mesh_creator_t* creator,
size_t stream_size, size_t stream_size,
const char* solid_name) const char* solid_name)
{ {
if (creator != NULL && creator->ascii_begin_solid_func != NULL) { if (creator != NULL && creator->func_ascii_begin_solid != NULL) {
creator->ascii_begin_solid_func( creator->func_ascii_begin_solid(
creator->cookie, stream_size, solid_name); creator->cookie, stream_size, solid_name);
} }
} }
/*! Safe and convenient function for /*! 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_INLINE void gmio_stl_mesh_creator_binary_begin_solid(
gmio_stl_mesh_creator_t* creator, gmio_stl_mesh_creator_t* creator,
uint32_t tri_count, uint32_t tri_count,
const gmio_stlb_header_t* header) const gmio_stlb_header_t* header)
{ {
if (creator != NULL && creator->binary_begin_solid_func != NULL) if (creator != NULL && creator->func_binary_begin_solid != NULL)
creator->binary_begin_solid_func(creator->cookie, tri_count, header); creator->func_binary_begin_solid(creator->cookie, tri_count, header);
} }
/*! Safe and convenient function for /*! 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_INLINE void gmio_stl_mesh_creator_add_triangle(
gmio_stl_mesh_creator_t* creator, gmio_stl_mesh_creator_t* creator,
uint32_t tri_id, uint32_t tri_id,
const gmio_stl_triangle_t* triangle) const gmio_stl_triangle_t* triangle)
{ {
if (creator != NULL && creator->add_triangle_func != NULL) if (creator != NULL && creator->func_add_triangle != NULL)
creator->add_triangle_func(creator->cookie, tri_id, triangle); creator->func_add_triangle(creator->cookie, tri_id, triangle);
} }
/*! Safe and convenient function for /*! 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_INLINE void gmio_stl_mesh_creator_end_solid(
gmio_stl_mesh_creator_t* creator) gmio_stl_mesh_creator_t* creator)
{ {
if (creator != NULL && creator->end_solid_func != NULL) if (creator != NULL && creator->func_end_solid != NULL)
creator->end_solid_func(creator->cookie); creator->func_end_solid(creator->cookie);
} }
#endif /* GMIO_INTERNAL_HELPER_STL_MESH_CREATOR_H */ #endif /* GMIO_INTERNAL_HELPER_STL_MESH_CREATOR_H */

View File

@ -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) gmio_bool_t gmio_stl_check_mesh(int *error, const gmio_stl_mesh_t* mesh)
{ {
if (mesh == NULL 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; *error = GMIO_STL_ERROR_NULL_GET_TRIANGLE_FUNC;
} }

View File

@ -28,7 +28,7 @@ struct gmio_stlb_readwrite_helper
{ {
uint32_t facet_count; uint32_t facet_count;
uint32_t i_facet_offset; 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; typedef struct gmio_stlb_readwrite_helper gmio_stlb_readwrite_helper_t;

View File

@ -203,7 +203,7 @@ int gmio_stla_write(
ibuffer_facet < clamped_facet_count; ibuffer_facet < clamped_facet_count;
++ibuffer_facet) ++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_string(buffc, "facet normal ");
buffc = gmio_write_coords(buffc, coords_format, &tri.normal); buffc = gmio_write_coords(buffc, coords_format, &tri.normal);
buffc = gmio_write_eol(buffc); buffc = gmio_write_eol(buffc);

View File

@ -46,7 +46,7 @@ static void gmio_stlb_write_facets(
uint32_t buffer_offset = 0; uint32_t buffer_offset = 0;
uint32_t i_facet = 0; uint32_t i_facet = 0;
if (mesh == NULL || mesh->get_triangle_func == NULL) if (mesh == NULL || mesh->func_get_triangle == NULL)
return; return;
triangle.attribute_byte_count = 0; triangle.attribute_byte_count = 0;
@ -54,10 +54,10 @@ static void gmio_stlb_write_facets(
i_facet < (i_facet_offset + facet_count); i_facet < (i_facet_offset + facet_count);
++i_facet) ++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) if (wparams->func_fix_endian != NULL)
wparams->fix_endian_func(&triangle); wparams->func_fix_endian(&triangle);
write_triangle_memcpy(&triangle, buffer + buffer_offset); write_triangle_memcpy(&triangle, buffer + buffer_offset);
@ -90,7 +90,7 @@ int gmio_stlb_write(
/* Initialize wparams */ /* Initialize wparams */
if (byte_order != GMIO_ENDIANNESS_HOST) 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( wparams.facet_count = gmio_size_to_uint32(
trsf->buffer.size / GMIO_STLB_TRIANGLE_RAWSIZE); trsf->buffer.size / GMIO_STLB_TRIANGLE_RAWSIZE);

View File

@ -30,7 +30,7 @@ enum gmio_stl_error
/*! STL format could not be guessed in read function */ /*! STL format could not be guessed in read function */
GMIO_STL_ERROR_UNKNOWN_FORMAT = GMIO_STL_ERROR_TAG + 0x01, 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 */ * pointer is NULL */
GMIO_STL_ERROR_NULL_GET_TRIANGLE_FUNC = GMIO_STL_ERROR_TAG + 0x02, GMIO_STL_ERROR_NULL_GET_TRIANGLE_FUNC = GMIO_STL_ERROR_TAG + 0x02,

View File

@ -113,7 +113,7 @@ int gmio_stl_write(
* \param trsf Defines needed objects for the read operation * \param trsf Defines needed objects for the read operation
* \param creator Defines the callbacks for the mesh creation * \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. * \p max_value argument.
* *
* Possible options in a future version could be: * Possible options in a future version could be:

View File

@ -35,7 +35,7 @@ struct gmio_stl_mesh
/*! Pointer on a function that stores the mesh triangle of index \p tri_id /*! Pointer on a function that stores the mesh triangle of index \p tri_id
* into \p triangle */ * into \p triangle */
void (*get_triangle_func)( void (*func_get_triangle)(
const void* cookie, uint32_t tri_id, gmio_stl_triangle_t* triangle); const void* cookie, uint32_t tri_id, gmio_stl_triangle_t* triangle);
}; };

View File

@ -44,7 +44,7 @@ struct gmio_stl_mesh_creator
* The argument \p stream_size is the total size (in bytes) of the input * The argument \p stream_size is the total size (in bytes) of the input
* stream * stream
*/ */
void (*ascii_begin_solid_func)( void (*func_ascii_begin_solid)(
void* cookie, size_t stream_size, const char* solid_name); void* cookie, size_t stream_size, const char* solid_name);
/*! Pointer on a function that handles declaration of a mesh with /*! 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) * 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); void* cookie, uint32_t tri_count, const gmio_stlb_header_t* header);
/*! Pointer on a function that adds a triangle to the user mesh /*! 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 * 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); void* cookie, uint32_t tri_id, const gmio_stl_triangle_t* triangle);
/*! Pointer on a function that finalizes creation of the user mesh /*! 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 * Optional function called at the end of the read process, ie. after all
* triangles have been added * 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; typedef struct gmio_stl_mesh_creator gmio_stl_mesh_creator_t;

View File

@ -90,7 +90,7 @@ typedef struct
size_t stream_size; size_t stream_size;
/* Offset (in bytes) from beginning of stream : current position */ /* Offset (in bytes) from beginning of stream : current position */
size_t stream_offset; 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_bool_t is_stop_requested;
} gmio_string_stream_fwd_iterator_cookie_t; } gmio_string_stream_fwd_iterator_cookie_t;

View File

@ -48,7 +48,7 @@ static void gmio_stlb_read_facets(
uint32_t buffer_offset = 0; uint32_t buffer_offset = 0;
uint32_t i_facet = 0; uint32_t i_facet = 0;
if (creator == NULL || creator->add_triangle_func == NULL) if (creator == NULL || creator->func_add_triangle == NULL)
return; return;
for (i_facet = 0; i_facet < facet_count; ++i_facet) { 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); read_triangle_memcpy(buffer + buffer_offset, &triangle);
buffer_offset += GMIO_STLB_TRIANGLE_RAWSIZE; buffer_offset += GMIO_STLB_TRIANGLE_RAWSIZE;
if (rparams->fix_endian_func != NULL) if (rparams->func_fix_endian != NULL)
rparams->fix_endian_func(&triangle); rparams->func_fix_endian(&triangle);
/* Declare triangle */ /* Declare triangle */
creator->add_triangle_func( creator->func_add_triangle(
creator->cookie, i_facet_offset + i_facet, &triangle); creator->cookie, i_facet_offset + i_facet, &triangle);
} }
} }
@ -89,7 +89,7 @@ int gmio_stlb_read(
/* Initialize rparams */ /* Initialize rparams */
if (byte_order != GMIO_ENDIANNESS_HOST) if (byte_order != GMIO_ENDIANNESS_HOST)
rparams.fix_endian_func = gmio_stl_triangle_bswap; rparams.func_fix_endian = gmio_stl_triangle_bswap;
/* Read header */ /* Read header */
if (gmio_stream_read(&trsf->stream, &header, GMIO_STLB_HEADER_SIZE, 1) if (gmio_stream_read(&trsf->stream, &header, GMIO_STLB_HEADER_SIZE, 1)

View File

@ -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) void gmio_stream_set_buffer(gmio_stream_t *stream, gmio_stream_buffer_t* buff)
{ {
stream->cookie = buff; stream->cookie = buff;
stream->at_end_func = gmio_stream_buffer_at_end; stream->func_at_end = gmio_stream_buffer_at_end;
stream->error_func = gmio_stream_buffer_error; stream->func_error = gmio_stream_buffer_error;
stream->read_func = gmio_stream_buffer_read; stream->func_read = gmio_stream_buffer_read;
stream->write_func = gmio_stream_buffer_write; stream->func_write = gmio_stream_buffer_write;
stream->size_func = gmio_stream_buffer_size; stream->func_size = gmio_stream_buffer_size;
stream->rewind_func = gmio_stream_buffer_rewind; stream->func_rewind = gmio_stream_buffer_rewind;
} }

View File

@ -123,8 +123,8 @@ const char* test_stl_read()
stl_testcase_result_t result = {0}; stl_testcase_result_t result = {0};
meshc.cookie = &result; meshc.cookie = &result;
meshc.ascii_begin_solid_func = &ascii_begin_solid; meshc.func_ascii_begin_solid = &ascii_begin_solid;
meshc.add_triangle_func = &add_triangle; meshc.func_add_triangle = &add_triangle;
for (i = 0; i < expected_count; ++i) { for (i = 0; i < expected_count; ++i) {
const gmio_stl_format_t format = const gmio_stl_format_t format =
@ -212,7 +212,7 @@ void generate_stlb_tests_models()
mesh.cookie = &tri_array; mesh.cookie = &tri_array;
mesh.triangle_count = tri_array.count; 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_write_file(
GMIO_STL_FORMAT_BINARY_LE, GMIO_STL_FORMAT_BINARY_LE,