acrn-hypervisor/devicemodel/include/dm_string.h
Junjie Mao 584f6b7255 doc: replace return with retval
`@return` is dedicated for brief description of return values, not for comments
stating actual return values. In addition, sphinx + breathe does not join
multiple adjacent `@return`. This results in multiple `Return` sections in the
generated document, which is confusing.

This patch replaces `@return` with `@retval` for the lists of return
values. Adjacent `@retval` can be joined into one list by breathe.

v1 -> v2:

* Replace return value descriptions like `negative` and `positive` with
  expressions like `<0` and `>0` in `@retval`.
* Keep the list of `@retval` comprehensive, even when there is a `@return` to
  generally describe what the return value means.
* Drop duplicated `@return` when it does not give more information than the
  `@retval` list.

Tracked-On: #1595
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2018-11-30 14:55:17 +08:00

68 lines
1.5 KiB
C

/*
* Copyright (C) 2018 Intel Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
*/
#ifndef _DM_STRING_H_
#define _DM_STRING_H_
/**
* @brief Convert string to a long integer.
*
* @param s Pointer to original string.
* @param end Pointer to end string.
* @param base Base: 8, 10, 16...
* @param val Long integer convert from string.
*
* @retval -1 error.
* @retval 0 no error.
*/
int dm_strtol(const char *s, char **end, unsigned int base, long *val);
/**
* @brief Convert string to an integer.
*
* @param s Pointer to original string.
* @param end Pointer to end string.
* @param base Base: 8, 10, 16...
* @param val Integer convert from string.
*
* @retval -1 error.
* @retval 0 no error.
*/
int dm_strtoi(const char *s, char **end, unsigned int base, int *val);
/**
* @brief Convert string to an unsigned long integer.
*
* @param s Pointer to original string.
* @param end Pointer to end string.
* @param base Base: 8, 10, 16...
* @param val Unsigned long integer convert from string.
*
* @retval -1 error.
* @retval 0 no error.
*/
int dm_strtoul(const char *s, char **end, unsigned int base, unsigned long *val);
/**
* @brief Convert string to an unsigned integer.
*
* @param s Pointer to original string.
* @param end Pointer to end string after strtol.
* @param base Base: 8, 10, 16...
* @param val Unsigned integer convert from string.
*
* @retval -1 error.
* @retval 0 no error.
*/
int dm_strtoui(const char *s, char **end, unsigned int base, unsigned int *val);
#endif