src/libs/elektra/keyset.c
/**
 * @internal
 *
 * KeySet object cleaner.
 *
 * Will keyDel() all contained keys, reset internal pointers and counters.
 *
 * After this call you can use the empty keyset again.
 *
 * @param ks the keyset object to work with
 * @see ksAppendKey() for details on how keys are inserted in KeySets
 * @retval 0 on sucess
 * @retval -1 on failure (memory)
 */
@internal
KeySet object cleaner.

Will keyDel() all contained keys, reset internal pointers and counters.

After this call you can use the empty keyset again.

@param ks the keyset object to work with
@see ksAppendKey() for details on how keys are inserted in KeySets
@retval 0 on sucess
@retval -1 on failure (memory)
@internal KeySet object cleaner . Will keyDel () all contained keys reset internal pointers and counters . After this call you can use the empty keyset again . @param ks the keyset object to work with @see ksAppendKey () for details on how keys are inserted in KeySets @retval 0 on sucess @retval - 1 on failure ( memory )
int ksClear (KeySet * ks)
{
	ksClose (ks);
	if ((ks->array = elektraMalloc (sizeof (struct _Key *) * KEYSET_SIZE)) == 0)
	{
		ks->size = 0;
		return -1;
	}
	ks->alloc = KEYSET_SIZE;
	return 0;
}
int ksClear ( KeySet * ks ) { ksClose ( ks ) ; if ( ( ks -> array = elektraMalloc ( sizeof ( struct _Key * ) * KEYSET_SIZE ) ) == 0 ) { ks -> size = 0 ; return -1 ; } ks -> alloc = KEYSET_SIZE ; return 0 ; }
@internal
 KeySet object cleaner.
@internal KeySet object cleaner .
// ks->array empty now /*errno = KDB_ERR_NOMEM;*/