-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmarray.h
More file actions
42 lines (31 loc) · 979 Bytes
/
Copy pathmarray.h
File metadata and controls
42 lines (31 loc) · 979 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef __MARRAY_H__
#define __MARRAY_H__
#include "./required/memory.h"
#include "./required/intrinsic.h"
struct marray
{
i32 realCount;
i32 count;
i32 size;
i32** ptr;
};
struct marray_link
{
i32 id;
struct marray_link *next;
};
struct marray_list
{
struct marray_link *head;
struct marray_link *tail;
};
void AddToMArray_(struct marray* mArray, i32* addr, char* filename, int line);
i32* GetFromMArray(struct marray* Array, i32 index);
void RemoveFromArray(struct marray* Array, i32 index);
void FreeMArray(struct marray* Array);
void CreateMArray_(struct marray* mArray, char* filename, int line);
void AddToMFreeList(int index);
#define AddToMArray(ArrayStruct, Data) AddToMArray_(ArrayStruct, (i32*) Data,(char*) __FILE__, __LINE__)
#define for_marray(MArrayStruct,var) struct marray *MArrayStruct##ary = MArrayStruct; for(int var=0;var <MArrayStruct##ary->count;var++)
#define CreateMArray(array) CreateMArray_(array, (char*) __FILE__,__LINE__)
#endif