UniRec
2.9.3
|
Data Structures | |
struct | ur_links_t |
Links structure. It contains a link count, link mask and link indexes. Array link_indexes stores positions in LINK_BIT_FIELD for used links (1-n), so one can easily compare LINK_BIT_FIELD with some link, indexed by common indexes 0 - (1-n). More... | |
Macros | |
#define | MAX_LINK_COUNT 64 |
Functions | |
ur_links_t * | ur_create_links (const char *mask) |
Create and initialize links structure. Create new links structure and initialize it from link mask in string format passed by parameter. String link mask is stored in uint64_t, thne link count and link_indexes arrray is determined from it. Structure created by this function should be destroyed by ur_free_links. More... | |
void | ur_free_links (ur_links_t *links) |
Destroy links structure. Free all memory allocated for a links structure created previously by ur_create_links. More... | |
INLINE int | ur_get_link_index (ur_links_t *links, uint64_t link_bit_field) |
Get index of link (0 - (n-1)) Function gets search link_indexes array for value corresponding to passed LINK_BIT_FIELD, which should contains only one "1" value. If more ones are filled in LINK_BIT_FIELD, first from right is taken. Returns index to link_indexes array (from interval 0 - (link_count-1)) or negative value if correspondig value was not found. More... | |
INLINE uint64_t | ur_get_link_bit_field_position (ur_links_t *links, unsigned int index) |
Get position in link_bit_field of link. Get position in link_bit_field of link specified by index of link (from interval 0 - (link_count-1)). This function is inversion to get_link_index. Returns zero if invalid index is passed. More... | |
INLINE uint64_t | ur_get_link_mask (ur_links_t *links) |
Get link mask. More... | |
INLINE unsigned int | ur_get_link_count (ur_links_t *links) |
Get link count. More... | |
struct ur_links_t |
Links structure. It contains a link count, link mask and link indexes. Array link_indexes stores positions in LINK_BIT_FIELD for used links (1-n), so one can easily compare LINK_BIT_FIELD with some link, indexed by common indexes 0 - (1-n).
Data Fields | ||
---|---|---|
unsigned int | link_count | |
uint64_t * | link_indexes | |
uint64_t | link_mask |
ur_links_t* ur_create_links | ( | const char * | mask | ) |
Create and initialize links structure. Create new links structure and initialize it from link mask in string format passed by parameter. String link mask is stored in uint64_t, thne link count and link_indexes arrray is determined from it. Structure created by this function should be destroyed by ur_free_links.
[in] | mask | String with link mask in hexadecimal format. |
void ur_free_links | ( | ur_links_t * | links | ) |
INLINE uint64_t ur_get_link_bit_field_position | ( | ur_links_t * | links, |
unsigned int | index | ||
) |
Get position in link_bit_field of link. Get position in link_bit_field of link specified by index of link (from interval 0 - (link_count-1)). This function is inversion to get_link_index. Returns zero if invalid index is passed.
[in] | links | Pointer to the links structure. |
[in] | index | Index of link from interval 0 - (link_count-1). |
INLINE unsigned int ur_get_link_count | ( | ur_links_t * | links | ) |
INLINE int ur_get_link_index | ( | ur_links_t * | links, |
uint64_t | link_bit_field | ||
) |
Get index of link (0 - (n-1)) Function gets search link_indexes array for value corresponding to passed LINK_BIT_FIELD, which should contains only one "1" value. If more ones are filled in LINK_BIT_FIELD, first from right is taken. Returns index to link_indexes array (from interval 0 - (link_count-1)) or negative value if correspondig value was not found.
[in] | links | Pointer to the links structure. |
[in] | link_bit_field | Link bit field of given link. |
INLINE uint64_t ur_get_link_mask | ( | ur_links_t * | links | ) |