Index: uspace/srv/net/structures/char_map.c
===================================================================
--- uspace/srv/net/structures/char_map.c	(revision 21580dd3dd9a49828a6c8dd3988e651a60708c10)
+++ uspace/srv/net/structures/char_map.c	(revision aadf01ebd2c032bc8dd43a6e06ae5715e6c2710f)
@@ -57,5 +57,5 @@
  *  @returns EEXIST if the key character string is already used.
  */
-int	char_map_add_item( char_map_ref map, const char * identifier, size_t length, const int value );
+int char_map_add_item(char_map_ref map, const char * identifier, size_t length, const int value);
 
 /** Returns the node assigned to the key from the map.
@@ -66,5 +66,5 @@
  *  @returns NULL if the key is not assigned a&nbsp;node.
  */
-char_map_ref	char_map_find_node( const char_map_ref map, const char * identifier, const size_t length );
+char_map_ref char_map_find_node(const char_map_ref map, const char * identifier, const size_t length);
 
 /** Returns the value assigned to the map.
@@ -73,5 +73,5 @@
  *  @returns CHAR_MAP_NULL if the map is not assigned a&nbsp;value.
  */
-int	char_map_get_value( const char_map_ref map );
+int char_map_get_value(const char_map_ref map);
 
 /** Checks if the map is valid.
@@ -80,74 +80,80 @@
  *  @returns FALSE otherwise.
  */
-int	char_map_is_valid( const char_map_ref map );
-
-int char_map_add( char_map_ref map, const char * identifier, size_t length, const int value ){
-	if( char_map_is_valid( map ) && ( identifier ) && (( length ) || ( * identifier ))){
-		int	index;
-
-		for( index = 0; index < map->next; ++ index ){
-			if( map->items[ index ]->c == * identifier ){
+int char_map_is_valid(const char_map_ref map);
+
+int char_map_add(char_map_ref map, const char * identifier, size_t length, const int value){
+	if(char_map_is_valid(map) && (identifier) && ((length) || (*identifier))){
+		int index;
+
+		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 > 1) || ((length == 0) && (*identifier))){
+					return char_map_add(map->items[index], identifier, length ? length - 1 : 0, value);
 				}else{
-					if( map->items[ index ]->value != CHAR_MAP_NULL ) return EEXISTS;
-					map->items[ index ]->value = value;
+					if(map->items[index]->value != CHAR_MAP_NULL){
+						return EEXISTS;
+					}
+					map->items[index]->value = value;
 					return EOK;
 				}
 			}
 		}
-		return char_map_add_item( map, identifier, length, value );
+		return char_map_add_item(map, identifier, length, value);
 	}
 	return EINVAL;
 }
 
-int char_map_add_item( char_map_ref map, const char * identifier, size_t length, const int value ){
-	if( map->next == ( map->size - 1 )){
-		char_map_ref	* tmp;
-
-		tmp = ( char_map_ref * ) realloc( map->items, sizeof( char_map_ref ) * 2 * map->size );
-		if( ! tmp ) return ENOMEM;
+int char_map_add_item(char_map_ref map, const char * identifier, size_t length, const int value){
+	if(map->next == (map->size - 1)){
+		char_map_ref *tmp;
+
+		tmp = (char_map_ref *) realloc(map->items, sizeof(char_map_ref) * 2 * map->size);
+		if(! tmp){
+			return ENOMEM;
+		}
 		map->size *= 2;
 		map->items = tmp;
 	}
-	map->items[ map->next ] = ( char_map_ref ) malloc( sizeof( char_map_t ));
-	if( ! map->items[ map->next ] ) return ENOMEM;
-	if( char_map_initialize( map->items[ map->next ] ) != EOK ){
-		free( map->items[ map->next ] );
-		map->items[ map->next ] = NULL;
+	map->items[map->next] = (char_map_ref) malloc(sizeof(char_map_t));
+	if(! map->items[map->next]){
 		return ENOMEM;
 	}
-	map->items[ map->next ]->c = * identifier;
+	if(char_map_initialize(map->items[map->next]) != EOK){
+		free(map->items[map->next]);
+		map->items[map->next] = NULL;
+		return ENOMEM;
+	}
+	map->items[map->next]->c = * identifier;
 	++ identifier;
 	++ map->next;
-	if(( length > 1 ) || (( length == 0 ) && ( * 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 );
+	if((length > 1) || ((length == 0) && (*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);
 	}else{
-		map->items[ map->next - 1 ]->value = value;
+		map->items[map->next - 1]->value = value;
 	}
 	return EOK;
 }
 
-void char_map_destroy( char_map_ref map ){
-	if( char_map_is_valid( map )){
-		int	index;
+void char_map_destroy(char_map_ref map){
+	if(char_map_is_valid(map)){
+		int index;
 
 		map->magic = 0;
-		for( index = 0; index < map->next; ++ index ){
-			char_map_destroy( map->items[ index ] );
-		}
-		free( map->items );
+		for(index = 0; index < map->next; ++ index){
+			char_map_destroy(map->items[index]);
+		}
+		free(map->items);
 		map->items = NULL;
 	}
 }
 
-int char_map_exclude( char_map_ref map, const char * identifier, size_t length ){
-	char_map_ref	node;
-
-	node = char_map_find_node( map, identifier, length );
-	if( node ){
-		int	value;
+int char_map_exclude(char_map_ref map, const char * identifier, size_t length){
+	char_map_ref node;
+
+	node = char_map_find_node(map, identifier, length);
+	if(node){
+		int value;
 
 		value = node->value;
@@ -158,21 +164,25 @@
 }
 
-int char_map_find( const char_map_ref map, const char * identifier, size_t length ){
-	char_map_ref	node;
-
-	node = char_map_find_node( map, identifier, length );
+int char_map_find(const char_map_ref map, const char * identifier, size_t length){
+	char_map_ref node;
+
+	node = char_map_find_node(map, identifier, length);
 	return node ? node->value : CHAR_MAP_NULL;
 }
 
-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 || ( * identifier )){
-		int	index;
-
-		for( index = 0; index < map->next; ++ index ){
-			if( map->items[ index ]->c == * identifier ){
+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 || (*identifier)){
+		int index;
+
+		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 );
+				if(length == 1){
+					return map->items[index];
+				}
+				return char_map_find_node(map->items[index], identifier, length ? length - 1 : 0);
 			}
 		}
@@ -182,38 +192,40 @@
 }
 
-int char_map_get_value( const char_map_ref map ){
-	return char_map_is_valid( map ) ? map->value : CHAR_MAP_NULL;
-}
-
-int char_map_initialize( char_map_ref map ){
-	if( ! map ) return EINVAL;
+int char_map_get_value(const char_map_ref map){
+	return char_map_is_valid(map) ? map->value : CHAR_MAP_NULL;
+}
+
+int char_map_initialize(char_map_ref map){
+	if(! map){
+		return EINVAL;
+	}
 	map->c = '\0';
 	map->value = CHAR_MAP_NULL;
 	map->size = 2;
 	map->next = 0;
-	map->items = malloc( sizeof( char_map_ref ) * map->size );
-	if( ! map->items ){
+	map->items = malloc(sizeof(char_map_ref) * map->size);
+	if(! map->items){
 		map->magic = 0;
 		return ENOMEM;
 	}
-	map->items[ map->next ] = NULL;
+	map->items[map->next] = NULL;
 	map->magic = CHAR_MAP_MAGIC_VALUE;
 	return EOK;
 }
 
-int char_map_is_valid( const char_map_ref map ){
-	return map && ( map->magic == CHAR_MAP_MAGIC_VALUE );
-}
-
-int char_map_update( char_map_ref map, const char * identifier, const size_t length, const int value ){
-	char_map_ref	node;
-
-//	if( ! char_map_is_valid( map )) return EINVAL;
-	node = char_map_find_node( map, identifier, length );
-	if( node ){
+int char_map_is_valid(const char_map_ref map){
+	return map && (map->magic == CHAR_MAP_MAGIC_VALUE);
+}
+
+int char_map_update(char_map_ref map, const char * identifier, const size_t length, const int value){
+	char_map_ref node;
+
+//	if(! char_map_is_valid(map)) return EINVAL;
+	node = char_map_find_node(map, identifier, length);
+	if(node){
 		node->value = value;
 		return EOK;
 	}else{
-		return char_map_add( map, identifier, length, value );
+		return char_map_add(map, identifier, length, value);
 	}
 }
