libcommonc++
0.7
|
Go to the source code of this file.
Namespaces | |
ccxx | |
Macros | |
#define | __STDC_FORMAT_MACROS |
#define | INT64_CONST(I) int64_t(I ## LL) |
Declare a signed 64-bit integer constant I. More... | |
#define | UINT64_CONST(I) uint64_t(I ## ULL) |
Declare an unsigned 64-bit integer constant I. More... | |
#define | INT8_MIN (-128) |
The minimum value for a signed 8-bit integer. More... | |
#define | INT16_MIN (-32767-1) |
The minimum value for a signed 16-bit integer. More... | |
#define | INT32_MIN (-2147483647-1) |
The minimum value for a signed 32-bit integer. More... | |
#define | INT64_MIN (INT64_CONST(-9223372036854775807)-1) |
The minimum value for a signed 64-bit integer. More... | |
#define | INT8_MAX (127) |
The maximum value for a signed 8-bit integer. More... | |
#define | INT16_MAX (32767) |
The maximum value for a signed 16-bit integer. More... | |
#define | INT32_MAX (2147483647) |
The maximum value for a signed 32-bit integer. More... | |
#define | INT64_MAX (INT64_CONST(9223372036854775807)) |
The maximum value for a signed 64-bit integer. More... | |
#define | UINT8_MAX (255U) |
The maximum value for an unsigned 8-bit integer. More... | |
#define | UINT16_MAX (65535U) |
The maximum value for an unsigned 16-bit integer. More... | |
#define | UINT32_MAX (4294967295U) |
The maximum value for an unsigned 32-bit integer. More... | |
#define | UINT64_MAX (UINT64_CONST(18446744073709551615)) |
The maximum value for an unsigned 64-bit integer. More... | |
#define | INT64_FMT "%" PRId64 |
The printf() formatting directive for signed 64-bit integers. More... | |
#define | UINT64_FMT "%" PRIu64 |
The printf() formatting directive for unsigned 64-bit integers. More... | |
#define | INT64_P_FMT(W) "%" #W PRId64 |
The parameterized printf() formatting directive for signed 64-bit integers; W indicates the field width. More... | |
#define | UINT64_P_FMT(W) "%" #W PRIu64 |
The parameterized printf() formatting directive for unsigned 64-bit integers; W indicates the field width. More... | |
#define | CCXX_BIT_SET(N, BIT) ((N) |= (1 << (BIT))) |
Set the bit at index BIT (where 0 corresponds to the LSB) in N. More... | |
#define | CCXX_BIT_CLEAR(N, BIT) (((N) &= ~(1 << (BIT)))) |
Clear the bit at index BIT (where 0 corresponds to the LSB) in N. More... | |
#define | CCXX_BIT_READ(N, BIT) ((((N) & (1 << (BIT))) == 0) ? 0 : 1) |
Read the bit at index BIT (where 0 corresponds to the LSB) in N. More... | |
#define | CCXX_BIT_WRITE(N, BIT, VALUE) ((VALUE) ? CCXX_BIT_SET((N), (BIT)) : CCXX_BIT_CLEAR((N), (BIT))) |
Write the bit at index BIT (where 0 corresponds to the LSB) in N. More... | |
#define | CCXX_BIT_TEST(N, BIT) (((N) & (1 << (BIT))) != 0) |
Test the bit at index BIT (where 0 corresponds to the LSB) in N. More... | |
Typedefs | |
typedef unsigned char | byte_t |
An unsigned 8-bit value. More... | |
typedef unsigned int | uint_t |
An alias for unsigned int. More... | |
typedef int32_t | time_s_t |
A time expressed in seconds since the epoch (00:00:00, UTC, January 1, 1970). More... | |
typedef int | timespan_s_t |
A timespan expressed in seconds. More... | |
typedef int64_t | time_ms_t |
A time expressed in milliseconds since the epoch (00:00:00, UTC, January 1, 1970). More... | |
typedef int | timespan_ms_t |
A timespan expressed in milliseconds. More... | |
#define __STDC_FORMAT_MACROS |
#define CCXX_BIT_CLEAR | ( | N, | |
BIT | |||
) | (((N) &= ~(1 << (BIT)))) |
Clear the bit at index BIT (where 0 corresponds to the LSB) in N.
The arguments are evaluated only once.
#define CCXX_BIT_READ | ( | N, | |
BIT | |||
) | ((((N) & (1 << (BIT))) == 0) ? 0 : 1) |
Read the bit at index BIT (where 0 corresponds to the LSB) in N.
Returns 0 or 1. The arguments are evaluated only once.
#define CCXX_BIT_SET | ( | N, | |
BIT | |||
) | ((N) |= (1 << (BIT))) |
Set the bit at index BIT (where 0 corresponds to the LSB) in N.
The arguments are evaluated only once.
#define CCXX_BIT_TEST | ( | N, | |
BIT | |||
) | (((N) & (1 << (BIT))) != 0) |
Test the bit at index BIT (where 0 corresponds to the LSB) in N.
Returns true if the bit is set, false otherwise. The arguments are evaluated only once.
#define CCXX_BIT_WRITE | ( | N, | |
BIT, | |||
VALUE | |||
) | ((VALUE) ? CCXX_BIT_SET((N), (BIT)) : CCXX_BIT_CLEAR((N), (BIT))) |
Write the bit at index BIT (where 0 corresponds to the LSB) in N.
VALUE is zero (or false) to clear the bit, nonzero (or true) to set the bit. The arguments are evaluated only once.
#define INT16_MAX (32767) |
The maximum value for a signed 16-bit integer.
#define INT16_MIN (-32767-1) |
The minimum value for a signed 16-bit integer.
#define INT32_MAX (2147483647) |
The maximum value for a signed 32-bit integer.
#define INT32_MIN (-2147483647-1) |
The minimum value for a signed 32-bit integer.
#define INT64_CONST | ( | I | ) | int64_t(I ## LL) |
Declare a signed 64-bit integer constant I.
#define INT64_FMT "%" PRId64 |
The printf() formatting directive for signed 64-bit integers.
#define INT64_MAX (INT64_CONST(9223372036854775807)) |
The maximum value for a signed 64-bit integer.
#define INT64_MIN (INT64_CONST(-9223372036854775807)-1) |
The minimum value for a signed 64-bit integer.
#define INT64_P_FMT | ( | W | ) | "%" #W PRId64 |
The parameterized printf() formatting directive for signed 64-bit integers; W indicates the field width.
#define INT8_MAX (127) |
The maximum value for a signed 8-bit integer.
#define INT8_MIN (-128) |
The minimum value for a signed 8-bit integer.
#define UINT16_MAX (65535U) |
The maximum value for an unsigned 16-bit integer.
#define UINT32_MAX (4294967295U) |
The maximum value for an unsigned 32-bit integer.
#define UINT64_CONST | ( | I | ) | uint64_t(I ## ULL) |
Declare an unsigned 64-bit integer constant I.
#define UINT64_FMT "%" PRIu64 |
The printf() formatting directive for unsigned 64-bit integers.
#define UINT64_MAX (UINT64_CONST(18446744073709551615)) |
The maximum value for an unsigned 64-bit integer.
#define UINT64_P_FMT | ( | W | ) | "%" #W PRIu64 |
The parameterized printf() formatting directive for unsigned 64-bit integers; W indicates the field width.
#define UINT8_MAX (255U) |
The maximum value for an unsigned 8-bit integer.