Commit Graph

13 Commits

Author SHA1 Message Date
Lucas De Marchi 877e80cd93 Use streq() when possible 2011-12-07 02:32:28 -02:00
Lucas De Marchi b7b7ac298f kmod_config: optimize config files handling
1) Allocate less by not sorting the result with qsort. Instead,
    insert the nodes in the correct order;
 2) Do not maintain the whole path in memory, but rely on openat()
2011-12-06 03:34:51 -02:00
Gustavo Sverzut Barbieri 43c29d10ff kmod_alias: reduce from 3 mallocs to a single one. 2011-12-05 13:42:13 -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 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 ca491ca99c Drop configurations from /usr/local 2011-12-02 15:02:50 -02:00
Lucas De Marchi 6f1bc6e36e Clean 'unused variable' warnings 2011-12-02 10:02:05 -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 b0ef19f7f5 Add getters for aliases 2011-11-30 18:18:13 -02:00
Lucas De Marchi 30be7513c0 Use underscores() in module names and aliases 2011-11-30 02:14:57 -02:00
Lucas De Marchi 81cf2060e0 Parse blacklists in config files 2011-11-29 18:48:02 -02:00
Lucas De Marchi 7c2ab358fd Add support for parsing config files
Right now only alias keyword is treated.
2011-11-29 18:07:43 -02:00