Files
harbour-core/harbour/contrib/hbssl/rand.c
Viktor Szakats cc375dfc00 2009-07-22 11:48 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* contrib/xhb/xhbfunc.c
    + Added HB_F_EOF() xhb compatibility function.

  * contrib/hbssl/Makefile
  - contrib/hbssl/sslx509.c
  + contrib/hbssl/x509.c
  - contrib/hbssl/sslrand.c
  + contrib/hbssl/rand.c
  - contrib/hbssl/sslbio.c
  + contrib/hbssl/bio.c
  - contrib/hbssl/sslerr.c
  + contrib/hbssl/err.c
    * Renamed a few source files.
    * SSL_RAND_*() functions renamed to RAND_*() to have
      the exact same name as in OpenSSL.
  * contrib/hbssl/tests/test.prg

  * contrib/hbssl/Makefile
  * contrib/hbssl/bio.c
  + contrib/hbssl/tests/bio.prg
  * contrib/hbssl/hbssl.ch
    + Added lots of new BIO functions:
      BIO_NEW()
      BIO_SET()
      BIO_CLEAR_FLAGS()
      BIO_SET_FLAGS()
      BIO_GET_FLAGS()
      BIO_TEST_FLAGS()
      BIO_SET_FD()
      BIO_GET_FD()
      BIO_GET_RETRY_REASON()
      BIO_SET_RETRY_SPECIAL()
      BIO_SET_RETRY_READ()
      BIO_SET_RETRY_WRITE()
      BIO_SHOULD_READ()
      BIO_SHOULD_WRITE()
      BIO_SHOULD_IO_SPECIAL()
      BIO_RETRY_TYPE()
      BIO_SHOULD_RETRY()
      BIO_CTRL_PENDING()
      BIO_CTRL_WPENDING()
      BIO_FLUSH()
      BIO_SEEK()
      BIO_TELL()
      BIO_RESET()
      BIO_EOF()
      BIO_SET_CLOSE()
      BIO_GET_CLOSE()
      BIO_NEW_FILE()
      BIO_NEW_MEM_BUF()
      BIO_READ()
      BIO_GETS()
      BIO_WRITE()
      BIO_PUTS()
      BIO_VFREE()
      BIO_FREE_ALL()
      BIO_NEW_CONNECT()
      BIO_NEW_ACCEPT()
      BIO_SET_CONN_HOSTNAME()
      BIO_SET_CONN_PORT()
      BIO_SET_CONN_INT_PORT()
      BIO_SET_CONN_IP()
      BIO_GET_CONN_HOSTNAME()
      BIO_GET_CONN_PORT()
      BIO_GET_CONN_IP()
      BIO_GET_CONN_INT_PORT()
      BIO_SET_NBIO()
      BIO_DO_CONNECT()
      ERR_LOAD_BIO_STRINGS()
2009-07-22 09:48:44 +00:00

88 lines
2.8 KiB
C

/*
* $Id$
*/
/*
* Harbour Project source code:
* OpenSSL API (RAND) - Harbour interface.
*
* Copyright 2009 Viktor Szakats (harbour.01 syenar.hu)
* www - http://www.harbour-project.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
*
* As a special exception, the Harbour Project gives permission for
* additional uses of the text contained in its release of Harbour.
*
* The exception is that, if you link the Harbour libraries with other
* files to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the Harbour library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the Harbour
* Project under the name Harbour. If you copy code from other
* Harbour Project or Free Software Foundation releases into a copy of
* Harbour, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for Harbour, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*
*/
#include "hbapi.h"
#include "hbapierr.h"
#include <openssl/rand.h>
HB_FUNC( RAND_SEED )
{
RAND_seed( hb_parcx( 1 ), hb_parclen( 1 ) );
}
HB_FUNC( RAND_ADD )
{
RAND_add( hb_parcx( 1 ), hb_parclen( 1 ), hb_parnd( 2 ) );
}
HB_FUNC( RAND_STATUS )
{
hb_retni( RAND_status() );
}
HB_FUNC( RAND_EVENT )
{
#if defined( HB_OS_WIN ) && ! defined( __CYGWIN__ )
hb_retni( RAND_event( hb_parni( 1 ), ( WPARAM ) hb_parnint( 2 ), ( LPARAM ) hb_parnint( 3 ) ) );
#else
hb_retni( 0 );
#endif
}
HB_FUNC( RAND_SCREEN )
{
#if defined( HB_OS_WIN ) && ! defined( __CYGWIN__ )
RAND_screen();
#endif
}