static jmp_buf ctrlc_;
-void sigint(int) {
+static void sigint(int) {
longjmp(ctrlc_, 1);
}
+static JSStringRef Result_;
+
void Run(const char *code, FILE *fout) { _pooled
JSStringRef script(JSStringCreateWithUTF8CString(code));
if (exception != NULL)
goto error;
+ CYSetProperty(context, CYGetGlobalObject(context), Result_, result);
+
if (fout != NULL) {
fputs(json, fout);
fputs("\n", fout);
}
}
-void Console() {
+static void Console() {
bool bypass(false);
bool debug(false);
fflush(fout);
}
-void *Map(const char *path, size_t *psize) {
+static void *Map(const char *path, size_t *psize) {
int fd;
_syscall(fd = open(path, O_RDONLY));
script = argv[1];
}
+ Result_ = CYCopyJSString("_");
+
if (script == NULL || strcmp(script, "-") == 0)
Console();
else {