shorten_buffer

shorten_buffer --  reduces the size of a buffer.

Syntax

shorten_buffer (buffer, n_elements)

		

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> 
    		

See Also

buffer, make_buffer

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.