Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3911 → Rev 3912

/branches/network/uspace/srv/net/structures/measured_strings.h
1,5 → 1,5
/*
* Copyright (c) 2008 Lukas Mejdrech
* Copyright (c) 2009 Lukas Mejdrech
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
31,33 → 31,31
*/
 
/** @file
* A character string with measured length header file.
* This structure has been designed for serialization of character strings between modules.
* Character string with measured length.
* The structure has been designed for serialization of character strings between modules.
*/
 
#ifndef __MEASURED_STRINGS_H__
#define __MEASURED_STRINGS_H__
 
/** A type definition of a character string with measured length.
/** Type definition of the character string with measured length.
* @see measured_string
*/
typedef struct measured_string measured_string_t;
 
/** A type definition of a character string with measured length pointer.
/** Type definition of the character string with measured length pointer.
* @see measured_string
*/
typedef measured_string_t * measured_string_ref;
 
/** A character string with measured length.
/** Character string with measured length.
* This structure has been designed for serialization of character strings between modules.
*/
struct measured_string{
 
/** The character string data.
/** Character string data.
*/
char * value;
 
/** The character string length.
/** Character string length.
*/
size_t length;
};
66,9 → 64,9
* If the measured string is being freed, whole memory block is freed.
* The measured string should be used only as a constant.
* @param string The initial character string to be stored. Input parameter.
* @param length The length of the given string without the terminating zero ('/0') character. If the length is zero (0), the actual length is computed. The given length is used and appended with the terminating zero ('\0') character otherwise. Input parameter.
* @returns The new bundled charecter string with measured length.
* @returns NULL if there is no memory left.
* @param length The length of the given string without the terminating zero ('/0') character. If the length is zero (0), the actual length is computed. The given length is used and appended with the terminating zero ('\\0') character otherwise. Input parameter.
* @returns The new bundled character string with measured length.
* @returns NULL if there is not enough memory left.
*/
measured_string_ref measured_string_create_bulk( const char * string, size_t length );
 
83,7 → 81,7
* @returns EINVAL if the count parameter is zero (0).
* @returns EINVAL if the sent array differs in size.
* @returns EINVAL if there is inconsistency in sent measured strings' lengths (should not occur).
* @returns ENOMEM if there is no memory left.
* @returns ENOMEM if there is not enough memory left.
* @returns Other error codes as defined for the ipc_data_write_finalize() function.
*/
int measured_strings_receive( measured_string_ref * strings, char ** data, size_t count );
112,7 → 110,7
* @returns EINVAL if the strings or data parameter is NULL.
* @returns EINVAL if the phone or count parameter is not positive (<=0).
* @returns EINVAL if the sent array differs in size.
* @returns ENOMEM if there is no memory left.
* @returns ENOMEM if there is not enough memory left.
* @returns Other error codes as defined for the ipc_data_read_start() function.
*/
int measured_strings_return( int phone, measured_string_ref * strings, char ** data, size_t count );