summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2011-01-28 16:05:12 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2011-01-28 16:05:12 +0000
commit2fd52be85c823deef014f9957aa71b114a3eedd1 (patch)
treeaa44dd57bcf08e3879f10cd5c93f5d2636b8a701
parent0ac0816bc248afabffae93531a19ea2b32c2bf28 (diff)
inglishicize some ducks
SVN revision: 56344
-rw-r--r--src/include/eina_inlist.h4
-rw-r--r--src/lib/eina_inlist.c86
2 files changed, 46 insertions, 44 deletions
diff --git a/src/include/eina_inlist.h b/src/include/eina_inlist.h
index 9981b42..03b1665 100644
--- a/src/include/eina_inlist.h
+++ b/src/include/eina_inlist.h
@@ -58,9 +58,11 @@ struct _Eina_Inlist
58 Eina_Inlist *prev; /**< previous node */ 58 Eina_Inlist *prev; /**< previous node */
59 Eina_Inlist *last; /**< last node */ 59 Eina_Inlist *last; /**< last node */
60}; 60};
61 61/** Used for declaring an inlist member in a struct */
62#define EINA_INLIST Eina_Inlist __in_list 62#define EINA_INLIST Eina_Inlist __in_list
63/** Utility macro to get the inlist object of a struct */
63#define EINA_INLIST_GET(Inlist) (& ((Inlist)->__in_list)) 64#define EINA_INLIST_GET(Inlist) (& ((Inlist)->__in_list))
65/** Utility macro to get the container object of an inlist */
64#define EINA_INLIST_CONTAINER_GET(ptr, \ 66#define EINA_INLIST_CONTAINER_GET(ptr, \
65 type) ((type *)((char *)ptr - \ 67 type) ((type *)((char *)ptr - \
66 offsetof(type, __in_list))) 68 offsetof(type, __in_list)))
diff --git a/src/lib/eina_inlist.c b/src/lib/eina_inlist.c
index 91ac278..716717a 100644
--- a/src/lib/eina_inlist.c
+++ b/src/lib/eina_inlist.c
@@ -160,13 +160,13 @@ eina_inlist_accessor_free(Eina_Accessor_Inlist *it) {
160 * @brief These functions provide inline list management. 160 * @brief These functions provide inline list management.
161 * 161 *
162 * Inline lists mean its nodes pointers are part of same memory as 162 * Inline lists mean its nodes pointers are part of same memory as
163 * data. This has the benefit of framenting memory less and avoiding 163 * data. This has the benefit of fragmenting memory less and avoiding
164 * @c node->data indirection, but has the drawback of elements only 164 * @c node->data indirection, but has the drawback of elements only
165 * being able to be part of one single inlist at same time. But it is 165 * being able to be part of one single inlist at same time. But it is
166 * possible to have inlist nodes to be part of regular lists created 166 * possible to have inlist nodes to be part of regular lists created
167 * with eina_list_append() or eina_list_prepend(). 167 * with eina_list_append() or eina_list_prepend().
168 * 168 *
169 * Inline lists have its purposes, but if you don't know them go with 169 * Inline lists have their purposes, but if you don't know what those purposes are, go with
170 * regular lists instead. 170 * regular lists instead.
171 * 171 *
172 * @code 172 * @code
@@ -229,20 +229,20 @@ eina_inlist_accessor_free(Eina_Accessor_Inlist *it) {
229 */ 229 */
230 230
231/** 231/**
232 * Add a new node to end of list. 232 * Add a new node to end of a list.
233 * 233 *
234 * @note this code is meant to be fast, appends are O(1) and do not 234 * @note this code is meant to be fast: appends are O(1) and do not
235 * walk @a list anyhow. 235 * walk @a list.
236 * 236 *
237 * @note @a new_l is considered to be in no list. If it was in another 237 * @note @a new_l is considered to be in no list. If it was in another
238 * list before, please eina_inlist_remove() it before adding. No 238 * list before, eina_inlist_remove() it before adding. No
239 * check of @a new_l prev and next pointers is done, so it' safe 239 * check of @a new_l prev and next pointers is done, so it's safe
240 * to have them uninitialized. 240 * to have them uninitialized.
241 * 241 *
242 * @param list existing list head or NULL to create a new list. 242 * @param list existing list head or NULL to create a new list.
243 * @param new_l new list node, must not be NULL. 243 * @param new_l new list node, must not be NULL.
244 * 244 *
245 * @return the new list head. Use it and not given @a list anymore. 245 * @return the new list head. Use it and not @a list anymore.
246 */ 246 */
247EAPI Eina_Inlist * 247EAPI Eina_Inlist *
248eina_inlist_append(Eina_Inlist *list, Eina_Inlist *new_l) 248eina_inlist_append(Eina_Inlist *list, Eina_Inlist *new_l)
@@ -274,18 +274,18 @@ eina_inlist_append(Eina_Inlist *list, Eina_Inlist *new_l)
274/** 274/**
275 * Add a new node to beginning of list. 275 * Add a new node to beginning of list.
276 * 276 *
277 * @note this code is meant to be fast, prepends are O(1) and do not 277 * @note this code is meant to be fast: appends are O(1) and do not
278 * walk @a list anyhow. 278 * walk @a list.
279 * 279 *
280 * @note @a new_l is considered to be in no list. If it was in another 280 * @note @a new_l is considered to be in no list. If it was in another
281 * list before, please eina_inlist_remove() it before adding. No 281 * list before, eina_inlist_remove() it before adding. No
282 * check of @a new_l prev and next pointers is done, so it' safe 282 * check of @a new_l prev and next pointers is done, so it's safe
283 * to have them uninitialized. 283 * to have them uninitialized.
284 * 284 *
285 * @param list existing list head or NULL to create a new list. 285 * @param list existing list head or NULL to create a new list.
286 * @param new_l new list node, must not be NULL. 286 * @param new_l new list node, must not be NULL.
287 * 287 *
288 * @return the new list head. Use it and not given @a list anymore. 288 * @return the new list head. Use it and not @a list anymore.
289 */ 289 */
290EAPI Eina_Inlist * 290EAPI Eina_Inlist *
291eina_inlist_prepend(Eina_Inlist *list, Eina_Inlist *new_l) 291eina_inlist_prepend(Eina_Inlist *list, Eina_Inlist *new_l)
@@ -310,12 +310,12 @@ eina_inlist_prepend(Eina_Inlist *list, Eina_Inlist *new_l)
310/** 310/**
311 * Add a new node after the given relative item in list. 311 * Add a new node after the given relative item in list.
312 * 312 *
313 * @note this code is meant to be fast, appends are O(1) and do not 313 * @note this code is meant to be fast: appends are O(1) and do not
314 * walk @a list anyhow. 314 * walk @a list.
315 * 315 *
316 * @note @a new_l is considered to be in no list. If it was in another 316 * @note @a new_l is considered to be in no list. If it was in another
317 * list before, please eina_inlist_remove() it before adding. No 317 * list before, eina_inlist_remove() it before adding. No
318 * check of @a new_l prev and next pointers is done, so it' safe 318 * check of @a new_l prev and next pointers is done, so it's safe
319 * to have them uninitialized. 319 * to have them uninitialized.
320 * 320 *
321 * @note @a relative is considered to be inside @a list, no checks are 321 * @note @a relative is considered to be inside @a list, no checks are
@@ -327,7 +327,7 @@ eina_inlist_prepend(Eina_Inlist *list, Eina_Inlist *new_l)
327 * @param new_l new list node, must not be NULL. 327 * @param new_l new list node, must not be NULL.
328 * @param relative reference node, @a new_l will be added after it. 328 * @param relative reference node, @a new_l will be added after it.
329 * 329 *
330 * @return the new list head. Use it and not given @a list anymore. 330 * @return the new list head. Use it and not @a list anymore.
331 */ 331 */
332EAPI Eina_Inlist * 332EAPI Eina_Inlist *
333eina_inlist_append_relative(Eina_Inlist *list, 333eina_inlist_append_relative(Eina_Inlist *list,
@@ -360,12 +360,12 @@ eina_inlist_append_relative(Eina_Inlist *list,
360/** 360/**
361 * Add a new node before the given relative item in list. 361 * Add a new node before the given relative item in list.
362 * 362 *
363 * @note this code is meant to be fast, prepends are O(1) and do not 363 * @note this code is meant to be fast: appends are O(1) and do not
364 * walk @a list anyhow. 364 * walk @a list.
365 * 365 *
366 * @note @a new_l is considered to be in no list. If it was in another 366 * @note @a new_l is considered to be in no list. If it was in another
367 * list before, please eina_inlist_remove() it before adding. No 367 * list before, eina_inlist_remove() it before adding. No
368 * check of @a new_l prev and next pointers is done, so it' safe 368 * check of @a new_l prev and next pointers is done, so it's safe
369 * to have them uninitialized. 369 * to have them uninitialized.
370 * 370 *
371 * @note @a relative is considered to be inside @a list, no checks are 371 * @note @a relative is considered to be inside @a list, no checks are
@@ -377,7 +377,7 @@ eina_inlist_append_relative(Eina_Inlist *list,
377 * @param new_l new list node, must not be NULL. 377 * @param new_l new list node, must not be NULL.
378 * @param relative reference node, @a new_l will be added before it. 378 * @param relative reference node, @a new_l will be added before it.
379 * 379 *
380 * @return the new list head. Use it and not given @a list anymore. 380 * @return the new list head. Use it and not @a list anymore.
381 */ 381 */
382EAPI Eina_Inlist * 382EAPI Eina_Inlist *
383eina_inlist_prepend_relative(Eina_Inlist *list, 383eina_inlist_prepend_relative(Eina_Inlist *list,
@@ -415,19 +415,19 @@ eina_inlist_prepend_relative(Eina_Inlist *list,
415/** 415/**
416 * Remove node from list. 416 * Remove node from list.
417 * 417 *
418 * @note this code is meant to be fast, removals are O(1) and do not 418 * @note this code is meant to be fast: appends are O(1) and do not
419 * walk @a list anyhow. 419 * walk @a list.
420 * 420 *
421 * @note @a item is considered to be inside @a list, no checks are 421 * @note @a item is considered to be inside @a list, no checks are
422 * done to confirm that and giving nodes from different lists 422 * done to confirm that and giving nodes from different lists
423 * will lead to problems, specially if @a item is the head since 423 * will lead to problems, especially if @a item is the head since
424 * it will be different from @a list and the wrong new head will 424 * it will be different from @a list and the wrong new head will
425 * be returned. 425 * be returned.
426 * 426 *
427 * @param list existing list head, must not be NULL. 427 * @param list existing list head, must not be NULL.
428 * @param item existing list node, must not be NULL. 428 * @param item existing list node, must not be NULL.
429 * 429 *
430 * @return the new list head. Use it and not given @a list anymore. 430 * @return the new list head. Use it and not @a list anymore.
431 */ 431 */
432EAPI Eina_Inlist * 432EAPI Eina_Inlist *
433eina_inlist_remove(Eina_Inlist *list, Eina_Inlist *item) 433eina_inlist_remove(Eina_Inlist *list, Eina_Inlist *item)
@@ -470,17 +470,17 @@ eina_inlist_remove(Eina_Inlist *list, Eina_Inlist *item)
470/** 470/**
471 * Move existing node to beginning of list. 471 * Move existing node to beginning of list.
472 * 472 *
473 * @note this code is meant to be fast, promotion is O(1) and do not 473 * @note this code is meant to be fast: appends are O(1) and do not
474 * walk @a list anyhow. 474 * walk @a list.
475 * 475 *
476 * @note @a item is considered to be inside @a list, no checks are 476 * @note @a item is considered to be inside @a list. No checks are
477 * done to confirm that and giving nodes from different lists 477 * done to confirm this, and giving nodes from different lists
478 * will lead to problems. 478 * will lead to problems.
479 * 479 *
480 * @param list existing list head or NULL to create a new list. 480 * @param list existing list head or NULL to create a new list.
481 * @param item list node to move to beginning (head), must not be NULL. 481 * @param item list node to move to beginning (head), must not be NULL.
482 * 482 *
483 * @return the new list head. Use it and not given @a list anymore. 483 * @return the new list head. Use it and not @a list anymore.
484 */ 484 */
485EAPI Eina_Inlist * 485EAPI Eina_Inlist *
486eina_inlist_promote(Eina_Inlist *list, Eina_Inlist *item) 486eina_inlist_promote(Eina_Inlist *list, Eina_Inlist *item)
@@ -512,17 +512,17 @@ eina_inlist_promote(Eina_Inlist *list, Eina_Inlist *item)
512/** 512/**
513 * Move existing node to end of list. 513 * Move existing node to end of list.
514 * 514 *
515 * @note this code is meant to be fast, demoting is O(1) and do not 515 * @note this code is meant to be fast: appends are O(1) and do not
516 * walk @a list anyhow. 516 * walk @a list.
517 * 517 *
518 * @note @a item is considered to be inside @a list, no checks are 518 * @note @a item is considered to be inside @a list. No checks are
519 * done to confirm that and giving nodes from different lists 519 * done to confirm this, and giving nodes from different lists
520 * will lead to problems. 520 * will lead to problems.
521 * 521 *
522 * @param list existing list head or NULL to create a new list. 522 * @param list existing list head or NULL to create a new list.
523 * @param item list node to move to end (tail), must not be NULL. 523 * @param item list node to move to end (tail), must not be NULL.
524 * 524 *
525 * @return the new list head. Use it and not given @a list anymore. 525 * @return the new list head. Use it and not @a list anymore.
526 */ 526 */
527EAPI Eina_Inlist * 527EAPI Eina_Inlist *
528eina_inlist_demote(Eina_Inlist *list, Eina_Inlist *item) 528eina_inlist_demote(Eina_Inlist *list, Eina_Inlist *item)
@@ -561,7 +561,7 @@ eina_inlist_demote(Eina_Inlist *list, Eina_Inlist *item)
561/** 561/**
562 * Find given node in list, returns itself if found, NULL if not. 562 * Find given node in list, returns itself if found, NULL if not.
563 * 563 *
564 * @warning this is an expensive call and have O(n) cost, possibly 564 * @warning this is an expensive call and has O(n) cost, possibly
565 * walking the whole list. 565 * walking the whole list.
566 * 566 *
567 * @param list existing list to search @a item in, must not be NULL. 567 * @param list existing list to search @a item in, must not be NULL.
@@ -591,7 +591,7 @@ eina_inlist_find(Eina_Inlist *list, Eina_Inlist *item)
591 * list is @c NULL, 0 is returned. 591 * list is @c NULL, 0 is returned.
592 * 592 *
593 * @warning This is an order-N operation and so the time will depend 593 * @warning This is an order-N operation and so the time will depend
594 * on the number of elements on the list, that is, it might become 594 * on the number of elements on the list, so, it might become
595 * slow for big lists! 595 * slow for big lists!
596 */ 596 */
597EAPI unsigned int 597EAPI unsigned int
@@ -607,7 +607,7 @@ eina_inlist_count(const Eina_Inlist *list)
607} 607}
608 608
609/** 609/**
610 * @brief Returned a new iterator associated to a list. 610 * @brief Returns a new iterator associated to @a list.
611 * 611 *
612 * @param list The list. 612 * @param list The list.
613 * @return A new iterator. 613 * @return A new iterator.
@@ -623,8 +623,8 @@ eina_inlist_count(const Eina_Inlist *list)
623 * returned. 623 * returned.
624 * 624 *
625 * @warning if the list structure changes then the iterator becomes 625 * @warning if the list structure changes then the iterator becomes
626 * invalid! That is, if you add or remove nodes this iterator 626 * invalid, and if you add or remove nodes iterator
627 * behavior is undefined and your program may crash! 627 * behavior is undefined, and your program may crash!
628 */ 628 */
629EAPI Eina_Iterator * 629EAPI Eina_Iterator *
630eina_inlist_iterator_new(const Eina_Inlist *list) 630eina_inlist_iterator_new(const Eina_Inlist *list)
@@ -654,7 +654,7 @@ eina_inlist_iterator_new(const Eina_Inlist *list)
654} 654}
655 655
656/** 656/**
657 * @brief Returned a new accessor associated to a list. 657 * @brief Returns a new accessor associated to a list.
658 * 658 *
659 * @param list The list. 659 * @param list The list.
660 * @return A new accessor. 660 * @return A new accessor.