shorten_buffer -- reduces the size of a buffer.
Arguments
- buffer
The buffer to shorten.
- n_elements
The number of elements that the buffer is to be reduced to.
Returns
The shortened buffer.
Description
This function reduces the size of a buffer by cutting off any elements which extend beyond the given size. This function is analogous to the C function, realloc.
Example
Gamma> b = buffer(119,120,121,122);
#{wxyz}
Gamma> shorten_buffer(b,3);
#{wxy}
Gamma>
Copyright 1995-2002 by
Cogent Real-Time Systems, Inc.