Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/adt/measured_strings.c

    r1bfd3d3 r278b97b1  
    5555 *                      appended with the terminating zero ('\0') character
    5656 *                      otherwise.
    57  * @return              The new bundled character string with measured length.
    58  * @return              NULL if there is not enough memory left.
    59  */
    60 measured_string_t *
     57 * @returns             The new bundled character string with measured length.
     58 * @returns             NULL if there is not enough memory left.
     59 */
     60measured_string_ref
    6161measured_string_create_bulk(const char *string, size_t length)
    6262{
    63         measured_string_t *new;
     63        measured_string_ref new;
    6464
    6565        if (length == 0) {
     
    6767                        length++;
    6868        }
    69         new = (measured_string_t *) malloc(sizeof(measured_string_t) +
     69        new = (measured_string_ref) malloc(sizeof(measured_string_t) +
    7070            (sizeof(char) * (length + 1)));
    7171        if (!new)
     
    8484 *
    8585 * @param[in] source    The source measured string to be copied.
    86  * @return              The copy of the given measured string.
    87  * @return              NULL if the source parameter is NULL.
    88  * @return              NULL if there is not enough memory left.
    89  */
    90 measured_string_t *measured_string_copy(measured_string_t *source)
    91 {
    92         measured_string_t *new;
     86 * @returns             The copy of the given measured string.
     87 * @returns             NULL if the source parameter is NULL.
     88 * @returns             NULL if there is not enough memory left.
     89 */
     90measured_string_ref measured_string_copy(measured_string_ref source)
     91{
     92        measured_string_ref new;
    9393
    9494        if (!source)
    9595                return NULL;
    9696
    97         new = (measured_string_t *) malloc(sizeof(measured_string_t));
     97        new = (measured_string_ref) malloc(sizeof(measured_string_t));
    9898        if (new) {
    9999                new->value = (char *) malloc(source->length + 1);
     
    120120 *                      actual character strings.
    121121 *  @param[in] count    The size of the measured strings array.
    122  *  @return             EOK on success.
    123  *  @return             EINVAL if the strings or data parameter is NULL.
    124  *  @return             EINVAL if the count parameter is zero (0).
    125  *  @return             EINVAL if the sent array differs in size.
    126  *  @return             EINVAL if there is inconsistency in sent measured
     122 *  @returns            EOK on success.
     123 *  @returns            EINVAL if the strings or data parameter is NULL.
     124 *  @returns            EINVAL if the count parameter is zero (0).
     125 *  @returns            EINVAL if the sent array differs in size.
     126 *  @returns            EINVAL if there is inconsistency in sent measured
    127127 *                      strings' lengths (should not occur).
    128  *  @return             ENOMEM if there is not enough memory left.
    129  *  @return             Other error codes as defined for the
     128 *  @returns            ENOMEM if there is not enough memory left.
     129 *  @returns            Other error codes as defined for the
    130130 *                      async_data_write_finalize() function.
    131131 */
    132132int
    133 measured_strings_receive(measured_string_t **strings, char **data,
     133measured_strings_receive(measured_string_ref *strings, char **data,
    134134    size_t count)
    135135{
     
    166166        (*data)[lengths[count] - 1] = '\0';
    167167
    168         *strings = (measured_string_t *) malloc(sizeof(measured_string_t) *
     168        *strings = (measured_string_ref) malloc(sizeof(measured_string_t) *
    169169            count);
    170170        if (!*strings) {
     
    209209 * @param[in] strings   The measured strings array to be processed.
    210210 * @param[in] count     The measured strings array size.
    211  * @return              The computed sizes array.
    212  * @return              NULL if there is not enough memory left.
    213  */
    214 static size_t *prepare_lengths(const measured_string_t *strings, size_t count)
     211 * @returns             The computed sizes array.
     212 * @returns             NULL if there is not enough memory left.
     213 */
     214static size_t *prepare_lengths(const measured_string_ref strings, size_t count)
    215215{
    216216        size_t *lengths;
     
    238238 * @param[in] strings   The measured strings array to be transferred.
    239239 * @param[in] count     The measured strings array size.
    240  * @return              EOK on success.
    241  * @return              EINVAL if the strings parameter is NULL.
    242  * @return              EINVAL if the count parameter is zero (0).
    243  * @return              EINVAL if the calling module does not accept the given
     240 * @returns             EOK on success.
     241 * @returns             EINVAL if the strings parameter is NULL.
     242 * @returns             EINVAL if the count parameter is zero (0).
     243 * @returns             EINVAL if the calling module does not accept the given
    244244 *                      array size.
    245  * @return              EINVAL if there is inconsistency in sent measured
     245 * @returns             EINVAL if there is inconsistency in sent measured
    246246 *                      strings' lengths (should not occur).
    247  * @return              Other error codes as defined for the
     247 * @returns             Other error codes as defined for the
    248248 *                      async_data_read_finalize() function.
    249249 */
    250 int measured_strings_reply(const measured_string_t *strings, size_t count)
     250int measured_strings_reply(const measured_string_ref strings, size_t count)
    251251{
    252252        size_t *lengths;
     
    302302 *                      actual character strings.
    303303 * @param[in] count     The size of the measured strings array.
    304  * @return              EOK on success.
    305  * @return              EINVAL if the strings or data parameter is NULL.
    306  * @return              EINVAL if the phone or count parameter is not positive.
    307  * @return              EINVAL if the sent array differs in size.
    308  * @return              ENOMEM if there is not enough memory left.
    309  * @return              Other error codes as defined for the
     304 * @returns             EOK on success.
     305 * @returns             EINVAL if the strings or data parameter is NULL.
     306 * @returns             EINVAL if the phone or count parameter is not positive.
     307 * @returns             EINVAL if the sent array differs in size.
     308 * @returns             ENOMEM if there is not enough memory left.
     309 * @returns             Other error codes as defined for the
    310310 *                      async_data_read_start() function.
    311311 */
    312312int
    313 measured_strings_return(int phone, measured_string_t **strings, char **data,
     313measured_strings_return(int phone, measured_string_ref *strings, char **data,
    314314    size_t count)
    315315{
     
    339339        }
    340340
    341         *strings = (measured_string_t *) malloc(sizeof(measured_string_t) *
     341        *strings = (measured_string_ref) malloc(sizeof(measured_string_t) *
    342342            count);
    343343        if (!*strings) {
     
    378378 * @param[in] strings   The measured strings array to be transferred.
    379379 * @param[in] count     The measured strings array size.
    380  * @return              EOK on success.
    381  * @return              EINVAL if the strings parameter is NULL.
    382  * @return              EINVAL if the phone or count parameter is not positive.
    383  * @return              Other error codes as defined for the
     380 * @returns             EOK on success.
     381 * @returns             EINVAL if the strings parameter is NULL.
     382 * @returns             EINVAL if the phone or count parameter is not positive.
     383 * @returns             Other error codes as defined for the
    384384 *                      async_data_write_start() function.
    385385 */
    386386int
    387 measured_strings_send(int phone, const measured_string_t *strings,
     387measured_strings_send(int phone, const measured_string_ref strings,
    388388    size_t count)
    389389{
Note: See TracChangeset for help on using the changeset viewer.