Item

ItemGetPtr

Read a data pointer from an ITEM

Syntax

Signature
void *ItemGetPtr( const ITEM *item );

Arguments

item is the ITEM to read.

Return value

The stored pointer, or NULL for a NULL input or a value of another type.

Description

The pointer retains its original ownership. Use it only while the referenced object is valid.

Example

itemgetptr.c
#include "xdev-wtui.h"

#include <stdio.h>

int main( void )
{
   int count = 42;
   ITEM *item = ItemPutPtr( NULL, &count );
   int *stored = ItemGetPtr( item );

   if( stored )
      printf( "%d\n", *stored );
   ItemRelease( item );

   return 0;
}

Output

42

See also