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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
/*
* SPDX-License-Identifier: MIT OR LGPL-2.0-or-later
*
* SPDX-FileContributor: Authored By: Gustav Hartvigsson
*/
[CCode (cheader_filename = "gjs/gjs.h", cprefix = "Gjs", lower_case_cprefix = "gjs_")]
namespace Gjs {
[CCode (cheader_filename = "gjs/error-types.h", cname = "GjsError", prefix = "GJS_ERROR_", lower_case_cprefix = "gjs_error_")]
public errordomain GjsError {
FAILED,
EXIT,
}
[CCode (cheader_filename = "gjs/error-types.h", cname = "GjsJSError", prefix = "GJS_JS_ERROR_", lower_case_cprefix = "gjs_js_error_")]
public errordomain GjsJSError {
ERROR,
ERROR,
EVAL_ERROR,
INTERNAL_ERROR,
RANGE_ERROR,
REFERENCE_ERROR,
STOP_ITERATION,
SYNTAX_ERROR,
TYPE_ERROR,
URI_ERROR,
}
/*
* Gjs.Context is an opaque datastructure with no outward visible
* members.
*/
[CCode (cheader_filename = "gjs/context.h", cname = "GjsContext", type_id = "GJS_TYPE_CONTEXT")]
public class Context {
[CCode (cname = "gjs_context_new")]
public Context ();
[CCode (cname = "gjs_context_new_with_search_path")]
public bool Context.with_search_path (string[] search_path);
[CCode (cname = "gjs_context_file")]
public bool eval_file (const string filename,
out int exit_status_p)
throws GLib.Error;
[CCode (cname = "gjs_context_eval_module_file")]
public bool eval_module_file (const string filename,
out uint8 exit_status_p)
throws GLib.Error;
[CCode (cname = "gjs_context_eval")]
public bool eval (const string script,
const string filename,
out exit_status_p)
throws GLib.Error;
[CCode (cname = "gjs_context_register_module")]
public bool register_module (const string identifier,
const string uri)
throws GLib.Error;
[CCode (cname = "gjs_context_eval_module")]
public bool eval_module (const string identifier,
out uint8 exit_code)
throws GLib.Error;
[CCode (cname = "gjs_context_define_string_array")]
public bool define_string_array (const string array_name,
[CCode array_length_pos = 1.1]
const string[] array_values)
throws GLib.Error;
[CCode (cname = "gjs_context_set_argv")]
public void set_argv ([CCode array_length_pos = 0.1]
string[] array_values);
[CCode (cname = "gjs_context_get_all")]
public GLib.List get_all ();
[CCode (cname = "gjs_context_get_current")]
public static Context get_current ();
[CCode (cname = "gjs_context_make_current")]
public void make_current ();
[CCode (cname = "gjs_context_get_native_context")]
public pointer get_native_context ();
[CCode (cname = "gjs_context_print_stack_stderr")]
public void print_stack_stderr ();
[CCode (cname = "gjs_context_maybe_gc")]
public void maybe_gc ();
[CCode (cname = "gjs_context_gc")]
public void gc ();
[CCode (cname = "gjs_context_get_profiler")]
public Profiler get_profiler ();
[CCode (cname = "gjs_profiler_chain_sgnal")]
public bool profiler_chain_signal (Posix.siginfo_t info)
[CCode (cname = "gjs_context_setup_debugger_console")]
public void setup_debugger_console ();
}
[CCode (cheader_filename = "gjs/context.h", cname = "gjs_dump_stack")]
public void dump_stack ();
[CCode (cheader_filename = "gjs/context.h", cname = "gjs_get_js_version")]
public const string get_js_version ();
/*
* This class has no visible _new function, can only be created from
* context.
*/
[CCode (cheader_filename = "gjs/profiler.h", cname = "GjsProfiler", type_id = "GJS_TYPE_PROFILER")]
public class Profiler {
[CCode (cname = "gjs_profiler_set_capture_writer")]
set_capture_writer (pointer capture);
[CCode (cname = "gjs_profiler_set_filename")]
set_filename (const string filename);
[CCode (cname = "gjs_profiler_set_fd")]
set_fd (int fd);
[CCode (cname = "gjs_profiler_start")]
start ();
[CCode (cname = "gjs_profiler_stop")]
stop ();
}
[CCode (cheader_filename = "gjs/mem.h", cname = "gjs_memory_report")]
memory_report (const string where,
bool die_if_fail);
[CCode (cheader_filename = "gjs/coverage.h", cname = "GjsProfiler", type_id = "GJS_TYPE_COVERAGE")]
public class Coverage {
[CCode (cname = "gjs_coverage_new")]
public Coverage (const string coverage_prefixes
Context coverage_context,
GLib.File output_dir);
[CCode (cname = "gjs_coverage_write_statistics")]
public void write_statistics ();
[CCode (cname = "gjs_coverage_enable")]
public static enable ();
}
}
|