Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/i/insque.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/i/insque.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/i/insque.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/i/insque.html on line 8

insque()

Insert an element into a doubly linked queue

Synopsis:

#include <search.h>

void insque( void *elem,
             void *pred);

Arguments:

elem
A pointer to the element you want to insert.
pred
A pointer to the previous element in the list, or NULL if you want to initialize the head of the list.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.


Note: This function is in libc.a, but not in libc.so (in order to save space).

Description:

The insque() function inserts the element pointed to by elem into a doubly linked queue immediately after the element pointed to by pred. The queue can be either circular or linear.

The first two members of the elements must be pointers to the same type of structure; the names of the members don't matter. The first member of the structure is a forward pointer to the next element in the queue, and the second is a backward pointer to the previous element. The application can define any additional members in the structure.

If the queue is linear, the queue is terminated with NULL pointers.

If the queue is to be used as a linear list, invoking insque( &element, NULL), where element is the initial element of the queue, initializes the forward and backward pointers of the element to NULL.

If you intend to use the queue as a circular list, initialize the forward pointer and the backward pointer of the initial element of the queue to the element's own address.

You can use remque() to remove elements from the queue.

Classification:

POSIX 1003.1 XSI

Safety:
Cancellation point No
Interrupt handler Yes
Signal handler Yes
Thread Yes

See also:

remque()


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/i/insque.html on line 155

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/i/insque.html on line 155