r6:Function:queue new

From liblfds.org
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Source Files

/src/queue/queue_new.c
/inc/liblfds.h

Prototype

int queue_new( struct queue_state **qs, atom_t number_elements );

Parameters

struct queue_state **qs

The address of a pointer onto which the function allocates the state which represents this queue. The pointer is set to NULL if queue creation fails.

atom_t number_elements

The maximum number of elements which can be present in the queue. If not all elements could be allocated (malloc() fails), qeue creation fails.

Return Value

Returns 1 on success and 0 on failure, with *qs being set to NULL on failure.

Notes

This function instantiates a queue.

See Also