Reduce dependencies on crypto.h by moving the opaque definition of

CRYPTO_EX_DATA and the new/free/dup callback prototypes to ossl_typ.h.
This commit is contained in:
Geoff Thorpe 2004-05-17 18:39:00 +00:00
parent 678c1e025b
commit 210a21bc8d
2 changed files with 26 additions and 12 deletions

View file

@ -128,6 +128,7 @@
#include <openssl/stack.h>
#include <openssl/safestack.h>
#include <openssl/opensslv.h>
#include <openssl/ossl_typ.h>
#ifdef CHARSET_EBCDIC
#include <openssl/ebcdic.h>
@ -152,6 +153,20 @@ extern "C" {
#define SSLEAY_PLATFORM 4
#define SSLEAY_DIR 5
/* Already declared in ossl_typ.h */
#if 0
typedef struct crypto_ex_data_st CRYPTO_EX_DATA;
/* Called when a new object is created */
typedef int CRYPTO_EX_new(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
int idx, long argl, void *argp);
/* Called when an object is free()ed */
typedef void CRYPTO_EX_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
int idx, long argl, void *argp);
/* Called when we need to dup an object */
typedef int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d,
int idx, long argl, void *argp);
#endif
/* A generic structure to pass assorted data in a expandable way */
typedef struct openssl_item_st
{
@ -265,21 +280,11 @@ typedef struct
/* predec of the BIO type */
typedef struct bio_st BIO_dummy;
typedef struct crypto_ex_data_st
struct crypto_ex_data_st
{
STACK *sk;
int dummy; /* gcc is screwing up this data structure :-( */
} CRYPTO_EX_DATA;
/* Called when a new object is created */
typedef int CRYPTO_EX_new(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
int idx, long argl, void *argp);
/* Called when an object is free()ed */
typedef void CRYPTO_EX_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
int idx, long argl, void *argp);
/* Called when we need to dup an object */
typedef int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d,
int idx, long argl, void *argp);
};
/* This stuff is basically class callback functions
* The current classes are SSL_CTX, SSL, SSL_SESSION, and a few more */

View file

@ -162,4 +162,13 @@ typedef struct X509_POLICY_CACHE_st X509_POLICY_CACHE;
#define DECLARE_PKCS12_STACK_OF(type) /* Nothing */
#define IMPLEMENT_PKCS12_STACK_OF(type) /* Nothing */
typedef struct crypto_ex_data_st CRYPTO_EX_DATA;
/* Callback types for crypto.h */
typedef int CRYPTO_EX_new(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
int idx, long argl, void *argp);
typedef void CRYPTO_EX_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
int idx, long argl, void *argp);
typedef int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d,
int idx, long argl, void *argp);
#endif /* def HEADER_OPENSSL_TYPES_H */