-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjscc.cpp
61 lines (47 loc) · 1015 Bytes
/
jscc.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include "jerry.h"
#include "jrt/jrt.h"
#include "jerry-port.h"
#include "libev/ev.h"
#include "JsObject.h"
#include "JsUart.h"
#include "JsHttp.h"
#include "JsTimer.h"
int jerry_port_logmsg (FILE* stream, const char* format, ...)
{
va_list args;
int count;
va_start (args, format);
count = vfprintf (stream, format, args);
va_end (args);
return count;
}
int jerry_port_errormsg (const char* format, ...)
{
va_list args;
int count;
va_start (args, format);
count = vfprintf (stderr, format, args);
va_end (args);
return count;
}
int jerry_port_putchar (int c)
{
return putchar (c);
}
int main(int argc, char **argv)
{
struct ev_loop* loop = ev_default_loop(0);
jerry_init (0);
JsUart::Register();
JsHttp::Register();
JsTimer::Register();
JsObject::EvalJsFile("jscc.js");
jerry_run ();
ev_loop(loop, 0);
jerry_cleanup ();
return 0;
}