src/stdlib/sequence.c
/*==================================================
 * tinsseq -- Insert new element at tail of sequence
 *================================================*/
- Insert new element at tail of sequence
- Insert new element at tail of sequence
SEQUENCE
tinsseq (SEQUENCE seq,
         ELEMENT el)
{
	INT i, n;
	ELEMENT *old = Data(seq);
	if ((n = Size(seq)) == Max(seq))  {
		ELEMENT *new = (ELEMENT *) stdalloc(sizeof(ELEMENT)*
		    (n + Inc(seq)));
		for (i = 0; i < n; i++)
			new[i] = old[i];
		stdfree(old);
		Data(seq) = old = new;
		Max(seq) += Inc(seq);
	}
	old[Size(seq)++] = el;
	return seq;
}
SEQUENCE tinsseq ( SEQUENCE seq , ELEMENT el ) { INT i , n ; ELEMENT * old = Data ( seq ) ; if ( ( n = Size ( seq ) ) == Max ( seq ) ) { ELEMENT * new = ( ELEMENT * ) stdalloc ( sizeof ( ELEMENT ) * ( n + Inc ( seq ) ) ) ; for ( i = 0 ; i < n ; i ++ ) new [ i ] = old [ i ] ; stdfree ( old ) ; Data ( seq ) = old = new ; Max ( seq ) += Inc ( seq ) ; } old [ Size ( seq ) ++ ] = el ; return seq ; }
tinsseq -- Insert new element at tail of sequence
tinsseq -- Insert new element at tail of sequence