Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > ListOfArrays
comparison ListOfArrays.h @ 4:53df05eb8d43
clean up debugging fns
| author | Nina Engelhardt <nengel@mailbox.tu-berlin.de> |
|---|---|
| date | Wed, 21 Dec 2011 16:55:02 +0100 |
| parents | 9c577efe70cd |
| children | 79982974d355 |
comparison
equal
deleted
inserted
replaced
| 3:421bf05feb43 | 4:f31d50e6a045 |
|---|---|
| 8 #ifndef LISTOFARRAYS_H | 8 #ifndef LISTOFARRAYS_H |
| 9 #define LISTOFARRAYS_H | 9 #define LISTOFARRAYS_H |
| 10 | 10 |
| 11 #include<stddef.h> | 11 #include<stddef.h> |
| 12 #include "../DynArray/DynArray.h" | 12 #include "../DynArray/DynArray.h" |
| 13 #include "../../dependency.h" | |
| 14 | 13 |
| 15 | 14 |
| 16 typedef struct { | 15 typedef struct { |
| 17 void* next; | 16 void* next; |
| 18 void* data; | 17 void* data; |
| 38 type* typedFragment = (type*) ((list->dim1)[list->dim1info->numInArray -1]); \ | 37 type* typedFragment = (type*) ((list->dim1)[list->dim1info->numInArray -1]); \ |
| 39 typedFragment[offset_in_fragment] = value; \ | 38 typedFragment[offset_in_fragment] = value; \ |
| 40 list->next_free_index++; \ | 39 list->next_free_index++; \ |
| 41 } while (0) | 40 } while (0) |
| 42 | 41 |
| 43 //void addToListOfArraysDependency(Dependency value, ListOfArrays* list); | |
| 44 //void addToListOfArraysUnit(Unit value, ListOfArrays* list); | |
| 45 | |
| 46 typedef void (*ListOfArraysFnPtr) ( void * ); //fn has to cast void * | 42 typedef void (*ListOfArraysFnPtr) ( void * ); //fn has to cast void * |
| 47 | 43 |
| 48 void forAllInListOfArraysDo(ListOfArrays* list, ListOfArraysFnPtr fnPtr); | 44 void forAllInListOfArraysDo(ListOfArrays* list, ListOfArraysFnPtr fnPtr); |
| 49 | 45 |
| 50 #define valueInListOfArrays(type,index,list) ((type*)((list->dim1)[index / list->num_entries_per_fragment]))[index % list->num_entries_per_fragment] | 46 #define valueInListOfArrays(type,index,list) ((type*)((list->dim1)[index / list->num_entries_per_fragment]))[index % list->num_entries_per_fragment] |
| 51 | 47 |
| 52 #define setValueInListOfArrays(type,index,value,list) ((type*)((list->dim1)[index / list->num_entries_per_fragment]))[index % list->num_entries_per_fragment] = value | 48 #define setValueInListOfArrays(type,index,value,list) ((type*)((list->dim1)[index / list->num_entries_per_fragment]))[index % list->num_entries_per_fragment] = value |
| 53 | 49 |
| 50 void freeListOfArrays(ListOfArrays* list); | |
| 51 | |
| 54 #endif /* LISTOFARRAYS_H */ | 52 #endif /* LISTOFARRAYS_H */ |
| 55 | 53 |
