typedef void (*crypt_func_init_t) (void);
-/*
- A structure to keep all crypto module fucntions together.
- */
-typedef struct crypt_module_functions {
+typedef struct crypt_module_specs {
/* Common/General functions. */
crypt_func_init_t init;
crypt_func_decrypt_mime_t decrypt_mime;
crypt_func_smime_verify_sender_t smime_verify_sender;
crypt_func_smime_build_smime_entity_t smime_build_smime_entity;
crypt_func_smime_invoke_import_t smime_invoke_import;
-} crypt_module_functions_t;
-
-
-/*
- A structure to decribe a crypto module.
- */
-typedef struct crypt_module_specs {
- int identifier; /* Identifying bit. */
- crypt_module_functions_t functions;
-} *crypt_module_specs_t;
-
-
-
-/*
- High Level crypto module interface.
- */
+} crypt_module_specs_t;
-void crypto_module_register (crypt_module_specs_t specs);
-crypt_module_specs_t crypto_module_lookup (int identifier);
+struct crypt_module_specs crypt_mod_SMIME_gpgme;
+struct crypt_module_specs crypt_mod_PGP_gpgme;
-/* If the crypto module identifier by IDENTIFIER has been registered,
- call its function FUNC. Do nothing else. This may be used as an
- expression. */
#define CRYPT_MOD_CALL_CHECK(identifier, func) \
- (crypto_module_lookup (APPLICATION_ ## identifier) \
- && (crypto_module_lookup (APPLICATION_ ## identifier))->functions.func)
+ ((crypt_mod_##identifier##_gpgme).func)
-/* Call the function FUNC in the crypto module identified by
- IDENTIFIER. This may be used as an expression. */
#define CRYPT_MOD_CALL(identifier, func) \
- *(crypto_module_lookup (APPLICATION_ ## identifier))->functions.func
+ (*((crypt_mod_##identifier##_gpgme).func))
#endif