/+junk/gjs-vapi

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/gjs-vapi
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
using Gjs;

int main (string[] args) {
  try {
    var grcs = GLib.Resource.load ("./gjs.vapi.test.gresource");
    grcs._register ();
  } catch (GLib.Error e) {
    print (e.message + "\n");
  }
  
  string js_paths[] = {"resource:///gjs/test/vapi/test/",
                       null};
  
  var ctx = (Context) GLib.Object.@new (typeof (Context) , 
                                            "program-name", "test",
                                            "search-path", js_paths);
  
  int t_i;
  try {
    ctx.set_argv (args);
    var b = ctx.eval_file ("test.js", out t_i);
    print (ctx.program_name + "\n");
    b = bool.parse (b.to_string ());
  } catch (GLib.Error e) {
    print (e.message + "\n");
  }
  
  return 0;
}