Fix heredoc/nowdoc bugs with large docs, docs crossing buffer boundaries
[hiphop-php.git] / hphp / idl / hash.idl.php
blob5df92098f710d858b83455b5cf026f65b59f117e
1 <?php
2 /**
3 * Automatically generated by running "php schema.php hash".
5 * You may modify the file, but re-running schema.php against this file will
6 * standardize the format without losing your schema changes. It does lose
7 * any changes that are not part of schema. Use "note" field to comment on
8 * schema itself, and "note" fields are not used in any code generation but
9 * only staying within this file.
11 ///////////////////////////////////////////////////////////////////////////////
12 // Preamble: C++ code inserted at beginning of ext_{name}.h
14 DefinePreamble(<<<CPP
16 CPP
19 ///////////////////////////////////////////////////////////////////////////////
20 // Constants
22 // array (
23 // 'name' => name of the constant
24 // 'type' => type of the constant
25 // 'note' => additional note about this constant's schema
26 // )
29 ///////////////////////////////////////////////////////////////////////////////
30 // Functions
32 // array (
33 // 'name' => name of the function
34 // 'desc' => description of the function's purpose
35 // 'flags' => attributes of the function, see base.php for possible values
36 // 'opt' => optimization callback function's name for compiler
37 // 'note' => additional note about this function's schema
38 // 'return' =>
39 // array (
40 // 'type' => return type, use Reference for ref return
41 // 'desc' => description of the return value
42 // )
43 // 'args' => arguments
44 // array (
45 // 'name' => name of the argument
46 // 'type' => type of the argument, use Reference for output parameter
47 // 'value' => default value of the argument
48 // 'desc' => description of the argument
49 // )
50 // )
52 DefineFunction(
53 array(
54 'name' => "hash",
55 'flags' => HasDocComment,
56 'return' => array(
57 'type' => Variant,
58 'desc' => "Returns a string containing the calculated message digest as lowercase hexits unless raw_output is set to true in which case the raw binary representation of the message digest is returned.",
60 'args' => array(
61 array(
62 'name' => "algo",
63 'type' => String,
64 'desc' => "Name of selected hashing algorithm (i.e. \"md5\", \"sha256\", \"haval160,4\", etc..)",
66 array(
67 'name' => "data",
68 'type' => String,
69 'desc' => "Message to be hashed.",
71 array(
72 'name' => "raw_output",
73 'type' => Boolean,
74 'value' => "false",
75 'desc' => "When set to TRUE, outputs raw binary data. FALSE outputs lowercase hexits.",
78 'taint_observer' => array(
79 'set_mask' => "TAINT_BIT_MUTATED",
80 'clear_mask' => "TAINT_BIT_NONE",
82 ));
84 DefineFunction(
85 array(
86 'name' => "hash_algos",
87 'flags' => HasDocComment,
88 'return' => array(
89 'type' => StringVec,
90 'desc' => "Returns a numerically indexed array containing the list of supported hashing algorithms.",
92 'taint_observer' => false,
93 ));
95 DefineFunction(
96 array(
97 'name' => "hash_init",
98 'flags' => HasDocComment,
99 'return' => array(
100 'type' => Variant,
101 'desc' => "Returns a Hashing Context resource for use with hash_update(), hash_update_stream(), hash_update_file(), and hash_final().",
103 'args' => array(
104 array(
105 'name' => "algo",
106 'type' => String,
107 'desc' => "Name of selected hashing algorithm (i.e. \"md5\", \"sha256\", \"haval160,4\", etc..)",
109 array(
110 'name' => "options",
111 'type' => Int32,
112 'value' => "0",
113 'desc' => "Optional settings for hash generation, currently supports only one option: HASH_HMAC. When specified, the key must be specified.",
115 array(
116 'name' => "key",
117 'type' => String,
118 'value' => "null_string",
119 'desc' => "When HASH_HMAC is specified for options, a shared secret key to be used with the HMAC hashing method must be supplied in this parameter.",
122 'taint_observer' => false,
125 DefineFunction(
126 array(
127 'name' => "hash_file",
128 'flags' => HasDocComment,
129 'return' => array(
130 'type' => Variant,
131 'desc' => "Returns a string containing the calculated message digest as lowercase hexits unless raw_output is set to true in which case the raw binary representation of the message digest is returned.",
133 'args' => array(
134 array(
135 'name' => "algo",
136 'type' => String,
137 'desc' => "Name of selected hashing algorithm (i.e. \"md5\", \"sha256\", \"haval160,4\", etc..)",
139 array(
140 'name' => "filename",
141 'type' => String,
142 'desc' => "URL describing location of file to be hashed; Supports fopen wrappers.",
144 array(
145 'name' => "raw_output",
146 'type' => Boolean,
147 'value' => "false",
148 'desc' => "When set to TRUE, outputs raw binary data. FALSE outputs lowercase hexits.",
151 'taint_observer' => array(
152 'set_mask' => "TAINT_BIT_MUTATED",
153 'clear_mask' => "TAINT_BIT_NONE",
157 DefineFunction(
158 array(
159 'name' => "hash_final",
160 'flags' => HasDocComment,
161 'return' => array(
162 'type' => String,
163 'desc' => "Returns a string containing the calculated message digest as lowercase hexits unless raw_output is set to true in which case the raw binary representation of the message digest is returned.",
165 'args' => array(
166 array(
167 'name' => "context",
168 'type' => Resource,
169 'desc' => "Hashing context returned by hash_init().",
171 array(
172 'name' => "raw_output",
173 'type' => Boolean,
174 'value' => "false",
175 'desc' => "When set to TRUE, outputs raw binary data. FALSE outputs lowercase hexits.",
178 'taint_observer' => array(
179 'set_mask' => "TAINT_BIT_MUTATED",
180 'clear_mask' => "TAINT_BIT_NONE",
184 DefineFunction(
185 array(
186 'name' => "hash_hmac_file",
187 'flags' => HasDocComment,
188 'return' => array(
189 'type' => Variant,
190 'desc' => "Returns a string containing the calculated message digest as lowercase hexits unless raw_output is set to true in which case the raw binary representation of the message digest is returned.",
192 'args' => array(
193 array(
194 'name' => "algo",
195 'type' => String,
196 'desc' => "Name of selected hashing algorithm (i.e. \"md5\", \"sha256\", \"haval160,4\", etc..) See hash_algos() for a list of supported algorithms.",
198 array(
199 'name' => "filename",
200 'type' => String,
201 'desc' => "URL describing location of file to be hashed; Supports fopen wrappers.",
203 array(
204 'name' => "key",
205 'type' => String,
206 'desc' => "Shared secret key used for generating the HMAC variant of the message digest.",
208 array(
209 'name' => "raw_output",
210 'type' => Boolean,
211 'value' => "false",
212 'desc' => "When set to TRUE, outputs raw binary data. FALSE outputs lowercase hexits.",
215 'taint_observer' => array(
216 'set_mask' => "TAINT_BIT_MUTATED",
217 'clear_mask' => "TAINT_BIT_NONE",
221 DefineFunction(
222 array(
223 'name' => "hash_hmac",
224 'flags' => HasDocComment,
225 'return' => array(
226 'type' => Variant,
227 'desc' => "Returns a string containing the calculated message digest as lowercase hexits unless raw_output is set to true in which case the raw binary representation of the message digest is returned.",
229 'args' => array(
230 array(
231 'name' => "algo",
232 'type' => String,
233 'desc' => "Name of selected hashing algorithm (i.e. \"md5\", \"sha256\", \"haval160,4\", etc..) See hash_algos() for a list of supported algorithms.",
235 array(
236 'name' => "data",
237 'type' => String,
238 'desc' => "Message to be hashed.",
240 array(
241 'name' => "key",
242 'type' => String,
243 'desc' => "Shared secret key used for generating the HMAC variant of the message digest.",
245 array(
246 'name' => "raw_output",
247 'type' => Boolean,
248 'value' => "false",
249 'desc' => "When set to TRUE, outputs raw binary data. FALSE outputs lowercase hexits.",
252 'taint_observer' => array(
253 'set_mask' => "TAINT_BIT_MUTATED",
254 'clear_mask' => "TAINT_BIT_NONE",
258 DefineFunction(
259 array(
260 'name' => "hash_update_file",
261 'flags' => HasDocComment,
262 'return' => array(
263 'type' => Boolean,
264 'desc' => "Returns TRUE on success or FALSE on failure.",
266 'args' => array(
267 array(
268 'name' => "init_context",
269 'type' => Resource,
270 'desc' => "Hashing context returned by hash_init().",
272 array(
273 'name' => "filename",
274 'type' => String,
275 'desc' => "URL describing location of file to be hashed; Supports fopen wrappers.",
277 array(
278 'name' => "stream_context",
279 'type' => Resource,
280 'value' => "null",
281 'desc' => "Stream context as returned by stream_context_create().",
284 'taint_observer' => false,
287 DefineFunction(
288 array(
289 'name' => "hash_update_stream",
290 'flags' => HasDocComment,
291 'return' => array(
292 'type' => Int64,
293 'desc' => "Actual number of bytes added to the hashing context from handle.",
295 'args' => array(
296 array(
297 'name' => "context",
298 'type' => Resource,
299 'desc' => "Hashing context returned by hash_init().",
301 array(
302 'name' => "handle",
303 'type' => Resource,
304 'desc' => "Open file handle as returned by any stream creation function.",
306 array(
307 'name' => "length",
308 'type' => Int32,
309 'value' => "-1",
310 'desc' => "Maximum number of characters to copy from handle into the hashing context.",
313 'taint_observer' => false,
316 DefineFunction(
317 array(
318 'name' => "hash_update",
319 'flags' => HasDocComment,
320 'return' => array(
321 'type' => Boolean,
322 'desc' => "Returns TRUE.",
324 'args' => array(
325 array(
326 'name' => "context",
327 'type' => Resource,
328 'desc' => "Hashing context returned by hash_init().",
330 array(
331 'name' => "data",
332 'type' => String,
333 'desc' => "Message to be included in the hash digest.",
336 'taint_observer' => false,
340 DefineFunction(
341 array(
342 'name' => "furchash_hphp_ext",
343 'flags' => HasDocComment,
344 'return' => array(
345 'type' => Int64,
346 'desc' => "Returns a number in the range of 0-(nPart-1)",
348 'args' => array(
349 array(
350 'name' => "key",
351 'type' => String,
352 'desc' => "The key to hash",
354 array(
355 'name' => "len",
356 'type' => Int32,
357 'desc' => "Number of bytes to use from the hash",
359 array(
360 'name' => "nPart",
361 'type' => Int32,
362 'desc' => "The number of buckets",
365 'taint_observer' => false,
368 DefineFunction(
369 array(
370 'name' => "furchash_hphp_ext_supported",
371 'flags' => HasDocComment,
372 'return' => array(
373 'type' => Boolean,
374 'desc' => "Returns whether furchash extension is supported",
376 'args' => array(
378 'taint_observer' => false,
381 DefineFunction(
382 array(
383 'name' => "hphp_murmurhash",
384 'flags' => HasDocComment,
385 'return' => array(
386 'type' => Int64,
387 'desc' => "Returns the Int64 hash of the first len input characters",
389 'args' => array(
390 array(
391 'name' => "key",
392 'type' => String,
393 'desc' => "The key to hash",
395 array(
396 'name' => "len",
397 'type' => Int32,
398 'desc' => "Number of bytes to use from the hash",
400 array(
401 'name' => "seed",
402 'type' => Int32,
403 'desc' => "The seed to use for hashing",
406 'taint_observer' => false,
409 ///////////////////////////////////////////////////////////////////////////////
410 // Classes
412 // BeginClass
413 // array (
414 // 'name' => name of the class
415 // 'desc' => description of the class's purpose
416 // 'flags' => attributes of the class, see base.php for possible values
417 // 'note' => additional note about this class's schema
418 // 'parent' => parent class name, if any
419 // 'ifaces' => array of interfaces tihs class implements
420 // 'bases' => extra internal and special base classes this class requires
421 // 'footer' => extra C++ inserted at end of class declaration
422 // )
424 // DefineConstant(..)
425 // DefineConstant(..)
426 // ...
427 // DefineFunction(..)
428 // DefineFunction(..)
429 // ...
430 // DefineProperty
431 // DefineProperty
433 // array (
434 // 'name' => name of the property
435 // 'type' => type of the property
436 // 'flags' => attributes of the property
437 // 'desc' => description of the property
438 // 'note' => additional note about this property's schema
439 // )
441 // EndClass()