hu_GlobalCtxCreate()

Creates a global context initialized with user-provided callback functions.

Synopsis:

#include "huctx.h"
 
int hu_GlobalCtxCreate(hu_MallocFunc *sbMalloc, hu_FreeFunc *sbFree, hu_MemCpyFunc *sbMemcpy, hu_MemCmpFunc *sbMemcmp, hu_MemSetFunc *sbMemset, hu_TimeFunc *sbTime, void *cbData, sb_GlobalCtx *sbCtx)

Since:

BlackBerry 10.0.0

Arguments:

sbMalloc

Memory allocation callback function.

sbFree

Memory free callback function.

sbMemcpy

Memory copy callback function.

sbMemcmp

Memory compare callback function.

sbMemset

Memory set callback function.

sbTime

Time callback function.

cbData

Callback data.

sbCtx

The global context pointer.

Library:

libhuapi (For the qcc command, use the -l huapi option to link against this library)

Description:

All callback functions are mandatory.

The optional cbData argument will be passed to all callback functions.

Returns:

SB_ERR_NULL_INPUT

One or more callback functions is NULL.

SB_ERR_NULL_GLOBAL_CTX_PTR

The global context pointer is NULL.

SB_FAIL_ALLOC

Memory allocation failure.

SB_SUCCESS

Success.