XBinder  Version 2.6.x
Functions
rtxDynPtrArray.h File Reference

Implementation of a dynamic pointer array. More...

#include "rtxsrc/rtxContext.h"

Go to the source code of this file.

Functions

EXTERNRT int rtxDynPtrArrayInit (OSCTXT *pctxt, OSRTDynPtrArray *pArray, OSUINT16 initialSize)
 This function initializes a new dynamic pointer array structure. More...
 
EXTERNRT int rtxDynPtrArrayAppend (OSCTXT *pctxt, OSRTDynPtrArray *pArray, void *ptr)
 This function adds a pointer to the end of the array and expands the array if necessary. More...
 

Detailed Description

Implementation of a dynamic pointer array.

Definition in file rtxDynPtrArray.h.

Function Documentation

◆ rtxDynPtrArrayAppend()

EXTERNRT int rtxDynPtrArrayAppend ( OSCTXT pctxt,
OSRTDynPtrArray *  pArray,
void *  ptr 
)

This function adds a pointer to the end of the array and expands the array if necessary.

Parameters
pctxtPointer to a context structure.
pArrayPointer to dynamic pointer array structure.
ptrPointer to be added to the array.
Returns
Status of operation: zero if success or a negative error code if failure.

◆ rtxDynPtrArrayInit()

EXTERNRT int rtxDynPtrArrayInit ( OSCTXT pctxt,
OSRTDynPtrArray *  pArray,
OSUINT16  initialSize 
)

This function initializes a new dynamic pointer array structure.

Memory is allocated for the initial capacity of pointers.

Parameters
pctxtPointer to a context structure.
pArrayPointer to dynamic pointer array structure.
initialSizeInitial capacilty of the array. The size will doubled on each expansion. If zero is provided, a default size will be used.
Returns
Status of operation: zero if success or a negative error code if failure.