pike.git/
src/
builtin.cmod
Branch:
Tag:
Non-build tags
All tags
No tags
2016-08-06
2016-08-06 17:12:12 by Henrik Grubbström (Grubba) <grubba@grubba.org>
8b2734f16ccaa78952cbaf1a4019e644d61b2c86 (
27
lines) (+
27
/-
0
)
[
Show
|
Annotate
]
Branch:
8.1
Documented some of the new Randomness subsystem.
2077:
push_int(0); }
+
/*! @class RandomInterface
+
*/
PIKECLASS RandomInterface { CVAR UINT64 int_buffer;
2088:
THIS->buffer_bits = 0; }
+
/*! @decl string(8bit) random_string(int(0..))
+
*!
+
*! Prototype for the randomness generating function.
+
*!
+
*! Override this symbol to implement a useable class.
+
*/
PIKEFUN string(8bit) random_string(int(0..)) prototype; {}
2236:
apply_low(o, f, 2); } }
+
/*! @endclass
+
*/
/** * Generates a random string of length len, using the current
2260:
#else static int random_fd = -1; #endif
+
/*! @class RandomSystem
+
*/
PIKECLASS RandomSystem {
-
+
/*! @decl inherit RandomInterface
+
*/
INHERIT RandomInterface;
-
+
/*! @decl string(8bit) random_string(int(0..) len)
+
*!
+
*! Return a string of random data from the system randomness pool.
+
*!
+
*! On POSIX platforms this reads random data from @tt{/dev/urandom@}
+
*! on other platforms it may use other methods.
+
*!
+
*! @throws
+
*! May throw errors on unexpected state.
+
*/
PIKEFUN string(8bit) random_string(int(0..) len) { if( !len )
2315:
RETURN end_shared_string(ret); } }
+
/*! @endclass
+
*/
#if defined(HAVE_SETENV) && defined(HAVE_UNSETENV) #define USE_SETENV