Subversion Repositories Kolibri OS

Rev

Rev 2048 | Rev 8473 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2048 Rev 2073
Line 1... Line 1...
1
#include "tp.c"
1
#include "tp.c"
2
/* INCLUDE */
2
/* INCLUDE */
3
const char header[]="TinyPy for kolibriOS";
3
const char header[]="TinyPy for kolibriOS";
4
const int argc = 2;
-
 
5
extern _stdcall void kolibri_dbg_init(tp_vm *tp);
4
extern _stdcall void kolibri_dbg_init(tp_vm *tp);
Line 6... Line -...
6
 
-
 
7
void main(void) {
-
 
8
    char *argv[2]={"tpmain", "test.py"};
-
 
9
 
-
 
10
    CONSOLE_INIT(header);
-
 
11
    con_printf("TinyPy console, version 1.1.\n");
-
 
12
    con_printf("Enter program file:");
-
 
13
    if (!(argv[1] = malloc(256)))
-
 
14
      con_printf("Memory error\n");
-
 
15
    con_gets(argv[1], 256);
-
 
16
    argv[1][strlen(argv[1]) - 1] = '\0';
5
 
17
    con_printf("Running file %s\n", argv[1]);
6
void main(int argc, const char *argv[]) {
18
    tp_vm *tp = tp_init(argc, argv);
7
    tp_vm *tp = tp_init(argc, argv);
19
    kolibri_dbg_init(tp);
8
    kolibri_dbg_init(tp);
-
 
9
    kolibri_init(tp);
20
    kolibri_init(tp);
10
    CONSOLE_INIT(header);
21
    /* INIT */
11
    /* INIT */
-
 
12
    tp_call(tp,"py2bc","tinypy",tp_None);
22
    tp_call(tp,"py2bc","tinypy",tp_None);
13
    con_printf("Done");
23
    tp_deinit(tp);
14
    tp_deinit(tp);
24
    kol_exit();
15
    kol_exit();
25
    return;
16
    return;