term: add function to query terminal dimensions

This commit is contained in:
2024-10-27 14:22:52 +00:00
parent f3cc628fd0
commit 2a7249cb1e
2 changed files with 8 additions and 0 deletions

View File

@@ -24,6 +24,12 @@
typedef b_status (*print_function)(FILE *fp, const char *s);
b_status b_term_get_dimensions(FILE *fp, unsigned int *w, unsigned int *h)
{
return z__b_stream_dimensions(fp, w, h) == 0 ? B_SUCCESS
: B_ERR_NOT_SUPPORTED;
}
static int print(FILE *fp, const char *str)
{
return fputs(str, fp);