This commit is contained in:
Hugues Delorme 2016-01-13 10:15:04 +01:00
parent f2a1665493
commit a6dff8a150
2 changed files with 18 additions and 7 deletions

View File

@ -22,18 +22,29 @@
/*! Stream that operates on a string /*! Stream that operates on a string
* *
* To be used with API below.
* It allows to iterate over a stream (until end is reached) as if it was a * It allows to iterate over a stream (until end is reached) as if it was a
* string. * string.
*
* To be used with API below.
*/ */
struct gmio_stringstream struct gmio_stringstream
{ {
/*! Stream to iterate over */
struct gmio_stream stream; struct gmio_stream stream;
struct gmio_string strbuff;
const char* strbuff_end; /*!< Position after last char in strbuff */
const char* strbuff_at; /*!< Position indicator in buffer */
/*! Holds contents read from stream */
struct gmio_string strbuff;
/*! Position after last char in strbuff */
const char* strbuff_end;
/*! Position indicator in strbuff */
const char* strbuff_at;
/*! User data to be passed to callback func_stream_read_hook */
void* cookie; void* cookie;
/*! Pointer on user function called each time next contents is read */
void (*func_stream_read_hook)( void (*func_stream_read_hook)(
void* cookie, const struct gmio_string* strbuff); void* cookie, const struct gmio_string* strbuff);
}; };

View File

@ -27,13 +27,13 @@
enum gmio_stl_constants enum gmio_stl_constants
{ {
/*! Compact size of a struct gmio_stl_coords object */ /*! Compact size of a gmio_stl_coords object */
GMIO_STL_COORDS_RAWSIZE = (3 * sizeof(gmio_float32_t)), GMIO_STL_COORDS_RAWSIZE = (3 * sizeof(gmio_float32_t)),
/*! Compact size of a struct gmio_stl_triangle object, STL ascii format */ /*! Compact size of a gmio_stl_triangle object, STL ascii format */
GMIO_STLA_TRIANGLE_RAWSIZE = (4 * GMIO_STL_COORDS_RAWSIZE), GMIO_STLA_TRIANGLE_RAWSIZE = (4 * GMIO_STL_COORDS_RAWSIZE),
/*! Compact size of a struct gmio_stl_triangle object, STL binary format */ /*! Compact size of a gmio_stl_triangle object, STL binary format */
GMIO_STLB_TRIANGLE_RAWSIZE = (GMIO_STLA_TRIANGLE_RAWSIZE + sizeof(uint16_t)), GMIO_STLB_TRIANGLE_RAWSIZE = (GMIO_STLA_TRIANGLE_RAWSIZE + sizeof(uint16_t)),
/*! Size(in bytes) of the header data for STL binary */ /*! Size(in bytes) of the header data for STL binary */