annotate DynArray.h @ 15:53c5d022dd45

added eol handling and .brch__VMS_malloc_brch to indicate brch (and reason for it)
author Me@portablequad
date Sat, 11 Feb 2012 17:46:39 -0800
parents 1cffeb870564
children
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
hausers@13 11 #include "../../VMS_Implementations/VMS_impl/VMS_primitive_data_types.h"
Me@15 12 #include "../../VMS_Implementations/VMS_impl/vmalloc.h"
Me@4 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@6 26 PrivDynArrayInfo;
Me@3 27
Me@6 28 PrivDynArrayInfo *
Me@6 29 makePrivDynArrayInfoFrom( void ***addrOfPtrToArray, int32 sizeOfArray );
Me@3 30
Me@6 31 PrivDynArrayInfo *
Me@6 32 makePrivDynArrayOfSize( void ***addrOfPtrToArray, int32 sizeOfArray );
Me@3 33
Me@7 34 PrivDynArrayInfo *
Me@7 35 makePrivDynArrayOfSize_Ext( void ***addrOfPtrToArray, int32 sizeOfArray );
Me@7 36
Me@4 37 int32
Me@6 38 addToDynArray( void *value, PrivDynArrayInfo *info );
Me@3 39
Me@4 40 void
Me@6 41 makeHighestDynArrayIndexBe( PrivDynArrayInfo *info, int32 highestIndex );
Me@4 42
Me@4 43 void
Me@7 44 makeHighestDynArrayIndexBeAtLeast(PrivDynArrayInfo *info,int32 highestIndex);
Me@7 45
Me@7 46 void
Me@6 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@6 52 freeDynArrayDeep( PrivDynArrayInfo *info, FreeFnPtr freeFnPtr );
Me@4 53
Me@4 54 void
Me@6 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@6 61 forAllInDynArrayDo( PrivDynArrayInfo *info, DynArrayFnPtr fnPtr );
Me@4 62
Me@4 63 #endif /* _DYNARRAY_H */
Me@4 64