src/libs/elektra/keyset.c
/**
 * Return a duplicate of a keyset.
 *
 * Objects created with ksDup() must be destroyed with ksDel().
 *
 * Memory will be allocated as needed for dynamic properties,
 * so you need to ksDel() the returned pointer.
 *
 * A flat copy is made, so the keys will not be duplicated,
 * but there reference counter is updated, so both keysets
 * need ksDel().
 *
 * @param source has to be an initialized source KeySet
 * @return a flat copy of source on success
 * @retval 0 on NULL pointer
 * @see ksNew(), ksDel()
 * @see keyDup() for key duplication
 */
Return a duplicate of a keyset.
Objects created with ksDup() must be destroyed with ksDel().

Memory will be allocated as needed for dynamic properties,
so you need to ksDel() the returned pointer.

A flat copy is made, so the keys will not be duplicated,
but there reference counter is updated, so both keysets
need ksDel().


Return a duplicate of a keyset . Objects created with ksDup () must be destroyed with ksDel () . Memory will be allocated as needed for dynamic properties so you need to ksDel () the returned pointer . A flat copy is made so the keys will not be duplicated but there reference counter is updated so both keysets need ksDel () .
KeySet * ksDup (const KeySet * source)
{
	if (!source) return 0;
	size_t size = source->alloc;
	if (size < KEYSET_SIZE)
	{
		size = KEYSET_SIZE;
	}
	KeySet * keyset = ksNew (size, KS_END);
	ksAppend (keyset, source);
	return keyset;
}
KeySet * ksDup ( const KeySet * source ) { if ( ! source ) return 0 ; size_t size = source -> alloc ; if ( size < KEYSET_SIZE ) { size = KEYSET_SIZE ; } KeySet * keyset = ksNew ( size , KS_END ) ; ksAppend ( keyset , source ) ; return keyset ; }
Return a duplicate of a keyset.
Return a duplicate of a keyset .