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

Last change on this file since 4746 was 4746, checked in by Jean-Yves Lamoureux, 10 years ago
  • Call dummy renderer in main()
File size: 822 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
12        char *tstr = testV8();
13        if(strncmp(tstr, "Hello, World!", 13)) {
14                printf("V8 doesn't seem to work : returned '%s', should return 'Hello, World!'\n", tstr);
15        } else {
16                printf("V8 Javascript engine seems to work ok\n");
17        }       
18
19        if(argc!=2) {
20                printf("Usage : %s URL\n", argv[0]);
21                return -1;
22        }
23
24        printf("Opening %s\n", argv[1]);
25
26        gIO *stream = gaycko_open(argv[1]);
27        if(!stream) {
28                printf("Can't open %s\n", argv[1]);   
29                return -1;
30        }
31
32        char *data = gaycko_get_data(stream);
33        int   size = gaycko_get_size(stream);
34
35        gDOM *dom = gaycko_parse(data, size);
36        gaycko_close(stream);
37
38   
39    gaycko_render(dom, 80, 25);
40
41        destroy_node(dom->root);
42
43}
44
45
Note: See TracBrowser for help on using the repository browser.