source: gaycko/trunk/src/gaycko.cpp @ 4747

Last change on this file since 4747 was 4747, checked in by Jean-Yves Lamoureux, 9 years ago
  • Added window/*
  • Updated XCode project accordingly
File size: 821 bytes
Line 
1extern "C" {
2#include "gaycko.h"
3#include "io/io.h"
4#include "parsing/parse.h"
5#include "js/glue.h"
6#include "render/renderer.h"
7}
8
9int main(int argc, char *argv[]) {
10
11        char *tstr = testV8();
12        if(strncmp(tstr, "Hello, World!", 13)) {
13                printf("V8 doesn't seem to work : returned '%s', should return 'Hello, World!'\n", tstr);
14        } else {
15                printf("V8 Javascript engine seems to work ok\n");
16        }       
17
18        if(argc!=2) {
19                printf("Usage : %s URL\n", argv[0]);
20                return -1;
21        }
22
23        printf("Opening %s\n", argv[1]);
24
25        gIO *stream = gaycko_open(argv[1]);
26        if(!stream) {
27                printf("Can't open %s\n", argv[1]);   
28                return -1;
29        }
30
31        char *data = gaycko_get_data(stream);
32        int   size = gaycko_get_size(stream);
33
34        gDOM *dom = gaycko_parse(data, size);
35        gaycko_close(stream);
36
37   
38    gaycko_render(dom, 80, 25);
39
40        destroy_node(dom->root);
41
42}
43
44
Note: See TracBrowser for help on using the repository browser.