Reduce header interdependencies, initially in engine.h (the rest of the
[openssl.git] / crypto / rand / rand.h
index 30e39c3545737e7a28f081be2de00ce784561141..6f544994ce2ed3a31cac921a2ff5632daad28248 100644 (file)
 #define HEADER_RAND_H
 
 #include <stdlib.h>
-#include <openssl/types.h>
+#include <openssl/ossl_typ.h>
+#include <openssl/e_os2.h>
+
+#if defined(OPENSSL_SYS_WINDOWS)
+#include <windows.h>
+#endif
 
 #ifdef  __cplusplus
 extern "C" {
 #endif
 
-typedef struct rand_meth_st
+/* Already defined in ossl_typ.h */
+/* typedef struct rand_meth_st RAND_METHOD; */
+
+struct rand_meth_st
        {
        void (*seed)(const void *buf, int num);
        int (*bytes)(unsigned char *buf, int num);
@@ -74,7 +82,7 @@ typedef struct rand_meth_st
        void (*add)(const void *buf, int num, double entropy);
        int (*pseudorand)(unsigned char *buf, int num);
        int (*status)(void);
-       } RAND_METHOD;
+       };
 
 #ifdef BN_DEBUG
 extern int rand_predictable;
@@ -82,7 +90,9 @@ extern int rand_predictable;
 
 int RAND_set_rand_method(const RAND_METHOD *meth);
 const RAND_METHOD *RAND_get_rand_method(void);
+#ifndef OPENSSL_NO_ENGINE
 int RAND_set_rand_engine(ENGINE *engine);
+#endif
 RAND_METHOD *RAND_SSLeay(void);
 void RAND_cleanup(void );
 int  RAND_bytes(unsigned char *buf,int num);