(file) Return to ptrarray.h CVS log (file) (dir) Up to [OMI] / omi / base

File: [OMI] / omi / base / ptrarray.h (download)
Revision: 1.1, Mon Apr 20 17:19:50 2015 UTC (9 years ago) by krisbash
Branch: MAIN
CVS Tags: OMI_1_0_8_2, OMI_1_0_8_1, HEAD
OMI 1.0.8-1

#ifndef _omi_base_ptrarray_h
#define _omi_base_ptrarray_h

#include <stddef.h>
#include <MI.h>
#include <common.h>

#if defined(__cplusplus)
extern "C"
{
#endif

typedef struct _PtrArray
{
    /* Array of poitners */
    void** data;

    /* Current size of this array */
    size_t size;

    /* Current capacity (will double when exhausted) */
    size_t capacity;

    /* Destroys individual items upon destruction (may be null) */
    void (MI_MAIN_CALL *destructor)(void*);
}
PtrArray;

int PtrArray_Construct(
    PtrArray* self,
    size_t capacity,
    void (MI_MAIN_CALL *destructor)(void*));

void PtrArray_Destruct(
    PtrArray* self);

int PtrArray_Append(
    _Inout_ PtrArray* self, 
    void* element);

#if defined(__cplusplus)
}
#endif

#endif /* _omi_base_ptrarray_h */

ViewCVS 0.9.2