Host. More...
Go to the source code of this file.
Classes | |
struct | _VlX86CpuInfo |
Defines | |
C preprocessor helper macros | |
------------------------------------------------------------------ | |
#define | VL_STRINGIFY(x) # x |
Convert the argument to a string. | |
#define | VL_XSTRINGIFY(x) VL_STRINGIFY(x) |
Expand and then convert the argument to a string. | |
#define | VL_CAT(x, y) x ## y |
Concatenate two arguments into a lexical unit. | |
#define | VL_XCAT(x, y) VL_CAT(x,y) |
Expand and then concatenate two arguments into a lexical unit. | |
#define | VL_XCAT3(x, y, z) VL_XCAT(VL_XCAT(x,y),z) |
Expand and then concatenate three arguments into a lexical unit. | |
#define | VL_XCAT4(x, y, z, u) VL_XCAT(VL_XCAT3(x,y,z),u) |
Expand and then concatenate four arguments into a lexical unit. | |
#define | VL_XCAT5(x, y, z, u, v) VL_XCAT(VL_XCAT4(x,y,z,u),v) |
Expand and then concatenate five arguments into a lexical unit. | |
#define | VL_YESNO(x) ((x)?"yes":"no") |
Convert a boolean to "yes" or "no" strings. | |
Identifying the host data model | |
#define | VL_COMPILER_ILP32 |
Defined if the host compiler data model is ILP32. | |
Identifying the host endianness | |
#define | VL_ARCH_BIG_ENDIAN |
Defined if the host CPU is big endian. | |
Creating integer constants | |
#define | VL_INT8_C(x) x |
Create an integer constant of the specified width and sign. | |
#define | VL_INT16_C(x) x |
#define | VL_INT32_C(x) x |
#define | VL_INT64_C(x) x ## LL |
#define | VL_UINT8_C(x) x |
#define | VL_UINT16_C(x) x |
#define | VL_UINT32_C(x) x ## U |
#define | VL_UINT64_C(x) x ## ULL |
Printing the atomic data types | |
------------------------------------------------------------------ | |
#define | VL_FL_INT64 "ll" |
printf length flag for vl_int64 and vl_uint64. | |
#define | VL_FL_INT32 "" |
printf length flag for vl_int32 and vl_uint32. | |
#define | VL_FL_INT16 "h" |
printf length flag for vl_int16 and vl_uint16. | |
#define | VL_FL_INT8 "hh" |
printf length flag for vl_int8 and vl_uint8. | |
#define | VL_FL_INDEX VL_FL_INT32 |
printf length flag for vl_index and vl_uindex | |
#define | VL_FMT_INDEX VL_FL_INDEX "d" |
printf flag for vl_index | |
#define | VL_FMT_INTPTR VL_FMT_INDEX |
printf flag for vl_intptr | |
#define | VL_FMT_UINDEX VL_FL_INDEX "u" |
printf flag for vl_uindex | |
#define | VL_FMT_SIZE VL_FMT_UINDEX |
printf flag for vl_size | |
#define | VL_FMT_UINTPTR VL_FMT_UINDEX |
printf flag for vl_uintptr | |
Atomic data types limits | |
------------------------------------------------------------------ | |
#define | VL_BIG_INT 0x7FFFFFFFL |
Largest integer (math constant) | |
#define | VL_SMALL_INT (- VL_BIG_INT - 1) |
Smallest integer (math constant) | |
#define | VL_BIG_UINT 0xFFFFFFFFUL |
Largest unsigned integer (math constant) | |
Functions | |
VL_EXPORT char * | vl_static_configuration_to_string_copy () |
Human readable static library configuration. | |
Endianness detection and conversion | |
------------------------------------------------------------------ | |
VL_INLINE void | vl_swap_host_big_endianness_8 (void *dst, void *src) |
Host <-> big endian transformation for 8-bytes value. | |
VL_INLINE void | vl_swap_host_big_endianness_4 (void *dst, void *src) |
Host <-> big endian transformation for 4-bytes value. | |
VL_INLINE void | vl_swap_host_big_endianness_2 (void *dst, void *src) |
Host <-> big endian transformation for 2-bytes value. | |
Atomic data types | |
------------------------------------------------------------------ | |
#define | VL_TRUE 1 |
true (1) constant | |
#define | VL_FALSE 0 |
false (0) constant | |
typedef long long | vl_int64 |
typedef int | vl_int32 |
typedef short | vl_int16 |
typedef char | vl_int8 |
typedef long long unsigned | vl_uint64 |
typedef int unsigned | vl_uint32 |
typedef short unsigned | vl_uint16 |
typedef char unsigned | vl_uint8 |
typedef int | vl_int |
typedef unsigned int | vl_uint |
typedef int | vl_bool |
typedef vl_int32 | vl_intptr |
typedef vl_uint32 | vl_uintptr |
typedef vl_uint32 | vl_size |
typedef vl_int32 | vl_index |
typedef vl_uint32 | vl_uindex |
Obtaining host info at run time | |
------------------------------------------------------------------ | |
typedef struct _VlX86CpuInfo | VlX86CpuInfo |
void | _vl_x86cpu_info_init (VlX86CpuInfo *self) |
char * | _vl_x86cpu_info_to_string_copy (VlX86CpuInfo const *self) |
#define VL_ARCH_BIG_ENDIAN |
#define VL_BIG_INT 0x7FFFFFFFL |
#define VL_BIG_UINT 0xFFFFFFFFUL |
#define VL_CAT | ( | x, | |
y | |||
) | x ## y |
Concatenate two arguments into a lexical unit.
x | first argument to be concatenated. |
y | second argument to be concatenated. |
This macro concatenates its arguments into a single lexical unit by means of the ##
preprocessor operator. Notice that arguments concatenated by ##
are not pre-expanded by the C preprocessor. To macro-expand the arguments and then concatenate them,use VL_XCAT.
#define VL_COMPILER_ILP32 |
Defined if the host compiler data model is ILP32.
#define VL_FL_INDEX VL_FL_INT32 |
#define VL_FL_INT16 "h" |
#define VL_FL_INT32 "" |
#define VL_FL_INT64 "ll" |
#define VL_FL_INT8 "hh" |
#define VL_FMT_INDEX VL_FL_INDEX "d" |
#define VL_FMT_INTPTR VL_FMT_INDEX |
#define VL_FMT_SIZE VL_FMT_UINDEX |
#define VL_FMT_UINDEX VL_FL_INDEX "u" |
#define VL_FMT_UINTPTR VL_FMT_UINDEX |
printf
flag for vl_uintptr
#define VL_INT16_C | ( | x | ) | x |
Create an integer constant of the specified width and sign.
x | integer constant. |
VL_INT64_C(1234)
is expanded as 123L
in a LP64 system and as 123LL
in a LLP64 system. #define VL_INT32_C | ( | x | ) | x |
Create an integer constant of the specified width and sign.
x | integer constant. |
VL_INT64_C(1234)
is expanded as 123L
in a LP64 system and as 123LL
in a LLP64 system. #define VL_INT64_C | ( | x | ) | x ## LL |
Create an integer constant of the specified width and sign.
x | integer constant. |
VL_INT64_C(1234)
is expanded as 123L
in a LP64 system and as 123LL
in a LLP64 system. #define VL_INT8_C | ( | x | ) | x |
Create an integer constant of the specified width and sign.
x | integer constant. |
VL_INT64_C(1234)
is expanded as 123L
in a LP64 system and as 123LL
in a LLP64 system. #define VL_SMALL_INT (- VL_BIG_INT - 1) |
#define VL_STRINGIFY | ( | x | ) | # x |
Convert the argument to a string.
x | value to be stringified. |
This macro stringifies the argument x by means of the #
prerpocessor operator.
The standard C preprocessor does not prescan arguments which are stringified, so
#define A B char const * str = VL_STRINGIFY(A) ;
initializes str
with a pointer to the string "A"
, which mihgt be unexpected. To fix this issue, you can use VL_XSTRINGIFY.
#define VL_UINT16_C | ( | x | ) | x |
Create an integer constant of the specified width and sign.
x | integer constant. |
VL_INT64_C(1234)
is expanded as 123L
in a LP64 system and as 123LL
in a LLP64 system. #define VL_UINT32_C | ( | x | ) | x ## U |
Create an integer constant of the specified width and sign.
x | integer constant. |
VL_INT64_C(1234)
is expanded as 123L
in a LP64 system and as 123LL
in a LLP64 system. #define VL_UINT64_C | ( | x | ) | x ## ULL |
Create an integer constant of the specified width and sign.
x | integer constant. |
VL_INT64_C(1234)
is expanded as 123L
in a LP64 system and as 123LL
in a LLP64 system. #define VL_UINT8_C | ( | x | ) | x |
Create an integer constant of the specified width and sign.
x | integer constant. |
VL_INT64_C(1234)
is expanded as 123L
in a LP64 system and as 123LL
in a LLP64 system. Expand and then concatenate four arguments into a lexical unit.
x | first argument to be concatenated. |
y | second argument to be concatenated. |
z | third argument to be concatenated. |
u | fourth argument to be concatenated. |
This macro is the same as VL_XCAT, except that it has four arguments.
Expand and then concatenate five arguments into a lexical unit.
x | first argument to be concatenated. |
y | second argument to be concatenated. |
z | third argument to be concatenated. |
u | fourth argument to be concatenated. |
v | fifth argument to be concatenated. |
This macro is the same as VL_XCAT, except that it has five arguments.
#define VL_XSTRINGIFY | ( | x | ) | VL_STRINGIFY(x) |
Expand and then convert the argument to a string.
x | value to be macro-expanded and converted. |
This macro macro-expands the argument x and stringifies the result of the expansion. For instance
#define A B char const * str = VL_STRINGIFY(A) ;
initializes str
with a pointer to the string "B"
.
#define VL_YESNO | ( | x | ) | ((x)?"yes":"no") |
typedef vl_uint32 vl_uintptr |
typedef struct _VlX86CpuInfo VlX86CpuInfo |
void _vl_x86cpu_info_init | ( | VlX86CpuInfo * | self | ) |
char* _vl_x86cpu_info_to_string_copy | ( | VlX86CpuInfo const * | self | ) |
VL_EXPORT char* vl_static_configuration_to_string_copy | ( | ) |
Human readable static library configuration.
------------------------------------------------------------------
The string includes information about the compiler, the host, and other static configuration parameters. The string must be released by vl_free.
VL_INLINE void vl_swap_host_big_endianness_2 | ( | void * | dst, |
void * | src | ||
) |
Host <-> big endian transformation for 2-bytes value.
------------------------------------------------------------------
dst | destination 2-byte buffer. |
src | source 2-byte bufffer. |
VL_INLINE void vl_swap_host_big_endianness_4 | ( | void * | dst, |
void * | src | ||
) |
Host <-> big endian transformation for 4-bytes value.
------------------------------------------------------------------
dst | destination 4-byte buffer. |
src | source 4-byte bufffer. |
VL_INLINE void vl_swap_host_big_endianness_8 | ( | void * | dst, |
void * | src | ||
) |
Host <-> big endian transformation for 8-bytes value.
------------------------------------------------------------------
dst | destination 8-byte buffer. |
src | source 8-byte bufffer. |