|
Mobil_surveillance_system 1
|
00001 #ifndef DINAMIC_ARRAY_H_ 00002 #define DINAMIC_ARRAY_H_ 00003 00005 00012 #include <stdlib.h> // due to: malloc and free functions 00013 #include <string.h> // due to: memset function 00014 00015 00016 //***************************************************************************** 00017 // 00018 // Types and definitions 00019 // 00020 //***************************************************************************** 00021 00022 #ifndef DEFINE_TBOOLEAN // define unsigned char as tBoolean in only that case when it hasn't been defined yet somewhere else in the scope 00023 00025 typedef unsigned char tBoolean; // use as bool 00026 #define DEFINE_TBOOLEAN 00027 00028 #endif // DEFINE_TBOOLEAN 00029 00031 typedef struct{ 00032 00034 void** pArray; 00036 unsigned int uiLimit; 00038 unsigned int uiSize; 00040 unsigned int uiStep; 00041 00042 }tDinamicArray; 00043 00044 00045 // If there is no more space in the current buffer, the size of the array will expand with this number 00046 #define STEPNUMBER 10 00047 00048 //***************************************************************************** 00049 // 00050 // Function declarations 00051 // 00052 //***************************************************************************** 00053 00058 void Dinamic_Array_Init(tDinamicArray* pDinamicArray); 00059 00060 00066 void Dinamic_Array_Add(tDinamicArray* pDinamicArray, const void* pItem); 00067 00068 00074 void Dinamic_Array_Delete(tDinamicArray* pDinamicArray, unsigned int uiIndex); 00075 00076 00081 void Dinamic_Array_Clear(tDinamicArray* pDinamicArray); 00082 00083 #endif /*DINAMIC_ARRAY_H_*/
1.7.4