v0.2.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... | |
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... | |
Typedefs | |
typedef struct gmio_memblock(* | gmio_memblock_constructor_func_t )() |
Typedef for a pointer to a function that creates an allocated mblock. 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 |
This enum identifies common endianness (byte order) of computer memory. More... | |
enum | gmio_error |
This enum defines common errors. More... | |
enum | |
GMIO_STREAMPOS_COOKIE_SIZE Size of the byte array gmio_streampos::cookie More... | |
enum | gmio_float_text_format |
This enum defines the various formats to textually represent a float. 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 gmio_memblock object. More... | |
struct gmio_memblock | gmio_memblock_malloc (size_t size) |
Returns a gmio_memblock object allocated with standard malloc() More... | |
struct gmio_memblock | gmio_memblock_calloc (size_t num, size_t size) |
Returns a gmio_memblock object allocated with standard calloc() More... | |
struct gmio_memblock | gmio_memblock_realloc (void *ptr, size_t size) |
Returns a gmio_memblock object 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 gmio_memblock objects. More... | |
struct gmio_memblock | gmio_memblock_default () |
Returns a gmio_memblock object created using 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_API |
Expands either to GMIO_DECL_EXPORT or GMIO_DECL_IMPORT when respectively compiling/using the DLL.
#define GMIO_ARRAY_SIZE | ( | array | ) | sizeof(array) / sizeof(*array) |
Expands to the size(item count) of an array.
#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_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_INLINE |
Expands to the C compiler specific inline keyword (if any)
#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_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_RESTRICT |
Expands to the C compiler specific restrict keyword (if any)
#define GMIO_UNUSED | ( | x | ) | (void)x; |
Tells the compiler that a parameter is not used in the body of a function.
typedef struct gmio_memblock(* gmio_memblock_constructor_func_t)() |
Typedef for a pointer to a function that creates an allocated mblock.
Signature:
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
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
anonymous enum |
GMIO_STREAMPOS_COOKIE_SIZE
Size of the byte array gmio_streampos::cookie
Enumerator | |
---|---|
GMIO_STREAMPOS_COOKIE_SIZE |
enum gmio_endianness |
This enum identifies common endianness (byte order) of computer memory.
enum gmio_error |
This enum defines common errors.
Enumerator | |
---|---|
GMIO_ERROR_OK |
No error occurred, success. |
GMIO_ERROR_NULL_MEMBLOCK |
Pointer on argument memory block is NULL. |
GMIO_ERROR_INVALID_MEMBLOCK_SIZE |
Argument size for the memory block is too small. |
GMIO_ERROR_STREAM |
An error occurred with gmio_stream. |
GMIO_ERROR_TRANSFER_STOPPED |
Transfer was stopped by user, that is to say gmio_transfer::func_is_stop_requested() returned true. |
GMIO_ERROR_STDIO |
An error occured after a call to a <stdio.h> function. The caller can check errno to get the real error number |
GMIO_ERROR_UNKNOWN |
Unknown error. |
This enum defines the various formats to textually represent a float.
bool gmio_error | ( | int | code | ) |
Returns true if code != GMIO_NO_ERROR
enum gmio_endianness gmio_host_endianness | ( | ) |
Returns endianness (byte order) of the host's CPU architecture.
struct gmio_memblock gmio_memblock | ( | void * | ptr, |
size_t | size, | ||
void(*)(void *) | func_deallocate | ||
) |
Returns an initialized gmio_memblock object.
If ptr
is NULL then gmio_memblock::size is forced to 0
struct gmio_memblock gmio_memblock_calloc | ( | size_t | num, |
size_t | size | ||
) |
Returns a gmio_memblock object allocated with standard calloc()
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()
struct gmio_memblock gmio_memblock_default | ( | ) |
Returns a gmio_memblock object created using the function gmio_memblock_default_constructor()
gmio_memblock_constructor_func_t gmio_memblock_default_constructor | ( | ) |
Returns the currently installed function to construct gmio_memblock objects.
It is initialized to gmio_memblock_malloc(128KB)
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_malloc | ( | size_t | size | ) |
Returns a gmio_memblock object allocated with standard malloc()
gmio_memblock::func_deallocate is set to standard free()
struct gmio_memblock gmio_memblock_realloc | ( | void * | ptr, |
size_t | size | ||
) |
Returns a gmio_memblock object allocated with standard realloc()
gmio_memblock::func_deallocate is set to standard free()
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 gmio_memblock object on demand, to be used when a temporary memblock is needed.
This function is not thread-safe.
bool gmio_no_error | ( | int | code | ) |
Returns true if code == GMIO_NO_ERROR
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 © 2016 | Last Update: Thu Jun 30 2016 |