Commit Graph

19 Commits

Author SHA1 Message Date
Lucas De Marchi
434f32ca8d libkmod-list: allow to append an empty list 2012-01-17 21:16:23 -02:00
Lucas De Marchi
6681951bbe doc: organize sections 2012-01-09 05:28:57 -02:00
Lucas De Marchi
a66a6a999f Update copyright 2012-01-09 00:41:07 -02:00
Lucas De Marchi
eb4ae531f7 Fix kmod_list_remove_n_latest()
It only worked because n was always 1. kmod_list_remove returns a
pointer to the next element, relative to the removed one. Therefore we
need to always get a pointer to the last.
2011-12-27 02:48:36 -02:00
Gustavo Sverzut Barbieri
d5ec60bc0c introduce kmod_list_last()
This gets the last element in the list, that is, the previous element
of the head.
2011-12-17 19:43:11 -02:00
Gustavo Sverzut Barbieri
2a70a5d4e0 fix kmod_list_prev().
kmod_list_prev() should return NULL if the current element is the
head, not if the previous element is the head. This was likely a copy
& paste error from kmod_list_next().
2011-12-17 19:43:11 -02:00
Lucas De Marchi
cb451f35d9 Change licenses
libkmod is under LGPL 2.1 or later
tools/* are under GPL
2011-12-12 18:24:35 -02:00
Lucas De Marchi
c35347f15c coding style: fix lines over 80 chars
Lines should not go over 80 chars with a few exceptions:
	- headers
	- function definitions with only 1 argument
	- long strings, otherwise we break grep

This should go later in a coding-style file
2011-12-12 10:54:19 -02:00
Lucas De Marchi
7e1b3ae2b9 kmod_list: document exported functions 2011-12-08 12:25:36 -02:00
Lucas De Marchi
e16e27f4a4 kmod_list: remove nodes in order 2011-12-06 03:34:51 -02:00
Lucas De Marchi
1965029cb0 kmod_list: add helper function to merge two lists
This helper function will append the second list in the first one, so
they become one single list.
2011-12-06 03:34:51 -02:00
Lucas De Marchi
b91a1c6d3d kmod_list: add helper kmod_list_insert_before() 2011-12-06 03:34:51 -02:00
Lucas De Marchi
86e8788572 kmod_list: add helper kmod_list_insert_after() 2011-12-06 03:34:51 -02:00
Gustavo Sverzut Barbieri
1ce08a563e improve "const" keyword usage.
functions that do not modify their parameters get them as const pointers.

special cases:
 * kmod_get_userdata/kmod_set_userdata: return as void* for user convenience.
 * kmod_list_append/kmod_list_prepend: take const void* for user convenience.
2011-12-03 03:51:55 -02:00
Lucas De Marchi
62be799554 Add kmod_list_remove_n_latest() 2011-12-01 15:34:12 -02:00
Lucas De Marchi
79d77111dc Add kmod_list_prev to exported functions 2011-12-01 14:47:44 -02:00
Lucas De Marchi
191ab4b9e0 Fix wrong copyright
I'm the author, not the copyright owner.
2011-11-28 16:59:06 -02:00
Lucas De Marchi
f87081b4d1 Add some function attributes and use them 2011-11-23 16:08:04 -02:00
Lucas De Marchi
6924e47a8d Implement circular double-linked list 2011-11-23 05:15:21 -02:00