cmd: Reimplement console buffer system as a cyclic doubly linked list
This implements cbuf_t, cbuf_cmd_t, and an assorted array of helper
functions for handling the linked list(s). This also ports the defer
command to use the new system.
Each list node allocated will not be freed, except deferred commands,
mainly to avoid a Z_Malloc and Z_Free every time a player uses the
controls. Nodes are recycled in a separate linked list. This should be
okay as the memory usage is quite negligible
This new system has several advantages, namely, multiple command
interpreters may share the same console buffer on the same thread, and
each command will be executed in order, eliminating any potential bugs
related to execution order (which have already happened).
I haven't noticed any performance decrease and the new system works
exactly as the old one did.
Enjoy!
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12886
d7cf8633-e32d-0410-b094-
e92efae38249