pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:2257:   #ifdef __NT__   #include <wincrypt.h>   static HCRYPTPROV crypto_handle;   #else   static int random_fd = -1;   #endif   PIKECLASS RandomSystem   {    INHERIT RandomInterface;    -  PIKEFUN string(8bit) random_string(int len) +  PIKEFUN string(8bit) random_string(int(0..) len)    { -  if( len<1 ) +  if( !len )    RETURN empty_pike_string; -  +  if( len<0 ) +  Pike_error("Bad argument 1 to random_string(). Expected int(0..).\n");      #ifdef __NT__    if(!crypto_handle)    {    if( !CryptAcquireContext(&crypto_handle, 0, 0, PROV_RSA_FULL,    CRYPT_VERIFYCONTEXT|CRYPT_SILENT) )    Pike_error("Failed to set up Crypto Service.\n");    }       struct pike_string *ret = begin_shared_string(len);