Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4270 → Rev 4271

/branches/network/uspace/srv/net/structures/measured_strings.c
71,6 → 71,25
return new;
}
 
measured_string_ref measured_string_copy( measured_string_ref source ){
measured_string_ref new;
 
if( ! source ) return NULL;
new = ( measured_string_ref ) malloc( sizeof( measured_string_t ));
if( new ){
new->value = ( char * ) malloc( source->length + 1 );
if( new->value ){
new->length = source->length;
memcpy( new->value, source->value, new->length );
new->value[ new->length ] = '\0';
return new;
}else{
free( new );
}
}
return NULL;
}
 
int measured_strings_receive( measured_string_ref * strings, char ** data, size_t count ){
ERROR_DECLARE;
 
/branches/network/uspace/srv/net/structures/measured_strings.h
70,6 → 70,14
*/
measured_string_ref measured_string_create_bulk( const char * string, size_t length );
 
/** Copies the given measured string with separated header and data parts.
* @param source The source measured string to be copied. Input parameter.
* @returns The copy of the given measured string.
* @returns NULL if the source parameter is NULL.
* @returns NULL if there is not enough memory left.
*/
measured_string_ref measured_string_copy( measured_string_ref source );
 
/** Receives a measured strings array from a calling module.
* Creates the array and the data memory blocks.
* This method should be used only while processing IPC messages as the array size has to be negotiated in advance.