annotate DynArray.h @ 17:62b3a4793b6e

chgd files to VMS__malloc and correct includes
author Me@portablequad
date Sat, 11 Feb 2012 19:00:21 -0800
parents 9de0a9369134
children 3e8e1a2a10f5
rev   line source
Me@3 1 /*
Me@3 2 * File: Vector.h
Me@3 3 * Author: Me
Me@3 4 *
Me@3 5 * Created on May 14, 2010, 3:08 PM
Me@3 6 */
Me@3 7
Me@4 8 #ifndef _DYNARRAY_H
Me@4 9 #define _DYNARRAY_H
Me@3 10
Me@17 11 #include "../../VMS_Implementations/VMS_impl/VMS_primitive_data_types.h"
Me@17 12 #include "../../VMS_Implementations/VMS_impl/vmalloc.h"
Me@17 13
Me@4 14
Me@4 15 //A dynamic array is same as any other array, but add a DynArrayInfo next
Me@4 16 // to it. Accesses and updates of array indexes are done normally, it's
Me@4 17 // only when add a new element into array that use the extra info.
Me@4 18 // An add can cause the pointer to the normal array to change.. so must
Me@4 19 // be protected to single VP at a time.
Me@3 20 typedef struct
Me@3 21 {
Me@4 22 void ***addrOfPtrToArray; //addr of array of ptrs == triple *
Me@4 23 int32 numInArray;
Me@4 24 int32 sizeOfArray;
Me@3 25 }
Me@14 26 PrivDynArrayInfo;
Me@3 27
Me@14 28 PrivDynArrayInfo *
Me@14 29 makePrivDynArrayInfoFrom( void ***addrOfPtrToArray, int32 sizeOfArray );
Me@3 30
Me@14 31 PrivDynArrayInfo *
Me@14 32 makePrivDynArrayOfSize( void ***addrOfPtrToArray, int32 sizeOfArray );
Me@14 33
Me@14 34 PrivDynArrayInfo *
Me@14 35 makePrivDynArrayOfSize_Ext( void ***addrOfPtrToArray, int32 sizeOfArray );
Me@3 36
Me@4 37 int32
Me@14 38 addToDynArray( void *value, PrivDynArrayInfo *info );
Me@3 39
Me@4 40 void
Me@14 41 makeHighestDynArrayIndexBe( PrivDynArrayInfo *info, int32 highestIndex );
Me@4 42
Me@4 43 void
Me@14 44 makeHighestDynArrayIndexBeAtLeast(PrivDynArrayInfo *info,int32 highestIndex);
Me@14 45
Me@14 46 void
Me@14 47 increaseSizeOfDynArrayTo( PrivDynArrayInfo *info, int32 newSize );
Me@4 48
Me@4 49 typedef void (*FreeFnPtr) ( void * ); //fn has to cast void * to whatever
Me@4 50
Me@4 51 void
Me@14 52 freeDynArrayDeep( PrivDynArrayInfo *info, FreeFnPtr freeFnPtr );
Me@4 53
Me@4 54 void
Me@14 55 freeDynArrayFlat( PrivDynArrayInfo *info );
Me@4 56
Me@4 57
Me@4 58 typedef void (*DynArrayFnPtr) ( void * ); //fn has to cast void *
Me@4 59
Me@4 60 void
Me@14 61 forAllInDynArrayDo( PrivDynArrayInfo *info, DynArrayFnPtr fnPtr );
Me@4 62
Me@4 63 #endif /* _DYNARRAY_H */
Me@4 64