mbgtools-lx
4.2.8
|
#include <mbg_tgt.h>
Go to the source code of this file.
Data Structures | |
struct | MBG_CODE_NAME_TABLE_ENTRY |
A table entry which can be used to map codes to names. More... | |
struct | NANO_TIME |
A timestamp with nanosecond resolution. More... | |
struct | NANO_TIME_64 |
A timestamp with nanosecond resolution, but 64 bit size. More... | |
Macros | |
#define | _IS_MBG_FIRMWARE 0 |
#define | _ext extern |
#define | MBG_TGT_HAS_64BIT_TYPES 1 |
#define | _abs64(_i) ( (int64_t) ( ( (_i) < 0 ) ? -(_i) : (_i) ) ) |
#define | uchar uchar |
#define | ushort ushort |
#define | uint uint |
#define | ulong ulong |
#define | udouble udouble |
#define | byte byte |
#define | word word |
#define | longword longword |
#define | bool bool |
#define | true 1 |
#define | false 0 |
#define | bit bit |
#define | _BIT_REDEFINED 1 |
#define | BYTE_0(_x) ( (uint8_t ) ( (_x) & 0xFF ) ) |
#define | BYTE_1(_x) ( (uint8_t ) ( ( ( (uint16_t) (_x) ) >> 8 ) & 0xFF ) ) |
#define | BYTE_2(_x) ( (uint8_t ) ( ( ( (uint32_t) (_x) ) >> 16 ) & 0xFF ) ) |
#define | BYTE_3(_x) ( (uint8_t ) ( ( ( (uint32_t) (_x) ) >> 24 ) & 0xFF ) ) |
#define | HI_BYTE(_x) ( (uint8_t ) ( (_x) >> 8 ) ) |
#define | LO_BYTE(_x) ( (uint8_t ) ( (_x) & 0xFF ) ) |
#define | HI_WORD(_x) ( (uint16_t ) ( (_x) >> 16 ) ) |
#define | LO_WORD(_x) ( (uint16_t ) ( (_x) & 0xFFFF ) ) |
#define | BYTE_OF(_v, _n) *( ( (uint8_t *) &(_v) ) + (_n) ) |
#define | WORD_OF(_v, _n) *( ( (uint16_t *) &(_v) ) + (_n) ) |
#define | FBYTE_OF(_v, _n) *( ( (uint8_t far *) &(_v) ) + (_n) ) |
#define | FWORD_OF(_v, _n) *( ( (uint16_t far *) &(_v) ) + (_n) ) |
#define | BYTE_OF_P(_p, _n) *( ( (uint8_t *) (_p) ) + (_n) ) |
#define | WORD_OF_P(_p, _n) *( ( (uint16_t *) (_p) ) + (_n) ) |
#define | _bswap16(_x) |
#define | _bswap32(_x) |
#define | _wswap32(_x) |
#define | _var_bswap16(_v) (_v) = _bswap16( _v ) |
#define | _var_bswap32(_v) (_v) = _bswap32( _v ) |
#define | _hilo_16(_x) (_x) |
#define | _hilo_32(_x) (_x) |
#define | _set_array_bit(_n, _byte_array, _max_bytes) |
#define | _clear_array_bit(_n, _byte_array, _max_bytes) |
#define | _isdigit(_c) ( (_c) >= '0' && (_c) <= '9' ) |
#define | _nop_macro_fnc() do {} while (0) |
#define | _mbg_cn_table_entry(_n) { _n, #_n } |
A macro defining a MBG_CODE_NAME_TABLE_ENTRY. More... | |
#define | _mbg_cn_table_end() { 0, NULL } |
A macro defining an empty MBG_CODE_NAME_TABLE_ENTRY. More... | |
#define | _mbg_swab_nano_time(_p) |
#define | _nano_time_negative(_nt) ( ( (_nt)->secs < 0 ) || ( (_nt)->nano_secs < 0 ) ) |
#define | _nano_time_zero(_nt) ( ( (_nt)->secs == 0 ) && ( (_nt)->nano_secs == 0 ) ) |
#define | _mbg_swab_nano_time_64(_p) |
#define | _nano_time_64_negative(_nt) ( ( (_nt)->secs < 0 ) || ( (_nt)->nano_secs < 0 ) ) |
#define | _nano_time_64_zero(_nt) ( ( (_nt)->secs == 0 ) && ( (_nt)->nano_secs == 0 ) ) |
#define | _int_from_size_t(_n) (_n) |
#define | XSTRINGIFY(x) #x |
A helper macro to implement STRINGIFY correctly. More... | |
#define | STRINGIFY(x) XSTRINGIFY(x) |
Make a string from a constant definition. More... | |
Typedefs | |
typedef char | int8_t |
typedef unsigned char | uint8_t |
typedef short | int16_t |
typedef unsigned short | uint16_t |
typedef __int64 | int64_t |
typedef unsigned __int64 | uint64_t |
typedef unsigned char | uchar |
typedef unsigned short | ushort |
typedef unsigned int | uint |
typedef unsigned long | ulong |
typedef double | udouble |
typedef unsigned char | byte |
typedef unsigned short | word |
typedef unsigned long | longword |
typedef int | bool |
typedef bool | bit |
#define _abs64 | ( | _i | ) | ( (int64_t) ( ( (_i) < 0 ) ? -(_i) : (_i) ) ) |
Definition at line 267 of file words.h.
Referenced by snprint_nano_time_64().
#define _bswap16 | ( | _x | ) |
#define _bswap32 | ( | _x | ) |
#define _clear_array_bit | ( | _n, | |
_byte_array, | |||
_max_bytes | |||
) |
#define _int_from_size_t | ( | _n | ) | (_n) |
Definition at line 662 of file words.h.
Referenced by __to_iso_frac(), ef_check_parm(), ip4_check_parm(), mbg_chk_snprint_results(), mbg_open_device_by_name(), mbg_snprint_date_time(), mbg_snprint_hr_time(), mbg_snprint_hr_time_loc(), mbg_snprint_hr_tstamp(), mbg_snprint_revision(), mbg_str_dev_name(), pcps_str_tm_gps_date_time(), sn_cpy_char_safe(), sn_cpy_str_safe(), snprint_chk_time_info(), snprint_ctry_dt(), snprint_ctry_tm(), snprint_ctry_tm_long(), snprint_ctry_tm_short(), snprint_dev_name(), snprint_gmtime_error(), snprint_hours_mins(), snprint_time_t_to_iso(), and snprint_utc_offs().
#define _mbg_cn_table_end | ( | ) | { 0, NULL } |
A macro defining an empty MBG_CODE_NAME_TABLE_ENTRY.
This is used to terminate a table.
#define _mbg_cn_table_entry | ( | _n | ) | { _n, #_n } |
A macro defining a MBG_CODE_NAME_TABLE_ENTRY.
The stringified parameter is used for the name.
_n | The symbolic name of the numeric code |
#define _mbg_swab_nano_time | ( | _p | ) |
#define _mbg_swab_nano_time_64 | ( | _p | ) |
Definition at line 632 of file words.h.
Referenced by mbgextio_set_fdm_tdev().
#define _nano_time_64_negative | ( | _nt | ) | ( ( (_nt)->secs < 0 ) || ( (_nt)->nano_secs < 0 ) ) |
Check if the value of the NANO_TIME_64 structure _nt is negative
#define _nano_time_64_zero | ( | _nt | ) | ( ( (_nt)->secs == 0 ) && ( (_nt)->nano_secs == 0 ) ) |
Check if the value of the NANO_TIME_64 structure _nt is 0
#define _nano_time_negative | ( | _nt | ) | ( ( (_nt)->secs < 0 ) || ( (_nt)->nano_secs < 0 ) ) |
Check if the value of the NANO_TIME structure _nt is negative
Definition at line 596 of file words.h.
Referenced by snprint_nano_time(), and snprint_nano_time_64().
#define _nano_time_zero | ( | _nt | ) | ( ( (_nt)->secs == 0 ) && ( (_nt)->nano_secs == 0 ) ) |
#define _set_array_bit | ( | _n, | |
_byte_array, | |||
_max_bytes | |||
) |
#define _wswap32 | ( | _x | ) |
#define BYTE_0 | ( | _x | ) | ( (uint8_t ) ( (_x) & 0xFF ) ) |
Definition at line 426 of file words.h.
Referenced by snprint_ip4_addr().
Definition at line 427 of file words.h.
Referenced by snprint_ip4_addr().
#define BYTE_2 | ( | _x | ) | ( (uint8_t ) ( ( ( (uint32_t) (_x) ) >> 16 ) & 0xFF ) ) |
Definition at line 428 of file words.h.
Referenced by snprint_ip4_addr().
#define BYTE_3 | ( | _x | ) | ( (uint8_t ) ( ( ( (uint32_t) (_x) ) >> 24 ) & 0xFF ) ) |
Definition at line 429 of file words.h.
Referenced by snprint_ip4_addr().
#define BYTE_OF | ( | _v, | |
_n | |||
) | *( ( (uint8_t *) &(_v) ) + (_n) ) |
Definition at line 440 of file words.h.
Referenced by mbg_swab_double(), nl_read(), and pcps_read_amcc_s5920().
#define BYTE_OF_P | ( | _p, | |
_n | |||
) | *( ( (uint8_t *) (_p) ) + (_n) ) |
#define FBYTE_OF | ( | _v, | |
_n | |||
) | *( ( (uint8_t far *) &(_v) ) + (_n) ) |
#define FWORD_OF | ( | _v, | |
_n | |||
) | *( ( (uint16_t far *) &(_v) ) + (_n) ) |
#define STRINGIFY | ( | x | ) | XSTRINGIFY(x) |
Make a string from a constant definition.
This macro can be used e.g. to define a constant string on the compiler's command line, e.g. like -DVERSION_STRING="v1.0 BETA". Source code like
may not work for every compiler since the double quotes in VERSION_STRING may be removed when the definition is evaluated. A proper solution is to use the STRINGIFY() macro defined here:
#define WORD_OF | ( | _v, | |
_n | |||
) | *( ( (uint16_t *) &(_v) ) + (_n) ) |
#define WORD_OF_P | ( | _p, | |
_n | |||
) | *( ( (uint16_t *) (_p) ) + (_n) ) |
#define XSTRINGIFY | ( | x | ) | #x |