Data Structures | |
union | fid_Uint48 |
A type that represents either 32 or 64 bit unsigned integer. More... | |
union | fid_Uint48constptr |
A type that represents const pointers to either 32 or 64 bit unsigned integers. More... | |
Defines | |
#define | fid_WORDSIZE 32 |
The native integer size. | |
#define | fid_U64FMT "%llu" |
Format string for printing a fid_Uint64 value. | |
#define | fid_S64FMT "%lld" |
Format string for printing a fid_Sint64 value. | |
#define | fid_UINT64_MAX ((fid_Uint64)~(fid_Uint64)0) |
Maximum value of a fid_Uint64. | |
#define | fid_UINT32_MAX ((fid_Uint32)~(fid_Uint32)0) |
Maximum value of a fid_Uint32. | |
#define | fid_UINT16_MAX ((fid_Uint16)~(fid_Uint16)0) |
Maximum value of a fid_Uint16. | |
#define | fid_U32FMT "%u" |
Format string for printing a fid_Uint32 value. | |
#define | fid_S32FMT "%d" |
Format string for printing a fid_Sint32 value. | |
#define | fid_TABREQFMT "%08x" |
Format string for printing a table request bitmask. | |
#define | fid_SWITCH48(UISIZE, CODE32, CODE64) |
Branch code into 32 and 64 bit versions. | |
#define | fid_ASSIGN48(VAR, UISIZE, VAL) fid_SWITCH48(UISIZE,(VAR).v_uint32=(VAL);,(VAR).v_uint64=(VAL);) |
Assign value to a fid_Uint48 or fid_Uint48constptr type. | |
#define | fid_VALUE48(UISIZE, VAL) ((UISIZE) == fid_UINTSIZE_32?(VAL).v_uint32:(VAL).v_uint64) |
Fetch value from a fid_Uint48 or fid_Uint48constptr type. | |
#define | fid_PRINT48(UISIZE, VAL) |
Fetch value from a fid_Uint48 type for printing. | |
Typedefs | |
typedef unsigned long long | fid_Uint64 |
Unsigned 64 bit integer type. | |
typedef signed long long | fid_Sint64 |
Signed 64 bit integer type. | |
typedef unsigned int | fid_Uint32 |
Unsigned 32 bit integer type. | |
typedef signed int | fid_Sint32 |
Signed 32 bit integer type. | |
typedef unsigned short | fid_Uint16 |
Unsigned 16 bit integer type. | |
typedef signed short | fid_Sint16 |
Signed 16 bit integer type. | |
Enumerations | |
enum | fid_Uintsize { fid_UINTSIZE_UNDEF = 1, fid_UINTSIZE_32, fid_UINTSIZE_64 } |
Type of integers used in some structure, i.e., fid_Uint48. More... |
#define fid_WORDSIZE 32 |
The native integer size.
This is defined to either 32 or 64. Its value is figured via feature test macros. Types like fid_Uint64 are defined depending on the value of this symbol.
Definition at line 43 of file libfidinttypes.h.
Referenced by fid_projectfile_init().
#define fid_U64FMT "%llu" |
Format string for printing a fid_Uint64 value.
Always use this for printing values of type fid_Uint64. Never use %lu
or %llu
directly for printing a fid_Uint64 value. The reason is that fid_Uint64 may be defined differently on different platforms, so there can be no fixed format string that is correct on all platforms,
Definition at line 89 of file libfidinttypes.h.
Referenced by fid_projectfile_dump(), fid_projectfile_write(), and fid_suffixarray_dump().
#define fid_S64FMT "%lld" |
Format string for printing a fid_Sint64 value.
Always use this for printing values of type fid_Sint64.
Definition at line 90 of file libfidinttypes.h.
#define fid_UINT64_MAX ((fid_Uint64)~(fid_Uint64)0) |
#define fid_UINT32_MAX ((fid_Uint32)~(fid_Uint32)0) |
#define fid_UINT16_MAX ((fid_Uint16)~(fid_Uint16)0) |
#define fid_U32FMT "%u" |
Format string for printing a fid_Uint32 value.
This should be used for printing values of type fid_Uint32. Raw int values or other raw C type values, however, should be printed using their respective standard format strings.
Definition at line 122 of file libfidinttypes.h.
#define fid_S32FMT "%d" |
Format string for printing a fid_Sint32 value.
This should be used for printing values of type fid_Sint32.
Definition at line 131 of file libfidinttypes.h.
#define fid_TABREQFMT "%08x" |
Format string for printing a table request bitmask.
This should be used for printing values of type fid_Tablerequest.
Definition at line 138 of file libfidinttypes.h.
#define fid_SWITCH48 | ( | UISIZE, | |||
CODE32, | |||||
CODE64 | ) |
Value:
switch(UISIZE)\ {\ case fid_UINTSIZE_32:\ CODE32\ break;\ case fid_UINTSIZE_64:\ CODE64\ break;\ default:\ abort();\ }
If UISIZE
contains an invalid value, then the program will be terminated by calling abort()
.
UISIZE | A value of type fid_Uintsize. | |
CODE32 | 32 bit code. | |
CODE64 | 64 bit code. |
Definition at line 214 of file libfidinttypes.h.
Referenced by fid_projectfile_init_from_suffixarray(), fid_sequences_compute_distribution(), fid_sequences_init(), fid_sequences_parse_from_memory_to_file(), fid_sequences_parse_from_memory_to_memory(), fid_sequences_realize(), fid_suffixarray_dump(), fid_suffixarray_init(), fid_suffixarray_load_from_project(), and fid_suffixarray_realize().
#define fid_ASSIGN48 | ( | VAR, | |||
UISIZE, | |||||
VAL | ) | fid_SWITCH48(UISIZE,(VAR).v_uint32=(VAL);,(VAR).v_uint64=(VAL);) |
Assign value to a fid_Uint48 or fid_Uint48constptr type.
VAR | Variable of type fid_Uint48 or fid_Uint48constptr. | |
UISIZE | A value of type fid_Uintsize. | |
VAL | An integer value. No type cast is performed. |
Definition at line 234 of file libfidinttypes.h.
#define fid_VALUE48 | ( | UISIZE, | |||
VAL | ) | ((UISIZE) == fid_UINTSIZE_32?(VAL).v_uint32:(VAL).v_uint64) |
Fetch value from a fid_Uint48 or fid_Uint48constptr type.
UISIZE | A value of type fid_Uintsize. | |
VAL | A value of type fid_Uint48. |
VAL
.UISIZE
contains an invalid value. Definition at line 247 of file libfidinttypes.h.
#define fid_PRINT48 | ( | UISIZE, | |||
VAL | ) |
Value:
((UISIZE) == fid_UINTSIZE_32\ ?(fid_Uint64)(VAL).v_uint32\ :(VAL).v_uint64)
Use the fid_U64FMT format string to print values returned by this macro.
UISIZE | A value of type fid_Uintsize. | |
VAL | A value of type fid_Uint48. |
VAL
as fid_Uint64 value.UISIZE
contains an invalid value. Definition at line 262 of file libfidinttypes.h.
Referenced by fid_suffixarray_dump().
enum fid_Uintsize |
Type of integers used in some structure, i.e., fid_Uint48.
Some data types, i.e., fid_Uint48 and fid_Suffixarray can store data represented by either 32 or 64 bit values. In order to be able to decide between these where it is necessary, a type identifier is stored along with the data.
Instead of using a simple boolean to switch between 32/64 bit code, we use this enumeration. The enumeration begins at 1 in order to catch uninitialized values at runtime (indicating a programming error).
fid_UINTSIZE_UNDEF | Undefined integer size. |
fid_UINTSIZE_32 | Integer size is 32 bits. |
fid_UINTSIZE_64 | Integer size is 64 bits. |
Definition at line 154 of file libfidinttypes.h.