Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef struct DATA
- {
- // stuff
- int active;
- } DATA;
- #defien MAXDATA 128
- DATA chunk[MAXDATA];
- DATA* actual_data[MAXDATA];
- size_t num_data;
- DATA* findfree()
- {
- for (c=0;c<MAX_DATA;c++) if (!chunk[c].active) return &chunk[c];
- }
- void insert(DATA* data)
- {
- actual_data[num_data++] = data;
- }
- void remove(int data_num)
- {
- actual_data[data_num] = actual_data[--num_data];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement