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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
|
/*
* 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 (cname = "GjsError",
cprefix = "GJS_ERROR_",
lower_case_cprefix = "gjs_error_")]
public errordomain Error {
FAILED,
EXIT,
}
[CCode (cname = "GjsJSError",
cprefix = "GJS_JS_ERROR_",
lower_case_cprefix = "gjs_js_error_")]
public errordomain JSError {
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 (cname = "GjsContext",
type_id = "GJS_TYPE_CONTEXT")]
public class Context : GLib.Object {
[CCode (cname = "gjs_context_new")]
public Context ();
[CCode (cname = "gjs_context_new_with_search_path")]
public Context.with_search_path ([CCode (array_length = false)]
string[] search_path);
[CCode (cname = "gjs_context_eval_file")]
public bool eval_file (string filename,
out int exit_status_p)
throws GLib.Error;
[CCode (cname = "gjs_context_eval_module_file")]
public bool eval_module_file (string filename,
out uint8 exit_status_p)
throws GLib.Error;
[CCode (cname = "gjs_context_eval")]
public bool eval (string script,
string filename,
out int exit_status_p)
throws GLib.Error;
[CCode (cname = "gjs_context_register_module")]
public bool register_module (string identifier,
string uri)
throws GLib.Error;
[CCode (cname = "gjs_context_eval_module")]
public bool eval_module (string identifier,
out uint8 exit_code)
throws GLib.Error;
[CCode (cname = "gjs_context_define_string_array")]
public bool define_string_array (string array_name,
[CCode (array_length_pos = 1.1)]
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 GLib.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 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 : GLib.Object {
[CCode (cname = "gjs_profiler_set_capture_writer")]
void set_capture_writer (GLib.pointer capture);
[CCode (cname = "gjs_profiler_set_filename")]
void set_filename (string filename);
[CCode (cname = "gjs_profiler_set_fd")]
void set_fd (int fd);
[CCode (cname = "gjs_profiler_start")]
void start ();
[CCode (cname = "gjs_profiler_stop")]
void stop ();
}
[CCode (cheader_filename = "gjs/mem.h",
cname = "gjs_memory_report")]
void memory_report (string where,
bool die_if_fail);
[CCode (cheader_filename = "gjs/coverage.h",
cname = "GjsProfiler",
type_id = "GJS_TYPE_COVERAGE")]
public class Coverage : GLib.Object {
[CCode (cname = "gjs_coverage_new")]
public Coverage (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 void enable ();
}
}
|