UniRec  2.9.3
Data Structures | Macros | Functions
Links API

Data Structures

Macros

#define MAX_LINK_COUNT   64
 

Functions

ur_links_tur_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...
 

Detailed Description


Data Structure Documentation

◆ ur_links_t

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).

Definition at line 70 of file links.h.

Data Fields
unsigned int link_count
uint64_t * link_indexes
uint64_t link_mask

Macro Definition Documentation

◆ MAX_LINK_COUNT

#define MAX_LINK_COUNT   64

Definition at line 64 of file links.h.

Function Documentation

◆ ur_create_links()

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.

Parameters
[in]maskString with link mask in hexadecimal format.
Returns
Pointer to newly created links structure or NULL on error.

Definition at line 1689 of file unirec.c.

◆ ur_free_links()

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.

Parameters
[in]linksPointer to the links structure.

Definition at line 1741 of file unirec.c.

◆ ur_get_link_bit_field_position()

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.

Parameters
[in]linksPointer to the links structure.
[in]indexIndex of link from interval 0 - (link_count-1).
Returns
Position in link_bit_field.

Definition at line 124 of file links.h.

◆ ur_get_link_count()

INLINE unsigned int ur_get_link_count ( ur_links_t links)

Get link count.

Parameters
[in]linksPointer to the links structure.
Returns
Count of used links.

Definition at line 147 of file links.h.

◆ ur_get_link_index()

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.

Parameters
[in]linksPointer to the links structure.
[in]link_bit_fieldLink bit field of given link.
Returns
Index of given link from interval 0 - (link_count-1).

Definition at line 103 of file links.h.

◆ ur_get_link_mask()

INLINE uint64_t ur_get_link_mask ( ur_links_t links)

Get link mask.

Parameters
[in]linksPointer to the links structure.
Returns
Link mask in 64bit unsigned int.

Definition at line 138 of file links.h.