Lines Matching refs:element
85 /* Basic element of a list*/\
115 /* This macro finds a space for a new element and puts in into 'element' pointer */
116 #define INSERT_NEW(element_type, l, element)\
120 element = (element_type*)(l->m_head_free.m_pos);\
121 if(element->m_next != NULL)\
123 element->m_next->m_prev = NULL;\
124 l->m_head_free.m_pos = element->m_next;\
138 element = (element_type*)((char*)l->m_buffer + sizeof(void*));\
142 element = (element_type*)((char*)l->m_buffer + sizeof(void*)) + l->m_size - 1;\
146 /* This macro adds 'element' to the list of free elements*/
147 #define INSERT_FREE(element_type, l, element)\
150 ((element_type*)l->m_head_free.m_pos)->m_prev = element;\
152 element->m_next = ((element_type*)l->m_head_free.m_pos);\
153 l->m_head_free.m_pos = element;
196 ELEMENT_##type* element = (ELEMENT_##type*)(pos->m_pos);\
197 pos->m_pos = element->m_next;\
198 return &element->m_data;\
209 ELEMENT_##type* element = (ELEMENT_##type*)(pos->m_pos);\
210 pos->m_pos = element->m_prev;\
211 return &element->m_data;\
231 ELEMENT_##type* element;\
232 INSERT_NEW(ELEMENT_##type, l, element);\
233 element->m_prev = NULL;\
234 element->m_next = (ELEMENT_##type*)(l->m_head.m_pos);\
235 memcpy(&(element->m_data), data, sizeof(*data));\
236 if(element->m_next)\
238 element->m_next->m_prev = element;\
242 l->m_tail.m_pos = element;\
244 l->m_head.m_pos = element;\
249 ELEMENT_##type* element;\
250 INSERT_NEW(ELEMENT_##type, l, element);\
251 element->m_next = NULL;\
252 element->m_prev = (ELEMENT_##type*)(l->m_tail.m_pos);\
253 memcpy(&(element->m_data), data, sizeof(*data));\
254 if(element->m_prev)\
256 element->m_prev->m_next = element;\
260 l->m_head.m_pos = element;\
262 l->m_tail.m_pos = element;\
267 ELEMENT_##type* element = ((ELEMENT_##type*)(l->m_head.m_pos));\
268 if(element->m_next != NULL)\
270 element->m_next->m_prev = NULL;\
272 l->m_head.m_pos = element->m_next;\
273 INSERT_FREE(ELEMENT_##type, l, element);\
278 ELEMENT_##type* element = ((ELEMENT_##type*)(l->m_tail.m_pos));\
279 if(element->m_prev != NULL)\
281 element->m_prev->m_next = NULL;\
283 l->m_tail.m_pos = element->m_prev;\
284 INSERT_FREE(ELEMENT_##type, l, element);\
289 ELEMENT_##type* element;\
292 INSERT_NEW(ELEMENT_##type, l, element);\
293 memcpy(&(element->m_data), data, sizeof(*data));\
295 element->m_prev = before;\
296 element->m_next = before->m_next;\
297 before->m_next = element;\
298 if(element->m_next != NULL)\
299 element->m_next->m_prev = element;\
301 l->m_tail.m_pos = element;\
302 newpos.m_pos = element;\
307 ELEMENT_##type* element;\
310 INSERT_NEW(ELEMENT_##type, l, element);\
311 memcpy(&(element->m_data), data, sizeof(*data));\
313 element->m_prev = after->m_prev;\
314 element->m_next = after;\
315 after->m_prev = element;\
316 if(element->m_prev != NULL)\
317 element->m_prev->m_next = element;\
319 l->m_head.m_pos = element;\
320 newpos.m_pos = element;\
325 ELEMENT_##type* element = ((ELEMENT_##type*)pos.m_pos);\
326 if(element->m_prev != NULL)\
328 element->m_prev->m_next = element->m_next;\
332 l->m_head.m_pos = element->m_next;\
334 if(element->m_next != NULL)\
336 element->m_next->m_prev = element->m_prev;\
340 l->m_tail.m_pos = element->m_prev;\
342 INSERT_FREE(ELEMENT_##type, l, element);\
347 ELEMENT_##type* element = ((ELEMENT_##type*)(pos.m_pos));\
348 memcpy(&(element->m_data), data, sizeof(data));\
352 ELEMENT_##type* element = ((ELEMENT_##type*)(pos.m_pos));\
353 return &(element->m_data);\