X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Fconsole.h;h=b182440fcd639be7f0a5f1e15ef1aa2c63a0d445;hb=49c8ef0e45a91ec894ef15e7d043dafe8f1c5efd;hp=7e628c0cf8360b94d705b789851d2c87c4bf9655;hpb=b5b0237d0216db34605ca54b83588fcfcf5e63a8;p=platform%2Fkernel%2Fu-boot.git diff --git a/include/console.h b/include/console.h index 7e628c0..b182440 100644 --- a/include/console.h +++ b/include/console.h @@ -72,7 +72,8 @@ int console_record_reset_enable(void); * * @str: Place to put string * @maxlen: Maximum length of @str including nul terminator - * @return length of string returned + * @return length of string returned, or -ENOSPC if the console buffer was + * overflowed by the output */ int console_record_readline(char *str, int maxlen); @@ -82,6 +83,17 @@ int console_record_readline(char *str, int maxlen); * @return available bytes (0 if empty) */ int console_record_avail(void); + +/** + * console_in_puts() - Write a string to the console input buffer + * + * This writes the given string to the console_in buffer which will then be + * returned if a function calls e.g. `getc()` + * + * @str: the string to write + * @return the number of bytes added + */ +int console_in_puts(const char *str); #else static inline int console_record_init(void) { @@ -113,6 +125,12 @@ static inline int console_record_avail(void) return 0; } +static inline int console_in_puts(const char *str) +{ + /* There is never anything written */ + return 0; +} + #endif /* !CONFIG_CONSOLE_RECORD */ /**