Changeset 0c01270 in mainline
- Timestamp:
 - 2020-07-05T21:00:33Z (5 years ago)
 - Children:
 - 0f75a63
 - Parents:
 - a81a950d
 - git-author:
 - Michal Koutný <xm.koutny+hos@…> (2015-05-08 11:02:56)
 - git-committer:
 - Matthieu Riolo <matthieu.riolo@…> (2020-07-05 21:00:33)
 - Location:
 - uspace/lib/conf
 - Files:
 - 
      
- 4 edited
 
- 
          
  include/conf/configuration.h (modified) (1 diff)
 - 
          
  src/configuration.c (modified) (2 diffs)
 - 
          
  src/ini.c (modified) (1 diff)
 - 
          
  test/ini.c (modified) (1 diff)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
uspace/lib/conf/include/conf/configuration.h
ra81a950d r0c01270 66 66 typedef enum { 67 67 CONFIGURATION_EMISSING_ITEM = -1, 68 CONFIGURATION_EINVAL_BOOL = -2 68 CONFIGURATION_EINVAL_BOOL = -2, 69 CONFIGURATION_ELIMIT = -3 69 70 } config_error_t; 70 71  - 
      
uspace/lib/conf/src/configuration.c
ra81a950d r0c01270 43 43 const char *string = ini_item_iterator_value(it); 44 44 const size_t lineno = ini_item_iterator_lineno(it); 45 has_error = has_error ||46 config_item->parse(string, field_dst, parse, lineno);45 bool success = config_item->parse(string, field_dst, parse, lineno); 46 has_error = has_error || !success; 47 47 } 48 48 … … 104 104 } 105 105 106 return has_error ? E OK : EINVAL;106 return has_error ? EINVAL : EOK; 107 107 } 108 108  - 
      
uspace/lib/conf/src/ini.c
ra81a950d r0c01270 489 489 bool ini_item_iterator_valid(ini_item_iterator_t *iterator) 490 490 { 491 bool empty = (iterator->cur_item != NULL);492 bool looped = (iterator->cur_item == iterator->first_item);493 return empty || (looped && iterator->incremented);491 bool empty = (iterator->cur_item == NULL); 492 bool maybe_looped = (iterator->cur_item == iterator->first_item); 493 return !(empty || (maybe_looped && iterator->incremented)); 494 494 } 495 495  - 
      
uspace/lib/conf/test/ini.c
ra81a950d r0c01270 109 109 (str_cmp(first, "value") == 0 && str_cmp(second, "value2") == 0) || 110 110 (str_cmp(first, "value2") == 0 && str_cmp(second, "value") == 0)); 111 112 ini_item_iterator_inc(&it); 113 PCUT_ASSERT_FALSE(ini_item_iterator_valid(&it)); 111 114 } 112 115  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  