/
apd.idl.php
261 lines (244 loc) · 8.06 KB
/
apd.idl.php
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
<?php
/**
* Automatically generated by running "php schema.php apd".
*
* You may modify the file, but re-running schema.php against this file will
* standardize the format without losing your schema changes. It does lose
* any changes that are not part of schema. Use "note" field to comment on
* schema itself, and "note" fields are not used in any code generation but
* only staying within this file.
*/
///////////////////////////////////////////////////////////////////////////////
// Preamble: C++ code inserted at beginning of ext_{name}.h
DefinePreamble(<<<CPP
CPP
);
///////////////////////////////////////////////////////////////////////////////
// Constants
//
// array (
// 'name' => name of the constant
// 'type' => type of the constant
// 'note' => additional note about this constant's schema
// )
///////////////////////////////////////////////////////////////////////////////
// Functions
//
// array (
// 'name' => name of the function
// 'desc' => description of the function's purpose
// 'flags' => attributes of the function, see base.php for possible values
// 'opt' => optimization callback function's name for compiler
// 'note' => additional note about this function's schema
// 'return' =>
// array (
// 'type' => return type, use Reference for ref return
// 'desc' => description of the return value
// )
// 'args' => arguments
// array (
// 'name' => name of the argument
// 'type' => type of the argument, use Reference for output parameter
// 'value' => default value of the argument
// 'desc' => description of the argument
// )
// )
DefineFunction(
array(
'name' => "override_function",
'desc' => "Overrides built-in functions by replacing them in the symbol table.",
'flags' => HasDocComment,
'return' => array(
'type' => Boolean,
'desc' => "Returns TRUE on success or FALSE on failure.",
),
'args' => array(
array(
'name' => "name",
'type' => String,
'desc' => "The function to override.",
),
array(
'name' => "args",
'type' => String,
'desc' => "The function arguments, as a comma separated string.\n\nUsually you will want to pass this parameter, as well as the function_code parameter, as a single quote delimited string. The reason for using single quoted strings, is to protect the variable names from parsing, otherwise, if you use double quotes there will be a need to escape the variable names, e.g. \\\$your_var.",
),
array(
'name' => "code",
'type' => String,
'desc' => "The new code for the function.",
),
),
'taint_observer' => false,
));
DefineFunction(
array(
'name' => "rename_function",
'desc' => "Renames a orig_name to new_name in the global function table. Useful for temporarily overriding built-in functions.",
'flags' => HasDocComment,
'return' => array(
'type' => Boolean,
'desc' => "Returns TRUE on success or FALSE on failure.",
),
'args' => array(
array(
'name' => "orig_name",
'type' => String,
'desc' => "The original function name.",
),
array(
'name' => "new_name",
'type' => String,
'desc' => "The new name for the original_name function.",
),
),
'taint_observer' => false,
));
DefineFunction(
array(
'name' => "apd_set_browser_trace",
'flags' => HasDocComment,
'return' => array(
'type' => null,
),
'taint_observer' => false,
));
DefineFunction(
array(
'name' => "apd_set_pprof_trace",
'desc' => "Starts debugging to pprof_{process_id} in the dump directory.",
'flags' => HasDocComment,
'return' => array(
'type' => String,
'desc' => "Returns path of the destination file.",
),
'args' => array(
array(
'name' => "dumpdir",
'type' => String,
'value' => "null_string",
'desc' => "The directory in which the profile dump file is written. If not set, the apd.dumpdir setting from the php.ini file is used.",
),
array(
'name' => "frament",
'type' => String,
'value' => "null_string",
),
),
'taint_observer' => false,
));
DefineFunction(
array(
'name' => "apd_set_session_trace_socket",
'desc' => "Connects to the specified tcp_server (eg. tcplisten) and sends debugging data to the socket.",
'flags' => HasDocComment,
'return' => array(
'type' => Boolean,
'desc' => "Returns TRUE on success or FALSE on failure.",
),
'args' => array(
array(
'name' => "ip_or_filename",
'type' => String,
'desc' => "IP or Unix Domain socket (like a file) of the TCP server.",
),
array(
'name' => "domain",
'type' => Int32,
'desc' => "Can be AF_UNIX for file based sockets or APD_AF_INET for standard tcp/ip.",
),
array(
'name' => "port",
'type' => Int32,
'desc' => "You can use any port, but higher numbers are better as most of the lower numbers may be used by other system services.",
),
array(
'name' => "mask",
'type' => Int32,
'desc' => "An integer which is formed by adding together the XXX_TRACE constants.\n\nIt is not recommended to use MEMORY_TRACE. It is very slow and does not appear to be accurate. ASSIGNMENT_TRACE is not implemented yet.\n\nTo turn on all functional traces (TIMING, FUNCTIONS, ARGS SUMMARY (like strace -c)) use the value 99",
),
),
'taint_observer' => false,
));
DefineFunction(
array(
'name' => "apd_stop_trace",
'flags' => HasDocComment,
'return' => array(
'type' => null,
),
'taint_observer' => false,
));
DefineFunction(
array(
'name' => "apd_breakpoint",
'desc' => "This can be used to stop the running of your script, and await responses on the connected socket. To step the program, just send enter (a blank line), or enter a php command to be executed.",
'flags' => HasDocComment,
'return' => array(
'type' => Boolean,
'desc' => "Returns TRUE on success or FALSE on failure.",
),
'taint_observer' => false,
));
DefineFunction(
array(
'name' => "apd_continue",
'desc' => "Usually sent via the socket to restart the interpreter.",
'flags' => HasDocComment,
'return' => array(
'type' => Boolean,
'desc' => "Returns TRUE on success or FALSE on failure.",
),
'taint_observer' => false,
));
DefineFunction(
array(
'name' => "apd_echo",
'desc' => "Usually sent via the socket to request information about the running script.",
'flags' => HasDocComment,
'return' => array(
'type' => Boolean,
'desc' => "Returns TRUE on success or FALSE on failure.",
),
'args' => array(
array(
'name' => "output",
'type' => String,
'desc' => "The debugged variable.",
),
),
'taint_observer' => false,
));
///////////////////////////////////////////////////////////////////////////////
// Classes
//
// BeginClass
// array (
// 'name' => name of the class
// 'desc' => description of the class's purpose
// 'flags' => attributes of the class, see base.php for possible values
// 'note' => additional note about this class's schema
// 'parent' => parent class name, if any
// 'ifaces' => array of interfaces tihs class implements
// 'bases' => extra internal and special base classes this class requires
// 'footer' => extra C++ inserted at end of class declaration
// )
//
// DefineConstant(..)
// DefineConstant(..)
// ...
// DefineFunction(..)
// DefineFunction(..)
// ...
// DefineProperty
// DefineProperty
//
// array (
// 'name' => name of the property
// 'type' => type of the property
// 'flags' => attributes of the property
// 'desc' => description of the property
// 'note' => additional note about this property's schema
// )
//
// EndClass()