mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-24 14:25:56 +00:00
common: console: introduce console_record_isempty helper
Add console_record_isempty to check if console record buffer contains any data. Signed-off-by: Ion Agorria <ion@agorria.com> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Link: https://lore.kernel.org/r/20240105072212.6615-4-clamor95@gmail.com Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
This commit is contained in:
parent
475aa9aabe
commit
9ce75f4912
2 changed files with 18 additions and 0 deletions
|
@ -853,6 +853,11 @@ int console_record_avail(void)
|
|||
return membuff_avail((struct membuff *)&gd->console_out);
|
||||
}
|
||||
|
||||
bool console_record_isempty(void)
|
||||
{
|
||||
return membuff_isempty((struct membuff *)&gd->console_out);
|
||||
}
|
||||
|
||||
int console_in_puts(const char *str)
|
||||
{
|
||||
return membuff_put((struct membuff *)&gd->console_in, str, strlen(str));
|
||||
|
|
|
@ -84,6 +84,13 @@ int console_record_readline(char *str, int maxlen);
|
|||
*/
|
||||
int console_record_avail(void);
|
||||
|
||||
/**
|
||||
* console_record_isempty() - Returns if console output is empty
|
||||
*
|
||||
* Return: true if empty
|
||||
*/
|
||||
bool console_record_isempty(void);
|
||||
|
||||
/**
|
||||
* console_in_puts() - Write a string to the console input buffer
|
||||
*
|
||||
|
@ -131,6 +138,12 @@ static inline int console_in_puts(const char *str)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline bool console_record_isempty(void)
|
||||
{
|
||||
/* Always empty */
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif /* !CONFIG_CONSOLE_RECORD */
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue