Very basic Notcurses support. There are bugs! (0.37.45)
This commit is contained in:
parent
4a6903e58a
commit
fd582f4d3a
30 changed files with 465 additions and 5 deletions
21
src/vm.c
21
src/vm.c
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue