/+junk/gjs-vapi

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/gjs-vapi
2 by Gustav Hartvigsson
More code.
1
using Gjs;
2
3
int main (string[] args) {
4
  try {
5
    var grcs = GLib.Resource.load ("./gjs.vapi.test.gresource");
6
    grcs._register ();
7
  } catch (GLib.Error e) {
8
    print (e.message + "\n");
9
  }
10
  
3 by Gustav Hartvigsson
* moved the path array out of the function call.
11
  string js_paths[] = {"resource:///gjs/test/vapi/test/",
12
                       null};
13
  
5 by Gustav Hartvigsson
* Added comments to the VAPI file.
14
  var ctx = (Context) GLib.Object.@new (typeof (Context) , 
15
                                            "program-name", "test",
16
                                            "search-path", js_paths);
2 by Gustav Hartvigsson
More code.
17
  
5 by Gustav Hartvigsson
* Added comments to the VAPI file.
18
  int t_i;
2 by Gustav Hartvigsson
More code.
19
  try {
5 by Gustav Hartvigsson
* Added comments to the VAPI file.
20
    ctx.set_argv (args);
21
    var b = ctx.eval_file ("test.js", out t_i);
22
    print (ctx.program_name + "\n");
2 by Gustav Hartvigsson
More code.
23
    b = bool.parse (b.to_string ());
24
  } catch (GLib.Error e) {
25
    print (e.message + "\n");
26
  }
5 by Gustav Hartvigsson
* Added comments to the VAPI file.
27
  
2 by Gustav Hartvigsson
More code.
28
  return 0;
29
}