Also updated the corresponding documentations.
Fixes #20710
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20745)
=head1 NAME
-OSSL_DISPATCH - OpenSSL Core type to define a dispatchable function table
+OSSL_DISPATCH, OSSL_DISPATCH_END - OpenSSL Core type to define a dispatchable function table
=head1 SYNOPSIS
void (*function)(void);
};
+ #define OSSL_DISPATCH_END
+
=head1 DESCRIPTION
This type is a tuple of function identity and function pointer.
Arrays of this type are passed between the OpenSSL libraries and the
providers to describe what functionality one side provides to the other.
-Arrays of this type must be terminated with a tuple having function identity
-zero and function pointer NULL.
+Arrays of this type must be terminated with the OSSL_DISPATCH_END macro.
=head2 B<OSSL_DISPATCH> fields
static const OSSL_ITEM reasons[] = {
{ E_MALLOC, "memory allocation failure" }.
- { 0, NULL } /* Termination */
+ OSSL_DISPATCH_END
};
/*
{ OSSL_FUNC_BAR_INIT, (void (*)(void))foo_init },
{ OSSL_FUNC_BAR_UPDATE, (void (*)(void))foo_update },
{ OSSL_FUNC_BAR_FINAL, (void (*)(void))foo_final },
- { 0, NULL }
+ OSSL_DISPATCH_END
};
static const OSSL_ALGORITHM bars[] = {
{ OSSL_FUNC_PROVIDER_TEARDOWN, (void (*)(void))p_teardown },
{ OSSL_FUNC_PROVIDER_QUERY_OPERATION, (void (*)(void))p_query },
{ OSSL_FUNC_PROVIDER_GET_REASON_STRINGS, (void (*)(void))p_reasons },
- { 0, NULL }
+ OSSL_DISPATCH_END
};
int OSSL_provider_init(const OSSL_CORE_HANDLE *handle,
void (*function)(void);
};
+# define OSSL_DISPATCH_END \
+ { 0, NULL }
+
/*
* Other items, essentially an int<->pointer map element.
*
OSSL_PARAM_utf8_string define
OSSL_PARAM_get_TYPE generic
OSSL_PARAM_END define
+OSSL_DISPATCH_END define
OSSL_PARAM_set_TYPE generic
OSSL_ENCODER_PUBKEY_TO_DER_PQ define
OSSL_ENCODER_PrivateKey_TO_DER_PQ define