Syntax
ITEM *ItemNew( const ITEM *source );
Arguments
source is an existing value to copy. Pass NULL to create a NIL value.
Return value
A new ITEM owned by the caller.
Description
A string is copied into independent storage; an array is not copied: the new ITEM holds the same array. AClone() duplicates an array. Release the new ITEM with ItemRelease().
Example
#include "xdev-wtui.h"
#include <stdio.h>
int main( void )
{
ITEM *original = ItemPutC( NULL, "Open" );
ITEM *copy = ItemNew( original );
ItemRelease( original );
puts( ItemGetCPtr( copy ) );
ItemRelease( copy );
return 0;
}
Output
Open