This is simpler and more efficient than klist.h for implementing queues that support insertion or removal at arbitrary positions.