Data types used throughout the library and related generic utilities and defintions.
Common data types | Data types used throughout the library and related generic utilities and defintions. |
Macros | |
NACORE_ELOOP | Error code indicating too many levels of symbolic links. |
NACORE_EUNKNOWN | Error code for unknown errors. |
NACORE_LIBC_SIZE_FORMAT_LM | Length modifier for size_t to be used with printf()-like functions of the platform’s standard C library. |
NACORE_LIBC_SIZE_FORMAT_TYPE | Type from/to which size_t values can be safely casted. |
Types | |
nacore_get_size_cb | A function that returns the size of some value. |
nacore_cmp_cb | A function that compares two values. |
nacore_to_string_cb | A function that retuns a textual description of some value. |
nacore_filter_cb | A function that decides whether a certain value should be filtered out or not. |
nacore_op_cb | A function that performs some operation on a value. |
Functions | |
nacore_ptr_cmp() | Pointer comparison function. |
Length modifier for size_t to be used with printf()-like functions of the platform’s standard C library.
This is not needed for NASPRO core printf()-like functions, since those understand the z length modifier correctly.
See also NACORE_LIBC_SIZE_FORMAT_TYPE.
Type from/to which size_t values can be safely casted.
This is mainly meant to be used in conjuction with NACORE_LIBC_SIZE_FORMAT_LM.
size_t val = 0x12341234; printf("The value of val is: %" NACORE_LIBC_FORMAT_LM "u\n", (NACORE_LIBC_SIZE_FORMAT_TYPE)val);
A function that retuns a textual description of some value.
value | Value pointer. |
opaque | Extra opaque data pointer or NULL. |
A malloc()-allocated string containing a textual description of value. The caller is in charge of free()ing such string. If there was not enough memory, the function should return NULL.
_NACORE_DEF int nacore_ptr_cmp( const void * v1, const void * v2, void * opaque )
Pointer comparison function.
opaque is used as a flag that, if NULL, makes the function usable as a nacore_cmp_cb callback for ascending ordering, otherwise for descending ordering. The opaque pointer is never dereferenced.
v1 | First pointer. |
v2 | Second pointer. |
opaque | Ordering direction flag. |
If opaque is (not) NULL, a strictly negative (positive) value if v1 < v2, 0 if v1 == v2, a strictly positive (negative) value if v1 > v2.
Pointer comparison function.
_NACORE_DEF int nacore_ptr_cmp( const void * v1, const void * v2, void * opaque )