Generic implementation of the queue in C.