1
0
Fork 0
forked from fun/fun

Very basic Notcurses support. There are bugs! (0.37.45)

This commit is contained in:
Johannes Findeisen 2026-01-03 21:11:26 +01:00
commit fd582f4d3a
30 changed files with 465 additions and 5 deletions

View file

@ -7,12 +7,15 @@
* https://opensource.org/license/apache-2-0
*/
/* Ensure POSIX prototypes (nanosleep, clock_gettime, localtime_r, etc.) are available
/* Ensure POSIX/XSI prototypes (nanosleep, wcwidth, etc.) are available
* before any system headers are included by amalgamated .c files. */
#ifndef _WIN32
#ifndef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200809L
#endif
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 700
#endif
#endif
#include <stdio.h>
@ -45,6 +48,13 @@
#include "value.h"
#include "vm.h"
/* Shared Notcurses state (optional) */
#ifdef FUN_WITH_NOTCURSES
# include <wchar.h> /* ensure wcwidth/wcswidth prototypes present before notcurses.h on some systems */
# include <notcurses/notcurses.h>
#endif
#include "vm/notcurses/common.h"
// Optional by extensions commonly used code. #ifdef's are in each single file.
#include "external/curl.c"
#include "external/ini.c"
@ -781,6 +791,15 @@ void vm_run(VM *vm, Bytecode *entry) {
#include "vm/tk/bind.c"
#endif
/* Notcurses TUI ops (optional) */
#ifdef FUN_WITH_NOTCURSES
#include "vm/notcurses/init.c"
#include "vm/notcurses/shutdown.c"
#include "vm/notcurses/clear.c"
#include "vm/notcurses/draw_text.c"
#include "vm/notcurses/getch.c"
#endif
/* SQLite ops */
#ifdef FUN_WITH_SQLITE
#include "vm/sqlite/open.c"