Hosted by the courtesy of  
http://www.free.fr 
The stars ASAP english francais spanish arab
Durée du voyage intersidéral francais
Résolutions de l'ONU en HTML francais
Bussard Ramjet english francais
DWARF : dwarf2xml english
ELF : libelf examples english
Code presentation : ctoohtml english

Interface


o Structures
o Selftest (macro)
The ring integrity routine.
o Test node is in a ring (macro)
Is this node in the this ring ?.
o Link (macro)
Hold a new node in the ring.
o Unlink (macro)
Remove reference from this node.
o Next (macro)
the next node.
o List (macro)
the next node, with loop detection.
o Do, done (macro)
A loop macro construction helper.
o Find by name (macro)
For named ring, find a node with his name.
o Previous (macro)
For double ring, expand to previous node.
o Move (macro)
For double ring,jump n nodes back or force.
o Errors
o Maintenance
o C API
The C fonctions set that implement rings
The interface let you to add, remove and list nodes in the ring. The most interresting way is to use macros. In order to use them, you have to include in your node structure a member that hold the ring information, for example :
      struct s_my_ring_node {
         int an_usefull_integer;
         short a_counter;
         s_ring link; // ring stuff
         struct s_data my_datas[];
      };
is ready to be use in a ring :
static struct s_my_ring_node *my_ring; // don't lose holding pointer !
   ...
   struct s_my_ring_node a_node;
   ...
   my_ring = m_ring_link(my_ring, link, &a_node);
   ...
That's it, a_node is now linked in the ring. Remember that rings does not care about memory management.
When the ring is empty, it's holding pointer is null. The link method accept null pointers and add the new node in the ring, linking its reference pointer on it self. A pointer to the new added node is always returned by the link method.
This is also true for the unlink method. The ring must always be hold by the result of theses 2 methods.
Successor and, when possibly ancestor, can be listed with next and previous methods. Linked pieces of memory in the ring must, at least, contain somewhere the suitable structure for the ring type there are in.
There are several, and potentially plenty, possible types of rings. The most simple is a simple pointer ring.

Alphabetic index



This page was generated with the help of DOC++.
from : machinman.net, updated on Tue May 17 16:19:41 CEST 2022

Hosted by the courtesy of  
http://www.free.fr 
The stars ASAP english francais spanish
Durée du voyage intersidéral francais
Résolutions de l'ONU en HTML francais
Bussard Ramjet english francais
DWARF : dwarf2xml english
ELF : libelf examples english
Code presentation : ctoohtml english