Changeset feeac0d in mainline for uspace/lib/c/generic/cfg.c


Ignore:
Timestamp:
2013-09-10T16:32:35Z (11 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4982d87
Parents:
e8d6ce2
Message:

Simplify use of list_foreach.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/cfg.c

    re8d6ce2 rfeeac0d  
    8383                return true;
    8484       
    85         list_foreach(data->sections, link) {
    86                 const cfg_section_t *section = cfg_section_instance(link);
    87                
     85        cfg_file_foreach(data, section) {
    8886                if (!list_empty(&section->entries))
    8987                        return false;
     
    413411const cfg_section_t *cfg_find_section(const cfg_file_t *data, const char *title)
    414412{
    415         list_foreach(data->sections, link) {
    416                 const cfg_section_t *section = cfg_section_instance(link);
    417                
     413        cfg_file_foreach(data, section) {
    418414                if (str_cmp(section->title, title) == 0)
    419415                        return section;
     
    434430const char *cfg_find_value(const cfg_section_t *section, const char *key)
    435431{
    436         list_foreach(section->entries, link) {
    437                 const cfg_entry_t *entry = cfg_entry_instance(link);
    438                
     432        cfg_section_foreach(section, entry) {
    439433                if (str_cmp(entry->key, key) == 0)
    440434                        return entry->value;
Note: See TracChangeset for help on using the changeset viewer.