Branch: Tag:

2016-08-06

2016-08-06 17:12:12 by Henrik Grubbström (Grubba) <grubba@grubba.org>

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