![]() |
v0.4.1
Fast, portable C library for geometry input/output
|
All other gmio modules rely on this module. More...
Data Structures | |
struct | gmio_memblock |
Basic memory block. More... | |
struct | gmio_stream |
Stream that can get input from an arbitrary data source or can write output to an arbitrary data sink. More... | |
struct | gmio_streampos |
Specifies a position within a stream. More... | |
struct | gmio_task_iface |
Defines an interface through which a task can be controlled. More... | |
struct | gmio_vec3f |
Vector of three float coords. More... | |
struct | gmio_vec3d |
Vector of three double coords. More... | |
struct | gmio_zlib_compress_options |
zlib compression options More... | |
Macros | |
#define | GMIO_DECL_EXPORT |
Expands to the C compiler extension to export functions to a DLL. More... | |
#define | GMIO_DECL_IMPORT |
Expands to the C compiler extension to import functions from a DLL. More... | |
#define | GMIO_API |
Expands either to GMIO_DECL_EXPORT or GMIO_DECL_IMPORT when respectively compiling/using the DLL. More... | |
#define | GMIO_UNUSED(x) (void)x; |
Tells the compiler that a parameter is not used in the body of a function. More... | |
#define | GMIO_INLINE |
Expands to the C compiler specific inline keyword (if any) More... | |
#define | GMIO_RESTRICT |
Expands to the C compiler specific restrict keyword (if any) More... | |
#define | GMIO_C_LINKAGE_BEGIN |
Expands to extern "C" { when building with a C++ compiler. More... | |
#define | GMIO_C_LINKAGE_END |
Expands to } when building with a C++ compiler. More... | |
#define | GMIO_PRAGMA_MSVC_WARNING_PUSH_AND_DISABLE(__code__) |
MSVC specific macro that disable the compiler warning of code code More... | |
#define | GMIO_PRAGMA_MSVC_WARNING_POP() |
MSVC specific macro that pop the changes made after last warning(pop) More... | |
#define | GMIO_ARRAY_SIZE(array) sizeof(array) / sizeof(*array) |
Expands to the size(item count) of an array. More... | |
#define | GMIO_VERSION_MAJOR 0 |
Expands to gmio's major version number. More... | |
#define | GMIO_VERSION_MINOR 4 |
Expands to gmio's minor version number. More... | |
#define | GMIO_VERSION_PATCH 1 |
Expands to gmio's patch version number. More... | |
#define | GMIO_VERSION_STR "0.4.1" |
Expands to a string that specifies gmio's version number. More... | |
#define | GMIO_VERSION 0x000401 |
Expands to an hexadecimal value of the form 0xMMNNPP (MM=major, NN=minor, PP=patch) that specifies gmio's version number. More... | |
Typedefs | |
typedef struct gmio_memblock(* | gmio_memblock_constructor_func_t )() |
Typedef for a pointer to a function that creates an allocated memblock. More... | |
typedef int64_or_long | gmio_streamsize_t |
Type able to represent the size(in bytes) of a stream. More... | |
typedef int64_or_long | gmio_streamoffset_t |
Type able to represent the offset position within a stream. More... | |
Enumerations | |
enum | gmio_endianness |
Common endianness (byte order) of computer memory. More... | |
enum | gmio_error |
Common errors. More... | |
enum | |
GMIO_CORE_ERROR_TAG Byte-mask to tag(identify) gmio_core error codes More... | |
enum | |
GMIO_STREAMPOS_COOKIE_SIZE Size of the byte array gmio_streampos::cookie More... | |
enum | gmio_float_text_format |
Various formats to textually represent a float(single/double precision) More... | |
enum | gmio_zlib_compress_level |
zlib compression level, specific values More... | |
enum | gmio_zlib_compress_strategy |
zlib compression strategy More... | |
Functions | |
enum gmio_endianness | gmio_host_endianness () |
Returns endianness (byte order) of the host's CPU architecture. More... | |
bool | gmio_no_error (int code) |
Returns true if code == GMIO_NO_ERROR More... | |
bool | gmio_error (int code) |
Returns true if code != GMIO_NO_ERROR More... | |
bool | gmio_memblock_isnull (const struct gmio_memblock *mblock) |
Returns true if mblock is NULL or points to null/void memory. More... | |
struct gmio_memblock | gmio_memblock (void *ptr, size_t size, void(*func_deallocate)(void *)) |
Returns an initialized memblock object. More... | |
struct gmio_memblock | gmio_memblock_malloc (size_t size) |
Returns a memblock allocated with standard malloc() . More... | |
struct gmio_memblock | gmio_memblock_calloc (size_t num, size_t size) |
Returns a memblock allocated with standard calloc() . More... | |
struct gmio_memblock | gmio_memblock_realloc (void *ptr, size_t size) |
Returns a memblock allocated with standard realloc() . More... | |
void | gmio_memblock_deallocate (struct gmio_memblock *mblock) |
Safe and convenient call to gmio_memblock::func_deallocate() More... | |
void | gmio_memblock_set_default_constructor (gmio_memblock_constructor_func_t ctor) |
Installs a global function to construct gmio_memblock objects. More... | |
gmio_memblock_constructor_func_t | gmio_memblock_default_constructor () |
Returns the currently installed function to construct memblock objects. More... | |
struct gmio_memblock | gmio_memblock_default () |
Returns a memblock created with the function gmio_memblock_default_constructor() More... | |
struct gmio_stream | gmio_stream_null () |
Returns a null stream. More... | |
struct gmio_stream | gmio_stream_stdio (FILE *file) |
Returns a stream for standard FILE* (cookie will hold file ) More... | |
All other gmio modules rely on this module.
struct gmio_streampos |
Specifies a position within a stream.
The information in gmio_streampos objects is usually filled by a call to gmio_stream::func_get_pos(), which takes a pointer to an object of this type as argument.
The content of a gmio_streampos object is not meant to be read directly, but only to be used as an argument in a call to gmio_stream::func_set_pos()
Data Fields | ||
---|---|---|
uint8_t | cookie[GMIO_STREAMPOS_COOKIE_SIZE] | Stores the actual(concrete) stream position object. |
struct gmio_vec3f |
Vector of three float coords.
Data Fields | ||
---|---|---|
float | x | |
float | y | |
float | z |
#define GMIO_DECL_EXPORT |
Expands to the C compiler extension to export functions to a DLL.
#define GMIO_DECL_IMPORT |
Expands to the C compiler extension to import functions from a DLL.
#define GMIO_API |
Expands either to GMIO_DECL_EXPORT or GMIO_DECL_IMPORT when respectively compiling/using the DLL.
#define GMIO_UNUSED | ( | x | ) | (void)x; |
Tells the compiler that a parameter is not used in the body of a function.
#define GMIO_INLINE |
Expands to the C compiler specific inline keyword (if any)
#define GMIO_RESTRICT |
Expands to the C compiler specific restrict keyword (if any)
#define GMIO_C_LINKAGE_BEGIN |
Expands to extern "C" {
when building with a C++ compiler.
#define GMIO_C_LINKAGE_END |
Expands to }
when building with a C++ compiler.
#define GMIO_PRAGMA_MSVC_WARNING_PUSH_AND_DISABLE | ( | __code__ | ) |
MSVC specific macro that disable the compiler warning of code code
With Visual C++, expands to :
#define GMIO_PRAGMA_MSVC_WARNING_POP | ( | ) |
MSVC specific macro that pop the changes made after last warning(pop)
With Visual C++, expands to :
#define GMIO_ARRAY_SIZE | ( | array | ) | sizeof(array) / sizeof(*array) |
Expands to the size(item count) of an array.
#define GMIO_VERSION_MAJOR 0 |
Expands to gmio's major version number.
#define GMIO_VERSION_MINOR 4 |
Expands to gmio's minor version number.
#define GMIO_VERSION_PATCH 1 |
Expands to gmio's patch version number.
#define GMIO_VERSION_STR "0.4.1" |
Expands to a string that specifies gmio's version number.
#define GMIO_VERSION 0x000401 |
Expands to an hexadecimal value of the form 0xMMNNPP
(MM=major, NN=minor, PP=patch) that specifies gmio's version number.
typedef struct gmio_memblock(* gmio_memblock_constructor_func_t)() |
Typedef for a pointer to a function that creates an allocated memblock.
Signature:
typedef int64_or_long gmio_streamsize_t |
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_streamoffset_t |
Type able to represent the offset position within a stream.
It can be int64_t or long depending on the compiler support
enum gmio_endianness |
Common endianness (byte order) of computer memory.
enum gmio_error |
Common errors.
Format:
4-bytes signed integer (ISO C restricts enumerator value to 'int')
max value: 0x7FFFFFFF
bits 0x00FFFFFF..0x7FFFFFFF: tag identifying the error category
bits 0x001FFFFF..0x00FFFFFF: tag identifying an error sub-category
bits 0x00000000..0x000FFFFF: error value in the (sub)category
Max count of categories : 128 (2^7)
Max count of sub-categories : 15 (2^4 - 1)
Max count of error values : 1048576 (2^20)
Enumerator | |
---|---|
GMIO_ERROR_OK |
No error occurred, success. |
GMIO_ERROR_UNKNOWN |
Unknown error. |
GMIO_ERROR_NULL_MEMBLOCK |
Pointer on argument memory block is |
GMIO_ERROR_INVALID_MEMBLOCK_SIZE |
Argument size for the memory block is too small. |
GMIO_ERROR_NULL_STREAM |
Provided gmio_stream is |
GMIO_ERROR_STREAM |
An error occurred with gmio_stream. |
GMIO_ERROR_STREAM_FUNC_REQUIRED |
Some required gmio_stream function pointer is NULL. |
GMIO_ERROR_TASK_STOPPED |
Task was stopped by user, that is to say gmio_task_iface::func_is_stop_requested() returned true. |
GMIO_ERROR_STDIO |
An error occured after a call to a The caller can check |
GMIO_ERROR_BAD_LC_NUMERIC |
Checking of |
GMIO_ERROR_ZLIB_ERRNO |
See |
GMIO_ERROR_ZLIB_STREAM |
See |
GMIO_ERROR_ZLIB_DATA |
See |
GMIO_ERROR_ZLIB_MEM |
See |
GMIO_ERROR_ZLIB_BUF |
See |
GMIO_ERROR_ZLIB_VERSION |
See |
GMIO_ERROR_ZLIB_INVALID_COMPRESS_LEVEL |
Invalid compression level, see gmio_zlib_compress_options::level. |
GMIO_ERROR_ZLIB_INVALID_COMPRESS_MEMORY_USAGE |
Invalid compression memory usage, see gmio_zlib_compress_options::memory_usage. |
GMIO_ERROR_ZLIB_DEFLATE_NOT_ALL_INPUT_USED |
All input to be deflated(compressed) was not processed. |
GMIO_ERROR_ZLIB_DEFLATE_STREAM_INCOMPLETE |
Deflate failure to flush pending output. |
GMIO_ERROR_ZIP_INT64_TYPE_REQUIRED |
Zip64 format requires the compiler to provide a 64b integer type. |
GMIO_ERROR_ZIP64_FORMAT_REQUIRED |
The size of some ZIP file entry exceeds 32b limit and so requires Zip64 format. |
anonymous enum |
anonymous enum |
GMIO_STREAMPOS_COOKIE_SIZE
Size of the byte array gmio_streampos::cookie
Enumerator | |
---|---|
GMIO_STREAMPOS_COOKIE_SIZE |
Various formats to textually represent a float(single/double precision)
zlib compression strategy
enum gmio_endianness gmio_host_endianness | ( | ) |
Returns endianness (byte order) of the host's CPU architecture.
bool gmio_no_error | ( | int | code | ) |
Returns true if code == GMIO_NO_ERROR
bool gmio_error | ( | int | code | ) |
Returns true if code != GMIO_NO_ERROR
bool gmio_memblock_isnull | ( | const struct gmio_memblock * | mblock | ) |
Returns true if mblock
is NULL or points to null/void memory.
struct gmio_memblock gmio_memblock | ( | void * | ptr, |
size_t | size, | ||
void(*)(void *) | func_deallocate | ||
) |
Returns an initialized memblock object.
If ptr
is NULL then gmio_memblock::size is forced to 0
struct gmio_memblock gmio_memblock_malloc | ( | size_t | size | ) |
Returns a memblock allocated with standard malloc()
.
gmio_memblock::func_deallocate is set to standard free()
struct gmio_memblock gmio_memblock_calloc | ( | size_t | num, |
size_t | size | ||
) |
Returns a memblock allocated with standard calloc()
.
gmio_memblock::func_deallocate is set to standard free()
struct gmio_memblock gmio_memblock_realloc | ( | void * | ptr, |
size_t | size | ||
) |
Returns a memblock allocated with standard realloc()
.
gmio_memblock::func_deallocate is set to standard free()
void gmio_memblock_deallocate | ( | struct gmio_memblock * | mblock | ) |
Safe and convenient call to gmio_memblock::func_deallocate()
void gmio_memblock_set_default_constructor | ( | gmio_memblock_constructor_func_t | ctor | ) |
Installs a global function to construct gmio_memblock objects.
The constructor function allocates a memblock on demand, to be used when a temporary memblock is needed.
This function is not thread-safe.
gmio_memblock_constructor_func_t gmio_memblock_default_constructor | ( | ) |
Returns the currently installed function to construct memblock objects.
It is initialized to gmio_memblock_malloc(128KB)
struct gmio_memblock gmio_memblock_default | ( | ) |
Returns a memblock created with the function gmio_memblock_default_constructor()
struct gmio_stream gmio_stream_null | ( | ) |
Returns a null stream.
struct gmio_stream gmio_stream_stdio | ( | FILE * | file | ) |
Returns a stream for standard FILE* (cookie will hold file
)
Fougue © 2017 | Last Update: Fri Apr 14 2017 |