forked from Mirror/wren
This adds a "timer" module to the CLI that provides a Timer class with a static sleep() method. Not the most exciting functionality in the world, but it requires the full hunk of libuv integration: - The CLI sets up libuv and runs the event loop. - Added a new directory src/module for CLI modules. - Updated all the make scripts to handle it. - Reorganized some other CLI code.
23 lines
483 B
C
23 lines
483 B
C
#ifndef vm_h
|
|
#define vm_h
|
|
|
|
#include "uv.h"
|
|
#include "wren.h"
|
|
|
|
// Executes the Wren script at [path] in a new VM.
|
|
//
|
|
// If [bindForeign] is not `NULL`, it will be called to register any foreign
|
|
// methods that the CLI itself doesn't handle.
|
|
void runFile(const char* path, WrenBindForeignMethodFn bindForeign);
|
|
|
|
// Runs the Wren interactive REPL.
|
|
int runRepl();
|
|
|
|
// Gets the currently running VM.
|
|
WrenVM* getVM();
|
|
|
|
// Gets the event loop the VM is using.
|
|
uv_loop_t* getLoop();
|
|
|
|
#endif
|