next up previous contents
Next: Non-Volatile Queue (NVQ_) Up: OPEN C PLATFORM Previous: Queue Module (QU_)   Contents

Subsections

Sequence Module (SEQ_)

    #include "seq.h"

    SEQ_PoolDesc SEQ_poolCreate(Int sizeOfElem, Int nuOfElems);
    Void SEQ_poolFree(SEQ_PoolDesc pool);

    Ptr SEQ_elemObtain(SEQ_PoolDesc pool);
    Void SEQ_elemRelease(SEQ_PoolDesc pool, Ptr elem);

SEQ_ module provides simple fixed size dynamic memory allocation capabilities for linked list elements. In conjunction with the QU_ module, sequences and sets implemented as linked lists can conveniently be maintained.

Memory for a number of elements within a sequence can initially be obtained through SEQ_poolCreate facility. As new elements of a set or a sequence are needed they can be obtained through SEQ_elemObtain facility. Sequence or set elements can be released back into the pool through the SEQ_elemRelease facility.

Example Usage

The following code fragment demonstrate the use of Queue management facilities.

Click here to see the complete codes. This example does not perform any useful task but demonstrates how the Queue manipulation facilities can be used to transfer some data through a queue. Flow of this example program is:

        /* Call Graph */