2.13.1. handle_GetHandle

[<<<] [>>>]

@c GetHandle

Having a pointer allocate a handle. This function stores the pointer and returns the handle.

The handle is a small positive integer.

If any error is happened (aka out of memory) zero is returned.

unsigned long handle_GetHandle(void **pHandle,
                               void *pMEM,
                               void *pointer
  ){

Note that NULL pointer can not be stored in the array.

The pointer to the handle array pHandle should be initialized to NULL before the first call to handle_GetHandle. For example:

   void *Handle = NULL;
     ....
   if( !handle_GetHandle(&Handle,pMEM,pointer) )return ERROR_CODE;

[<<<] [>>>]