Commit Graph

214 Commits

Author SHA1 Message Date
Gustavo Sverzut Barbieri
8226058343 tests: release memory before error exits.
this makes it easier to valgrind the error cases as well.
2011-12-05 01:45:21 -02:00
Gustavo Sverzut Barbieri
69f9dd4369 no more kmod_loaded and kmod_loaded_module.
kmod_loaded_get_list() now returns a regular list of kmod_modules, use
kmod_module_get_module(), kmod_module_unref() and
kmod_module_unref_list() to operate on it.
2011-12-04 17:24:08 -02:00
Gustavo Sverzut Barbieri
f12ae3c438 kmod_module: extended information gathering.
provide means to get:
 * refcount
 * initstate
 * holders
 * sections

this can be used to individually query properties from modules,
similar to /proc/modules (kmod_loaded / kmod_loaded_module).
2011-12-04 17:24:08 -02:00
Gustavo Sverzut Barbieri
ad4d1ae565 kmod_module_get_module: safety against NULL pointers 2011-12-04 17:24:08 -02:00
Gustavo Sverzut Barbieri
87ca03bd07 module refcount should start at 1.
the current way was having the referenced modules to be released given
the unref comparison checking for "> 0".
2011-12-04 17:24:08 -02:00
Gustavo Sverzut Barbieri
32c328d28e fix missing ")". 2011-12-04 15:34:43 -02:00
Lucas De Marchi
478af97f1c TODO: update file 2011-12-03 20:51:01 -02:00
Lucas De Marchi
94fe3dfbb9 License library as LGPL
The only part under GPL was the index, that is now re-licensed. Switch
back to LGPL.
2011-12-03 04:30:41 -02:00
Lucas De Marchi
8f923be69a index: change license to LGPL
I've got an explicit permit from index author to re-license it as LGPL.
2011-12-03 04:30:16 -02:00
Lucas De Marchi
5a7ade7191 index: update copyrignt
mmap implementation
2011-12-03 04:07:16 -02:00
Lucas De Marchi
bf89f70ca3 index: mmap: add support for seaching with wildcards
Almost a clean copy & paste from the previous implementation.
2011-12-03 04:07:16 -02:00
Lucas De Marchi
b797b79183 index: mmap: add support for searching
Almost a clean copy & paste from the previous implementation.
2011-12-03 04:07:16 -02:00
Lucas De Marchi
e33bb87cae index: mmap: add support for searching node
Almost a clean copy & paste from the previous implementation.
2011-12-03 04:07:16 -02:00
Lucas De Marchi
91298dc79e index: mmap: read child node 2011-12-03 04:07:15 -02:00
Lucas De Marchi
77bf936a89 index: mmap: read root node 2011-12-03 04:07:15 -02:00
Lucas De Marchi
836be9ac5f index: mmap: create and destroy node 2011-12-03 04:07:15 -02:00
Lucas De Marchi
e22c85f357 Add memdup() helper 2011-12-03 04:07:15 -02:00
Lucas De Marchi
b471a6b494 index: mmap: open and close file 2011-12-03 04:06:16 -02:00
Lucas De Marchi
4a4876d6a7 index: use idx instead of index due to name clash 2011-12-03 04:06:16 -02:00
Lucas De Marchi
2295acc5da Fix some coding style issues 2011-12-03 04:05:22 -02:00
Gustavo Sverzut Barbieri
d13e606ff6 improve kmod_config api.
make the function names reflect the structure they are operating on.

the structure is now allocated and remembers the context it was
created, then no need to give the context in every function call.
2011-12-03 03:56:57 -02:00
Gustavo Sverzut Barbieri
8d3f3ef815 reorder struct fields to avoid holes, improving packing 2011-12-03 03:56:02 -02:00
Gustavo Sverzut Barbieri
91b44c77ae README with purpose and initial overview. 2011-12-03 03:55:35 -02:00
Lucas De Marchi
ad5555b272 Fix extra attribute
linenum can be NULL in case we are not interested in the number of lines
parsed.
2011-12-03 03:53:10 -02:00
Gustavo Sverzut Barbieri
12d9419d08 improve compiler warnings and checks for internal functions. 2011-12-03 03:52:35 -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
Jan Engelhardt
a66a0c37af autogen: use "$@" and exec last program 2011-12-03 02:32:36 -02:00
Lucas De Marchi
85ece2042f Do not ship autogen.sh in the tarball
Copied from libabc.
2011-12-02 17:54:42 -02:00
Lucas De Marchi
ca491ca99c Drop configurations from /usr/local 2011-12-02 15:02:50 -02:00
Lucas De Marchi
c3325cfc26 TODO: update tasks 2011-12-02 14:50:19 -02:00
Lucas De Marchi
e71970ae44 index: follow libkmod coding style 2011-12-02 10:29:36 -02:00
Lucas De Marchi
eb8bb32e42 Remove redundant comments 2011-12-02 10:25:17 -02:00
Lucas De Marchi
85078e6eef index: remove unused functions 2011-12-02 10:21:42 -02:00
Lucas De Marchi
1d152accf3 index: re-order functions so prototypes are not needed 2011-12-02 10:15:00 -02:00
Lucas De Marchi
3a61c84faa Remove trailing whitespace 2011-12-02 10:08:52 -02:00
Lucas De Marchi
963ca5586e Fix 'redundant redeclaration' warnings 2011-12-02 10:07:25 -02:00
Lucas De Marchi
93688880db Fix 'old style declaration' warnings 2011-12-02 10:05:31 -02:00
Lucas De Marchi
84f4220440 Fix missing return 2011-12-02 10:03:34 -02:00
Lucas De Marchi
6f1bc6e36e Clean 'unused variable' warnings 2011-12-02 10:02:05 -02:00
Lucas De Marchi
1fc1c9a06f Clean 'shadowed declaration' warnings 2011-12-02 10:00:03 -02:00
Lucas De Marchi
0fbdfef3f9 Clean 'shadowed declaration' warnings
index is a function in string.h, so replace index with idx all over the
source code.
2011-12-02 09:56:22 -02:00
Lucas De Marchi
a009482ccf Clean 'no previous prototype' warning 2011-12-02 09:53:31 -02:00
Lucas De Marchi
b418a82097 Use fstat() instead of stat() when possible 2011-12-01 23:13:27 -02:00
Lucas De Marchi
0835fc3bf9 Add fucntion to API to get dependencies 2011-12-01 20:06:08 -02:00
Lucas De Marchi
c11e62bfd4 Use strtok_r insteat of strtok
strtok is not thread-safe because it uses a static pointer to keep track
of position in the string. Using strtok_r solves the problem.
2011-12-01 18:59:54 -02:00
Lucas De Marchi
bf89f76eaa Add TODO file with a few items 2011-12-01 18:23:47 -02:00
Lucas De Marchi
4a3eb3a4cc Add dependencies when module is create by name lookup
We already have the data needed to add the dependencies, so call
fucntion to transform it in a list and save in kmod_module structure.
2011-12-01 17:57:07 -02:00
Lucas De Marchi
7636e72b15 Add dependency list to kmod_module
Dependency list is created from line as defined in modules.dep.
2011-12-01 17:56:03 -02:00
Lucas De Marchi
e915f92ad3 Add missing newlines 2011-12-01 17:47:49 -02:00
Lucas De Marchi
9eaad1f63a Allow path_to_modname to operate locally withou alloc 2011-12-01 17:19:24 -02:00