Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4332 → Rev 4331

/branches/network/uspace/srv/net/structures/char_map.c
81,8 → 81,9
for( index = 0; index < map->next; ++ index ){
if( map->items[ index ]->c == * identifier ){
++ identifier;
if(( length > 1 ) || (( length == 0 ) && ( * identifier ))){
return char_map_add( map->items[ index ], identifier, length ? length - 1 : 0, value );
if( length ) -- length;
if( length || ( * identifier )){
return char_map_add( map->items[ index ], identifier, length, value );
}else{
if( map->items[ index ]->value != CHAR_MAP_NULL ) return EEXISTS;
map->items[ index ]->value = value;
113,10 → 114,11
}
map->items[ map->next ]->c = * identifier;
++ identifier;
if( length ) -- length;
++ map->next;
if(( length > 1 ) || (( length == 0 ) && ( * identifier ))){
if( length || ( * identifier )){
map->items[ map->next - 1 ]->value = CHAR_MAP_NULL;
return char_map_add_item( map->items[ map->next - 1 ], identifier, length ? length - 1 : 0, value );
return char_map_add_item( map->items[ map->next - 1 ], identifier, length, value );
}else{
map->items[ map->next - 1 ]->value = value;
}
159,6 → 161,7
 
char_map_ref char_map_find_node( const char_map_ref map, const char * identifier, size_t length ){
if( ! char_map_is_valid( map )) return NULL;
if( length ) -- length;
if( length || ( * identifier )){
int index;
 
165,8 → 168,7
for( index = 0; index < map->next; ++ index ){
if( map->items[ index ]->c == * identifier ){
++ identifier;
if( length == 1 ) return map->items[ index ];
return char_map_find_node( map->items[ index ], identifier, length ? length - 1 : 0 );
return char_map_find_node( map->items[ index ], identifier, length );
}
}
return NULL;