Use a seperate section for each nested struct member in INIT macro

This commit is contained in:
Martin Willi
2010-08-18 12:15:03 +02:00
parent 53115857ae
commit ba31fe1fd6
77 changed files with 615 additions and 448 deletions
@@ -177,14 +177,16 @@ padlock_aes_crypter_t *padlock_aes_crypter_create(encryption_algorithm_t algo,
}
INIT(this,
.public.crypter = {
.encrypt = _encrypt,
.decrypt = _decrypt,
.get_block_size = _get_block_size,
.get_iv_size = _get_iv_size,
.get_key_size = _get_key_size,
.set_key = _set_key,
.destroy = _destroy,
.public = {
.crypter = {
.encrypt = _encrypt,
.decrypt = _decrypt,
.get_block_size = _get_block_size,
.get_iv_size = _get_iv_size,
.get_key_size = _get_key_size,
.set_key = _set_key,
.destroy = _destroy,
},
},
.key = chunk_alloc(key_size),
);
@@ -134,7 +134,11 @@ plugin_t *padlock_plugin_create()
private_padlock_plugin_t *this;
INIT(this,
.public.plugin.destroy = _destroy,
.public = {
.plugin = {
.destroy = _destroy,
},
},
.features = get_padlock_features(),
);
@@ -104,10 +104,12 @@ padlock_rng_t *padlock_rng_create(rng_quality_t quality)
private_padlock_rng_t *this;
INIT(this,
.public.rng = {
.get_bytes = _get_bytes,
.allocate_bytes = _allocate_bytes,
.destroy = _destroy,
.public = {
.rng = {
.get_bytes = _get_bytes,
.allocate_bytes = _allocate_bytes,
.destroy = _destroy,
},
},
);
@@ -150,12 +150,14 @@ padlock_sha1_hasher_t *padlock_sha1_hasher_create(hash_algorithm_t algo)
return NULL;
}
INIT(this,
.public.hasher = {
.get_hash = _get_hash,
.allocate_hash = _allocate_hash,
.get_hash_size = _get_hash_size,
.reset = _reset,
.destroy = _destroy,
.public = {
.hasher = {
.get_hash = _get_hash,
.allocate_hash = _allocate_hash,
.get_hash_size = _get_hash_size,
.reset = _reset,
.destroy = _destroy,
},
},
);
return &this->public;