diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2008-08-31 22:10:35 +0000 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2008-08-31 22:10:35 +0000 |
commit | 3153863567f51c9173227b9cb4375d53e6f3e6ed (patch) | |
tree | 3502c7fa5c991c73d2b2fe669ebf3411ef08f10d /payloads/libpayload/libc | |
parent | 0e6ad6bd09594924f6f7224bc14b27f9c4e8429c (diff) |
Various Doxygen-related fixes in libpayload (trivial).
- Drop all '@brief's, they're not needed as we use JAVADOC_AUTOBRIEF.
The first sentence of every description will be treated as the '@brief'
automatically.
- Also, put all documentation/descriptions on top of the Doxygen-comments,
and put the '@foo' keywords at the bottom of the comments for consistency.
- Change comments for SEEK_SET/SEEK_CUR/SEEK_END from '/**@def' to '/**<'
in order to make them appear in the output.
- Drop all explicit '@struct' lines (which are optional; Doxygen will figure
out that it's a struct if the comment is right before the struct).
- Fix various typos, whitespace issues, etc.
- Fix incorrect @param variable names, e.g. change '@param n foobar' to
'@param s foobar' if the variable is named 's'.
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3555 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'payloads/libpayload/libc')
-rw-r--r-- | payloads/libpayload/libc/readline.c | 46 | ||||
-rw-r--r-- | payloads/libpayload/libc/time.c | 23 |
2 files changed, 35 insertions, 34 deletions
diff --git a/payloads/libpayload/libc/readline.c b/payloads/libpayload/libc/readline.c index 4faf3d7895..01a565a698 100644 --- a/payloads/libpayload/libc/readline.c +++ b/payloads/libpayload/libc/readline.c @@ -27,27 +27,27 @@ * SUCH DAMAGE. */ -/** @file libc/readline.c - * @brief Simple readline implementation +/** + * @file libc/readline.c + * Simple readline implementation */ #include <libpayload.h> -static char * readline_buffer; +static char *readline_buffer; static int readline_bufferlen; /** - * @brief Read a line from the terminal and return it - * @param prompt A prompt to display on the line - * @return A pointer to the input string + * Read a line from the terminal and return it. + * + * This readline implementation is rather simple, but it does more than the + * original readline() because it allows us to have a pre-filled buffer. + * To pre-fill the buffer, use the getline() function. * - * Read a line from the terminal and return it. This readline implementation - * is rather simple, but it does more than the original readline() because - * it allows us to have a pre-filled buffer. To pre-fill the buffer, use the - * getline() function. + * @param prompt A prompt to display on the line. + * @return A pointer to the input string. */ - -char * readline(const char * prompt) +char *readline(const char *prompt) { char *buffer; int current, ch, nonspace_seen; @@ -141,7 +141,6 @@ char * readline(const char * prompt) } } - out: if (current >= readline_bufferlen) current = readline_bufferlen - 1; @@ -151,22 +150,23 @@ out: } /** - * @brief Read a line from the input and store it in a buffer - * @param prompt A buffer to store the line in - * @param len Length of the buffer - * @return The final length of the string - * This function allows the user to pass a predefined buffer to - * readline(). The buffer may be filled with a default value - * which will be displayed by readline and can be edited as normal. - * The final input string returned by readline will be returned in + * Read a line from the input and store it in a buffer. + * + * This function allows the user to pass a predefined buffer to readline(). + * The buffer may be filled with a default value which will be displayed by + * readline() and can be edited as normal. + * The final input string returned by readline() will be returned in * the buffer and the function will return the length of the string. + * + * @param buffer Pointer to a buffer to store the line in. + * @param len Length of the buffer. + * @return The final length of the string. */ - int getline(char *buffer, int len) { readline_buffer = buffer; readline_bufferlen = len; readline(NULL); + return strlen(buffer); } - diff --git a/payloads/libpayload/libc/time.c b/payloads/libpayload/libc/time.c index b49879b9d8..b47e452e49 100644 --- a/payloads/libpayload/libc/time.c +++ b/payloads/libpayload/libc/time.c @@ -27,8 +27,9 @@ * SUCH DAMAGE. */ -/** @file libc/time.c - * @brief General Time Functions +/** + * @file libc/time.c + * General time functions */ #include <config.h> @@ -115,18 +116,18 @@ static void gettimeofday_init(void) #endif /** - * Return the current time broken into a timeval structure - * @param tv A pointer to a timeval structure - * @param tz Added for compatability - not used - * @return 0 for success + * Return the current time broken into a timeval structure. + * + * @param tv A pointer to a timeval structure. + * @param tz Added for compatability - not used. + * @return 0 for success (this function cannot return non-zero currently). */ int gettimeofday(struct timeval *tv, void *tz) { - /* Call the gtod init when we need it - this keeps - the code from being included in the binary if we don't - need it - */ - + /* + * Call the gtod init when we need it - this keeps the code from + * being included in the binary if we don't need it. + */ if (!clock.ticks) gettimeofday_init(); |