Sturk 1.0.2
Publish-subscribe C implementation.
Loading...
Searching...
No Matches
cirq.h File Reference

Doubly linked circular list. More...

#include "vx/graph.h"
Include dependency graph for cirq.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define VX_CIRQ(name, type)   VX_GRAPH(name, 2, type)
 Define the cirq.
 
#define vx_cirq_ins(cirq, ...)   VX__CIRQ_INS((cirq), __VA_ARGS__, -1, )
 Insert, at a given position, an entry into a cirq.
 
#define vx_cirq_rem(...)   VX__CIRQ_REM(__VA_ARGS__, 0, )
 Remove, at a given position, an entry from a cirq.
 

Detailed Description

Doubly linked circular list.

This header file provides data types, functions and macros that define and operate on doubly linked circular lists.

Macro Definition Documentation

◆ VX_CIRQ

#define VX_CIRQ (   name,
  type 
)    VX_GRAPH(name, 2, type)

Define the cirq.

Parameters
[in]nameThe name of the type used for the cirq.
[in]typeThe type of the data held by name.

This macro will define a compound type (must be struct or union) name, a type for a cirq entry that holds the data of the type type.

◆ vx_cirq_ins

#define vx_cirq_ins (   cirq,
  ... 
)    VX__CIRQ_INS((cirq), __VA_ARGS__, -1, )

Insert, at a given position, an entry into a cirq.

A call vx_cirq_ins(cirq, entry, pos) will insert the entry into the cirq at the pos. To insert at the head use 0 for the pos and to insert at the tail use -1 for the pos. The argument pos is optional and by default it equals -1.

Returns
The new head.

◆ vx_cirq_rem

#define vx_cirq_rem (   ...)    VX__CIRQ_REM(__VA_ARGS__, 0, )

Remove, at a given position, an entry from a cirq.

A call vx_cirq_rem(cirqp, pos) will remove an entry from the cirqp at the pos and will return the removed entry. To remove from the head use 0 for the pos and to remove from the tail use -1 for the pos. The argument pos is optional and by default it equals 0.

Returns
The removed entry.