2026-05-25 10:33:29 +01:00
|
|
|
#include <bshell/line-source.h>
|
2026-05-07 10:52:00 +01:00
|
|
|
|
2026-05-25 10:33:29 +01:00
|
|
|
enum bshell_status bshell_line_source_get_name(
|
|
|
|
|
struct bshell_line_source *src,
|
2026-05-07 10:52:00 +01:00
|
|
|
char *buf,
|
|
|
|
|
size_t count,
|
|
|
|
|
size_t *nr_read)
|
|
|
|
|
{
|
|
|
|
|
if (src->s_get_name) {
|
|
|
|
|
return src->s_get_name(src, buf, count, nr_read);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return BSHELL_ERR_NOT_SUPPORTED;
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-25 10:33:29 +01:00
|
|
|
enum bshell_status bshell_line_source_readline(
|
|
|
|
|
struct bshell_line_source *src,
|
2026-05-07 10:52:00 +01:00
|
|
|
fx_stringstream *out)
|
|
|
|
|
{
|
|
|
|
|
if (src->s_readline) {
|
|
|
|
|
return src->s_readline(src, out);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return BSHELL_ERR_NOT_SUPPORTED;
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-25 10:33:29 +01:00
|
|
|
enum bshell_status bshell_line_source_get_row(
|
|
|
|
|
struct bshell_line_source *src,
|
2026-05-07 10:52:00 +01:00
|
|
|
size_t row,
|
|
|
|
|
char *buf,
|
|
|
|
|
size_t count,
|
|
|
|
|
size_t *nr_read)
|
|
|
|
|
{
|
|
|
|
|
if (src->s_get_row) {
|
|
|
|
|
return src->s_get_row(src, row, buf, count, nr_read);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return BSHELL_ERR_NOT_SUPPORTED;
|
|
|
|
|
}
|