1
0
Fork 0
forked from fun/fun

More notcurses fun. Not stable! (0.39.4)

This commit is contained in:
Johannes Findeisen 2026-03-20 20:57:43 +01:00
commit 18ac230c21
19 changed files with 715 additions and 15 deletions

View file

@ -0,0 +1,29 @@
/**
* This file is part of the Fun programming language.
* https://fun-lang.xyz/
*
* Copyright 2026 Johannes Findeisen <you@hanez.org>
* Licensed under the terms of the Apache-2.0 license.
* https://opensource.org/license/apache-2-0
*/
/* NC_GET_SIZE */
case OP_NC_GET_SIZE: {
#ifdef FUN_WITH_NOTCURSES
if (_fun_nc_std) {
int rows = 0, cols = 0;
ncplane_dim_yx(_fun_nc_std, &rows, &cols);
Value tmp[2];
tmp[0] = make_int(rows);
tmp[1] = make_int(cols);
Value arr = make_array_from_values(tmp, 2);
push_value(vm, arr);
} else {
push_value(vm, make_int(-1));
}
#else
(void)_fun_nc_std;
push_value(vm, make_int(-1));
#endif
break;
}