lib/stream: Add stream_discard, to discard read data from a stream

* stream.c: (stream_discard) Discard the already data from a stream, as
  indicated by the getp. Move remaining, unread data, to the beginning of
  the stream. get and end stream pointers are updated as appropriate.

  If all data has been consumed, then this behaves identically to
  stream_reset.
2 files changed