src/libs/elektra/keyset.c
/**
 * @internal
 *
 * Copies all Keys until the end of the array from a position
 * in the array to an position in the array.
 *
 * @param ks the keyset where this should be done
 * @param to the position where it should be copied to
 * @param from the position where it should be copied from
 * @return the number of moved elements
 */
@internal
Copies all Keys until the end of the array from a position
in the array to an position in the array.

@param ks the keyset where this should be done
@param to the position where it should be copied to
@param from the position where it should be copied from
@return the number of moved elements
@internal Copies all Keys until the end of the array from a position in the array to an position in the array . @param ks the keyset where this should be done @param to the position where it should be copied to @param from the position where it should be copied from @return the number of moved elements
ssize_t ksCopyInternal (KeySet * ks, size_t to, size_t from)
{
	ssize_t ssize = ks->size;
	ssize_t sto = to;
	ssize_t sfrom = from;
	ssize_t sizediff = sto - sfrom;
	ssize_t length = ssize - sfrom;
	size_t ret = 0;
	ELEKTRA_ASSERT (length >= 0, "length %zu too small", length);
	ELEKTRA_ASSERT (ks->size >= to, "ks->size %zu smaller than %zu", ks->size, to);
	ks->size += sizediff;
	if (length != 0)
	{
		ret = elektraMemmove (ks->array + to, ks->array + from, length);
	}
	ks->array[ks->size] = 0;
	return ret;
}
ssize_t ksCopyInternal ( KeySet * ks , size_t to , size_t from ) { ssize_t ssize = ks -> size ; ssize_t sto = to ; ssize_t sfrom = from ; ssize_t sizediff = sto - sfrom ; ssize_t length = ssize - sfrom ; size_t ret = 0 ; ELEKTRA_ASSERT ( length >= 0 , " " , length ) ; ELEKTRA_ASSERT ( ks -> size >= to , " " , ks -> size , to ) ; ks -> size += sizediff ; if ( length != 0 ) { ret = elektraMemmove ( ks -> array + to , ks -> array + from , length ) ; } ks -> array [ ks -> size ] = 0 ; return ret ; }
@internal
 Copies all Keys until the end of the array from a position
 in the array to an position in the array.
@internal Copies all Keys until the end of the array from a position in the array to an position in the array .